@treasuredata/tdx 2026.4.5 → 2026.4.6

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.d.ts +3 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/types/workspace.js.map +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/tdx-config.js +1 -1
  183. package/dist/sdk/workflow/workflow-utils.js +1 -1
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -1
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.js +1 -1
  189. package/dist/sdk/workspace/index.d.ts +1 -1
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.d.ts +2 -0
  196. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  197. package/dist/sdk/workspace/wikilinks.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x4f40c0=a54_0x4855;(function(_0x36b47d,_0x3d29a3){const _0x587e65=a54_0x4855,_0x2a29b1=_0x36b47d();while(!![]){try{const _0x5c29b8=parseInt(_0x587e65(0x12f))/0x1*(-parseInt(_0x587e65(0x181))/0x2)+parseInt(_0x587e65(0x126))/0x3*(parseInt(_0x587e65(0xd3))/0x4)+-parseInt(_0x587e65(0xb6))/0x5*(-parseInt(_0x587e65(0xab))/0x6)+parseInt(_0x587e65(0x251))/0x7+-parseInt(_0x587e65(0x16e))/0x8*(parseInt(_0x587e65(0x24e))/0x9)+-parseInt(_0x587e65(0x244))/0xa+-parseInt(_0x587e65(0x194))/0xb*(parseInt(_0x587e65(0x1af))/0xc);if(_0x5c29b8===_0x3d29a3)break;else _0x2a29b1['push'](_0x2a29b1['shift']());}catch(_0x577852){_0x2a29b1['push'](_0x2a29b1['shift']());}}}(a54_0x43e6,0x62699));import a54_0x4448c0 from'chalk';import{existsSync}from'fs';import a54_0x4ed50f 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_0x3961f9 from'prompts';function getAttemptStatusDisplay(_0x4f52c8){const _0x37baa8=a54_0x4855;if(!_0x4f52c8)return{'icon':'⏳','text':''};const {done:_0x2a1f9b,success:_0x1168c5,cancelRequested:_0x2dfc89}=_0x4f52c8;if(!_0x2a1f9b)return _0x2dfc89?{'icon':'🛑','text':a54_0x4448c0[_0x37baa8(0x13a)]('canceling')}:{'icon':'🔄','text':a54_0x4448c0[_0x37baa8(0xa6)](_0x37baa8(0x1a7))};if(_0x1168c5)return{'icon':'✅','text':a54_0x4448c0[_0x37baa8(0x229)](_0x37baa8(0xc4))};return{'icon':'❌','text':a54_0x4448c0[_0x37baa8(0x167)](_0x37baa8(0x20f))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x4f40c0(0x192)](_0x18af3a,_0x38e2a7,_0x2c6e93=0x0){const _0x3f7933=a54_0x4f40c0;return _0x18af3a[_0x2c6e93]||_0x38e2a7[_0x3f7933(0x125)];}[a54_0x4f40c0(0xc0)](_0x5de825,_0x161389,_0x3e3e2b=0x0){const _0x57168b=a54_0x4f40c0,_0x51b417=this['resolveProject'](_0x5de825,_0x161389,_0x3e3e2b);if(!_0x51b417)return console[_0x57168b(0x20f)](a54_0x4448c0[_0x57168b(0x167)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x57168b(0x20f)](a54_0x4448c0['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x51b417;}[a54_0x4f40c0(0x207)](_0x423db1,_0x7ca5e1){const _0xbfc2a6=a54_0x4f40c0;if(_0x423db1[0x0]){const _0x5c96f1=_0x423db1[0x0]['split']('.');if(_0x5c96f1[_0xbfc2a6(0x9d)]===0x1)return{'projectName':_0x5c96f1[0x0],'workflowName':undefined};else return _0x5c96f1['length']===0x2?{'projectName':_0x5c96f1[0x0],'workflowName':_0x5c96f1[0x1]}:(console['error'](a54_0x4448c0[_0xbfc2a6(0x167)](_0xbfc2a6(0x146)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x7ca5e1[_0xbfc2a6(0x125)],'workflowName':undefined};}[a54_0x4f40c0(0x1eb)](_0x1b8a69,_0x2140a3,_0x203098=0x0){const _0x2c75c8=a54_0x4f40c0;if(_0x1b8a69[_0x203098])return _0x1b8a69[_0x203098];if(_0x2140a3[_0x2c75c8(0x125)]){const _0x2db439=a54_0x4ed50f[_0x2c75c8(0x1a8)](process[_0x2c75c8(0x256)](),'workflows',_0x2140a3[_0x2c75c8(0x125)]);if(existsSync(a54_0x4ed50f[_0x2c75c8(0x1a8)](_0x2db439,_0x2c75c8(0x1ff))))return _0x2db439;}return undefined;}async[a54_0x4f40c0(0xaf)](_0x38fa7e,_0x41a384,_0x798873){const _0x3a4f0a=a54_0x4f40c0;try{const _0x53a009=await _0x38fa7e[_0x3a4f0a(0xc9)]['workflows'](_0x41a384,{'limit':0x1});if(_0x53a009[_0x3a4f0a(0x9d)]>0x0){const _0x35be59=_0x53a009[0x0]['id'],_0x5911d7=getWorkflowUrl(_0x798873,_0x35be59);console[_0x3a4f0a(0x20f)](_0x3a4f0a(0x1f8)+a54_0x4448c0[_0x3a4f0a(0x214)](_0x5911d7));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x4f40c0(0xe1);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x4f5613){const _0x3203a8=a54_0x4f40c0,{options:_0x584737,args:_0x33a909,tdx:_0x438d61}=_0x4f5613,_0x2faef0=_0x33a909[0x0],_0x2a4843=_0x584737[_0x3203a8(0x136)];if(_0x2a4843)return saveSessionContext({'workflow_project':undefined},_0x584737[_0x3203a8(0x10d)]),console[_0x3203a8(0xe7)](a54_0x4448c0['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x2faef0)return console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0x167)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0xcc)](_0x3203a8(0x23d))),console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0xcc)](_0x3203a8(0x11a))),0x1;const _0x1b405e=await withSpinner('Resolving\x20project\x20\x27'+_0x2faef0+'\x27...',()=>_0x438d61[_0x3203a8(0xc9)]['resolveProjectId'](_0x2faef0),{'verbose':_0x584737['verbose']}),{name:_0x24539a}=_0x1b405e[_0x3203a8(0xdf)];return saveSessionContext({'workflow_project':_0x24539a},_0x584737[_0x3203a8(0x10d)]),console['log'](a54_0x4448c0['green'](_0x3203a8(0x1d4)+a54_0x4448c0[_0x3203a8(0x214)](_0x24539a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x4f40c0(0x14c);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x15d);async[a54_0x4f40c0(0x1e9)](_0x288e6a){const _0x99c1e5=a54_0x4f40c0,{options:_0x249507,args:_0x2429e2,tdx:_0x15c0c0}=_0x288e6a,_0x208979=_0x2429e2[0x0];_0x249507['verbose']&&_0x208979&&console['error'](_0x99c1e5(0x1dd)+_0x208979);const _0x582c7f=await withSpinner(_0x99c1e5(0xba),()=>_0x15c0c0[_0x99c1e5(0xc9)][_0x99c1e5(0x10c)](_0x208979,{'limit':_0x249507[_0x99c1e5(0x141)]}),{'verbose':_0x249507[_0x99c1e5(0x1c0)]});let _0x3d2b27=_0x582c7f[_0x99c1e5(0xdf)];_0x3d2b27[_0x99c1e5(0xac)]((_0x311f15,_0x499d18)=>_0x311f15['name']['localeCompare'](_0x499d18[_0x99c1e5(0x153)]));const _0x4eed02=_0x249507[_0x99c1e5(0x141)]||0x64,_0x1f78b4=_0x3d2b27[_0x99c1e5(0x9d)]>=_0x4eed02?a54_0x4448c0['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x99c1e5(0x20f)]('✔\x20Found\x20'+_0x3d2b27[_0x99c1e5(0x9d)]+'\x20project'+(_0x3d2b27[_0x99c1e5(0x9d)]!==0x1?'s':'')+_0x1f78b4);if(_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0x15b)||_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0x100)||_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0xb3))await handleSDKOutput(_0x3d2b27,_0x249507);else{if(_0x3d2b27[_0x99c1e5(0x9d)]===0x0)_0x208979?console['log'](_0x99c1e5(0xc5)+_0x208979):console[_0x99c1e5(0xe7)](_0x99c1e5(0x24b));else{const _0x370089=_0x3d2b27[_0x99c1e5(0x17c)](_0x4a1115=>{const _0x49d26e=_0x99c1e5,_0x3c0b11=_0x4a1115['metadata']?.['some'](_0xfcc69f=>_0xfcc69f['key']==='sys'),_0x41034a=_0x3c0b11?a54_0x4448c0[_0x49d26e(0xcc)]('\x20(system)'):'';return _0x49d26e(0x1ee)+_0x4a1115['name']+_0x41034a;});await writeOutput(_0x370089[_0x99c1e5(0x1a8)]('\x0a'),_0x249507[_0x99c1e5(0x232)],_0x99c1e5(0x132));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x208);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xf6);async['execute'](_0x6b654e){const _0x47073a=a54_0x4f40c0,{options:_0x39a7e6,args:_0x5db127,tdx:_0x3fb63a}=_0x6b654e,_0x2603b9=this['resolveProject'](_0x5db127,_0x39a7e6);_0x39a7e6[_0x47073a(0x1c0)]&&_0x2603b9&&console[_0x47073a(0x20f)]('Project\x20filter:\x20'+_0x2603b9);const _0x3120f5=await withSpinner(_0x47073a(0x245),()=>_0x3fb63a[_0x47073a(0xc9)]['workflows'](_0x2603b9,{'limit':_0x39a7e6[_0x47073a(0x141)]}),{'verbose':_0x39a7e6[_0x47073a(0x1c0)]});let _0xeebb35=_0x3120f5[_0x47073a(0xdf)];_0xeebb35[_0x47073a(0xac)]((_0x3d32ab,_0x283692)=>{const _0x2fa0c5=_0x47073a,_0x13768c=_0x3d32ab[_0x2fa0c5(0x153)]['localeCompare'](_0x283692['name']);if(_0x13768c!==0x0)return _0x13768c;return(_0x3d32ab[_0x2fa0c5(0x22b)]?.[_0x2fa0c5(0x153)]||'')[_0x2fa0c5(0x200)](_0x283692[_0x2fa0c5(0x22b)]?.[_0x2fa0c5(0x153)]||'');});const _0x5683f9=_0x39a7e6['limit']||0x64,_0x5bce1d=_0xeebb35[_0x47073a(0x9d)]>=_0x5683f9?a54_0x4448c0[_0x47073a(0xcc)](_0x47073a(0x193)):'';console[_0x47073a(0x20f)](_0x47073a(0x114)+_0xeebb35['length']+_0x47073a(0x254)+(_0xeebb35['length']!==0x1?'s':'')+_0x5bce1d);if(_0x39a7e6[_0x47073a(0x1f0)]===_0x47073a(0x15b)||_0x39a7e6[_0x47073a(0x1f0)]==='jsonl'||_0x39a7e6['format']===_0x47073a(0xb3))await handleSDKOutput(_0xeebb35,_0x39a7e6);else{if(_0xeebb35['length']===0x0)_0x2603b9?console[_0x47073a(0xe7)](_0x47073a(0xc8)+_0x2603b9):console[_0x47073a(0xe7)](_0x47073a(0x1c6));else{const _0x331030=_0x39a7e6[_0x47073a(0x174)],_0x5b1e82=_0xeebb35[_0x47073a(0x17c)](_0x186d45=>{const _0xf7f9a4=_0x47073a,_0x1748a5=a54_0x4448c0[_0xf7f9a4(0xcc)]('#'+_0x186d45['id']),_0x56550b=hyperlink(_0x1748a5,getWorkflowUrl(_0x331030,_0x186d45['id'])),_0x26350e=_0x186d45['project']?.['name']?a54_0x4448c0[_0xf7f9a4(0xcc)]('\x20('+_0x186d45['project'][_0xf7f9a4(0x153)]+')'):'';return _0xf7f9a4(0x1bd)+_0x56550b+'\x20'+_0x186d45[_0xf7f9a4(0x153)]+_0x26350e;});await writeOutput(_0x5b1e82[_0x47073a(0x1a8)]('\x0a'),_0x39a7e6[_0x47073a(0x232)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x1c2);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x148);async[a54_0x4f40c0(0x1e9)](_0x5d4dbd){const _0x11ba2b=a54_0x4f40c0,{options:_0x175166,args:_0x23d9e6,tdx:_0x5857c9}=_0x5d4dbd,_0x47e06b=this[_0x11ba2b(0x207)](_0x23d9e6,_0x175166);if(!_0x47e06b)return 0x1;const {projectName:_0x5d219d,workflowName:_0x3fb3c7}=_0x47e06b;if(_0x175166[_0x11ba2b(0x1c0)]){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0x20f)]('Filter:\x20'+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d&&console[_0x11ba2b(0x20f)]('Filter:\x20project='+_0x5d219d);const _0x1d735e=_0x175166[_0x11ba2b(0x110)];_0x1d735e&&console[_0x11ba2b(0x20f)](_0x11ba2b(0xd0)+_0x1d735e);}let _0x4a53b8=0x28;if(process['stdout'][_0x11ba2b(0x237)]&&!_0x175166[_0x11ba2b(0x232)]&&!_0x175166[_0x11ba2b(0x1f0)]){const _0x4fec71=process[_0x11ba2b(0x1d8)]['rows']||0x28;_0x4a53b8=Math[_0x11ba2b(0xfd)](0x14,Math['floor'](_0x4fec71*0x2/0x3));}const _0x56e358=_0x175166[_0x11ba2b(0x141)]||_0x4a53b8,_0x156c73=await withSpinner(_0x11ba2b(0x24c),()=>_0x5857c9[_0x11ba2b(0xc9)][_0x11ba2b(0xb5)]({'projectName':_0x5d219d,'workflowName':_0x3fb3c7,'status':_0x175166[_0x11ba2b(0x110)],'fromTime':_0x175166[_0x11ba2b(0x1e4)],'toTime':_0x175166['to'],'limit':_0x56e358}),{'verbose':_0x175166['verbose']}),_0x3fcc8b=_0x156c73[_0x11ba2b(0xdf)];_0x3fcc8b[_0x11ba2b(0xac)]((_0x7414b6,_0x33a15c)=>{const _0x5d4094=_0x11ba2b,_0x1488cf=_0x7414b6[_0x5d4094(0x24f)]||'',_0x436c09=_0x33a15c[_0x5d4094(0x24f)]||'';return _0x436c09[_0x5d4094(0x200)](_0x1488cf);});_0x3fcc8b[_0x11ba2b(0x9d)]>=_0x56e358?console[_0x11ba2b(0x20f)](_0x11ba2b(0x1a2)+_0x3fcc8b['length']+_0x11ba2b(0x1bb)+a54_0x4448c0[_0x11ba2b(0xcc)](_0x11ba2b(0x1a6))):console['error']('✔\x20Found\x20'+_0x3fcc8b['length']+_0x11ba2b(0x17a)+(_0x3fcc8b[_0x11ba2b(0x9d)]!==0x1?'s':''));if(_0x175166[_0x11ba2b(0x1f0)]===_0x11ba2b(0x15b)||_0x175166[_0x11ba2b(0x1f0)]===_0x11ba2b(0x100)||_0x175166['format']===_0x11ba2b(0xb3))await handleSDKOutput(_0x3fcc8b,_0x175166);else{if(!process[_0x11ba2b(0x1d8)]['isTTY']||_0x175166[_0x11ba2b(0x232)]){if(_0x3fcc8b['length']===0x0){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0xe7)](_0x11ba2b(0x1ec)+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d?console['log'](_0x11ba2b(0xa4)+_0x5d219d):console[_0x11ba2b(0xe7)]('No\x20sessions\x20found');}else{const _0x46879b=_0x175166[_0x11ba2b(0x174)],_0x520bc9=this[_0x11ba2b(0x236)](_0x3fcc8b,_0x46879b);_0x175166[_0x11ba2b(0x232)]?await writeOutput(_0x520bc9,_0x175166[_0x11ba2b(0x232)],'list'):console[_0x11ba2b(0xe7)](_0x520bc9);}!_0x5d219d&&(console[_0x11ba2b(0x20f)](''),console['error'](a54_0x4448c0[_0x11ba2b(0xcc)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x11ba2b(0x20f)](a54_0x4448c0['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4448c0['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3fcc8b['length']===0x0){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0xe7)](_0x11ba2b(0x1ec)+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d?console[_0x11ba2b(0xe7)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5d219d):console['log'](_0x11ba2b(0xcb));}else await this[_0x11ba2b(0x1a5)](_0x3fcc8b,_0x5d4dbd,_0x5d219d);}}return 0x0;}[a54_0x4f40c0(0x236)](_0x5ced25,_0x1d0365){const _0x273f80=a54_0x4f40c0,_0x51040a=[],_0x34732e=new Map();let _0x2d6b40=Infinity,_0x2daaf2=-Infinity;for(const _0x441107 of _0x5ced25){if(_0x441107[_0x273f80(0x17e)]?.[_0x273f80(0xb4)]){const _0x5a2f31=new Date(_0x441107[_0x273f80(0x17e)][_0x273f80(0xb4)])['getTime'](),_0x126f61=_0x441107[_0x273f80(0x17e)]['finishedAt']?new Date(_0x441107[_0x273f80(0x17e)][_0x273f80(0x217)])[_0x273f80(0x1d6)]():Date[_0x273f80(0x131)](),_0x18788d=_0x441107['project']?.['name']||_0x273f80(0x24d);!_0x34732e[_0x273f80(0x9f)](_0x18788d)&&_0x34732e[_0x273f80(0x1c7)](_0x18788d,[]),_0x34732e[_0x273f80(0x112)](_0x18788d)['push']({'session':_0x441107,'startTime':_0x5a2f31,'endTime':_0x126f61,'duration':_0x126f61-_0x5a2f31}),_0x2d6b40=Math[_0x273f80(0x1cd)](_0x2d6b40,_0x5a2f31),_0x2daaf2=Math[_0x273f80(0xfd)](_0x2daaf2,_0x126f61);}}if(_0x34732e[_0x273f80(0x102)]===0x0)return _0x273f80(0x166);const _0x2663da=process[_0x273f80(0x1d8)][_0x273f80(0xb1)]||0x78,_0x4367ab=0x1e,_0x9fb33=0x32,_0x480a1c=0x4,_0x44e93a=Math[_0x273f80(0x1cd)](_0x9fb33,Math[_0x273f80(0xfd)](_0x4367ab,Math[_0x273f80(0x128)](_0x2663da*0.3))),_0x2c4888=_0x2663da-_0x44e93a-TIMELINE_CONFIG[_0x273f80(0x159)]-0x3-_0x480a1c,_0x453288=_0x2daaf2-_0x2d6b40,_0xd71e65=_0x453288/_0x44e93a,_0x4508fe=renderTimeAxis({'startTime':_0x2d6b40,'endTime':_0x2daaf2,'durationMs':_0x453288,'msPerChar':_0xd71e65},_0x44e93a),_0x514fcb=[];for(const _0xda321a of _0x34732e[_0x273f80(0x198)]()){_0x514fcb[_0x273f80(0x1e7)](..._0xda321a);}_0x514fcb['sort']((_0xd1c9eb,_0x4969db)=>_0x4969db[_0x273f80(0xda)]-_0xd1c9eb[_0x273f80(0xda)]);const _0x5ce1de=new Date(_0x2d6b40),_0x43e487=formatDate(_0x5ce1de),_0x50982a=_0x480a1c+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x273f80(0x165)]+_0x2c4888,_0x4001a3='\x20'[_0x273f80(0x10a)](_0x50982a-_0x43e487['length']),_0x38ac1d=_0x4001a3+a54_0x4448c0[_0x273f80(0xcc)](_0x43e487)+'\x20'+_0x4508fe;_0x51040a[_0x273f80(0x1e7)](_0x38ac1d);const _0x5963a0=0x16;let _0x18a23a=0x0;for(const _0x2b33cf of _0x514fcb){const _0x43de12=_0x2b33cf[_0x273f80(0x10d)][_0x273f80(0x22b)]?.[_0x273f80(0x153)]||'?',_0x520c4a=Math['min'](stringWidth(_0x43de12),_0x5963a0);_0x18a23a=Math[_0x273f80(0xfd)](_0x18a23a,_0x520c4a);}for(const _0x3470a3 of _0x514fcb){const {session:_0x4720fa,startTime:_0x234bed,endTime:_0x279aa4,duration:_0x40b96c}=_0x3470a3,_0x23ecab=_0x4720fa[_0x273f80(0x22b)]?.['id'],_0x5ee8df=_0x4720fa['id'],_0x2ca9b4=_0x4720fa[_0x273f80(0x22b)]?.['name']||'?',_0x53b122=_0x4720fa[_0x273f80(0xc9)]?.[_0x273f80(0x153)]||'?';let _0xc33cac,_0x2134ac;if(_0x4720fa[_0x273f80(0x17e)]){const _0x3f8442=_0x4720fa['lastAttempt'];!_0x3f8442['done']?(_0xc33cac=_0x3f8442[_0x273f80(0x1cf)]?'🛑':'🔄',_0x2134ac=_0x3f8442[_0x273f80(0x1cf)]?a54_0x4448c0['yellow']:a54_0x4448c0[_0x273f80(0xa6)]):(_0xc33cac=_0x3f8442[_0x273f80(0xc4)]?'✅':'❌',_0x2134ac=_0x3f8442['success']?a54_0x4448c0[_0x273f80(0x229)]:a54_0x4448c0['red']);}else _0xc33cac='⏳',_0x2134ac=a54_0x4448c0[_0x273f80(0xcc)];const _0x5ba60e='#'+_0x5ee8df,_0x40d3b7=_0x23ecab?hyperlink(_0x5ba60e,getWorkflowSessionUrl(_0x1d0365,_0x23ecab,_0x5ee8df)):_0x5ba60e;let _0x51336d=_0x2ca9b4;stringWidth(_0x2ca9b4)>_0x5963a0&&(_0x51336d=_0x2ca9b4[_0x273f80(0xf7)](0x0,_0x5963a0-0x1)+'…');const _0x4a4fd1=a54_0x4448c0[_0x273f80(0xcc)](_0x51336d),_0x47f707=stringWidth(_0x51336d),_0xf94b44='\x20'['repeat'](_0x18a23a-stringWidth(_0x51336d)+0x2),_0x4402cd='('+formatElapsed(_0x40b96c)+')',_0x235cee=stringWidth(_0x4402cd),_0x4e9444=stringWidth(_0x5ba60e),_0x366a57=_0x4e9444+0x1+_0x47f707+_0xf94b44[_0x273f80(0x9d)],_0x1338f5=_0x2c4888-_0x366a57-_0x235cee-0x1-0x8;let _0x7d773b=_0x53b122;stringWidth(_0x7d773b)>_0x1338f5&&(_0x7d773b=_0x7d773b[_0x273f80(0xf7)](0x0,_0x1338f5-0x1)+'…');const _0x263166=_0x40d3b7+'\x20'+_0x4a4fd1+_0xf94b44+_0x7d773b,_0x523051=stringWidth(_0x263166),_0x111293=_0x2c4888-_0x523051-_0x235cee,_0x4a9a14=_0x263166+'\x20'[_0x273f80(0x10a)](Math[_0x273f80(0xfd)](0x1,_0x111293))+a54_0x4448c0[_0x273f80(0xcc)](_0x4402cd),_0x255798=Math[_0x273f80(0x128)]((_0x234bed-_0x2d6b40)/_0xd71e65),_0x369f43=Math[_0x273f80(0x128)]((_0x279aa4-_0x2d6b40)/_0xd71e65),_0x4f139a=Math[_0x273f80(0xfd)](_0x255798+0x1,_0x369f43),_0x2bc6e0=new Array(_0x44e93a)[_0x273f80(0x1c4)]('\x20');for(let _0x3b1632=_0x255798;_0x3b1632<Math['min'](_0x4f139a,_0x44e93a);_0x3b1632++){_0x2bc6e0[_0x3b1632]='─';}const _0x746090=_0x2bc6e0[_0x273f80(0x17c)](_0x3f0fe8=>_0x3f0fe8==='\x20'?'\x20':_0x2134ac(_0x3f0fe8))[_0x273f80(0x1a8)]('');_0x51040a[_0x273f80(0x1e7)](_0xc33cac+'\x20'+_0x4a9a14+'│'+_0x746090+'│');}return _0x51040a[_0x273f80(0x1a8)]('\x0a');}async[a54_0x4f40c0(0x1a5)](_0x22f2da,_0x5a4c4e,_0x1a6a58){const _0x231e25=a54_0x4f40c0,{options:_0x217a66,tdx:_0x4869b6}=_0x5a4c4e,_0x377253=_0x217a66[_0x231e25(0x174)],{timelineRows:_0x29638b,timeAxisHeader:_0x4ab904}=this[_0x231e25(0x1f2)](_0x22f2da,_0x377253),_0x4e8fc8=_0x29638b[_0x231e25(0xb2)](_0x4d3c76=>_0x4d3c76['attemptId']);if(_0x4e8fc8['length']===0x0){const _0x21b654=this[_0x231e25(0x236)](_0x22f2da,_0x377253);console[_0x231e25(0xe7)](_0x21b654);!_0x1a6a58&&(console[_0x231e25(0x20f)](''),console[_0x231e25(0x20f)](a54_0x4448c0['dim'](_0x231e25(0x127))),console[_0x231e25(0x20f)](a54_0x4448c0[_0x231e25(0xcc)](_0x231e25(0x133))+'or'+a54_0x4448c0[_0x231e25(0xcc)](_0x231e25(0xc3))));return;}_0x4ab904&&console[_0x231e25(0xe7)](_0x4ab904);const _0x3405bd=_0x29638b[_0x231e25(0xb2)](_0x23ed50=>_0x23ed50[_0x231e25(0x249)])[_0x231e25(0x17c)](_0x5c672f=>({'title':_0x5c672f[_0x231e25(0xb8)],'value':_0x5c672f['attemptId']})),_0x1c3c79=process[_0x231e25(0x1d8)]['rows']||0x3c,_0x53521a=Math[_0x231e25(0xfd)](0x28,Math[_0x231e25(0x128)](_0x1c3c79*0x2/0x3)),_0x2d7072=await a54_0x3961f9({'type':_0x231e25(0x20e),'name':'attemptId','message':_0x231e25(0xea),'choices':_0x3405bd,'initial':-0x1,'limit':_0x53521a,'clearFirst':!![],'fallback':{'title':_0x231e25(0x1dc),'value':null},'suggest':(_0x223dc3,_0x255d37)=>{const _0x1da1b7=_0x231e25;if(!_0x223dc3)return Promise[_0x1da1b7(0xe5)](_0x255d37);const _0x8e4a85=_0x255d37['filter'](_0x4ab96e=>{const _0x42a496=_0x1da1b7,_0x566fc7=_0x4ab96e;return _0x566fc7['title'][_0x42a496(0x156)]()['includes'](_0x223dc3[_0x42a496(0x156)]());});return Promise[_0x1da1b7(0xe5)](_0x8e4a85);}}),_0x3a5d2f=()=>{const _0x5d3811=_0x231e25;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x5d3811(0x1d8)]['write'](_0x5d3811(0xae)),process[_0x5d3811(0x1d8)][_0x5d3811(0x19a)](_0x5d3811(0xae));},_0x2f73a8=_0x2d7072&&_0x2d7072[_0x231e25(0x249)]&&_0x2d7072[_0x231e25(0x249)]!==null&&_0x2d7072[_0x231e25(0x249)][_0x231e25(0xe8)]()!=='';if(!_0x2f73a8){_0x3a5d2f(),console[_0x231e25(0xe7)](a54_0x4448c0[_0x231e25(0xcc)]('Cancelled'));return;}_0x3a5d2f();const _0x27b255=_0x22f2da[_0x231e25(0x172)](_0x40ba91=>_0x40ba91[_0x231e25(0x17e)]?.['id']===_0x2d7072[_0x231e25(0x249)]);if(_0x27b255){const _0x1c9e86=_0x27b255[_0x231e25(0x22b)]?.[_0x231e25(0x153)]||'?',_0x6a23ca=_0x27b255[_0x231e25(0xc9)]?.['name']||'?';console[_0x231e25(0xe7)](_0x231e25(0x12d)+a54_0x4448c0[_0x231e25(0xcc)](_0x1c9e86)+_0x231e25(0x121)+a54_0x4448c0[_0x231e25(0xcc)](_0x6a23ca));}const _0xf3107b=new WorkflowTimelineCommand();await _0xf3107b[_0x231e25(0x1e9)]({'args':[],'options':{..._0x217a66,'attemptId':_0x2d7072['attemptId']},'tdx':_0x4869b6});}[a54_0x4f40c0(0x1f2)](_0x32c2ed,_0x55e9d5){const _0x53b524=a54_0x4f40c0,_0x589865=new Map();for(const _0x216945 of _0x32c2ed){_0x216945['id']&&_0x216945[_0x53b524(0x17e)]?.['id']&&_0x589865[_0x53b524(0x1c7)](_0x216945['id'],_0x216945[_0x53b524(0x17e)]['id']);}const _0x2a3ad7=[];let _0x528068='';const _0x2d94d3=this[_0x53b524(0x236)](_0x32c2ed,_0x55e9d5),_0x168c52=_0x2d94d3[_0x53b524(0x169)]('\x0a');for(const _0x331b96 of _0x168c52){if(_0x331b96[_0x53b524(0x155)](_0x53b524(0x158))||_0x331b96[_0x53b524(0xa7)](/^\s+\d{4}-\d{2}-\d{2}/))_0x528068=_0x331b96;else{if(_0x331b96[_0x53b524(0xa7)](/^[✅❌🔄🛑⏳]/)){const _0xf78dd1=_0x331b96[_0x53b524(0xa7)](/#(\d+)/),_0x31fc06=_0xf78dd1?_0xf78dd1[0x1]:null,_0x5b66ca=_0x31fc06?_0x589865[_0x53b524(0x112)](_0x31fc06)||null:null,_0x1e022a=_0x32c2ed['find'](_0x4cd409=>_0x4cd409['id']===_0x31fc06),_0x52cc4a=_0x1e022a?.[_0x53b524(0x22b)]?.['name']||'';_0x2a3ad7[_0x53b524(0x1e7)]({'displayLine':_0x331b96,'attemptId':_0x5b66ca,'projectName':_0x52cc4a});}}}return{'timelineRows':_0x2a3ad7,'timeAxisHeader':_0x528068};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x154);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xe3);async[a54_0x4f40c0(0x1e9)](_0x262711){const _0x49df51=a54_0x4f40c0,{options:_0x30a9e7,args:_0x5ad2fc,tdx:_0x42d423}=_0x262711,_0x1a6a82=this[_0x49df51(0x207)](_0x5ad2fc,_0x30a9e7);if(!_0x1a6a82)return 0x1;const {projectName:_0xabc4f0,workflowName:_0x100800}=_0x1a6a82,_0x8e9288=_0x30a9e7['includeRetried'];if(_0x30a9e7[_0x49df51(0x1c0)]){if(_0xabc4f0&&_0x100800)console[_0x49df51(0x20f)](_0x49df51(0x1db)+_0xabc4f0+'.'+_0x100800);else _0xabc4f0&&console['error'](_0x49df51(0x117)+_0xabc4f0);_0x8e9288&&console[_0x49df51(0x20f)]('Include\x20retried:\x20yes');}const _0x326a56=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x42d423[_0x49df51(0xc9)][_0x49df51(0xbb)]({'projectName':_0xabc4f0,'workflowName':_0x100800,'includeRetried':_0x8e9288,'limit':_0x30a9e7[_0x49df51(0x141)]}),{'verbose':_0x30a9e7['verbose']}),_0x248c91=_0x326a56[_0x49df51(0xdf)],_0x46611c=_0x30a9e7[_0x49df51(0x141)]||0x64,_0x36bb0e=_0x248c91[_0x49df51(0x9d)]>=_0x46611c?a54_0x4448c0['dim'](_0x49df51(0x193)):'';console[_0x49df51(0x20f)]('✔\x20Found\x20'+_0x248c91['length']+_0x49df51(0x1fe)+(_0x248c91['length']!==0x1?'s':'')+_0x36bb0e);if(_0x30a9e7[_0x49df51(0x1f0)]==='json'||_0x30a9e7[_0x49df51(0x1f0)]===_0x49df51(0x100)||_0x30a9e7[_0x49df51(0x1f0)]==='table')await handleSDKOutput(_0x248c91,_0x30a9e7);else{if(_0x248c91['length']===0x0){if(_0xabc4f0&&_0x100800)console[_0x49df51(0xe7)](_0x49df51(0xaa)+_0xabc4f0+'.'+_0x100800);else _0xabc4f0?console[_0x49df51(0xe7)](_0x49df51(0x108)+_0xabc4f0):console[_0x49df51(0xe7)](_0x49df51(0x15a));}else{const _0x1904f9=_0x30a9e7[_0x49df51(0x174)],_0x25a076=_0x248c91[_0x49df51(0x17c)](_0x4c6a42=>{const _0x2a233a=_0x49df51,_0x4168d8=a54_0x4448c0[_0x2a233a(0xcc)]('#'+_0x4c6a42['id']),_0x135116=_0x4c6a42[_0x2a233a(0x22b)]?.['id'],_0x32a178=_0x4c6a42[_0x2a233a(0x145)]||_0x4c6a42[_0x2a233a(0x1b6)],_0x39ca3f=_0x135116&&_0x32a178?hyperlink(_0x4168d8,getWorkflowAttemptUrl(_0x1904f9,_0x135116,_0x32a178,_0x4c6a42['id'])):_0x4168d8,{icon:_0x3b2196,text:_0x129d17}=getAttemptStatusDisplay(_0x4c6a42),_0x321881=(_0x4c6a42[_0x2a233a(0x22b)]?.[_0x2a233a(0x153)]||'?')+'.'+(_0x4c6a42['workflow']?.[_0x2a233a(0x153)]||'?'),_0x37fb75=_0x4c6a42['sessionTime']?a54_0x4448c0[_0x2a233a(0xcc)](_0x4c6a42[_0x2a233a(0x24f)]):'';return(_0x39ca3f+'\x20'+_0x3b2196+(_0x129d17?'\x20'+_0x129d17:'')+'\x20'+_0x321881+'\x20'+_0x37fb75)[_0x2a233a(0x9e)]();});await writeOutput(_0x25a076['join']('\x0a'),_0x30a9e7[_0x49df51(0x232)],_0x49df51(0x132));}}return 0x0;}}function a54_0x43e6(){const _0x4b55dc=['disabledAt','newProjectName','MAX_TIMELINE_WIDTH','\x0a⚠\x20Project\x20\x22','Source:\x20','Source\x20directory\x20is\x20required','deleted','attempt','resolveProject','\x20(use\x20--limit\x20to\x20show\x20more)','253DFGLsi','dryRun','yes','\x20task','values','executePushProject','write','Error:\x20','\x20\x20Session\x20ID:\x20','value','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflow:secrets:list','Parameters:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Showing\x20','→\x20Project:\x20','✔\x20Pull\x20complete','navigateSessionsInteractive','(use\x20--limit\x20to\x20see\x20more)','running','join','\x20\x20Revision:\x20','type','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x22\x20to\x20new\x20project\x20\x22','workflow:timeline','55464pgfQKt','✔\x20Schedule\x20#','Loading\x20workflows...','workflow:kill','\x20\x20New\x20attempt\x20ID:\x20','context','Retrying\x20attempt...','sessionId','isNewProject','\x20\x20Source:\x20','Output\x20directory:\x20','Cancelled','\x20sessions\x20','startedAt','📋\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20secret','verbose','fs/promises','workflow:sessions','TASK_NAME_WIDTH','fill','listSecrets','No\x20workflows\x20found','set','\x20-\x20','\x0aApply\x20these\x20changes?','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Expected\x20format:\x20--param\x20key=value','enableSchedule','min','path','cancelRequested','Project\x20directory:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','resumeFrom','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','✔\x20Workflow\x20project\x20set\x20to:\x20','toISOString','getTime','Pulling\x20project\x20','stdout','Pushing\x20workflow\x20project...','\x20from\x20session\x20','Filter:\x20','No\x20matching\x20sessions\x20found','Pattern:\x20','Files\x20to\x20upload:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','MIN_LABEL_COUNT','\x20logs','from','✔\x20Project:\x20','workflow:secrets:delete','push','Setting\x20','execute','select','resolveProjectDir','No\x20sessions\x20found\x20for:\x20','POLL_INTERVAL_MS','📁\x20','toLocaleString','format','✔\x20Push\x20complete','generateSessionTimelineRows','Project\x20name\x20is\x20required','-\x20nothing\x20pushed','\x0aPush\x20these\x20changes?','MAX_POLL_ITERATIONS','getMinutes','\x20\x20Console:\x20','\x20next:\x20','start','workflow:run','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20attempt','tdx.json','localeCompare','LABEL_WIDTH_DIVISOR','✔\x20Downloaded\x20','renderTimeline','revision','Session\x20time:\x20','fullName','parseProjectWorkflowPattern','workflow:workflows','readFile','Killing\x20attempt...','preparePushProject','skipValidation','\x20\x20Files\x20extracted:\x20','autocomplete','error','relative','workflow:schedules','\x20\x20Project\x20ID:\x20','revision:\x20','cyan','Including\x20subtasks:\x20yes','Analyzing\x20project...','finishedAt','Loading\x20sessions...','updatedAt','LABEL_MIN_SPACING','existingProjectId','targetExists','Analyzing\x20changes...','Force:\x20yes','sourceProjectName','isArray','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Auto-selected\x20latest\x20session:\x20','reason','\x0aUpdate\x20existing\x20project\x20\x22','workflows','round','done','kill','green','Target:\x20','project','canceling','parse','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','MIN_TIMELINE_WIDTH','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x20\x20Attempt\x20ID:\x20','output','workflow:retry','params','Error:\x20Project\x20name\x20is\x20required','renderSessionsTimeline','isTTY','fileCount','nextRunTime','filesExtracted','indexOf','state','Usage:\x20tdx\x20wf\x20use\x20<project>','replace','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','pending','Project\x20name:\x20','workflow:attempt','ICON_WIDTH','4899490UmpvHI','Listing\x20workflows...','task','logs','\x20(disabled)','attemptId','workflow:secrets:set','No\x20workflow\x20projects\x20found','Listing\x20workflow\x20sessions...','(unknown)','72fkLbFy','sessionTime','unknown','2743510JGEpsJ','\x20\x20Session\x20context\x20set\x20to:\x20','summary','\x20workflow','prepareCloneProject','cwd','index','workflow:clone','MAX_TASKS_DISPLAY','fileSize','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Retry\x20a\x20session\x20or\x20attempt','projectName','changes','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20secrets\x20set\x20for\x20project\x20\x27','length','trimEnd','has','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','diff','Disabling\x20schedule\x20#','stringify','No\x20sessions\x20found\x20in\x20project:\x20','Downloading\x20logs...','blue','match','No\x20log\x20files\x20found\x20for\x20this\x20attempt','download','No\x20attempts\x20found\x20for:\x20','6zHeirO','sort','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x1b[1A\x1b[2K','showWorkflowConsoleUrl','Show\x20tasks\x20for\x20an\x20attempt','columns','filter','table','createdAt','sessions','3486805geNnOx','splice','displayLine','Deleting\x20secret...','Listing\x20workflow\x20projects...','attempts','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','.\x20Expected\x20format:\x20KEY=VALUE','\x20modified','workflow:download','requireProject','param','duration','\x20\x20tdx\x20wf\x20use\x20<project>','success','No\x20projects\x20match\x20pattern:\x20','getMonth','includes','No\x20workflows\x20found\x20in\x20project:\x20','workflow','end','No\x20sessions\x20found','dim','✔\x20Retry\x20started','unchanged','renderSingleTimeline','Status:\x20','Revision:\x20','includeSubtasks','1400100uRaeCq','description','\x20\x20Changes:\x20','No\x20log\x20content\x20found','projectId','\x27\x20from\x20project\x20\x27','padStart','startTime','Listing\x20schedules...','workflow:tasks','Fetching\x20log\x20files...','text','data','Total:\x20','workflow:use','\x20schedule','List\x20workflow\x20attempts','pollTimeline','resolve','Using\x20attempt\x20','log','trim','getFullYear','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Latest\x20session\x20has\x20no\x20attempt','durationMs','Enabling\x20schedule\x20#','Attempt:\x20','group_error','workflow:schedule:enable','retryAttempt','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Setting\x20secret...','...','-\x20no\x20files\x20written','List\x20workflows','slice','✔\x20Clone\x20complete','/app/workflows/','Kill\x20a\x20running\x20attempt','listSchedules','Disable\x20a\x20workflow\x20schedule','max','\x20\x20Project:\x20','---\x20','jsonl','\x0aClone\x20\x22','size','From\x20task:\x20','\x20secrets...','new','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20workflow\x20sessions\x20found','No\x20attempts\x20found\x20in\x20project:\x20','Error:\x20Attempt\x20ID\x20is\x20required','repeat','Show\x20specific\x20attempt\x20details','projects','session','window','✔\x20Project\x20updated','status','⚠\x20Showing\x20first\x20','get','workflow:delete','✔\x20Found\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:upload','Filter:\x20project=','workflowName','workflow:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Workflow:\x20','Key\x20cannot\x20be\x20empty','\x20\x20Next\x20run:\x20','📅\x20#','getDate','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)',',\x20Workflow:\x20','Deleting\x20project\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','taskName','workflowProject','6aKKXJD','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','floor','No\x20schedules\x20found','Getting\x20attempt\x20tasks...','executeCloneProject','Session\x20','Project:\x20','\x20\x20Target:\x20','6301gCSpHV','targetDir','now','list','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x0a✔\x20No\x20changes\x20to\x20push','Target\x20directory:\x20','clear','\x0aDry\x20run\x20-\x20no\x20project\x20created','Loading\x20session...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','yellow','substring','Starting\x20workflow\x20run...','tdx\x20wf\x20attempt\x20','\x20disabled\x20(','\x0aPolling...\x20(','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','limit','\x20deleted','\x20is\x20not\x20a\x20directory','Error:\x20Secret\x20key\x20is\x20required','session_id','Error:','✔\x20Workflow\x20run\x20started','List\x20workflow\x20execution\x20sessions','retryAttemptName','workflow:schedule:disable','✔\x20Deleted\x20project\x20','workflow:projects','session:','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','workflow:logs','Select\x20a\x20session\x20to\x20view\x20timeline:','Schedule\x20ID\x20is\x20required','name','workflow:attempts','startsWith','toLowerCase','msPerChar','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','GUTTER','No\x20attempts\x20found','json','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','List\x20all\x20workflow\x20projects','Listing\x20secrets...','Resume\x20from:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20new','keys','tasks','ICON_SPACING','No\x20sessions\x20with\x20timing\x20information','red','🔄\x20','split','Dry\x20run:\x20yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Select\x20a\x20task\x20to\x20view\x20logs:','follow','733280CoaIho','icon','\x0aError:','\x0aDry\x20run\x20-\x20nothing\x20pushed','find','Select\x20a\x20workflow\x20to\x20run','site','getHours','key','\x0a✔\x20Already\x20up\x20to\x20date','buildTimelineData','\x20tasks','\x20session','modified','map','✔\x20Secret\x20\x27','lastAttempt','disableSchedule','planned','18QRHzYw','\x20\x20Location:\x20','Validation:\x20skipped','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','New\x20project\x20name:\x20','Failed\x20to\x20fetch\x20attempt\x20data','\x22\x20with\x20new\x20revision?','Attempt\x20ID:\x20','hasChanges'];a54_0x43e6=function(){return _0x4b55dc;};return a54_0x43e6();}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x242);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x10b);async[a54_0x4f40c0(0x1e9)](_0x232884){const _0x545183=a54_0x4f40c0,{options:_0x4dd349,args:_0x5b643f,tdx:_0x3abe09}=_0x232884,_0x473a3c=_0x5b643f[0x0];if(!_0x473a3c)return console[_0x545183(0x20f)](_0x545183(0x109)),0x1;_0x4dd349[_0x545183(0x1c0)]&&console[_0x545183(0x20f)](_0x545183(0x188)+_0x473a3c);const _0x340c90=await withSpinner('Getting\x20attempt\x20details...',()=>_0x3abe09[_0x545183(0xc9)]['attempt'](_0x473a3c),{'verbose':_0x4dd349[_0x545183(0x1c0)]}),_0xba36f9=_0x340c90[_0x545183(0xdf)];let _0x204c76;!_0xba36f9[_0x545183(0x227)]?_0x204c76=_0xba36f9[_0x545183(0x1cf)]?_0x545183(0x22c):_0x545183(0x1a7):_0x204c76=_0xba36f9[_0x545183(0xc4)]?_0x545183(0xc4):_0x545183(0x20f);let _0x59b08f;if(_0xba36f9[_0x545183(0xb4)]&&_0xba36f9[_0x545183(0x217)]){const _0x728004=new Date(_0xba36f9[_0x545183(0xb4)])[_0x545183(0x1d6)](),_0x44817e=new Date(_0xba36f9[_0x545183(0x217)])[_0x545183(0x1d6)]();_0x59b08f=Math[_0x545183(0x226)]((_0x44817e-_0x728004)/0x3e8);}const _0x3d9b51={'attempt_id':_0xba36f9['id'],'status':_0x204c76,..._0xba36f9[_0x545183(0x257)]!==undefined&&{'index':_0xba36f9['index']},..._0xba36f9[_0x545183(0x22b)]&&{'project':_0xba36f9[_0x545183(0x22b)]['name']},..._0xba36f9['workflow']&&{'workflow':_0xba36f9[_0x545183(0xc9)][_0x545183(0x153)]},..._0xba36f9['sessionId']&&{'session_id':_0xba36f9[_0x545183(0x1b6)]},..._0xba36f9[_0x545183(0x24f)]&&{'session_time':_0xba36f9[_0x545183(0x24f)]},..._0xba36f9[_0x545183(0x149)]&&{'retry_attempt':_0xba36f9[_0x545183(0x149)]},..._0x59b08f!==undefined&&{'duration_sec':_0x59b08f},..._0xba36f9['createdAt']&&{'created_at':_0xba36f9[_0x545183(0xb4)]},..._0xba36f9[_0x545183(0x217)]&&{'finished_at':_0xba36f9[_0x545183(0x217)]},...Object[_0x545183(0x163)](_0xba36f9[_0x545183(0x234)])[_0x545183(0x9d)]>0x0&&{'params':_0xba36f9[_0x545183(0x234)]}};return await handleSingleObjectOutput(_0x3d9b51,_0x4dd349),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0xdc);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xb0);async[a54_0x4f40c0(0x1e9)](_0x1564df){const _0x3311cb=a54_0x4f40c0,{options:_0x515022,args:_0x5a5e69,tdx:_0x23a75c}=_0x1564df,_0x35e873=_0x5a5e69[0x0];if(!_0x35e873)return console[_0x3311cb(0x20f)](_0x3311cb(0x109)),0x1;const _0xf5b915=_0x515022[_0x3311cb(0xd2)];_0x515022[_0x3311cb(0x1c0)]&&(console[_0x3311cb(0x20f)](_0x3311cb(0x188)+_0x35e873),_0xf5b915&&console[_0x3311cb(0x20f)](_0x3311cb(0x215)));const _0xbc3cea=await withSpinner(_0x3311cb(0x12a),()=>_0x23a75c['workflow'][_0x3311cb(0x164)](_0x35e873,_0xf5b915||![]),{'verbose':_0x515022['verbose']}),_0x2f618f=_0xbc3cea[_0x3311cb(0xdf)];return console[_0x3311cb(0x20f)]('✔\x20Found\x20'+_0x2f618f[_0x3311cb(0x9d)]+_0x3311cb(0x197)+(_0x2f618f[_0x3311cb(0x9d)]!==0x1?'s':'')),await handleSDKOutput(_0x2f618f,_0x515022),0x0;}}function a54_0x4855(_0x318f13,_0x570f20){_0x318f13=_0x318f13-0x99;const _0x43e6ba=a54_0x43e6();let _0x485513=_0x43e6ba[_0x318f13];return _0x485513;}export class WorkflowLogsCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x150);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x115);async[a54_0x4f40c0(0x1e9)](_0x4cf1fd){const _0x5c428b=a54_0x4f40c0,{options:_0x144f78,args:_0x1e9e2e,tdx:_0x8b25f1}=_0x4cf1fd,_0x1a559f=_0x1e9e2e[0x0];let _0x1df2b6=_0x1e9e2e[0x1];if(!_0x1a559f)return console[_0x5c428b(0x20f)](_0x5c428b(0x109)),0x1;_0x144f78[_0x5c428b(0x1c0)]&&(console[_0x5c428b(0x20f)](_0x5c428b(0x188)+_0x1a559f),_0x1df2b6&&console['error']('Task\x20name:\x20'+_0x1df2b6));const _0x4955d8=await withSpinner(_0x5c428b(0xdd),()=>_0x8b25f1['workflow']['logFiles'](_0x1a559f,_0x1df2b6),{'verbose':_0x144f78['verbose']}),_0x48c1f8=_0x4955d8['data'];if(_0x48c1f8[_0x5c428b(0x9d)]===0x0)return console[_0x5c428b(0x20f)](_0x5c428b(0xa8)),0x0;if(!_0x1df2b6&&(_0x144f78[_0x5c428b(0x15b)]||_0x144f78[_0x5c428b(0x1f0)]))return await handleSDKOutput(_0x48c1f8,_0x144f78),0x0;if(!_0x1df2b6){const _0x58c20b=_0x48c1f8[_0x5c428b(0x17c)](_0x45065c=>({'title':_0x45065c[_0x5c428b(0x124)]+'\x20('+formatBytes(_0x45065c[_0x5c428b(0x25a)])+')','value':_0x45065c[_0x5c428b(0x124)]})),_0x2e583b=await a54_0x3961f9({'type':_0x5c428b(0x1ea),'name':_0x5c428b(0x246),'message':_0x5c428b(0x16c),'choices':_0x58c20b});if(!_0x2e583b['task'])return console[_0x5c428b(0x20f)](_0x5c428b(0x1ba)),0x0;_0x1df2b6=_0x2e583b['task'];}const _0x3a033a=await withSpinner(_0x5c428b(0xa5),()=>_0x8b25f1[_0x5c428b(0xc9)][_0x5c428b(0x247)](_0x1a559f,_0x1df2b6),{'verbose':_0x144f78['verbose']}),_0x299aa7=_0x3a033a[_0x5c428b(0xdf)];return _0x299aa7?console[_0x5c428b(0xe7)](_0x299aa7):console[_0x5c428b(0x20f)](_0x5c428b(0xd6)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1b2);['description']=a54_0x4f40c0(0xfa);async['execute'](_0x4a89cc){const _0x15cef2=a54_0x4f40c0,{options:_0x1084b2,args:_0x503b13,tdx:_0x10ab81}=_0x4a89cc,_0x567e8e=_0x503b13[0x0];if(!_0x567e8e)return console[_0x15cef2(0x20f)](_0x15cef2(0x109)),0x1;const _0x34d8b9=_0x1084b2[_0x15cef2(0x223)];_0x1084b2[_0x15cef2(0x1c0)]&&(console[_0x15cef2(0x20f)]('Attempt\x20ID:\x20'+_0x567e8e),_0x34d8b9&&console[_0x15cef2(0x20f)]('Reason:\x20'+_0x34d8b9));if(!_0x1084b2['yes']){if(!isInteractive())return console[_0x15cef2(0x20f)](a54_0x4448c0[_0x15cef2(0x167)](_0x15cef2(0x170)),_0x15cef2(0x106)),console[_0x15cef2(0x20f)](a54_0x4448c0[_0x15cef2(0xcc)](_0x15cef2(0x140))),0x1;const _0x22d7a1=await confirmKey(_0x15cef2(0x15c)+_0x567e8e+'?');if(!_0x22d7a1)return console[_0x15cef2(0x20f)](a54_0x4448c0['yellow'](_0x15cef2(0x1ba))),0x1;}const _0x805ec6=await withSpinner(_0x15cef2(0x20a),()=>_0x10ab81[_0x15cef2(0xc9)][_0x15cef2(0x228)](_0x567e8e,_0x34d8b9),{'verbose':_0x1084b2['verbose']}),_0x85be89=_0x805ec6[_0x15cef2(0xdf)];return console[_0x15cef2(0x20f)]('✔\x20'+_0x85be89),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x233);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x25c);async[a54_0x4f40c0(0x1e9)](_0x134e44){const _0x5ec997=a54_0x4f40c0,{options:_0x4ed81b,args:_0xfffa7d,tdx:_0x500b78}=_0x134e44,_0x5ec81c=_0xfffa7d[0x0];if(!_0x5ec81c)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x5ec997(0x20f)](_0x5ec997(0x1ac)),0x1;let _0x5d6aca=![],_0x4ca7de=_0x5ec81c;if(_0x5ec81c['startsWith'](_0x5ec997(0x14d)))_0x5d6aca=!![],_0x4ca7de=_0x5ec81c[_0x5ec997(0x13b)](0x8);else{if(_0x5ec81c[_0x5ec997(0x155)]('attempt:'))_0x5d6aca=![],_0x4ca7de=_0x5ec81c[_0x5ec997(0x13b)](0x8);else return console[_0x5ec997(0x20f)](_0x5ec997(0x1be)),console[_0x5ec997(0x20f)](_0x5ec997(0x1ac)),0x1;}const _0x479052=_0x4ed81b['fromTask'],_0x1a0f4c=_0x4ed81b[_0x5ec997(0x1d2)],_0x7cb855=_0x4ed81b[_0x5ec997(0x234)],_0x1053db=_0x4ed81b['force'];_0x4ed81b[_0x5ec997(0x1c0)]&&(console[_0x5ec997(0x20f)](_0x5ec997(0x22a)+(_0x5d6aca?_0x5ec997(0x10d):_0x5ec997(0x191))+'\x20'+_0x4ca7de),_0x479052&&console['error'](_0x5ec997(0x103)+_0x479052),_0x1a0f4c&&console['error'](_0x5ec997(0x15f)+_0x1a0f4c),_0x7cb855&&console[_0x5ec997(0x20f)]('Params:\x20'+_0x7cb855),_0x1053db&&console[_0x5ec997(0x20f)](_0x5ec997(0x21e)));let _0x42a27f;if(_0x7cb855)try{if(_0x7cb855['startsWith']('@')){const _0x3712ba=await import(_0x5ec997(0x1c1)),_0x42d973=_0x7cb855['substring'](0x1),_0x554070=await _0x3712ba[_0x5ec997(0x209)](_0x42d973,'utf-8');_0x42a27f=JSON['parse'](_0x554070);}else _0x42a27f=JSON[_0x5ec997(0x22d)](_0x7cb855);}catch{return console[_0x5ec997(0x20f)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4ed81b[_0x5ec997(0x196)]){if(!isInteractive())return console[_0x5ec997(0x20f)](a54_0x4448c0[_0x5ec997(0x167)](_0x5ec997(0x170)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5ec997(0x20f)](a54_0x4448c0['dim'](_0x5ec997(0x140))),0x1;const _0x2916ee=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5d6aca?_0x5ec997(0x10d):_0x5ec997(0x191))+'\x20'+_0x4ca7de+'?');if(!_0x2916ee)return console[_0x5ec997(0x20f)](a54_0x4448c0['yellow'](_0x5ec997(0x1ba))),0x1;}let _0xe3c806;_0x5d6aca?_0xe3c806=await withSpinner('Retrying\x20session...',()=>_0x500b78[_0x5ec997(0xc9)]['retrySession'](_0x4ca7de,{'fromTask':_0x479052,'retryParams':_0x42a27f}),{'verbose':_0x4ed81b[_0x5ec997(0x1c0)]}):_0xe3c806=await withSpinner(_0x5ec997(0x1b5),()=>_0x500b78[_0x5ec997(0xc9)][_0x5ec997(0xf1)](_0x4ca7de,{'resumeFrom':_0x1a0f4c,'retryParams':_0x42a27f,'force':_0x1053db}),{'verbose':_0x4ed81b[_0x5ec997(0x1c0)]});const _0x4b4190=_0xe3c806[_0x5ec997(0xdf)];return console[_0x5ec997(0x20f)](_0x5ec997(0xcd)),console['error'](_0x5ec997(0x1b3)+_0x4b4190[_0x5ec997(0x249)]),console[_0x5ec997(0x20f)](_0x5ec997(0x19c)+_0x4b4190[_0x5ec997(0x1b6)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1fb);[a54_0x4f40c0(0xd4)]='Start\x20a\x20workflow\x20run';async[a54_0x4f40c0(0x1e9)](_0x291c94){const _0xe538dd=a54_0x4f40c0,{options:_0x356523,args:_0x3730c2,tdx:_0x2994e3}=_0x291c94;let _0x5aa74b=_0x3730c2[0x0];if(!_0x5aa74b){const _0x2aa532=this[_0xe538dd(0x192)]([],_0x356523),_0x5e34ed=await withSpinner(_0xe538dd(0x1b1),()=>_0x2994e3[_0xe538dd(0xc9)][_0xe538dd(0x225)](_0x2aa532,{'limit':_0x356523[_0xe538dd(0x141)]}),{'verbose':_0x356523[_0xe538dd(0x1c0)]}),_0x497331=_0x5e34ed[_0xe538dd(0xdf)];if(_0x497331[_0xe538dd(0x9d)]===0x0)return console[_0xe538dd(0x20f)]('No\x20workflows\x20found'),!_0x2aa532&&console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0xcc)](_0xe538dd(0x23f))),0x1;const _0x5026bc=_0x497331[_0xe538dd(0x17c)](_0x721101=>({'title':_0x721101[_0xe538dd(0x22b)]?.['name']+'.'+_0x721101[_0xe538dd(0x153)],'value':_0x721101[_0xe538dd(0x22b)]?.[_0xe538dd(0x153)]+'.'+_0x721101[_0xe538dd(0x153)],'description':_0x721101[_0xe538dd(0x204)]?_0xe538dd(0x213)+_0x721101[_0xe538dd(0x204)]:undefined})),_0x56fa7f=await a54_0x3961f9({'type':'select','name':_0xe538dd(0xc9),'message':_0xe538dd(0x173),'choices':_0x5026bc});if(!_0x56fa7f[_0xe538dd(0xc9)])return 0x1;_0x5aa74b=_0x56fa7f['workflow'];}if(!_0x5aa74b[_0xe538dd(0xc7)]('.')){const _0x32f0c7=this[_0xe538dd(0x192)]([],_0x356523);if(_0x32f0c7)_0x5aa74b=_0x32f0c7+'.'+_0x5aa74b;else return console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0x167)](_0xe538dd(0x146)),_0xe538dd(0x1fd)),console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0xcc)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x45fd39=_0x356523[_0xe538dd(0xc1)],_0xb528b3=_0x356523[_0xe538dd(0x24f)],_0x260b1b={};if(_0x45fd39&&Array[_0xe538dd(0x220)](_0x45fd39))for(const _0x1aa5f5 of _0x45fd39){const _0x845c24=_0x1aa5f5[_0xe538dd(0x23b)]('=');if(_0x845c24===-0x1)return console[_0xe538dd(0x20f)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x1aa5f5),console['error'](_0xe538dd(0x1cb)),0x1;const _0x19cf90=_0x1aa5f5[_0xe538dd(0x13b)](0x0,_0x845c24),_0x71951b=_0x1aa5f5[_0xe538dd(0x13b)](_0x845c24+0x1);try{_0x260b1b[_0x19cf90]=JSON['parse'](_0x71951b);}catch{_0x260b1b[_0x19cf90]=_0x71951b;}}_0x356523[_0xe538dd(0x1c0)]&&(console[_0xe538dd(0x20f)]('Workflow:\x20'+_0x5aa74b),Object[_0xe538dd(0x163)](_0x260b1b)[_0xe538dd(0x9d)]>0x0&&console[_0xe538dd(0x20f)](_0xe538dd(0x1a0)+JSON[_0xe538dd(0xa3)](_0x260b1b)),_0xb528b3&&console['error'](_0xe538dd(0x205)+_0xb528b3));const _0x4c600d=await withSpinner(_0xe538dd(0x13c),()=>_0x2994e3[_0xe538dd(0xc9)]['run'](_0x5aa74b,_0x260b1b,{'sessionTime':_0xb528b3}),{'verbose':_0x356523[_0xe538dd(0x1c0)]}),_0x2a31dc=_0x4c600d['data'];console[_0xe538dd(0x20f)](_0xe538dd(0x147)),console['error'](_0xe538dd(0x231)+_0x2a31dc['id']),console[_0xe538dd(0x20f)](_0xe538dd(0x19c)+_0x2a31dc[_0xe538dd(0x1b6)]),console[_0xe538dd(0x20f)](_0xe538dd(0xfe)+_0x2a31dc[_0xe538dd(0x22b)]?.[_0xe538dd(0x153)]),console[_0xe538dd(0x20f)](_0xe538dd(0x11b)+_0x2a31dc['workflow']?.[_0xe538dd(0x153)]);if(_0x2a31dc[_0xe538dd(0x22b)]?.['id']&&_0x2a31dc[_0xe538dd(0x1b6)]&&_0x2a31dc['id']){const _0x27fd61=_0x356523[_0xe538dd(0x174)],_0x2511d1=getConsoleUrl(_0x27fd61,_0xe538dd(0xf9)+_0x2a31dc[_0xe538dd(0x22b)]['id']+'/sessions/'+_0x2a31dc[_0xe538dd(0x1b6)]+'/attempt/'+_0x2a31dc['id']);console[_0xe538dd(0x20f)]('\x20\x20Console:\x20'+a54_0x4448c0[_0xe538dd(0x214)](_0x2511d1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x4f40c0(0xbf);[a54_0x4f40c0(0xd4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x4f40c0(0x1e9)](_0x44f46a){const _0x405a64=a54_0x4f40c0,{options:_0x56e18d,args:_0x34d6ba,tdx:_0xb1caa4}=_0x44f46a,_0x54614b=_0x34d6ba[0x0],_0x1efba2=_0x34d6ba[0x1]||'.';if(!_0x54614b)return console[_0x405a64(0x20f)](_0x405a64(0x235)),console[_0x405a64(0x20f)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x361739=_0x56e18d['revision'];_0x56e18d[_0x405a64(0x1c0)]&&(console['error'](_0x405a64(0x12d)+_0x54614b),console['error'](_0x405a64(0x1b9)+_0x1efba2),_0x361739&&console['error'](_0x405a64(0xd1)+_0x361739));const _0xf76a01=await withSpinner('Downloading\x20project\x20'+_0x54614b+_0x405a64(0xf4),()=>_0xb1caa4['workflow'][_0x405a64(0xa9)](_0x54614b,_0x1efba2,{'revision':_0x361739}),{'verbose':_0x56e18d['verbose']}),_0x57ef88=_0xf76a01[_0x405a64(0xdf)];return console[_0x405a64(0x20f)](_0x405a64(0x202)+_0x57ef88[_0x405a64(0x99)]),console['error']('\x20\x20Revision:\x20'+_0x57ef88['revision']),console['error'](_0x405a64(0x20d)+_0x57ef88[_0x405a64(0x23a)]),console['error'](_0x405a64(0x182)+_0x1efba2+'/'+_0x57ef88[_0x405a64(0x99)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x116);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x120);async['execute'](_0x4d9393){const _0x5af7a6=a54_0x4f40c0,{options:_0x201e44,args:_0x853626,tdx:_0x3bde15}=_0x4d9393;let _0x51dbe9='.',_0x288f73=_0x201e44[_0x5af7a6(0x153)];if(_0x853626[0x0]){const {promises:_0x283aeb}=await import('fs');try{const _0xb95d78=await _0x283aeb['stat'](_0x853626[0x0]);if(_0xb95d78['isDirectory']())_0x51dbe9=_0x853626[0x0];else return console[_0x5af7a6(0x20f)](_0x5af7a6(0x19b)+_0x853626[0x0]+_0x5af7a6(0x143)),0x1;}catch{_0x288f73=_0x853626[0x0],_0x51dbe9='.';}}const _0x290fdb=_0x201e44['revision'],_0x472001=_0x201e44['skipValidation'];_0x201e44['verbose']&&(console['error'](_0x5af7a6(0x1d0)+_0x51dbe9),_0x288f73&&console[_0x5af7a6(0x20f)](_0x5af7a6(0x241)+_0x288f73),_0x290fdb&&console['error'](_0x5af7a6(0xd1)+_0x290fdb),_0x472001&&console[_0x5af7a6(0x20f)]('Validation:\x20skipped'));const _0x2034d5=await withSpinner(_0x5af7a6(0x1d9),()=>_0x3bde15[_0x5af7a6(0xc9)][_0x5af7a6(0x1e7)](_0x51dbe9,{'projectName':_0x288f73,'revision':_0x290fdb,'skipValidation':_0x472001}),{'verbose':_0x201e44[_0x5af7a6(0x1c0)]}),_0x2813af=_0x2034d5['data'];return console[_0x5af7a6(0x20f)]('✔\x20Pushed\x20'+_0x2813af[_0x5af7a6(0x99)]),console[_0x5af7a6(0x20f)](_0x5af7a6(0x212)+_0x2813af[_0x5af7a6(0xd7)]),console['error'](_0x5af7a6(0x1a9)+_0x2813af['revision']),await this[_0x5af7a6(0xaf)](_0x3bde15,_0x2813af[_0x5af7a6(0x99)],_0x201e44[_0x5af7a6(0x174)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x119);[a54_0x4f40c0(0xd4)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x4890b6){const _0x54a350=a54_0x4f40c0,{options:_0x268f7b,args:_0x2ef52d,tdx:_0x3f8c74}=_0x4890b6,_0x37ed32=_0x2ef52d[0x0],_0x39eb55=_0x2ef52d[0x1];if(!_0x37ed32)return console['error'](a54_0x4448c0[_0x54a350(0x167)](_0x54a350(0x146)),_0x54a350(0x1f3)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0xf2))),0x1;const _0x32db88=_0x268f7b[_0x54a350(0x204)];_0x268f7b[_0x54a350(0x1c0)]&&(console[_0x54a350(0x20f)](_0x54a350(0x12d)+_0x37ed32),_0x39eb55&&console['error'](_0x54a350(0x135)+_0x39eb55),_0x32db88&&console[_0x54a350(0x20f)](_0x54a350(0xd1)+_0x32db88),_0x268f7b[_0x54a350(0x195)]&&console[_0x54a350(0x20f)](_0x54a350(0x16a)));const _0x52efb2=await withSpinner(_0x54a350(0x1d7)+_0x37ed32+_0x54a350(0xf4),()=>_0x3f8c74[_0x54a350(0xc9)]['pullProject'](_0x37ed32,{'targetDir':_0x39eb55,'revision':_0x32db88}),{'verbose':_0x268f7b[_0x54a350(0x1c0)]}),_0x3821f0=_0x52efb2[_0x54a350(0xdf)];_0x3821f0[_0x54a350(0x1b7)]?console[_0x54a350(0x20f)]('→\x20New\x20project:\x20'+_0x3821f0[_0x54a350(0x99)]):console['error'](_0x54a350(0x1a3)+_0x3821f0['projectName']);console[_0x54a350(0x20f)](_0x54a350(0x1a9)+_0x3821f0[_0x54a350(0x204)]),console['error'](_0x54a350(0x12e)+(a54_0x4ed50f[_0x54a350(0x210)](process[_0x54a350(0x256)](),_0x3821f0[_0x54a350(0x130)])||'.')),console[_0x54a350(0x20f)](_0x54a350(0xd5)+a54_0x4448c0[_0x54a350(0x229)]('+'+_0x3821f0[_0x54a350(0x253)][_0x54a350(0x105)]+'\x20new')+',\x20'+(a54_0x4448c0[_0x54a350(0x13a)]('~'+_0x3821f0['summary'][_0x54a350(0x17b)]+'\x20modified')+',\x20')+(a54_0x4448c0[_0x54a350(0x167)]('-'+_0x3821f0[_0x54a350(0x253)][_0x54a350(0x190)]+_0x54a350(0x142))+',\x20')+(''+a54_0x4448c0[_0x54a350(0xcc)](_0x3821f0[_0x54a350(0x253)][_0x54a350(0xce)]+'\x20unchanged')));for(const _0x3c10c2 of _0x3821f0[_0x54a350(0x9a)]){_0x3c10c2[_0x54a350(0x1aa)]===_0x54a350(0x17b)&&_0x3c10c2['diff']&&(console[_0x54a350(0x20f)]('\x0a'+a54_0x4448c0[_0x54a350(0x214)](_0x54a350(0xff)+_0x3c10c2[_0x54a350(0x1ce)])),console[_0x54a350(0x20f)](_0x3c10c2['diff']));}if(!_0x3821f0[_0x54a350(0x189)])return saveSessionContext({'workflow_project':_0x3821f0['projectName']},_0x268f7b[_0x54a350(0x10d)]),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x229)](_0x54a350(0x177))),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0x252)+_0x3821f0['projectName'])),0x0;if(_0x268f7b[_0x54a350(0x195)])return console['error'](a54_0x4448c0['yellow'](_0x54a350(0x230))),0x0;if(!_0x268f7b['yes']){if(!isInteractive())return console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x167)]('\x0aError:'),_0x54a350(0x106)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0x140))),0x1;const _0x24c608=await confirmKey(_0x54a350(0x1c9));if(!_0x24c608)return console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x13a)]('Cancelled'),_0x54a350(0xf5)),0x1;}await withSpinner('Writing\x20files...',()=>_0x3f8c74[_0x54a350(0xc9)]['applyPullProject'](_0x3821f0,{'revision':_0x32db88}),{'verbose':_0x268f7b[_0x54a350(0x1c0)]}),saveSessionContext({'workflow_project':_0x3821f0[_0x54a350(0x99)]},_0x268f7b[_0x54a350(0x10d)]),console['error'](a54_0x4448c0['green'](_0x54a350(0x1a4)));const _0x1b503d=a54_0x4ed50f[_0x54a350(0x210)](process[_0x54a350(0x256)](),_0x3821f0['targetDir'])||'.';return console[_0x54a350(0x20f)](a54_0x4448c0['dim'](_0x54a350(0x182)+_0x1b503d)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3821f0[_0x54a350(0x99)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x160);async['execute'](_0x274c54){const _0x4d02a6=a54_0x4f40c0,{options:_0x4e5506,args:_0xf31171,tdx:_0x167aee}=_0x274c54,_0x3d293b=this[_0x4d02a6(0x1eb)](_0xf31171,_0x4e5506),_0x327ac0=_0x4e5506[_0x4d02a6(0x204)],_0x740007=_0x4e5506[_0x4d02a6(0x20c)];_0x4e5506['verbose']&&(_0x3d293b&&console[_0x4d02a6(0x20f)]('Source\x20directory:\x20'+_0x3d293b),_0x327ac0&&console['error']('Revision:\x20'+_0x327ac0),_0x4e5506['dryRun']&&console[_0x4d02a6(0x20f)](_0x4d02a6(0x16a)),_0x740007&&console[_0x4d02a6(0x20f)](_0x4d02a6(0x183)));let _0x20209b;try{_0x20209b=await withSpinner(_0x4d02a6(0x21d),()=>_0x167aee[_0x4d02a6(0xc9)][_0x4d02a6(0x20b)]({'sourceDir':_0x3d293b,'revision':_0x327ac0,'skipValidation':_0x740007}),{'verbose':_0x4e5506['verbose']});}catch(_0x4f695b){if(_0x4f695b instanceof Error&&_0x4f695b['message'][_0x4d02a6(0xc7)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x167)]('Error:'),_0x4d02a6(0xbc)),_0x4e5506[_0x4d02a6(0x125)]?console['error'](a54_0x4448c0[_0x4d02a6(0xcc)]('Tip:\x20cd\x20to\x20workflows/'+_0x4e5506[_0x4d02a6(0x125)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4e5506[_0x4d02a6(0x125)]+'\x27')):console['error'](a54_0x4448c0['dim'](_0x4d02a6(0x19e))),0x1;throw _0x4f695b;}const _0xaa435a=_0x20209b[_0x4d02a6(0xdf)];console[_0x4d02a6(0x20f)](_0x4d02a6(0x1e5)+_0xaa435a['projectName']),console[_0x4d02a6(0x20f)](_0x4d02a6(0x1b8)+_0xaa435a['sourceDir']),console[_0x4d02a6(0x20f)]('\x20\x20Revision:\x20'+_0xaa435a[_0x4d02a6(0x204)]),console[_0x4d02a6(0x20f)](_0x4d02a6(0xd5)+a54_0x4448c0[_0x4d02a6(0x229)]('+'+_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0x105)]+_0x4d02a6(0x162))+',\x20'+(a54_0x4448c0['yellow']('~'+_0xaa435a['summary']['modified']+_0x4d02a6(0xbe))+',\x20')+(a54_0x4448c0['red']('-'+_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0x190)]+'\x20deleted')+',\x20')+(''+a54_0x4448c0['dim'](_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0xce)]+'\x20unchanged')));for(const _0x14907f of _0xaa435a['changes']){_0x14907f['type']===_0x4d02a6(0x17b)&&_0x14907f['diff']&&(console[_0x4d02a6(0x20f)]('\x0a'+a54_0x4448c0[_0x4d02a6(0x214)]('---\x20'+_0x14907f[_0x4d02a6(0x1ce)])),console[_0x4d02a6(0x20f)](_0x14907f[_0x4d02a6(0xa1)]));}if(!_0xaa435a[_0x4d02a6(0x189)])return console[_0x4d02a6(0x20f)](a54_0x4448c0['green'](_0x4d02a6(0x134))),await this[_0x4d02a6(0xaf)](_0x167aee,_0xaa435a[_0x4d02a6(0x99)],_0x4e5506[_0x4d02a6(0x174)]),0x0;if(_0x4e5506[_0x4d02a6(0x195)])return console[_0x4d02a6(0x20f)](a54_0x4448c0['yellow'](_0x4d02a6(0x171))),0x0;if(!_0x4e5506[_0x4d02a6(0x196)]){if(!isInteractive())return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x167)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x4448c0['dim'](_0x4d02a6(0x140))),0x1;const _0x2cdf7b=await confirmKey(_0x4d02a6(0x1f5));if(!_0x2cdf7b)return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x13a)](_0x4d02a6(0x1ba)),_0x4d02a6(0x1f4)),0x1;}const _0x2469ea=await withSpinner('Pushing\x20project...',()=>_0x167aee[_0x4d02a6(0xc9)][_0x4d02a6(0x199)](_0xaa435a),{'verbose':_0x4e5506[_0x4d02a6(0x1c0)]}),_0x12ec1b=_0x2469ea['data'];return console['error'](a54_0x4448c0['green'](_0x4d02a6(0x1f1))),console['error'](_0x4d02a6(0x212)+_0x12ec1b['projectId']),console[_0x4d02a6(0x20f)](_0x4d02a6(0x1a9)+_0x12ec1b[_0x4d02a6(0x204)]),await this[_0x4d02a6(0xaf)](_0x167aee,_0x12ec1b[_0x4d02a6(0x99)],_0x4e5506['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x258);[a54_0x4f40c0(0xd4)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x4f40c0(0x1e9)](_0x4f29d1){const _0x5c7306=a54_0x4f40c0,{options:_0x4c2e44,args:_0x9f6835,tdx:_0x10ddba}=_0x4f29d1,_0x4466e7=this[_0x5c7306(0x1eb)](_0x9f6835,_0x4c2e44),_0x38b0e9=_0x4c2e44[_0x5c7306(0x153)],_0x5c4e6b=_0x4c2e44['revision'],_0x242e60=_0x4c2e44['skipValidation'];if(!_0x4466e7)return console['error'](a54_0x4448c0['red'](_0x5c7306(0x146)),_0x5c7306(0x18f)),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0xcc)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x4448c0[_0x5c7306(0xcc)](_0x5c7306(0x184))),0x1;if(!_0x38b0e9)return console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x167)](_0x5c7306(0x146)),_0x5c7306(0x1d3)),console[_0x5c7306(0x20f)](a54_0x4448c0['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4c2e44['verbose']&&(console[_0x5c7306(0x20f)]('Source\x20directory:\x20'+_0x4466e7),console['error'](_0x5c7306(0x185)+_0x38b0e9),_0x5c4e6b&&console[_0x5c7306(0x20f)](_0x5c7306(0xd1)+_0x5c4e6b),_0x4c2e44[_0x5c7306(0x195)]&&console[_0x5c7306(0x20f)](_0x5c7306(0x16a)),_0x242e60&&console[_0x5c7306(0x20f)]('Validation:\x20skipped'));const _0xd28c7c=await withSpinner(_0x5c7306(0x216),()=>_0x10ddba[_0x5c7306(0xc9)][_0x5c7306(0x255)](_0x4466e7,_0x38b0e9,{'revision':_0x5c4e6b,'skipValidation':_0x242e60}),{'verbose':_0x4c2e44[_0x5c7306(0x1c0)]}),_0x58dc5e=_0xd28c7c[_0x5c7306(0xdf)];console[_0x5c7306(0x20f)](_0x5c7306(0x18e)+_0x58dc5e['sourceDir']);_0x58dc5e[_0x5c7306(0x21f)]&&console[_0x5c7306(0x20f)]('Source\x20project:\x20'+_0x58dc5e['sourceProjectName']);console[_0x5c7306(0x20f)](_0x5c7306(0x185)+_0x58dc5e[_0x5c7306(0x18b)]),console[_0x5c7306(0x20f)]('Revision:\x20'+_0x58dc5e[_0x5c7306(0x204)]),console['error'](_0x5c7306(0x1de)+_0x58dc5e[_0x5c7306(0x238)]);_0x58dc5e[_0x5c7306(0x21c)]&&(console[_0x5c7306(0x20f)](a54_0x4448c0['yellow'](_0x5c7306(0x18d)+_0x58dc5e[_0x5c7306(0x18b)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x58dc5e[_0x5c7306(0x21b)]+')')),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x13a)](_0x5c7306(0x1df))));if(_0x4c2e44[_0x5c7306(0x195)])return console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x13a)](_0x5c7306(0x137))),0x0;if(!_0x4c2e44[_0x5c7306(0x196)]){if(!isInteractive())return console[_0x5c7306(0x20f)](a54_0x4448c0['red']('\x0aError:'),_0x5c7306(0x106)),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0xcc)](_0x5c7306(0x140))),0x1;const _0x58e422=_0x58dc5e[_0x5c7306(0x21f)]||a54_0x4ed50f['basename'](_0x4466e7),_0x3024d5=_0x58dc5e[_0x5c7306(0x21c)]?_0x5c7306(0x224)+_0x38b0e9+_0x5c7306(0x187):_0x5c7306(0x101)+_0x58e422+_0x5c7306(0x1ad)+_0x38b0e9+'\x22?',_0x105704=await confirmKey(_0x3024d5);if(!_0x105704)return console['error'](a54_0x4448c0[_0x5c7306(0x13a)]('Cancelled')),0x1;}const _0x21c48f=await withSpinner(_0x58dc5e['targetExists']?'Updating\x20'+_0x38b0e9+_0x5c7306(0xf4):'Cloning\x20to\x20'+_0x38b0e9+_0x5c7306(0xf4),()=>_0x10ddba[_0x5c7306(0xc9)][_0x5c7306(0x12b)](_0x58dc5e),{'verbose':_0x4c2e44[_0x5c7306(0x1c0)]}),_0x19a5a0=_0x21c48f[_0x5c7306(0xdf)];return console['error'](a54_0x4448c0[_0x5c7306(0x229)](_0x58dc5e[_0x5c7306(0x21c)]?_0x5c7306(0x10f):_0x5c7306(0xf8))),console[_0x5c7306(0x20f)]('\x20\x20Project:\x20'+_0x19a5a0['newProjectName']),console[_0x5c7306(0x20f)](_0x5c7306(0x212)+_0x19a5a0['newProjectId']),console[_0x5c7306(0x20f)]('\x20\x20Revision:\x20'+_0x19a5a0[_0x5c7306(0x204)]),await this[_0x5c7306(0xaf)](_0x10ddba,_0x19a5a0[_0x5c7306(0x18b)],_0x4c2e44[_0x5c7306(0x174)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x113);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x16b);async['execute'](_0xd0cb3a){const _0x189913=a54_0x4f40c0,{options:_0x5819c5,args:_0x11ba2a,tdx:_0x3aa62b}=_0xd0cb3a,_0x3c24d0=_0x11ba2a[0x0];if(!_0x3c24d0)return console['error'](_0x189913(0x1fc)),console[_0x189913(0x20f)](_0x189913(0x1a1)),0x1;_0x5819c5[_0x189913(0x1c0)]&&console['error'](_0x189913(0x12d)+_0x3c24d0);if(!_0x5819c5[_0x189913(0x196)]){if(!isInteractive())return console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0x167)](_0x189913(0x170)),_0x189913(0x106)),console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0xcc)](_0x189913(0x140))),0x1;const _0x1aa06a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x3c24d0+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x1aa06a)return console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0x13a)](_0x189913(0x1ba))),0x1;}const _0x239a8b=await withSpinner(_0x189913(0x122)+_0x3c24d0+_0x189913(0xf4),()=>_0x3aa62b[_0x189913(0xc9)]['delete'](_0x3c24d0),{'verbose':_0x5819c5[_0x189913(0x1c0)]}),_0x42bdc8=_0x239a8b[_0x189913(0xdf)];return console[_0x189913(0x20f)](_0x189913(0x14b)+_0x42bdc8['projectName']),console[_0x189913(0x20f)]('\x20\x20Project\x20ID:\x20'+_0x42bdc8[_0x189913(0xd7)]),0x0;}}export function parseKeyValue(_0x4ab2d6){const _0x122311=a54_0x4f40c0,_0x3cf4e4=_0x4ab2d6['indexOf']('=');if(_0x3cf4e4===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4ab2d6+_0x122311(0xbd));const _0x44dda9=_0x4ab2d6['substring'](0x0,_0x3cf4e4),_0xc17f07=_0x4ab2d6['substring'](_0x3cf4e4+0x1);if(!_0x44dda9)throw new Error(_0x122311(0x11c));return{'key':_0x44dda9,'value':_0xc17f07};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x19f);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x161);async['execute'](_0x5f473d){const _0x122270=a54_0x4f40c0,{options:_0x2a0536,args:_0x4b5900,tdx:_0x5004a8}=_0x5f473d,_0x430b19=this[_0x122270(0xc0)](_0x4b5900,_0x2a0536);if(!_0x430b19)return 0x1;_0x2a0536[_0x122270(0x1c0)]&&console[_0x122270(0x20f)](_0x122270(0x12d)+_0x430b19);const _0x238e14=await withSpinner(_0x122270(0x15e),()=>_0x5004a8[_0x122270(0xc9)][_0x122270(0x1c5)](_0x430b19),{'verbose':_0x2a0536[_0x122270(0x1c0)]}),{secrets:_0x4ae148}=_0x238e14[_0x122270(0xdf)];return console[_0x122270(0x20f)](_0x122270(0x114)+_0x4ae148[_0x122270(0x9d)]+_0x122270(0x1bf)+(_0x4ae148['length']!==0x1?'s':'')),await handleSDKOutput(_0x4ae148,_0x2a0536),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x24a);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x123);async[a54_0x4f40c0(0x1e9)](_0xfbc366){const _0x356dbc=a54_0x4f40c0,{options:_0x4091b9,args:_0x86e23b,tdx:_0x38bbe9}=_0xfbc366;let _0x391c1a,_0x2e975a;if(_0x86e23b[_0x356dbc(0x9d)]>=0x1&&!_0x86e23b[0x0][_0x356dbc(0xc7)]('='))_0x391c1a=_0x86e23b[0x0],_0x2e975a=_0x86e23b['slice'](0x1);else{if(_0x86e23b[_0x356dbc(0x9d)]>=0x1&&_0x4091b9[_0x356dbc(0x125)])_0x391c1a=_0x4091b9['workflowProject'],_0x2e975a=_0x86e23b;else return _0x86e23b['length']>=0x1?(console['error'](_0x356dbc(0x235)),console[_0x356dbc(0x20f)](_0x356dbc(0x23f)),0x1):(console[_0x356dbc(0x20f)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x356dbc(0x20f)](_0x356dbc(0x14f)),0x1);}if(_0x2e975a[_0x356dbc(0x9d)]===0x0)return console[_0x356dbc(0x20f)](_0x356dbc(0x25b)),console[_0x356dbc(0x20f)](_0x356dbc(0x14f)),0x1;const _0x13b018={};try{for(const _0x169db4 of _0x2e975a){const {key:_0x3b5989,value:_0x234859}=parseKeyValue(_0x169db4);_0x13b018[_0x3b5989]=_0x234859;}}catch(_0x3cf93c){return _0x3cf93c instanceof Error&&console[_0x356dbc(0x20f)](a54_0x4448c0[_0x356dbc(0x167)](_0x356dbc(0x146)),_0x3cf93c['message']),0x1;}const _0x3e1df2=Object['keys'](_0x13b018);_0x4091b9[_0x356dbc(0x1c0)]&&(console[_0x356dbc(0x20f)]('Project:\x20'+_0x391c1a),console[_0x356dbc(0x20f)]('Secrets\x20to\x20set:\x20'+_0x3e1df2[_0x356dbc(0x1a8)](',\x20')));const _0x4a2fdb=await withSpinner(_0x3e1df2[_0x356dbc(0x9d)]===0x1?_0x356dbc(0xf3):_0x356dbc(0x1e8)+_0x3e1df2[_0x356dbc(0x9d)]+_0x356dbc(0x104),()=>_0x38bbe9[_0x356dbc(0xc9)]['setSecrets'](_0x391c1a,_0x13b018),{'verbose':_0x4091b9[_0x356dbc(0x1c0)]}),_0x535dc0=_0x4a2fdb[_0x356dbc(0xdf)];return console[_0x356dbc(0x20f)](_0x3e1df2[_0x356dbc(0x9d)]===0x1?_0x356dbc(0x17d)+_0x535dc0[_0x356dbc(0x163)][0x0]+_0x356dbc(0xad)+_0x535dc0['projectName']+'\x27':'✔\x20'+_0x535dc0['keys']['length']+_0x356dbc(0x9c)+_0x535dc0['projectName']+'\x27'),(_0x4091b9[_0x356dbc(0x15b)]||_0x4091b9['jsonl'])&&await handleSingleObjectOutput(_0x535dc0,_0x4091b9),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x1e6);[a54_0x4f40c0(0xd4)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0x1c3fd9){const _0x2c08e5=a54_0x4f40c0,{options:_0x16e83d,args:_0x470dd5,tdx:_0x594a4b}=_0x1c3fd9;let _0x5b54f8,_0x407a66;if(_0x470dd5[_0x2c08e5(0x9d)]>=0x2)_0x5b54f8=_0x470dd5[0x0],_0x407a66=_0x470dd5[0x1];else{if(_0x470dd5[_0x2c08e5(0x9d)]===0x1&&_0x16e83d[_0x2c08e5(0x125)])_0x5b54f8=_0x16e83d[_0x2c08e5(0x125)],_0x407a66=_0x470dd5[0x0];else return _0x470dd5['length']===0x1?(console[_0x2c08e5(0x20f)](_0x2c08e5(0x235)),console[_0x2c08e5(0x20f)](_0x2c08e5(0x23f)),0x1):(console[_0x2c08e5(0x20f)](_0x2c08e5(0x144)),console['error'](_0x2c08e5(0x139)),0x1);}_0x16e83d['verbose']&&(console[_0x2c08e5(0x20f)]('Project:\x20'+_0x5b54f8),console['error']('Key:\x20'+_0x407a66));if(!_0x16e83d['yes']){if(!isInteractive())return console[_0x2c08e5(0x20f)](a54_0x4448c0[_0x2c08e5(0x167)](_0x2c08e5(0x170)),_0x2c08e5(0x106)),console[_0x2c08e5(0x20f)](a54_0x4448c0[_0x2c08e5(0xcc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x11291a=await confirmKey(_0x2c08e5(0x221)+_0x407a66+_0x2c08e5(0xd8)+_0x5b54f8+'\x27?');if(!_0x11291a)return console['error'](a54_0x4448c0[_0x2c08e5(0x13a)]('Cancelled')),0x1;}const _0x29480d=await withSpinner(_0x2c08e5(0xb9),()=>_0x594a4b[_0x2c08e5(0xc9)]['deleteSecret'](_0x5b54f8,_0x407a66),{'verbose':_0x16e83d[_0x2c08e5(0x1c0)]}),_0x963fa1=_0x29480d[_0x2c08e5(0xdf)];return console[_0x2c08e5(0x20f)](_0x2c08e5(0x17d)+_0x963fa1[_0x2c08e5(0x176)]+_0x2c08e5(0x1e0)+_0x963fa1[_0x2c08e5(0x99)]+'\x27'),(_0x16e83d[_0x2c08e5(0x15b)]||_0x16e83d[_0x2c08e5(0x100)])&&await handleSingleObjectOutput(_0x963fa1,_0x16e83d),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(_0x307883){const _0x17237b=a54_0x4f40c0,_0x28193c=Math[_0x17237b(0x128)](_0x307883/0x3e8),_0x440605=Math[_0x17237b(0x128)](_0x28193c/0x3c),_0x39c637=Math[_0x17237b(0x128)](_0x440605/0x3c),_0x14408e=Math['floor'](_0x39c637/0x18);if(_0x14408e>0x0){const _0x3b2bb5=_0x39c637%0x18;return _0x3b2bb5>0x0?_0x14408e+'d\x20'+_0x3b2bb5+'h':_0x14408e+'d';}else{if(_0x39c637>0x0){const _0x317d79=_0x440605%0x3c;return _0x317d79>0x0?_0x39c637+'h\x20'+_0x317d79+'m':_0x39c637+'h';}else{if(_0x440605>0x0){const _0x19eab9=_0x28193c%0x3c;return _0x19eab9>0x0?_0x440605+'m\x20'+_0x19eab9+'s':_0x440605+'m';}else return _0x28193c+'s';}}}function formatTimestamp(_0x4ce860,_0x22f89e){const _0x55b40d=a54_0x4f40c0,_0x57b7be=new Date(_0x4ce860),_0x5025bb=String(_0x57b7be[_0x55b40d(0x175)]())[_0x55b40d(0xd9)](0x2,'0'),_0x5a0ae8=String(_0x57b7be[_0x55b40d(0x1f7)]())[_0x55b40d(0xd9)](0x2,'0'),_0x22b7d0=_0x5025bb+':'+_0x5a0ae8,_0x5288b4=_0x57b7be[_0x55b40d(0xe9)]()===_0x22f89e['getFullYear']()&&_0x57b7be[_0x55b40d(0xc6)]()===_0x22f89e[_0x55b40d(0xc6)]()&&_0x57b7be['getDate']()===_0x22f89e[_0x55b40d(0x11f)]();if(_0x5288b4)return _0x22b7d0;else{const _0x282cda=String(_0x57b7be['getMonth']()+0x1)['padStart'](0x2,'0'),_0x202046=String(_0x57b7be[_0x55b40d(0x11f)]())[_0x55b40d(0xd9)](0x2,'0');return _0x282cda+'-'+_0x202046+'\x20'+_0x22b7d0;}}function formatDate(_0x392646){const _0x1bb5ff=a54_0x4f40c0,_0x5e0a63=_0x392646[_0x1bb5ff(0xe9)](),_0x56cbe8=String(_0x392646['getMonth']()+0x1)[_0x1bb5ff(0xd9)](0x2,'0'),_0x438fbc=String(_0x392646[_0x1bb5ff(0x11f)]())[_0x1bb5ff(0xd9)](0x2,'0');return _0x5e0a63+'-'+_0x56cbe8+'-'+_0x438fbc;}function getTaskStateIcon(_0x286cd2){const _0x27ab55={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x27ab55[_0x286cd2]||'⚪';}function getBarChar(_0x3ce7ac){const _0x153497=a54_0x4f40c0;return _0x3ce7ac===_0x153497(0x20f)||_0x3ce7ac===_0x153497(0xef)?'×':'─';}function getBarColor(_0x29d31d){const _0x303af5=a54_0x4f40c0,_0x5e7dc9={'success':a54_0x4448c0['green'],'error':a54_0x4448c0[_0x303af5(0x167)],'group_error':a54_0x4448c0[_0x303af5(0x167)],'running':a54_0x4448c0[_0x303af5(0xa6)],'blocked':a54_0x4448c0[_0x303af5(0x13a)],'planned':a54_0x4448c0['dim'],'canceling':a54_0x4448c0['yellow']};return _0x5e7dc9[_0x29d31d]||a54_0x4448c0['white'];}function parseTaskName(_0x23db00){const _0x18adec=a54_0x4f40c0;let _0x417820=_0x23db00[_0x18adec(0x23e)](/^\++/,'');const _0xc6e378=_0x417820['split']('+'),_0x4c54bd=_0xc6e378[_0x18adec(0x9d)]>0x1?_0xc6e378['length']-0x2:0x0,_0xbcda28=_0xc6e378[_0xc6e378[_0x18adec(0x9d)]-0x1]||_0x417820;return{'level':_0x4c54bd,'name':'+'+_0xbcda28};}function truncateTaskName(_0x27213f,_0x46eff1){const _0x4069cf=a54_0x4f40c0,_0xde46da=stringWidth(_0x27213f);if(_0xde46da<=_0x46eff1)return _0x27213f;let _0x5254ad=_0x27213f;while(stringWidth(_0x5254ad+'…')>_0x46eff1&&_0x5254ad[_0x4069cf(0x9d)]>0x0){_0x5254ad=_0x5254ad[_0x4069cf(0xf7)](0x0,-0x1);}return _0x5254ad+'…';}function calculateTimeScale(_0x4a48a0,_0x47f21c){const _0x56df3a=a54_0x4f40c0;return{'startTime':_0x4a48a0[_0x56df3a(0x1fa)],'endTime':_0x4a48a0['end'],'durationMs':_0x4a48a0['duration'],'msPerChar':_0x4a48a0[_0x56df3a(0xc2)]/_0x47f21c};}function timeToPosition(_0x1f66d2,_0x264ac3,_0x1555d1){const _0x205645=a54_0x4f40c0,_0x207917=_0x1f66d2-_0x264ac3[_0x205645(0xda)],_0x35e44e=Math[_0x205645(0x128)](_0x207917/_0x264ac3[_0x205645(0x157)]);return Math[_0x205645(0xfd)](0x0,Math['min'](_0x35e44e,_0x1555d1));}function renderTimeAxis(_0x21531f,_0x2fdd5f){const _0x102054=a54_0x4f40c0,_0x2486cf=Math[_0x102054(0x1cd)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x102054(0x1e2)],Math['floor'](_0x2fdd5f/TIMELINE_CONFIG[_0x102054(0x201)]))),_0x334e78=_0x21531f[_0x102054(0xec)]/(_0x2486cf-0x1),_0x17a1b3=new Date(_0x21531f[_0x102054(0xda)]),_0x41e632=[];for(let _0x370b8d=0x0;_0x370b8d<_0x2486cf;_0x370b8d++){const _0xe2524c=_0x21531f[_0x102054(0xda)]+_0x370b8d*_0x334e78,_0x414111=timeToPosition(_0xe2524c,_0x21531f,_0x2fdd5f),_0x2da41d=formatTimestamp(_0xe2524c,_0x17a1b3);_0x41e632['push']({'pos':_0x414111,'text':_0x2da41d});}const _0x1f8dcf=new Array(_0x2fdd5f)[_0x102054(0x1c4)]('\x20');let _0x4355ff=-0x1;for(const {pos:_0xd24b5,text:_0x31f323}of _0x41e632){let _0x4d2b28=Math[_0x102054(0xfd)](0x0,_0xd24b5-Math[_0x102054(0x128)](_0x31f323['length']/0x2));_0x4d2b28<=_0x4355ff+TIMELINE_CONFIG[_0x102054(0x21a)]&&(_0x4d2b28=_0x4355ff+TIMELINE_CONFIG[_0x102054(0x21a)]+0x1);_0x4d2b28+_0x31f323[_0x102054(0x9d)]>_0x2fdd5f&&(_0x4d2b28=_0x2fdd5f-_0x31f323[_0x102054(0x9d)]);if(_0x4d2b28>=0x0&&_0x4d2b28+_0x31f323['length']<=_0x2fdd5f&&_0x4d2b28>_0x4355ff){for(let _0x1410ef=0x0;_0x1410ef<_0x31f323[_0x102054(0x9d)];_0x1410ef++){_0x1f8dcf[_0x4d2b28+_0x1410ef]=_0x31f323[_0x1410ef];}_0x4355ff=_0x4d2b28+_0x31f323[_0x102054(0x9d)]-0x1;}}return _0x1f8dcf[_0x102054(0x1a8)]('');}function renderTaskRow(_0x8d6666,_0x13798f,_0xe0de9e,_0x55cec3){const _0x53a214=a54_0x4f40c0,{level:_0x3380ad,name:_0x28e0c7}=parseTaskName(_0x8d6666['name']),_0x571c3f='\x20'[_0x53a214(0x10a)](_0x3380ad),_0x89240c=_0x8d6666['window']?'('+formatElapsed(_0x8d6666[_0x53a214(0x10e)]['duration'])+')':'',_0x4f2841=stringWidth(_0x89240c),_0x35a6e3=_0x3380ad*0x1,_0x3f2eec=_0x55cec3-_0x35a6e3-_0x4f2841-0x1,_0x405bec=truncateTaskName(_0x28e0c7,_0x3f2eec),_0x67f282=_0x571c3f+_0x405bec,_0x531935=stringWidth(_0x67f282),_0x4b7f8f=_0x55cec3-_0x531935-_0x4f2841,_0x320411=_0x67f282+'\x20'[_0x53a214(0x10a)](Math[_0x53a214(0xfd)](0x1,_0x4b7f8f))+a54_0x4448c0['dim'](_0x89240c),_0x31ce1c=getTaskStateIcon(_0x8d6666[_0x53a214(0x23c)]),_0x5459bf=new Array(_0xe0de9e)[_0x53a214(0x1c4)]('\x20');if(_0x8d6666[_0x53a214(0x10e)]){const _0x4950b8=timeToPosition(_0x8d6666['window'][_0x53a214(0x1fa)],_0x13798f,_0xe0de9e),_0x4b8e5f=timeToPosition(_0x8d6666['window'][_0x53a214(0xca)],_0x13798f,_0xe0de9e),_0x493b77=getBarChar(_0x8d6666[_0x53a214(0x23c)]),_0x9c5dc9=Math[_0x53a214(0xfd)](_0x4950b8+0x1,_0x4b8e5f);for(let _0x11dce3=_0x4950b8;_0x11dce3<Math['min'](_0x9c5dc9,_0xe0de9e);_0x11dce3++){_0x5459bf[_0x11dce3]=_0x493b77;}}const _0x203144=getBarColor(_0x8d6666[_0x53a214(0x23c)]),_0x2c110b=_0x5459bf[_0x53a214(0x17c)](_0x5a4d94=>_0x5a4d94==='\x20'?'\x20':_0x203144(_0x5a4d94))[_0x53a214(0x1a8)]('');return _0x31ce1c+'\x20'+_0x320411+'│'+_0x2c110b+'│';}function calculateStats(_0xe43bac){const _0x45d776=a54_0x4f40c0,_0x1d13c4={'total':_0xe43bac[_0x45d776(0x9d)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3dc109 of _0xe43bac){if(_0x3dc109[_0x45d776(0x23c)]===_0x45d776(0xc4))_0x1d13c4[_0x45d776(0xc4)]++;else{if(_0x3dc109[_0x45d776(0x23c)]==='error'||_0x3dc109[_0x45d776(0x23c)]===_0x45d776(0xef))_0x1d13c4[_0x45d776(0x20f)]++;else _0x3dc109[_0x45d776(0x23c)]===_0x45d776(0x1a7)?_0x1d13c4[_0x45d776(0x1a7)]++:_0x1d13c4[_0x45d776(0x240)]++;}}return _0x1d13c4;}function formatStats(_0x2e19f2){const _0x53e974=a54_0x4f40c0;return[_0x53e974(0xe0)+_0x2e19f2['total'],'✅\x20'+_0x2e19f2[_0x53e974(0xc4)],'❌\x20'+_0x2e19f2['error'],_0x53e974(0x168)+_0x2e19f2[_0x53e974(0x1a7)],'⏳\x20'+_0x2e19f2['pending']][_0x53e974(0x1a8)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1ae);[a54_0x4f40c0(0xd4)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x45480b){const _0x223173=a54_0x4f40c0,{options:_0x22e61c,args:_0x57560f,tdx:_0x561c71}=_0x45480b;let _0x4f6f63,_0x4ab063,_0x906c81=![];if(_0x57560f[0x0]){if(_0x57560f[0x0][_0x223173(0xc7)]('.')){const _0x14e296=this[_0x223173(0x207)](_0x57560f,_0x22e61c);if(!_0x14e296)return 0x1;_0x4f6f63=_0x14e296[_0x223173(0x99)],_0x4ab063=_0x14e296[_0x223173(0x118)];}else{_0x4ab063=_0x57560f[0x0],_0x4f6f63=_0x22e61c['workflowProject'];if(!_0x4f6f63)return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)](_0x223173(0x146)),_0x223173(0xa0)),0x1;_0x906c81=!![];}}else{const _0x5c1630=this[_0x223173(0x207)](_0x57560f,_0x22e61c);if(!_0x5c1630)return 0x1;_0x4f6f63=_0x5c1630[_0x223173(0x99)],_0x4ab063=_0x5c1630['workflowName'];}if(_0x22e61c['verbose']){if(_0x4f6f63&&_0x4ab063)console['error'](_0x223173(0x1db)+_0x4f6f63+'.'+_0x4ab063);else _0x4f6f63&&console[_0x223173(0x20f)](_0x223173(0x117)+_0x4f6f63);}const _0x195b10=_0x22e61c[_0x223173(0x249)],_0x1f8663=_0x22e61c[_0x223173(0x1b6)];if(_0x195b10){_0x1f8663&&console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x13a)]('Warning:'),_0x223173(0x14e));const _0x3cf081=_0x22e61c['follow'];return _0x3cf081?await this[_0x223173(0xe4)](_0x45480b,_0x195b10):await this[_0x223173(0xcf)](_0x45480b,_0x195b10,_0x22e61c),0x0;}if(_0x1f8663){const _0x4bf14=await withSpinner(_0x223173(0x138),()=>_0x561c71[_0x223173(0xc9)][_0x223173(0xb5)]({'projectName':_0x4f6f63,'workflowName':_0x4ab063,'limit':0x64}),{'verbose':_0x22e61c[_0x223173(0x1c0)]}),_0x226ab2=_0x4bf14['data'][_0x223173(0x172)](_0x5915fa=>_0x5915fa['id']===_0x1f8663);if(!_0x226ab2)return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)](_0x223173(0x146)),'Session\x20not\x20found:\x20'+_0x1f8663),0x1;if(!_0x226ab2[_0x223173(0x17e)]?.['id'])return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)]('Error:'),_0x223173(0x12c)+_0x1f8663+'\x20has\x20no\x20attempts'),0x1;const _0x288800=_0x226ab2['lastAttempt']['id'];_0x22e61c[_0x223173(0x1c0)]&&console[_0x223173(0x20f)](_0x223173(0xe6)+_0x288800+_0x223173(0x1da)+_0x1f8663);const _0x4818c2=_0x22e61c['follow'];return _0x4818c2?await this[_0x223173(0xe4)](_0x45480b,_0x288800):await this[_0x223173(0xcf)](_0x45480b,_0x288800,_0x22e61c),0x0;}const _0x1ae417=await withSpinner(_0x223173(0x218),()=>_0x561c71[_0x223173(0xc9)][_0x223173(0xb5)]({'projectName':_0x4f6f63,'workflowName':_0x4ab063,'limit':_0x22e61c[_0x223173(0x141)]||0x32}),{'verbose':_0x22e61c[_0x223173(0x1c0)]}),_0x708f79=_0x1ae417['data'];if(_0x708f79[_0x223173(0x9d)]===0x0){if(_0x4f6f63&&_0x4ab063)console['error'](_0x223173(0x1ec)+_0x4f6f63+'.'+_0x4ab063);else _0x4f6f63?console[_0x223173(0x20f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4f6f63):(console[_0x223173(0x20f)](_0x223173(0x107)),console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0xcc)](_0x223173(0x1e1))));return 0x0;}_0x708f79[_0x223173(0xac)]((_0x272d67,_0x44e19a)=>{const _0x10b27e=_0x223173,_0x12cc33=_0x272d67['sessionTime']||'',_0x36d063=_0x44e19a[_0x10b27e(0x24f)]||'';return _0x36d063['localeCompare'](_0x12cc33);});if(_0x22e61c['json']||_0x22e61c[_0x223173(0x100)])return await handleSDKOutput(_0x708f79,_0x22e61c),0x0;let _0x3d670f;if(_0x906c81){const _0x5befb1=_0x708f79[0x0];if(!_0x5befb1[_0x223173(0x17e)]?.['id'])return console[_0x223173(0x20f)](_0x223173(0xeb)),0x0;_0x3d670f=_0x5befb1[_0x223173(0x17e)]['id'],_0x22e61c['verbose']&&console[_0x223173(0x20f)](_0x223173(0x222)+_0x5befb1[_0x223173(0x24f)]);}else{const _0x16e61a=_0x708f79['map'](_0x1a6c05=>{const _0x30b455=_0x223173,_0x1616e1=getAttemptStatusDisplay(_0x1a6c05[_0x30b455(0x17e)]);return{'title':_0x1a6c05[_0x30b455(0x22b)]?.[_0x30b455(0x153)]+'.'+_0x1a6c05[_0x30b455(0xc9)]?.[_0x30b455(0x153)]+_0x30b455(0x1c8)+_0x1a6c05[_0x30b455(0x24f)]+'\x20'+_0x1616e1[_0x30b455(0x16f)],'value':_0x1a6c05[_0x30b455(0x17e)]?.['id']||'','description':_0x1616e1[_0x30b455(0xde)]};}),_0x45e9de=await a54_0x3961f9({'type':'select','name':'attemptId','message':_0x223173(0x151),'choices':_0x16e61a['filter'](_0x3d4fc8=>_0x3d4fc8[_0x223173(0x19d)]!=='')});if(!_0x45e9de[_0x223173(0x249)])return 0x0;_0x3d670f=_0x45e9de[_0x223173(0x249)];}const _0xe73ae5=_0x22e61c[_0x223173(0x16d)];return _0xe73ae5?await this[_0x223173(0xe4)](_0x45480b,_0x3d670f):await this['renderSingleTimeline'](_0x45480b,_0x3d670f,_0x22e61c),0x0;}async[a54_0x4f40c0(0xcf)](_0x3a3337,_0x2df44d,_0x44ad3d){const _0x4dca0f=a54_0x4f40c0,{tdx:_0x4c7867}=_0x3a3337;let _0x258b4c,_0x4b780c;try{[_0x258b4c,_0x4b780c]=await Promise['all']([_0x4c7867[_0x4dca0f(0xc9)][_0x4dca0f(0x191)](_0x2df44d),_0x4c7867[_0x4dca0f(0xc9)][_0x4dca0f(0x164)](_0x2df44d,![])]);}catch(_0x34a12f){console[_0x4dca0f(0x20f)](a54_0x4448c0[_0x4dca0f(0x167)](_0x4dca0f(0x186)));_0x44ad3d[_0x4dca0f(0x1c0)]&&console[_0x4dca0f(0x20f)](_0x34a12f);throw _0x34a12f;}if(_0x44ad3d['json']||_0x44ad3d[_0x4dca0f(0x100)]){const _0x390f59=this[_0x4dca0f(0x178)](_0x258b4c,_0x4b780c);await handleSDKOutput([_0x390f59],_0x44ad3d);return;}const _0x1b4951=_0x4c7867['context'][_0x4dca0f(0x174)],_0xd752f5=this[_0x4dca0f(0x203)](_0x258b4c,_0x4b780c,_0x1b4951);console[_0x4dca0f(0xe7)](_0xd752f5);}async['pollTimeline'](_0x588614,_0x58b097){const _0x1efc4f=a54_0x4f40c0,{tdx:_0x26bac1}=_0x588614,_0x3d7991=TIMELINE_CONFIG[_0x1efc4f(0x1ed)],_0x216e49=TIMELINE_CONFIG[_0x1efc4f(0x1f6)];let _0x4ed54f=0x0;while(_0x4ed54f<_0x216e49){process[_0x1efc4f(0x1d8)]['isTTY']&&process[_0x1efc4f(0x1d8)]['write']('\x1bc');let _0x2bacb6,_0x4e9237;try{[_0x2bacb6,_0x4e9237]=await Promise['all']([_0x26bac1[_0x1efc4f(0xc9)]['attempt'](_0x58b097),_0x26bac1['workflow']['tasks'](_0x58b097,![])]);}catch(_0xbc329f){console[_0x1efc4f(0x20f)](a54_0x4448c0[_0x1efc4f(0x167)](_0x1efc4f(0x1ab)));_0x4ed54f>0x0&&console[_0x1efc4f(0x20f)](a54_0x4448c0['dim'](_0x1efc4f(0x9b)+_0x4ed54f));throw _0xbc329f;}const _0x4772f2=_0x26bac1[_0x1efc4f(0x1b4)][_0x1efc4f(0x174)],_0x2aaefb=this[_0x1efc4f(0x203)](_0x2bacb6,_0x4e9237,_0x4772f2);console[_0x1efc4f(0xe7)](_0x2aaefb);const _0x44c192=_0x2bacb6[_0x1efc4f(0x227)]&&_0x4e9237['every'](_0x44ce11=>_0x44ce11['state']!=='running'&&_0x44ce11[_0x1efc4f(0x23c)]!==_0x1efc4f(0x180));if(_0x44c192){console[_0x1efc4f(0x20f)](a54_0x4448c0[_0x1efc4f(0x229)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x1efc4f(0x20f)](a54_0x4448c0['dim'](_0x1efc4f(0x13f)+_0x4ed54f*0x2+_0x1efc4f(0x1d1))),await new Promise(_0x308656=>setTimeout(_0x308656,_0x3d7991)),_0x4ed54f++;}_0x4ed54f>=_0x216e49&&console['error'](a54_0x4448c0['yellow'](_0x1efc4f(0x1ca)));}[a54_0x4f40c0(0x203)](_0x1d3bba,_0x344cf5,_0x183108){const _0x1ee6ed=a54_0x4f40c0,_0x561968=[],_0xfeed86=TIMELINE_CONFIG[_0x1ee6ed(0x1c3)],_0x50b23a=0x5,_0x358587=process[_0x1ee6ed(0x1d8)][_0x1ee6ed(0xb1)]||0x78,_0xd2c7b2=_0x358587-_0xfeed86-_0x50b23a,_0x154ba4=Math[_0x1ee6ed(0xfd)](TIMELINE_CONFIG[_0x1ee6ed(0x22f)],Math[_0x1ee6ed(0x1cd)](_0xd2c7b2,TIMELINE_CONFIG[_0x1ee6ed(0x18c)])),_0x19367d=new Date(_0x1d3bba[_0x1ee6ed(0xb4)])[_0x1ee6ed(0x1d6)](),_0x2c2b8d=_0x1d3bba[_0x1ee6ed(0x217)]?new Date(_0x1d3bba[_0x1ee6ed(0x217)])['getTime']():Date[_0x1ee6ed(0x131)](),_0x45e180={'start':_0x19367d,'end':_0x2c2b8d,'duration':_0x2c2b8d-_0x19367d},_0x4d8a77=new Map(),_0x100330=[];for(const _0x252b1f of _0x344cf5){if(_0x252b1f[_0x1ee6ed(0x1bc)]){const _0x2fd6d2=new Date(_0x252b1f[_0x1ee6ed(0x1bc)])[_0x1ee6ed(0x1d6)](),_0x3746d4=_0x252b1f[_0x1ee6ed(0x219)]?new Date(_0x252b1f['updatedAt'])[_0x1ee6ed(0x1d6)]():Date[_0x1ee6ed(0x131)](),_0x5b5835={'start':_0x2fd6d2,'end':_0x3746d4,'duration':_0x3746d4-_0x2fd6d2};_0x4d8a77['set'](_0x252b1f['id'],_0x5b5835),_0x100330[_0x1ee6ed(0x1e7)]({'name':_0x252b1f[_0x1ee6ed(0x206)],'state':_0x252b1f[_0x1ee6ed(0x23c)]||_0x1ee6ed(0x250),'window':_0x5b5835});}else _0x100330[_0x1ee6ed(0x1e7)]({'name':_0x252b1f[_0x1ee6ed(0x206)],'state':_0x252b1f[_0x1ee6ed(0x23c)]||'planned','window':undefined});}_0x100330['sort']((_0x1a0d94,_0x194347)=>{const _0x8dbf9b=_0x1ee6ed;if(!_0x1a0d94[_0x8dbf9b(0x10e)])return 0x1;if(!_0x194347[_0x8dbf9b(0x10e)])return-0x1;return _0x1a0d94[_0x8dbf9b(0x10e)][_0x8dbf9b(0x1fa)]-_0x194347[_0x8dbf9b(0x10e)]['start'];});const _0x31167a=_0x100330[_0x1ee6ed(0x9d)],_0x5990f8=_0x31167a>TIMELINE_CONFIG[_0x1ee6ed(0x259)];_0x5990f8&&_0x100330[_0x1ee6ed(0xb7)](TIMELINE_CONFIG[_0x1ee6ed(0x259)]);const _0x560eaa=calculateTimeScale(_0x45e180,_0x154ba4),_0x2459b1=_0x1d3bba[_0x1ee6ed(0x227)]?_0x1d3bba['success']?a54_0x4448c0[_0x1ee6ed(0x229)](_0x1ee6ed(0xc4)):a54_0x4448c0['red'](_0x1ee6ed(0x20f)):a54_0x4448c0[_0x1ee6ed(0xa6)](_0x1ee6ed(0x1a7)),_0x641eba=_0x1d3bba[_0x1ee6ed(0x22b)]?.['id'],_0x315608=_0x1d3bba[_0x1ee6ed(0x1b6)];let _0x3b1979;if(_0x641eba&&_0x315608){const _0x3bc88c=getWorkflowAttemptUrl(_0x183108,_0x641eba,_0x315608,_0x1d3bba['id']);_0x3b1979=hyperlink(a54_0x4448c0[_0x1ee6ed(0xcc)](_0x1d3bba['id']),_0x3bc88c);}else _0x3b1979=a54_0x4448c0[_0x1ee6ed(0xcc)](_0x1d3bba['id']);_0x561968[_0x1ee6ed(0x1e7)](_0x1ee6ed(0xee)+_0x3b1979+_0x1ee6ed(0x1c8)+_0x2459b1+_0x1ee6ed(0x1c8)+formatElapsed(_0x45e180[_0x1ee6ed(0xc2)]));if(_0x100330[_0x1ee6ed(0x9d)]>0x0){const _0x4a9afa=renderTimeAxis(_0x560eaa,_0x154ba4),_0x26a15e=new Date(_0x45e180[_0x1ee6ed(0x1fa)]),_0x4b5f22=formatDate(_0x26a15e),_0x59a05c=TIMELINE_CONFIG[_0x1ee6ed(0x243)]+TIMELINE_CONFIG[_0x1ee6ed(0x165)]+_0xfeed86,_0x195168=_0x4b5f22[_0x1ee6ed(0xd9)](_0x59a05c),_0x4804f3=a54_0x4448c0[_0x1ee6ed(0xcc)](_0x195168);_0x561968[_0x1ee6ed(0x1e7)](_0x4804f3+'\x20'+_0x4a9afa);for(const _0x3aff97 of _0x100330){_0x561968['push'](renderTaskRow(_0x3aff97,_0x560eaa,_0x154ba4,_0xfeed86));}const _0x36bb40=calculateStats(_0x100330);_0x561968[_0x1ee6ed(0x1e7)](formatStats(_0x36bb40)),_0x5990f8&&_0x561968[_0x1ee6ed(0x1e7)](a54_0x4448c0['yellow'](_0x1ee6ed(0x111)+TIMELINE_CONFIG[_0x1ee6ed(0x259)]+'\x20of\x20'+_0x31167a+_0x1ee6ed(0x179))),_0x561968[_0x1ee6ed(0x1e7)](''),_0x561968['push'](a54_0x4448c0[_0x1ee6ed(0xcc)]('💡\x20Tip:\x20Use\x20')+(_0x1ee6ed(0x13d)+_0x1d3bba['id']+_0x1ee6ed(0x1e3))+a54_0x4448c0[_0x1ee6ed(0xcc)]('\x20to\x20see\x20detailed\x20logs'));}else _0x561968[_0x1ee6ed(0x1e7)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x561968[_0x1ee6ed(0x1a8)]('\x0a');}['buildTimelineData'](_0x5e5f04,_0x990135){const _0x168c31=a54_0x4f40c0,_0x2ff3ad=new Date(_0x5e5f04[_0x168c31(0xb4)])[_0x168c31(0x1d6)](),_0x1bae19=_0x5e5f04[_0x168c31(0x217)]?new Date(_0x5e5f04[_0x168c31(0x217)])[_0x168c31(0x1d6)]():Date[_0x168c31(0x131)](),_0x223700=_0x1bae19-_0x2ff3ad,_0x39d17a=[];for(const _0x13cc5f of _0x990135){if(_0x13cc5f['startedAt']){const _0x1d26f8=new Date(_0x13cc5f[_0x168c31(0x1bc)])[_0x168c31(0x1d6)](),_0x11118c=_0x13cc5f['updatedAt']?new Date(_0x13cc5f['updatedAt'])['getTime']():Date[_0x168c31(0x131)]();_0x39d17a['push']({'name':_0x13cc5f[_0x168c31(0x206)],'state':_0x13cc5f[_0x168c31(0x23c)]||'unknown','window':{'start':_0x1d26f8,'end':_0x11118c,'duration':_0x11118c-_0x1d26f8}});}else _0x39d17a[_0x168c31(0x1e7)]({'name':_0x13cc5f[_0x168c31(0x206)],'state':_0x13cc5f[_0x168c31(0x23c)]||_0x168c31(0x180),'window':undefined});}const _0x3e41ea=calculateStats(_0x39d17a);return{'attempt':{'id':_0x5e5f04['id'],'status':_0x5e5f04[_0x168c31(0x227)]?_0x5e5f04[_0x168c31(0xc4)]?_0x168c31(0xc4):_0x168c31(0x20f):'running','createdAt':_0x5e5f04['createdAt'],'finishedAt':_0x5e5f04[_0x168c31(0x217)],'duration_ms':_0x223700},'tasks':_0x39d17a['map'](_0xd52983=>({'name':_0xd52983['name'],'state':_0xd52983[_0x168c31(0x23c)],'startedAt':_0xd52983[_0x168c31(0x10e)]?new Date(_0xd52983[_0x168c31(0x10e)]['start'])[_0x168c31(0x1d5)]():null,'updatedAt':_0xd52983[_0x168c31(0x10e)]?new Date(_0xd52983[_0x168c31(0x10e)]['end'])[_0x168c31(0x1d5)]():null,'duration_ms':_0xd52983[_0x168c31(0x10e)]?.[_0x168c31(0xc2)]||null})),'stats':_0x3e41ea};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x4f40c0(0x211);[a54_0x4f40c0(0xd4)]='List\x20workflow\x20schedules';async['execute'](_0x49d2b2){const _0x1fe789=a54_0x4f40c0,{options:_0x5bce19,tdx:_0x4a6c54}=_0x49d2b2,_0x44d4f6=await withSpinner(_0x1fe789(0xdb),()=>_0x4a6c54[_0x1fe789(0xc9)][_0x1fe789(0xfb)](),{'verbose':_0x5bce19[_0x1fe789(0x1c0)]}),_0x220750=_0x44d4f6['data'];console[_0x1fe789(0x20f)]('✔\x20Found\x20'+_0x220750['length']+_0x1fe789(0xe2)+(_0x220750[_0x1fe789(0x9d)]!==0x1?'s':''));if(isStructuredFormat(_0x5bce19))await handleSDKOutput(_0x220750,_0x5bce19);else{if(_0x220750[_0x1fe789(0x9d)]===0x0)console[_0x1fe789(0xe7)](_0x1fe789(0x129));else for(const _0x230e10 of _0x220750){const _0xf2309a=_0x230e10[_0x1fe789(0x18a)]?a54_0x4448c0[_0x1fe789(0x13a)](_0x1fe789(0x248)):'',_0x480e7e=_0x230e10[_0x1fe789(0x22b)]?.[_0x1fe789(0x153)]?a54_0x4448c0['dim']('\x20['+_0x230e10[_0x1fe789(0x22b)][_0x1fe789(0x153)]+']'):'',_0x14ae7b=_0x230e10[_0x1fe789(0x239)]?a54_0x4448c0[_0x1fe789(0xcc)](_0x1fe789(0x1f9)+new Date(_0x230e10[_0x1fe789(0x239)])[_0x1fe789(0x1ef)]()):'';console[_0x1fe789(0xe7)](_0x1fe789(0x11e)+_0x230e10['id']+'\x20'+(_0x230e10['workflow']?.[_0x1fe789(0x153)]||_0x1fe789(0x24d))+_0x480e7e+_0xf2309a+_0x14ae7b);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0xf0);[a54_0x4f40c0(0xd4)]='Enable\x20a\x20workflow\x20schedule';async[a54_0x4f40c0(0x1e9)](_0x2bc319){const _0x598b29=a54_0x4f40c0,{options:_0x201769,args:_0x27ab24,tdx:_0x19a090}=_0x2bc319,_0x1be7b1=_0x27ab24[0x0];if(!_0x1be7b1)return console[_0x598b29(0x20f)](a54_0x4448c0[_0x598b29(0x167)](_0x598b29(0x146)),_0x598b29(0x152)),console[_0x598b29(0x20f)](a54_0x4448c0[_0x598b29(0xcc)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console['error'](a54_0x4448c0['dim'](_0x598b29(0x22e))),0x1;const _0x22ad69=await withSpinner(_0x598b29(0xed)+_0x1be7b1+'...',()=>_0x19a090['workflow'][_0x598b29(0x1cc)](_0x1be7b1),{'verbose':_0x201769[_0x598b29(0x1c0)]}),_0x450e46=_0x22ad69[_0x598b29(0xdf)];return isStructuredFormat(_0x201769)?await handleSingleObjectOutput(_0x450e46,_0x201769):(console[_0x598b29(0xe7)](_0x598b29(0x1b0)+_0x1be7b1+'\x20enabled\x20('+(_0x450e46['workflow']?.[_0x598b29(0x153)]||_0x598b29(0x250))+')'),_0x450e46[_0x598b29(0x239)]&&console['log'](a54_0x4448c0[_0x598b29(0xcc)](_0x598b29(0x11d)+new Date(_0x450e46[_0x598b29(0x239)])[_0x598b29(0x1ef)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x14a);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xfc);async[a54_0x4f40c0(0x1e9)](_0x48c39b){const _0x16cb68=a54_0x4f40c0,{options:_0x3d4279,args:_0x2c1d7d,tdx:_0x101a6c}=_0x48c39b,_0x42b471=_0x2c1d7d[0x0];if(!_0x42b471)return console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0x167)]('Error:'),_0x16cb68(0x152)),console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0xcc)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0xcc)](_0x16cb68(0x22e))),0x1;const _0x300dde=await withSpinner(_0x16cb68(0xa2)+_0x42b471+_0x16cb68(0xf4),()=>_0x101a6c[_0x16cb68(0xc9)][_0x16cb68(0x17f)](_0x42b471),{'verbose':_0x3d4279[_0x16cb68(0x1c0)]}),_0xe00208=_0x300dde['data'];return isStructuredFormat(_0x3d4279)?await handleSingleObjectOutput(_0xe00208,_0x3d4279):console[_0x16cb68(0xe7)](_0x16cb68(0x1b0)+_0x42b471+_0x16cb68(0x13e)+(_0xe00208[_0x16cb68(0xc9)]?.[_0x16cb68(0x153)]||_0x16cb68(0x250))+')'),0x0;}}
1
+ const a54_0x26a927=a54_0x4873;(function(_0x56e74d,_0x4446b8){const _0x4bf50a=a54_0x4873,_0x5a1556=_0x56e74d();while(!![]){try{const _0x49eca8=-parseInt(_0x4bf50a(0x27c))/0x1+parseInt(_0x4bf50a(0x274))/0x2*(-parseInt(_0x4bf50a(0x2d7))/0x3)+-parseInt(_0x4bf50a(0x212))/0x4*(parseInt(_0x4bf50a(0x176))/0x5)+-parseInt(_0x4bf50a(0x264))/0x6+-parseInt(_0x4bf50a(0x1f7))/0x7+parseInt(_0x4bf50a(0x244))/0x8+parseInt(_0x4bf50a(0x1fd))/0x9;if(_0x49eca8===_0x4446b8)break;else _0x5a1556['push'](_0x5a1556['shift']());}catch(_0x3337c7){_0x5a1556['push'](_0x5a1556['shift']());}}}(a54_0x2dbd,0x69a35));import a54_0x1d1160 from'chalk';import{existsSync}from'fs';import a54_0x44d406 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_0x1d7da3 from'prompts';function getAttemptStatusDisplay(_0x56ef22){const _0x41ecaa=a54_0x4873;if(!_0x56ef22)return{'icon':'⏳','text':''};const {done:_0x126971,success:_0x4aec90,cancelRequested:_0xd1750e}=_0x56ef22;if(!_0x126971)return _0xd1750e?{'icon':'🛑','text':a54_0x1d1160[_0x41ecaa(0x242)](_0x41ecaa(0x163))}:{'icon':'🔄','text':a54_0x1d1160['blue'](_0x41ecaa(0x2c6))};if(_0x4aec90)return{'icon':'✅','text':a54_0x1d1160[_0x41ecaa(0x2bf)](_0x41ecaa(0x173))};return{'icon':'❌','text':a54_0x1d1160[_0x41ecaa(0x224)](_0x41ecaa(0x2ab))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x26a927(0x1b5)](_0x22e3d3,_0x357ff2,_0x3c7257=0x0){return _0x22e3d3[_0x3c7257]||_0x357ff2['workflowProject'];}[a54_0x26a927(0x2ce)](_0x1f3568,_0x1c3e68,_0x92dc9e=0x0){const _0x5d7fda=a54_0x26a927,_0xb3867e=this[_0x5d7fda(0x1b5)](_0x1f3568,_0x1c3e68,_0x92dc9e);if(!_0xb3867e)return console[_0x5d7fda(0x2ab)](a54_0x1d1160[_0x5d7fda(0x224)](_0x5d7fda(0x243)),'Project\x20name\x20is\x20required'),console[_0x5d7fda(0x2ab)](a54_0x1d1160[_0x5d7fda(0x17d)](_0x5d7fda(0x253))),null;return _0xb3867e;}[a54_0x26a927(0x2c1)](_0x3ba7bb,_0x2e38cc){const _0x2e872b=a54_0x26a927;if(_0x3ba7bb[0x0]){const _0x1a52b5=_0x3ba7bb[0x0][_0x2e872b(0x29f)]('.');if(_0x1a52b5[_0x2e872b(0x294)]===0x1)return{'projectName':_0x1a52b5[0x0],'workflowName':undefined};else return _0x1a52b5['length']===0x2?{'projectName':_0x1a52b5[0x0],'workflowName':_0x1a52b5[0x1]}:(console[_0x2e872b(0x2ab)](a54_0x1d1160[_0x2e872b(0x224)]('Error:'),_0x2e872b(0x1a2)),null);}return{'projectName':_0x2e38cc[_0x2e872b(0x21d)],'workflowName':undefined};}[a54_0x26a927(0x1bf)](_0x308fa9,_0x2f0276,_0x5e1571=0x0){const _0x1f4485=a54_0x26a927;if(_0x308fa9[_0x5e1571])return _0x308fa9[_0x5e1571];if(_0x2f0276[_0x1f4485(0x21d)]){const _0x2e2494=a54_0x44d406[_0x1f4485(0x240)](process[_0x1f4485(0x20b)](),_0x1f4485(0x133),_0x2f0276[_0x1f4485(0x21d)]);if(existsSync(a54_0x44d406['join'](_0x2e2494,'tdx.json')))return _0x2e2494;}return undefined;}async[a54_0x26a927(0x162)](_0x2c6008,_0x274be7,_0x12bf2c){const _0x39140f=a54_0x26a927;try{const _0x501047=await _0x2c6008[_0x39140f(0x13e)][_0x39140f(0x133)](_0x274be7,{'limit':0x1});if(_0x501047[_0x39140f(0x294)]>0x0){const _0xfd6576=_0x501047[0x0]['id'],_0x511e7f=getWorkflowUrl(_0x12bf2c,_0xfd6576);console[_0x39140f(0x2ab)]('\x20\x20Console:\x20'+a54_0x1d1160['cyan'](_0x511e7f));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1d2);[a54_0x26a927(0x150)]=a54_0x26a927(0x141);async['execute'](_0x330635){const _0x2e7016=a54_0x26a927,{options:_0x255cd6,args:_0x54a63a,tdx:_0x2c3cab}=_0x330635,_0x15bae9=_0x54a63a[0x0],_0x2a6202=_0x255cd6[_0x2e7016(0x188)];if(_0x2a6202)return saveSessionContext({'workflow_project':undefined},_0x255cd6[_0x2e7016(0x22c)]),console[_0x2e7016(0x149)](a54_0x1d1160[_0x2e7016(0x2bf)](_0x2e7016(0x14a))),0x0;if(!_0x15bae9)return console[_0x2e7016(0x2ab)](a54_0x1d1160['red'](_0x2e7016(0x243)),'Project\x20name\x20is\x20required'),console[_0x2e7016(0x2ab)](a54_0x1d1160[_0x2e7016(0x17d)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x2e7016(0x2ab)](a54_0x1d1160[_0x2e7016(0x17d)](_0x2e7016(0x20d))),0x1;const _0x48e69c=await withSpinner('Resolving\x20project\x20\x27'+_0x15bae9+_0x2e7016(0x1a0),()=>_0x2c3cab[_0x2e7016(0x13e)]['resolveProjectId'](_0x15bae9),{'verbose':_0x255cd6['verbose']}),{name:_0x865083}=_0x48e69c[_0x2e7016(0x1ab)];return saveSessionContext({'workflow_project':_0x865083},_0x255cd6['session']),console[_0x2e7016(0x149)](a54_0x1d1160[_0x2e7016(0x2bf)](_0x2e7016(0x22f)+a54_0x1d1160[_0x2e7016(0x281)](_0x865083))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x26a927(0x296)]='workflow:projects';[a54_0x26a927(0x150)]='List\x20all\x20workflow\x20projects';async[a54_0x26a927(0x1a6)](_0x1387cd){const _0x434cd7=a54_0x26a927,{options:_0x223781,args:_0x108a67,tdx:_0x52381e}=_0x1387cd,_0x15fe40=_0x108a67[0x0];_0x223781[_0x434cd7(0x1f9)]&&_0x15fe40&&console[_0x434cd7(0x2ab)](_0x434cd7(0x1d6)+_0x15fe40);const _0x8eb65c=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x52381e['workflow']['projects'](_0x15fe40,{'limit':_0x223781[_0x434cd7(0x1bb)]}),{'verbose':_0x223781[_0x434cd7(0x1f9)]});let _0x4fae80=_0x8eb65c['data'];_0x4fae80[_0x434cd7(0x1d0)]((_0x5aa3bd,_0xbf9422)=>_0x5aa3bd[_0x434cd7(0x296)][_0x434cd7(0x26d)](_0xbf9422['name']));const _0x5d230d=_0x223781[_0x434cd7(0x1bb)]||0x64,_0x5723fd=_0x4fae80[_0x434cd7(0x294)]>=_0x5d230d?a54_0x1d1160[_0x434cd7(0x17d)](_0x434cd7(0x183)):'';console[_0x434cd7(0x2ab)](_0x434cd7(0x11f)+_0x4fae80[_0x434cd7(0x294)]+'\x20project'+(_0x4fae80[_0x434cd7(0x294)]!==0x1?'s':'')+_0x5723fd);if(_0x223781['format']===_0x434cd7(0x208)||_0x223781[_0x434cd7(0x15e)]===_0x434cd7(0x25c)||_0x223781[_0x434cd7(0x15e)]==='table')await handleSDKOutput(_0x4fae80,_0x223781);else{if(_0x4fae80[_0x434cd7(0x294)]===0x0)_0x15fe40?console[_0x434cd7(0x149)]('No\x20projects\x20match\x20pattern:\x20'+_0x15fe40):console[_0x434cd7(0x149)](_0x434cd7(0x252));else{const _0x5bfe2f=_0x4fae80[_0x434cd7(0x12e)](_0x5a2fd2=>{const _0x578f5b=_0x434cd7,_0x5b3056=_0x5a2fd2[_0x578f5b(0x27b)]?.[_0x578f5b(0x1f8)](_0x2f1e74=>_0x2f1e74[_0x578f5b(0x153)]===_0x578f5b(0x22e)),_0x21d3b3=_0x5b3056?a54_0x1d1160[_0x578f5b(0x17d)](_0x578f5b(0x138)):'';return _0x578f5b(0x171)+_0x5a2fd2[_0x578f5b(0x296)]+_0x21d3b3;});await writeOutput(_0x5bfe2f['join']('\x0a'),_0x223781['output'],_0x434cd7(0x1b3));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1ce);[a54_0x26a927(0x150)]=a54_0x26a927(0x241);async['execute'](_0x4c0b34){const _0xf03d0b=a54_0x26a927,{options:_0x228d9d,args:_0x15e33b,tdx:_0x263343}=_0x4c0b34,_0x41d8aa=this['resolveProject'](_0x15e33b,_0x228d9d);_0x228d9d[_0xf03d0b(0x1f9)]&&_0x41d8aa&&console[_0xf03d0b(0x2ab)](_0xf03d0b(0x287)+_0x41d8aa);const _0x5de360=await withSpinner(_0xf03d0b(0x14b),()=>_0x263343[_0xf03d0b(0x13e)]['workflows'](_0x41d8aa,{'limit':_0x228d9d[_0xf03d0b(0x1bb)]}),{'verbose':_0x228d9d[_0xf03d0b(0x1f9)]});let _0x41bcbb=_0x5de360[_0xf03d0b(0x1ab)];_0x41bcbb[_0xf03d0b(0x1d0)]((_0x502cbb,_0x267111)=>{const _0x4ac76d=_0xf03d0b,_0x44214f=_0x502cbb[_0x4ac76d(0x296)][_0x4ac76d(0x26d)](_0x267111['name']);if(_0x44214f!==0x0)return _0x44214f;return(_0x502cbb['project']?.[_0x4ac76d(0x296)]||'')['localeCompare'](_0x267111[_0x4ac76d(0x15d)]?.[_0x4ac76d(0x296)]||'');});const _0x4bda5a=_0x228d9d[_0xf03d0b(0x1bb)]||0x64,_0x1d0700=_0x41bcbb[_0xf03d0b(0x294)]>=_0x4bda5a?a54_0x1d1160[_0xf03d0b(0x17d)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0xf03d0b(0x2ab)](_0xf03d0b(0x11f)+_0x41bcbb[_0xf03d0b(0x294)]+_0xf03d0b(0x123)+(_0x41bcbb[_0xf03d0b(0x294)]!==0x1?'s':'')+_0x1d0700);if(_0x228d9d[_0xf03d0b(0x15e)]==='json'||_0x228d9d[_0xf03d0b(0x15e)]===_0xf03d0b(0x25c)||_0x228d9d[_0xf03d0b(0x15e)]===_0xf03d0b(0x194))await handleSDKOutput(_0x41bcbb,_0x228d9d);else{if(_0x41bcbb[_0xf03d0b(0x294)]===0x0)_0x41d8aa?console['log'](_0xf03d0b(0x154)+_0x41d8aa):console[_0xf03d0b(0x149)](_0xf03d0b(0x11d));else{const _0x4d438e=_0x228d9d['site'],_0x15faee=_0x41bcbb['map'](_0x12d3b0=>{const _0xdc9a7e=_0xf03d0b,_0x572eba=a54_0x1d1160['dim']('#'+_0x12d3b0['id']),_0x24b819=hyperlink(_0x572eba,getWorkflowUrl(_0x4d438e,_0x12d3b0['id'])),_0x334828=_0x12d3b0['project']?.[_0xdc9a7e(0x296)]?a54_0x1d1160[_0xdc9a7e(0x17d)]('\x20('+_0x12d3b0['project']['name']+')'):'';return _0xdc9a7e(0x19c)+_0x24b819+'\x20'+_0x12d3b0[_0xdc9a7e(0x296)]+_0x334828;});await writeOutput(_0x15faee['join']('\x0a'),_0x228d9d[_0xf03d0b(0x160)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x2a0);['description']=a54_0x26a927(0x15b);async['execute'](_0x4e8441){const _0x15663e=a54_0x26a927,{options:_0x81e7ba,args:_0xa47c6d,tdx:_0x1b5e9f}=_0x4e8441,_0x51debb=this[_0x15663e(0x2c1)](_0xa47c6d,_0x81e7ba);if(!_0x51debb)return 0x1;const {projectName:_0x4e0395,workflowName:_0x2d1725}=_0x51debb;if(_0x81e7ba['verbose']){if(_0x4e0395&&_0x2d1725)console[_0x15663e(0x2ab)]('Filter:\x20'+_0x4e0395+'.'+_0x2d1725);else _0x4e0395&&console[_0x15663e(0x2ab)]('Filter:\x20project='+_0x4e0395);const _0x4e82fd=_0x81e7ba['status'];_0x4e82fd&&console['error']('Status:\x20'+_0x4e82fd);}let _0x18924c=0x28;if(process[_0x15663e(0x25d)]['isTTY']&&!_0x81e7ba[_0x15663e(0x160)]&&!_0x81e7ba[_0x15663e(0x15e)]){const _0x4adc1c=process[_0x15663e(0x25d)][_0x15663e(0x164)]||0x28;_0x18924c=Math[_0x15663e(0x29c)](0x14,Math['floor'](_0x4adc1c*0x2/0x3));}const _0x73433b=_0x81e7ba[_0x15663e(0x1bb)]||_0x18924c,_0x624b91=await withSpinner(_0x15663e(0x22b),()=>_0x1b5e9f['workflow'][_0x15663e(0x165)]({'projectName':_0x4e0395,'workflowName':_0x2d1725,'status':_0x81e7ba['status'],'fromTime':_0x81e7ba[_0x15663e(0x15c)],'toTime':_0x81e7ba['to'],'limit':_0x73433b}),{'verbose':_0x81e7ba[_0x15663e(0x1f9)]}),_0x5994ac=_0x624b91[_0x15663e(0x1ab)];_0x5994ac[_0x15663e(0x1d0)]((_0x131083,_0x2658a2)=>{const _0x5b1112=_0x15663e,_0x26cf07=_0x131083[_0x5b1112(0x2cb)]||'',_0x1d0bbb=_0x2658a2['sessionTime']||'';return _0x1d0bbb[_0x5b1112(0x26d)](_0x26cf07);});_0x5994ac[_0x15663e(0x294)]>=_0x73433b?console['error'](_0x15663e(0x2b9)+_0x5994ac['length']+_0x15663e(0x191)+a54_0x1d1160['dim'](_0x15663e(0x2d6))):console[_0x15663e(0x2ab)](_0x15663e(0x11f)+_0x5994ac['length']+_0x15663e(0x2b8)+(_0x5994ac[_0x15663e(0x294)]!==0x1?'s':''));if(_0x81e7ba[_0x15663e(0x15e)]===_0x15663e(0x208)||_0x81e7ba['format']===_0x15663e(0x25c)||_0x81e7ba[_0x15663e(0x15e)]===_0x15663e(0x194))await handleSDKOutput(_0x5994ac,_0x81e7ba);else{if(!process[_0x15663e(0x25d)]['isTTY']||_0x81e7ba[_0x15663e(0x160)]){if(_0x5994ac[_0x15663e(0x294)]===0x0){if(_0x4e0395&&_0x2d1725)console['log'](_0x15663e(0x195)+_0x4e0395+'.'+_0x2d1725);else _0x4e0395?console[_0x15663e(0x149)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4e0395):console[_0x15663e(0x149)](_0x15663e(0x2a9));}else{const _0x427439=_0x81e7ba[_0x15663e(0x184)],_0x260df6=this[_0x15663e(0x16f)](_0x5994ac,_0x427439);_0x81e7ba['output']?await writeOutput(_0x260df6,_0x81e7ba[_0x15663e(0x160)],_0x15663e(0x1b3)):console[_0x15663e(0x149)](_0x260df6);}!_0x4e0395&&(console['error'](''),console['error'](a54_0x1d1160[_0x15663e(0x17d)](_0x15663e(0x246))),console['error'](a54_0x1d1160[_0x15663e(0x17d)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x1d1160[_0x15663e(0x17d)](_0x15663e(0x216))));}else{if(_0x5994ac['length']===0x0){if(_0x4e0395&&_0x2d1725)console[_0x15663e(0x149)](_0x15663e(0x195)+_0x4e0395+'.'+_0x2d1725);else _0x4e0395?console[_0x15663e(0x149)](_0x15663e(0x16e)+_0x4e0395):console[_0x15663e(0x149)]('No\x20sessions\x20found');}else await this[_0x15663e(0x19f)](_0x5994ac,_0x4e8441,_0x4e0395);}}return 0x0;}[a54_0x26a927(0x16f)](_0x477f6d,_0x4d2b04){const _0x4b3c9c=a54_0x26a927,_0x55efa2=[],_0x2dcdd9=new Map();let _0x41c041=Infinity,_0x6bed8f=-Infinity;for(const _0x4a500e of _0x477f6d){if(_0x4a500e[_0x4b3c9c(0x283)]?.[_0x4b3c9c(0x172)]){const _0x419bd2=new Date(_0x4a500e[_0x4b3c9c(0x283)][_0x4b3c9c(0x172)])[_0x4b3c9c(0x256)](),_0x2107a7=_0x4a500e[_0x4b3c9c(0x283)][_0x4b3c9c(0x1cf)]?new Date(_0x4a500e[_0x4b3c9c(0x283)]['finishedAt'])[_0x4b3c9c(0x256)]():Date['now'](),_0x7c659b=_0x4a500e[_0x4b3c9c(0x15d)]?.[_0x4b3c9c(0x296)]||_0x4b3c9c(0x217);!_0x2dcdd9[_0x4b3c9c(0x2b7)](_0x7c659b)&&_0x2dcdd9[_0x4b3c9c(0x1b8)](_0x7c659b,[]),_0x2dcdd9['get'](_0x7c659b)[_0x4b3c9c(0x1f4)]({'session':_0x4a500e,'startTime':_0x419bd2,'endTime':_0x2107a7,'duration':_0x2107a7-_0x419bd2}),_0x41c041=Math[_0x4b3c9c(0x277)](_0x41c041,_0x419bd2),_0x6bed8f=Math['max'](_0x6bed8f,_0x2107a7);}}if(_0x2dcdd9['size']===0x0)return _0x4b3c9c(0x2be);const _0x1cd7ad=process[_0x4b3c9c(0x25d)][_0x4b3c9c(0x166)]||0x78,_0x4fd457=0x1e,_0xab48a4=0x32,_0x513fe4=0x4,_0x49113b=Math[_0x4b3c9c(0x277)](_0xab48a4,Math[_0x4b3c9c(0x29c)](_0x4fd457,Math[_0x4b3c9c(0x290)](_0x1cd7ad*0.3))),_0x4596bc=_0x1cd7ad-_0x49113b-TIMELINE_CONFIG[_0x4b3c9c(0x135)]-0x3-_0x513fe4,_0x220c96=_0x6bed8f-_0x41c041,_0x3ea2fd=_0x220c96/_0x49113b,_0x51cb61=renderTimeAxis({'startTime':_0x41c041,'endTime':_0x6bed8f,'durationMs':_0x220c96,'msPerChar':_0x3ea2fd},_0x49113b),_0x3aeb2b=[];for(const _0x374d8c of _0x2dcdd9[_0x4b3c9c(0x24a)]()){_0x3aeb2b[_0x4b3c9c(0x1f4)](..._0x374d8c);}_0x3aeb2b[_0x4b3c9c(0x1d0)]((_0x41c09c,_0x517adc)=>_0x517adc[_0x4b3c9c(0x1e7)]-_0x41c09c[_0x4b3c9c(0x1e7)]);const _0x2d7abb=new Date(_0x41c041),_0x554abe=formatDate(_0x2d7abb),_0x5ed705=_0x513fe4+TIMELINE_CONFIG[_0x4b3c9c(0x27d)]+TIMELINE_CONFIG[_0x4b3c9c(0x2a5)]+_0x4596bc,_0x1c9842='\x20'[_0x4b3c9c(0x1de)](_0x5ed705-_0x554abe[_0x4b3c9c(0x294)]),_0x368f2c=_0x1c9842+a54_0x1d1160[_0x4b3c9c(0x17d)](_0x554abe)+'\x20'+_0x51cb61;_0x55efa2['push'](_0x368f2c);const _0xdda130=0x16;let _0xdc968=0x0;for(const _0x2c5b2c of _0x3aeb2b){const _0x40df77=_0x2c5b2c['session'][_0x4b3c9c(0x15d)]?.[_0x4b3c9c(0x296)]||'?',_0x43d1eb=Math[_0x4b3c9c(0x277)](stringWidth(_0x40df77),_0xdda130);_0xdc968=Math['max'](_0xdc968,_0x43d1eb);}for(const _0x1608ca of _0x3aeb2b){const {session:_0x22a21c,startTime:_0xece3eb,endTime:_0x4db8ee,duration:_0x42aab3}=_0x1608ca,_0x5901e3=_0x22a21c['project']?.['id'],_0x5f49b5=_0x22a21c['id'],_0x208dff=_0x22a21c['project']?.[_0x4b3c9c(0x296)]||'?',_0x455e02=_0x22a21c[_0x4b3c9c(0x13e)]?.[_0x4b3c9c(0x296)]||'?';let _0x40db95,_0x4ce20c;if(_0x22a21c['lastAttempt']){const _0x24a1a5=_0x22a21c[_0x4b3c9c(0x283)];!_0x24a1a5[_0x4b3c9c(0x23a)]?(_0x40db95=_0x24a1a5[_0x4b3c9c(0x20f)]?'🛑':'🔄',_0x4ce20c=_0x24a1a5[_0x4b3c9c(0x20f)]?a54_0x1d1160[_0x4b3c9c(0x242)]:a54_0x1d1160['blue']):(_0x40db95=_0x24a1a5[_0x4b3c9c(0x173)]?'✅':'❌',_0x4ce20c=_0x24a1a5[_0x4b3c9c(0x173)]?a54_0x1d1160[_0x4b3c9c(0x2bf)]:a54_0x1d1160[_0x4b3c9c(0x224)]);}else _0x40db95='⏳',_0x4ce20c=a54_0x1d1160[_0x4b3c9c(0x17d)];const _0x1fbf19='#'+_0x5f49b5,_0x11b34=_0x5901e3?hyperlink(_0x1fbf19,getWorkflowSessionUrl(_0x4d2b04,_0x5901e3,_0x5f49b5)):_0x1fbf19;let _0x5db741=_0x208dff;stringWidth(_0x208dff)>_0xdda130&&(_0x5db741=_0x208dff['slice'](0x0,_0xdda130-0x1)+'…');const _0x226c7c=a54_0x1d1160['dim'](_0x5db741),_0x6eee7f=stringWidth(_0x5db741),_0x5f243b='\x20'[_0x4b3c9c(0x1de)](_0xdc968-stringWidth(_0x5db741)+0x2),_0x56dfbe='('+formatElapsed(_0x42aab3)+')',_0x3d2420=stringWidth(_0x56dfbe),_0x10e038=stringWidth(_0x1fbf19),_0x35a23b=_0x10e038+0x1+_0x6eee7f+_0x5f243b[_0x4b3c9c(0x294)],_0x2fa5b0=_0x4596bc-_0x35a23b-_0x3d2420-0x1-0x8;let _0x510f24=_0x455e02;stringWidth(_0x510f24)>_0x2fa5b0&&(_0x510f24=_0x510f24['slice'](0x0,_0x2fa5b0-0x1)+'…');const _0xf47de0=_0x11b34+'\x20'+_0x226c7c+_0x5f243b+_0x510f24,_0x1b1223=stringWidth(_0xf47de0),_0x27cd98=_0x4596bc-_0x1b1223-_0x3d2420,_0x864977=_0xf47de0+'\x20'[_0x4b3c9c(0x1de)](Math['max'](0x1,_0x27cd98))+a54_0x1d1160['dim'](_0x56dfbe),_0x549248=Math[_0x4b3c9c(0x290)]((_0xece3eb-_0x41c041)/_0x3ea2fd),_0x4de86b=Math[_0x4b3c9c(0x290)]((_0x4db8ee-_0x41c041)/_0x3ea2fd),_0x4c73ab=Math[_0x4b3c9c(0x29c)](_0x549248+0x1,_0x4de86b),_0x10003c=new Array(_0x49113b)[_0x4b3c9c(0x2d8)]('\x20');for(let _0x2d7f63=_0x549248;_0x2d7f63<Math[_0x4b3c9c(0x277)](_0x4c73ab,_0x49113b);_0x2d7f63++){_0x10003c[_0x2d7f63]='─';}const _0xc76059=_0x10003c[_0x4b3c9c(0x12e)](_0x511ffd=>_0x511ffd==='\x20'?'\x20':_0x4ce20c(_0x511ffd))['join']('');_0x55efa2['push'](_0x40db95+'\x20'+_0x864977+'│'+_0xc76059+'│');}return _0x55efa2['join']('\x0a');}async[a54_0x26a927(0x19f)](_0x1821a8,_0xfe85b9,_0x164754){const _0x4e6743=a54_0x26a927,{options:_0x1c3e0e,tdx:_0x3fe356}=_0xfe85b9,_0x1e4cf5=_0x1c3e0e['site'],{timelineRows:_0x2b6329,timeAxisHeader:_0x4a4b83}=this[_0x4e6743(0x285)](_0x1821a8,_0x1e4cf5),_0x589b62=_0x2b6329[_0x4e6743(0x250)](_0x3b4e17=>_0x3b4e17['attemptId']);if(_0x589b62[_0x4e6743(0x294)]===0x0){const _0x1033ed=this[_0x4e6743(0x16f)](_0x1821a8,_0x1e4cf5);console[_0x4e6743(0x149)](_0x1033ed);!_0x164754&&(console[_0x4e6743(0x2ab)](''),console[_0x4e6743(0x2ab)](a54_0x1d1160[_0x4e6743(0x17d)](_0x4e6743(0x246))),console[_0x4e6743(0x2ab)](a54_0x1d1160['dim'](_0x4e6743(0x1bd))+'or'+a54_0x1d1160[_0x4e6743(0x17d)](_0x4e6743(0x216))));return;}_0x4a4b83&&console['log'](_0x4a4b83);const _0x1f8457=_0x2b6329[_0x4e6743(0x250)](_0x11dca1=>_0x11dca1['attemptId'])['map'](_0x23935c=>({'title':_0x23935c[_0x4e6743(0x2b1)],'value':_0x23935c[_0x4e6743(0x1e6)]})),_0x2ecdd7=process['stdout']['rows']||0x3c,_0x8cf428=Math[_0x4e6743(0x29c)](0x28,Math['floor'](_0x2ecdd7*0x2/0x3)),_0x4c233f=await a54_0x1d7da3({'type':'autocomplete','name':_0x4e6743(0x1e6),'message':_0x4e6743(0x2b3),'choices':_0x1f8457,'initial':-0x1,'limit':_0x8cf428,'clearFirst':!![],'fallback':{'title':_0x4e6743(0x28a),'value':null},'suggest':(_0x520571,_0x5e05a0)=>{const _0x9240ef=_0x4e6743;if(!_0x520571)return Promise['resolve'](_0x5e05a0);const _0x5ad69a=_0x5e05a0[_0x9240ef(0x250)](_0xecdce6=>{const _0x104eb1=_0x9240ef,_0x4c76da=_0xecdce6;return _0x4c76da[_0x104eb1(0x1ae)][_0x104eb1(0x238)]()[_0x104eb1(0x2bd)](_0x520571[_0x104eb1(0x238)]());});return Promise[_0x9240ef(0x2ca)](_0x5ad69a);}}),_0x52814e=()=>{const _0x561ae9=_0x4e6743;process[_0x561ae9(0x25d)]['write'](_0x561ae9(0x27a)),process[_0x561ae9(0x25d)]['write'](_0x561ae9(0x27a)),process[_0x561ae9(0x25d)][_0x561ae9(0x209)](_0x561ae9(0x27a));},_0x545821=_0x4c233f&&_0x4c233f[_0x4e6743(0x1e6)]&&_0x4c233f[_0x4e6743(0x1e6)]!==null&&_0x4c233f[_0x4e6743(0x1e6)][_0x4e6743(0x155)]()!=='';if(!_0x545821){_0x52814e(),console[_0x4e6743(0x149)](a54_0x1d1160['dim']('Cancelled'));return;}_0x52814e();const _0x42ae9b=_0x1821a8[_0x4e6743(0x143)](_0x2f5f0d=>_0x2f5f0d[_0x4e6743(0x283)]?.['id']===_0x4c233f[_0x4e6743(0x1e6)]);if(_0x42ae9b){const _0x17abe2=_0x42ae9b[_0x4e6743(0x15d)]?.['name']||'?',_0x183888=_0x42ae9b[_0x4e6743(0x13e)]?.[_0x4e6743(0x296)]||'?';console[_0x4e6743(0x149)](_0x4e6743(0x2d3)+a54_0x1d1160[_0x4e6743(0x17d)](_0x17abe2)+_0x4e6743(0x147)+a54_0x1d1160['dim'](_0x183888));}const _0x504826=new WorkflowTimelineCommand();await _0x504826[_0x4e6743(0x1a6)]({'args':[],'options':{..._0x1c3e0e,'attemptId':_0x4c233f['attemptId']},'tdx':_0x3fe356});}[a54_0x26a927(0x285)](_0x52648c,_0x2745e3){const _0x427c3e=a54_0x26a927,_0x1e2dca=new Map();for(const _0x19b91e of _0x52648c){_0x19b91e['id']&&_0x19b91e['lastAttempt']?.['id']&&_0x1e2dca[_0x427c3e(0x1b8)](_0x19b91e['id'],_0x19b91e[_0x427c3e(0x283)]['id']);}const _0xf1e6aa=[];let _0x226824='';const _0x23b67e=this[_0x427c3e(0x16f)](_0x52648c,_0x2745e3),_0x157f8d=_0x23b67e[_0x427c3e(0x29f)]('\x0a');for(const _0x566bd3 of _0x157f8d){if(_0x566bd3[_0x427c3e(0x293)](_0x427c3e(0x11e))||_0x566bd3[_0x427c3e(0x199)](/^\s+\d{4}-\d{2}-\d{2}/))_0x226824=_0x566bd3;else{if(_0x566bd3[_0x427c3e(0x199)](/^[✅❌🔄🛑⏳]/)){const _0x81bbdd=_0x566bd3[_0x427c3e(0x199)](/#(\d+)/),_0x3fcf8e=_0x81bbdd?_0x81bbdd[0x1]:null,_0x24ca99=_0x3fcf8e?_0x1e2dca[_0x427c3e(0x14f)](_0x3fcf8e)||null:null,_0x4a8495=_0x52648c[_0x427c3e(0x143)](_0x586172=>_0x586172['id']===_0x3fcf8e),_0xe3b2b0=_0x4a8495?.[_0x427c3e(0x15d)]?.[_0x427c3e(0x296)]||'';_0xf1e6aa[_0x427c3e(0x1f4)]({'displayLine':_0x566bd3,'attemptId':_0x24ca99,'projectName':_0xe3b2b0});}}}return{'timelineRows':_0xf1e6aa,'timeAxisHeader':_0x226824};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]='workflow:attempts';[a54_0x26a927(0x150)]='List\x20workflow\x20attempts';async['execute'](_0x41286b){const _0x4bf580=a54_0x26a927,{options:_0x631e37,args:_0x2c9f9a,tdx:_0x4c97c6}=_0x41286b,_0x37de4c=this[_0x4bf580(0x2c1)](_0x2c9f9a,_0x631e37);if(!_0x37de4c)return 0x1;const {projectName:_0x500e2d,workflowName:_0x363edc}=_0x37de4c,_0x2de7e9=_0x631e37[_0x4bf580(0x15f)];if(_0x631e37[_0x4bf580(0x1f9)]){if(_0x500e2d&&_0x363edc)console[_0x4bf580(0x2ab)](_0x4bf580(0x227)+_0x500e2d+'.'+_0x363edc);else _0x500e2d&&console[_0x4bf580(0x2ab)]('Filter:\x20project='+_0x500e2d);_0x2de7e9&&console[_0x4bf580(0x2ab)](_0x4bf580(0x28e));}const _0x3584ae=await withSpinner(_0x4bf580(0x2a1),()=>_0x4c97c6[_0x4bf580(0x13e)]['attempts']({'projectName':_0x500e2d,'workflowName':_0x363edc,'includeRetried':_0x2de7e9,'limit':_0x631e37['limit']}),{'verbose':_0x631e37['verbose']}),_0x44b97d=_0x3584ae[_0x4bf580(0x1ab)],_0x2df57d=_0x631e37[_0x4bf580(0x1bb)]||0x64,_0x2efb1b=_0x44b97d[_0x4bf580(0x294)]>=_0x2df57d?a54_0x1d1160[_0x4bf580(0x17d)](_0x4bf580(0x183)):'';console[_0x4bf580(0x2ab)]('✔\x20Found\x20'+_0x44b97d[_0x4bf580(0x294)]+_0x4bf580(0x2da)+(_0x44b97d[_0x4bf580(0x294)]!==0x1?'s':'')+_0x2efb1b);if(_0x631e37['format']==='json'||_0x631e37[_0x4bf580(0x15e)]===_0x4bf580(0x25c)||_0x631e37[_0x4bf580(0x15e)]===_0x4bf580(0x194))await handleSDKOutput(_0x44b97d,_0x631e37);else{if(_0x44b97d[_0x4bf580(0x294)]===0x0){if(_0x500e2d&&_0x363edc)console[_0x4bf580(0x149)](_0x4bf580(0x170)+_0x500e2d+'.'+_0x363edc);else _0x500e2d?console[_0x4bf580(0x149)](_0x4bf580(0x1f6)+_0x500e2d):console[_0x4bf580(0x149)]('No\x20attempts\x20found');}else{const _0x4617e0=_0x631e37[_0x4bf580(0x184)],_0x3eb6c9=_0x44b97d['map'](_0x33383e=>{const _0x45f816=_0x4bf580,_0x16d0b8=a54_0x1d1160[_0x45f816(0x17d)]('#'+_0x33383e['id']),_0x48beab=_0x33383e[_0x45f816(0x15d)]?.['id'],_0x11ba12=_0x33383e['session_id']||_0x33383e[_0x45f816(0x202)],_0x104ce1=_0x48beab&&_0x11ba12?hyperlink(_0x16d0b8,getWorkflowAttemptUrl(_0x4617e0,_0x48beab,_0x11ba12,_0x33383e['id'])):_0x16d0b8,{icon:_0x459431,text:_0x6a0f03}=getAttemptStatusDisplay(_0x33383e),_0x105bd6=(_0x33383e[_0x45f816(0x15d)]?.[_0x45f816(0x296)]||'?')+'.'+(_0x33383e['workflow']?.[_0x45f816(0x296)]||'?'),_0x2e07a5=_0x33383e[_0x45f816(0x2cb)]?a54_0x1d1160[_0x45f816(0x17d)](_0x33383e['sessionTime']):'';return(_0x104ce1+'\x20'+_0x459431+(_0x6a0f03?'\x20'+_0x6a0f03:'')+'\x20'+_0x105bd6+'\x20'+_0x2e07a5)['trimEnd']();});await writeOutput(_0x3eb6c9['join']('\x0a'),_0x631e37[_0x4bf580(0x160)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1ee);[a54_0x26a927(0x150)]=a54_0x26a927(0x2d5);async[a54_0x26a927(0x1a6)](_0x437bb8){const _0x3eec03=a54_0x26a927,{options:_0x4b0a8d,args:_0x34384b,tdx:_0x5b7d3c}=_0x437bb8,_0x1792e8=_0x34384b[0x0];if(!_0x1792e8)return console[_0x3eec03(0x2ab)](_0x3eec03(0x249)),0x1;_0x4b0a8d[_0x3eec03(0x1f9)]&&console['error'](_0x3eec03(0x291)+_0x1792e8);const _0x25f248=await withSpinner('Getting\x20attempt\x20details...',()=>_0x5b7d3c[_0x3eec03(0x13e)]['attempt'](_0x1792e8),{'verbose':_0x4b0a8d[_0x3eec03(0x1f9)]}),_0x2ff505=_0x25f248[_0x3eec03(0x1ab)];let _0x5c12d7;!_0x2ff505['done']?_0x5c12d7=_0x2ff505[_0x3eec03(0x20f)]?_0x3eec03(0x163):_0x3eec03(0x2c6):_0x5c12d7=_0x2ff505[_0x3eec03(0x173)]?_0x3eec03(0x173):_0x3eec03(0x2ab);let _0x4d24b6;if(_0x2ff505['createdAt']&&_0x2ff505[_0x3eec03(0x1cf)]){const _0x5bf4f2=new Date(_0x2ff505['createdAt'])[_0x3eec03(0x256)](),_0x291203=new Date(_0x2ff505[_0x3eec03(0x1cf)])[_0x3eec03(0x256)]();_0x4d24b6=Math[_0x3eec03(0x26b)]((_0x291203-_0x5bf4f2)/0x3e8);}const _0x3d13e5={'attempt_id':_0x2ff505['id'],'status':_0x5c12d7,..._0x2ff505[_0x3eec03(0x169)]!==undefined&&{'index':_0x2ff505[_0x3eec03(0x169)]},..._0x2ff505[_0x3eec03(0x15d)]&&{'project':_0x2ff505[_0x3eec03(0x15d)]['name']},..._0x2ff505[_0x3eec03(0x13e)]&&{'workflow':_0x2ff505['workflow'][_0x3eec03(0x296)]},..._0x2ff505[_0x3eec03(0x202)]&&{'session_id':_0x2ff505[_0x3eec03(0x202)]},..._0x2ff505[_0x3eec03(0x2cb)]&&{'session_time':_0x2ff505[_0x3eec03(0x2cb)]},..._0x2ff505['retryAttemptName']&&{'retry_attempt':_0x2ff505[_0x3eec03(0x12d)]},..._0x4d24b6!==undefined&&{'duration_sec':_0x4d24b6},..._0x2ff505['createdAt']&&{'created_at':_0x2ff505[_0x3eec03(0x172)]},..._0x2ff505[_0x3eec03(0x1cf)]&&{'finished_at':_0x2ff505['finishedAt']},...Object[_0x3eec03(0x295)](_0x2ff505[_0x3eec03(0x260)])[_0x3eec03(0x294)]>0x0&&{'params':_0x2ff505[_0x3eec03(0x260)]}};return await handleSingleObjectOutput(_0x3d13e5,_0x4b0a8d),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x26a927(0x296)]='workflow:tasks';[a54_0x26a927(0x150)]=a54_0x26a927(0x1da);async[a54_0x26a927(0x1a6)](_0x2fc64c){const _0x3f179d=a54_0x26a927,{options:_0x1dd05e,args:_0x201aa3,tdx:_0x131f1d}=_0x2fc64c,_0x115a41=_0x201aa3[0x0];if(!_0x115a41)return console[_0x3f179d(0x2ab)](_0x3f179d(0x249)),0x1;const _0x19bfbe=_0x1dd05e[_0x3f179d(0x18b)];_0x1dd05e[_0x3f179d(0x1f9)]&&(console[_0x3f179d(0x2ab)]('Attempt\x20ID:\x20'+_0x115a41),_0x19bfbe&&console[_0x3f179d(0x2ab)](_0x3f179d(0x2c8)));const _0x2d62a7=await withSpinner(_0x3f179d(0x13b),()=>_0x131f1d[_0x3f179d(0x13e)]['tasks'](_0x115a41,_0x19bfbe||![]),{'verbose':_0x1dd05e[_0x3f179d(0x1f9)]}),_0x33dc13=_0x2d62a7[_0x3f179d(0x1ab)];return console[_0x3f179d(0x2ab)](_0x3f179d(0x11f)+_0x33dc13[_0x3f179d(0x294)]+_0x3f179d(0x21f)+(_0x33dc13['length']!==0x1?'s':'')),await handleSDKOutput(_0x33dc13,_0x1dd05e),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x26a927(0x296)]='workflow:logs';[a54_0x26a927(0x150)]=a54_0x26a927(0x230);async[a54_0x26a927(0x1a6)](_0x23d798){const _0x168a4e=a54_0x26a927,{options:_0x5eb220,args:_0x15c48c,tdx:_0x330e81}=_0x23d798,_0xeefcff=_0x15c48c[0x0];let _0x219d26=_0x15c48c[0x1];if(!_0xeefcff)return console['error'](_0x168a4e(0x249)),0x1;_0x5eb220[_0x168a4e(0x1f9)]&&(console[_0x168a4e(0x2ab)](_0x168a4e(0x291)+_0xeefcff),_0x219d26&&console['error'](_0x168a4e(0x18c)+_0x219d26));const _0x38db0b=await withSpinner('Fetching\x20log\x20files...',()=>_0x330e81[_0x168a4e(0x13e)][_0x168a4e(0x2b6)](_0xeefcff,_0x219d26),{'verbose':_0x5eb220[_0x168a4e(0x1f9)]}),_0x14977b=_0x38db0b[_0x168a4e(0x1ab)];if(_0x14977b[_0x168a4e(0x294)]===0x0)return console[_0x168a4e(0x2ab)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x219d26&&(_0x5eb220['json']||_0x5eb220[_0x168a4e(0x15e)]))return await handleSDKOutput(_0x14977b,_0x5eb220),0x0;if(!_0x219d26){const _0xcc2143=_0x14977b[_0x168a4e(0x12e)](_0xee544d=>({'title':_0xee544d[_0x168a4e(0x2ba)]+'\x20('+formatBytes(_0xee544d[_0x168a4e(0x233)])+')','value':_0xee544d[_0x168a4e(0x2ba)]})),_0x28f8ab=await a54_0x1d7da3({'type':_0x168a4e(0x23d),'name':'task','message':_0x168a4e(0x21b),'choices':_0xcc2143});if(!_0x28f8ab['task'])return console[_0x168a4e(0x2ab)](_0x168a4e(0x1ba)),0x0;_0x219d26=_0x28f8ab[_0x168a4e(0x145)];}const _0x3b61ce=await withSpinner(_0x168a4e(0x1fb),()=>_0x330e81[_0x168a4e(0x13e)][_0x168a4e(0x1d1)](_0xeefcff,_0x219d26),{'verbose':_0x5eb220['verbose']}),_0x6235cd=_0x3b61ce[_0x168a4e(0x1ab)];return _0x6235cd?console['log'](_0x6235cd):console[_0x168a4e(0x2ab)](_0x168a4e(0x18d)),0x0;}}function a54_0x2dbd(){const _0x1141dd=['attempt','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','find','toISOString','task','Schedule\x20ID\x20is\x20required',',\x20Workflow:\x20','listSecrets','log','✔\x20Workflow\x20project\x20context\x20cleared.','Listing\x20workflows...','Dry\x20run:\x20yes','Failed\x20to\x20fetch\x20attempt\x20data','kill','get','description','\x20secrets\x20set\x20for\x20project\x20\x27','TASK_NAME_WIDTH','key','No\x20workflows\x20found\x20in\x20project:\x20','trim','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','---\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','executePushProject','every','List\x20workflow\x20execution\x20sessions','from','project','format','includeRetried','output','\x22?\x20This\x20cannot\x20be\x20undone.','showWorkflowConsoleUrl','canceling','rows','sessions','columns','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getMonth','index','pending','\x20to\x20see\x20detailed\x20logs','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','fileCount','No\x20sessions\x20found\x20in\x20project:\x20','renderSessionsTimeline','No\x20attempts\x20found\x20for:\x20','📁\x20','createdAt','success','\x0a⚠\x20Project\x20\x22','✔\x20Push\x20complete','129530pTHHyA','...','workflow:schedules','\x20\x20Location:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','🔄\x20','isNewProject','dim','sourceDir','substring','Session\x20','isDirectory','Project\x20name\x20is\x20required','\x20(use\x20--limit\x20to\x20show\x20more)','site','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','fromTask','clear','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pushing\x20project...','includeSubtasks','Task\x20name:\x20','No\x20log\x20content\x20found','text','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20disabled\x20(','\x20sessions\x20','msPerChar','List\x20workflow\x20schedules','table','No\x20sessions\x20found\x20for:\x20','attempt:','relative','/app/workflows/','match','✔\x20Downloaded\x20','Analyzing\x20project...','📋\x20','Reason:\x20','\x20from\x20session\x20','navigateSessionsInteractive','\x27...','replace','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x0aDry\x20run\x20-\x20no\x20files\x20written','follow','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','execute','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','✔\x20Schedule\x20#','\x20\x20Session\x20context\x20set\x20to:\x20','revision','data','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','✔\x20Pushed\x20','title','Total:\x20','✔\x20Workflow\x20run\x20started','Secrets\x20to\x20set:\x20','splice','list','skipValidation','resolveProject','Deleting\x20secret...','Loading\x20session...','set','Filter:\x20project=','Cancelled','limit','workflow:schedule:enable','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20New\x20attempt\x20ID:\x20','resolveProjectDir','✔\x20Retry\x20started','New\x20project\x20name:\x20','No\x20workflow\x20tdx.json\x20found','POLL_INTERVAL_MS','updatedAt','workflow:push','newProjectId','Disabling\x20schedule\x20#','.\x20Expected\x20format:\x20KEY=VALUE','newProjectName','-\x20no\x20files\x20written','listSchedules','filesExtracted','Killing\x20attempt...','workflow:workflows','finishedAt','sort','logs','workflow:use','context','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Project:\x20','Pattern:\x20','\x0aError:','isArray','/sessions/','Show\x20tasks\x20for\x20an\x20attempt','dryRun','MAX_TIMELINE_WIDTH','setSecrets','repeat','workflow:run','slice','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','renderSingleTimeline','deleted','Source:\x20','attemptId','startTime','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','MAX_LABEL_COUNT','✔\x20Clone\x20complete','tdx\x20wf\x20attempt\x20','\x20\x20Revision:\x20','now','workflow:attempt','new','reason','indexOf','prepareCloneProject','startedAt','push','\x20\x20Files\x20extracted:\x20','No\x20attempts\x20found\x20in\x20project:\x20','1252125kPGXSw','some','verbose','projectId','Downloading\x20logs...','\x20-\x20','20656593fSjZlx','Key:\x20','\x20\x20Console:\x20','diff','unknown','sessionId','Project\x20name:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x0aDry\x20run\x20-\x20nothing\x20pushed','yes','Params:\x20','json','write','executeCloneProject','cwd','end','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','unchanged','cancelRequested','\x20\x20Project:\x20','Source\x20directory:\x20','112tVUuXw','MIN_TIMELINE_WIDTH','sourceProjectName','buildTimelineData','\x20\x20tdx\x20wf\x20use\x20<project>','(unknown)','renderTimeline','Retrying\x20session...','/attempt/','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:secrets:delete','workflowProject','\x20\x20Workflow:\x20','\x20task','\x20secret','Loading\x20sessions...','\x20enabled\x20(','window','red','Tip:\x20cd\x20to\x20workflows/','Setting\x20secret...','Filter:\x20','-\x20nothing\x20pushed','Session\x20time:\x20','hasChanges','Listing\x20workflow\x20sessions...','session','nextRunTime','sys','✔\x20Workflow\x20project\x20set\x20to:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x22\x20already\x20exists\x20(ID:\x20','fileSize','Key\x20cannot\x20be\x20empty','targetDir','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','getMinutes','toLowerCase','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','done','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aPush\x20these\x20changes?','select','\x20\x20Target:\x20','✔\x20Pull\x20complete','join','List\x20workflows','yellow','Error:','5076504sWhJNz','planned','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Output\x20directory:\x20','Error:\x20Attempt\x20ID\x20is\x20required','values','stringify','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Error:\x20','filter','durationMs','No\x20workflow\x20projects\x20found','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Retrying\x20attempt...','⚠\x20Showing\x20first\x20','getTime','Revision:\x20','Target:\x20','parse','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Target\x20directory:\x20','jsonl','stdout','basename','\x20(disabled)','params','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Downloading\x20project\x20','summary','1720104QFdupE','Error:\x20Project\x20name\x20is\x20required','tasks','preparePushProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','enableSchedule','\x20\x20Attempt\x20ID:\x20','round','Kill\x20a\x20running\x20attempt','localeCompare','disableSchedule','Parameters:\x20','getDate','Enable\x20a\x20workflow\x20schedule','💡\x20Tip:\x20Use\x20','Start\x20a\x20workflow\x20run','14KnhpyS','workflow:pull','Expected\x20format:\x20--param\x20key=value','min','\x20\x20Project\x20ID:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x1b[1A\x1b[2K','metadata','650710egFQSR','ICON_WIDTH','group_error','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','type','cyan','total','lastAttempt','existingProjectId','generateSessionTimelineRows','blue','Project\x20filter:\x20','Error:\x20Secret\x20key\x20is\x20required','MAX_POLL_ITERATIONS','No\x20matching\x20sessions\x20found','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','getHours','Source\x20directory\x20is\x20required','Include\x20retried:\x20yes','MAX_TASKS_DISPLAY','floor','Attempt\x20ID:\x20','workflow:clone','startsWith','length','keys','name','white','\x20new','\x20unchanged','workflow:kill','workflowName','max','workflow:delete','all','split','workflow:sessions','Listing\x20workflow\x20attempts...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','utf-8','→\x20New\x20project:\x20','ICON_SPACING','Force:\x20yes','changes','Auto-selected\x20latest\x20session:\x20','No\x20sessions\x20found','No\x20schedules\x20found','error','workflow:retry','download','retrySession','Cloning\x20to\x20','Select\x20a\x20workflow\x20to\x20run','displayLine','MIN_LABEL_COUNT','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Analyzing\x20changes...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','logFiles','has','\x20session','✔\x20Showing\x20','taskName','Attempt:\x20','\x20next:\x20','includes','No\x20sessions\x20with\x20timing\x20information','green','Resume\x20from:\x20','parseProjectWorkflowPattern','fullName','duration','message','\x20deleted','running','retryAttempt','Including\x20subtasks:\x20yes','isTTY','resolve','sessionTime','toLocaleString','\x20\x20Changes:\x20','requireProject','Latest\x20session\x20has\x20no\x20attempt','📅\x20#','\x20\x20Session\x20ID:\x20','\x20secrets...','Project:\x20','Session\x20not\x20found:\x20','Show\x20specific\x20attempt\x20details','(use\x20--limit\x20to\x20see\x20more)','280890ONYjLt','fill','projectName','\x20attempt','✔\x20Secret\x20\x27','✔\x20Deleted\x20project\x20','workflow:upload','path','No\x20workflows\x20found','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✔\x20Found\x20','\x27\x20from\x20project\x20\x27','getFullYear','LABEL_WIDTH_DIVISOR','\x20workflow','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x0a✔\x20No\x20changes\x20to\x20push','start','\x20modified','Pushing\x20workflow\x20project...','modified','Writing\x20files...','targetExists','Error:\x20Invalid\x20parameter\x20format:\x20','retryAttemptName','map','Disable\x20a\x20workflow\x20schedule','Files\x20to\x20upload:\x20','pollTimeline','Enabling\x20schedule\x20#','workflows','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','GUTTER','Listing\x20secrets...','Usage:\x20workflow:delete\x20<project-name-or-id>','\x20(system)','Validation:\x20skipped','revision:\x20','Getting\x20attempt\x20tasks...','padStart','state','workflow','param'];a54_0x2dbd=function(){return _0x1141dd;};return a54_0x2dbd();}export class WorkflowKillCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x29a);[a54_0x26a927(0x150)]=a54_0x26a927(0x26c);async[a54_0x26a927(0x1a6)](_0x306d0c){const _0x58bbed=a54_0x26a927,{options:_0x330986,args:_0x27dfc0,tdx:_0x3b87a7}=_0x306d0c,_0x560f89=_0x27dfc0[0x0];if(!_0x560f89)return console[_0x58bbed(0x2ab)](_0x58bbed(0x249)),0x1;const _0xfe3dd=_0x330986[_0x58bbed(0x1f0)];_0x330986[_0x58bbed(0x1f9)]&&(console[_0x58bbed(0x2ab)]('Attempt\x20ID:\x20'+_0x560f89),_0xfe3dd&&console[_0x58bbed(0x2ab)](_0x58bbed(0x19d)+_0xfe3dd));if(!_0x330986[_0x58bbed(0x206)]){if(!isInteractive())return console['error'](a54_0x1d1160[_0x58bbed(0x224)](_0x58bbed(0x1d7)),_0x58bbed(0x189)),console['error'](a54_0x1d1160['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb02d0=await confirmKey(_0x58bbed(0x1e8)+_0x560f89+'?');if(!_0xb02d0)return console[_0x58bbed(0x2ab)](a54_0x1d1160['yellow'](_0x58bbed(0x1ba))),0x1;}const _0x19fe2d=await withSpinner(_0x58bbed(0x1cd),()=>_0x3b87a7[_0x58bbed(0x13e)][_0x58bbed(0x14e)](_0x560f89,_0xfe3dd),{'verbose':_0x330986[_0x58bbed(0x1f9)]}),_0x32942a=_0x19fe2d[_0x58bbed(0x1ab)];return console[_0x58bbed(0x2ab)]('✔\x20'+_0x32942a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x2ac);[a54_0x26a927(0x150)]='Retry\x20a\x20session\x20or\x20attempt';async[a54_0x26a927(0x1a6)](_0x32ecae){const _0x1df353=a54_0x26a927,{options:_0x4d61a8,args:_0xf0c07b,tdx:_0xea8d34}=_0x32ecae,_0x587402=_0xf0c07b[0x0];if(!_0x587402)return console[_0x1df353(0x2ab)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1df353(0x2ab)](_0x1df353(0x1ac)),0x1;let _0x23e166=![],_0x3c19c5=_0x587402;if(_0x587402['startsWith']('session:'))_0x23e166=!![],_0x3c19c5=_0x587402[_0x1df353(0x17f)](0x8);else{if(_0x587402[_0x1df353(0x293)](_0x1df353(0x196)))_0x23e166=![],_0x3c19c5=_0x587402[_0x1df353(0x17f)](0x8);else return console[_0x1df353(0x2ab)](_0x1df353(0x24c)),console[_0x1df353(0x2ab)](_0x1df353(0x1ac)),0x1;}const _0x29fdce=_0x4d61a8[_0x1df353(0x187)],_0x41bed4=_0x4d61a8['resumeFrom'],_0x41ffd6=_0x4d61a8[_0x1df353(0x260)],_0x9b48a=_0x4d61a8['force'];_0x4d61a8[_0x1df353(0x1f9)]&&(console['error'](_0x1df353(0x258)+(_0x23e166?_0x1df353(0x22c):'attempt')+'\x20'+_0x3c19c5),_0x29fdce&&console['error']('From\x20task:\x20'+_0x29fdce),_0x41bed4&&console['error'](_0x1df353(0x2c0)+_0x41bed4),_0x41ffd6&&console[_0x1df353(0x2ab)](_0x1df353(0x207)+_0x41ffd6),_0x9b48a&&console['error'](_0x1df353(0x2a6)));let _0x4046a0;if(_0x41ffd6)try{if(_0x41ffd6[_0x1df353(0x293)]('@')){const _0x23223b=await import('fs/promises'),_0x4758a7=_0x41ffd6[_0x1df353(0x17f)](0x1),_0x5520cf=await _0x23223b['readFile'](_0x4758a7,_0x1df353(0x2a3));_0x4046a0=JSON[_0x1df353(0x259)](_0x5520cf);}else _0x4046a0=JSON[_0x1df353(0x259)](_0x41ffd6);}catch{return console[_0x1df353(0x2ab)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4d61a8['yes']){if(!isInteractive())return console[_0x1df353(0x2ab)](a54_0x1d1160[_0x1df353(0x224)]('\x0aError:'),_0x1df353(0x189)),console[_0x1df353(0x2ab)](a54_0x1d1160[_0x1df353(0x17d)](_0x1df353(0x18f))),0x1;const _0x5c79bf=await confirmKey(_0x1df353(0x261)+(_0x23e166?_0x1df353(0x22c):_0x1df353(0x140))+'\x20'+_0x3c19c5+'?');if(!_0x5c79bf)return console[_0x1df353(0x2ab)](a54_0x1d1160[_0x1df353(0x242)](_0x1df353(0x1ba))),0x1;}let _0x446cac;_0x23e166?_0x446cac=await withSpinner(_0x1df353(0x219),()=>_0xea8d34['workflow'][_0x1df353(0x2ae)](_0x3c19c5,{'fromTask':_0x29fdce,'retryParams':_0x4046a0}),{'verbose':_0x4d61a8[_0x1df353(0x1f9)]}):_0x446cac=await withSpinner(_0x1df353(0x254),()=>_0xea8d34[_0x1df353(0x13e)][_0x1df353(0x2c7)](_0x3c19c5,{'resumeFrom':_0x41bed4,'retryParams':_0x4046a0,'force':_0x9b48a}),{'verbose':_0x4d61a8[_0x1df353(0x1f9)]});const _0x15d377=_0x446cac['data'];return console[_0x1df353(0x2ab)](_0x1df353(0x1c0)),console[_0x1df353(0x2ab)](_0x1df353(0x1be)+_0x15d377[_0x1df353(0x1e6)]),console[_0x1df353(0x2ab)](_0x1df353(0x2d1)+_0x15d377['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1df);[a54_0x26a927(0x150)]=a54_0x26a927(0x273);async[a54_0x26a927(0x1a6)](_0x325487){const _0x579282=a54_0x26a927,{options:_0x57a50b,args:_0xa66e43,tdx:_0x3b3743}=_0x325487;let _0x423313=_0xa66e43[0x0];if(!_0x423313){const _0x54d0c8=this[_0x579282(0x1b5)]([],_0x57a50b),_0x1d56d0=await withSpinner('Loading\x20workflows...',()=>_0x3b3743[_0x579282(0x13e)][_0x579282(0x133)](_0x54d0c8,{'limit':_0x57a50b[_0x579282(0x1bb)]}),{'verbose':_0x57a50b[_0x579282(0x1f9)]}),_0x333444=_0x1d56d0[_0x579282(0x1ab)];if(_0x333444[_0x579282(0x294)]===0x0)return console[_0x579282(0x2ab)](_0x579282(0x11d)),!_0x54d0c8&&console[_0x579282(0x2ab)](a54_0x1d1160[_0x579282(0x17d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x556c73=_0x333444[_0x579282(0x12e)](_0x41ab76=>({'title':_0x41ab76[_0x579282(0x15d)]?.['name']+'.'+_0x41ab76[_0x579282(0x296)],'value':_0x41ab76[_0x579282(0x15d)]?.[_0x579282(0x296)]+'.'+_0x41ab76[_0x579282(0x296)],'description':_0x41ab76[_0x579282(0x1aa)]?_0x579282(0x13a)+_0x41ab76[_0x579282(0x1aa)]:undefined})),_0x5f55fd=await a54_0x1d7da3({'type':_0x579282(0x23d),'name':'workflow','message':_0x579282(0x2b0),'choices':_0x556c73});if(!_0x5f55fd[_0x579282(0x13e)])return 0x1;_0x423313=_0x5f55fd[_0x579282(0x13e)];}if(!_0x423313[_0x579282(0x2bd)]('.')){const _0x1d559a=this[_0x579282(0x1b5)]([],_0x57a50b);if(_0x1d559a)_0x423313=_0x1d559a+'.'+_0x423313;else return console['error'](a54_0x1d1160[_0x579282(0x224)](_0x579282(0x243)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x579282(0x2ab)](a54_0x1d1160[_0x579282(0x17d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x5cb7da=_0x57a50b[_0x579282(0x13f)],_0x1a79b5=_0x57a50b[_0x579282(0x2cb)],_0xf09b3f={};if(_0x5cb7da&&Array[_0x579282(0x1d8)](_0x5cb7da))for(const _0x5a9d5a of _0x5cb7da){const _0x440c44=_0x5a9d5a['indexOf']('=');if(_0x440c44===-0x1)return console['error'](_0x579282(0x12c)+_0x5a9d5a),console[_0x579282(0x2ab)](_0x579282(0x276)),0x1;const _0x4b75f9=_0x5a9d5a[_0x579282(0x17f)](0x0,_0x440c44),_0x4d815a=_0x5a9d5a[_0x579282(0x17f)](_0x440c44+0x1);try{_0xf09b3f[_0x4b75f9]=JSON[_0x579282(0x259)](_0x4d815a);}catch{_0xf09b3f[_0x4b75f9]=_0x4d815a;}}_0x57a50b['verbose']&&(console['error']('Workflow:\x20'+_0x423313),Object[_0x579282(0x295)](_0xf09b3f)[_0x579282(0x294)]>0x0&&console[_0x579282(0x2ab)](_0x579282(0x26f)+JSON[_0x579282(0x24b)](_0xf09b3f)),_0x1a79b5&&console[_0x579282(0x2ab)](_0x579282(0x229)+_0x1a79b5));const _0x29bda7=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3b3743[_0x579282(0x13e)]['run'](_0x423313,_0xf09b3f,{'sessionTime':_0x1a79b5}),{'verbose':_0x57a50b[_0x579282(0x1f9)]}),_0x5234c8=_0x29bda7[_0x579282(0x1ab)];console[_0x579282(0x2ab)](_0x579282(0x1b0)),console[_0x579282(0x2ab)](_0x579282(0x26a)+_0x5234c8['id']),console[_0x579282(0x2ab)](_0x579282(0x2d1)+_0x5234c8['sessionId']),console[_0x579282(0x2ab)](_0x579282(0x210)+_0x5234c8[_0x579282(0x15d)]?.[_0x579282(0x296)]),console['error'](_0x579282(0x21e)+_0x5234c8[_0x579282(0x13e)]?.[_0x579282(0x296)]);if(_0x5234c8['project']?.['id']&&_0x5234c8[_0x579282(0x202)]&&_0x5234c8['id']){const _0x325f12=_0x57a50b[_0x579282(0x184)],_0x522db5=getConsoleUrl(_0x325f12,_0x579282(0x198)+_0x5234c8[_0x579282(0x15d)]['id']+_0x579282(0x1d9)+_0x5234c8[_0x579282(0x202)]+_0x579282(0x21a)+_0x5234c8['id']);console[_0x579282(0x2ab)](_0x579282(0x1ff)+a54_0x1d1160['cyan'](_0x522db5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x26a927(0x296)]='workflow:download';[a54_0x26a927(0x150)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x26a927(0x1a6)](_0x3e3e83){const _0x23f202=a54_0x26a927,{options:_0xa9a882,args:_0x3de095,tdx:_0x3c0b6f}=_0x3e3e83,_0x93e271=_0x3de095[0x0],_0x1e393a=_0x3de095[0x1]||'.';if(!_0x93e271)return console[_0x23f202(0x2ab)](_0x23f202(0x265)),console['error']('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x328515=_0xa9a882['revision'];_0xa9a882[_0x23f202(0x1f9)]&&(console['error']('Project:\x20'+_0x93e271),console[_0x23f202(0x2ab)](_0x23f202(0x248)+_0x1e393a),_0x328515&&console['error']('Revision:\x20'+_0x328515));const _0x328ddb=await withSpinner(_0x23f202(0x262)+_0x93e271+'...',()=>_0x3c0b6f[_0x23f202(0x13e)][_0x23f202(0x2ad)](_0x93e271,_0x1e393a,{'revision':_0x328515}),{'verbose':_0xa9a882[_0x23f202(0x1f9)]}),_0x3a6004=_0x328ddb[_0x23f202(0x1ab)];return console[_0x23f202(0x2ab)](_0x23f202(0x19a)+_0x3a6004[_0x23f202(0x2d9)]),console[_0x23f202(0x2ab)](_0x23f202(0x1ec)+_0x3a6004[_0x23f202(0x1aa)]),console[_0x23f202(0x2ab)](_0x23f202(0x1f5)+_0x3a6004[_0x23f202(0x1cc)]),console[_0x23f202(0x2ab)](_0x23f202(0x179)+_0x1e393a+'/'+_0x3a6004[_0x23f202(0x2d9)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a54_0x26a927(0x2dd);[a54_0x26a927(0x150)]=a54_0x26a927(0x16c);async[a54_0x26a927(0x1a6)](_0x22b9b1){const _0x26e57f=a54_0x26a927,{options:_0x7dd93d,args:_0x12d30e,tdx:_0x5964ee}=_0x22b9b1;let _0x5b98aa='.',_0x13ce62=_0x7dd93d[_0x26e57f(0x296)];if(_0x12d30e[0x0]){const {promises:_0x32f3be}=await import('fs');try{const _0x489c84=await _0x32f3be['stat'](_0x12d30e[0x0]);if(_0x489c84[_0x26e57f(0x181)]())_0x5b98aa=_0x12d30e[0x0];else return console[_0x26e57f(0x2ab)](_0x26e57f(0x24f)+_0x12d30e[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x13ce62=_0x12d30e[0x0],_0x5b98aa='.';}}const _0x3710f2=_0x7dd93d['revision'],_0x15b3e4=_0x7dd93d[_0x26e57f(0x1b4)];_0x7dd93d[_0x26e57f(0x1f9)]&&(console[_0x26e57f(0x2ab)]('Project\x20directory:\x20'+_0x5b98aa),_0x13ce62&&console[_0x26e57f(0x2ab)](_0x26e57f(0x203)+_0x13ce62),_0x3710f2&&console[_0x26e57f(0x2ab)](_0x26e57f(0x257)+_0x3710f2),_0x15b3e4&&console[_0x26e57f(0x2ab)](_0x26e57f(0x139)));const _0x23a5a1=await withSpinner(_0x26e57f(0x128),()=>_0x5964ee[_0x26e57f(0x13e)]['push'](_0x5b98aa,{'projectName':_0x13ce62,'revision':_0x3710f2,'skipValidation':_0x15b3e4}),{'verbose':_0x7dd93d[_0x26e57f(0x1f9)]}),_0x269295=_0x23a5a1[_0x26e57f(0x1ab)];return console[_0x26e57f(0x2ab)](_0x26e57f(0x1ad)+_0x269295['projectName']),console['error'](_0x26e57f(0x278)+_0x269295[_0x26e57f(0x1fa)]),console['error']('\x20\x20Revision:\x20'+_0x269295[_0x26e57f(0x1aa)]),await this['showWorkflowConsoleUrl'](_0x5964ee,_0x269295[_0x26e57f(0x2d9)],_0x7dd93d['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x275);[a54_0x26a927(0x150)]=a54_0x26a927(0x279);async['execute'](_0x37f7cc){const _0x2beb50=a54_0x26a927,{options:_0x2325b5,args:_0xed2c7d,tdx:_0x25dc43}=_0x37f7cc,_0x5e096d=_0xed2c7d[0x0],_0x12eb41=_0xed2c7d[0x1];if(!_0x5e096d)return console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x224)](_0x2beb50(0x243)),_0x2beb50(0x182)),console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x17d)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x4fa961=_0x2325b5[_0x2beb50(0x1aa)];_0x2325b5['verbose']&&(console[_0x2beb50(0x2ab)](_0x2beb50(0x2d3)+_0x5e096d),_0x12eb41&&console[_0x2beb50(0x2ab)](_0x2beb50(0x25b)+_0x12eb41),_0x4fa961&&console[_0x2beb50(0x2ab)](_0x2beb50(0x257)+_0x4fa961),_0x2325b5[_0x2beb50(0x1db)]&&console[_0x2beb50(0x2ab)](_0x2beb50(0x14c)));const _0xad65f6=await withSpinner('Pulling\x20project\x20'+_0x5e096d+_0x2beb50(0x177),()=>_0x25dc43[_0x2beb50(0x13e)]['pullProject'](_0x5e096d,{'targetDir':_0x12eb41,'revision':_0x4fa961}),{'verbose':_0x2325b5[_0x2beb50(0x1f9)]}),_0x4638b2=_0xad65f6[_0x2beb50(0x1ab)];_0x4638b2[_0x2beb50(0x17c)]?console[_0x2beb50(0x2ab)](_0x2beb50(0x2a4)+_0x4638b2['projectName']):console[_0x2beb50(0x2ab)]('→\x20Project:\x20'+_0x4638b2[_0x2beb50(0x2d9)]);console[_0x2beb50(0x2ab)]('\x20\x20Revision:\x20'+_0x4638b2[_0x2beb50(0x1aa)]),console[_0x2beb50(0x2ab)](_0x2beb50(0x23e)+(a54_0x44d406['relative'](process['cwd'](),_0x4638b2[_0x2beb50(0x235)])||'.')),console[_0x2beb50(0x2ab)](_0x2beb50(0x2cd)+a54_0x1d1160[_0x2beb50(0x2bf)]('+'+_0x4638b2['summary'][_0x2beb50(0x1ef)]+_0x2beb50(0x298))+',\x20'+(a54_0x1d1160['yellow']('~'+_0x4638b2['summary'][_0x2beb50(0x129)]+_0x2beb50(0x127))+',\x20')+(a54_0x1d1160['red']('-'+_0x4638b2[_0x2beb50(0x263)][_0x2beb50(0x1e4)]+_0x2beb50(0x2c5))+',\x20')+(''+a54_0x1d1160[_0x2beb50(0x17d)](_0x4638b2[_0x2beb50(0x263)][_0x2beb50(0x20e)]+_0x2beb50(0x299))));for(const _0x260a60 of _0x4638b2[_0x2beb50(0x2a7)]){_0x260a60['type']===_0x2beb50(0x129)&&_0x260a60[_0x2beb50(0x200)]&&(console['error']('\x0a'+a54_0x1d1160['cyan'](_0x2beb50(0x157)+_0x260a60[_0x2beb50(0x11c)])),console[_0x2beb50(0x2ab)](_0x260a60['diff']));}if(!_0x4638b2[_0x2beb50(0x22a)])return saveSessionContext({'workflow_project':_0x4638b2[_0x2beb50(0x2d9)]},_0x2325b5[_0x2beb50(0x22c)]),console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x2bf)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x17d)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4638b2[_0x2beb50(0x2d9)])),0x0;if(_0x2325b5[_0x2beb50(0x1db)])return console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x242)](_0x2beb50(0x1a3))),0x0;if(!_0x2325b5['yes']){if(!isInteractive())return console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x224)](_0x2beb50(0x1d7)),_0x2beb50(0x189)),console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x17d)](_0x2beb50(0x18f))),0x1;const _0x291677=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x291677)return console[_0x2beb50(0x2ab)](a54_0x1d1160[_0x2beb50(0x242)](_0x2beb50(0x1ba)),_0x2beb50(0x1ca)),0x1;}await withSpinner(_0x2beb50(0x12a),()=>_0x25dc43[_0x2beb50(0x13e)]['applyPullProject'](_0x4638b2,{'revision':_0x4fa961}),{'verbose':_0x2325b5[_0x2beb50(0x1f9)]}),saveSessionContext({'workflow_project':_0x4638b2['projectName']},_0x2325b5[_0x2beb50(0x22c)]),console[_0x2beb50(0x2ab)](a54_0x1d1160['green'](_0x2beb50(0x23f)));const _0x5b57de=a54_0x44d406[_0x2beb50(0x197)](process[_0x2beb50(0x20b)](),_0x4638b2[_0x2beb50(0x235)])||'.';return console[_0x2beb50(0x2ab)](a54_0x1d1160['dim'](_0x2beb50(0x179)+_0x5b57de)),console[_0x2beb50(0x2ab)](a54_0x1d1160['dim'](_0x2beb50(0x1a9)+_0x4638b2[_0x2beb50(0x2d9)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1c5);['description']=a54_0x26a927(0x1a5);async['execute'](_0x26c62e){const _0x1d1c08=a54_0x26a927,{options:_0x536d64,args:_0x2f93d0,tdx:_0x13ba73}=_0x26c62e,_0xce4b00=this[_0x1d1c08(0x1bf)](_0x2f93d0,_0x536d64),_0x460194=_0x536d64[_0x1d1c08(0x1aa)],_0x535fa9=_0x536d64[_0x1d1c08(0x1b4)];_0x536d64['verbose']&&(_0xce4b00&&console[_0x1d1c08(0x2ab)](_0x1d1c08(0x211)+_0xce4b00),_0x460194&&console['error'](_0x1d1c08(0x257)+_0x460194),_0x536d64[_0x1d1c08(0x1db)]&&console[_0x1d1c08(0x2ab)](_0x1d1c08(0x14c)),_0x535fa9&&console['error'](_0x1d1c08(0x139)));let _0x1a9262;try{_0x1a9262=await withSpinner(_0x1d1c08(0x2b4),()=>_0x13ba73['workflow'][_0x1d1c08(0x267)]({'sourceDir':_0xce4b00,'revision':_0x460194,'skipValidation':_0x535fa9}),{'verbose':_0x536d64[_0x1d1c08(0x1f9)]});}catch(_0x152b2d){if(_0x152b2d instanceof Error&&_0x152b2d[_0x1d1c08(0x2c4)]['includes'](_0x1d1c08(0x1c2)))return console[_0x1d1c08(0x2ab)](a54_0x1d1160[_0x1d1c08(0x224)](_0x1d1c08(0x243)),_0x1d1c08(0x236)),_0x536d64[_0x1d1c08(0x21d)]?console[_0x1d1c08(0x2ab)](a54_0x1d1160[_0x1d1c08(0x17d)](_0x1d1c08(0x225)+_0x536d64[_0x1d1c08(0x21d)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x536d64[_0x1d1c08(0x21d)]+'\x27')):console[_0x1d1c08(0x2ab)](a54_0x1d1160[_0x1d1c08(0x17d)](_0x1d1c08(0x158))),0x1;throw _0x152b2d;}const _0x184db6=_0x1a9262[_0x1d1c08(0x1ab)];console[_0x1d1c08(0x2ab)](_0x1d1c08(0x1d5)+_0x184db6[_0x1d1c08(0x2d9)]),console['error']('\x20\x20Source:\x20'+_0x184db6[_0x1d1c08(0x17e)]),console[_0x1d1c08(0x2ab)](_0x1d1c08(0x1ec)+_0x184db6[_0x1d1c08(0x1aa)]),console[_0x1d1c08(0x2ab)](_0x1d1c08(0x2cd)+a54_0x1d1160[_0x1d1c08(0x2bf)]('+'+_0x184db6[_0x1d1c08(0x263)][_0x1d1c08(0x1ef)]+_0x1d1c08(0x298))+',\x20'+(a54_0x1d1160['yellow']('~'+_0x184db6['summary'][_0x1d1c08(0x129)]+_0x1d1c08(0x127))+',\x20')+(a54_0x1d1160[_0x1d1c08(0x224)]('-'+_0x184db6[_0x1d1c08(0x263)][_0x1d1c08(0x1e4)]+_0x1d1c08(0x2c5))+',\x20')+(''+a54_0x1d1160['dim'](_0x184db6[_0x1d1c08(0x263)]['unchanged']+_0x1d1c08(0x299))));for(const _0x25097b of _0x184db6[_0x1d1c08(0x2a7)]){_0x25097b[_0x1d1c08(0x280)]==='modified'&&_0x25097b[_0x1d1c08(0x200)]&&(console[_0x1d1c08(0x2ab)]('\x0a'+a54_0x1d1160[_0x1d1c08(0x281)](_0x1d1c08(0x157)+_0x25097b[_0x1d1c08(0x11c)])),console[_0x1d1c08(0x2ab)](_0x25097b[_0x1d1c08(0x200)]));}if(!_0x184db6[_0x1d1c08(0x22a)])return console[_0x1d1c08(0x2ab)](a54_0x1d1160[_0x1d1c08(0x2bf)](_0x1d1c08(0x125))),await this[_0x1d1c08(0x162)](_0x13ba73,_0x184db6[_0x1d1c08(0x2d9)],_0x536d64[_0x1d1c08(0x184)]),0x0;if(_0x536d64['dryRun'])return console['error'](a54_0x1d1160['yellow'](_0x1d1c08(0x205))),0x0;if(!_0x536d64[_0x1d1c08(0x206)]){if(!isInteractive())return console[_0x1d1c08(0x2ab)](a54_0x1d1160['red']('\x0aError:'),_0x1d1c08(0x189)),console['error'](a54_0x1d1160['dim'](_0x1d1c08(0x18f))),0x1;const _0x585aa4=await confirmKey(_0x1d1c08(0x23c));if(!_0x585aa4)return console[_0x1d1c08(0x2ab)](a54_0x1d1160[_0x1d1c08(0x242)](_0x1d1c08(0x1ba)),_0x1d1c08(0x228)),0x1;}const _0x1a17fe=await withSpinner(_0x1d1c08(0x18a),()=>_0x13ba73[_0x1d1c08(0x13e)][_0x1d1c08(0x159)](_0x184db6),{'verbose':_0x536d64[_0x1d1c08(0x1f9)]}),_0x185c45=_0x1a17fe['data'];return console['error'](a54_0x1d1160[_0x1d1c08(0x2bf)](_0x1d1c08(0x175))),console[_0x1d1c08(0x2ab)](_0x1d1c08(0x278)+_0x185c45[_0x1d1c08(0x1fa)]),console['error']('\x20\x20Revision:\x20'+_0x185c45[_0x1d1c08(0x1aa)]),await this[_0x1d1c08(0x162)](_0x13ba73,_0x185c45[_0x1d1c08(0x2d9)],_0x536d64['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x26a927(0x292);[a54_0x26a927(0x150)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x44965e){const _0x7e49f0=a54_0x26a927,{options:_0x5ba71b,args:_0xf9c905,tdx:_0x4d7b9d}=_0x44965e,_0x5a7bc5=this['resolveProjectDir'](_0xf9c905,_0x5ba71b),_0x1c09b7=_0x5ba71b[_0x7e49f0(0x296)],_0x1a8ebe=_0x5ba71b['revision'],_0x46ddbc=_0x5ba71b[_0x7e49f0(0x1b4)];if(!_0x5a7bc5)return console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x224)](_0x7e49f0(0x243)),_0x7e49f0(0x28d)),console['error'](a54_0x1d1160[_0x7e49f0(0x17d)](_0x7e49f0(0x124))),console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x17d)](_0x7e49f0(0x186))),0x1;if(!_0x1c09b7)return console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x224)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x7e49f0(0x2ab)](a54_0x1d1160['dim'](_0x7e49f0(0x124))),0x1;_0x5ba71b[_0x7e49f0(0x1f9)]&&(console[_0x7e49f0(0x2ab)]('Source\x20directory:\x20'+_0x5a7bc5),console[_0x7e49f0(0x2ab)](_0x7e49f0(0x1c1)+_0x1c09b7),_0x1a8ebe&&console[_0x7e49f0(0x2ab)](_0x7e49f0(0x257)+_0x1a8ebe),_0x5ba71b[_0x7e49f0(0x1db)]&&console[_0x7e49f0(0x2ab)](_0x7e49f0(0x14c)),_0x46ddbc&&console['error'](_0x7e49f0(0x139)));const _0x4d8247=await withSpinner(_0x7e49f0(0x19b),()=>_0x4d7b9d[_0x7e49f0(0x13e)][_0x7e49f0(0x1f2)](_0x5a7bc5,_0x1c09b7,{'revision':_0x1a8ebe,'skipValidation':_0x46ddbc}),{'verbose':_0x5ba71b[_0x7e49f0(0x1f9)]}),_0x34d049=_0x4d8247[_0x7e49f0(0x1ab)];console[_0x7e49f0(0x2ab)](_0x7e49f0(0x1e5)+_0x34d049['sourceDir']);_0x34d049[_0x7e49f0(0x214)]&&console[_0x7e49f0(0x2ab)]('Source\x20project:\x20'+_0x34d049[_0x7e49f0(0x214)]);console['error']('New\x20project\x20name:\x20'+_0x34d049[_0x7e49f0(0x1c9)]),console[_0x7e49f0(0x2ab)]('Revision:\x20'+_0x34d049[_0x7e49f0(0x1aa)]),console[_0x7e49f0(0x2ab)](_0x7e49f0(0x130)+_0x34d049[_0x7e49f0(0x16d)]);_0x34d049[_0x7e49f0(0x12b)]&&(console['error'](a54_0x1d1160[_0x7e49f0(0x242)](_0x7e49f0(0x174)+_0x34d049[_0x7e49f0(0x1c9)]+_0x7e49f0(0x232)+_0x34d049[_0x7e49f0(0x284)]+')')),console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x242)](_0x7e49f0(0x17a))));if(_0x5ba71b[_0x7e49f0(0x1db)])return console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x242)](_0x7e49f0(0x23b))),0x0;if(!_0x5ba71b['yes']){if(!isInteractive())return console[_0x7e49f0(0x2ab)](a54_0x1d1160['red'](_0x7e49f0(0x1d7)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x17d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5d868f=_0x34d049['sourceProjectName']||a54_0x44d406[_0x7e49f0(0x25e)](_0x5a7bc5),_0x8a154e=_0x34d049[_0x7e49f0(0x12b)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1c09b7+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x5d868f+'\x22\x20to\x20new\x20project\x20\x22'+_0x1c09b7+'\x22?',_0x3516f0=await confirmKey(_0x8a154e);if(!_0x3516f0)return console['error'](a54_0x1d1160['yellow'](_0x7e49f0(0x1ba))),0x1;}const _0x5bb403=await withSpinner(_0x34d049[_0x7e49f0(0x12b)]?'Updating\x20'+_0x1c09b7+_0x7e49f0(0x177):_0x7e49f0(0x2af)+_0x1c09b7+_0x7e49f0(0x177),()=>_0x4d7b9d['workflow'][_0x7e49f0(0x20a)](_0x34d049),{'verbose':_0x5ba71b['verbose']}),_0x1e137b=_0x5bb403['data'];return console[_0x7e49f0(0x2ab)](a54_0x1d1160[_0x7e49f0(0x2bf)](_0x34d049['targetExists']?'✔\x20Project\x20updated':_0x7e49f0(0x1ea))),console['error'](_0x7e49f0(0x210)+_0x1e137b[_0x7e49f0(0x1c9)]),console[_0x7e49f0(0x2ab)](_0x7e49f0(0x278)+_0x1e137b[_0x7e49f0(0x1c6)]),console[_0x7e49f0(0x2ab)](_0x7e49f0(0x1ec)+_0x1e137b[_0x7e49f0(0x1aa)]),await this['showWorkflowConsoleUrl'](_0x4d7b9d,_0x1e137b['newProjectName'],_0x5ba71b[_0x7e49f0(0x184)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x29d);[a54_0x26a927(0x150)]=a54_0x26a927(0x239);async[a54_0x26a927(0x1a6)](_0x2a5a61){const _0x15a24e=a54_0x26a927,{options:_0x522334,args:_0x4c2edf,tdx:_0xf757bb}=_0x2a5a61,_0x3ac9ab=_0x4c2edf[0x0];if(!_0x3ac9ab)return console[_0x15a24e(0x2ab)](_0x15a24e(0x1e2)),console[_0x15a24e(0x2ab)](_0x15a24e(0x137)),0x1;_0x522334[_0x15a24e(0x1f9)]&&console[_0x15a24e(0x2ab)](_0x15a24e(0x2d3)+_0x3ac9ab);if(!_0x522334[_0x15a24e(0x206)]){if(!isInteractive())return console[_0x15a24e(0x2ab)](a54_0x1d1160[_0x15a24e(0x224)]('\x0aError:'),_0x15a24e(0x189)),console[_0x15a24e(0x2ab)](a54_0x1d1160[_0x15a24e(0x17d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3d17ee=await confirmKey(_0x15a24e(0x27f)+_0x3ac9ab+_0x15a24e(0x161));if(!_0x3d17ee)return console['error'](a54_0x1d1160[_0x15a24e(0x242)](_0x15a24e(0x1ba))),0x1;}const _0x184e03=await withSpinner('Deleting\x20project\x20'+_0x3ac9ab+'...',()=>_0xf757bb[_0x15a24e(0x13e)][_0x15a24e(0x185)](_0x3ac9ab),{'verbose':_0x522334[_0x15a24e(0x1f9)]}),_0x3d5d1c=_0x184e03[_0x15a24e(0x1ab)];return console['error'](_0x15a24e(0x2dc)+_0x3d5d1c[_0x15a24e(0x2d9)]),console['error'](_0x15a24e(0x278)+_0x3d5d1c[_0x15a24e(0x1fa)]),0x0;}}export function parseKeyValue(_0x4033b7){const _0x388a82=a54_0x26a927,_0x3a349f=_0x4033b7[_0x388a82(0x1f1)]('=');if(_0x3a349f===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4033b7+_0x388a82(0x1c8));const _0xeade16=_0x4033b7[_0x388a82(0x17f)](0x0,_0x3a349f),_0xd75de0=_0x4033b7[_0x388a82(0x17f)](_0x3a349f+0x1);if(!_0xeade16)throw new Error(_0x388a82(0x234));return{'key':_0xeade16,'value':_0xd75de0};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]='workflow:secrets:list';[a54_0x26a927(0x150)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x26a927(0x1a6)](_0xc1b29f){const _0x44bd9c=a54_0x26a927,{options:_0x3282ed,args:_0x33b9b5,tdx:_0x59cd66}=_0xc1b29f,_0x590db4=this[_0x44bd9c(0x2ce)](_0x33b9b5,_0x3282ed);if(!_0x590db4)return 0x1;_0x3282ed[_0x44bd9c(0x1f9)]&&console[_0x44bd9c(0x2ab)]('Project:\x20'+_0x590db4);const _0x4c5719=await withSpinner(_0x44bd9c(0x136),()=>_0x59cd66[_0x44bd9c(0x13e)][_0x44bd9c(0x148)](_0x590db4),{'verbose':_0x3282ed['verbose']}),{secrets:_0x536b48}=_0x4c5719[_0x44bd9c(0x1ab)];return console['error'](_0x44bd9c(0x11f)+_0x536b48[_0x44bd9c(0x294)]+_0x44bd9c(0x220)+(_0x536b48[_0x44bd9c(0x294)]!==0x1?'s':'')),await handleSDKOutput(_0x536b48,_0x3282ed),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]='workflow:secrets:set';[a54_0x26a927(0x150)]=a54_0x26a927(0x2b5);async['execute'](_0x542aeb){const _0xedc09f=a54_0x26a927,{options:_0x4a2655,args:_0x5d27fc,tdx:_0x28617b}=_0x542aeb;let _0x3364e7,_0x10b78a;if(_0x5d27fc[_0xedc09f(0x294)]>=0x1&&!_0x5d27fc[0x0][_0xedc09f(0x2bd)]('='))_0x3364e7=_0x5d27fc[0x0],_0x10b78a=_0x5d27fc[_0xedc09f(0x1e0)](0x1);else{if(_0x5d27fc['length']>=0x1&&_0x4a2655['workflowProject'])_0x3364e7=_0x4a2655['workflowProject'],_0x10b78a=_0x5d27fc;else return _0x5d27fc[_0xedc09f(0x294)]>=0x1?(console[_0xedc09f(0x2ab)](_0xedc09f(0x265)),console['error'](_0xedc09f(0x253)),0x1):(console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0xedc09f(0x2ab)](_0xedc09f(0x156)),0x1);}if(_0x10b78a[_0xedc09f(0x294)]===0x0)return console[_0xedc09f(0x2ab)](_0xedc09f(0x142)),console['error'](_0xedc09f(0x156)),0x1;const _0x528599={};try{for(const _0x304dae of _0x10b78a){const {key:_0x693949,value:_0x574340}=parseKeyValue(_0x304dae);_0x528599[_0x693949]=_0x574340;}}catch(_0x24e9f0){return _0x24e9f0 instanceof Error&&console[_0xedc09f(0x2ab)](a54_0x1d1160[_0xedc09f(0x224)]('Error:'),_0x24e9f0[_0xedc09f(0x2c4)]),0x1;}const _0x588866=Object[_0xedc09f(0x295)](_0x528599);_0x4a2655[_0xedc09f(0x1f9)]&&(console[_0xedc09f(0x2ab)](_0xedc09f(0x2d3)+_0x3364e7),console[_0xedc09f(0x2ab)](_0xedc09f(0x1b1)+_0x588866[_0xedc09f(0x240)](',\x20')));const _0x3dae7a=await withSpinner(_0x588866['length']===0x1?_0xedc09f(0x226):'Setting\x20'+_0x588866[_0xedc09f(0x294)]+_0xedc09f(0x2d2),()=>_0x28617b[_0xedc09f(0x13e)][_0xedc09f(0x1dd)](_0x3364e7,_0x528599),{'verbose':_0x4a2655[_0xedc09f(0x1f9)]}),_0xdbc3d1=_0x3dae7a[_0xedc09f(0x1ab)];return console[_0xedc09f(0x2ab)](_0x588866['length']===0x1?_0xedc09f(0x2db)+_0xdbc3d1[_0xedc09f(0x295)][0x0]+_0xedc09f(0x268)+_0xdbc3d1['projectName']+'\x27':'✔\x20'+_0xdbc3d1[_0xedc09f(0x295)][_0xedc09f(0x294)]+_0xedc09f(0x151)+_0xdbc3d1['projectName']+'\x27'),(_0x4a2655[_0xedc09f(0x208)]||_0x4a2655[_0xedc09f(0x25c)])&&await handleSingleObjectOutput(_0xdbc3d1,_0x4a2655),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x26a927(0x21c);['description']=a54_0x26a927(0x231);async[a54_0x26a927(0x1a6)](_0x405d45){const _0x27415f=a54_0x26a927,{options:_0x56cb33,args:_0x5db4b9,tdx:_0x39d7c7}=_0x405d45;let _0x2f2303,_0x16aa40;if(_0x5db4b9['length']>=0x2)_0x2f2303=_0x5db4b9[0x0],_0x16aa40=_0x5db4b9[0x1];else{if(_0x5db4b9['length']===0x1&&_0x56cb33[_0x27415f(0x21d)])_0x2f2303=_0x56cb33['workflowProject'],_0x16aa40=_0x5db4b9[0x0];else return _0x5db4b9[_0x27415f(0x294)]===0x1?(console['error'](_0x27415f(0x265)),console[_0x27415f(0x2ab)](_0x27415f(0x253)),0x1):(console['error'](_0x27415f(0x288)),console[_0x27415f(0x2ab)](_0x27415f(0x134)),0x1);}_0x56cb33[_0x27415f(0x1f9)]&&(console[_0x27415f(0x2ab)](_0x27415f(0x2d3)+_0x2f2303),console[_0x27415f(0x2ab)](_0x27415f(0x1fe)+_0x16aa40));if(!_0x56cb33['yes']){if(!isInteractive())return console[_0x27415f(0x2ab)](a54_0x1d1160[_0x27415f(0x224)]('\x0aError:'),_0x27415f(0x189)),console[_0x27415f(0x2ab)](a54_0x1d1160['dim'](_0x27415f(0x18f))),0x1;const _0x3e3c6a=await confirmKey(_0x27415f(0x25a)+_0x16aa40+_0x27415f(0x120)+_0x2f2303+'\x27?');if(!_0x3e3c6a)return console[_0x27415f(0x2ab)](a54_0x1d1160[_0x27415f(0x242)](_0x27415f(0x1ba))),0x1;}const _0x249f8b=await withSpinner(_0x27415f(0x1b6),()=>_0x39d7c7['workflow']['deleteSecret'](_0x2f2303,_0x16aa40),{'verbose':_0x56cb33['verbose']}),_0x508741=_0x249f8b[_0x27415f(0x1ab)];return console['error']('✔\x20Secret\x20\x27'+_0x508741[_0x27415f(0x153)]+_0x27415f(0x1d4)+_0x508741['projectName']+'\x27'),(_0x56cb33[_0x27415f(0x208)]||_0x56cb33['jsonl'])&&await handleSingleObjectOutput(_0x508741,_0x56cb33),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(_0x3ab133){const _0x206df7=a54_0x26a927,_0x511dde=Math[_0x206df7(0x290)](_0x3ab133/0x3e8),_0x43f341=Math[_0x206df7(0x290)](_0x511dde/0x3c),_0x596d08=Math[_0x206df7(0x290)](_0x43f341/0x3c),_0xd4ec64=Math[_0x206df7(0x290)](_0x596d08/0x18);if(_0xd4ec64>0x0){const _0x2bb7fc=_0x596d08%0x18;return _0x2bb7fc>0x0?_0xd4ec64+'d\x20'+_0x2bb7fc+'h':_0xd4ec64+'d';}else{if(_0x596d08>0x0){const _0x1dce12=_0x43f341%0x3c;return _0x1dce12>0x0?_0x596d08+'h\x20'+_0x1dce12+'m':_0x596d08+'h';}else{if(_0x43f341>0x0){const _0x258be6=_0x511dde%0x3c;return _0x258be6>0x0?_0x43f341+'m\x20'+_0x258be6+'s':_0x43f341+'m';}else return _0x511dde+'s';}}}function formatTimestamp(_0x598302,_0x371502){const _0x423051=a54_0x26a927,_0x2442b2=new Date(_0x598302),_0x4d9e13=String(_0x2442b2[_0x423051(0x28c)]())[_0x423051(0x13c)](0x2,'0'),_0x27b696=String(_0x2442b2[_0x423051(0x237)]())[_0x423051(0x13c)](0x2,'0'),_0x389bd4=_0x4d9e13+':'+_0x27b696,_0x4c47fe=_0x2442b2['getFullYear']()===_0x371502[_0x423051(0x121)]()&&_0x2442b2['getMonth']()===_0x371502[_0x423051(0x168)]()&&_0x2442b2[_0x423051(0x270)]()===_0x371502[_0x423051(0x270)]();if(_0x4c47fe)return _0x389bd4;else{const _0x3daf0a=String(_0x2442b2[_0x423051(0x168)]()+0x1)['padStart'](0x2,'0'),_0x5c3752=String(_0x2442b2[_0x423051(0x270)]())['padStart'](0x2,'0');return _0x3daf0a+'-'+_0x5c3752+'\x20'+_0x389bd4;}}function formatDate(_0x3d758d){const _0x5dc64c=a54_0x26a927,_0x184fbf=_0x3d758d['getFullYear'](),_0xb98c42=String(_0x3d758d[_0x5dc64c(0x168)]()+0x1)[_0x5dc64c(0x13c)](0x2,'0'),_0x9975ab=String(_0x3d758d[_0x5dc64c(0x270)]())[_0x5dc64c(0x13c)](0x2,'0');return _0x184fbf+'-'+_0xb98c42+'-'+_0x9975ab;}function getTaskStateIcon(_0x53dec7){const _0xea618b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0xea618b[_0x53dec7]||'⚪';}function getBarChar(_0x56879d){const _0x2525ca=a54_0x26a927;return _0x56879d===_0x2525ca(0x2ab)||_0x56879d===_0x2525ca(0x27e)?'×':'─';}function getBarColor(_0x162ec6){const _0x4adf86=a54_0x26a927,_0x18a6c8={'success':a54_0x1d1160[_0x4adf86(0x2bf)],'error':a54_0x1d1160[_0x4adf86(0x224)],'group_error':a54_0x1d1160[_0x4adf86(0x224)],'running':a54_0x1d1160[_0x4adf86(0x286)],'blocked':a54_0x1d1160['yellow'],'planned':a54_0x1d1160[_0x4adf86(0x17d)],'canceling':a54_0x1d1160['yellow']};return _0x18a6c8[_0x162ec6]||a54_0x1d1160[_0x4adf86(0x297)];}function parseTaskName(_0x6727db){const _0x218602=a54_0x26a927;let _0x1f5c5d=_0x6727db[_0x218602(0x1a1)](/^\++/,'');const _0x1c0f25=_0x1f5c5d['split']('+'),_0x5b18bd=_0x1c0f25[_0x218602(0x294)]>0x1?_0x1c0f25[_0x218602(0x294)]-0x2:0x0,_0x2235c0=_0x1c0f25[_0x1c0f25[_0x218602(0x294)]-0x1]||_0x1f5c5d;return{'level':_0x5b18bd,'name':'+'+_0x2235c0};}function truncateTaskName(_0x857670,_0x554c24){const _0x1d73c9=a54_0x26a927,_0x15e500=stringWidth(_0x857670);if(_0x15e500<=_0x554c24)return _0x857670;let _0x3c01d4=_0x857670;while(stringWidth(_0x3c01d4+'…')>_0x554c24&&_0x3c01d4[_0x1d73c9(0x294)]>0x0){_0x3c01d4=_0x3c01d4['slice'](0x0,-0x1);}return _0x3c01d4+'…';}function calculateTimeScale(_0x3af2c7,_0x4ff0fb){const _0x23d481=a54_0x26a927;return{'startTime':_0x3af2c7['start'],'endTime':_0x3af2c7[_0x23d481(0x20c)],'durationMs':_0x3af2c7['duration'],'msPerChar':_0x3af2c7[_0x23d481(0x2c3)]/_0x4ff0fb};}function timeToPosition(_0x5662ab,_0x57693b,_0x178a08){const _0x1cb50a=a54_0x26a927,_0x505775=_0x5662ab-_0x57693b[_0x1cb50a(0x1e7)],_0x2c2a0a=Math[_0x1cb50a(0x290)](_0x505775/_0x57693b[_0x1cb50a(0x192)]);return Math['max'](0x0,Math[_0x1cb50a(0x277)](_0x2c2a0a,_0x178a08));}function renderTimeAxis(_0xec6688,_0x53e4fa){const _0x57033c=a54_0x26a927,_0x441fed=Math['min'](TIMELINE_CONFIG[_0x57033c(0x1e9)],Math[_0x57033c(0x29c)](TIMELINE_CONFIG[_0x57033c(0x2b2)],Math[_0x57033c(0x290)](_0x53e4fa/TIMELINE_CONFIG[_0x57033c(0x122)]))),_0x4e9f17=_0xec6688[_0x57033c(0x251)]/(_0x441fed-0x1),_0x458a04=new Date(_0xec6688[_0x57033c(0x1e7)]),_0x1fd068=[];for(let _0x46aed1=0x0;_0x46aed1<_0x441fed;_0x46aed1++){const _0x5024a4=_0xec6688['startTime']+_0x46aed1*_0x4e9f17,_0x30d785=timeToPosition(_0x5024a4,_0xec6688,_0x53e4fa),_0x393204=formatTimestamp(_0x5024a4,_0x458a04);_0x1fd068[_0x57033c(0x1f4)]({'pos':_0x30d785,'text':_0x393204});}const _0x250339=new Array(_0x53e4fa)[_0x57033c(0x2d8)]('\x20');let _0x2c64d7=-0x1;for(const {pos:_0x214e7e,text:_0x6ffccf}of _0x1fd068){let _0x1d160e=Math[_0x57033c(0x29c)](0x0,_0x214e7e-Math[_0x57033c(0x290)](_0x6ffccf[_0x57033c(0x294)]/0x2));_0x1d160e<=_0x2c64d7+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x1d160e=_0x2c64d7+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x1d160e+_0x6ffccf['length']>_0x53e4fa&&(_0x1d160e=_0x53e4fa-_0x6ffccf['length']);if(_0x1d160e>=0x0&&_0x1d160e+_0x6ffccf[_0x57033c(0x294)]<=_0x53e4fa&&_0x1d160e>_0x2c64d7){for(let _0x444dd0=0x0;_0x444dd0<_0x6ffccf[_0x57033c(0x294)];_0x444dd0++){_0x250339[_0x1d160e+_0x444dd0]=_0x6ffccf[_0x444dd0];}_0x2c64d7=_0x1d160e+_0x6ffccf[_0x57033c(0x294)]-0x1;}}return _0x250339[_0x57033c(0x240)]('');}function renderTaskRow(_0x111db6,_0x7d3b1,_0x2063e6,_0x288574){const _0x189810=a54_0x26a927,{level:_0x71594d,name:_0x566547}=parseTaskName(_0x111db6[_0x189810(0x296)]),_0x5c4c49='\x20'[_0x189810(0x1de)](_0x71594d),_0x303524=_0x111db6[_0x189810(0x223)]?'('+formatElapsed(_0x111db6['window'][_0x189810(0x2c3)])+')':'',_0x45c8b9=stringWidth(_0x303524),_0xdc9f39=_0x71594d*0x1,_0x1c2b65=_0x288574-_0xdc9f39-_0x45c8b9-0x1,_0x273f3a=truncateTaskName(_0x566547,_0x1c2b65),_0x3c1672=_0x5c4c49+_0x273f3a,_0x922260=stringWidth(_0x3c1672),_0x397ab0=_0x288574-_0x922260-_0x45c8b9,_0x14e2c5=_0x3c1672+'\x20'[_0x189810(0x1de)](Math[_0x189810(0x29c)](0x1,_0x397ab0))+a54_0x1d1160[_0x189810(0x17d)](_0x303524),_0x2db2f4=getTaskStateIcon(_0x111db6[_0x189810(0x13d)]),_0x85475f=new Array(_0x2063e6)[_0x189810(0x2d8)]('\x20');if(_0x111db6[_0x189810(0x223)]){const _0x3e2abf=timeToPosition(_0x111db6[_0x189810(0x223)][_0x189810(0x126)],_0x7d3b1,_0x2063e6),_0x4e2aaf=timeToPosition(_0x111db6[_0x189810(0x223)][_0x189810(0x20c)],_0x7d3b1,_0x2063e6),_0x5573fd=getBarChar(_0x111db6[_0x189810(0x13d)]),_0x205ac7=Math[_0x189810(0x29c)](_0x3e2abf+0x1,_0x4e2aaf);for(let _0x38e43e=_0x3e2abf;_0x38e43e<Math[_0x189810(0x277)](_0x205ac7,_0x2063e6);_0x38e43e++){_0x85475f[_0x38e43e]=_0x5573fd;}}const _0x3608d2=getBarColor(_0x111db6['state']),_0x4d9fdf=_0x85475f[_0x189810(0x12e)](_0x741536=>_0x741536==='\x20'?'\x20':_0x3608d2(_0x741536))[_0x189810(0x240)]('');return _0x2db2f4+'\x20'+_0x14e2c5+'│'+_0x4d9fdf+'│';}function calculateStats(_0x4195da){const _0x303a19=a54_0x26a927,_0x1dcaf2={'total':_0x4195da[_0x303a19(0x294)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x36d6cb of _0x4195da){if(_0x36d6cb['state']==='success')_0x1dcaf2[_0x303a19(0x173)]++;else{if(_0x36d6cb[_0x303a19(0x13d)]===_0x303a19(0x2ab)||_0x36d6cb[_0x303a19(0x13d)]===_0x303a19(0x27e))_0x1dcaf2[_0x303a19(0x2ab)]++;else _0x36d6cb['state']===_0x303a19(0x2c6)?_0x1dcaf2[_0x303a19(0x2c6)]++:_0x1dcaf2[_0x303a19(0x16a)]++;}}return _0x1dcaf2;}function formatStats(_0x5315a8){const _0x4082fc=a54_0x26a927;return[_0x4082fc(0x1af)+_0x5315a8[_0x4082fc(0x282)],'✅\x20'+_0x5315a8[_0x4082fc(0x173)],'❌\x20'+_0x5315a8[_0x4082fc(0x2ab)],_0x4082fc(0x17b)+_0x5315a8[_0x4082fc(0x2c6)],'⏳\x20'+_0x5315a8[_0x4082fc(0x16a)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x26a927(0x296)]='workflow:timeline';[a54_0x26a927(0x150)]=a54_0x26a927(0x2a2);async[a54_0x26a927(0x1a6)](_0x31f57b){const _0x2dd624=a54_0x26a927,{options:_0x27a681,args:_0x2aeeaf,tdx:_0x2d9115}=_0x31f57b;let _0x5e9146,_0x40fe00,_0x3e6e9a=![];if(_0x2aeeaf[0x0]){if(_0x2aeeaf[0x0][_0x2dd624(0x2bd)]('.')){const _0x13d618=this[_0x2dd624(0x2c1)](_0x2aeeaf,_0x27a681);if(!_0x13d618)return 0x1;_0x5e9146=_0x13d618[_0x2dd624(0x2d9)],_0x40fe00=_0x13d618[_0x2dd624(0x29b)];}else{_0x40fe00=_0x2aeeaf[0x0],_0x5e9146=_0x27a681['workflowProject'];if(!_0x5e9146)return console[_0x2dd624(0x2ab)](a54_0x1d1160[_0x2dd624(0x224)](_0x2dd624(0x243)),_0x2dd624(0x1e1)),0x1;_0x3e6e9a=!![];}}else{const _0x520076=this[_0x2dd624(0x2c1)](_0x2aeeaf,_0x27a681);if(!_0x520076)return 0x1;_0x5e9146=_0x520076[_0x2dd624(0x2d9)],_0x40fe00=_0x520076['workflowName'];}if(_0x27a681['verbose']){if(_0x5e9146&&_0x40fe00)console['error'](_0x2dd624(0x227)+_0x5e9146+'.'+_0x40fe00);else _0x5e9146&&console['error'](_0x2dd624(0x1b9)+_0x5e9146);}const _0x18f458=_0x27a681['attemptId'],_0x45a1f5=_0x27a681[_0x2dd624(0x202)];if(_0x18f458){_0x45a1f5&&console[_0x2dd624(0x2ab)](a54_0x1d1160[_0x2dd624(0x242)]('Warning:'),_0x2dd624(0x24e));const _0x552e13=_0x27a681[_0x2dd624(0x1a4)];return _0x552e13?await this['pollTimeline'](_0x31f57b,_0x18f458):await this['renderSingleTimeline'](_0x31f57b,_0x18f458,_0x27a681),0x0;}if(_0x45a1f5){const _0x3f6481=await withSpinner(_0x2dd624(0x1b7),()=>_0x2d9115[_0x2dd624(0x13e)][_0x2dd624(0x165)]({'projectName':_0x5e9146,'workflowName':_0x40fe00,'limit':0x64}),{'verbose':_0x27a681[_0x2dd624(0x1f9)]}),_0x1e0bf9=_0x3f6481[_0x2dd624(0x1ab)][_0x2dd624(0x143)](_0x26dcb2=>_0x26dcb2['id']===_0x45a1f5);if(!_0x1e0bf9)return console[_0x2dd624(0x2ab)](a54_0x1d1160[_0x2dd624(0x224)](_0x2dd624(0x243)),_0x2dd624(0x2d4)+_0x45a1f5),0x1;if(!_0x1e0bf9[_0x2dd624(0x283)]?.['id'])return console[_0x2dd624(0x2ab)](a54_0x1d1160[_0x2dd624(0x224)](_0x2dd624(0x243)),_0x2dd624(0x180)+_0x45a1f5+'\x20has\x20no\x20attempts'),0x1;const _0x482592=_0x1e0bf9['lastAttempt']['id'];_0x27a681[_0x2dd624(0x1f9)]&&console[_0x2dd624(0x2ab)]('Using\x20attempt\x20'+_0x482592+_0x2dd624(0x19e)+_0x45a1f5);const _0x5daec6=_0x27a681[_0x2dd624(0x1a4)];return _0x5daec6?await this[_0x2dd624(0x131)](_0x31f57b,_0x482592):await this[_0x2dd624(0x1e3)](_0x31f57b,_0x482592,_0x27a681),0x0;}const _0x54c5d6=await withSpinner(_0x2dd624(0x221),()=>_0x2d9115['workflow'][_0x2dd624(0x165)]({'projectName':_0x5e9146,'workflowName':_0x40fe00,'limit':_0x27a681[_0x2dd624(0x1bb)]||0x32}),{'verbose':_0x27a681[_0x2dd624(0x1f9)]}),_0x504637=_0x54c5d6['data'];if(_0x504637[_0x2dd624(0x294)]===0x0){if(_0x5e9146&&_0x40fe00)console[_0x2dd624(0x2ab)](_0x2dd624(0x195)+_0x5e9146+'.'+_0x40fe00);else _0x5e9146?console[_0x2dd624(0x2ab)](_0x2dd624(0x16e)+_0x5e9146):(console[_0x2dd624(0x2ab)]('No\x20workflow\x20sessions\x20found'),console[_0x2dd624(0x2ab)](a54_0x1d1160[_0x2dd624(0x17d)](_0x2dd624(0x28b))));return 0x0;}_0x504637[_0x2dd624(0x1d0)]((_0x57d7bb,_0x4d1875)=>{const _0x3b6f33=_0x2dd624,_0x22ccf5=_0x57d7bb[_0x3b6f33(0x2cb)]||'',_0x69551e=_0x4d1875[_0x3b6f33(0x2cb)]||'';return _0x69551e[_0x3b6f33(0x26d)](_0x22ccf5);});if(_0x27a681[_0x2dd624(0x208)]||_0x27a681[_0x2dd624(0x25c)])return await handleSDKOutput(_0x504637,_0x27a681),0x0;let _0x4ff06f;if(_0x3e6e9a){const _0x1e8b52=_0x504637[0x0];if(!_0x1e8b52[_0x2dd624(0x283)]?.['id'])return console[_0x2dd624(0x2ab)](_0x2dd624(0x2cf)),0x0;_0x4ff06f=_0x1e8b52['lastAttempt']['id'],_0x27a681['verbose']&&console[_0x2dd624(0x2ab)](_0x2dd624(0x2a8)+_0x1e8b52[_0x2dd624(0x2cb)]);}else{const _0x2807d8=_0x504637['map'](_0x28b5b7=>{const _0xcaae83=_0x2dd624,_0x35477b=getAttemptStatusDisplay(_0x28b5b7[_0xcaae83(0x283)]);return{'title':_0x28b5b7[_0xcaae83(0x15d)]?.['name']+'.'+_0x28b5b7['workflow']?.['name']+_0xcaae83(0x1fc)+_0x28b5b7[_0xcaae83(0x2cb)]+'\x20'+_0x35477b['icon'],'value':_0x28b5b7[_0xcaae83(0x283)]?.['id']||'','description':_0x35477b[_0xcaae83(0x18e)]};}),_0x7812e7=await a54_0x1d7da3({'type':_0x2dd624(0x23d),'name':_0x2dd624(0x1e6),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2807d8[_0x2dd624(0x250)](_0x14d9f5=>_0x14d9f5['value']!=='')});if(!_0x7812e7[_0x2dd624(0x1e6)])return 0x0;_0x4ff06f=_0x7812e7[_0x2dd624(0x1e6)];}const _0x30f11c=_0x27a681[_0x2dd624(0x1a4)];return _0x30f11c?await this[_0x2dd624(0x131)](_0x31f57b,_0x4ff06f):await this[_0x2dd624(0x1e3)](_0x31f57b,_0x4ff06f,_0x27a681),0x0;}async[a54_0x26a927(0x1e3)](_0x4042c2,_0x2addd6,_0x5ef159){const _0x703d09=a54_0x26a927,{tdx:_0x348d68}=_0x4042c2;let _0x5c5adb,_0x773f93;try{[_0x5c5adb,_0x773f93]=await Promise[_0x703d09(0x29e)]([_0x348d68['workflow'][_0x703d09(0x140)](_0x2addd6),_0x348d68['workflow'][_0x703d09(0x266)](_0x2addd6,![])]);}catch(_0x5053ff){console[_0x703d09(0x2ab)](a54_0x1d1160[_0x703d09(0x224)](_0x703d09(0x14d)));_0x5ef159[_0x703d09(0x1f9)]&&console[_0x703d09(0x2ab)](_0x5053ff);throw _0x5053ff;}if(_0x5ef159[_0x703d09(0x208)]||_0x5ef159[_0x703d09(0x25c)]){const _0x354399=this[_0x703d09(0x215)](_0x5c5adb,_0x773f93);await handleSDKOutput([_0x354399],_0x5ef159);return;}const _0x4b0e2d=_0x348d68['context']['site'],_0x42ddc7=this[_0x703d09(0x218)](_0x5c5adb,_0x773f93,_0x4b0e2d);console[_0x703d09(0x149)](_0x42ddc7);}async[a54_0x26a927(0x131)](_0x3ee57f,_0x5e1e90){const _0x27c688=a54_0x26a927,{tdx:_0x996ba0}=_0x3ee57f,_0x92325b=TIMELINE_CONFIG[_0x27c688(0x1c3)],_0x1b8e5f=TIMELINE_CONFIG[_0x27c688(0x289)];let _0x59cddf=0x0;while(_0x59cddf<_0x1b8e5f){process[_0x27c688(0x25d)][_0x27c688(0x2c9)]&&process[_0x27c688(0x25d)][_0x27c688(0x209)]('\x1bc');let _0x4de4ae,_0x20d032;try{[_0x4de4ae,_0x20d032]=await Promise[_0x27c688(0x29e)]([_0x996ba0[_0x27c688(0x13e)]['attempt'](_0x5e1e90),_0x996ba0[_0x27c688(0x13e)]['tasks'](_0x5e1e90,![])]);}catch(_0x2a18d7){console[_0x27c688(0x2ab)](a54_0x1d1160[_0x27c688(0x224)](_0x27c688(0x24d)));_0x59cddf>0x0&&console[_0x27c688(0x2ab)](a54_0x1d1160[_0x27c688(0x17d)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x59cddf));throw _0x2a18d7;}const _0x44ba27=_0x996ba0[_0x27c688(0x1d3)]['site'],_0x4a640e=this[_0x27c688(0x218)](_0x4de4ae,_0x20d032,_0x44ba27);console[_0x27c688(0x149)](_0x4a640e);const _0x564529=_0x4de4ae[_0x27c688(0x23a)]&&_0x20d032[_0x27c688(0x15a)](_0x17a942=>_0x17a942[_0x27c688(0x13d)]!==_0x27c688(0x2c6)&&_0x17a942['state']!=='planned');if(_0x564529){console[_0x27c688(0x2ab)](a54_0x1d1160[_0x27c688(0x2bf)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a54_0x1d1160[_0x27c688(0x17d)]('\x0aPolling...\x20('+_0x59cddf*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x534b21=>setTimeout(_0x534b21,_0x92325b)),_0x59cddf++;}_0x59cddf>=_0x1b8e5f&&console[_0x27c688(0x2ab)](a54_0x1d1160[_0x27c688(0x242)](_0x27c688(0x1a7)));}[a54_0x26a927(0x218)](_0x438a8f,_0xfeae01,_0x1af8e6){const _0x4bf217=a54_0x26a927,_0x4b0111=[],_0x17346c=TIMELINE_CONFIG[_0x4bf217(0x152)],_0x5d6f3c=0x5,_0x5e4130=process['stdout'][_0x4bf217(0x166)]||0x78,_0x4cf5e8=_0x5e4130-_0x17346c-_0x5d6f3c,_0x1fcee5=Math[_0x4bf217(0x29c)](TIMELINE_CONFIG[_0x4bf217(0x213)],Math['min'](_0x4cf5e8,TIMELINE_CONFIG[_0x4bf217(0x1dc)])),_0x28b08f=new Date(_0x438a8f[_0x4bf217(0x172)])['getTime'](),_0x5e9425=_0x438a8f['finishedAt']?new Date(_0x438a8f[_0x4bf217(0x1cf)])[_0x4bf217(0x256)]():Date[_0x4bf217(0x1ed)](),_0xabdaa2={'start':_0x28b08f,'end':_0x5e9425,'duration':_0x5e9425-_0x28b08f},_0x16ab9b=new Map(),_0x3d6f3d=[];for(const _0x11d336 of _0xfeae01){if(_0x11d336['startedAt']){const _0xabba9e=new Date(_0x11d336['startedAt'])[_0x4bf217(0x256)](),_0xf6164c=_0x11d336[_0x4bf217(0x1c4)]?new Date(_0x11d336['updatedAt'])[_0x4bf217(0x256)]():Date[_0x4bf217(0x1ed)](),_0x56ac85={'start':_0xabba9e,'end':_0xf6164c,'duration':_0xf6164c-_0xabba9e};_0x16ab9b[_0x4bf217(0x1b8)](_0x11d336['id'],_0x56ac85),_0x3d6f3d[_0x4bf217(0x1f4)]({'name':_0x11d336['fullName'],'state':_0x11d336[_0x4bf217(0x13d)]||_0x4bf217(0x201),'window':_0x56ac85});}else _0x3d6f3d['push']({'name':_0x11d336[_0x4bf217(0x2c2)],'state':_0x11d336[_0x4bf217(0x13d)]||_0x4bf217(0x245),'window':undefined});}_0x3d6f3d[_0x4bf217(0x1d0)]((_0x334752,_0x5b3245)=>{const _0x28644d=_0x4bf217;if(!_0x334752[_0x28644d(0x223)])return 0x1;if(!_0x5b3245[_0x28644d(0x223)])return-0x1;return _0x334752[_0x28644d(0x223)][_0x28644d(0x126)]-_0x5b3245[_0x28644d(0x223)][_0x28644d(0x126)];});const _0x35b34a=_0x3d6f3d[_0x4bf217(0x294)],_0x2ab3e0=_0x35b34a>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x2ab3e0&&_0x3d6f3d[_0x4bf217(0x1b2)](TIMELINE_CONFIG[_0x4bf217(0x28f)]);const _0x5cb548=calculateTimeScale(_0xabdaa2,_0x1fcee5),_0x44cac9=_0x438a8f[_0x4bf217(0x23a)]?_0x438a8f[_0x4bf217(0x173)]?a54_0x1d1160[_0x4bf217(0x2bf)](_0x4bf217(0x173)):a54_0x1d1160[_0x4bf217(0x224)](_0x4bf217(0x2ab)):a54_0x1d1160[_0x4bf217(0x286)](_0x4bf217(0x2c6)),_0x2e51b7=_0x438a8f[_0x4bf217(0x15d)]?.['id'],_0x18fa03=_0x438a8f['sessionId'];let _0x201e3c;if(_0x2e51b7&&_0x18fa03){const _0x2333c4=getWorkflowAttemptUrl(_0x1af8e6,_0x2e51b7,_0x18fa03,_0x438a8f['id']);_0x201e3c=hyperlink(a54_0x1d1160[_0x4bf217(0x17d)](_0x438a8f['id']),_0x2333c4);}else _0x201e3c=a54_0x1d1160[_0x4bf217(0x17d)](_0x438a8f['id']);_0x4b0111[_0x4bf217(0x1f4)](_0x4bf217(0x2bb)+_0x201e3c+_0x4bf217(0x1fc)+_0x44cac9+_0x4bf217(0x1fc)+formatElapsed(_0xabdaa2[_0x4bf217(0x2c3)]));if(_0x3d6f3d['length']>0x0){const _0x2bc21c=renderTimeAxis(_0x5cb548,_0x1fcee5),_0x61005f=new Date(_0xabdaa2[_0x4bf217(0x126)]),_0x12eaf3=formatDate(_0x61005f),_0x1a91d5=TIMELINE_CONFIG[_0x4bf217(0x27d)]+TIMELINE_CONFIG[_0x4bf217(0x2a5)]+_0x17346c,_0x225e09=_0x12eaf3['padStart'](_0x1a91d5),_0x19354b=a54_0x1d1160['dim'](_0x225e09);_0x4b0111[_0x4bf217(0x1f4)](_0x19354b+'\x20'+_0x2bc21c);for(const _0x5b171b of _0x3d6f3d){_0x4b0111[_0x4bf217(0x1f4)](renderTaskRow(_0x5b171b,_0x5cb548,_0x1fcee5,_0x17346c));}const _0x2e1c04=calculateStats(_0x3d6f3d);_0x4b0111[_0x4bf217(0x1f4)](formatStats(_0x2e1c04)),_0x2ab3e0&&_0x4b0111[_0x4bf217(0x1f4)](a54_0x1d1160[_0x4bf217(0x242)](_0x4bf217(0x255)+TIMELINE_CONFIG[_0x4bf217(0x28f)]+'\x20of\x20'+_0x35b34a+'\x20tasks')),_0x4b0111['push'](''),_0x4b0111[_0x4bf217(0x1f4)](a54_0x1d1160['dim'](_0x4bf217(0x272))+(_0x4bf217(0x1eb)+_0x438a8f['id']+'\x20logs')+a54_0x1d1160[_0x4bf217(0x17d)](_0x4bf217(0x16b)));}else _0x4b0111[_0x4bf217(0x1f4)](_0x4bf217(0x167));return _0x4b0111['join']('\x0a');}[a54_0x26a927(0x215)](_0x35f815,_0x4d6b2f){const _0x4d7c6b=a54_0x26a927,_0x4ea1ee=new Date(_0x35f815[_0x4d7c6b(0x172)])[_0x4d7c6b(0x256)](),_0x1a4fe4=_0x35f815[_0x4d7c6b(0x1cf)]?new Date(_0x35f815['finishedAt'])['getTime']():Date[_0x4d7c6b(0x1ed)](),_0x23759f=_0x1a4fe4-_0x4ea1ee,_0x3081e0=[];for(const _0xc24715 of _0x4d6b2f){if(_0xc24715[_0x4d7c6b(0x1f3)]){const _0x35e184=new Date(_0xc24715[_0x4d7c6b(0x1f3)])[_0x4d7c6b(0x256)](),_0x1624d9=_0xc24715[_0x4d7c6b(0x1c4)]?new Date(_0xc24715['updatedAt'])[_0x4d7c6b(0x256)]():Date[_0x4d7c6b(0x1ed)]();_0x3081e0[_0x4d7c6b(0x1f4)]({'name':_0xc24715[_0x4d7c6b(0x2c2)],'state':_0xc24715[_0x4d7c6b(0x13d)]||_0x4d7c6b(0x201),'window':{'start':_0x35e184,'end':_0x1624d9,'duration':_0x1624d9-_0x35e184}});}else _0x3081e0[_0x4d7c6b(0x1f4)]({'name':_0xc24715[_0x4d7c6b(0x2c2)],'state':_0xc24715['state']||_0x4d7c6b(0x245),'window':undefined});}const _0x440662=calculateStats(_0x3081e0);return{'attempt':{'id':_0x35f815['id'],'status':_0x35f815[_0x4d7c6b(0x23a)]?_0x35f815[_0x4d7c6b(0x173)]?'success':'error':'running','createdAt':_0x35f815['createdAt'],'finishedAt':_0x35f815[_0x4d7c6b(0x1cf)],'duration_ms':_0x23759f},'tasks':_0x3081e0[_0x4d7c6b(0x12e)](_0x98e5df=>({'name':_0x98e5df[_0x4d7c6b(0x296)],'state':_0x98e5df[_0x4d7c6b(0x13d)],'startedAt':_0x98e5df[_0x4d7c6b(0x223)]?new Date(_0x98e5df['window'][_0x4d7c6b(0x126)])[_0x4d7c6b(0x144)]():null,'updatedAt':_0x98e5df[_0x4d7c6b(0x223)]?new Date(_0x98e5df[_0x4d7c6b(0x223)][_0x4d7c6b(0x20c)])[_0x4d7c6b(0x144)]():null,'duration_ms':_0x98e5df[_0x4d7c6b(0x223)]?.[_0x4d7c6b(0x2c3)]||null})),'stats':_0x440662};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x178);['description']=a54_0x26a927(0x193);async[a54_0x26a927(0x1a6)](_0x33e392){const _0x3925bc=a54_0x26a927,{options:_0x55d70b,tdx:_0x275f3d}=_0x33e392,_0x2e5714=await withSpinner('Listing\x20schedules...',()=>_0x275f3d[_0x3925bc(0x13e)][_0x3925bc(0x1cb)](),{'verbose':_0x55d70b[_0x3925bc(0x1f9)]}),_0x3f5789=_0x2e5714[_0x3925bc(0x1ab)];console['error']('✔\x20Found\x20'+_0x3f5789[_0x3925bc(0x294)]+'\x20schedule'+(_0x3f5789[_0x3925bc(0x294)]!==0x1?'s':''));if(isStructuredFormat(_0x55d70b))await handleSDKOutput(_0x3f5789,_0x55d70b);else{if(_0x3f5789[_0x3925bc(0x294)]===0x0)console[_0x3925bc(0x149)](_0x3925bc(0x2aa));else for(const _0x398644 of _0x3f5789){const _0x4aafb8=_0x398644['disabledAt']?a54_0x1d1160[_0x3925bc(0x242)](_0x3925bc(0x25f)):'',_0x1533ba=_0x398644['project']?.['name']?a54_0x1d1160[_0x3925bc(0x17d)]('\x20['+_0x398644[_0x3925bc(0x15d)][_0x3925bc(0x296)]+']'):'',_0x57f5c1=_0x398644[_0x3925bc(0x22d)]?a54_0x1d1160[_0x3925bc(0x17d)](_0x3925bc(0x2bc)+new Date(_0x398644[_0x3925bc(0x22d)])[_0x3925bc(0x2cc)]()):'';console[_0x3925bc(0x149)](_0x3925bc(0x2d0)+_0x398644['id']+'\x20'+(_0x398644[_0x3925bc(0x13e)]?.[_0x3925bc(0x296)]||_0x3925bc(0x217))+_0x1533ba+_0x4aafb8+_0x57f5c1);}}return 0x0;}}function a54_0x4873(_0x5cf870,_0x22fbb1){_0x5cf870=_0x5cf870-0x11c;const _0x2dbd42=a54_0x2dbd();let _0x4873f5=_0x2dbd42[_0x5cf870];return _0x4873f5;}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x26a927(0x296)]=a54_0x26a927(0x1bc);[a54_0x26a927(0x150)]=a54_0x26a927(0x271);async[a54_0x26a927(0x1a6)](_0x1ec610){const _0x58ceb5=a54_0x26a927,{options:_0xb376a3,args:_0x2141df,tdx:_0x11af64}=_0x1ec610,_0x346d66=_0x2141df[0x0];if(!_0x346d66)return console[_0x58ceb5(0x2ab)](a54_0x1d1160[_0x58ceb5(0x224)]('Error:'),_0x58ceb5(0x146)),console[_0x58ceb5(0x2ab)](a54_0x1d1160['dim'](_0x58ceb5(0x204))),console[_0x58ceb5(0x2ab)](a54_0x1d1160[_0x58ceb5(0x17d)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x4028b2=await withSpinner(_0x58ceb5(0x132)+_0x346d66+_0x58ceb5(0x177),()=>_0x11af64['workflow'][_0x58ceb5(0x269)](_0x346d66),{'verbose':_0xb376a3[_0x58ceb5(0x1f9)]}),_0x36fef0=_0x4028b2[_0x58ceb5(0x1ab)];return isStructuredFormat(_0xb376a3)?await handleSingleObjectOutput(_0x36fef0,_0xb376a3):(console['log'](_0x58ceb5(0x1a8)+_0x346d66+_0x58ceb5(0x222)+(_0x36fef0[_0x58ceb5(0x13e)]?.[_0x58ceb5(0x296)]||_0x58ceb5(0x201))+')'),_0x36fef0[_0x58ceb5(0x22d)]&&console['log'](a54_0x1d1160[_0x58ceb5(0x17d)]('\x20\x20Next\x20run:\x20'+new Date(_0x36fef0[_0x58ceb5(0x22d)])[_0x58ceb5(0x2cc)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x26a927(0x296)]='workflow:schedule:disable';[a54_0x26a927(0x150)]=a54_0x26a927(0x12f);async[a54_0x26a927(0x1a6)](_0x612ffc){const _0x4fb8b4=a54_0x26a927,{options:_0x431ed8,args:_0x1c309d,tdx:_0x18d542}=_0x612ffc,_0x3d6c1f=_0x1c309d[0x0];if(!_0x3d6c1f)return console[_0x4fb8b4(0x2ab)](a54_0x1d1160[_0x4fb8b4(0x224)](_0x4fb8b4(0x243)),_0x4fb8b4(0x146)),console['error'](a54_0x1d1160[_0x4fb8b4(0x17d)](_0x4fb8b4(0x247))),console[_0x4fb8b4(0x2ab)](a54_0x1d1160[_0x4fb8b4(0x17d)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x2927e0=await withSpinner(_0x4fb8b4(0x1c7)+_0x3d6c1f+'...',()=>_0x18d542[_0x4fb8b4(0x13e)][_0x4fb8b4(0x26e)](_0x3d6c1f),{'verbose':_0x431ed8[_0x4fb8b4(0x1f9)]}),_0x4c059b=_0x2927e0[_0x4fb8b4(0x1ab)];return isStructuredFormat(_0x431ed8)?await handleSingleObjectOutput(_0x4c059b,_0x431ed8):console[_0x4fb8b4(0x149)](_0x4fb8b4(0x1a8)+_0x3d6c1f+_0x4fb8b4(0x190)+(_0x4c059b[_0x4fb8b4(0x13e)]?.[_0x4fb8b4(0x296)]||_0x4fb8b4(0x201))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x284e9b,_0x2cce7a){const _0xb0efe1=a55_0x58e2,_0x1651f7=_0x284e9b();while(!![]){try{const _0x2f3edb=-parseInt(_0xb0efe1(0x171))/0x1+-parseInt(_0xb0efe1(0x16f))/0x2*(parseInt(_0xb0efe1(0x161))/0x3)+parseInt(_0xb0efe1(0x172))/0x4*(-parseInt(_0xb0efe1(0x16e))/0x5)+-parseInt(_0xb0efe1(0x164))/0x6*(-parseInt(_0xb0efe1(0x169))/0x7)+parseInt(_0xb0efe1(0x16a))/0x8*(parseInt(_0xb0efe1(0x163))/0x9)+-parseInt(_0xb0efe1(0x16c))/0xa+-parseInt(_0xb0efe1(0x160))/0xb*(-parseInt(_0xb0efe1(0x16b))/0xc);if(_0x2f3edb===_0x2cce7a)break;else _0x1651f7['push'](_0x1651f7['shift']());}catch(_0x4cb289){_0x1651f7['push'](_0x1651f7['shift']());}}}(a55_0x5c99,0x8977d));import{platform}from'os';function a55_0x5c99(){const _0x29fee3=['133192mJvWze','168nLcvzw','8280650qhgFpM','Authorization','25385AWNJcD','542xfSIFy','replace','14222olDOan','592KvFrWe','length','1278827nFuGEP','11355QhddpF','TD1\x20','414XPTeSN','78tfWIPM','version','tdx','tdx/','entries','424865sSGfbc'];a55_0x5c99=function(){return _0x29fee3;};return a55_0x5c99();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x443f5c=a55_0x58e2,_0x1e4f22=getVersion(),_0x273aff=platform(),_0xeacf43=process[_0x443f5c(0x165)][_0x443f5c(0x170)]('v','');return _0x443f5c(0x167)+_0x1e4f22+'\x20('+_0x273aff+';\x20node/'+_0xeacf43+')';}export function getAuthHeaders(_0x5cec88,_0x13ffa8,_0x269ae2){const _0x54b77c=a55_0x58e2,_0x53a023=getVersion(),_0x277a50={'User-Agent':getUserAgent(),'X-TD-Client':_0x54b77c(0x166),'X-TD-Client-Version':_0x53a023};if(_0x269ae2)_0x277a50[_0x54b77c(0x16d)]='Bearer\x20'+_0x269ae2;else _0x13ffa8&&(_0x277a50[_0x54b77c(0x16d)]=_0x54b77c(0x162)+_0x13ffa8);return _0x277a50;}export function toHeaderRecord(_0x3dbe37){const _0x2871ab=a55_0x58e2,_0x1cd5d9={};for(const [_0x5b7144,_0x1fec1e]of Object[_0x2871ab(0x168)](_0x3dbe37)){_0x1fec1e!==undefined&&(_0x1cd5d9[_0x5b7144]=_0x1fec1e);}return _0x1cd5d9;}function a55_0x58e2(_0xe08f3f,_0x50980d){_0xe08f3f=_0xe08f3f-0x15f;const _0x5c991d=a55_0x5c99();let _0x58e2da=_0x5c991d[_0xe08f3f];return _0x58e2da;}export function getTrinoHeaders(_0x46bdcd,_0x4f3550,_0x40e30d){const _0x1a2072=a55_0x58e2,_0x5678f8=getAuthHeaders(_0x46bdcd),_0x30b15e=toHeaderRecord(_0x5678f8);if(_0x40e30d)_0x30b15e[_0x1a2072(0x16d)]='Bearer\x20'+_0x40e30d;else _0x4f3550&&(_0x30b15e['X-Trino-User']=_0x4f3550);return _0x30b15e;}export function hasAPIKey(_0x4bb555){const _0x5c6402=a55_0x58e2,_0x10192d=getAPIKey();return _0x10192d!==undefined&&_0x10192d[_0x5c6402(0x15f)]>0x0;}
1
+ (function(_0x1624db,_0x4acfbf){const _0x7ee405=a55_0x277d,_0x5d12f4=_0x1624db();while(!![]){try{const _0x5003f9=parseInt(_0x7ee405(0x18b))/0x1*(parseInt(_0x7ee405(0x190))/0x2)+parseInt(_0x7ee405(0x193))/0x3*(-parseInt(_0x7ee405(0x195))/0x4)+-parseInt(_0x7ee405(0x19a))/0x5+parseInt(_0x7ee405(0x192))/0x6+-parseInt(_0x7ee405(0x197))/0x7+-parseInt(_0x7ee405(0x18c))/0x8+parseInt(_0x7ee405(0x196))/0x9*(parseInt(_0x7ee405(0x199))/0xa);if(_0x5003f9===_0x4acfbf)break;else _0x5d12f4['push'](_0x5d12f4['shift']());}catch(_0x301d28){_0x5d12f4['push'](_0x5d12f4['shift']());}}}(a55_0x1942,0xefab4));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x277d(_0x459205,_0x2a5f15){_0x459205=_0x459205-0x18a;const _0x194246=a55_0x1942();let _0x277d7c=_0x194246[_0x459205];return _0x277d7c;}function a55_0x1942(){const _0xb1add8=['9388dTPmjz','25125480jhxUFL','9804242NMLOgi','Authorization','10XymgCf','3830925oDhVre','TD1\x20','tdx/','2iDRDTm','7736632mSAyvQ','length','X-Trino-User',';\x20node/','1092340dWprWE','Bearer\x20','1712850TwDWdS','69iUGVjM','tdx'];a55_0x1942=function(){return _0xb1add8;};return a55_0x1942();}export function getUserAgent(){const _0x4f5a82=a55_0x277d,_0xbb18f0=getVersion(),_0x28fc5=platform(),_0x2d1637=process['version']['replace']('v','');return _0x4f5a82(0x18a)+_0xbb18f0+'\x20('+_0x28fc5+_0x4f5a82(0x18f)+_0x2d1637+')';}export function getAuthHeaders(_0x5ba3b1,_0x407bdf,_0x1f1397){const _0x3a368d=a55_0x277d,_0x3942c3=getVersion(),_0x4986e0={'User-Agent':getUserAgent(),'X-TD-Client':_0x3a368d(0x194),'X-TD-Client-Version':_0x3942c3};if(_0x1f1397)_0x4986e0[_0x3a368d(0x198)]=_0x3a368d(0x191)+_0x1f1397;else _0x407bdf&&(_0x4986e0[_0x3a368d(0x198)]=_0x3a368d(0x19b)+_0x407bdf);return _0x4986e0;}export function toHeaderRecord(_0x483440){const _0x4ee333={};for(const [_0x10e6fe,_0x2b3091]of Object['entries'](_0x483440)){_0x2b3091!==undefined&&(_0x4ee333[_0x10e6fe]=_0x2b3091);}return _0x4ee333;}export function getTrinoHeaders(_0x2a45f9,_0x20ced2,_0x14198b){const _0x433df8=a55_0x277d,_0x34f824=getAuthHeaders(_0x2a45f9),_0x2c46d0=toHeaderRecord(_0x34f824);if(_0x14198b)_0x2c46d0[_0x433df8(0x198)]=_0x433df8(0x191)+_0x14198b;else _0x20ced2&&(_0x2c46d0[_0x433df8(0x18e)]=_0x20ced2);return _0x2c46d0;}export function hasAPIKey(_0x2c4b33){const _0x2f8347=a55_0x277d,_0x531712=getAPIKey();return _0x531712!==undefined&&_0x531712[_0x2f8347(0x18d)]>0x0;}
@@ -1 +1 @@
1
- (function(_0xfe500e,_0x5ee886){const _0x5b0a6f=a56_0x30f3,_0x568cd7=_0xfe500e();while(!![]){try{const _0x2a5fef=parseInt(_0x5b0a6f(0xb6))/0x1+-parseInt(_0x5b0a6f(0xb3))/0x2*(-parseInt(_0x5b0a6f(0xa0))/0x3)+-parseInt(_0x5b0a6f(0x9e))/0x4*(-parseInt(_0x5b0a6f(0x97))/0x5)+parseInt(_0x5b0a6f(0xa8))/0x6+-parseInt(_0x5b0a6f(0xb8))/0x7*(parseInt(_0x5b0a6f(0xaf))/0x8)+-parseInt(_0x5b0a6f(0xb9))/0x9*(-parseInt(_0x5b0a6f(0x89))/0xa)+parseInt(_0x5b0a6f(0xb7))/0xb*(-parseInt(_0x5b0a6f(0x8f))/0xc);if(_0x2a5fef===_0x5ee886)break;else _0x568cd7['push'](_0x568cd7['shift']());}catch(_0x3a61d1){_0x568cd7['push'](_0x568cd7['shift']());}}}(a56_0x1511,0xab6ae));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_0x5eb0d5 from'chalk';function a56_0x30f3(_0x570f71,_0x11f667){_0x570f71=_0x570f71-0x70;const _0x1511ba=a56_0x1511();let _0x30f3ac=_0x1511ba[_0x570f71];return _0x30f3ac;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x28c80b){const _0x2ebddd=a56_0x30f3;return _0x28c80b[_0x2ebddd(0xbd)]==='json'||_0x28c80b[_0x2ebddd(0xbd)]===_0x2ebddd(0xac)||_0x28c80b[_0x2ebddd(0xbd)]===_0x2ebddd(0x79)||_0x28c80b['format']===_0x2ebddd(0xb2)||_0x28c80b['json']===!![]||_0x28c80b[_0x2ebddd(0xac)]===!![]||_0x28c80b[_0x2ebddd(0x79)]===!![]||_0x28c80b['table']===!![];}export function parseOutputOptions(_0x3569ab){const _0x4eba8e=a56_0x30f3;return{'format':_0x3569ab[_0x4eba8e(0xbd)]||'table','output':_0x3569ab['output']||'','limit':_0x3569ab[_0x4eba8e(0x8d)],'limitStructuredFormats':_0x3569ab[_0x4eba8e(0xa4)],'color':_0x3569ab[_0x4eba8e(0xb5)],'noColor':_0x3569ab['noColor']};}function convertSDKResultToQueryResult(_0x19974b){const _0x23d4f2=a56_0x30f3,_0x3cda03=[];if(_0x19974b[_0x23d4f2(0x99)]>0x0){const _0x1b182f=_0x19974b[0x0];for(const [_0x1272ec,_0x13a89f]of Object[_0x23d4f2(0x76)](_0x1b182f)){let _0x3cb34f=_0x23d4f2(0xae);if(typeof _0x13a89f===_0x23d4f2(0x7c))_0x3cb34f=Number[_0x23d4f2(0xbb)](_0x13a89f)?'bigint':_0x23d4f2(0x78);else{if(typeof _0x13a89f==='boolean')_0x3cb34f=_0x23d4f2(0xb4);else _0x13a89f===null&&(_0x3cb34f='varchar');}_0x3cda03[_0x23d4f2(0x70)]({'name':_0x1272ec,'type':_0x3cb34f});}}return{'queryId':_0x23d4f2(0x88),'columns':_0x3cda03,'data':_0x19974b,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x19974b[_0x23d4f2(0x99)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x239db4,_0x2899dd){const _0xc57ad8=convertSDKResultToQueryResult(_0x239db4);return formatQueryOutput(_0xc57ad8,_0x2899dd);}export async function formatQueryOutput(_0x2647bb,_0x3ae97e){const _0x4463a9=a56_0x30f3,{format:_0x4001bf,limit:_0x5536f6,output:_0x55ae13,color:_0x53d096,noColor:_0xb3e376,limitStructuredFormats:_0x442b0c}=_0x3ae97e,_0x32556c=Boolean(_0x55ae13)&&!_0x53d096,_0xd103b3={'color':_0x53d096,'noColor':_0xb3e376||_0x32556c};if(_0x4001bf===_0x4463a9(0xb2)){const _0x557c89=shouldUseLess(_0x4001bf,_0x55ae13);return formatAsTable(_0x2647bb,_0x5536f6,_0x557c89,_0xd103b3);}const _0x23fa4c=_0x442b0c&&Number[_0x4463a9(0xbe)](_0x5536f6)&&_0x2647bb[_0x4463a9(0x87)]['length']>_0x5536f6?{..._0x2647bb,'data':_0x2647bb[_0x4463a9(0x87)][_0x4463a9(0x9b)](0x0,_0x5536f6)}:_0x2647bb;if(_0x4001bf===_0x4463a9(0xbc))return formatAsJSON(_0x23fa4c,_0xd103b3);else return _0x4001bf===_0x4463a9(0xac)?formatAsJSONL(_0x23fa4c,_0xd103b3):formatQueryResult(_0x23fa4c,_0x4001bf);}function shouldUseLess(_0x137a6d,_0x4b49cb){const _0x1ca926=a56_0x30f3;return(_0x137a6d===_0x1ca926(0xb2)||_0x137a6d===_0x1ca926(0xa3))&&process[_0x1ca926(0x86)][_0x1ca926(0xa6)]&&!_0x4b49cb;}export function resolveOutputOptions(_0x1570bd){const _0x48939=a56_0x30f3,_0x583845=_0x1570bd[_0x48939(0x81)]||'',_0x30cf1c=resolveOutputFormat(_0x1570bd[_0x48939(0xbd)],_0x583845,_0x48939(0xb2));let _0x39652e=typeof _0x1570bd[_0x48939(0x8d)]===_0x48939(0x7c)?_0x1570bd[_0x48939(0x8d)]:parseInt(_0x1570bd[_0x48939(0x8d)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1570bd[_0x48939(0x8d)]===undefined&&shouldUseLess(_0x30cf1c,_0x583845)&&(_0x39652e=Infinity),{'format':_0x30cf1c,'output':_0x583845,'limit':_0x39652e,'limitStructuredFormats':_0x1570bd[_0x48939(0xa4)],'color':_0x1570bd[_0x48939(0xb5)],'noColor':_0x1570bd['noColor']};}export function writeOutput(_0x451445,_0x5cb84d,_0x74fddc){const _0x117e5a=a56_0x30f3;return _0x5cb84d?(writeFileSync(_0x5cb84d,_0x451445),console[_0x117e5a(0x9f)]('Results\x20saved\x20to\x20'+_0x5cb84d),Promise['resolve']()):shouldUseLess(_0x74fddc||'','')?new Promise(_0x28ddc9=>{const _0x35db3f=_0x117e5a,_0x2ac896=spawn(_0x35db3f(0xa9),[_0x35db3f(0x9d)],{'stdio':[_0x35db3f(0x93),_0x35db3f(0x92),_0x35db3f(0x92)]});let _0x4f405d=![];_0x2ac896['on'](_0x35db3f(0x9f),()=>{const _0x963804=_0x35db3f;!_0x4f405d&&(_0x4f405d=!![],console[_0x963804(0xb0)](_0x451445),_0x28ddc9());}),_0x2ac896['on'](_0x35db3f(0xa1),()=>{!_0x4f405d&&(_0x4f405d=!![],_0x28ddc9());}),_0x2ac896['on'](_0x35db3f(0x98),()=>{const _0x1dd913=_0x35db3f;!_0x4f405d&&_0x2ac896[_0x1dd913(0x7f)]&&(_0x2ac896[_0x1dd913(0x7f)]['on'](_0x1dd913(0x9f),()=>{}),_0x2ac896[_0x1dd913(0x7f)][_0x1dd913(0x95)](_0x451445),_0x2ac896[_0x1dd913(0x7f)][_0x1dd913(0x73)]());}),!_0x2ac896[_0x35db3f(0x7f)]&&(!_0x4f405d&&(_0x4f405d=!![],console['log'](_0x451445),_0x28ddc9()));}):(console['log'](_0x451445),Promise[_0x117e5a(0x83)]());}export async function handleSDKOutput(_0x6adc6e,_0x3eceb5){const _0x2ebde9=a56_0x30f3,_0x51aad3=resolveOutputOptions(_0x3eceb5),_0x4451ee=await formatSDKOutput(_0x6adc6e,_0x51aad3);await writeOutput(_0x4451ee,_0x51aad3[_0x2ebde9(0x81)]||undefined,_0x51aad3[_0x2ebde9(0xbd)]);}export async function handleQueryOutput(_0xdb9c3b,_0x3982f4){const _0x39e672=a56_0x30f3,_0x748ccb=resolveOutputOptions(_0x3982f4),_0x1185bc=await formatQueryOutput(_0xdb9c3b,_0x748ccb);await writeOutput(_0x1185bc,_0x748ccb[_0x39e672(0x81)]||undefined,_0x748ccb['format']);}async function formatSingleObject(_0xaff2dd,_0x166897){const _0x3c61b4=a56_0x30f3,{format:_0x289e77,color:_0xdcc7dd,noColor:_0xc0aae2}=_0x166897,_0x1d770f={'color':_0xdcc7dd,'noColor':_0xc0aae2};if(_0x289e77==='json'){if(shouldUseColor(_0x1d770f))return colorizeJSON(_0xaff2dd,_0x1d770f);return JSON['stringify'](_0xaff2dd,null,0x2);}else{if(_0x289e77===_0x3c61b4(0xac)){if(shouldUseColor(_0x1d770f))return colorizeJSONCompact(_0xaff2dd,_0x1d770f);return JSON[_0x3c61b4(0x74)](_0xaff2dd);}else{if(_0x289e77===_0x3c61b4(0x79))return Object[_0x3c61b4(0x76)](_0xaff2dd)[_0x3c61b4(0x85)](([_0x51403,_0x5d9b51])=>_0x51403+'\x09'+_0x5d9b51)[_0x3c61b4(0x8e)]('\x0a');else{const _0x20bb25=Object[_0x3c61b4(0x76)](_0xaff2dd);if(_0x20bb25['length']===0x0)return _0x3c61b4(0x7a);const _0x37b3a6=_0xaff2dd[_0x3c61b4(0x90)],_0xba0dc1=_0xaff2dd[_0x3c61b4(0xab)],_0x38e820=_0xaff2dd[_0x3c61b4(0xad)],_0x2509a9=_0xaff2dd[_0x3c61b4(0x80)],_0x12cfb6=_0xba0dc1?typeof _0xba0dc1===_0x3c61b4(0x72)?_0xba0dc1:JSON[_0x3c61b4(0x74)](_0xba0dc1,null,0x2):undefined,_0x8031d6=_0x38e820&&Object[_0x3c61b4(0x94)](_0x38e820)[_0x3c61b4(0x99)]>0x0?JSON[_0x3c61b4(0x74)](_0x38e820,null,0x2):undefined,_0x3ec53e=_0x2509a9&&Object['keys'](_0x2509a9)['length']>0x0?JSON[_0x3c61b4(0x74)](_0x2509a9,null,0x2):undefined,_0x35565f=_0x20bb25['filter'](([_0x3131b7])=>_0x3131b7!=='debug'&&_0x3131b7!==_0x3c61b4(0xab)&&_0x3131b7!==_0x3c61b4(0xad)&&_0x3131b7!==_0x3c61b4(0x80)),_0x22f252=Math[_0x3c61b4(0x7b)](..._0x35565f[_0x3c61b4(0x85)](([_0x5e0d52])=>_0x5e0d52[_0x3c61b4(0x99)])),_0x58222d=Math[_0x3c61b4(0x7b)](..._0x35565f[_0x3c61b4(0x85)](([,_0x47445a])=>{const _0x345eca=_0x3c61b4;try{const _0x227a82=_0x47445a===null||_0x47445a===undefined?'':typeof _0x47445a==='object'?JSON[_0x345eca(0x74)](_0x47445a):String(_0x47445a),_0x5240bc=_0x227a82['split']('\x0a');return Math[_0x345eca(0x7b)](..._0x5240bc[_0x345eca(0x85)](_0x24fcd6=>_0x24fcd6[_0x345eca(0x99)]),0x0);}catch{return 0x0;}}),0x14),_0x4a14ce=[];_0x4a14ce['push'](colorBorder('┌─'+'─'['repeat'](_0x22f252)+'─┬─'+'─'[_0x3c61b4(0x75)](_0x58222d)+'─┐',_0x1d770f)),_0x35565f[_0x3c61b4(0xb1)](([_0x3dbb1a,_0x42d5a5])=>{const _0x4c10a9=_0x3c61b4;let _0x4279b2;try{_0x4279b2=_0x42d5a5===null||_0x42d5a5===undefined?'':typeof _0x42d5a5===_0x4c10a9(0x8c)?JSON['stringify'](_0x42d5a5):String(_0x42d5a5);}catch{_0x4279b2=_0x4c10a9(0xa7);}const _0xeba6c9=_0x3dbb1a['padEnd'](_0x22f252),_0x22179c=_0x4279b2['split']('\x0a');_0x22179c['forEach']((_0x4549ff,_0x15204f)=>{const _0x5bc61e=_0x4c10a9,_0x3bff90=colorBorder('│',_0x1d770f);_0x15204f===0x0?_0x4a14ce['push'](_0x3bff90+'\x20'+_0xeba6c9+'\x20'+_0x3bff90+'\x20'+_0x4549ff[_0x5bc61e(0x96)](_0x58222d)+'\x20'+_0x3bff90):_0x4a14ce[_0x5bc61e(0x70)](_0x3bff90+'\x20'+'\x20'[_0x5bc61e(0x75)](_0x22f252)+'\x20'+_0x3bff90+'\x20'+_0x4549ff['padEnd'](_0x58222d)+'\x20'+_0x3bff90);});}),_0x4a14ce[_0x3c61b4(0x70)](colorBorder('└─'+'─'[_0x3c61b4(0x75)](_0x22f252)+_0x3c61b4(0x82)+'─'[_0x3c61b4(0x75)](_0x58222d)+'─┘',_0x1d770f));_0x12cfb6&&(_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce['push'](String(a56_0x5eb0d5[_0x3c61b4(0x9c)][_0x3c61b4(0x9a)](_0x3c61b4(0x77)))),_0x4a14ce[_0x3c61b4(0x70)](_0x12cfb6));_0x8031d6&&(_0x4a14ce['push'](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0x8a)][_0x3c61b4(0x9a)](_0x3c61b4(0x7e)))),_0x4a14ce[_0x3c61b4(0x70)](_0x8031d6));_0x3ec53e&&(_0x4a14ce['push'](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0xaa)]['bold'](_0x3c61b4(0x71)))),_0x4a14ce[_0x3c61b4(0x70)](_0x3ec53e));if(_0x37b3a6){if(_0x37b3a6[_0x3c61b4(0xa5)]){_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0x8b)]['bold']('[error]')));const _0x5a7abd=_0x37b3a6['stderr'][_0x3c61b4(0x84)]('\x0a');_0x5a7abd['forEach'](_0x1ff718=>{const _0x5ea31b=_0x3c61b4;_0x1ff718[_0x5ea31b(0x7d)]()&&_0x4a14ce[_0x5ea31b(0x70)](_0x1ff718);});}if(_0x37b3a6[_0x3c61b4(0x91)]){_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0xa2)]['bold'](_0x3c61b4(0xba))));const _0x5d2d77=_0x37b3a6[_0x3c61b4(0x91)][_0x3c61b4(0x84)]('\x0a');_0x5d2d77['forEach'](_0x3ecbbd=>{const _0x409bdb=_0x3c61b4;_0x3ecbbd[_0x409bdb(0x7d)]()&&_0x4a14ce['push'](_0x3ecbbd);});}}return _0x4a14ce[_0x3c61b4(0x8e)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x49983a,_0x3a658d){const _0x5947fa=a56_0x30f3;if(_0x3a658d[_0x5947fa(0xbd)]===_0x5947fa(0xb2)){await handleSDKOutput([_0x49983a],_0x3a658d);return;}const _0xe59f88=resolveOutputOptions(_0x3a658d),_0x2728c9=await formatSingleObject(_0x49983a,_0xe59f88);await writeOutput(_0x2728c9,_0xe59f88[_0x5947fa(0x81)]||undefined,_0xe59f88[_0x5947fa(0xbd)]);}function a56_0x1511(){const _0x467162=['join','883812YkIqui','debug','cmdout','inherit','pipe','keys','write','padEnd','5SjOfdN','spawn','length','bold','slice','yellow','-FXRSn','3370772cKWAGW','error','13353elXPmF','close','cyan','list','limitStructuredFormats','stderr','isTTY','[Object]','8217498lzOSbQ','less','magenta','query','jsonl','params','varchar','8JFcEwN','log','forEach','table','94hQVBET','boolean','color','445620bmOIOh','264tKaLbf','9774744VhFRuH','9xFNJRd','[logs]','isInteger','json','format','isFinite','push','[rule]','string','end','stringify','repeat','entries','[query]','double','tsv','No\x20data','max','number','trim','[params]','stdin','rule','output','─┴─','resolve','split','map','stdout','data','sdk-result','9990490EjNmno','blue','red','object','limit'];a56_0x1511=function(){return _0x467162;};return a56_0x1511();}
1
+ (function(_0x3c5d4d,_0x58e6f2){const _0x1ea0c3=a56_0x3690,_0x1bea20=_0x3c5d4d();while(!![]){try{const _0x53ab72=-parseInt(_0x1ea0c3(0x192))/0x1+parseInt(_0x1ea0c3(0x1b0))/0x2*(-parseInt(_0x1ea0c3(0x1a5))/0x3)+-parseInt(_0x1ea0c3(0x1d2))/0x4*(-parseInt(_0x1ea0c3(0x1d1))/0x5)+parseInt(_0x1ea0c3(0x1a8))/0x6+parseInt(_0x1ea0c3(0x1d9))/0x7+parseInt(_0x1ea0c3(0x1c6))/0x8*(parseInt(_0x1ea0c3(0x1a4))/0x9)+parseInt(_0x1ea0c3(0x197))/0xa*(parseInt(_0x1ea0c3(0x1a1))/0xb);if(_0x53ab72===_0x58e6f2)break;else _0x1bea20['push'](_0x1bea20['shift']());}catch(_0xa75dc6){_0x1bea20['push'](_0x1bea20['shift']());}}}(a56_0x39fc,0xc5a4a));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_0x48f428 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4d20a6){const _0x3c44df=a56_0x3690;return _0x4d20a6['format']===_0x3c44df(0x1b2)||_0x4d20a6[_0x3c44df(0x1cb)]===_0x3c44df(0x1b6)||_0x4d20a6[_0x3c44df(0x1cb)]===_0x3c44df(0x1b5)||_0x4d20a6[_0x3c44df(0x1cb)]===_0x3c44df(0x19d)||_0x4d20a6[_0x3c44df(0x1b2)]===!![]||_0x4d20a6[_0x3c44df(0x1b6)]===!![]||_0x4d20a6[_0x3c44df(0x1b5)]===!![]||_0x4d20a6[_0x3c44df(0x19d)]===!![];}export function parseOutputOptions(_0x550b53){const _0x47d8b3=a56_0x3690;return{'format':_0x550b53['format']||_0x47d8b3(0x19d),'output':_0x550b53[_0x47d8b3(0x1c5)]||'','limit':_0x550b53['limit'],'limitStructuredFormats':_0x550b53['limitStructuredFormats'],'color':_0x550b53[_0x47d8b3(0x1c8)],'noColor':_0x550b53[_0x47d8b3(0x1d0)]};}function convertSDKResultToQueryResult(_0x4bb77e){const _0x41b0de=a56_0x3690,_0x4b2eab=[];if(_0x4bb77e[_0x41b0de(0x1b1)]>0x0){const _0x18b2fe=_0x4bb77e[0x0];for(const [_0x5619cc,_0x2d9db0]of Object[_0x41b0de(0x1d4)](_0x18b2fe)){let _0x5d7446=_0x41b0de(0x1d7);if(typeof _0x2d9db0===_0x41b0de(0x19b))_0x5d7446=Number[_0x41b0de(0x1bf)](_0x2d9db0)?_0x41b0de(0x1bc):_0x41b0de(0x1d8);else{if(typeof _0x2d9db0===_0x41b0de(0x1ad))_0x5d7446=_0x41b0de(0x1ad);else _0x2d9db0===null&&(_0x5d7446=_0x41b0de(0x1d7));}_0x4b2eab[_0x41b0de(0x1a6)]({'name':_0x5619cc,'type':_0x5d7446});}}return{'queryId':'sdk-result','columns':_0x4b2eab,'data':_0x4bb77e,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4bb77e[_0x41b0de(0x1b1)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x328dc5,_0x15c67d){const _0x48111e=convertSDKResultToQueryResult(_0x328dc5);return formatQueryOutput(_0x48111e,_0x15c67d);}function a56_0x3690(_0x168297,_0x2320dd){_0x168297=_0x168297-0x191;const _0x39fc1c=a56_0x39fc();let _0x3690bf=_0x39fc1c[_0x168297];return _0x3690bf;}export async function formatQueryOutput(_0x58c4e9,_0x284238){const _0x4d9e9d=a56_0x3690,{format:_0x459ee6,limit:_0x3ef0a4,output:_0x66a6b,color:_0x499ea7,noColor:_0x2a9158,limitStructuredFormats:_0x5e783a}=_0x284238,_0x43baa2=Boolean(_0x66a6b)&&!_0x499ea7,_0x1f0f74={'color':_0x499ea7,'noColor':_0x2a9158||_0x43baa2};if(_0x459ee6===_0x4d9e9d(0x19d)){const _0x11094f=shouldUseLess(_0x459ee6,_0x66a6b);return formatAsTable(_0x58c4e9,_0x3ef0a4,_0x11094f,_0x1f0f74);}const _0x570916=_0x5e783a&&Number['isFinite'](_0x3ef0a4)&&_0x58c4e9[_0x4d9e9d(0x1bb)][_0x4d9e9d(0x1b1)]>_0x3ef0a4?{..._0x58c4e9,'data':_0x58c4e9[_0x4d9e9d(0x1bb)][_0x4d9e9d(0x1ab)](0x0,_0x3ef0a4)}:_0x58c4e9;if(_0x459ee6==='json')return formatAsJSON(_0x570916,_0x1f0f74);else return _0x459ee6==='jsonl'?formatAsJSONL(_0x570916,_0x1f0f74):formatQueryResult(_0x570916,_0x459ee6);}function shouldUseLess(_0xb6220e,_0x362282){const _0x12f13c=a56_0x3690;return(_0xb6220e===_0x12f13c(0x19d)||_0xb6220e===_0x12f13c(0x1ac))&&process[_0x12f13c(0x1cd)]['isTTY']&&!_0x362282;}export function resolveOutputOptions(_0x44066f){const _0xbb6e12=a56_0x3690,_0x5a616a=_0x44066f[_0xbb6e12(0x1c5)]||'',_0x637e22=resolveOutputFormat(_0x44066f[_0xbb6e12(0x1cb)],_0x5a616a,_0xbb6e12(0x19d));let _0x53e872=typeof _0x44066f[_0xbb6e12(0x1c0)]===_0xbb6e12(0x19b)?_0x44066f[_0xbb6e12(0x1c0)]:parseInt(_0x44066f[_0xbb6e12(0x1c0)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x44066f[_0xbb6e12(0x1c0)]===undefined&&shouldUseLess(_0x637e22,_0x5a616a)&&(_0x53e872=Infinity),{'format':_0x637e22,'output':_0x5a616a,'limit':_0x53e872,'limitStructuredFormats':_0x44066f[_0xbb6e12(0x191)],'color':_0x44066f['color'],'noColor':_0x44066f[_0xbb6e12(0x1d0)]};}export function writeOutput(_0x1e7a19,_0x132071,_0xa03ac8){const _0x1743ea=a56_0x3690;return _0x132071?(writeFileSync(_0x132071,_0x1e7a19),console[_0x1743ea(0x195)](_0x1743ea(0x1a7)+_0x132071),Promise[_0x1743ea(0x19c)]()):shouldUseLess(_0xa03ac8||'','')?new Promise(_0x4b8068=>{const _0x5a4f2f=_0x1743ea,_0x5b7a3d=spawn(_0x5a4f2f(0x1a3),[_0x5a4f2f(0x1be)],{'stdio':[_0x5a4f2f(0x1ce),_0x5a4f2f(0x1a0),_0x5a4f2f(0x1a0)]});let _0x2ccd27=![];_0x5b7a3d['on'](_0x5a4f2f(0x195),()=>{const _0x41af6e=_0x5a4f2f;!_0x2ccd27&&(_0x2ccd27=!![],console[_0x41af6e(0x1c1)](_0x1e7a19),_0x4b8068());}),_0x5b7a3d['on']('close',()=>{!_0x2ccd27&&(_0x2ccd27=!![],_0x4b8068());}),_0x5b7a3d['on'](_0x5a4f2f(0x1cc),()=>{const _0x381c69=_0x5a4f2f;!_0x2ccd27&&_0x5b7a3d[_0x381c69(0x1c3)]&&(_0x5b7a3d[_0x381c69(0x1c3)]['on']('error',()=>{}),_0x5b7a3d[_0x381c69(0x1c3)][_0x381c69(0x1b4)](_0x1e7a19),_0x5b7a3d[_0x381c69(0x1c3)][_0x381c69(0x1a2)]());}),!_0x5b7a3d['stdin']&&(!_0x2ccd27&&(_0x2ccd27=!![],console[_0x5a4f2f(0x1c1)](_0x1e7a19),_0x4b8068()));}):(console['log'](_0x1e7a19),Promise['resolve']());}export async function handleSDKOutput(_0x1b2671,_0xc97c5e){const _0x1703c4=a56_0x3690,_0x3c7327=resolveOutputOptions(_0xc97c5e),_0x305dbb=await formatSDKOutput(_0x1b2671,_0x3c7327);await writeOutput(_0x305dbb,_0x3c7327[_0x1703c4(0x1c5)]||undefined,_0x3c7327[_0x1703c4(0x1cb)]);}function a56_0x39fc(){const _0x16238b=['json','object','write','tsv','jsonl','stderr','split','map','keys','data','bigint','string','-FXRSn','isInteger','limit','log','[params]','stdin','[query]','output','1590088fPgBGD','query','color','debug','magenta','format','spawn','stdout','pipe','yellow','noColor','490UkOjIs','16384baWcLy','filter','entries','forEach','stringify','varchar','double','4919971qOPUkq','cmdout','limitStructuredFormats','1151344fVngxf','repeat','[Object]','error','─┬─','10LVtZBp','params','max','[rule]','number','resolve','table','─┴─','trim','inherit','5846489ZiYJKq','end','less','27DAPGev','3shwiCd','push','Results\x20saved\x20to\x20','2339892SbbKWM','padEnd','join','slice','list','boolean','bold','rule','1322270oMPvMK','length'];a56_0x39fc=function(){return _0x16238b;};return a56_0x39fc();}export async function handleQueryOutput(_0x5f3cac,_0x4ab4c7){const _0x47de4a=a56_0x3690,_0x30a39c=resolveOutputOptions(_0x4ab4c7),_0x4590a2=await formatQueryOutput(_0x5f3cac,_0x30a39c);await writeOutput(_0x4590a2,_0x30a39c[_0x47de4a(0x1c5)]||undefined,_0x30a39c[_0x47de4a(0x1cb)]);}async function formatSingleObject(_0x12bed3,_0xdb8484){const _0x2cc96b=a56_0x3690,{format:_0x57154b,color:_0x269d30,noColor:_0x24a7cd}=_0xdb8484,_0x447cc9={'color':_0x269d30,'noColor':_0x24a7cd};if(_0x57154b===_0x2cc96b(0x1b2)){if(shouldUseColor(_0x447cc9))return colorizeJSON(_0x12bed3,_0x447cc9);return JSON[_0x2cc96b(0x1d6)](_0x12bed3,null,0x2);}else{if(_0x57154b==='jsonl'){if(shouldUseColor(_0x447cc9))return colorizeJSONCompact(_0x12bed3,_0x447cc9);return JSON[_0x2cc96b(0x1d6)](_0x12bed3);}else{if(_0x57154b===_0x2cc96b(0x1b5))return Object[_0x2cc96b(0x1d4)](_0x12bed3)[_0x2cc96b(0x1b9)](([_0x3d3931,_0x5b3519])=>_0x3d3931+'\x09'+_0x5b3519)[_0x2cc96b(0x1aa)]('\x0a');else{const _0xade58d=Object[_0x2cc96b(0x1d4)](_0x12bed3);if(_0xade58d[_0x2cc96b(0x1b1)]===0x0)return'No\x20data';const _0x4fa157=_0x12bed3['debug'],_0x1814fa=_0x12bed3[_0x2cc96b(0x1c7)],_0xa24a14=_0x12bed3[_0x2cc96b(0x198)],_0x788648=_0x12bed3[_0x2cc96b(0x1af)],_0x4a0705=_0x1814fa?typeof _0x1814fa===_0x2cc96b(0x1bd)?_0x1814fa:JSON[_0x2cc96b(0x1d6)](_0x1814fa,null,0x2):undefined,_0x456515=_0xa24a14&&Object[_0x2cc96b(0x1ba)](_0xa24a14)[_0x2cc96b(0x1b1)]>0x0?JSON[_0x2cc96b(0x1d6)](_0xa24a14,null,0x2):undefined,_0x35e18f=_0x788648&&Object['keys'](_0x788648)['length']>0x0?JSON[_0x2cc96b(0x1d6)](_0x788648,null,0x2):undefined,_0xe0679c=_0xade58d[_0x2cc96b(0x1d3)](([_0x44274b])=>_0x44274b!==_0x2cc96b(0x1c9)&&_0x44274b!=='query'&&_0x44274b!==_0x2cc96b(0x198)&&_0x44274b!==_0x2cc96b(0x1af)),_0x40a14f=Math[_0x2cc96b(0x199)](..._0xe0679c[_0x2cc96b(0x1b9)](([_0x8226ca])=>_0x8226ca['length'])),_0x440941=Math[_0x2cc96b(0x199)](..._0xe0679c[_0x2cc96b(0x1b9)](([,_0x16f48c])=>{const _0x3b7470=_0x2cc96b;try{const _0x21f4d6=_0x16f48c===null||_0x16f48c===undefined?'':typeof _0x16f48c===_0x3b7470(0x1b3)?JSON[_0x3b7470(0x1d6)](_0x16f48c):String(_0x16f48c),_0xa03540=_0x21f4d6[_0x3b7470(0x1b8)]('\x0a');return Math[_0x3b7470(0x199)](..._0xa03540['map'](_0x17b99f=>_0x17b99f[_0x3b7470(0x1b1)]),0x0);}catch{return 0x0;}}),0x14),_0x3d3e87=[];_0x3d3e87[_0x2cc96b(0x1a6)](colorBorder('┌─'+'─'['repeat'](_0x40a14f)+_0x2cc96b(0x196)+'─'[_0x2cc96b(0x193)](_0x440941)+'─┐',_0x447cc9)),_0xe0679c['forEach'](([_0x44e125,_0x5c91f7])=>{const _0x5ce6b5=_0x2cc96b;let _0x366ee1;try{_0x366ee1=_0x5c91f7===null||_0x5c91f7===undefined?'':typeof _0x5c91f7==='object'?JSON[_0x5ce6b5(0x1d6)](_0x5c91f7):String(_0x5c91f7);}catch{_0x366ee1=_0x5ce6b5(0x194);}const _0x4baf92=_0x44e125[_0x5ce6b5(0x1a9)](_0x40a14f),_0x56ff79=_0x366ee1['split']('\x0a');_0x56ff79['forEach']((_0x445e23,_0x1b2940)=>{const _0x258727=_0x5ce6b5,_0x23c9e2=colorBorder('│',_0x447cc9);_0x1b2940===0x0?_0x3d3e87[_0x258727(0x1a6)](_0x23c9e2+'\x20'+_0x4baf92+'\x20'+_0x23c9e2+'\x20'+_0x445e23['padEnd'](_0x440941)+'\x20'+_0x23c9e2):_0x3d3e87[_0x258727(0x1a6)](_0x23c9e2+'\x20'+'\x20'['repeat'](_0x40a14f)+'\x20'+_0x23c9e2+'\x20'+_0x445e23[_0x258727(0x1a9)](_0x440941)+'\x20'+_0x23c9e2);});}),_0x3d3e87[_0x2cc96b(0x1a6)](colorBorder('└─'+'─'[_0x2cc96b(0x193)](_0x40a14f)+_0x2cc96b(0x19e)+'─'[_0x2cc96b(0x193)](_0x440941)+'─┘',_0x447cc9));_0x4a0705&&(_0x3d3e87[_0x2cc96b(0x1a6)](''),_0x3d3e87['push'](String(a56_0x48f428[_0x2cc96b(0x1cf)][_0x2cc96b(0x1ae)](_0x2cc96b(0x1c4)))),_0x3d3e87[_0x2cc96b(0x1a6)](_0x4a0705));_0x456515&&(_0x3d3e87[_0x2cc96b(0x1a6)](''),_0x3d3e87[_0x2cc96b(0x1a6)](String(a56_0x48f428['blue'][_0x2cc96b(0x1ae)](_0x2cc96b(0x1c2)))),_0x3d3e87['push'](_0x456515));_0x35e18f&&(_0x3d3e87[_0x2cc96b(0x1a6)](''),_0x3d3e87[_0x2cc96b(0x1a6)](String(a56_0x48f428[_0x2cc96b(0x1ca)][_0x2cc96b(0x1ae)](_0x2cc96b(0x19a)))),_0x3d3e87[_0x2cc96b(0x1a6)](_0x35e18f));if(_0x4fa157){if(_0x4fa157[_0x2cc96b(0x1b7)]){_0x3d3e87[_0x2cc96b(0x1a6)](''),_0x3d3e87[_0x2cc96b(0x1a6)](String(a56_0x48f428['red'][_0x2cc96b(0x1ae)]('[error]')));const _0x17b0a3=_0x4fa157[_0x2cc96b(0x1b7)][_0x2cc96b(0x1b8)]('\x0a');_0x17b0a3[_0x2cc96b(0x1d5)](_0x268abe=>{const _0x285abc=_0x2cc96b;_0x268abe[_0x285abc(0x19f)]()&&_0x3d3e87['push'](_0x268abe);});}if(_0x4fa157[_0x2cc96b(0x1da)]){_0x3d3e87[_0x2cc96b(0x1a6)](''),_0x3d3e87[_0x2cc96b(0x1a6)](String(a56_0x48f428['cyan'][_0x2cc96b(0x1ae)]('[logs]')));const _0x1a85d9=_0x4fa157[_0x2cc96b(0x1da)][_0x2cc96b(0x1b8)]('\x0a');_0x1a85d9[_0x2cc96b(0x1d5)](_0x125410=>{const _0x24e054=_0x2cc96b;_0x125410[_0x24e054(0x19f)]()&&_0x3d3e87[_0x24e054(0x1a6)](_0x125410);});}}return _0x3d3e87['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x5755b8,_0x196f03){const _0x186f30=a56_0x3690;if(_0x196f03[_0x186f30(0x1cb)]===_0x186f30(0x19d)){await handleSDKOutput([_0x5755b8],_0x196f03);return;}const _0x47dfcc=resolveOutputOptions(_0x196f03),_0x4c015e=await formatSingleObject(_0x5755b8,_0x47dfcc);await writeOutput(_0x4c015e,_0x47dfcc[_0x186f30(0x1c5)]||undefined,_0x47dfcc[_0x186f30(0x1cb)]);}