@treasuredata/tdx 2026.3.9 → 2026.3.10

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 (210) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.d.ts.map +1 -1
  55. package/dist/commands/workflow-command.js +1 -1
  56. package/dist/commands/workflow-command.js.map +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.d.ts +2 -0
  118. package/dist/sdk/errors.d.ts.map +1 -1
  119. package/dist/sdk/errors.js +1 -1
  120. package/dist/sdk/errors.js.map +1 -1
  121. package/dist/sdk/index.js +1 -1
  122. package/dist/sdk/io/index.js +1 -1
  123. package/dist/sdk/io/node-filesystem.js +1 -1
  124. package/dist/sdk/job.js +1 -1
  125. package/dist/sdk/journey.js +1 -1
  126. package/dist/sdk/llm/chat-cache.js +1 -1
  127. package/dist/sdk/llm/index.js +1 -1
  128. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  129. package/dist/sdk/llm/model-factors.js +1 -1
  130. package/dist/sdk/personalization.js +1 -1
  131. package/dist/sdk/query/index.js +1 -1
  132. package/dist/sdk/query/sql-parser.js +1 -1
  133. package/dist/sdk/realtime.js +1 -1
  134. package/dist/sdk/schedule.js +1 -1
  135. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  136. package/dist/sdk/segment/fields-display.js +1 -1
  137. package/dist/sdk/segment/file-discovery.js +1 -1
  138. package/dist/sdk/segment/journey-utils.js +1 -1
  139. package/dist/sdk/segment/journey-validator.js +1 -1
  140. package/dist/sdk/segment/journey-yaml.js +1 -1
  141. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  142. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/pull-workflow.js +1 -1
  144. package/dist/sdk/segment/push-recovery.js +1 -1
  145. package/dist/sdk/segment/push-workflow.js +1 -1
  146. package/dist/sdk/segment/resolution-context.js +1 -1
  147. package/dist/sdk/segment/segment-path-parser.js +1 -1
  148. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  149. package/dist/sdk/segment/segment-validator.js +1 -1
  150. package/dist/sdk/segment/target-resolution.js +1 -1
  151. package/dist/sdk/segment/tdx-config.js +1 -1
  152. package/dist/sdk/segment/types/activation-schema.js +1 -1
  153. package/dist/sdk/segment/types/journey-def.js +1 -1
  154. package/dist/sdk/segment/types/journey-schema.js +1 -1
  155. package/dist/sdk/segment/types/segment-def.js +1 -1
  156. package/dist/sdk/segment/types/segment-schema.js +1 -1
  157. package/dist/sdk/segment/validate-files.js +1 -1
  158. package/dist/sdk/segment/yaml-validator.js +1 -1
  159. package/dist/sdk/segment.js +1 -1
  160. package/dist/sdk/types/index.js +1 -1
  161. package/dist/sdk/types/progress.js +1 -1
  162. package/dist/sdk/user.js +1 -1
  163. package/dist/sdk/util/format-detector.js +1 -1
  164. package/dist/sdk/util/formatters.js +1 -1
  165. package/dist/sdk/util/index.js +1 -1
  166. package/dist/sdk/util/paginate.js +1 -1
  167. package/dist/sdk/util/tree-formatter.js +1 -1
  168. package/dist/sdk/workflow/archive-validation.js +1 -1
  169. package/dist/sdk/workflow/clone-workflow.js +1 -1
  170. package/dist/sdk/workflow/index.d.ts +12 -0
  171. package/dist/sdk/workflow/index.d.ts.map +1 -1
  172. package/dist/sdk/workflow/index.js +1 -1
  173. package/dist/sdk/workflow/index.js.map +1 -1
  174. package/dist/sdk/workflow/pull-workflow.js +1 -1
  175. package/dist/sdk/workflow/push-workflow.js +1 -1
  176. package/dist/sdk/workflow/tdx-config.js +1 -1
  177. package/dist/sdk/workflow/workflow-utils.js +1 -1
  178. package/dist/test-utils/command-runner.js +1 -1
  179. package/dist/test-utils/factories.js +1 -1
  180. package/dist/test-utils/fixtures.js +1 -1
  181. package/dist/test-utils/http-mock.js +1 -1
  182. package/dist/test-utils/index.js +1 -1
  183. package/dist/utils/async.js +1 -1
  184. package/dist/utils/colors.js +1 -1
  185. package/dist/utils/diff.js +1 -1
  186. package/dist/utils/file-permissions.js +1 -1
  187. package/dist/utils/file-reader.js +1 -1
  188. package/dist/utils/github-releases.js +1 -1
  189. package/dist/utils/global-cache.js +1 -1
  190. package/dist/utils/json-loader.js +1 -1
  191. package/dist/utils/local-cache.js +1 -1
  192. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  193. package/dist/utils/logger/formatters/index.js +1 -1
  194. package/dist/utils/logger/handlers/console-handler.js +1 -1
  195. package/dist/utils/logger/handlers/file-handler.js +1 -1
  196. package/dist/utils/logger/handlers/index.js +1 -1
  197. package/dist/utils/logger/handlers/null-handler.js +1 -1
  198. package/dist/utils/logger/index.js +1 -1
  199. package/dist/utils/logger/logger.js +1 -1
  200. package/dist/utils/logger/types.js +1 -1
  201. package/dist/utils/option-validation.js +1 -1
  202. package/dist/utils/process.js +1 -1
  203. package/dist/utils/prompt.js +1 -1
  204. package/dist/utils/spinner.js +1 -1
  205. package/dist/utils/sse-parser.js +1 -1
  206. package/dist/utils/string-utils.js +1 -1
  207. package/dist/utils/table-ref-parser.js +1 -1
  208. package/dist/utils/tdx-logger.js +1 -1
  209. package/dist/utils/version-check.js +1 -1
  210. package/package.json +1 -1
@@ -1 +1 @@
1
- const a51_0x3e4a18=a51_0x1765;(function(_0x159b14,_0x66bc76){const _0x815ab7=a51_0x1765,_0x52329e=_0x159b14();while(!![]){try{const _0x2aae66=-parseInt(_0x815ab7(0x2dc))/0x1*(parseInt(_0x815ab7(0x376))/0x2)+parseInt(_0x815ab7(0x295))/0x3*(-parseInt(_0x815ab7(0x378))/0x4)+parseInt(_0x815ab7(0x33a))/0x5+parseInt(_0x815ab7(0x230))/0x6+parseInt(_0x815ab7(0x1ec))/0x7+-parseInt(_0x815ab7(0x325))/0x8+parseInt(_0x815ab7(0x2e0))/0x9;if(_0x2aae66===_0x66bc76)break;else _0x52329e['push'](_0x52329e['shift']());}catch(_0x39a8cb){_0x52329e['push'](_0x52329e['shift']());}}}(a51_0xf29b,0x3ff91));import a51_0x19af4d from'chalk';import{existsSync}from'fs';import a51_0x4a2e0b 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 a51_0x4a0a66 from'prompts';function getAttemptStatusDisplay(_0x4b60b4){const _0x1dc072=a51_0x1765;if(!_0x4b60b4)return{'icon':'⏳','text':''};const {done:_0x1c57e2,success:_0x4911fc,cancelRequested:_0x19e2c8}=_0x4b60b4;if(!_0x1c57e2)return _0x19e2c8?{'icon':'🛑','text':a51_0x19af4d[_0x1dc072(0x2f8)]('canceling')}:{'icon':'🔄','text':a51_0x19af4d[_0x1dc072(0x361)](_0x1dc072(0x342))};if(_0x4911fc)return{'icon':'✅','text':a51_0x19af4d[_0x1dc072(0x308)](_0x1dc072(0x1f6))};return{'icon':'❌','text':a51_0x19af4d[_0x1dc072(0x26c)](_0x1dc072(0x21c))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x3e4a18(0x31b)](_0x292d8a,_0x2c2a84,_0xe8feae=0x0){return _0x292d8a[_0xe8feae]||_0x2c2a84['workflowProject'];}[a51_0x3e4a18(0x2fb)](_0x396eb0,_0x15128b,_0x238bd2=0x0){const _0x5fba9b=a51_0x3e4a18,_0x3cf37d=this['resolveProject'](_0x396eb0,_0x15128b,_0x238bd2);if(!_0x3cf37d)return console[_0x5fba9b(0x21c)](a51_0x19af4d[_0x5fba9b(0x26c)](_0x5fba9b(0x2cd)),_0x5fba9b(0x306)),console[_0x5fba9b(0x21c)](a51_0x19af4d[_0x5fba9b(0x34d)](_0x5fba9b(0x20f))),null;return _0x3cf37d;}[a51_0x3e4a18(0x2d3)](_0x45d0cb,_0x43e40b){const _0x1bd2b8=a51_0x3e4a18;if(_0x45d0cb[0x0]){const _0x3bda6f=_0x45d0cb[0x0][_0x1bd2b8(0x387)]('.');if(_0x3bda6f[_0x1bd2b8(0x202)]===0x1)return{'projectName':_0x3bda6f[0x0],'workflowName':undefined};else return _0x3bda6f[_0x1bd2b8(0x202)]===0x2?{'projectName':_0x3bda6f[0x0],'workflowName':_0x3bda6f[0x1]}:(console[_0x1bd2b8(0x21c)](a51_0x19af4d[_0x1bd2b8(0x26c)](_0x1bd2b8(0x2cd)),_0x1bd2b8(0x2b4)),null);}return{'projectName':_0x43e40b[_0x1bd2b8(0x22f)],'workflowName':undefined};}['resolveProjectDir'](_0x39e31d,_0x1bf0ed,_0x2a19ca=0x0){const _0xeba48=a51_0x3e4a18;if(_0x39e31d[_0x2a19ca])return _0x39e31d[_0x2a19ca];if(_0x1bf0ed[_0xeba48(0x22f)]){const _0x547799=a51_0x4a2e0b['join'](process[_0xeba48(0x288)](),'workflows',_0x1bf0ed['workflowProject']);if(existsSync(a51_0x4a2e0b[_0xeba48(0x210)](_0x547799,'tdx.json')))return _0x547799;}return undefined;}async[a51_0x3e4a18(0x310)](_0x1d265f,_0xdf79ca,_0x84cdaa){const _0xa9f46=a51_0x3e4a18;try{const _0x10558d=await _0x1d265f['workflow'][_0xa9f46(0x277)](_0xdf79ca,{'limit':0x1});if(_0x10558d[_0xa9f46(0x202)]>0x0){const _0x51634d=_0x10558d[0x0]['id'],_0x587082=getWorkflowUrl(_0x84cdaa,_0x51634d);console[_0xa9f46(0x21c)](_0xa9f46(0x299)+a51_0x19af4d[_0xa9f46(0x241)](_0x587082));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]='workflow:use';[a51_0x3e4a18(0x30b)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a51_0x3e4a18(0x1e9)](_0x2cdb90){const _0x19e4e1=a51_0x3e4a18,{options:_0x2a5fb5,args:_0x355d3d,tdx:_0x5c200f}=_0x2cdb90,_0x3cef16=_0x355d3d[0x0],_0xc41e06=_0x2a5fb5[_0x19e4e1(0x2c8)];if(_0xc41e06)return saveSessionContext({'workflow_project':undefined},_0x2a5fb5[_0x19e4e1(0x28a)]),console[_0x19e4e1(0x1f7)](a51_0x19af4d[_0x19e4e1(0x308)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x3cef16)return console['error'](a51_0x19af4d[_0x19e4e1(0x26c)](_0x19e4e1(0x2cd)),_0x19e4e1(0x306)),console[_0x19e4e1(0x21c)](a51_0x19af4d[_0x19e4e1(0x34d)](_0x19e4e1(0x26d))),console[_0x19e4e1(0x21c)](a51_0x19af4d['dim'](_0x19e4e1(0x1e8))),0x1;const _0x42e191=await withSpinner(_0x19e4e1(0x22d)+_0x3cef16+_0x19e4e1(0x26a),()=>_0x5c200f[_0x19e4e1(0x324)][_0x19e4e1(0x2b6)](_0x3cef16),{'verbose':_0x2a5fb5['verbose']}),{name:_0x276d3e}=_0x42e191[_0x19e4e1(0x2ab)];return saveSessionContext({'workflow_project':_0x276d3e},_0x2a5fb5[_0x19e4e1(0x28a)]),console[_0x19e4e1(0x1f7)](a51_0x19af4d[_0x19e4e1(0x308)](_0x19e4e1(0x2f3)+a51_0x19af4d[_0x19e4e1(0x241)](_0x276d3e))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x2dd);['description']=a51_0x3e4a18(0x25c);async['execute'](_0x3954a0){const _0x4f8926=a51_0x3e4a18,{options:_0x339335,args:_0x212ebc,tdx:_0xc7a170}=_0x3954a0,_0x367535=_0x212ebc[0x0];_0x339335[_0x4f8926(0x380)]&&_0x367535&&console[_0x4f8926(0x21c)](_0x4f8926(0x2ec)+_0x367535);const _0x5e2914=await withSpinner(_0x4f8926(0x1f9),()=>_0xc7a170['workflow']['projects'](_0x367535,{'limit':_0x339335[_0x4f8926(0x32c)]}),{'verbose':_0x339335[_0x4f8926(0x380)]});let _0x256992=_0x5e2914[_0x4f8926(0x2ab)];_0x256992[_0x4f8926(0x316)]((_0x6aba02,_0x47fbb7)=>_0x6aba02['name'][_0x4f8926(0x371)](_0x47fbb7[_0x4f8926(0x35a)]));const _0x340a25=_0x339335[_0x4f8926(0x32c)]||0x64,_0x434782=_0x256992[_0x4f8926(0x202)]>=_0x340a25?a51_0x19af4d[_0x4f8926(0x34d)](_0x4f8926(0x31f)):'';console[_0x4f8926(0x21c)](_0x4f8926(0x365)+_0x256992['length']+_0x4f8926(0x2c7)+(_0x256992[_0x4f8926(0x202)]!==0x1?'s':'')+_0x434782);if(_0x339335[_0x4f8926(0x21d)]==='json'||_0x339335['format']==='jsonl'||_0x339335[_0x4f8926(0x21d)]===_0x4f8926(0x290))await handleSDKOutput(_0x256992,_0x339335);else{if(_0x256992[_0x4f8926(0x202)]===0x0)_0x367535?console[_0x4f8926(0x1f7)](_0x4f8926(0x203)+_0x367535):console['log']('No\x20workflow\x20projects\x20found');else{const _0x383824=_0x256992['map'](_0x28f740=>{const _0x23c697=_0x4f8926,_0x2b8847=_0x28f740[_0x23c697(0x37f)]?.[_0x23c697(0x350)](_0x32a5ec=>_0x32a5ec['key']==='sys'),_0xf0eeba=_0x2b8847?a51_0x19af4d[_0x23c697(0x34d)](_0x23c697(0x258)):'';return _0x23c697(0x2f7)+_0x28f740['name']+_0xf0eeba;});await writeOutput(_0x383824['join']('\x0a'),_0x339335[_0x4f8926(0x2cb)],_0x4f8926(0x244));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x3e4a18(0x34b);[a51_0x3e4a18(0x30b)]='List\x20workflows';async[a51_0x3e4a18(0x1e9)](_0x440e4c){const _0x527bf9=a51_0x3e4a18,{options:_0x41af75,args:_0x288f5a,tdx:_0x521d0c}=_0x440e4c,_0x1b5721=this[_0x527bf9(0x31b)](_0x288f5a,_0x41af75);_0x41af75['verbose']&&_0x1b5721&&console['error'](_0x527bf9(0x320)+_0x1b5721);const _0xf1302=await withSpinner(_0x527bf9(0x1f1),()=>_0x521d0c[_0x527bf9(0x324)]['workflows'](_0x1b5721,{'limit':_0x41af75[_0x527bf9(0x32c)]}),{'verbose':_0x41af75[_0x527bf9(0x380)]});let _0x430865=_0xf1302[_0x527bf9(0x2ab)];_0x430865[_0x527bf9(0x316)]((_0x37437c,_0x29d6bc)=>{const _0x35c651=_0x527bf9,_0x3edc6f=_0x37437c[_0x35c651(0x35a)][_0x35c651(0x371)](_0x29d6bc[_0x35c651(0x35a)]);if(_0x3edc6f!==0x0)return _0x3edc6f;return(_0x37437c[_0x35c651(0x313)]?.[_0x35c651(0x35a)]||'')[_0x35c651(0x371)](_0x29d6bc[_0x35c651(0x313)]?.[_0x35c651(0x35a)]||'');});const _0x146d98=_0x41af75[_0x527bf9(0x32c)]||0x64,_0x5061be=_0x430865['length']>=_0x146d98?a51_0x19af4d[_0x527bf9(0x34d)](_0x527bf9(0x31f)):'';console['error'](_0x527bf9(0x365)+_0x430865['length']+_0x527bf9(0x2bd)+(_0x430865['length']!==0x1?'s':'')+_0x5061be);if(_0x41af75[_0x527bf9(0x21d)]===_0x527bf9(0x28d)||_0x41af75[_0x527bf9(0x21d)]===_0x527bf9(0x356)||_0x41af75[_0x527bf9(0x21d)]===_0x527bf9(0x290))await handleSDKOutput(_0x430865,_0x41af75);else{if(_0x430865['length']===0x0)_0x1b5721?console[_0x527bf9(0x1f7)](_0x527bf9(0x292)+_0x1b5721):console[_0x527bf9(0x1f7)](_0x527bf9(0x25a));else{const _0x2c1f0e=_0x41af75['site'],_0x37fd62=_0x430865[_0x527bf9(0x1fe)](_0x58e0dd=>{const _0x7d1f99=_0x527bf9,_0xc48c3f=a51_0x19af4d[_0x7d1f99(0x34d)]('#'+_0x58e0dd['id']),_0x1b4d24=hyperlink(_0xc48c3f,getWorkflowUrl(_0x2c1f0e,_0x58e0dd['id'])),_0x5ede21=_0x58e0dd[_0x7d1f99(0x313)]?.[_0x7d1f99(0x35a)]?a51_0x19af4d[_0x7d1f99(0x34d)]('\x20('+_0x58e0dd[_0x7d1f99(0x313)][_0x7d1f99(0x35a)]+')'):'';return _0x7d1f99(0x2b2)+_0x1b4d24+'\x20'+_0x58e0dd['name']+_0x5ede21;});await writeOutput(_0x37fd62[_0x527bf9(0x210)]('\x0a'),_0x41af75['output'],_0x527bf9(0x244));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x207);['description']=a51_0x3e4a18(0x2b0);async[a51_0x3e4a18(0x1e9)](_0x444f55){const _0x55c8df=a51_0x3e4a18,{options:_0x2895e6,args:_0x54a637,tdx:_0xd863}=_0x444f55,_0x6925ea=this[_0x55c8df(0x2d3)](_0x54a637,_0x2895e6);if(!_0x6925ea)return 0x1;const {projectName:_0x52e5de,workflowName:_0x1d73dc}=_0x6925ea;if(_0x2895e6[_0x55c8df(0x380)]){if(_0x52e5de&&_0x1d73dc)console[_0x55c8df(0x21c)](_0x55c8df(0x332)+_0x52e5de+'.'+_0x1d73dc);else _0x52e5de&&console[_0x55c8df(0x21c)]('Filter:\x20project='+_0x52e5de);const _0x11a451=_0x2895e6['status'];_0x11a451&&console[_0x55c8df(0x21c)]('Status:\x20'+_0x11a451);}let _0x2a6f8f=0x28;if(process[_0x55c8df(0x31c)][_0x55c8df(0x312)]&&!_0x2895e6[_0x55c8df(0x2cb)]&&!_0x2895e6[_0x55c8df(0x21d)]){const _0x5cb9a6=process[_0x55c8df(0x31c)][_0x55c8df(0x309)]||0x28;_0x2a6f8f=Math[_0x55c8df(0x201)](0x14,Math[_0x55c8df(0x24d)](_0x5cb9a6*0x2/0x3));}const _0x4252a5=_0x2895e6['limit']||_0x2a6f8f,_0x6d6c96=await withSpinner(_0x55c8df(0x35f),()=>_0xd863['workflow'][_0x55c8df(0x2a4)]({'projectName':_0x52e5de,'workflowName':_0x1d73dc,'status':_0x2895e6[_0x55c8df(0x2b8)],'fromTime':_0x2895e6[_0x55c8df(0x2cf)],'toTime':_0x2895e6['to'],'limit':_0x4252a5}),{'verbose':_0x2895e6[_0x55c8df(0x380)]}),_0x4b4e48=_0x6d6c96[_0x55c8df(0x2ab)];_0x4b4e48[_0x55c8df(0x316)]((_0x143edd,_0x4bade3)=>{const _0x587606=_0x55c8df,_0x1dd655=_0x143edd[_0x587606(0x237)]||'',_0x27b2d9=_0x4bade3[_0x587606(0x237)]||'';return _0x27b2d9['localeCompare'](_0x1dd655);});_0x4b4e48[_0x55c8df(0x202)]>=_0x4252a5?console[_0x55c8df(0x21c)](_0x55c8df(0x33e)+_0x4b4e48[_0x55c8df(0x202)]+_0x55c8df(0x217)+a51_0x19af4d[_0x55c8df(0x34d)](_0x55c8df(0x2e7))):console['error'](_0x55c8df(0x365)+_0x4b4e48[_0x55c8df(0x202)]+_0x55c8df(0x285)+(_0x4b4e48[_0x55c8df(0x202)]!==0x1?'s':''));if(_0x2895e6['format']===_0x55c8df(0x28d)||_0x2895e6['format']===_0x55c8df(0x356)||_0x2895e6[_0x55c8df(0x21d)]===_0x55c8df(0x290))await handleSDKOutput(_0x4b4e48,_0x2895e6);else{if(!process[_0x55c8df(0x31c)][_0x55c8df(0x312)]||_0x2895e6[_0x55c8df(0x2cb)]){if(_0x4b4e48[_0x55c8df(0x202)]===0x0){if(_0x52e5de&&_0x1d73dc)console[_0x55c8df(0x1f7)](_0x55c8df(0x377)+_0x52e5de+'.'+_0x1d73dc);else _0x52e5de?console[_0x55c8df(0x1f7)](_0x55c8df(0x346)+_0x52e5de):console[_0x55c8df(0x1f7)](_0x55c8df(0x2e4));}else{const _0x16fdfa=_0x2895e6['site'],_0x52a14b=this[_0x55c8df(0x2a0)](_0x4b4e48,_0x16fdfa);_0x2895e6[_0x55c8df(0x2cb)]?await writeOutput(_0x52a14b,_0x2895e6[_0x55c8df(0x2cb)],_0x55c8df(0x244)):console[_0x55c8df(0x1f7)](_0x52a14b);}!_0x52e5de&&(console[_0x55c8df(0x21c)](''),console[_0x55c8df(0x21c)](a51_0x19af4d['dim'](_0x55c8df(0x337))),console[_0x55c8df(0x21c)](a51_0x19af4d['dim'](_0x55c8df(0x246))+'or'+a51_0x19af4d[_0x55c8df(0x34d)](_0x55c8df(0x281))));}else{if(_0x4b4e48[_0x55c8df(0x202)]===0x0){if(_0x52e5de&&_0x1d73dc)console[_0x55c8df(0x1f7)](_0x55c8df(0x377)+_0x52e5de+'.'+_0x1d73dc);else _0x52e5de?console[_0x55c8df(0x1f7)](_0x55c8df(0x346)+_0x52e5de):console[_0x55c8df(0x1f7)](_0x55c8df(0x2e4));}else await this['navigateSessionsInteractive'](_0x4b4e48,_0x444f55,_0x52e5de);}}return 0x0;}['renderSessionsTimeline'](_0x2595b9,_0x35a5c1){const _0x24d659=a51_0x3e4a18,_0x1a6659=[],_0x252382=new Map();let _0x201320=Infinity,_0x246e62=-Infinity;for(const _0x95c6b9 of _0x2595b9){if(_0x95c6b9[_0x24d659(0x352)]?.[_0x24d659(0x32b)]){const _0x40c37e=new Date(_0x95c6b9[_0x24d659(0x352)][_0x24d659(0x32b)])[_0x24d659(0x226)](),_0x14532b=_0x95c6b9['lastAttempt'][_0x24d659(0x32d)]?new Date(_0x95c6b9[_0x24d659(0x352)][_0x24d659(0x32d)])[_0x24d659(0x226)]():Date[_0x24d659(0x302)](),_0x444f96=_0x95c6b9[_0x24d659(0x313)]?.[_0x24d659(0x35a)]||_0x24d659(0x2fd);!_0x252382[_0x24d659(0x1fb)](_0x444f96)&&_0x252382['set'](_0x444f96,[]),_0x252382[_0x24d659(0x2ac)](_0x444f96)[_0x24d659(0x331)]({'session':_0x95c6b9,'startTime':_0x40c37e,'endTime':_0x14532b,'duration':_0x14532b-_0x40c37e}),_0x201320=Math[_0x24d659(0x23a)](_0x201320,_0x40c37e),_0x246e62=Math[_0x24d659(0x201)](_0x246e62,_0x14532b);}}if(_0x252382['size']===0x0)return _0x24d659(0x24a);const _0xf23a60=process[_0x24d659(0x31c)][_0x24d659(0x23f)]||0x78,_0x2a2310=0x1e,_0x5187ee=0x32,_0x11f282=0x4,_0x2be602=Math[_0x24d659(0x23a)](_0x5187ee,Math[_0x24d659(0x201)](_0x2a2310,Math[_0x24d659(0x24d)](_0xf23a60*0.3))),_0x2939c6=_0xf23a60-_0x2be602-TIMELINE_CONFIG[_0x24d659(0x289)]-0x3-_0x11f282,_0x41f0bd=_0x246e62-_0x201320,_0x209780=_0x41f0bd/_0x2be602,_0x151251=renderTimeAxis({'startTime':_0x201320,'endTime':_0x246e62,'durationMs':_0x41f0bd,'msPerChar':_0x209780},_0x2be602),_0x383856=[];for(const _0x5326ea of _0x252382[_0x24d659(0x1fa)]()){_0x383856[_0x24d659(0x331)](..._0x5326ea);}_0x383856[_0x24d659(0x316)]((_0x3ae908,_0x3b1527)=>_0x3b1527[_0x24d659(0x30f)]-_0x3ae908[_0x24d659(0x30f)]);const _0x2a3e1a=new Date(_0x201320),_0x44132e=formatDate(_0x2a3e1a),_0x42cda0=_0x11f282+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x24d659(0x272)]+_0x2939c6,_0x432fd5='\x20'[_0x24d659(0x255)](_0x42cda0-_0x44132e[_0x24d659(0x202)]),_0x15ed47=_0x432fd5+a51_0x19af4d[_0x24d659(0x34d)](_0x44132e)+'\x20'+_0x151251;_0x1a6659[_0x24d659(0x331)](_0x15ed47);const _0x358a5a=0x16;let _0x1b9a88=0x0;for(const _0x37f2a4 of _0x383856){const _0x1d99cb=_0x37f2a4['session'][_0x24d659(0x313)]?.[_0x24d659(0x35a)]||'?',_0xdf9f53=Math[_0x24d659(0x23a)](stringWidth(_0x1d99cb),_0x358a5a);_0x1b9a88=Math[_0x24d659(0x201)](_0x1b9a88,_0xdf9f53);}for(const _0x51a96c of _0x383856){const {session:_0x5421b0,startTime:_0x445702,endTime:_0x481b23,duration:_0x4ebd94}=_0x51a96c,_0x194ade=_0x5421b0[_0x24d659(0x313)]?.['id'],_0x56e009=_0x5421b0['id'],_0x2aee0f=_0x5421b0['project']?.[_0x24d659(0x35a)]||'?',_0x216a80=_0x5421b0[_0x24d659(0x324)]?.['name']||'?';let _0x532863,_0x44e25d;if(_0x5421b0['lastAttempt']){const _0x315969=_0x5421b0['lastAttempt'];!_0x315969['done']?(_0x532863=_0x315969[_0x24d659(0x340)]?'🛑':'🔄',_0x44e25d=_0x315969[_0x24d659(0x340)]?a51_0x19af4d[_0x24d659(0x2f8)]:a51_0x19af4d[_0x24d659(0x361)]):(_0x532863=_0x315969[_0x24d659(0x1f6)]?'✅':'❌',_0x44e25d=_0x315969[_0x24d659(0x1f6)]?a51_0x19af4d[_0x24d659(0x308)]:a51_0x19af4d[_0x24d659(0x26c)]);}else _0x532863='⏳',_0x44e25d=a51_0x19af4d[_0x24d659(0x34d)];const _0x109e11='#'+_0x56e009,_0x24512f=_0x194ade?hyperlink(_0x109e11,getWorkflowSessionUrl(_0x35a5c1,_0x194ade,_0x56e009)):_0x109e11;let _0x1187c7=_0x2aee0f;stringWidth(_0x2aee0f)>_0x358a5a&&(_0x1187c7=_0x2aee0f['slice'](0x0,_0x358a5a-0x1)+'…');const _0x4d6702=a51_0x19af4d[_0x24d659(0x34d)](_0x1187c7),_0x50aafd=stringWidth(_0x1187c7),_0x15a05d='\x20'[_0x24d659(0x255)](_0x1b9a88-stringWidth(_0x1187c7)+0x2),_0x4b2e21='('+formatElapsed(_0x4ebd94)+')',_0x26fcdf=stringWidth(_0x4b2e21),_0x33784a=stringWidth(_0x109e11),_0x586237=_0x33784a+0x1+_0x50aafd+_0x15a05d[_0x24d659(0x202)],_0x1b866a=_0x2939c6-_0x586237-_0x26fcdf-0x1-0x8;let _0x3b1ed7=_0x216a80;stringWidth(_0x3b1ed7)>_0x1b866a&&(_0x3b1ed7=_0x3b1ed7[_0x24d659(0x26b)](0x0,_0x1b866a-0x1)+'…');const _0x398438=_0x24512f+'\x20'+_0x4d6702+_0x15a05d+_0x3b1ed7,_0x1b353c=stringWidth(_0x398438),_0x58996a=_0x2939c6-_0x1b353c-_0x26fcdf,_0x6c28f2=_0x398438+'\x20'['repeat'](Math['max'](0x1,_0x58996a))+a51_0x19af4d[_0x24d659(0x34d)](_0x4b2e21),_0x54b98a=Math['floor']((_0x445702-_0x201320)/_0x209780),_0x59bb42=Math[_0x24d659(0x24d)]((_0x481b23-_0x201320)/_0x209780),_0x2734a6=Math[_0x24d659(0x201)](_0x54b98a+0x1,_0x59bb42),_0x5d40c5=new Array(_0x2be602)['fill']('\x20');for(let _0x570870=_0x54b98a;_0x570870<Math[_0x24d659(0x23a)](_0x2734a6,_0x2be602);_0x570870++){_0x5d40c5[_0x570870]='─';}const _0x10a98a=_0x5d40c5[_0x24d659(0x1fe)](_0x12f2a9=>_0x12f2a9==='\x20'?'\x20':_0x44e25d(_0x12f2a9))['join']('');_0x1a6659[_0x24d659(0x331)](_0x532863+'\x20'+_0x6c28f2+'│'+_0x10a98a+'│');}return _0x1a6659[_0x24d659(0x210)]('\x0a');}async[a51_0x3e4a18(0x2f2)](_0x91d6cd,_0x226b99,_0x341962){const _0x3a9f3e=a51_0x3e4a18,{options:_0xfe7a10,tdx:_0x365b8a}=_0x226b99,_0xd78dd6=_0xfe7a10['site'],{timelineRows:_0x2bc4a3,timeAxisHeader:_0xbe45f6}=this['generateSessionTimelineRows'](_0x91d6cd,_0xd78dd6),_0x2154df=_0x2bc4a3[_0x3a9f3e(0x26f)](_0x506ba8=>_0x506ba8[_0x3a9f3e(0x269)]);if(_0x2154df[_0x3a9f3e(0x202)]===0x0){const _0x1e3242=this['renderSessionsTimeline'](_0x91d6cd,_0xd78dd6);console['log'](_0x1e3242);!_0x341962&&(console[_0x3a9f3e(0x21c)](''),console[_0x3a9f3e(0x21c)](a51_0x19af4d[_0x3a9f3e(0x34d)](_0x3a9f3e(0x337))),console[_0x3a9f3e(0x21c)](a51_0x19af4d['dim'](_0x3a9f3e(0x246))+'or'+a51_0x19af4d[_0x3a9f3e(0x34d)](_0x3a9f3e(0x281))));return;}_0xbe45f6&&console[_0x3a9f3e(0x1f7)](_0xbe45f6);const _0x4c6aaa=_0x2bc4a3['filter'](_0x189f3f=>_0x189f3f[_0x3a9f3e(0x269)])['map'](_0x312ba2=>({'title':_0x312ba2[_0x3a9f3e(0x30c)],'value':_0x312ba2[_0x3a9f3e(0x269)]})),_0x5a04d5=process[_0x3a9f3e(0x31c)][_0x3a9f3e(0x309)]||0x3c,_0x41b5a5=Math[_0x3a9f3e(0x201)](0x28,Math['floor'](_0x5a04d5*0x2/0x3)),_0x4c0c32=await a51_0x4a0a66({'type':_0x3a9f3e(0x1f0),'name':_0x3a9f3e(0x269),'message':_0x3a9f3e(0x36d),'choices':_0x4c6aaa,'initial':-0x1,'limit':_0x41b5a5,'clearFirst':!![],'fallback':{'title':_0x3a9f3e(0x1f5),'value':null},'suggest':(_0x6b6c59,_0x1fecd9)=>{const _0x4af3b6=_0x3a9f3e;if(!_0x6b6c59)return Promise[_0x4af3b6(0x2d0)](_0x1fecd9);const _0x3b686f=_0x1fecd9['filter'](_0x422fdb=>{const _0x5b4706=_0x4af3b6,_0x3b1fdd=_0x422fdb;return _0x3b1fdd[_0x5b4706(0x27a)]['toLowerCase']()[_0x5b4706(0x2ed)](_0x6b6c59[_0x5b4706(0x1f2)]());});return Promise[_0x4af3b6(0x2d0)](_0x3b686f);}}),_0x29c50b=()=>{const _0x6f8d7=_0x3a9f3e;process[_0x6f8d7(0x31c)][_0x6f8d7(0x261)](_0x6f8d7(0x247)),process[_0x6f8d7(0x31c)][_0x6f8d7(0x261)](_0x6f8d7(0x247)),process[_0x6f8d7(0x31c)]['write']('\x1b[1A\x1b[2K');},_0x5eb8e0=_0x4c0c32&&_0x4c0c32['attemptId']&&_0x4c0c32[_0x3a9f3e(0x269)]!==null&&_0x4c0c32['attemptId'][_0x3a9f3e(0x2cc)]()!=='';if(!_0x5eb8e0){_0x29c50b(),console[_0x3a9f3e(0x1f7)](a51_0x19af4d['dim'](_0x3a9f3e(0x209)));return;}_0x29c50b();const _0x7d21d0=_0x91d6cd['find'](_0x1a008f=>_0x1a008f[_0x3a9f3e(0x352)]?.['id']===_0x4c0c32[_0x3a9f3e(0x269)]);if(_0x7d21d0){const _0x124c04=_0x7d21d0[_0x3a9f3e(0x313)]?.['name']||'?',_0x27d70d=_0x7d21d0[_0x3a9f3e(0x324)]?.[_0x3a9f3e(0x35a)]||'?';console['log'](_0x3a9f3e(0x314)+a51_0x19af4d[_0x3a9f3e(0x34d)](_0x124c04)+',\x20Workflow:\x20'+a51_0x19af4d['dim'](_0x27d70d));}const _0x24ebc7=new WorkflowTimelineCommand();await _0x24ebc7[_0x3a9f3e(0x1e9)]({'args':[],'options':{..._0xfe7a10,'attemptId':_0x4c0c32[_0x3a9f3e(0x269)]},'tdx':_0x365b8a});}[a51_0x3e4a18(0x32a)](_0x13060b,_0x5bc231){const _0x45ba1a=a51_0x3e4a18,_0xfc8f3d=new Map();for(const _0x210793 of _0x13060b){_0x210793['id']&&_0x210793[_0x45ba1a(0x352)]?.['id']&&_0xfc8f3d[_0x45ba1a(0x35e)](_0x210793['id'],_0x210793[_0x45ba1a(0x352)]['id']);}const _0x451104=[];let _0x4ff998='';const _0x22bb3f=this[_0x45ba1a(0x2a0)](_0x13060b,_0x5bc231),_0x1a181e=_0x22bb3f[_0x45ba1a(0x387)]('\x0a');for(const _0x1426d4 of _0x1a181e){if(_0x1426d4[_0x45ba1a(0x256)](_0x45ba1a(0x1f4))||_0x1426d4[_0x45ba1a(0x23e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x4ff998=_0x1426d4;else{if(_0x1426d4[_0x45ba1a(0x23e)](/^[✅❌🔄🛑⏳]/)){const _0x106598=_0x1426d4['match'](/#(\d+)/),_0x1fb566=_0x106598?_0x106598[0x1]:null,_0x473289=_0x1fb566?_0xfc8f3d[_0x45ba1a(0x2ac)](_0x1fb566)||null:null,_0x35d7b3=_0x13060b[_0x45ba1a(0x2c3)](_0x3b27d5=>_0x3b27d5['id']===_0x1fb566),_0x26fb10=_0x35d7b3?.['project']?.[_0x45ba1a(0x35a)]||'';_0x451104['push']({'displayLine':_0x1426d4,'attemptId':_0x473289,'projectName':_0x26fb10});}}}return{'timelineRows':_0x451104,'timeAxisHeader':_0x4ff998};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x362);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x379);async[a51_0x3e4a18(0x1e9)](_0x3b0b03){const _0xdb864d=a51_0x3e4a18,{options:_0x382d19,args:_0x4dc045,tdx:_0x3235d3}=_0x3b0b03,_0x37efac=this['parseProjectWorkflowPattern'](_0x4dc045,_0x382d19);if(!_0x37efac)return 0x1;const {projectName:_0x35ebe9,workflowName:_0x3a602b}=_0x37efac,_0x541d6b=_0x382d19[_0xdb864d(0x220)];if(_0x382d19['verbose']){if(_0x35ebe9&&_0x3a602b)console[_0xdb864d(0x21c)](_0xdb864d(0x332)+_0x35ebe9+'.'+_0x3a602b);else _0x35ebe9&&console['error'](_0xdb864d(0x221)+_0x35ebe9);_0x541d6b&&console[_0xdb864d(0x21c)]('Include\x20retried:\x20yes');}const _0x470b70=await withSpinner(_0xdb864d(0x374),()=>_0x3235d3['workflow'][_0xdb864d(0x2a2)]({'projectName':_0x35ebe9,'workflowName':_0x3a602b,'includeRetried':_0x541d6b,'limit':_0x382d19[_0xdb864d(0x32c)]}),{'verbose':_0x382d19['verbose']}),_0x41df27=_0x470b70[_0xdb864d(0x2ab)],_0x13e8bc=_0x382d19[_0xdb864d(0x32c)]||0x64,_0x16e047=_0x41df27[_0xdb864d(0x202)]>=_0x13e8bc?a51_0x19af4d[_0xdb864d(0x34d)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0xdb864d(0x21c)](_0xdb864d(0x365)+_0x41df27[_0xdb864d(0x202)]+'\x20attempt'+(_0x41df27[_0xdb864d(0x202)]!==0x1?'s':'')+_0x16e047);if(_0x382d19['format']===_0xdb864d(0x28d)||_0x382d19[_0xdb864d(0x21d)]===_0xdb864d(0x356)||_0x382d19[_0xdb864d(0x21d)]===_0xdb864d(0x290))await handleSDKOutput(_0x41df27,_0x382d19);else{if(_0x41df27[_0xdb864d(0x202)]===0x0){if(_0x35ebe9&&_0x3a602b)console[_0xdb864d(0x1f7)]('No\x20attempts\x20found\x20for:\x20'+_0x35ebe9+'.'+_0x3a602b);else _0x35ebe9?console[_0xdb864d(0x1f7)](_0xdb864d(0x36e)+_0x35ebe9):console[_0xdb864d(0x1f7)]('No\x20attempts\x20found');}else{const _0x2b90bc=_0x382d19[_0xdb864d(0x336)],_0x51dea9=_0x41df27[_0xdb864d(0x1fe)](_0xb06378=>{const _0x156581=_0xdb864d,_0x113387=a51_0x19af4d[_0x156581(0x34d)]('#'+_0xb06378['id']),_0x49d84d=_0xb06378[_0x156581(0x313)]?.['id'],_0x4fc9ad=_0xb06378[_0x156581(0x22a)]||_0xb06378[_0x156581(0x355)],_0x14dbd4=_0x49d84d&&_0x4fc9ad?hyperlink(_0x113387,getWorkflowAttemptUrl(_0x2b90bc,_0x49d84d,_0x4fc9ad,_0xb06378['id'])):_0x113387,{icon:_0xc748ac,text:_0xb55c15}=getAttemptStatusDisplay(_0xb06378),_0x46407f=(_0xb06378[_0x156581(0x313)]?.[_0x156581(0x35a)]||'?')+'.'+(_0xb06378[_0x156581(0x324)]?.[_0x156581(0x35a)]||'?'),_0x48a611=_0xb06378[_0x156581(0x237)]?a51_0x19af4d['dim'](_0xb06378[_0x156581(0x237)]):'';return(_0x14dbd4+'\x20'+_0xc748ac+(_0xb55c15?'\x20'+_0xb55c15:'')+'\x20'+_0x46407f+'\x20'+_0x48a611)['trimEnd']();});await writeOutput(_0x51dea9[_0xdb864d(0x210)]('\x0a'),_0x382d19[_0xdb864d(0x2cb)],_0xdb864d(0x244));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]='workflow:attempt';[a51_0x3e4a18(0x30b)]='Show\x20specific\x20attempt\x20details';async[a51_0x3e4a18(0x1e9)](_0x115343){const _0x429f7c=a51_0x3e4a18,{options:_0x49cf79,args:_0x57d385,tdx:_0x1a8345}=_0x115343,_0x2aff6f=_0x57d385[0x0];if(!_0x2aff6f)return console[_0x429f7c(0x21c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x49cf79['verbose']&&console[_0x429f7c(0x21c)](_0x429f7c(0x27f)+_0x2aff6f);const _0x29d606=await withSpinner(_0x429f7c(0x204),()=>_0x1a8345[_0x429f7c(0x324)][_0x429f7c(0x231)](_0x2aff6f),{'verbose':_0x49cf79[_0x429f7c(0x380)]}),_0xc7747d=_0x29d606[_0x429f7c(0x2ab)];let _0x5d99c9;!_0xc7747d[_0x429f7c(0x26e)]?_0x5d99c9=_0xc7747d[_0x429f7c(0x340)]?'canceling':_0x429f7c(0x342):_0x5d99c9=_0xc7747d[_0x429f7c(0x1f6)]?'success':_0x429f7c(0x21c);let _0x13e86f;if(_0xc7747d[_0x429f7c(0x32b)]&&_0xc7747d[_0x429f7c(0x32d)]){const _0x53b918=new Date(_0xc7747d[_0x429f7c(0x32b)])[_0x429f7c(0x226)](),_0x5dc5a3=new Date(_0xc7747d['finishedAt'])[_0x429f7c(0x226)]();_0x13e86f=Math['round']((_0x5dc5a3-_0x53b918)/0x3e8);}const _0x2a437c={'attempt_id':_0xc7747d['id'],'status':_0x5d99c9,..._0xc7747d[_0x429f7c(0x29f)]!==undefined&&{'index':_0xc7747d[_0x429f7c(0x29f)]},..._0xc7747d['project']&&{'project':_0xc7747d['project'][_0x429f7c(0x35a)]},..._0xc7747d['workflow']&&{'workflow':_0xc7747d['workflow'][_0x429f7c(0x35a)]},..._0xc7747d['sessionId']&&{'session_id':_0xc7747d[_0x429f7c(0x355)]},..._0xc7747d['sessionTime']&&{'session_time':_0xc7747d['sessionTime']},..._0xc7747d['retryAttemptName']&&{'retry_attempt':_0xc7747d[_0x429f7c(0x341)]},..._0x13e86f!==undefined&&{'duration_sec':_0x13e86f},..._0xc7747d['createdAt']&&{'created_at':_0xc7747d[_0x429f7c(0x32b)]},..._0xc7747d[_0x429f7c(0x32d)]&&{'finished_at':_0xc7747d[_0x429f7c(0x32d)]},...Object['keys'](_0xc7747d[_0x429f7c(0x321)])[_0x429f7c(0x202)]>0x0&&{'params':_0xc7747d[_0x429f7c(0x321)]}};return await handleSingleObjectOutput(_0x2a437c,_0x49cf79),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x2f6);['description']=a51_0x3e4a18(0x2e6);async[a51_0x3e4a18(0x1e9)](_0x1485e0){const _0x6a31bd=a51_0x3e4a18,{options:_0x17d22f,args:_0x378f47,tdx:_0x4a9d07}=_0x1485e0,_0x19efc5=_0x378f47[0x0];if(!_0x19efc5)return console[_0x6a31bd(0x21c)](_0x6a31bd(0x1ed)),0x1;const _0xadbbf0=_0x17d22f['includeSubtasks'];_0x17d22f[_0x6a31bd(0x380)]&&(console[_0x6a31bd(0x21c)](_0x6a31bd(0x27f)+_0x19efc5),_0xadbbf0&&console[_0x6a31bd(0x21c)]('Including\x20subtasks:\x20yes'));const _0xedc98a=await withSpinner(_0x6a31bd(0x216),()=>_0x4a9d07[_0x6a31bd(0x324)][_0x6a31bd(0x20e)](_0x19efc5,_0xadbbf0||![]),{'verbose':_0x17d22f['verbose']}),_0xff1dcc=_0xedc98a[_0x6a31bd(0x2ab)];return console[_0x6a31bd(0x21c)](_0x6a31bd(0x365)+_0xff1dcc[_0x6a31bd(0x202)]+'\x20task'+(_0xff1dcc[_0x6a31bd(0x202)]!==0x1?'s':'')),await handleSDKOutput(_0xff1dcc,_0x17d22f),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x24f);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x2c6);async[a51_0x3e4a18(0x1e9)](_0x41b49f){const _0x19ab83=a51_0x3e4a18,{options:_0x534714,args:_0x23f359,tdx:_0x5e82b8}=_0x41b49f,_0x1f3b79=_0x23f359[0x0];let _0x1d855e=_0x23f359[0x1];if(!_0x1f3b79)return console['error'](_0x19ab83(0x1ed)),0x1;_0x534714['verbose']&&(console[_0x19ab83(0x21c)](_0x19ab83(0x27f)+_0x1f3b79),_0x1d855e&&console[_0x19ab83(0x21c)]('Task\x20name:\x20'+_0x1d855e));const _0x32a0d1=await withSpinner(_0x19ab83(0x32f),()=>_0x5e82b8['workflow'][_0x19ab83(0x382)](_0x1f3b79,_0x1d855e),{'verbose':_0x534714[_0x19ab83(0x380)]}),_0x3e32db=_0x32a0d1[_0x19ab83(0x2ab)];if(_0x3e32db[_0x19ab83(0x202)]===0x0)return console[_0x19ab83(0x21c)](_0x19ab83(0x344)),0x0;if(!_0x1d855e&&(_0x534714['json']||_0x534714[_0x19ab83(0x21d)]))return await handleSDKOutput(_0x3e32db,_0x534714),0x0;if(!_0x1d855e){const _0x5e992b=_0x3e32db[_0x19ab83(0x1fe)](_0x421724=>({'title':_0x421724[_0x19ab83(0x2fe)]+'\x20('+formatBytes(_0x421724[_0x19ab83(0x366)])+')','value':_0x421724[_0x19ab83(0x2fe)]})),_0x50defc=await a51_0x4a0a66({'type':_0x19ab83(0x33c),'name':'task','message':_0x19ab83(0x286),'choices':_0x5e992b});if(!_0x50defc[_0x19ab83(0x27d)])return console[_0x19ab83(0x21c)](_0x19ab83(0x209)),0x0;_0x1d855e=_0x50defc[_0x19ab83(0x27d)];}const _0x4f609a=await withSpinner(_0x19ab83(0x212),()=>_0x5e82b8[_0x19ab83(0x324)][_0x19ab83(0x370)](_0x1f3b79,_0x1d855e),{'verbose':_0x534714[_0x19ab83(0x380)]}),_0x2fca24=_0x4f609a[_0x19ab83(0x2ab)];return _0x2fca24?console[_0x19ab83(0x1f7)](_0x2fca24):console['error'](_0x19ab83(0x20a)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x2eb);[a51_0x3e4a18(0x30b)]='Kill\x20a\x20running\x20attempt';async[a51_0x3e4a18(0x1e9)](_0x10eb4b){const _0x2b5993=a51_0x3e4a18,{options:_0x3ed92e,args:_0x23d0c6,tdx:_0x5d1784}=_0x10eb4b,_0x1c4468=_0x23d0c6[0x0];if(!_0x1c4468)return console[_0x2b5993(0x21c)](_0x2b5993(0x1ed)),0x1;const _0x318043=_0x3ed92e[_0x2b5993(0x347)];_0x3ed92e[_0x2b5993(0x380)]&&(console[_0x2b5993(0x21c)](_0x2b5993(0x27f)+_0x1c4468),_0x318043&&console[_0x2b5993(0x21c)]('Reason:\x20'+_0x318043));if(!_0x3ed92e[_0x2b5993(0x242)]){if(!isInteractive())return console[_0x2b5993(0x21c)](a51_0x19af4d['red'](_0x2b5993(0x293)),_0x2b5993(0x218)),console[_0x2b5993(0x21c)](a51_0x19af4d[_0x2b5993(0x34d)](_0x2b5993(0x276))),0x1;const _0x52a4d8=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x1c4468+'?');if(!_0x52a4d8)return console[_0x2b5993(0x21c)](a51_0x19af4d[_0x2b5993(0x2f8)]('Cancelled')),0x1;}const _0x40e4fb=await withSpinner(_0x2b5993(0x267),()=>_0x5d1784[_0x2b5993(0x324)][_0x2b5993(0x257)](_0x1c4468,_0x318043),{'verbose':_0x3ed92e[_0x2b5993(0x380)]}),_0x36d86b=_0x40e4fb[_0x2b5993(0x2ab)];return console[_0x2b5993(0x21c)]('✔\x20'+_0x36d86b),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x2f9);['description']='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x3e4a18(0x1e9)](_0x1a195f){const _0x148631=a51_0x3e4a18,{options:_0x169c95,args:_0x12dac1,tdx:_0x3c8d2d}=_0x1a195f,_0x15c68e=_0x12dac1[0x0];if(!_0x15c68e)return console[_0x148631(0x21c)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x148631(0x21c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x223b68=![],_0x15324a=_0x15c68e;if(_0x15c68e['startsWith'](_0x148631(0x275)))_0x223b68=!![],_0x15324a=_0x15c68e[_0x148631(0x29d)](0x8);else{if(_0x15c68e[_0x148631(0x256)](_0x148631(0x357)))_0x223b68=![],_0x15324a=_0x15c68e['substring'](0x8);else return console['error'](_0x148631(0x334)),console['error'](_0x148631(0x2d9)),0x1;}const _0x366621=_0x169c95[_0x148631(0x25f)],_0x31aa43=_0x169c95['resumeFrom'],_0x56ba54=_0x169c95[_0x148631(0x321)],_0x58b5d0=_0x169c95[_0x148631(0x205)];_0x169c95[_0x148631(0x380)]&&(console[_0x148631(0x21c)]('Target:\x20'+(_0x223b68?_0x148631(0x28a):_0x148631(0x231))+'\x20'+_0x15324a),_0x366621&&console[_0x148631(0x21c)](_0x148631(0x2a6)+_0x366621),_0x31aa43&&console[_0x148631(0x21c)](_0x148631(0x211)+_0x31aa43),_0x56ba54&&console[_0x148631(0x21c)]('Params:\x20'+_0x56ba54),_0x58b5d0&&console[_0x148631(0x21c)](_0x148631(0x32e)));let _0xf7a4f0;if(_0x56ba54)try{if(_0x56ba54['startsWith']('@')){const _0x36c312=await import(_0x148631(0x243)),_0x1c3bc2=_0x56ba54['substring'](0x1),_0x5bdaad=await _0x36c312[_0x148631(0x2e2)](_0x1c3bc2,_0x148631(0x372));_0xf7a4f0=JSON[_0x148631(0x303)](_0x5bdaad);}else _0xf7a4f0=JSON['parse'](_0x56ba54);}catch{return console[_0x148631(0x21c)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x169c95[_0x148631(0x242)]){if(!isInteractive())return console[_0x148631(0x21c)](a51_0x19af4d[_0x148631(0x26c)](_0x148631(0x293)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x148631(0x21c)](a51_0x19af4d['dim'](_0x148631(0x276))),0x1;const _0x4fc05d=await confirmKey(_0x148631(0x359)+(_0x223b68?_0x148631(0x28a):'attempt')+'\x20'+_0x15324a+'?');if(!_0x4fc05d)return console[_0x148631(0x21c)](a51_0x19af4d[_0x148631(0x2f8)](_0x148631(0x209))),0x1;}let _0x1aba7d;_0x223b68?_0x1aba7d=await withSpinner('Retrying\x20session...',()=>_0x3c8d2d['workflow']['retrySession'](_0x15324a,{'fromTask':_0x366621,'retryParams':_0xf7a4f0}),{'verbose':_0x169c95['verbose']}):_0x1aba7d=await withSpinner(_0x148631(0x279),()=>_0x3c8d2d[_0x148631(0x324)][_0x148631(0x36a)](_0x15324a,{'resumeFrom':_0x31aa43,'retryParams':_0xf7a4f0,'force':_0x58b5d0}),{'verbose':_0x169c95[_0x148631(0x380)]});const _0x1abcee=_0x1aba7d['data'];return console[_0x148631(0x21c)](_0x148631(0x37b)),console[_0x148631(0x21c)](_0x148631(0x25d)+_0x1abcee['attemptId']),console[_0x148631(0x21c)](_0x148631(0x22c)+_0x1abcee[_0x148631(0x355)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x30a);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x1fd);async[a51_0x3e4a18(0x1e9)](_0x5261f0){const _0x1b72ec=a51_0x3e4a18,{options:_0x51215f,args:_0x51887b,tdx:_0x40109c}=_0x5261f0;let _0x5a53c6=_0x51887b[0x0];if(!_0x5a53c6){const _0x3690d4=this['resolveProject']([],_0x51215f),_0x315947=await withSpinner('Loading\x20workflows...',()=>_0x40109c[_0x1b72ec(0x324)][_0x1b72ec(0x277)](_0x3690d4,{'limit':_0x51215f[_0x1b72ec(0x32c)]}),{'verbose':_0x51215f[_0x1b72ec(0x380)]}),_0x24f792=_0x315947[_0x1b72ec(0x2ab)];if(_0x24f792[_0x1b72ec(0x202)]===0x0)return console[_0x1b72ec(0x21c)](_0x1b72ec(0x25a)),!_0x3690d4&&console[_0x1b72ec(0x21c)](a51_0x19af4d[_0x1b72ec(0x34d)](_0x1b72ec(0x20f))),0x1;const _0x466acb=_0x24f792[_0x1b72ec(0x1fe)](_0xfec047=>({'title':_0xfec047['project']?.[_0x1b72ec(0x35a)]+'.'+_0xfec047[_0x1b72ec(0x35a)],'value':_0xfec047[_0x1b72ec(0x313)]?.[_0x1b72ec(0x35a)]+'.'+_0xfec047[_0x1b72ec(0x35a)],'description':_0xfec047[_0x1b72ec(0x239)]?'revision:\x20'+_0xfec047[_0x1b72ec(0x239)]:undefined})),_0x114358=await a51_0x4a0a66({'type':_0x1b72ec(0x33c),'name':_0x1b72ec(0x324),'message':_0x1b72ec(0x20c),'choices':_0x466acb});if(!_0x114358[_0x1b72ec(0x324)])return 0x1;_0x5a53c6=_0x114358[_0x1b72ec(0x324)];}if(!_0x5a53c6[_0x1b72ec(0x2ed)]('.')){const _0x17d895=this[_0x1b72ec(0x31b)]([],_0x51215f);if(_0x17d895)_0x5a53c6=_0x17d895+'.'+_0x5a53c6;else return console[_0x1b72ec(0x21c)](a51_0x19af4d[_0x1b72ec(0x26c)](_0x1b72ec(0x2cd)),_0x1b72ec(0x353)),console[_0x1b72ec(0x21c)](a51_0x19af4d['dim'](_0x1b72ec(0x20f))),0x1;}const _0x36355b=_0x51215f['param'],_0xecadf0=_0x51215f['sessionTime'],_0x392570={};if(_0x36355b&&Array[_0x1b72ec(0x2f1)](_0x36355b))for(const _0x4e774f of _0x36355b){const _0x1869e8=_0x4e774f[_0x1b72ec(0x311)]('=');if(_0x1869e8===-0x1)return console[_0x1b72ec(0x21c)](_0x1b72ec(0x29e)+_0x4e774f),console[_0x1b72ec(0x21c)](_0x1b72ec(0x249)),0x1;const _0x25220d=_0x4e774f['substring'](0x0,_0x1869e8),_0x5194b1=_0x4e774f[_0x1b72ec(0x29d)](_0x1869e8+0x1);try{_0x392570[_0x25220d]=JSON[_0x1b72ec(0x303)](_0x5194b1);}catch{_0x392570[_0x25220d]=_0x5194b1;}}_0x51215f[_0x1b72ec(0x380)]&&(console['error']('Workflow:\x20'+_0x5a53c6),Object['keys'](_0x392570)[_0x1b72ec(0x202)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x392570)),_0xecadf0&&console[_0x1b72ec(0x21c)](_0x1b72ec(0x224)+_0xecadf0));const _0x1721af=await withSpinner(_0x1b72ec(0x2e8),()=>_0x40109c[_0x1b72ec(0x324)][_0x1b72ec(0x208)](_0x5a53c6,_0x392570,{'sessionTime':_0xecadf0}),{'verbose':_0x51215f['verbose']}),_0x5e43a0=_0x1721af['data'];console[_0x1b72ec(0x21c)]('✔\x20Workflow\x20run\x20started'),console[_0x1b72ec(0x21c)]('\x20\x20Attempt\x20ID:\x20'+_0x5e43a0['id']),console['error'](_0x1b72ec(0x22c)+_0x5e43a0[_0x1b72ec(0x355)]),console[_0x1b72ec(0x21c)](_0x1b72ec(0x2b9)+_0x5e43a0[_0x1b72ec(0x313)]?.[_0x1b72ec(0x35a)]),console['error'](_0x1b72ec(0x1f3)+_0x5e43a0[_0x1b72ec(0x324)]?.[_0x1b72ec(0x35a)]);if(_0x5e43a0[_0x1b72ec(0x313)]?.['id']&&_0x5e43a0[_0x1b72ec(0x355)]&&_0x5e43a0['id']){const _0x4eebb0=_0x51215f['site'],_0x5ace54=getConsoleUrl(_0x4eebb0,_0x1b72ec(0x2da)+_0x5e43a0[_0x1b72ec(0x313)]['id']+_0x1b72ec(0x35d)+_0x5e43a0[_0x1b72ec(0x355)]+'/attempt/'+_0x5e43a0['id']);console[_0x1b72ec(0x21c)](_0x1b72ec(0x299)+a51_0x19af4d[_0x1b72ec(0x241)](_0x5ace54));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x323);['description']=a51_0x3e4a18(0x264);async[a51_0x3e4a18(0x1e9)](_0xa02036){const _0x5866bf=a51_0x3e4a18,{options:_0x3cc350,args:_0x43fd87,tdx:_0x1813d3}=_0xa02036,_0x56c3bc=_0x43fd87[0x0],_0x353ab2=_0x43fd87[0x1]||'.';if(!_0x56c3bc)return console[_0x5866bf(0x21c)](_0x5866bf(0x283)),console[_0x5866bf(0x21c)](_0x5866bf(0x2b3)),0x1;const _0x47762e=_0x3cc350[_0x5866bf(0x239)];_0x3cc350[_0x5866bf(0x380)]&&(console['error'](_0x5866bf(0x314)+_0x56c3bc),console[_0x5866bf(0x21c)](_0x5866bf(0x228)+_0x353ab2),_0x47762e&&console[_0x5866bf(0x21c)](_0x5866bf(0x240)+_0x47762e));const _0x55b46f=await withSpinner(_0x5866bf(0x319)+_0x56c3bc+'...',()=>_0x1813d3[_0x5866bf(0x324)][_0x5866bf(0x2b5)](_0x56c3bc,_0x353ab2,{'revision':_0x47762e}),{'verbose':_0x3cc350['verbose']}),_0x4b8fbe=_0x55b46f['data'];return console[_0x5866bf(0x21c)](_0x5866bf(0x2d1)+_0x4b8fbe[_0x5866bf(0x245)]),console[_0x5866bf(0x21c)](_0x5866bf(0x360)+_0x4b8fbe[_0x5866bf(0x239)]),console[_0x5866bf(0x21c)]('\x20\x20Files\x20extracted:\x20'+_0x4b8fbe['filesExtracted']),console[_0x5866bf(0x21c)](_0x5866bf(0x206)+_0x353ab2+'/'+_0x4b8fbe['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]='workflow:upload';[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x223);async['execute'](_0x33bffe){const _0x24b54a=a51_0x3e4a18,{options:_0x114f2d,args:_0x27a8e9,tdx:_0x44a54e}=_0x33bffe;let _0x5f5799='.',_0x2797d1=_0x114f2d[_0x24b54a(0x35a)];if(_0x27a8e9[0x0]){const {promises:_0x586b9c}=await import('fs');try{const _0x1e20c4=await _0x586b9c[_0x24b54a(0x200)](_0x27a8e9[0x0]);if(_0x1e20c4[_0x24b54a(0x335)]())_0x5f5799=_0x27a8e9[0x0];else return console['error'](_0x24b54a(0x339)+_0x27a8e9[0x0]+_0x24b54a(0x2d5)),0x1;}catch{_0x2797d1=_0x27a8e9[0x0],_0x5f5799='.';}}const _0x2141ba=_0x114f2d['revision'],_0x27c429=_0x114f2d['skipValidation'];_0x114f2d[_0x24b54a(0x380)]&&(console[_0x24b54a(0x21c)]('Project\x20directory:\x20'+_0x5f5799),_0x2797d1&&console[_0x24b54a(0x21c)](_0x24b54a(0x2ca)+_0x2797d1),_0x2141ba&&console[_0x24b54a(0x21c)]('Revision:\x20'+_0x2141ba),_0x27c429&&console[_0x24b54a(0x21c)](_0x24b54a(0x373)));const _0x57bd88=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x44a54e[_0x24b54a(0x324)][_0x24b54a(0x331)](_0x5f5799,{'projectName':_0x2797d1,'revision':_0x2141ba,'skipValidation':_0x27c429}),{'verbose':_0x114f2d[_0x24b54a(0x380)]}),_0x5784b4=_0x57bd88[_0x24b54a(0x2ab)];return console['error'](_0x24b54a(0x384)+_0x5784b4[_0x24b54a(0x245)]),console[_0x24b54a(0x21c)](_0x24b54a(0x2bb)+_0x5784b4[_0x24b54a(0x33b)]),console[_0x24b54a(0x21c)](_0x24b54a(0x360)+_0x5784b4[_0x24b54a(0x239)]),await this[_0x24b54a(0x310)](_0x44a54e,_0x5784b4[_0x24b54a(0x245)],_0x114f2d[_0x24b54a(0x336)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x28e);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x2a1);async[a51_0x3e4a18(0x1e9)](_0x4b29d9){const _0x211772=a51_0x3e4a18,{options:_0x3366b3,args:_0x37eea1,tdx:_0x57e1bd}=_0x4b29d9,_0x27e993=_0x37eea1[0x0],_0x3fb960=_0x37eea1[0x1];if(!_0x27e993)return console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x26c)]('Error:'),_0x211772(0x306)),console[_0x211772(0x21c)](a51_0x19af4d['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2b80cf=_0x3366b3[_0x211772(0x239)];_0x3366b3[_0x211772(0x380)]&&(console[_0x211772(0x21c)](_0x211772(0x314)+_0x27e993),_0x3fb960&&console[_0x211772(0x21c)](_0x211772(0x351)+_0x3fb960),_0x2b80cf&&console['error'](_0x211772(0x240)+_0x2b80cf),_0x3366b3[_0x211772(0x2ee)]&&console[_0x211772(0x21c)](_0x211772(0x24c)));const _0x59a7c1=await withSpinner(_0x211772(0x219)+_0x27e993+_0x211772(0x367),()=>_0x57e1bd[_0x211772(0x324)][_0x211772(0x2a8)](_0x27e993,{'targetDir':_0x3fb960,'revision':_0x2b80cf}),{'verbose':_0x3366b3[_0x211772(0x380)]}),_0x1f2833=_0x59a7c1[_0x211772(0x2ab)];_0x1f2833[_0x211772(0x348)]?console[_0x211772(0x21c)](_0x211772(0x284)+_0x1f2833[_0x211772(0x245)]):console[_0x211772(0x21c)]('→\x20Project:\x20'+_0x1f2833[_0x211772(0x245)]);console[_0x211772(0x21c)](_0x211772(0x360)+_0x1f2833[_0x211772(0x239)]),console[_0x211772(0x21c)](_0x211772(0x36b)+(a51_0x4a2e0b[_0x211772(0x27b)](process[_0x211772(0x288)](),_0x1f2833[_0x211772(0x37a)])||'.')),console['error']('\x20\x20Changes:\x20'+a51_0x19af4d[_0x211772(0x308)]('+'+_0x1f2833['summary'][_0x211772(0x35c)]+'\x20new')+',\x20'+(a51_0x19af4d['yellow']('~'+_0x1f2833[_0x211772(0x2fa)][_0x211772(0x338)]+_0x211772(0x27c))+',\x20')+(a51_0x19af4d[_0x211772(0x26c)]('-'+_0x1f2833['summary'][_0x211772(0x235)]+'\x20deleted')+',\x20')+(''+a51_0x19af4d[_0x211772(0x34d)](_0x1f2833['summary'][_0x211772(0x2be)]+'\x20unchanged')));for(const _0x1dd833 of _0x1f2833[_0x211772(0x23b)]){_0x1dd833[_0x211772(0x225)]===_0x211772(0x338)&&_0x1dd833['diff']&&(console['error']('\x0a'+a51_0x19af4d[_0x211772(0x241)](_0x211772(0x23d)+_0x1dd833[_0x211772(0x22e)])),console[_0x211772(0x21c)](_0x1dd833[_0x211772(0x2de)]));}if(!_0x1f2833[_0x211772(0x2bf)])return saveSessionContext({'workflow_project':_0x1f2833['projectName']},_0x3366b3['session']),console[_0x211772(0x21c)](a51_0x19af4d['green'](_0x211772(0x34f))),console[_0x211772(0x21c)](a51_0x19af4d['dim'](_0x211772(0x2db)+_0x1f2833[_0x211772(0x245)])),0x0;if(_0x3366b3['dryRun'])return console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x2f8)](_0x211772(0x2a3))),0x0;if(!_0x3366b3[_0x211772(0x242)]){if(!isInteractive())return console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x26c)](_0x211772(0x293)),_0x211772(0x218)),console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x34d)](_0x211772(0x276))),0x1;const _0x2eaa80=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x2eaa80)return console['error'](a51_0x19af4d[_0x211772(0x2f8)](_0x211772(0x209)),_0x211772(0x1eb)),0x1;}await withSpinner(_0x211772(0x1ff),()=>_0x57e1bd[_0x211772(0x324)][_0x211772(0x253)](_0x1f2833,{'revision':_0x2b80cf}),{'verbose':_0x3366b3[_0x211772(0x380)]}),saveSessionContext({'workflow_project':_0x1f2833[_0x211772(0x245)]},_0x3366b3[_0x211772(0x28a)]),console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x308)](_0x211772(0x363)));const _0x3e5979=a51_0x4a2e0b['relative'](process[_0x211772(0x288)](),_0x1f2833[_0x211772(0x37a)])||'.';return console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x34d)]('\x20\x20Location:\x20'+_0x3e5979)),console[_0x211772(0x21c)](a51_0x19af4d[_0x211772(0x34d)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1f2833['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x291);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x2ad);async[a51_0x3e4a18(0x1e9)](_0x1c079f){const _0x54f77f=a51_0x3e4a18,{options:_0x570928,args:_0x9cf00c,tdx:_0x2bdd52}=_0x1c079f,_0xa2e047=this[_0x54f77f(0x273)](_0x9cf00c,_0x570928),_0x4b1552=_0x570928[_0x54f77f(0x239)],_0x38680c=_0x570928[_0x54f77f(0x33f)];_0x570928[_0x54f77f(0x380)]&&(_0xa2e047&&console['error'](_0x54f77f(0x234)+_0xa2e047),_0x4b1552&&console[_0x54f77f(0x21c)](_0x54f77f(0x240)+_0x4b1552),_0x570928[_0x54f77f(0x2ee)]&&console[_0x54f77f(0x21c)](_0x54f77f(0x24c)),_0x38680c&&console[_0x54f77f(0x21c)]('Validation:\x20skipped'));let _0x21e524;try{_0x21e524=await withSpinner(_0x54f77f(0x369),()=>_0x2bdd52['workflow'][_0x54f77f(0x322)]({'sourceDir':_0xa2e047,'revision':_0x4b1552,'skipValidation':_0x38680c}),{'verbose':_0x570928['verbose']});}catch(_0x42e974){if(_0x42e974 instanceof Error&&_0x42e974[_0x54f77f(0x2a7)][_0x54f77f(0x2ed)](_0x54f77f(0x1ef)))return console['error'](a51_0x19af4d[_0x54f77f(0x26c)](_0x54f77f(0x2cd)),_0x54f77f(0x2ae)),_0x570928['workflowProject']?console['error'](a51_0x19af4d['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x570928[_0x54f77f(0x22f)]+_0x54f77f(0x270)+_0x570928[_0x54f77f(0x22f)]+'\x27')):console[_0x54f77f(0x21c)](a51_0x19af4d[_0x54f77f(0x34d)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x42e974;}const _0x1373c2=_0x21e524[_0x54f77f(0x2ab)];console['error'](_0x54f77f(0x37c)+_0x1373c2['projectName']),console[_0x54f77f(0x21c)](_0x54f77f(0x307)+_0x1373c2[_0x54f77f(0x34c)]),console[_0x54f77f(0x21c)]('\x20\x20Revision:\x20'+_0x1373c2[_0x54f77f(0x239)]),console[_0x54f77f(0x21c)]('\x20\x20Changes:\x20'+a51_0x19af4d[_0x54f77f(0x308)]('+'+_0x1373c2[_0x54f77f(0x2fa)][_0x54f77f(0x35c)]+'\x20new')+',\x20'+(a51_0x19af4d['yellow']('~'+_0x1373c2[_0x54f77f(0x2fa)]['modified']+_0x54f77f(0x27c))+',\x20')+(a51_0x19af4d[_0x54f77f(0x26c)]('-'+_0x1373c2['summary'][_0x54f77f(0x235)]+_0x54f77f(0x33d))+',\x20')+(''+a51_0x19af4d[_0x54f77f(0x34d)](_0x1373c2['summary'][_0x54f77f(0x2be)]+_0x54f77f(0x29a))));for(const _0x51043f of _0x1373c2['changes']){_0x51043f[_0x54f77f(0x225)]==='modified'&&_0x51043f['diff']&&(console[_0x54f77f(0x21c)]('\x0a'+a51_0x19af4d[_0x54f77f(0x241)](_0x54f77f(0x23d)+_0x51043f[_0x54f77f(0x22e)])),console['error'](_0x51043f[_0x54f77f(0x2de)]));}if(!_0x1373c2[_0x54f77f(0x2bf)])return console[_0x54f77f(0x21c)](a51_0x19af4d['green'](_0x54f77f(0x2e3))),await this[_0x54f77f(0x310)](_0x2bdd52,_0x1373c2[_0x54f77f(0x245)],_0x570928[_0x54f77f(0x336)]),0x0;if(_0x570928[_0x54f77f(0x2ee)])return console[_0x54f77f(0x21c)](a51_0x19af4d[_0x54f77f(0x2f8)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x570928['yes']){if(!isInteractive())return console[_0x54f77f(0x21c)](a51_0x19af4d[_0x54f77f(0x26c)]('\x0aError:'),_0x54f77f(0x218)),console['error'](a51_0x19af4d[_0x54f77f(0x34d)](_0x54f77f(0x276))),0x1;const _0x347c61=await confirmKey(_0x54f77f(0x2d4));if(!_0x347c61)return console[_0x54f77f(0x21c)](a51_0x19af4d[_0x54f77f(0x2f8)](_0x54f77f(0x209)),_0x54f77f(0x271)),0x1;}const _0x2724b3=await withSpinner(_0x54f77f(0x251),()=>_0x2bdd52[_0x54f77f(0x324)][_0x54f77f(0x2d8)](_0x1373c2),{'verbose':_0x570928[_0x54f77f(0x380)]}),_0x43d305=_0x2724b3[_0x54f77f(0x2ab)];return console[_0x54f77f(0x21c)](a51_0x19af4d[_0x54f77f(0x308)](_0x54f77f(0x2e5))),console[_0x54f77f(0x21c)](_0x54f77f(0x2bb)+_0x43d305[_0x54f77f(0x33b)]),console[_0x54f77f(0x21c)](_0x54f77f(0x360)+_0x43d305[_0x54f77f(0x239)]),await this[_0x54f77f(0x310)](_0x2bdd52,_0x43d305[_0x54f77f(0x245)],_0x570928['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x3e4a18(0x1e9)](_0x2bff17){const _0x2f34b2=a51_0x3e4a18,{options:_0x53b5df,args:_0x29363b,tdx:_0x2b8066}=_0x2bff17,_0x21610d=this[_0x2f34b2(0x273)](_0x29363b,_0x53b5df),_0x57dd7f=_0x53b5df[_0x2f34b2(0x35a)],_0x48b709=_0x53b5df[_0x2f34b2(0x239)],_0x2e9f40=_0x53b5df[_0x2f34b2(0x33f)];if(!_0x21610d)return console['error'](a51_0x19af4d[_0x2f34b2(0x26c)]('Error:'),_0x2f34b2(0x294)),console[_0x2f34b2(0x21c)](a51_0x19af4d['dim'](_0x2f34b2(0x2df))),console[_0x2f34b2(0x21c)](a51_0x19af4d['dim'](_0x2f34b2(0x364))),0x1;if(!_0x57dd7f)return console['error'](a51_0x19af4d['red']('Error:'),_0x2f34b2(0x232)),console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x34d)](_0x2f34b2(0x2df))),0x1;_0x53b5df[_0x2f34b2(0x380)]&&(console[_0x2f34b2(0x21c)](_0x2f34b2(0x234)+_0x21610d),console['error']('New\x20project\x20name:\x20'+_0x57dd7f),_0x48b709&&console[_0x2f34b2(0x21c)](_0x2f34b2(0x240)+_0x48b709),_0x53b5df[_0x2f34b2(0x2ee)]&&console[_0x2f34b2(0x21c)](_0x2f34b2(0x24c)),_0x2e9f40&&console[_0x2f34b2(0x21c)](_0x2f34b2(0x373)));const _0x467378=await withSpinner(_0x2f34b2(0x305),()=>_0x2b8066[_0x2f34b2(0x324)][_0x2f34b2(0x280)](_0x21610d,_0x57dd7f,{'revision':_0x48b709,'skipValidation':_0x2e9f40}),{'verbose':_0x53b5df[_0x2f34b2(0x380)]}),_0x127b83=_0x467378[_0x2f34b2(0x2ab)];console[_0x2f34b2(0x21c)](_0x2f34b2(0x259)+_0x127b83[_0x2f34b2(0x34c)]);_0x127b83[_0x2f34b2(0x2a9)]&&console[_0x2f34b2(0x21c)](_0x2f34b2(0x1fc)+_0x127b83[_0x2f34b2(0x2a9)]);console['error']('New\x20project\x20name:\x20'+_0x127b83['newProjectName']),console[_0x2f34b2(0x21c)](_0x2f34b2(0x240)+_0x127b83['revision']),console[_0x2f34b2(0x21c)](_0x2f34b2(0x23c)+_0x127b83['fileCount']);_0x127b83[_0x2f34b2(0x383)]&&(console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x2f8)]('\x0a⚠\x20Project\x20\x22'+_0x127b83[_0x2f34b2(0x252)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x127b83[_0x2f34b2(0x349)]+')')),console['error'](a51_0x19af4d['yellow'](_0x2f34b2(0x2af))));if(_0x53b5df[_0x2f34b2(0x2ee)])return console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x2f8)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x53b5df[_0x2f34b2(0x242)]){if(!isInteractive())return console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x26c)](_0x2f34b2(0x293)),_0x2f34b2(0x218)),console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x34d)](_0x2f34b2(0x276))),0x1;const _0x486d50=_0x127b83[_0x2f34b2(0x2a9)]||a51_0x4a2e0b[_0x2f34b2(0x298)](_0x21610d),_0x3b815d=_0x127b83[_0x2f34b2(0x383)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x57dd7f+_0x2f34b2(0x24b):_0x2f34b2(0x2b1)+_0x486d50+_0x2f34b2(0x329)+_0x57dd7f+'\x22?',_0xb95bb7=await confirmKey(_0x3b815d);if(!_0xb95bb7)return console[_0x2f34b2(0x21c)](a51_0x19af4d[_0x2f34b2(0x2f8)](_0x2f34b2(0x209))),0x1;}const _0x3bdd92=await withSpinner(_0x127b83[_0x2f34b2(0x383)]?'Updating\x20'+_0x57dd7f+_0x2f34b2(0x367):_0x2f34b2(0x278)+_0x57dd7f+'...',()=>_0x2b8066[_0x2f34b2(0x324)][_0x2f34b2(0x287)](_0x127b83),{'verbose':_0x53b5df[_0x2f34b2(0x380)]}),_0x485bbf=_0x3bdd92[_0x2f34b2(0x2ab)];return console[_0x2f34b2(0x21c)](a51_0x19af4d['green'](_0x127b83[_0x2f34b2(0x383)]?_0x2f34b2(0x227):'✔\x20Clone\x20complete')),console[_0x2f34b2(0x21c)](_0x2f34b2(0x2b9)+_0x485bbf[_0x2f34b2(0x252)]),console[_0x2f34b2(0x21c)](_0x2f34b2(0x2bb)+_0x485bbf[_0x2f34b2(0x333)]),console[_0x2f34b2(0x21c)](_0x2f34b2(0x360)+_0x485bbf[_0x2f34b2(0x239)]),await this[_0x2f34b2(0x310)](_0x2b8066,_0x485bbf['newProjectName'],_0x53b5df['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a51_0x3e4a18(0x268);['description']=a51_0x3e4a18(0x2c1);async[a51_0x3e4a18(0x1e9)](_0x1ce6ad){const _0x208a15=a51_0x3e4a18,{options:_0x4e0993,args:_0x5df004,tdx:_0x10c7c1}=_0x1ce6ad,_0x254d77=_0x5df004[0x0];if(!_0x254d77)return console[_0x208a15(0x21c)](_0x208a15(0x25b)),console[_0x208a15(0x21c)](_0x208a15(0x2e1)),0x1;_0x4e0993[_0x208a15(0x380)]&&console[_0x208a15(0x21c)](_0x208a15(0x314)+_0x254d77);if(!_0x4e0993['yes']){if(!isInteractive())return console[_0x208a15(0x21c)](a51_0x19af4d[_0x208a15(0x26c)](_0x208a15(0x293)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x208a15(0x21c)](a51_0x19af4d[_0x208a15(0x34d)](_0x208a15(0x276))),0x1;const _0x5ee07f=await confirmKey(_0x208a15(0x35b)+_0x254d77+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x5ee07f)return console[_0x208a15(0x21c)](a51_0x19af4d[_0x208a15(0x2f8)](_0x208a15(0x209))),0x1;}const _0x108ab2=await withSpinner('Deleting\x20project\x20'+_0x254d77+_0x208a15(0x367),()=>_0x10c7c1[_0x208a15(0x324)]['delete'](_0x254d77),{'verbose':_0x4e0993['verbose']}),_0x12cc63=_0x108ab2[_0x208a15(0x2ab)];return console['error'](_0x208a15(0x2d7)+_0x12cc63[_0x208a15(0x245)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x12cc63[_0x208a15(0x33b)]),0x0;}}function a51_0x1765(_0x57df53,_0x42412b){_0x57df53=_0x57df53-0x1e7;const _0xf29b03=a51_0xf29b();let _0x1765bb=_0xf29b03[_0x57df53];return _0x1765bb;}export function parseKeyValue(_0x49d43a){const _0x221c66=a51_0x3e4a18,_0x1f8663=_0x49d43a[_0x221c66(0x311)]('=');if(_0x1f8663===-0x1)throw new Error(_0x221c66(0x2ba)+_0x49d43a+_0x221c66(0x34a));const _0x4dcb94=_0x49d43a[_0x221c66(0x29d)](0x0,_0x1f8663),_0x5ad74d=_0x49d43a[_0x221c66(0x29d)](_0x1f8663+0x1);if(!_0x4dcb94)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x4dcb94,'value':_0x5ad74d};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]=a51_0x3e4a18(0x37e);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a51_0x3e4a18(0x1e9)](_0x254dc5){const _0x183de9=a51_0x3e4a18,{options:_0xc9c6b3,args:_0x4c1959,tdx:_0x3180e7}=_0x254dc5,_0xfeb4ee=this[_0x183de9(0x2fb)](_0x4c1959,_0xc9c6b3);if(!_0xfeb4ee)return 0x1;_0xc9c6b3['verbose']&&console[_0x183de9(0x21c)](_0x183de9(0x314)+_0xfeb4ee);const _0x56cbcf=await withSpinner(_0x183de9(0x214),()=>_0x3180e7[_0x183de9(0x324)]['listSecrets'](_0xfeb4ee),{'verbose':_0xc9c6b3['verbose']}),{secrets:_0x4f1521}=_0x56cbcf[_0x183de9(0x2ab)];return console['error'](_0x183de9(0x365)+_0x4f1521[_0x183de9(0x202)]+_0x183de9(0x29b)+(_0x4f1521[_0x183de9(0x202)]!==0x1?'s':'')),await handleSDKOutput(_0x4f1521,_0xc9c6b3),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a51_0x3e4a18(0x1e7);['description']=a51_0x3e4a18(0x28c);async[a51_0x3e4a18(0x1e9)](_0x45e5e5){const _0x297a00=a51_0x3e4a18,{options:_0x5f1d4e,args:_0x4d099c,tdx:_0x2bb630}=_0x45e5e5;let _0x54a627,_0x43cf13;if(_0x4d099c['length']>=0x2)_0x54a627=_0x4d099c[0x0],_0x43cf13=_0x4d099c[0x1];else{if(_0x4d099c[_0x297a00(0x202)]===0x1&&_0x5f1d4e[_0x297a00(0x22f)])_0x54a627=_0x5f1d4e[_0x297a00(0x22f)],_0x43cf13=_0x4d099c[0x0];else return _0x4d099c['length']===0x1?(console[_0x297a00(0x21c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x297a00(0x21c)](_0x297a00(0x20f)),0x1):(console['error'](_0x297a00(0x368)),console[_0x297a00(0x21c)](_0x297a00(0x21b)),0x1);}let _0x2878cd,_0xcf719c;try{({key:_0x2878cd,value:_0xcf719c}=parseKeyValue(_0x43cf13));}catch(_0x1c311c){return _0x1c311c instanceof Error&&console[_0x297a00(0x21c)](a51_0x19af4d[_0x297a00(0x26c)](_0x297a00(0x2cd)),_0x1c311c[_0x297a00(0x2a7)]),0x1;}_0x5f1d4e[_0x297a00(0x380)]&&(console['error'](_0x297a00(0x314)+_0x54a627),console[_0x297a00(0x21c)](_0x297a00(0x381)+_0x2878cd));const _0x18a946=await withSpinner(_0x297a00(0x229),()=>_0x2bb630[_0x297a00(0x324)][_0x297a00(0x2c9)](_0x54a627,_0x2878cd,_0xcf719c),{'verbose':_0x5f1d4e[_0x297a00(0x380)]}),_0x51c461=_0x18a946[_0x297a00(0x2ab)];return console[_0x297a00(0x21c)](_0x297a00(0x31e)+_0x51c461[_0x297a00(0x29c)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x51c461[_0x297a00(0x245)]+'\x27'),(_0x5f1d4e['json']||_0x5f1d4e['jsonl'])&&await handleSingleObjectOutput(_0x51c461,_0x5f1d4e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x3e4a18(0x35a)]='workflow:secrets:delete';[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x358);async[a51_0x3e4a18(0x1e9)](_0x1af8cd){const _0x416e2d=a51_0x3e4a18,{options:_0xe59c41,args:_0x126992,tdx:_0x3109f9}=_0x1af8cd;let _0x2d71af,_0x2c0647;if(_0x126992[_0x416e2d(0x202)]>=0x2)_0x2d71af=_0x126992[0x0],_0x2c0647=_0x126992[0x1];else{if(_0x126992['length']===0x1&&_0xe59c41['workflowProject'])_0x2d71af=_0xe59c41['workflowProject'],_0x2c0647=_0x126992[0x0];else return _0x126992[_0x416e2d(0x202)]===0x1?(console[_0x416e2d(0x21c)](_0x416e2d(0x283)),console[_0x416e2d(0x21c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x416e2d(0x21c)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x416e2d(0x2b7)),0x1);}_0xe59c41[_0x416e2d(0x380)]&&(console[_0x416e2d(0x21c)](_0x416e2d(0x314)+_0x2d71af),console['error'](_0x416e2d(0x381)+_0x2c0647));if(!_0xe59c41[_0x416e2d(0x242)]){if(!isInteractive())return console['error'](a51_0x19af4d[_0x416e2d(0x26c)]('\x0aError:'),_0x416e2d(0x218)),console[_0x416e2d(0x21c)](a51_0x19af4d[_0x416e2d(0x34d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xc6996=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2c0647+_0x416e2d(0x2ff)+_0x2d71af+'\x27?');if(!_0xc6996)return console[_0x416e2d(0x21c)](a51_0x19af4d[_0x416e2d(0x2f8)](_0x416e2d(0x209))),0x1;}const _0x5a362e=await withSpinner('Deleting\x20secret...',()=>_0x3109f9[_0x416e2d(0x324)][_0x416e2d(0x262)](_0x2d71af,_0x2c0647),{'verbose':_0xe59c41['verbose']}),_0x1d3689=_0x5a362e['data'];return console[_0x416e2d(0x21c)](_0x416e2d(0x31e)+_0x1d3689[_0x416e2d(0x29c)]+_0x416e2d(0x2aa)+_0x1d3689[_0x416e2d(0x245)]+'\x27'),(_0xe59c41['json']||_0xe59c41['jsonl'])&&await handleSingleObjectOutput(_0x1d3689,_0xe59c41),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(_0x1e15b0){const _0x55b336=a51_0x3e4a18,_0x2059c6=Math['floor'](_0x1e15b0/0x3e8),_0x5c51b6=Math[_0x55b336(0x24d)](_0x2059c6/0x3c),_0x1bc3ef=Math[_0x55b336(0x24d)](_0x5c51b6/0x3c),_0x267c30=Math[_0x55b336(0x24d)](_0x1bc3ef/0x18);if(_0x267c30>0x0){const _0x9cc10d=_0x1bc3ef%0x18;return _0x9cc10d>0x0?_0x267c30+'d\x20'+_0x9cc10d+'h':_0x267c30+'d';}else{if(_0x1bc3ef>0x0){const _0x34bd84=_0x5c51b6%0x3c;return _0x34bd84>0x0?_0x1bc3ef+'h\x20'+_0x34bd84+'m':_0x1bc3ef+'h';}else{if(_0x5c51b6>0x0){const _0x5379c8=_0x2059c6%0x3c;return _0x5379c8>0x0?_0x5c51b6+'m\x20'+_0x5379c8+'s':_0x5c51b6+'m';}else return _0x2059c6+'s';}}}function formatTimestamp(_0xaf6a06,_0x39fce2){const _0x150759=a51_0x3e4a18,_0x100635=new Date(_0xaf6a06),_0x125a56=String(_0x100635['getHours']())[_0x150759(0x266)](0x2,'0'),_0x592ea6=String(_0x100635[_0x150759(0x260)]())[_0x150759(0x266)](0x2,'0'),_0x53215c=_0x125a56+':'+_0x592ea6,_0x272e66=_0x100635[_0x150759(0x36c)]()===_0x39fce2['getFullYear']()&&_0x100635[_0x150759(0x300)]()===_0x39fce2['getMonth']()&&_0x100635['getDate']()===_0x39fce2['getDate']();if(_0x272e66)return _0x53215c;else{const _0x44e225=String(_0x100635[_0x150759(0x300)]()+0x1)['padStart'](0x2,'0'),_0x53ab28=String(_0x100635[_0x150759(0x31a)]())[_0x150759(0x266)](0x2,'0');return _0x44e225+'-'+_0x53ab28+'\x20'+_0x53215c;}}function formatDate(_0xf05fa){const _0x31fe58=a51_0x3e4a18,_0x396023=_0xf05fa[_0x31fe58(0x36c)](),_0x54d454=String(_0xf05fa[_0x31fe58(0x300)]()+0x1)[_0x31fe58(0x266)](0x2,'0'),_0x51a166=String(_0xf05fa[_0x31fe58(0x31a)]())[_0x31fe58(0x266)](0x2,'0');return _0x396023+'-'+_0x54d454+'-'+_0x51a166;}function getTaskStateIcon(_0x5211f6){const _0x4f9565={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4f9565[_0x5211f6]||'⚪';}function getBarChar(_0x52bf3b){const _0x4eefd7=a51_0x3e4a18;return _0x52bf3b===_0x4eefd7(0x21c)||_0x52bf3b===_0x4eefd7(0x25e)?'×':'─';}function getBarColor(_0x4b92c8){const _0x2a6952=a51_0x3e4a18,_0x4a10c2={'success':a51_0x19af4d[_0x2a6952(0x308)],'error':a51_0x19af4d[_0x2a6952(0x26c)],'group_error':a51_0x19af4d[_0x2a6952(0x26c)],'running':a51_0x19af4d['blue'],'blocked':a51_0x19af4d[_0x2a6952(0x2f8)],'planned':a51_0x19af4d['dim'],'canceling':a51_0x19af4d[_0x2a6952(0x2f8)]};return _0x4a10c2[_0x4b92c8]||a51_0x19af4d['white'];}function parseTaskName(_0x4a8770){const _0x1d3810=a51_0x3e4a18;let _0x3d136e=_0x4a8770['replace'](/^\++/,'');const _0x5bacab=_0x3d136e[_0x1d3810(0x387)]('+'),_0x3e01a6=_0x5bacab['length']>0x1?_0x5bacab[_0x1d3810(0x202)]-0x2:0x0,_0x2b651c=_0x5bacab[_0x5bacab[_0x1d3810(0x202)]-0x1]||_0x3d136e;return{'level':_0x3e01a6,'name':'+'+_0x2b651c};}function truncateTaskName(_0x18e63a,_0x20cc0c){const _0x4ee86a=a51_0x3e4a18,_0x3a2be9=stringWidth(_0x18e63a);if(_0x3a2be9<=_0x20cc0c)return _0x18e63a;let _0x531aad=_0x18e63a;while(stringWidth(_0x531aad+'…')>_0x20cc0c&&_0x531aad[_0x4ee86a(0x202)]>0x0){_0x531aad=_0x531aad[_0x4ee86a(0x26b)](0x0,-0x1);}return _0x531aad+'…';}function calculateTimeScale(_0x14ec40,_0x33d985){const _0x2cbca7=a51_0x3e4a18;return{'startTime':_0x14ec40['start'],'endTime':_0x14ec40[_0x2cbca7(0x2d2)],'durationMs':_0x14ec40[_0x2cbca7(0x328)],'msPerChar':_0x14ec40[_0x2cbca7(0x328)]/_0x33d985};}function timeToPosition(_0x19431f,_0x3f0796,_0xc5fba8){const _0x122f8c=a51_0x3e4a18,_0x12dce8=_0x19431f-_0x3f0796[_0x122f8c(0x30f)],_0x53cd2a=Math[_0x122f8c(0x24d)](_0x12dce8/_0x3f0796['msPerChar']);return Math[_0x122f8c(0x201)](0x0,Math[_0x122f8c(0x23a)](_0x53cd2a,_0xc5fba8));}function renderTimeAxis(_0x589cdd,_0x2466cc){const _0x52533f=a51_0x3e4a18,_0x5a3bc8=Math[_0x52533f(0x23a)](TIMELINE_CONFIG[_0x52533f(0x2f0)],Math['max'](TIMELINE_CONFIG[_0x52533f(0x317)],Math[_0x52533f(0x24d)](_0x2466cc/TIMELINE_CONFIG[_0x52533f(0x2ce)]))),_0x5d6666=_0x589cdd[_0x52533f(0x326)]/(_0x5a3bc8-0x1),_0x1ab1da=new Date(_0x589cdd[_0x52533f(0x30f)]),_0x9a66ca=[];for(let _0x57bc5c=0x0;_0x57bc5c<_0x5a3bc8;_0x57bc5c++){const _0x395ae6=_0x589cdd[_0x52533f(0x30f)]+_0x57bc5c*_0x5d6666,_0x1568bc=timeToPosition(_0x395ae6,_0x589cdd,_0x2466cc),_0x392676=formatTimestamp(_0x395ae6,_0x1ab1da);_0x9a66ca[_0x52533f(0x331)]({'pos':_0x1568bc,'text':_0x392676});}const _0x1f5377=new Array(_0x2466cc)[_0x52533f(0x2a5)]('\x20');let _0x4843ae=-0x1;for(const {pos:_0x52e6a1,text:_0x129343}of _0x9a66ca){let _0x5b6ae1=Math[_0x52533f(0x201)](0x0,_0x52e6a1-Math[_0x52533f(0x24d)](_0x129343['length']/0x2));_0x5b6ae1<=_0x4843ae+TIMELINE_CONFIG[_0x52533f(0x34e)]&&(_0x5b6ae1=_0x4843ae+TIMELINE_CONFIG[_0x52533f(0x34e)]+0x1);_0x5b6ae1+_0x129343[_0x52533f(0x202)]>_0x2466cc&&(_0x5b6ae1=_0x2466cc-_0x129343[_0x52533f(0x202)]);if(_0x5b6ae1>=0x0&&_0x5b6ae1+_0x129343[_0x52533f(0x202)]<=_0x2466cc&&_0x5b6ae1>_0x4843ae){for(let _0x53ee87=0x0;_0x53ee87<_0x129343[_0x52533f(0x202)];_0x53ee87++){_0x1f5377[_0x5b6ae1+_0x53ee87]=_0x129343[_0x53ee87];}_0x4843ae=_0x5b6ae1+_0x129343['length']-0x1;}}return _0x1f5377[_0x52533f(0x210)]('');}function a51_0xf29b(){const _0x478e21=['min','changes','Files\x20to\x20upload:\x20','---\x20','match','columns','Revision:\x20','cyan','yes','fs/promises','list','projectName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x1b[1A\x1b[2K','renderTimeline','Expected\x20format:\x20--param\x20key=value','No\x20sessions\x20with\x20timing\x20information','\x22\x20with\x20new\x20revision?','Dry\x20run:\x20yes','floor','every','workflow:logs','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Pushing\x20project...','newProjectName','applyPullProject','Warning:','repeat','startsWith','kill','\x20(system)','Source:\x20','No\x20workflows\x20found','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','\x20\x20New\x20attempt\x20ID:\x20','group_error','fromTask','getMinutes','write','deleteSecret','\x20-\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Failed\x20to\x20fetch\x20attempt\x20data','padStart','Killing\x20attempt...','workflow:delete','attemptId','\x27...','slice','red','Usage:\x20tdx\x20wf\x20use\x20<project>','done','filter','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','-\x20nothing\x20pushed','ICON_SPACING','resolveProjectDir','ICON_WIDTH','session:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','workflows','Cloning\x20to\x20','Retrying\x20attempt...','title','relative','\x20modified','task','POLL_INTERVAL_MS','Attempt\x20ID:\x20','prepareCloneProject','\x20\x20tdx\x20wf\x20use\x20<project>','tdx\x20wf\x20attempt\x20','Error:\x20Project\x20name\x20is\x20required','→\x20New\x20project:\x20','\x20session','Select\x20a\x20task\x20to\x20view\x20logs:','executeCloneProject','cwd','GUTTER','session','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','json','workflow:pull','fullName','table','workflow:push','No\x20workflows\x20found\x20in\x20project:\x20','\x0aError:','Source\x20directory\x20is\x20required','6927zUHzhk','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','MIN_TIMELINE_WIDTH','basename','\x20\x20Console:\x20','\x20unchanged','\x20secret','key','substring','Error:\x20Invalid\x20parameter\x20format:\x20','index','renderSessionsTimeline','Pull\x20workflow\x20project\x20to\x20local\x20folder','attempts','\x0aDry\x20run\x20-\x20no\x20files\x20written','sessions','fill','From\x20task:\x20','message','pullProject','sourceProjectName','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','data','get','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','List\x20workflow\x20execution\x20sessions','\x0aClone\x20\x22','📋\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','download','resolveProjectId','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','status','\x20\x20Project:\x20','Invalid\x20format:\x20','\x20\x20Project\x20ID:\x20','planned','\x20workflow','unchanged','hasChanges','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Loading\x20session...','find','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','toISOString','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20project','clear','setSecret','Project\x20name:\x20','output','trim','Error:','LABEL_WIDTH_DIVISOR','from','resolve','✔\x20Downloaded\x20','end','parseProjectWorkflowPattern','\x0aPush\x20these\x20changes?','\x20is\x20not\x20a\x20directory','renderSingleTimeline','✔\x20Deleted\x20project\x20','executePushProject','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','/app/workflows/','\x20\x20Session\x20context\x20set\x20to:\x20','5rSfCQd','workflow:projects','diff','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','12768210XTUwJp','Usage:\x20workflow:delete\x20<project-name-or-id>','readFile','\x0a✔\x20No\x20changes\x20to\x20push','No\x20sessions\x20found','✔\x20Push\x20complete','Show\x20tasks\x20for\x20an\x20attempt','(use\x20--limit\x20to\x20see\x20more)','Starting\x20workflow\x20run...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','window','workflow:kill','Pattern:\x20','includes','dryRun','Latest\x20session\x20has\x20no\x20attempt','MAX_LABEL_COUNT','isArray','navigateSessionsInteractive','✔\x20Workflow\x20project\x20set\x20to:\x20','pending','MAX_TASKS_DISPLAY','workflow:tasks','📁\x20','yellow','workflow:retry','summary','requireProject','all','(unknown)','taskName','\x27\x20from\x20project\x20\x27','getMonth','No\x20workflow\x20sessions\x20found','now','parse','workflow:timeline','Analyzing\x20project...','Project\x20name\x20is\x20required','\x20\x20Source:\x20','green','rows','workflow:run','description','displayLine','Session\x20not\x20found:\x20','unknown','startTime','showWorkflowConsoleUrl','indexOf','isTTY','project','Project:\x20','\x20has\x20no\x20attempts','sort','MIN_LABEL_COUNT','value','Downloading\x20project\x20','getDate','resolveProject','stdout','text','✔\x20Secret\x20\x27','\x20(use\x20--limit\x20to\x20show\x20more)','Project\x20filter:\x20','params','preparePushProject','workflow:download','workflow','3740376YqRJWn','durationMs','updatedAt','duration','\x22\x20to\x20new\x20project\x20\x22','generateSessionTimelineRows','createdAt','limit','finishedAt','Force:\x20yes','Fetching\x20log\x20files...','\x20from\x20session\x20','push','Filter:\x20','newProjectId','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','isDirectory','site','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','modified','Error:\x20','201240BfFKmv','projectId','select','\x20deleted','✔\x20Showing\x20','skipValidation','cancelRequested','retryAttemptName','running','workflowName','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Loading\x20sessions...','No\x20sessions\x20found\x20in\x20project:\x20','reason','isNewProject','existingProjectId','.\x20Expected\x20format:\x20KEY=VALUE','workflow:workflows','sourceDir','dim','LABEL_MIN_SPACING','\x0a✔\x20Already\x20up\x20to\x20date','some','Target\x20directory:\x20','lastAttempt','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x0a✔\x20Attempt\x20complete','sessionId','jsonl','attempt:','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','new','/sessions/','set','Listing\x20workflow\x20sessions...','\x20\x20Revision:\x20','blue','workflow:attempts','✔\x20Pull\x20complete','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','✔\x20Found\x20','fileSize','...','Error:\x20KEY=VALUE\x20is\x20required','Analyzing\x20changes...','retryAttempt','\x20\x20Target:\x20','getFullYear','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20attempts\x20found\x20in\x20project:\x20','state','logs','localeCompare','utf-8','Validation:\x20skipped','Listing\x20workflow\x20attempts...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','204954IZeTFm','No\x20sessions\x20found\x20for:\x20','900eaoyPg','List\x20workflow\x20attempts','targetDir','✔\x20Retry\x20started','✔\x20Project:\x20','\x20logs','workflow:secrets:list','metadata','verbose','Key:\x20','logFiles','targetExists','✔\x20Pushed\x20','TASK_NAME_WIDTH','Using\x20attempt\x20','split','workflow:secrets:set','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','execute','Session\x20','-\x20no\x20files\x20written','1951747FFjcbZ','Error:\x20Attempt\x20ID\x20is\x20required','start','No\x20workflow\x20tdx.json\x20found','autocomplete','Listing\x20workflows...','toLowerCase','\x20\x20Workflow:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','No\x20matching\x20sessions\x20found','success','log','follow','Listing\x20workflow\x20projects...','values','has','Source\x20project:\x20','Start\x20a\x20workflow\x20run','map','Writing\x20files...','stat','max','length','No\x20projects\x20match\x20pattern:\x20','Getting\x20attempt\x20details...','force','\x20\x20Location:\x20','workflow:sessions','run','Cancelled','No\x20log\x20content\x20found','\x20to\x20see\x20detailed\x20logs','Select\x20a\x20workflow\x20to\x20run','buildTimelineData','tasks','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','join','Resume\x20from:\x20','Downloading\x20logs...','\x20of\x20','Listing\x20secrets...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Getting\x20attempt\x20tasks...','\x20sessions\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20project\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','error','format','Total:\x20','⚠\x20Showing\x20first\x20','includeRetried','Filter:\x20project=','\x0aPolling...\x20(','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Session\x20time:\x20','type','getTime','✔\x20Project\x20updated','Output\x20directory:\x20','Setting\x20secret...','session_id','Auto-selected\x20latest\x20session:\x20','\x20\x20Session\x20ID:\x20','Resolving\x20project\x20\x27','path','workflowProject','142386CDjZnY','attempt','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','startedAt','Source\x20directory:\x20','deleted','MAX_POLL_ITERATIONS','sessionTime','pollTimeline','revision'];a51_0xf29b=function(){return _0x478e21;};return a51_0xf29b();}function renderTaskRow(_0x17654a,_0x3eca05,_0xe1ff8b,_0x3eb17f){const _0xecc7ac=a51_0x3e4a18,{level:_0x1c73c4,name:_0x50ccad}=parseTaskName(_0x17654a[_0xecc7ac(0x35a)]),_0x56468d='\x20'[_0xecc7ac(0x255)](_0x1c73c4),_0x36b111=_0x17654a['window']?'('+formatElapsed(_0x17654a[_0xecc7ac(0x2ea)][_0xecc7ac(0x328)])+')':'',_0x20126c=stringWidth(_0x36b111),_0x500ae3=_0x1c73c4*0x1,_0xda977d=_0x3eb17f-_0x500ae3-_0x20126c-0x1,_0x1a7803=truncateTaskName(_0x50ccad,_0xda977d),_0x189cd9=_0x56468d+_0x1a7803,_0x1e8ea4=stringWidth(_0x189cd9),_0x4fa542=_0x3eb17f-_0x1e8ea4-_0x20126c,_0x1722a4=_0x189cd9+'\x20'['repeat'](Math[_0xecc7ac(0x201)](0x1,_0x4fa542))+a51_0x19af4d['dim'](_0x36b111),_0x13da08=getTaskStateIcon(_0x17654a[_0xecc7ac(0x36f)]),_0x46b563=new Array(_0xe1ff8b)[_0xecc7ac(0x2a5)]('\x20');if(_0x17654a[_0xecc7ac(0x2ea)]){const _0x11b318=timeToPosition(_0x17654a[_0xecc7ac(0x2ea)][_0xecc7ac(0x1ee)],_0x3eca05,_0xe1ff8b),_0x31efbf=timeToPosition(_0x17654a[_0xecc7ac(0x2ea)][_0xecc7ac(0x2d2)],_0x3eca05,_0xe1ff8b),_0x52d415=getBarChar(_0x17654a['state']),_0x17075c=Math[_0xecc7ac(0x201)](_0x11b318+0x1,_0x31efbf);for(let _0x3175c0=_0x11b318;_0x3175c0<Math[_0xecc7ac(0x23a)](_0x17075c,_0xe1ff8b);_0x3175c0++){_0x46b563[_0x3175c0]=_0x52d415;}}const _0x41a889=getBarColor(_0x17654a[_0xecc7ac(0x36f)]),_0x3bd8a1=_0x46b563[_0xecc7ac(0x1fe)](_0x5c2f61=>_0x5c2f61==='\x20'?'\x20':_0x41a889(_0x5c2f61))[_0xecc7ac(0x210)]('');return _0x13da08+'\x20'+_0x1722a4+'│'+_0x3bd8a1+'│';}function calculateStats(_0x5045dd){const _0x198fea=a51_0x3e4a18,_0x4eb469={'total':_0x5045dd[_0x198fea(0x202)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2fc4e7 of _0x5045dd){if(_0x2fc4e7['state']===_0x198fea(0x1f6))_0x4eb469[_0x198fea(0x1f6)]++;else{if(_0x2fc4e7['state']==='error'||_0x2fc4e7[_0x198fea(0x36f)]===_0x198fea(0x25e))_0x4eb469[_0x198fea(0x21c)]++;else _0x2fc4e7[_0x198fea(0x36f)]==='running'?_0x4eb469[_0x198fea(0x342)]++:_0x4eb469[_0x198fea(0x2f4)]++;}}return _0x4eb469;}function formatStats(_0x93f511){const _0x16e2aa=a51_0x3e4a18;return[_0x16e2aa(0x21e)+_0x93f511['total'],'✅\x20'+_0x93f511['success'],'❌\x20'+_0x93f511[_0x16e2aa(0x21c)],'🔄\x20'+_0x93f511[_0x16e2aa(0x342)],'⏳\x20'+_0x93f511[_0x16e2aa(0x2f4)]][_0x16e2aa(0x210)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a51_0x3e4a18(0x304);[a51_0x3e4a18(0x30b)]=a51_0x3e4a18(0x21a);async['execute'](_0x120eef){const _0x27dbdf=a51_0x3e4a18,{options:_0x58962b,args:_0x540542,tdx:_0x187692}=_0x120eef;let _0x3b0ab8,_0x58719c,_0x9cfd68=![];if(_0x540542[0x0]){if(_0x540542[0x0][_0x27dbdf(0x2ed)]('.')){const _0x28bd8f=this[_0x27dbdf(0x2d3)](_0x540542,_0x58962b);if(!_0x28bd8f)return 0x1;_0x3b0ab8=_0x28bd8f[_0x27dbdf(0x245)],_0x58719c=_0x28bd8f[_0x27dbdf(0x343)];}else{_0x58719c=_0x540542[0x0],_0x3b0ab8=_0x58962b[_0x27dbdf(0x22f)];if(!_0x3b0ab8)return console[_0x27dbdf(0x21c)](a51_0x19af4d[_0x27dbdf(0x26c)](_0x27dbdf(0x2cd)),_0x27dbdf(0x28b)),0x1;_0x9cfd68=!![];}}else{const _0x2d2af1=this[_0x27dbdf(0x2d3)](_0x540542,_0x58962b);if(!_0x2d2af1)return 0x1;_0x3b0ab8=_0x2d2af1[_0x27dbdf(0x245)],_0x58719c=_0x2d2af1[_0x27dbdf(0x343)];}if(_0x58962b['verbose']){if(_0x3b0ab8&&_0x58719c)console[_0x27dbdf(0x21c)](_0x27dbdf(0x332)+_0x3b0ab8+'.'+_0x58719c);else _0x3b0ab8&&console['error'](_0x27dbdf(0x221)+_0x3b0ab8);}const _0x125670=_0x58962b[_0x27dbdf(0x269)],_0x585d00=_0x58962b['sessionId'];if(_0x125670){_0x585d00&&console[_0x27dbdf(0x21c)](a51_0x19af4d[_0x27dbdf(0x2f8)](_0x27dbdf(0x254)),_0x27dbdf(0x296));const _0x24950d=_0x58962b['follow'];return _0x24950d?await this[_0x27dbdf(0x238)](_0x120eef,_0x125670):await this[_0x27dbdf(0x2d6)](_0x120eef,_0x125670,_0x58962b),0x0;}if(_0x585d00){const _0x5e5d12=await withSpinner(_0x27dbdf(0x2c2),()=>_0x187692[_0x27dbdf(0x324)][_0x27dbdf(0x2a4)]({'projectName':_0x3b0ab8,'workflowName':_0x58719c,'limit':0x64}),{'verbose':_0x58962b[_0x27dbdf(0x380)]}),_0x43c9d2=_0x5e5d12[_0x27dbdf(0x2ab)]['find'](_0x3f1a00=>_0x3f1a00['id']===_0x585d00);if(!_0x43c9d2)return console[_0x27dbdf(0x21c)](a51_0x19af4d['red'](_0x27dbdf(0x2cd)),_0x27dbdf(0x30d)+_0x585d00),0x1;if(!_0x43c9d2['lastAttempt']?.['id'])return console[_0x27dbdf(0x21c)](a51_0x19af4d[_0x27dbdf(0x26c)]('Error:'),_0x27dbdf(0x1ea)+_0x585d00+_0x27dbdf(0x315)),0x1;const _0x10a76a=_0x43c9d2[_0x27dbdf(0x352)]['id'];_0x58962b[_0x27dbdf(0x380)]&&console['error'](_0x27dbdf(0x386)+_0x10a76a+_0x27dbdf(0x330)+_0x585d00);const _0xf5e045=_0x58962b[_0x27dbdf(0x1f8)];return _0xf5e045?await this[_0x27dbdf(0x238)](_0x120eef,_0x10a76a):await this['renderSingleTimeline'](_0x120eef,_0x10a76a,_0x58962b),0x0;}const _0x55f7f9=await withSpinner(_0x27dbdf(0x345),()=>_0x187692[_0x27dbdf(0x324)]['sessions']({'projectName':_0x3b0ab8,'workflowName':_0x58719c,'limit':_0x58962b[_0x27dbdf(0x32c)]||0x32}),{'verbose':_0x58962b[_0x27dbdf(0x380)]}),_0x18cdbd=_0x55f7f9[_0x27dbdf(0x2ab)];if(_0x18cdbd[_0x27dbdf(0x202)]===0x0){if(_0x3b0ab8&&_0x58719c)console[_0x27dbdf(0x21c)](_0x27dbdf(0x377)+_0x3b0ab8+'.'+_0x58719c);else _0x3b0ab8?console[_0x27dbdf(0x21c)](_0x27dbdf(0x346)+_0x3b0ab8):(console[_0x27dbdf(0x21c)](_0x27dbdf(0x301)),console[_0x27dbdf(0x21c)](a51_0x19af4d[_0x27dbdf(0x34d)](_0x27dbdf(0x375))));return 0x0;}_0x18cdbd[_0x27dbdf(0x316)]((_0x28a675,_0x59fc4d)=>{const _0x1282e8=_0x27dbdf,_0x3360f4=_0x28a675[_0x1282e8(0x237)]||'',_0x2b3412=_0x59fc4d['sessionTime']||'';return _0x2b3412[_0x1282e8(0x371)](_0x3360f4);});if(_0x58962b[_0x27dbdf(0x28d)]||_0x58962b[_0x27dbdf(0x356)])return await handleSDKOutput(_0x18cdbd,_0x58962b),0x0;let _0x1f43b7;if(_0x9cfd68){const _0x3811df=_0x18cdbd[0x0];if(!_0x3811df[_0x27dbdf(0x352)]?.['id'])return console[_0x27dbdf(0x21c)](_0x27dbdf(0x2ef)),0x0;_0x1f43b7=_0x3811df[_0x27dbdf(0x352)]['id'],_0x58962b[_0x27dbdf(0x380)]&&console[_0x27dbdf(0x21c)](_0x27dbdf(0x22b)+_0x3811df[_0x27dbdf(0x237)]);}else{const _0x56de2f=_0x18cdbd[_0x27dbdf(0x1fe)](_0x23a0a6=>{const _0x242928=_0x27dbdf,_0x409fab=getAttemptStatusDisplay(_0x23a0a6[_0x242928(0x352)]);return{'title':_0x23a0a6[_0x242928(0x313)]?.[_0x242928(0x35a)]+'.'+_0x23a0a6[_0x242928(0x324)]?.[_0x242928(0x35a)]+_0x242928(0x263)+_0x23a0a6[_0x242928(0x237)]+'\x20'+_0x409fab['icon'],'value':_0x23a0a6[_0x242928(0x352)]?.['id']||'','description':_0x409fab[_0x242928(0x31d)]};}),_0x3de268=await a51_0x4a0a66({'type':'select','name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x56de2f[_0x27dbdf(0x26f)](_0x2f2d6b=>_0x2f2d6b[_0x27dbdf(0x318)]!=='')});if(!_0x3de268[_0x27dbdf(0x269)])return 0x0;_0x1f43b7=_0x3de268[_0x27dbdf(0x269)];}const _0x5f4e1a=_0x58962b[_0x27dbdf(0x1f8)];return _0x5f4e1a?await this[_0x27dbdf(0x238)](_0x120eef,_0x1f43b7):await this[_0x27dbdf(0x2d6)](_0x120eef,_0x1f43b7,_0x58962b),0x0;}async['renderSingleTimeline'](_0x2e76a2,_0x55013e,_0x1bd58f){const _0x35afa1=a51_0x3e4a18,{tdx:_0x3fa380}=_0x2e76a2;let _0x3705de,_0x384c7e;try{[_0x3705de,_0x384c7e]=await Promise[_0x35afa1(0x2fc)]([_0x3fa380[_0x35afa1(0x324)][_0x35afa1(0x231)](_0x55013e),_0x3fa380[_0x35afa1(0x324)][_0x35afa1(0x20e)](_0x55013e,![])]);}catch(_0x1d9732){console['error'](a51_0x19af4d[_0x35afa1(0x26c)](_0x35afa1(0x265)));_0x1bd58f[_0x35afa1(0x380)]&&console[_0x35afa1(0x21c)](_0x1d9732);throw _0x1d9732;}if(_0x1bd58f['json']||_0x1bd58f['jsonl']){const _0x41fa9f=this[_0x35afa1(0x20d)](_0x3705de,_0x384c7e);await handleSDKOutput([_0x41fa9f],_0x1bd58f);return;}const _0x2f0827=_0x3fa380['context']['site'],_0x25e57d=this[_0x35afa1(0x248)](_0x3705de,_0x384c7e,_0x2f0827);console[_0x35afa1(0x1f7)](_0x25e57d);}async[a51_0x3e4a18(0x238)](_0x4e3b8e,_0x3a2375){const _0x433807=a51_0x3e4a18,{tdx:_0x8b88d8}=_0x4e3b8e,_0x1a3110=TIMELINE_CONFIG[_0x433807(0x27e)],_0x2413cf=TIMELINE_CONFIG[_0x433807(0x236)];let _0x17a946=0x0;while(_0x17a946<_0x2413cf){process[_0x433807(0x31c)][_0x433807(0x312)]&&process[_0x433807(0x31c)][_0x433807(0x261)]('\x1bc');let _0x4f737e,_0x3e0e2f;try{[_0x4f737e,_0x3e0e2f]=await Promise['all']([_0x8b88d8['workflow'][_0x433807(0x231)](_0x3a2375),_0x8b88d8['workflow']['tasks'](_0x3a2375,![])]);}catch(_0x4a31d0){console[_0x433807(0x21c)](a51_0x19af4d[_0x433807(0x26c)](_0x433807(0x2c0)));_0x17a946>0x0&&console[_0x433807(0x21c)](a51_0x19af4d['dim'](_0x433807(0x2e9)+_0x17a946));throw _0x4a31d0;}const _0x37cc29=_0x8b88d8['context']['site'],_0x1104b7=this[_0x433807(0x248)](_0x4f737e,_0x3e0e2f,_0x37cc29);console['log'](_0x1104b7);const _0x377c6a=_0x4f737e[_0x433807(0x26e)]&&_0x3e0e2f[_0x433807(0x24e)](_0x1f0e78=>_0x1f0e78[_0x433807(0x36f)]!==_0x433807(0x342)&&_0x1f0e78['state']!=='planned');if(_0x377c6a){console[_0x433807(0x21c)](a51_0x19af4d['green'](_0x433807(0x354)));break;}console[_0x433807(0x21c)](a51_0x19af4d[_0x433807(0x34d)](_0x433807(0x222)+_0x17a946*0x2+_0x433807(0x215))),await new Promise(_0x2daaa5=>setTimeout(_0x2daaa5,_0x1a3110)),_0x17a946++;}_0x17a946>=_0x2413cf&&console[_0x433807(0x21c)](a51_0x19af4d['yellow'](_0x433807(0x2c4)));}[a51_0x3e4a18(0x248)](_0x26ddcc,_0x5e927d,_0x225538){const _0x13bdb6=a51_0x3e4a18,_0x164212=[],_0x5e754f=TIMELINE_CONFIG[_0x13bdb6(0x385)],_0x5a2fd3=0x5,_0x2e98e6=process[_0x13bdb6(0x31c)][_0x13bdb6(0x23f)]||0x78,_0x5837cb=_0x2e98e6-_0x5e754f-_0x5a2fd3,_0x153955=Math[_0x13bdb6(0x201)](TIMELINE_CONFIG[_0x13bdb6(0x297)],Math[_0x13bdb6(0x23a)](_0x5837cb,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x22f526=new Date(_0x26ddcc[_0x13bdb6(0x32b)])['getTime'](),_0x411776=_0x26ddcc[_0x13bdb6(0x32d)]?new Date(_0x26ddcc[_0x13bdb6(0x32d)])['getTime']():Date[_0x13bdb6(0x302)](),_0xe163d4={'start':_0x22f526,'end':_0x411776,'duration':_0x411776-_0x22f526},_0x540fdd=new Map(),_0x3459d9=[];for(const _0x39739d of _0x5e927d){if(_0x39739d[_0x13bdb6(0x233)]){const _0x2975ca=new Date(_0x39739d['startedAt'])['getTime'](),_0x18e701=_0x39739d[_0x13bdb6(0x327)]?new Date(_0x39739d[_0x13bdb6(0x327)])[_0x13bdb6(0x226)]():Date[_0x13bdb6(0x302)](),_0x5aa80f={'start':_0x2975ca,'end':_0x18e701,'duration':_0x18e701-_0x2975ca};_0x540fdd[_0x13bdb6(0x35e)](_0x39739d['id'],_0x5aa80f),_0x3459d9['push']({'name':_0x39739d[_0x13bdb6(0x28f)],'state':_0x39739d['state']||_0x13bdb6(0x30e),'window':_0x5aa80f});}else _0x3459d9[_0x13bdb6(0x331)]({'name':_0x39739d[_0x13bdb6(0x28f)],'state':_0x39739d[_0x13bdb6(0x36f)]||_0x13bdb6(0x2bc),'window':undefined});}_0x3459d9[_0x13bdb6(0x316)]((_0x3a67d7,_0x32a953)=>{const _0x5a5b9c=_0x13bdb6;if(!_0x3a67d7[_0x5a5b9c(0x2ea)])return 0x1;if(!_0x32a953[_0x5a5b9c(0x2ea)])return-0x1;return _0x3a67d7[_0x5a5b9c(0x2ea)]['start']-_0x32a953[_0x5a5b9c(0x2ea)][_0x5a5b9c(0x1ee)];});const _0x2ffcac=_0x3459d9[_0x13bdb6(0x202)],_0x2e7545=_0x2ffcac>TIMELINE_CONFIG[_0x13bdb6(0x2f5)];_0x2e7545&&_0x3459d9['splice'](TIMELINE_CONFIG[_0x13bdb6(0x2f5)]);const _0x30f107=calculateTimeScale(_0xe163d4,_0x153955),_0x32596a=_0x26ddcc[_0x13bdb6(0x26e)]?_0x26ddcc[_0x13bdb6(0x1f6)]?a51_0x19af4d[_0x13bdb6(0x308)](_0x13bdb6(0x1f6)):a51_0x19af4d[_0x13bdb6(0x26c)](_0x13bdb6(0x21c)):a51_0x19af4d[_0x13bdb6(0x361)](_0x13bdb6(0x342)),_0x46bff7=_0x26ddcc[_0x13bdb6(0x313)]?.['id'],_0x2e8ee9=_0x26ddcc['sessionId'];let _0x212598;if(_0x46bff7&&_0x2e8ee9){const _0x76e8ef=getWorkflowAttemptUrl(_0x225538,_0x46bff7,_0x2e8ee9,_0x26ddcc['id']);_0x212598=hyperlink(a51_0x19af4d[_0x13bdb6(0x34d)](_0x26ddcc['id']),_0x76e8ef);}else _0x212598=a51_0x19af4d[_0x13bdb6(0x34d)](_0x26ddcc['id']);_0x164212[_0x13bdb6(0x331)]('Attempt:\x20'+_0x212598+'\x20-\x20'+_0x32596a+_0x13bdb6(0x263)+formatElapsed(_0xe163d4[_0x13bdb6(0x328)]));if(_0x3459d9[_0x13bdb6(0x202)]>0x0){const _0x36e936=renderTimeAxis(_0x30f107,_0x153955),_0x49fdcc=new Date(_0xe163d4[_0x13bdb6(0x1ee)]),_0x26b869=formatDate(_0x49fdcc),_0x3f1c21=TIMELINE_CONFIG[_0x13bdb6(0x274)]+TIMELINE_CONFIG[_0x13bdb6(0x272)]+_0x5e754f,_0x53002c=_0x26b869['padStart'](_0x3f1c21),_0x4d3048=a51_0x19af4d[_0x13bdb6(0x34d)](_0x53002c);_0x164212[_0x13bdb6(0x331)](_0x4d3048+'\x20'+_0x36e936);for(const _0x35a66e of _0x3459d9){_0x164212[_0x13bdb6(0x331)](renderTaskRow(_0x35a66e,_0x30f107,_0x153955,_0x5e754f));}const _0x13538d=calculateStats(_0x3459d9);_0x164212['push'](formatStats(_0x13538d)),_0x2e7545&&_0x164212[_0x13bdb6(0x331)](a51_0x19af4d[_0x13bdb6(0x2f8)](_0x13bdb6(0x21f)+TIMELINE_CONFIG[_0x13bdb6(0x2f5)]+_0x13bdb6(0x213)+_0x2ffcac+'\x20tasks')),_0x164212[_0x13bdb6(0x331)](''),_0x164212[_0x13bdb6(0x331)](a51_0x19af4d['dim']('💡\x20Tip:\x20Use\x20')+(_0x13bdb6(0x282)+_0x26ddcc['id']+_0x13bdb6(0x37d))+a51_0x19af4d['dim'](_0x13bdb6(0x20b)));}else _0x164212[_0x13bdb6(0x331)](_0x13bdb6(0x250));return _0x164212[_0x13bdb6(0x210)]('\x0a');}[a51_0x3e4a18(0x20d)](_0x598291,_0x3478b3){const _0xc5ebad=a51_0x3e4a18,_0x28a38e=new Date(_0x598291[_0xc5ebad(0x32b)])[_0xc5ebad(0x226)](),_0x15ae97=_0x598291[_0xc5ebad(0x32d)]?new Date(_0x598291[_0xc5ebad(0x32d)])[_0xc5ebad(0x226)]():Date[_0xc5ebad(0x302)](),_0x16e133=_0x15ae97-_0x28a38e,_0x56a88f=[];for(const _0x5f557b of _0x3478b3){if(_0x5f557b[_0xc5ebad(0x233)]){const _0x1816b2=new Date(_0x5f557b[_0xc5ebad(0x233)])[_0xc5ebad(0x226)](),_0x15a0a1=_0x5f557b[_0xc5ebad(0x327)]?new Date(_0x5f557b[_0xc5ebad(0x327)])[_0xc5ebad(0x226)]():Date[_0xc5ebad(0x302)]();_0x56a88f[_0xc5ebad(0x331)]({'name':_0x5f557b[_0xc5ebad(0x28f)],'state':_0x5f557b['state']||_0xc5ebad(0x30e),'window':{'start':_0x1816b2,'end':_0x15a0a1,'duration':_0x15a0a1-_0x1816b2}});}else _0x56a88f[_0xc5ebad(0x331)]({'name':_0x5f557b[_0xc5ebad(0x28f)],'state':_0x5f557b[_0xc5ebad(0x36f)]||'planned','window':undefined});}const _0x4f522f=calculateStats(_0x56a88f);return{'attempt':{'id':_0x598291['id'],'status':_0x598291['done']?_0x598291['success']?_0xc5ebad(0x1f6):_0xc5ebad(0x21c):'running','createdAt':_0x598291[_0xc5ebad(0x32b)],'finishedAt':_0x598291[_0xc5ebad(0x32d)],'duration_ms':_0x16e133},'tasks':_0x56a88f[_0xc5ebad(0x1fe)](_0x2ec325=>({'name':_0x2ec325[_0xc5ebad(0x35a)],'state':_0x2ec325[_0xc5ebad(0x36f)],'startedAt':_0x2ec325[_0xc5ebad(0x2ea)]?new Date(_0x2ec325[_0xc5ebad(0x2ea)]['start'])[_0xc5ebad(0x2c5)]():null,'updatedAt':_0x2ec325[_0xc5ebad(0x2ea)]?new Date(_0x2ec325[_0xc5ebad(0x2ea)][_0xc5ebad(0x2d2)])['toISOString']():null,'duration_ms':_0x2ec325['window']?.['duration']||null})),'stats':_0x4f522f};}}
1
+ const a51_0x10da29=a51_0x4c2d;(function(_0xbe5b85,_0x51a451){const _0x335325=a51_0x4c2d,_0x272445=_0xbe5b85();while(!![]){try{const _0x2a3b44=parseInt(_0x335325(0x2e7))/0x1*(-parseInt(_0x335325(0x1c2))/0x2)+-parseInt(_0x335325(0x177))/0x3*(parseInt(_0x335325(0x236))/0x4)+parseInt(_0x335325(0x1ab))/0x5*(parseInt(_0x335325(0x227))/0x6)+parseInt(_0x335325(0x29b))/0x7+-parseInt(_0x335325(0x157))/0x8*(-parseInt(_0x335325(0x17d))/0x9)+-parseInt(_0x335325(0x1a1))/0xa*(parseInt(_0x335325(0x21d))/0xb)+-parseInt(_0x335325(0x248))/0xc;if(_0x2a3b44===_0x51a451)break;else _0x272445['push'](_0x272445['shift']());}catch(_0x59e32f){_0x272445['push'](_0x272445['shift']());}}}(a51_0x141c,0xb2353));import a51_0x55b9d6 from'chalk';import{existsSync}from'fs';import a51_0x2dea47 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';function a51_0x141c(){const _0x1dffcd=['\x20session','match','\x20-\x20','Session\x20time:\x20','getFullYear','utf-8','New\x20project\x20name:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','Listing\x20workflow\x20attempts...','sourceDir','buildTimelineData','startedAt','showWorkflowConsoleUrl','Including\x20subtasks:\x20yes','relative','workflow:tasks','Killing\x20attempt...','attemptId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','window','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20to\x20see\x20detailed\x20logs','group_error','readFile','Force:\x20yes','Secrets\x20to\x20set:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','session:','✔\x20Workflow\x20run\x20started','renderSessionsTimeline','💡\x20Tip:\x20Use\x20','cancelRequested','path','66JMHDnv','taskName','workflow:timeline','-\x20nothing\x20pushed','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','log','toISOString','attempt','\x20\x20tdx\x20wf\x20use\x20<project>','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','246mwmAlG','fileCount','\x27\x20from\x20project\x20\x27','isArray','\x0a✔\x20Attempt\x20complete','padStart','session','context','Error:','setSecrets','keys','retrySession','sessions','\x20unchanged','clear','1651480rzChXV','Revision:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Project\x20name\x20is\x20required','yes','updatedAt','List\x20workflows','round','autocomplete','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','resolveProject','Attempt\x20ID:\x20','deleted','changes','planned','Source\x20directory\x20is\x20required','join','MAX_POLL_ITERATIONS','19033020AqAwhl','fromTask','icon','startsWith','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Retry\x20a\x20session\x20or\x20attempt','filesExtracted','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','floor','\x20\x20Console:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20is\x20not\x20a\x20directory','modified','/app/workflows/','\x22\x20with\x20new\x20revision?','startTime','Usage:\x20workflow:delete\x20<project-name-or-id>','toLowerCase','✔\x20Project\x20updated','No\x20sessions\x20found\x20for:\x20','\x20from\x20session\x20','existingProjectId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','getMonth','workflow:kill','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Getting\x20attempt\x20details...','status','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Kill\x20a\x20running\x20attempt','Parameters:\x20','✔\x20Found\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','stat','Error:\x20Project\x20name\x20is\x20required','workflow:logs','push','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Include\x20retried:\x20yes','No\x20workflows\x20found','green','\x0aPolling...\x20(','Target:\x20','index','workflow:attempt','red','start','✔\x20Retry\x20started','values','executeCloneProject','rows','tdx.json','Resume\x20from:\x20','workflow:upload','message','\x20\x20Session\x20ID:\x20','limit','Attempt:\x20','✔\x20Showing\x20','\x20\x20Project:\x20','yellow','includeSubtasks','\x20modified','getTime','\x20\x20Target:\x20','splice','✔\x20Clone\x20complete','\x0a⚠\x20Project\x20\x22','max','new','\x20project','Validation:\x20skipped','\x22\x20already\x20exists\x20(ID:\x20','\x0aUpdate\x20existing\x20project\x20\x22','\x22\x20to\x20new\x20project\x20\x22','No\x20attempts\x20found','Project\x20directory:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','canceling','Writing\x20files...','indexOf','revision:\x20','9114861MMrGuz','json','workflows','fs/promises','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','/attempt/','workflowName','No\x20sessions\x20found\x20in\x20project:\x20','Retrying\x20session...','Filter:\x20','sessionTime','\x20(use\x20--limit\x20to\x20show\x20more)','find','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','site','Deleting\x20project\x20','all','task','\x20secrets...','parseProjectWorkflowPattern','Error:\x20Secret\x20key\x20is\x20required','pending','\x0a✔\x20No\x20changes\x20to\x20push','error','\x20\x20New\x20attempt\x20ID:\x20','metadata','workflow:secrets:delete','Source:\x20','parse','\x20\x20Revision:\x20','repeat','ICON_WIDTH','projectId','Listing\x20workflows...','fileSize','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Project:\x20','description','Reason:\x20','fill','project','white','finishedAt','workflow:secrets:set','set','Filter:\x20project=','No\x20workflow\x20projects\x20found','end','/sessions/','workflow:sessions','targetExists','params','newProjectName','\x20has\x20no\x20attempts','\x20secret','createdAt','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Files\x20to\x20upload:\x20','navigateSessionsInteractive','min','state','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','✔\x20Pushed\x20','Source\x20directory:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20deleted','sessionId','blue','Source\x20project:\x20','key','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Session\x20context\x20set\x20to:\x20','deleteSecret','\x20\x20Location:\x20','workflow','Cancelled','21689tcpDpx','stringify','slice','force','✔\x20Workflow\x20project\x20set\x20to:\x20','newProjectId','revision','\x20\x20Project\x20ID:\x20','retryAttemptName','\x0a✔\x20Already\x20up\x20to\x20date','projectName','MIN_LABEL_COUNT','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','resolve','Task\x20name:\x20','Listing\x20workflow\x20projects...','Deleting\x20secret...','-\x20no\x20files\x20written','No\x20attempts\x20found\x20for:\x20','→\x20New\x20project:\x20','3524072cCfgTW','duration','Project\x20filter:\x20','reason','Failed\x20to\x20fetch\x20attempt\x20data','Using\x20attempt\x20','data','includes','workflow:clone','No\x20workflow\x20tdx.json\x20found','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','filter','skipValidation','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','MAX_LABEL_COUNT','\x20new','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20\x20Workflow:\x20','Show\x20tasks\x20for\x20an\x20attempt','displayLine','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','list','\x20of\x20','Target\x20directory:\x20','getDate','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','delete','substring','🔄\x20','Error:\x20Attempt\x20ID\x20is\x20required','localeCompare','generateSessionTimelineRows','3EMIwev','applyPullProject','write','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x1b[1A\x1b[2K','listSecrets','18CqHulz','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','now','workflow:run','targetDir','download','Getting\x20attempt\x20tasks...','resolveProjectDir','...','text','trim','Output\x20directory:\x20','No\x20sessions\x20found','✔\x20Pull\x20complete','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','some','split','pollTimeline','MIN_TIMELINE_WIDTH','dim','attempts','from','output','workflow:use','renderSingleTimeline','follow','List\x20workflow\x20attempts','unknown','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','msPerChar','Project:\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','workflowProject','✔\x20Workflow\x20project\x20context\x20cleared.','.\x20Expected\x20format:\x20KEY=VALUE','diff','772710QAYYSm','total','\x20\x20Source:\x20','columns','sys','Auto-selected\x20latest\x20session:\x20','📋\x20','logs','Dry\x20run:\x20yes','select','141610LxfxUh','jsonl','List\x20all\x20workflow\x20projects','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aApply\x20these\x20changes?','basename','POLL_INTERVAL_MS','table','size','session_id','length','No\x20matching\x20sessions\x20found','param','replace','name','---\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20attempts\x20found\x20in\x20project:\x20','Expected\x20format:\x20--param\x20key=value','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','No\x20log\x20content\x20found','Downloading\x20project\x20','14WSMvjG','✔\x20Secret\x20\x27','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','LABEL_MIN_SPACING','Key:\x20','sourceProjectName','Session\x20not\x20found:\x20','summary','List\x20workflow\x20execution\x20sessions','map','stdout','MAX_TIMELINE_WIDTH','Show\x20specific\x20attempt\x20details','\x0aPush\x20these\x20changes?','\x20task','\x0aError:','workflow:push','Start\x20a\x20workflow\x20run','unchanged','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflow:download','Invalid\x20format:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','done','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','MAX_TASKS_DISPLAY','workflow:pull','format','tdx\x20wf\x20attempt\x20','get','(use\x20--limit\x20to\x20see\x20more)','execute','Starting\x20workflow\x20run...','Pushing\x20workflow\x20project...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0aClone\x20\x22','GUTTER','✔\x20Push\x20complete','Pulling\x20project\x20','renderTimeline','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','verbose','running','Setting\x20','tasks','(unknown)','sort','isNewProject','isTTY','Pattern:\x20','success','lastAttempt','\x20\x20Changes:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','dryRun','fullName'];a51_0x141c=function(){return _0x1dffcd;};return a51_0x141c();}import a51_0x5637a3 from'prompts';function getAttemptStatusDisplay(_0x23d6f3){const _0x54a343=a51_0x4c2d;if(!_0x23d6f3)return{'icon':'⏳','text':''};const {done:_0x3bb723,success:_0x121f48,cancelRequested:_0x218631}=_0x23d6f3;if(!_0x3bb723)return _0x218631?{'icon':'🛑','text':a51_0x55b9d6['yellow']('canceling')}:{'icon':'🔄','text':a51_0x55b9d6[_0x54a343(0x2de)](_0x54a343(0x1ee))};if(_0x121f48)return{'icon':'✅','text':a51_0x55b9d6[_0x54a343(0x270)](_0x54a343(0x1f6))};return{'icon':'❌','text':a51_0x55b9d6[_0x54a343(0x275)](_0x54a343(0x2b2))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x2465d7,_0x622e37,_0x595b61=0x0){const _0x5d1111=a51_0x4c2d;return _0x2465d7[_0x595b61]||_0x622e37[_0x5d1111(0x19d)];}['requireProject'](_0x2c6e9a,_0x48d15e,_0x3625e0=0x0){const _0x4d01c9=a51_0x4c2d,_0x3ab603=this['resolveProject'](_0x2c6e9a,_0x48d15e,_0x3625e0);if(!_0x3ab603)return console[_0x4d01c9(0x2b2)](a51_0x55b9d6[_0x4d01c9(0x275)](_0x4d01c9(0x22f)),_0x4d01c9(0x239)),console[_0x4d01c9(0x2b2)](a51_0x55b9d6[_0x4d01c9(0x190)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x3ab603;}['parseProjectWorkflowPattern'](_0x40f3cb,_0x1d7d53){const _0x34f0eb=a51_0x4c2d;if(_0x40f3cb[0x0]){const _0x582a8a=_0x40f3cb[0x0][_0x34f0eb(0x18d)]('.');if(_0x582a8a[_0x34f0eb(0x1b5)]===0x1)return{'projectName':_0x582a8a[0x0],'workflowName':undefined};else return _0x582a8a['length']===0x2?{'projectName':_0x582a8a[0x0],'workflowName':_0x582a8a[0x1]}:(console[_0x34f0eb(0x2b2)](a51_0x55b9d6['red'](_0x34f0eb(0x22f)),_0x34f0eb(0x161)),null);}return{'projectName':_0x1d7d53[_0x34f0eb(0x19d)],'workflowName':undefined};}[a51_0x10da29(0x184)](_0x5f192c,_0x24aa6a,_0xf237a8=0x0){const _0x202929=a51_0x10da29;if(_0x5f192c[_0xf237a8])return _0x5f192c[_0xf237a8];if(_0x24aa6a['workflowProject']){const _0x528503=a51_0x2dea47['join'](process['cwd'](),_0x202929(0x29d),_0x24aa6a[_0x202929(0x19d)]);if(existsSync(a51_0x2dea47['join'](_0x528503,_0x202929(0x27b))))return _0x528503;}return undefined;}async['showWorkflowConsoleUrl'](_0x58a510,_0x48a34f,_0x4716bc){const _0x270165=a51_0x10da29;try{const _0x406404=await _0x58a510[_0x270165(0x2e5)]['workflows'](_0x48a34f,{'limit':0x1});if(_0x406404[_0x270165(0x1b5)]>0x0){const _0x12cd92=_0x406404[0x0]['id'],_0x592edb=getWorkflowUrl(_0x4716bc,_0x12cd92);console[_0x270165(0x2b2)]('\x20\x20Console:\x20'+a51_0x55b9d6[_0x270165(0x1da)](_0x592edb));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x194);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x29f);async[a51_0x10da29(0x1e3)](_0x236cab){const _0x554720=a51_0x10da29,{options:_0x29739d,args:_0x21339f,tdx:_0x4428f4}=_0x236cab,_0x53fd54=_0x21339f[0x0],_0x3d70d5=_0x29739d[_0x554720(0x235)];if(_0x3d70d5)return saveSessionContext({'workflow_project':undefined},_0x29739d['session']),console[_0x554720(0x222)](a51_0x55b9d6[_0x554720(0x270)](_0x554720(0x19e))),0x0;if(!_0x53fd54)return console[_0x554720(0x2b2)](a51_0x55b9d6[_0x554720(0x275)](_0x554720(0x22f)),'Project\x20name\x20is\x20required'),console[_0x554720(0x2b2)](a51_0x55b9d6[_0x554720(0x190)](_0x554720(0x1bb))),console[_0x554720(0x2b2)](a51_0x55b9d6['dim'](_0x554720(0x1d8))),0x1;const _0x183320=await withSpinner('Resolving\x20project\x20\x27'+_0x53fd54+'\x27...',()=>_0x4428f4[_0x554720(0x2e5)]['resolveProjectId'](_0x53fd54),{'verbose':_0x29739d[_0x554720(0x1ed)]}),{name:_0x2ff6cf}=_0x183320[_0x554720(0x15d)];return saveSessionContext({'workflow_project':_0x2ff6cf},_0x29739d[_0x554720(0x22d)]),console[_0x554720(0x222)](a51_0x55b9d6[_0x554720(0x270)](_0x554720(0x147)+a51_0x55b9d6['cyan'](_0x2ff6cf))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x10da29(0x1b9)]='workflow:projects';[a51_0x10da29(0x2c0)]=a51_0x10da29(0x1ad);async[a51_0x10da29(0x1e3)](_0x13cafb){const _0x2d0219=a51_0x10da29,{options:_0x548e6a,args:_0x322307,tdx:_0x58745b}=_0x13cafb,_0x50823b=_0x322307[0x0];_0x548e6a[_0x2d0219(0x1ed)]&&_0x50823b&&console[_0x2d0219(0x2b2)](_0x2d0219(0x1f5)+_0x50823b);const _0x29a2b6=await withSpinner(_0x2d0219(0x152),()=>_0x58745b['workflow']['projects'](_0x50823b,{'limit':_0x548e6a[_0x2d0219(0x280)]}),{'verbose':_0x548e6a[_0x2d0219(0x1ed)]});let _0x11c0ca=_0x29a2b6['data'];_0x11c0ca[_0x2d0219(0x1f2)]((_0x156559,_0x189689)=>_0x156559[_0x2d0219(0x1b9)]['localeCompare'](_0x189689['name']));const _0x565a56=_0x548e6a['limit']||0x64,_0x3cf0d7=_0x11c0ca[_0x2d0219(0x1b5)]>=_0x565a56?a51_0x55b9d6[_0x2d0219(0x190)](_0x2d0219(0x2a6)):'';console[_0x2d0219(0x2b2)](_0x2d0219(0x267)+_0x11c0ca[_0x2d0219(0x1b5)]+_0x2d0219(0x28e)+(_0x11c0ca[_0x2d0219(0x1b5)]!==0x1?'s':'')+_0x3cf0d7);if(_0x548e6a['format']===_0x2d0219(0x29c)||_0x548e6a['format']===_0x2d0219(0x1ac)||_0x548e6a[_0x2d0219(0x1df)]===_0x2d0219(0x1b2))await handleSDKOutput(_0x11c0ca,_0x548e6a);else{if(_0x11c0ca[_0x2d0219(0x1b5)]===0x0)_0x50823b?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x50823b):console['log'](_0x2d0219(0x2c9));else{const _0x6964cb=_0x11c0ca['map'](_0x26965d=>{const _0x5de235=_0x2d0219,_0x1b9f75=_0x26965d[_0x5de235(0x2b4)]?.[_0x5de235(0x18c)](_0x2dbef5=>_0x2dbef5['key']===_0x5de235(0x1a5)),_0x27b591=_0x1b9f75?a51_0x55b9d6[_0x5de235(0x190)]('\x20(system)'):'';return'📁\x20'+_0x26965d['name']+_0x27b591;});await writeOutput(_0x6964cb[_0x2d0219(0x246)]('\x0a'),_0x548e6a[_0x2d0219(0x193)],_0x2d0219(0x16c));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]='workflow:workflows';[a51_0x10da29(0x2c0)]=a51_0x10da29(0x23c);async[a51_0x10da29(0x1e3)](_0x3607f4){const _0x4aed05=a51_0x10da29,{options:_0xd47ecf,args:_0x218f20,tdx:_0x3b1d87}=_0x3607f4,_0x28f848=this['resolveProject'](_0x218f20,_0xd47ecf);_0xd47ecf['verbose']&&_0x28f848&&console['error'](_0x4aed05(0x159)+_0x28f848);const _0x24e4e0=await withSpinner(_0x4aed05(0x2bc),()=>_0x3b1d87[_0x4aed05(0x2e5)][_0x4aed05(0x29d)](_0x28f848,{'limit':_0xd47ecf[_0x4aed05(0x280)]}),{'verbose':_0xd47ecf[_0x4aed05(0x1ed)]});let _0x3fb431=_0x24e4e0['data'];_0x3fb431['sort']((_0x421833,_0x384873)=>{const _0x56bf57=_0x4aed05,_0x32bd14=_0x421833[_0x56bf57(0x1b9)]['localeCompare'](_0x384873[_0x56bf57(0x1b9)]);if(_0x32bd14!==0x0)return _0x32bd14;return(_0x421833[_0x56bf57(0x2c3)]?.[_0x56bf57(0x1b9)]||'')[_0x56bf57(0x175)](_0x384873['project']?.[_0x56bf57(0x1b9)]||'');});const _0x1b4767=_0xd47ecf[_0x4aed05(0x280)]||0x64,_0x4b64b5=_0x3fb431[_0x4aed05(0x1b5)]>=_0x1b4767?a51_0x55b9d6[_0x4aed05(0x190)](_0x4aed05(0x2a6)):'';console[_0x4aed05(0x2b2)](_0x4aed05(0x267)+_0x3fb431['length']+'\x20workflow'+(_0x3fb431[_0x4aed05(0x1b5)]!==0x1?'s':'')+_0x4b64b5);if(_0xd47ecf[_0x4aed05(0x1df)]===_0x4aed05(0x29c)||_0xd47ecf[_0x4aed05(0x1df)]==='jsonl'||_0xd47ecf['format']===_0x4aed05(0x1b2))await handleSDKOutput(_0x3fb431,_0xd47ecf);else{if(_0x3fb431[_0x4aed05(0x1b5)]===0x0)_0x28f848?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x28f848):console[_0x4aed05(0x222)](_0x4aed05(0x26f));else{const _0x135e48=_0xd47ecf[_0x4aed05(0x2a9)],_0x7a522e=_0x3fb431['map'](_0x2f4ee5=>{const _0x4fd054=_0x4aed05,_0x3cd38b=a51_0x55b9d6[_0x4fd054(0x190)]('#'+_0x2f4ee5['id']),_0x58c326=hyperlink(_0x3cd38b,getWorkflowUrl(_0x135e48,_0x2f4ee5['id'])),_0x4ce57c=_0x2f4ee5[_0x4fd054(0x2c3)]?.['name']?a51_0x55b9d6[_0x4fd054(0x190)]('\x20('+_0x2f4ee5[_0x4fd054(0x2c3)][_0x4fd054(0x1b9)]+')'):'';return _0x4fd054(0x1a7)+_0x58c326+'\x20'+_0x2f4ee5[_0x4fd054(0x1b9)]+_0x4ce57c;});await writeOutput(_0x7a522e['join']('\x0a'),_0xd47ecf['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x2cc);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x1ca);async[a51_0x10da29(0x1e3)](_0x508d46){const _0x54a014=a51_0x10da29,{options:_0x206ce8,args:_0xb1831,tdx:_0x3194f2}=_0x508d46,_0x4cbc3b=this[_0x54a014(0x2ae)](_0xb1831,_0x206ce8);if(!_0x4cbc3b)return 0x1;const {projectName:_0x2c1f77,workflowName:_0x5b7fed}=_0x4cbc3b;if(_0x206ce8['verbose']){if(_0x2c1f77&&_0x5b7fed)console['error'](_0x54a014(0x2a4)+_0x2c1f77+'.'+_0x5b7fed);else _0x2c1f77&&console[_0x54a014(0x2b2)](_0x54a014(0x2c8)+_0x2c1f77);const _0x419005=_0x206ce8[_0x54a014(0x263)];_0x419005&&console['error']('Status:\x20'+_0x419005);}let _0x35e217=0x28;if(process[_0x54a014(0x1cc)][_0x54a014(0x1f4)]&&!_0x206ce8[_0x54a014(0x193)]&&!_0x206ce8[_0x54a014(0x1df)]){const _0x188386=process['stdout']['rows']||0x28;_0x35e217=Math['max'](0x14,Math[_0x54a014(0x250)](_0x188386*0x2/0x3));}const _0x141343=_0x206ce8['limit']||_0x35e217,_0xc489a4=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x3194f2['workflow']['sessions']({'projectName':_0x2c1f77,'workflowName':_0x5b7fed,'status':_0x206ce8[_0x54a014(0x263)],'fromTime':_0x206ce8[_0x54a014(0x192)],'toTime':_0x206ce8['to'],'limit':_0x141343}),{'verbose':_0x206ce8[_0x54a014(0x1ed)]}),_0x279b37=_0xc489a4[_0x54a014(0x15d)];_0x279b37['sort']((_0x2aa6e3,_0x2042b9)=>{const _0x43c2c5=_0x54a014,_0x3d3092=_0x2aa6e3[_0x43c2c5(0x2a5)]||'',_0xd98888=_0x2042b9[_0x43c2c5(0x2a5)]||'';return _0xd98888[_0x43c2c5(0x175)](_0x3d3092);});_0x279b37['length']>=_0x141343?console[_0x54a014(0x2b2)](_0x54a014(0x282)+_0x279b37[_0x54a014(0x1b5)]+'\x20sessions\x20'+a51_0x55b9d6[_0x54a014(0x190)](_0x54a014(0x1e2))):console['error'](_0x54a014(0x267)+_0x279b37[_0x54a014(0x1b5)]+_0x54a014(0x1fc)+(_0x279b37[_0x54a014(0x1b5)]!==0x1?'s':''));if(_0x206ce8[_0x54a014(0x1df)]==='json'||_0x206ce8[_0x54a014(0x1df)]===_0x54a014(0x1ac)||_0x206ce8[_0x54a014(0x1df)]===_0x54a014(0x1b2))await handleSDKOutput(_0x279b37,_0x206ce8);else{if(!process[_0x54a014(0x1cc)][_0x54a014(0x1f4)]||_0x206ce8['output']){if(_0x279b37['length']===0x0){if(_0x2c1f77&&_0x5b7fed)console[_0x54a014(0x222)](_0x54a014(0x25b)+_0x2c1f77+'.'+_0x5b7fed);else _0x2c1f77?console[_0x54a014(0x222)](_0x54a014(0x2a2)+_0x2c1f77):console[_0x54a014(0x222)](_0x54a014(0x189));}else{const _0x30b30f=_0x206ce8[_0x54a014(0x2a9)],_0x3a7b3e=this[_0x54a014(0x219)](_0x279b37,_0x30b30f);_0x206ce8['output']?await writeOutput(_0x3a7b3e,_0x206ce8[_0x54a014(0x193)],'list'):console[_0x54a014(0x222)](_0x3a7b3e);}!_0x2c1f77&&(console[_0x54a014(0x2b2)](''),console[_0x54a014(0x2b2)](a51_0x55b9d6[_0x54a014(0x190)](_0x54a014(0x2db))),console[_0x54a014(0x2b2)](a51_0x55b9d6[_0x54a014(0x190)](_0x54a014(0x1f9))+'or'+a51_0x55b9d6[_0x54a014(0x190)](_0x54a014(0x225))));}else{if(_0x279b37['length']===0x0){if(_0x2c1f77&&_0x5b7fed)console[_0x54a014(0x222)]('No\x20sessions\x20found\x20for:\x20'+_0x2c1f77+'.'+_0x5b7fed);else _0x2c1f77?console[_0x54a014(0x222)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x2c1f77):console['log'](_0x54a014(0x189));}else await this[_0x54a014(0x2d5)](_0x279b37,_0x508d46,_0x2c1f77);}}return 0x0;}[a51_0x10da29(0x219)](_0x54a16e,_0x117dbe){const _0xc2bdaf=a51_0x10da29,_0x41e5b6=[],_0x42d6cb=new Map();let _0x4e0459=Infinity,_0x459c73=-Infinity;for(const _0x53f5dc of _0x54a16e){if(_0x53f5dc[_0xc2bdaf(0x1f7)]?.[_0xc2bdaf(0x2d2)]){const _0x2aa0bd=new Date(_0x53f5dc[_0xc2bdaf(0x1f7)]['createdAt'])[_0xc2bdaf(0x287)](),_0x49c604=_0x53f5dc[_0xc2bdaf(0x1f7)][_0xc2bdaf(0x2c5)]?new Date(_0x53f5dc['lastAttempt'][_0xc2bdaf(0x2c5)])['getTime']():Date[_0xc2bdaf(0x17f)](),_0x3e0a3b=_0x53f5dc[_0xc2bdaf(0x2c3)]?.[_0xc2bdaf(0x1b9)]||_0xc2bdaf(0x1f1);!_0x42d6cb['has'](_0x3e0a3b)&&_0x42d6cb['set'](_0x3e0a3b,[]),_0x42d6cb[_0xc2bdaf(0x1e1)](_0x3e0a3b)[_0xc2bdaf(0x26c)]({'session':_0x53f5dc,'startTime':_0x2aa0bd,'endTime':_0x49c604,'duration':_0x49c604-_0x2aa0bd}),_0x4e0459=Math['min'](_0x4e0459,_0x2aa0bd),_0x459c73=Math[_0xc2bdaf(0x28c)](_0x459c73,_0x49c604);}}if(_0x42d6cb[_0xc2bdaf(0x1b3)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x575a9c=process[_0xc2bdaf(0x1cc)][_0xc2bdaf(0x1a4)]||0x78,_0x27dcc2=0x1e,_0x46f83b=0x32,_0x1c0403=0x4,_0x4de66a=Math[_0xc2bdaf(0x2d6)](_0x46f83b,Math[_0xc2bdaf(0x28c)](_0x27dcc2,Math[_0xc2bdaf(0x250)](_0x575a9c*0.3))),_0x2e97f5=_0x575a9c-_0x4de66a-TIMELINE_CONFIG[_0xc2bdaf(0x1e8)]-0x3-_0x1c0403,_0x4e3d19=_0x459c73-_0x4e0459,_0x3be75d=_0x4e3d19/_0x4de66a,_0x1d403d=renderTimeAxis({'startTime':_0x4e0459,'endTime':_0x459c73,'durationMs':_0x4e3d19,'msPerChar':_0x3be75d},_0x4de66a),_0x9912f9=[];for(const _0x23a7c0 of _0x42d6cb[_0xc2bdaf(0x278)]()){_0x9912f9['push'](..._0x23a7c0);}_0x9912f9[_0xc2bdaf(0x1f2)]((_0x5a0917,_0x714dca)=>_0x714dca[_0xc2bdaf(0x257)]-_0x5a0917['startTime']);const _0x4106ac=new Date(_0x4e0459),_0x10d0eb=formatDate(_0x4106ac),_0x582f18=_0x1c0403+TIMELINE_CONFIG[_0xc2bdaf(0x2ba)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2e97f5,_0x29c71e='\x20'[_0xc2bdaf(0x2b9)](_0x582f18-_0x10d0eb['length']),_0x30d26f=_0x29c71e+a51_0x55b9d6['dim'](_0x10d0eb)+'\x20'+_0x1d403d;_0x41e5b6[_0xc2bdaf(0x26c)](_0x30d26f);const _0x515480=0x16;let _0x5344ef=0x0;for(const _0xdf3240 of _0x9912f9){const _0x383b71=_0xdf3240[_0xc2bdaf(0x22d)][_0xc2bdaf(0x2c3)]?.['name']||'?',_0x2f79c8=Math[_0xc2bdaf(0x2d6)](stringWidth(_0x383b71),_0x515480);_0x5344ef=Math[_0xc2bdaf(0x28c)](_0x5344ef,_0x2f79c8);}for(const _0x1754bf of _0x9912f9){const {session:_0x38eea4,startTime:_0x204742,endTime:_0xaeb974,duration:_0x2af4c8}=_0x1754bf,_0x40a6ae=_0x38eea4[_0xc2bdaf(0x2c3)]?.['id'],_0x3ed5cc=_0x38eea4['id'],_0xa6489b=_0x38eea4['project']?.['name']||'?',_0x3e158c=_0x38eea4[_0xc2bdaf(0x2e5)]?.[_0xc2bdaf(0x1b9)]||'?';let _0x33192d,_0x1d3ac7;if(_0x38eea4[_0xc2bdaf(0x1f7)]){const _0x3cb59e=_0x38eea4[_0xc2bdaf(0x1f7)];!_0x3cb59e[_0xc2bdaf(0x1d9)]?(_0x33192d=_0x3cb59e[_0xc2bdaf(0x21b)]?'🛑':'🔄',_0x1d3ac7=_0x3cb59e[_0xc2bdaf(0x21b)]?a51_0x55b9d6['yellow']:a51_0x55b9d6[_0xc2bdaf(0x2de)]):(_0x33192d=_0x3cb59e[_0xc2bdaf(0x1f6)]?'✅':'❌',_0x1d3ac7=_0x3cb59e['success']?a51_0x55b9d6[_0xc2bdaf(0x270)]:a51_0x55b9d6[_0xc2bdaf(0x275)]);}else _0x33192d='⏳',_0x1d3ac7=a51_0x55b9d6[_0xc2bdaf(0x190)];const _0x5dac23='#'+_0x3ed5cc,_0x42f171=_0x40a6ae?hyperlink(_0x5dac23,getWorkflowSessionUrl(_0x117dbe,_0x40a6ae,_0x3ed5cc)):_0x5dac23;let _0x298ce5=_0xa6489b;stringWidth(_0xa6489b)>_0x515480&&(_0x298ce5=_0xa6489b['slice'](0x0,_0x515480-0x1)+'…');const _0x2e46c3=a51_0x55b9d6[_0xc2bdaf(0x190)](_0x298ce5),_0x300269=stringWidth(_0x298ce5),_0x5a59a6='\x20'[_0xc2bdaf(0x2b9)](_0x5344ef-stringWidth(_0x298ce5)+0x2),_0x337581='('+formatElapsed(_0x2af4c8)+')',_0x2fdd39=stringWidth(_0x337581),_0x26f08a=stringWidth(_0x5dac23),_0x190279=_0x26f08a+0x1+_0x300269+_0x5a59a6[_0xc2bdaf(0x1b5)],_0x409fb6=_0x2e97f5-_0x190279-_0x2fdd39-0x1-0x8;let _0x56a616=_0x3e158c;stringWidth(_0x56a616)>_0x409fb6&&(_0x56a616=_0x56a616[_0xc2bdaf(0x2e9)](0x0,_0x409fb6-0x1)+'…');const _0x2098e5=_0x42f171+'\x20'+_0x2e46c3+_0x5a59a6+_0x56a616,_0x278cd8=stringWidth(_0x2098e5),_0x4cd0b2=_0x2e97f5-_0x278cd8-_0x2fdd39,_0x3c7477=_0x2098e5+'\x20'[_0xc2bdaf(0x2b9)](Math[_0xc2bdaf(0x28c)](0x1,_0x4cd0b2))+a51_0x55b9d6[_0xc2bdaf(0x190)](_0x337581),_0x431d2b=Math['floor']((_0x204742-_0x4e0459)/_0x3be75d),_0x25ddd6=Math[_0xc2bdaf(0x250)]((_0xaeb974-_0x4e0459)/_0x3be75d),_0x55f353=Math[_0xc2bdaf(0x28c)](_0x431d2b+0x1,_0x25ddd6),_0x1bbbed=new Array(_0x4de66a)['fill']('\x20');for(let _0x1b4460=_0x431d2b;_0x1b4460<Math[_0xc2bdaf(0x2d6)](_0x55f353,_0x4de66a);_0x1b4460++){_0x1bbbed[_0x1b4460]='─';}const _0x193c9a=_0x1bbbed['map'](_0x4ca925=>_0x4ca925==='\x20'?'\x20':_0x1d3ac7(_0x4ca925))[_0xc2bdaf(0x246)]('');_0x41e5b6[_0xc2bdaf(0x26c)](_0x33192d+'\x20'+_0x3c7477+'│'+_0x193c9a+'│');}return _0x41e5b6['join']('\x0a');}async['navigateSessionsInteractive'](_0x4a8132,_0x54f417,_0x3b99fe){const _0x316eed=a51_0x10da29,{options:_0x6140d,tdx:_0x208621}=_0x54f417,_0x2e7119=_0x6140d[_0x316eed(0x2a9)],{timelineRows:_0x44cadf,timeAxisHeader:_0x1f6db2}=this['generateSessionTimelineRows'](_0x4a8132,_0x2e7119),_0x3bd420=_0x44cadf['filter'](_0x3a4166=>_0x3a4166['attemptId']);if(_0x3bd420['length']===0x0){const _0x36c534=this[_0x316eed(0x219)](_0x4a8132,_0x2e7119);console['log'](_0x36c534);!_0x3b99fe&&(console[_0x316eed(0x2b2)](''),console[_0x316eed(0x2b2)](a51_0x55b9d6[_0x316eed(0x190)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x316eed(0x2b2)](a51_0x55b9d6['dim'](_0x316eed(0x1f9))+'or'+a51_0x55b9d6[_0x316eed(0x190)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x1f6db2&&console[_0x316eed(0x222)](_0x1f6db2);const _0x30ebd8=_0x44cadf[_0x316eed(0x162)](_0x498dbd=>_0x498dbd[_0x316eed(0x20d)])[_0x316eed(0x1cb)](_0x19966c=>({'title':_0x19966c[_0x316eed(0x16a)],'value':_0x19966c['attemptId']})),_0x37b35f=process[_0x316eed(0x1cc)][_0x316eed(0x27a)]||0x3c,_0x1f7868=Math[_0x316eed(0x28c)](0x28,Math[_0x316eed(0x250)](_0x37b35f*0x2/0x3)),_0x3872b2=await a51_0x5637a3({'type':_0x316eed(0x23e),'name':_0x316eed(0x20d),'message':_0x316eed(0x1c4),'choices':_0x30ebd8,'initial':-0x1,'limit':_0x1f7868,'clearFirst':!![],'fallback':{'title':_0x316eed(0x1b6),'value':null},'suggest':(_0x19986a,_0x4029f5)=>{const _0x1641f2=_0x316eed;if(!_0x19986a)return Promise[_0x1641f2(0x150)](_0x4029f5);const _0x132276=_0x4029f5[_0x1641f2(0x162)](_0xe961f=>{const _0x8fb4dc=_0x1641f2,_0x67b694=_0xe961f;return _0x67b694['title'][_0x8fb4dc(0x259)]()[_0x8fb4dc(0x15e)](_0x19986a[_0x8fb4dc(0x259)]());});return Promise[_0x1641f2(0x150)](_0x132276);}}),_0x2f415a=()=>{const _0xbb536b=_0x316eed;process['stdout'][_0xbb536b(0x179)]('\x1b[1A\x1b[2K'),process[_0xbb536b(0x1cc)][_0xbb536b(0x179)](_0xbb536b(0x17b)),process[_0xbb536b(0x1cc)][_0xbb536b(0x179)](_0xbb536b(0x17b));},_0x46d71c=_0x3872b2&&_0x3872b2[_0x316eed(0x20d)]&&_0x3872b2[_0x316eed(0x20d)]!==null&&_0x3872b2['attemptId'][_0x316eed(0x187)]()!=='';if(!_0x46d71c){_0x2f415a(),console[_0x316eed(0x222)](a51_0x55b9d6[_0x316eed(0x190)](_0x316eed(0x2e6)));return;}_0x2f415a();const _0x4ad8ab=_0x4a8132[_0x316eed(0x2a7)](_0x941e74=>_0x941e74[_0x316eed(0x1f7)]?.['id']===_0x3872b2['attemptId']);if(_0x4ad8ab){const _0x5f2ad0=_0x4ad8ab['project']?.[_0x316eed(0x1b9)]||'?',_0x5eb993=_0x4ad8ab[_0x316eed(0x2e5)]?.[_0x316eed(0x1b9)]||'?';console[_0x316eed(0x222)](_0x316eed(0x19b)+a51_0x55b9d6[_0x316eed(0x190)](_0x5f2ad0)+',\x20Workflow:\x20'+a51_0x55b9d6[_0x316eed(0x190)](_0x5eb993));}const _0x1a7a13=new WorkflowTimelineCommand();await _0x1a7a13[_0x316eed(0x1e3)]({'args':[],'options':{..._0x6140d,'attemptId':_0x3872b2[_0x316eed(0x20d)]},'tdx':_0x208621});}[a51_0x10da29(0x176)](_0x5770b3,_0x22bdfe){const _0x2ba10d=a51_0x10da29,_0x4448e9=new Map();for(const _0x4fb6da of _0x5770b3){_0x4fb6da['id']&&_0x4fb6da['lastAttempt']?.['id']&&_0x4448e9[_0x2ba10d(0x2c7)](_0x4fb6da['id'],_0x4fb6da[_0x2ba10d(0x1f7)]['id']);}const _0x3e5b62=[];let _0x2b8c26='';const _0x19a54b=this['renderSessionsTimeline'](_0x5770b3,_0x22bdfe),_0x5e97af=_0x19a54b[_0x2ba10d(0x18d)]('\x0a');for(const _0x3ec752 of _0x5e97af){if(_0x3ec752[_0x2ba10d(0x24b)](_0x2ba10d(0x164))||_0x3ec752[_0x2ba10d(0x1fd)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2b8c26=_0x3ec752;else{if(_0x3ec752['match'](/^[✅❌🔄🛑⏳]/)){const _0x3feb6f=_0x3ec752[_0x2ba10d(0x1fd)](/#(\d+)/),_0x27c42a=_0x3feb6f?_0x3feb6f[0x1]:null,_0x31a442=_0x27c42a?_0x4448e9['get'](_0x27c42a)||null:null,_0xf37b45=_0x5770b3['find'](_0x1a803a=>_0x1a803a['id']===_0x27c42a),_0x286cd0=_0xf37b45?.[_0x2ba10d(0x2c3)]?.[_0x2ba10d(0x1b9)]||'';_0x3e5b62[_0x2ba10d(0x26c)]({'displayLine':_0x3ec752,'attemptId':_0x31a442,'projectName':_0x286cd0});}}}return{'timelineRows':_0x3e5b62,'timeAxisHeader':_0x2b8c26};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]='workflow:attempts';['description']=a51_0x10da29(0x197);async[a51_0x10da29(0x1e3)](_0x5e1077){const _0xeb21f8=a51_0x10da29,{options:_0x2e5795,args:_0x29fa9f,tdx:_0xddfdd0}=_0x5e1077,_0x7daf59=this[_0xeb21f8(0x2ae)](_0x29fa9f,_0x2e5795);if(!_0x7daf59)return 0x1;const {projectName:_0x4d950d,workflowName:_0x441eb1}=_0x7daf59,_0x7327b8=_0x2e5795['includeRetried'];if(_0x2e5795[_0xeb21f8(0x1ed)]){if(_0x4d950d&&_0x441eb1)console[_0xeb21f8(0x2b2)](_0xeb21f8(0x2a4)+_0x4d950d+'.'+_0x441eb1);else _0x4d950d&&console['error']('Filter:\x20project='+_0x4d950d);_0x7327b8&&console[_0xeb21f8(0x2b2)](_0xeb21f8(0x26e));}const _0xc1b6e0=await withSpinner(_0xeb21f8(0x204),()=>_0xddfdd0[_0xeb21f8(0x2e5)][_0xeb21f8(0x191)]({'projectName':_0x4d950d,'workflowName':_0x441eb1,'includeRetried':_0x7327b8,'limit':_0x2e5795[_0xeb21f8(0x280)]}),{'verbose':_0x2e5795['verbose']}),_0x10fa13=_0xc1b6e0[_0xeb21f8(0x15d)],_0x39de60=_0x2e5795[_0xeb21f8(0x280)]||0x64,_0x6f5431=_0x10fa13[_0xeb21f8(0x1b5)]>=_0x39de60?a51_0x55b9d6[_0xeb21f8(0x190)](_0xeb21f8(0x2a6)):'';console['error'](_0xeb21f8(0x267)+_0x10fa13[_0xeb21f8(0x1b5)]+'\x20attempt'+(_0x10fa13[_0xeb21f8(0x1b5)]!==0x1?'s':'')+_0x6f5431);if(_0x2e5795[_0xeb21f8(0x1df)]==='json'||_0x2e5795[_0xeb21f8(0x1df)]===_0xeb21f8(0x1ac)||_0x2e5795[_0xeb21f8(0x1df)]===_0xeb21f8(0x1b2))await handleSDKOutput(_0x10fa13,_0x2e5795);else{if(_0x10fa13[_0xeb21f8(0x1b5)]===0x0){if(_0x4d950d&&_0x441eb1)console['log'](_0xeb21f8(0x155)+_0x4d950d+'.'+_0x441eb1);else _0x4d950d?console[_0xeb21f8(0x222)](_0xeb21f8(0x1bc)+_0x4d950d):console[_0xeb21f8(0x222)](_0xeb21f8(0x293));}else{const _0x2ba7b9=_0x2e5795['site'],_0x30504b=_0x10fa13[_0xeb21f8(0x1cb)](_0x44c4d6=>{const _0x1023da=_0xeb21f8,_0x1f0d28=a51_0x55b9d6[_0x1023da(0x190)]('#'+_0x44c4d6['id']),_0x1849fa=_0x44c4d6[_0x1023da(0x2c3)]?.['id'],_0x3e2a20=_0x44c4d6[_0x1023da(0x1b4)]||_0x44c4d6['sessionId'],_0x4f0837=_0x1849fa&&_0x3e2a20?hyperlink(_0x1f0d28,getWorkflowAttemptUrl(_0x2ba7b9,_0x1849fa,_0x3e2a20,_0x44c4d6['id'])):_0x1f0d28,{icon:_0x206eca,text:_0x44f726}=getAttemptStatusDisplay(_0x44c4d6),_0x4c7436=(_0x44c4d6[_0x1023da(0x2c3)]?.[_0x1023da(0x1b9)]||'?')+'.'+(_0x44c4d6[_0x1023da(0x2e5)]?.['name']||'?'),_0x317db6=_0x44c4d6[_0x1023da(0x2a5)]?a51_0x55b9d6[_0x1023da(0x190)](_0x44c4d6[_0x1023da(0x2a5)]):'';return(_0x4f0837+'\x20'+_0x206eca+(_0x44f726?'\x20'+_0x44f726:'')+'\x20'+_0x4c7436+'\x20'+_0x317db6)['trimEnd']();});await writeOutput(_0x30504b['join']('\x0a'),_0x2e5795[_0xeb21f8(0x193)],_0xeb21f8(0x16c));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x274);['description']=a51_0x10da29(0x1ce);async[a51_0x10da29(0x1e3)](_0x55a1a4){const _0x70a5a7=a51_0x10da29,{options:_0x4ee046,args:_0x2411b2,tdx:_0x800335}=_0x55a1a4,_0x489af5=_0x2411b2[0x0];if(!_0x489af5)return console[_0x70a5a7(0x2b2)](_0x70a5a7(0x174)),0x1;_0x4ee046[_0x70a5a7(0x1ed)]&&console['error'](_0x70a5a7(0x241)+_0x489af5);const _0x4fe17f=await withSpinner(_0x70a5a7(0x262),()=>_0x800335[_0x70a5a7(0x2e5)][_0x70a5a7(0x224)](_0x489af5),{'verbose':_0x4ee046[_0x70a5a7(0x1ed)]}),_0x13fc2b=_0x4fe17f[_0x70a5a7(0x15d)];let _0x229a43;!_0x13fc2b[_0x70a5a7(0x1d9)]?_0x229a43=_0x13fc2b[_0x70a5a7(0x21b)]?_0x70a5a7(0x297):_0x70a5a7(0x1ee):_0x229a43=_0x13fc2b[_0x70a5a7(0x1f6)]?'success':_0x70a5a7(0x2b2);let _0x35c9b1;if(_0x13fc2b[_0x70a5a7(0x2d2)]&&_0x13fc2b['finishedAt']){const _0x5bcc5a=new Date(_0x13fc2b[_0x70a5a7(0x2d2)])[_0x70a5a7(0x287)](),_0x3caae5=new Date(_0x13fc2b[_0x70a5a7(0x2c5)])[_0x70a5a7(0x287)]();_0x35c9b1=Math[_0x70a5a7(0x23d)]((_0x3caae5-_0x5bcc5a)/0x3e8);}const _0x534a39={'attempt_id':_0x13fc2b['id'],'status':_0x229a43,..._0x13fc2b['index']!==undefined&&{'index':_0x13fc2b[_0x70a5a7(0x273)]},..._0x13fc2b[_0x70a5a7(0x2c3)]&&{'project':_0x13fc2b['project']['name']},..._0x13fc2b[_0x70a5a7(0x2e5)]&&{'workflow':_0x13fc2b[_0x70a5a7(0x2e5)][_0x70a5a7(0x1b9)]},..._0x13fc2b[_0x70a5a7(0x2dd)]&&{'session_id':_0x13fc2b[_0x70a5a7(0x2dd)]},..._0x13fc2b[_0x70a5a7(0x2a5)]&&{'session_time':_0x13fc2b[_0x70a5a7(0x2a5)]},..._0x13fc2b[_0x70a5a7(0x14b)]&&{'retry_attempt':_0x13fc2b[_0x70a5a7(0x14b)]},..._0x35c9b1!==undefined&&{'duration_sec':_0x35c9b1},..._0x13fc2b[_0x70a5a7(0x2d2)]&&{'created_at':_0x13fc2b[_0x70a5a7(0x2d2)]},..._0x13fc2b[_0x70a5a7(0x2c5)]&&{'finished_at':_0x13fc2b[_0x70a5a7(0x2c5)]},...Object[_0x70a5a7(0x231)](_0x13fc2b['params'])[_0x70a5a7(0x1b5)]>0x0&&{'params':_0x13fc2b['params']}};return await handleSingleObjectOutput(_0x534a39,_0x4ee046),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x20b);['description']=a51_0x10da29(0x169);async['execute'](_0x44e77e){const _0x2fbd76=a51_0x10da29,{options:_0x42b601,args:_0x5e43cb,tdx:_0xbf6498}=_0x44e77e,_0x307729=_0x5e43cb[0x0];if(!_0x307729)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x101819=_0x42b601[_0x2fbd76(0x285)];_0x42b601['verbose']&&(console[_0x2fbd76(0x2b2)](_0x2fbd76(0x241)+_0x307729),_0x101819&&console[_0x2fbd76(0x2b2)](_0x2fbd76(0x209)));const _0x4192c3=await withSpinner(_0x2fbd76(0x183),()=>_0xbf6498[_0x2fbd76(0x2e5)][_0x2fbd76(0x1f0)](_0x307729,_0x101819||![]),{'verbose':_0x42b601[_0x2fbd76(0x1ed)]}),_0x4f98a1=_0x4192c3[_0x2fbd76(0x15d)];return console[_0x2fbd76(0x2b2)](_0x2fbd76(0x267)+_0x4f98a1[_0x2fbd76(0x1b5)]+_0x2fbd76(0x1d0)+(_0x4f98a1[_0x2fbd76(0x1b5)]!==0x1?'s':'')),await handleSDKOutput(_0x4f98a1,_0x42b601),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x26b);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x2be);async['execute'](_0x4a6d6d){const _0x5ad5a9=a51_0x10da29,{options:_0x2226c1,args:_0x5a3128,tdx:_0x532872}=_0x4a6d6d,_0x39b90a=_0x5a3128[0x0];let _0x3a673d=_0x5a3128[0x1];if(!_0x39b90a)return console['error'](_0x5ad5a9(0x174)),0x1;_0x2226c1[_0x5ad5a9(0x1ed)]&&(console[_0x5ad5a9(0x2b2)](_0x5ad5a9(0x241)+_0x39b90a),_0x3a673d&&console[_0x5ad5a9(0x2b2)](_0x5ad5a9(0x151)+_0x3a673d));const _0x2c71cb=await withSpinner('Fetching\x20log\x20files...',()=>_0x532872['workflow']['logFiles'](_0x39b90a,_0x3a673d),{'verbose':_0x2226c1[_0x5ad5a9(0x1ed)]}),_0x1c8fc7=_0x2c71cb[_0x5ad5a9(0x15d)];if(_0x1c8fc7[_0x5ad5a9(0x1b5)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3a673d&&(_0x2226c1[_0x5ad5a9(0x29c)]||_0x2226c1[_0x5ad5a9(0x1df)]))return await handleSDKOutput(_0x1c8fc7,_0x2226c1),0x0;if(!_0x3a673d){const _0xc714c7=_0x1c8fc7[_0x5ad5a9(0x1cb)](_0x84ea17=>({'title':_0x84ea17[_0x5ad5a9(0x21e)]+'\x20('+formatBytes(_0x84ea17[_0x5ad5a9(0x2bd)])+')','value':_0x84ea17[_0x5ad5a9(0x21e)]})),_0xd47c2b=await a51_0x5637a3({'type':_0x5ad5a9(0x1aa),'name':_0x5ad5a9(0x2ac),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0xc714c7});if(!_0xd47c2b['task'])return console[_0x5ad5a9(0x2b2)](_0x5ad5a9(0x2e6)),0x0;_0x3a673d=_0xd47c2b[_0x5ad5a9(0x2ac)];}const _0xf046fd=await withSpinner('Downloading\x20logs...',()=>_0x532872[_0x5ad5a9(0x2e5)][_0x5ad5a9(0x1a8)](_0x39b90a,_0x3a673d),{'verbose':_0x2226c1[_0x5ad5a9(0x1ed)]}),_0x2fe0bd=_0xf046fd[_0x5ad5a9(0x15d)];return _0x2fe0bd?console[_0x5ad5a9(0x222)](_0x2fe0bd):console[_0x5ad5a9(0x2b2)](_0x5ad5a9(0x1c0)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x260);['description']=a51_0x10da29(0x265);async[a51_0x10da29(0x1e3)](_0x1835f9){const _0x3f1e1b=a51_0x10da29,{options:_0x24f72c,args:_0x1f095c,tdx:_0x50dc14}=_0x1835f9,_0x1412a6=_0x1f095c[0x0];if(!_0x1412a6)return console['error'](_0x3f1e1b(0x174)),0x1;const _0x207e83=_0x24f72c[_0x3f1e1b(0x15a)];_0x24f72c[_0x3f1e1b(0x1ed)]&&(console[_0x3f1e1b(0x2b2)](_0x3f1e1b(0x241)+_0x1412a6),_0x207e83&&console[_0x3f1e1b(0x2b2)](_0x3f1e1b(0x2c1)+_0x207e83));if(!_0x24f72c[_0x3f1e1b(0x23a)]){if(!isInteractive())return console[_0x3f1e1b(0x2b2)](a51_0x55b9d6[_0x3f1e1b(0x275)](_0x3f1e1b(0x1d1)),_0x3f1e1b(0x261)),console[_0x3f1e1b(0x2b2)](a51_0x55b9d6['dim'](_0x3f1e1b(0x20e))),0x1;const _0x21908b=await confirmKey(_0x3f1e1b(0x24f)+_0x1412a6+'?');if(!_0x21908b)return console[_0x3f1e1b(0x2b2)](a51_0x55b9d6['yellow'](_0x3f1e1b(0x2e6))),0x1;}const _0x314b1c=await withSpinner(_0x3f1e1b(0x20c),()=>_0x50dc14[_0x3f1e1b(0x2e5)]['kill'](_0x1412a6,_0x207e83),{'verbose':_0x24f72c['verbose']}),_0x30423c=_0x314b1c[_0x3f1e1b(0x15d)];return console['error']('✔\x20'+_0x30423c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';[a51_0x10da29(0x2c0)]=a51_0x10da29(0x24d);async[a51_0x10da29(0x1e3)](_0x4175f2){const _0xf4fd03=a51_0x10da29,{options:_0x4f23c5,args:_0x459c5f,tdx:_0xe91ddb}=_0x4175f2,_0x1b1a50=_0x459c5f[0x0];if(!_0x1b1a50)return console[_0xf4fd03(0x2b2)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0xf4fd03(0x2b2)](_0xf4fd03(0x17e)),0x1;let _0x29bf05=![],_0x224462=_0x1b1a50;if(_0x1b1a50[_0xf4fd03(0x24b)](_0xf4fd03(0x217)))_0x29bf05=!![],_0x224462=_0x1b1a50['substring'](0x8);else{if(_0x1b1a50[_0xf4fd03(0x24b)]('attempt:'))_0x29bf05=![],_0x224462=_0x1b1a50['substring'](0x8);else return console[_0xf4fd03(0x2b2)](_0xf4fd03(0x23f)),console[_0xf4fd03(0x2b2)](_0xf4fd03(0x17e)),0x1;}const _0x4d82e8=_0x4f23c5[_0xf4fd03(0x249)],_0x3815ea=_0x4f23c5['resumeFrom'],_0x4aa3d2=_0x4f23c5[_0xf4fd03(0x2ce)],_0x376a04=_0x4f23c5[_0xf4fd03(0x146)];_0x4f23c5[_0xf4fd03(0x1ed)]&&(console[_0xf4fd03(0x2b2)](_0xf4fd03(0x272)+(_0x29bf05?_0xf4fd03(0x22d):_0xf4fd03(0x224))+'\x20'+_0x224462),_0x4d82e8&&console[_0xf4fd03(0x2b2)]('From\x20task:\x20'+_0x4d82e8),_0x3815ea&&console['error'](_0xf4fd03(0x27c)+_0x3815ea),_0x4aa3d2&&console[_0xf4fd03(0x2b2)]('Params:\x20'+_0x4aa3d2),_0x376a04&&console[_0xf4fd03(0x2b2)](_0xf4fd03(0x214)));let _0x5d3437;if(_0x4aa3d2)try{if(_0x4aa3d2[_0xf4fd03(0x24b)]('@')){const _0x24c69e=await import(_0xf4fd03(0x29e)),_0x1d3d07=_0x4aa3d2[_0xf4fd03(0x172)](0x1),_0x1600d6=await _0x24c69e[_0xf4fd03(0x213)](_0x1d3d07,_0xf4fd03(0x201));_0x5d3437=JSON['parse'](_0x1600d6);}else _0x5d3437=JSON[_0xf4fd03(0x2b7)](_0x4aa3d2);}catch{return console[_0xf4fd03(0x2b2)](_0xf4fd03(0x268)),0x1;}if(!_0x4f23c5['yes']){if(!isInteractive())return console[_0xf4fd03(0x2b2)](a51_0x55b9d6['red'](_0xf4fd03(0x1d1)),_0xf4fd03(0x261)),console['error'](a51_0x55b9d6[_0xf4fd03(0x190)](_0xf4fd03(0x20e))),0x1;const _0x349399=await confirmKey(_0xf4fd03(0x26d)+(_0x29bf05?'session':_0xf4fd03(0x224))+'\x20'+_0x224462+'?');if(!_0x349399)return console['error'](a51_0x55b9d6[_0xf4fd03(0x284)](_0xf4fd03(0x2e6))),0x1;}let _0x3f8c9e;_0x29bf05?_0x3f8c9e=await withSpinner(_0xf4fd03(0x2a3),()=>_0xe91ddb['workflow'][_0xf4fd03(0x232)](_0x224462,{'fromTask':_0x4d82e8,'retryParams':_0x5d3437}),{'verbose':_0x4f23c5['verbose']}):_0x3f8c9e=await withSpinner('Retrying\x20attempt...',()=>_0xe91ddb[_0xf4fd03(0x2e5)]['retryAttempt'](_0x224462,{'resumeFrom':_0x3815ea,'retryParams':_0x5d3437,'force':_0x376a04}),{'verbose':_0x4f23c5[_0xf4fd03(0x1ed)]});const _0x43d8e=_0x3f8c9e[_0xf4fd03(0x15d)];return console[_0xf4fd03(0x2b2)](_0xf4fd03(0x277)),console['error'](_0xf4fd03(0x2b3)+_0x43d8e[_0xf4fd03(0x20d)]),console['error'](_0xf4fd03(0x27f)+_0x43d8e[_0xf4fd03(0x2dd)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x180);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x1d3);async[a51_0x10da29(0x1e3)](_0x1b3eff){const _0x3f331f=a51_0x10da29,{options:_0x3d7c84,args:_0x32d2de,tdx:_0x1ad0f8}=_0x1b3eff;let _0x45b68f=_0x32d2de[0x0];if(!_0x45b68f){const _0x341830=this[_0x3f331f(0x240)]([],_0x3d7c84),_0x381a91=await withSpinner('Loading\x20workflows...',()=>_0x1ad0f8[_0x3f331f(0x2e5)][_0x3f331f(0x29d)](_0x341830,{'limit':_0x3d7c84[_0x3f331f(0x280)]}),{'verbose':_0x3d7c84[_0x3f331f(0x1ed)]}),_0x3176a0=_0x381a91['data'];if(_0x3176a0['length']===0x0)return console['error']('No\x20workflows\x20found'),!_0x341830&&console[_0x3f331f(0x2b2)](a51_0x55b9d6[_0x3f331f(0x190)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x168482=_0x3176a0[_0x3f331f(0x1cb)](_0x3a9eb8=>({'title':_0x3a9eb8[_0x3f331f(0x2c3)]?.[_0x3f331f(0x1b9)]+'.'+_0x3a9eb8[_0x3f331f(0x1b9)],'value':_0x3a9eb8[_0x3f331f(0x2c3)]?.['name']+'.'+_0x3a9eb8[_0x3f331f(0x1b9)],'description':_0x3a9eb8[_0x3f331f(0x149)]?_0x3f331f(0x29a)+_0x3a9eb8['revision']:undefined})),_0x3ead9d=await a51_0x5637a3({'type':_0x3f331f(0x1aa),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x168482});if(!_0x3ead9d['workflow'])return 0x1;_0x45b68f=_0x3ead9d[_0x3f331f(0x2e5)];}if(!_0x45b68f['includes']('.')){const _0x199651=this[_0x3f331f(0x240)]([],_0x3d7c84);if(_0x199651)_0x45b68f=_0x199651+'.'+_0x45b68f;else return console[_0x3f331f(0x2b2)](a51_0x55b9d6['red']('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a51_0x55b9d6[_0x3f331f(0x190)](_0x3f331f(0x24c))),0x1;}const _0x24308e=_0x3d7c84[_0x3f331f(0x1b7)],_0x11921e=_0x3d7c84[_0x3f331f(0x2a5)],_0x4f9b3a={};if(_0x24308e&&Array[_0x3f331f(0x22a)](_0x24308e))for(const _0x4ddf3c of _0x24308e){const _0x450d48=_0x4ddf3c[_0x3f331f(0x299)]('=');if(_0x450d48===-0x1)return console[_0x3f331f(0x2b2)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4ddf3c),console[_0x3f331f(0x2b2)](_0x3f331f(0x1bd)),0x1;const _0x2592b4=_0x4ddf3c['substring'](0x0,_0x450d48),_0xc88b5e=_0x4ddf3c[_0x3f331f(0x172)](_0x450d48+0x1);try{_0x4f9b3a[_0x2592b4]=JSON['parse'](_0xc88b5e);}catch{_0x4f9b3a[_0x2592b4]=_0xc88b5e;}}_0x3d7c84['verbose']&&(console[_0x3f331f(0x2b2)]('Workflow:\x20'+_0x45b68f),Object[_0x3f331f(0x231)](_0x4f9b3a)[_0x3f331f(0x1b5)]>0x0&&console[_0x3f331f(0x2b2)](_0x3f331f(0x266)+JSON[_0x3f331f(0x2e8)](_0x4f9b3a)),_0x11921e&&console[_0x3f331f(0x2b2)](_0x3f331f(0x1ff)+_0x11921e));const _0xf1925c=await withSpinner(_0x3f331f(0x1e4),()=>_0x1ad0f8[_0x3f331f(0x2e5)]['run'](_0x45b68f,_0x4f9b3a,{'sessionTime':_0x11921e}),{'verbose':_0x3d7c84[_0x3f331f(0x1ed)]}),_0x1a2d75=_0xf1925c[_0x3f331f(0x15d)];console[_0x3f331f(0x2b2)](_0x3f331f(0x218)),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x1a2d75['id']),console[_0x3f331f(0x2b2)]('\x20\x20Session\x20ID:\x20'+_0x1a2d75['sessionId']),console[_0x3f331f(0x2b2)]('\x20\x20Project:\x20'+_0x1a2d75[_0x3f331f(0x2c3)]?.[_0x3f331f(0x1b9)]),console[_0x3f331f(0x2b2)](_0x3f331f(0x168)+_0x1a2d75[_0x3f331f(0x2e5)]?.[_0x3f331f(0x1b9)]);if(_0x1a2d75[_0x3f331f(0x2c3)]?.['id']&&_0x1a2d75[_0x3f331f(0x2dd)]&&_0x1a2d75['id']){const _0x299596=_0x3d7c84[_0x3f331f(0x2a9)],_0xcda364=getConsoleUrl(_0x299596,_0x3f331f(0x255)+_0x1a2d75[_0x3f331f(0x2c3)]['id']+_0x3f331f(0x2cb)+_0x1a2d75['sessionId']+_0x3f331f(0x2a0)+_0x1a2d75['id']);console[_0x3f331f(0x2b2)](_0x3f331f(0x251)+a51_0x55b9d6[_0x3f331f(0x1da)](_0xcda364));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x1d6);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x2e1);async[a51_0x10da29(0x1e3)](_0x3a45bf){const _0x51a7ea=a51_0x10da29,{options:_0x4d1421,args:_0x322b7a,tdx:_0x3be260}=_0x3a45bf,_0x158f89=_0x322b7a[0x0],_0x36b2c9=_0x322b7a[0x1]||'.';if(!_0x158f89)return console[_0x51a7ea(0x2b2)](_0x51a7ea(0x26a)),console[_0x51a7ea(0x2b2)](_0x51a7ea(0x252)),0x1;const _0x3fa5e7=_0x4d1421[_0x51a7ea(0x149)];_0x4d1421[_0x51a7ea(0x1ed)]&&(console[_0x51a7ea(0x2b2)](_0x51a7ea(0x19b)+_0x158f89),console[_0x51a7ea(0x2b2)](_0x51a7ea(0x188)+_0x36b2c9),_0x3fa5e7&&console[_0x51a7ea(0x2b2)](_0x51a7ea(0x237)+_0x3fa5e7));const _0x58b77b=await withSpinner(_0x51a7ea(0x1c1)+_0x158f89+_0x51a7ea(0x185),()=>_0x3be260['workflow'][_0x51a7ea(0x182)](_0x158f89,_0x36b2c9,{'revision':_0x3fa5e7}),{'verbose':_0x4d1421[_0x51a7ea(0x1ed)]}),_0x5ddb9c=_0x58b77b[_0x51a7ea(0x15d)];return console['error']('✔\x20Downloaded\x20'+_0x5ddb9c[_0x51a7ea(0x14d)]),console[_0x51a7ea(0x2b2)](_0x51a7ea(0x2b8)+_0x5ddb9c[_0x51a7ea(0x149)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x5ddb9c[_0x51a7ea(0x24e)]),console[_0x51a7ea(0x2b2)](_0x51a7ea(0x2e4)+_0x36b2c9+'/'+_0x5ddb9c['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x10da29(0x27d);['description']=a51_0x10da29(0x18b);async[a51_0x10da29(0x1e3)](_0x23aa62){const _0x57c392=a51_0x10da29,{options:_0x51fce8,args:_0x1b252c,tdx:_0x345454}=_0x23aa62;let _0x3af14b='.',_0x572d98=_0x51fce8[_0x57c392(0x1b9)];if(_0x1b252c[0x0]){const {promises:_0x415067}=await import('fs');try{const _0x684fa6=await _0x415067[_0x57c392(0x269)](_0x1b252c[0x0]);if(_0x684fa6['isDirectory']())_0x3af14b=_0x1b252c[0x0];else return console[_0x57c392(0x2b2)]('Error:\x20'+_0x1b252c[0x0]+_0x57c392(0x253)),0x1;}catch{_0x572d98=_0x1b252c[0x0],_0x3af14b='.';}}const _0x489e83=_0x51fce8[_0x57c392(0x149)],_0x372bdc=_0x51fce8['skipValidation'];_0x51fce8[_0x57c392(0x1ed)]&&(console['error'](_0x57c392(0x294)+_0x3af14b),_0x572d98&&console[_0x57c392(0x2b2)]('Project\x20name:\x20'+_0x572d98),_0x489e83&&console[_0x57c392(0x2b2)](_0x57c392(0x237)+_0x489e83),_0x372bdc&&console[_0x57c392(0x2b2)]('Validation:\x20skipped'));const _0x45fcba=await withSpinner(_0x57c392(0x1e5),()=>_0x345454[_0x57c392(0x2e5)][_0x57c392(0x26c)](_0x3af14b,{'projectName':_0x572d98,'revision':_0x489e83,'skipValidation':_0x372bdc}),{'verbose':_0x51fce8[_0x57c392(0x1ed)]}),_0x913fed=_0x45fcba[_0x57c392(0x15d)];return console[_0x57c392(0x2b2)](_0x57c392(0x2d9)+_0x913fed['projectName']),console[_0x57c392(0x2b2)](_0x57c392(0x14a)+_0x913fed[_0x57c392(0x2bb)]),console[_0x57c392(0x2b2)](_0x57c392(0x2b8)+_0x913fed[_0x57c392(0x149)]),await this[_0x57c392(0x208)](_0x345454,_0x913fed[_0x57c392(0x14d)],_0x51fce8['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x1de);[a51_0x10da29(0x2c0)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a51_0x10da29(0x1e3)](_0x493416){const _0x481b5b=a51_0x10da29,{options:_0x471f59,args:_0x1a2277,tdx:_0x4dec44}=_0x493416,_0x5db744=_0x1a2277[0x0],_0x29598f=_0x1a2277[0x1];if(!_0x5db744)return console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x275)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x190)](_0x481b5b(0x1be))),0x1;const _0x566de1=_0x471f59[_0x481b5b(0x149)];_0x471f59[_0x481b5b(0x1ed)]&&(console[_0x481b5b(0x2b2)](_0x481b5b(0x19b)+_0x5db744),_0x29598f&&console[_0x481b5b(0x2b2)](_0x481b5b(0x16e)+_0x29598f),_0x566de1&&console['error'](_0x481b5b(0x237)+_0x566de1),_0x471f59[_0x481b5b(0x1fa)]&&console['error'](_0x481b5b(0x1a9)));const _0x4e39ed=await withSpinner(_0x481b5b(0x1ea)+_0x5db744+_0x481b5b(0x185),()=>_0x4dec44[_0x481b5b(0x2e5)]['pullProject'](_0x5db744,{'targetDir':_0x29598f,'revision':_0x566de1}),{'verbose':_0x471f59[_0x481b5b(0x1ed)]}),_0x54dda4=_0x4e39ed[_0x481b5b(0x15d)];_0x54dda4[_0x481b5b(0x1f3)]?console[_0x481b5b(0x2b2)](_0x481b5b(0x156)+_0x54dda4[_0x481b5b(0x14d)]):console[_0x481b5b(0x2b2)]('→\x20Project:\x20'+_0x54dda4['projectName']);console[_0x481b5b(0x2b2)](_0x481b5b(0x2b8)+_0x54dda4[_0x481b5b(0x149)]),console[_0x481b5b(0x2b2)](_0x481b5b(0x288)+(a51_0x2dea47[_0x481b5b(0x20a)](process['cwd'](),_0x54dda4[_0x481b5b(0x181)])||'.')),console[_0x481b5b(0x2b2)](_0x481b5b(0x1f8)+a51_0x55b9d6[_0x481b5b(0x270)]('+'+_0x54dda4['summary'][_0x481b5b(0x28d)]+_0x481b5b(0x166))+',\x20'+(a51_0x55b9d6[_0x481b5b(0x284)]('~'+_0x54dda4[_0x481b5b(0x1c9)][_0x481b5b(0x254)]+_0x481b5b(0x286))+',\x20')+(a51_0x55b9d6[_0x481b5b(0x275)]('-'+_0x54dda4['summary'][_0x481b5b(0x242)]+_0x481b5b(0x2dc))+',\x20')+(''+a51_0x55b9d6[_0x481b5b(0x190)](_0x54dda4[_0x481b5b(0x1c9)][_0x481b5b(0x1d4)]+_0x481b5b(0x234))));for(const _0x4b63c7 of _0x54dda4['changes']){_0x4b63c7['type']===_0x481b5b(0x254)&&_0x4b63c7[_0x481b5b(0x1a0)]&&(console[_0x481b5b(0x2b2)]('\x0a'+a51_0x55b9d6[_0x481b5b(0x1da)](_0x481b5b(0x1ba)+_0x4b63c7['path'])),console[_0x481b5b(0x2b2)](_0x4b63c7[_0x481b5b(0x1a0)]));}if(!_0x54dda4['hasChanges'])return saveSessionContext({'workflow_project':_0x54dda4[_0x481b5b(0x14d)]},_0x471f59[_0x481b5b(0x22d)]),console['error'](a51_0x55b9d6['green'](_0x481b5b(0x14c))),console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x190)](_0x481b5b(0x2e2)+_0x54dda4[_0x481b5b(0x14d)])),0x0;if(_0x471f59['dryRun'])return console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x284)](_0x481b5b(0x203))),0x0;if(!_0x471f59[_0x481b5b(0x23a)]){if(!isInteractive())return console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x275)](_0x481b5b(0x1d1)),_0x481b5b(0x261)),console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x190)](_0x481b5b(0x20e))),0x1;const _0x59c288=await confirmKey(_0x481b5b(0x1af));if(!_0x59c288)return console['error'](a51_0x55b9d6[_0x481b5b(0x284)](_0x481b5b(0x2e6)),_0x481b5b(0x154)),0x1;}await withSpinner(_0x481b5b(0x298),()=>_0x4dec44[_0x481b5b(0x2e5)][_0x481b5b(0x178)](_0x54dda4,{'revision':_0x566de1}),{'verbose':_0x471f59['verbose']}),saveSessionContext({'workflow_project':_0x54dda4[_0x481b5b(0x14d)]},_0x471f59[_0x481b5b(0x22d)]),console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x270)](_0x481b5b(0x18a)));const _0x3779f5=a51_0x2dea47[_0x481b5b(0x20a)](process['cwd'](),_0x54dda4[_0x481b5b(0x181)])||'.';return console[_0x481b5b(0x2b2)](a51_0x55b9d6[_0x481b5b(0x190)](_0x481b5b(0x2e4)+_0x3779f5)),console[_0x481b5b(0x2b2)](a51_0x55b9d6['dim'](_0x481b5b(0x2e2)+_0x54dda4[_0x481b5b(0x14d)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x1d2);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x2d8);async[a51_0x10da29(0x1e3)](_0x279bd6){const _0x57c2ba=a51_0x10da29,{options:_0x5bfd74,args:_0x1a17c4,tdx:_0x443ea1}=_0x279bd6,_0x4405e1=this[_0x57c2ba(0x184)](_0x1a17c4,_0x5bfd74),_0x2d4e0f=_0x5bfd74['revision'],_0xda9c8a=_0x5bfd74[_0x57c2ba(0x163)];_0x5bfd74[_0x57c2ba(0x1ed)]&&(_0x4405e1&&console[_0x57c2ba(0x2b2)](_0x57c2ba(0x2da)+_0x4405e1),_0x2d4e0f&&console[_0x57c2ba(0x2b2)](_0x57c2ba(0x237)+_0x2d4e0f),_0x5bfd74[_0x57c2ba(0x1fa)]&&console[_0x57c2ba(0x2b2)](_0x57c2ba(0x1a9)),_0xda9c8a&&console[_0x57c2ba(0x2b2)](_0x57c2ba(0x28f)));let _0x265e26;try{_0x265e26=await withSpinner('Analyzing\x20changes...',()=>_0x443ea1['workflow']['preparePushProject']({'sourceDir':_0x4405e1,'revision':_0x2d4e0f,'skipValidation':_0xda9c8a}),{'verbose':_0x5bfd74[_0x57c2ba(0x1ed)]});}catch(_0x21a81d){if(_0x21a81d instanceof Error&&_0x21a81d[_0x57c2ba(0x27e)][_0x57c2ba(0x15e)](_0x57c2ba(0x160)))return console[_0x57c2ba(0x2b2)](a51_0x55b9d6[_0x57c2ba(0x275)](_0x57c2ba(0x22f)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x5bfd74[_0x57c2ba(0x19d)]?console[_0x57c2ba(0x2b2)](a51_0x55b9d6['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x5bfd74[_0x57c2ba(0x19d)]+_0x57c2ba(0x216)+_0x5bfd74[_0x57c2ba(0x19d)]+'\x27')):console[_0x57c2ba(0x2b2)](a51_0x55b9d6['dim'](_0x57c2ba(0x221))),0x1;throw _0x21a81d;}const _0x1fcd4a=_0x265e26[_0x57c2ba(0x15d)];console[_0x57c2ba(0x2b2)](_0x57c2ba(0x2bf)+_0x1fcd4a[_0x57c2ba(0x14d)]),console['error'](_0x57c2ba(0x1a3)+_0x1fcd4a[_0x57c2ba(0x205)]),console['error'](_0x57c2ba(0x2b8)+_0x1fcd4a[_0x57c2ba(0x149)]),console[_0x57c2ba(0x2b2)]('\x20\x20Changes:\x20'+a51_0x55b9d6[_0x57c2ba(0x270)]('+'+_0x1fcd4a[_0x57c2ba(0x1c9)][_0x57c2ba(0x28d)]+_0x57c2ba(0x166))+',\x20'+(a51_0x55b9d6[_0x57c2ba(0x284)]('~'+_0x1fcd4a[_0x57c2ba(0x1c9)][_0x57c2ba(0x254)]+_0x57c2ba(0x286))+',\x20')+(a51_0x55b9d6[_0x57c2ba(0x275)]('-'+_0x1fcd4a[_0x57c2ba(0x1c9)][_0x57c2ba(0x242)]+_0x57c2ba(0x2dc))+',\x20')+(''+a51_0x55b9d6['dim'](_0x1fcd4a['summary']['unchanged']+'\x20unchanged')));for(const _0x590695 of _0x1fcd4a[_0x57c2ba(0x243)]){_0x590695['type']==='modified'&&_0x590695['diff']&&(console[_0x57c2ba(0x2b2)]('\x0a'+a51_0x55b9d6[_0x57c2ba(0x1da)]('---\x20'+_0x590695[_0x57c2ba(0x21c)])),console[_0x57c2ba(0x2b2)](_0x590695[_0x57c2ba(0x1a0)]));}if(!_0x1fcd4a['hasChanges'])return console['error'](a51_0x55b9d6[_0x57c2ba(0x270)](_0x57c2ba(0x2b1))),await this['showWorkflowConsoleUrl'](_0x443ea1,_0x1fcd4a[_0x57c2ba(0x14d)],_0x5bfd74['site']),0x0;if(_0x5bfd74[_0x57c2ba(0x1fa)])return console['error'](a51_0x55b9d6[_0x57c2ba(0x284)](_0x57c2ba(0x295))),0x0;if(!_0x5bfd74[_0x57c2ba(0x23a)]){if(!isInteractive())return console['error'](a51_0x55b9d6[_0x57c2ba(0x275)](_0x57c2ba(0x1d1)),_0x57c2ba(0x261)),console['error'](a51_0x55b9d6[_0x57c2ba(0x190)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x153dca=await confirmKey(_0x57c2ba(0x1cf));if(!_0x153dca)return console[_0x57c2ba(0x2b2)](a51_0x55b9d6[_0x57c2ba(0x284)](_0x57c2ba(0x2e6)),_0x57c2ba(0x220)),0x1;}const _0x12793a=await withSpinner('Pushing\x20project...',()=>_0x443ea1[_0x57c2ba(0x2e5)]['executePushProject'](_0x1fcd4a),{'verbose':_0x5bfd74[_0x57c2ba(0x1ed)]}),_0x3da7bd=_0x12793a[_0x57c2ba(0x15d)];return console[_0x57c2ba(0x2b2)](a51_0x55b9d6['green'](_0x57c2ba(0x1e9))),console['error'](_0x57c2ba(0x14a)+_0x3da7bd[_0x57c2ba(0x2bb)]),console[_0x57c2ba(0x2b2)](_0x57c2ba(0x2b8)+_0x3da7bd[_0x57c2ba(0x149)]),await this['showWorkflowConsoleUrl'](_0x443ea1,_0x3da7bd[_0x57c2ba(0x14d)],_0x5bfd74[_0x57c2ba(0x2a9)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x15f);['description']=a51_0x10da29(0x17a);async[a51_0x10da29(0x1e3)](_0x5dc2c4){const _0x264802=a51_0x10da29,{options:_0x37f5ab,args:_0x49218d,tdx:_0x1e646c}=_0x5dc2c4,_0x168ddb=this[_0x264802(0x184)](_0x49218d,_0x37f5ab),_0x5e4417=_0x37f5ab[_0x264802(0x1b9)],_0x4e3399=_0x37f5ab[_0x264802(0x149)],_0x23e46c=_0x37f5ab[_0x264802(0x163)];if(!_0x168ddb)return console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x275)](_0x264802(0x22f)),_0x264802(0x245)),console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x190)](_0x264802(0x170))),console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x190)](_0x264802(0x1db))),0x1;if(!_0x5e4417)return console[_0x264802(0x2b2)](a51_0x55b9d6['red'](_0x264802(0x22f)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x190)](_0x264802(0x170))),0x1;_0x37f5ab[_0x264802(0x1ed)]&&(console[_0x264802(0x2b2)](_0x264802(0x2da)+_0x168ddb),console[_0x264802(0x2b2)]('New\x20project\x20name:\x20'+_0x5e4417),_0x4e3399&&console[_0x264802(0x2b2)](_0x264802(0x237)+_0x4e3399),_0x37f5ab[_0x264802(0x1fa)]&&console[_0x264802(0x2b2)](_0x264802(0x1a9)),_0x23e46c&&console['error'](_0x264802(0x28f)));const _0x3a1072=await withSpinner('Analyzing\x20project...',()=>_0x1e646c[_0x264802(0x2e5)]['prepareCloneProject'](_0x168ddb,_0x5e4417,{'revision':_0x4e3399,'skipValidation':_0x23e46c}),{'verbose':_0x37f5ab['verbose']}),_0x3e3479=_0x3a1072[_0x264802(0x15d)];console['error'](_0x264802(0x2b6)+_0x3e3479['sourceDir']);_0x3e3479[_0x264802(0x1c7)]&&console['error'](_0x264802(0x2df)+_0x3e3479[_0x264802(0x1c7)]);console['error'](_0x264802(0x202)+_0x3e3479['newProjectName']),console['error'](_0x264802(0x237)+_0x3e3479[_0x264802(0x149)]),console[_0x264802(0x2b2)](_0x264802(0x2d4)+_0x3e3479[_0x264802(0x228)]);_0x3e3479[_0x264802(0x2cd)]&&(console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x284)](_0x264802(0x28b)+_0x3e3479[_0x264802(0x2cf)]+_0x264802(0x290)+_0x3e3479[_0x264802(0x25d)]+')')),console[_0x264802(0x2b2)](a51_0x55b9d6[_0x264802(0x284)](_0x264802(0x296))));if(_0x37f5ab[_0x264802(0x1fa)])return console['error'](a51_0x55b9d6[_0x264802(0x284)](_0x264802(0x1ae))),0x0;if(!_0x37f5ab[_0x264802(0x23a)]){if(!isInteractive())return console['error'](a51_0x55b9d6[_0x264802(0x275)](_0x264802(0x1d1)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x264802(0x2b2)](a51_0x55b9d6['dim'](_0x264802(0x20e))),0x1;const _0x5adbda=_0x3e3479[_0x264802(0x1c7)]||a51_0x2dea47[_0x264802(0x1b0)](_0x168ddb),_0x1aa866=_0x3e3479[_0x264802(0x2cd)]?_0x264802(0x291)+_0x5e4417+_0x264802(0x256):_0x264802(0x1e7)+_0x5adbda+_0x264802(0x292)+_0x5e4417+'\x22?',_0x3bdccf=await confirmKey(_0x1aa866);if(!_0x3bdccf)return console[_0x264802(0x2b2)](a51_0x55b9d6['yellow'](_0x264802(0x2e6))),0x1;}const _0xf9cd2a=await withSpinner(_0x3e3479['targetExists']?'Updating\x20'+_0x5e4417+_0x264802(0x185):'Cloning\x20to\x20'+_0x5e4417+_0x264802(0x185),()=>_0x1e646c[_0x264802(0x2e5)][_0x264802(0x279)](_0x3e3479),{'verbose':_0x37f5ab[_0x264802(0x1ed)]}),_0x3a21d6=_0xf9cd2a['data'];return console['error'](a51_0x55b9d6[_0x264802(0x270)](_0x3e3479[_0x264802(0x2cd)]?_0x264802(0x25a):_0x264802(0x28a))),console[_0x264802(0x2b2)](_0x264802(0x283)+_0x3a21d6[_0x264802(0x2cf)]),console['error'](_0x264802(0x14a)+_0x3a21d6[_0x264802(0x148)]),console[_0x264802(0x2b2)](_0x264802(0x2b8)+_0x3a21d6['revision']),await this[_0x264802(0x208)](_0x1e646c,_0x3a21d6['newProjectName'],_0x37f5ab[_0x264802(0x2a9)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x10da29(0x1b9)]='workflow:delete';[a51_0x10da29(0x2c0)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x10da29(0x1e3)](_0x37a13d){const _0x59c647=a51_0x10da29,{options:_0x29380a,args:_0x2d01aa,tdx:_0x3eaa83}=_0x37a13d,_0x24cf23=_0x2d01aa[0x0];if(!_0x24cf23)return console[_0x59c647(0x2b2)](_0x59c647(0x264)),console['error'](_0x59c647(0x258)),0x1;_0x29380a[_0x59c647(0x1ed)]&&console[_0x59c647(0x2b2)](_0x59c647(0x19b)+_0x24cf23);if(!_0x29380a[_0x59c647(0x23a)]){if(!isInteractive())return console['error'](a51_0x55b9d6[_0x59c647(0x275)]('\x0aError:'),_0x59c647(0x261)),console[_0x59c647(0x2b2)](a51_0x55b9d6['dim'](_0x59c647(0x20e))),0x1;const _0x523cc2=await confirmKey(_0x59c647(0x25e)+_0x24cf23+_0x59c647(0x238));if(!_0x523cc2)return console[_0x59c647(0x2b2)](a51_0x55b9d6[_0x59c647(0x284)](_0x59c647(0x2e6))),0x1;}const _0x4fe1d7=await withSpinner(_0x59c647(0x2aa)+_0x24cf23+'...',()=>_0x3eaa83[_0x59c647(0x2e5)][_0x59c647(0x171)](_0x24cf23),{'verbose':_0x29380a[_0x59c647(0x1ed)]}),_0x159a2d=_0x4fe1d7[_0x59c647(0x15d)];return console[_0x59c647(0x2b2)]('✔\x20Deleted\x20project\x20'+_0x159a2d['projectName']),console['error'](_0x59c647(0x14a)+_0x159a2d[_0x59c647(0x2bb)]),0x0;}}export function parseKeyValue(_0x20f371){const _0x50b1fa=a51_0x10da29,_0x166517=_0x20f371[_0x50b1fa(0x299)]('=');if(_0x166517===-0x1)throw new Error(_0x50b1fa(0x1d7)+_0x20f371+_0x50b1fa(0x19f));const _0x9e50d=_0x20f371[_0x50b1fa(0x172)](0x0,_0x166517),_0x2f91dc=_0x20f371[_0x50b1fa(0x172)](_0x166517+0x1);if(!_0x9e50d)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x9e50d,'value':_0x2f91dc};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]='workflow:secrets:list';['description']=a51_0x10da29(0x1dc);async[a51_0x10da29(0x1e3)](_0x2e78ea){const _0x3c33b8=a51_0x10da29,{options:_0x1fe0bc,args:_0x45c5c2,tdx:_0x1d2050}=_0x2e78ea,_0x3d0cd6=this['requireProject'](_0x45c5c2,_0x1fe0bc);if(!_0x3d0cd6)return 0x1;_0x1fe0bc[_0x3c33b8(0x1ed)]&&console['error']('Project:\x20'+_0x3d0cd6);const _0x32ee0=await withSpinner('Listing\x20secrets...',()=>_0x1d2050[_0x3c33b8(0x2e5)][_0x3c33b8(0x17c)](_0x3d0cd6),{'verbose':_0x1fe0bc[_0x3c33b8(0x1ed)]}),{secrets:_0x2776e4}=_0x32ee0[_0x3c33b8(0x15d)];return console[_0x3c33b8(0x2b2)](_0x3c33b8(0x267)+_0x2776e4[_0x3c33b8(0x1b5)]+_0x3c33b8(0x2d1)+(_0x2776e4[_0x3c33b8(0x1b5)]!==0x1?'s':'')),await handleSDKOutput(_0x2776e4,_0x1fe0bc),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x2c6);[a51_0x10da29(0x2c0)]=a51_0x10da29(0x1d5);async['execute'](_0x3a9feb){const _0x11b16f=a51_0x10da29,{options:_0x2bd8bd,args:_0x1e21ed,tdx:_0x44b803}=_0x3a9feb;let _0x2039cd,_0x420d1e;if(_0x1e21ed[_0x11b16f(0x1b5)]>=0x1&&!_0x1e21ed[0x0]['includes']('='))_0x2039cd=_0x1e21ed[0x0],_0x420d1e=_0x1e21ed['slice'](0x1);else{if(_0x1e21ed[_0x11b16f(0x1b5)]>=0x1&&_0x2bd8bd['workflowProject'])_0x2039cd=_0x2bd8bd[_0x11b16f(0x19d)],_0x420d1e=_0x1e21ed;else return _0x1e21ed[_0x11b16f(0x1b5)]>=0x1?(console[_0x11b16f(0x2b2)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x11b16f(0x2b2)](_0x11b16f(0x24c)),0x1):(console[_0x11b16f(0x2b2)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x11b16f(0x2b2)](_0x11b16f(0x2a8)),0x1);}if(_0x420d1e['length']===0x0)return console['error'](_0x11b16f(0x19c)),console[_0x11b16f(0x2b2)](_0x11b16f(0x2a8)),0x1;const _0x3a788a={};try{for(const _0x3927f6 of _0x420d1e){const {key:_0x3dabba,value:_0x16e7bc}=parseKeyValue(_0x3927f6);_0x3a788a[_0x3dabba]=_0x16e7bc;}}catch(_0x21ec71){return _0x21ec71 instanceof Error&&console[_0x11b16f(0x2b2)](a51_0x55b9d6['red'](_0x11b16f(0x22f)),_0x21ec71[_0x11b16f(0x27e)]),0x1;}const _0x30ad9e=Object[_0x11b16f(0x231)](_0x3a788a);_0x2bd8bd[_0x11b16f(0x1ed)]&&(console[_0x11b16f(0x2b2)](_0x11b16f(0x19b)+_0x2039cd),console['error'](_0x11b16f(0x215)+_0x30ad9e[_0x11b16f(0x246)](',\x20')));const _0x48ed61=await withSpinner(_0x30ad9e[_0x11b16f(0x1b5)]===0x1?'Setting\x20secret...':_0x11b16f(0x1ef)+_0x30ad9e['length']+_0x11b16f(0x2ad),()=>_0x44b803[_0x11b16f(0x2e5)][_0x11b16f(0x230)](_0x2039cd,_0x3a788a),{'verbose':_0x2bd8bd[_0x11b16f(0x1ed)]}),_0x14cb05=_0x48ed61[_0x11b16f(0x15d)];return console[_0x11b16f(0x2b2)](_0x30ad9e[_0x11b16f(0x1b5)]===0x1?_0x11b16f(0x1c3)+_0x14cb05[_0x11b16f(0x231)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x14cb05[_0x11b16f(0x14d)]+'\x27':'✔\x20'+_0x14cb05[_0x11b16f(0x231)][_0x11b16f(0x1b5)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x14cb05['projectName']+'\x27'),(_0x2bd8bd[_0x11b16f(0x29c)]||_0x2bd8bd[_0x11b16f(0x1ac)])&&await handleSingleObjectOutput(_0x14cb05,_0x2bd8bd),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x2b5);[a51_0x10da29(0x2c0)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0xe22167){const _0x45ea27=a51_0x10da29,{options:_0xfbbe99,args:_0x50a62e,tdx:_0x4027b3}=_0xe22167;let _0x12152f,_0x1290e9;if(_0x50a62e['length']>=0x2)_0x12152f=_0x50a62e[0x0],_0x1290e9=_0x50a62e[0x1];else{if(_0x50a62e['length']===0x1&&_0xfbbe99['workflowProject'])_0x12152f=_0xfbbe99[_0x45ea27(0x19d)],_0x1290e9=_0x50a62e[0x0];else return _0x50a62e[_0x45ea27(0x1b5)]===0x1?(console[_0x45ea27(0x2b2)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x45ea27(0x2b2)](_0x45ea27(0x24c)),0x1):(console[_0x45ea27(0x2b2)](_0x45ea27(0x2af)),console[_0x45ea27(0x2b2)](_0x45ea27(0x226)),0x1);}_0xfbbe99[_0x45ea27(0x1ed)]&&(console[_0x45ea27(0x2b2)](_0x45ea27(0x19b)+_0x12152f),console['error'](_0x45ea27(0x1c6)+_0x1290e9));if(!_0xfbbe99[_0x45ea27(0x23a)]){if(!isInteractive())return console[_0x45ea27(0x2b2)](a51_0x55b9d6[_0x45ea27(0x275)]('\x0aError:'),_0x45ea27(0x261)),console[_0x45ea27(0x2b2)](a51_0x55b9d6[_0x45ea27(0x190)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x189c12=await confirmKey(_0x45ea27(0x16b)+_0x1290e9+_0x45ea27(0x229)+_0x12152f+'\x27?');if(!_0x189c12)return console[_0x45ea27(0x2b2)](a51_0x55b9d6[_0x45ea27(0x284)](_0x45ea27(0x2e6))),0x1;}const _0x4d92ea=await withSpinner(_0x45ea27(0x153),()=>_0x4027b3['workflow'][_0x45ea27(0x2e3)](_0x12152f,_0x1290e9),{'verbose':_0xfbbe99[_0x45ea27(0x1ed)]}),_0x1a68c1=_0x4d92ea[_0x45ea27(0x15d)];return console[_0x45ea27(0x2b2)](_0x45ea27(0x1c3)+_0x1a68c1[_0x45ea27(0x2e0)]+_0x45ea27(0x14f)+_0x1a68c1[_0x45ea27(0x14d)]+'\x27'),(_0xfbbe99['json']||_0xfbbe99['jsonl'])&&await handleSingleObjectOutput(_0x1a68c1,_0xfbbe99),0x0;}}function a51_0x4c2d(_0x3003f6,_0x2be4a4){_0x3003f6=_0x3003f6-0x146;const _0x141caf=a51_0x141c();let _0x4c2d46=_0x141caf[_0x3003f6];return _0x4c2d46;}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(_0x3c6c7f){const _0x234b86=a51_0x10da29,_0x5ae5d8=Math['floor'](_0x3c6c7f/0x3e8),_0x45ff7b=Math['floor'](_0x5ae5d8/0x3c),_0x1d639b=Math[_0x234b86(0x250)](_0x45ff7b/0x3c),_0x38f0f4=Math[_0x234b86(0x250)](_0x1d639b/0x18);if(_0x38f0f4>0x0){const _0x40060d=_0x1d639b%0x18;return _0x40060d>0x0?_0x38f0f4+'d\x20'+_0x40060d+'h':_0x38f0f4+'d';}else{if(_0x1d639b>0x0){const _0x58f498=_0x45ff7b%0x3c;return _0x58f498>0x0?_0x1d639b+'h\x20'+_0x58f498+'m':_0x1d639b+'h';}else{if(_0x45ff7b>0x0){const _0xe3b12e=_0x5ae5d8%0x3c;return _0xe3b12e>0x0?_0x45ff7b+'m\x20'+_0xe3b12e+'s':_0x45ff7b+'m';}else return _0x5ae5d8+'s';}}}function formatTimestamp(_0x3deb37,_0xb9507a){const _0x415b11=a51_0x10da29,_0x1fa640=new Date(_0x3deb37),_0x422a22=String(_0x1fa640['getHours']())[_0x415b11(0x22c)](0x2,'0'),_0x557c4f=String(_0x1fa640['getMinutes']())[_0x415b11(0x22c)](0x2,'0'),_0x20cb77=_0x422a22+':'+_0x557c4f,_0x1da6b7=_0x1fa640[_0x415b11(0x200)]()===_0xb9507a[_0x415b11(0x200)]()&&_0x1fa640[_0x415b11(0x25f)]()===_0xb9507a['getMonth']()&&_0x1fa640[_0x415b11(0x16f)]()===_0xb9507a[_0x415b11(0x16f)]();if(_0x1da6b7)return _0x20cb77;else{const _0x24a9e5=String(_0x1fa640['getMonth']()+0x1)['padStart'](0x2,'0'),_0x37299a=String(_0x1fa640['getDate']())[_0x415b11(0x22c)](0x2,'0');return _0x24a9e5+'-'+_0x37299a+'\x20'+_0x20cb77;}}function formatDate(_0xffd67d){const _0x598c47=a51_0x10da29,_0x3ddf49=_0xffd67d['getFullYear'](),_0xe60e6e=String(_0xffd67d[_0x598c47(0x25f)]()+0x1)[_0x598c47(0x22c)](0x2,'0'),_0x5dc473=String(_0xffd67d[_0x598c47(0x16f)]())['padStart'](0x2,'0');return _0x3ddf49+'-'+_0xe60e6e+'-'+_0x5dc473;}function getTaskStateIcon(_0x14d696){const _0x1cea90={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1cea90[_0x14d696]||'⚪';}function getBarChar(_0x45cce4){const _0x16b1e6=a51_0x10da29;return _0x45cce4==='error'||_0x45cce4===_0x16b1e6(0x212)?'×':'─';}function getBarColor(_0x166ca7){const _0x18bb21=a51_0x10da29,_0x39aa67={'success':a51_0x55b9d6['green'],'error':a51_0x55b9d6[_0x18bb21(0x275)],'group_error':a51_0x55b9d6[_0x18bb21(0x275)],'running':a51_0x55b9d6['blue'],'blocked':a51_0x55b9d6[_0x18bb21(0x284)],'planned':a51_0x55b9d6[_0x18bb21(0x190)],'canceling':a51_0x55b9d6[_0x18bb21(0x284)]};return _0x39aa67[_0x166ca7]||a51_0x55b9d6[_0x18bb21(0x2c4)];}function parseTaskName(_0x3d1d88){const _0x5aa05e=a51_0x10da29;let _0x46b93e=_0x3d1d88[_0x5aa05e(0x1b8)](/^\++/,'');const _0x5e888b=_0x46b93e[_0x5aa05e(0x18d)]('+'),_0x2eb0ba=_0x5e888b[_0x5aa05e(0x1b5)]>0x1?_0x5e888b['length']-0x2:0x0,_0x2754d1=_0x5e888b[_0x5e888b[_0x5aa05e(0x1b5)]-0x1]||_0x46b93e;return{'level':_0x2eb0ba,'name':'+'+_0x2754d1};}function truncateTaskName(_0x3d1e8c,_0x2807a3){const _0x1f0bda=a51_0x10da29,_0xa40225=stringWidth(_0x3d1e8c);if(_0xa40225<=_0x2807a3)return _0x3d1e8c;let _0x26800b=_0x3d1e8c;while(stringWidth(_0x26800b+'…')>_0x2807a3&&_0x26800b[_0x1f0bda(0x1b5)]>0x0){_0x26800b=_0x26800b['slice'](0x0,-0x1);}return _0x26800b+'…';}function calculateTimeScale(_0x495483,_0xa4958f){const _0x5eb76f=a51_0x10da29;return{'startTime':_0x495483[_0x5eb76f(0x276)],'endTime':_0x495483['end'],'durationMs':_0x495483['duration'],'msPerChar':_0x495483['duration']/_0xa4958f};}function timeToPosition(_0x26b8b3,_0x194f03,_0x30d8b7){const _0x24c02c=a51_0x10da29,_0x28aefd=_0x26b8b3-_0x194f03[_0x24c02c(0x257)],_0x44fbbd=Math['floor'](_0x28aefd/_0x194f03[_0x24c02c(0x19a)]);return Math['max'](0x0,Math[_0x24c02c(0x2d6)](_0x44fbbd,_0x30d8b7));}function renderTimeAxis(_0xccee63,_0x67fa3e){const _0xfc100f=a51_0x10da29,_0x22163b=Math[_0xfc100f(0x2d6)](TIMELINE_CONFIG[_0xfc100f(0x165)],Math['max'](TIMELINE_CONFIG[_0xfc100f(0x14e)],Math['floor'](_0x67fa3e/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x182799=_0xccee63['durationMs']/(_0x22163b-0x1),_0x1b42a7=new Date(_0xccee63[_0xfc100f(0x257)]),_0x3e62c8=[];for(let _0x14c9cc=0x0;_0x14c9cc<_0x22163b;_0x14c9cc++){const _0x2d8692=_0xccee63[_0xfc100f(0x257)]+_0x14c9cc*_0x182799,_0x4f4c6b=timeToPosition(_0x2d8692,_0xccee63,_0x67fa3e),_0x5548d0=formatTimestamp(_0x2d8692,_0x1b42a7);_0x3e62c8['push']({'pos':_0x4f4c6b,'text':_0x5548d0});}const _0x3f95eb=new Array(_0x67fa3e)[_0xfc100f(0x2c2)]('\x20');let _0x2c8bc5=-0x1;for(const {pos:_0x225b8d,text:_0xb80b22}of _0x3e62c8){let _0x193dc4=Math[_0xfc100f(0x28c)](0x0,_0x225b8d-Math[_0xfc100f(0x250)](_0xb80b22[_0xfc100f(0x1b5)]/0x2));_0x193dc4<=_0x2c8bc5+TIMELINE_CONFIG[_0xfc100f(0x1c5)]&&(_0x193dc4=_0x2c8bc5+TIMELINE_CONFIG[_0xfc100f(0x1c5)]+0x1);_0x193dc4+_0xb80b22['length']>_0x67fa3e&&(_0x193dc4=_0x67fa3e-_0xb80b22[_0xfc100f(0x1b5)]);if(_0x193dc4>=0x0&&_0x193dc4+_0xb80b22[_0xfc100f(0x1b5)]<=_0x67fa3e&&_0x193dc4>_0x2c8bc5){for(let _0x17a1d1=0x0;_0x17a1d1<_0xb80b22[_0xfc100f(0x1b5)];_0x17a1d1++){_0x3f95eb[_0x193dc4+_0x17a1d1]=_0xb80b22[_0x17a1d1];}_0x2c8bc5=_0x193dc4+_0xb80b22['length']-0x1;}}return _0x3f95eb[_0xfc100f(0x246)]('');}function renderTaskRow(_0x1f59c,_0x524733,_0x556d0a,_0x5865dc){const _0x5c88f4=a51_0x10da29,{level:_0x5a1fb5,name:_0xe96b18}=parseTaskName(_0x1f59c[_0x5c88f4(0x1b9)]),_0x429990='\x20'[_0x5c88f4(0x2b9)](_0x5a1fb5),_0x3d2860=_0x1f59c[_0x5c88f4(0x20f)]?'('+formatElapsed(_0x1f59c[_0x5c88f4(0x20f)][_0x5c88f4(0x158)])+')':'',_0x338189=stringWidth(_0x3d2860),_0x3c8943=_0x5a1fb5*0x1,_0x2854c2=_0x5865dc-_0x3c8943-_0x338189-0x1,_0x39d0b3=truncateTaskName(_0xe96b18,_0x2854c2),_0x591fc6=_0x429990+_0x39d0b3,_0xe1169d=stringWidth(_0x591fc6),_0x4c7d55=_0x5865dc-_0xe1169d-_0x338189,_0x2a6794=_0x591fc6+'\x20'[_0x5c88f4(0x2b9)](Math[_0x5c88f4(0x28c)](0x1,_0x4c7d55))+a51_0x55b9d6['dim'](_0x3d2860),_0x6071f8=getTaskStateIcon(_0x1f59c['state']),_0x3b5660=new Array(_0x556d0a)[_0x5c88f4(0x2c2)]('\x20');if(_0x1f59c[_0x5c88f4(0x20f)]){const _0x369980=timeToPosition(_0x1f59c['window'][_0x5c88f4(0x276)],_0x524733,_0x556d0a),_0x4169bb=timeToPosition(_0x1f59c[_0x5c88f4(0x20f)][_0x5c88f4(0x2ca)],_0x524733,_0x556d0a),_0x92bda=getBarChar(_0x1f59c[_0x5c88f4(0x2d7)]),_0x2d6337=Math[_0x5c88f4(0x28c)](_0x369980+0x1,_0x4169bb);for(let _0x3c7a93=_0x369980;_0x3c7a93<Math[_0x5c88f4(0x2d6)](_0x2d6337,_0x556d0a);_0x3c7a93++){_0x3b5660[_0x3c7a93]=_0x92bda;}}const _0x470f65=getBarColor(_0x1f59c[_0x5c88f4(0x2d7)]),_0x1a12ad=_0x3b5660[_0x5c88f4(0x1cb)](_0x475c55=>_0x475c55==='\x20'?'\x20':_0x470f65(_0x475c55))[_0x5c88f4(0x246)]('');return _0x6071f8+'\x20'+_0x2a6794+'│'+_0x1a12ad+'│';}function calculateStats(_0x24c8b4){const _0xffff51=a51_0x10da29,_0x35cd60={'total':_0x24c8b4[_0xffff51(0x1b5)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5e5a3d of _0x24c8b4){if(_0x5e5a3d[_0xffff51(0x2d7)]==='success')_0x35cd60[_0xffff51(0x1f6)]++;else{if(_0x5e5a3d[_0xffff51(0x2d7)]===_0xffff51(0x2b2)||_0x5e5a3d['state']==='group_error')_0x35cd60[_0xffff51(0x2b2)]++;else _0x5e5a3d[_0xffff51(0x2d7)]===_0xffff51(0x1ee)?_0x35cd60[_0xffff51(0x1ee)]++:_0x35cd60[_0xffff51(0x2b0)]++;}}return _0x35cd60;}function formatStats(_0xae0765){const _0x34e917=a51_0x10da29;return['Total:\x20'+_0xae0765[_0x34e917(0x1a2)],'✅\x20'+_0xae0765['success'],'❌\x20'+_0xae0765[_0x34e917(0x2b2)],_0x34e917(0x173)+_0xae0765[_0x34e917(0x1ee)],'⏳\x20'+_0xae0765[_0x34e917(0x2b0)]][_0x34e917(0x246)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x10da29(0x1b9)]=a51_0x10da29(0x21f);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a51_0x10da29(0x1e3)](_0x341547){const _0x20b973=a51_0x10da29,{options:_0x5c49de,args:_0x4a5ccd,tdx:_0x17c7ad}=_0x341547;let _0x387c7a,_0x316dd8,_0x5f592b=![];if(_0x4a5ccd[0x0]){if(_0x4a5ccd[0x0][_0x20b973(0x15e)]('.')){const _0x244a42=this[_0x20b973(0x2ae)](_0x4a5ccd,_0x5c49de);if(!_0x244a42)return 0x1;_0x387c7a=_0x244a42[_0x20b973(0x14d)],_0x316dd8=_0x244a42[_0x20b973(0x2a1)];}else{_0x316dd8=_0x4a5ccd[0x0],_0x387c7a=_0x5c49de[_0x20b973(0x19d)];if(!_0x387c7a)return console['error'](a51_0x55b9d6[_0x20b973(0x275)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x5f592b=!![];}}else{const _0x48ed6a=this[_0x20b973(0x2ae)](_0x4a5ccd,_0x5c49de);if(!_0x48ed6a)return 0x1;_0x387c7a=_0x48ed6a[_0x20b973(0x14d)],_0x316dd8=_0x48ed6a[_0x20b973(0x2a1)];}if(_0x5c49de[_0x20b973(0x1ed)]){if(_0x387c7a&&_0x316dd8)console[_0x20b973(0x2b2)](_0x20b973(0x2a4)+_0x387c7a+'.'+_0x316dd8);else _0x387c7a&&console[_0x20b973(0x2b2)](_0x20b973(0x2c8)+_0x387c7a);}const _0x551291=_0x5c49de[_0x20b973(0x20d)],_0x2b8d3f=_0x5c49de[_0x20b973(0x2dd)];if(_0x551291){_0x2b8d3f&&console[_0x20b973(0x2b2)](a51_0x55b9d6[_0x20b973(0x284)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x214e2a=_0x5c49de[_0x20b973(0x196)];return _0x214e2a?await this[_0x20b973(0x18e)](_0x341547,_0x551291):await this[_0x20b973(0x195)](_0x341547,_0x551291,_0x5c49de),0x0;}if(_0x2b8d3f){const _0x823a3a=await withSpinner('Loading\x20session...',()=>_0x17c7ad[_0x20b973(0x2e5)][_0x20b973(0x233)]({'projectName':_0x387c7a,'workflowName':_0x316dd8,'limit':0x64}),{'verbose':_0x5c49de['verbose']}),_0x1d0f5=_0x823a3a['data']['find'](_0x4cec0b=>_0x4cec0b['id']===_0x2b8d3f);if(!_0x1d0f5)return console[_0x20b973(0x2b2)](a51_0x55b9d6['red'](_0x20b973(0x22f)),_0x20b973(0x1c8)+_0x2b8d3f),0x1;if(!_0x1d0f5[_0x20b973(0x1f7)]?.['id'])return console[_0x20b973(0x2b2)](a51_0x55b9d6['red'](_0x20b973(0x22f)),'Session\x20'+_0x2b8d3f+_0x20b973(0x2d0)),0x1;const _0x5dbdc7=_0x1d0f5[_0x20b973(0x1f7)]['id'];_0x5c49de[_0x20b973(0x1ed)]&&console[_0x20b973(0x2b2)](_0x20b973(0x15c)+_0x5dbdc7+_0x20b973(0x25c)+_0x2b8d3f);const _0x51bf8a=_0x5c49de[_0x20b973(0x196)];return _0x51bf8a?await this[_0x20b973(0x18e)](_0x341547,_0x5dbdc7):await this[_0x20b973(0x195)](_0x341547,_0x5dbdc7,_0x5c49de),0x0;}const _0xb0b7c=await withSpinner('Loading\x20sessions...',()=>_0x17c7ad[_0x20b973(0x2e5)]['sessions']({'projectName':_0x387c7a,'workflowName':_0x316dd8,'limit':_0x5c49de[_0x20b973(0x280)]||0x32}),{'verbose':_0x5c49de['verbose']}),_0x2cdd72=_0xb0b7c[_0x20b973(0x15d)];if(_0x2cdd72[_0x20b973(0x1b5)]===0x0){if(_0x387c7a&&_0x316dd8)console[_0x20b973(0x2b2)](_0x20b973(0x25b)+_0x387c7a+'.'+_0x316dd8);else _0x387c7a?console[_0x20b973(0x2b2)](_0x20b973(0x2a2)+_0x387c7a):(console[_0x20b973(0x2b2)]('No\x20workflow\x20sessions\x20found'),console['error'](a51_0x55b9d6[_0x20b973(0x190)](_0x20b973(0x199))));return 0x0;}_0x2cdd72[_0x20b973(0x1f2)]((_0x3d5355,_0x144803)=>{const _0x3f80dd=_0x20b973,_0x4b6a46=_0x3d5355[_0x3f80dd(0x2a5)]||'',_0x5896b6=_0x144803[_0x3f80dd(0x2a5)]||'';return _0x5896b6[_0x3f80dd(0x175)](_0x4b6a46);});if(_0x5c49de[_0x20b973(0x29c)]||_0x5c49de[_0x20b973(0x1ac)])return await handleSDKOutput(_0x2cdd72,_0x5c49de),0x0;let _0x2b3233;if(_0x5f592b){const _0x3d1ef0=_0x2cdd72[0x0];if(!_0x3d1ef0['lastAttempt']?.['id'])return console[_0x20b973(0x2b2)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x2b3233=_0x3d1ef0[_0x20b973(0x1f7)]['id'],_0x5c49de['verbose']&&console[_0x20b973(0x2b2)](_0x20b973(0x1a6)+_0x3d1ef0[_0x20b973(0x2a5)]);}else{const _0x42bbc9=_0x2cdd72[_0x20b973(0x1cb)](_0x6b5332=>{const _0x58b646=_0x20b973,_0x2a5a95=getAttemptStatusDisplay(_0x6b5332[_0x58b646(0x1f7)]);return{'title':_0x6b5332[_0x58b646(0x2c3)]?.['name']+'.'+_0x6b5332['workflow']?.[_0x58b646(0x1b9)]+_0x58b646(0x1fe)+_0x6b5332[_0x58b646(0x2a5)]+'\x20'+_0x2a5a95[_0x58b646(0x24a)],'value':_0x6b5332[_0x58b646(0x1f7)]?.['id']||'','description':_0x2a5a95[_0x58b646(0x186)]};}),_0x425dbe=await a51_0x5637a3({'type':_0x20b973(0x1aa),'name':_0x20b973(0x20d),'message':_0x20b973(0x210),'choices':_0x42bbc9[_0x20b973(0x162)](_0x574c4a=>_0x574c4a['value']!=='')});if(!_0x425dbe['attemptId'])return 0x0;_0x2b3233=_0x425dbe[_0x20b973(0x20d)];}const _0x237271=_0x5c49de[_0x20b973(0x196)];return _0x237271?await this[_0x20b973(0x18e)](_0x341547,_0x2b3233):await this[_0x20b973(0x195)](_0x341547,_0x2b3233,_0x5c49de),0x0;}async[a51_0x10da29(0x195)](_0x9e5ba7,_0x31f191,_0x4511cd){const _0x4f54f1=a51_0x10da29,{tdx:_0x5c525c}=_0x9e5ba7;let _0x58d69c,_0x1794da;try{[_0x58d69c,_0x1794da]=await Promise[_0x4f54f1(0x2ab)]([_0x5c525c[_0x4f54f1(0x2e5)][_0x4f54f1(0x224)](_0x31f191),_0x5c525c[_0x4f54f1(0x2e5)][_0x4f54f1(0x1f0)](_0x31f191,![])]);}catch(_0x45d467){console[_0x4f54f1(0x2b2)](a51_0x55b9d6[_0x4f54f1(0x275)](_0x4f54f1(0x15b)));_0x4511cd['verbose']&&console[_0x4f54f1(0x2b2)](_0x45d467);throw _0x45d467;}if(_0x4511cd[_0x4f54f1(0x29c)]||_0x4511cd[_0x4f54f1(0x1ac)]){const _0x575458=this[_0x4f54f1(0x206)](_0x58d69c,_0x1794da);await handleSDKOutput([_0x575458],_0x4511cd);return;}const _0x386bfc=_0x5c525c[_0x4f54f1(0x22e)][_0x4f54f1(0x2a9)],_0x48ee88=this[_0x4f54f1(0x1eb)](_0x58d69c,_0x1794da,_0x386bfc);console[_0x4f54f1(0x222)](_0x48ee88);}async[a51_0x10da29(0x18e)](_0x5e48a8,_0x1d870b){const _0x5e8902=a51_0x10da29,{tdx:_0x2d4521}=_0x5e48a8,_0x238200=TIMELINE_CONFIG[_0x5e8902(0x1b1)],_0x54f974=TIMELINE_CONFIG[_0x5e8902(0x247)];let _0x4aa64c=0x0;while(_0x4aa64c<_0x54f974){process[_0x5e8902(0x1cc)][_0x5e8902(0x1f4)]&&process[_0x5e8902(0x1cc)]['write']('\x1bc');let _0x388cf1,_0x1b6337;try{[_0x388cf1,_0x1b6337]=await Promise[_0x5e8902(0x2ab)]([_0x2d4521[_0x5e8902(0x2e5)][_0x5e8902(0x224)](_0x1d870b),_0x2d4521[_0x5e8902(0x2e5)]['tasks'](_0x1d870b,![])]);}catch(_0x5323f7){console[_0x5e8902(0x2b2)](a51_0x55b9d6[_0x5e8902(0x275)](_0x5e8902(0x2d3)));_0x4aa64c>0x0&&console['error'](a51_0x55b9d6[_0x5e8902(0x190)](_0x5e8902(0x1ec)+_0x4aa64c));throw _0x5323f7;}const _0x4b9394=_0x2d4521[_0x5e8902(0x22e)]['site'],_0x1b75ae=this['renderTimeline'](_0x388cf1,_0x1b6337,_0x4b9394);console['log'](_0x1b75ae);const _0x50bc84=_0x388cf1['done']&&_0x1b6337['every'](_0x4238f4=>_0x4238f4['state']!==_0x5e8902(0x1ee)&&_0x4238f4[_0x5e8902(0x2d7)]!==_0x5e8902(0x244));if(_0x50bc84){console['error'](a51_0x55b9d6[_0x5e8902(0x270)](_0x5e8902(0x22b)));break;}console['error'](a51_0x55b9d6[_0x5e8902(0x190)](_0x5e8902(0x271)+_0x4aa64c*0x2+_0x5e8902(0x167))),await new Promise(_0x2be11e=>setTimeout(_0x2be11e,_0x238200)),_0x4aa64c++;}_0x4aa64c>=_0x54f974&&console['error'](a51_0x55b9d6[_0x5e8902(0x284)](_0x5e8902(0x1e6)));}['renderTimeline'](_0x3449db,_0x38ecd1,_0x2c934c){const _0x5dda19=a51_0x10da29,_0x11768f=[],_0x1f7f86=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x4afbac=0x5,_0x240233=process[_0x5dda19(0x1cc)][_0x5dda19(0x1a4)]||0x78,_0x842d13=_0x240233-_0x1f7f86-_0x4afbac,_0x2cfaef=Math[_0x5dda19(0x28c)](TIMELINE_CONFIG[_0x5dda19(0x18f)],Math['min'](_0x842d13,TIMELINE_CONFIG[_0x5dda19(0x1cd)])),_0x5b38f2=new Date(_0x3449db[_0x5dda19(0x2d2)])['getTime'](),_0x515b5d=_0x3449db['finishedAt']?new Date(_0x3449db[_0x5dda19(0x2c5)])[_0x5dda19(0x287)]():Date[_0x5dda19(0x17f)](),_0x4f5094={'start':_0x5b38f2,'end':_0x515b5d,'duration':_0x515b5d-_0x5b38f2},_0x584081=new Map(),_0x3ac82c=[];for(const _0x4c047e of _0x38ecd1){if(_0x4c047e[_0x5dda19(0x207)]){const _0x351886=new Date(_0x4c047e['startedAt'])[_0x5dda19(0x287)](),_0x10d4ff=_0x4c047e[_0x5dda19(0x23b)]?new Date(_0x4c047e[_0x5dda19(0x23b)])[_0x5dda19(0x287)]():Date[_0x5dda19(0x17f)](),_0x1c5e7d={'start':_0x351886,'end':_0x10d4ff,'duration':_0x10d4ff-_0x351886};_0x584081[_0x5dda19(0x2c7)](_0x4c047e['id'],_0x1c5e7d),_0x3ac82c[_0x5dda19(0x26c)]({'name':_0x4c047e[_0x5dda19(0x1fb)],'state':_0x4c047e[_0x5dda19(0x2d7)]||_0x5dda19(0x198),'window':_0x1c5e7d});}else _0x3ac82c[_0x5dda19(0x26c)]({'name':_0x4c047e[_0x5dda19(0x1fb)],'state':_0x4c047e[_0x5dda19(0x2d7)]||_0x5dda19(0x244),'window':undefined});}_0x3ac82c[_0x5dda19(0x1f2)]((_0x3379dc,_0x19f9b5)=>{const _0x5acff1=_0x5dda19;if(!_0x3379dc[_0x5acff1(0x20f)])return 0x1;if(!_0x19f9b5[_0x5acff1(0x20f)])return-0x1;return _0x3379dc[_0x5acff1(0x20f)]['start']-_0x19f9b5['window'][_0x5acff1(0x276)];});const _0x195727=_0x3ac82c['length'],_0x3a51c3=_0x195727>TIMELINE_CONFIG[_0x5dda19(0x1dd)];_0x3a51c3&&_0x3ac82c[_0x5dda19(0x289)](TIMELINE_CONFIG[_0x5dda19(0x1dd)]);const _0x5bbd34=calculateTimeScale(_0x4f5094,_0x2cfaef),_0x1d09ef=_0x3449db[_0x5dda19(0x1d9)]?_0x3449db['success']?a51_0x55b9d6['green'](_0x5dda19(0x1f6)):a51_0x55b9d6['red'](_0x5dda19(0x2b2)):a51_0x55b9d6['blue'](_0x5dda19(0x1ee)),_0x486137=_0x3449db[_0x5dda19(0x2c3)]?.['id'],_0x109023=_0x3449db[_0x5dda19(0x2dd)];let _0x2f29f6;if(_0x486137&&_0x109023){const _0x482b2a=getWorkflowAttemptUrl(_0x2c934c,_0x486137,_0x109023,_0x3449db['id']);_0x2f29f6=hyperlink(a51_0x55b9d6[_0x5dda19(0x190)](_0x3449db['id']),_0x482b2a);}else _0x2f29f6=a51_0x55b9d6[_0x5dda19(0x190)](_0x3449db['id']);_0x11768f[_0x5dda19(0x26c)](_0x5dda19(0x281)+_0x2f29f6+_0x5dda19(0x1fe)+_0x1d09ef+_0x5dda19(0x1fe)+formatElapsed(_0x4f5094[_0x5dda19(0x158)]));if(_0x3ac82c['length']>0x0){const _0xe198b=renderTimeAxis(_0x5bbd34,_0x2cfaef),_0x5ce63c=new Date(_0x4f5094[_0x5dda19(0x276)]),_0x5ca4d7=formatDate(_0x5ce63c),_0x593e0c=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x1f7f86,_0xbd794c=_0x5ca4d7[_0x5dda19(0x22c)](_0x593e0c),_0x45f302=a51_0x55b9d6[_0x5dda19(0x190)](_0xbd794c);_0x11768f[_0x5dda19(0x26c)](_0x45f302+'\x20'+_0xe198b);for(const _0x27c9ab of _0x3ac82c){_0x11768f[_0x5dda19(0x26c)](renderTaskRow(_0x27c9ab,_0x5bbd34,_0x2cfaef,_0x1f7f86));}const _0x9ac30d=calculateStats(_0x3ac82c);_0x11768f[_0x5dda19(0x26c)](formatStats(_0x9ac30d)),_0x3a51c3&&_0x11768f[_0x5dda19(0x26c)](a51_0x55b9d6[_0x5dda19(0x284)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x5dda19(0x1dd)]+_0x5dda19(0x16d)+_0x195727+'\x20tasks')),_0x11768f[_0x5dda19(0x26c)](''),_0x11768f['push'](a51_0x55b9d6[_0x5dda19(0x190)](_0x5dda19(0x21a))+(_0x5dda19(0x1e0)+_0x3449db['id']+'\x20logs')+a51_0x55b9d6[_0x5dda19(0x190)](_0x5dda19(0x211)));}else _0x11768f[_0x5dda19(0x26c)](_0x5dda19(0x1bf));return _0x11768f['join']('\x0a');}[a51_0x10da29(0x206)](_0x37024d,_0x2b2960){const _0x3240f1=a51_0x10da29,_0x21a587=new Date(_0x37024d['createdAt'])[_0x3240f1(0x287)](),_0x185025=_0x37024d[_0x3240f1(0x2c5)]?new Date(_0x37024d['finishedAt'])[_0x3240f1(0x287)]():Date['now'](),_0x48f865=_0x185025-_0x21a587,_0x464458=[];for(const _0x4ff790 of _0x2b2960){if(_0x4ff790[_0x3240f1(0x207)]){const _0x2cca39=new Date(_0x4ff790['startedAt'])[_0x3240f1(0x287)](),_0x3ff9d0=_0x4ff790[_0x3240f1(0x23b)]?new Date(_0x4ff790[_0x3240f1(0x23b)])[_0x3240f1(0x287)]():Date[_0x3240f1(0x17f)]();_0x464458[_0x3240f1(0x26c)]({'name':_0x4ff790[_0x3240f1(0x1fb)],'state':_0x4ff790[_0x3240f1(0x2d7)]||'unknown','window':{'start':_0x2cca39,'end':_0x3ff9d0,'duration':_0x3ff9d0-_0x2cca39}});}else _0x464458[_0x3240f1(0x26c)]({'name':_0x4ff790[_0x3240f1(0x1fb)],'state':_0x4ff790[_0x3240f1(0x2d7)]||'planned','window':undefined});}const _0x3c4312=calculateStats(_0x464458);return{'attempt':{'id':_0x37024d['id'],'status':_0x37024d['done']?_0x37024d[_0x3240f1(0x1f6)]?_0x3240f1(0x1f6):_0x3240f1(0x2b2):_0x3240f1(0x1ee),'createdAt':_0x37024d[_0x3240f1(0x2d2)],'finishedAt':_0x37024d[_0x3240f1(0x2c5)],'duration_ms':_0x48f865},'tasks':_0x464458['map'](_0x50865e=>({'name':_0x50865e['name'],'state':_0x50865e[_0x3240f1(0x2d7)],'startedAt':_0x50865e['window']?new Date(_0x50865e[_0x3240f1(0x20f)][_0x3240f1(0x276)])[_0x3240f1(0x223)]():null,'updatedAt':_0x50865e['window']?new Date(_0x50865e['window'][_0x3240f1(0x2ca)])[_0x3240f1(0x223)]():null,'duration_ms':_0x50865e[_0x3240f1(0x20f)]?.['duration']||null})),'stats':_0x3c4312};}}