@treasuredata/tdx 2026.4.14 → 2026.4.15

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_0x1978f8=a54_0x238d;(function(_0x59c905,_0x5ed708){const _0x2f4db2=a54_0x238d,_0x49b38a=_0x59c905();while(!![]){try{const _0x232584=-parseInt(_0x2f4db2(0x159))/0x1+parseInt(_0x2f4db2(0x30a))/0x2*(-parseInt(_0x2f4db2(0x29e))/0x3)+-parseInt(_0x2f4db2(0x176))/0x4*(parseInt(_0x2f4db2(0x1a7))/0x5)+parseInt(_0x2f4db2(0x290))/0x6+-parseInt(_0x2f4db2(0x186))/0x7+parseInt(_0x2f4db2(0x192))/0x8+parseInt(_0x2f4db2(0x25c))/0x9;if(_0x232584===_0x5ed708)break;else _0x49b38a['push'](_0x49b38a['shift']());}catch(_0x161915){_0x49b38a['push'](_0x49b38a['shift']());}}}(a54_0x4909,0x65f3c));import a54_0x4dcb08 from'chalk';import{existsSync}from'fs';import a54_0x331f20 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';function a54_0x238d(_0x73c11a,_0x1921e4){_0x73c11a=_0x73c11a-0x150;const _0x49093c=a54_0x4909();let _0x238d7e=_0x49093c[_0x73c11a];return _0x238d7e;}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_0x51a435 from'prompts';function getAttemptStatusDisplay(_0x135ab4){const _0x545e7c=a54_0x238d;if(!_0x135ab4)return{'icon':'⏳','text':''};const {done:_0x5de673,success:_0x45931c,cancelRequested:_0x2e4339}=_0x135ab4;if(!_0x5de673)return _0x2e4339?{'icon':'🛑','text':a54_0x4dcb08['yellow'](_0x545e7c(0x2d3))}:{'icon':'🔄','text':a54_0x4dcb08[_0x545e7c(0x15f)](_0x545e7c(0x20a))};if(_0x45931c)return{'icon':'✅','text':a54_0x4dcb08[_0x545e7c(0x2ac)](_0x545e7c(0x1e7))};return{'icon':'❌','text':a54_0x4dcb08['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x1978f8(0x27e)](_0x563db8,_0x168966,_0x56e9bf=0x0){return _0x563db8[_0x56e9bf]||_0x168966['workflowProject'];}[a54_0x1978f8(0x22c)](_0x4b5cc6,_0x140c17,_0x22e6d6=0x0){const _0x583299=a54_0x1978f8,_0x172e7c=this['resolveProject'](_0x4b5cc6,_0x140c17,_0x22e6d6);if(!_0x172e7c)return console[_0x583299(0x1a6)](a54_0x4dcb08[_0x583299(0x236)](_0x583299(0x2a4)),_0x583299(0x249)),console[_0x583299(0x1a6)](a54_0x4dcb08['dim'](_0x583299(0x166))),null;return _0x172e7c;}[a54_0x1978f8(0x1c5)](_0x1f3b9b,_0x1f0552){const _0x2ba321=a54_0x1978f8;if(_0x1f3b9b[0x0]){const _0x1b4a7a=_0x1f3b9b[0x0]['split']('.');if(_0x1b4a7a[_0x2ba321(0x1d5)]===0x1)return{'projectName':_0x1b4a7a[0x0],'workflowName':undefined};else return _0x1b4a7a[_0x2ba321(0x1d5)]===0x2?{'projectName':_0x1b4a7a[0x0],'workflowName':_0x1b4a7a[0x1]}:(console[_0x2ba321(0x1a6)](a54_0x4dcb08[_0x2ba321(0x236)](_0x2ba321(0x2a4)),_0x2ba321(0x269)),null);}return{'projectName':_0x1f0552['workflowProject'],'workflowName':undefined};}['resolveProjectDir'](_0x21a9dc,_0x174ddf,_0x3cbc14=0x0){const _0x3a41a4=a54_0x1978f8;if(_0x21a9dc[_0x3cbc14])return _0x21a9dc[_0x3cbc14];if(_0x174ddf[_0x3a41a4(0x28a)]){const _0xa8d5b8=a54_0x331f20[_0x3a41a4(0x302)](process[_0x3a41a4(0x2c1)](),_0x3a41a4(0x2aa),_0x174ddf[_0x3a41a4(0x28a)]);if(existsSync(a54_0x331f20['join'](_0xa8d5b8,_0x3a41a4(0x247))))return _0xa8d5b8;}return undefined;}async[a54_0x1978f8(0x23b)](_0x17bc6d,_0x6d407,_0x1e2135){const _0x83cc5=a54_0x1978f8;try{const _0x536585=await _0x17bc6d[_0x83cc5(0x1ef)][_0x83cc5(0x2aa)](_0x6d407,{'limit':0x1});if(_0x536585[_0x83cc5(0x1d5)]>0x0){const _0x489c70=_0x536585[0x0]['id'],_0x2a06b5=getWorkflowUrl(_0x1e2135,_0x489c70);console['error'](_0x83cc5(0x252)+a54_0x4dcb08[_0x83cc5(0x30f)](_0x2a06b5));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x2fd);async[a54_0x1978f8(0x1bd)](_0x1aab24){const _0x3d5526=a54_0x1978f8,{options:_0x595fba,args:_0x55c984,tdx:_0x3638d3}=_0x1aab24,_0x4bf5fd=_0x55c984[0x0],_0x33455a=_0x595fba[_0x3d5526(0x2df)];if(_0x33455a)return saveSessionContext({'workflow_project':undefined},_0x595fba[_0x3d5526(0x2ed)]),console[_0x3d5526(0x2e8)](a54_0x4dcb08[_0x3d5526(0x2ac)](_0x3d5526(0x178))),0x0;if(!_0x4bf5fd)return console[_0x3d5526(0x1a6)](a54_0x4dcb08[_0x3d5526(0x236)](_0x3d5526(0x2a4)),_0x3d5526(0x249)),console[_0x3d5526(0x1a6)](a54_0x4dcb08[_0x3d5526(0x24d)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x3d5526(0x1a6)](a54_0x4dcb08[_0x3d5526(0x24d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x289bd5=await withSpinner(_0x3d5526(0x2de)+_0x4bf5fd+_0x3d5526(0x17c),()=>_0x3638d3[_0x3d5526(0x1ef)][_0x3d5526(0x1ec)](_0x4bf5fd),{'verbose':_0x595fba[_0x3d5526(0x156)]}),{name:_0x1dc422}=_0x289bd5[_0x3d5526(0x297)];return saveSessionContext({'workflow_project':_0x1dc422},_0x595fba['session']),console[_0x3d5526(0x2e8)](a54_0x4dcb08[_0x3d5526(0x2ac)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x4dcb08['cyan'](_0x1dc422))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x1978f8(0x1d7);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x1dd);async[a54_0x1978f8(0x1bd)](_0x2cc16b){const _0x54933f=a54_0x1978f8,{options:_0x3580bd,args:_0x5eed1a,tdx:_0x26d2c9}=_0x2cc16b,_0x40481f=_0x5eed1a[0x0];_0x3580bd[_0x54933f(0x156)]&&_0x40481f&&console[_0x54933f(0x1a6)]('Pattern:\x20'+_0x40481f);const _0x17def0=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x26d2c9['workflow'][_0x54933f(0x270)](_0x40481f,{'limit':_0x3580bd[_0x54933f(0x214)]}),{'verbose':_0x3580bd[_0x54933f(0x156)]});let _0x2f9078=_0x17def0[_0x54933f(0x297)];_0x2f9078[_0x54933f(0x23d)]((_0x451bb0,_0x2b04f2)=>_0x451bb0[_0x54933f(0x273)][_0x54933f(0x165)](_0x2b04f2[_0x54933f(0x273)]));const _0x440e5f=_0x3580bd[_0x54933f(0x214)]||0x64,_0x414009=_0x2f9078['length']>=_0x440e5f?a54_0x4dcb08[_0x54933f(0x24d)](_0x54933f(0x218)):'';console[_0x54933f(0x1a6)](_0x54933f(0x29a)+_0x2f9078[_0x54933f(0x1d5)]+'\x20project'+(_0x2f9078['length']!==0x1?'s':'')+_0x414009);if(_0x3580bd['format']===_0x54933f(0x169)||_0x3580bd[_0x54933f(0x1a8)]===_0x54933f(0x1c6)||_0x3580bd[_0x54933f(0x1a8)]===_0x54933f(0x1d3))await handleSDKOutput(_0x2f9078,_0x3580bd);else{if(_0x2f9078['length']===0x0)_0x40481f?console['log'](_0x54933f(0x234)+_0x40481f):console[_0x54933f(0x2e8)](_0x54933f(0x25a));else{const _0x50a34d=_0x2f9078[_0x54933f(0x1f0)](_0x2b6539=>{const _0x28e436=_0x54933f,_0x4e8689=_0x2b6539['metadata']?.[_0x28e436(0x2e2)](_0xafc427=>_0xafc427[_0x28e436(0x152)]===_0x28e436(0x277)),_0x35e50f=_0x4e8689?a54_0x4dcb08[_0x28e436(0x24d)](_0x28e436(0x24b)):'';return _0x28e436(0x220)+_0x2b6539[_0x28e436(0x273)]+_0x35e50f;});await writeOutput(_0x50a34d['join']('\x0a'),_0x3580bd[_0x54933f(0x1b8)],_0x54933f(0x256));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x223);[a54_0x1978f8(0x19b)]='List\x20workflows';async[a54_0x1978f8(0x1bd)](_0x23f7da){const _0x5f4653=a54_0x1978f8,{options:_0x30d4c2,args:_0x3624f5,tdx:_0x510749}=_0x23f7da,_0x3f6574=this[_0x5f4653(0x27e)](_0x3624f5,_0x30d4c2);_0x30d4c2[_0x5f4653(0x156)]&&_0x3f6574&&console[_0x5f4653(0x1a6)]('Project\x20filter:\x20'+_0x3f6574);const _0x231426=await withSpinner(_0x5f4653(0x20b),()=>_0x510749[_0x5f4653(0x1ef)][_0x5f4653(0x2aa)](_0x3f6574,{'limit':_0x30d4c2[_0x5f4653(0x214)]}),{'verbose':_0x30d4c2[_0x5f4653(0x156)]});let _0x226d2c=_0x231426[_0x5f4653(0x297)];_0x226d2c['sort']((_0x5688ca,_0x24f8cb)=>{const _0x260c23=_0x5f4653,_0x34a2bb=_0x5688ca['name'][_0x260c23(0x165)](_0x24f8cb[_0x260c23(0x273)]);if(_0x34a2bb!==0x0)return _0x34a2bb;return(_0x5688ca[_0x260c23(0x301)]?.[_0x260c23(0x273)]||'')[_0x260c23(0x165)](_0x24f8cb[_0x260c23(0x301)]?.[_0x260c23(0x273)]||'');});const _0x4fc1e8=_0x30d4c2[_0x5f4653(0x214)]||0x64,_0x68f169=_0x226d2c[_0x5f4653(0x1d5)]>=_0x4fc1e8?a54_0x4dcb08[_0x5f4653(0x24d)](_0x5f4653(0x218)):'';console[_0x5f4653(0x1a6)](_0x5f4653(0x29a)+_0x226d2c[_0x5f4653(0x1d5)]+_0x5f4653(0x1e9)+(_0x226d2c[_0x5f4653(0x1d5)]!==0x1?'s':'')+_0x68f169);if(_0x30d4c2[_0x5f4653(0x1a8)]===_0x5f4653(0x169)||_0x30d4c2[_0x5f4653(0x1a8)]===_0x5f4653(0x1c6)||_0x30d4c2[_0x5f4653(0x1a8)]===_0x5f4653(0x1d3))await handleSDKOutput(_0x226d2c,_0x30d4c2);else{if(_0x226d2c[_0x5f4653(0x1d5)]===0x0)_0x3f6574?console[_0x5f4653(0x2e8)](_0x5f4653(0x1b4)+_0x3f6574):console[_0x5f4653(0x2e8)]('No\x20workflows\x20found');else{const _0xb28657=_0x30d4c2['site'],_0x4973bb=_0x226d2c[_0x5f4653(0x1f0)](_0x2e904f=>{const _0x4a745b=_0x5f4653,_0x505e37=a54_0x4dcb08[_0x4a745b(0x24d)]('#'+_0x2e904f['id']),_0x5544f9=hyperlink(_0x505e37,getWorkflowUrl(_0xb28657,_0x2e904f['id'])),_0x4dbe56=_0x2e904f['project']?.['name']?a54_0x4dcb08['dim']('\x20('+_0x2e904f[_0x4a745b(0x301)][_0x4a745b(0x273)]+')'):'';return _0x4a745b(0x1e3)+_0x5544f9+'\x20'+_0x2e904f['name']+_0x4dbe56;});await writeOutput(_0x4973bb['join']('\x0a'),_0x30d4c2[_0x5f4653(0x1b8)],_0x5f4653(0x256));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x280);['description']='List\x20workflow\x20execution\x20sessions';async['execute'](_0x435f52){const _0x50260f=a54_0x1978f8,{options:_0x2fea27,args:_0x3ba7e9,tdx:_0x37e352}=_0x435f52,_0x424b36=this[_0x50260f(0x1c5)](_0x3ba7e9,_0x2fea27);if(!_0x424b36)return 0x1;const {projectName:_0x2726a,workflowName:_0x28bb03}=_0x424b36;if(_0x2fea27[_0x50260f(0x156)]){if(_0x2726a&&_0x28bb03)console[_0x50260f(0x1a6)](_0x50260f(0x2a0)+_0x2726a+'.'+_0x28bb03);else _0x2726a&&console['error']('Filter:\x20project='+_0x2726a);const _0x79a548=_0x2fea27[_0x50260f(0x2bd)];_0x79a548&&console[_0x50260f(0x1a6)](_0x50260f(0x2f3)+_0x79a548);}let _0x4f3da3=0x28;if(process['stdout'][_0x50260f(0x2d6)]&&!_0x2fea27['output']&&!_0x2fea27[_0x50260f(0x1a8)]){const _0x4e6e83=process[_0x50260f(0x272)][_0x50260f(0x181)]||0x28;_0x4f3da3=Math[_0x50260f(0x29c)](0x14,Math['floor'](_0x4e6e83*0x2/0x3));}const _0x1ab67f=_0x2fea27[_0x50260f(0x214)]||_0x4f3da3,_0x6fee86=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x37e352[_0x50260f(0x1ef)][_0x50260f(0x172)]({'projectName':_0x2726a,'workflowName':_0x28bb03,'status':_0x2fea27['status'],'fromTime':_0x2fea27[_0x50260f(0x182)],'toTime':_0x2fea27['to'],'limit':_0x1ab67f}),{'verbose':_0x2fea27[_0x50260f(0x156)]}),_0x5c91cc=_0x6fee86[_0x50260f(0x297)];_0x5c91cc['sort']((_0x4b57de,_0x5653be)=>{const _0x1cb7e8=_0x50260f,_0x77d42d=_0x4b57de['sessionTime']||'',_0x23e38d=_0x5653be[_0x1cb7e8(0x1e1)]||'';return _0x23e38d[_0x1cb7e8(0x165)](_0x77d42d);});_0x5c91cc[_0x50260f(0x1d5)]>=_0x1ab67f?console[_0x50260f(0x1a6)](_0x50260f(0x2f2)+_0x5c91cc[_0x50260f(0x1d5)]+_0x50260f(0x185)+a54_0x4dcb08[_0x50260f(0x24d)](_0x50260f(0x2d8))):console[_0x50260f(0x1a6)](_0x50260f(0x29a)+_0x5c91cc[_0x50260f(0x1d5)]+_0x50260f(0x173)+(_0x5c91cc[_0x50260f(0x1d5)]!==0x1?'s':''));if(_0x2fea27['format']==='json'||_0x2fea27[_0x50260f(0x1a8)]===_0x50260f(0x1c6)||_0x2fea27[_0x50260f(0x1a8)]===_0x50260f(0x1d3))await handleSDKOutput(_0x5c91cc,_0x2fea27);else{if(!process[_0x50260f(0x272)][_0x50260f(0x2d6)]||_0x2fea27['output']){if(_0x5c91cc[_0x50260f(0x1d5)]===0x0){if(_0x2726a&&_0x28bb03)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x2726a+'.'+_0x28bb03);else _0x2726a?console[_0x50260f(0x2e8)](_0x50260f(0x1c8)+_0x2726a):console[_0x50260f(0x2e8)](_0x50260f(0x1ce));}else{const _0x23a4cb=_0x2fea27[_0x50260f(0x2e3)],_0x8363de=this[_0x50260f(0x239)](_0x5c91cc,_0x23a4cb);_0x2fea27[_0x50260f(0x1b8)]?await writeOutput(_0x8363de,_0x2fea27['output'],'list'):console['log'](_0x8363de);}!_0x2726a&&(console[_0x50260f(0x1a6)](''),console[_0x50260f(0x1a6)](a54_0x4dcb08[_0x50260f(0x24d)](_0x50260f(0x1a5))),console[_0x50260f(0x1a6)](a54_0x4dcb08[_0x50260f(0x24d)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4dcb08['dim'](_0x50260f(0x163))));}else{if(_0x5c91cc[_0x50260f(0x1d5)]===0x0){if(_0x2726a&&_0x28bb03)console[_0x50260f(0x2e8)](_0x50260f(0x312)+_0x2726a+'.'+_0x28bb03);else _0x2726a?console[_0x50260f(0x2e8)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2726a):console[_0x50260f(0x2e8)](_0x50260f(0x1ce));}else await this[_0x50260f(0x285)](_0x5c91cc,_0x435f52,_0x2726a);}}return 0x0;}[a54_0x1978f8(0x239)](_0x5c2d75,_0x2d6f4c){const _0x3b01ca=a54_0x1978f8,_0x4d7ec2=[],_0x35fc92=new Map();let _0x51acab=Infinity,_0x4c3535=-Infinity;for(const _0x4b8f7f of _0x5c2d75){if(_0x4b8f7f[_0x3b01ca(0x2e6)]?.[_0x3b01ca(0x2c7)]){const _0x11fcac=new Date(_0x4b8f7f[_0x3b01ca(0x2e6)]['createdAt'])[_0x3b01ca(0x307)](),_0x1fee07=_0x4b8f7f['lastAttempt'][_0x3b01ca(0x1de)]?new Date(_0x4b8f7f[_0x3b01ca(0x2e6)][_0x3b01ca(0x1de)])[_0x3b01ca(0x307)]():Date['now'](),_0x4c8b9c=_0x4b8f7f[_0x3b01ca(0x301)]?.['name']||_0x3b01ca(0x19e);!_0x35fc92[_0x3b01ca(0x1f6)](_0x4c8b9c)&&_0x35fc92['set'](_0x4c8b9c,[]),_0x35fc92['get'](_0x4c8b9c)[_0x3b01ca(0x198)]({'session':_0x4b8f7f,'startTime':_0x11fcac,'endTime':_0x1fee07,'duration':_0x1fee07-_0x11fcac}),_0x51acab=Math['min'](_0x51acab,_0x11fcac),_0x4c3535=Math[_0x3b01ca(0x29c)](_0x4c3535,_0x1fee07);}}if(_0x35fc92[_0x3b01ca(0x20d)]===0x0)return _0x3b01ca(0x27a);const _0x5d5991=process[_0x3b01ca(0x272)][_0x3b01ca(0x2c0)]||0x78,_0x294263=0x1e,_0x310a00=0x32,_0x5f89a0=0x4,_0x565ae6=Math[_0x3b01ca(0x264)](_0x310a00,Math[_0x3b01ca(0x29c)](_0x294263,Math[_0x3b01ca(0x18c)](_0x5d5991*0.3))),_0x4b8502=_0x5d5991-_0x565ae6-TIMELINE_CONFIG['GUTTER']-0x3-_0x5f89a0,_0xb94e56=_0x4c3535-_0x51acab,_0x9889b7=_0xb94e56/_0x565ae6,_0x5774cc=renderTimeAxis({'startTime':_0x51acab,'endTime':_0x4c3535,'durationMs':_0xb94e56,'msPerChar':_0x9889b7},_0x565ae6),_0x883e57=[];for(const _0x561275 of _0x35fc92['values']()){_0x883e57[_0x3b01ca(0x198)](..._0x561275);}_0x883e57[_0x3b01ca(0x23d)]((_0xe4e65a,_0x3ecd80)=>_0x3ecd80[_0x3b01ca(0x190)]-_0xe4e65a[_0x3b01ca(0x190)]);const _0x35863d=new Date(_0x51acab),_0x54bd0b=formatDate(_0x35863d),_0x5e20bf=_0x5f89a0+TIMELINE_CONFIG[_0x3b01ca(0x29f)]+TIMELINE_CONFIG[_0x3b01ca(0x300)]+_0x4b8502,_0x53ea08='\x20'['repeat'](_0x5e20bf-_0x54bd0b[_0x3b01ca(0x1d5)]),_0x4ac99b=_0x53ea08+a54_0x4dcb08[_0x3b01ca(0x24d)](_0x54bd0b)+'\x20'+_0x5774cc;_0x4d7ec2[_0x3b01ca(0x198)](_0x4ac99b);const _0x3fdc0b=0x16;let _0x3dc50f=0x0;for(const _0x3b0ae8 of _0x883e57){const _0x1798e9=_0x3b0ae8[_0x3b01ca(0x2ed)]['project']?.[_0x3b01ca(0x273)]||'?',_0x16cf00=Math[_0x3b01ca(0x264)](stringWidth(_0x1798e9),_0x3fdc0b);_0x3dc50f=Math[_0x3b01ca(0x29c)](_0x3dc50f,_0x16cf00);}for(const _0xbec3c of _0x883e57){const {session:_0x2b201f,startTime:_0x4c6a03,endTime:_0xc760ea,duration:_0x31fbd9}=_0xbec3c,_0xdcb6ad=_0x2b201f[_0x3b01ca(0x301)]?.['id'],_0x4cdb9d=_0x2b201f['id'],_0x398cc7=_0x2b201f[_0x3b01ca(0x301)]?.['name']||'?',_0x49fbc0=_0x2b201f[_0x3b01ca(0x1ef)]?.[_0x3b01ca(0x273)]||'?';let _0x3cb0e2,_0x1cb079;if(_0x2b201f[_0x3b01ca(0x2e6)]){const _0x12653d=_0x2b201f['lastAttempt'];!_0x12653d[_0x3b01ca(0x259)]?(_0x3cb0e2=_0x12653d[_0x3b01ca(0x1b1)]?'🛑':'🔄',_0x1cb079=_0x12653d[_0x3b01ca(0x1b1)]?a54_0x4dcb08['yellow']:a54_0x4dcb08[_0x3b01ca(0x15f)]):(_0x3cb0e2=_0x12653d[_0x3b01ca(0x1e7)]?'✅':'❌',_0x1cb079=_0x12653d[_0x3b01ca(0x1e7)]?a54_0x4dcb08['green']:a54_0x4dcb08[_0x3b01ca(0x236)]);}else _0x3cb0e2='⏳',_0x1cb079=a54_0x4dcb08[_0x3b01ca(0x24d)];const _0x26b191='#'+_0x4cdb9d,_0x4c1be9=_0xdcb6ad?hyperlink(_0x26b191,getWorkflowSessionUrl(_0x2d6f4c,_0xdcb6ad,_0x4cdb9d)):_0x26b191;let _0x4c801b=_0x398cc7;stringWidth(_0x398cc7)>_0x3fdc0b&&(_0x4c801b=_0x398cc7[_0x3b01ca(0x23a)](0x0,_0x3fdc0b-0x1)+'…');const _0x2a312c=a54_0x4dcb08[_0x3b01ca(0x24d)](_0x4c801b),_0x2e1741=stringWidth(_0x4c801b),_0x5dc7f1='\x20'[_0x3b01ca(0x28f)](_0x3dc50f-stringWidth(_0x4c801b)+0x2),_0x201f66='('+formatElapsed(_0x31fbd9)+')',_0x3a891d=stringWidth(_0x201f66),_0x49465b=stringWidth(_0x26b191),_0x1b8ca2=_0x49465b+0x1+_0x2e1741+_0x5dc7f1[_0x3b01ca(0x1d5)],_0x20ef8e=_0x4b8502-_0x1b8ca2-_0x3a891d-0x1-0x8;let _0x540f2c=_0x49fbc0;stringWidth(_0x540f2c)>_0x20ef8e&&(_0x540f2c=_0x540f2c[_0x3b01ca(0x23a)](0x0,_0x20ef8e-0x1)+'…');const _0x2fb284=_0x4c1be9+'\x20'+_0x2a312c+_0x5dc7f1+_0x540f2c,_0x3d5484=stringWidth(_0x2fb284),_0x466848=_0x4b8502-_0x3d5484-_0x3a891d,_0x5f5ce3=_0x2fb284+'\x20'[_0x3b01ca(0x28f)](Math[_0x3b01ca(0x29c)](0x1,_0x466848))+a54_0x4dcb08[_0x3b01ca(0x24d)](_0x201f66),_0x50a718=Math[_0x3b01ca(0x18c)]((_0x4c6a03-_0x51acab)/_0x9889b7),_0x4baf8b=Math[_0x3b01ca(0x18c)]((_0xc760ea-_0x51acab)/_0x9889b7),_0x432333=Math[_0x3b01ca(0x29c)](_0x50a718+0x1,_0x4baf8b),_0x340c2c=new Array(_0x565ae6)[_0x3b01ca(0x226)]('\x20');for(let _0x13bf1c=_0x50a718;_0x13bf1c<Math[_0x3b01ca(0x264)](_0x432333,_0x565ae6);_0x13bf1c++){_0x340c2c[_0x13bf1c]='─';}const _0x9adf1c=_0x340c2c[_0x3b01ca(0x1f0)](_0x453b06=>_0x453b06==='\x20'?'\x20':_0x1cb079(_0x453b06))[_0x3b01ca(0x302)]('');_0x4d7ec2[_0x3b01ca(0x198)](_0x3cb0e2+'\x20'+_0x5f5ce3+'│'+_0x9adf1c+'│');}return _0x4d7ec2[_0x3b01ca(0x302)]('\x0a');}async[a54_0x1978f8(0x285)](_0x1064f0,_0x1b20bd,_0x3702f2){const _0x2e338e=a54_0x1978f8,{options:_0x510bda,tdx:_0x43a5ec}=_0x1b20bd,_0x4a8a8d=_0x510bda[_0x2e338e(0x2e3)],{timelineRows:_0x1c1eed,timeAxisHeader:_0x1f3f0b}=this[_0x2e338e(0x1fc)](_0x1064f0,_0x4a8a8d),_0x1cd649=_0x1c1eed[_0x2e338e(0x1ed)](_0x1a0527=>_0x1a0527['attemptId']);if(_0x1cd649['length']===0x0){const _0x4c5356=this[_0x2e338e(0x239)](_0x1064f0,_0x4a8a8d);console[_0x2e338e(0x2e8)](_0x4c5356);!_0x3702f2&&(console[_0x2e338e(0x1a6)](''),console['error'](a54_0x4dcb08['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x2e338e(0x1a6)](a54_0x4dcb08[_0x2e338e(0x24d)](_0x2e338e(0x1b9))+'or'+a54_0x4dcb08[_0x2e338e(0x24d)](_0x2e338e(0x163))));return;}_0x1f3f0b&&console['log'](_0x1f3f0b);const _0x11ef5b=_0x1c1eed['filter'](_0xe8e45=>_0xe8e45[_0x2e338e(0x217)])[_0x2e338e(0x1f0)](_0x7859cf=>({'title':_0x7859cf[_0x2e338e(0x1ae)],'value':_0x7859cf['attemptId']})),_0x227a3f=process[_0x2e338e(0x272)]['rows']||0x3c,_0xec24b9=Math['max'](0x28,Math[_0x2e338e(0x18c)](_0x227a3f*0x2/0x3)),_0x59eedd=await a54_0x51a435({'type':_0x2e338e(0x17d),'name':_0x2e338e(0x217),'message':_0x2e338e(0x1c9),'choices':_0x11ef5b,'initial':-0x1,'limit':_0xec24b9,'clearFirst':!![],'fallback':{'title':_0x2e338e(0x224),'value':null},'suggest':(_0x1b6816,_0x159579)=>{const _0x540132=_0x2e338e;if(!_0x1b6816)return Promise[_0x540132(0x2b2)](_0x159579);const _0x50905e=_0x159579[_0x540132(0x1ed)](_0x58243b=>{const _0x34de82=_0x540132,_0x299f8b=_0x58243b;return _0x299f8b[_0x34de82(0x16d)]['toLowerCase']()['includes'](_0x1b6816[_0x34de82(0x2c3)]());});return Promise['resolve'](_0x50905e);}}),_0x1a3262=()=>{const _0xaef7f1=_0x2e338e;process[_0xaef7f1(0x272)][_0xaef7f1(0x1f1)](_0xaef7f1(0x27b)),process['stdout'][_0xaef7f1(0x1f1)](_0xaef7f1(0x27b)),process[_0xaef7f1(0x272)]['write'](_0xaef7f1(0x27b));},_0xa996a1=_0x59eedd&&_0x59eedd[_0x2e338e(0x217)]&&_0x59eedd[_0x2e338e(0x217)]!==null&&_0x59eedd[_0x2e338e(0x217)]['trim']()!=='';if(!_0xa996a1){_0x1a3262(),console[_0x2e338e(0x2e8)](a54_0x4dcb08[_0x2e338e(0x24d)](_0x2e338e(0x202)));return;}_0x1a3262();const _0x7a8c77=_0x1064f0[_0x2e338e(0x2a3)](_0x13f6de=>_0x13f6de[_0x2e338e(0x2e6)]?.['id']===_0x59eedd[_0x2e338e(0x217)]);if(_0x7a8c77){const _0x47c0cb=_0x7a8c77['project']?.[_0x2e338e(0x273)]||'?',_0x3e0e78=_0x7a8c77[_0x2e338e(0x1ef)]?.[_0x2e338e(0x273)]||'?';console[_0x2e338e(0x2e8)]('Project:\x20'+a54_0x4dcb08[_0x2e338e(0x24d)](_0x47c0cb)+_0x2e338e(0x1d6)+a54_0x4dcb08[_0x2e338e(0x24d)](_0x3e0e78));}const _0x178c8f=new WorkflowTimelineCommand();await _0x178c8f[_0x2e338e(0x1bd)]({'args':[],'options':{..._0x510bda,'attemptId':_0x59eedd[_0x2e338e(0x217)]},'tdx':_0x43a5ec});}[a54_0x1978f8(0x1fc)](_0x1a0171,_0x2b3d40){const _0x507ba8=a54_0x1978f8,_0x5b5fb2=new Map();for(const _0x24247d of _0x1a0171){_0x24247d['id']&&_0x24247d[_0x507ba8(0x2e6)]?.['id']&&_0x5b5fb2[_0x507ba8(0x24f)](_0x24247d['id'],_0x24247d['lastAttempt']['id']);}const _0x552eb9=[];let _0x466dad='';const _0xd9ed14=this[_0x507ba8(0x239)](_0x1a0171,_0x2b3d40),_0xbe4605=_0xd9ed14['split']('\x0a');for(const _0x161fb9 of _0xbe4605){if(_0x161fb9[_0x507ba8(0x2f6)](_0x507ba8(0x248))||_0x161fb9[_0x507ba8(0x212)](/^\s+\d{4}-\d{2}-\d{2}/))_0x466dad=_0x161fb9;else{if(_0x161fb9[_0x507ba8(0x212)](/^[✅❌🔄🛑⏳]/)){const _0x36d6b1=_0x161fb9[_0x507ba8(0x212)](/#(\d+)/),_0x177d71=_0x36d6b1?_0x36d6b1[0x1]:null,_0x93ed39=_0x177d71?_0x5b5fb2[_0x507ba8(0x18d)](_0x177d71)||null:null,_0x3ac34a=_0x1a0171[_0x507ba8(0x2a3)](_0x45a352=>_0x45a352['id']===_0x177d71),_0x127402=_0x3ac34a?.[_0x507ba8(0x301)]?.[_0x507ba8(0x273)]||'';_0x552eb9['push']({'displayLine':_0x161fb9,'attemptId':_0x93ed39,'projectName':_0x127402});}}}return{'timelineRows':_0x552eb9,'timeAxisHeader':_0x466dad};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a54_0x1978f8(0x1e4);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x291);async[a54_0x1978f8(0x1bd)](_0x28fc12){const _0xca8eff=a54_0x1978f8,{options:_0x500d59,args:_0x3ba970,tdx:_0x1baefe}=_0x28fc12,_0x576f60=this[_0xca8eff(0x1c5)](_0x3ba970,_0x500d59);if(!_0x576f60)return 0x1;const {projectName:_0x49f108,workflowName:_0x232b3a}=_0x576f60,_0x41cc02=_0x500d59['includeRetried'];if(_0x500d59[_0xca8eff(0x156)]){if(_0x49f108&&_0x232b3a)console['error']('Filter:\x20'+_0x49f108+'.'+_0x232b3a);else _0x49f108&&console[_0xca8eff(0x1a6)](_0xca8eff(0x1f3)+_0x49f108);_0x41cc02&&console[_0xca8eff(0x1a6)](_0xca8eff(0x17a));}const _0x2d84f1=await withSpinner(_0xca8eff(0x2e7),()=>_0x1baefe['workflow'][_0xca8eff(0x241)]({'projectName':_0x49f108,'workflowName':_0x232b3a,'includeRetried':_0x41cc02,'limit':_0x500d59['limit']}),{'verbose':_0x500d59[_0xca8eff(0x156)]}),_0xbf3737=_0x2d84f1['data'],_0x5a1413=_0x500d59[_0xca8eff(0x214)]||0x64,_0x1e26b2=_0xbf3737[_0xca8eff(0x1d5)]>=_0x5a1413?a54_0x4dcb08[_0xca8eff(0x24d)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0xca8eff(0x1a6)](_0xca8eff(0x29a)+_0xbf3737[_0xca8eff(0x1d5)]+'\x20attempt'+(_0xbf3737[_0xca8eff(0x1d5)]!==0x1?'s':'')+_0x1e26b2);if(_0x500d59[_0xca8eff(0x1a8)]===_0xca8eff(0x169)||_0x500d59[_0xca8eff(0x1a8)]===_0xca8eff(0x1c6)||_0x500d59[_0xca8eff(0x1a8)]==='table')await handleSDKOutput(_0xbf3737,_0x500d59);else{if(_0xbf3737[_0xca8eff(0x1d5)]===0x0){if(_0x49f108&&_0x232b3a)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x49f108+'.'+_0x232b3a);else _0x49f108?console[_0xca8eff(0x2e8)](_0xca8eff(0x1d9)+_0x49f108):console[_0xca8eff(0x2e8)](_0xca8eff(0x15c));}else{const _0x52ca7d=_0x500d59['site'],_0x2d86d2=_0xbf3737['map'](_0x404a3d=>{const _0x12255f=_0xca8eff,_0x3f6472=a54_0x4dcb08[_0x12255f(0x24d)]('#'+_0x404a3d['id']),_0x471a9e=_0x404a3d['project']?.['id'],_0x3eb0a3=_0x404a3d[_0x12255f(0x257)]||_0x404a3d[_0x12255f(0x245)],_0x18442d=_0x471a9e&&_0x3eb0a3?hyperlink(_0x3f6472,getWorkflowAttemptUrl(_0x52ca7d,_0x471a9e,_0x3eb0a3,_0x404a3d['id'])):_0x3f6472,{icon:_0x5cc8a0,text:_0x2e9fab}=getAttemptStatusDisplay(_0x404a3d),_0x4525aa=(_0x404a3d[_0x12255f(0x301)]?.[_0x12255f(0x273)]||'?')+'.'+(_0x404a3d['workflow']?.[_0x12255f(0x273)]||'?'),_0x3d8b2e=_0x404a3d[_0x12255f(0x1e1)]?a54_0x4dcb08['dim'](_0x404a3d[_0x12255f(0x1e1)]):'';return(_0x18442d+'\x20'+_0x5cc8a0+(_0x2e9fab?'\x20'+_0x2e9fab:'')+'\x20'+_0x4525aa+'\x20'+_0x3d8b2e)[_0x12255f(0x22b)]();});await writeOutput(_0x2d86d2[_0xca8eff(0x302)]('\x0a'),_0x500d59[_0xca8eff(0x1b8)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x2f9);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x1d4);async[a54_0x1978f8(0x1bd)](_0x115c54){const _0xfaa9c5=a54_0x1978f8,{options:_0xa0ec9b,args:_0x1d4bb4,tdx:_0x4463b0}=_0x115c54,_0x2930a0=_0x1d4bb4[0x0];if(!_0x2930a0)return console[_0xfaa9c5(0x1a6)](_0xfaa9c5(0x221)),0x1;_0xa0ec9b[_0xfaa9c5(0x156)]&&console[_0xfaa9c5(0x1a6)](_0xfaa9c5(0x1d0)+_0x2930a0);const _0x7e62bc=await withSpinner('Getting\x20attempt\x20details...',()=>_0x4463b0[_0xfaa9c5(0x1ef)][_0xfaa9c5(0x2b6)](_0x2930a0),{'verbose':_0xa0ec9b[_0xfaa9c5(0x156)]}),_0x55c7d9=_0x7e62bc['data'];let _0x102337;!_0x55c7d9[_0xfaa9c5(0x259)]?_0x102337=_0x55c7d9[_0xfaa9c5(0x1b1)]?_0xfaa9c5(0x2d3):_0xfaa9c5(0x20a):_0x102337=_0x55c7d9[_0xfaa9c5(0x1e7)]?'success':_0xfaa9c5(0x1a6);let _0x5e55f4;if(_0x55c7d9[_0xfaa9c5(0x2c7)]&&_0x55c7d9['finishedAt']){const _0x3d3bb8=new Date(_0x55c7d9[_0xfaa9c5(0x2c7)])[_0xfaa9c5(0x307)](),_0xaa0fb2=new Date(_0x55c7d9[_0xfaa9c5(0x1de)])[_0xfaa9c5(0x307)]();_0x5e55f4=Math[_0xfaa9c5(0x184)]((_0xaa0fb2-_0x3d3bb8)/0x3e8);}const _0x596b62={'attempt_id':_0x55c7d9['id'],'status':_0x102337,..._0x55c7d9[_0xfaa9c5(0x18b)]!==undefined&&{'index':_0x55c7d9[_0xfaa9c5(0x18b)]},..._0x55c7d9[_0xfaa9c5(0x301)]&&{'project':_0x55c7d9[_0xfaa9c5(0x301)][_0xfaa9c5(0x273)]},..._0x55c7d9[_0xfaa9c5(0x1ef)]&&{'workflow':_0x55c7d9['workflow'][_0xfaa9c5(0x273)]},..._0x55c7d9[_0xfaa9c5(0x245)]&&{'session_id':_0x55c7d9[_0xfaa9c5(0x245)]},..._0x55c7d9['sessionTime']&&{'session_time':_0x55c7d9[_0xfaa9c5(0x1e1)]},..._0x55c7d9[_0xfaa9c5(0x26c)]&&{'retry_attempt':_0x55c7d9['retryAttemptName']},..._0x5e55f4!==undefined&&{'duration_sec':_0x5e55f4},..._0x55c7d9['createdAt']&&{'created_at':_0x55c7d9[_0xfaa9c5(0x2c7)]},..._0x55c7d9['finishedAt']&&{'finished_at':_0x55c7d9[_0xfaa9c5(0x1de)]},...Object['keys'](_0x55c7d9[_0xfaa9c5(0x1bc)])[_0xfaa9c5(0x1d5)]>0x0&&{'params':_0x55c7d9[_0xfaa9c5(0x1bc)]}};return await handleSingleObjectOutput(_0x596b62,_0xa0ec9b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x1978f8(0x1c2);[a54_0x1978f8(0x19b)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x51741e){const _0x12addc=a54_0x1978f8,{options:_0x122ee6,args:_0x180bba,tdx:_0x10e4a9}=_0x51741e,_0x1a7f39=_0x180bba[0x0];if(!_0x1a7f39)return console['error'](_0x12addc(0x221)),0x1;const _0x2b3404=_0x122ee6['includeSubtasks'];_0x122ee6[_0x12addc(0x156)]&&(console[_0x12addc(0x1a6)](_0x12addc(0x1d0)+_0x1a7f39),_0x2b3404&&console[_0x12addc(0x1a6)](_0x12addc(0x2d1)));const _0x234bb2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x10e4a9[_0x12addc(0x1ef)][_0x12addc(0x254)](_0x1a7f39,_0x2b3404||![]),{'verbose':_0x122ee6[_0x12addc(0x156)]}),_0x2b521c=_0x234bb2[_0x12addc(0x297)];return console[_0x12addc(0x1a6)]('✔\x20Found\x20'+_0x2b521c[_0x12addc(0x1d5)]+_0x12addc(0x30e)+(_0x2b521c[_0x12addc(0x1d5)]!==0x1?'s':'')),await handleSDKOutput(_0x2b521c,_0x122ee6),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x283);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x19a);async[a54_0x1978f8(0x1bd)](_0x581af4){const _0x4e7dd9=a54_0x1978f8,{options:_0x5da196,args:_0x69f1e6,tdx:_0x1a9406}=_0x581af4,_0x2b09d2=_0x69f1e6[0x0];let _0x1fbec8=_0x69f1e6[0x1];if(!_0x2b09d2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5da196[_0x4e7dd9(0x156)]&&(console[_0x4e7dd9(0x1a6)]('Attempt\x20ID:\x20'+_0x2b09d2),_0x1fbec8&&console[_0x4e7dd9(0x1a6)](_0x4e7dd9(0x2d2)+_0x1fbec8));const _0x17fd0d=await withSpinner(_0x4e7dd9(0x2b3),()=>_0x1a9406[_0x4e7dd9(0x1ef)]['logFiles'](_0x2b09d2,_0x1fbec8),{'verbose':_0x5da196[_0x4e7dd9(0x156)]}),_0x4fe493=_0x17fd0d[_0x4e7dd9(0x297)];if(_0x4fe493[_0x4e7dd9(0x1d5)]===0x0)return console[_0x4e7dd9(0x1a6)](_0x4e7dd9(0x253)),0x0;if(!_0x1fbec8&&(_0x5da196[_0x4e7dd9(0x169)]||_0x5da196['format']))return await handleSDKOutput(_0x4fe493,_0x5da196),0x0;if(!_0x1fbec8){const _0x79c702=_0x4fe493['map'](_0x136a83=>({'title':_0x136a83['taskName']+'\x20('+formatBytes(_0x136a83[_0x4e7dd9(0x232)])+')','value':_0x136a83['taskName']})),_0x450ae6=await a54_0x51a435({'type':_0x4e7dd9(0x204),'name':'task','message':_0x4e7dd9(0x29d),'choices':_0x79c702});if(!_0x450ae6['task'])return console[_0x4e7dd9(0x1a6)]('Cancelled'),0x0;_0x1fbec8=_0x450ae6[_0x4e7dd9(0x2c8)];}const _0x4ffa42=await withSpinner('Downloading\x20logs...',()=>_0x1a9406[_0x4e7dd9(0x1ef)][_0x4e7dd9(0x2f1)](_0x2b09d2,_0x1fbec8),{'verbose':_0x5da196[_0x4e7dd9(0x156)]}),_0x400301=_0x4ffa42['data'];return _0x400301?console[_0x4e7dd9(0x2e8)](_0x400301):console[_0x4e7dd9(0x1a6)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x1978f8(0x273)]='workflow:kill';[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x19c);async[a54_0x1978f8(0x1bd)](_0x4c0c0f){const _0x75b0c8=a54_0x1978f8,{options:_0x57aeb6,args:_0x2423a6,tdx:_0x4d5421}=_0x4c0c0f,_0x543da8=_0x2423a6[0x0];if(!_0x543da8)return console['error'](_0x75b0c8(0x221)),0x1;const _0x3c6787=_0x57aeb6['reason'];_0x57aeb6['verbose']&&(console['error'](_0x75b0c8(0x1d0)+_0x543da8),_0x3c6787&&console[_0x75b0c8(0x1a6)](_0x75b0c8(0x1b6)+_0x3c6787));if(!_0x57aeb6['yes']){if(!isInteractive())return console[_0x75b0c8(0x1a6)](a54_0x4dcb08[_0x75b0c8(0x236)]('\x0aError:'),_0x75b0c8(0x168)),console[_0x75b0c8(0x1a6)](a54_0x4dcb08[_0x75b0c8(0x24d)](_0x75b0c8(0x203))),0x1;const _0x2ec83e=await confirmKey(_0x75b0c8(0x207)+_0x543da8+'?');if(!_0x2ec83e)return console[_0x75b0c8(0x1a6)](a54_0x4dcb08['yellow'](_0x75b0c8(0x202))),0x1;}const _0x460a51=await withSpinner(_0x75b0c8(0x16e),()=>_0x4d5421[_0x75b0c8(0x1ef)][_0x75b0c8(0x2bf)](_0x543da8,_0x3c6787),{'verbose':_0x57aeb6['verbose']}),_0xefce82=_0x460a51['data'];return console['error']('✔\x20'+_0xefce82),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a54_0x1978f8(0x205);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x2dc);async[a54_0x1978f8(0x1bd)](_0x28212a){const _0x1ded5e=a54_0x1978f8,{options:_0x2305d3,args:_0x10f31a,tdx:_0xd40ee9}=_0x28212a,_0xcd0132=_0x10f31a[0x0];if(!_0xcd0132)return console[_0x1ded5e(0x1a6)](_0x1ded5e(0x246)),console['error'](_0x1ded5e(0x1d1)),0x1;let _0x2a8810=![],_0x13eaf4=_0xcd0132;if(_0xcd0132['startsWith'](_0x1ded5e(0x16c)))_0x2a8810=!![],_0x13eaf4=_0xcd0132[_0x1ded5e(0x25e)](0x8);else{if(_0xcd0132[_0x1ded5e(0x2f6)](_0x1ded5e(0x24e)))_0x2a8810=![],_0x13eaf4=_0xcd0132[_0x1ded5e(0x25e)](0x8);else return console[_0x1ded5e(0x1a6)](_0x1ded5e(0x2ab)),console[_0x1ded5e(0x1a6)](_0x1ded5e(0x1d1)),0x1;}const _0x11346e=_0x2305d3[_0x1ded5e(0x281)],_0x1c3ae2=_0x2305d3[_0x1ded5e(0x314)],_0x5cf88e=_0x2305d3['params'],_0x5f3fce=_0x2305d3[_0x1ded5e(0x26e)];_0x2305d3[_0x1ded5e(0x156)]&&(console[_0x1ded5e(0x1a6)](_0x1ded5e(0x1e8)+(_0x2a8810?_0x1ded5e(0x2ed):'attempt')+'\x20'+_0x13eaf4),_0x11346e&&console['error'](_0x1ded5e(0x1c1)+_0x11346e),_0x1c3ae2&&console['error'](_0x1ded5e(0x1c0)+_0x1c3ae2),_0x5cf88e&&console[_0x1ded5e(0x1a6)](_0x1ded5e(0x21e)+_0x5cf88e),_0x5f3fce&&console[_0x1ded5e(0x1a6)]('Force:\x20yes'));let _0x4cc626;if(_0x5cf88e)try{if(_0x5cf88e['startsWith']('@')){const _0x430152=await import(_0x1ded5e(0x1f9)),_0x3cb2be=_0x5cf88e[_0x1ded5e(0x25e)](0x1),_0x207130=await _0x430152[_0x1ded5e(0x1cb)](_0x3cb2be,_0x1ded5e(0x20f));_0x4cc626=JSON[_0x1ded5e(0x29b)](_0x207130);}else _0x4cc626=JSON['parse'](_0x5cf88e);}catch{return console[_0x1ded5e(0x1a6)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x2305d3[_0x1ded5e(0x188)]){if(!isInteractive())return console[_0x1ded5e(0x1a6)](a54_0x4dcb08[_0x1ded5e(0x236)](_0x1ded5e(0x2ba)),_0x1ded5e(0x168)),console['error'](a54_0x4dcb08['dim'](_0x1ded5e(0x203))),0x1;const _0x21ee43=await confirmKey(_0x1ded5e(0x22e)+(_0x2a8810?_0x1ded5e(0x2ed):'attempt')+'\x20'+_0x13eaf4+'?');if(!_0x21ee43)return console['error'](a54_0x4dcb08['yellow']('Cancelled')),0x1;}let _0x4bdc65;_0x2a8810?_0x4bdc65=await withSpinner(_0x1ded5e(0x250),()=>_0xd40ee9[_0x1ded5e(0x1ef)][_0x1ded5e(0x21b)](_0x13eaf4,{'fromTask':_0x11346e,'retryParams':_0x4cc626}),{'verbose':_0x2305d3['verbose']}):_0x4bdc65=await withSpinner(_0x1ded5e(0x1ca),()=>_0xd40ee9[_0x1ded5e(0x1ef)]['retryAttempt'](_0x13eaf4,{'resumeFrom':_0x1c3ae2,'retryParams':_0x4cc626,'force':_0x5f3fce}),{'verbose':_0x2305d3[_0x1ded5e(0x156)]});const _0x2e23a7=_0x4bdc65[_0x1ded5e(0x297)];return console[_0x1ded5e(0x1a6)](_0x1ded5e(0x2a2)),console[_0x1ded5e(0x1a6)](_0x1ded5e(0x2ea)+_0x2e23a7[_0x1ded5e(0x217)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x2e23a7[_0x1ded5e(0x245)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x1978f8(0x17f);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x2cd);async[a54_0x1978f8(0x1bd)](_0x2b13f3){const _0x170912=a54_0x1978f8,{options:_0x378c8d,args:_0x252f38,tdx:_0x221ed0}=_0x2b13f3;let _0x4ef507=_0x252f38[0x0];if(!_0x4ef507){const _0x4b8419=this[_0x170912(0x27e)]([],_0x378c8d),_0x5773cb=await withSpinner(_0x170912(0x1fd),()=>_0x221ed0[_0x170912(0x1ef)][_0x170912(0x2aa)](_0x4b8419,{'limit':_0x378c8d[_0x170912(0x214)]}),{'verbose':_0x378c8d[_0x170912(0x156)]}),_0x1e86b1=_0x5773cb[_0x170912(0x297)];if(_0x1e86b1[_0x170912(0x1d5)]===0x0)return console[_0x170912(0x1a6)](_0x170912(0x230)),!_0x4b8419&&console['error'](a54_0x4dcb08[_0x170912(0x24d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x1942cb=_0x1e86b1[_0x170912(0x1f0)](_0x53f110=>({'title':_0x53f110[_0x170912(0x301)]?.[_0x170912(0x273)]+'.'+_0x53f110[_0x170912(0x273)],'value':_0x53f110[_0x170912(0x301)]?.['name']+'.'+_0x53f110['name'],'description':_0x53f110[_0x170912(0x1af)]?_0x170912(0x227)+_0x53f110['revision']:undefined})),_0x4192af=await a54_0x51a435({'type':_0x170912(0x204),'name':_0x170912(0x1ef),'message':_0x170912(0x1eb),'choices':_0x1942cb});if(!_0x4192af['workflow'])return 0x1;_0x4ef507=_0x4192af[_0x170912(0x1ef)];}if(!_0x4ef507[_0x170912(0x243)]('.')){const _0x2c9308=this[_0x170912(0x27e)]([],_0x378c8d);if(_0x2c9308)_0x4ef507=_0x2c9308+'.'+_0x4ef507;else return console[_0x170912(0x1a6)](a54_0x4dcb08[_0x170912(0x236)](_0x170912(0x2a4)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a54_0x4dcb08[_0x170912(0x24d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0xbcad30=_0x378c8d[_0x170912(0x279)],_0x53bd39=_0x378c8d[_0x170912(0x1e1)],_0x42a708={};if(_0xbcad30&&Array[_0x170912(0x1c7)](_0xbcad30))for(const _0x9205aa of _0xbcad30){const _0xec0d8a=_0x9205aa[_0x170912(0x1cc)]('=');if(_0xec0d8a===-0x1)return console[_0x170912(0x1a6)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x9205aa),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x2c4923=_0x9205aa[_0x170912(0x25e)](0x0,_0xec0d8a),_0x4d369e=_0x9205aa['substring'](_0xec0d8a+0x1);try{_0x42a708[_0x2c4923]=JSON[_0x170912(0x29b)](_0x4d369e);}catch{_0x42a708[_0x2c4923]=_0x4d369e;}}_0x378c8d[_0x170912(0x156)]&&(console[_0x170912(0x1a6)](_0x170912(0x2f5)+_0x4ef507),Object[_0x170912(0x189)](_0x42a708)[_0x170912(0x1d5)]>0x0&&console[_0x170912(0x1a6)]('Parameters:\x20'+JSON['stringify'](_0x42a708)),_0x53bd39&&console[_0x170912(0x1a6)]('Session\x20time:\x20'+_0x53bd39));const _0x13719a=await withSpinner(_0x170912(0x305),()=>_0x221ed0[_0x170912(0x1ef)]['run'](_0x4ef507,_0x42a708,{'sessionTime':_0x53bd39}),{'verbose':_0x378c8d[_0x170912(0x156)]}),_0x46b341=_0x13719a[_0x170912(0x297)];console['error'](_0x170912(0x15a)),console[_0x170912(0x1a6)](_0x170912(0x263)+_0x46b341['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x46b341[_0x170912(0x245)]),console[_0x170912(0x1a6)](_0x170912(0x262)+_0x46b341[_0x170912(0x301)]?.[_0x170912(0x273)]),console[_0x170912(0x1a6)](_0x170912(0x19d)+_0x46b341[_0x170912(0x1ef)]?.['name']);if(_0x46b341['project']?.['id']&&_0x46b341[_0x170912(0x245)]&&_0x46b341['id']){const _0x4a091d=_0x378c8d[_0x170912(0x2e3)],_0xbc2fbc=getConsoleUrl(_0x4a091d,_0x170912(0x311)+_0x46b341[_0x170912(0x301)]['id']+_0x170912(0x229)+_0x46b341[_0x170912(0x245)]+_0x170912(0x233)+_0x46b341['id']);console[_0x170912(0x1a6)](_0x170912(0x252)+a54_0x4dcb08[_0x170912(0x30f)](_0xbc2fbc));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x310);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x158);async[a54_0x1978f8(0x1bd)](_0x410b02){const _0x564bfb=a54_0x1978f8,{options:_0x35036a,args:_0x1948d7,tdx:_0x9d9750}=_0x410b02,_0x4a0646=_0x1948d7[0x0],_0x3d4b1c=_0x1948d7[0x1]||'.';if(!_0x4a0646)return console[_0x564bfb(0x1a6)](_0x564bfb(0x209)),console[_0x564bfb(0x1a6)](_0x564bfb(0x1f8)),0x1;const _0x5f2d10=_0x35036a[_0x564bfb(0x1af)];_0x35036a[_0x564bfb(0x156)]&&(console[_0x564bfb(0x1a6)]('Project:\x20'+_0x4a0646),console['error'](_0x564bfb(0x18f)+_0x3d4b1c),_0x5f2d10&&console[_0x564bfb(0x1a6)](_0x564bfb(0x25b)+_0x5f2d10));const _0x2e906c=await withSpinner(_0x564bfb(0x23e)+_0x4a0646+_0x564bfb(0x199),()=>_0x9d9750['workflow'][_0x564bfb(0x16a)](_0x4a0646,_0x3d4b1c,{'revision':_0x5f2d10}),{'verbose':_0x35036a[_0x564bfb(0x156)]}),_0x119068=_0x2e906c[_0x564bfb(0x297)];return console[_0x564bfb(0x1a6)](_0x564bfb(0x2dd)+_0x119068[_0x564bfb(0x306)]),console[_0x564bfb(0x1a6)](_0x564bfb(0x2ee)+_0x119068[_0x564bfb(0x1af)]),console['error'](_0x564bfb(0x1fa)+_0x119068[_0x564bfb(0x292)]),console['error'](_0x564bfb(0x2b7)+_0x3d4b1c+'/'+_0x119068[_0x564bfb(0x306)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x2ca);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x21d);async[a54_0x1978f8(0x1bd)](_0x18dcaa){const _0x56abc8=a54_0x1978f8,{options:_0x31cdb8,args:_0x344f0b,tdx:_0x5b6070}=_0x18dcaa;let _0x584617='.',_0x5460fc=_0x31cdb8[_0x56abc8(0x273)];if(_0x344f0b[0x0]){const {promises:_0x1acd96}=await import('fs');try{const _0x134e5f=await _0x1acd96[_0x56abc8(0x183)](_0x344f0b[0x0]);if(_0x134e5f[_0x56abc8(0x194)]())_0x584617=_0x344f0b[0x0];else return console['error']('Error:\x20'+_0x344f0b[0x0]+_0x56abc8(0x1f7)),0x1;}catch{_0x5460fc=_0x344f0b[0x0],_0x584617='.';}}const _0x22470c=_0x31cdb8[_0x56abc8(0x1af)],_0x1c5d7e=_0x31cdb8[_0x56abc8(0x23c)];_0x31cdb8['verbose']&&(console[_0x56abc8(0x1a6)](_0x56abc8(0x2b4)+_0x584617),_0x5460fc&&console['error'](_0x56abc8(0x2bb)+_0x5460fc),_0x22470c&&console['error'](_0x56abc8(0x25b)+_0x22470c),_0x1c5d7e&&console[_0x56abc8(0x1a6)](_0x56abc8(0x308)));const _0x28a99d=await withSpinner(_0x56abc8(0x170),()=>_0x5b6070[_0x56abc8(0x1ef)][_0x56abc8(0x198)](_0x584617,{'projectName':_0x5460fc,'revision':_0x22470c,'skipValidation':_0x1c5d7e}),{'verbose':_0x31cdb8[_0x56abc8(0x156)]}),_0x55ecf7=_0x28a99d['data'];return console[_0x56abc8(0x1a6)](_0x56abc8(0x2c4)+_0x55ecf7[_0x56abc8(0x306)]),console[_0x56abc8(0x1a6)]('\x20\x20Project\x20ID:\x20'+_0x55ecf7['projectId']),console['error'](_0x56abc8(0x2ee)+_0x55ecf7[_0x56abc8(0x1af)]),await this[_0x56abc8(0x23b)](_0x5b6070,_0x55ecf7[_0x56abc8(0x306)],_0x31cdb8[_0x56abc8(0x2e3)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x22f);['description']=a54_0x1978f8(0x1bb);async[a54_0x1978f8(0x1bd)](_0x572cab){const _0x1b663b=a54_0x1978f8,{options:_0x3e1489,args:_0x53325d,tdx:_0x3933dc}=_0x572cab,_0x186698=_0x53325d[0x0],_0x4ddc4c=_0x53325d[0x1];if(!_0x186698)return console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x236)](_0x1b663b(0x2a4)),_0x1b663b(0x249)),console[_0x1b663b(0x1a6)](a54_0x4dcb08['dim'](_0x1b663b(0x235))),0x1;const _0x25a6b2=_0x3e1489['revision'];_0x3e1489[_0x1b663b(0x156)]&&(console[_0x1b663b(0x1a6)](_0x1b663b(0x2b1)+_0x186698),_0x4ddc4c&&console[_0x1b663b(0x1a6)](_0x1b663b(0x2e1)+_0x4ddc4c),_0x25a6b2&&console[_0x1b663b(0x1a6)](_0x1b663b(0x25b)+_0x25a6b2),_0x3e1489[_0x1b663b(0x1b2)]&&console[_0x1b663b(0x1a6)]('Dry\x20run:\x20yes'));const _0x4f2b3d=await withSpinner(_0x1b663b(0x1fe)+_0x186698+'...',()=>_0x3933dc[_0x1b663b(0x1ef)][_0x1b663b(0x286)](_0x186698,{'targetDir':_0x4ddc4c,'revision':_0x25a6b2}),{'verbose':_0x3e1489[_0x1b663b(0x156)]}),_0x2b2703=_0x4f2b3d[_0x1b663b(0x297)];_0x2b2703[_0x1b663b(0x27c)]?console[_0x1b663b(0x1a6)]('→\x20New\x20project:\x20'+_0x2b2703[_0x1b663b(0x306)]):console[_0x1b663b(0x1a6)](_0x1b663b(0x2db)+_0x2b2703[_0x1b663b(0x306)]);console[_0x1b663b(0x1a6)](_0x1b663b(0x2ee)+_0x2b2703['revision']),console[_0x1b663b(0x1a6)]('\x20\x20Target:\x20'+(a54_0x331f20[_0x1b663b(0x2ce)](process[_0x1b663b(0x2c1)](),_0x2b2703[_0x1b663b(0x164)])||'.')),console[_0x1b663b(0x1a6)]('\x20\x20Changes:\x20'+a54_0x4dcb08['green']('+'+_0x2b2703[_0x1b663b(0x27f)]['new']+_0x1b663b(0x238))+',\x20'+(a54_0x4dcb08[_0x1b663b(0x1ff)]('~'+_0x2b2703[_0x1b663b(0x27f)][_0x1b663b(0x2b8)]+_0x1b663b(0x201))+',\x20')+(a54_0x4dcb08[_0x1b663b(0x236)]('-'+_0x2b2703[_0x1b663b(0x27f)][_0x1b663b(0x17e)]+_0x1b663b(0x161))+',\x20')+(''+a54_0x4dcb08[_0x1b663b(0x24d)](_0x2b2703[_0x1b663b(0x27f)][_0x1b663b(0x1cf)]+_0x1b663b(0x22a))));for(const _0x23af98 of _0x2b2703['changes']){_0x23af98[_0x1b663b(0x2ec)]===_0x1b663b(0x2b8)&&_0x23af98['diff']&&(console['error']('\x0a'+a54_0x4dcb08['cyan'](_0x1b663b(0x26f)+_0x23af98['path'])),console[_0x1b663b(0x1a6)](_0x23af98[_0x1b663b(0x167)]));}if(!_0x2b2703[_0x1b663b(0x2b9)])return saveSessionContext({'workflow_project':_0x2b2703[_0x1b663b(0x306)]},_0x3e1489[_0x1b663b(0x2ed)]),console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x2ac)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x24d)](_0x1b663b(0x1a3)+_0x2b2703['projectName'])),0x0;if(_0x3e1489['dryRun'])return console['error'](a54_0x4dcb08[_0x1b663b(0x1ff)](_0x1b663b(0x258))),0x0;if(!_0x3e1489[_0x1b663b(0x188)]){if(!isInteractive())return console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x236)](_0x1b663b(0x2ba)),_0x1b663b(0x168)),console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x24d)](_0x1b663b(0x203))),0x1;const _0x1ec344=await confirmKey(_0x1b663b(0x195));if(!_0x1ec344)return console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x1ff)](_0x1b663b(0x202)),_0x1b663b(0x265)),0x1;}await withSpinner(_0x1b663b(0x1a1),()=>_0x3933dc[_0x1b663b(0x1ef)][_0x1b663b(0x211)](_0x2b2703,{'revision':_0x25a6b2}),{'verbose':_0x3e1489[_0x1b663b(0x156)]}),saveSessionContext({'workflow_project':_0x2b2703['projectName']},_0x3e1489[_0x1b663b(0x2ed)]),console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x2ac)](_0x1b663b(0x2f4)));const _0x44d661=a54_0x331f20['relative'](process[_0x1b663b(0x2c1)](),_0x2b2703[_0x1b663b(0x164)])||'.';return console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x24d)](_0x1b663b(0x2b7)+_0x44d661)),console[_0x1b663b(0x1a6)](a54_0x4dcb08[_0x1b663b(0x24d)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2b2703[_0x1b663b(0x306)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x1978f8(0x1a9);['description']=a54_0x1978f8(0x288);async[a54_0x1978f8(0x1bd)](_0x74c8fb){const _0xa45fd4=a54_0x1978f8,{options:_0x57c09f,args:_0x35a31d,tdx:_0x501733}=_0x74c8fb,_0xcad5cc=this['resolveProjectDir'](_0x35a31d,_0x57c09f),_0x2dcd9d=_0x57c09f[_0xa45fd4(0x1af)],_0x3fbac8=_0x57c09f[_0xa45fd4(0x23c)];_0x57c09f[_0xa45fd4(0x156)]&&(_0xcad5cc&&console['error'](_0xa45fd4(0x2f0)+_0xcad5cc),_0x2dcd9d&&console[_0xa45fd4(0x1a6)]('Revision:\x20'+_0x2dcd9d),_0x57c09f[_0xa45fd4(0x1b2)]&&console[_0xa45fd4(0x1a6)](_0xa45fd4(0x2c6)),_0x3fbac8&&console['error']('Validation:\x20skipped'));let _0x53b416;try{_0x53b416=await withSpinner(_0xa45fd4(0x222),()=>_0x501733[_0xa45fd4(0x1ef)]['preparePushProject']({'sourceDir':_0xcad5cc,'revision':_0x2dcd9d,'skipValidation':_0x3fbac8}),{'verbose':_0x57c09f[_0xa45fd4(0x156)]});}catch(_0x3186d1){if(_0x3186d1 instanceof Error&&_0x3186d1[_0xa45fd4(0x242)]['includes'](_0xa45fd4(0x20c)))return console['error'](a54_0x4dcb08['red'](_0xa45fd4(0x2a4)),_0xa45fd4(0x1a0)),_0x57c09f[_0xa45fd4(0x28a)]?console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x24d)](_0xa45fd4(0x157)+_0x57c09f[_0xa45fd4(0x28a)]+_0xa45fd4(0x1c4)+_0x57c09f[_0xa45fd4(0x28a)]+'\x27')):console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x24d)](_0xa45fd4(0x191))),0x1;throw _0x3186d1;}const _0x4d05e9=_0x53b416[_0xa45fd4(0x297)];console[_0xa45fd4(0x1a6)](_0xa45fd4(0x2be)+_0x4d05e9[_0xa45fd4(0x306)]),console['error'](_0xa45fd4(0x2a1)+_0x4d05e9[_0xa45fd4(0x294)]),console[_0xa45fd4(0x1a6)](_0xa45fd4(0x2ee)+_0x4d05e9[_0xa45fd4(0x1af)]),console[_0xa45fd4(0x1a6)](_0xa45fd4(0x210)+a54_0x4dcb08[_0xa45fd4(0x2ac)]('+'+_0x4d05e9[_0xa45fd4(0x27f)][_0xa45fd4(0x2cc)]+_0xa45fd4(0x238))+',\x20'+(a54_0x4dcb08[_0xa45fd4(0x1ff)]('~'+_0x4d05e9[_0xa45fd4(0x27f)][_0xa45fd4(0x2b8)]+_0xa45fd4(0x201))+',\x20')+(a54_0x4dcb08[_0xa45fd4(0x236)]('-'+_0x4d05e9['summary'][_0xa45fd4(0x17e)]+'\x20deleted')+',\x20')+(''+a54_0x4dcb08[_0xa45fd4(0x24d)](_0x4d05e9[_0xa45fd4(0x27f)][_0xa45fd4(0x1cf)]+'\x20unchanged')));for(const _0x3a38cb of _0x4d05e9['changes']){_0x3a38cb['type']===_0xa45fd4(0x2b8)&&_0x3a38cb['diff']&&(console[_0xa45fd4(0x1a6)]('\x0a'+a54_0x4dcb08[_0xa45fd4(0x30f)](_0xa45fd4(0x26f)+_0x3a38cb['path'])),console[_0xa45fd4(0x1a6)](_0x3a38cb['diff']));}if(!_0x4d05e9[_0xa45fd4(0x2b9)])return console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x2ac)](_0xa45fd4(0x19f))),await this[_0xa45fd4(0x23b)](_0x501733,_0x4d05e9[_0xa45fd4(0x306)],_0x57c09f[_0xa45fd4(0x2e3)]),0x0;if(_0x57c09f['dryRun'])return console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x1ff)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x57c09f[_0xa45fd4(0x188)]){if(!isInteractive())return console['error'](a54_0x4dcb08[_0xa45fd4(0x236)](_0xa45fd4(0x2ba)),_0xa45fd4(0x168)),console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x24d)](_0xa45fd4(0x203))),0x1;const _0x4b7f06=await confirmKey(_0xa45fd4(0x160));if(!_0x4b7f06)return console['error'](a54_0x4dcb08['yellow'](_0xa45fd4(0x202)),'-\x20nothing\x20pushed'),0x1;}const _0x22eb69=await withSpinner(_0xa45fd4(0x15e),()=>_0x501733['workflow'][_0xa45fd4(0x150)](_0x4d05e9),{'verbose':_0x57c09f[_0xa45fd4(0x156)]}),_0x40ed47=_0x22eb69[_0xa45fd4(0x297)];return console[_0xa45fd4(0x1a6)](a54_0x4dcb08[_0xa45fd4(0x2ac)](_0xa45fd4(0x296))),console['error']('\x20\x20Project\x20ID:\x20'+_0x40ed47[_0xa45fd4(0x213)]),console[_0xa45fd4(0x1a6)]('\x20\x20Revision:\x20'+_0x40ed47[_0xa45fd4(0x1af)]),await this[_0xa45fd4(0x23b)](_0x501733,_0x40ed47[_0xa45fd4(0x306)],_0x57c09f['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x180);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x1978f8(0x1bd)](_0x1fac2f){const _0x19e2c1=a54_0x1978f8,{options:_0x37e6a7,args:_0x24b1ce,tdx:_0x58e6ba}=_0x1fac2f,_0x360294=this['resolveProjectDir'](_0x24b1ce,_0x37e6a7),_0x2586ea=_0x37e6a7[_0x19e2c1(0x273)],_0x1a321a=_0x37e6a7['revision'],_0x25abab=_0x37e6a7[_0x19e2c1(0x23c)];if(!_0x360294)return console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x236)](_0x19e2c1(0x2a4)),_0x19e2c1(0x244)),console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x24d)](_0x19e2c1(0x303))),console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x24d)](_0x19e2c1(0x197))),0x1;if(!_0x2586ea)return console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x236)](_0x19e2c1(0x2a4)),_0x19e2c1(0x25d)),console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x24d)](_0x19e2c1(0x303))),0x1;_0x37e6a7[_0x19e2c1(0x156)]&&(console[_0x19e2c1(0x1a6)](_0x19e2c1(0x2f0)+_0x360294),console[_0x19e2c1(0x1a6)](_0x19e2c1(0x260)+_0x2586ea),_0x1a321a&&console[_0x19e2c1(0x1a6)](_0x19e2c1(0x25b)+_0x1a321a),_0x37e6a7[_0x19e2c1(0x1b2)]&&console['error'](_0x19e2c1(0x2c6)),_0x25abab&&console[_0x19e2c1(0x1a6)]('Validation:\x20skipped'));const _0x1dc144=await withSpinner('Analyzing\x20project...',()=>_0x58e6ba['workflow']['prepareCloneProject'](_0x360294,_0x2586ea,{'revision':_0x1a321a,'skipValidation':_0x25abab}),{'verbose':_0x37e6a7[_0x19e2c1(0x156)]}),_0x4c8674=_0x1dc144[_0x19e2c1(0x297)];console[_0x19e2c1(0x1a6)](_0x19e2c1(0x26b)+_0x4c8674['sourceDir']);_0x4c8674['sourceProjectName']&&console['error'](_0x19e2c1(0x2fc)+_0x4c8674[_0x19e2c1(0x24c)]);console[_0x19e2c1(0x1a6)](_0x19e2c1(0x260)+_0x4c8674[_0x19e2c1(0x24a)]),console[_0x19e2c1(0x1a6)]('Revision:\x20'+_0x4c8674[_0x19e2c1(0x1af)]),console['error']('Files\x20to\x20upload:\x20'+_0x4c8674[_0x19e2c1(0x1e5)]);_0x4c8674['targetExists']&&(console['error'](a54_0x4dcb08[_0x19e2c1(0x1ff)](_0x19e2c1(0x30c)+_0x4c8674['newProjectName']+_0x19e2c1(0x278)+_0x4c8674['existingProjectId']+')')),console['error'](a54_0x4dcb08[_0x19e2c1(0x1ff)](_0x19e2c1(0x2b0))));if(_0x37e6a7[_0x19e2c1(0x1b2)])return console[_0x19e2c1(0x1a6)](a54_0x4dcb08['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x37e6a7[_0x19e2c1(0x188)]){if(!isInteractive())return console[_0x19e2c1(0x1a6)](a54_0x4dcb08['red'](_0x19e2c1(0x2ba)),_0x19e2c1(0x168)),console[_0x19e2c1(0x1a6)](a54_0x4dcb08['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4329b5=_0x4c8674[_0x19e2c1(0x24c)]||a54_0x331f20['basename'](_0x360294),_0x5258af=_0x4c8674[_0x19e2c1(0x215)]?_0x19e2c1(0x15d)+_0x2586ea+_0x19e2c1(0x2b5):_0x19e2c1(0x1f4)+_0x4329b5+_0x19e2c1(0x17b)+_0x2586ea+'\x22?',_0x2efbf9=await confirmKey(_0x5258af);if(!_0x2efbf9)return console[_0x19e2c1(0x1a6)](a54_0x4dcb08['yellow'](_0x19e2c1(0x202))),0x1;}const _0x5342d1=await withSpinner(_0x4c8674[_0x19e2c1(0x215)]?_0x19e2c1(0x153)+_0x2586ea+'...':'Cloning\x20to\x20'+_0x2586ea+_0x19e2c1(0x199),()=>_0x58e6ba[_0x19e2c1(0x1ef)][_0x19e2c1(0x25f)](_0x4c8674),{'verbose':_0x37e6a7['verbose']}),_0x9ba626=_0x5342d1[_0x19e2c1(0x297)];return console[_0x19e2c1(0x1a6)](a54_0x4dcb08[_0x19e2c1(0x2ac)](_0x4c8674[_0x19e2c1(0x215)]?_0x19e2c1(0x196):_0x19e2c1(0x219))),console['error'](_0x19e2c1(0x262)+_0x9ba626[_0x19e2c1(0x24a)]),console[_0x19e2c1(0x1a6)](_0x19e2c1(0x151)+_0x9ba626[_0x19e2c1(0x2ef)]),console[_0x19e2c1(0x1a6)](_0x19e2c1(0x2ee)+_0x9ba626['revision']),await this[_0x19e2c1(0x23b)](_0x58e6ba,_0x9ba626[_0x19e2c1(0x24a)],_0x37e6a7[_0x19e2c1(0x2e3)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x240);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x225);async['execute'](_0x32b092){const _0x2a1a09=a54_0x1978f8,{options:_0x44f6e2,args:_0x31cea0,tdx:_0x3b4a96}=_0x32b092,_0x94ce39=_0x31cea0[0x0];if(!_0x94ce39)return console[_0x2a1a09(0x1a6)](_0x2a1a09(0x1dc)),console[_0x2a1a09(0x1a6)](_0x2a1a09(0x2fa)),0x1;_0x44f6e2[_0x2a1a09(0x156)]&&console[_0x2a1a09(0x1a6)](_0x2a1a09(0x2b1)+_0x94ce39);if(!_0x44f6e2[_0x2a1a09(0x188)]){if(!isInteractive())return console[_0x2a1a09(0x1a6)](a54_0x4dcb08[_0x2a1a09(0x236)](_0x2a1a09(0x2ba)),_0x2a1a09(0x168)),console[_0x2a1a09(0x1a6)](a54_0x4dcb08[_0x2a1a09(0x24d)](_0x2a1a09(0x203))),0x1;const _0x2a4305=await confirmKey(_0x2a1a09(0x2f7)+_0x94ce39+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x2a4305)return console['error'](a54_0x4dcb08[_0x2a1a09(0x1ff)](_0x2a1a09(0x202))),0x1;}const _0x44d08f=await withSpinner(_0x2a1a09(0x1a4)+_0x94ce39+'...',()=>_0x3b4a96[_0x2a1a09(0x1ef)][_0x2a1a09(0x2fe)](_0x94ce39),{'verbose':_0x44f6e2['verbose']}),_0x5bf8eb=_0x44d08f[_0x2a1a09(0x297)];return console[_0x2a1a09(0x1a6)]('✔\x20Deleted\x20project\x20'+_0x5bf8eb[_0x2a1a09(0x306)]),console[_0x2a1a09(0x1a6)](_0x2a1a09(0x151)+_0x5bf8eb[_0x2a1a09(0x213)]),0x0;}}export function parseKeyValue(_0x5a76fd){const _0x341296=a54_0x1978f8,_0x1b35b9=_0x5a76fd['indexOf']('=');if(_0x1b35b9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5a76fd+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x3206e1=_0x5a76fd[_0x341296(0x25e)](0x0,_0x1b35b9),_0x3b1514=_0x5a76fd[_0x341296(0x25e)](_0x1b35b9+0x1);if(!_0x3206e1)throw new Error(_0x341296(0x1e6));return{'key':_0x3206e1,'value':_0x3b1514};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x2ae);[a54_0x1978f8(0x19b)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x1978f8(0x1bd)](_0x1f1f8f){const _0x46d90c=a54_0x1978f8,{options:_0x510b5b,args:_0x435ac9,tdx:_0x389515}=_0x1f1f8f,_0xcf1dbe=this[_0x46d90c(0x22c)](_0x435ac9,_0x510b5b);if(!_0xcf1dbe)return 0x1;_0x510b5b['verbose']&&console[_0x46d90c(0x1a6)]('Project:\x20'+_0xcf1dbe);const _0x325acc=await withSpinner(_0x46d90c(0x28b),()=>_0x389515[_0x46d90c(0x1ef)][_0x46d90c(0x1ac)](_0xcf1dbe),{'verbose':_0x510b5b[_0x46d90c(0x156)]}),{secrets:_0x11e1b6}=_0x325acc[_0x46d90c(0x297)];return console[_0x46d90c(0x1a6)](_0x46d90c(0x29a)+_0x11e1b6[_0x46d90c(0x1d5)]+'\x20secret'+(_0x11e1b6['length']!==0x1?'s':'')),await handleSDKOutput(_0x11e1b6,_0x510b5b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x208);['description']=a54_0x1978f8(0x2d4);async[a54_0x1978f8(0x1bd)](_0x3ec3e4){const _0x5c93a9=a54_0x1978f8,{options:_0x5e3a24,args:_0x2b381d,tdx:_0x417392}=_0x3ec3e4;let _0x3c7945,_0x4d2c54;if(_0x2b381d[_0x5c93a9(0x1d5)]>=0x1&&!_0x2b381d[0x0]['includes']('='))_0x3c7945=_0x2b381d[0x0],_0x4d2c54=_0x2b381d['slice'](0x1);else{if(_0x2b381d[_0x5c93a9(0x1d5)]>=0x1&&_0x5e3a24[_0x5c93a9(0x28a)])_0x3c7945=_0x5e3a24[_0x5c93a9(0x28a)],_0x4d2c54=_0x2b381d;else return _0x2b381d[_0x5c93a9(0x1d5)]>=0x1?(console[_0x5c93a9(0x1a6)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5c93a9(0x1a6)](_0x5c93a9(0x166)),0x1):(console['error'](_0x5c93a9(0x1db)),console[_0x5c93a9(0x1a6)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x4d2c54[_0x5c93a9(0x1d5)]===0x0)return console[_0x5c93a9(0x1a6)](_0x5c93a9(0x1db)),console['error'](_0x5c93a9(0x175)),0x1;const _0x7299df={};try{for(const _0x481db7 of _0x4d2c54){const {key:_0x3d601d,value:_0xb7f7a4}=parseKeyValue(_0x481db7);_0x7299df[_0x3d601d]=_0xb7f7a4;}}catch(_0x28ff2e){return _0x28ff2e instanceof Error&&console['error'](a54_0x4dcb08['red'](_0x5c93a9(0x2a4)),_0x28ff2e[_0x5c93a9(0x242)]),0x1;}const _0x4835f3=Object['keys'](_0x7299df);_0x5e3a24[_0x5c93a9(0x156)]&&(console[_0x5c93a9(0x1a6)](_0x5c93a9(0x2b1)+_0x3c7945),console[_0x5c93a9(0x1a6)](_0x5c93a9(0x162)+_0x4835f3[_0x5c93a9(0x302)](',\x20')));const _0x1f1164=await withSpinner(_0x4835f3[_0x5c93a9(0x1d5)]===0x1?_0x5c93a9(0x2c9):_0x5c93a9(0x2d7)+_0x4835f3[_0x5c93a9(0x1d5)]+'\x20secrets...',()=>_0x417392[_0x5c93a9(0x1ef)][_0x5c93a9(0x275)](_0x3c7945,_0x7299df),{'verbose':_0x5e3a24['verbose']}),_0x24cf13=_0x1f1164[_0x5c93a9(0x297)];return console[_0x5c93a9(0x1a6)](_0x4835f3[_0x5c93a9(0x1d5)]===0x1?_0x5c93a9(0x2cf)+_0x24cf13[_0x5c93a9(0x189)][0x0]+_0x5c93a9(0x2da)+_0x24cf13[_0x5c93a9(0x306)]+'\x27':'✔\x20'+_0x24cf13[_0x5c93a9(0x189)][_0x5c93a9(0x1d5)]+_0x5c93a9(0x2a8)+_0x24cf13[_0x5c93a9(0x306)]+'\x27'),(_0x5e3a24['json']||_0x5e3a24[_0x5c93a9(0x1c6)])&&await handleSingleObjectOutput(_0x24cf13,_0x5e3a24),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x1978f8(0x295);[a54_0x1978f8(0x19b)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a54_0x1978f8(0x1bd)](_0x26f5aa){const _0x59518e=a54_0x1978f8,{options:_0x546133,args:_0x31f647,tdx:_0x3b0ce3}=_0x26f5aa;let _0x52836a,_0x58f92e;if(_0x31f647[_0x59518e(0x1d5)]>=0x2)_0x52836a=_0x31f647[0x0],_0x58f92e=_0x31f647[0x1];else{if(_0x31f647[_0x59518e(0x1d5)]===0x1&&_0x546133[_0x59518e(0x28a)])_0x52836a=_0x546133['workflowProject'],_0x58f92e=_0x31f647[0x0];else return _0x31f647[_0x59518e(0x1d5)]===0x1?(console[_0x59518e(0x1a6)](_0x59518e(0x209)),console[_0x59518e(0x1a6)](_0x59518e(0x166)),0x1):(console[_0x59518e(0x1a6)](_0x59518e(0x289)),console[_0x59518e(0x1a6)](_0x59518e(0x30b)),0x1);}_0x546133[_0x59518e(0x156)]&&(console[_0x59518e(0x1a6)](_0x59518e(0x2b1)+_0x52836a),console[_0x59518e(0x1a6)](_0x59518e(0x1b0)+_0x58f92e));if(!_0x546133[_0x59518e(0x188)]){if(!isInteractive())return console[_0x59518e(0x1a6)](a54_0x4dcb08[_0x59518e(0x236)](_0x59518e(0x2ba)),_0x59518e(0x168)),console['error'](a54_0x4dcb08['dim'](_0x59518e(0x203))),0x1;const _0x1f766e=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x58f92e+_0x59518e(0x2a7)+_0x52836a+'\x27?');if(!_0x1f766e)return console[_0x59518e(0x1a6)](a54_0x4dcb08[_0x59518e(0x1ff)]('Cancelled')),0x1;}const _0xdfebdb=await withSpinner(_0x59518e(0x261),()=>_0x3b0ce3[_0x59518e(0x1ef)][_0x59518e(0x18a)](_0x52836a,_0x58f92e),{'verbose':_0x546133[_0x59518e(0x156)]}),_0x3fb64f=_0xdfebdb[_0x59518e(0x297)];return console[_0x59518e(0x1a6)]('✔\x20Secret\x20\x27'+_0x3fb64f[_0x59518e(0x152)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x3fb64f[_0x59518e(0x306)]+'\x27'),(_0x546133['json']||_0x546133[_0x59518e(0x1c6)])&&await handleSingleObjectOutput(_0x3fb64f,_0x546133),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(_0x442488){const _0x1bee9a=a54_0x1978f8,_0x36db98=Math[_0x1bee9a(0x18c)](_0x442488/0x3e8),_0x2c00c5=Math['floor'](_0x36db98/0x3c),_0x543aa9=Math[_0x1bee9a(0x18c)](_0x2c00c5/0x3c),_0x4b80c8=Math[_0x1bee9a(0x18c)](_0x543aa9/0x18);if(_0x4b80c8>0x0){const _0x900605=_0x543aa9%0x18;return _0x900605>0x0?_0x4b80c8+'d\x20'+_0x900605+'h':_0x4b80c8+'d';}else{if(_0x543aa9>0x0){const _0xa4f501=_0x2c00c5%0x3c;return _0xa4f501>0x0?_0x543aa9+'h\x20'+_0xa4f501+'m':_0x543aa9+'h';}else{if(_0x2c00c5>0x0){const _0x4bb846=_0x36db98%0x3c;return _0x4bb846>0x0?_0x2c00c5+'m\x20'+_0x4bb846+'s':_0x2c00c5+'m';}else return _0x36db98+'s';}}}function formatTimestamp(_0x3a2552,_0x3c9bd1){const _0x12d58b=a54_0x1978f8,_0x49d853=new Date(_0x3a2552),_0x3eaf91=String(_0x49d853['getHours']())['padStart'](0x2,'0'),_0x34619c=String(_0x49d853[_0x12d58b(0x287)]())[_0x12d58b(0x266)](0x2,'0'),_0x418a37=_0x3eaf91+':'+_0x34619c,_0x51b320=_0x49d853[_0x12d58b(0x2d9)]()===_0x3c9bd1['getFullYear']()&&_0x49d853[_0x12d58b(0x2a6)]()===_0x3c9bd1[_0x12d58b(0x2a6)]()&&_0x49d853[_0x12d58b(0x206)]()===_0x3c9bd1['getDate']();if(_0x51b320)return _0x418a37;else{const _0x27470a=String(_0x49d853[_0x12d58b(0x2a6)]()+0x1)[_0x12d58b(0x266)](0x2,'0'),_0x2457b9=String(_0x49d853[_0x12d58b(0x206)]())[_0x12d58b(0x266)](0x2,'0');return _0x27470a+'-'+_0x2457b9+'\x20'+_0x418a37;}}function formatDate(_0x3a0a85){const _0x13155=a54_0x1978f8,_0x20ce47=_0x3a0a85[_0x13155(0x2d9)](),_0x4d4bbd=String(_0x3a0a85[_0x13155(0x2a6)]()+0x1)['padStart'](0x2,'0'),_0x5955a0=String(_0x3a0a85[_0x13155(0x206)]())[_0x13155(0x266)](0x2,'0');return _0x20ce47+'-'+_0x4d4bbd+'-'+_0x5955a0;}function getTaskStateIcon(_0x297891){const _0x3269d9={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3269d9[_0x297891]||'⚪';}function getBarChar(_0x3e73c8){const _0x16971a=a54_0x1978f8;return _0x3e73c8===_0x16971a(0x1a6)||_0x3e73c8===_0x16971a(0x2bc)?'×':'─';}function getBarColor(_0x45cc4e){const _0x4533e2=a54_0x1978f8,_0x339e48={'success':a54_0x4dcb08[_0x4533e2(0x2ac)],'error':a54_0x4dcb08[_0x4533e2(0x236)],'group_error':a54_0x4dcb08[_0x4533e2(0x236)],'running':a54_0x4dcb08[_0x4533e2(0x15f)],'blocked':a54_0x4dcb08['yellow'],'planned':a54_0x4dcb08[_0x4533e2(0x24d)],'canceling':a54_0x4dcb08['yellow']};return _0x339e48[_0x45cc4e]||a54_0x4dcb08[_0x4533e2(0x1f2)];}function parseTaskName(_0x587895){const _0x31e605=a54_0x1978f8;let _0x23defa=_0x587895[_0x31e605(0x28e)](/^\++/,'');const _0x1fefed=_0x23defa[_0x31e605(0x313)]('+'),_0xcab4d1=_0x1fefed[_0x31e605(0x1d5)]>0x1?_0x1fefed[_0x31e605(0x1d5)]-0x2:0x0,_0x28470f=_0x1fefed[_0x1fefed[_0x31e605(0x1d5)]-0x1]||_0x23defa;return{'level':_0xcab4d1,'name':'+'+_0x28470f};}function truncateTaskName(_0x3a9b63,_0x2916f0){const _0x5a5cbc=a54_0x1978f8,_0x24073d=stringWidth(_0x3a9b63);if(_0x24073d<=_0x2916f0)return _0x3a9b63;let _0x57f279=_0x3a9b63;while(stringWidth(_0x57f279+'…')>_0x2916f0&&_0x57f279[_0x5a5cbc(0x1d5)]>0x0){_0x57f279=_0x57f279[_0x5a5cbc(0x23a)](0x0,-0x1);}return _0x57f279+'…';}function calculateTimeScale(_0x33aad6,_0x361559){const _0x3bbb6e=a54_0x1978f8;return{'startTime':_0x33aad6[_0x3bbb6e(0x23f)],'endTime':_0x33aad6['end'],'durationMs':_0x33aad6['duration'],'msPerChar':_0x33aad6[_0x3bbb6e(0x1d8)]/_0x361559};}function timeToPosition(_0x5f1c9c,_0x2f361f,_0xc4fa67){const _0x2cccf5=a54_0x1978f8,_0x15c760=_0x5f1c9c-_0x2f361f[_0x2cccf5(0x190)],_0x50c380=Math[_0x2cccf5(0x18c)](_0x15c760/_0x2f361f[_0x2cccf5(0x2ff)]);return Math['max'](0x0,Math[_0x2cccf5(0x264)](_0x50c380,_0xc4fa67));}function renderTimeAxis(_0x520a45,_0xd58fde){const _0x11d4bb=a54_0x1978f8,_0x158bb8=Math[_0x11d4bb(0x264)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x11d4bb(0x29c)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x11d4bb(0x18c)](_0xd58fde/TIMELINE_CONFIG[_0x11d4bb(0x1b3)]))),_0x47b1e4=_0x520a45[_0x11d4bb(0x1da)]/(_0x158bb8-0x1),_0x2fe096=new Date(_0x520a45[_0x11d4bb(0x190)]),_0x5b4c33=[];for(let _0x599616=0x0;_0x599616<_0x158bb8;_0x599616++){const _0x4a52aa=_0x520a45[_0x11d4bb(0x190)]+_0x599616*_0x47b1e4,_0x2876e1=timeToPosition(_0x4a52aa,_0x520a45,_0xd58fde),_0x23b7c8=formatTimestamp(_0x4a52aa,_0x2fe096);_0x5b4c33[_0x11d4bb(0x198)]({'pos':_0x2876e1,'text':_0x23b7c8});}const _0x47d3e1=new Array(_0xd58fde)[_0x11d4bb(0x226)]('\x20');let _0xf82215=-0x1;for(const {pos:_0x4f4eaa,text:_0x3ca562}of _0x5b4c33){let _0x34b250=Math[_0x11d4bb(0x29c)](0x0,_0x4f4eaa-Math['floor'](_0x3ca562[_0x11d4bb(0x1d5)]/0x2));_0x34b250<=_0xf82215+TIMELINE_CONFIG[_0x11d4bb(0x154)]&&(_0x34b250=_0xf82215+TIMELINE_CONFIG[_0x11d4bb(0x154)]+0x1);_0x34b250+_0x3ca562['length']>_0xd58fde&&(_0x34b250=_0xd58fde-_0x3ca562['length']);if(_0x34b250>=0x0&&_0x34b250+_0x3ca562[_0x11d4bb(0x1d5)]<=_0xd58fde&&_0x34b250>_0xf82215){for(let _0x186999=0x0;_0x186999<_0x3ca562[_0x11d4bb(0x1d5)];_0x186999++){_0x47d3e1[_0x34b250+_0x186999]=_0x3ca562[_0x186999];}_0xf82215=_0x34b250+_0x3ca562[_0x11d4bb(0x1d5)]-0x1;}}return _0x47d3e1['join']('');}function renderTaskRow(_0xfa5f5b,_0x4a8bc8,_0x1d0443,_0x7c6ba9){const _0x4724ec=a54_0x1978f8,{level:_0x1c2de7,name:_0x458b30}=parseTaskName(_0xfa5f5b['name']),_0x1907b6='\x20'[_0x4724ec(0x28f)](_0x1c2de7),_0x26b359=_0xfa5f5b['window']?'('+formatElapsed(_0xfa5f5b[_0x4724ec(0x179)][_0x4724ec(0x1d8)])+')':'',_0x236ed7=stringWidth(_0x26b359),_0x167b86=_0x1c2de7*0x1,_0x149f8b=_0x7c6ba9-_0x167b86-_0x236ed7-0x1,_0x1ec009=truncateTaskName(_0x458b30,_0x149f8b),_0x3e6444=_0x1907b6+_0x1ec009,_0x50dad0=stringWidth(_0x3e6444),_0x5c970e=_0x7c6ba9-_0x50dad0-_0x236ed7,_0x40eb00=_0x3e6444+'\x20'['repeat'](Math[_0x4724ec(0x29c)](0x1,_0x5c970e))+a54_0x4dcb08['dim'](_0x26b359),_0x194945=getTaskStateIcon(_0xfa5f5b[_0x4724ec(0x2cb)]),_0x47457a=new Array(_0x1d0443)[_0x4724ec(0x226)]('\x20');if(_0xfa5f5b[_0x4724ec(0x179)]){const _0x2cbd10=timeToPosition(_0xfa5f5b[_0x4724ec(0x179)][_0x4724ec(0x23f)],_0x4a8bc8,_0x1d0443),_0x53c539=timeToPosition(_0xfa5f5b[_0x4724ec(0x179)][_0x4724ec(0x28c)],_0x4a8bc8,_0x1d0443),_0x5c9571=getBarChar(_0xfa5f5b[_0x4724ec(0x2cb)]),_0x44c658=Math[_0x4724ec(0x29c)](_0x2cbd10+0x1,_0x53c539);for(let _0x1399ac=_0x2cbd10;_0x1399ac<Math[_0x4724ec(0x264)](_0x44c658,_0x1d0443);_0x1399ac++){_0x47457a[_0x1399ac]=_0x5c9571;}}const _0x217021=getBarColor(_0xfa5f5b[_0x4724ec(0x2cb)]),_0x3db565=_0x47457a[_0x4724ec(0x1f0)](_0xfeeff5=>_0xfeeff5==='\x20'?'\x20':_0x217021(_0xfeeff5))[_0x4724ec(0x302)]('');return _0x194945+'\x20'+_0x40eb00+'│'+_0x3db565+'│';}function calculateStats(_0x4704f3){const _0x468fa9=a54_0x1978f8,_0x5dbdc5={'total':_0x4704f3['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4d02f4 of _0x4704f3){if(_0x4d02f4[_0x468fa9(0x2cb)]===_0x468fa9(0x1e7))_0x5dbdc5[_0x468fa9(0x1e7)]++;else{if(_0x4d02f4['state']===_0x468fa9(0x1a6)||_0x4d02f4[_0x468fa9(0x2cb)]===_0x468fa9(0x2bc))_0x5dbdc5[_0x468fa9(0x1a6)]++;else _0x4d02f4[_0x468fa9(0x2cb)]===_0x468fa9(0x20a)?_0x5dbdc5[_0x468fa9(0x20a)]++:_0x5dbdc5[_0x468fa9(0x1fb)]++;}}return _0x5dbdc5;}function a54_0x4909(){const _0x14e38e=['Pulling\x20project\x20','yellow','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20modified','Cancelled','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','select','workflow:retry','getDate','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:secrets:set','Error:\x20Project\x20name\x20is\x20required','running','Listing\x20workflows...','No\x20workflow\x20tdx.json\x20found','size','nextRunTime','utf-8','\x20\x20Changes:\x20','applyPullProject','match','projectId','limit','targetExists','now','attemptId','\x20(use\x20--limit\x20to\x20show\x20more)','✔\x20Clone\x20complete','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','retrySession','tdx\x20wf\x20attempt\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Params:\x20','\x0aPolling...\x20(','📁\x20','Error:\x20Attempt\x20ID\x20is\x20required','Analyzing\x20changes...','workflow:workflows','No\x20matching\x20sessions\x20found','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','fill','revision:\x20','\x20tasks','/sessions/','\x20unchanged','trimEnd','requireProject','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:pull','No\x20workflows\x20found','renderSingleTimeline','fileSize','/attempt/','No\x20projects\x20match\x20pattern:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','red','pollTimeline','\x20new','renderSessionsTimeline','slice','showWorkflowConsoleUrl','skipValidation','sort','Downloading\x20project\x20','start','workflow:delete','attempts','message','includes','Source\x20directory\x20is\x20required','sessionId','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','tdx.json','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project\x20name\x20is\x20required','newProjectName','\x20(system)','sourceProjectName','dim','attempt:','set','Retrying\x20session...','Schedule\x20ID\x20is\x20required','\x20\x20Console:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','tasks','Session\x20','list','session_id','\x0aDry\x20run\x20-\x20no\x20files\x20written','done','No\x20workflow\x20projects\x20found','Revision:\x20','6039675ubXUhL','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','substring','executeCloneProject','New\x20project\x20name:\x20','Deleting\x20secret...','\x20\x20Project:\x20','\x20\x20Attempt\x20ID:\x20','min','-\x20no\x20files\x20written','padStart','toISOString','\x20\x20Next\x20run:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','MAX_TASKS_DISPLAY','Source:\x20','retryAttemptName','✔\x20Schedule\x20#','force','---\x20','projects','Using\x20attempt\x20','stdout','name','💡\x20Tip:\x20Use\x20','setSecrets','updatedAt','sys','\x22\x20already\x20exists\x20(ID:\x20','param','No\x20sessions\x20with\x20timing\x20information','\x1b[1A\x1b[2K','isNewProject','disableSchedule','resolveProject','summary','workflow:sessions','fromTask','workflowName','workflow:logs','Failed\x20to\x20fetch\x20attempt\x20data','navigateSessionsInteractive','pullProject','getMinutes','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Error:\x20Secret\x20key\x20is\x20required','workflowProject','Listing\x20secrets...','end','Latest\x20session\x20has\x20no\x20attempt','replace','repeat','1133778BhVuSN','List\x20workflow\x20attempts','filesExtracted','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','sourceDir','workflow:secrets:delete','✔\x20Push\x20complete','data','📅\x20#','\x0a✔\x20Attempt\x20complete','✔\x20Found\x20','parse','max','Select\x20a\x20task\x20to\x20view\x20logs:','3oOvSEI','ICON_WIDTH','Filter:\x20','\x20\x20Source:\x20','✔\x20Retry\x20started','find','Error:','text','getMonth','\x27\x20from\x20project\x20\x27','\x20secrets\x20set\x20for\x20project\x20\x27','renderTimeline','workflows','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','green','toLocaleString','workflow:secrets:list','\x20enabled\x20(','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Project:\x20','resolve','Fetching\x20log\x20files...','Project\x20directory:\x20','\x22\x20with\x20new\x20revision?','attempt','\x20\x20Location:\x20','modified','hasChanges','\x0aError:','Project\x20name:\x20','group_error','status','✔\x20Project:\x20','kill','columns','cwd','buildTimelineData','toLowerCase','✔\x20Pushed\x20','unknown','Dry\x20run:\x20yes','createdAt','task','Setting\x20secret...','workflow:upload','state','new','Start\x20a\x20workflow\x20run','relative','✔\x20Secret\x20\x27','total','Including\x20subtasks:\x20yes','Task\x20name:\x20','canceling','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','startedAt','isTTY','Setting\x20','(use\x20--limit\x20to\x20see\x20more)','getFullYear','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','→\x20Project:\x20','Retry\x20a\x20session\x20or\x20attempt','✔\x20Downloaded\x20','Resolving\x20project\x20\x27','clear','value','Target\x20directory:\x20','some','site','planned','\x20logs','lastAttempt','Listing\x20workflow\x20attempts...','log','MAX_TIMELINE_WIDTH','\x20\x20New\x20attempt\x20ID:\x20','\x20next:\x20','type','session','\x20\x20Revision:\x20','newProjectId','Source\x20directory:\x20','logs','✔\x20Showing\x20','Status:\x20','✔\x20Pull\x20complete','Workflow:\x20','startsWith','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:attempt','Usage:\x20workflow:delete\x20<project-name-or-id>','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Source\x20project:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','delete','msPerChar','ICON_SPACING','project','join','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','No\x20workflow\x20sessions\x20found','Starting\x20workflow\x20run...','projectName','getTime','Validation:\x20skipped','🔄\x20','1490240YREyyf','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0a⚠\x20Project\x20\x22','TASK_NAME_WIDTH','\x20task','cyan','workflow:download','/app/workflows/','No\x20sessions\x20found\x20for:\x20','split','resumeFrom','executePushProject','\x20\x20Project\x20ID:\x20','key','Updating\x20','LABEL_MIN_SPACING','Enabling\x20schedule\x20#','verbose','Tip:\x20cd\x20to\x20workflows/','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','257234cwtNvg','✔\x20Workflow\x20run\x20started','Loading\x20sessions...','No\x20attempts\x20found','\x0aUpdate\x20existing\x20project\x20\x22','Pushing\x20project...','blue','\x0aPush\x20these\x20changes?','\x20deleted','Secrets\x20to\x20set:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','targetDir','localeCompare','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','json','download','follow','session:','title','Killing\x20attempt...','Auto-selected\x20latest\x20session:\x20','Pushing\x20workflow\x20project...','workflow:timeline','sessions','\x20session','Listing\x20schedules...','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','7532uiZCAg','splice','✔\x20Workflow\x20project\x20context\x20cleared.','window','Include\x20retried:\x20yes','\x22\x20to\x20new\x20project\x20\x22','\x27...','autocomplete','deleted','workflow:run','workflow:clone','rows','from','stat','round','\x20sessions\x20','930951HsFgni','⚠\x20Showing\x20first\x20','yes','keys','deleteSecret','index','floor','get','Warning:','Output\x20directory:\x20','startTime','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','5799328DCvBiJ','Loading\x20session...','isDirectory','\x0aApply\x20these\x20changes?','✔\x20Project\x20updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','push','...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','description','Kill\x20a\x20running\x20attempt','\x20\x20Workflow:\x20','(unknown)','\x0a✔\x20No\x20changes\x20to\x20push','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Writing\x20files...','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x20\x20Session\x20context\x20set\x20to:\x20','Deleting\x20project\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','error','85dijeHr','format','workflow:push','Total:\x20','icon','listSecrets','\x20schedule','displayLine','revision','Key:\x20','cancelRequested','dryRun','LABEL_WIDTH_DIVISOR','No\x20workflows\x20found\x20in\x20project:\x20','\x20(disabled)','Reason:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','output','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','all','Pull\x20workflow\x20project\x20to\x20local\x20folder','params','execute','Session\x20not\x20found:\x20','\x20has\x20no\x20attempts','Resume\x20from:\x20','From\x20task:\x20','workflow:tasks','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','parseProjectWorkflowPattern','jsonl','isArray','No\x20sessions\x20found\x20in\x20project:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Retrying\x20attempt...','readFile','indexOf','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found','unchanged','Attempt\x20ID:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','context','table','Show\x20specific\x20attempt\x20details','length',',\x20Workflow:\x20','workflow:projects','duration','No\x20attempts\x20found\x20in\x20project:\x20','durationMs','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','finishedAt','fullName','Enable\x20a\x20workflow\x20schedule','sessionTime','workflow:schedule:enable','📋\x20','workflow:attempts','fileCount','Key\x20cannot\x20be\x20empty','success','Target:\x20','\x20workflow','\x20-\x20','Select\x20a\x20workflow\x20to\x20run','resolveProjectId','filter','POLL_INTERVAL_MS','workflow','map','write','white','Filter:\x20project=','\x0aClone\x20\x22','MIN_TIMELINE_WIDTH','has','\x20is\x20not\x20a\x20directory','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','fs/promises','\x20\x20Files\x20extracted:\x20','pending','generateSessionTimelineRows','Loading\x20workflows...'];a54_0x4909=function(){return _0x14e38e;};return a54_0x4909();}function formatStats(_0x15779d){const _0x5e8c96=a54_0x1978f8;return[_0x5e8c96(0x1aa)+_0x15779d[_0x5e8c96(0x2d0)],'✅\x20'+_0x15779d[_0x5e8c96(0x1e7)],'❌\x20'+_0x15779d[_0x5e8c96(0x1a6)],_0x5e8c96(0x309)+_0x15779d[_0x5e8c96(0x20a)],'⏳\x20'+_0x15779d[_0x5e8c96(0x1fb)]][_0x5e8c96(0x302)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x171);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x21a);async[a54_0x1978f8(0x1bd)](_0x19c3a1){const _0xaf37b6=a54_0x1978f8,{options:_0x2ed5cd,args:_0x129a79,tdx:_0x31bb27}=_0x19c3a1;let _0x44704a,_0x4665f8,_0x10684e=![];if(_0x129a79[0x0]){if(_0x129a79[0x0]['includes']('.')){const _0x20cd4a=this[_0xaf37b6(0x1c5)](_0x129a79,_0x2ed5cd);if(!_0x20cd4a)return 0x1;_0x44704a=_0x20cd4a['projectName'],_0x4665f8=_0x20cd4a['workflowName'];}else{_0x4665f8=_0x129a79[0x0],_0x44704a=_0x2ed5cd[_0xaf37b6(0x28a)];if(!_0x44704a)return console[_0xaf37b6(0x1a6)](a54_0x4dcb08[_0xaf37b6(0x236)](_0xaf37b6(0x2a4)),_0xaf37b6(0x1cd)),0x1;_0x10684e=!![];}}else{const _0x366844=this['parseProjectWorkflowPattern'](_0x129a79,_0x2ed5cd);if(!_0x366844)return 0x1;_0x44704a=_0x366844[_0xaf37b6(0x306)],_0x4665f8=_0x366844[_0xaf37b6(0x282)];}if(_0x2ed5cd[_0xaf37b6(0x156)]){if(_0x44704a&&_0x4665f8)console[_0xaf37b6(0x1a6)](_0xaf37b6(0x2a0)+_0x44704a+'.'+_0x4665f8);else _0x44704a&&console[_0xaf37b6(0x1a6)](_0xaf37b6(0x1f3)+_0x44704a);}const _0x21feac=_0x2ed5cd[_0xaf37b6(0x217)],_0x2c9f9b=_0x2ed5cd[_0xaf37b6(0x245)];if(_0x21feac){_0x2c9f9b&&console['error'](a54_0x4dcb08[_0xaf37b6(0x1ff)](_0xaf37b6(0x18e)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0xd04d6e=_0x2ed5cd[_0xaf37b6(0x16b)];return _0xd04d6e?await this[_0xaf37b6(0x237)](_0x19c3a1,_0x21feac):await this['renderSingleTimeline'](_0x19c3a1,_0x21feac,_0x2ed5cd),0x0;}if(_0x2c9f9b){const _0x2671d8=await withSpinner(_0xaf37b6(0x193),()=>_0x31bb27[_0xaf37b6(0x1ef)]['sessions']({'projectName':_0x44704a,'workflowName':_0x4665f8,'limit':0x64}),{'verbose':_0x2ed5cd[_0xaf37b6(0x156)]}),_0x5f03c0=_0x2671d8[_0xaf37b6(0x297)][_0xaf37b6(0x2a3)](_0x2dfb8f=>_0x2dfb8f['id']===_0x2c9f9b);if(!_0x5f03c0)return console[_0xaf37b6(0x1a6)](a54_0x4dcb08[_0xaf37b6(0x236)]('Error:'),_0xaf37b6(0x1be)+_0x2c9f9b),0x1;if(!_0x5f03c0[_0xaf37b6(0x2e6)]?.['id'])return console[_0xaf37b6(0x1a6)](a54_0x4dcb08['red'](_0xaf37b6(0x2a4)),_0xaf37b6(0x255)+_0x2c9f9b+_0xaf37b6(0x1bf)),0x1;const _0x58fcc0=_0x5f03c0[_0xaf37b6(0x2e6)]['id'];_0x2ed5cd[_0xaf37b6(0x156)]&&console['error'](_0xaf37b6(0x271)+_0x58fcc0+'\x20from\x20session\x20'+_0x2c9f9b);const _0x46d791=_0x2ed5cd['follow'];return _0x46d791?await this[_0xaf37b6(0x237)](_0x19c3a1,_0x58fcc0):await this[_0xaf37b6(0x231)](_0x19c3a1,_0x58fcc0,_0x2ed5cd),0x0;}const _0x16d670=await withSpinner(_0xaf37b6(0x15b),()=>_0x31bb27[_0xaf37b6(0x1ef)][_0xaf37b6(0x172)]({'projectName':_0x44704a,'workflowName':_0x4665f8,'limit':_0x2ed5cd[_0xaf37b6(0x214)]||0x32}),{'verbose':_0x2ed5cd['verbose']}),_0x58bddc=_0x16d670['data'];if(_0x58bddc['length']===0x0){if(_0x44704a&&_0x4665f8)console['error'](_0xaf37b6(0x312)+_0x44704a+'.'+_0x4665f8);else _0x44704a?console[_0xaf37b6(0x1a6)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x44704a):(console['error'](_0xaf37b6(0x304)),console[_0xaf37b6(0x1a6)](a54_0x4dcb08['dim'](_0xaf37b6(0x1b7))));return 0x0;}_0x58bddc[_0xaf37b6(0x23d)]((_0x53b413,_0x2b95cf)=>{const _0x37f513=_0xaf37b6,_0x1326d9=_0x53b413[_0x37f513(0x1e1)]||'',_0x5ac8e8=_0x2b95cf[_0x37f513(0x1e1)]||'';return _0x5ac8e8['localeCompare'](_0x1326d9);});if(_0x2ed5cd[_0xaf37b6(0x169)]||_0x2ed5cd[_0xaf37b6(0x1c6)])return await handleSDKOutput(_0x58bddc,_0x2ed5cd),0x0;let _0x4fe7a9;if(_0x10684e){const _0x4d5833=_0x58bddc[0x0];if(!_0x4d5833[_0xaf37b6(0x2e6)]?.['id'])return console['error'](_0xaf37b6(0x28d)),0x0;_0x4fe7a9=_0x4d5833[_0xaf37b6(0x2e6)]['id'],_0x2ed5cd['verbose']&&console[_0xaf37b6(0x1a6)](_0xaf37b6(0x16f)+_0x4d5833[_0xaf37b6(0x1e1)]);}else{const _0x55a914=_0x58bddc[_0xaf37b6(0x1f0)](_0x441a85=>{const _0x2f7b0e=_0xaf37b6,_0x2c8153=getAttemptStatusDisplay(_0x441a85[_0x2f7b0e(0x2e6)]);return{'title':_0x441a85[_0x2f7b0e(0x301)]?.['name']+'.'+_0x441a85['workflow']?.[_0x2f7b0e(0x273)]+'\x20-\x20'+_0x441a85[_0x2f7b0e(0x1e1)]+'\x20'+_0x2c8153[_0x2f7b0e(0x1ab)],'value':_0x441a85['lastAttempt']?.['id']||'','description':_0x2c8153[_0x2f7b0e(0x2a5)]};}),_0x548545=await a54_0x51a435({'type':_0xaf37b6(0x204),'name':_0xaf37b6(0x217),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x55a914['filter'](_0x5db10b=>_0x5db10b[_0xaf37b6(0x2e0)]!=='')});if(!_0x548545[_0xaf37b6(0x217)])return 0x0;_0x4fe7a9=_0x548545[_0xaf37b6(0x217)];}const _0x55ec48=_0x2ed5cd[_0xaf37b6(0x16b)];return _0x55ec48?await this[_0xaf37b6(0x237)](_0x19c3a1,_0x4fe7a9):await this[_0xaf37b6(0x231)](_0x19c3a1,_0x4fe7a9,_0x2ed5cd),0x0;}async[a54_0x1978f8(0x231)](_0x333320,_0x4f33a1,_0x3280b4){const _0x5e4b9f=a54_0x1978f8,{tdx:_0x6eabc7}=_0x333320;let _0x2719b6,_0x17f4bd;try{[_0x2719b6,_0x17f4bd]=await Promise[_0x5e4b9f(0x1ba)]([_0x6eabc7[_0x5e4b9f(0x1ef)][_0x5e4b9f(0x2b6)](_0x4f33a1),_0x6eabc7[_0x5e4b9f(0x1ef)][_0x5e4b9f(0x254)](_0x4f33a1,![])]);}catch(_0x381b91){console[_0x5e4b9f(0x1a6)](a54_0x4dcb08['red'](_0x5e4b9f(0x284)));_0x3280b4[_0x5e4b9f(0x156)]&&console[_0x5e4b9f(0x1a6)](_0x381b91);throw _0x381b91;}if(_0x3280b4['json']||_0x3280b4[_0x5e4b9f(0x1c6)]){const _0x5ae120=this[_0x5e4b9f(0x2c2)](_0x2719b6,_0x17f4bd);await handleSDKOutput([_0x5ae120],_0x3280b4);return;}const _0x51acdf=_0x6eabc7['context'][_0x5e4b9f(0x2e3)],_0x2987bf=this[_0x5e4b9f(0x2a9)](_0x2719b6,_0x17f4bd,_0x51acdf);console[_0x5e4b9f(0x2e8)](_0x2987bf);}async[a54_0x1978f8(0x237)](_0x513f21,_0x43a969){const _0x317cd7=a54_0x1978f8,{tdx:_0x227d47}=_0x513f21,_0x59cc5b=TIMELINE_CONFIG[_0x317cd7(0x1ee)],_0x4b8fe8=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x380359=0x0;while(_0x380359<_0x4b8fe8){process['stdout']['isTTY']&&process[_0x317cd7(0x272)]['write']('\x1bc');let _0x1b3764,_0x2551d2;try{[_0x1b3764,_0x2551d2]=await Promise[_0x317cd7(0x1ba)]([_0x227d47[_0x317cd7(0x1ef)][_0x317cd7(0x2b6)](_0x43a969),_0x227d47[_0x317cd7(0x1ef)][_0x317cd7(0x254)](_0x43a969,![])]);}catch(_0x7161a1){console[_0x317cd7(0x1a6)](a54_0x4dcb08[_0x317cd7(0x236)](_0x317cd7(0x22d)));_0x380359>0x0&&console[_0x317cd7(0x1a6)](a54_0x4dcb08[_0x317cd7(0x24d)](_0x317cd7(0x293)+_0x380359));throw _0x7161a1;}const _0x359568=_0x227d47[_0x317cd7(0x1d2)][_0x317cd7(0x2e3)],_0x1dd26e=this[_0x317cd7(0x2a9)](_0x1b3764,_0x2551d2,_0x359568);console['log'](_0x1dd26e);const _0x10c698=_0x1b3764[_0x317cd7(0x259)]&&_0x2551d2['every'](_0x55ffd8=>_0x55ffd8[_0x317cd7(0x2cb)]!==_0x317cd7(0x20a)&&_0x55ffd8['state']!==_0x317cd7(0x2e4));if(_0x10c698){console['error'](a54_0x4dcb08[_0x317cd7(0x2ac)](_0x317cd7(0x299)));break;}console[_0x317cd7(0x1a6)](a54_0x4dcb08['dim'](_0x317cd7(0x21f)+_0x380359*0x2+_0x317cd7(0x200))),await new Promise(_0x259872=>setTimeout(_0x259872,_0x59cc5b)),_0x380359++;}_0x380359>=_0x4b8fe8&&console[_0x317cd7(0x1a6)](a54_0x4dcb08['yellow'](_0x317cd7(0x1c3)));}['renderTimeline'](_0x4919fe,_0x37c768,_0x502d83){const _0x1db4c8=a54_0x1978f8,_0x32dbf3=[],_0x296907=TIMELINE_CONFIG[_0x1db4c8(0x30d)],_0x5bbed9=0x5,_0x4bde2e=process[_0x1db4c8(0x272)][_0x1db4c8(0x2c0)]||0x78,_0x38f9d0=_0x4bde2e-_0x296907-_0x5bbed9,_0x45df5a=Math[_0x1db4c8(0x29c)](TIMELINE_CONFIG[_0x1db4c8(0x1f5)],Math[_0x1db4c8(0x264)](_0x38f9d0,TIMELINE_CONFIG[_0x1db4c8(0x2e9)])),_0x284b0f=new Date(_0x4919fe[_0x1db4c8(0x2c7)])[_0x1db4c8(0x307)](),_0x3c9ece=_0x4919fe[_0x1db4c8(0x1de)]?new Date(_0x4919fe[_0x1db4c8(0x1de)])['getTime']():Date[_0x1db4c8(0x216)](),_0x423109={'start':_0x284b0f,'end':_0x3c9ece,'duration':_0x3c9ece-_0x284b0f},_0x1c65dc=new Map(),_0x25f238=[];for(const _0x5a6830 of _0x37c768){if(_0x5a6830[_0x1db4c8(0x2d5)]){const _0x45932a=new Date(_0x5a6830['startedAt'])[_0x1db4c8(0x307)](),_0x45e2ed=_0x5a6830[_0x1db4c8(0x276)]?new Date(_0x5a6830[_0x1db4c8(0x276)])[_0x1db4c8(0x307)]():Date[_0x1db4c8(0x216)](),_0x462935={'start':_0x45932a,'end':_0x45e2ed,'duration':_0x45e2ed-_0x45932a};_0x1c65dc[_0x1db4c8(0x24f)](_0x5a6830['id'],_0x462935),_0x25f238[_0x1db4c8(0x198)]({'name':_0x5a6830[_0x1db4c8(0x1df)],'state':_0x5a6830['state']||_0x1db4c8(0x2c5),'window':_0x462935});}else _0x25f238[_0x1db4c8(0x198)]({'name':_0x5a6830['fullName'],'state':_0x5a6830[_0x1db4c8(0x2cb)]||'planned','window':undefined});}_0x25f238[_0x1db4c8(0x23d)]((_0x27eb19,_0x220c73)=>{const _0x29fa15=_0x1db4c8;if(!_0x27eb19[_0x29fa15(0x179)])return 0x1;if(!_0x220c73['window'])return-0x1;return _0x27eb19[_0x29fa15(0x179)][_0x29fa15(0x23f)]-_0x220c73['window']['start'];});const _0x2c83a9=_0x25f238['length'],_0x587ca4=_0x2c83a9>TIMELINE_CONFIG[_0x1db4c8(0x26a)];_0x587ca4&&_0x25f238[_0x1db4c8(0x177)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x2a924b=calculateTimeScale(_0x423109,_0x45df5a),_0x228380=_0x4919fe['done']?_0x4919fe[_0x1db4c8(0x1e7)]?a54_0x4dcb08[_0x1db4c8(0x2ac)](_0x1db4c8(0x1e7)):a54_0x4dcb08[_0x1db4c8(0x236)]('error'):a54_0x4dcb08[_0x1db4c8(0x15f)](_0x1db4c8(0x20a)),_0x580686=_0x4919fe['project']?.['id'],_0x11c940=_0x4919fe[_0x1db4c8(0x245)];let _0x557371;if(_0x580686&&_0x11c940){const _0x5b3449=getWorkflowAttemptUrl(_0x502d83,_0x580686,_0x11c940,_0x4919fe['id']);_0x557371=hyperlink(a54_0x4dcb08[_0x1db4c8(0x24d)](_0x4919fe['id']),_0x5b3449);}else _0x557371=a54_0x4dcb08[_0x1db4c8(0x24d)](_0x4919fe['id']);_0x32dbf3['push']('Attempt:\x20'+_0x557371+_0x1db4c8(0x1ea)+_0x228380+'\x20-\x20'+formatElapsed(_0x423109['duration']));if(_0x25f238[_0x1db4c8(0x1d5)]>0x0){const _0x37cc17=renderTimeAxis(_0x2a924b,_0x45df5a),_0x5a33d0=new Date(_0x423109[_0x1db4c8(0x23f)]),_0x4e8448=formatDate(_0x5a33d0),_0xcd174e=TIMELINE_CONFIG[_0x1db4c8(0x29f)]+TIMELINE_CONFIG[_0x1db4c8(0x300)]+_0x296907,_0x5e5a79=_0x4e8448['padStart'](_0xcd174e),_0x3e23c2=a54_0x4dcb08[_0x1db4c8(0x24d)](_0x5e5a79);_0x32dbf3[_0x1db4c8(0x198)](_0x3e23c2+'\x20'+_0x37cc17);for(const _0x516979 of _0x25f238){_0x32dbf3['push'](renderTaskRow(_0x516979,_0x2a924b,_0x45df5a,_0x296907));}const _0x28f1ba=calculateStats(_0x25f238);_0x32dbf3[_0x1db4c8(0x198)](formatStats(_0x28f1ba)),_0x587ca4&&_0x32dbf3['push'](a54_0x4dcb08[_0x1db4c8(0x1ff)](_0x1db4c8(0x187)+TIMELINE_CONFIG[_0x1db4c8(0x26a)]+'\x20of\x20'+_0x2c83a9+_0x1db4c8(0x228))),_0x32dbf3[_0x1db4c8(0x198)](''),_0x32dbf3[_0x1db4c8(0x198)](a54_0x4dcb08[_0x1db4c8(0x24d)](_0x1db4c8(0x274))+(_0x1db4c8(0x21c)+_0x4919fe['id']+_0x1db4c8(0x2e5))+a54_0x4dcb08['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x32dbf3[_0x1db4c8(0x198)](_0x1db4c8(0x2f8));return _0x32dbf3[_0x1db4c8(0x302)]('\x0a');}[a54_0x1978f8(0x2c2)](_0x1c8421,_0x353534){const _0x33f321=a54_0x1978f8,_0x33f2db=new Date(_0x1c8421['createdAt'])[_0x33f321(0x307)](),_0x4bd8b5=_0x1c8421[_0x33f321(0x1de)]?new Date(_0x1c8421[_0x33f321(0x1de)])['getTime']():Date['now'](),_0x2e5812=_0x4bd8b5-_0x33f2db,_0x5b1831=[];for(const _0x222def of _0x353534){if(_0x222def[_0x33f321(0x2d5)]){const _0x4a3aa7=new Date(_0x222def[_0x33f321(0x2d5)])['getTime'](),_0x2130ed=_0x222def[_0x33f321(0x276)]?new Date(_0x222def[_0x33f321(0x276)])['getTime']():Date[_0x33f321(0x216)]();_0x5b1831[_0x33f321(0x198)]({'name':_0x222def[_0x33f321(0x1df)],'state':_0x222def['state']||_0x33f321(0x2c5),'window':{'start':_0x4a3aa7,'end':_0x2130ed,'duration':_0x2130ed-_0x4a3aa7}});}else _0x5b1831[_0x33f321(0x198)]({'name':_0x222def[_0x33f321(0x1df)],'state':_0x222def[_0x33f321(0x2cb)]||_0x33f321(0x2e4),'window':undefined});}const _0x3484e3=calculateStats(_0x5b1831);return{'attempt':{'id':_0x1c8421['id'],'status':_0x1c8421[_0x33f321(0x259)]?_0x1c8421[_0x33f321(0x1e7)]?_0x33f321(0x1e7):_0x33f321(0x1a6):_0x33f321(0x20a),'createdAt':_0x1c8421['createdAt'],'finishedAt':_0x1c8421[_0x33f321(0x1de)],'duration_ms':_0x2e5812},'tasks':_0x5b1831['map'](_0x5ae4a2=>({'name':_0x5ae4a2[_0x33f321(0x273)],'state':_0x5ae4a2[_0x33f321(0x2cb)],'startedAt':_0x5ae4a2['window']?new Date(_0x5ae4a2['window'][_0x33f321(0x23f)])[_0x33f321(0x267)]():null,'updatedAt':_0x5ae4a2['window']?new Date(_0x5ae4a2['window']['end'])['toISOString']():null,'duration_ms':_0x5ae4a2[_0x33f321(0x179)]?.[_0x33f321(0x1d8)]||null})),'stats':_0x3484e3};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x1978f8(0x273)]='workflow:schedules';[a54_0x1978f8(0x19b)]='List\x20workflow\x20schedules';async['execute'](_0x472e74){const _0x26fec7=a54_0x1978f8,{options:_0xb97722,tdx:_0x169441}=_0x472e74,_0x222275=await withSpinner(_0x26fec7(0x174),()=>_0x169441['workflow']['listSchedules'](),{'verbose':_0xb97722['verbose']}),_0x3e7e09=_0x222275[_0x26fec7(0x297)];console['error']('✔\x20Found\x20'+_0x3e7e09['length']+_0x26fec7(0x1ad)+(_0x3e7e09[_0x26fec7(0x1d5)]!==0x1?'s':''));if(isStructuredFormat(_0xb97722))await handleSDKOutput(_0x3e7e09,_0xb97722);else{if(_0x3e7e09[_0x26fec7(0x1d5)]===0x0)console[_0x26fec7(0x2e8)]('No\x20schedules\x20found');else for(const _0x20453e of _0x3e7e09){const _0x382772=_0x20453e['disabledAt']?a54_0x4dcb08[_0x26fec7(0x1ff)](_0x26fec7(0x1b5)):'',_0x13a95f=_0x20453e['project']?.[_0x26fec7(0x273)]?a54_0x4dcb08[_0x26fec7(0x24d)]('\x20['+_0x20453e['project'][_0x26fec7(0x273)]+']'):'',_0xec6c21=_0x20453e[_0x26fec7(0x20e)]?a54_0x4dcb08[_0x26fec7(0x24d)](_0x26fec7(0x2eb)+new Date(_0x20453e[_0x26fec7(0x20e)])['toLocaleString']()):'';console['log'](_0x26fec7(0x298)+_0x20453e['id']+'\x20'+(_0x20453e[_0x26fec7(0x1ef)]?.[_0x26fec7(0x273)]||_0x26fec7(0x19e))+_0x13a95f+_0x382772+_0xec6c21);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x1978f8(0x273)]=a54_0x1978f8(0x1e2);[a54_0x1978f8(0x19b)]=a54_0x1978f8(0x1e0);async[a54_0x1978f8(0x1bd)](_0x193d29){const _0x2d0de7=a54_0x1978f8,{options:_0x27eef2,args:_0x27b1d4,tdx:_0x40675b}=_0x193d29,_0x4d5d8b=_0x27b1d4[0x0];if(!_0x4d5d8b)return console[_0x2d0de7(0x1a6)](a54_0x4dcb08[_0x2d0de7(0x236)]('Error:'),_0x2d0de7(0x251)),console['error'](a54_0x4dcb08[_0x2d0de7(0x24d)](_0x2d0de7(0x1a2))),console[_0x2d0de7(0x1a6)](a54_0x4dcb08[_0x2d0de7(0x24d)](_0x2d0de7(0x2fb))),0x1;const _0x4d317a=await withSpinner(_0x2d0de7(0x155)+_0x4d5d8b+_0x2d0de7(0x199),()=>_0x40675b[_0x2d0de7(0x1ef)]['enableSchedule'](_0x4d5d8b),{'verbose':_0x27eef2[_0x2d0de7(0x156)]}),_0x2c6c3d=_0x4d317a[_0x2d0de7(0x297)];return isStructuredFormat(_0x27eef2)?await handleSingleObjectOutput(_0x2c6c3d,_0x27eef2):(console[_0x2d0de7(0x2e8)](_0x2d0de7(0x26d)+_0x4d5d8b+_0x2d0de7(0x2af)+(_0x2c6c3d[_0x2d0de7(0x1ef)]?.['name']||_0x2d0de7(0x2c5))+')'),_0x2c6c3d[_0x2d0de7(0x20e)]&&console[_0x2d0de7(0x2e8)](a54_0x4dcb08[_0x2d0de7(0x24d)](_0x2d0de7(0x268)+new Date(_0x2c6c3d[_0x2d0de7(0x20e)])[_0x2d0de7(0x2ad)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x1978f8(0x273)]='workflow:schedule:disable';[a54_0x1978f8(0x19b)]='Disable\x20a\x20workflow\x20schedule';async['execute'](_0x45709c){const _0x4bf960=a54_0x1978f8,{options:_0x5aeb23,args:_0xacd921,tdx:_0x438106}=_0x45709c,_0x46882e=_0xacd921[0x0];if(!_0x46882e)return console[_0x4bf960(0x1a6)](a54_0x4dcb08['red'](_0x4bf960(0x2a4)),_0x4bf960(0x251)),console[_0x4bf960(0x1a6)](a54_0x4dcb08['dim']('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x4bf960(0x1a6)](a54_0x4dcb08[_0x4bf960(0x24d)](_0x4bf960(0x2fb))),0x1;const _0x24511a=await withSpinner('Disabling\x20schedule\x20#'+_0x46882e+_0x4bf960(0x199),()=>_0x438106[_0x4bf960(0x1ef)][_0x4bf960(0x27d)](_0x46882e),{'verbose':_0x5aeb23[_0x4bf960(0x156)]}),_0x381abd=_0x24511a[_0x4bf960(0x297)];return isStructuredFormat(_0x5aeb23)?await handleSingleObjectOutput(_0x381abd,_0x5aeb23):console[_0x4bf960(0x2e8)](_0x4bf960(0x26d)+_0x46882e+'\x20disabled\x20('+(_0x381abd['workflow']?.[_0x4bf960(0x273)]||'unknown')+')'),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 a55_0x3d43(){const _0x581cfe=['X-Trino-User','33036beIefs','1614bDAjrQ','tdx',';\x20node/','338066zusuOB','tdx/','Authorization','1699173UMHtMP','1423870NCEJjw','150QJXBBI','1089GbAdge','3215304aEYNGL','entries','length','version','165712LwAaPr','Bearer\x20','161bHuBjI'];a55_0x3d43=function(){return _0x581cfe;};return a55_0x3d43();}(function(_0x39d0b6,_0x3c2d56){const _0x3d6f06=a55_0x1668,_0xae89e=_0x39d0b6();while(!![]){try{const _0x5b1761=parseInt(_0x3d6f06(0xdb))/0x1+parseInt(_0x3d6f06(0xd8))/0x2*(-parseInt(_0x3d6f06(0xe1))/0x3)+parseInt(_0x3d6f06(0xd7))/0x4*(parseInt(_0x3d6f06(0xe0))/0x5)+parseInt(_0x3d6f06(0xcf))/0x6+-parseInt(_0x3d6f06(0xd5))/0x7*(parseInt(_0x3d6f06(0xd3))/0x8)+-parseInt(_0x3d6f06(0xde))/0x9+parseInt(_0x3d6f06(0xdf))/0xa;if(_0x5b1761===_0x3c2d56)break;else _0xae89e['push'](_0xae89e['shift']());}catch(_0x247716){_0xae89e['push'](_0xae89e['shift']());}}}(a55_0x3d43,0x4ab1b));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 _0x42a300=a55_0x1668,_0x47ba2e=getVersion(),_0x2ade97=platform(),_0x777479=process[_0x42a300(0xd2)]['replace']('v','');return _0x42a300(0xdc)+_0x47ba2e+'\x20('+_0x2ade97+_0x42a300(0xda)+_0x777479+')';}export function getAuthHeaders(_0x31c8a3,_0x5681c2,_0x58bef9){const _0x1d492a=a55_0x1668,_0x7c7d74=getVersion(),_0x12f820={'User-Agent':getUserAgent(),'X-TD-Client':_0x1d492a(0xd9),'X-TD-Client-Version':_0x7c7d74};if(_0x58bef9)_0x12f820[_0x1d492a(0xdd)]=_0x1d492a(0xd4)+_0x58bef9;else _0x5681c2&&(_0x12f820[_0x1d492a(0xdd)]='TD1\x20'+_0x5681c2);return _0x12f820;}function a55_0x1668(_0x54a1ab,_0x52f481){_0x54a1ab=_0x54a1ab-0xcf;const _0x3d43f6=a55_0x3d43();let _0x16680c=_0x3d43f6[_0x54a1ab];return _0x16680c;}export function toHeaderRecord(_0x67799d){const _0x23d2da=a55_0x1668,_0x4b570f={};for(const [_0x3e92b2,_0x441c56]of Object[_0x23d2da(0xd0)](_0x67799d)){_0x441c56!==undefined&&(_0x4b570f[_0x3e92b2]=_0x441c56);}return _0x4b570f;}export function getTrinoHeaders(_0x2af590,_0x156fbb,_0xfe94e0){const _0x5b8b7e=a55_0x1668,_0x3d7a37=getAuthHeaders(_0x2af590),_0x5419ef=toHeaderRecord(_0x3d7a37);if(_0xfe94e0)_0x5419ef[_0x5b8b7e(0xdd)]='Bearer\x20'+_0xfe94e0;else _0x156fbb&&(_0x5419ef[_0x5b8b7e(0xd6)]=_0x156fbb);return _0x5419ef;}export function hasAPIKey(_0x16fbd6){const _0x13d4a4=a55_0x1668,_0x39e237=getAPIKey();return _0x39e237!==undefined&&_0x39e237[_0x13d4a4(0xd1)]>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(_0x55c1e9,_0x1263f9){const _0x434812=a56_0x5239,_0x4e54a3=_0x55c1e9();while(!![]){try{const _0x4784d7=-parseInt(_0x434812(0xb7))/0x1+-parseInt(_0x434812(0xc8))/0x2*(-parseInt(_0x434812(0xe2))/0x3)+-parseInt(_0x434812(0xf8))/0x4+-parseInt(_0x434812(0xfb))/0x5*(parseInt(_0x434812(0xe6))/0x6)+parseInt(_0x434812(0xd7))/0x7+-parseInt(_0x434812(0xcf))/0x8+-parseInt(_0x434812(0xdf))/0x9*(-parseInt(_0x434812(0xf7))/0xa);if(_0x4784d7===_0x1263f9)break;else _0x4e54a3['push'](_0x4e54a3['shift']());}catch(_0x25b295){_0x4e54a3['push'](_0x4e54a3['shift']());}}}(a56_0x4348,0x6ab3c));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a56_0x5239(_0x6990e7,_0x1150be){_0x6990e7=_0x6990e7-0xb7;const _0x43485a=a56_0x4348();let _0x523992=_0x43485a[_0x6990e7];return _0x523992;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x1157a8 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x141a98){const _0x4cee1b=a56_0x5239;return _0x141a98[_0x4cee1b(0xfa)]===_0x4cee1b(0xf6)||_0x141a98[_0x4cee1b(0xfa)]==='jsonl'||_0x141a98[_0x4cee1b(0xfa)]===_0x4cee1b(0xdc)||_0x141a98[_0x4cee1b(0xfa)]==='table'||_0x141a98['json']===!![]||_0x141a98[_0x4cee1b(0xfe)]===!![]||_0x141a98[_0x4cee1b(0xdc)]===!![]||_0x141a98[_0x4cee1b(0xfc)]===!![];}export function parseOutputOptions(_0xe30adc){const _0x418036=a56_0x5239;return{'format':_0xe30adc[_0x418036(0xfa)]||'table','output':_0xe30adc[_0x418036(0xe7)]||'','limit':_0xe30adc['limit'],'limitStructuredFormats':_0xe30adc[_0x418036(0xd1)],'color':_0xe30adc['color'],'noColor':_0xe30adc[_0x418036(0xd3)]};}function convertSDKResultToQueryResult(_0x306c42){const _0x2c6ed4=a56_0x5239,_0x2ca136=[];if(_0x306c42[_0x2c6ed4(0xf1)]>0x0){const _0x52b8f0=_0x306c42[0x0];for(const [_0x11e9cf,_0x5893cb]of Object['entries'](_0x52b8f0)){let _0x224210=_0x2c6ed4(0xe1);if(typeof _0x5893cb==='number')_0x224210=Number[_0x2c6ed4(0xf0)](_0x5893cb)?_0x2c6ed4(0xf3):_0x2c6ed4(0xcb);else{if(typeof _0x5893cb===_0x2c6ed4(0xc9))_0x224210=_0x2c6ed4(0xc9);else _0x5893cb===null&&(_0x224210=_0x2c6ed4(0xe1));}_0x2ca136[_0x2c6ed4(0xe3)]({'name':_0x11e9cf,'type':_0x224210});}}return{'queryId':'sdk-result','columns':_0x2ca136,'data':_0x306c42,'stats':{'state':_0x2c6ed4(0xcd),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x306c42[_0x2c6ed4(0xf1)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2eaa58,_0x57cf23){const _0xc36f7d=convertSDKResultToQueryResult(_0x2eaa58);return formatQueryOutput(_0xc36f7d,_0x57cf23);}export async function formatQueryOutput(_0x3fe7d6,_0x4e4e1e){const _0x31784b=a56_0x5239,{format:_0x4ae2e7,limit:_0x1c44c8,output:_0x1753df,color:_0x24e0b6,noColor:_0x965dda,limitStructuredFormats:_0x58ca86}=_0x4e4e1e,_0x115a57=Boolean(_0x1753df)&&!_0x24e0b6,_0x5d7403={'color':_0x24e0b6,'noColor':_0x965dda||_0x115a57};if(_0x4ae2e7===_0x31784b(0xfc)){const _0x4b24ef=shouldUseLess(_0x4ae2e7,_0x1753df);return formatAsTable(_0x3fe7d6,_0x1c44c8,_0x4b24ef,_0x5d7403);}const _0x469bee=_0x58ca86&&Number[_0x31784b(0xce)](_0x1c44c8)&&_0x3fe7d6[_0x31784b(0xef)][_0x31784b(0xf1)]>_0x1c44c8?{..._0x3fe7d6,'data':_0x3fe7d6[_0x31784b(0xef)][_0x31784b(0xdb)](0x0,_0x1c44c8)}:_0x3fe7d6;if(_0x4ae2e7===_0x31784b(0xf6))return formatAsJSON(_0x469bee,_0x5d7403);else return _0x4ae2e7==='jsonl'?formatAsJSONL(_0x469bee,_0x5d7403):formatQueryResult(_0x469bee,_0x4ae2e7);}function shouldUseLess(_0x1b0ff8,_0x2b69eb){const _0x21a62d=a56_0x5239;return(_0x1b0ff8==='table'||_0x1b0ff8===_0x21a62d(0xe0))&&process[_0x21a62d(0xc1)]['isTTY']&&!_0x2b69eb;}export function resolveOutputOptions(_0x717a94){const _0x522f3a=a56_0x5239,_0xda4cca=_0x717a94[_0x522f3a(0xe7)]||'',_0x7a20d0=resolveOutputFormat(_0x717a94['format'],_0xda4cca,_0x522f3a(0xfc));let _0x53b3ff=typeof _0x717a94[_0x522f3a(0xbd)]===_0x522f3a(0xf5)?_0x717a94[_0x522f3a(0xbd)]:parseInt(_0x717a94[_0x522f3a(0xbd)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x717a94['limit']===undefined&&shouldUseLess(_0x7a20d0,_0xda4cca)&&(_0x53b3ff=Infinity),{'format':_0x7a20d0,'output':_0xda4cca,'limit':_0x53b3ff,'limitStructuredFormats':_0x717a94[_0x522f3a(0xd1)],'color':_0x717a94['color'],'noColor':_0x717a94['noColor']};}function a56_0x4348(){const _0x302b15=['boolean','map','double','keys','FINISHED','isFinite','239824whQUcO','blue','limitStructuredFormats','stdin','noColor','magenta','object','Results\x20saved\x20to\x20','2127076cUDAcz','end','rule','debug','slice','tsv','-FXRSn','repeat','13383WkkOtU','list','varchar','1692yHdJYW','push','inherit','split','174VqzzFQ','output','error','[Object]','query','string','filter','forEach','log','data','isInteger','length','join','bigint','padEnd','number','json','8140WAMJba','3361612ewsGwD','stringify','format','102335WyimRk','table','pipe','jsonl','cyan','trim','283342ySfhHR','resolve','[rule]','spawn','max','No\x20data','limit','─┴─','params','less','stdout','stderr','cmdout','[params]','[error]','entries','bold','2376cHEhWy'];a56_0x4348=function(){return _0x302b15;};return a56_0x4348();}export function writeOutput(_0x31f31d,_0x31b4b5,_0x52f3b1){const _0x1ac77c=a56_0x5239;return _0x31b4b5?(writeFileSync(_0x31b4b5,_0x31f31d),console[_0x1ac77c(0xe8)](_0x1ac77c(0xd6)+_0x31b4b5),Promise[_0x1ac77c(0xb8)]()):shouldUseLess(_0x52f3b1||'','')?new Promise(_0x350905=>{const _0x4f64f9=_0x1ac77c,_0x3a5d74=spawn(_0x4f64f9(0xc0),[_0x4f64f9(0xdd)],{'stdio':[_0x4f64f9(0xfd),'inherit',_0x4f64f9(0xe4)]});let _0x15d7f0=![];_0x3a5d74['on'](_0x4f64f9(0xe8),()=>{const _0x5b8fc0=_0x4f64f9;!_0x15d7f0&&(_0x15d7f0=!![],console[_0x5b8fc0(0xee)](_0x31f31d),_0x350905());}),_0x3a5d74['on']('close',()=>{!_0x15d7f0&&(_0x15d7f0=!![],_0x350905());}),_0x3a5d74['on'](_0x4f64f9(0xba),()=>{const _0x35ae4c=_0x4f64f9;!_0x15d7f0&&_0x3a5d74[_0x35ae4c(0xd2)]&&(_0x3a5d74['stdin']['on'](_0x35ae4c(0xe8),()=>{}),_0x3a5d74['stdin']['write'](_0x31f31d),_0x3a5d74[_0x35ae4c(0xd2)][_0x35ae4c(0xd8)]());}),!_0x3a5d74[_0x4f64f9(0xd2)]&&(!_0x15d7f0&&(_0x15d7f0=!![],console['log'](_0x31f31d),_0x350905()));}):(console[_0x1ac77c(0xee)](_0x31f31d),Promise[_0x1ac77c(0xb8)]());}export async function handleSDKOutput(_0x88850,_0x32b4c0){const _0x5cc4d3=a56_0x5239,_0x5390fb=resolveOutputOptions(_0x32b4c0),_0x2f49ae=await formatSDKOutput(_0x88850,_0x5390fb);await writeOutput(_0x2f49ae,_0x5390fb['output']||undefined,_0x5390fb[_0x5cc4d3(0xfa)]);}export async function handleQueryOutput(_0x137eed,_0x5b4da3){const _0x2ed352=a56_0x5239,_0x2e6240=resolveOutputOptions(_0x5b4da3),_0x5c1084=await formatQueryOutput(_0x137eed,_0x2e6240);await writeOutput(_0x5c1084,_0x2e6240[_0x2ed352(0xe7)]||undefined,_0x2e6240[_0x2ed352(0xfa)]);}async function formatSingleObject(_0x25fd9c,_0x455ae8){const _0x33a7=a56_0x5239,{format:_0x3bb229,color:_0x49f236,noColor:_0x2bcf92}=_0x455ae8,_0x159610={'color':_0x49f236,'noColor':_0x2bcf92};if(_0x3bb229==='json'){if(shouldUseColor(_0x159610))return colorizeJSON(_0x25fd9c,_0x159610);return JSON['stringify'](_0x25fd9c,null,0x2);}else{if(_0x3bb229===_0x33a7(0xfe)){if(shouldUseColor(_0x159610))return colorizeJSONCompact(_0x25fd9c,_0x159610);return JSON[_0x33a7(0xf9)](_0x25fd9c);}else{if(_0x3bb229==='tsv')return Object[_0x33a7(0xc6)](_0x25fd9c)['map'](([_0x1066a3,_0x22a0c3])=>_0x1066a3+'\x09'+_0x22a0c3)[_0x33a7(0xf2)]('\x0a');else{const _0x1e7cf4=Object[_0x33a7(0xc6)](_0x25fd9c);if(_0x1e7cf4[_0x33a7(0xf1)]===0x0)return _0x33a7(0xbc);const _0x1ed934=_0x25fd9c[_0x33a7(0xda)],_0x29e3cd=_0x25fd9c['query'],_0x202b2e=_0x25fd9c[_0x33a7(0xbf)],_0x31a853=_0x25fd9c['rule'],_0x3eb827=_0x29e3cd?typeof _0x29e3cd===_0x33a7(0xeb)?_0x29e3cd:JSON['stringify'](_0x29e3cd,null,0x2):undefined,_0x564ff9=_0x202b2e&&Object[_0x33a7(0xcc)](_0x202b2e)[_0x33a7(0xf1)]>0x0?JSON['stringify'](_0x202b2e,null,0x2):undefined,_0x2454ca=_0x31a853&&Object[_0x33a7(0xcc)](_0x31a853)[_0x33a7(0xf1)]>0x0?JSON['stringify'](_0x31a853,null,0x2):undefined,_0x4195f6=_0x1e7cf4[_0x33a7(0xec)](([_0x2e65c9])=>_0x2e65c9!=='debug'&&_0x2e65c9!==_0x33a7(0xea)&&_0x2e65c9!==_0x33a7(0xbf)&&_0x2e65c9!==_0x33a7(0xd9)),_0x2e5be2=Math[_0x33a7(0xbb)](..._0x4195f6[_0x33a7(0xca)](([_0x28ea20])=>_0x28ea20['length'])),_0x132974=Math['max'](..._0x4195f6['map'](([,_0x522485])=>{const _0x442411=_0x33a7;try{const _0x36835c=_0x522485===null||_0x522485===undefined?'':typeof _0x522485===_0x442411(0xd5)?JSON[_0x442411(0xf9)](_0x522485):String(_0x522485),_0x250af0=_0x36835c['split']('\x0a');return Math['max'](..._0x250af0[_0x442411(0xca)](_0x35df09=>_0x35df09['length']),0x0);}catch{return 0x0;}}),0x14),_0x1034d1=[];_0x1034d1['push'](colorBorder('┌─'+'─'['repeat'](_0x2e5be2)+'─┬─'+'─'[_0x33a7(0xde)](_0x132974)+'─┐',_0x159610)),_0x4195f6[_0x33a7(0xed)](([_0x11e39e,_0x39040b])=>{const _0x38a30f=_0x33a7;let _0x126b9f;try{_0x126b9f=_0x39040b===null||_0x39040b===undefined?'':typeof _0x39040b===_0x38a30f(0xd5)?JSON[_0x38a30f(0xf9)](_0x39040b):String(_0x39040b);}catch{_0x126b9f=_0x38a30f(0xe9);}const _0xae2f8f=_0x11e39e['padEnd'](_0x2e5be2),_0x5d0cc5=_0x126b9f[_0x38a30f(0xe5)]('\x0a');_0x5d0cc5['forEach']((_0x4e1105,_0x3886d3)=>{const _0x3a00af=_0x38a30f,_0x3503f3=colorBorder('│',_0x159610);_0x3886d3===0x0?_0x1034d1[_0x3a00af(0xe3)](_0x3503f3+'\x20'+_0xae2f8f+'\x20'+_0x3503f3+'\x20'+_0x4e1105['padEnd'](_0x132974)+'\x20'+_0x3503f3):_0x1034d1['push'](_0x3503f3+'\x20'+'\x20'[_0x3a00af(0xde)](_0x2e5be2)+'\x20'+_0x3503f3+'\x20'+_0x4e1105[_0x3a00af(0xf4)](_0x132974)+'\x20'+_0x3503f3);});}),_0x1034d1['push'](colorBorder('└─'+'─'[_0x33a7(0xde)](_0x2e5be2)+_0x33a7(0xbe)+'─'[_0x33a7(0xde)](_0x132974)+'─┘',_0x159610));_0x3eb827&&(_0x1034d1[_0x33a7(0xe3)](''),_0x1034d1[_0x33a7(0xe3)](String(a56_0x1157a8['yellow'][_0x33a7(0xc7)]('[query]'))),_0x1034d1[_0x33a7(0xe3)](_0x3eb827));_0x564ff9&&(_0x1034d1[_0x33a7(0xe3)](''),_0x1034d1[_0x33a7(0xe3)](String(a56_0x1157a8[_0x33a7(0xd0)][_0x33a7(0xc7)](_0x33a7(0xc4)))),_0x1034d1['push'](_0x564ff9));_0x2454ca&&(_0x1034d1[_0x33a7(0xe3)](''),_0x1034d1[_0x33a7(0xe3)](String(a56_0x1157a8[_0x33a7(0xd4)][_0x33a7(0xc7)](_0x33a7(0xb9)))),_0x1034d1[_0x33a7(0xe3)](_0x2454ca));if(_0x1ed934){if(_0x1ed934[_0x33a7(0xc2)]){_0x1034d1[_0x33a7(0xe3)](''),_0x1034d1[_0x33a7(0xe3)](String(a56_0x1157a8['red'][_0x33a7(0xc7)](_0x33a7(0xc5))));const _0x47ea04=_0x1ed934[_0x33a7(0xc2)]['split']('\x0a');_0x47ea04[_0x33a7(0xed)](_0x1a93e5=>{const _0x22683c=_0x33a7;_0x1a93e5[_0x22683c(0x100)]()&&_0x1034d1[_0x22683c(0xe3)](_0x1a93e5);});}if(_0x1ed934['cmdout']){_0x1034d1[_0x33a7(0xe3)](''),_0x1034d1[_0x33a7(0xe3)](String(a56_0x1157a8[_0x33a7(0xff)]['bold']('[logs]')));const _0x3f05a8=_0x1ed934[_0x33a7(0xc3)][_0x33a7(0xe5)]('\x0a');_0x3f05a8[_0x33a7(0xed)](_0x51610b=>{const _0x4771df=_0x33a7;_0x51610b[_0x4771df(0x100)]()&&_0x1034d1[_0x4771df(0xe3)](_0x51610b);});}}return _0x1034d1[_0x33a7(0xf2)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2b7139,_0x388d0d){const _0x121788=a56_0x5239;if(_0x388d0d[_0x121788(0xfa)]===_0x121788(0xfc)){await handleSDKOutput([_0x2b7139],_0x388d0d);return;}const _0x395274=resolveOutputOptions(_0x388d0d),_0x1638cf=await formatSingleObject(_0x2b7139,_0x395274);await writeOutput(_0x1638cf,_0x395274[_0x121788(0xe7)]||undefined,_0x395274[_0x121788(0xfa)]);}