@treasuredata/tdx 2026.3.53 → 2026.3.55

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 (254) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.d.ts +2 -2
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/llm.d.ts +158 -0
  193. package/dist/sdk/types/llm.d.ts.map +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/types/workflow.d.ts +26 -0
  196. package/dist/sdk/types/workflow.d.ts.map +1 -1
  197. package/dist/sdk/types/workspace.js +1 -1
  198. package/dist/sdk/user.js +1 -1
  199. package/dist/sdk/util/format-detector.js +1 -1
  200. package/dist/sdk/util/formatters.js +1 -1
  201. package/dist/sdk/util/index.js +1 -1
  202. package/dist/sdk/util/paginate.js +1 -1
  203. package/dist/sdk/util/tree-formatter.js +1 -1
  204. package/dist/sdk/workflow/archive-validation.js +1 -1
  205. package/dist/sdk/workflow/clone-workflow.js +1 -1
  206. package/dist/sdk/workflow/index.d.ts +22 -0
  207. package/dist/sdk/workflow/index.d.ts.map +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/index.js.map +1 -1
  210. package/dist/sdk/workflow/pull-workflow.js +1 -1
  211. package/dist/sdk/workflow/push-workflow.js +1 -1
  212. package/dist/sdk/workflow/tdx-config.js +1 -1
  213. package/dist/sdk/workflow/workflow-utils.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.d.ts.map +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/process.js.map +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +2 -2
@@ -1 +1 @@
1
- const a54_0x12ede4=a54_0x2841;(function(_0x33597c,_0x895142){const _0xdcb0e5=a54_0x2841,_0x28ee82=_0x33597c();while(!![]){try{const _0x109d3a=-parseInt(_0xdcb0e5(0x220))/0x1*(-parseInt(_0xdcb0e5(0x11a))/0x2)+-parseInt(_0xdcb0e5(0x11e))/0x3+parseInt(_0xdcb0e5(0x200))/0x4+parseInt(_0xdcb0e5(0x1b9))/0x5+-parseInt(_0xdcb0e5(0x1b7))/0x6*(parseInt(_0xdcb0e5(0xe0))/0x7)+parseInt(_0xdcb0e5(0xbe))/0x8*(-parseInt(_0xdcb0e5(0xbc))/0x9)+parseInt(_0xdcb0e5(0x12d))/0xa;if(_0x109d3a===_0x895142)break;else _0x28ee82['push'](_0x28ee82['shift']());}catch(_0x5c6be3){_0x28ee82['push'](_0x28ee82['shift']());}}}(a54_0x8031,0x89cd0));import a54_0x9af19e from'chalk';import{existsSync}from'fs';function a54_0x2841(_0x5701d6,_0x55186e){_0x5701d6=_0x5701d6-0x73;const _0x803156=a54_0x8031();let _0x2841cd=_0x803156[_0x5701d6];return _0x2841cd;}import a54_0x254133 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x435c0a from'prompts';function getAttemptStatusDisplay(_0x307f30){const _0x37369c=a54_0x2841;if(!_0x307f30)return{'icon':'⏳','text':''};const {done:_0x4702ff,success:_0x2a09f0,cancelRequested:_0x194a23}=_0x307f30;if(!_0x4702ff)return _0x194a23?{'icon':'🛑','text':a54_0x9af19e['yellow'](_0x37369c(0x157))}:{'icon':'🔄','text':a54_0x9af19e[_0x37369c(0x101)](_0x37369c(0x7f))};if(_0x2a09f0)return{'icon':'✅','text':a54_0x9af19e[_0x37369c(0xde)](_0x37369c(0x21d))};return{'icon':'❌','text':a54_0x9af19e[_0x37369c(0xab)](_0x37369c(0x214))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x5be9ec,_0x3fce72,_0x1502dd=0x0){return _0x5be9ec[_0x1502dd]||_0x3fce72['workflowProject'];}[a54_0x12ede4(0xc6)](_0x508c62,_0x41193a,_0x4ff67a=0x0){const _0xa248bc=a54_0x12ede4,_0x80f9b0=this[_0xa248bc(0x1f8)](_0x508c62,_0x41193a,_0x4ff67a);if(!_0x80f9b0)return console[_0xa248bc(0x214)](a54_0x9af19e[_0xa248bc(0xab)](_0xa248bc(0x163)),'Project\x20name\x20is\x20required'),console['error'](a54_0x9af19e[_0xa248bc(0x1f1)](_0xa248bc(0x89))),null;return _0x80f9b0;}[a54_0x12ede4(0x9d)](_0x2983b3,_0x29a1cd){const _0x102bf9=a54_0x12ede4;if(_0x2983b3[0x0]){const _0xc85fac=_0x2983b3[0x0][_0x102bf9(0x12f)]('.');if(_0xc85fac[_0x102bf9(0x1d8)]===0x1)return{'projectName':_0xc85fac[0x0],'workflowName':undefined};else return _0xc85fac['length']===0x2?{'projectName':_0xc85fac[0x0],'workflowName':_0xc85fac[0x1]}:(console[_0x102bf9(0x214)](a54_0x9af19e[_0x102bf9(0xab)](_0x102bf9(0x163)),_0x102bf9(0x1c5)),null);}return{'projectName':_0x29a1cd[_0x102bf9(0x16f)],'workflowName':undefined};}[a54_0x12ede4(0xc3)](_0x2ef50f,_0x204389,_0xc1b361=0x0){const _0x3c2f96=a54_0x12ede4;if(_0x2ef50f[_0xc1b361])return _0x2ef50f[_0xc1b361];if(_0x204389[_0x3c2f96(0x16f)]){const _0x5db90e=a54_0x254133[_0x3c2f96(0xbf)](process[_0x3c2f96(0x1bd)](),_0x3c2f96(0x15f),_0x204389[_0x3c2f96(0x16f)]);if(existsSync(a54_0x254133[_0x3c2f96(0xbf)](_0x5db90e,_0x3c2f96(0x125))))return _0x5db90e;}return undefined;}async[a54_0x12ede4(0xc1)](_0x26bd71,_0x15858b,_0x75d655){const _0x2410b1=a54_0x12ede4;try{const _0x25a469=await _0x26bd71['workflow'][_0x2410b1(0x15f)](_0x15858b,{'limit':0x1});if(_0x25a469[_0x2410b1(0x1d8)]>0x0){const _0x64c667=_0x25a469[0x0]['id'],_0x366a64=getWorkflowUrl(_0x75d655,_0x64c667);console['error'](_0x2410b1(0x106)+a54_0x9af19e['cyan'](_0x366a64));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x18a);async['execute'](_0x4093ea){const _0x597eb7=a54_0x12ede4,{options:_0x5681e7,args:_0x182b32,tdx:_0x390ace}=_0x4093ea,_0x279ba4=_0x182b32[0x0],_0x37d5e0=_0x5681e7[_0x597eb7(0x17b)];if(_0x37d5e0)return saveSessionContext({'workflow_project':undefined},_0x5681e7[_0x597eb7(0x12b)]),console[_0x597eb7(0x144)](a54_0x9af19e[_0x597eb7(0xde)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x279ba4)return console[_0x597eb7(0x214)](a54_0x9af19e[_0x597eb7(0xab)](_0x597eb7(0x163)),_0x597eb7(0x98)),console[_0x597eb7(0x214)](a54_0x9af19e[_0x597eb7(0x1f1)](_0x597eb7(0x135))),console[_0x597eb7(0x214)](a54_0x9af19e['dim'](_0x597eb7(0xb7))),0x1;const _0x38b774=await withSpinner('Resolving\x20project\x20\x27'+_0x279ba4+_0x597eb7(0xc2),()=>_0x390ace['workflow'][_0x597eb7(0x1fd)](_0x279ba4),{'verbose':_0x5681e7[_0x597eb7(0x19b)]}),{name:_0x35eee4}=_0x38b774[_0x597eb7(0x10a)];return saveSessionContext({'workflow_project':_0x35eee4},_0x5681e7[_0x597eb7(0x12b)]),console['log'](a54_0x9af19e[_0x597eb7(0xde)](_0x597eb7(0x152)+a54_0x9af19e[_0x597eb7(0x124)](_0x35eee4))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x7e);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1eb);async[a54_0x12ede4(0x202)](_0x2a9c7a){const _0x230be7=a54_0x12ede4,{options:_0x6e38f8,args:_0x7b551e,tdx:_0x55272c}=_0x2a9c7a,_0x16e4bd=_0x7b551e[0x0];_0x6e38f8[_0x230be7(0x19b)]&&_0x16e4bd&&console[_0x230be7(0x214)](_0x230be7(0x1b6)+_0x16e4bd);const _0x1067a9=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x55272c[_0x230be7(0x1f4)][_0x230be7(0xce)](_0x16e4bd,{'limit':_0x6e38f8[_0x230be7(0x13d)]}),{'verbose':_0x6e38f8['verbose']});let _0x462a80=_0x1067a9[_0x230be7(0x10a)];_0x462a80[_0x230be7(0x154)]((_0x5a0736,_0x1c4edf)=>_0x5a0736[_0x230be7(0x1a3)]['localeCompare'](_0x1c4edf[_0x230be7(0x1a3)]));const _0x1a87d9=_0x6e38f8[_0x230be7(0x13d)]||0x64,_0x45b0b4=_0x462a80[_0x230be7(0x1d8)]>=_0x1a87d9?a54_0x9af19e[_0x230be7(0x1f1)](_0x230be7(0x1a0)):'';console[_0x230be7(0x214)]('✔\x20Found\x20'+_0x462a80[_0x230be7(0x1d8)]+_0x230be7(0x145)+(_0x462a80[_0x230be7(0x1d8)]!==0x1?'s':'')+_0x45b0b4);if(_0x6e38f8[_0x230be7(0x1ba)]===_0x230be7(0x11f)||_0x6e38f8['format']===_0x230be7(0x11b)||_0x6e38f8[_0x230be7(0x1ba)]===_0x230be7(0x99))await handleSDKOutput(_0x462a80,_0x6e38f8);else{if(_0x462a80['length']===0x0)_0x16e4bd?console[_0x230be7(0x144)](_0x230be7(0x1a9)+_0x16e4bd):console[_0x230be7(0x144)]('No\x20workflow\x20projects\x20found');else{const _0x3331e8=_0x462a80[_0x230be7(0x76)](_0x13b632=>{const _0x175119=_0x230be7,_0xbb4923=_0x13b632[_0x175119(0x1e1)]?.['some'](_0x3d3ac5=>_0x3d3ac5[_0x175119(0x82)]==='sys'),_0x1827ad=_0xbb4923?a54_0x9af19e[_0x175119(0x1f1)](_0x175119(0x12e)):'';return _0x175119(0x134)+_0x13b632[_0x175119(0x1a3)]+_0x1827ad;});await writeOutput(_0x3331e8[_0x230be7(0xbf)]('\x0a'),_0x6e38f8[_0x230be7(0x192)],_0x230be7(0x1f7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x94);['description']=a54_0x12ede4(0xb6);async[a54_0x12ede4(0x202)](_0x4741e2){const _0x4183b9=a54_0x12ede4,{options:_0x2a5b8b,args:_0x5e502e,tdx:_0x5ed5b1}=_0x4741e2,_0x57a04e=this[_0x4183b9(0x1f8)](_0x5e502e,_0x2a5b8b);_0x2a5b8b['verbose']&&_0x57a04e&&console['error'](_0x4183b9(0xd5)+_0x57a04e);const _0xd1132b=await withSpinner(_0x4183b9(0x131),()=>_0x5ed5b1['workflow'][_0x4183b9(0x15f)](_0x57a04e,{'limit':_0x2a5b8b['limit']}),{'verbose':_0x2a5b8b['verbose']});let _0xa6e90a=_0xd1132b['data'];_0xa6e90a['sort']((_0x528dcb,_0x2ee326)=>{const _0x3c00f8=_0x4183b9,_0x3d882b=_0x528dcb[_0x3c00f8(0x1a3)][_0x3c00f8(0x1cf)](_0x2ee326[_0x3c00f8(0x1a3)]);if(_0x3d882b!==0x0)return _0x3d882b;return(_0x528dcb[_0x3c00f8(0x168)]?.['name']||'')[_0x3c00f8(0x1cf)](_0x2ee326['project']?.['name']||'');});const _0x3a421c=_0x2a5b8b[_0x4183b9(0x13d)]||0x64,_0x485e1b=_0xa6e90a['length']>=_0x3a421c?a54_0x9af19e[_0x4183b9(0x1f1)](_0x4183b9(0x1a0)):'';console[_0x4183b9(0x214)](_0x4183b9(0x7d)+_0xa6e90a[_0x4183b9(0x1d8)]+_0x4183b9(0x1dd)+(_0xa6e90a[_0x4183b9(0x1d8)]!==0x1?'s':'')+_0x485e1b);if(_0x2a5b8b['format']==='json'||_0x2a5b8b['format']===_0x4183b9(0x11b)||_0x2a5b8b[_0x4183b9(0x1ba)]===_0x4183b9(0x99))await handleSDKOutput(_0xa6e90a,_0x2a5b8b);else{if(_0xa6e90a[_0x4183b9(0x1d8)]===0x0)_0x57a04e?console['log'](_0x4183b9(0x11c)+_0x57a04e):console['log'](_0x4183b9(0x13f));else{const _0x5401c9=_0x2a5b8b[_0x4183b9(0x10d)],_0x418a7c=_0xa6e90a['map'](_0x47d665=>{const _0x203e7f=_0x4183b9,_0x549d83=a54_0x9af19e['dim']('#'+_0x47d665['id']),_0x5708b6=hyperlink(_0x549d83,getWorkflowUrl(_0x5401c9,_0x47d665['id'])),_0x1b5327=_0x47d665[_0x203e7f(0x168)]?.[_0x203e7f(0x1a3)]?a54_0x9af19e[_0x203e7f(0x1f1)]('\x20('+_0x47d665['project'][_0x203e7f(0x1a3)]+')'):'';return _0x203e7f(0x1d3)+_0x5708b6+'\x20'+_0x47d665[_0x203e7f(0x1a3)]+_0x1b5327;});await writeOutput(_0x418a7c['join']('\x0a'),_0x2a5b8b['output'],_0x4183b9(0x1f7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1e4);async['execute'](_0x1c284f){const _0x3432a2=a54_0x12ede4,{options:_0x17072d,args:_0x4ca93c,tdx:_0x10caf}=_0x1c284f,_0x333c2a=this[_0x3432a2(0x9d)](_0x4ca93c,_0x17072d);if(!_0x333c2a)return 0x1;const {projectName:_0x3359c0,workflowName:_0x294cd4}=_0x333c2a;if(_0x17072d[_0x3432a2(0x19b)]){if(_0x3359c0&&_0x294cd4)console[_0x3432a2(0x214)](_0x3432a2(0xfe)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0&&console[_0x3432a2(0x214)](_0x3432a2(0x11d)+_0x3359c0);const _0x410b8e=_0x17072d[_0x3432a2(0x119)];_0x410b8e&&console['error'](_0x3432a2(0x1ad)+_0x410b8e);}let _0x1866a9=0x28;if(process[_0x3432a2(0xd7)]['isTTY']&&!_0x17072d[_0x3432a2(0x192)]&&!_0x17072d[_0x3432a2(0x1ba)]){const _0x2266b0=process[_0x3432a2(0xd7)][_0x3432a2(0x8d)]||0x28;_0x1866a9=Math[_0x3432a2(0x1ca)](0x14,Math['floor'](_0x2266b0*0x2/0x3));}const _0x1ba108=_0x17072d[_0x3432a2(0x13d)]||_0x1866a9,_0xefa91a=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x10caf[_0x3432a2(0x1f4)][_0x3432a2(0x1e5)]({'projectName':_0x3359c0,'workflowName':_0x294cd4,'status':_0x17072d[_0x3432a2(0x119)],'fromTime':_0x17072d[_0x3432a2(0x205)],'toTime':_0x17072d['to'],'limit':_0x1ba108}),{'verbose':_0x17072d['verbose']}),_0x107e4f=_0xefa91a['data'];_0x107e4f[_0x3432a2(0x154)]((_0x2a28ff,_0x17176c)=>{const _0x514561=_0x3432a2,_0x488575=_0x2a28ff[_0x514561(0x1ed)]||'',_0xdb4425=_0x17176c[_0x514561(0x1ed)]||'';return _0xdb4425[_0x514561(0x1cf)](_0x488575);});_0x107e4f[_0x3432a2(0x1d8)]>=_0x1ba108?console[_0x3432a2(0x214)]('✔\x20Showing\x20'+_0x107e4f[_0x3432a2(0x1d8)]+_0x3432a2(0x1aa)+a54_0x9af19e['dim'](_0x3432a2(0xf1))):console[_0x3432a2(0x214)](_0x3432a2(0x7d)+_0x107e4f['length']+_0x3432a2(0x17e)+(_0x107e4f[_0x3432a2(0x1d8)]!==0x1?'s':''));if(_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x11f)||_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x11b)||_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x99))await handleSDKOutput(_0x107e4f,_0x17072d);else{if(!process[_0x3432a2(0xd7)][_0x3432a2(0x1b8)]||_0x17072d[_0x3432a2(0x192)]){if(_0x107e4f[_0x3432a2(0x1d8)]===0x0){if(_0x3359c0&&_0x294cd4)console[_0x3432a2(0x144)](_0x3432a2(0x1a6)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0?console[_0x3432a2(0x144)](_0x3432a2(0x16a)+_0x3359c0):console['log'](_0x3432a2(0x201));}else{const _0x2a43f0=_0x17072d[_0x3432a2(0x10d)],_0x28eb39=this[_0x3432a2(0x1ac)](_0x107e4f,_0x2a43f0);_0x17072d['output']?await writeOutput(_0x28eb39,_0x17072d[_0x3432a2(0x192)],'list'):console[_0x3432a2(0x144)](_0x28eb39);}!_0x3359c0&&(console[_0x3432a2(0x214)](''),console[_0x3432a2(0x214)](a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0xa3))),console[_0x3432a2(0x214)](a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0xf0))+'or'+a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0x173))));}else{if(_0x107e4f[_0x3432a2(0x1d8)]===0x0){if(_0x3359c0&&_0x294cd4)console['log'](_0x3432a2(0x1a6)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0?console[_0x3432a2(0x144)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3359c0):console['log'](_0x3432a2(0x201));}else await this[_0x3432a2(0x7b)](_0x107e4f,_0x1c284f,_0x3359c0);}}return 0x0;}['renderSessionsTimeline'](_0x467fc9,_0x1d168c){const _0x301cc3=a54_0x12ede4,_0x315875=[],_0x4f8433=new Map();let _0x40f1ea=Infinity,_0x1a1b96=-Infinity;for(const _0x488a9d of _0x467fc9){if(_0x488a9d[_0x301cc3(0x117)]?.[_0x301cc3(0xd2)]){const _0x236fb1=new Date(_0x488a9d[_0x301cc3(0x117)][_0x301cc3(0xd2)])[_0x301cc3(0x1b0)](),_0x5704ae=_0x488a9d[_0x301cc3(0x117)][_0x301cc3(0x166)]?new Date(_0x488a9d['lastAttempt'][_0x301cc3(0x166)])['getTime']():Date['now'](),_0x4af6f9=_0x488a9d[_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||_0x301cc3(0x156);!_0x4f8433[_0x301cc3(0xd4)](_0x4af6f9)&&_0x4f8433[_0x301cc3(0x1ee)](_0x4af6f9,[]),_0x4f8433['get'](_0x4af6f9)[_0x301cc3(0x1cd)]({'session':_0x488a9d,'startTime':_0x236fb1,'endTime':_0x5704ae,'duration':_0x5704ae-_0x236fb1}),_0x40f1ea=Math[_0x301cc3(0x20b)](_0x40f1ea,_0x236fb1),_0x1a1b96=Math[_0x301cc3(0x1ca)](_0x1a1b96,_0x5704ae);}}if(_0x4f8433[_0x301cc3(0x1f5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x426bbe=process['stdout']['columns']||0x78,_0x1eefc5=0x1e,_0x2000f5=0x32,_0x59ebe6=0x4,_0x1e976a=Math[_0x301cc3(0x20b)](_0x2000f5,Math['max'](_0x1eefc5,Math['floor'](_0x426bbe*0.3))),_0x25c1df=_0x426bbe-_0x1e976a-TIMELINE_CONFIG[_0x301cc3(0xeb)]-0x3-_0x59ebe6,_0x162c7a=_0x1a1b96-_0x40f1ea,_0x3955d4=_0x162c7a/_0x1e976a,_0x3df370=renderTimeAxis({'startTime':_0x40f1ea,'endTime':_0x1a1b96,'durationMs':_0x162c7a,'msPerChar':_0x3955d4},_0x1e976a),_0x1e9684=[];for(const _0x2c0348 of _0x4f8433['values']()){_0x1e9684[_0x301cc3(0x1cd)](..._0x2c0348);}_0x1e9684[_0x301cc3(0x154)]((_0x429196,_0x240315)=>_0x240315[_0x301cc3(0x1e3)]-_0x429196[_0x301cc3(0x1e3)]);const _0x17a19c=new Date(_0x40f1ea),_0x3a004d=formatDate(_0x17a19c),_0x5e7181=_0x59ebe6+TIMELINE_CONFIG[_0x301cc3(0xa4)]+TIMELINE_CONFIG[_0x301cc3(0xf8)]+_0x25c1df,_0x229ad9='\x20'[_0x301cc3(0xa8)](_0x5e7181-_0x3a004d[_0x301cc3(0x1d8)]),_0x6aab68=_0x229ad9+a54_0x9af19e[_0x301cc3(0x1f1)](_0x3a004d)+'\x20'+_0x3df370;_0x315875[_0x301cc3(0x1cd)](_0x6aab68);const _0x4994b6=0x16;let _0x397a29=0x0;for(const _0x22ee3e of _0x1e9684){const _0x46b93c=_0x22ee3e[_0x301cc3(0x12b)][_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||'?',_0x4ab858=Math[_0x301cc3(0x20b)](stringWidth(_0x46b93c),_0x4994b6);_0x397a29=Math['max'](_0x397a29,_0x4ab858);}for(const _0x5e2071 of _0x1e9684){const {session:_0x2d2bf9,startTime:_0xabfc80,endTime:_0x23f779,duration:_0xe0ee0e}=_0x5e2071,_0x49cfec=_0x2d2bf9['project']?.['id'],_0x546b88=_0x2d2bf9['id'],_0x1da1b9=_0x2d2bf9[_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||'?',_0x5d8080=_0x2d2bf9['workflow']?.[_0x301cc3(0x1a3)]||'?';let _0x5b6e6b,_0x3fa5b3;if(_0x2d2bf9[_0x301cc3(0x117)]){const _0x371a6b=_0x2d2bf9[_0x301cc3(0x117)];!_0x371a6b[_0x301cc3(0xb9)]?(_0x5b6e6b=_0x371a6b[_0x301cc3(0x8a)]?'🛑':'🔄',_0x3fa5b3=_0x371a6b['cancelRequested']?a54_0x9af19e['yellow']:a54_0x9af19e[_0x301cc3(0x101)]):(_0x5b6e6b=_0x371a6b[_0x301cc3(0x21d)]?'✅':'❌',_0x3fa5b3=_0x371a6b[_0x301cc3(0x21d)]?a54_0x9af19e[_0x301cc3(0xde)]:a54_0x9af19e[_0x301cc3(0xab)]);}else _0x5b6e6b='⏳',_0x3fa5b3=a54_0x9af19e['dim'];const _0x4f980a='#'+_0x546b88,_0x292264=_0x49cfec?hyperlink(_0x4f980a,getWorkflowSessionUrl(_0x1d168c,_0x49cfec,_0x546b88)):_0x4f980a;let _0x24e040=_0x1da1b9;stringWidth(_0x1da1b9)>_0x4994b6&&(_0x24e040=_0x1da1b9[_0x301cc3(0x17a)](0x0,_0x4994b6-0x1)+'…');const _0x4ed033=a54_0x9af19e[_0x301cc3(0x1f1)](_0x24e040),_0x242539=stringWidth(_0x24e040),_0x23779f='\x20'[_0x301cc3(0xa8)](_0x397a29-stringWidth(_0x24e040)+0x2),_0x5f1781='('+formatElapsed(_0xe0ee0e)+')',_0x5f19c0=stringWidth(_0x5f1781),_0x428e31=stringWidth(_0x4f980a),_0x3faa87=_0x428e31+0x1+_0x242539+_0x23779f['length'],_0x1a7811=_0x25c1df-_0x3faa87-_0x5f19c0-0x1-0x8;let _0x15365f=_0x5d8080;stringWidth(_0x15365f)>_0x1a7811&&(_0x15365f=_0x15365f[_0x301cc3(0x17a)](0x0,_0x1a7811-0x1)+'…');const _0xfebd98=_0x292264+'\x20'+_0x4ed033+_0x23779f+_0x15365f,_0x11ef7a=stringWidth(_0xfebd98),_0x48c96b=_0x25c1df-_0x11ef7a-_0x5f19c0,_0x5a409e=_0xfebd98+'\x20'[_0x301cc3(0xa8)](Math[_0x301cc3(0x1ca)](0x1,_0x48c96b))+a54_0x9af19e[_0x301cc3(0x1f1)](_0x5f1781),_0x4ffc94=Math['floor']((_0xabfc80-_0x40f1ea)/_0x3955d4),_0x12f0cb=Math[_0x301cc3(0x198)]((_0x23f779-_0x40f1ea)/_0x3955d4),_0x257a62=Math[_0x301cc3(0x1ca)](_0x4ffc94+0x1,_0x12f0cb),_0x519399=new Array(_0x1e976a)['fill']('\x20');for(let _0x748bbe=_0x4ffc94;_0x748bbe<Math['min'](_0x257a62,_0x1e976a);_0x748bbe++){_0x519399[_0x748bbe]='─';}const _0x5d5c75=_0x519399[_0x301cc3(0x76)](_0x2bfa9f=>_0x2bfa9f==='\x20'?'\x20':_0x3fa5b3(_0x2bfa9f))[_0x301cc3(0xbf)]('');_0x315875[_0x301cc3(0x1cd)](_0x5b6e6b+'\x20'+_0x5a409e+'│'+_0x5d5c75+'│');}return _0x315875[_0x301cc3(0xbf)]('\x0a');}async[a54_0x12ede4(0x7b)](_0x541f70,_0x40403d,_0x460c25){const _0x3f15cb=a54_0x12ede4,{options:_0x58e4a6,tdx:_0x5845c7}=_0x40403d,_0x5d0ede=_0x58e4a6[_0x3f15cb(0x10d)],{timelineRows:_0x19b34f,timeAxisHeader:_0x70113f}=this[_0x3f15cb(0x1fa)](_0x541f70,_0x5d0ede),_0x21be23=_0x19b34f[_0x3f15cb(0xf3)](_0x554bcb=>_0x554bcb[_0x3f15cb(0x1f2)]);if(_0x21be23[_0x3f15cb(0x1d8)]===0x0){const _0x3d0a95=this[_0x3f15cb(0x1ac)](_0x541f70,_0x5d0ede);console['log'](_0x3d0a95);!_0x460c25&&(console[_0x3f15cb(0x214)](''),console[_0x3f15cb(0x214)](a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0xa3))),console['error'](a54_0x9af19e['dim'](_0x3f15cb(0xf0))+'or'+a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0x173))));return;}_0x70113f&&console[_0x3f15cb(0x144)](_0x70113f);const _0x57c0a1=_0x19b34f[_0x3f15cb(0xf3)](_0x426e0f=>_0x426e0f[_0x3f15cb(0x1f2)])[_0x3f15cb(0x76)](_0x17852b=>({'title':_0x17852b[_0x3f15cb(0x93)],'value':_0x17852b[_0x3f15cb(0x1f2)]})),_0x4d268e=process[_0x3f15cb(0xd7)][_0x3f15cb(0x8d)]||0x3c,_0x5eb12e=Math[_0x3f15cb(0x1ca)](0x28,Math['floor'](_0x4d268e*0x2/0x3)),_0x594efa=await a54_0x435c0a({'type':_0x3f15cb(0x19d),'name':_0x3f15cb(0x1f2),'message':_0x3f15cb(0x12c),'choices':_0x57c0a1,'initial':-0x1,'limit':_0x5eb12e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0xcaf48c,_0x23159a)=>{const _0x88f1ab=_0x3f15cb;if(!_0xcaf48c)return Promise['resolve'](_0x23159a);const _0x5426bc=_0x23159a[_0x88f1ab(0xf3)](_0x40cd53=>{const _0x3c7af3=_0x88f1ab,_0x3fc31f=_0x40cd53;return _0x3fc31f[_0x3c7af3(0x85)][_0x3c7af3(0xdf)]()[_0x3c7af3(0x20a)](_0xcaf48c[_0x3c7af3(0xdf)]());});return Promise['resolve'](_0x5426bc);}}),_0x5de3b6=()=>{const _0x1fee08=_0x3f15cb;process[_0x1fee08(0xd7)][_0x1fee08(0x10f)](_0x1fee08(0x1cc)),process[_0x1fee08(0xd7)][_0x1fee08(0x10f)](_0x1fee08(0x1cc)),process[_0x1fee08(0xd7)][_0x1fee08(0x10f)]('\x1b[1A\x1b[2K');},_0x29ff61=_0x594efa&&_0x594efa[_0x3f15cb(0x1f2)]&&_0x594efa[_0x3f15cb(0x1f2)]!==null&&_0x594efa[_0x3f15cb(0x1f2)][_0x3f15cb(0xc7)]()!=='';if(!_0x29ff61){_0x5de3b6(),console[_0x3f15cb(0x144)](a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0x148)));return;}_0x5de3b6();const _0x2f02ab=_0x541f70[_0x3f15cb(0x1f3)](_0x5c63cf=>_0x5c63cf[_0x3f15cb(0x117)]?.['id']===_0x594efa[_0x3f15cb(0x1f2)]);if(_0x2f02ab){const _0x53ee59=_0x2f02ab[_0x3f15cb(0x168)]?.['name']||'?',_0x44abe6=_0x2f02ab[_0x3f15cb(0x1f4)]?.[_0x3f15cb(0x1a3)]||'?';console['log'](_0x3f15cb(0x1c2)+a54_0x9af19e[_0x3f15cb(0x1f1)](_0x53ee59)+_0x3f15cb(0x17c)+a54_0x9af19e['dim'](_0x44abe6));}const _0x2046c7=new WorkflowTimelineCommand();await _0x2046c7[_0x3f15cb(0x202)]({'args':[],'options':{..._0x58e4a6,'attemptId':_0x594efa[_0x3f15cb(0x1f2)]},'tdx':_0x5845c7});}['generateSessionTimelineRows'](_0x5933ca,_0x3de01a){const _0x2b8649=a54_0x12ede4,_0x1d90d7=new Map();for(const _0x168ab4 of _0x5933ca){_0x168ab4['id']&&_0x168ab4[_0x2b8649(0x117)]?.['id']&&_0x1d90d7['set'](_0x168ab4['id'],_0x168ab4[_0x2b8649(0x117)]['id']);}const _0x38e4cc=[];let _0x294d79='';const _0x5b4021=this[_0x2b8649(0x1ac)](_0x5933ca,_0x3de01a),_0x206d9e=_0x5b4021[_0x2b8649(0x12f)]('\x0a');for(const _0x341d51 of _0x206d9e){if(_0x341d51[_0x2b8649(0xb4)](_0x2b8649(0x211))||_0x341d51[_0x2b8649(0x111)](/^\s+\d{4}-\d{2}-\d{2}/))_0x294d79=_0x341d51;else{if(_0x341d51[_0x2b8649(0x111)](/^[✅❌🔄🛑⏳]/)){const _0xe45ca4=_0x341d51['match'](/#(\d+)/),_0x179c97=_0xe45ca4?_0xe45ca4[0x1]:null,_0x378173=_0x179c97?_0x1d90d7[_0x2b8649(0xbd)](_0x179c97)||null:null,_0x1c20e6=_0x5933ca[_0x2b8649(0x1f3)](_0x4ca01a=>_0x4ca01a['id']===_0x179c97),_0x4d3cb0=_0x1c20e6?.[_0x2b8649(0x168)]?.['name']||'';_0x38e4cc[_0x2b8649(0x1cd)]({'displayLine':_0x341d51,'attemptId':_0x378173,'projectName':_0x4d3cb0});}}}return{'timelineRows':_0x38e4cc,'timeAxisHeader':_0x294d79};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x126);['description']='List\x20workflow\x20attempts';async[a54_0x12ede4(0x202)](_0x491170){const _0x3b39f2=a54_0x12ede4,{options:_0x16f066,args:_0x416ae7,tdx:_0x53444a}=_0x491170,_0x255c52=this['parseProjectWorkflowPattern'](_0x416ae7,_0x16f066);if(!_0x255c52)return 0x1;const {projectName:_0x4be2cd,workflowName:_0x170c2d}=_0x255c52,_0x430343=_0x16f066['includeRetried'];if(_0x16f066['verbose']){if(_0x4be2cd&&_0x170c2d)console[_0x3b39f2(0x214)]('Filter:\x20'+_0x4be2cd+'.'+_0x170c2d);else _0x4be2cd&&console[_0x3b39f2(0x214)](_0x3b39f2(0x11d)+_0x4be2cd);_0x430343&&console[_0x3b39f2(0x214)](_0x3b39f2(0x10e));}const _0x1d60c3=await withSpinner(_0x3b39f2(0x91),()=>_0x53444a[_0x3b39f2(0x1f4)][_0x3b39f2(0x20d)]({'projectName':_0x4be2cd,'workflowName':_0x170c2d,'includeRetried':_0x430343,'limit':_0x16f066[_0x3b39f2(0x13d)]}),{'verbose':_0x16f066[_0x3b39f2(0x19b)]}),_0x5d1367=_0x1d60c3[_0x3b39f2(0x10a)],_0x3c45bc=_0x16f066[_0x3b39f2(0x13d)]||0x64,_0x2f750b=_0x5d1367[_0x3b39f2(0x1d8)]>=_0x3c45bc?a54_0x9af19e['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x5d1367['length']+'\x20attempt'+(_0x5d1367[_0x3b39f2(0x1d8)]!==0x1?'s':'')+_0x2f750b);if(_0x16f066[_0x3b39f2(0x1ba)]==='json'||_0x16f066[_0x3b39f2(0x1ba)]===_0x3b39f2(0x11b)||_0x16f066[_0x3b39f2(0x1ba)]==='table')await handleSDKOutput(_0x5d1367,_0x16f066);else{if(_0x5d1367['length']===0x0){if(_0x4be2cd&&_0x170c2d)console[_0x3b39f2(0x144)](_0x3b39f2(0x208)+_0x4be2cd+'.'+_0x170c2d);else _0x4be2cd?console[_0x3b39f2(0x144)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x4be2cd):console[_0x3b39f2(0x144)](_0x3b39f2(0x120));}else{const _0x48511e=_0x16f066[_0x3b39f2(0x10d)],_0x5d9d8e=_0x5d1367[_0x3b39f2(0x76)](_0xa983db=>{const _0x3fc551=_0x3b39f2,_0x4984a1=a54_0x9af19e[_0x3fc551(0x1f1)]('#'+_0xa983db['id']),_0x4f1fff=_0xa983db[_0x3fc551(0x168)]?.['id'],_0x38d237=_0xa983db[_0x3fc551(0x217)]||_0xa983db[_0x3fc551(0x1a1)],_0xe06e31=_0x4f1fff&&_0x38d237?hyperlink(_0x4984a1,getWorkflowAttemptUrl(_0x48511e,_0x4f1fff,_0x38d237,_0xa983db['id'])):_0x4984a1,{icon:_0x356ef9,text:_0x43bb74}=getAttemptStatusDisplay(_0xa983db),_0x359ec9=(_0xa983db['project']?.['name']||'?')+'.'+(_0xa983db[_0x3fc551(0x1f4)]?.['name']||'?'),_0x17de98=_0xa983db['sessionTime']?a54_0x9af19e['dim'](_0xa983db['sessionTime']):'';return(_0xe06e31+'\x20'+_0x356ef9+(_0x43bb74?'\x20'+_0x43bb74:'')+'\x20'+_0x359ec9+'\x20'+_0x17de98)['trimEnd']();});await writeOutput(_0x5d9d8e[_0x3b39f2(0xbf)]('\x0a'),_0x16f066[_0x3b39f2(0x192)],_0x3b39f2(0x1f7));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]='workflow:attempt';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1bb);async['execute'](_0x2c00fa){const _0x3dd016=a54_0x12ede4,{options:_0x3b5391,args:_0x482766,tdx:_0xbeeb65}=_0x2c00fa,_0x4397ff=_0x482766[0x0];if(!_0x4397ff)return console['error'](_0x3dd016(0x138)),0x1;_0x3b5391[_0x3dd016(0x19b)]&&console[_0x3dd016(0x214)](_0x3dd016(0x13b)+_0x4397ff);const _0x44128c=await withSpinner('Getting\x20attempt\x20details...',()=>_0xbeeb65[_0x3dd016(0x1f4)][_0x3dd016(0x21b)](_0x4397ff),{'verbose':_0x3b5391[_0x3dd016(0x19b)]}),_0xe87775=_0x44128c['data'];let _0x288f9c;!_0xe87775[_0x3dd016(0xb9)]?_0x288f9c=_0xe87775[_0x3dd016(0x8a)]?'canceling':'running':_0x288f9c=_0xe87775[_0x3dd016(0x21d)]?_0x3dd016(0x21d):'error';let _0x5cc189;if(_0xe87775[_0x3dd016(0xd2)]&&_0xe87775[_0x3dd016(0x166)]){const _0x55301c=new Date(_0xe87775[_0x3dd016(0xd2)])[_0x3dd016(0x1b0)](),_0x261f65=new Date(_0xe87775[_0x3dd016(0x166)])[_0x3dd016(0x1b0)]();_0x5cc189=Math[_0x3dd016(0xaa)]((_0x261f65-_0x55301c)/0x3e8);}const _0x4f86a2={'attempt_id':_0xe87775['id'],'status':_0x288f9c,..._0xe87775['index']!==undefined&&{'index':_0xe87775[_0x3dd016(0x1e9)]},..._0xe87775[_0x3dd016(0x168)]&&{'project':_0xe87775['project'][_0x3dd016(0x1a3)]},..._0xe87775[_0x3dd016(0x1f4)]&&{'workflow':_0xe87775[_0x3dd016(0x1f4)][_0x3dd016(0x1a3)]},..._0xe87775[_0x3dd016(0x1a1)]&&{'session_id':_0xe87775['sessionId']},..._0xe87775['sessionTime']&&{'session_time':_0xe87775[_0x3dd016(0x1ed)]},..._0xe87775[_0x3dd016(0x128)]&&{'retry_attempt':_0xe87775[_0x3dd016(0x128)]},..._0x5cc189!==undefined&&{'duration_sec':_0x5cc189},..._0xe87775[_0x3dd016(0xd2)]&&{'created_at':_0xe87775[_0x3dd016(0xd2)]},..._0xe87775[_0x3dd016(0x166)]&&{'finished_at':_0xe87775[_0x3dd016(0x166)]},...Object[_0x3dd016(0x1ea)](_0xe87775[_0x3dd016(0x77)])[_0x3dd016(0x1d8)]>0x0&&{'params':_0xe87775[_0x3dd016(0x77)]}};return await handleSingleObjectOutput(_0x4f86a2,_0x3b5391),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x193);async[a54_0x12ede4(0x202)](_0x2cc2d1){const _0x5d654b=a54_0x12ede4,{options:_0x4051bd,args:_0x4d4eb7,tdx:_0x248b52}=_0x2cc2d1,_0x20395f=_0x4d4eb7[0x0];if(!_0x20395f)return console[_0x5d654b(0x214)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2f4460=_0x4051bd[_0x5d654b(0xb8)];_0x4051bd[_0x5d654b(0x19b)]&&(console[_0x5d654b(0x214)](_0x5d654b(0x13b)+_0x20395f),_0x2f4460&&console[_0x5d654b(0x214)](_0x5d654b(0xe4)));const _0x38c6e6=await withSpinner(_0x5d654b(0xc4),()=>_0x248b52[_0x5d654b(0x1f4)][_0x5d654b(0x19c)](_0x20395f,_0x2f4460||![]),{'verbose':_0x4051bd[_0x5d654b(0x19b)]}),_0x180755=_0x38c6e6['data'];return console[_0x5d654b(0x214)](_0x5d654b(0x7d)+_0x180755['length']+_0x5d654b(0x13a)+(_0x180755[_0x5d654b(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x180755,_0x4051bd),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x1e7);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x170);async['execute'](_0x7ad28e){const _0x404dc4=a54_0x12ede4,{options:_0x3087b5,args:_0x2dd2a9,tdx:_0x257466}=_0x7ad28e,_0x522a58=_0x2dd2a9[0x0];let _0x41bc4c=_0x2dd2a9[0x1];if(!_0x522a58)return console[_0x404dc4(0x214)](_0x404dc4(0x138)),0x1;_0x3087b5[_0x404dc4(0x19b)]&&(console[_0x404dc4(0x214)](_0x404dc4(0x13b)+_0x522a58),_0x41bc4c&&console['error'](_0x404dc4(0xba)+_0x41bc4c));const _0x36cb65=await withSpinner(_0x404dc4(0xf6),()=>_0x257466[_0x404dc4(0x1f4)][_0x404dc4(0x86)](_0x522a58,_0x41bc4c),{'verbose':_0x3087b5[_0x404dc4(0x19b)]}),_0x32a9e2=_0x36cb65['data'];if(_0x32a9e2['length']===0x0)return console[_0x404dc4(0x214)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x41bc4c&&(_0x3087b5[_0x404dc4(0x11f)]||_0x3087b5[_0x404dc4(0x1ba)]))return await handleSDKOutput(_0x32a9e2,_0x3087b5),0x0;if(!_0x41bc4c){const _0x2cd79c=_0x32a9e2[_0x404dc4(0x76)](_0x3df113=>({'title':_0x3df113[_0x404dc4(0xfb)]+'\x20('+formatBytes(_0x3df113[_0x404dc4(0x203)])+')','value':_0x3df113[_0x404dc4(0xfb)]})),_0x25a249=await a54_0x435c0a({'type':'select','name':_0x404dc4(0x132),'message':_0x404dc4(0x88),'choices':_0x2cd79c});if(!_0x25a249['task'])return console['error'](_0x404dc4(0x148)),0x0;_0x41bc4c=_0x25a249['task'];}const _0x5818c6=await withSpinner(_0x404dc4(0x21a),()=>_0x257466[_0x404dc4(0x1f4)][_0x404dc4(0x1ce)](_0x522a58,_0x41bc4c),{'verbose':_0x3087b5['verbose']}),_0x1b439f=_0x5818c6[_0x404dc4(0x10a)];return _0x1b439f?console[_0x404dc4(0x144)](_0x1b439f):console[_0x404dc4(0x214)]('No\x20log\x20content\x20found'),0x0;}}function a54_0x8031(){const _0x42f221=['\x20new','fileCount','No\x20workflow\x20tdx.json\x20found','\x20\x20New\x20attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','ICON_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','splice','isNewProject','repeat','context','round','red','listSecrets','TASK_NAME_WIDTH','\x20-\x20','Loading\x20workflows...','\x20\x20Files\x20extracted:\x20','Writing\x20files...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20no\x20files\x20written','startsWith','parse','List\x20workflows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','includeSubtasks','done','Task\x20name:\x20','sourceProjectName','9PqVCzc','get','8355056vgtzIr','join','newProjectName','showWorkflowConsoleUrl','\x27...','resolveProjectDir','Getting\x20attempt\x20tasks...','workflow:kill','requireProject','trim','sourceDir','\x20\x20Changes:\x20','Latest\x20session\x20has\x20no\x20attempt','-\x20nothing\x20pushed','padStart','\x22?\x20This\x20cannot\x20be\x20undone.','projects','workflow:secrets:delete','workflow:upload','targetDir','createdAt','/sessions/','has','Project\x20filter:\x20','Using\x20attempt\x20','stdout','\x20is\x20not\x20a\x20directory','Invalid\x20format:\x20','all','\x0a✔\x20Already\x20up\x20to\x20date','\x20of\x20','✔\x20Secret\x20\x27','green','toLowerCase','67893ivPvtM','Error:\x20Invalid\x20JSON\x20in\x20--params','projectName','getMonth','Including\x20subtasks:\x20yes','getDate','durationMs','Analyzing\x20changes...','pullProject','readFile','Cloning\x20to\x20','GUTTER','renderTimeline','Validation:\x20skipped','workflow:secrets:set','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','(use\x20--limit\x20to\x20see\x20more)','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','filter','workflow:retry','Pulling\x20project\x20','Fetching\x20log\x20files...','Key\x20cannot\x20be\x20empty','ICON_SPACING','dryRun','Kill\x20a\x20running\x20attempt','taskName','startedAt','MAX_TASKS_DISPLAY','Filter:\x20','Session\x20not\x20found:\x20','Updating\x20','blue','MIN_LABEL_COUNT','delete','Secrets\x20to\x20set:\x20','\x20\x20Revision:\x20','\x20\x20Console:\x20','Reason:\x20','Error:\x20Project\x20name\x20is\x20required','unchanged','data','Total:\x20','Dry\x20run:\x20yes','site','Include\x20retried:\x20yes','write','\x20\x20Source:\x20','match','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','fill','Error:\x20Secret\x20key\x20is\x20required','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Project\x20ID:\x20','lastAttempt','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','status','142xxRRBr','jsonl','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20project=','1560192oDUxaL','json','No\x20attempts\x20found','\x22\x20with\x20new\x20revision?','every','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','cyan','tdx.json','workflow:attempts','MAX_POLL_ITERATIONS','retryAttemptName','duration','deleteSecret','session','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','21979730QUvXrX','\x20(system)','split','start','Listing\x20workflows...','task','Source\x20directory:\x20','📁\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x0a✔\x20Attempt\x20complete','pollTimeline','Error:\x20Attempt\x20ID\x20is\x20required','✔\x20Workflow\x20run\x20started','\x20task','Attempt\x20ID:\x20','indexOf','limit','\x0a⚠\x20Project\x20\x22','No\x20workflows\x20found','\x0aError:','resumeFrom','✔\x20Clone\x20complete','\x0aDry\x20run\x20-\x20no\x20files\x20written','log','\x20project','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x22\x20to\x20new\x20project\x20\x22','Cancelled','param','description','existingProjectId','total','Setting\x20secret...','tdx\x20wf\x20attempt\x20','yellow','buildTimelineData','\x20\x20Session\x20ID:\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','executeCloneProject','sort','Downloading\x20project\x20','(unknown)','canceling','\x20secrets...','isDirectory','workflow:push','MAX_TIMELINE_WIDTH','MIN_TIMELINE_WIDTH','follow','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflows','Source\x20directory\x20is\x20required','\x20\x20Location:\x20','stat','Error:','Expected\x20format:\x20--param\x20key=value','prepareCloneProject','finishedAt','yes','project','Failed\x20to\x20fetch\x20attempt\x20data','No\x20sessions\x20found\x20in\x20project:\x20','Params:\x20','\x0aClone\x20\x22','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','retryAttempt','workflowProject','Show\x20logs\x20for\x20a\x20workflow\x20attempt','select','msPerChar','\x20\x20tdx\x20wf\x20use\x20<project>','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Source\x20project:\x20','modified','\x20has\x20no\x20attempts','deleted','MAX_LABEL_COUNT','slice','clear',',\x20Workflow:\x20','attempt:','\x20session','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','unknown','Project\x20name:\x20','Files\x20to\x20upload:\x20','\x0aPush\x20these\x20changes?','newProjectId','stringify','Pushing\x20workflow\x20project...','\x0aApply\x20these\x20changes?','Target\x20directory:\x20','💡\x20Tip:\x20Use\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','relative','fullName','isArray','New\x20project\x20name:\x20','group_error','substring','/app/workflows/','output','Show\x20tasks\x20for\x20an\x20attempt','\x27\x20from\x20project\x20\x27','workflow:timeline','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','workflow:clone','floor','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x0aUpdate\x20existing\x20project\x20\x22','verbose','tasks','autocomplete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Retrying\x20attempt...','\x20(use\x20--limit\x20to\x20show\x20more)','sessionId','\x20from\x20session\x20','name','executePushProject','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','No\x20sessions\x20found\x20for:\x20','setSecrets','\x20deleted','No\x20projects\x20match\x20pattern:\x20','\x20sessions\x20','Killing\x20attempt...','renderSessionsTimeline','Status:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','value','getTime','Loading\x20session...','Starting\x20workflow\x20run...','applyPullProject','\x20\x20Project:\x20','getFullYear','Pattern:\x20','294lYaslM','isTTY','2045vSGlbO','format','Show\x20specific\x20attempt\x20details','getHours','cwd','replace','window','POLL_INTERVAL_MS','Tip:\x20cd\x20to\x20workflows/','Project:\x20','Loading\x20sessions...','icon','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Source:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','LABEL_MIN_SPACING','Start\x20a\x20workflow\x20run','max','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x1b[1A\x1b[2K','push','logs','localeCompare','updatedAt','✔\x20Pushed\x20','.\x20Expected\x20format:\x20KEY=VALUE','📋\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Revision:\x20','/attempt/','state','length','✔\x20Deleted\x20project\x20','Session\x20time:\x20','→\x20New\x20project:\x20','Target:\x20','\x20workflow','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Auto-selected\x20latest\x20session:\x20','Error:\x20','metadata','type','startTime','List\x20workflow\x20execution\x20sessions','sessions','\x0a✔\x20No\x20changes\x20to\x20push','workflow:logs','✔\x20Project:\x20','index','keys','List\x20all\x20workflow\x20projects','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','sessionTime','set','skipValidation','hasChanges','dim','attemptId','find','workflow','size','diff','list','resolveProject','Pushing\x20project...','generateSessionTimelineRows','Parameters:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','resolveProjectId','⚠\x20Showing\x20first\x20','summary','160104NUuSmt','No\x20sessions\x20found','execute','fileSize','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','from','fs/promises','revision:\x20','No\x20attempts\x20found\x20for:\x20','---\x20','includes','min','...','attempts','\x20logs','Analyzing\x20project...','\x20modified','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Key:\x20','\x20\x20Workflow:\x20','error','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','projectId','session_id','\x20unchanged','Retry\x20a\x20session\x20or\x20attempt','Downloading\x20logs...','attempt','reason','success','getMinutes','now','5151WjeYyK','planned','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:download','renderSingleTimeline','map','params','workflow:secrets:list','run','targetExists','navigateSessionsInteractive','Project\x20directory:\x20','✔\x20Found\x20','workflow:projects','running','revision','Force:\x20yes','key','retrySession','→\x20Project:\x20','title','logFiles','\x20\x20Target:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','cancelRequested','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','message','rows','Deleting\x20project\x20','pending','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Listing\x20workflow\x20attempts...','\x0aPolling...\x20(','displayLine','workflow:workflows','\x20\x20Session\x20context\x20set\x20to:\x20','\x20tasks','\x20\x20Attempt\x20ID:\x20','Project\x20name\x20is\x20required','table','fromTask','changes','filesExtracted','parseProjectWorkflowPattern'];a54_0x8031=function(){return _0x42f221;};return a54_0x8031();}export class WorkflowKillCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xc5);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0xfa);async[a54_0x12ede4(0x202)](_0x4df8fe){const _0x1fc6eb=a54_0x12ede4,{options:_0x414a8d,args:_0x2c6a9e,tdx:_0xd25b40}=_0x4df8fe,_0x11b17a=_0x2c6a9e[0x0];if(!_0x11b17a)return console[_0x1fc6eb(0x214)](_0x1fc6eb(0x138)),0x1;const _0x2d3b00=_0x414a8d[_0x1fc6eb(0x21c)];_0x414a8d[_0x1fc6eb(0x19b)]&&(console[_0x1fc6eb(0x214)](_0x1fc6eb(0x13b)+_0x11b17a),_0x2d3b00&&console[_0x1fc6eb(0x214)](_0x1fc6eb(0x107)+_0x2d3b00));if(!_0x414a8d[_0x1fc6eb(0x167)]){if(!isInteractive())return console['error'](a54_0x9af19e['red'](_0x1fc6eb(0x140)),_0x1fc6eb(0xb2)),console[_0x1fc6eb(0x214)](a54_0x9af19e[_0x1fc6eb(0x1f1)](_0x1fc6eb(0xa5))),0x1;const _0x3decc9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x11b17a+'?');if(!_0x3decc9)return console[_0x1fc6eb(0x214)](a54_0x9af19e[_0x1fc6eb(0x14f)]('Cancelled')),0x1;}const _0x4596d1=await withSpinner(_0x1fc6eb(0x1ab),()=>_0xd25b40[_0x1fc6eb(0x1f4)]['kill'](_0x11b17a,_0x2d3b00),{'verbose':_0x414a8d[_0x1fc6eb(0x19b)]}),_0x5d37a8=_0x4596d1['data'];return console['error']('✔\x20'+_0x5d37a8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xf4);['description']=a54_0x12ede4(0x219);async[a54_0x12ede4(0x202)](_0x3ae9c7){const _0x4431ed=a54_0x12ede4,{options:_0x16d2fc,args:_0x493f02,tdx:_0x4fae99}=_0x3ae9c7,_0x3fc63e=_0x493f02[0x0];if(!_0x3fc63e)return console[_0x4431ed(0x214)](_0x4431ed(0x146)),console[_0x4431ed(0x214)](_0x4431ed(0x199)),0x1;let _0x3ca234=![],_0x5e928d=_0x3fc63e;if(_0x3fc63e['startsWith']('session:'))_0x3ca234=!![],_0x5e928d=_0x3fc63e[_0x4431ed(0x190)](0x8);else{if(_0x3fc63e[_0x4431ed(0xb4)](_0x4431ed(0x17d)))_0x3ca234=![],_0x5e928d=_0x3fc63e[_0x4431ed(0x190)](0x8);else return console[_0x4431ed(0x214)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x2cc43b=_0x16d2fc[_0x4431ed(0x9a)],_0x38b6cb=_0x16d2fc[_0x4431ed(0x141)],_0x2da37e=_0x16d2fc[_0x4431ed(0x77)],_0x267d78=_0x16d2fc['force'];_0x16d2fc[_0x4431ed(0x19b)]&&(console['error'](_0x4431ed(0x1dc)+(_0x3ca234?_0x4431ed(0x12b):'attempt')+'\x20'+_0x5e928d),_0x2cc43b&&console['error']('From\x20task:\x20'+_0x2cc43b),_0x38b6cb&&console[_0x4431ed(0x214)]('Resume\x20from:\x20'+_0x38b6cb),_0x2da37e&&console[_0x4431ed(0x214)](_0x4431ed(0x16b)+_0x2da37e),_0x267d78&&console['error'](_0x4431ed(0x81)));let _0x1947e4;if(_0x2da37e)try{if(_0x2da37e[_0x4431ed(0xb4)]('@')){const _0x54620f=await import(_0x4431ed(0x206)),_0x3694c7=_0x2da37e[_0x4431ed(0x190)](0x1),_0x674763=await _0x54620f[_0x4431ed(0xe9)](_0x3694c7,'utf-8');_0x1947e4=JSON[_0x4431ed(0xb5)](_0x674763);}else _0x1947e4=JSON['parse'](_0x2da37e);}catch{return console[_0x4431ed(0x214)](_0x4431ed(0xe1)),0x1;}if(!_0x16d2fc[_0x4431ed(0x167)]){if(!isInteractive())return console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0xab)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0x1f1)](_0x4431ed(0xa5))),0x1;const _0x5993d1=await confirmKey(_0x4431ed(0x123)+(_0x3ca234?_0x4431ed(0x12b):_0x4431ed(0x21b))+'\x20'+_0x5e928d+'?');if(!_0x5993d1)return console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0x14f)](_0x4431ed(0x148))),0x1;}let _0x4c0c28;_0x3ca234?_0x4c0c28=await withSpinner('Retrying\x20session...',()=>_0x4fae99[_0x4431ed(0x1f4)][_0x4431ed(0x83)](_0x5e928d,{'fromTask':_0x2cc43b,'retryParams':_0x1947e4}),{'verbose':_0x16d2fc[_0x4431ed(0x19b)]}):_0x4c0c28=await withSpinner(_0x4431ed(0x19f),()=>_0x4fae99['workflow'][_0x4431ed(0x16e)](_0x5e928d,{'resumeFrom':_0x38b6cb,'retryParams':_0x1947e4,'force':_0x267d78}),{'verbose':_0x16d2fc[_0x4431ed(0x19b)]});const _0x3ac209=_0x4c0c28[_0x4431ed(0x10a)];return console[_0x4431ed(0x214)]('✔\x20Retry\x20started'),console['error'](_0x4431ed(0xa1)+_0x3ac209[_0x4431ed(0x1f2)]),console[_0x4431ed(0x214)](_0x4431ed(0x151)+_0x3ac209[_0x4431ed(0x1a1)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]='workflow:run';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1c9);async[a54_0x12ede4(0x202)](_0x598dff){const _0xc3a772=a54_0x12ede4,{options:_0x464c73,args:_0x2479bd,tdx:_0x3d57dd}=_0x598dff;let _0xd76457=_0x2479bd[0x0];if(!_0xd76457){const _0x2f2d1f=this[_0xc3a772(0x1f8)]([],_0x464c73),_0x19c91b=await withSpinner(_0xc3a772(0xaf),()=>_0x3d57dd['workflow'][_0xc3a772(0x15f)](_0x2f2d1f,{'limit':_0x464c73[_0xc3a772(0x13d)]}),{'verbose':_0x464c73['verbose']}),_0x2da7ab=_0x19c91b['data'];if(_0x2da7ab['length']===0x0)return console[_0xc3a772(0x214)](_0xc3a772(0x13f)),!_0x2f2d1f&&console['error'](a54_0x9af19e[_0xc3a772(0x1f1)](_0xc3a772(0x89))),0x1;const _0x365f44=_0x2da7ab[_0xc3a772(0x76)](_0x154619=>({'title':_0x154619[_0xc3a772(0x168)]?.[_0xc3a772(0x1a3)]+'.'+_0x154619['name'],'value':_0x154619['project']?.[_0xc3a772(0x1a3)]+'.'+_0x154619[_0xc3a772(0x1a3)],'description':_0x154619[_0xc3a772(0x80)]?_0xc3a772(0x207)+_0x154619[_0xc3a772(0x80)]:undefined})),_0x27df99=await a54_0x435c0a({'type':_0xc3a772(0x171),'name':_0xc3a772(0x1f4),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x365f44});if(!_0x27df99[_0xc3a772(0x1f4)])return 0x1;_0xd76457=_0x27df99['workflow'];}if(!_0xd76457[_0xc3a772(0x20a)]('.')){const _0x46e805=this['resolveProject']([],_0x464c73);if(_0x46e805)_0xd76457=_0x46e805+'.'+_0xd76457;else return console[_0xc3a772(0x214)](a54_0x9af19e[_0xc3a772(0xab)](_0xc3a772(0x163)),_0xc3a772(0x174)),console[_0xc3a772(0x214)](a54_0x9af19e[_0xc3a772(0x1f1)](_0xc3a772(0x89))),0x1;}const _0x321c7f=_0x464c73[_0xc3a772(0x149)],_0x1c39c9=_0x464c73[_0xc3a772(0x1ed)],_0x25cd60={};if(_0x321c7f&&Array[_0xc3a772(0x18d)](_0x321c7f))for(const _0x247e82 of _0x321c7f){const _0x4d7cfc=_0x247e82[_0xc3a772(0x13c)]('=');if(_0x4d7cfc===-0x1)return console[_0xc3a772(0x214)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x247e82),console[_0xc3a772(0x214)](_0xc3a772(0x164)),0x1;const _0x2338fd=_0x247e82[_0xc3a772(0x190)](0x0,_0x4d7cfc),_0x2e1227=_0x247e82[_0xc3a772(0x190)](_0x4d7cfc+0x1);try{_0x25cd60[_0x2338fd]=JSON[_0xc3a772(0xb5)](_0x2e1227);}catch{_0x25cd60[_0x2338fd]=_0x2e1227;}}_0x464c73['verbose']&&(console['error']('Workflow:\x20'+_0xd76457),Object[_0xc3a772(0x1ea)](_0x25cd60)['length']>0x0&&console['error'](_0xc3a772(0x1fb)+JSON[_0xc3a772(0x185)](_0x25cd60)),_0x1c39c9&&console[_0xc3a772(0x214)](_0xc3a772(0x1da)+_0x1c39c9));const _0x27bf4c=await withSpinner(_0xc3a772(0x1b2),()=>_0x3d57dd['workflow'][_0xc3a772(0x79)](_0xd76457,_0x25cd60,{'sessionTime':_0x1c39c9}),{'verbose':_0x464c73['verbose']}),_0x33c43a=_0x27bf4c[_0xc3a772(0x10a)];console['error'](_0xc3a772(0x139)),console[_0xc3a772(0x214)](_0xc3a772(0x97)+_0x33c43a['id']),console[_0xc3a772(0x214)](_0xc3a772(0x151)+_0x33c43a[_0xc3a772(0x1a1)]),console[_0xc3a772(0x214)](_0xc3a772(0x1b4)+_0x33c43a[_0xc3a772(0x168)]?.[_0xc3a772(0x1a3)]),console[_0xc3a772(0x214)](_0xc3a772(0x213)+_0x33c43a[_0xc3a772(0x1f4)]?.[_0xc3a772(0x1a3)]);if(_0x33c43a['project']?.['id']&&_0x33c43a[_0xc3a772(0x1a1)]&&_0x33c43a['id']){const _0x3d6417=_0x464c73[_0xc3a772(0x10d)],_0x4da8cc=getConsoleUrl(_0x3d6417,_0xc3a772(0x191)+_0x33c43a[_0xc3a772(0x168)]['id']+_0xc3a772(0xd3)+_0x33c43a[_0xc3a772(0x1a1)]+_0xc3a772(0x1d6)+_0x33c43a['id']);console['error'](_0xc3a772(0x106)+a54_0x9af19e[_0xc3a772(0x124)](_0x4da8cc));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x12ede4(0x74);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x12ede4(0x202)](_0x4f1520){const _0x42199b=a54_0x12ede4,{options:_0x40a7e1,args:_0x2fa88c,tdx:_0x3e14b1}=_0x4f1520,_0x1ab790=_0x2fa88c[0x0],_0x5761c8=_0x2fa88c[0x1]||'.';if(!_0x1ab790)return console[_0x42199b(0x214)](_0x42199b(0x108)),console['error'](_0x42199b(0x118)),0x1;const _0x173546=_0x40a7e1[_0x42199b(0x80)];_0x40a7e1['verbose']&&(console['error'](_0x42199b(0x1c2)+_0x1ab790),console['error']('Output\x20directory:\x20'+_0x5761c8),_0x173546&&console[_0x42199b(0x214)](_0x42199b(0x1d5)+_0x173546));const _0x25ee9d=await withSpinner(_0x42199b(0x155)+_0x1ab790+_0x42199b(0x20c),()=>_0x3e14b1['workflow']['download'](_0x1ab790,_0x5761c8,{'revision':_0x173546}),{'verbose':_0x40a7e1[_0x42199b(0x19b)]}),_0x1ba017=_0x25ee9d['data'];return console['error']('✔\x20Downloaded\x20'+_0x1ba017[_0x42199b(0xe2)]),console[_0x42199b(0x214)](_0x42199b(0x105)+_0x1ba017['revision']),console['error'](_0x42199b(0xb0)+_0x1ba017[_0x42199b(0x9c)]),console[_0x42199b(0x214)](_0x42199b(0x161)+_0x5761c8+'/'+_0x1ba017[_0x42199b(0xe2)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xd0);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x73);async[a54_0x12ede4(0x202)](_0x1ec293){const _0x2c7d75=a54_0x12ede4,{options:_0x5e1fd0,args:_0x36b87e,tdx:_0x2a7903}=_0x1ec293;let _0x51bee3='.',_0x7248b5=_0x5e1fd0[_0x2c7d75(0x1a3)];if(_0x36b87e[0x0]){const {promises:_0x3b8777}=await import('fs');try{const _0x295488=await _0x3b8777[_0x2c7d75(0x162)](_0x36b87e[0x0]);if(_0x295488[_0x2c7d75(0x159)]())_0x51bee3=_0x36b87e[0x0];else return console[_0x2c7d75(0x214)](_0x2c7d75(0x1e0)+_0x36b87e[0x0]+_0x2c7d75(0xd8)),0x1;}catch{_0x7248b5=_0x36b87e[0x0],_0x51bee3='.';}}const _0x2fc514=_0x5e1fd0[_0x2c7d75(0x80)],_0x2a65f5=_0x5e1fd0[_0x2c7d75(0x1ef)];_0x5e1fd0[_0x2c7d75(0x19b)]&&(console[_0x2c7d75(0x214)](_0x2c7d75(0x7c)+_0x51bee3),_0x7248b5&&console[_0x2c7d75(0x214)](_0x2c7d75(0x181)+_0x7248b5),_0x2fc514&&console['error'](_0x2c7d75(0x1d5)+_0x2fc514),_0x2a65f5&&console['error'](_0x2c7d75(0xed)));const _0x5ab9f2=await withSpinner(_0x2c7d75(0x186),()=>_0x2a7903[_0x2c7d75(0x1f4)]['push'](_0x51bee3,{'projectName':_0x7248b5,'revision':_0x2fc514,'skipValidation':_0x2a65f5}),{'verbose':_0x5e1fd0[_0x2c7d75(0x19b)]}),_0x4c8427=_0x5ab9f2[_0x2c7d75(0x10a)];return console[_0x2c7d75(0x214)](_0x2c7d75(0x1d1)+_0x4c8427[_0x2c7d75(0xe2)]),console[_0x2c7d75(0x214)](_0x2c7d75(0x116)+_0x4c8427[_0x2c7d75(0x216)]),console[_0x2c7d75(0x214)](_0x2c7d75(0x105)+_0x4c8427[_0x2c7d75(0x80)]),await this['showWorkflowConsoleUrl'](_0x2a7903,_0x4c8427['projectName'],_0x5e1fd0[_0x2c7d75(0x10d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]='workflow:pull';[a54_0x12ede4(0x14a)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x12ede4(0x202)](_0x5444df){const _0x10c49b=a54_0x12ede4,{options:_0x2a1f9d,args:_0x55139a,tdx:_0x238e4c}=_0x5444df,_0x2708c4=_0x55139a[0x0],_0x1a369e=_0x55139a[0x1];if(!_0x2708c4)return console[_0x10c49b(0x214)](a54_0x9af19e['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0xf2))),0x1;const _0x38521e=_0x2a1f9d['revision'];_0x2a1f9d[_0x10c49b(0x19b)]&&(console[_0x10c49b(0x214)](_0x10c49b(0x1c2)+_0x2708c4),_0x1a369e&&console[_0x10c49b(0x214)](_0x10c49b(0x188)+_0x1a369e),_0x38521e&&console['error'](_0x10c49b(0x1d5)+_0x38521e),_0x2a1f9d[_0x10c49b(0xf9)]&&console[_0x10c49b(0x214)](_0x10c49b(0x10c)));const _0x4683f3=await withSpinner(_0x10c49b(0xf5)+_0x2708c4+_0x10c49b(0x20c),()=>_0x238e4c['workflow'][_0x10c49b(0xe8)](_0x2708c4,{'targetDir':_0x1a369e,'revision':_0x38521e}),{'verbose':_0x2a1f9d['verbose']}),_0x15b49c=_0x4683f3[_0x10c49b(0x10a)];_0x15b49c[_0x10c49b(0xa7)]?console[_0x10c49b(0x214)](_0x10c49b(0x1db)+_0x15b49c['projectName']):console[_0x10c49b(0x214)](_0x10c49b(0x84)+_0x15b49c[_0x10c49b(0xe2)]);console[_0x10c49b(0x214)](_0x10c49b(0x105)+_0x15b49c[_0x10c49b(0x80)]),console[_0x10c49b(0x214)](_0x10c49b(0x87)+(a54_0x254133[_0x10c49b(0x18b)](process[_0x10c49b(0x1bd)](),_0x15b49c[_0x10c49b(0xd1)])||'.')),console['error'](_0x10c49b(0xc9)+a54_0x9af19e[_0x10c49b(0xde)]('+'+_0x15b49c[_0x10c49b(0x1ff)]['new']+'\x20new')+',\x20'+(a54_0x9af19e['yellow']('~'+_0x15b49c[_0x10c49b(0x1ff)][_0x10c49b(0x176)]+_0x10c49b(0x210))+',\x20')+(a54_0x9af19e['red']('-'+_0x15b49c[_0x10c49b(0x1ff)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x9af19e[_0x10c49b(0x1f1)](_0x15b49c['summary'][_0x10c49b(0x109)]+_0x10c49b(0x218))));for(const _0x266273 of _0x15b49c[_0x10c49b(0x9b)]){_0x266273[_0x10c49b(0x1e2)]==='modified'&&_0x266273[_0x10c49b(0x1f6)]&&(console[_0x10c49b(0x214)]('\x0a'+a54_0x9af19e[_0x10c49b(0x124)](_0x10c49b(0x209)+_0x266273['path'])),console[_0x10c49b(0x214)](_0x266273['diff']));}if(!_0x15b49c[_0x10c49b(0x1f0)])return saveSessionContext({'workflow_project':_0x15b49c[_0x10c49b(0xe2)]},_0x2a1f9d[_0x10c49b(0x12b)]),console[_0x10c49b(0x214)](a54_0x9af19e['green'](_0x10c49b(0xdb))),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0x95)+_0x15b49c[_0x10c49b(0xe2)])),0x0;if(_0x2a1f9d[_0x10c49b(0xf9)])return console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x14f)](_0x10c49b(0x143))),0x0;if(!_0x2a1f9d[_0x10c49b(0x167)]){if(!isInteractive())return console[_0x10c49b(0x214)](a54_0x9af19e['red'](_0x10c49b(0x140)),_0x10c49b(0xb2)),console[_0x10c49b(0x214)](a54_0x9af19e['dim'](_0x10c49b(0xa5))),0x1;const _0x556c5d=await confirmKey(_0x10c49b(0x187));if(!_0x556c5d)return console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x14f)](_0x10c49b(0x148)),_0x10c49b(0xb3)),0x1;}await withSpinner(_0x10c49b(0xb1),()=>_0x238e4c['workflow'][_0x10c49b(0x1b3)](_0x15b49c,{'revision':_0x38521e}),{'verbose':_0x2a1f9d['verbose']}),saveSessionContext({'workflow_project':_0x15b49c[_0x10c49b(0xe2)]},_0x2a1f9d['session']),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0xde)]('✔\x20Pull\x20complete'));const _0x2c3761=a54_0x254133[_0x10c49b(0x18b)](process[_0x10c49b(0x1bd)](),_0x15b49c[_0x10c49b(0xd1)])||'.';return console[_0x10c49b(0x214)](a54_0x9af19e['dim'](_0x10c49b(0x161)+_0x2c3761)),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0x95)+_0x15b49c[_0x10c49b(0xe2)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x15a);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1ec);async[a54_0x12ede4(0x202)](_0x5bcb33){const _0x5e8f06=a54_0x12ede4,{options:_0x3c224b,args:_0x7c959e,tdx:_0x3698ab}=_0x5bcb33,_0x4af9b0=this['resolveProjectDir'](_0x7c959e,_0x3c224b),_0x5110c0=_0x3c224b[_0x5e8f06(0x80)],_0x1326ac=_0x3c224b[_0x5e8f06(0x1ef)];_0x3c224b['verbose']&&(_0x4af9b0&&console[_0x5e8f06(0x214)](_0x5e8f06(0x133)+_0x4af9b0),_0x5110c0&&console[_0x5e8f06(0x214)]('Revision:\x20'+_0x5110c0),_0x3c224b[_0x5e8f06(0xf9)]&&console[_0x5e8f06(0x214)](_0x5e8f06(0x10c)),_0x1326ac&&console['error'](_0x5e8f06(0xed)));let _0x58b6ba;try{_0x58b6ba=await withSpinner(_0x5e8f06(0xe7),()=>_0x3698ab[_0x5e8f06(0x1f4)]['preparePushProject']({'sourceDir':_0x4af9b0,'revision':_0x5110c0,'skipValidation':_0x1326ac}),{'verbose':_0x3c224b[_0x5e8f06(0x19b)]});}catch(_0x11be0c){if(_0x11be0c instanceof Error&&_0x11be0c[_0x5e8f06(0x8c)][_0x5e8f06(0x20a)](_0x5e8f06(0xa0)))return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0xab)](_0x5e8f06(0x163)),_0x5e8f06(0x215)),_0x3c224b[_0x5e8f06(0x16f)]?console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x1f1)](_0x5e8f06(0x1c1)+_0x3c224b[_0x5e8f06(0x16f)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x3c224b[_0x5e8f06(0x16f)]+'\x27')):console[_0x5e8f06(0x214)](a54_0x9af19e['dim'](_0x5e8f06(0x15e))),0x1;throw _0x11be0c;}const _0x56355b=_0x58b6ba['data'];console['error'](_0x5e8f06(0x1e8)+_0x56355b[_0x5e8f06(0xe2)]),console['error'](_0x5e8f06(0x110)+_0x56355b[_0x5e8f06(0xc8)]),console[_0x5e8f06(0x214)](_0x5e8f06(0x105)+_0x56355b[_0x5e8f06(0x80)]),console[_0x5e8f06(0x214)]('\x20\x20Changes:\x20'+a54_0x9af19e[_0x5e8f06(0xde)]('+'+_0x56355b[_0x5e8f06(0x1ff)]['new']+_0x5e8f06(0x9e))+',\x20'+(a54_0x9af19e[_0x5e8f06(0x14f)]('~'+_0x56355b[_0x5e8f06(0x1ff)][_0x5e8f06(0x176)]+_0x5e8f06(0x210))+',\x20')+(a54_0x9af19e[_0x5e8f06(0xab)]('-'+_0x56355b['summary'][_0x5e8f06(0x178)]+_0x5e8f06(0x1a8))+',\x20')+(''+a54_0x9af19e[_0x5e8f06(0x1f1)](_0x56355b[_0x5e8f06(0x1ff)]['unchanged']+_0x5e8f06(0x218))));for(const _0x2c734b of _0x56355b[_0x5e8f06(0x9b)]){_0x2c734b[_0x5e8f06(0x1e2)]===_0x5e8f06(0x176)&&_0x2c734b[_0x5e8f06(0x1f6)]&&(console[_0x5e8f06(0x214)]('\x0a'+a54_0x9af19e[_0x5e8f06(0x124)](_0x5e8f06(0x209)+_0x2c734b['path'])),console[_0x5e8f06(0x214)](_0x2c734b['diff']));}if(!_0x56355b[_0x5e8f06(0x1f0)])return console[_0x5e8f06(0x214)](a54_0x9af19e['green'](_0x5e8f06(0x1e6))),await this['showWorkflowConsoleUrl'](_0x3698ab,_0x56355b['projectName'],_0x3c224b[_0x5e8f06(0x10d)]),0x0;if(_0x3c224b[_0x5e8f06(0xf9)])return console['error'](a54_0x9af19e[_0x5e8f06(0x14f)](_0x5e8f06(0x1ae))),0x0;if(!_0x3c224b['yes']){if(!isInteractive())return console['error'](a54_0x9af19e[_0x5e8f06(0xab)]('\x0aError:'),_0x5e8f06(0xb2)),console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x1f1)](_0x5e8f06(0xa5))),0x1;const _0x3ded8b=await confirmKey(_0x5e8f06(0x183));if(!_0x3ded8b)return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x14f)]('Cancelled'),_0x5e8f06(0xcb)),0x1;}const _0x926375=await withSpinner(_0x5e8f06(0x1f9),()=>_0x3698ab['workflow'][_0x5e8f06(0x1a4)](_0x56355b),{'verbose':_0x3c224b['verbose']}),_0x352495=_0x926375['data'];return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0xde)]('✔\x20Push\x20complete')),console[_0x5e8f06(0x214)](_0x5e8f06(0x116)+_0x352495['projectId']),console[_0x5e8f06(0x214)]('\x20\x20Revision:\x20'+_0x352495[_0x5e8f06(0x80)]),await this[_0x5e8f06(0xc1)](_0x3698ab,_0x352495[_0x5e8f06(0xe2)],_0x3c224b[_0x5e8f06(0x10d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x197);['description']=a54_0x12ede4(0x17f);async[a54_0x12ede4(0x202)](_0x30d933){const _0x523113=a54_0x12ede4,{options:_0x5bb840,args:_0x50a01b,tdx:_0x23a6f2}=_0x30d933,_0x56510c=this['resolveProjectDir'](_0x50a01b,_0x5bb840),_0x45ac5f=_0x5bb840[_0x523113(0x1a3)],_0xcd5176=_0x5bb840[_0x523113(0x80)],_0x169ab0=_0x5bb840[_0x523113(0x1ef)];if(!_0x56510c)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0xab)](_0x523113(0x163)),_0x523113(0x160)),console['error'](a54_0x9af19e[_0x523113(0x1f1)](_0x523113(0xef))),console[_0x523113(0x214)](a54_0x9af19e['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x45ac5f)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0xab)](_0x523113(0x163)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x1f1)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5bb840[_0x523113(0x19b)]&&(console[_0x523113(0x214)]('Source\x20directory:\x20'+_0x56510c),console[_0x523113(0x214)](_0x523113(0x18e)+_0x45ac5f),_0xcd5176&&console[_0x523113(0x214)](_0x523113(0x1d5)+_0xcd5176),_0x5bb840[_0x523113(0xf9)]&&console[_0x523113(0x214)]('Dry\x20run:\x20yes'),_0x169ab0&&console[_0x523113(0x214)](_0x523113(0xed)));const _0x5bef01=await withSpinner(_0x523113(0x20f),()=>_0x23a6f2['workflow'][_0x523113(0x165)](_0x56510c,_0x45ac5f,{'revision':_0xcd5176,'skipValidation':_0x169ab0}),{'verbose':_0x5bb840[_0x523113(0x19b)]}),_0x9cd4f3=_0x5bef01[_0x523113(0x10a)];console[_0x523113(0x214)](_0x523113(0x1c6)+_0x9cd4f3[_0x523113(0xc8)]);_0x9cd4f3['sourceProjectName']&&console[_0x523113(0x214)](_0x523113(0x175)+_0x9cd4f3['sourceProjectName']);console[_0x523113(0x214)](_0x523113(0x18e)+_0x9cd4f3[_0x523113(0xc0)]),console[_0x523113(0x214)](_0x523113(0x1d5)+_0x9cd4f3[_0x523113(0x80)]),console[_0x523113(0x214)](_0x523113(0x182)+_0x9cd4f3[_0x523113(0x9f)]);_0x9cd4f3[_0x523113(0x7a)]&&(console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x13e)+_0x9cd4f3[_0x523113(0xc0)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x9cd4f3[_0x523113(0x14b)]+')')),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x8b))));if(_0x5bb840[_0x523113(0xf9)])return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x1c7))),0x0;if(!_0x5bb840[_0x523113(0x167)]){if(!isInteractive())return console[_0x523113(0x214)](a54_0x9af19e['red'](_0x523113(0x140)),_0x523113(0xb2)),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x1f1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x526769=_0x9cd4f3[_0x523113(0xbb)]||a54_0x254133['basename'](_0x56510c),_0x5400d3=_0x9cd4f3[_0x523113(0x7a)]?_0x523113(0x19a)+_0x45ac5f+_0x523113(0x121):_0x523113(0x16c)+_0x526769+_0x523113(0x147)+_0x45ac5f+'\x22?',_0x137d25=await confirmKey(_0x5400d3);if(!_0x137d25)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)]('Cancelled')),0x1;}const _0x5e77a8=await withSpinner(_0x9cd4f3['targetExists']?_0x523113(0x100)+_0x45ac5f+_0x523113(0x20c):_0x523113(0xea)+_0x45ac5f+'...',()=>_0x23a6f2[_0x523113(0x1f4)][_0x523113(0x153)](_0x9cd4f3),{'verbose':_0x5bb840[_0x523113(0x19b)]}),_0x2e7a4c=_0x5e77a8[_0x523113(0x10a)];return console['error'](a54_0x9af19e[_0x523113(0xde)](_0x9cd4f3['targetExists']?'✔\x20Project\x20updated':_0x523113(0x142))),console[_0x523113(0x214)](_0x523113(0x1b4)+_0x2e7a4c[_0x523113(0xc0)]),console[_0x523113(0x214)](_0x523113(0x116)+_0x2e7a4c[_0x523113(0x184)]),console['error'](_0x523113(0x105)+_0x2e7a4c[_0x523113(0x80)]),await this['showWorkflowConsoleUrl'](_0x23a6f2,_0x2e7a4c[_0x523113(0xc0)],_0x5bb840['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x115);async[a54_0x12ede4(0x202)](_0xbbace8){const _0x435c44=a54_0x12ede4,{options:_0x275127,args:_0xfca47c,tdx:_0x132e11}=_0xbbace8,_0x13e03f=_0xfca47c[0x0];if(!_0x13e03f)return console[_0x435c44(0x214)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x435c44(0x214)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x275127['verbose']&&console[_0x435c44(0x214)](_0x435c44(0x1c2)+_0x13e03f);if(!_0x275127['yes']){if(!isInteractive())return console[_0x435c44(0x214)](a54_0x9af19e[_0x435c44(0xab)](_0x435c44(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x435c44(0x214)](a54_0x9af19e['dim'](_0x435c44(0xa5))),0x1;const _0x13fba3=await confirmKey(_0x435c44(0x19e)+_0x13e03f+_0x435c44(0xcd));if(!_0x13fba3)return console[_0x435c44(0x214)](a54_0x9af19e[_0x435c44(0x14f)](_0x435c44(0x148))),0x1;}const _0x35f4f1=await withSpinner(_0x435c44(0x8e)+_0x13e03f+_0x435c44(0x20c),()=>_0x132e11['workflow'][_0x435c44(0x103)](_0x13e03f),{'verbose':_0x275127[_0x435c44(0x19b)]}),_0x357c85=_0x35f4f1[_0x435c44(0x10a)];return console['error'](_0x435c44(0x1d9)+_0x357c85['projectName']),console[_0x435c44(0x214)](_0x435c44(0x116)+_0x357c85['projectId']),0x0;}}export function parseKeyValue(_0x5b731c){const _0x1dafb0=a54_0x12ede4,_0x38cbce=_0x5b731c[_0x1dafb0(0x13c)]('=');if(_0x38cbce===-0x1)throw new Error(_0x1dafb0(0xd9)+_0x5b731c+_0x1dafb0(0x1d2));const _0x22bf3a=_0x5b731c[_0x1dafb0(0x190)](0x0,_0x38cbce),_0x565b67=_0x5b731c[_0x1dafb0(0x190)](_0x38cbce+0x1);if(!_0x22bf3a)throw new Error(_0x1dafb0(0xf7));return{'key':_0x22bf3a,'value':_0x565b67};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x78);[a54_0x12ede4(0x14a)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x12ede4(0x202)](_0x42f9b2){const _0x5dc115=a54_0x12ede4,{options:_0x52f313,args:_0x239629,tdx:_0x42e909}=_0x42f9b2,_0x92589e=this['requireProject'](_0x239629,_0x52f313);if(!_0x92589e)return 0x1;_0x52f313[_0x5dc115(0x19b)]&&console[_0x5dc115(0x214)](_0x5dc115(0x1c2)+_0x92589e);const _0xa43e3c=await withSpinner('Listing\x20secrets...',()=>_0x42e909[_0x5dc115(0x1f4)][_0x5dc115(0xac)](_0x92589e),{'verbose':_0x52f313[_0x5dc115(0x19b)]}),{secrets:_0x3ef273}=_0xa43e3c[_0x5dc115(0x10a)];return console[_0x5dc115(0x214)](_0x5dc115(0x7d)+_0x3ef273[_0x5dc115(0x1d8)]+'\x20secret'+(_0x3ef273['length']!==0x1?'s':'')),await handleSDKOutput(_0x3ef273,_0x52f313),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xee);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x16d);async[a54_0x12ede4(0x202)](_0x5b2edf){const _0x130919=a54_0x12ede4,{options:_0x7436f0,args:_0x18a32e,tdx:_0x49d827}=_0x5b2edf;let _0x2964c8,_0x2d6acf;if(_0x18a32e['length']>=0x1&&!_0x18a32e[0x0][_0x130919(0x20a)]('='))_0x2964c8=_0x18a32e[0x0],_0x2d6acf=_0x18a32e[_0x130919(0x17a)](0x1);else{if(_0x18a32e[_0x130919(0x1d8)]>=0x1&&_0x7436f0[_0x130919(0x16f)])_0x2964c8=_0x7436f0[_0x130919(0x16f)],_0x2d6acf=_0x18a32e;else return _0x18a32e[_0x130919(0x1d8)]>=0x1?(console[_0x130919(0x214)](_0x130919(0x108)),console[_0x130919(0x214)](_0x130919(0x89)),0x1):(console[_0x130919(0x214)](_0x130919(0x1a5)),console[_0x130919(0x214)](_0x130919(0x1de)),0x1);}if(_0x2d6acf['length']===0x0)return console[_0x130919(0x214)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x130919(0x214)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x3e5ada={};try{for(const _0x366742 of _0x2d6acf){const {key:_0x2e8040,value:_0x469137}=parseKeyValue(_0x366742);_0x3e5ada[_0x2e8040]=_0x469137;}}catch(_0x1505c7){return _0x1505c7 instanceof Error&&console['error'](a54_0x9af19e[_0x130919(0xab)](_0x130919(0x163)),_0x1505c7[_0x130919(0x8c)]),0x1;}const _0x65fa64=Object[_0x130919(0x1ea)](_0x3e5ada);_0x7436f0[_0x130919(0x19b)]&&(console[_0x130919(0x214)](_0x130919(0x1c2)+_0x2964c8),console[_0x130919(0x214)](_0x130919(0x104)+_0x65fa64[_0x130919(0xbf)](',\x20')));const _0x352e13=await withSpinner(_0x65fa64['length']===0x1?_0x130919(0x14d):'Setting\x20'+_0x65fa64[_0x130919(0x1d8)]+_0x130919(0x158),()=>_0x49d827['workflow'][_0x130919(0x1a7)](_0x2964c8,_0x3e5ada),{'verbose':_0x7436f0[_0x130919(0x19b)]}),_0x2ffa2b=_0x352e13[_0x130919(0x10a)];return console[_0x130919(0x214)](_0x65fa64[_0x130919(0x1d8)]===0x1?_0x130919(0xdd)+_0x2ffa2b[_0x130919(0x1ea)][0x0]+_0x130919(0x1d4)+_0x2ffa2b[_0x130919(0xe2)]+'\x27':'✔\x20'+_0x2ffa2b[_0x130919(0x1ea)][_0x130919(0x1d8)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x2ffa2b[_0x130919(0xe2)]+'\x27'),(_0x7436f0[_0x130919(0x11f)]||_0x7436f0[_0x130919(0x11b)])&&await handleSingleObjectOutput(_0x2ffa2b,_0x7436f0),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x12ede4(0xcf);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1fc);async[a54_0x12ede4(0x202)](_0x4e652e){const _0x26d7c2=a54_0x12ede4,{options:_0x374bb9,args:_0x3108f1,tdx:_0x43d88f}=_0x4e652e;let _0x35b5dc,_0x149b4c;if(_0x3108f1[_0x26d7c2(0x1d8)]>=0x2)_0x35b5dc=_0x3108f1[0x0],_0x149b4c=_0x3108f1[0x1];else{if(_0x3108f1[_0x26d7c2(0x1d8)]===0x1&&_0x374bb9[_0x26d7c2(0x16f)])_0x35b5dc=_0x374bb9['workflowProject'],_0x149b4c=_0x3108f1[0x0];else return _0x3108f1[_0x26d7c2(0x1d8)]===0x1?(console[_0x26d7c2(0x214)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x26d7c2(0x214)](_0x26d7c2(0x89)),0x1):(console['error'](_0x26d7c2(0x114)),console[_0x26d7c2(0x214)](_0x26d7c2(0x90)),0x1);}_0x374bb9[_0x26d7c2(0x19b)]&&(console[_0x26d7c2(0x214)]('Project:\x20'+_0x35b5dc),console[_0x26d7c2(0x214)](_0x26d7c2(0x212)+_0x149b4c));if(!_0x374bb9[_0x26d7c2(0x167)]){if(!isInteractive())return console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0xab)](_0x26d7c2(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0x1f1)](_0x26d7c2(0xa5))),0x1;const _0x2e711b=await confirmKey(_0x26d7c2(0x112)+_0x149b4c+_0x26d7c2(0x194)+_0x35b5dc+'\x27?');if(!_0x2e711b)return console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0x14f)](_0x26d7c2(0x148))),0x1;}const _0x23730a=await withSpinner('Deleting\x20secret...',()=>_0x43d88f[_0x26d7c2(0x1f4)][_0x26d7c2(0x12a)](_0x35b5dc,_0x149b4c),{'verbose':_0x374bb9[_0x26d7c2(0x19b)]}),_0x546e16=_0x23730a[_0x26d7c2(0x10a)];return console['error']('✔\x20Secret\x20\x27'+_0x546e16[_0x26d7c2(0x82)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x546e16['projectName']+'\x27'),(_0x374bb9[_0x26d7c2(0x11f)]||_0x374bb9[_0x26d7c2(0x11b)])&&await handleSingleObjectOutput(_0x546e16,_0x374bb9),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(_0xa7d4ad){const _0x558956=a54_0x12ede4,_0x287fa6=Math[_0x558956(0x198)](_0xa7d4ad/0x3e8),_0x388f41=Math['floor'](_0x287fa6/0x3c),_0x326ed6=Math['floor'](_0x388f41/0x3c),_0x5e479e=Math[_0x558956(0x198)](_0x326ed6/0x18);if(_0x5e479e>0x0){const _0x32b81f=_0x326ed6%0x18;return _0x32b81f>0x0?_0x5e479e+'d\x20'+_0x32b81f+'h':_0x5e479e+'d';}else{if(_0x326ed6>0x0){const _0x4510ce=_0x388f41%0x3c;return _0x4510ce>0x0?_0x326ed6+'h\x20'+_0x4510ce+'m':_0x326ed6+'h';}else{if(_0x388f41>0x0){const _0x43dc6c=_0x287fa6%0x3c;return _0x43dc6c>0x0?_0x388f41+'m\x20'+_0x43dc6c+'s':_0x388f41+'m';}else return _0x287fa6+'s';}}}function formatTimestamp(_0x4ab598,_0x5246bd){const _0x390b86=a54_0x12ede4,_0x513578=new Date(_0x4ab598),_0x23bd2d=String(_0x513578[_0x390b86(0x1bc)]())[_0x390b86(0xcc)](0x2,'0'),_0x3b1adc=String(_0x513578[_0x390b86(0x21e)]())['padStart'](0x2,'0'),_0x3d3f60=_0x23bd2d+':'+_0x3b1adc,_0x471dee=_0x513578[_0x390b86(0x1b5)]()===_0x5246bd['getFullYear']()&&_0x513578[_0x390b86(0xe3)]()===_0x5246bd[_0x390b86(0xe3)]()&&_0x513578['getDate']()===_0x5246bd[_0x390b86(0xe5)]();if(_0x471dee)return _0x3d3f60;else{const _0x2f6c80=String(_0x513578[_0x390b86(0xe3)]()+0x1)[_0x390b86(0xcc)](0x2,'0'),_0x35eaf9=String(_0x513578[_0x390b86(0xe5)]())[_0x390b86(0xcc)](0x2,'0');return _0x2f6c80+'-'+_0x35eaf9+'\x20'+_0x3d3f60;}}function formatDate(_0x1be6a7){const _0x12598c=a54_0x12ede4,_0x1740b3=_0x1be6a7[_0x12598c(0x1b5)](),_0x10e501=String(_0x1be6a7[_0x12598c(0xe3)]()+0x1)[_0x12598c(0xcc)](0x2,'0'),_0x10b72c=String(_0x1be6a7[_0x12598c(0xe5)]())[_0x12598c(0xcc)](0x2,'0');return _0x1740b3+'-'+_0x10e501+'-'+_0x10b72c;}function getTaskStateIcon(_0x6df690){const _0x3d4272={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3d4272[_0x6df690]||'⚪';}function getBarChar(_0x586c9a){const _0x8b46fa=a54_0x12ede4;return _0x586c9a===_0x8b46fa(0x214)||_0x586c9a===_0x8b46fa(0x18f)?'×':'─';}function getBarColor(_0x3a42e7){const _0x1d29e2=a54_0x12ede4,_0x45ebd1={'success':a54_0x9af19e[_0x1d29e2(0xde)],'error':a54_0x9af19e[_0x1d29e2(0xab)],'group_error':a54_0x9af19e['red'],'running':a54_0x9af19e[_0x1d29e2(0x101)],'blocked':a54_0x9af19e[_0x1d29e2(0x14f)],'planned':a54_0x9af19e[_0x1d29e2(0x1f1)],'canceling':a54_0x9af19e[_0x1d29e2(0x14f)]};return _0x45ebd1[_0x3a42e7]||a54_0x9af19e['white'];}function parseTaskName(_0xa5313b){const _0x309124=a54_0x12ede4;let _0x4a9dc9=_0xa5313b[_0x309124(0x1be)](/^\++/,'');const _0x1d4728=_0x4a9dc9['split']('+'),_0x5a4a26=_0x1d4728['length']>0x1?_0x1d4728[_0x309124(0x1d8)]-0x2:0x0,_0x2614d1=_0x1d4728[_0x1d4728[_0x309124(0x1d8)]-0x1]||_0x4a9dc9;return{'level':_0x5a4a26,'name':'+'+_0x2614d1};}function truncateTaskName(_0x7928b3,_0x3acfbf){const _0x35d012=a54_0x12ede4,_0xeb4217=stringWidth(_0x7928b3);if(_0xeb4217<=_0x3acfbf)return _0x7928b3;let _0x52dfe6=_0x7928b3;while(stringWidth(_0x52dfe6+'…')>_0x3acfbf&&_0x52dfe6[_0x35d012(0x1d8)]>0x0){_0x52dfe6=_0x52dfe6[_0x35d012(0x17a)](0x0,-0x1);}return _0x52dfe6+'…';}function calculateTimeScale(_0x26b42b,_0x469893){const _0x16ce6a=a54_0x12ede4;return{'startTime':_0x26b42b[_0x16ce6a(0x130)],'endTime':_0x26b42b['end'],'durationMs':_0x26b42b[_0x16ce6a(0x129)],'msPerChar':_0x26b42b[_0x16ce6a(0x129)]/_0x469893};}function timeToPosition(_0x26e897,_0x51fb82,_0x33f9cf){const _0x25b0d5=a54_0x12ede4,_0x2235b3=_0x26e897-_0x51fb82[_0x25b0d5(0x1e3)],_0xa8fde8=Math[_0x25b0d5(0x198)](_0x2235b3/_0x51fb82[_0x25b0d5(0x172)]);return Math[_0x25b0d5(0x1ca)](0x0,Math[_0x25b0d5(0x20b)](_0xa8fde8,_0x33f9cf));}function renderTimeAxis(_0x33e8b5,_0x5c5d78){const _0x429c79=a54_0x12ede4,_0x89edcb=Math[_0x429c79(0x20b)](TIMELINE_CONFIG[_0x429c79(0x179)],Math[_0x429c79(0x1ca)](TIMELINE_CONFIG[_0x429c79(0x102)],Math[_0x429c79(0x198)](_0x5c5d78/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x5a6a5d=_0x33e8b5[_0x429c79(0xe6)]/(_0x89edcb-0x1),_0x45e065=new Date(_0x33e8b5[_0x429c79(0x1e3)]),_0x41a40c=[];for(let _0x5d91f1=0x0;_0x5d91f1<_0x89edcb;_0x5d91f1++){const _0x37310f=_0x33e8b5[_0x429c79(0x1e3)]+_0x5d91f1*_0x5a6a5d,_0x140ff2=timeToPosition(_0x37310f,_0x33e8b5,_0x5c5d78),_0x422de7=formatTimestamp(_0x37310f,_0x45e065);_0x41a40c[_0x429c79(0x1cd)]({'pos':_0x140ff2,'text':_0x422de7});}const _0x10cf49=new Array(_0x5c5d78)[_0x429c79(0x113)]('\x20');let _0x31b207=-0x1;for(const {pos:_0x7a87b8,text:_0x1d8282}of _0x41a40c){let _0x3b45c3=Math['max'](0x0,_0x7a87b8-Math[_0x429c79(0x198)](_0x1d8282[_0x429c79(0x1d8)]/0x2));_0x3b45c3<=_0x31b207+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x3b45c3=_0x31b207+TIMELINE_CONFIG[_0x429c79(0x1c8)]+0x1);_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]>_0x5c5d78&&(_0x3b45c3=_0x5c5d78-_0x1d8282[_0x429c79(0x1d8)]);if(_0x3b45c3>=0x0&&_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]<=_0x5c5d78&&_0x3b45c3>_0x31b207){for(let _0x2e032b=0x0;_0x2e032b<_0x1d8282[_0x429c79(0x1d8)];_0x2e032b++){_0x10cf49[_0x3b45c3+_0x2e032b]=_0x1d8282[_0x2e032b];}_0x31b207=_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]-0x1;}}return _0x10cf49[_0x429c79(0xbf)]('');}function renderTaskRow(_0x184412,_0x460e21,_0x52a06c,_0x12ca96){const _0x1fc8ac=a54_0x12ede4,{level:_0x1343e4,name:_0x14e195}=parseTaskName(_0x184412['name']),_0x5062ec='\x20'['repeat'](_0x1343e4),_0x5a88e6=_0x184412[_0x1fc8ac(0x1bf)]?'('+formatElapsed(_0x184412['window'][_0x1fc8ac(0x129)])+')':'',_0x40f104=stringWidth(_0x5a88e6),_0x14d840=_0x1343e4*0x1,_0x3c3638=_0x12ca96-_0x14d840-_0x40f104-0x1,_0x3dc9fb=truncateTaskName(_0x14e195,_0x3c3638),_0x43cffc=_0x5062ec+_0x3dc9fb,_0x4d3648=stringWidth(_0x43cffc),_0x5cb965=_0x12ca96-_0x4d3648-_0x40f104,_0x4c2221=_0x43cffc+'\x20'[_0x1fc8ac(0xa8)](Math[_0x1fc8ac(0x1ca)](0x1,_0x5cb965))+a54_0x9af19e[_0x1fc8ac(0x1f1)](_0x5a88e6),_0xb4b08c=getTaskStateIcon(_0x184412[_0x1fc8ac(0x1d7)]),_0x2a82f0=new Array(_0x52a06c)['fill']('\x20');if(_0x184412['window']){const _0x4d029e=timeToPosition(_0x184412[_0x1fc8ac(0x1bf)]['start'],_0x460e21,_0x52a06c),_0x5f120d=timeToPosition(_0x184412[_0x1fc8ac(0x1bf)]['end'],_0x460e21,_0x52a06c),_0xff48a3=getBarChar(_0x184412[_0x1fc8ac(0x1d7)]),_0x4fd39d=Math['max'](_0x4d029e+0x1,_0x5f120d);for(let _0x16bb3e=_0x4d029e;_0x16bb3e<Math[_0x1fc8ac(0x20b)](_0x4fd39d,_0x52a06c);_0x16bb3e++){_0x2a82f0[_0x16bb3e]=_0xff48a3;}}const _0x2049bf=getBarColor(_0x184412['state']),_0x152eda=_0x2a82f0[_0x1fc8ac(0x76)](_0x15c3a4=>_0x15c3a4==='\x20'?'\x20':_0x2049bf(_0x15c3a4))[_0x1fc8ac(0xbf)]('');return _0xb4b08c+'\x20'+_0x4c2221+'│'+_0x152eda+'│';}function calculateStats(_0x4565f9){const _0x510f3f=a54_0x12ede4,_0x7b9b59={'total':_0x4565f9[_0x510f3f(0x1d8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x37993f of _0x4565f9){if(_0x37993f[_0x510f3f(0x1d7)]==='success')_0x7b9b59[_0x510f3f(0x21d)]++;else{if(_0x37993f['state']===_0x510f3f(0x214)||_0x37993f[_0x510f3f(0x1d7)]===_0x510f3f(0x18f))_0x7b9b59['error']++;else _0x37993f[_0x510f3f(0x1d7)]===_0x510f3f(0x7f)?_0x7b9b59[_0x510f3f(0x7f)]++:_0x7b9b59[_0x510f3f(0x8f)]++;}}return _0x7b9b59;}function formatStats(_0x2c37e7){const _0x1b2e75=a54_0x12ede4;return[_0x1b2e75(0x10b)+_0x2c37e7[_0x1b2e75(0x14c)],'✅\x20'+_0x2c37e7[_0x1b2e75(0x21d)],'❌\x20'+_0x2c37e7[_0x1b2e75(0x214)],'🔄\x20'+_0x2c37e7[_0x1b2e75(0x7f)],'⏳\x20'+_0x2c37e7['pending']][_0x1b2e75(0xbf)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x12ede4(0x195);[a54_0x12ede4(0x14a)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x12ede4(0x202)](_0x4b91d8){const _0x309b14=a54_0x12ede4,{options:_0x5e4c62,args:_0x53f75d,tdx:_0x4a2ccd}=_0x4b91d8;let _0x9ac32b,_0xbde1ac,_0x1b0156=![];if(_0x53f75d[0x0]){if(_0x53f75d[0x0]['includes']('.')){const _0x447927=this[_0x309b14(0x9d)](_0x53f75d,_0x5e4c62);if(!_0x447927)return 0x1;_0x9ac32b=_0x447927['projectName'],_0xbde1ac=_0x447927['workflowName'];}else{_0xbde1ac=_0x53f75d[0x0],_0x9ac32b=_0x5e4c62[_0x309b14(0x16f)];if(!_0x9ac32b)return console['error'](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),_0x309b14(0x204)),0x1;_0x1b0156=!![];}}else{const _0x1c3400=this[_0x309b14(0x9d)](_0x53f75d,_0x5e4c62);if(!_0x1c3400)return 0x1;_0x9ac32b=_0x1c3400['projectName'],_0xbde1ac=_0x1c3400['workflowName'];}if(_0x5e4c62[_0x309b14(0x19b)]){if(_0x9ac32b&&_0xbde1ac)console[_0x309b14(0x214)]('Filter:\x20'+_0x9ac32b+'.'+_0xbde1ac);else _0x9ac32b&&console[_0x309b14(0x214)](_0x309b14(0x11d)+_0x9ac32b);}const _0x3b4be9=_0x5e4c62[_0x309b14(0x1f2)],_0x4c1e79=_0x5e4c62['sessionId'];if(_0x3b4be9){_0x4c1e79&&console['error'](a54_0x9af19e[_0x309b14(0x14f)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x19a590=_0x5e4c62[_0x309b14(0x15d)];return _0x19a590?await this[_0x309b14(0x137)](_0x4b91d8,_0x3b4be9):await this[_0x309b14(0x75)](_0x4b91d8,_0x3b4be9,_0x5e4c62),0x0;}if(_0x4c1e79){const _0x106120=await withSpinner(_0x309b14(0x1b1),()=>_0x4a2ccd[_0x309b14(0x1f4)]['sessions']({'projectName':_0x9ac32b,'workflowName':_0xbde1ac,'limit':0x64}),{'verbose':_0x5e4c62['verbose']}),_0x68104b=_0x106120[_0x309b14(0x10a)][_0x309b14(0x1f3)](_0x4e4e8e=>_0x4e4e8e['id']===_0x4c1e79);if(!_0x68104b)return console['error'](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),_0x309b14(0xff)+_0x4c1e79),0x1;if(!_0x68104b[_0x309b14(0x117)]?.['id'])return console[_0x309b14(0x214)](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),'Session\x20'+_0x4c1e79+_0x309b14(0x177)),0x1;const _0x57692d=_0x68104b[_0x309b14(0x117)]['id'];_0x5e4c62['verbose']&&console[_0x309b14(0x214)](_0x309b14(0xd6)+_0x57692d+_0x309b14(0x1a2)+_0x4c1e79);const _0x3a7b88=_0x5e4c62['follow'];return _0x3a7b88?await this['pollTimeline'](_0x4b91d8,_0x57692d):await this[_0x309b14(0x75)](_0x4b91d8,_0x57692d,_0x5e4c62),0x0;}const _0xe3d0ba=await withSpinner(_0x309b14(0x1c3),()=>_0x4a2ccd['workflow'][_0x309b14(0x1e5)]({'projectName':_0x9ac32b,'workflowName':_0xbde1ac,'limit':_0x5e4c62['limit']||0x32}),{'verbose':_0x5e4c62[_0x309b14(0x19b)]}),_0x428428=_0xe3d0ba[_0x309b14(0x10a)];if(_0x428428[_0x309b14(0x1d8)]===0x0){if(_0x9ac32b&&_0xbde1ac)console[_0x309b14(0x214)]('No\x20sessions\x20found\x20for:\x20'+_0x9ac32b+'.'+_0xbde1ac);else _0x9ac32b?console[_0x309b14(0x214)](_0x309b14(0x16a)+_0x9ac32b):(console[_0x309b14(0x214)]('No\x20workflow\x20sessions\x20found'),console['error'](a54_0x9af19e[_0x309b14(0x1f1)](_0x309b14(0x196))));return 0x0;}_0x428428[_0x309b14(0x154)]((_0x5e307d,_0x5ee797)=>{const _0x4efa21=_0x309b14,_0x109ba7=_0x5e307d[_0x4efa21(0x1ed)]||'',_0x100560=_0x5ee797[_0x4efa21(0x1ed)]||'';return _0x100560[_0x4efa21(0x1cf)](_0x109ba7);});if(_0x5e4c62[_0x309b14(0x11f)]||_0x5e4c62[_0x309b14(0x11b)])return await handleSDKOutput(_0x428428,_0x5e4c62),0x0;let _0x44afc1;if(_0x1b0156){const _0xdd31a9=_0x428428[0x0];if(!_0xdd31a9['lastAttempt']?.['id'])return console[_0x309b14(0x214)](_0x309b14(0xca)),0x0;_0x44afc1=_0xdd31a9[_0x309b14(0x117)]['id'],_0x5e4c62['verbose']&&console[_0x309b14(0x214)](_0x309b14(0x1df)+_0xdd31a9[_0x309b14(0x1ed)]);}else{const _0x4819bd=_0x428428[_0x309b14(0x76)](_0x43b7e7=>{const _0x567ab2=_0x309b14,_0x1af263=getAttemptStatusDisplay(_0x43b7e7[_0x567ab2(0x117)]);return{'title':_0x43b7e7[_0x567ab2(0x168)]?.['name']+'.'+_0x43b7e7[_0x567ab2(0x1f4)]?.[_0x567ab2(0x1a3)]+_0x567ab2(0xae)+_0x43b7e7['sessionTime']+'\x20'+_0x1af263[_0x567ab2(0x1c4)],'value':_0x43b7e7['lastAttempt']?.['id']||'','description':_0x1af263['text']};}),_0x3c7a9e=await a54_0x435c0a({'type':_0x309b14(0x171),'name':'attemptId','message':_0x309b14(0xa2),'choices':_0x4819bd['filter'](_0x56de5d=>_0x56de5d[_0x309b14(0x1af)]!=='')});if(!_0x3c7a9e['attemptId'])return 0x0;_0x44afc1=_0x3c7a9e[_0x309b14(0x1f2)];}const _0x366a6c=_0x5e4c62['follow'];return _0x366a6c?await this[_0x309b14(0x137)](_0x4b91d8,_0x44afc1):await this[_0x309b14(0x75)](_0x4b91d8,_0x44afc1,_0x5e4c62),0x0;}async['renderSingleTimeline'](_0x3e25b9,_0xae1afc,_0x33a96b){const _0x10d335=a54_0x12ede4,{tdx:_0x26a91d}=_0x3e25b9;let _0x11d146,_0xf68f34;try{[_0x11d146,_0xf68f34]=await Promise[_0x10d335(0xda)]([_0x26a91d[_0x10d335(0x1f4)][_0x10d335(0x21b)](_0xae1afc),_0x26a91d[_0x10d335(0x1f4)][_0x10d335(0x19c)](_0xae1afc,![])]);}catch(_0x34e822){console[_0x10d335(0x214)](a54_0x9af19e[_0x10d335(0xab)](_0x10d335(0x169)));_0x33a96b['verbose']&&console[_0x10d335(0x214)](_0x34e822);throw _0x34e822;}if(_0x33a96b['json']||_0x33a96b[_0x10d335(0x11b)]){const _0x5a937a=this['buildTimelineData'](_0x11d146,_0xf68f34);await handleSDKOutput([_0x5a937a],_0x33a96b);return;}const _0x132033=_0x26a91d[_0x10d335(0xa9)][_0x10d335(0x10d)],_0x240503=this[_0x10d335(0xec)](_0x11d146,_0xf68f34,_0x132033);console[_0x10d335(0x144)](_0x240503);}async[a54_0x12ede4(0x137)](_0x3c510f,_0x44184a){const _0x1cec3e=a54_0x12ede4,{tdx:_0x412d48}=_0x3c510f,_0x53759f=TIMELINE_CONFIG[_0x1cec3e(0x1c0)],_0x2e0f4e=TIMELINE_CONFIG[_0x1cec3e(0x127)];let _0x4a834c=0x0;while(_0x4a834c<_0x2e0f4e){process[_0x1cec3e(0xd7)]['isTTY']&&process[_0x1cec3e(0xd7)]['write']('\x1bc');let _0x363cf6,_0x25e195;try{[_0x363cf6,_0x25e195]=await Promise[_0x1cec3e(0xda)]([_0x412d48[_0x1cec3e(0x1f4)]['attempt'](_0x44184a),_0x412d48[_0x1cec3e(0x1f4)][_0x1cec3e(0x19c)](_0x44184a,![])]);}catch(_0x30cf6f){console['error'](a54_0x9af19e[_0x1cec3e(0xab)](_0x1cec3e(0x1cb)));_0x4a834c>0x0&&console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x1f1)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x4a834c));throw _0x30cf6f;}const _0x4d7e7a=_0x412d48[_0x1cec3e(0xa9)][_0x1cec3e(0x10d)],_0x1775ed=this['renderTimeline'](_0x363cf6,_0x25e195,_0x4d7e7a);console[_0x1cec3e(0x144)](_0x1775ed);const _0x4cc66c=_0x363cf6[_0x1cec3e(0xb9)]&&_0x25e195[_0x1cec3e(0x122)](_0x289af2=>_0x289af2[_0x1cec3e(0x1d7)]!=='running'&&_0x289af2[_0x1cec3e(0x1d7)]!==_0x1cec3e(0x221));if(_0x4cc66c){console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0xde)](_0x1cec3e(0x136)));break;}console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x1f1)](_0x1cec3e(0x92)+_0x4a834c*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0xa1a708=>setTimeout(_0xa1a708,_0x53759f)),_0x4a834c++;}_0x4a834c>=_0x2e0f4e&&console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x14f)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x12ede4(0xec)](_0x2e7538,_0x51a288,_0x2721de){const _0x563fc6=a54_0x12ede4,_0x55d32f=[],_0x74c31e=TIMELINE_CONFIG[_0x563fc6(0xad)],_0x330894=0x5,_0x1552e8=process[_0x563fc6(0xd7)]['columns']||0x78,_0x75a7b6=_0x1552e8-_0x74c31e-_0x330894,_0x3dbcb3=Math[_0x563fc6(0x1ca)](TIMELINE_CONFIG[_0x563fc6(0x15c)],Math[_0x563fc6(0x20b)](_0x75a7b6,TIMELINE_CONFIG[_0x563fc6(0x15b)])),_0x58d853=new Date(_0x2e7538[_0x563fc6(0xd2)])[_0x563fc6(0x1b0)](),_0x54aff8=_0x2e7538['finishedAt']?new Date(_0x2e7538[_0x563fc6(0x166)])[_0x563fc6(0x1b0)]():Date[_0x563fc6(0x21f)](),_0x3674f0={'start':_0x58d853,'end':_0x54aff8,'duration':_0x54aff8-_0x58d853},_0x118dd7=new Map(),_0x355260=[];for(const _0x2e0cef of _0x51a288){if(_0x2e0cef[_0x563fc6(0xfc)]){const _0x4294bf=new Date(_0x2e0cef[_0x563fc6(0xfc)])[_0x563fc6(0x1b0)](),_0x881d8a=_0x2e0cef[_0x563fc6(0x1d0)]?new Date(_0x2e0cef['updatedAt'])[_0x563fc6(0x1b0)]():Date[_0x563fc6(0x21f)](),_0x5bc275={'start':_0x4294bf,'end':_0x881d8a,'duration':_0x881d8a-_0x4294bf};_0x118dd7['set'](_0x2e0cef['id'],_0x5bc275),_0x355260[_0x563fc6(0x1cd)]({'name':_0x2e0cef[_0x563fc6(0x18c)],'state':_0x2e0cef['state']||'unknown','window':_0x5bc275});}else _0x355260[_0x563fc6(0x1cd)]({'name':_0x2e0cef['fullName'],'state':_0x2e0cef[_0x563fc6(0x1d7)]||_0x563fc6(0x221),'window':undefined});}_0x355260[_0x563fc6(0x154)]((_0x2500ae,_0x50e4b4)=>{const _0x8227f7=_0x563fc6;if(!_0x2500ae['window'])return 0x1;if(!_0x50e4b4[_0x8227f7(0x1bf)])return-0x1;return _0x2500ae['window'][_0x8227f7(0x130)]-_0x50e4b4[_0x8227f7(0x1bf)][_0x8227f7(0x130)];});const _0x225827=_0x355260['length'],_0x1d9adc=_0x225827>TIMELINE_CONFIG[_0x563fc6(0xfd)];_0x1d9adc&&_0x355260[_0x563fc6(0xa6)](TIMELINE_CONFIG[_0x563fc6(0xfd)]);const _0x20ee63=calculateTimeScale(_0x3674f0,_0x3dbcb3),_0x5305c6=_0x2e7538[_0x563fc6(0xb9)]?_0x2e7538[_0x563fc6(0x21d)]?a54_0x9af19e[_0x563fc6(0xde)](_0x563fc6(0x21d)):a54_0x9af19e[_0x563fc6(0xab)]('error'):a54_0x9af19e['blue']('running'),_0x404368=_0x2e7538[_0x563fc6(0x168)]?.['id'],_0x6881cb=_0x2e7538[_0x563fc6(0x1a1)];let _0x45c470;if(_0x404368&&_0x6881cb){const _0x2acd92=getWorkflowAttemptUrl(_0x2721de,_0x404368,_0x6881cb,_0x2e7538['id']);_0x45c470=hyperlink(a54_0x9af19e[_0x563fc6(0x1f1)](_0x2e7538['id']),_0x2acd92);}else _0x45c470=a54_0x9af19e['dim'](_0x2e7538['id']);_0x55d32f[_0x563fc6(0x1cd)]('Attempt:\x20'+_0x45c470+_0x563fc6(0xae)+_0x5305c6+_0x563fc6(0xae)+formatElapsed(_0x3674f0[_0x563fc6(0x129)]));if(_0x355260[_0x563fc6(0x1d8)]>0x0){const _0x4f1380=renderTimeAxis(_0x20ee63,_0x3dbcb3),_0x1b6073=new Date(_0x3674f0[_0x563fc6(0x130)]),_0x5f4095=formatDate(_0x1b6073),_0xa8994b=TIMELINE_CONFIG[_0x563fc6(0xa4)]+TIMELINE_CONFIG[_0x563fc6(0xf8)]+_0x74c31e,_0x3c91f1=_0x5f4095['padStart'](_0xa8994b),_0x4ee86e=a54_0x9af19e[_0x563fc6(0x1f1)](_0x3c91f1);_0x55d32f['push'](_0x4ee86e+'\x20'+_0x4f1380);for(const _0x4b1ecf of _0x355260){_0x55d32f[_0x563fc6(0x1cd)](renderTaskRow(_0x4b1ecf,_0x20ee63,_0x3dbcb3,_0x74c31e));}const _0x46aa60=calculateStats(_0x355260);_0x55d32f[_0x563fc6(0x1cd)](formatStats(_0x46aa60)),_0x1d9adc&&_0x55d32f[_0x563fc6(0x1cd)](a54_0x9af19e['yellow'](_0x563fc6(0x1fe)+TIMELINE_CONFIG[_0x563fc6(0xfd)]+_0x563fc6(0xdc)+_0x225827+_0x563fc6(0x96))),_0x55d32f[_0x563fc6(0x1cd)](''),_0x55d32f['push'](a54_0x9af19e[_0x563fc6(0x1f1)](_0x563fc6(0x189))+(_0x563fc6(0x14e)+_0x2e7538['id']+_0x563fc6(0x20e))+a54_0x9af19e['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x55d32f[_0x563fc6(0x1cd)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x55d32f[_0x563fc6(0xbf)]('\x0a');}[a54_0x12ede4(0x150)](_0xa5537f,_0x36c83f){const _0x2cd79b=a54_0x12ede4,_0x5caa86=new Date(_0xa5537f['createdAt'])[_0x2cd79b(0x1b0)](),_0xa1265a=_0xa5537f[_0x2cd79b(0x166)]?new Date(_0xa5537f['finishedAt'])[_0x2cd79b(0x1b0)]():Date[_0x2cd79b(0x21f)](),_0x21c728=_0xa1265a-_0x5caa86,_0x75d2b6=[];for(const _0x3601c9 of _0x36c83f){if(_0x3601c9[_0x2cd79b(0xfc)]){const _0x2411d8=new Date(_0x3601c9[_0x2cd79b(0xfc)])['getTime'](),_0x2af6d7=_0x3601c9[_0x2cd79b(0x1d0)]?new Date(_0x3601c9[_0x2cd79b(0x1d0)])[_0x2cd79b(0x1b0)]():Date['now']();_0x75d2b6[_0x2cd79b(0x1cd)]({'name':_0x3601c9[_0x2cd79b(0x18c)],'state':_0x3601c9[_0x2cd79b(0x1d7)]||_0x2cd79b(0x180),'window':{'start':_0x2411d8,'end':_0x2af6d7,'duration':_0x2af6d7-_0x2411d8}});}else _0x75d2b6['push']({'name':_0x3601c9['fullName'],'state':_0x3601c9[_0x2cd79b(0x1d7)]||_0x2cd79b(0x221),'window':undefined});}const _0x5d9e1b=calculateStats(_0x75d2b6);return{'attempt':{'id':_0xa5537f['id'],'status':_0xa5537f[_0x2cd79b(0xb9)]?_0xa5537f[_0x2cd79b(0x21d)]?_0x2cd79b(0x21d):_0x2cd79b(0x214):_0x2cd79b(0x7f),'createdAt':_0xa5537f[_0x2cd79b(0xd2)],'finishedAt':_0xa5537f[_0x2cd79b(0x166)],'duration_ms':_0x21c728},'tasks':_0x75d2b6[_0x2cd79b(0x76)](_0xfd7b49=>({'name':_0xfd7b49[_0x2cd79b(0x1a3)],'state':_0xfd7b49['state'],'startedAt':_0xfd7b49['window']?new Date(_0xfd7b49['window'][_0x2cd79b(0x130)])['toISOString']():null,'updatedAt':_0xfd7b49[_0x2cd79b(0x1bf)]?new Date(_0xfd7b49[_0x2cd79b(0x1bf)]['end'])['toISOString']():null,'duration_ms':_0xfd7b49[_0x2cd79b(0x1bf)]?.[_0x2cd79b(0x129)]||null})),'stats':_0x5d9e1b};}}
1
+ function a54_0x597d(_0x3be6d8,_0x4f7ef0){_0x3be6d8=_0x3be6d8-0x165;const _0x1b76e9=a54_0x1b76();let _0x597dfe=_0x1b76e9[_0x3be6d8];return _0x597dfe;}const a54_0x5bba2d=a54_0x597d;(function(_0x168f04,_0x4b432a){const _0x201bd4=a54_0x597d,_0x1e624b=_0x168f04();while(!![]){try{const _0xdcd6dc=-parseInt(_0x201bd4(0x2fd))/0x1+parseInt(_0x201bd4(0x210))/0x2*(parseInt(_0x201bd4(0x207))/0x3)+parseInt(_0x201bd4(0x2f3))/0x4*(parseInt(_0x201bd4(0x2c3))/0x5)+-parseInt(_0x201bd4(0x1f7))/0x6*(-parseInt(_0x201bd4(0x1e3))/0x7)+parseInt(_0x201bd4(0x1b7))/0x8+-parseInt(_0x201bd4(0x2fb))/0x9+-parseInt(_0x201bd4(0x1aa))/0xa;if(_0xdcd6dc===_0x4b432a)break;else _0x1e624b['push'](_0x1e624b['shift']());}catch(_0x44ace3){_0x1e624b['push'](_0x1e624b['shift']());}}}(a54_0x1b76,0x3fc89));import a54_0x425391 from'chalk';import{existsSync}from'fs';import a54_0x55dc3e 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_0x2e7bce from'prompts';function getAttemptStatusDisplay(_0x5af573){const _0x441e9e=a54_0x597d;if(!_0x5af573)return{'icon':'⏳','text':''};const {done:_0x5884a0,success:_0x4677e1,cancelRequested:_0x2525ce}=_0x5af573;if(!_0x5884a0)return _0x2525ce?{'icon':'🛑','text':a54_0x425391[_0x441e9e(0x1f9)](_0x441e9e(0x227))}:{'icon':'🔄','text':a54_0x425391[_0x441e9e(0x1b8)](_0x441e9e(0x1d5))};if(_0x4677e1)return{'icon':'✅','text':a54_0x425391[_0x441e9e(0x2b6)]('success')};return{'icon':'❌','text':a54_0x425391['red'](_0x441e9e(0x28c))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x5bba2d(0x1d0)](_0x37b534,_0x30c3d9,_0x4c9dd0=0x0){const _0x73f563=a54_0x5bba2d;return _0x37b534[_0x4c9dd0]||_0x30c3d9[_0x73f563(0x2eb)];}[a54_0x5bba2d(0x1c6)](_0xfa0ba5,_0xbd5680,_0x44470=0x0){const _0x255c7f=a54_0x5bba2d,_0xa65b78=this[_0x255c7f(0x1d0)](_0xfa0ba5,_0xbd5680,_0x44470);if(!_0xa65b78)return console[_0x255c7f(0x28c)](a54_0x425391[_0x255c7f(0x28b)](_0x255c7f(0x1f0)),_0x255c7f(0x1e6)),console[_0x255c7f(0x28c)](a54_0x425391[_0x255c7f(0x1af)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0xa65b78;}[a54_0x5bba2d(0x1df)](_0x424dfc,_0x1fe6e0){const _0x1a86d9=a54_0x5bba2d;if(_0x424dfc[0x0]){const _0x5168ea=_0x424dfc[0x0][_0x1a86d9(0x195)]('.');if(_0x5168ea[_0x1a86d9(0x2c0)]===0x1)return{'projectName':_0x5168ea[0x0],'workflowName':undefined};else return _0x5168ea[_0x1a86d9(0x2c0)]===0x2?{'projectName':_0x5168ea[0x0],'workflowName':_0x5168ea[0x1]}:(console[_0x1a86d9(0x28c)](a54_0x425391[_0x1a86d9(0x28b)](_0x1a86d9(0x1f0)),_0x1a86d9(0x179)),null);}return{'projectName':_0x1fe6e0[_0x1a86d9(0x2eb)],'workflowName':undefined};}[a54_0x5bba2d(0x266)](_0x552dce,_0xa23db4,_0x4541ea=0x0){const _0xcbc134=a54_0x5bba2d;if(_0x552dce[_0x4541ea])return _0x552dce[_0x4541ea];if(_0xa23db4[_0xcbc134(0x2eb)]){const _0x1eaf52=a54_0x55dc3e[_0xcbc134(0x18a)](process['cwd'](),'workflows',_0xa23db4['workflowProject']);if(existsSync(a54_0x55dc3e[_0xcbc134(0x18a)](_0x1eaf52,_0xcbc134(0x1e8))))return _0x1eaf52;}return undefined;}async['showWorkflowConsoleUrl'](_0x416ed9,_0x54b550,_0x3fc7d1){const _0x2f8579=a54_0x5bba2d;try{const _0x57d6bc=await _0x416ed9[_0x2f8579(0x2ba)][_0x2f8579(0x203)](_0x54b550,{'limit':0x1});if(_0x57d6bc[_0x2f8579(0x2c0)]>0x0){const _0x4e71e8=_0x57d6bc[0x0]['id'],_0x2c0b3d=getWorkflowUrl(_0x3fc7d1,_0x4e71e8);console[_0x2f8579(0x28c)]('\x20\x20Console:\x20'+a54_0x425391[_0x2f8579(0x183)](_0x2c0b3d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1bf);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1b2);async['execute'](_0x1b4007){const _0x3ca223=a54_0x5bba2d,{options:_0x41ab41,args:_0x3e1507,tdx:_0x5b9efa}=_0x1b4007,_0x3c6c85=_0x3e1507[0x0],_0x59a124=_0x41ab41[_0x3ca223(0x243)];if(_0x59a124)return saveSessionContext({'workflow_project':undefined},_0x41ab41[_0x3ca223(0x2d6)]),console[_0x3ca223(0x26b)](a54_0x425391[_0x3ca223(0x2b6)](_0x3ca223(0x2b4))),0x0;if(!_0x3c6c85)return console[_0x3ca223(0x28c)](a54_0x425391[_0x3ca223(0x28b)](_0x3ca223(0x1f0)),_0x3ca223(0x1e6)),console[_0x3ca223(0x28c)](a54_0x425391['dim'](_0x3ca223(0x1b4))),console[_0x3ca223(0x28c)](a54_0x425391[_0x3ca223(0x1af)](_0x3ca223(0x27a))),0x1;const _0x2eeb6c=await withSpinner('Resolving\x20project\x20\x27'+_0x3c6c85+'\x27...',()=>_0x5b9efa['workflow'][_0x3ca223(0x298)](_0x3c6c85),{'verbose':_0x41ab41[_0x3ca223(0x26a)]}),{name:_0x3111c1}=_0x2eeb6c[_0x3ca223(0x197)];return saveSessionContext({'workflow_project':_0x3111c1},_0x41ab41[_0x3ca223(0x2d6)]),console['log'](a54_0x425391['green'](_0x3ca223(0x238)+a54_0x425391[_0x3ca223(0x183)](_0x3111c1))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:projects';['description']='List\x20all\x20workflow\x20projects';async[a54_0x5bba2d(0x321)](_0x305272){const _0x191b3c=a54_0x5bba2d,{options:_0x4b162e,args:_0x4cbd3b,tdx:_0x3c08dd}=_0x305272,_0x5c5ba4=_0x4cbd3b[0x0];_0x4b162e[_0x191b3c(0x26a)]&&_0x5c5ba4&&console[_0x191b3c(0x28c)]('Pattern:\x20'+_0x5c5ba4);const _0x165c7a=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3c08dd['workflow'][_0x191b3c(0x2e1)](_0x5c5ba4,{'limit':_0x4b162e[_0x191b3c(0x2d9)]}),{'verbose':_0x4b162e['verbose']});let _0x205500=_0x165c7a[_0x191b3c(0x197)];_0x205500[_0x191b3c(0x29f)]((_0x20ec29,_0x1674de)=>_0x20ec29[_0x191b3c(0x310)]['localeCompare'](_0x1674de['name']));const _0x4617e1=_0x4b162e[_0x191b3c(0x2d9)]||0x64,_0x72b1ff=_0x205500['length']>=_0x4617e1?a54_0x425391[_0x191b3c(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x191b3c(0x28c)](_0x191b3c(0x1ff)+_0x205500[_0x191b3c(0x2c0)]+'\x20project'+(_0x205500[_0x191b3c(0x2c0)]!==0x1?'s':'')+_0x72b1ff);if(_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x257)||_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x242)||_0x4b162e[_0x191b3c(0x24d)]===_0x191b3c(0x293))await handleSDKOutput(_0x205500,_0x4b162e);else{if(_0x205500[_0x191b3c(0x2c0)]===0x0)_0x5c5ba4?console[_0x191b3c(0x26b)](_0x191b3c(0x18b)+_0x5c5ba4):console[_0x191b3c(0x26b)]('No\x20workflow\x20projects\x20found');else{const _0x3dcf76=_0x205500[_0x191b3c(0x318)](_0x4fe486=>{const _0x3f7002=_0x191b3c,_0x5f0014=_0x4fe486[_0x3f7002(0x1ab)]?.[_0x3f7002(0x2ae)](_0x2fddda=>_0x2fddda[_0x3f7002(0x30b)]===_0x3f7002(0x2b0)),_0x2c85b6=_0x5f0014?a54_0x425391['dim'](_0x3f7002(0x29a)):'';return _0x3f7002(0x255)+_0x4fe486[_0x3f7002(0x310)]+_0x2c85b6;});await writeOutput(_0x3dcf76[_0x191b3c(0x18a)]('\x0a'),_0x4b162e[_0x191b3c(0x1cd)],_0x191b3c(0x29d));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x240);async[a54_0x5bba2d(0x321)](_0x32a2e6){const _0x1856e6=a54_0x5bba2d,{options:_0x1c5d3b,args:_0x4b9861,tdx:_0x1cd913}=_0x32a2e6,_0x550c59=this[_0x1856e6(0x1d0)](_0x4b9861,_0x1c5d3b);_0x1c5d3b[_0x1856e6(0x26a)]&&_0x550c59&&console[_0x1856e6(0x28c)](_0x1856e6(0x261)+_0x550c59);const _0x26ee72=await withSpinner(_0x1856e6(0x1e1),()=>_0x1cd913[_0x1856e6(0x2ba)][_0x1856e6(0x203)](_0x550c59,{'limit':_0x1c5d3b[_0x1856e6(0x2d9)]}),{'verbose':_0x1c5d3b[_0x1856e6(0x26a)]});let _0x588fef=_0x26ee72['data'];_0x588fef[_0x1856e6(0x29f)]((_0x1945af,_0x33c6c1)=>{const _0x378608=_0x1856e6,_0x5a6683=_0x1945af[_0x378608(0x310)][_0x378608(0x23d)](_0x33c6c1[_0x378608(0x310)]);if(_0x5a6683!==0x0)return _0x5a6683;return(_0x1945af[_0x378608(0x22a)]?.[_0x378608(0x310)]||'')[_0x378608(0x23d)](_0x33c6c1['project']?.[_0x378608(0x310)]||'');});const _0x2079c6=_0x1c5d3b['limit']||0x64,_0x2092c1=_0x588fef[_0x1856e6(0x2c0)]>=_0x2079c6?a54_0x425391[_0x1856e6(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x1856e6(0x1ff)+_0x588fef[_0x1856e6(0x2c0)]+_0x1856e6(0x27e)+(_0x588fef[_0x1856e6(0x2c0)]!==0x1?'s':'')+_0x2092c1);if(_0x1c5d3b[_0x1856e6(0x24d)]==='json'||_0x1c5d3b[_0x1856e6(0x24d)]==='jsonl'||_0x1c5d3b[_0x1856e6(0x24d)]===_0x1856e6(0x293))await handleSDKOutput(_0x588fef,_0x1c5d3b);else{if(_0x588fef[_0x1856e6(0x2c0)]===0x0)_0x550c59?console[_0x1856e6(0x26b)](_0x1856e6(0x1d6)+_0x550c59):console[_0x1856e6(0x26b)](_0x1856e6(0x2d1));else{const _0x155b45=_0x1c5d3b[_0x1856e6(0x20b)],_0x523914=_0x588fef[_0x1856e6(0x318)](_0xc38280=>{const _0x2aa138=_0x1856e6,_0xfe7a26=a54_0x425391['dim']('#'+_0xc38280['id']),_0x31259b=hyperlink(_0xfe7a26,getWorkflowUrl(_0x155b45,_0xc38280['id'])),_0x152828=_0xc38280[_0x2aa138(0x22a)]?.[_0x2aa138(0x310)]?a54_0x425391['dim']('\x20('+_0xc38280[_0x2aa138(0x22a)][_0x2aa138(0x310)]+')'):'';return _0x2aa138(0x2bd)+_0x31259b+'\x20'+_0xc38280[_0x2aa138(0x310)]+_0x152828;});await writeOutput(_0x523914[_0x1856e6(0x18a)]('\x0a'),_0x1c5d3b[_0x1856e6(0x1cd)],_0x1856e6(0x29d));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1c2);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x189);async['execute'](_0xe34f8d){const _0x551155=a54_0x5bba2d,{options:_0x34abdd,args:_0x1448a8,tdx:_0x564820}=_0xe34f8d,_0x115949=this[_0x551155(0x1df)](_0x1448a8,_0x34abdd);if(!_0x115949)return 0x1;const {projectName:_0x2deae0,workflowName:_0x2904b9}=_0x115949;if(_0x34abdd['verbose']){if(_0x2deae0&&_0x2904b9)console['error'](_0x551155(0x28a)+_0x2deae0+'.'+_0x2904b9);else _0x2deae0&&console[_0x551155(0x28c)](_0x551155(0x30f)+_0x2deae0);const _0x13804a=_0x34abdd[_0x551155(0x27b)];_0x13804a&&console[_0x551155(0x28c)](_0x551155(0x315)+_0x13804a);}let _0x45786d=0x28;if(process[_0x551155(0x2a4)][_0x551155(0x1f3)]&&!_0x34abdd[_0x551155(0x1cd)]&&!_0x34abdd[_0x551155(0x24d)]){const _0x21ca40=process['stdout'][_0x551155(0x254)]||0x28;_0x45786d=Math[_0x551155(0x307)](0x14,Math[_0x551155(0x1b0)](_0x21ca40*0x2/0x3));}const _0x53d486=_0x34abdd[_0x551155(0x2d9)]||_0x45786d,_0x7bf841=await withSpinner(_0x551155(0x2a6),()=>_0x564820[_0x551155(0x2ba)][_0x551155(0x2ce)]({'projectName':_0x2deae0,'workflowName':_0x2904b9,'status':_0x34abdd[_0x551155(0x27b)],'fromTime':_0x34abdd[_0x551155(0x23e)],'toTime':_0x34abdd['to'],'limit':_0x53d486}),{'verbose':_0x34abdd[_0x551155(0x26a)]}),_0x7dc51f=_0x7bf841[_0x551155(0x197)];_0x7dc51f['sort']((_0x33d9c4,_0x25e326)=>{const _0x15f11b=_0x551155,_0x1c6672=_0x33d9c4[_0x15f11b(0x24c)]||'',_0x1f5ed8=_0x25e326[_0x15f11b(0x24c)]||'';return _0x1f5ed8[_0x15f11b(0x23d)](_0x1c6672);});_0x7dc51f[_0x551155(0x2c0)]>=_0x53d486?console[_0x551155(0x28c)](_0x551155(0x2d0)+_0x7dc51f[_0x551155(0x2c0)]+_0x551155(0x17a)+a54_0x425391[_0x551155(0x1af)](_0x551155(0x2e8))):console['error'](_0x551155(0x1ff)+_0x7dc51f[_0x551155(0x2c0)]+_0x551155(0x22b)+(_0x7dc51f[_0x551155(0x2c0)]!==0x1?'s':''));if(_0x34abdd[_0x551155(0x24d)]===_0x551155(0x257)||_0x34abdd['format']==='jsonl'||_0x34abdd[_0x551155(0x24d)]===_0x551155(0x293))await handleSDKOutput(_0x7dc51f,_0x34abdd);else{if(!process['stdout'][_0x551155(0x1f3)]||_0x34abdd['output']){if(_0x7dc51f[_0x551155(0x2c0)]===0x0){if(_0x2deae0&&_0x2904b9)console[_0x551155(0x26b)](_0x551155(0x2c4)+_0x2deae0+'.'+_0x2904b9);else _0x2deae0?console['log'](_0x551155(0x288)+_0x2deae0):console['log'](_0x551155(0x20c));}else{const _0x18f91a=_0x34abdd[_0x551155(0x20b)],_0x17d62c=this[_0x551155(0x191)](_0x7dc51f,_0x18f91a);_0x34abdd['output']?await writeOutput(_0x17d62c,_0x34abdd[_0x551155(0x1cd)],'list'):console['log'](_0x17d62c);}!_0x2deae0&&(console['error'](''),console[_0x551155(0x28c)](a54_0x425391['dim'](_0x551155(0x249))),console[_0x551155(0x28c)](a54_0x425391[_0x551155(0x1af)](_0x551155(0x244))+'or'+a54_0x425391['dim'](_0x551155(0x18f))));}else{if(_0x7dc51f[_0x551155(0x2c0)]===0x0){if(_0x2deae0&&_0x2904b9)console[_0x551155(0x26b)]('No\x20sessions\x20found\x20for:\x20'+_0x2deae0+'.'+_0x2904b9);else _0x2deae0?console[_0x551155(0x26b)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2deae0):console[_0x551155(0x26b)](_0x551155(0x20c));}else await this['navigateSessionsInteractive'](_0x7dc51f,_0xe34f8d,_0x2deae0);}}return 0x0;}[a54_0x5bba2d(0x191)](_0x121c65,_0x22b55c){const _0x1586f6=a54_0x5bba2d,_0x20025f=[],_0x1781a2=new Map();let _0x45d44c=Infinity,_0x1da45b=-Infinity;for(const _0x316f86 of _0x121c65){if(_0x316f86['lastAttempt']?.[_0x1586f6(0x17f)]){const _0x34047e=new Date(_0x316f86[_0x1586f6(0x305)][_0x1586f6(0x17f)])['getTime'](),_0x5781a5=_0x316f86[_0x1586f6(0x305)]['finishedAt']?new Date(_0x316f86[_0x1586f6(0x305)]['finishedAt'])[_0x1586f6(0x2ef)]():Date['now'](),_0x420ee7=_0x316f86['project']?.[_0x1586f6(0x310)]||'(unknown)';!_0x1781a2['has'](_0x420ee7)&&_0x1781a2[_0x1586f6(0x323)](_0x420ee7,[]),_0x1781a2[_0x1586f6(0x31c)](_0x420ee7)[_0x1586f6(0x234)]({'session':_0x316f86,'startTime':_0x34047e,'endTime':_0x5781a5,'duration':_0x5781a5-_0x34047e}),_0x45d44c=Math[_0x1586f6(0x19a)](_0x45d44c,_0x34047e),_0x1da45b=Math[_0x1586f6(0x307)](_0x1da45b,_0x5781a5);}}if(_0x1781a2[_0x1586f6(0x190)]===0x0)return _0x1586f6(0x21e);const _0x26699f=process[_0x1586f6(0x2a4)][_0x1586f6(0x30c)]||0x78,_0x1e1cfc=0x1e,_0x34cc8f=0x32,_0x2c3f74=0x4,_0x5af2e0=Math[_0x1586f6(0x19a)](_0x34cc8f,Math[_0x1586f6(0x307)](_0x1e1cfc,Math[_0x1586f6(0x1b0)](_0x26699f*0.3))),_0x5aa7d9=_0x26699f-_0x5af2e0-TIMELINE_CONFIG[_0x1586f6(0x25a)]-0x3-_0x2c3f74,_0x19f75d=_0x1da45b-_0x45d44c,_0x1b62a3=_0x19f75d/_0x5af2e0,_0xd1bda0=renderTimeAxis({'startTime':_0x45d44c,'endTime':_0x1da45b,'durationMs':_0x19f75d,'msPerChar':_0x1b62a3},_0x5af2e0),_0x5168bf=[];for(const _0xffbaf6 of _0x1781a2['values']()){_0x5168bf[_0x1586f6(0x234)](..._0xffbaf6);}_0x5168bf[_0x1586f6(0x29f)]((_0x5430db,_0x2423fd)=>_0x2423fd[_0x1586f6(0x30d)]-_0x5430db[_0x1586f6(0x30d)]);const _0x3975ad=new Date(_0x45d44c),_0x41fcae=formatDate(_0x3975ad),_0x2986b4=_0x2c3f74+TIMELINE_CONFIG[_0x1586f6(0x2de)]+TIMELINE_CONFIG[_0x1586f6(0x1c4)]+_0x5aa7d9,_0x1cd6c7='\x20'['repeat'](_0x2986b4-_0x41fcae['length']),_0x2d73ad=_0x1cd6c7+a54_0x425391[_0x1586f6(0x1af)](_0x41fcae)+'\x20'+_0xd1bda0;_0x20025f[_0x1586f6(0x234)](_0x2d73ad);const _0x5734b9=0x16;let _0x24e3ba=0x0;for(const _0x494a0e of _0x5168bf){const _0x4fb5f8=_0x494a0e[_0x1586f6(0x2d6)][_0x1586f6(0x22a)]?.['name']||'?',_0x57e107=Math[_0x1586f6(0x19a)](stringWidth(_0x4fb5f8),_0x5734b9);_0x24e3ba=Math[_0x1586f6(0x307)](_0x24e3ba,_0x57e107);}for(const _0x43bba4 of _0x5168bf){const {session:_0x4728b7,startTime:_0x33747d,endTime:_0x1487f8,duration:_0x3a3b58}=_0x43bba4,_0xee4f11=_0x4728b7[_0x1586f6(0x22a)]?.['id'],_0xbd8666=_0x4728b7['id'],_0x25b35f=_0x4728b7[_0x1586f6(0x22a)]?.['name']||'?',_0x41204a=_0x4728b7[_0x1586f6(0x2ba)]?.[_0x1586f6(0x310)]||'?';let _0x4edf45,_0x451867;if(_0x4728b7[_0x1586f6(0x305)]){const _0x260129=_0x4728b7['lastAttempt'];!_0x260129[_0x1586f6(0x182)]?(_0x4edf45=_0x260129['cancelRequested']?'🛑':'🔄',_0x451867=_0x260129[_0x1586f6(0x1fd)]?a54_0x425391[_0x1586f6(0x1f9)]:a54_0x425391['blue']):(_0x4edf45=_0x260129[_0x1586f6(0x2e3)]?'✅':'❌',_0x451867=_0x260129[_0x1586f6(0x2e3)]?a54_0x425391[_0x1586f6(0x2b6)]:a54_0x425391[_0x1586f6(0x28b)]);}else _0x4edf45='⏳',_0x451867=a54_0x425391[_0x1586f6(0x1af)];const _0x3a9b37='#'+_0xbd8666,_0x1d7af7=_0xee4f11?hyperlink(_0x3a9b37,getWorkflowSessionUrl(_0x22b55c,_0xee4f11,_0xbd8666)):_0x3a9b37;let _0x17a4e4=_0x25b35f;stringWidth(_0x25b35f)>_0x5734b9&&(_0x17a4e4=_0x25b35f['slice'](0x0,_0x5734b9-0x1)+'…');const _0x18724a=a54_0x425391['dim'](_0x17a4e4),_0x18f3c9=stringWidth(_0x17a4e4),_0xc6522a='\x20'[_0x1586f6(0x1c8)](_0x24e3ba-stringWidth(_0x17a4e4)+0x2),_0x441b3f='('+formatElapsed(_0x3a3b58)+')',_0x4f58d4=stringWidth(_0x441b3f),_0x3db4bc=stringWidth(_0x3a9b37),_0x56f9b7=_0x3db4bc+0x1+_0x18f3c9+_0xc6522a[_0x1586f6(0x2c0)],_0x3b9f8c=_0x5aa7d9-_0x56f9b7-_0x4f58d4-0x1-0x8;let _0x4df616=_0x41204a;stringWidth(_0x4df616)>_0x3b9f8c&&(_0x4df616=_0x4df616[_0x1586f6(0x30e)](0x0,_0x3b9f8c-0x1)+'…');const _0x372570=_0x1d7af7+'\x20'+_0x18724a+_0xc6522a+_0x4df616,_0x5de7f6=stringWidth(_0x372570),_0x133ab4=_0x5aa7d9-_0x5de7f6-_0x4f58d4,_0x162bb7=_0x372570+'\x20'[_0x1586f6(0x1c8)](Math[_0x1586f6(0x307)](0x1,_0x133ab4))+a54_0x425391['dim'](_0x441b3f),_0x2778bc=Math[_0x1586f6(0x1b0)]((_0x33747d-_0x45d44c)/_0x1b62a3),_0x5443cc=Math[_0x1586f6(0x1b0)]((_0x1487f8-_0x45d44c)/_0x1b62a3),_0x5f233d=Math[_0x1586f6(0x307)](_0x2778bc+0x1,_0x5443cc),_0x2c3b27=new Array(_0x5af2e0)['fill']('\x20');for(let _0x52769d=_0x2778bc;_0x52769d<Math[_0x1586f6(0x19a)](_0x5f233d,_0x5af2e0);_0x52769d++){_0x2c3b27[_0x52769d]='─';}const _0x23b115=_0x2c3b27[_0x1586f6(0x318)](_0x2752b0=>_0x2752b0==='\x20'?'\x20':_0x451867(_0x2752b0))[_0x1586f6(0x18a)]('');_0x20025f[_0x1586f6(0x234)](_0x4edf45+'\x20'+_0x162bb7+'│'+_0x23b115+'│');}return _0x20025f['join']('\x0a');}async['navigateSessionsInteractive'](_0x292424,_0x2362e1,_0x28594d){const _0x16714b=a54_0x5bba2d,{options:_0x341c84,tdx:_0x4ad461}=_0x2362e1,_0x456d32=_0x341c84[_0x16714b(0x20b)],{timelineRows:_0x173c2a,timeAxisHeader:_0x37c22f}=this['generateSessionTimelineRows'](_0x292424,_0x456d32),_0x42efe7=_0x173c2a[_0x16714b(0x30a)](_0x562fcf=>_0x562fcf['attemptId']);if(_0x42efe7[_0x16714b(0x2c0)]===0x0){const _0x17456e=this[_0x16714b(0x191)](_0x292424,_0x456d32);console['log'](_0x17456e);!_0x28594d&&(console[_0x16714b(0x28c)](''),console[_0x16714b(0x28c)](a54_0x425391['dim'](_0x16714b(0x249))),console[_0x16714b(0x28c)](a54_0x425391['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x425391[_0x16714b(0x1af)](_0x16714b(0x18f))));return;}_0x37c22f&&console[_0x16714b(0x26b)](_0x37c22f);const _0x5221d4=_0x173c2a[_0x16714b(0x30a)](_0x1d628c=>_0x1d628c['attemptId'])[_0x16714b(0x318)](_0x28c1d0=>({'title':_0x28c1d0['displayLine'],'value':_0x28c1d0[_0x16714b(0x194)]})),_0x2d08b0=process[_0x16714b(0x2a4)][_0x16714b(0x254)]||0x3c,_0x24a332=Math['max'](0x28,Math[_0x16714b(0x1b0)](_0x2d08b0*0x2/0x3)),_0x5faed1=await a54_0x2e7bce({'type':'autocomplete','name':_0x16714b(0x194),'message':_0x16714b(0x1de),'choices':_0x5221d4,'initial':-0x1,'limit':_0x24a332,'clearFirst':!![],'fallback':{'title':_0x16714b(0x231),'value':null},'suggest':(_0x501b8b,_0x54b283)=>{const _0x49be04=_0x16714b;if(!_0x501b8b)return Promise[_0x49be04(0x1ce)](_0x54b283);const _0x5b52f8=_0x54b283['filter'](_0x2a4dd8=>{const _0xf87e96=_0x49be04,_0x44131b=_0x2a4dd8;return _0x44131b[_0xf87e96(0x224)]['toLowerCase']()[_0xf87e96(0x1a4)](_0x501b8b['toLowerCase']());});return Promise[_0x49be04(0x1ce)](_0x5b52f8);}}),_0x2735aa=()=>{const _0x5e06fb=_0x16714b;process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c)),process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c)),process[_0x5e06fb(0x2a4)][_0x5e06fb(0x196)](_0x5e06fb(0x22c));},_0x3e432d=_0x5faed1&&_0x5faed1[_0x16714b(0x194)]&&_0x5faed1[_0x16714b(0x194)]!==null&&_0x5faed1[_0x16714b(0x194)][_0x16714b(0x311)]()!=='';if(!_0x3e432d){_0x2735aa(),console[_0x16714b(0x26b)](a54_0x425391[_0x16714b(0x1af)](_0x16714b(0x1fb)));return;}_0x2735aa();const _0x509455=_0x292424[_0x16714b(0x248)](_0x5d5762=>_0x5d5762[_0x16714b(0x305)]?.['id']===_0x5faed1[_0x16714b(0x194)]);if(_0x509455){const _0x4a76e4=_0x509455[_0x16714b(0x22a)]?.['name']||'?',_0x4302e9=_0x509455[_0x16714b(0x2ba)]?.[_0x16714b(0x310)]||'?';console[_0x16714b(0x26b)](_0x16714b(0x1e7)+a54_0x425391[_0x16714b(0x1af)](_0x4a76e4)+',\x20Workflow:\x20'+a54_0x425391['dim'](_0x4302e9));}const _0x9bfa1a=new WorkflowTimelineCommand();await _0x9bfa1a[_0x16714b(0x321)]({'args':[],'options':{..._0x341c84,'attemptId':_0x5faed1[_0x16714b(0x194)]},'tdx':_0x4ad461});}[a54_0x5bba2d(0x168)](_0x26f0f6,_0xeedecf){const _0xebfaa5=a54_0x5bba2d,_0x224656=new Map();for(const _0x2a918f of _0x26f0f6){_0x2a918f['id']&&_0x2a918f[_0xebfaa5(0x305)]?.['id']&&_0x224656[_0xebfaa5(0x323)](_0x2a918f['id'],_0x2a918f[_0xebfaa5(0x305)]['id']);}const _0x56e25e=[];let _0x2939ed='';const _0x48bca7=this['renderSessionsTimeline'](_0x26f0f6,_0xeedecf),_0x338cbc=_0x48bca7[_0xebfaa5(0x195)]('\x0a');for(const _0x1174e4 of _0x338cbc){if(_0x1174e4[_0xebfaa5(0x303)](_0xebfaa5(0x2d4))||_0x1174e4[_0xebfaa5(0x1cc)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2939ed=_0x1174e4;else{if(_0x1174e4[_0xebfaa5(0x1cc)](/^[✅❌🔄🛑⏳]/)){const _0x51d705=_0x1174e4[_0xebfaa5(0x1cc)](/#(\d+)/),_0x5ea850=_0x51d705?_0x51d705[0x1]:null,_0x1ca79e=_0x5ea850?_0x224656[_0xebfaa5(0x31c)](_0x5ea850)||null:null,_0x49eaf7=_0x26f0f6[_0xebfaa5(0x248)](_0x5932a5=>_0x5932a5['id']===_0x5ea850),_0x3051e8=_0x49eaf7?.[_0xebfaa5(0x22a)]?.[_0xebfaa5(0x310)]||'';_0x56e25e[_0xebfaa5(0x234)]({'displayLine':_0x1174e4,'attemptId':_0x1ca79e,'projectName':_0x3051e8});}}}return{'timelineRows':_0x56e25e,'timeAxisHeader':_0x2939ed};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1f6);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2ca);async[a54_0x5bba2d(0x321)](_0x39c19b){const _0x566838=a54_0x5bba2d,{options:_0x1f1342,args:_0xfb5b94,tdx:_0x51359e}=_0x39c19b,_0x2511e3=this['parseProjectWorkflowPattern'](_0xfb5b94,_0x1f1342);if(!_0x2511e3)return 0x1;const {projectName:_0x3791e1,workflowName:_0x4d5bc0}=_0x2511e3,_0xf6bdcf=_0x1f1342[_0x566838(0x250)];if(_0x1f1342['verbose']){if(_0x3791e1&&_0x4d5bc0)console[_0x566838(0x28c)](_0x566838(0x28a)+_0x3791e1+'.'+_0x4d5bc0);else _0x3791e1&&console[_0x566838(0x28c)](_0x566838(0x30f)+_0x3791e1);_0xf6bdcf&&console[_0x566838(0x28c)]('Include\x20retried:\x20yes');}const _0x351b13=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x51359e['workflow'][_0x566838(0x2ab)]({'projectName':_0x3791e1,'workflowName':_0x4d5bc0,'includeRetried':_0xf6bdcf,'limit':_0x1f1342[_0x566838(0x2d9)]}),{'verbose':_0x1f1342[_0x566838(0x26a)]}),_0x3e131d=_0x351b13[_0x566838(0x197)],_0xc8bee2=_0x1f1342[_0x566838(0x2d9)]||0x64,_0xb308fd=_0x3e131d[_0x566838(0x2c0)]>=_0xc8bee2?a54_0x425391[_0x566838(0x1af)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x566838(0x28c)](_0x566838(0x1ff)+_0x3e131d['length']+_0x566838(0x237)+(_0x3e131d[_0x566838(0x2c0)]!==0x1?'s':'')+_0xb308fd);if(_0x1f1342['format']==='json'||_0x1f1342[_0x566838(0x24d)]==='jsonl'||_0x1f1342[_0x566838(0x24d)]===_0x566838(0x293))await handleSDKOutput(_0x3e131d,_0x1f1342);else{if(_0x3e131d[_0x566838(0x2c0)]===0x0){if(_0x3791e1&&_0x4d5bc0)console['log'](_0x566838(0x292)+_0x3791e1+'.'+_0x4d5bc0);else _0x3791e1?console[_0x566838(0x26b)](_0x566838(0x286)+_0x3791e1):console[_0x566838(0x26b)](_0x566838(0x20e));}else{const _0x136830=_0x1f1342[_0x566838(0x20b)],_0x34e3e0=_0x3e131d[_0x566838(0x318)](_0x45c541=>{const _0x3fe065=_0x566838,_0x52b0d3=a54_0x425391[_0x3fe065(0x1af)]('#'+_0x45c541['id']),_0x384a31=_0x45c541[_0x3fe065(0x22a)]?.['id'],_0x5d1452=_0x45c541['session_id']||_0x45c541[_0x3fe065(0x326)],_0xa78995=_0x384a31&&_0x5d1452?hyperlink(_0x52b0d3,getWorkflowAttemptUrl(_0x136830,_0x384a31,_0x5d1452,_0x45c541['id'])):_0x52b0d3,{icon:_0x1fd32e,text:_0x26d766}=getAttemptStatusDisplay(_0x45c541),_0x56229e=(_0x45c541[_0x3fe065(0x22a)]?.['name']||'?')+'.'+(_0x45c541['workflow']?.[_0x3fe065(0x310)]||'?'),_0x95a4f4=_0x45c541[_0x3fe065(0x24c)]?a54_0x425391[_0x3fe065(0x1af)](_0x45c541[_0x3fe065(0x24c)]):'';return(_0xa78995+'\x20'+_0x1fd32e+(_0x26d766?'\x20'+_0x26d766:'')+'\x20'+_0x56229e+'\x20'+_0x95a4f4)[_0x3fe065(0x214)]();});await writeOutput(_0x34e3e0[_0x566838(0x18a)]('\x0a'),_0x1f1342['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1c0);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x304);async['execute'](_0x4fcae3){const _0x350812=a54_0x5bba2d,{options:_0x29576a,args:_0x15a5d3,tdx:_0x17a293}=_0x4fcae3,_0x2967a9=_0x15a5d3[0x0];if(!_0x2967a9)return console[_0x350812(0x28c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x29576a['verbose']&&console[_0x350812(0x28c)](_0x350812(0x178)+_0x2967a9);const _0x20c583=await withSpinner(_0x350812(0x27c),()=>_0x17a293[_0x350812(0x2ba)]['attempt'](_0x2967a9),{'verbose':_0x29576a[_0x350812(0x26a)]}),_0x1e22d6=_0x20c583['data'];let _0x34130f;!_0x1e22d6[_0x350812(0x182)]?_0x34130f=_0x1e22d6[_0x350812(0x1fd)]?_0x350812(0x227):'running':_0x34130f=_0x1e22d6[_0x350812(0x2e3)]?_0x350812(0x2e3):_0x350812(0x28c);let _0x45aea1;if(_0x1e22d6[_0x350812(0x17f)]&&_0x1e22d6['finishedAt']){const _0x236a49=new Date(_0x1e22d6[_0x350812(0x17f)])[_0x350812(0x2ef)](),_0x3e920f=new Date(_0x1e22d6['finishedAt'])[_0x350812(0x2ef)]();_0x45aea1=Math['round']((_0x3e920f-_0x236a49)/0x3e8);}const _0x355f19={'attempt_id':_0x1e22d6['id'],'status':_0x34130f,..._0x1e22d6[_0x350812(0x19c)]!==undefined&&{'index':_0x1e22d6[_0x350812(0x19c)]},..._0x1e22d6['project']&&{'project':_0x1e22d6[_0x350812(0x22a)][_0x350812(0x310)]},..._0x1e22d6[_0x350812(0x2ba)]&&{'workflow':_0x1e22d6[_0x350812(0x2ba)][_0x350812(0x310)]},..._0x1e22d6['sessionId']&&{'session_id':_0x1e22d6[_0x350812(0x326)]},..._0x1e22d6[_0x350812(0x24c)]&&{'session_time':_0x1e22d6[_0x350812(0x24c)]},..._0x1e22d6[_0x350812(0x187)]&&{'retry_attempt':_0x1e22d6[_0x350812(0x187)]},..._0x45aea1!==undefined&&{'duration_sec':_0x45aea1},..._0x1e22d6[_0x350812(0x17f)]&&{'created_at':_0x1e22d6[_0x350812(0x17f)]},..._0x1e22d6[_0x350812(0x31f)]&&{'finished_at':_0x1e22d6[_0x350812(0x31f)]},...Object[_0x350812(0x325)](_0x1e22d6[_0x350812(0x177)])[_0x350812(0x2c0)]>0x0&&{'params':_0x1e22d6[_0x350812(0x177)]}};return await handleSingleObjectOutput(_0x355f19,_0x29576a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2bc);async['execute'](_0x8c0556){const _0x94314=a54_0x5bba2d,{options:_0x205388,args:_0x56f352,tdx:_0x1b2ced}=_0x8c0556,_0x4f69c0=_0x56f352[0x0];if(!_0x4f69c0)return console[_0x94314(0x28c)](_0x94314(0x253)),0x1;const _0x2a64e7=_0x205388[_0x94314(0x21a)];_0x205388[_0x94314(0x26a)]&&(console['error'](_0x94314(0x178)+_0x4f69c0),_0x2a64e7&&console['error'](_0x94314(0x278)));const _0x18e16b=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x1b2ced[_0x94314(0x2ba)]['tasks'](_0x4f69c0,_0x2a64e7||![]),{'verbose':_0x205388['verbose']}),_0x4fd047=_0x18e16b[_0x94314(0x197)];return console[_0x94314(0x28c)](_0x94314(0x1ff)+_0x4fd047[_0x94314(0x2c0)]+_0x94314(0x2bb)+(_0x4fd047[_0x94314(0x2c0)]!==0x1?'s':'')),await handleSDKOutput(_0x4fd047,_0x205388),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a54_0x5bba2d(0x26d);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2e6);async[a54_0x5bba2d(0x321)](_0x120078){const _0xd28bec=a54_0x5bba2d,{options:_0x36515e,args:_0x445e2f,tdx:_0x1e00a8}=_0x120078,_0x43d9bb=_0x445e2f[0x0];let _0xc0273d=_0x445e2f[0x1];if(!_0x43d9bb)return console[_0xd28bec(0x28c)](_0xd28bec(0x253)),0x1;_0x36515e[_0xd28bec(0x26a)]&&(console[_0xd28bec(0x28c)](_0xd28bec(0x178)+_0x43d9bb),_0xc0273d&&console[_0xd28bec(0x28c)](_0xd28bec(0x1a3)+_0xc0273d));const _0x39e898=await withSpinner(_0xd28bec(0x2d8),()=>_0x1e00a8[_0xd28bec(0x2ba)][_0xd28bec(0x205)](_0x43d9bb,_0xc0273d),{'verbose':_0x36515e[_0xd28bec(0x26a)]}),_0x51e67a=_0x39e898[_0xd28bec(0x197)];if(_0x51e67a[_0xd28bec(0x2c0)]===0x0)return console[_0xd28bec(0x28c)](_0xd28bec(0x258)),0x0;if(!_0xc0273d&&(_0x36515e['json']||_0x36515e['format']))return await handleSDKOutput(_0x51e67a,_0x36515e),0x0;if(!_0xc0273d){const _0x489dcf=_0x51e67a['map'](_0x428c80=>({'title':_0x428c80['taskName']+'\x20('+formatBytes(_0x428c80[_0xd28bec(0x1db)])+')','value':_0x428c80[_0xd28bec(0x2f9)]})),_0x4a6b25=await a54_0x2e7bce({'type':_0xd28bec(0x21d),'name':_0xd28bec(0x1a8),'message':_0xd28bec(0x317),'choices':_0x489dcf});if(!_0x4a6b25[_0xd28bec(0x1a8)])return console[_0xd28bec(0x28c)](_0xd28bec(0x1fb)),0x0;_0xc0273d=_0x4a6b25[_0xd28bec(0x1a8)];}const _0x51edc2=await withSpinner(_0xd28bec(0x213),()=>_0x1e00a8[_0xd28bec(0x2ba)][_0xd28bec(0x169)](_0x43d9bb,_0xc0273d),{'verbose':_0x36515e[_0xd28bec(0x26a)]}),_0x111dbe=_0x51edc2[_0xd28bec(0x197)];return _0x111dbe?console[_0xd28bec(0x26b)](_0x111dbe):console[_0xd28bec(0x28c)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x17b);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x2f8);async[a54_0x5bba2d(0x321)](_0x31515a){const _0xe2d0f0=a54_0x5bba2d,{options:_0xc4867b,args:_0x183069,tdx:_0x3b916e}=_0x31515a,_0x355d1e=_0x183069[0x0];if(!_0x355d1e)return console[_0xe2d0f0(0x28c)](_0xe2d0f0(0x253)),0x1;const _0x28915a=_0xc4867b[_0xe2d0f0(0x316)];_0xc4867b[_0xe2d0f0(0x26a)]&&(console[_0xe2d0f0(0x28c)](_0xe2d0f0(0x178)+_0x355d1e),_0x28915a&&console[_0xe2d0f0(0x28c)]('Reason:\x20'+_0x28915a));if(!_0xc4867b[_0xe2d0f0(0x2a8)]){if(!isInteractive())return console[_0xe2d0f0(0x28c)](a54_0x425391['red'](_0xe2d0f0(0x319)),_0xe2d0f0(0x1ac)),console['error'](a54_0x425391[_0xe2d0f0(0x1af)](_0xe2d0f0(0x2d7))),0x1;const _0xa5875=await confirmKey(_0xe2d0f0(0x16f)+_0x355d1e+'?');if(!_0xa5875)return console['error'](a54_0x425391[_0xe2d0f0(0x1f9)]('Cancelled')),0x1;}const _0x2a8615=await withSpinner(_0xe2d0f0(0x287),()=>_0x3b916e[_0xe2d0f0(0x2ba)]['kill'](_0x355d1e,_0x28915a),{'verbose':_0xc4867b[_0xe2d0f0(0x26a)]}),_0x1f0ada=_0x2a8615[_0xe2d0f0(0x197)];return console['error']('✔\x20'+_0x1f0ada),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x20a);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x324);async[a54_0x5bba2d(0x321)](_0x6fe55e){const _0x584e86=a54_0x5bba2d,{options:_0x55b796,args:_0x1d7093,tdx:_0x483660}=_0x6fe55e,_0x27cfca=_0x1d7093[0x0];if(!_0x27cfca)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x584e86(0x28c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5b88d3=![],_0x33482d=_0x27cfca;if(_0x27cfca[_0x584e86(0x303)](_0x584e86(0x1ec)))_0x5b88d3=!![],_0x33482d=_0x27cfca[_0x584e86(0x251)](0x8);else{if(_0x27cfca['startsWith'](_0x584e86(0x181)))_0x5b88d3=![],_0x33482d=_0x27cfca['substring'](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x584e86(0x301)),0x1;}const _0x26d029=_0x55b796[_0x584e86(0x1e5)],_0x57dda2=_0x55b796[_0x584e86(0x193)],_0x589709=_0x55b796[_0x584e86(0x177)],_0x5ef484=_0x55b796[_0x584e86(0x216)];_0x55b796['verbose']&&(console[_0x584e86(0x28c)](_0x584e86(0x312)+(_0x5b88d3?_0x584e86(0x2d6):_0x584e86(0x18d))+'\x20'+_0x33482d),_0x26d029&&console[_0x584e86(0x28c)](_0x584e86(0x2b3)+_0x26d029),_0x57dda2&&console[_0x584e86(0x28c)](_0x584e86(0x1bc)+_0x57dda2),_0x589709&&console['error'](_0x584e86(0x1b3)+_0x589709),_0x5ef484&&console[_0x584e86(0x28c)](_0x584e86(0x294)));let _0x31c241;if(_0x589709)try{if(_0x589709[_0x584e86(0x303)]('@')){const _0x3592e1=await import('fs/promises'),_0xcaa65c=_0x589709[_0x584e86(0x251)](0x1),_0x110e0a=await _0x3592e1[_0x584e86(0x221)](_0xcaa65c,_0x584e86(0x26e));_0x31c241=JSON[_0x584e86(0x21f)](_0x110e0a);}else _0x31c241=JSON[_0x584e86(0x21f)](_0x589709);}catch{return console[_0x584e86(0x28c)](_0x584e86(0x239)),0x1;}if(!_0x55b796[_0x584e86(0x2a8)]){if(!isInteractive())return console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x28b)](_0x584e86(0x319)),_0x584e86(0x1ac)),console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x1af)](_0x584e86(0x2d7))),0x1;const _0x5a9c74=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5b88d3?_0x584e86(0x2d6):_0x584e86(0x18d))+'\x20'+_0x33482d+'?');if(!_0x5a9c74)return console[_0x584e86(0x28c)](a54_0x425391[_0x584e86(0x1f9)]('Cancelled')),0x1;}let _0x8f7fd0;_0x5b88d3?_0x8f7fd0=await withSpinner(_0x584e86(0x222),()=>_0x483660[_0x584e86(0x2ba)][_0x584e86(0x24e)](_0x33482d,{'fromTask':_0x26d029,'retryParams':_0x31c241}),{'verbose':_0x55b796[_0x584e86(0x26a)]}):_0x8f7fd0=await withSpinner('Retrying\x20attempt...',()=>_0x483660[_0x584e86(0x2ba)][_0x584e86(0x217)](_0x33482d,{'resumeFrom':_0x57dda2,'retryParams':_0x31c241,'force':_0x5ef484}),{'verbose':_0x55b796['verbose']});const _0x42d18b=_0x8f7fd0[_0x584e86(0x197)];return console[_0x584e86(0x28c)](_0x584e86(0x219)),console[_0x584e86(0x28c)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x42d18b[_0x584e86(0x194)]),console['error'](_0x584e86(0x263)+_0x42d18b[_0x584e86(0x326)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x208);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1ed);async[a54_0x5bba2d(0x321)](_0xcc72bf){const _0x5a8514=a54_0x5bba2d,{options:_0x32f174,args:_0x2eb0e8,tdx:_0x32a49b}=_0xcc72bf;let _0x2ae3a0=_0x2eb0e8[0x0];if(!_0x2ae3a0){const _0x57977e=this['resolveProject']([],_0x32f174),_0x241482=await withSpinner(_0x5a8514(0x291),()=>_0x32a49b[_0x5a8514(0x2ba)][_0x5a8514(0x203)](_0x57977e,{'limit':_0x32f174[_0x5a8514(0x2d9)]}),{'verbose':_0x32f174['verbose']}),_0x5f33dd=_0x241482[_0x5a8514(0x197)];if(_0x5f33dd[_0x5a8514(0x2c0)]===0x0)return console[_0x5a8514(0x28c)]('No\x20workflows\x20found'),!_0x57977e&&console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x1af)](_0x5a8514(0x2f4))),0x1;const _0x2d9eb4=_0x5f33dd[_0x5a8514(0x318)](_0x563cdc=>({'title':_0x563cdc[_0x5a8514(0x22a)]?.[_0x5a8514(0x310)]+'.'+_0x563cdc['name'],'value':_0x563cdc[_0x5a8514(0x22a)]?.[_0x5a8514(0x310)]+'.'+_0x563cdc[_0x5a8514(0x310)],'description':_0x563cdc[_0x5a8514(0x2cf)]?_0x5a8514(0x1eb)+_0x563cdc[_0x5a8514(0x2cf)]:undefined})),_0x128f76=await a54_0x2e7bce({'type':_0x5a8514(0x21d),'name':'workflow','message':_0x5a8514(0x289),'choices':_0x2d9eb4});if(!_0x128f76['workflow'])return 0x1;_0x2ae3a0=_0x128f76[_0x5a8514(0x2ba)];}if(!_0x2ae3a0['includes']('.')){const _0x46c719=this[_0x5a8514(0x1d0)]([],_0x32f174);if(_0x46c719)_0x2ae3a0=_0x46c719+'.'+_0x2ae3a0;else return console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x28b)](_0x5a8514(0x1f0)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x5a8514(0x28c)](a54_0x425391[_0x5a8514(0x1af)](_0x5a8514(0x2f4))),0x1;}const _0x2e1acf=_0x32f174['param'],_0x2cf43f=_0x32f174[_0x5a8514(0x24c)],_0x2b93f7={};if(_0x2e1acf&&Array[_0x5a8514(0x1b1)](_0x2e1acf))for(const _0x4613bf of _0x2e1acf){const _0x20714d=_0x4613bf['indexOf']('=');if(_0x20714d===-0x1)return console[_0x5a8514(0x28c)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4613bf),console[_0x5a8514(0x28c)](_0x5a8514(0x19d)),0x1;const _0x50b743=_0x4613bf[_0x5a8514(0x251)](0x0,_0x20714d),_0x422950=_0x4613bf[_0x5a8514(0x251)](_0x20714d+0x1);try{_0x2b93f7[_0x50b743]=JSON['parse'](_0x422950);}catch{_0x2b93f7[_0x50b743]=_0x422950;}}_0x32f174[_0x5a8514(0x26a)]&&(console[_0x5a8514(0x28c)](_0x5a8514(0x225)+_0x2ae3a0),Object[_0x5a8514(0x325)](_0x2b93f7)[_0x5a8514(0x2c0)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x2b93f7)),_0x2cf43f&&console['error']('Session\x20time:\x20'+_0x2cf43f));const _0x190a1e=await withSpinner(_0x5a8514(0x267),()=>_0x32a49b['workflow'][_0x5a8514(0x1a9)](_0x2ae3a0,_0x2b93f7,{'sessionTime':_0x2cf43f}),{'verbose':_0x32f174['verbose']}),_0x4b22fb=_0x190a1e[_0x5a8514(0x197)];console[_0x5a8514(0x28c)](_0x5a8514(0x230)),console[_0x5a8514(0x28c)](_0x5a8514(0x26f)+_0x4b22fb['id']),console['error'](_0x5a8514(0x263)+_0x4b22fb[_0x5a8514(0x326)]),console[_0x5a8514(0x28c)](_0x5a8514(0x170)+_0x4b22fb['project']?.[_0x5a8514(0x310)]),console['error'](_0x5a8514(0x1cf)+_0x4b22fb[_0x5a8514(0x2ba)]?.['name']);if(_0x4b22fb['project']?.['id']&&_0x4b22fb[_0x5a8514(0x326)]&&_0x4b22fb['id']){const _0x2f5bc9=_0x32f174[_0x5a8514(0x20b)],_0x438508=getConsoleUrl(_0x2f5bc9,_0x5a8514(0x18e)+_0x4b22fb[_0x5a8514(0x22a)]['id']+_0x5a8514(0x2fa)+_0x4b22fb[_0x5a8514(0x326)]+_0x5a8514(0x2f5)+_0x4b22fb['id']);console[_0x5a8514(0x28c)]('\x20\x20Console:\x20'+a54_0x425391['cyan'](_0x438508));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2cb);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x236);async[a54_0x5bba2d(0x321)](_0x501bec){const _0x3e7b19=a54_0x5bba2d,{options:_0x592521,args:_0x4d2baa,tdx:_0x4b51b7}=_0x501bec,_0x5f000f=_0x4d2baa[0x0],_0x65916e=_0x4d2baa[0x1]||'.';if(!_0x5f000f)return console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x3e7b19(0x1b6)),0x1;const _0x219932=_0x592521['revision'];_0x592521['verbose']&&(console[_0x3e7b19(0x28c)](_0x3e7b19(0x1e7)+_0x5f000f),console['error'](_0x3e7b19(0x166)+_0x65916e),_0x219932&&console[_0x3e7b19(0x28c)](_0x3e7b19(0x2b1)+_0x219932));const _0x38a26a=await withSpinner(_0x3e7b19(0x2e7)+_0x5f000f+_0x3e7b19(0x1ef),()=>_0x4b51b7['workflow'][_0x3e7b19(0x2dc)](_0x5f000f,_0x65916e,{'revision':_0x219932}),{'verbose':_0x592521[_0x3e7b19(0x26a)]}),_0x55adf1=_0x38a26a[_0x3e7b19(0x197)];return console[_0x3e7b19(0x28c)](_0x3e7b19(0x23c)+_0x55adf1[_0x3e7b19(0x2c6)]),console[_0x3e7b19(0x28c)]('\x20\x20Revision:\x20'+_0x55adf1['revision']),console[_0x3e7b19(0x28c)](_0x3e7b19(0x306)+_0x55adf1[_0x3e7b19(0x2ec)]),console[_0x3e7b19(0x28c)](_0x3e7b19(0x2f2)+_0x65916e+'/'+_0x55adf1['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2af);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x202);async['execute'](_0x4c7387){const _0x29eb7f=a54_0x5bba2d,{options:_0x4d77ac,args:_0x162cc2,tdx:_0x5af8c3}=_0x4c7387;let _0x5e75a3='.',_0x3628c0=_0x4d77ac[_0x29eb7f(0x310)];if(_0x162cc2[0x0]){const {promises:_0x38f7c4}=await import('fs');try{const _0x533d41=await _0x38f7c4[_0x29eb7f(0x27d)](_0x162cc2[0x0]);if(_0x533d41['isDirectory']())_0x5e75a3=_0x162cc2[0x0];else return console['error']('Error:\x20'+_0x162cc2[0x0]+_0x29eb7f(0x31e)),0x1;}catch{_0x3628c0=_0x162cc2[0x0],_0x5e75a3='.';}}const _0x46172a=_0x4d77ac[_0x29eb7f(0x2cf)],_0x5c14dd=_0x4d77ac[_0x29eb7f(0x223)];_0x4d77ac[_0x29eb7f(0x26a)]&&(console[_0x29eb7f(0x28c)](_0x29eb7f(0x281)+_0x5e75a3),_0x3628c0&&console['error'](_0x29eb7f(0x174)+_0x3628c0),_0x46172a&&console[_0x29eb7f(0x28c)](_0x29eb7f(0x2b1)+_0x46172a),_0x5c14dd&&console['error'](_0x29eb7f(0x1c7)));const _0x3cf2d6=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x5af8c3['workflow']['push'](_0x5e75a3,{'projectName':_0x3628c0,'revision':_0x46172a,'skipValidation':_0x5c14dd}),{'verbose':_0x4d77ac[_0x29eb7f(0x26a)]}),_0x1de10a=_0x3cf2d6[_0x29eb7f(0x197)];return console[_0x29eb7f(0x28c)]('✔\x20Pushed\x20'+_0x1de10a['projectName']),console[_0x29eb7f(0x28c)](_0x29eb7f(0x283)+_0x1de10a['projectId']),console[_0x29eb7f(0x28c)]('\x20\x20Revision:\x20'+_0x1de10a[_0x29eb7f(0x2cf)]),await this[_0x29eb7f(0x2d2)](_0x5af8c3,_0x1de10a[_0x29eb7f(0x2c6)],_0x4d77ac['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1f2);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x5bba2d(0x321)](_0x44e52a){const _0x318b9e=a54_0x5bba2d,{options:_0xf2502,args:_0x45c238,tdx:_0x6bcc58}=_0x44e52a,_0x5dcc77=_0x45c238[0x0],_0x27aebd=_0x45c238[0x1];if(!_0x5dcc77)return console['error'](a54_0x425391[_0x318b9e(0x28b)](_0x318b9e(0x1f0)),_0x318b9e(0x1e6)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x1d2))),0x1;const _0xd314=_0xf2502[_0x318b9e(0x2cf)];_0xf2502[_0x318b9e(0x26a)]&&(console['error'](_0x318b9e(0x1e7)+_0x5dcc77),_0x27aebd&&console[_0x318b9e(0x28c)](_0x318b9e(0x192)+_0x27aebd),_0xd314&&console[_0x318b9e(0x28c)](_0x318b9e(0x2b1)+_0xd314),_0xf2502[_0x318b9e(0x1f1)]&&console[_0x318b9e(0x28c)](_0x318b9e(0x1e9)));const _0x5864e5=await withSpinner(_0x318b9e(0x2ac)+_0x5dcc77+'...',()=>_0x6bcc58[_0x318b9e(0x2ba)][_0x318b9e(0x2ee)](_0x5dcc77,{'targetDir':_0x27aebd,'revision':_0xd314}),{'verbose':_0xf2502[_0x318b9e(0x26a)]}),_0x2bbd48=_0x5864e5[_0x318b9e(0x197)];_0x2bbd48[_0x318b9e(0x260)]?console['error'](_0x318b9e(0x165)+_0x2bbd48[_0x318b9e(0x2c6)]):console[_0x318b9e(0x28c)](_0x318b9e(0x1c9)+_0x2bbd48[_0x318b9e(0x2c6)]);console[_0x318b9e(0x28c)](_0x318b9e(0x29e)+_0x2bbd48[_0x318b9e(0x2cf)]),console[_0x318b9e(0x28c)](_0x318b9e(0x220)+(a54_0x55dc3e[_0x318b9e(0x2ea)](process['cwd'](),_0x2bbd48['targetDir'])||'.')),console['error'](_0x318b9e(0x1b9)+a54_0x425391[_0x318b9e(0x2b6)]('+'+_0x2bbd48[_0x318b9e(0x16b)][_0x318b9e(0x19f)]+_0x318b9e(0x1d1))+',\x20'+(a54_0x425391[_0x318b9e(0x1f9)]('~'+_0x2bbd48[_0x318b9e(0x16b)][_0x318b9e(0x2db)]+_0x318b9e(0x2c8))+',\x20')+(a54_0x425391[_0x318b9e(0x28b)]('-'+_0x2bbd48[_0x318b9e(0x16b)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x425391[_0x318b9e(0x1af)](_0x2bbd48[_0x318b9e(0x16b)]['unchanged']+'\x20unchanged')));for(const _0x2a7edf of _0x2bbd48[_0x318b9e(0x280)]){_0x2a7edf['type']===_0x318b9e(0x2db)&&_0x2a7edf[_0x318b9e(0x2a1)]&&(console[_0x318b9e(0x28c)]('\x0a'+a54_0x425391[_0x318b9e(0x183)](_0x318b9e(0x175)+_0x2a7edf[_0x318b9e(0x17e)])),console[_0x318b9e(0x28c)](_0x2a7edf[_0x318b9e(0x2a1)]));}if(!_0x2bbd48[_0x318b9e(0x25c)])return saveSessionContext({'workflow_project':_0x2bbd48['projectName']},_0xf2502[_0x318b9e(0x2d6)]),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x2b6)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x318b9e(0x28c)](a54_0x425391['dim'](_0x318b9e(0x188)+_0x2bbd48[_0x318b9e(0x2c6)])),0x0;if(_0xf2502[_0x318b9e(0x1f1)])return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1f9)](_0x318b9e(0x1a6))),0x0;if(!_0xf2502[_0x318b9e(0x2a8)]){if(!isInteractive())return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x28b)]('\x0aError:'),_0x318b9e(0x1ac)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4deb15=await confirmKey(_0x318b9e(0x198));if(!_0x4deb15)return console['error'](a54_0x425391[_0x318b9e(0x1f9)](_0x318b9e(0x1fb)),_0x318b9e(0x211)),0x1;}await withSpinner(_0x318b9e(0x1bb),()=>_0x6bcc58[_0x318b9e(0x2ba)][_0x318b9e(0x299)](_0x2bbd48,{'revision':_0xd314}),{'verbose':_0xf2502[_0x318b9e(0x26a)]}),saveSessionContext({'workflow_project':_0x2bbd48[_0x318b9e(0x2c6)]},_0xf2502[_0x318b9e(0x2d6)]),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x2b6)](_0x318b9e(0x245)));const _0x48e5f5=a54_0x55dc3e[_0x318b9e(0x2ea)](process[_0x318b9e(0x2e9)](),_0x2bbd48['targetDir'])||'.';return console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x2f2)+_0x48e5f5)),console[_0x318b9e(0x28c)](a54_0x425391[_0x318b9e(0x1af)](_0x318b9e(0x188)+_0x2bbd48['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x5bba2d(0x321)](_0x3fd9b6){const _0x475ce7=a54_0x5bba2d,{options:_0x2dc29e,args:_0x2b0151,tdx:_0x29d11a}=_0x3fd9b6,_0x4f6dcb=this[_0x475ce7(0x266)](_0x2b0151,_0x2dc29e),_0x52caa7=_0x2dc29e[_0x475ce7(0x2cf)],_0x2e71c9=_0x2dc29e[_0x475ce7(0x223)];_0x2dc29e[_0x475ce7(0x26a)]&&(_0x4f6dcb&&console[_0x475ce7(0x28c)](_0x475ce7(0x31b)+_0x4f6dcb),_0x52caa7&&console[_0x475ce7(0x28c)](_0x475ce7(0x2b1)+_0x52caa7),_0x2dc29e[_0x475ce7(0x1f1)]&&console[_0x475ce7(0x28c)](_0x475ce7(0x1e9)),_0x2e71c9&&console['error'](_0x475ce7(0x1c7)));let _0xb26d29;try{_0xb26d29=await withSpinner(_0x475ce7(0x172),()=>_0x29d11a['workflow'][_0x475ce7(0x167)]({'sourceDir':_0x4f6dcb,'revision':_0x52caa7,'skipValidation':_0x2e71c9}),{'verbose':_0x2dc29e[_0x475ce7(0x26a)]});}catch(_0x34e44a){if(_0x34e44a instanceof Error&&_0x34e44a[_0x475ce7(0x1c1)][_0x475ce7(0x1a4)](_0x475ce7(0x2fe)))return console['error'](a54_0x425391['red']('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2dc29e[_0x475ce7(0x2eb)]?console[_0x475ce7(0x28c)](a54_0x425391['dim'](_0x475ce7(0x233)+_0x2dc29e[_0x475ce7(0x2eb)]+_0x475ce7(0x2b9)+_0x2dc29e[_0x475ce7(0x2eb)]+'\x27')):console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x1af)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x34e44a;}const _0x180b2b=_0xb26d29[_0x475ce7(0x197)];console[_0x475ce7(0x28c)](_0x475ce7(0x17d)+_0x180b2b[_0x475ce7(0x2c6)]),console['error'](_0x475ce7(0x19b)+_0x180b2b[_0x475ce7(0x176)]),console[_0x475ce7(0x28c)](_0x475ce7(0x29e)+_0x180b2b[_0x475ce7(0x2cf)]),console[_0x475ce7(0x28c)]('\x20\x20Changes:\x20'+a54_0x425391[_0x475ce7(0x2b6)]('+'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x19f)]+'\x20new')+',\x20'+(a54_0x425391[_0x475ce7(0x1f9)]('~'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x2db)]+_0x475ce7(0x2c8))+',\x20')+(a54_0x425391[_0x475ce7(0x28b)]('-'+_0x180b2b[_0x475ce7(0x16b)][_0x475ce7(0x241)]+_0x475ce7(0x1f8))+',\x20')+(''+a54_0x425391[_0x475ce7(0x1af)](_0x180b2b[_0x475ce7(0x16b)]['unchanged']+'\x20unchanged')));for(const _0xb4cd90 of _0x180b2b[_0x475ce7(0x280)]){_0xb4cd90['type']===_0x475ce7(0x2db)&&_0xb4cd90[_0x475ce7(0x2a1)]&&(console['error']('\x0a'+a54_0x425391[_0x475ce7(0x183)](_0x475ce7(0x175)+_0xb4cd90[_0x475ce7(0x17e)])),console[_0x475ce7(0x28c)](_0xb4cd90[_0x475ce7(0x2a1)]));}if(!_0x180b2b[_0x475ce7(0x25c)])return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x2b6)](_0x475ce7(0x2f6))),await this[_0x475ce7(0x2d2)](_0x29d11a,_0x180b2b[_0x475ce7(0x2c6)],_0x2dc29e[_0x475ce7(0x20b)]),0x0;if(_0x2dc29e[_0x475ce7(0x1f1)])return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x1f9)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2dc29e[_0x475ce7(0x2a8)]){if(!isInteractive())return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x28b)](_0x475ce7(0x319)),_0x475ce7(0x1ac)),console[_0x475ce7(0x28c)](a54_0x425391['dim'](_0x475ce7(0x2d7))),0x1;const _0x44ba0e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x44ba0e)return console['error'](a54_0x425391['yellow']('Cancelled'),_0x475ce7(0x204)),0x1;}const _0x5b3cb9=await withSpinner(_0x475ce7(0x1dc),()=>_0x29d11a[_0x475ce7(0x2ba)][_0x475ce7(0x1f5)](_0x180b2b),{'verbose':_0x2dc29e[_0x475ce7(0x26a)]}),_0x1ed791=_0x5b3cb9['data'];return console[_0x475ce7(0x28c)](a54_0x425391[_0x475ce7(0x2b6)]('✔\x20Push\x20complete')),console[_0x475ce7(0x28c)](_0x475ce7(0x283)+_0x1ed791[_0x475ce7(0x282)]),console['error'](_0x475ce7(0x29e)+_0x1ed791[_0x475ce7(0x2cf)]),await this[_0x475ce7(0x2d2)](_0x29d11a,_0x1ed791[_0x475ce7(0x2c6)],_0x2dc29e[_0x475ce7(0x20b)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x271);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x25d);async[a54_0x5bba2d(0x321)](_0x2de32e){const _0x4f216c=a54_0x5bba2d,{options:_0xa01396,args:_0x2cec4f,tdx:_0x4d1b1f}=_0x2de32e,_0x59afda=this[_0x4f216c(0x266)](_0x2cec4f,_0xa01396),_0x281397=_0xa01396['name'],_0x2a6600=_0xa01396[_0x4f216c(0x2cf)],_0x5e7972=_0xa01396[_0x4f216c(0x223)];if(!_0x59afda)return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x28b)]('Error:'),_0x4f216c(0x313)),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)](_0x4f216c(0x20f))),0x1;if(!_0x281397)return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x28b)](_0x4f216c(0x1f0)),_0x4f216c(0x25b)),console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x1af)](_0x4f216c(0x2bf))),0x1;_0xa01396[_0x4f216c(0x26a)]&&(console[_0x4f216c(0x28c)](_0x4f216c(0x31b)+_0x59afda),console[_0x4f216c(0x28c)](_0x4f216c(0x295)+_0x281397),_0x2a6600&&console[_0x4f216c(0x28c)](_0x4f216c(0x2b1)+_0x2a6600),_0xa01396[_0x4f216c(0x1f1)]&&console[_0x4f216c(0x28c)](_0x4f216c(0x1e9)),_0x5e7972&&console[_0x4f216c(0x28c)]('Validation:\x20skipped'));const _0x2e8694=await withSpinner('Analyzing\x20project...',()=>_0x4d1b1f[_0x4f216c(0x2ba)]['prepareCloneProject'](_0x59afda,_0x281397,{'revision':_0x2a6600,'skipValidation':_0x5e7972}),{'verbose':_0xa01396[_0x4f216c(0x26a)]}),_0x25d9be=_0x2e8694[_0x4f216c(0x197)];console[_0x4f216c(0x28c)](_0x4f216c(0x2ff)+_0x25d9be['sourceDir']);_0x25d9be[_0x4f216c(0x2c2)]&&console[_0x4f216c(0x28c)](_0x4f216c(0x206)+_0x25d9be[_0x4f216c(0x2c2)]);console[_0x4f216c(0x28c)](_0x4f216c(0x295)+_0x25d9be[_0x4f216c(0x1ea)]),console[_0x4f216c(0x28c)](_0x4f216c(0x2b1)+_0x25d9be[_0x4f216c(0x2cf)]),console[_0x4f216c(0x28c)](_0x4f216c(0x308)+_0x25d9be[_0x4f216c(0x2f0)]);_0x25d9be[_0x4f216c(0x1da)]&&(console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x275)+_0x25d9be[_0x4f216c(0x1ea)]+_0x4f216c(0x185)+_0x25d9be[_0x4f216c(0x2e5)]+')')),console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x2dd))));if(_0xa01396[_0x4f216c(0x1f1)])return console['error'](a54_0x425391['yellow'](_0x4f216c(0x1a1))),0x0;if(!_0xa01396[_0x4f216c(0x2a8)]){if(!isInteractive())return console['error'](a54_0x425391[_0x4f216c(0x28b)](_0x4f216c(0x319)),_0x4f216c(0x1ac)),console[_0x4f216c(0x28c)](a54_0x425391['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3020d2=_0x25d9be['sourceProjectName']||a54_0x55dc3e[_0x4f216c(0x302)](_0x59afda),_0x442860=_0x25d9be[_0x4f216c(0x1da)]?_0x4f216c(0x2c5)+_0x281397+_0x4f216c(0x27f):'\x0aClone\x20\x22'+_0x3020d2+_0x4f216c(0x31d)+_0x281397+'\x22?',_0x43138b=await confirmKey(_0x442860);if(!_0x43138b)return console['error'](a54_0x425391[_0x4f216c(0x1f9)](_0x4f216c(0x1fb))),0x1;}const _0xec048e=await withSpinner(_0x25d9be[_0x4f216c(0x1da)]?_0x4f216c(0x290)+_0x281397+_0x4f216c(0x1ef):_0x4f216c(0x2fc)+_0x281397+_0x4f216c(0x1ef),()=>_0x4d1b1f[_0x4f216c(0x2ba)][_0x4f216c(0x2ad)](_0x25d9be),{'verbose':_0xa01396[_0x4f216c(0x26a)]}),_0x440b21=_0xec048e[_0x4f216c(0x197)];return console[_0x4f216c(0x28c)](a54_0x425391[_0x4f216c(0x2b6)](_0x25d9be['targetExists']?'✔\x20Project\x20updated':_0x4f216c(0x1a7))),console[_0x4f216c(0x28c)](_0x4f216c(0x170)+_0x440b21[_0x4f216c(0x1ea)]),console['error'](_0x4f216c(0x283)+_0x440b21[_0x4f216c(0x2a7)]),console['error'](_0x4f216c(0x29e)+_0x440b21[_0x4f216c(0x2cf)]),await this[_0x4f216c(0x2d2)](_0x4d1b1f,_0x440b21[_0x4f216c(0x1ea)],_0xa01396[_0x4f216c(0x20b)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:delete';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1bd);async[a54_0x5bba2d(0x321)](_0x457286){const _0x5dd150=a54_0x5bba2d,{options:_0x140b2e,args:_0xbdafda,tdx:_0x40f08e}=_0x457286,_0x39bb70=_0xbdafda[0x0];if(!_0x39bb70)return console[_0x5dd150(0x28c)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5dd150(0x28c)](_0x5dd150(0x272)),0x1;_0x140b2e[_0x5dd150(0x26a)]&&console['error'](_0x5dd150(0x1e7)+_0x39bb70);if(!_0x140b2e[_0x5dd150(0x2a8)]){if(!isInteractive())return console[_0x5dd150(0x28c)](a54_0x425391['red'](_0x5dd150(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5dd150(0x28c)](a54_0x425391[_0x5dd150(0x1af)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xadae25=await confirmKey(_0x5dd150(0x232)+_0x39bb70+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0xadae25)return console['error'](a54_0x425391[_0x5dd150(0x1f9)](_0x5dd150(0x1fb))),0x1;}const _0x1eb1cb=await withSpinner('Deleting\x20project\x20'+_0x39bb70+_0x5dd150(0x1ef),()=>_0x40f08e[_0x5dd150(0x2ba)]['delete'](_0x39bb70),{'verbose':_0x140b2e[_0x5dd150(0x26a)]}),_0x239add=_0x1eb1cb[_0x5dd150(0x197)];return console[_0x5dd150(0x28c)](_0x5dd150(0x2cd)+_0x239add[_0x5dd150(0x2c6)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x239add[_0x5dd150(0x282)]),0x0;}}export function parseKeyValue(_0x20f7b3){const _0xbf8265=a54_0x5bba2d,_0x160924=_0x20f7b3[_0xbf8265(0x2e4)]('=');if(_0x160924===-0x1)throw new Error(_0xbf8265(0x16c)+_0x20f7b3+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x157206=_0x20f7b3['substring'](0x0,_0x160924),_0x22d48e=_0x20f7b3[_0xbf8265(0x251)](_0x160924+0x1);if(!_0x157206)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x157206,'value':_0x22d48e};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x5bba2d(0x2c7);['description']=a54_0x5bba2d(0x229);async[a54_0x5bba2d(0x321)](_0x235223){const _0x322ba5=a54_0x5bba2d,{options:_0x5cbc67,args:_0x22b938,tdx:_0x22747c}=_0x235223,_0x5296ba=this[_0x322ba5(0x1c6)](_0x22b938,_0x5cbc67);if(!_0x5296ba)return 0x1;_0x5cbc67[_0x322ba5(0x26a)]&&console[_0x322ba5(0x28c)](_0x322ba5(0x1e7)+_0x5296ba);const _0x1564e7=await withSpinner(_0x322ba5(0x19e),()=>_0x22747c[_0x322ba5(0x2ba)][_0x322ba5(0x23b)](_0x5296ba),{'verbose':_0x5cbc67['verbose']}),{secrets:_0x42dcf2}=_0x1564e7[_0x322ba5(0x197)];return console[_0x322ba5(0x28c)](_0x322ba5(0x1ff)+_0x42dcf2['length']+'\x20secret'+(_0x42dcf2['length']!==0x1?'s':'')),await handleSDKOutput(_0x42dcf2,_0x5cbc67),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x1d8);[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x16a);async[a54_0x5bba2d(0x321)](_0x2b2228){const _0x1e6df6=a54_0x5bba2d,{options:_0x5f3a26,args:_0x5a8af7,tdx:_0x21375c}=_0x2b2228;let _0x2f9c2c,_0x58176d;if(_0x5a8af7[_0x1e6df6(0x2c0)]>=0x1&&!_0x5a8af7[0x0][_0x1e6df6(0x1a4)]('='))_0x2f9c2c=_0x5a8af7[0x0],_0x58176d=_0x5a8af7[_0x1e6df6(0x30e)](0x1);else{if(_0x5a8af7[_0x1e6df6(0x2c0)]>=0x1&&_0x5f3a26['workflowProject'])_0x2f9c2c=_0x5f3a26[_0x1e6df6(0x2eb)],_0x58176d=_0x5a8af7;else return _0x5a8af7[_0x1e6df6(0x2c0)]>=0x1?(console[_0x1e6df6(0x28c)](_0x1e6df6(0x22f)),console[_0x1e6df6(0x28c)](_0x1e6df6(0x2f4)),0x1):(console['error'](_0x1e6df6(0x277)),console['error'](_0x1e6df6(0x1a5)),0x1);}if(_0x58176d['length']===0x0)return console[_0x1e6df6(0x28c)](_0x1e6df6(0x277)),console['error'](_0x1e6df6(0x1a5)),0x1;const _0x27015e={};try{for(const _0x47542f of _0x58176d){const {key:_0x30dc12,value:_0x53cabf}=parseKeyValue(_0x47542f);_0x27015e[_0x30dc12]=_0x53cabf;}}catch(_0x145103){return _0x145103 instanceof Error&&console[_0x1e6df6(0x28c)](a54_0x425391[_0x1e6df6(0x28b)](_0x1e6df6(0x1f0)),_0x145103['message']),0x1;}const _0x1156a1=Object[_0x1e6df6(0x325)](_0x27015e);_0x5f3a26[_0x1e6df6(0x26a)]&&(console['error'](_0x1e6df6(0x1e7)+_0x2f9c2c),console['error'](_0x1e6df6(0x2cc)+_0x1156a1[_0x1e6df6(0x18a)](',\x20')));const _0x2e9e20=await withSpinner(_0x1156a1[_0x1e6df6(0x2c0)]===0x1?_0x1e6df6(0x1c3):_0x1e6df6(0x29b)+_0x1156a1[_0x1e6df6(0x2c0)]+_0x1e6df6(0x1d3),()=>_0x21375c[_0x1e6df6(0x2ba)]['setSecrets'](_0x2f9c2c,_0x27015e),{'verbose':_0x5f3a26[_0x1e6df6(0x26a)]}),_0x19fd8a=_0x2e9e20[_0x1e6df6(0x197)];return console['error'](_0x1156a1[_0x1e6df6(0x2c0)]===0x1?_0x1e6df6(0x1ae)+_0x19fd8a[_0x1e6df6(0x325)][0x0]+_0x1e6df6(0x1fe)+_0x19fd8a[_0x1e6df6(0x2c6)]+'\x27':'✔\x20'+_0x19fd8a[_0x1e6df6(0x325)][_0x1e6df6(0x2c0)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x19fd8a[_0x1e6df6(0x2c6)]+'\x27'),(_0x5f3a26['json']||_0x5f3a26[_0x1e6df6(0x242)])&&await handleSingleObjectOutput(_0x19fd8a,_0x5f3a26),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]='workflow:secrets:delete';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x1c5);async[a54_0x5bba2d(0x321)](_0x578341){const _0x38202f=a54_0x5bba2d,{options:_0x1b5ed8,args:_0x4ea316,tdx:_0x1a4053}=_0x578341;let _0x26acc4,_0x51ff38;if(_0x4ea316[_0x38202f(0x2c0)]>=0x2)_0x26acc4=_0x4ea316[0x0],_0x51ff38=_0x4ea316[0x1];else{if(_0x4ea316['length']===0x1&&_0x1b5ed8[_0x38202f(0x2eb)])_0x26acc4=_0x1b5ed8[_0x38202f(0x2eb)],_0x51ff38=_0x4ea316[0x0];else return _0x4ea316[_0x38202f(0x2c0)]===0x1?(console[_0x38202f(0x28c)](_0x38202f(0x22f)),console[_0x38202f(0x28c)](_0x38202f(0x2f4)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1b5ed8['verbose']&&(console[_0x38202f(0x28c)]('Project:\x20'+_0x26acc4),console['error']('Key:\x20'+_0x51ff38));if(!_0x1b5ed8['yes']){if(!isInteractive())return console['error'](a54_0x425391[_0x38202f(0x28b)](_0x38202f(0x319)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x425391['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57c0b8=await confirmKey(_0x38202f(0x28f)+_0x51ff38+'\x27\x20from\x20project\x20\x27'+_0x26acc4+'\x27?');if(!_0x57c0b8)return console['error'](a54_0x425391[_0x38202f(0x1f9)](_0x38202f(0x1fb))),0x1;}const _0x1b0cf4=await withSpinner(_0x38202f(0x1e2),()=>_0x1a4053[_0x38202f(0x2ba)][_0x38202f(0x22d)](_0x26acc4,_0x51ff38),{'verbose':_0x1b5ed8[_0x38202f(0x26a)]}),_0x118c3d=_0x1b0cf4['data'];return console[_0x38202f(0x28c)](_0x38202f(0x1ae)+_0x118c3d[_0x38202f(0x30b)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x118c3d['projectName']+'\x27'),(_0x1b5ed8[_0x38202f(0x257)]||_0x1b5ed8[_0x38202f(0x242)])&&await handleSingleObjectOutput(_0x118c3d,_0x1b5ed8),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(_0x4d1054){const _0x10a87c=a54_0x5bba2d,_0x2716eb=Math['floor'](_0x4d1054/0x3e8),_0x1b70f8=Math[_0x10a87c(0x1b0)](_0x2716eb/0x3c),_0x62f763=Math[_0x10a87c(0x1b0)](_0x1b70f8/0x3c),_0x16cf55=Math['floor'](_0x62f763/0x18);if(_0x16cf55>0x0){const _0x3b831c=_0x62f763%0x18;return _0x3b831c>0x0?_0x16cf55+'d\x20'+_0x3b831c+'h':_0x16cf55+'d';}else{if(_0x62f763>0x0){const _0x55440b=_0x1b70f8%0x3c;return _0x55440b>0x0?_0x62f763+'h\x20'+_0x55440b+'m':_0x62f763+'h';}else{if(_0x1b70f8>0x0){const _0x436a2f=_0x2716eb%0x3c;return _0x436a2f>0x0?_0x1b70f8+'m\x20'+_0x436a2f+'s':_0x1b70f8+'m';}else return _0x2716eb+'s';}}}function formatTimestamp(_0x98952,_0x3aa889){const _0x97b328=a54_0x5bba2d,_0x8bd101=new Date(_0x98952),_0x2bd5f9=String(_0x8bd101[_0x97b328(0x1a2)]())[_0x97b328(0x2a5)](0x2,'0'),_0x70ce21=String(_0x8bd101[_0x97b328(0x268)]())[_0x97b328(0x2a5)](0x2,'0'),_0x257140=_0x2bd5f9+':'+_0x70ce21,_0x304fe7=_0x8bd101[_0x97b328(0x2f7)]()===_0x3aa889[_0x97b328(0x2f7)]()&&_0x8bd101[_0x97b328(0x1e0)]()===_0x3aa889[_0x97b328(0x1e0)]()&&_0x8bd101['getDate']()===_0x3aa889[_0x97b328(0x1fa)]();if(_0x304fe7)return _0x257140;else{const _0x1bde3e=String(_0x8bd101[_0x97b328(0x1e0)]()+0x1)[_0x97b328(0x2a5)](0x2,'0'),_0x553784=String(_0x8bd101[_0x97b328(0x1fa)]())[_0x97b328(0x2a5)](0x2,'0');return _0x1bde3e+'-'+_0x553784+'\x20'+_0x257140;}}function formatDate(_0x41a9b8){const _0x3e8b3d=a54_0x5bba2d,_0x2290ba=_0x41a9b8[_0x3e8b3d(0x2f7)](),_0x444876=String(_0x41a9b8['getMonth']()+0x1)[_0x3e8b3d(0x2a5)](0x2,'0'),_0x1726eb=String(_0x41a9b8['getDate']())[_0x3e8b3d(0x2a5)](0x2,'0');return _0x2290ba+'-'+_0x444876+'-'+_0x1726eb;}function getTaskStateIcon(_0x535b2f){const _0x3a007d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3a007d[_0x535b2f]||'⚪';}function getBarChar(_0x44ce73){const _0x3edfdc=a54_0x5bba2d;return _0x44ce73===_0x3edfdc(0x28c)||_0x44ce73===_0x3edfdc(0x273)?'×':'─';}function getBarColor(_0x881705){const _0x42e290=a54_0x5bba2d,_0x2e1ed7={'success':a54_0x425391[_0x42e290(0x2b6)],'error':a54_0x425391['red'],'group_error':a54_0x425391['red'],'running':a54_0x425391[_0x42e290(0x1b8)],'blocked':a54_0x425391[_0x42e290(0x1f9)],'planned':a54_0x425391[_0x42e290(0x1af)],'canceling':a54_0x425391[_0x42e290(0x1f9)]};return _0x2e1ed7[_0x881705]||a54_0x425391[_0x42e290(0x21c)];}function parseTaskName(_0x55ab19){const _0x3def30=a54_0x5bba2d;let _0x39ee2e=_0x55ab19[_0x3def30(0x1a0)](/^\++/,'');const _0x41b90e=_0x39ee2e[_0x3def30(0x195)]('+'),_0x42cb99=_0x41b90e[_0x3def30(0x2c0)]>0x1?_0x41b90e[_0x3def30(0x2c0)]-0x2:0x0,_0x21821b=_0x41b90e[_0x41b90e['length']-0x1]||_0x39ee2e;return{'level':_0x42cb99,'name':'+'+_0x21821b};}function truncateTaskName(_0xf825d5,_0x474ca2){const _0x45773a=a54_0x5bba2d,_0x34ca60=stringWidth(_0xf825d5);if(_0x34ca60<=_0x474ca2)return _0xf825d5;let _0x512358=_0xf825d5;while(stringWidth(_0x512358+'…')>_0x474ca2&&_0x512358[_0x45773a(0x2c0)]>0x0){_0x512358=_0x512358['slice'](0x0,-0x1);}return _0x512358+'…';}function a54_0x1b76(){const _0x1d9dd0=['\x20\x20Project\x20ID:\x20','window','now','No\x20attempts\x20found\x20in\x20project:\x20','Killing\x20attempt...','No\x20sessions\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','Filter:\x20','red','error','splice','nextRunTime','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Updating\x20','Loading\x20workflows...','No\x20attempts\x20found\x20for:\x20','table','Force:\x20yes','New\x20project\x20name:\x20','icon','enableSchedule','resolveProjectId','applyPullProject','\x20(system)','Setting\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','list','\x20\x20Revision:\x20','sort','toLocaleString','diff','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','MAX_LABEL_COUNT','stdout','padStart','Listing\x20workflow\x20sessions...','newProjectId','yes','context','\x20-\x20','attempts','Pulling\x20project\x20','executeCloneProject','some','workflow:upload','sys','Revision:\x20','end','From\x20task:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','Listing\x20schedules...','green','listSchedules','\x20logs','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','workflow','\x20task','Show\x20tasks\x20for\x20an\x20attempt','📋\x20','Auto-selected\x20latest\x20session:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','length','MAX_TIMELINE_WIDTH','sourceProjectName','118205KPWrmc','No\x20sessions\x20found\x20for:\x20','\x0aUpdate\x20existing\x20project\x20\x22','projectName','workflow:secrets:list','\x20modified','fullName','List\x20workflow\x20attempts','workflow:download','Secrets\x20to\x20set:\x20','✔\x20Deleted\x20project\x20','sessions','revision','✔\x20Showing\x20','No\x20workflows\x20found','showWorkflowConsoleUrl','Enabling\x20schedule\x20#','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','List\x20workflow\x20schedules','session','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20log\x20files...','limit','Latest\x20session\x20has\x20no\x20attempt','modified','download','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','ICON_WIDTH','startedAt','disableSchedule','projects','pollTimeline','success','indexOf','existingProjectId','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Downloading\x20project\x20','(use\x20--limit\x20to\x20see\x20more)','cwd','relative','workflowProject','filesExtracted','pending','pullProject','getTime','fileCount','workflow:schedule:disable','\x20\x20Location:\x20','24akrmNd','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','/attempt/','\x0a✔\x20No\x20changes\x20to\x20push','getFullYear','Kill\x20a\x20running\x20attempt','taskName','/sessions/','4006143lUqjNT','Cloning\x20to\x20','303698epmiTS','No\x20workflow\x20tdx.json\x20found','Source:\x20','all','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','basename','startsWith','Show\x20specific\x20attempt\x20details','lastAttempt','\x20\x20Files\x20extracted:\x20','max','Files\x20to\x20upload:\x20','Disable\x20a\x20workflow\x20schedule','filter','key','columns','startTime','slice','Filter:\x20project=','name','trim','Target:\x20','Source\x20directory\x20is\x20required','\x20(disabled)','Status:\x20','reason','Select\x20a\x20task\x20to\x20view\x20logs:','map','\x0aError:','description','Source\x20directory:\x20','get','\x22\x20to\x20new\x20project\x20\x22','\x20is\x20not\x20a\x20directory','finishedAt','Session\x20','execute','Select\x20a\x20session\x20to\x20view\x20timeline:','set','Retry\x20a\x20session\x20or\x20attempt','keys','sessionId','→\x20New\x20project:\x20','Output\x20directory:\x20','preparePushProject','generateSessionTimelineRows','logs','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','summary','Invalid\x20format:\x20','workflow:timeline','buildTimelineData','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20Project:\x20','MAX_POLL_ITERATIONS','Analyzing\x20changes...','msPerChar','Project\x20name:\x20','---\x20','sourceDir','params','Attempt\x20ID:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','\x20sessions\x20','workflow:kill','No\x20workflow\x20sessions\x20found','✔\x20Project:\x20','path','createdAt','duration','attempt:','done','cyan','total','\x22\x20already\x20exists\x20(ID:\x20','Disabling\x20schedule\x20#','retryAttemptName','\x20\x20Session\x20context\x20set\x20to:\x20','List\x20workflow\x20execution\x20sessions','join','No\x20projects\x20match\x20pattern:\x20','🔄\x20','attempt','/app/workflows/','\x20\x20tdx\x20wf\x20use\x20<project>','size','renderSessionsTimeline','Target\x20directory:\x20','resumeFrom','attemptId','split','write','data','\x0aApply\x20these\x20changes?','TASK_NAME_WIDTH','min','\x20\x20Source:\x20','index','Expected\x20format:\x20--param\x20key=value','Listing\x20secrets...','new','replace','\x0aDry\x20run\x20-\x20no\x20project\x20created','getHours','Task\x20name:\x20','includes','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x0aDry\x20run\x20-\x20no\x20files\x20written','✔\x20Clone\x20complete','task','run','3656700DlkBBO','metadata','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20to\x20see\x20detailed\x20logs','✔\x20Secret\x20\x27','dim','floor','isArray','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Params:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','3431144OBFNwW','blue','\x20\x20Changes:\x20','Schedule\x20ID\x20is\x20required','Writing\x20files...','Resume\x20from:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','every','workflow:use','workflow:attempt','message','workflow:sessions','Setting\x20secret...','ICON_SPACING','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','requireProject','Validation:\x20skipped','repeat','→\x20Project:\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x20from\x20session\x20','match','output','resolve','\x20\x20Workflow:\x20','resolveProject','\x20new','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20secrets...','Total:\x20','running','No\x20workflows\x20found\x20in\x20project:\x20','Using\x20attempt\x20','workflow:secrets:set','renderSingleTimeline','targetExists','fileSize','Pushing\x20project...','MAX_TASKS_DISPLAY','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','parseProjectWorkflowPattern','getMonth','Listing\x20workflows...','Deleting\x20secret...','7bTGIpD','planned','fromTask','Project\x20name\x20is\x20required','Project:\x20','tdx.json','Dry\x20run:\x20yes','newProjectName','revision:\x20','session:','Start\x20a\x20workflow\x20run','unknown','...','Error:','dryRun','workflow:pull','isTTY','\x20of\x20','executePushProject','workflow:attempts','1864746tPVoIi','\x20deleted','yellow','getDate','Cancelled','state','cancelRequested','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','✔\x20Found\x20','Session\x20not\x20found:\x20','POLL_INTERVAL_MS','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflows','-\x20nothing\x20pushed','logFiles','Source\x20project:\x20','24306QFEoYv','workflow:run','renderTimeline','workflow:retry','site','No\x20sessions\x20found','text','No\x20attempts\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','122VXbttW','-\x20no\x20files\x20written','\x20schedule','Downloading\x20logs...','trimEnd','\x20next:\x20','force','retryAttempt','\x0a✔\x20Attempt\x20complete','✔\x20Retry\x20started','includeSubtasks','tdx\x20wf\x20attempt\x20','white','select','No\x20sessions\x20with\x20timing\x20information','parse','\x20\x20Target:\x20','readFile','Retrying\x20session...','skipValidation','title','Workflow:\x20','(unknown)','canceling','start','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','project','\x20session','\x1b[1A\x1b[2K','deleteSecret','LABEL_MIN_SPACING','Error:\x20Project\x20name\x20is\x20required','✔\x20Workflow\x20run\x20started','No\x20matching\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Tip:\x20cd\x20to\x20workflows/','push','Loading\x20sessions...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20attempt','✔\x20Workflow\x20project\x20set\x20to:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x0aPolling...\x20(','listSecrets','✔\x20Downloaded\x20','localeCompare','from','updatedAt','List\x20workflows','deleted','jsonl','clear','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Pull\x20complete','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Schedule\x20#','find','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Enable\x20a\x20workflow\x20schedule','follow','sessionTime','format','retrySession','\x20disabled\x20(','includeRetried','substring','\x20tasks','Error:\x20Attempt\x20ID\x20is\x20required','rows','📁\x20','MIN_TIMELINE_WIDTH','json','No\x20log\x20files\x20found\x20for\x20this\x20attempt','toISOString','GUTTER','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','hasChanges','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','📅\x20#','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','isNewProject','Project\x20filter:\x20','durationMs','\x20\x20Session\x20ID:\x20','\x20has\x20no\x20attempts','tasks','resolveProjectDir','Starting\x20workflow\x20run...','getMinutes','fill','verbose','log','\x20\x20Next\x20run:\x20','workflow:logs','utf-8','\x20\x20Attempt\x20ID:\x20','LABEL_WIDTH_DIVISOR','workflow:clone','Usage:\x20workflow:delete\x20<project-name-or-id>','group_error','Failed\x20to\x20fetch\x20attempt\x20data','\x0a⚠\x20Project\x20\x22','workflowName','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Including\x20subtasks:\x20yes','Warning:','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','status','Getting\x20attempt\x20details...','stat','\x20workflow','\x22\x20with\x20new\x20revision?','changes','Project\x20directory:\x20','projectId'];a54_0x1b76=function(){return _0x1d9dd0;};return a54_0x1b76();}function calculateTimeScale(_0x19d30a,_0x2e2faa){const _0x12e8dc=a54_0x5bba2d;return{'startTime':_0x19d30a[_0x12e8dc(0x228)],'endTime':_0x19d30a['end'],'durationMs':_0x19d30a[_0x12e8dc(0x180)],'msPerChar':_0x19d30a['duration']/_0x2e2faa};}function timeToPosition(_0x2944e9,_0x1f2314,_0xee9f19){const _0x31e99e=a54_0x5bba2d,_0x2adf3a=_0x2944e9-_0x1f2314[_0x31e99e(0x30d)],_0x3d05fc=Math[_0x31e99e(0x1b0)](_0x2adf3a/_0x1f2314[_0x31e99e(0x173)]);return Math[_0x31e99e(0x307)](0x0,Math['min'](_0x3d05fc,_0xee9f19));}function renderTimeAxis(_0x64235,_0x266799){const _0x22c275=a54_0x5bba2d,_0x38d334=Math[_0x22c275(0x19a)](TIMELINE_CONFIG[_0x22c275(0x2a3)],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x22c275(0x1b0)](_0x266799/TIMELINE_CONFIG[_0x22c275(0x270)]))),_0x2b955a=_0x64235[_0x22c275(0x262)]/(_0x38d334-0x1),_0x3b40ec=new Date(_0x64235[_0x22c275(0x30d)]),_0x369446=[];for(let _0x42d0db=0x0;_0x42d0db<_0x38d334;_0x42d0db++){const _0x548a08=_0x64235[_0x22c275(0x30d)]+_0x42d0db*_0x2b955a,_0xfee039=timeToPosition(_0x548a08,_0x64235,_0x266799),_0x4cc41a=formatTimestamp(_0x548a08,_0x3b40ec);_0x369446[_0x22c275(0x234)]({'pos':_0xfee039,'text':_0x4cc41a});}const _0x1d41f2=new Array(_0x266799)[_0x22c275(0x269)]('\x20');let _0x528436=-0x1;for(const {pos:_0x242586,text:_0x47b1c7}of _0x369446){let _0x24c164=Math[_0x22c275(0x307)](0x0,_0x242586-Math[_0x22c275(0x1b0)](_0x47b1c7[_0x22c275(0x2c0)]/0x2));_0x24c164<=_0x528436+TIMELINE_CONFIG[_0x22c275(0x22e)]&&(_0x24c164=_0x528436+TIMELINE_CONFIG[_0x22c275(0x22e)]+0x1);_0x24c164+_0x47b1c7['length']>_0x266799&&(_0x24c164=_0x266799-_0x47b1c7[_0x22c275(0x2c0)]);if(_0x24c164>=0x0&&_0x24c164+_0x47b1c7[_0x22c275(0x2c0)]<=_0x266799&&_0x24c164>_0x528436){for(let _0x5038eb=0x0;_0x5038eb<_0x47b1c7[_0x22c275(0x2c0)];_0x5038eb++){_0x1d41f2[_0x24c164+_0x5038eb]=_0x47b1c7[_0x5038eb];}_0x528436=_0x24c164+_0x47b1c7[_0x22c275(0x2c0)]-0x1;}}return _0x1d41f2[_0x22c275(0x18a)]('');}function renderTaskRow(_0x3ac1fe,_0xd77bf0,_0xfbe683,_0x305ec4){const _0x9922b2=a54_0x5bba2d,{level:_0x3f3ee7,name:_0x59ea90}=parseTaskName(_0x3ac1fe['name']),_0x527af9='\x20'[_0x9922b2(0x1c8)](_0x3f3ee7),_0x417798=_0x3ac1fe[_0x9922b2(0x284)]?'('+formatElapsed(_0x3ac1fe[_0x9922b2(0x284)]['duration'])+')':'',_0x4848fc=stringWidth(_0x417798),_0x2dde31=_0x3f3ee7*0x1,_0x581497=_0x305ec4-_0x2dde31-_0x4848fc-0x1,_0x374d03=truncateTaskName(_0x59ea90,_0x581497),_0x31c3ec=_0x527af9+_0x374d03,_0x212e34=stringWidth(_0x31c3ec),_0x5ead1d=_0x305ec4-_0x212e34-_0x4848fc,_0x9744cb=_0x31c3ec+'\x20'[_0x9922b2(0x1c8)](Math['max'](0x1,_0x5ead1d))+a54_0x425391['dim'](_0x417798),_0x3ba094=getTaskStateIcon(_0x3ac1fe[_0x9922b2(0x1fc)]),_0x3c155c=new Array(_0xfbe683)[_0x9922b2(0x269)]('\x20');if(_0x3ac1fe['window']){const _0x5aac3c=timeToPosition(_0x3ac1fe[_0x9922b2(0x284)][_0x9922b2(0x228)],_0xd77bf0,_0xfbe683),_0x4c6129=timeToPosition(_0x3ac1fe[_0x9922b2(0x284)]['end'],_0xd77bf0,_0xfbe683),_0x4bb914=getBarChar(_0x3ac1fe[_0x9922b2(0x1fc)]),_0x2369f4=Math[_0x9922b2(0x307)](_0x5aac3c+0x1,_0x4c6129);for(let _0x3d5389=_0x5aac3c;_0x3d5389<Math[_0x9922b2(0x19a)](_0x2369f4,_0xfbe683);_0x3d5389++){_0x3c155c[_0x3d5389]=_0x4bb914;}}const _0x312dee=getBarColor(_0x3ac1fe['state']),_0x20206a=_0x3c155c[_0x9922b2(0x318)](_0x21ea2b=>_0x21ea2b==='\x20'?'\x20':_0x312dee(_0x21ea2b))[_0x9922b2(0x18a)]('');return _0x3ba094+'\x20'+_0x9744cb+'│'+_0x20206a+'│';}function calculateStats(_0x39572e){const _0x4c7731=a54_0x5bba2d,_0x6817e0={'total':_0x39572e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1d7ca1 of _0x39572e){if(_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x2e3))_0x6817e0[_0x4c7731(0x2e3)]++;else{if(_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x28c)||_0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x273))_0x6817e0['error']++;else _0x1d7ca1[_0x4c7731(0x1fc)]===_0x4c7731(0x1d5)?_0x6817e0[_0x4c7731(0x1d5)]++:_0x6817e0['pending']++;}}return _0x6817e0;}function formatStats(_0x549609){const _0x5085ce=a54_0x5bba2d;return[_0x5085ce(0x1d4)+_0x549609[_0x5085ce(0x184)],'✅\x20'+_0x549609[_0x5085ce(0x2e3)],'❌\x20'+_0x549609[_0x5085ce(0x28c)],_0x5085ce(0x18c)+_0x549609[_0x5085ce(0x1d5)],'⏳\x20'+_0x549609[_0x5085ce(0x2ed)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x16d);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x5bba2d(0x321)](_0x4ed672){const _0x306adf=a54_0x5bba2d,{options:_0x665413,args:_0x191a47,tdx:_0xbefbbb}=_0x4ed672;let _0x300703,_0x4a199a,_0x117d9d=![];if(_0x191a47[0x0]){if(_0x191a47[0x0]['includes']('.')){const _0x65d6a=this[_0x306adf(0x1df)](_0x191a47,_0x665413);if(!_0x65d6a)return 0x1;_0x300703=_0x65d6a[_0x306adf(0x2c6)],_0x4a199a=_0x65d6a[_0x306adf(0x276)];}else{_0x4a199a=_0x191a47[0x0],_0x300703=_0x665413[_0x306adf(0x2eb)];if(!_0x300703)return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x246)),0x1;_0x117d9d=!![];}}else{const _0x4704ef=this[_0x306adf(0x1df)](_0x191a47,_0x665413);if(!_0x4704ef)return 0x1;_0x300703=_0x4704ef[_0x306adf(0x2c6)],_0x4a199a=_0x4704ef['workflowName'];}if(_0x665413[_0x306adf(0x26a)]){if(_0x300703&&_0x4a199a)console[_0x306adf(0x28c)](_0x306adf(0x28a)+_0x300703+'.'+_0x4a199a);else _0x300703&&console[_0x306adf(0x28c)](_0x306adf(0x30f)+_0x300703);}const _0x42b264=_0x665413[_0x306adf(0x194)],_0x2dc9b5=_0x665413[_0x306adf(0x326)];if(_0x42b264){_0x2dc9b5&&console['error'](a54_0x425391['yellow'](_0x306adf(0x279)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x71e703=_0x665413[_0x306adf(0x24b)];return _0x71e703?await this[_0x306adf(0x2e2)](_0x4ed672,_0x42b264):await this['renderSingleTimeline'](_0x4ed672,_0x42b264,_0x665413),0x0;}if(_0x2dc9b5){const _0x280776=await withSpinner('Loading\x20session...',()=>_0xbefbbb[_0x306adf(0x2ba)][_0x306adf(0x2ce)]({'projectName':_0x300703,'workflowName':_0x4a199a,'limit':0x64}),{'verbose':_0x665413[_0x306adf(0x26a)]}),_0x256dbd=_0x280776[_0x306adf(0x197)][_0x306adf(0x248)](_0x14b620=>_0x14b620['id']===_0x2dc9b5);if(!_0x256dbd)return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x200)+_0x2dc9b5),0x1;if(!_0x256dbd[_0x306adf(0x305)]?.['id'])return console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x28b)](_0x306adf(0x1f0)),_0x306adf(0x320)+_0x2dc9b5+_0x306adf(0x264)),0x1;const _0x7d15aa=_0x256dbd[_0x306adf(0x305)]['id'];_0x665413['verbose']&&console[_0x306adf(0x28c)](_0x306adf(0x1d7)+_0x7d15aa+_0x306adf(0x1cb)+_0x2dc9b5);const _0x5cacea=_0x665413[_0x306adf(0x24b)];return _0x5cacea?await this['pollTimeline'](_0x4ed672,_0x7d15aa):await this[_0x306adf(0x1d9)](_0x4ed672,_0x7d15aa,_0x665413),0x0;}const _0x490c5b=await withSpinner(_0x306adf(0x235),()=>_0xbefbbb[_0x306adf(0x2ba)][_0x306adf(0x2ce)]({'projectName':_0x300703,'workflowName':_0x4a199a,'limit':_0x665413[_0x306adf(0x2d9)]||0x32}),{'verbose':_0x665413['verbose']}),_0x2d2ce5=_0x490c5b[_0x306adf(0x197)];if(_0x2d2ce5[_0x306adf(0x2c0)]===0x0){if(_0x300703&&_0x4a199a)console[_0x306adf(0x28c)](_0x306adf(0x2c4)+_0x300703+'.'+_0x4a199a);else _0x300703?console[_0x306adf(0x28c)](_0x306adf(0x288)+_0x300703):(console[_0x306adf(0x28c)](_0x306adf(0x17c)),console[_0x306adf(0x28c)](a54_0x425391[_0x306adf(0x1af)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2d2ce5['sort']((_0xb8d5fc,_0x5e1cca)=>{const _0x4e84fe=_0x306adf,_0x579e66=_0xb8d5fc[_0x4e84fe(0x24c)]||'',_0x2b6791=_0x5e1cca[_0x4e84fe(0x24c)]||'';return _0x2b6791[_0x4e84fe(0x23d)](_0x579e66);});if(_0x665413['json']||_0x665413[_0x306adf(0x242)])return await handleSDKOutput(_0x2d2ce5,_0x665413),0x0;let _0x230686;if(_0x117d9d){const _0x5b18f7=_0x2d2ce5[0x0];if(!_0x5b18f7['lastAttempt']?.['id'])return console[_0x306adf(0x28c)](_0x306adf(0x2da)),0x0;_0x230686=_0x5b18f7[_0x306adf(0x305)]['id'],_0x665413[_0x306adf(0x26a)]&&console[_0x306adf(0x28c)](_0x306adf(0x2be)+_0x5b18f7[_0x306adf(0x24c)]);}else{const _0x21b8ec=_0x2d2ce5[_0x306adf(0x318)](_0x27d505=>{const _0x5aada6=_0x306adf,_0x4f5b11=getAttemptStatusDisplay(_0x27d505['lastAttempt']);return{'title':_0x27d505['project']?.['name']+'.'+_0x27d505[_0x5aada6(0x2ba)]?.[_0x5aada6(0x310)]+_0x5aada6(0x2aa)+_0x27d505['sessionTime']+'\x20'+_0x4f5b11[_0x5aada6(0x296)],'value':_0x27d505[_0x5aada6(0x305)]?.['id']||'','description':_0x4f5b11[_0x5aada6(0x20d)]};}),_0x1f4891=await a54_0x2e7bce({'type':_0x306adf(0x21d),'name':_0x306adf(0x194),'message':_0x306adf(0x322),'choices':_0x21b8ec[_0x306adf(0x30a)](_0x14f0cb=>_0x14f0cb['value']!=='')});if(!_0x1f4891[_0x306adf(0x194)])return 0x0;_0x230686=_0x1f4891[_0x306adf(0x194)];}const _0x5e5ed5=_0x665413[_0x306adf(0x24b)];return _0x5e5ed5?await this[_0x306adf(0x2e2)](_0x4ed672,_0x230686):await this['renderSingleTimeline'](_0x4ed672,_0x230686,_0x665413),0x0;}async[a54_0x5bba2d(0x1d9)](_0x20d94d,_0x3f2ecb,_0x25a4ee){const _0x5d97d0=a54_0x5bba2d,{tdx:_0x19c408}=_0x20d94d;let _0x52e0b9,_0x5bdc16;try{[_0x52e0b9,_0x5bdc16]=await Promise[_0x5d97d0(0x300)]([_0x19c408[_0x5d97d0(0x2ba)][_0x5d97d0(0x18d)](_0x3f2ecb),_0x19c408[_0x5d97d0(0x2ba)][_0x5d97d0(0x265)](_0x3f2ecb,![])]);}catch(_0x500c2b){console[_0x5d97d0(0x28c)](a54_0x425391['red'](_0x5d97d0(0x274)));_0x25a4ee[_0x5d97d0(0x26a)]&&console['error'](_0x500c2b);throw _0x500c2b;}if(_0x25a4ee[_0x5d97d0(0x257)]||_0x25a4ee['jsonl']){const _0x515d66=this[_0x5d97d0(0x16e)](_0x52e0b9,_0x5bdc16);await handleSDKOutput([_0x515d66],_0x25a4ee);return;}const _0x45f246=_0x19c408[_0x5d97d0(0x2a9)][_0x5d97d0(0x20b)],_0x4f20ef=this[_0x5d97d0(0x209)](_0x52e0b9,_0x5bdc16,_0x45f246);console[_0x5d97d0(0x26b)](_0x4f20ef);}async['pollTimeline'](_0x5870ef,_0x785a83){const _0x510f6e=a54_0x5bba2d,{tdx:_0x3b27d7}=_0x5870ef,_0x294e35=TIMELINE_CONFIG[_0x510f6e(0x201)],_0x2bfde0=TIMELINE_CONFIG[_0x510f6e(0x171)];let _0x1f4ddc=0x0;while(_0x1f4ddc<_0x2bfde0){process[_0x510f6e(0x2a4)]['isTTY']&&process[_0x510f6e(0x2a4)][_0x510f6e(0x196)]('\x1bc');let _0x4c4074,_0x356378;try{[_0x4c4074,_0x356378]=await Promise[_0x510f6e(0x300)]([_0x3b27d7[_0x510f6e(0x2ba)][_0x510f6e(0x18d)](_0x785a83),_0x3b27d7[_0x510f6e(0x2ba)][_0x510f6e(0x265)](_0x785a83,![])]);}catch(_0x4dede7){console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x28b)](_0x510f6e(0x1b5)));_0x1f4ddc>0x0&&console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x1af)](_0x510f6e(0x25f)+_0x1f4ddc));throw _0x4dede7;}const _0x268d0c=_0x3b27d7[_0x510f6e(0x2a9)]['site'],_0x4aba74=this[_0x510f6e(0x209)](_0x4c4074,_0x356378,_0x268d0c);console[_0x510f6e(0x26b)](_0x4aba74);const _0xe493ab=_0x4c4074[_0x510f6e(0x182)]&&_0x356378[_0x510f6e(0x1be)](_0x150c2f=>_0x150c2f[_0x510f6e(0x1fc)]!==_0x510f6e(0x1d5)&&_0x150c2f['state']!=='planned');if(_0xe493ab){console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x2b6)](_0x510f6e(0x218)));break;}console[_0x510f6e(0x28c)](a54_0x425391['dim'](_0x510f6e(0x23a)+_0x1f4ddc*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x2764bd=>setTimeout(_0x2764bd,_0x294e35)),_0x1f4ddc++;}_0x1f4ddc>=_0x2bfde0&&console[_0x510f6e(0x28c)](a54_0x425391[_0x510f6e(0x1f9)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x5bba2d(0x209)](_0x2586a7,_0x3d362c,_0x1b54c9){const _0x2d0a2b=a54_0x5bba2d,_0x571177=[],_0x41b1b4=TIMELINE_CONFIG[_0x2d0a2b(0x199)],_0x4d0fd8=0x5,_0x5b0517=process[_0x2d0a2b(0x2a4)][_0x2d0a2b(0x30c)]||0x78,_0xdaf774=_0x5b0517-_0x41b1b4-_0x4d0fd8,_0x4fc280=Math[_0x2d0a2b(0x307)](TIMELINE_CONFIG[_0x2d0a2b(0x256)],Math['min'](_0xdaf774,TIMELINE_CONFIG[_0x2d0a2b(0x2c1)])),_0x20e45e=new Date(_0x2586a7[_0x2d0a2b(0x17f)])[_0x2d0a2b(0x2ef)](),_0x3e693e=_0x2586a7[_0x2d0a2b(0x31f)]?new Date(_0x2586a7[_0x2d0a2b(0x31f)])[_0x2d0a2b(0x2ef)]():Date[_0x2d0a2b(0x285)](),_0x1700db={'start':_0x20e45e,'end':_0x3e693e,'duration':_0x3e693e-_0x20e45e},_0x37db4c=new Map(),_0x2152c3=[];for(const _0x16354e of _0x3d362c){if(_0x16354e[_0x2d0a2b(0x2df)]){const _0xa08215=new Date(_0x16354e[_0x2d0a2b(0x2df)])[_0x2d0a2b(0x2ef)](),_0x5c2528=_0x16354e[_0x2d0a2b(0x23f)]?new Date(_0x16354e[_0x2d0a2b(0x23f)])[_0x2d0a2b(0x2ef)]():Date[_0x2d0a2b(0x285)](),_0x2f4ce9={'start':_0xa08215,'end':_0x5c2528,'duration':_0x5c2528-_0xa08215};_0x37db4c[_0x2d0a2b(0x323)](_0x16354e['id'],_0x2f4ce9),_0x2152c3[_0x2d0a2b(0x234)]({'name':_0x16354e[_0x2d0a2b(0x2c9)],'state':_0x16354e[_0x2d0a2b(0x1fc)]||_0x2d0a2b(0x1ee),'window':_0x2f4ce9});}else _0x2152c3[_0x2d0a2b(0x234)]({'name':_0x16354e[_0x2d0a2b(0x2c9)],'state':_0x16354e[_0x2d0a2b(0x1fc)]||_0x2d0a2b(0x1e4),'window':undefined});}_0x2152c3['sort']((_0x561014,_0x131397)=>{const _0x33e1df=_0x2d0a2b;if(!_0x561014[_0x33e1df(0x284)])return 0x1;if(!_0x131397['window'])return-0x1;return _0x561014[_0x33e1df(0x284)][_0x33e1df(0x228)]-_0x131397['window'][_0x33e1df(0x228)];});const _0x25e48c=_0x2152c3[_0x2d0a2b(0x2c0)],_0x549e35=_0x25e48c>TIMELINE_CONFIG[_0x2d0a2b(0x1dd)];_0x549e35&&_0x2152c3[_0x2d0a2b(0x28d)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x2685d3=calculateTimeScale(_0x1700db,_0x4fc280),_0x54dd35=_0x2586a7[_0x2d0a2b(0x182)]?_0x2586a7[_0x2d0a2b(0x2e3)]?a54_0x425391['green']('success'):a54_0x425391[_0x2d0a2b(0x28b)]('error'):a54_0x425391['blue'](_0x2d0a2b(0x1d5)),_0x34dd57=_0x2586a7[_0x2d0a2b(0x22a)]?.['id'],_0x2efe7f=_0x2586a7[_0x2d0a2b(0x326)];let _0xb22582;if(_0x34dd57&&_0x2efe7f){const _0x5e86f6=getWorkflowAttemptUrl(_0x1b54c9,_0x34dd57,_0x2efe7f,_0x2586a7['id']);_0xb22582=hyperlink(a54_0x425391[_0x2d0a2b(0x1af)](_0x2586a7['id']),_0x5e86f6);}else _0xb22582=a54_0x425391['dim'](_0x2586a7['id']);_0x571177[_0x2d0a2b(0x234)]('Attempt:\x20'+_0xb22582+_0x2d0a2b(0x2aa)+_0x54dd35+_0x2d0a2b(0x2aa)+formatElapsed(_0x1700db[_0x2d0a2b(0x180)]));if(_0x2152c3[_0x2d0a2b(0x2c0)]>0x0){const _0x53e528=renderTimeAxis(_0x2685d3,_0x4fc280),_0x3d649b=new Date(_0x1700db[_0x2d0a2b(0x228)]),_0x39107d=formatDate(_0x3d649b),_0x5eb569=TIMELINE_CONFIG[_0x2d0a2b(0x2de)]+TIMELINE_CONFIG[_0x2d0a2b(0x1c4)]+_0x41b1b4,_0x475120=_0x39107d[_0x2d0a2b(0x2a5)](_0x5eb569),_0x35252e=a54_0x425391[_0x2d0a2b(0x1af)](_0x475120);_0x571177[_0x2d0a2b(0x234)](_0x35252e+'\x20'+_0x53e528);for(const _0x42f96e of _0x2152c3){_0x571177[_0x2d0a2b(0x234)](renderTaskRow(_0x42f96e,_0x2685d3,_0x4fc280,_0x41b1b4));}const _0x1fe064=calculateStats(_0x2152c3);_0x571177[_0x2d0a2b(0x234)](formatStats(_0x1fe064)),_0x549e35&&_0x571177[_0x2d0a2b(0x234)](a54_0x425391['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x2d0a2b(0x1dd)]+_0x2d0a2b(0x1f4)+_0x25e48c+_0x2d0a2b(0x252))),_0x571177[_0x2d0a2b(0x234)](''),_0x571177[_0x2d0a2b(0x234)](a54_0x425391[_0x2d0a2b(0x1af)]('💡\x20Tip:\x20Use\x20')+(_0x2d0a2b(0x21b)+_0x2586a7['id']+_0x2d0a2b(0x2b8))+a54_0x425391[_0x2d0a2b(0x1af)](_0x2d0a2b(0x1ad)));}else _0x571177[_0x2d0a2b(0x234)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x571177[_0x2d0a2b(0x18a)]('\x0a');}[a54_0x5bba2d(0x16e)](_0x5ae951,_0x2e8a35){const _0x1dde16=a54_0x5bba2d,_0x6e18c2=new Date(_0x5ae951[_0x1dde16(0x17f)])['getTime'](),_0x33ae34=_0x5ae951[_0x1dde16(0x31f)]?new Date(_0x5ae951['finishedAt'])[_0x1dde16(0x2ef)]():Date[_0x1dde16(0x285)](),_0x24f9bd=_0x33ae34-_0x6e18c2,_0xb1382c=[];for(const _0x2b37d7 of _0x2e8a35){if(_0x2b37d7['startedAt']){const _0x22bcd8=new Date(_0x2b37d7['startedAt'])[_0x1dde16(0x2ef)](),_0x30f498=_0x2b37d7['updatedAt']?new Date(_0x2b37d7[_0x1dde16(0x23f)])[_0x1dde16(0x2ef)]():Date['now']();_0xb1382c['push']({'name':_0x2b37d7['fullName'],'state':_0x2b37d7[_0x1dde16(0x1fc)]||_0x1dde16(0x1ee),'window':{'start':_0x22bcd8,'end':_0x30f498,'duration':_0x30f498-_0x22bcd8}});}else _0xb1382c[_0x1dde16(0x234)]({'name':_0x2b37d7['fullName'],'state':_0x2b37d7['state']||_0x1dde16(0x1e4),'window':undefined});}const _0x41d5a5=calculateStats(_0xb1382c);return{'attempt':{'id':_0x5ae951['id'],'status':_0x5ae951[_0x1dde16(0x182)]?_0x5ae951[_0x1dde16(0x2e3)]?_0x1dde16(0x2e3):'error':_0x1dde16(0x1d5),'createdAt':_0x5ae951[_0x1dde16(0x17f)],'finishedAt':_0x5ae951[_0x1dde16(0x31f)],'duration_ms':_0x24f9bd},'tasks':_0xb1382c[_0x1dde16(0x318)](_0x14f930=>({'name':_0x14f930[_0x1dde16(0x310)],'state':_0x14f930['state'],'startedAt':_0x14f930[_0x1dde16(0x284)]?new Date(_0x14f930[_0x1dde16(0x284)][_0x1dde16(0x228)])[_0x1dde16(0x259)]():null,'updatedAt':_0x14f930[_0x1dde16(0x284)]?new Date(_0x14f930['window'][_0x1dde16(0x2b2)])[_0x1dde16(0x259)]():null,'duration_ms':_0x14f930[_0x1dde16(0x284)]?.['duration']||null})),'stats':_0x41d5a5};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x5bba2d(0x310)]='workflow:schedules';['description']=a54_0x5bba2d(0x2d5);async[a54_0x5bba2d(0x321)](_0x30d501){const _0x57fd97=a54_0x5bba2d,{options:_0x311029,tdx:_0x28d61e}=_0x30d501,_0xc11700=await withSpinner(_0x57fd97(0x2b5),()=>_0x28d61e[_0x57fd97(0x2ba)][_0x57fd97(0x2b7)](),{'verbose':_0x311029['verbose']}),_0x33b68c=_0xc11700[_0x57fd97(0x197)];console[_0x57fd97(0x28c)](_0x57fd97(0x1ff)+_0x33b68c['length']+_0x57fd97(0x212)+(_0x33b68c[_0x57fd97(0x2c0)]!==0x1?'s':''));if(isStructuredFormat(_0x311029))await handleSDKOutput(_0x33b68c,_0x311029);else{if(_0x33b68c[_0x57fd97(0x2c0)]===0x0)console[_0x57fd97(0x26b)]('No\x20schedules\x20found');else for(const _0x2ae756 of _0x33b68c){const _0x40fac3=_0x2ae756['disabledAt']?a54_0x425391[_0x57fd97(0x1f9)](_0x57fd97(0x314)):'',_0x279d0f=_0x2ae756['project']?.[_0x57fd97(0x310)]?a54_0x425391[_0x57fd97(0x1af)]('\x20['+_0x2ae756[_0x57fd97(0x22a)]['name']+']'):'',_0x4e00b8=_0x2ae756[_0x57fd97(0x28e)]?a54_0x425391[_0x57fd97(0x1af)](_0x57fd97(0x215)+new Date(_0x2ae756[_0x57fd97(0x28e)])[_0x57fd97(0x2a0)]()):'';console[_0x57fd97(0x26b)](_0x57fd97(0x25e)+_0x2ae756['id']+'\x20'+(_0x2ae756['workflow']?.[_0x57fd97(0x310)]||_0x57fd97(0x226))+_0x279d0f+_0x40fac3+_0x4e00b8);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']='workflow:schedule:enable';[a54_0x5bba2d(0x31a)]=a54_0x5bba2d(0x24a);async[a54_0x5bba2d(0x321)](_0x224239){const _0x17ede0=a54_0x5bba2d,{options:_0x5038b6,args:_0x2fc6ff,tdx:_0x142fd3}=_0x224239,_0x30296e=_0x2fc6ff[0x0];if(!_0x30296e)return console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x28b)](_0x17ede0(0x1f0)),_0x17ede0(0x1ba)),console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x1ca))),console[_0x17ede0(0x28c)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x29c))),0x1;const _0x328892=await withSpinner(_0x17ede0(0x2d3)+_0x30296e+_0x17ede0(0x1ef),()=>_0x142fd3[_0x17ede0(0x2ba)][_0x17ede0(0x297)](_0x30296e),{'verbose':_0x5038b6[_0x17ede0(0x26a)]}),_0xd1d5db=_0x328892[_0x17ede0(0x197)];return isStructuredFormat(_0x5038b6)?await handleSingleObjectOutput(_0xd1d5db,_0x5038b6):(console['log'](_0x17ede0(0x247)+_0x30296e+'\x20enabled\x20('+(_0xd1d5db[_0x17ede0(0x2ba)]?.[_0x17ede0(0x310)]||'unknown')+')'),_0xd1d5db[_0x17ede0(0x28e)]&&console[_0x17ede0(0x26b)](a54_0x425391[_0x17ede0(0x1af)](_0x17ede0(0x26c)+new Date(_0xd1d5db[_0x17ede0(0x28e)])[_0x17ede0(0x2a0)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x5bba2d(0x310)]=a54_0x5bba2d(0x2f1);['description']=a54_0x5bba2d(0x309);async[a54_0x5bba2d(0x321)](_0x12009c){const _0x5b9b58=a54_0x5bba2d,{options:_0x21ada4,args:_0x5f2431,tdx:_0x2e3973}=_0x12009c,_0x2e7efa=_0x5f2431[0x0];if(!_0x2e7efa)return console['error'](a54_0x425391[_0x5b9b58(0x28b)](_0x5b9b58(0x1f0)),_0x5b9b58(0x1ba)),console['error'](a54_0x425391[_0x5b9b58(0x1af)](_0x5b9b58(0x2a2))),console[_0x5b9b58(0x28c)](a54_0x425391['dim'](_0x5b9b58(0x29c))),0x1;const _0x334c9d=await withSpinner(_0x5b9b58(0x186)+_0x2e7efa+'...',()=>_0x2e3973[_0x5b9b58(0x2ba)][_0x5b9b58(0x2e0)](_0x2e7efa),{'verbose':_0x21ada4[_0x5b9b58(0x26a)]}),_0x474cd5=_0x334c9d[_0x5b9b58(0x197)];return isStructuredFormat(_0x21ada4)?await handleSingleObjectOutput(_0x474cd5,_0x21ada4):console[_0x5b9b58(0x26b)](_0x5b9b58(0x247)+_0x2e7efa+_0x5b9b58(0x24f)+(_0x474cd5[_0x5b9b58(0x2ba)]?.[_0x5b9b58(0x310)]||_0x5b9b58(0x1ee))+')'),0x0;}}