@treasuredata/tdx 2026.3.53 → 2026.3.54

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x12ede4=a54_0x2841;(function(_0x33597c,_0x895142){const _0xdcb0e5=a54_0x2841,_0x28ee82=_0x33597c();while(!![]){try{const _0x109d3a=-parseInt(_0xdcb0e5(0x220))/0x1*(-parseInt(_0xdcb0e5(0x11a))/0x2)+-parseInt(_0xdcb0e5(0x11e))/0x3+parseInt(_0xdcb0e5(0x200))/0x4+parseInt(_0xdcb0e5(0x1b9))/0x5+-parseInt(_0xdcb0e5(0x1b7))/0x6*(parseInt(_0xdcb0e5(0xe0))/0x7)+parseInt(_0xdcb0e5(0xbe))/0x8*(-parseInt(_0xdcb0e5(0xbc))/0x9)+parseInt(_0xdcb0e5(0x12d))/0xa;if(_0x109d3a===_0x895142)break;else _0x28ee82['push'](_0x28ee82['shift']());}catch(_0x5c6be3){_0x28ee82['push'](_0x28ee82['shift']());}}}(a54_0x8031,0x89cd0));import a54_0x9af19e from'chalk';import{existsSync}from'fs';function a54_0x2841(_0x5701d6,_0x55186e){_0x5701d6=_0x5701d6-0x73;const _0x803156=a54_0x8031();let _0x2841cd=_0x803156[_0x5701d6];return _0x2841cd;}import a54_0x254133 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x435c0a from'prompts';function getAttemptStatusDisplay(_0x307f30){const _0x37369c=a54_0x2841;if(!_0x307f30)return{'icon':'⏳','text':''};const {done:_0x4702ff,success:_0x2a09f0,cancelRequested:_0x194a23}=_0x307f30;if(!_0x4702ff)return _0x194a23?{'icon':'🛑','text':a54_0x9af19e['yellow'](_0x37369c(0x157))}:{'icon':'🔄','text':a54_0x9af19e[_0x37369c(0x101)](_0x37369c(0x7f))};if(_0x2a09f0)return{'icon':'✅','text':a54_0x9af19e[_0x37369c(0xde)](_0x37369c(0x21d))};return{'icon':'❌','text':a54_0x9af19e[_0x37369c(0xab)](_0x37369c(0x214))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x5be9ec,_0x3fce72,_0x1502dd=0x0){return _0x5be9ec[_0x1502dd]||_0x3fce72['workflowProject'];}[a54_0x12ede4(0xc6)](_0x508c62,_0x41193a,_0x4ff67a=0x0){const _0xa248bc=a54_0x12ede4,_0x80f9b0=this[_0xa248bc(0x1f8)](_0x508c62,_0x41193a,_0x4ff67a);if(!_0x80f9b0)return console[_0xa248bc(0x214)](a54_0x9af19e[_0xa248bc(0xab)](_0xa248bc(0x163)),'Project\x20name\x20is\x20required'),console['error'](a54_0x9af19e[_0xa248bc(0x1f1)](_0xa248bc(0x89))),null;return _0x80f9b0;}[a54_0x12ede4(0x9d)](_0x2983b3,_0x29a1cd){const _0x102bf9=a54_0x12ede4;if(_0x2983b3[0x0]){const _0xc85fac=_0x2983b3[0x0][_0x102bf9(0x12f)]('.');if(_0xc85fac[_0x102bf9(0x1d8)]===0x1)return{'projectName':_0xc85fac[0x0],'workflowName':undefined};else return _0xc85fac['length']===0x2?{'projectName':_0xc85fac[0x0],'workflowName':_0xc85fac[0x1]}:(console[_0x102bf9(0x214)](a54_0x9af19e[_0x102bf9(0xab)](_0x102bf9(0x163)),_0x102bf9(0x1c5)),null);}return{'projectName':_0x29a1cd[_0x102bf9(0x16f)],'workflowName':undefined};}[a54_0x12ede4(0xc3)](_0x2ef50f,_0x204389,_0xc1b361=0x0){const _0x3c2f96=a54_0x12ede4;if(_0x2ef50f[_0xc1b361])return _0x2ef50f[_0xc1b361];if(_0x204389[_0x3c2f96(0x16f)]){const _0x5db90e=a54_0x254133[_0x3c2f96(0xbf)](process[_0x3c2f96(0x1bd)](),_0x3c2f96(0x15f),_0x204389[_0x3c2f96(0x16f)]);if(existsSync(a54_0x254133[_0x3c2f96(0xbf)](_0x5db90e,_0x3c2f96(0x125))))return _0x5db90e;}return undefined;}async[a54_0x12ede4(0xc1)](_0x26bd71,_0x15858b,_0x75d655){const _0x2410b1=a54_0x12ede4;try{const _0x25a469=await _0x26bd71['workflow'][_0x2410b1(0x15f)](_0x15858b,{'limit':0x1});if(_0x25a469[_0x2410b1(0x1d8)]>0x0){const _0x64c667=_0x25a469[0x0]['id'],_0x366a64=getWorkflowUrl(_0x75d655,_0x64c667);console['error'](_0x2410b1(0x106)+a54_0x9af19e['cyan'](_0x366a64));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x18a);async['execute'](_0x4093ea){const _0x597eb7=a54_0x12ede4,{options:_0x5681e7,args:_0x182b32,tdx:_0x390ace}=_0x4093ea,_0x279ba4=_0x182b32[0x0],_0x37d5e0=_0x5681e7[_0x597eb7(0x17b)];if(_0x37d5e0)return saveSessionContext({'workflow_project':undefined},_0x5681e7[_0x597eb7(0x12b)]),console[_0x597eb7(0x144)](a54_0x9af19e[_0x597eb7(0xde)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x279ba4)return console[_0x597eb7(0x214)](a54_0x9af19e[_0x597eb7(0xab)](_0x597eb7(0x163)),_0x597eb7(0x98)),console[_0x597eb7(0x214)](a54_0x9af19e[_0x597eb7(0x1f1)](_0x597eb7(0x135))),console[_0x597eb7(0x214)](a54_0x9af19e['dim'](_0x597eb7(0xb7))),0x1;const _0x38b774=await withSpinner('Resolving\x20project\x20\x27'+_0x279ba4+_0x597eb7(0xc2),()=>_0x390ace['workflow'][_0x597eb7(0x1fd)](_0x279ba4),{'verbose':_0x5681e7[_0x597eb7(0x19b)]}),{name:_0x35eee4}=_0x38b774[_0x597eb7(0x10a)];return saveSessionContext({'workflow_project':_0x35eee4},_0x5681e7[_0x597eb7(0x12b)]),console['log'](a54_0x9af19e[_0x597eb7(0xde)](_0x597eb7(0x152)+a54_0x9af19e[_0x597eb7(0x124)](_0x35eee4))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x7e);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1eb);async[a54_0x12ede4(0x202)](_0x2a9c7a){const _0x230be7=a54_0x12ede4,{options:_0x6e38f8,args:_0x7b551e,tdx:_0x55272c}=_0x2a9c7a,_0x16e4bd=_0x7b551e[0x0];_0x6e38f8[_0x230be7(0x19b)]&&_0x16e4bd&&console[_0x230be7(0x214)](_0x230be7(0x1b6)+_0x16e4bd);const _0x1067a9=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x55272c[_0x230be7(0x1f4)][_0x230be7(0xce)](_0x16e4bd,{'limit':_0x6e38f8[_0x230be7(0x13d)]}),{'verbose':_0x6e38f8['verbose']});let _0x462a80=_0x1067a9[_0x230be7(0x10a)];_0x462a80[_0x230be7(0x154)]((_0x5a0736,_0x1c4edf)=>_0x5a0736[_0x230be7(0x1a3)]['localeCompare'](_0x1c4edf[_0x230be7(0x1a3)]));const _0x1a87d9=_0x6e38f8[_0x230be7(0x13d)]||0x64,_0x45b0b4=_0x462a80[_0x230be7(0x1d8)]>=_0x1a87d9?a54_0x9af19e[_0x230be7(0x1f1)](_0x230be7(0x1a0)):'';console[_0x230be7(0x214)]('✔\x20Found\x20'+_0x462a80[_0x230be7(0x1d8)]+_0x230be7(0x145)+(_0x462a80[_0x230be7(0x1d8)]!==0x1?'s':'')+_0x45b0b4);if(_0x6e38f8[_0x230be7(0x1ba)]===_0x230be7(0x11f)||_0x6e38f8['format']===_0x230be7(0x11b)||_0x6e38f8[_0x230be7(0x1ba)]===_0x230be7(0x99))await handleSDKOutput(_0x462a80,_0x6e38f8);else{if(_0x462a80['length']===0x0)_0x16e4bd?console[_0x230be7(0x144)](_0x230be7(0x1a9)+_0x16e4bd):console[_0x230be7(0x144)]('No\x20workflow\x20projects\x20found');else{const _0x3331e8=_0x462a80[_0x230be7(0x76)](_0x13b632=>{const _0x175119=_0x230be7,_0xbb4923=_0x13b632[_0x175119(0x1e1)]?.['some'](_0x3d3ac5=>_0x3d3ac5[_0x175119(0x82)]==='sys'),_0x1827ad=_0xbb4923?a54_0x9af19e[_0x175119(0x1f1)](_0x175119(0x12e)):'';return _0x175119(0x134)+_0x13b632[_0x175119(0x1a3)]+_0x1827ad;});await writeOutput(_0x3331e8[_0x230be7(0xbf)]('\x0a'),_0x6e38f8[_0x230be7(0x192)],_0x230be7(0x1f7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x94);['description']=a54_0x12ede4(0xb6);async[a54_0x12ede4(0x202)](_0x4741e2){const _0x4183b9=a54_0x12ede4,{options:_0x2a5b8b,args:_0x5e502e,tdx:_0x5ed5b1}=_0x4741e2,_0x57a04e=this[_0x4183b9(0x1f8)](_0x5e502e,_0x2a5b8b);_0x2a5b8b['verbose']&&_0x57a04e&&console['error'](_0x4183b9(0xd5)+_0x57a04e);const _0xd1132b=await withSpinner(_0x4183b9(0x131),()=>_0x5ed5b1['workflow'][_0x4183b9(0x15f)](_0x57a04e,{'limit':_0x2a5b8b['limit']}),{'verbose':_0x2a5b8b['verbose']});let _0xa6e90a=_0xd1132b['data'];_0xa6e90a['sort']((_0x528dcb,_0x2ee326)=>{const _0x3c00f8=_0x4183b9,_0x3d882b=_0x528dcb[_0x3c00f8(0x1a3)][_0x3c00f8(0x1cf)](_0x2ee326[_0x3c00f8(0x1a3)]);if(_0x3d882b!==0x0)return _0x3d882b;return(_0x528dcb[_0x3c00f8(0x168)]?.['name']||'')[_0x3c00f8(0x1cf)](_0x2ee326['project']?.['name']||'');});const _0x3a421c=_0x2a5b8b[_0x4183b9(0x13d)]||0x64,_0x485e1b=_0xa6e90a['length']>=_0x3a421c?a54_0x9af19e[_0x4183b9(0x1f1)](_0x4183b9(0x1a0)):'';console[_0x4183b9(0x214)](_0x4183b9(0x7d)+_0xa6e90a[_0x4183b9(0x1d8)]+_0x4183b9(0x1dd)+(_0xa6e90a[_0x4183b9(0x1d8)]!==0x1?'s':'')+_0x485e1b);if(_0x2a5b8b['format']==='json'||_0x2a5b8b['format']===_0x4183b9(0x11b)||_0x2a5b8b[_0x4183b9(0x1ba)]===_0x4183b9(0x99))await handleSDKOutput(_0xa6e90a,_0x2a5b8b);else{if(_0xa6e90a[_0x4183b9(0x1d8)]===0x0)_0x57a04e?console['log'](_0x4183b9(0x11c)+_0x57a04e):console['log'](_0x4183b9(0x13f));else{const _0x5401c9=_0x2a5b8b[_0x4183b9(0x10d)],_0x418a7c=_0xa6e90a['map'](_0x47d665=>{const _0x203e7f=_0x4183b9,_0x549d83=a54_0x9af19e['dim']('#'+_0x47d665['id']),_0x5708b6=hyperlink(_0x549d83,getWorkflowUrl(_0x5401c9,_0x47d665['id'])),_0x1b5327=_0x47d665[_0x203e7f(0x168)]?.[_0x203e7f(0x1a3)]?a54_0x9af19e[_0x203e7f(0x1f1)]('\x20('+_0x47d665['project'][_0x203e7f(0x1a3)]+')'):'';return _0x203e7f(0x1d3)+_0x5708b6+'\x20'+_0x47d665[_0x203e7f(0x1a3)]+_0x1b5327;});await writeOutput(_0x418a7c['join']('\x0a'),_0x2a5b8b['output'],_0x4183b9(0x1f7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1e4);async['execute'](_0x1c284f){const _0x3432a2=a54_0x12ede4,{options:_0x17072d,args:_0x4ca93c,tdx:_0x10caf}=_0x1c284f,_0x333c2a=this[_0x3432a2(0x9d)](_0x4ca93c,_0x17072d);if(!_0x333c2a)return 0x1;const {projectName:_0x3359c0,workflowName:_0x294cd4}=_0x333c2a;if(_0x17072d[_0x3432a2(0x19b)]){if(_0x3359c0&&_0x294cd4)console[_0x3432a2(0x214)](_0x3432a2(0xfe)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0&&console[_0x3432a2(0x214)](_0x3432a2(0x11d)+_0x3359c0);const _0x410b8e=_0x17072d[_0x3432a2(0x119)];_0x410b8e&&console['error'](_0x3432a2(0x1ad)+_0x410b8e);}let _0x1866a9=0x28;if(process[_0x3432a2(0xd7)]['isTTY']&&!_0x17072d[_0x3432a2(0x192)]&&!_0x17072d[_0x3432a2(0x1ba)]){const _0x2266b0=process[_0x3432a2(0xd7)][_0x3432a2(0x8d)]||0x28;_0x1866a9=Math[_0x3432a2(0x1ca)](0x14,Math['floor'](_0x2266b0*0x2/0x3));}const _0x1ba108=_0x17072d[_0x3432a2(0x13d)]||_0x1866a9,_0xefa91a=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x10caf[_0x3432a2(0x1f4)][_0x3432a2(0x1e5)]({'projectName':_0x3359c0,'workflowName':_0x294cd4,'status':_0x17072d[_0x3432a2(0x119)],'fromTime':_0x17072d[_0x3432a2(0x205)],'toTime':_0x17072d['to'],'limit':_0x1ba108}),{'verbose':_0x17072d['verbose']}),_0x107e4f=_0xefa91a['data'];_0x107e4f[_0x3432a2(0x154)]((_0x2a28ff,_0x17176c)=>{const _0x514561=_0x3432a2,_0x488575=_0x2a28ff[_0x514561(0x1ed)]||'',_0xdb4425=_0x17176c[_0x514561(0x1ed)]||'';return _0xdb4425[_0x514561(0x1cf)](_0x488575);});_0x107e4f[_0x3432a2(0x1d8)]>=_0x1ba108?console[_0x3432a2(0x214)]('✔\x20Showing\x20'+_0x107e4f[_0x3432a2(0x1d8)]+_0x3432a2(0x1aa)+a54_0x9af19e['dim'](_0x3432a2(0xf1))):console[_0x3432a2(0x214)](_0x3432a2(0x7d)+_0x107e4f['length']+_0x3432a2(0x17e)+(_0x107e4f[_0x3432a2(0x1d8)]!==0x1?'s':''));if(_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x11f)||_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x11b)||_0x17072d[_0x3432a2(0x1ba)]===_0x3432a2(0x99))await handleSDKOutput(_0x107e4f,_0x17072d);else{if(!process[_0x3432a2(0xd7)][_0x3432a2(0x1b8)]||_0x17072d[_0x3432a2(0x192)]){if(_0x107e4f[_0x3432a2(0x1d8)]===0x0){if(_0x3359c0&&_0x294cd4)console[_0x3432a2(0x144)](_0x3432a2(0x1a6)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0?console[_0x3432a2(0x144)](_0x3432a2(0x16a)+_0x3359c0):console['log'](_0x3432a2(0x201));}else{const _0x2a43f0=_0x17072d[_0x3432a2(0x10d)],_0x28eb39=this[_0x3432a2(0x1ac)](_0x107e4f,_0x2a43f0);_0x17072d['output']?await writeOutput(_0x28eb39,_0x17072d[_0x3432a2(0x192)],'list'):console[_0x3432a2(0x144)](_0x28eb39);}!_0x3359c0&&(console[_0x3432a2(0x214)](''),console[_0x3432a2(0x214)](a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0xa3))),console[_0x3432a2(0x214)](a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0xf0))+'or'+a54_0x9af19e[_0x3432a2(0x1f1)](_0x3432a2(0x173))));}else{if(_0x107e4f[_0x3432a2(0x1d8)]===0x0){if(_0x3359c0&&_0x294cd4)console['log'](_0x3432a2(0x1a6)+_0x3359c0+'.'+_0x294cd4);else _0x3359c0?console[_0x3432a2(0x144)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3359c0):console['log'](_0x3432a2(0x201));}else await this[_0x3432a2(0x7b)](_0x107e4f,_0x1c284f,_0x3359c0);}}return 0x0;}['renderSessionsTimeline'](_0x467fc9,_0x1d168c){const _0x301cc3=a54_0x12ede4,_0x315875=[],_0x4f8433=new Map();let _0x40f1ea=Infinity,_0x1a1b96=-Infinity;for(const _0x488a9d of _0x467fc9){if(_0x488a9d[_0x301cc3(0x117)]?.[_0x301cc3(0xd2)]){const _0x236fb1=new Date(_0x488a9d[_0x301cc3(0x117)][_0x301cc3(0xd2)])[_0x301cc3(0x1b0)](),_0x5704ae=_0x488a9d[_0x301cc3(0x117)][_0x301cc3(0x166)]?new Date(_0x488a9d['lastAttempt'][_0x301cc3(0x166)])['getTime']():Date['now'](),_0x4af6f9=_0x488a9d[_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||_0x301cc3(0x156);!_0x4f8433[_0x301cc3(0xd4)](_0x4af6f9)&&_0x4f8433[_0x301cc3(0x1ee)](_0x4af6f9,[]),_0x4f8433['get'](_0x4af6f9)[_0x301cc3(0x1cd)]({'session':_0x488a9d,'startTime':_0x236fb1,'endTime':_0x5704ae,'duration':_0x5704ae-_0x236fb1}),_0x40f1ea=Math[_0x301cc3(0x20b)](_0x40f1ea,_0x236fb1),_0x1a1b96=Math[_0x301cc3(0x1ca)](_0x1a1b96,_0x5704ae);}}if(_0x4f8433[_0x301cc3(0x1f5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x426bbe=process['stdout']['columns']||0x78,_0x1eefc5=0x1e,_0x2000f5=0x32,_0x59ebe6=0x4,_0x1e976a=Math[_0x301cc3(0x20b)](_0x2000f5,Math['max'](_0x1eefc5,Math['floor'](_0x426bbe*0.3))),_0x25c1df=_0x426bbe-_0x1e976a-TIMELINE_CONFIG[_0x301cc3(0xeb)]-0x3-_0x59ebe6,_0x162c7a=_0x1a1b96-_0x40f1ea,_0x3955d4=_0x162c7a/_0x1e976a,_0x3df370=renderTimeAxis({'startTime':_0x40f1ea,'endTime':_0x1a1b96,'durationMs':_0x162c7a,'msPerChar':_0x3955d4},_0x1e976a),_0x1e9684=[];for(const _0x2c0348 of _0x4f8433['values']()){_0x1e9684[_0x301cc3(0x1cd)](..._0x2c0348);}_0x1e9684[_0x301cc3(0x154)]((_0x429196,_0x240315)=>_0x240315[_0x301cc3(0x1e3)]-_0x429196[_0x301cc3(0x1e3)]);const _0x17a19c=new Date(_0x40f1ea),_0x3a004d=formatDate(_0x17a19c),_0x5e7181=_0x59ebe6+TIMELINE_CONFIG[_0x301cc3(0xa4)]+TIMELINE_CONFIG[_0x301cc3(0xf8)]+_0x25c1df,_0x229ad9='\x20'[_0x301cc3(0xa8)](_0x5e7181-_0x3a004d[_0x301cc3(0x1d8)]),_0x6aab68=_0x229ad9+a54_0x9af19e[_0x301cc3(0x1f1)](_0x3a004d)+'\x20'+_0x3df370;_0x315875[_0x301cc3(0x1cd)](_0x6aab68);const _0x4994b6=0x16;let _0x397a29=0x0;for(const _0x22ee3e of _0x1e9684){const _0x46b93c=_0x22ee3e[_0x301cc3(0x12b)][_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||'?',_0x4ab858=Math[_0x301cc3(0x20b)](stringWidth(_0x46b93c),_0x4994b6);_0x397a29=Math['max'](_0x397a29,_0x4ab858);}for(const _0x5e2071 of _0x1e9684){const {session:_0x2d2bf9,startTime:_0xabfc80,endTime:_0x23f779,duration:_0xe0ee0e}=_0x5e2071,_0x49cfec=_0x2d2bf9['project']?.['id'],_0x546b88=_0x2d2bf9['id'],_0x1da1b9=_0x2d2bf9[_0x301cc3(0x168)]?.[_0x301cc3(0x1a3)]||'?',_0x5d8080=_0x2d2bf9['workflow']?.[_0x301cc3(0x1a3)]||'?';let _0x5b6e6b,_0x3fa5b3;if(_0x2d2bf9[_0x301cc3(0x117)]){const _0x371a6b=_0x2d2bf9[_0x301cc3(0x117)];!_0x371a6b[_0x301cc3(0xb9)]?(_0x5b6e6b=_0x371a6b[_0x301cc3(0x8a)]?'🛑':'🔄',_0x3fa5b3=_0x371a6b['cancelRequested']?a54_0x9af19e['yellow']:a54_0x9af19e[_0x301cc3(0x101)]):(_0x5b6e6b=_0x371a6b[_0x301cc3(0x21d)]?'✅':'❌',_0x3fa5b3=_0x371a6b[_0x301cc3(0x21d)]?a54_0x9af19e[_0x301cc3(0xde)]:a54_0x9af19e[_0x301cc3(0xab)]);}else _0x5b6e6b='⏳',_0x3fa5b3=a54_0x9af19e['dim'];const _0x4f980a='#'+_0x546b88,_0x292264=_0x49cfec?hyperlink(_0x4f980a,getWorkflowSessionUrl(_0x1d168c,_0x49cfec,_0x546b88)):_0x4f980a;let _0x24e040=_0x1da1b9;stringWidth(_0x1da1b9)>_0x4994b6&&(_0x24e040=_0x1da1b9[_0x301cc3(0x17a)](0x0,_0x4994b6-0x1)+'…');const _0x4ed033=a54_0x9af19e[_0x301cc3(0x1f1)](_0x24e040),_0x242539=stringWidth(_0x24e040),_0x23779f='\x20'[_0x301cc3(0xa8)](_0x397a29-stringWidth(_0x24e040)+0x2),_0x5f1781='('+formatElapsed(_0xe0ee0e)+')',_0x5f19c0=stringWidth(_0x5f1781),_0x428e31=stringWidth(_0x4f980a),_0x3faa87=_0x428e31+0x1+_0x242539+_0x23779f['length'],_0x1a7811=_0x25c1df-_0x3faa87-_0x5f19c0-0x1-0x8;let _0x15365f=_0x5d8080;stringWidth(_0x15365f)>_0x1a7811&&(_0x15365f=_0x15365f[_0x301cc3(0x17a)](0x0,_0x1a7811-0x1)+'…');const _0xfebd98=_0x292264+'\x20'+_0x4ed033+_0x23779f+_0x15365f,_0x11ef7a=stringWidth(_0xfebd98),_0x48c96b=_0x25c1df-_0x11ef7a-_0x5f19c0,_0x5a409e=_0xfebd98+'\x20'[_0x301cc3(0xa8)](Math[_0x301cc3(0x1ca)](0x1,_0x48c96b))+a54_0x9af19e[_0x301cc3(0x1f1)](_0x5f1781),_0x4ffc94=Math['floor']((_0xabfc80-_0x40f1ea)/_0x3955d4),_0x12f0cb=Math[_0x301cc3(0x198)]((_0x23f779-_0x40f1ea)/_0x3955d4),_0x257a62=Math[_0x301cc3(0x1ca)](_0x4ffc94+0x1,_0x12f0cb),_0x519399=new Array(_0x1e976a)['fill']('\x20');for(let _0x748bbe=_0x4ffc94;_0x748bbe<Math['min'](_0x257a62,_0x1e976a);_0x748bbe++){_0x519399[_0x748bbe]='─';}const _0x5d5c75=_0x519399[_0x301cc3(0x76)](_0x2bfa9f=>_0x2bfa9f==='\x20'?'\x20':_0x3fa5b3(_0x2bfa9f))[_0x301cc3(0xbf)]('');_0x315875[_0x301cc3(0x1cd)](_0x5b6e6b+'\x20'+_0x5a409e+'│'+_0x5d5c75+'│');}return _0x315875[_0x301cc3(0xbf)]('\x0a');}async[a54_0x12ede4(0x7b)](_0x541f70,_0x40403d,_0x460c25){const _0x3f15cb=a54_0x12ede4,{options:_0x58e4a6,tdx:_0x5845c7}=_0x40403d,_0x5d0ede=_0x58e4a6[_0x3f15cb(0x10d)],{timelineRows:_0x19b34f,timeAxisHeader:_0x70113f}=this[_0x3f15cb(0x1fa)](_0x541f70,_0x5d0ede),_0x21be23=_0x19b34f[_0x3f15cb(0xf3)](_0x554bcb=>_0x554bcb[_0x3f15cb(0x1f2)]);if(_0x21be23[_0x3f15cb(0x1d8)]===0x0){const _0x3d0a95=this[_0x3f15cb(0x1ac)](_0x541f70,_0x5d0ede);console['log'](_0x3d0a95);!_0x460c25&&(console[_0x3f15cb(0x214)](''),console[_0x3f15cb(0x214)](a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0xa3))),console['error'](a54_0x9af19e['dim'](_0x3f15cb(0xf0))+'or'+a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0x173))));return;}_0x70113f&&console[_0x3f15cb(0x144)](_0x70113f);const _0x57c0a1=_0x19b34f[_0x3f15cb(0xf3)](_0x426e0f=>_0x426e0f[_0x3f15cb(0x1f2)])[_0x3f15cb(0x76)](_0x17852b=>({'title':_0x17852b[_0x3f15cb(0x93)],'value':_0x17852b[_0x3f15cb(0x1f2)]})),_0x4d268e=process[_0x3f15cb(0xd7)][_0x3f15cb(0x8d)]||0x3c,_0x5eb12e=Math[_0x3f15cb(0x1ca)](0x28,Math['floor'](_0x4d268e*0x2/0x3)),_0x594efa=await a54_0x435c0a({'type':_0x3f15cb(0x19d),'name':_0x3f15cb(0x1f2),'message':_0x3f15cb(0x12c),'choices':_0x57c0a1,'initial':-0x1,'limit':_0x5eb12e,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0xcaf48c,_0x23159a)=>{const _0x88f1ab=_0x3f15cb;if(!_0xcaf48c)return Promise['resolve'](_0x23159a);const _0x5426bc=_0x23159a[_0x88f1ab(0xf3)](_0x40cd53=>{const _0x3c7af3=_0x88f1ab,_0x3fc31f=_0x40cd53;return _0x3fc31f[_0x3c7af3(0x85)][_0x3c7af3(0xdf)]()[_0x3c7af3(0x20a)](_0xcaf48c[_0x3c7af3(0xdf)]());});return Promise['resolve'](_0x5426bc);}}),_0x5de3b6=()=>{const _0x1fee08=_0x3f15cb;process[_0x1fee08(0xd7)][_0x1fee08(0x10f)](_0x1fee08(0x1cc)),process[_0x1fee08(0xd7)][_0x1fee08(0x10f)](_0x1fee08(0x1cc)),process[_0x1fee08(0xd7)][_0x1fee08(0x10f)]('\x1b[1A\x1b[2K');},_0x29ff61=_0x594efa&&_0x594efa[_0x3f15cb(0x1f2)]&&_0x594efa[_0x3f15cb(0x1f2)]!==null&&_0x594efa[_0x3f15cb(0x1f2)][_0x3f15cb(0xc7)]()!=='';if(!_0x29ff61){_0x5de3b6(),console[_0x3f15cb(0x144)](a54_0x9af19e[_0x3f15cb(0x1f1)](_0x3f15cb(0x148)));return;}_0x5de3b6();const _0x2f02ab=_0x541f70[_0x3f15cb(0x1f3)](_0x5c63cf=>_0x5c63cf[_0x3f15cb(0x117)]?.['id']===_0x594efa[_0x3f15cb(0x1f2)]);if(_0x2f02ab){const _0x53ee59=_0x2f02ab[_0x3f15cb(0x168)]?.['name']||'?',_0x44abe6=_0x2f02ab[_0x3f15cb(0x1f4)]?.[_0x3f15cb(0x1a3)]||'?';console['log'](_0x3f15cb(0x1c2)+a54_0x9af19e[_0x3f15cb(0x1f1)](_0x53ee59)+_0x3f15cb(0x17c)+a54_0x9af19e['dim'](_0x44abe6));}const _0x2046c7=new WorkflowTimelineCommand();await _0x2046c7[_0x3f15cb(0x202)]({'args':[],'options':{..._0x58e4a6,'attemptId':_0x594efa[_0x3f15cb(0x1f2)]},'tdx':_0x5845c7});}['generateSessionTimelineRows'](_0x5933ca,_0x3de01a){const _0x2b8649=a54_0x12ede4,_0x1d90d7=new Map();for(const _0x168ab4 of _0x5933ca){_0x168ab4['id']&&_0x168ab4[_0x2b8649(0x117)]?.['id']&&_0x1d90d7['set'](_0x168ab4['id'],_0x168ab4[_0x2b8649(0x117)]['id']);}const _0x38e4cc=[];let _0x294d79='';const _0x5b4021=this[_0x2b8649(0x1ac)](_0x5933ca,_0x3de01a),_0x206d9e=_0x5b4021[_0x2b8649(0x12f)]('\x0a');for(const _0x341d51 of _0x206d9e){if(_0x341d51[_0x2b8649(0xb4)](_0x2b8649(0x211))||_0x341d51[_0x2b8649(0x111)](/^\s+\d{4}-\d{2}-\d{2}/))_0x294d79=_0x341d51;else{if(_0x341d51[_0x2b8649(0x111)](/^[✅❌🔄🛑⏳]/)){const _0xe45ca4=_0x341d51['match'](/#(\d+)/),_0x179c97=_0xe45ca4?_0xe45ca4[0x1]:null,_0x378173=_0x179c97?_0x1d90d7[_0x2b8649(0xbd)](_0x179c97)||null:null,_0x1c20e6=_0x5933ca[_0x2b8649(0x1f3)](_0x4ca01a=>_0x4ca01a['id']===_0x179c97),_0x4d3cb0=_0x1c20e6?.[_0x2b8649(0x168)]?.['name']||'';_0x38e4cc[_0x2b8649(0x1cd)]({'displayLine':_0x341d51,'attemptId':_0x378173,'projectName':_0x4d3cb0});}}}return{'timelineRows':_0x38e4cc,'timeAxisHeader':_0x294d79};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x126);['description']='List\x20workflow\x20attempts';async[a54_0x12ede4(0x202)](_0x491170){const _0x3b39f2=a54_0x12ede4,{options:_0x16f066,args:_0x416ae7,tdx:_0x53444a}=_0x491170,_0x255c52=this['parseProjectWorkflowPattern'](_0x416ae7,_0x16f066);if(!_0x255c52)return 0x1;const {projectName:_0x4be2cd,workflowName:_0x170c2d}=_0x255c52,_0x430343=_0x16f066['includeRetried'];if(_0x16f066['verbose']){if(_0x4be2cd&&_0x170c2d)console[_0x3b39f2(0x214)]('Filter:\x20'+_0x4be2cd+'.'+_0x170c2d);else _0x4be2cd&&console[_0x3b39f2(0x214)](_0x3b39f2(0x11d)+_0x4be2cd);_0x430343&&console[_0x3b39f2(0x214)](_0x3b39f2(0x10e));}const _0x1d60c3=await withSpinner(_0x3b39f2(0x91),()=>_0x53444a[_0x3b39f2(0x1f4)][_0x3b39f2(0x20d)]({'projectName':_0x4be2cd,'workflowName':_0x170c2d,'includeRetried':_0x430343,'limit':_0x16f066[_0x3b39f2(0x13d)]}),{'verbose':_0x16f066[_0x3b39f2(0x19b)]}),_0x5d1367=_0x1d60c3[_0x3b39f2(0x10a)],_0x3c45bc=_0x16f066[_0x3b39f2(0x13d)]||0x64,_0x2f750b=_0x5d1367[_0x3b39f2(0x1d8)]>=_0x3c45bc?a54_0x9af19e['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x5d1367['length']+'\x20attempt'+(_0x5d1367[_0x3b39f2(0x1d8)]!==0x1?'s':'')+_0x2f750b);if(_0x16f066[_0x3b39f2(0x1ba)]==='json'||_0x16f066[_0x3b39f2(0x1ba)]===_0x3b39f2(0x11b)||_0x16f066[_0x3b39f2(0x1ba)]==='table')await handleSDKOutput(_0x5d1367,_0x16f066);else{if(_0x5d1367['length']===0x0){if(_0x4be2cd&&_0x170c2d)console[_0x3b39f2(0x144)](_0x3b39f2(0x208)+_0x4be2cd+'.'+_0x170c2d);else _0x4be2cd?console[_0x3b39f2(0x144)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x4be2cd):console[_0x3b39f2(0x144)](_0x3b39f2(0x120));}else{const _0x48511e=_0x16f066[_0x3b39f2(0x10d)],_0x5d9d8e=_0x5d1367[_0x3b39f2(0x76)](_0xa983db=>{const _0x3fc551=_0x3b39f2,_0x4984a1=a54_0x9af19e[_0x3fc551(0x1f1)]('#'+_0xa983db['id']),_0x4f1fff=_0xa983db[_0x3fc551(0x168)]?.['id'],_0x38d237=_0xa983db[_0x3fc551(0x217)]||_0xa983db[_0x3fc551(0x1a1)],_0xe06e31=_0x4f1fff&&_0x38d237?hyperlink(_0x4984a1,getWorkflowAttemptUrl(_0x48511e,_0x4f1fff,_0x38d237,_0xa983db['id'])):_0x4984a1,{icon:_0x356ef9,text:_0x43bb74}=getAttemptStatusDisplay(_0xa983db),_0x359ec9=(_0xa983db['project']?.['name']||'?')+'.'+(_0xa983db[_0x3fc551(0x1f4)]?.['name']||'?'),_0x17de98=_0xa983db['sessionTime']?a54_0x9af19e['dim'](_0xa983db['sessionTime']):'';return(_0xe06e31+'\x20'+_0x356ef9+(_0x43bb74?'\x20'+_0x43bb74:'')+'\x20'+_0x359ec9+'\x20'+_0x17de98)['trimEnd']();});await writeOutput(_0x5d9d8e[_0x3b39f2(0xbf)]('\x0a'),_0x16f066[_0x3b39f2(0x192)],_0x3b39f2(0x1f7));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]='workflow:attempt';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1bb);async['execute'](_0x2c00fa){const _0x3dd016=a54_0x12ede4,{options:_0x3b5391,args:_0x482766,tdx:_0xbeeb65}=_0x2c00fa,_0x4397ff=_0x482766[0x0];if(!_0x4397ff)return console['error'](_0x3dd016(0x138)),0x1;_0x3b5391[_0x3dd016(0x19b)]&&console[_0x3dd016(0x214)](_0x3dd016(0x13b)+_0x4397ff);const _0x44128c=await withSpinner('Getting\x20attempt\x20details...',()=>_0xbeeb65[_0x3dd016(0x1f4)][_0x3dd016(0x21b)](_0x4397ff),{'verbose':_0x3b5391[_0x3dd016(0x19b)]}),_0xe87775=_0x44128c['data'];let _0x288f9c;!_0xe87775[_0x3dd016(0xb9)]?_0x288f9c=_0xe87775[_0x3dd016(0x8a)]?'canceling':'running':_0x288f9c=_0xe87775[_0x3dd016(0x21d)]?_0x3dd016(0x21d):'error';let _0x5cc189;if(_0xe87775[_0x3dd016(0xd2)]&&_0xe87775[_0x3dd016(0x166)]){const _0x55301c=new Date(_0xe87775[_0x3dd016(0xd2)])[_0x3dd016(0x1b0)](),_0x261f65=new Date(_0xe87775[_0x3dd016(0x166)])[_0x3dd016(0x1b0)]();_0x5cc189=Math[_0x3dd016(0xaa)]((_0x261f65-_0x55301c)/0x3e8);}const _0x4f86a2={'attempt_id':_0xe87775['id'],'status':_0x288f9c,..._0xe87775['index']!==undefined&&{'index':_0xe87775[_0x3dd016(0x1e9)]},..._0xe87775[_0x3dd016(0x168)]&&{'project':_0xe87775['project'][_0x3dd016(0x1a3)]},..._0xe87775[_0x3dd016(0x1f4)]&&{'workflow':_0xe87775[_0x3dd016(0x1f4)][_0x3dd016(0x1a3)]},..._0xe87775[_0x3dd016(0x1a1)]&&{'session_id':_0xe87775['sessionId']},..._0xe87775['sessionTime']&&{'session_time':_0xe87775[_0x3dd016(0x1ed)]},..._0xe87775[_0x3dd016(0x128)]&&{'retry_attempt':_0xe87775[_0x3dd016(0x128)]},..._0x5cc189!==undefined&&{'duration_sec':_0x5cc189},..._0xe87775[_0x3dd016(0xd2)]&&{'created_at':_0xe87775[_0x3dd016(0xd2)]},..._0xe87775[_0x3dd016(0x166)]&&{'finished_at':_0xe87775[_0x3dd016(0x166)]},...Object[_0x3dd016(0x1ea)](_0xe87775[_0x3dd016(0x77)])[_0x3dd016(0x1d8)]>0x0&&{'params':_0xe87775[_0x3dd016(0x77)]}};return await handleSingleObjectOutput(_0x4f86a2,_0x3b5391),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x193);async[a54_0x12ede4(0x202)](_0x2cc2d1){const _0x5d654b=a54_0x12ede4,{options:_0x4051bd,args:_0x4d4eb7,tdx:_0x248b52}=_0x2cc2d1,_0x20395f=_0x4d4eb7[0x0];if(!_0x20395f)return console[_0x5d654b(0x214)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2f4460=_0x4051bd[_0x5d654b(0xb8)];_0x4051bd[_0x5d654b(0x19b)]&&(console[_0x5d654b(0x214)](_0x5d654b(0x13b)+_0x20395f),_0x2f4460&&console[_0x5d654b(0x214)](_0x5d654b(0xe4)));const _0x38c6e6=await withSpinner(_0x5d654b(0xc4),()=>_0x248b52[_0x5d654b(0x1f4)][_0x5d654b(0x19c)](_0x20395f,_0x2f4460||![]),{'verbose':_0x4051bd[_0x5d654b(0x19b)]}),_0x180755=_0x38c6e6['data'];return console[_0x5d654b(0x214)](_0x5d654b(0x7d)+_0x180755['length']+_0x5d654b(0x13a)+(_0x180755[_0x5d654b(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x180755,_0x4051bd),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x1e7);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x170);async['execute'](_0x7ad28e){const _0x404dc4=a54_0x12ede4,{options:_0x3087b5,args:_0x2dd2a9,tdx:_0x257466}=_0x7ad28e,_0x522a58=_0x2dd2a9[0x0];let _0x41bc4c=_0x2dd2a9[0x1];if(!_0x522a58)return console[_0x404dc4(0x214)](_0x404dc4(0x138)),0x1;_0x3087b5[_0x404dc4(0x19b)]&&(console[_0x404dc4(0x214)](_0x404dc4(0x13b)+_0x522a58),_0x41bc4c&&console['error'](_0x404dc4(0xba)+_0x41bc4c));const _0x36cb65=await withSpinner(_0x404dc4(0xf6),()=>_0x257466[_0x404dc4(0x1f4)][_0x404dc4(0x86)](_0x522a58,_0x41bc4c),{'verbose':_0x3087b5[_0x404dc4(0x19b)]}),_0x32a9e2=_0x36cb65['data'];if(_0x32a9e2['length']===0x0)return console[_0x404dc4(0x214)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x41bc4c&&(_0x3087b5[_0x404dc4(0x11f)]||_0x3087b5[_0x404dc4(0x1ba)]))return await handleSDKOutput(_0x32a9e2,_0x3087b5),0x0;if(!_0x41bc4c){const _0x2cd79c=_0x32a9e2[_0x404dc4(0x76)](_0x3df113=>({'title':_0x3df113[_0x404dc4(0xfb)]+'\x20('+formatBytes(_0x3df113[_0x404dc4(0x203)])+')','value':_0x3df113[_0x404dc4(0xfb)]})),_0x25a249=await a54_0x435c0a({'type':'select','name':_0x404dc4(0x132),'message':_0x404dc4(0x88),'choices':_0x2cd79c});if(!_0x25a249['task'])return console['error'](_0x404dc4(0x148)),0x0;_0x41bc4c=_0x25a249['task'];}const _0x5818c6=await withSpinner(_0x404dc4(0x21a),()=>_0x257466[_0x404dc4(0x1f4)][_0x404dc4(0x1ce)](_0x522a58,_0x41bc4c),{'verbose':_0x3087b5['verbose']}),_0x1b439f=_0x5818c6[_0x404dc4(0x10a)];return _0x1b439f?console[_0x404dc4(0x144)](_0x1b439f):console[_0x404dc4(0x214)]('No\x20log\x20content\x20found'),0x0;}}function a54_0x8031(){const _0x42f221=['\x20new','fileCount','No\x20workflow\x20tdx.json\x20found','\x20\x20New\x20attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','ICON_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','splice','isNewProject','repeat','context','round','red','listSecrets','TASK_NAME_WIDTH','\x20-\x20','Loading\x20workflows...','\x20\x20Files\x20extracted:\x20','Writing\x20files...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20no\x20files\x20written','startsWith','parse','List\x20workflows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','includeSubtasks','done','Task\x20name:\x20','sourceProjectName','9PqVCzc','get','8355056vgtzIr','join','newProjectName','showWorkflowConsoleUrl','\x27...','resolveProjectDir','Getting\x20attempt\x20tasks...','workflow:kill','requireProject','trim','sourceDir','\x20\x20Changes:\x20','Latest\x20session\x20has\x20no\x20attempt','-\x20nothing\x20pushed','padStart','\x22?\x20This\x20cannot\x20be\x20undone.','projects','workflow:secrets:delete','workflow:upload','targetDir','createdAt','/sessions/','has','Project\x20filter:\x20','Using\x20attempt\x20','stdout','\x20is\x20not\x20a\x20directory','Invalid\x20format:\x20','all','\x0a✔\x20Already\x20up\x20to\x20date','\x20of\x20','✔\x20Secret\x20\x27','green','toLowerCase','67893ivPvtM','Error:\x20Invalid\x20JSON\x20in\x20--params','projectName','getMonth','Including\x20subtasks:\x20yes','getDate','durationMs','Analyzing\x20changes...','pullProject','readFile','Cloning\x20to\x20','GUTTER','renderTimeline','Validation:\x20skipped','workflow:secrets:set','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','(use\x20--limit\x20to\x20see\x20more)','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','filter','workflow:retry','Pulling\x20project\x20','Fetching\x20log\x20files...','Key\x20cannot\x20be\x20empty','ICON_SPACING','dryRun','Kill\x20a\x20running\x20attempt','taskName','startedAt','MAX_TASKS_DISPLAY','Filter:\x20','Session\x20not\x20found:\x20','Updating\x20','blue','MIN_LABEL_COUNT','delete','Secrets\x20to\x20set:\x20','\x20\x20Revision:\x20','\x20\x20Console:\x20','Reason:\x20','Error:\x20Project\x20name\x20is\x20required','unchanged','data','Total:\x20','Dry\x20run:\x20yes','site','Include\x20retried:\x20yes','write','\x20\x20Source:\x20','match','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','fill','Error:\x20Secret\x20key\x20is\x20required','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Project\x20ID:\x20','lastAttempt','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','status','142xxRRBr','jsonl','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20project=','1560192oDUxaL','json','No\x20attempts\x20found','\x22\x20with\x20new\x20revision?','every','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','cyan','tdx.json','workflow:attempts','MAX_POLL_ITERATIONS','retryAttemptName','duration','deleteSecret','session','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','21979730QUvXrX','\x20(system)','split','start','Listing\x20workflows...','task','Source\x20directory:\x20','📁\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x0a✔\x20Attempt\x20complete','pollTimeline','Error:\x20Attempt\x20ID\x20is\x20required','✔\x20Workflow\x20run\x20started','\x20task','Attempt\x20ID:\x20','indexOf','limit','\x0a⚠\x20Project\x20\x22','No\x20workflows\x20found','\x0aError:','resumeFrom','✔\x20Clone\x20complete','\x0aDry\x20run\x20-\x20no\x20files\x20written','log','\x20project','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x22\x20to\x20new\x20project\x20\x22','Cancelled','param','description','existingProjectId','total','Setting\x20secret...','tdx\x20wf\x20attempt\x20','yellow','buildTimelineData','\x20\x20Session\x20ID:\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','executeCloneProject','sort','Downloading\x20project\x20','(unknown)','canceling','\x20secrets...','isDirectory','workflow:push','MAX_TIMELINE_WIDTH','MIN_TIMELINE_WIDTH','follow','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflows','Source\x20directory\x20is\x20required','\x20\x20Location:\x20','stat','Error:','Expected\x20format:\x20--param\x20key=value','prepareCloneProject','finishedAt','yes','project','Failed\x20to\x20fetch\x20attempt\x20data','No\x20sessions\x20found\x20in\x20project:\x20','Params:\x20','\x0aClone\x20\x22','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','retryAttempt','workflowProject','Show\x20logs\x20for\x20a\x20workflow\x20attempt','select','msPerChar','\x20\x20tdx\x20wf\x20use\x20<project>','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Source\x20project:\x20','modified','\x20has\x20no\x20attempts','deleted','MAX_LABEL_COUNT','slice','clear',',\x20Workflow:\x20','attempt:','\x20session','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','unknown','Project\x20name:\x20','Files\x20to\x20upload:\x20','\x0aPush\x20these\x20changes?','newProjectId','stringify','Pushing\x20workflow\x20project...','\x0aApply\x20these\x20changes?','Target\x20directory:\x20','💡\x20Tip:\x20Use\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','relative','fullName','isArray','New\x20project\x20name:\x20','group_error','substring','/app/workflows/','output','Show\x20tasks\x20for\x20an\x20attempt','\x27\x20from\x20project\x20\x27','workflow:timeline','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','workflow:clone','floor','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x0aUpdate\x20existing\x20project\x20\x22','verbose','tasks','autocomplete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Retrying\x20attempt...','\x20(use\x20--limit\x20to\x20show\x20more)','sessionId','\x20from\x20session\x20','name','executePushProject','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','No\x20sessions\x20found\x20for:\x20','setSecrets','\x20deleted','No\x20projects\x20match\x20pattern:\x20','\x20sessions\x20','Killing\x20attempt...','renderSessionsTimeline','Status:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','value','getTime','Loading\x20session...','Starting\x20workflow\x20run...','applyPullProject','\x20\x20Project:\x20','getFullYear','Pattern:\x20','294lYaslM','isTTY','2045vSGlbO','format','Show\x20specific\x20attempt\x20details','getHours','cwd','replace','window','POLL_INTERVAL_MS','Tip:\x20cd\x20to\x20workflows/','Project:\x20','Loading\x20sessions...','icon','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Source:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','LABEL_MIN_SPACING','Start\x20a\x20workflow\x20run','max','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x1b[1A\x1b[2K','push','logs','localeCompare','updatedAt','✔\x20Pushed\x20','.\x20Expected\x20format:\x20KEY=VALUE','📋\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Revision:\x20','/attempt/','state','length','✔\x20Deleted\x20project\x20','Session\x20time:\x20','→\x20New\x20project:\x20','Target:\x20','\x20workflow','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Auto-selected\x20latest\x20session:\x20','Error:\x20','metadata','type','startTime','List\x20workflow\x20execution\x20sessions','sessions','\x0a✔\x20No\x20changes\x20to\x20push','workflow:logs','✔\x20Project:\x20','index','keys','List\x20all\x20workflow\x20projects','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','sessionTime','set','skipValidation','hasChanges','dim','attemptId','find','workflow','size','diff','list','resolveProject','Pushing\x20project...','generateSessionTimelineRows','Parameters:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','resolveProjectId','⚠\x20Showing\x20first\x20','summary','160104NUuSmt','No\x20sessions\x20found','execute','fileSize','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','from','fs/promises','revision:\x20','No\x20attempts\x20found\x20for:\x20','---\x20','includes','min','...','attempts','\x20logs','Analyzing\x20project...','\x20modified','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Key:\x20','\x20\x20Workflow:\x20','error','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','projectId','session_id','\x20unchanged','Retry\x20a\x20session\x20or\x20attempt','Downloading\x20logs...','attempt','reason','success','getMinutes','now','5151WjeYyK','planned','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:download','renderSingleTimeline','map','params','workflow:secrets:list','run','targetExists','navigateSessionsInteractive','Project\x20directory:\x20','✔\x20Found\x20','workflow:projects','running','revision','Force:\x20yes','key','retrySession','→\x20Project:\x20','title','logFiles','\x20\x20Target:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','cancelRequested','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','message','rows','Deleting\x20project\x20','pending','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Listing\x20workflow\x20attempts...','\x0aPolling...\x20(','displayLine','workflow:workflows','\x20\x20Session\x20context\x20set\x20to:\x20','\x20tasks','\x20\x20Attempt\x20ID:\x20','Project\x20name\x20is\x20required','table','fromTask','changes','filesExtracted','parseProjectWorkflowPattern'];a54_0x8031=function(){return _0x42f221;};return a54_0x8031();}export class WorkflowKillCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xc5);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0xfa);async[a54_0x12ede4(0x202)](_0x4df8fe){const _0x1fc6eb=a54_0x12ede4,{options:_0x414a8d,args:_0x2c6a9e,tdx:_0xd25b40}=_0x4df8fe,_0x11b17a=_0x2c6a9e[0x0];if(!_0x11b17a)return console[_0x1fc6eb(0x214)](_0x1fc6eb(0x138)),0x1;const _0x2d3b00=_0x414a8d[_0x1fc6eb(0x21c)];_0x414a8d[_0x1fc6eb(0x19b)]&&(console[_0x1fc6eb(0x214)](_0x1fc6eb(0x13b)+_0x11b17a),_0x2d3b00&&console[_0x1fc6eb(0x214)](_0x1fc6eb(0x107)+_0x2d3b00));if(!_0x414a8d[_0x1fc6eb(0x167)]){if(!isInteractive())return console['error'](a54_0x9af19e['red'](_0x1fc6eb(0x140)),_0x1fc6eb(0xb2)),console[_0x1fc6eb(0x214)](a54_0x9af19e[_0x1fc6eb(0x1f1)](_0x1fc6eb(0xa5))),0x1;const _0x3decc9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x11b17a+'?');if(!_0x3decc9)return console[_0x1fc6eb(0x214)](a54_0x9af19e[_0x1fc6eb(0x14f)]('Cancelled')),0x1;}const _0x4596d1=await withSpinner(_0x1fc6eb(0x1ab),()=>_0xd25b40[_0x1fc6eb(0x1f4)]['kill'](_0x11b17a,_0x2d3b00),{'verbose':_0x414a8d[_0x1fc6eb(0x19b)]}),_0x5d37a8=_0x4596d1['data'];return console['error']('✔\x20'+_0x5d37a8),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xf4);['description']=a54_0x12ede4(0x219);async[a54_0x12ede4(0x202)](_0x3ae9c7){const _0x4431ed=a54_0x12ede4,{options:_0x16d2fc,args:_0x493f02,tdx:_0x4fae99}=_0x3ae9c7,_0x3fc63e=_0x493f02[0x0];if(!_0x3fc63e)return console[_0x4431ed(0x214)](_0x4431ed(0x146)),console[_0x4431ed(0x214)](_0x4431ed(0x199)),0x1;let _0x3ca234=![],_0x5e928d=_0x3fc63e;if(_0x3fc63e['startsWith']('session:'))_0x3ca234=!![],_0x5e928d=_0x3fc63e[_0x4431ed(0x190)](0x8);else{if(_0x3fc63e[_0x4431ed(0xb4)](_0x4431ed(0x17d)))_0x3ca234=![],_0x5e928d=_0x3fc63e[_0x4431ed(0x190)](0x8);else return console[_0x4431ed(0x214)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x2cc43b=_0x16d2fc[_0x4431ed(0x9a)],_0x38b6cb=_0x16d2fc[_0x4431ed(0x141)],_0x2da37e=_0x16d2fc[_0x4431ed(0x77)],_0x267d78=_0x16d2fc['force'];_0x16d2fc[_0x4431ed(0x19b)]&&(console['error'](_0x4431ed(0x1dc)+(_0x3ca234?_0x4431ed(0x12b):'attempt')+'\x20'+_0x5e928d),_0x2cc43b&&console['error']('From\x20task:\x20'+_0x2cc43b),_0x38b6cb&&console[_0x4431ed(0x214)]('Resume\x20from:\x20'+_0x38b6cb),_0x2da37e&&console[_0x4431ed(0x214)](_0x4431ed(0x16b)+_0x2da37e),_0x267d78&&console['error'](_0x4431ed(0x81)));let _0x1947e4;if(_0x2da37e)try{if(_0x2da37e[_0x4431ed(0xb4)]('@')){const _0x54620f=await import(_0x4431ed(0x206)),_0x3694c7=_0x2da37e[_0x4431ed(0x190)](0x1),_0x674763=await _0x54620f[_0x4431ed(0xe9)](_0x3694c7,'utf-8');_0x1947e4=JSON[_0x4431ed(0xb5)](_0x674763);}else _0x1947e4=JSON['parse'](_0x2da37e);}catch{return console[_0x4431ed(0x214)](_0x4431ed(0xe1)),0x1;}if(!_0x16d2fc[_0x4431ed(0x167)]){if(!isInteractive())return console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0xab)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0x1f1)](_0x4431ed(0xa5))),0x1;const _0x5993d1=await confirmKey(_0x4431ed(0x123)+(_0x3ca234?_0x4431ed(0x12b):_0x4431ed(0x21b))+'\x20'+_0x5e928d+'?');if(!_0x5993d1)return console[_0x4431ed(0x214)](a54_0x9af19e[_0x4431ed(0x14f)](_0x4431ed(0x148))),0x1;}let _0x4c0c28;_0x3ca234?_0x4c0c28=await withSpinner('Retrying\x20session...',()=>_0x4fae99[_0x4431ed(0x1f4)][_0x4431ed(0x83)](_0x5e928d,{'fromTask':_0x2cc43b,'retryParams':_0x1947e4}),{'verbose':_0x16d2fc[_0x4431ed(0x19b)]}):_0x4c0c28=await withSpinner(_0x4431ed(0x19f),()=>_0x4fae99['workflow'][_0x4431ed(0x16e)](_0x5e928d,{'resumeFrom':_0x38b6cb,'retryParams':_0x1947e4,'force':_0x267d78}),{'verbose':_0x16d2fc[_0x4431ed(0x19b)]});const _0x3ac209=_0x4c0c28[_0x4431ed(0x10a)];return console[_0x4431ed(0x214)]('✔\x20Retry\x20started'),console['error'](_0x4431ed(0xa1)+_0x3ac209[_0x4431ed(0x1f2)]),console[_0x4431ed(0x214)](_0x4431ed(0x151)+_0x3ac209[_0x4431ed(0x1a1)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]='workflow:run';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1c9);async[a54_0x12ede4(0x202)](_0x598dff){const _0xc3a772=a54_0x12ede4,{options:_0x464c73,args:_0x2479bd,tdx:_0x3d57dd}=_0x598dff;let _0xd76457=_0x2479bd[0x0];if(!_0xd76457){const _0x2f2d1f=this[_0xc3a772(0x1f8)]([],_0x464c73),_0x19c91b=await withSpinner(_0xc3a772(0xaf),()=>_0x3d57dd['workflow'][_0xc3a772(0x15f)](_0x2f2d1f,{'limit':_0x464c73[_0xc3a772(0x13d)]}),{'verbose':_0x464c73['verbose']}),_0x2da7ab=_0x19c91b['data'];if(_0x2da7ab['length']===0x0)return console[_0xc3a772(0x214)](_0xc3a772(0x13f)),!_0x2f2d1f&&console['error'](a54_0x9af19e[_0xc3a772(0x1f1)](_0xc3a772(0x89))),0x1;const _0x365f44=_0x2da7ab[_0xc3a772(0x76)](_0x154619=>({'title':_0x154619[_0xc3a772(0x168)]?.[_0xc3a772(0x1a3)]+'.'+_0x154619['name'],'value':_0x154619['project']?.[_0xc3a772(0x1a3)]+'.'+_0x154619[_0xc3a772(0x1a3)],'description':_0x154619[_0xc3a772(0x80)]?_0xc3a772(0x207)+_0x154619[_0xc3a772(0x80)]:undefined})),_0x27df99=await a54_0x435c0a({'type':_0xc3a772(0x171),'name':_0xc3a772(0x1f4),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x365f44});if(!_0x27df99[_0xc3a772(0x1f4)])return 0x1;_0xd76457=_0x27df99['workflow'];}if(!_0xd76457[_0xc3a772(0x20a)]('.')){const _0x46e805=this['resolveProject']([],_0x464c73);if(_0x46e805)_0xd76457=_0x46e805+'.'+_0xd76457;else return console[_0xc3a772(0x214)](a54_0x9af19e[_0xc3a772(0xab)](_0xc3a772(0x163)),_0xc3a772(0x174)),console[_0xc3a772(0x214)](a54_0x9af19e[_0xc3a772(0x1f1)](_0xc3a772(0x89))),0x1;}const _0x321c7f=_0x464c73[_0xc3a772(0x149)],_0x1c39c9=_0x464c73[_0xc3a772(0x1ed)],_0x25cd60={};if(_0x321c7f&&Array[_0xc3a772(0x18d)](_0x321c7f))for(const _0x247e82 of _0x321c7f){const _0x4d7cfc=_0x247e82[_0xc3a772(0x13c)]('=');if(_0x4d7cfc===-0x1)return console[_0xc3a772(0x214)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x247e82),console[_0xc3a772(0x214)](_0xc3a772(0x164)),0x1;const _0x2338fd=_0x247e82[_0xc3a772(0x190)](0x0,_0x4d7cfc),_0x2e1227=_0x247e82[_0xc3a772(0x190)](_0x4d7cfc+0x1);try{_0x25cd60[_0x2338fd]=JSON[_0xc3a772(0xb5)](_0x2e1227);}catch{_0x25cd60[_0x2338fd]=_0x2e1227;}}_0x464c73['verbose']&&(console['error']('Workflow:\x20'+_0xd76457),Object[_0xc3a772(0x1ea)](_0x25cd60)['length']>0x0&&console['error'](_0xc3a772(0x1fb)+JSON[_0xc3a772(0x185)](_0x25cd60)),_0x1c39c9&&console[_0xc3a772(0x214)](_0xc3a772(0x1da)+_0x1c39c9));const _0x27bf4c=await withSpinner(_0xc3a772(0x1b2),()=>_0x3d57dd['workflow'][_0xc3a772(0x79)](_0xd76457,_0x25cd60,{'sessionTime':_0x1c39c9}),{'verbose':_0x464c73['verbose']}),_0x33c43a=_0x27bf4c[_0xc3a772(0x10a)];console['error'](_0xc3a772(0x139)),console[_0xc3a772(0x214)](_0xc3a772(0x97)+_0x33c43a['id']),console[_0xc3a772(0x214)](_0xc3a772(0x151)+_0x33c43a[_0xc3a772(0x1a1)]),console[_0xc3a772(0x214)](_0xc3a772(0x1b4)+_0x33c43a[_0xc3a772(0x168)]?.[_0xc3a772(0x1a3)]),console[_0xc3a772(0x214)](_0xc3a772(0x213)+_0x33c43a[_0xc3a772(0x1f4)]?.[_0xc3a772(0x1a3)]);if(_0x33c43a['project']?.['id']&&_0x33c43a[_0xc3a772(0x1a1)]&&_0x33c43a['id']){const _0x3d6417=_0x464c73[_0xc3a772(0x10d)],_0x4da8cc=getConsoleUrl(_0x3d6417,_0xc3a772(0x191)+_0x33c43a[_0xc3a772(0x168)]['id']+_0xc3a772(0xd3)+_0x33c43a[_0xc3a772(0x1a1)]+_0xc3a772(0x1d6)+_0x33c43a['id']);console['error'](_0xc3a772(0x106)+a54_0x9af19e[_0xc3a772(0x124)](_0x4da8cc));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x12ede4(0x74);['description']='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x12ede4(0x202)](_0x4f1520){const _0x42199b=a54_0x12ede4,{options:_0x40a7e1,args:_0x2fa88c,tdx:_0x3e14b1}=_0x4f1520,_0x1ab790=_0x2fa88c[0x0],_0x5761c8=_0x2fa88c[0x1]||'.';if(!_0x1ab790)return console[_0x42199b(0x214)](_0x42199b(0x108)),console['error'](_0x42199b(0x118)),0x1;const _0x173546=_0x40a7e1[_0x42199b(0x80)];_0x40a7e1['verbose']&&(console['error'](_0x42199b(0x1c2)+_0x1ab790),console['error']('Output\x20directory:\x20'+_0x5761c8),_0x173546&&console[_0x42199b(0x214)](_0x42199b(0x1d5)+_0x173546));const _0x25ee9d=await withSpinner(_0x42199b(0x155)+_0x1ab790+_0x42199b(0x20c),()=>_0x3e14b1['workflow']['download'](_0x1ab790,_0x5761c8,{'revision':_0x173546}),{'verbose':_0x40a7e1[_0x42199b(0x19b)]}),_0x1ba017=_0x25ee9d['data'];return console['error']('✔\x20Downloaded\x20'+_0x1ba017[_0x42199b(0xe2)]),console[_0x42199b(0x214)](_0x42199b(0x105)+_0x1ba017['revision']),console['error'](_0x42199b(0xb0)+_0x1ba017[_0x42199b(0x9c)]),console[_0x42199b(0x214)](_0x42199b(0x161)+_0x5761c8+'/'+_0x1ba017[_0x42199b(0xe2)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xd0);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x73);async[a54_0x12ede4(0x202)](_0x1ec293){const _0x2c7d75=a54_0x12ede4,{options:_0x5e1fd0,args:_0x36b87e,tdx:_0x2a7903}=_0x1ec293;let _0x51bee3='.',_0x7248b5=_0x5e1fd0[_0x2c7d75(0x1a3)];if(_0x36b87e[0x0]){const {promises:_0x3b8777}=await import('fs');try{const _0x295488=await _0x3b8777[_0x2c7d75(0x162)](_0x36b87e[0x0]);if(_0x295488[_0x2c7d75(0x159)]())_0x51bee3=_0x36b87e[0x0];else return console[_0x2c7d75(0x214)](_0x2c7d75(0x1e0)+_0x36b87e[0x0]+_0x2c7d75(0xd8)),0x1;}catch{_0x7248b5=_0x36b87e[0x0],_0x51bee3='.';}}const _0x2fc514=_0x5e1fd0[_0x2c7d75(0x80)],_0x2a65f5=_0x5e1fd0[_0x2c7d75(0x1ef)];_0x5e1fd0[_0x2c7d75(0x19b)]&&(console[_0x2c7d75(0x214)](_0x2c7d75(0x7c)+_0x51bee3),_0x7248b5&&console[_0x2c7d75(0x214)](_0x2c7d75(0x181)+_0x7248b5),_0x2fc514&&console['error'](_0x2c7d75(0x1d5)+_0x2fc514),_0x2a65f5&&console['error'](_0x2c7d75(0xed)));const _0x5ab9f2=await withSpinner(_0x2c7d75(0x186),()=>_0x2a7903[_0x2c7d75(0x1f4)]['push'](_0x51bee3,{'projectName':_0x7248b5,'revision':_0x2fc514,'skipValidation':_0x2a65f5}),{'verbose':_0x5e1fd0[_0x2c7d75(0x19b)]}),_0x4c8427=_0x5ab9f2[_0x2c7d75(0x10a)];return console[_0x2c7d75(0x214)](_0x2c7d75(0x1d1)+_0x4c8427[_0x2c7d75(0xe2)]),console[_0x2c7d75(0x214)](_0x2c7d75(0x116)+_0x4c8427[_0x2c7d75(0x216)]),console[_0x2c7d75(0x214)](_0x2c7d75(0x105)+_0x4c8427[_0x2c7d75(0x80)]),await this['showWorkflowConsoleUrl'](_0x2a7903,_0x4c8427['projectName'],_0x5e1fd0[_0x2c7d75(0x10d)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x12ede4(0x1a3)]='workflow:pull';[a54_0x12ede4(0x14a)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x12ede4(0x202)](_0x5444df){const _0x10c49b=a54_0x12ede4,{options:_0x2a1f9d,args:_0x55139a,tdx:_0x238e4c}=_0x5444df,_0x2708c4=_0x55139a[0x0],_0x1a369e=_0x55139a[0x1];if(!_0x2708c4)return console[_0x10c49b(0x214)](a54_0x9af19e['red']('Error:'),'Project\x20name\x20is\x20required'),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0xf2))),0x1;const _0x38521e=_0x2a1f9d['revision'];_0x2a1f9d[_0x10c49b(0x19b)]&&(console[_0x10c49b(0x214)](_0x10c49b(0x1c2)+_0x2708c4),_0x1a369e&&console[_0x10c49b(0x214)](_0x10c49b(0x188)+_0x1a369e),_0x38521e&&console['error'](_0x10c49b(0x1d5)+_0x38521e),_0x2a1f9d[_0x10c49b(0xf9)]&&console[_0x10c49b(0x214)](_0x10c49b(0x10c)));const _0x4683f3=await withSpinner(_0x10c49b(0xf5)+_0x2708c4+_0x10c49b(0x20c),()=>_0x238e4c['workflow'][_0x10c49b(0xe8)](_0x2708c4,{'targetDir':_0x1a369e,'revision':_0x38521e}),{'verbose':_0x2a1f9d['verbose']}),_0x15b49c=_0x4683f3[_0x10c49b(0x10a)];_0x15b49c[_0x10c49b(0xa7)]?console[_0x10c49b(0x214)](_0x10c49b(0x1db)+_0x15b49c['projectName']):console[_0x10c49b(0x214)](_0x10c49b(0x84)+_0x15b49c[_0x10c49b(0xe2)]);console[_0x10c49b(0x214)](_0x10c49b(0x105)+_0x15b49c[_0x10c49b(0x80)]),console[_0x10c49b(0x214)](_0x10c49b(0x87)+(a54_0x254133[_0x10c49b(0x18b)](process[_0x10c49b(0x1bd)](),_0x15b49c[_0x10c49b(0xd1)])||'.')),console['error'](_0x10c49b(0xc9)+a54_0x9af19e[_0x10c49b(0xde)]('+'+_0x15b49c[_0x10c49b(0x1ff)]['new']+'\x20new')+',\x20'+(a54_0x9af19e['yellow']('~'+_0x15b49c[_0x10c49b(0x1ff)][_0x10c49b(0x176)]+_0x10c49b(0x210))+',\x20')+(a54_0x9af19e['red']('-'+_0x15b49c[_0x10c49b(0x1ff)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x9af19e[_0x10c49b(0x1f1)](_0x15b49c['summary'][_0x10c49b(0x109)]+_0x10c49b(0x218))));for(const _0x266273 of _0x15b49c[_0x10c49b(0x9b)]){_0x266273[_0x10c49b(0x1e2)]==='modified'&&_0x266273[_0x10c49b(0x1f6)]&&(console[_0x10c49b(0x214)]('\x0a'+a54_0x9af19e[_0x10c49b(0x124)](_0x10c49b(0x209)+_0x266273['path'])),console[_0x10c49b(0x214)](_0x266273['diff']));}if(!_0x15b49c[_0x10c49b(0x1f0)])return saveSessionContext({'workflow_project':_0x15b49c[_0x10c49b(0xe2)]},_0x2a1f9d[_0x10c49b(0x12b)]),console[_0x10c49b(0x214)](a54_0x9af19e['green'](_0x10c49b(0xdb))),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0x95)+_0x15b49c[_0x10c49b(0xe2)])),0x0;if(_0x2a1f9d[_0x10c49b(0xf9)])return console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x14f)](_0x10c49b(0x143))),0x0;if(!_0x2a1f9d[_0x10c49b(0x167)]){if(!isInteractive())return console[_0x10c49b(0x214)](a54_0x9af19e['red'](_0x10c49b(0x140)),_0x10c49b(0xb2)),console[_0x10c49b(0x214)](a54_0x9af19e['dim'](_0x10c49b(0xa5))),0x1;const _0x556c5d=await confirmKey(_0x10c49b(0x187));if(!_0x556c5d)return console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x14f)](_0x10c49b(0x148)),_0x10c49b(0xb3)),0x1;}await withSpinner(_0x10c49b(0xb1),()=>_0x238e4c['workflow'][_0x10c49b(0x1b3)](_0x15b49c,{'revision':_0x38521e}),{'verbose':_0x2a1f9d['verbose']}),saveSessionContext({'workflow_project':_0x15b49c[_0x10c49b(0xe2)]},_0x2a1f9d['session']),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0xde)]('✔\x20Pull\x20complete'));const _0x2c3761=a54_0x254133[_0x10c49b(0x18b)](process[_0x10c49b(0x1bd)](),_0x15b49c[_0x10c49b(0xd1)])||'.';return console[_0x10c49b(0x214)](a54_0x9af19e['dim'](_0x10c49b(0x161)+_0x2c3761)),console[_0x10c49b(0x214)](a54_0x9af19e[_0x10c49b(0x1f1)](_0x10c49b(0x95)+_0x15b49c[_0x10c49b(0xe2)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x15a);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1ec);async[a54_0x12ede4(0x202)](_0x5bcb33){const _0x5e8f06=a54_0x12ede4,{options:_0x3c224b,args:_0x7c959e,tdx:_0x3698ab}=_0x5bcb33,_0x4af9b0=this['resolveProjectDir'](_0x7c959e,_0x3c224b),_0x5110c0=_0x3c224b[_0x5e8f06(0x80)],_0x1326ac=_0x3c224b[_0x5e8f06(0x1ef)];_0x3c224b['verbose']&&(_0x4af9b0&&console[_0x5e8f06(0x214)](_0x5e8f06(0x133)+_0x4af9b0),_0x5110c0&&console[_0x5e8f06(0x214)]('Revision:\x20'+_0x5110c0),_0x3c224b[_0x5e8f06(0xf9)]&&console[_0x5e8f06(0x214)](_0x5e8f06(0x10c)),_0x1326ac&&console['error'](_0x5e8f06(0xed)));let _0x58b6ba;try{_0x58b6ba=await withSpinner(_0x5e8f06(0xe7),()=>_0x3698ab[_0x5e8f06(0x1f4)]['preparePushProject']({'sourceDir':_0x4af9b0,'revision':_0x5110c0,'skipValidation':_0x1326ac}),{'verbose':_0x3c224b[_0x5e8f06(0x19b)]});}catch(_0x11be0c){if(_0x11be0c instanceof Error&&_0x11be0c[_0x5e8f06(0x8c)][_0x5e8f06(0x20a)](_0x5e8f06(0xa0)))return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0xab)](_0x5e8f06(0x163)),_0x5e8f06(0x215)),_0x3c224b[_0x5e8f06(0x16f)]?console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x1f1)](_0x5e8f06(0x1c1)+_0x3c224b[_0x5e8f06(0x16f)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x3c224b[_0x5e8f06(0x16f)]+'\x27')):console[_0x5e8f06(0x214)](a54_0x9af19e['dim'](_0x5e8f06(0x15e))),0x1;throw _0x11be0c;}const _0x56355b=_0x58b6ba['data'];console['error'](_0x5e8f06(0x1e8)+_0x56355b[_0x5e8f06(0xe2)]),console['error'](_0x5e8f06(0x110)+_0x56355b[_0x5e8f06(0xc8)]),console[_0x5e8f06(0x214)](_0x5e8f06(0x105)+_0x56355b[_0x5e8f06(0x80)]),console[_0x5e8f06(0x214)]('\x20\x20Changes:\x20'+a54_0x9af19e[_0x5e8f06(0xde)]('+'+_0x56355b[_0x5e8f06(0x1ff)]['new']+_0x5e8f06(0x9e))+',\x20'+(a54_0x9af19e[_0x5e8f06(0x14f)]('~'+_0x56355b[_0x5e8f06(0x1ff)][_0x5e8f06(0x176)]+_0x5e8f06(0x210))+',\x20')+(a54_0x9af19e[_0x5e8f06(0xab)]('-'+_0x56355b['summary'][_0x5e8f06(0x178)]+_0x5e8f06(0x1a8))+',\x20')+(''+a54_0x9af19e[_0x5e8f06(0x1f1)](_0x56355b[_0x5e8f06(0x1ff)]['unchanged']+_0x5e8f06(0x218))));for(const _0x2c734b of _0x56355b[_0x5e8f06(0x9b)]){_0x2c734b[_0x5e8f06(0x1e2)]===_0x5e8f06(0x176)&&_0x2c734b[_0x5e8f06(0x1f6)]&&(console[_0x5e8f06(0x214)]('\x0a'+a54_0x9af19e[_0x5e8f06(0x124)](_0x5e8f06(0x209)+_0x2c734b['path'])),console[_0x5e8f06(0x214)](_0x2c734b['diff']));}if(!_0x56355b[_0x5e8f06(0x1f0)])return console[_0x5e8f06(0x214)](a54_0x9af19e['green'](_0x5e8f06(0x1e6))),await this['showWorkflowConsoleUrl'](_0x3698ab,_0x56355b['projectName'],_0x3c224b[_0x5e8f06(0x10d)]),0x0;if(_0x3c224b[_0x5e8f06(0xf9)])return console['error'](a54_0x9af19e[_0x5e8f06(0x14f)](_0x5e8f06(0x1ae))),0x0;if(!_0x3c224b['yes']){if(!isInteractive())return console['error'](a54_0x9af19e[_0x5e8f06(0xab)]('\x0aError:'),_0x5e8f06(0xb2)),console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x1f1)](_0x5e8f06(0xa5))),0x1;const _0x3ded8b=await confirmKey(_0x5e8f06(0x183));if(!_0x3ded8b)return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0x14f)]('Cancelled'),_0x5e8f06(0xcb)),0x1;}const _0x926375=await withSpinner(_0x5e8f06(0x1f9),()=>_0x3698ab['workflow'][_0x5e8f06(0x1a4)](_0x56355b),{'verbose':_0x3c224b['verbose']}),_0x352495=_0x926375['data'];return console[_0x5e8f06(0x214)](a54_0x9af19e[_0x5e8f06(0xde)]('✔\x20Push\x20complete')),console[_0x5e8f06(0x214)](_0x5e8f06(0x116)+_0x352495['projectId']),console[_0x5e8f06(0x214)]('\x20\x20Revision:\x20'+_0x352495[_0x5e8f06(0x80)]),await this[_0x5e8f06(0xc1)](_0x3698ab,_0x352495[_0x5e8f06(0xe2)],_0x3c224b[_0x5e8f06(0x10d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x197);['description']=a54_0x12ede4(0x17f);async[a54_0x12ede4(0x202)](_0x30d933){const _0x523113=a54_0x12ede4,{options:_0x5bb840,args:_0x50a01b,tdx:_0x23a6f2}=_0x30d933,_0x56510c=this['resolveProjectDir'](_0x50a01b,_0x5bb840),_0x45ac5f=_0x5bb840[_0x523113(0x1a3)],_0xcd5176=_0x5bb840[_0x523113(0x80)],_0x169ab0=_0x5bb840[_0x523113(0x1ef)];if(!_0x56510c)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0xab)](_0x523113(0x163)),_0x523113(0x160)),console['error'](a54_0x9af19e[_0x523113(0x1f1)](_0x523113(0xef))),console[_0x523113(0x214)](a54_0x9af19e['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x45ac5f)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0xab)](_0x523113(0x163)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x1f1)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5bb840[_0x523113(0x19b)]&&(console[_0x523113(0x214)]('Source\x20directory:\x20'+_0x56510c),console[_0x523113(0x214)](_0x523113(0x18e)+_0x45ac5f),_0xcd5176&&console[_0x523113(0x214)](_0x523113(0x1d5)+_0xcd5176),_0x5bb840[_0x523113(0xf9)]&&console[_0x523113(0x214)]('Dry\x20run:\x20yes'),_0x169ab0&&console[_0x523113(0x214)](_0x523113(0xed)));const _0x5bef01=await withSpinner(_0x523113(0x20f),()=>_0x23a6f2['workflow'][_0x523113(0x165)](_0x56510c,_0x45ac5f,{'revision':_0xcd5176,'skipValidation':_0x169ab0}),{'verbose':_0x5bb840[_0x523113(0x19b)]}),_0x9cd4f3=_0x5bef01[_0x523113(0x10a)];console[_0x523113(0x214)](_0x523113(0x1c6)+_0x9cd4f3[_0x523113(0xc8)]);_0x9cd4f3['sourceProjectName']&&console[_0x523113(0x214)](_0x523113(0x175)+_0x9cd4f3['sourceProjectName']);console[_0x523113(0x214)](_0x523113(0x18e)+_0x9cd4f3[_0x523113(0xc0)]),console[_0x523113(0x214)](_0x523113(0x1d5)+_0x9cd4f3[_0x523113(0x80)]),console[_0x523113(0x214)](_0x523113(0x182)+_0x9cd4f3[_0x523113(0x9f)]);_0x9cd4f3[_0x523113(0x7a)]&&(console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x13e)+_0x9cd4f3[_0x523113(0xc0)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x9cd4f3[_0x523113(0x14b)]+')')),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x8b))));if(_0x5bb840[_0x523113(0xf9)])return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)](_0x523113(0x1c7))),0x0;if(!_0x5bb840[_0x523113(0x167)]){if(!isInteractive())return console[_0x523113(0x214)](a54_0x9af19e['red'](_0x523113(0x140)),_0x523113(0xb2)),console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x1f1)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x526769=_0x9cd4f3[_0x523113(0xbb)]||a54_0x254133['basename'](_0x56510c),_0x5400d3=_0x9cd4f3[_0x523113(0x7a)]?_0x523113(0x19a)+_0x45ac5f+_0x523113(0x121):_0x523113(0x16c)+_0x526769+_0x523113(0x147)+_0x45ac5f+'\x22?',_0x137d25=await confirmKey(_0x5400d3);if(!_0x137d25)return console[_0x523113(0x214)](a54_0x9af19e[_0x523113(0x14f)]('Cancelled')),0x1;}const _0x5e77a8=await withSpinner(_0x9cd4f3['targetExists']?_0x523113(0x100)+_0x45ac5f+_0x523113(0x20c):_0x523113(0xea)+_0x45ac5f+'...',()=>_0x23a6f2[_0x523113(0x1f4)][_0x523113(0x153)](_0x9cd4f3),{'verbose':_0x5bb840[_0x523113(0x19b)]}),_0x2e7a4c=_0x5e77a8[_0x523113(0x10a)];return console['error'](a54_0x9af19e[_0x523113(0xde)](_0x9cd4f3['targetExists']?'✔\x20Project\x20updated':_0x523113(0x142))),console[_0x523113(0x214)](_0x523113(0x1b4)+_0x2e7a4c[_0x523113(0xc0)]),console[_0x523113(0x214)](_0x523113(0x116)+_0x2e7a4c[_0x523113(0x184)]),console['error'](_0x523113(0x105)+_0x2e7a4c[_0x523113(0x80)]),await this['showWorkflowConsoleUrl'](_0x23a6f2,_0x2e7a4c[_0x523113(0xc0)],_0x5bb840['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x115);async[a54_0x12ede4(0x202)](_0xbbace8){const _0x435c44=a54_0x12ede4,{options:_0x275127,args:_0xfca47c,tdx:_0x132e11}=_0xbbace8,_0x13e03f=_0xfca47c[0x0];if(!_0x13e03f)return console[_0x435c44(0x214)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x435c44(0x214)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x275127['verbose']&&console[_0x435c44(0x214)](_0x435c44(0x1c2)+_0x13e03f);if(!_0x275127['yes']){if(!isInteractive())return console[_0x435c44(0x214)](a54_0x9af19e[_0x435c44(0xab)](_0x435c44(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x435c44(0x214)](a54_0x9af19e['dim'](_0x435c44(0xa5))),0x1;const _0x13fba3=await confirmKey(_0x435c44(0x19e)+_0x13e03f+_0x435c44(0xcd));if(!_0x13fba3)return console[_0x435c44(0x214)](a54_0x9af19e[_0x435c44(0x14f)](_0x435c44(0x148))),0x1;}const _0x35f4f1=await withSpinner(_0x435c44(0x8e)+_0x13e03f+_0x435c44(0x20c),()=>_0x132e11['workflow'][_0x435c44(0x103)](_0x13e03f),{'verbose':_0x275127[_0x435c44(0x19b)]}),_0x357c85=_0x35f4f1[_0x435c44(0x10a)];return console['error'](_0x435c44(0x1d9)+_0x357c85['projectName']),console[_0x435c44(0x214)](_0x435c44(0x116)+_0x357c85['projectId']),0x0;}}export function parseKeyValue(_0x5b731c){const _0x1dafb0=a54_0x12ede4,_0x38cbce=_0x5b731c[_0x1dafb0(0x13c)]('=');if(_0x38cbce===-0x1)throw new Error(_0x1dafb0(0xd9)+_0x5b731c+_0x1dafb0(0x1d2));const _0x22bf3a=_0x5b731c[_0x1dafb0(0x190)](0x0,_0x38cbce),_0x565b67=_0x5b731c[_0x1dafb0(0x190)](_0x38cbce+0x1);if(!_0x22bf3a)throw new Error(_0x1dafb0(0xf7));return{'key':_0x22bf3a,'value':_0x565b67};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0x78);[a54_0x12ede4(0x14a)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x12ede4(0x202)](_0x42f9b2){const _0x5dc115=a54_0x12ede4,{options:_0x52f313,args:_0x239629,tdx:_0x42e909}=_0x42f9b2,_0x92589e=this['requireProject'](_0x239629,_0x52f313);if(!_0x92589e)return 0x1;_0x52f313[_0x5dc115(0x19b)]&&console[_0x5dc115(0x214)](_0x5dc115(0x1c2)+_0x92589e);const _0xa43e3c=await withSpinner('Listing\x20secrets...',()=>_0x42e909[_0x5dc115(0x1f4)][_0x5dc115(0xac)](_0x92589e),{'verbose':_0x52f313[_0x5dc115(0x19b)]}),{secrets:_0x3ef273}=_0xa43e3c[_0x5dc115(0x10a)];return console[_0x5dc115(0x214)](_0x5dc115(0x7d)+_0x3ef273[_0x5dc115(0x1d8)]+'\x20secret'+(_0x3ef273['length']!==0x1?'s':'')),await handleSDKOutput(_0x3ef273,_0x52f313),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x12ede4(0x1a3)]=a54_0x12ede4(0xee);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x16d);async[a54_0x12ede4(0x202)](_0x5b2edf){const _0x130919=a54_0x12ede4,{options:_0x7436f0,args:_0x18a32e,tdx:_0x49d827}=_0x5b2edf;let _0x2964c8,_0x2d6acf;if(_0x18a32e['length']>=0x1&&!_0x18a32e[0x0][_0x130919(0x20a)]('='))_0x2964c8=_0x18a32e[0x0],_0x2d6acf=_0x18a32e[_0x130919(0x17a)](0x1);else{if(_0x18a32e[_0x130919(0x1d8)]>=0x1&&_0x7436f0[_0x130919(0x16f)])_0x2964c8=_0x7436f0[_0x130919(0x16f)],_0x2d6acf=_0x18a32e;else return _0x18a32e[_0x130919(0x1d8)]>=0x1?(console[_0x130919(0x214)](_0x130919(0x108)),console[_0x130919(0x214)](_0x130919(0x89)),0x1):(console[_0x130919(0x214)](_0x130919(0x1a5)),console[_0x130919(0x214)](_0x130919(0x1de)),0x1);}if(_0x2d6acf['length']===0x0)return console[_0x130919(0x214)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x130919(0x214)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x3e5ada={};try{for(const _0x366742 of _0x2d6acf){const {key:_0x2e8040,value:_0x469137}=parseKeyValue(_0x366742);_0x3e5ada[_0x2e8040]=_0x469137;}}catch(_0x1505c7){return _0x1505c7 instanceof Error&&console['error'](a54_0x9af19e[_0x130919(0xab)](_0x130919(0x163)),_0x1505c7[_0x130919(0x8c)]),0x1;}const _0x65fa64=Object[_0x130919(0x1ea)](_0x3e5ada);_0x7436f0[_0x130919(0x19b)]&&(console[_0x130919(0x214)](_0x130919(0x1c2)+_0x2964c8),console[_0x130919(0x214)](_0x130919(0x104)+_0x65fa64[_0x130919(0xbf)](',\x20')));const _0x352e13=await withSpinner(_0x65fa64['length']===0x1?_0x130919(0x14d):'Setting\x20'+_0x65fa64[_0x130919(0x1d8)]+_0x130919(0x158),()=>_0x49d827['workflow'][_0x130919(0x1a7)](_0x2964c8,_0x3e5ada),{'verbose':_0x7436f0[_0x130919(0x19b)]}),_0x2ffa2b=_0x352e13[_0x130919(0x10a)];return console[_0x130919(0x214)](_0x65fa64[_0x130919(0x1d8)]===0x1?_0x130919(0xdd)+_0x2ffa2b[_0x130919(0x1ea)][0x0]+_0x130919(0x1d4)+_0x2ffa2b[_0x130919(0xe2)]+'\x27':'✔\x20'+_0x2ffa2b[_0x130919(0x1ea)][_0x130919(0x1d8)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x2ffa2b[_0x130919(0xe2)]+'\x27'),(_0x7436f0[_0x130919(0x11f)]||_0x7436f0[_0x130919(0x11b)])&&await handleSingleObjectOutput(_0x2ffa2b,_0x7436f0),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x12ede4(0xcf);[a54_0x12ede4(0x14a)]=a54_0x12ede4(0x1fc);async[a54_0x12ede4(0x202)](_0x4e652e){const _0x26d7c2=a54_0x12ede4,{options:_0x374bb9,args:_0x3108f1,tdx:_0x43d88f}=_0x4e652e;let _0x35b5dc,_0x149b4c;if(_0x3108f1[_0x26d7c2(0x1d8)]>=0x2)_0x35b5dc=_0x3108f1[0x0],_0x149b4c=_0x3108f1[0x1];else{if(_0x3108f1[_0x26d7c2(0x1d8)]===0x1&&_0x374bb9[_0x26d7c2(0x16f)])_0x35b5dc=_0x374bb9['workflowProject'],_0x149b4c=_0x3108f1[0x0];else return _0x3108f1[_0x26d7c2(0x1d8)]===0x1?(console[_0x26d7c2(0x214)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x26d7c2(0x214)](_0x26d7c2(0x89)),0x1):(console['error'](_0x26d7c2(0x114)),console[_0x26d7c2(0x214)](_0x26d7c2(0x90)),0x1);}_0x374bb9[_0x26d7c2(0x19b)]&&(console[_0x26d7c2(0x214)]('Project:\x20'+_0x35b5dc),console[_0x26d7c2(0x214)](_0x26d7c2(0x212)+_0x149b4c));if(!_0x374bb9[_0x26d7c2(0x167)]){if(!isInteractive())return console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0xab)](_0x26d7c2(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0x1f1)](_0x26d7c2(0xa5))),0x1;const _0x2e711b=await confirmKey(_0x26d7c2(0x112)+_0x149b4c+_0x26d7c2(0x194)+_0x35b5dc+'\x27?');if(!_0x2e711b)return console[_0x26d7c2(0x214)](a54_0x9af19e[_0x26d7c2(0x14f)](_0x26d7c2(0x148))),0x1;}const _0x23730a=await withSpinner('Deleting\x20secret...',()=>_0x43d88f[_0x26d7c2(0x1f4)][_0x26d7c2(0x12a)](_0x35b5dc,_0x149b4c),{'verbose':_0x374bb9[_0x26d7c2(0x19b)]}),_0x546e16=_0x23730a[_0x26d7c2(0x10a)];return console['error']('✔\x20Secret\x20\x27'+_0x546e16[_0x26d7c2(0x82)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x546e16['projectName']+'\x27'),(_0x374bb9[_0x26d7c2(0x11f)]||_0x374bb9[_0x26d7c2(0x11b)])&&await handleSingleObjectOutput(_0x546e16,_0x374bb9),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0xa7d4ad){const _0x558956=a54_0x12ede4,_0x287fa6=Math[_0x558956(0x198)](_0xa7d4ad/0x3e8),_0x388f41=Math['floor'](_0x287fa6/0x3c),_0x326ed6=Math['floor'](_0x388f41/0x3c),_0x5e479e=Math[_0x558956(0x198)](_0x326ed6/0x18);if(_0x5e479e>0x0){const _0x32b81f=_0x326ed6%0x18;return _0x32b81f>0x0?_0x5e479e+'d\x20'+_0x32b81f+'h':_0x5e479e+'d';}else{if(_0x326ed6>0x0){const _0x4510ce=_0x388f41%0x3c;return _0x4510ce>0x0?_0x326ed6+'h\x20'+_0x4510ce+'m':_0x326ed6+'h';}else{if(_0x388f41>0x0){const _0x43dc6c=_0x287fa6%0x3c;return _0x43dc6c>0x0?_0x388f41+'m\x20'+_0x43dc6c+'s':_0x388f41+'m';}else return _0x287fa6+'s';}}}function formatTimestamp(_0x4ab598,_0x5246bd){const _0x390b86=a54_0x12ede4,_0x513578=new Date(_0x4ab598),_0x23bd2d=String(_0x513578[_0x390b86(0x1bc)]())[_0x390b86(0xcc)](0x2,'0'),_0x3b1adc=String(_0x513578[_0x390b86(0x21e)]())['padStart'](0x2,'0'),_0x3d3f60=_0x23bd2d+':'+_0x3b1adc,_0x471dee=_0x513578[_0x390b86(0x1b5)]()===_0x5246bd['getFullYear']()&&_0x513578[_0x390b86(0xe3)]()===_0x5246bd[_0x390b86(0xe3)]()&&_0x513578['getDate']()===_0x5246bd[_0x390b86(0xe5)]();if(_0x471dee)return _0x3d3f60;else{const _0x2f6c80=String(_0x513578[_0x390b86(0xe3)]()+0x1)[_0x390b86(0xcc)](0x2,'0'),_0x35eaf9=String(_0x513578[_0x390b86(0xe5)]())[_0x390b86(0xcc)](0x2,'0');return _0x2f6c80+'-'+_0x35eaf9+'\x20'+_0x3d3f60;}}function formatDate(_0x1be6a7){const _0x12598c=a54_0x12ede4,_0x1740b3=_0x1be6a7[_0x12598c(0x1b5)](),_0x10e501=String(_0x1be6a7[_0x12598c(0xe3)]()+0x1)[_0x12598c(0xcc)](0x2,'0'),_0x10b72c=String(_0x1be6a7[_0x12598c(0xe5)]())[_0x12598c(0xcc)](0x2,'0');return _0x1740b3+'-'+_0x10e501+'-'+_0x10b72c;}function getTaskStateIcon(_0x6df690){const _0x3d4272={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3d4272[_0x6df690]||'⚪';}function getBarChar(_0x586c9a){const _0x8b46fa=a54_0x12ede4;return _0x586c9a===_0x8b46fa(0x214)||_0x586c9a===_0x8b46fa(0x18f)?'×':'─';}function getBarColor(_0x3a42e7){const _0x1d29e2=a54_0x12ede4,_0x45ebd1={'success':a54_0x9af19e[_0x1d29e2(0xde)],'error':a54_0x9af19e[_0x1d29e2(0xab)],'group_error':a54_0x9af19e['red'],'running':a54_0x9af19e[_0x1d29e2(0x101)],'blocked':a54_0x9af19e[_0x1d29e2(0x14f)],'planned':a54_0x9af19e[_0x1d29e2(0x1f1)],'canceling':a54_0x9af19e[_0x1d29e2(0x14f)]};return _0x45ebd1[_0x3a42e7]||a54_0x9af19e['white'];}function parseTaskName(_0xa5313b){const _0x309124=a54_0x12ede4;let _0x4a9dc9=_0xa5313b[_0x309124(0x1be)](/^\++/,'');const _0x1d4728=_0x4a9dc9['split']('+'),_0x5a4a26=_0x1d4728['length']>0x1?_0x1d4728[_0x309124(0x1d8)]-0x2:0x0,_0x2614d1=_0x1d4728[_0x1d4728[_0x309124(0x1d8)]-0x1]||_0x4a9dc9;return{'level':_0x5a4a26,'name':'+'+_0x2614d1};}function truncateTaskName(_0x7928b3,_0x3acfbf){const _0x35d012=a54_0x12ede4,_0xeb4217=stringWidth(_0x7928b3);if(_0xeb4217<=_0x3acfbf)return _0x7928b3;let _0x52dfe6=_0x7928b3;while(stringWidth(_0x52dfe6+'…')>_0x3acfbf&&_0x52dfe6[_0x35d012(0x1d8)]>0x0){_0x52dfe6=_0x52dfe6[_0x35d012(0x17a)](0x0,-0x1);}return _0x52dfe6+'…';}function calculateTimeScale(_0x26b42b,_0x469893){const _0x16ce6a=a54_0x12ede4;return{'startTime':_0x26b42b[_0x16ce6a(0x130)],'endTime':_0x26b42b['end'],'durationMs':_0x26b42b[_0x16ce6a(0x129)],'msPerChar':_0x26b42b[_0x16ce6a(0x129)]/_0x469893};}function timeToPosition(_0x26e897,_0x51fb82,_0x33f9cf){const _0x25b0d5=a54_0x12ede4,_0x2235b3=_0x26e897-_0x51fb82[_0x25b0d5(0x1e3)],_0xa8fde8=Math[_0x25b0d5(0x198)](_0x2235b3/_0x51fb82[_0x25b0d5(0x172)]);return Math[_0x25b0d5(0x1ca)](0x0,Math[_0x25b0d5(0x20b)](_0xa8fde8,_0x33f9cf));}function renderTimeAxis(_0x33e8b5,_0x5c5d78){const _0x429c79=a54_0x12ede4,_0x89edcb=Math[_0x429c79(0x20b)](TIMELINE_CONFIG[_0x429c79(0x179)],Math[_0x429c79(0x1ca)](TIMELINE_CONFIG[_0x429c79(0x102)],Math[_0x429c79(0x198)](_0x5c5d78/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x5a6a5d=_0x33e8b5[_0x429c79(0xe6)]/(_0x89edcb-0x1),_0x45e065=new Date(_0x33e8b5[_0x429c79(0x1e3)]),_0x41a40c=[];for(let _0x5d91f1=0x0;_0x5d91f1<_0x89edcb;_0x5d91f1++){const _0x37310f=_0x33e8b5[_0x429c79(0x1e3)]+_0x5d91f1*_0x5a6a5d,_0x140ff2=timeToPosition(_0x37310f,_0x33e8b5,_0x5c5d78),_0x422de7=formatTimestamp(_0x37310f,_0x45e065);_0x41a40c[_0x429c79(0x1cd)]({'pos':_0x140ff2,'text':_0x422de7});}const _0x10cf49=new Array(_0x5c5d78)[_0x429c79(0x113)]('\x20');let _0x31b207=-0x1;for(const {pos:_0x7a87b8,text:_0x1d8282}of _0x41a40c){let _0x3b45c3=Math['max'](0x0,_0x7a87b8-Math[_0x429c79(0x198)](_0x1d8282[_0x429c79(0x1d8)]/0x2));_0x3b45c3<=_0x31b207+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x3b45c3=_0x31b207+TIMELINE_CONFIG[_0x429c79(0x1c8)]+0x1);_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]>_0x5c5d78&&(_0x3b45c3=_0x5c5d78-_0x1d8282[_0x429c79(0x1d8)]);if(_0x3b45c3>=0x0&&_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]<=_0x5c5d78&&_0x3b45c3>_0x31b207){for(let _0x2e032b=0x0;_0x2e032b<_0x1d8282[_0x429c79(0x1d8)];_0x2e032b++){_0x10cf49[_0x3b45c3+_0x2e032b]=_0x1d8282[_0x2e032b];}_0x31b207=_0x3b45c3+_0x1d8282[_0x429c79(0x1d8)]-0x1;}}return _0x10cf49[_0x429c79(0xbf)]('');}function renderTaskRow(_0x184412,_0x460e21,_0x52a06c,_0x12ca96){const _0x1fc8ac=a54_0x12ede4,{level:_0x1343e4,name:_0x14e195}=parseTaskName(_0x184412['name']),_0x5062ec='\x20'['repeat'](_0x1343e4),_0x5a88e6=_0x184412[_0x1fc8ac(0x1bf)]?'('+formatElapsed(_0x184412['window'][_0x1fc8ac(0x129)])+')':'',_0x40f104=stringWidth(_0x5a88e6),_0x14d840=_0x1343e4*0x1,_0x3c3638=_0x12ca96-_0x14d840-_0x40f104-0x1,_0x3dc9fb=truncateTaskName(_0x14e195,_0x3c3638),_0x43cffc=_0x5062ec+_0x3dc9fb,_0x4d3648=stringWidth(_0x43cffc),_0x5cb965=_0x12ca96-_0x4d3648-_0x40f104,_0x4c2221=_0x43cffc+'\x20'[_0x1fc8ac(0xa8)](Math[_0x1fc8ac(0x1ca)](0x1,_0x5cb965))+a54_0x9af19e[_0x1fc8ac(0x1f1)](_0x5a88e6),_0xb4b08c=getTaskStateIcon(_0x184412[_0x1fc8ac(0x1d7)]),_0x2a82f0=new Array(_0x52a06c)['fill']('\x20');if(_0x184412['window']){const _0x4d029e=timeToPosition(_0x184412[_0x1fc8ac(0x1bf)]['start'],_0x460e21,_0x52a06c),_0x5f120d=timeToPosition(_0x184412[_0x1fc8ac(0x1bf)]['end'],_0x460e21,_0x52a06c),_0xff48a3=getBarChar(_0x184412[_0x1fc8ac(0x1d7)]),_0x4fd39d=Math['max'](_0x4d029e+0x1,_0x5f120d);for(let _0x16bb3e=_0x4d029e;_0x16bb3e<Math[_0x1fc8ac(0x20b)](_0x4fd39d,_0x52a06c);_0x16bb3e++){_0x2a82f0[_0x16bb3e]=_0xff48a3;}}const _0x2049bf=getBarColor(_0x184412['state']),_0x152eda=_0x2a82f0[_0x1fc8ac(0x76)](_0x15c3a4=>_0x15c3a4==='\x20'?'\x20':_0x2049bf(_0x15c3a4))[_0x1fc8ac(0xbf)]('');return _0xb4b08c+'\x20'+_0x4c2221+'│'+_0x152eda+'│';}function calculateStats(_0x4565f9){const _0x510f3f=a54_0x12ede4,_0x7b9b59={'total':_0x4565f9[_0x510f3f(0x1d8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x37993f of _0x4565f9){if(_0x37993f[_0x510f3f(0x1d7)]==='success')_0x7b9b59[_0x510f3f(0x21d)]++;else{if(_0x37993f['state']===_0x510f3f(0x214)||_0x37993f[_0x510f3f(0x1d7)]===_0x510f3f(0x18f))_0x7b9b59['error']++;else _0x37993f[_0x510f3f(0x1d7)]===_0x510f3f(0x7f)?_0x7b9b59[_0x510f3f(0x7f)]++:_0x7b9b59[_0x510f3f(0x8f)]++;}}return _0x7b9b59;}function formatStats(_0x2c37e7){const _0x1b2e75=a54_0x12ede4;return[_0x1b2e75(0x10b)+_0x2c37e7[_0x1b2e75(0x14c)],'✅\x20'+_0x2c37e7[_0x1b2e75(0x21d)],'❌\x20'+_0x2c37e7[_0x1b2e75(0x214)],'🔄\x20'+_0x2c37e7[_0x1b2e75(0x7f)],'⏳\x20'+_0x2c37e7['pending']][_0x1b2e75(0xbf)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x12ede4(0x195);[a54_0x12ede4(0x14a)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x12ede4(0x202)](_0x4b91d8){const _0x309b14=a54_0x12ede4,{options:_0x5e4c62,args:_0x53f75d,tdx:_0x4a2ccd}=_0x4b91d8;let _0x9ac32b,_0xbde1ac,_0x1b0156=![];if(_0x53f75d[0x0]){if(_0x53f75d[0x0]['includes']('.')){const _0x447927=this[_0x309b14(0x9d)](_0x53f75d,_0x5e4c62);if(!_0x447927)return 0x1;_0x9ac32b=_0x447927['projectName'],_0xbde1ac=_0x447927['workflowName'];}else{_0xbde1ac=_0x53f75d[0x0],_0x9ac32b=_0x5e4c62[_0x309b14(0x16f)];if(!_0x9ac32b)return console['error'](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),_0x309b14(0x204)),0x1;_0x1b0156=!![];}}else{const _0x1c3400=this[_0x309b14(0x9d)](_0x53f75d,_0x5e4c62);if(!_0x1c3400)return 0x1;_0x9ac32b=_0x1c3400['projectName'],_0xbde1ac=_0x1c3400['workflowName'];}if(_0x5e4c62[_0x309b14(0x19b)]){if(_0x9ac32b&&_0xbde1ac)console[_0x309b14(0x214)]('Filter:\x20'+_0x9ac32b+'.'+_0xbde1ac);else _0x9ac32b&&console[_0x309b14(0x214)](_0x309b14(0x11d)+_0x9ac32b);}const _0x3b4be9=_0x5e4c62[_0x309b14(0x1f2)],_0x4c1e79=_0x5e4c62['sessionId'];if(_0x3b4be9){_0x4c1e79&&console['error'](a54_0x9af19e[_0x309b14(0x14f)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x19a590=_0x5e4c62[_0x309b14(0x15d)];return _0x19a590?await this[_0x309b14(0x137)](_0x4b91d8,_0x3b4be9):await this[_0x309b14(0x75)](_0x4b91d8,_0x3b4be9,_0x5e4c62),0x0;}if(_0x4c1e79){const _0x106120=await withSpinner(_0x309b14(0x1b1),()=>_0x4a2ccd[_0x309b14(0x1f4)]['sessions']({'projectName':_0x9ac32b,'workflowName':_0xbde1ac,'limit':0x64}),{'verbose':_0x5e4c62['verbose']}),_0x68104b=_0x106120[_0x309b14(0x10a)][_0x309b14(0x1f3)](_0x4e4e8e=>_0x4e4e8e['id']===_0x4c1e79);if(!_0x68104b)return console['error'](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),_0x309b14(0xff)+_0x4c1e79),0x1;if(!_0x68104b[_0x309b14(0x117)]?.['id'])return console[_0x309b14(0x214)](a54_0x9af19e[_0x309b14(0xab)](_0x309b14(0x163)),'Session\x20'+_0x4c1e79+_0x309b14(0x177)),0x1;const _0x57692d=_0x68104b[_0x309b14(0x117)]['id'];_0x5e4c62['verbose']&&console[_0x309b14(0x214)](_0x309b14(0xd6)+_0x57692d+_0x309b14(0x1a2)+_0x4c1e79);const _0x3a7b88=_0x5e4c62['follow'];return _0x3a7b88?await this['pollTimeline'](_0x4b91d8,_0x57692d):await this[_0x309b14(0x75)](_0x4b91d8,_0x57692d,_0x5e4c62),0x0;}const _0xe3d0ba=await withSpinner(_0x309b14(0x1c3),()=>_0x4a2ccd['workflow'][_0x309b14(0x1e5)]({'projectName':_0x9ac32b,'workflowName':_0xbde1ac,'limit':_0x5e4c62['limit']||0x32}),{'verbose':_0x5e4c62[_0x309b14(0x19b)]}),_0x428428=_0xe3d0ba[_0x309b14(0x10a)];if(_0x428428[_0x309b14(0x1d8)]===0x0){if(_0x9ac32b&&_0xbde1ac)console[_0x309b14(0x214)]('No\x20sessions\x20found\x20for:\x20'+_0x9ac32b+'.'+_0xbde1ac);else _0x9ac32b?console[_0x309b14(0x214)](_0x309b14(0x16a)+_0x9ac32b):(console[_0x309b14(0x214)]('No\x20workflow\x20sessions\x20found'),console['error'](a54_0x9af19e[_0x309b14(0x1f1)](_0x309b14(0x196))));return 0x0;}_0x428428[_0x309b14(0x154)]((_0x5e307d,_0x5ee797)=>{const _0x4efa21=_0x309b14,_0x109ba7=_0x5e307d[_0x4efa21(0x1ed)]||'',_0x100560=_0x5ee797[_0x4efa21(0x1ed)]||'';return _0x100560[_0x4efa21(0x1cf)](_0x109ba7);});if(_0x5e4c62[_0x309b14(0x11f)]||_0x5e4c62[_0x309b14(0x11b)])return await handleSDKOutput(_0x428428,_0x5e4c62),0x0;let _0x44afc1;if(_0x1b0156){const _0xdd31a9=_0x428428[0x0];if(!_0xdd31a9['lastAttempt']?.['id'])return console[_0x309b14(0x214)](_0x309b14(0xca)),0x0;_0x44afc1=_0xdd31a9[_0x309b14(0x117)]['id'],_0x5e4c62['verbose']&&console[_0x309b14(0x214)](_0x309b14(0x1df)+_0xdd31a9[_0x309b14(0x1ed)]);}else{const _0x4819bd=_0x428428[_0x309b14(0x76)](_0x43b7e7=>{const _0x567ab2=_0x309b14,_0x1af263=getAttemptStatusDisplay(_0x43b7e7[_0x567ab2(0x117)]);return{'title':_0x43b7e7[_0x567ab2(0x168)]?.['name']+'.'+_0x43b7e7[_0x567ab2(0x1f4)]?.[_0x567ab2(0x1a3)]+_0x567ab2(0xae)+_0x43b7e7['sessionTime']+'\x20'+_0x1af263[_0x567ab2(0x1c4)],'value':_0x43b7e7['lastAttempt']?.['id']||'','description':_0x1af263['text']};}),_0x3c7a9e=await a54_0x435c0a({'type':_0x309b14(0x171),'name':'attemptId','message':_0x309b14(0xa2),'choices':_0x4819bd['filter'](_0x56de5d=>_0x56de5d[_0x309b14(0x1af)]!=='')});if(!_0x3c7a9e['attemptId'])return 0x0;_0x44afc1=_0x3c7a9e[_0x309b14(0x1f2)];}const _0x366a6c=_0x5e4c62['follow'];return _0x366a6c?await this[_0x309b14(0x137)](_0x4b91d8,_0x44afc1):await this[_0x309b14(0x75)](_0x4b91d8,_0x44afc1,_0x5e4c62),0x0;}async['renderSingleTimeline'](_0x3e25b9,_0xae1afc,_0x33a96b){const _0x10d335=a54_0x12ede4,{tdx:_0x26a91d}=_0x3e25b9;let _0x11d146,_0xf68f34;try{[_0x11d146,_0xf68f34]=await Promise[_0x10d335(0xda)]([_0x26a91d[_0x10d335(0x1f4)][_0x10d335(0x21b)](_0xae1afc),_0x26a91d[_0x10d335(0x1f4)][_0x10d335(0x19c)](_0xae1afc,![])]);}catch(_0x34e822){console[_0x10d335(0x214)](a54_0x9af19e[_0x10d335(0xab)](_0x10d335(0x169)));_0x33a96b['verbose']&&console[_0x10d335(0x214)](_0x34e822);throw _0x34e822;}if(_0x33a96b['json']||_0x33a96b[_0x10d335(0x11b)]){const _0x5a937a=this['buildTimelineData'](_0x11d146,_0xf68f34);await handleSDKOutput([_0x5a937a],_0x33a96b);return;}const _0x132033=_0x26a91d[_0x10d335(0xa9)][_0x10d335(0x10d)],_0x240503=this[_0x10d335(0xec)](_0x11d146,_0xf68f34,_0x132033);console[_0x10d335(0x144)](_0x240503);}async[a54_0x12ede4(0x137)](_0x3c510f,_0x44184a){const _0x1cec3e=a54_0x12ede4,{tdx:_0x412d48}=_0x3c510f,_0x53759f=TIMELINE_CONFIG[_0x1cec3e(0x1c0)],_0x2e0f4e=TIMELINE_CONFIG[_0x1cec3e(0x127)];let _0x4a834c=0x0;while(_0x4a834c<_0x2e0f4e){process[_0x1cec3e(0xd7)]['isTTY']&&process[_0x1cec3e(0xd7)]['write']('\x1bc');let _0x363cf6,_0x25e195;try{[_0x363cf6,_0x25e195]=await Promise[_0x1cec3e(0xda)]([_0x412d48[_0x1cec3e(0x1f4)]['attempt'](_0x44184a),_0x412d48[_0x1cec3e(0x1f4)][_0x1cec3e(0x19c)](_0x44184a,![])]);}catch(_0x30cf6f){console['error'](a54_0x9af19e[_0x1cec3e(0xab)](_0x1cec3e(0x1cb)));_0x4a834c>0x0&&console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x1f1)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x4a834c));throw _0x30cf6f;}const _0x4d7e7a=_0x412d48[_0x1cec3e(0xa9)][_0x1cec3e(0x10d)],_0x1775ed=this['renderTimeline'](_0x363cf6,_0x25e195,_0x4d7e7a);console[_0x1cec3e(0x144)](_0x1775ed);const _0x4cc66c=_0x363cf6[_0x1cec3e(0xb9)]&&_0x25e195[_0x1cec3e(0x122)](_0x289af2=>_0x289af2[_0x1cec3e(0x1d7)]!=='running'&&_0x289af2[_0x1cec3e(0x1d7)]!==_0x1cec3e(0x221));if(_0x4cc66c){console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0xde)](_0x1cec3e(0x136)));break;}console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x1f1)](_0x1cec3e(0x92)+_0x4a834c*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0xa1a708=>setTimeout(_0xa1a708,_0x53759f)),_0x4a834c++;}_0x4a834c>=_0x2e0f4e&&console[_0x1cec3e(0x214)](a54_0x9af19e[_0x1cec3e(0x14f)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x12ede4(0xec)](_0x2e7538,_0x51a288,_0x2721de){const _0x563fc6=a54_0x12ede4,_0x55d32f=[],_0x74c31e=TIMELINE_CONFIG[_0x563fc6(0xad)],_0x330894=0x5,_0x1552e8=process[_0x563fc6(0xd7)]['columns']||0x78,_0x75a7b6=_0x1552e8-_0x74c31e-_0x330894,_0x3dbcb3=Math[_0x563fc6(0x1ca)](TIMELINE_CONFIG[_0x563fc6(0x15c)],Math[_0x563fc6(0x20b)](_0x75a7b6,TIMELINE_CONFIG[_0x563fc6(0x15b)])),_0x58d853=new Date(_0x2e7538[_0x563fc6(0xd2)])[_0x563fc6(0x1b0)](),_0x54aff8=_0x2e7538['finishedAt']?new Date(_0x2e7538[_0x563fc6(0x166)])[_0x563fc6(0x1b0)]():Date[_0x563fc6(0x21f)](),_0x3674f0={'start':_0x58d853,'end':_0x54aff8,'duration':_0x54aff8-_0x58d853},_0x118dd7=new Map(),_0x355260=[];for(const _0x2e0cef of _0x51a288){if(_0x2e0cef[_0x563fc6(0xfc)]){const _0x4294bf=new Date(_0x2e0cef[_0x563fc6(0xfc)])[_0x563fc6(0x1b0)](),_0x881d8a=_0x2e0cef[_0x563fc6(0x1d0)]?new Date(_0x2e0cef['updatedAt'])[_0x563fc6(0x1b0)]():Date[_0x563fc6(0x21f)](),_0x5bc275={'start':_0x4294bf,'end':_0x881d8a,'duration':_0x881d8a-_0x4294bf};_0x118dd7['set'](_0x2e0cef['id'],_0x5bc275),_0x355260[_0x563fc6(0x1cd)]({'name':_0x2e0cef[_0x563fc6(0x18c)],'state':_0x2e0cef['state']||'unknown','window':_0x5bc275});}else _0x355260[_0x563fc6(0x1cd)]({'name':_0x2e0cef['fullName'],'state':_0x2e0cef[_0x563fc6(0x1d7)]||_0x563fc6(0x221),'window':undefined});}_0x355260[_0x563fc6(0x154)]((_0x2500ae,_0x50e4b4)=>{const _0x8227f7=_0x563fc6;if(!_0x2500ae['window'])return 0x1;if(!_0x50e4b4[_0x8227f7(0x1bf)])return-0x1;return _0x2500ae['window'][_0x8227f7(0x130)]-_0x50e4b4[_0x8227f7(0x1bf)][_0x8227f7(0x130)];});const _0x225827=_0x355260['length'],_0x1d9adc=_0x225827>TIMELINE_CONFIG[_0x563fc6(0xfd)];_0x1d9adc&&_0x355260[_0x563fc6(0xa6)](TIMELINE_CONFIG[_0x563fc6(0xfd)]);const _0x20ee63=calculateTimeScale(_0x3674f0,_0x3dbcb3),_0x5305c6=_0x2e7538[_0x563fc6(0xb9)]?_0x2e7538[_0x563fc6(0x21d)]?a54_0x9af19e[_0x563fc6(0xde)](_0x563fc6(0x21d)):a54_0x9af19e[_0x563fc6(0xab)]('error'):a54_0x9af19e['blue']('running'),_0x404368=_0x2e7538[_0x563fc6(0x168)]?.['id'],_0x6881cb=_0x2e7538[_0x563fc6(0x1a1)];let _0x45c470;if(_0x404368&&_0x6881cb){const _0x2acd92=getWorkflowAttemptUrl(_0x2721de,_0x404368,_0x6881cb,_0x2e7538['id']);_0x45c470=hyperlink(a54_0x9af19e[_0x563fc6(0x1f1)](_0x2e7538['id']),_0x2acd92);}else _0x45c470=a54_0x9af19e['dim'](_0x2e7538['id']);_0x55d32f[_0x563fc6(0x1cd)]('Attempt:\x20'+_0x45c470+_0x563fc6(0xae)+_0x5305c6+_0x563fc6(0xae)+formatElapsed(_0x3674f0[_0x563fc6(0x129)]));if(_0x355260[_0x563fc6(0x1d8)]>0x0){const _0x4f1380=renderTimeAxis(_0x20ee63,_0x3dbcb3),_0x1b6073=new Date(_0x3674f0[_0x563fc6(0x130)]),_0x5f4095=formatDate(_0x1b6073),_0xa8994b=TIMELINE_CONFIG[_0x563fc6(0xa4)]+TIMELINE_CONFIG[_0x563fc6(0xf8)]+_0x74c31e,_0x3c91f1=_0x5f4095['padStart'](_0xa8994b),_0x4ee86e=a54_0x9af19e[_0x563fc6(0x1f1)](_0x3c91f1);_0x55d32f['push'](_0x4ee86e+'\x20'+_0x4f1380);for(const _0x4b1ecf of _0x355260){_0x55d32f[_0x563fc6(0x1cd)](renderTaskRow(_0x4b1ecf,_0x20ee63,_0x3dbcb3,_0x74c31e));}const _0x46aa60=calculateStats(_0x355260);_0x55d32f[_0x563fc6(0x1cd)](formatStats(_0x46aa60)),_0x1d9adc&&_0x55d32f[_0x563fc6(0x1cd)](a54_0x9af19e['yellow'](_0x563fc6(0x1fe)+TIMELINE_CONFIG[_0x563fc6(0xfd)]+_0x563fc6(0xdc)+_0x225827+_0x563fc6(0x96))),_0x55d32f[_0x563fc6(0x1cd)](''),_0x55d32f['push'](a54_0x9af19e[_0x563fc6(0x1f1)](_0x563fc6(0x189))+(_0x563fc6(0x14e)+_0x2e7538['id']+_0x563fc6(0x20e))+a54_0x9af19e['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x55d32f[_0x563fc6(0x1cd)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x55d32f[_0x563fc6(0xbf)]('\x0a');}[a54_0x12ede4(0x150)](_0xa5537f,_0x36c83f){const _0x2cd79b=a54_0x12ede4,_0x5caa86=new Date(_0xa5537f['createdAt'])[_0x2cd79b(0x1b0)](),_0xa1265a=_0xa5537f[_0x2cd79b(0x166)]?new Date(_0xa5537f['finishedAt'])[_0x2cd79b(0x1b0)]():Date[_0x2cd79b(0x21f)](),_0x21c728=_0xa1265a-_0x5caa86,_0x75d2b6=[];for(const _0x3601c9 of _0x36c83f){if(_0x3601c9[_0x2cd79b(0xfc)]){const _0x2411d8=new Date(_0x3601c9[_0x2cd79b(0xfc)])['getTime'](),_0x2af6d7=_0x3601c9[_0x2cd79b(0x1d0)]?new Date(_0x3601c9[_0x2cd79b(0x1d0)])[_0x2cd79b(0x1b0)]():Date['now']();_0x75d2b6[_0x2cd79b(0x1cd)]({'name':_0x3601c9[_0x2cd79b(0x18c)],'state':_0x3601c9[_0x2cd79b(0x1d7)]||_0x2cd79b(0x180),'window':{'start':_0x2411d8,'end':_0x2af6d7,'duration':_0x2af6d7-_0x2411d8}});}else _0x75d2b6['push']({'name':_0x3601c9['fullName'],'state':_0x3601c9[_0x2cd79b(0x1d7)]||_0x2cd79b(0x221),'window':undefined});}const _0x5d9e1b=calculateStats(_0x75d2b6);return{'attempt':{'id':_0xa5537f['id'],'status':_0xa5537f[_0x2cd79b(0xb9)]?_0xa5537f[_0x2cd79b(0x21d)]?_0x2cd79b(0x21d):_0x2cd79b(0x214):_0x2cd79b(0x7f),'createdAt':_0xa5537f[_0x2cd79b(0xd2)],'finishedAt':_0xa5537f[_0x2cd79b(0x166)],'duration_ms':_0x21c728},'tasks':_0x75d2b6[_0x2cd79b(0x76)](_0xfd7b49=>({'name':_0xfd7b49[_0x2cd79b(0x1a3)],'state':_0xfd7b49['state'],'startedAt':_0xfd7b49['window']?new Date(_0xfd7b49['window'][_0x2cd79b(0x130)])['toISOString']():null,'updatedAt':_0xfd7b49[_0x2cd79b(0x1bf)]?new Date(_0xfd7b49[_0x2cd79b(0x1bf)]['end'])['toISOString']():null,'duration_ms':_0xfd7b49[_0x2cd79b(0x1bf)]?.[_0x2cd79b(0x129)]||null})),'stats':_0x5d9e1b};}}
1
+ const a54_0x54edc0=a54_0xccde;(function(_0x879e37,_0x2ecedf){const _0x3774dd=a54_0xccde,_0x52ee58=_0x879e37();while(!![]){try{const _0xe8d569=parseInt(_0x3774dd(0x149))/0x1*(-parseInt(_0x3774dd(0x19a))/0x2)+parseInt(_0x3774dd(0x27e))/0x3+parseInt(_0x3774dd(0x134))/0x4*(parseInt(_0x3774dd(0x280))/0x5)+-parseInt(_0x3774dd(0x299))/0x6*(parseInt(_0x3774dd(0x2b6))/0x7)+-parseInt(_0x3774dd(0x2bf))/0x8*(parseInt(_0x3774dd(0x2b2))/0x9)+parseInt(_0x3774dd(0x2ae))/0xa*(-parseInt(_0x3774dd(0x197))/0xb)+parseInt(_0x3774dd(0x18e))/0xc*(parseInt(_0x3774dd(0x13f))/0xd);if(_0xe8d569===_0x2ecedf)break;else _0x52ee58['push'](_0x52ee58['shift']());}catch(_0xd22bc){_0x52ee58['push'](_0x52ee58['shift']());}}}(a54_0x11ab,0xdb0f3));import a54_0x26125e from'chalk';function a54_0xccde(_0x5aebd0,_0x5a266d){_0x5aebd0=_0x5aebd0-0x11c;const _0x11ab96=a54_0x11ab();let _0xccded9=_0x11ab96[_0x5aebd0];return _0xccded9;}import{existsSync}from'fs';import a54_0x1db018 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x1aee3d from'prompts';function getAttemptStatusDisplay(_0x16f32b){const _0x300276=a54_0xccde;if(!_0x16f32b)return{'icon':'⏳','text':''};const {done:_0x562d4c,success:_0x1b7f6b,cancelRequested:_0x5ddda5}=_0x16f32b;if(!_0x562d4c)return _0x5ddda5?{'icon':'🛑','text':a54_0x26125e[_0x300276(0x21c)](_0x300276(0x17d))}:{'icon':'🔄','text':a54_0x26125e['blue'](_0x300276(0x187))};if(_0x1b7f6b)return{'icon':'✅','text':a54_0x26125e[_0x300276(0x208)](_0x300276(0x2bb))};return{'icon':'❌','text':a54_0x26125e[_0x300276(0x16f)](_0x300276(0x279))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x54edc0(0x2bd)](_0xba37e5,_0x4b0a8b,_0x109fce=0x0){const _0x963863=a54_0x54edc0;return _0xba37e5[_0x109fce]||_0x4b0a8b[_0x963863(0x198)];}['requireProject'](_0x18aec7,_0x12d0bd,_0x496b72=0x0){const _0x4154c4=a54_0x54edc0,_0x87a9a0=this[_0x4154c4(0x2bd)](_0x18aec7,_0x12d0bd,_0x496b72);if(!_0x87a9a0)return console[_0x4154c4(0x279)](a54_0x26125e['red'](_0x4154c4(0x14e)),'Project\x20name\x20is\x20required'),console['error'](a54_0x26125e['dim'](_0x4154c4(0x1eb))),null;return _0x87a9a0;}[a54_0x54edc0(0x124)](_0x19fb18,_0x1a664f){const _0x3f6029=a54_0x54edc0;if(_0x19fb18[0x0]){const _0x5d5194=_0x19fb18[0x0][_0x3f6029(0x210)]('.');if(_0x5d5194[_0x3f6029(0x274)]===0x1)return{'projectName':_0x5d5194[0x0],'workflowName':undefined};else return _0x5d5194['length']===0x2?{'projectName':_0x5d5194[0x0],'workflowName':_0x5d5194[0x1]}:(console['error'](a54_0x26125e[_0x3f6029(0x16f)](_0x3f6029(0x14e)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x1a664f[_0x3f6029(0x198)],'workflowName':undefined};}[a54_0x54edc0(0x1a1)](_0x249237,_0x585c6d,_0x55da15=0x0){const _0x1df6f8=a54_0x54edc0;if(_0x249237[_0x55da15])return _0x249237[_0x55da15];if(_0x585c6d[_0x1df6f8(0x198)]){const _0x2aab6c=a54_0x1db018['join'](process['cwd'](),_0x1df6f8(0x189),_0x585c6d['workflowProject']);if(existsSync(a54_0x1db018[_0x1df6f8(0x2a6)](_0x2aab6c,'tdx.json')))return _0x2aab6c;}return undefined;}async[a54_0x54edc0(0x140)](_0x43b851,_0x376d6d,_0x891256){const _0x474518=a54_0x54edc0;try{const _0x1f1c68=await _0x43b851['workflow'][_0x474518(0x189)](_0x376d6d,{'limit':0x1});if(_0x1f1c68[_0x474518(0x274)]>0x0){const _0x570d0d=_0x1f1c68[0x0]['id'],_0x44140e=getWorkflowUrl(_0x891256,_0x570d0d);console['error'](_0x474518(0x15e)+a54_0x26125e['cyan'](_0x44140e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:use';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1b7);async[a54_0x54edc0(0x256)](_0x325fa8){const _0x567bdf=a54_0x54edc0,{options:_0x5ba579,args:_0x4b8548,tdx:_0x11dcae}=_0x325fa8,_0x512c72=_0x4b8548[0x0],_0x39f81a=_0x5ba579[_0x567bdf(0x23d)];if(_0x39f81a)return saveSessionContext({'workflow_project':undefined},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x512c72)return console['error'](a54_0x26125e[_0x567bdf(0x16f)](_0x567bdf(0x14e)),_0x567bdf(0x2c0)),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)](_0x567bdf(0x2c8))),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x30621b=await withSpinner(_0x567bdf(0x1fd)+_0x512c72+_0x567bdf(0x216),()=>_0x11dcae[_0x567bdf(0x169)][_0x567bdf(0x192)](_0x512c72),{'verbose':_0x5ba579[_0x567bdf(0x1f9)]}),{name:_0x322ae8}=_0x30621b['data'];return saveSessionContext({'workflow_project':_0x322ae8},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e[_0x567bdf(0x208)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x26125e['cyan'](_0x322ae8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:projects';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x25f);async['execute'](_0x5de221){const _0x1460ef=a54_0x54edc0,{options:_0x3d3e54,args:_0x5a72d6,tdx:_0x3f4742}=_0x5de221,_0x569776=_0x5a72d6[0x0];_0x3d3e54[_0x1460ef(0x1f9)]&&_0x569776&&console[_0x1460ef(0x279)](_0x1460ef(0x1ac)+_0x569776);const _0x27fab8=await withSpinner(_0x1460ef(0x138),()=>_0x3f4742[_0x1460ef(0x169)][_0x1460ef(0x262)](_0x569776,{'limit':_0x3d3e54[_0x1460ef(0x21e)]}),{'verbose':_0x3d3e54['verbose']});let _0x3977ea=_0x27fab8[_0x1460ef(0x199)];_0x3977ea[_0x1460ef(0x1f8)]((_0x4d0658,_0x4f7518)=>_0x4d0658['name'][_0x1460ef(0x267)](_0x4f7518['name']));const _0x408c03=_0x3d3e54[_0x1460ef(0x21e)]||0x64,_0x3224c3=_0x3977ea[_0x1460ef(0x274)]>=_0x408c03?a54_0x26125e[_0x1460ef(0x13e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1460ef(0x279)](_0x1460ef(0x272)+_0x3977ea[_0x1460ef(0x274)]+_0x1460ef(0x243)+(_0x3977ea['length']!==0x1?'s':'')+_0x3224c3);if(_0x3d3e54['format']===_0x1460ef(0x11d)||_0x3d3e54[_0x1460ef(0x185)]===_0x1460ef(0x245)||_0x3d3e54[_0x1460ef(0x185)]==='table')await handleSDKOutput(_0x3977ea,_0x3d3e54);else{if(_0x3977ea['length']===0x0)_0x569776?console[_0x1460ef(0x25d)](_0x1460ef(0x273)+_0x569776):console[_0x1460ef(0x25d)]('No\x20workflow\x20projects\x20found');else{const _0x4e7bc3=_0x3977ea[_0x1460ef(0x136)](_0x4ffa30=>{const _0x575aec=_0x1460ef,_0x55c8ec=_0x4ffa30['metadata']?.['some'](_0x2d398d=>_0x2d398d[_0x575aec(0x254)]===_0x575aec(0x23f)),_0x19e6ef=_0x55c8ec?a54_0x26125e[_0x575aec(0x13e)](_0x575aec(0x230)):'';return _0x575aec(0x2b1)+_0x4ffa30[_0x575aec(0x231)]+_0x19e6ef;});await writeOutput(_0x4e7bc3['join']('\x0a'),_0x3d3e54[_0x1460ef(0x2c5)],_0x1460ef(0x222));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:workflows';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x181);async[a54_0x54edc0(0x256)](_0x2855f3){const _0x326b34=a54_0x54edc0,{options:_0x451172,args:_0x5a6fd7,tdx:_0x46edac}=_0x2855f3,_0x26c44d=this['resolveProject'](_0x5a6fd7,_0x451172);_0x451172[_0x326b34(0x1f9)]&&_0x26c44d&&console['error']('Project\x20filter:\x20'+_0x26c44d);const _0x2a756a=await withSpinner(_0x326b34(0x295),()=>_0x46edac[_0x326b34(0x169)]['workflows'](_0x26c44d,{'limit':_0x451172['limit']}),{'verbose':_0x451172['verbose']});let _0x130b00=_0x2a756a[_0x326b34(0x199)];_0x130b00[_0x326b34(0x1f8)]((_0x2332dc,_0x25c143)=>{const _0x228061=_0x326b34,_0xc8176=_0x2332dc[_0x228061(0x231)]['localeCompare'](_0x25c143[_0x228061(0x231)]);if(_0xc8176!==0x0)return _0xc8176;return(_0x2332dc[_0x228061(0x21d)]?.[_0x228061(0x231)]||'')[_0x228061(0x267)](_0x25c143['project']?.[_0x228061(0x231)]||'');});const _0x2b748c=_0x451172[_0x326b34(0x21e)]||0x64,_0x1b5a3f=_0x130b00[_0x326b34(0x274)]>=_0x2b748c?a54_0x26125e[_0x326b34(0x13e)](_0x326b34(0x24b)):'';console[_0x326b34(0x279)](_0x326b34(0x272)+_0x130b00['length']+_0x326b34(0x238)+(_0x130b00['length']!==0x1?'s':'')+_0x1b5a3f);if(_0x451172[_0x326b34(0x185)]==='json'||_0x451172['format']===_0x326b34(0x245)||_0x451172[_0x326b34(0x185)]===_0x326b34(0x1c2))await handleSDKOutput(_0x130b00,_0x451172);else{if(_0x130b00[_0x326b34(0x274)]===0x0)_0x26c44d?console[_0x326b34(0x25d)](_0x326b34(0x294)+_0x26c44d):console[_0x326b34(0x25d)]('No\x20workflows\x20found');else{const _0x2789ba=_0x451172[_0x326b34(0x232)],_0x41f0a1=_0x130b00['map'](_0x47616c=>{const _0x211c2a=_0x326b34,_0x1c7724=a54_0x26125e[_0x211c2a(0x13e)]('#'+_0x47616c['id']),_0x2b237a=hyperlink(_0x1c7724,getWorkflowUrl(_0x2789ba,_0x47616c['id'])),_0x343c0f=_0x47616c['project']?.[_0x211c2a(0x231)]?a54_0x26125e[_0x211c2a(0x13e)]('\x20('+_0x47616c[_0x211c2a(0x21d)][_0x211c2a(0x231)]+')'):'';return _0x211c2a(0x288)+_0x2b237a+'\x20'+_0x47616c[_0x211c2a(0x231)]+_0x343c0f;});await writeOutput(_0x41f0a1[_0x326b34(0x2a6)]('\x0a'),_0x451172['output'],_0x326b34(0x222));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:sessions';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x15b);async[a54_0x54edc0(0x256)](_0x3c65aa){const _0x5e4ba4=a54_0x54edc0,{options:_0x4e4cdb,args:_0x1c00e6,tdx:_0x8f4fde}=_0x3c65aa,_0x4d548a=this[_0x5e4ba4(0x124)](_0x1c00e6,_0x4e4cdb);if(!_0x4d548a)return 0x1;const {projectName:_0x276c11,workflowName:_0x3de4da}=_0x4d548a;if(_0x4e4cdb[_0x5e4ba4(0x1f9)]){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x279)](_0x5e4ba4(0x2a7)+_0x276c11+'.'+_0x3de4da);else _0x276c11&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x22e)+_0x276c11);const _0x31e9a1=_0x4e4cdb[_0x5e4ba4(0x156)];_0x31e9a1&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x19b)+_0x31e9a1);}let _0x5b569b=0x28;if(process['stdout']['isTTY']&&!_0x4e4cdb[_0x5e4ba4(0x2c5)]&&!_0x4e4cdb[_0x5e4ba4(0x185)]){const _0x4ea3c0=process['stdout'][_0x5e4ba4(0x20b)]||0x28;_0x5b569b=Math[_0x5e4ba4(0x224)](0x14,Math[_0x5e4ba4(0x287)](_0x4ea3c0*0x2/0x3));}const _0x24a9e4=_0x4e4cdb[_0x5e4ba4(0x21e)]||_0x5b569b,_0x49db2b=await withSpinner(_0x5e4ba4(0x2a0),()=>_0x8f4fde[_0x5e4ba4(0x169)][_0x5e4ba4(0x173)]({'projectName':_0x276c11,'workflowName':_0x3de4da,'status':_0x4e4cdb['status'],'fromTime':_0x4e4cdb[_0x5e4ba4(0x213)],'toTime':_0x4e4cdb['to'],'limit':_0x24a9e4}),{'verbose':_0x4e4cdb[_0x5e4ba4(0x1f9)]}),_0x3a5f61=_0x49db2b['data'];_0x3a5f61[_0x5e4ba4(0x1f8)]((_0x1e806e,_0x21a2e6)=>{const _0x158ab3=_0x5e4ba4,_0x2ce1eb=_0x1e806e[_0x158ab3(0x2b9)]||'',_0x6210db=_0x21a2e6['sessionTime']||'';return _0x6210db[_0x158ab3(0x267)](_0x2ce1eb);});_0x3a5f61[_0x5e4ba4(0x274)]>=_0x24a9e4?console[_0x5e4ba4(0x279)]('✔\x20Showing\x20'+_0x3a5f61[_0x5e4ba4(0x274)]+'\x20sessions\x20'+a54_0x26125e[_0x5e4ba4(0x13e)](_0x5e4ba4(0x201))):console[_0x5e4ba4(0x279)](_0x5e4ba4(0x272)+_0x3a5f61[_0x5e4ba4(0x274)]+_0x5e4ba4(0x1ab)+(_0x3a5f61['length']!==0x1?'s':''));if(_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x11d)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x245)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x1c2))await handleSDKOutput(_0x3a5f61,_0x4e4cdb);else{if(!process[_0x5e4ba4(0x1ce)][_0x5e4ba4(0x170)]||_0x4e4cdb['output']){if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else{const _0x487e7c=_0x4e4cdb[_0x5e4ba4(0x232)],_0xd5845b=this[_0x5e4ba4(0x1d6)](_0x3a5f61,_0x487e7c);_0x4e4cdb[_0x5e4ba4(0x2c5)]?await writeOutput(_0xd5845b,_0x4e4cdb[_0x5e4ba4(0x2c5)],_0x5e4ba4(0x222)):console['log'](_0xd5845b);}!_0x276c11&&(console[_0x5e4ba4(0x279)](''),console[_0x5e4ba4(0x279)](a54_0x26125e['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x5e4ba4(0x279)](a54_0x26125e['dim'](_0x5e4ba4(0x25a))+'or'+a54_0x26125e['dim'](_0x5e4ba4(0x20c))));}else{if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console['log'](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x21a)+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else await this[_0x5e4ba4(0x1d5)](_0x3a5f61,_0x3c65aa,_0x276c11);}}return 0x0;}[a54_0x54edc0(0x1d6)](_0x234331,_0x3d59f1){const _0x30797e=a54_0x54edc0,_0x47e623=[],_0x163d7b=new Map();let _0x35d81d=Infinity,_0xaa2251=-Infinity;for(const _0x505d7f of _0x234331){if(_0x505d7f['lastAttempt']?.['createdAt']){const _0x2595e5=new Date(_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x145)])[_0x30797e(0x284)](),_0x41ff5f=_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x16e)]?new Date(_0x505d7f['lastAttempt'][_0x30797e(0x16e)])['getTime']():Date[_0x30797e(0x2be)](),_0x5eccb8=_0x505d7f[_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'(unknown)';!_0x163d7b[_0x30797e(0x2aa)](_0x5eccb8)&&_0x163d7b['set'](_0x5eccb8,[]),_0x163d7b['get'](_0x5eccb8)[_0x30797e(0x167)]({'session':_0x505d7f,'startTime':_0x2595e5,'endTime':_0x41ff5f,'duration':_0x41ff5f-_0x2595e5}),_0x35d81d=Math[_0x30797e(0x121)](_0x35d81d,_0x2595e5),_0xaa2251=Math[_0x30797e(0x224)](_0xaa2251,_0x41ff5f);}}if(_0x163d7b[_0x30797e(0x1da)]===0x0)return _0x30797e(0x241);const _0x2aedaa=process['stdout'][_0x30797e(0x2c3)]||0x78,_0x18a317=0x1e,_0x593c4d=0x32,_0x6dfdd8=0x4,_0x27a2f4=Math[_0x30797e(0x121)](_0x593c4d,Math['max'](_0x18a317,Math['floor'](_0x2aedaa*0.3))),_0x38f266=_0x2aedaa-_0x27a2f4-TIMELINE_CONFIG['GUTTER']-0x3-_0x6dfdd8,_0x1572af=_0xaa2251-_0x35d81d,_0xf99a2c=_0x1572af/_0x27a2f4,_0x4251af=renderTimeAxis({'startTime':_0x35d81d,'endTime':_0xaa2251,'durationMs':_0x1572af,'msPerChar':_0xf99a2c},_0x27a2f4),_0x23e5bf=[];for(const _0x272302 of _0x163d7b[_0x30797e(0x211)]()){_0x23e5bf[_0x30797e(0x167)](..._0x272302);}_0x23e5bf[_0x30797e(0x1f8)]((_0x32eea1,_0x4c71b8)=>_0x4c71b8[_0x30797e(0x1fa)]-_0x32eea1[_0x30797e(0x1fa)]);const _0x3b87b1=new Date(_0x35d81d),_0x909add=formatDate(_0x3b87b1),_0x2d9b82=_0x6dfdd8+TIMELINE_CONFIG[_0x30797e(0x162)]+TIMELINE_CONFIG[_0x30797e(0x1b1)]+_0x38f266,_0x5b47b0='\x20'[_0x30797e(0x258)](_0x2d9b82-_0x909add[_0x30797e(0x274)]),_0x55a1a4=_0x5b47b0+a54_0x26125e['dim'](_0x909add)+'\x20'+_0x4251af;_0x47e623[_0x30797e(0x167)](_0x55a1a4);const _0x8ab5b3=0x16;let _0x1c6c09=0x0;for(const _0x288176 of _0x23e5bf){const _0x35cdc6=_0x288176[_0x30797e(0x27d)][_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'?',_0x6625d6=Math[_0x30797e(0x121)](stringWidth(_0x35cdc6),_0x8ab5b3);_0x1c6c09=Math[_0x30797e(0x224)](_0x1c6c09,_0x6625d6);}for(const _0x2f48c3 of _0x23e5bf){const {session:_0xcc2ec0,startTime:_0x4fa765,endTime:_0x3c6116,duration:_0x5581c3}=_0x2f48c3,_0x4d6f27=_0xcc2ec0[_0x30797e(0x21d)]?.['id'],_0x2cc2f3=_0xcc2ec0['id'],_0x1be73c=_0xcc2ec0[_0x30797e(0x21d)]?.['name']||'?',_0x4f345c=_0xcc2ec0[_0x30797e(0x169)]?.[_0x30797e(0x231)]||'?';let _0x49f365,_0x3f41b4;if(_0xcc2ec0['lastAttempt']){const _0xf8fb4e=_0xcc2ec0[_0x30797e(0x2b7)];!_0xf8fb4e['done']?(_0x49f365=_0xf8fb4e[_0x30797e(0x1f3)]?'🛑':'🔄',_0x3f41b4=_0xf8fb4e[_0x30797e(0x1f3)]?a54_0x26125e[_0x30797e(0x21c)]:a54_0x26125e[_0x30797e(0x154)]):(_0x49f365=_0xf8fb4e[_0x30797e(0x2bb)]?'✅':'❌',_0x3f41b4=_0xf8fb4e['success']?a54_0x26125e[_0x30797e(0x208)]:a54_0x26125e[_0x30797e(0x16f)]);}else _0x49f365='⏳',_0x3f41b4=a54_0x26125e[_0x30797e(0x13e)];const _0x63860e='#'+_0x2cc2f3,_0x3c5783=_0x4d6f27?hyperlink(_0x63860e,getWorkflowSessionUrl(_0x3d59f1,_0x4d6f27,_0x2cc2f3)):_0x63860e;let _0x15c7da=_0x1be73c;stringWidth(_0x1be73c)>_0x8ab5b3&&(_0x15c7da=_0x1be73c['slice'](0x0,_0x8ab5b3-0x1)+'…');const _0x1cba9f=a54_0x26125e['dim'](_0x15c7da),_0xb84d2b=stringWidth(_0x15c7da),_0x4f89fa='\x20'[_0x30797e(0x258)](_0x1c6c09-stringWidth(_0x15c7da)+0x2),_0x2eb65c='('+formatElapsed(_0x5581c3)+')',_0x1f107f=stringWidth(_0x2eb65c),_0xfaf3f8=stringWidth(_0x63860e),_0x5de900=_0xfaf3f8+0x1+_0xb84d2b+_0x4f89fa['length'],_0x566537=_0x38f266-_0x5de900-_0x1f107f-0x1-0x8;let _0x3be978=_0x4f345c;stringWidth(_0x3be978)>_0x566537&&(_0x3be978=_0x3be978[_0x30797e(0x12d)](0x0,_0x566537-0x1)+'…');const _0x35ff3b=_0x3c5783+'\x20'+_0x1cba9f+_0x4f89fa+_0x3be978,_0x1bb947=stringWidth(_0x35ff3b),_0x1b46ce=_0x38f266-_0x1bb947-_0x1f107f,_0x23585f=_0x35ff3b+'\x20'[_0x30797e(0x258)](Math[_0x30797e(0x224)](0x1,_0x1b46ce))+a54_0x26125e[_0x30797e(0x13e)](_0x2eb65c),_0x16be0e=Math[_0x30797e(0x287)]((_0x4fa765-_0x35d81d)/_0xf99a2c),_0x22e14e=Math[_0x30797e(0x287)]((_0x3c6116-_0x35d81d)/_0xf99a2c),_0x188467=Math[_0x30797e(0x224)](_0x16be0e+0x1,_0x22e14e),_0x4fc81d=new Array(_0x27a2f4)[_0x30797e(0x28b)]('\x20');for(let _0x52245a=_0x16be0e;_0x52245a<Math[_0x30797e(0x121)](_0x188467,_0x27a2f4);_0x52245a++){_0x4fc81d[_0x52245a]='─';}const _0x66e72c=_0x4fc81d[_0x30797e(0x136)](_0x290202=>_0x290202==='\x20'?'\x20':_0x3f41b4(_0x290202))['join']('');_0x47e623[_0x30797e(0x167)](_0x49f365+'\x20'+_0x23585f+'│'+_0x66e72c+'│');}return _0x47e623[_0x30797e(0x2a6)]('\x0a');}async[a54_0x54edc0(0x1d5)](_0x711a8c,_0x12cc86,_0x49326e){const _0x41b9bc=a54_0x54edc0,{options:_0x243956,tdx:_0x5ae6fc}=_0x12cc86,_0x1265fa=_0x243956['site'],{timelineRows:_0x6ce810,timeAxisHeader:_0x3d1ddf}=this[_0x41b9bc(0x195)](_0x711a8c,_0x1265fa),_0x5d0f46=_0x6ce810[_0x41b9bc(0x217)](_0x5e2759=>_0x5e2759['attemptId']);if(_0x5d0f46[_0x41b9bc(0x274)]===0x0){const _0x458f34=this[_0x41b9bc(0x1d6)](_0x711a8c,_0x1265fa);console[_0x41b9bc(0x25d)](_0x458f34);!_0x49326e&&(console[_0x41b9bc(0x279)](''),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x2c1))),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x25a))+'or'+a54_0x26125e['dim'](_0x41b9bc(0x20c))));return;}_0x3d1ddf&&console['log'](_0x3d1ddf);const _0x295619=_0x6ce810[_0x41b9bc(0x217)](_0x28674f=>_0x28674f[_0x41b9bc(0x28e)])[_0x41b9bc(0x136)](_0x24a6bd=>({'title':_0x24a6bd[_0x41b9bc(0x1d3)],'value':_0x24a6bd[_0x41b9bc(0x28e)]})),_0x2258bb=process[_0x41b9bc(0x1ce)][_0x41b9bc(0x20b)]||0x3c,_0x44d998=Math[_0x41b9bc(0x224)](0x28,Math[_0x41b9bc(0x287)](_0x2258bb*0x2/0x3)),_0x202088=await a54_0x1aee3d({'type':_0x41b9bc(0x250),'name':_0x41b9bc(0x28e),'message':_0x41b9bc(0x1c4),'choices':_0x295619,'initial':-0x1,'limit':_0x44d998,'clearFirst':!![],'fallback':{'title':_0x41b9bc(0x130),'value':null},'suggest':(_0x333e2d,_0x3ec979)=>{const _0x58cb7a=_0x41b9bc;if(!_0x333e2d)return Promise[_0x58cb7a(0x236)](_0x3ec979);const _0x4e81b4=_0x3ec979['filter'](_0x291a8d=>{const _0x3bdc1e=_0x58cb7a,_0x72439c=_0x291a8d;return _0x72439c[_0x3bdc1e(0x228)]['toLowerCase']()[_0x3bdc1e(0x183)](_0x333e2d[_0x3bdc1e(0x286)]());});return Promise[_0x58cb7a(0x236)](_0x4e81b4);}}),_0x32ed9d=()=>{const _0x2447a9=_0x41b9bc;process[_0x2447a9(0x1ce)]['write'](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2));},_0x38995a=_0x202088&&_0x202088[_0x41b9bc(0x28e)]&&_0x202088[_0x41b9bc(0x28e)]!==null&&_0x202088[_0x41b9bc(0x28e)][_0x41b9bc(0x234)]()!=='';if(!_0x38995a){_0x32ed9d(),console['log'](a54_0x26125e['dim'](_0x41b9bc(0x1cf)));return;}_0x32ed9d();const _0x18ce0f=_0x711a8c[_0x41b9bc(0x1b0)](_0x231f73=>_0x231f73[_0x41b9bc(0x2b7)]?.['id']===_0x202088['attemptId']);if(_0x18ce0f){const _0x4ca4f1=_0x18ce0f[_0x41b9bc(0x21d)]?.['name']||'?',_0x5b65c5=_0x18ce0f[_0x41b9bc(0x169)]?.[_0x41b9bc(0x231)]||'?';console[_0x41b9bc(0x25d)](_0x41b9bc(0x1e6)+a54_0x26125e['dim'](_0x4ca4f1)+',\x20Workflow:\x20'+a54_0x26125e['dim'](_0x5b65c5));}const _0x76427e=new WorkflowTimelineCommand();await _0x76427e[_0x41b9bc(0x256)]({'args':[],'options':{..._0x243956,'attemptId':_0x202088[_0x41b9bc(0x28e)]},'tdx':_0x5ae6fc});}[a54_0x54edc0(0x195)](_0x37cbe7,_0x495b3a){const _0x44658d=a54_0x54edc0,_0x6d4b2d=new Map();for(const _0x513733 of _0x37cbe7){_0x513733['id']&&_0x513733['lastAttempt']?.['id']&&_0x6d4b2d[_0x44658d(0x11e)](_0x513733['id'],_0x513733['lastAttempt']['id']);}const _0x3930a8=[];let _0x13220f='';const _0x25cf8d=this['renderSessionsTimeline'](_0x37cbe7,_0x495b3a),_0x138877=_0x25cf8d['split']('\x0a');for(const _0x3048c1 of _0x138877){if(_0x3048c1[_0x44658d(0x2b0)](_0x44658d(0x1b5))||_0x3048c1[_0x44658d(0x153)](/^\s+\d{4}-\d{2}-\d{2}/))_0x13220f=_0x3048c1;else{if(_0x3048c1['match'](/^[✅❌🔄🛑⏳]/)){const _0x587f07=_0x3048c1[_0x44658d(0x153)](/#(\d+)/),_0x1eb19b=_0x587f07?_0x587f07[0x1]:null,_0x2791c8=_0x1eb19b?_0x6d4b2d[_0x44658d(0x298)](_0x1eb19b)||null:null,_0x1da8d0=_0x37cbe7[_0x44658d(0x1b0)](_0xd3a951=>_0xd3a951['id']===_0x1eb19b),_0x42baaa=_0x1da8d0?.[_0x44658d(0x21d)]?.['name']||'';_0x3930a8['push']({'displayLine':_0x3048c1,'attemptId':_0x2791c8,'projectName':_0x42baaa});}}}return{'timelineRows':_0x3930a8,'timeAxisHeader':_0x13220f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a54_0x54edc0(0x26a)]='List\x20workflow\x20attempts';async[a54_0x54edc0(0x256)](_0x1bdd1a){const _0x2a773b=a54_0x54edc0,{options:_0x3b9be3,args:_0x3eadf1,tdx:_0x3ff8dc}=_0x1bdd1a,_0x3fa731=this[_0x2a773b(0x124)](_0x3eadf1,_0x3b9be3);if(!_0x3fa731)return 0x1;const {projectName:_0x5d5783,workflowName:_0x265dc5}=_0x3fa731,_0x5aee57=_0x3b9be3[_0x2a773b(0x1d4)];if(_0x3b9be3[_0x2a773b(0x1f9)]){if(_0x5d5783&&_0x265dc5)console[_0x2a773b(0x279)](_0x2a773b(0x2a7)+_0x5d5783+'.'+_0x265dc5);else _0x5d5783&&console[_0x2a773b(0x279)](_0x2a773b(0x22e)+_0x5d5783);_0x5aee57&&console['error'](_0x2a773b(0x158));}const _0x56d522=await withSpinner(_0x2a773b(0x22b),()=>_0x3ff8dc[_0x2a773b(0x169)][_0x2a773b(0x283)]({'projectName':_0x5d5783,'workflowName':_0x265dc5,'includeRetried':_0x5aee57,'limit':_0x3b9be3['limit']}),{'verbose':_0x3b9be3[_0x2a773b(0x1f9)]}),_0x31fb1e=_0x56d522[_0x2a773b(0x199)],_0x192321=_0x3b9be3['limit']||0x64,_0x1aed8f=_0x31fb1e[_0x2a773b(0x274)]>=_0x192321?a54_0x26125e['dim'](_0x2a773b(0x24b)):'';console[_0x2a773b(0x279)](_0x2a773b(0x272)+_0x31fb1e[_0x2a773b(0x274)]+_0x2a773b(0x221)+(_0x31fb1e[_0x2a773b(0x274)]!==0x1?'s':'')+_0x1aed8f);if(_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x11d)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x245)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x1c2))await handleSDKOutput(_0x31fb1e,_0x3b9be3);else{if(_0x31fb1e['length']===0x0){if(_0x5d5783&&_0x265dc5)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5d5783+'.'+_0x265dc5);else _0x5d5783?console[_0x2a773b(0x25d)](_0x2a773b(0x126)+_0x5d5783):console[_0x2a773b(0x25d)](_0x2a773b(0x1df));}else{const _0x391173=_0x3b9be3[_0x2a773b(0x232)],_0x42f063=_0x31fb1e['map'](_0x82a4b=>{const _0x5b9e29=_0x2a773b,_0x4e3fe1=a54_0x26125e[_0x5b9e29(0x13e)]('#'+_0x82a4b['id']),_0x305432=_0x82a4b[_0x5b9e29(0x21d)]?.['id'],_0x11c8d7=_0x82a4b[_0x5b9e29(0x1cd)]||_0x82a4b[_0x5b9e29(0x1fe)],_0x460016=_0x305432&&_0x11c8d7?hyperlink(_0x4e3fe1,getWorkflowAttemptUrl(_0x391173,_0x305432,_0x11c8d7,_0x82a4b['id'])):_0x4e3fe1,{icon:_0x23efc9,text:_0x1b3ba6}=getAttemptStatusDisplay(_0x82a4b),_0x144f12=(_0x82a4b[_0x5b9e29(0x21d)]?.[_0x5b9e29(0x231)]||'?')+'.'+(_0x82a4b['workflow']?.[_0x5b9e29(0x231)]||'?'),_0x150ecb=_0x82a4b[_0x5b9e29(0x2b9)]?a54_0x26125e[_0x5b9e29(0x13e)](_0x82a4b[_0x5b9e29(0x2b9)]):'';return(_0x460016+'\x20'+_0x23efc9+(_0x1b3ba6?'\x20'+_0x1b3ba6:'')+'\x20'+_0x144f12+'\x20'+_0x150ecb)[_0x5b9e29(0x14f)]();});await writeOutput(_0x42f063[_0x2a773b(0x2a6)]('\x0a'),_0x3b9be3[_0x2a773b(0x2c5)],_0x2a773b(0x222));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x265);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x28f);async[a54_0x54edc0(0x256)](_0x10c8e5){const _0x1033b5=a54_0x54edc0,{options:_0x5e9ed7,args:_0xc853cf,tdx:_0x87972d}=_0x10c8e5,_0x3d0c46=_0xc853cf[0x0];if(!_0x3d0c46)return console[_0x1033b5(0x279)](_0x1033b5(0x1bd)),0x1;_0x5e9ed7[_0x1033b5(0x1f9)]&&console[_0x1033b5(0x279)]('Attempt\x20ID:\x20'+_0x3d0c46);const _0x56c9e5=await withSpinner(_0x1033b5(0x1b4),()=>_0x87972d[_0x1033b5(0x169)][_0x1033b5(0x164)](_0x3d0c46),{'verbose':_0x5e9ed7[_0x1033b5(0x1f9)]}),_0x2f0931=_0x56c9e5[_0x1033b5(0x199)];let _0x3fc289;!_0x2f0931['done']?_0x3fc289=_0x2f0931[_0x1033b5(0x1f3)]?_0x1033b5(0x17d):_0x1033b5(0x187):_0x3fc289=_0x2f0931[_0x1033b5(0x2bb)]?_0x1033b5(0x2bb):'error';let _0x132d0b;if(_0x2f0931['createdAt']&&_0x2f0931[_0x1033b5(0x16e)]){const _0x11119a=new Date(_0x2f0931[_0x1033b5(0x145)])[_0x1033b5(0x284)](),_0x950d0b=new Date(_0x2f0931['finishedAt'])[_0x1033b5(0x284)]();_0x132d0b=Math['round']((_0x950d0b-_0x11119a)/0x3e8);}const _0x3ddb97={'attempt_id':_0x2f0931['id'],'status':_0x3fc289,..._0x2f0931[_0x1033b5(0x1e5)]!==undefined&&{'index':_0x2f0931[_0x1033b5(0x1e5)]},..._0x2f0931[_0x1033b5(0x21d)]&&{'project':_0x2f0931[_0x1033b5(0x21d)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x169)]&&{'workflow':_0x2f0931[_0x1033b5(0x169)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x1fe)]&&{'session_id':_0x2f0931[_0x1033b5(0x1fe)]},..._0x2f0931[_0x1033b5(0x2b9)]&&{'session_time':_0x2f0931[_0x1033b5(0x2b9)]},..._0x2f0931['retryAttemptName']&&{'retry_attempt':_0x2f0931['retryAttemptName']},..._0x132d0b!==undefined&&{'duration_sec':_0x132d0b},..._0x2f0931[_0x1033b5(0x145)]&&{'created_at':_0x2f0931[_0x1033b5(0x145)]},..._0x2f0931[_0x1033b5(0x16e)]&&{'finished_at':_0x2f0931['finishedAt']},...Object[_0x1033b5(0x257)](_0x2f0931[_0x1033b5(0x29a)])[_0x1033b5(0x274)]>0x0&&{'params':_0x2f0931[_0x1033b5(0x29a)]}};return await handleSingleObjectOutput(_0x3ddb97,_0x5e9ed7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1a2);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x2ad);async[a54_0x54edc0(0x256)](_0x1bf582){const _0x24a480=a54_0x54edc0,{options:_0x38fc54,args:_0x27615f,tdx:_0x3dcbe4}=_0x1bf582,_0x33ed06=_0x27615f[0x0];if(!_0x33ed06)return console['error'](_0x24a480(0x1bd)),0x1;const _0x27f08c=_0x38fc54[_0x24a480(0x141)];_0x38fc54[_0x24a480(0x1f9)]&&(console[_0x24a480(0x279)](_0x24a480(0x123)+_0x33ed06),_0x27f08c&&console['error'](_0x24a480(0x251)));const _0x515f64=await withSpinner(_0x24a480(0x1e3),()=>_0x3dcbe4['workflow'][_0x24a480(0x1a3)](_0x33ed06,_0x27f08c||![]),{'verbose':_0x38fc54[_0x24a480(0x1f9)]}),_0x552726=_0x515f64[_0x24a480(0x199)];return console[_0x24a480(0x279)](_0x24a480(0x272)+_0x552726[_0x24a480(0x274)]+_0x24a480(0x1bb)+(_0x552726[_0x24a480(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x552726,_0x38fc54),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:logs';['description']=a54_0x54edc0(0x171);async[a54_0x54edc0(0x256)](_0x37526d){const _0x3cd8b5=a54_0x54edc0,{options:_0x37e9e2,args:_0x336e44,tdx:_0x59d221}=_0x37526d,_0x54a338=_0x336e44[0x0];let _0x4db88e=_0x336e44[0x1];if(!_0x54a338)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x1bd)),0x1;_0x37e9e2[_0x3cd8b5(0x1f9)]&&(console[_0x3cd8b5(0x279)](_0x3cd8b5(0x123)+_0x54a338),_0x4db88e&&console[_0x3cd8b5(0x279)](_0x3cd8b5(0x220)+_0x4db88e));const _0x26037e=await withSpinner(_0x3cd8b5(0x165),()=>_0x59d221[_0x3cd8b5(0x169)][_0x3cd8b5(0x1bf)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x340360=_0x26037e['data'];if(_0x340360[_0x3cd8b5(0x274)]===0x0)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x26f)),0x0;if(!_0x4db88e&&(_0x37e9e2[_0x3cd8b5(0x11d)]||_0x37e9e2[_0x3cd8b5(0x185)]))return await handleSDKOutput(_0x340360,_0x37e9e2),0x0;if(!_0x4db88e){const _0x38a27d=_0x340360[_0x3cd8b5(0x136)](_0x27a32e=>({'title':_0x27a32e[_0x3cd8b5(0x14a)]+'\x20('+formatBytes(_0x27a32e[_0x3cd8b5(0x28d)])+')','value':_0x27a32e['taskName']})),_0x4a2cdf=await a54_0x1aee3d({'type':_0x3cd8b5(0x1b3),'name':_0x3cd8b5(0x14c),'message':_0x3cd8b5(0x27b),'choices':_0x38a27d});if(!_0x4a2cdf['task'])return console['error']('Cancelled'),0x0;_0x4db88e=_0x4a2cdf[_0x3cd8b5(0x14c)];}const _0x262f64=await withSpinner(_0x3cd8b5(0x268),()=>_0x59d221['workflow'][_0x3cd8b5(0x229)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x220f05=_0x262f64[_0x3cd8b5(0x199)];return _0x220f05?console[_0x3cd8b5(0x25d)](_0x220f05):console['error'](_0x3cd8b5(0x131)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:kill';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1c9);async[a54_0x54edc0(0x256)](_0x124def){const _0x10d25a=a54_0x54edc0,{options:_0x4be135,args:_0x1a1a7f,tdx:_0x3b99df}=_0x124def,_0x23c271=_0x1a1a7f[0x0];if(!_0x23c271)return console[_0x10d25a(0x279)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x359755=_0x4be135[_0x10d25a(0x25b)];_0x4be135['verbose']&&(console['error'](_0x10d25a(0x123)+_0x23c271),_0x359755&&console[_0x10d25a(0x279)]('Reason:\x20'+_0x359755));if(!_0x4be135['yes']){if(!isInteractive())return console[_0x10d25a(0x279)](a54_0x26125e[_0x10d25a(0x16f)](_0x10d25a(0x186)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x26125e[_0x10d25a(0x13e)](_0x10d25a(0x2b3))),0x1;const _0x25d733=await confirmKey(_0x10d25a(0x23e)+_0x23c271+'?');if(!_0x25d733)return console[_0x10d25a(0x279)](a54_0x26125e['yellow'](_0x10d25a(0x1cf))),0x1;}const _0x493e01=await withSpinner('Killing\x20attempt...',()=>_0x3b99df[_0x10d25a(0x169)][_0x10d25a(0x18f)](_0x23c271,_0x359755),{'verbose':_0x4be135[_0x10d25a(0x1f9)]}),_0x2975db=_0x493e01[_0x10d25a(0x199)];return console['error']('✔\x20'+_0x2975db),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x24a);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x24e);async[a54_0x54edc0(0x256)](_0x38acc7){const _0x237497=a54_0x54edc0,{options:_0xdc28dc,args:_0x1172e6,tdx:_0x3a4250}=_0x38acc7,_0x1768a2=_0x1172e6[0x0];if(!_0x1768a2)return console[_0x237497(0x279)](_0x237497(0x176)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x507c0b=![],_0x8fa100=_0x1768a2;if(_0x1768a2[_0x237497(0x2b0)](_0x237497(0x178)))_0x507c0b=!![],_0x8fa100=_0x1768a2[_0x237497(0x1a4)](0x8);else{if(_0x1768a2[_0x237497(0x2b0)]('attempt:'))_0x507c0b=![],_0x8fa100=_0x1768a2['substring'](0x8);else return console[_0x237497(0x279)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x237497(0x137)),0x1;}const _0x3d8120=_0xdc28dc[_0x237497(0x25c)],_0x21f957=_0xdc28dc[_0x237497(0x135)],_0x14dc03=_0xdc28dc[_0x237497(0x29a)],_0x2b8e2c=_0xdc28dc[_0x237497(0x1c3)];_0xdc28dc[_0x237497(0x1f9)]&&(console[_0x237497(0x279)](_0x237497(0x144)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100),_0x3d8120&&console[_0x237497(0x279)]('From\x20task:\x20'+_0x3d8120),_0x21f957&&console[_0x237497(0x279)](_0x237497(0x260)+_0x21f957),_0x14dc03&&console[_0x237497(0x279)](_0x237497(0x155)+_0x14dc03),_0x2b8e2c&&console[_0x237497(0x279)](_0x237497(0x296)));let _0x43820e;if(_0x14dc03)try{if(_0x14dc03['startsWith']('@')){const _0x549993=await import(_0x237497(0x248)),_0x176fb6=_0x14dc03[_0x237497(0x1a4)](0x1),_0x5d915e=await _0x549993[_0x237497(0x151)](_0x176fb6,_0x237497(0x21f));_0x43820e=JSON[_0x237497(0x26d)](_0x5d915e);}else _0x43820e=JSON[_0x237497(0x26d)](_0x14dc03);}catch{return console[_0x237497(0x279)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0xdc28dc['yes']){if(!isInteractive())return console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x16f)](_0x237497(0x186)),_0x237497(0x269)),console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x13e)](_0x237497(0x2b3))),0x1;const _0x127166=await confirmKey(_0x237497(0x207)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100+'?');if(!_0x127166)return console['error'](a54_0x26125e[_0x237497(0x21c)]('Cancelled')),0x1;}let _0x4e5923;_0x507c0b?_0x4e5923=await withSpinner(_0x237497(0x2a9),()=>_0x3a4250['workflow']['retrySession'](_0x8fa100,{'fromTask':_0x3d8120,'retryParams':_0x43820e}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]}):_0x4e5923=await withSpinner(_0x237497(0x1ea),()=>_0x3a4250[_0x237497(0x169)]['retryAttempt'](_0x8fa100,{'resumeFrom':_0x21f957,'retryParams':_0x43820e,'force':_0x2b8e2c}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]});const _0x1a708b=_0x4e5923['data'];return console[_0x237497(0x279)](_0x237497(0x247)),console[_0x237497(0x279)](_0x237497(0x29d)+_0x1a708b[_0x237497(0x28e)]),console[_0x237497(0x279)]('\x20\x20Session\x20ID:\x20'+_0x1a708b['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22f);[a54_0x54edc0(0x26a)]='Start\x20a\x20workflow\x20run';async[a54_0x54edc0(0x256)](_0x1e3329){const _0x56627c=a54_0x54edc0,{options:_0x1c502a,args:_0x25a428,tdx:_0x3a85cb}=_0x1e3329;let _0x438196=_0x25a428[0x0];if(!_0x438196){const _0x263f13=this[_0x56627c(0x2bd)]([],_0x1c502a),_0x184e07=await withSpinner(_0x56627c(0x1e4),()=>_0x3a85cb[_0x56627c(0x169)][_0x56627c(0x189)](_0x263f13,{'limit':_0x1c502a[_0x56627c(0x21e)]}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x30e2df=_0x184e07[_0x56627c(0x199)];if(_0x30e2df[_0x56627c(0x274)]===0x0)return console[_0x56627c(0x279)]('No\x20workflows\x20found'),!_0x263f13&&console[_0x56627c(0x279)](a54_0x26125e['dim'](_0x56627c(0x1eb))),0x1;const _0x687d9d=_0x30e2df[_0x56627c(0x136)](_0x13c8c4=>({'title':_0x13c8c4['project']?.[_0x56627c(0x231)]+'.'+_0x13c8c4['name'],'value':_0x13c8c4[_0x56627c(0x21d)]?.[_0x56627c(0x231)]+'.'+_0x13c8c4[_0x56627c(0x231)],'description':_0x13c8c4[_0x56627c(0x235)]?_0x56627c(0x205)+_0x13c8c4[_0x56627c(0x235)]:undefined})),_0x54543b=await a54_0x1aee3d({'type':_0x56627c(0x1b3),'name':_0x56627c(0x169),'message':_0x56627c(0x17e),'choices':_0x687d9d});if(!_0x54543b[_0x56627c(0x169)])return 0x1;_0x438196=_0x54543b[_0x56627c(0x169)];}if(!_0x438196[_0x56627c(0x183)]('.')){const _0x109bb7=this[_0x56627c(0x2bd)]([],_0x1c502a);if(_0x109bb7)_0x438196=_0x109bb7+'.'+_0x438196;else return console['error'](a54_0x26125e[_0x56627c(0x16f)](_0x56627c(0x14e)),_0x56627c(0x275)),console[_0x56627c(0x279)](a54_0x26125e[_0x56627c(0x13e)](_0x56627c(0x1eb))),0x1;}const _0x1e7785=_0x1c502a[_0x56627c(0x271)],_0x44cd83=_0x1c502a[_0x56627c(0x2b9)],_0x1d37b9={};if(_0x1e7785&&Array[_0x56627c(0x16c)](_0x1e7785))for(const _0x1c64dc of _0x1e7785){const _0x5186ce=_0x1c64dc[_0x56627c(0x2b5)]('=');if(_0x5186ce===-0x1)return console[_0x56627c(0x279)](_0x56627c(0x1f4)+_0x1c64dc),console[_0x56627c(0x279)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1d563c=_0x1c64dc[_0x56627c(0x1a4)](0x0,_0x5186ce),_0x398349=_0x1c64dc[_0x56627c(0x1a4)](_0x5186ce+0x1);try{_0x1d37b9[_0x1d563c]=JSON[_0x56627c(0x26d)](_0x398349);}catch{_0x1d37b9[_0x1d563c]=_0x398349;}}_0x1c502a[_0x56627c(0x1f9)]&&(console[_0x56627c(0x279)](_0x56627c(0x12a)+_0x438196),Object[_0x56627c(0x257)](_0x1d37b9)['length']>0x0&&console[_0x56627c(0x279)](_0x56627c(0x1b8)+JSON['stringify'](_0x1d37b9)),_0x44cd83&&console[_0x56627c(0x279)](_0x56627c(0x13c)+_0x44cd83));const _0x52fcac=await withSpinner(_0x56627c(0x297),()=>_0x3a85cb[_0x56627c(0x169)]['run'](_0x438196,_0x1d37b9,{'sessionTime':_0x44cd83}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x39ba60=_0x52fcac[_0x56627c(0x199)];console['error'](_0x56627c(0x20a)),console[_0x56627c(0x279)]('\x20\x20Attempt\x20ID:\x20'+_0x39ba60['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x39ba60[_0x56627c(0x1fe)]),console[_0x56627c(0x279)](_0x56627c(0x29b)+_0x39ba60[_0x56627c(0x21d)]?.['name']),console[_0x56627c(0x279)](_0x56627c(0x14b)+_0x39ba60[_0x56627c(0x169)]?.[_0x56627c(0x231)]);if(_0x39ba60[_0x56627c(0x21d)]?.['id']&&_0x39ba60['sessionId']&&_0x39ba60['id']){const _0x504816=_0x1c502a['site'],_0x198b7f=getConsoleUrl(_0x504816,_0x56627c(0x1e0)+_0x39ba60[_0x56627c(0x21d)]['id']+_0x56627c(0x194)+_0x39ba60[_0x56627c(0x1fe)]+_0x56627c(0x179)+_0x39ba60['id']);console[_0x56627c(0x279)](_0x56627c(0x15e)+a54_0x26125e['cyan'](_0x198b7f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x21b);['description']=a54_0x54edc0(0x19c);async[a54_0x54edc0(0x256)](_0x22a6e4){const _0x4557f5=a54_0x54edc0,{options:_0x4a7912,args:_0x50df57,tdx:_0x46239c}=_0x22a6e4,_0x55f420=_0x50df57[0x0],_0x2f39a6=_0x50df57[0x1]||'.';if(!_0x55f420)return console[_0x4557f5(0x279)](_0x4557f5(0x175)),console['error'](_0x4557f5(0x1ef)),0x1;const _0x34efac=_0x4a7912['revision'];_0x4a7912['verbose']&&(console[_0x4557f5(0x279)](_0x4557f5(0x1e6)+_0x55f420),console[_0x4557f5(0x279)](_0x4557f5(0x219)+_0x2f39a6),_0x34efac&&console['error'](_0x4557f5(0x26b)+_0x34efac));const _0x326726=await withSpinner(_0x4557f5(0x1d0)+_0x55f420+_0x4557f5(0x1aa),()=>_0x46239c[_0x4557f5(0x169)][_0x4557f5(0x1f2)](_0x55f420,_0x2f39a6,{'revision':_0x34efac}),{'verbose':_0x4a7912[_0x4557f5(0x1f9)]}),_0x42a283=_0x326726[_0x4557f5(0x199)];return console[_0x4557f5(0x279)](_0x4557f5(0x1dc)+_0x42a283[_0x4557f5(0x1d7)]),console['error'](_0x4557f5(0x143)+_0x42a283['revision']),console['error']('\x20\x20Files\x20extracted:\x20'+_0x42a283[_0x4557f5(0x17c)]),console['error'](_0x4557f5(0x223)+_0x2f39a6+'/'+_0x42a283['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22c);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x125);async['execute'](_0x5f3070){const _0x3a2b6d=a54_0x54edc0,{options:_0x261b15,args:_0x5edb2d,tdx:_0x3cdfe7}=_0x5f3070;let _0x343ee1='.',_0x5aae34=_0x261b15['name'];if(_0x5edb2d[0x0]){const {promises:_0x17e4b9}=await import('fs');try{const _0xa728fd=await _0x17e4b9[_0x3a2b6d(0x1a7)](_0x5edb2d[0x0]);if(_0xa728fd[_0x3a2b6d(0x23a)]())_0x343ee1=_0x5edb2d[0x0];else return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x12c)+_0x5edb2d[0x0]+_0x3a2b6d(0x290)),0x1;}catch{_0x5aae34=_0x5edb2d[0x0],_0x343ee1='.';}}const _0xdd216=_0x261b15[_0x3a2b6d(0x235)],_0x1655e2=_0x261b15[_0x3a2b6d(0x129)];_0x261b15[_0x3a2b6d(0x1f9)]&&(console['error'](_0x3a2b6d(0x2c4)+_0x343ee1),_0x5aae34&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x27a)+_0x5aae34),_0xdd216&&console['error'](_0x3a2b6d(0x26b)+_0xdd216),_0x1655e2&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x174)));const _0xc80a4d=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3cdfe7[_0x3a2b6d(0x169)][_0x3a2b6d(0x167)](_0x343ee1,{'projectName':_0x5aae34,'revision':_0xdd216,'skipValidation':_0x1655e2}),{'verbose':_0x261b15['verbose']}),_0x31d758=_0xc80a4d[_0x3a2b6d(0x199)];return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x166)+_0x31d758[_0x3a2b6d(0x1d7)]),console[_0x3a2b6d(0x279)](_0x3a2b6d(0x2b8)+_0x31d758['projectId']),console[_0x3a2b6d(0x279)]('\x20\x20Revision:\x20'+_0x31d758['revision']),await this[_0x3a2b6d(0x140)](_0x3cdfe7,_0x31d758[_0x3a2b6d(0x1d7)],_0x261b15[_0x3a2b6d(0x232)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x54edc0(0x132);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x29f);async[a54_0x54edc0(0x256)](_0x41b0fd){const _0x51a30f=a54_0x54edc0,{options:_0x88a115,args:_0x29ad5b,tdx:_0x5bcf6b}=_0x41b0fd,_0x276015=_0x29ad5b[0x0],_0xec7cb0=_0x29ad5b[0x1];if(!_0x276015)return console[_0x51a30f(0x279)](a54_0x26125e['red'](_0x51a30f(0x14e)),_0x51a30f(0x2c0)),console['error'](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x1c6))),0x1;const _0x3e4755=_0x88a115[_0x51a30f(0x235)];_0x88a115[_0x51a30f(0x1f9)]&&(console[_0x51a30f(0x279)](_0x51a30f(0x1e6)+_0x276015),_0xec7cb0&&console[_0x51a30f(0x279)](_0x51a30f(0x1a5)+_0xec7cb0),_0x3e4755&&console['error'](_0x51a30f(0x26b)+_0x3e4755),_0x88a115[_0x51a30f(0x200)]&&console['error']('Dry\x20run:\x20yes'));const _0x21db55=await withSpinner('Pulling\x20project\x20'+_0x276015+_0x51a30f(0x1aa),()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1fb)](_0x276015,{'targetDir':_0xec7cb0,'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),_0x52265c=_0x21db55[_0x51a30f(0x199)];_0x52265c[_0x51a30f(0x24f)]?console['error'](_0x51a30f(0x1c5)+_0x52265c[_0x51a30f(0x1d7)]):console[_0x51a30f(0x279)]('→\x20Project:\x20'+_0x52265c['projectName']);console[_0x51a30f(0x279)](_0x51a30f(0x143)+_0x52265c[_0x51a30f(0x235)]),console[_0x51a30f(0x279)](_0x51a30f(0x19d)+(a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.')),console[_0x51a30f(0x279)](_0x51a30f(0x2a8)+a54_0x26125e[_0x51a30f(0x208)]('+'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x237)]+_0x51a30f(0x291))+',\x20'+(a54_0x26125e['yellow']('~'+_0x52265c['summary'][_0x51a30f(0x142)]+_0x51a30f(0x1d8))+',\x20')+(a54_0x26125e['red']('-'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x277)]+_0x51a30f(0x160))+',\x20')+(''+a54_0x26125e[_0x51a30f(0x13e)](_0x52265c['summary'][_0x51a30f(0x1ed)]+_0x51a30f(0x1a8))));for(const _0x8f73dd of _0x52265c[_0x51a30f(0x2c6)]){_0x8f73dd[_0x51a30f(0x266)]===_0x51a30f(0x142)&&_0x8f73dd[_0x51a30f(0x1e8)]&&(console[_0x51a30f(0x279)]('\x0a'+a54_0x26125e[_0x51a30f(0x1ca)]('---\x20'+_0x8f73dd['path'])),console[_0x51a30f(0x279)](_0x8f73dd[_0x51a30f(0x1e8)]));}if(!_0x52265c[_0x51a30f(0x202)])return saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x208)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x1f7)+_0x52265c[_0x51a30f(0x1d7)])),0x0;if(_0x88a115[_0x51a30f(0x200)])return console['error'](a54_0x26125e[_0x51a30f(0x21c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x88a115['yes']){if(!isInteractive())return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x16f)](_0x51a30f(0x186)),_0x51a30f(0x269)),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x2b3))),0x1;const _0x212ae2=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x212ae2)return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x21c)](_0x51a30f(0x1cf)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1e1)](_0x52265c,{'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console['error'](a54_0x26125e[_0x51a30f(0x208)]('✔\x20Pull\x20complete'));const _0x94af49=a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.';return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x223)+_0x94af49)),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x52265c['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x54edc0(0x182);['description']=a54_0x54edc0(0x2c7);async[a54_0x54edc0(0x256)](_0x354964){const _0x2262a3=a54_0x54edc0,{options:_0x4d5eff,args:_0x289ba1,tdx:_0x3ef46b}=_0x354964,_0x1a7cc2=this[_0x2262a3(0x1a1)](_0x289ba1,_0x4d5eff),_0x2aa01a=_0x4d5eff[_0x2262a3(0x235)],_0x56e2c9=_0x4d5eff['skipValidation'];_0x4d5eff[_0x2262a3(0x1f9)]&&(_0x1a7cc2&&console[_0x2262a3(0x279)](_0x2262a3(0x17f)+_0x1a7cc2),_0x2aa01a&&console['error'](_0x2262a3(0x26b)+_0x2aa01a),_0x4d5eff[_0x2262a3(0x200)]&&console[_0x2262a3(0x279)](_0x2262a3(0x15f)),_0x56e2c9&&console[_0x2262a3(0x279)]('Validation:\x20skipped'));let _0x3c5b64;try{_0x3c5b64=await withSpinner(_0x2262a3(0x147),()=>_0x3ef46b['workflow']['preparePushProject']({'sourceDir':_0x1a7cc2,'revision':_0x2aa01a,'skipValidation':_0x56e2c9}),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]});}catch(_0x205496){if(_0x205496 instanceof Error&&_0x205496[_0x2262a3(0x276)][_0x2262a3(0x183)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x16f)](_0x2262a3(0x14e)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4d5eff[_0x2262a3(0x198)]?console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x12e)+_0x4d5eff['workflowProject']+_0x2262a3(0x2ba)+_0x4d5eff[_0x2262a3(0x198)]+'\x27')):console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x261))),0x1;throw _0x205496;}const _0x3baf87=_0x3c5b64[_0x2262a3(0x199)];console['error'](_0x2262a3(0x270)+_0x3baf87[_0x2262a3(0x1d7)]),console[_0x2262a3(0x279)](_0x2262a3(0x12b)+_0x3baf87[_0x2262a3(0x206)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x3baf87['revision']),console['error'](_0x2262a3(0x2a8)+a54_0x26125e[_0x2262a3(0x208)]('+'+_0x3baf87['summary'][_0x2262a3(0x237)]+_0x2262a3(0x291))+',\x20'+(a54_0x26125e[_0x2262a3(0x21c)]('~'+_0x3baf87['summary'][_0x2262a3(0x142)]+_0x2262a3(0x1d8))+',\x20')+(a54_0x26125e[_0x2262a3(0x16f)]('-'+_0x3baf87['summary'][_0x2262a3(0x277)]+_0x2262a3(0x160))+',\x20')+(''+a54_0x26125e[_0x2262a3(0x13e)](_0x3baf87[_0x2262a3(0x163)]['unchanged']+_0x2262a3(0x1a8))));for(const _0x3ac2e8 of _0x3baf87[_0x2262a3(0x2c6)]){_0x3ac2e8[_0x2262a3(0x266)]===_0x2262a3(0x142)&&_0x3ac2e8[_0x2262a3(0x1e8)]&&(console[_0x2262a3(0x279)]('\x0a'+a54_0x26125e[_0x2262a3(0x1ca)](_0x2262a3(0x1c7)+_0x3ac2e8['path'])),console[_0x2262a3(0x279)](_0x3ac2e8[_0x2262a3(0x1e8)]));}if(!_0x3baf87['hasChanges'])return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x193))),await this[_0x2262a3(0x140)](_0x3ef46b,_0x3baf87['projectName'],_0x4d5eff[_0x2262a3(0x232)]),0x0;if(_0x4d5eff[_0x2262a3(0x200)])return console[_0x2262a3(0x279)](a54_0x26125e['yellow'](_0x2262a3(0x2a3))),0x0;if(!_0x4d5eff[_0x2262a3(0x13d)]){if(!isInteractive())return console[_0x2262a3(0x279)](a54_0x26125e['red'](_0x2262a3(0x186)),_0x2262a3(0x269)),console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16f02e=await confirmKey(_0x2262a3(0x1dd));if(!_0x16f02e)return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x21c)]('Cancelled'),_0x2262a3(0x13b)),0x1;}const _0x4cc613=await withSpinner('Pushing\x20project...',()=>_0x3ef46b[_0x2262a3(0x169)][_0x2262a3(0x18b)](_0x3baf87),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]}),_0x27883d=_0x4cc613[_0x2262a3(0x199)];return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x1bc))),console[_0x2262a3(0x279)]('\x20\x20Project\x20ID:\x20'+_0x27883d[_0x2262a3(0x152)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x27883d[_0x2262a3(0x235)]),await this[_0x2262a3(0x140)](_0x3ef46b,_0x27883d[_0x2262a3(0x1d7)],_0x4d5eff[_0x2262a3(0x232)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22d);[a54_0x54edc0(0x26a)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x54edc0(0x256)](_0x3b0f75){const _0x38746d=a54_0x54edc0,{options:_0x4e8c58,args:_0x420cba,tdx:_0x46799b}=_0x3b0f75,_0x43742f=this[_0x38746d(0x1a1)](_0x420cba,_0x4e8c58),_0x442f08=_0x4e8c58[_0x38746d(0x231)],_0x3baa72=_0x4e8c58[_0x38746d(0x235)],_0x4dd0c7=_0x4e8c58[_0x38746d(0x129)];if(!_0x43742f)return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x14e)),_0x38746d(0x1f5)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),console['error'](a54_0x26125e[_0x38746d(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x442f08)return console[_0x38746d(0x279)](a54_0x26125e['red']('Error:'),_0x38746d(0x1f0)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),0x1;_0x4e8c58['verbose']&&(console['error'](_0x38746d(0x17f)+_0x43742f),console['error'](_0x38746d(0x1ff)+_0x442f08),_0x3baa72&&console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x3baa72),_0x4e8c58[_0x38746d(0x200)]&&console[_0x38746d(0x279)](_0x38746d(0x15f)),_0x4dd0c7&&console[_0x38746d(0x279)](_0x38746d(0x174)));const _0x50730f=await withSpinner('Analyzing\x20project...',()=>_0x46799b[_0x38746d(0x169)][_0x38746d(0x253)](_0x43742f,_0x442f08,{'revision':_0x3baa72,'skipValidation':_0x4dd0c7}),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x35979e=_0x50730f['data'];console[_0x38746d(0x279)](_0x38746d(0x1af)+_0x35979e['sourceDir']);_0x35979e['sourceProjectName']&&console[_0x38746d(0x279)]('Source\x20project:\x20'+_0x35979e['sourceProjectName']);console[_0x38746d(0x279)](_0x38746d(0x1ff)+_0x35979e['newProjectName']),console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x35979e[_0x38746d(0x235)]),console[_0x38746d(0x279)](_0x38746d(0x2b4)+_0x35979e['fileCount']);_0x35979e['targetExists']&&(console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x21c)]('\x0a⚠\x20Project\x20\x22'+_0x35979e['newProjectName']+_0x38746d(0x1b9)+_0x35979e[_0x38746d(0x2af)]+')')),console[_0x38746d(0x279)](a54_0x26125e['yellow'](_0x38746d(0x259))));if(_0x4e8c58[_0x38746d(0x200)])return console['error'](a54_0x26125e['yellow'](_0x38746d(0x24d))),0x0;if(!_0x4e8c58['yes']){if(!isInteractive())return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x186)),_0x38746d(0x269)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x2b3))),0x1;const _0x441a15=_0x35979e['sourceProjectName']||a54_0x1db018[_0x38746d(0x289)](_0x43742f),_0x44a106=_0x35979e[_0x38746d(0x177)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x442f08+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x441a15+_0x38746d(0x212)+_0x442f08+'\x22?',_0x578ec1=await confirmKey(_0x44a106);if(!_0x578ec1)return console['error'](a54_0x26125e['yellow']('Cancelled')),0x1;}const _0x1192a9=await withSpinner(_0x35979e[_0x38746d(0x177)]?_0x38746d(0x1c0)+_0x442f08+_0x38746d(0x1aa):_0x38746d(0x1e2)+_0x442f08+'...',()=>_0x46799b[_0x38746d(0x169)]['executeCloneProject'](_0x35979e),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x1252e4=_0x1192a9[_0x38746d(0x199)];return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x208)](_0x35979e[_0x38746d(0x177)]?_0x38746d(0x191):_0x38746d(0x11c))),console['error'](_0x38746d(0x29b)+_0x1252e4['newProjectName']),console[_0x38746d(0x279)]('\x20\x20Project\x20ID:\x20'+_0x1252e4[_0x38746d(0x18c)]),console[_0x38746d(0x279)]('\x20\x20Revision:\x20'+_0x1252e4['revision']),await this[_0x38746d(0x140)](_0x46799b,_0x1252e4[_0x38746d(0x1b2)],_0x4e8c58[_0x38746d(0x232)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:delete';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x252);async[a54_0x54edc0(0x256)](_0xe7e749){const _0x5aacc4=a54_0x54edc0,{options:_0x2a126d,args:_0x4c1c4b,tdx:_0xe8cefb}=_0xe7e749,_0xf6ca25=_0x4c1c4b[0x0];if(!_0xf6ca25)return console[_0x5aacc4(0x279)](_0x5aacc4(0x1ec)),console[_0x5aacc4(0x279)](_0x5aacc4(0x1fc)),0x1;_0x2a126d[_0x5aacc4(0x1f9)]&&console[_0x5aacc4(0x279)]('Project:\x20'+_0xf6ca25);if(!_0x2a126d[_0x5aacc4(0x13d)]){if(!isInteractive())return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x16f)]('\x0aError:'),_0x5aacc4(0x269)),console[_0x5aacc4(0x279)](a54_0x26125e['dim'](_0x5aacc4(0x2b3))),0x1;const _0x3b4a50=await confirmKey(_0x5aacc4(0x1f1)+_0xf6ca25+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3b4a50)return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x21c)](_0x5aacc4(0x1cf))),0x1;}const _0x425285=await withSpinner(_0x5aacc4(0x1d1)+_0xf6ca25+_0x5aacc4(0x1aa),()=>_0xe8cefb[_0x5aacc4(0x169)][_0x5aacc4(0x1c1)](_0xf6ca25),{'verbose':_0x2a126d[_0x5aacc4(0x1f9)]}),_0x514590=_0x425285[_0x5aacc4(0x199)];return console['error'](_0x5aacc4(0x1de)+_0x514590[_0x5aacc4(0x1d7)]),console[_0x5aacc4(0x279)](_0x5aacc4(0x2b8)+_0x514590['projectId']),0x0;}}export function parseKeyValue(_0xa58a3e){const _0x6d1ae0=a54_0x54edc0,_0x53a1a0=_0xa58a3e[_0x6d1ae0(0x2b5)]('=');if(_0x53a1a0===-0x1)throw new Error(_0x6d1ae0(0x281)+_0xa58a3e+_0x6d1ae0(0x19f));const _0x349085=_0xa58a3e[_0x6d1ae0(0x1a4)](0x0,_0x53a1a0),_0x473d7c=_0xa58a3e[_0x6d1ae0(0x1a4)](_0x53a1a0+0x1);if(!_0x349085)throw new Error(_0x6d1ae0(0x285));return{'key':_0x349085,'value':_0x473d7c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:secrets:list';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x146);async['execute'](_0x3eb655){const _0x27b9f3=a54_0x54edc0,{options:_0x5c106c,args:_0x37accf,tdx:_0x5f0dbc}=_0x3eb655,_0x2f958c=this[_0x27b9f3(0x1ad)](_0x37accf,_0x5c106c);if(!_0x2f958c)return 0x1;_0x5c106c[_0x27b9f3(0x1f9)]&&console[_0x27b9f3(0x279)]('Project:\x20'+_0x2f958c);const _0x44a014=await withSpinner(_0x27b9f3(0x1ee),()=>_0x5f0dbc[_0x27b9f3(0x169)][_0x27b9f3(0x2ab)](_0x2f958c),{'verbose':_0x5c106c['verbose']}),{secrets:_0x51fa24}=_0x44a014['data'];return console[_0x27b9f3(0x279)]('✔\x20Found\x20'+_0x51fa24['length']+_0x27b9f3(0x1f6)+(_0x51fa24[_0x27b9f3(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x51fa24,_0x5c106c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x27f);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1ba);async[a54_0x54edc0(0x256)](_0x469658){const _0x55860b=a54_0x54edc0,{options:_0x4928e6,args:_0x5a842d,tdx:_0x1b1a28}=_0x469658;let _0x131394,_0x24b7a0;if(_0x5a842d['length']>=0x1&&!_0x5a842d[0x0][_0x55860b(0x183)]('='))_0x131394=_0x5a842d[0x0],_0x24b7a0=_0x5a842d[_0x55860b(0x12d)](0x1);else{if(_0x5a842d['length']>=0x1&&_0x4928e6[_0x55860b(0x198)])_0x131394=_0x4928e6['workflowProject'],_0x24b7a0=_0x5a842d;else return _0x5a842d[_0x55860b(0x274)]>=0x1?(console[_0x55860b(0x279)](_0x55860b(0x175)),console[_0x55860b(0x279)](_0x55860b(0x1eb)),0x1):(console[_0x55860b(0x279)](_0x55860b(0x159)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x24b7a0[_0x55860b(0x274)]===0x0)return console[_0x55860b(0x279)](_0x55860b(0x159)),console['error'](_0x55860b(0x23c)),0x1;const _0x4e5307={};try{for(const _0x2a2c83 of _0x24b7a0){const {key:_0x43a718,value:_0x14be33}=parseKeyValue(_0x2a2c83);_0x4e5307[_0x43a718]=_0x14be33;}}catch(_0x58fee3){return _0x58fee3 instanceof Error&&console['error'](a54_0x26125e[_0x55860b(0x16f)](_0x55860b(0x14e)),_0x58fee3[_0x55860b(0x276)]),0x1;}const _0x2124c4=Object['keys'](_0x4e5307);_0x4928e6['verbose']&&(console[_0x55860b(0x279)](_0x55860b(0x1e6)+_0x131394),console[_0x55860b(0x279)](_0x55860b(0x204)+_0x2124c4[_0x55860b(0x2a6)](',\x20')));const _0x46cbcf=await withSpinner(_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x17b):_0x55860b(0x255)+_0x2124c4[_0x55860b(0x274)]+_0x55860b(0x28c),()=>_0x1b1a28[_0x55860b(0x169)][_0x55860b(0x172)](_0x131394,_0x4e5307),{'verbose':_0x4928e6[_0x55860b(0x1f9)]}),_0x34fd5a=_0x46cbcf[_0x55860b(0x199)];return console[_0x55860b(0x279)](_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x22a)+_0x34fd5a['keys'][0x0]+_0x55860b(0x20e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27':'✔\x20'+_0x34fd5a[_0x55860b(0x257)][_0x55860b(0x274)]+_0x55860b(0x29e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27'),(_0x4928e6[_0x55860b(0x11d)]||_0x4928e6[_0x55860b(0x245)])&&await handleSingleObjectOutput(_0x34fd5a,_0x4928e6),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1db);['description']=a54_0x54edc0(0x20d);async[a54_0x54edc0(0x256)](_0x25a6fc){const _0x599d91=a54_0x54edc0,{options:_0x4a0646,args:_0x5dace2,tdx:_0x9903cd}=_0x25a6fc;let _0x26663c,_0x23eb8f;if(_0x5dace2[_0x599d91(0x274)]>=0x2)_0x26663c=_0x5dace2[0x0],_0x23eb8f=_0x5dace2[0x1];else{if(_0x5dace2[_0x599d91(0x274)]===0x1&&_0x4a0646['workflowProject'])_0x26663c=_0x4a0646[_0x599d91(0x198)],_0x23eb8f=_0x5dace2[0x0];else return _0x5dace2[_0x599d91(0x274)]===0x1?(console['error'](_0x599d91(0x175)),console[_0x599d91(0x279)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x599d91(0x279)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x599d91(0x279)](_0x599d91(0x233)),0x1);}_0x4a0646[_0x599d91(0x1f9)]&&(console[_0x599d91(0x279)](_0x599d91(0x1e6)+_0x26663c),console['error'](_0x599d91(0x157)+_0x23eb8f));if(!_0x4a0646[_0x599d91(0x13d)]){if(!isInteractive())return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x16f)](_0x599d91(0x186)),_0x599d91(0x269)),console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5070cb=await confirmKey(_0x599d91(0x14d)+_0x23eb8f+'\x27\x20from\x20project\x20\x27'+_0x26663c+'\x27?');if(!_0x5070cb)return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x21c)]('Cancelled')),0x1;}const _0x35498a=await withSpinner(_0x599d91(0x127),()=>_0x9903cd[_0x599d91(0x169)][_0x599d91(0x282)](_0x26663c,_0x23eb8f),{'verbose':_0x4a0646['verbose']}),_0x4aa4b2=_0x35498a[_0x599d91(0x199)];return console['error'](_0x599d91(0x22a)+_0x4aa4b2[_0x599d91(0x254)]+_0x599d91(0x24c)+_0x4aa4b2[_0x599d91(0x1d7)]+'\x27'),(_0x4a0646['json']||_0x4a0646[_0x599d91(0x245)])&&await handleSingleObjectOutput(_0x4aa4b2,_0x4a0646),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(_0xf1b246){const _0xa85092=a54_0x54edc0,_0x32571b=Math[_0xa85092(0x287)](_0xf1b246/0x3e8),_0x5eaa31=Math[_0xa85092(0x287)](_0x32571b/0x3c),_0x295777=Math['floor'](_0x5eaa31/0x3c),_0x1e37f9=Math[_0xa85092(0x287)](_0x295777/0x18);if(_0x1e37f9>0x0){const _0xda107e=_0x295777%0x18;return _0xda107e>0x0?_0x1e37f9+'d\x20'+_0xda107e+'h':_0x1e37f9+'d';}else{if(_0x295777>0x0){const _0x5e71f3=_0x5eaa31%0x3c;return _0x5e71f3>0x0?_0x295777+'h\x20'+_0x5e71f3+'m':_0x295777+'h';}else{if(_0x5eaa31>0x0){const _0x5dd69b=_0x32571b%0x3c;return _0x5dd69b>0x0?_0x5eaa31+'m\x20'+_0x5dd69b+'s':_0x5eaa31+'m';}else return _0x32571b+'s';}}}function formatTimestamp(_0x3a9fec,_0x14cb9d){const _0x17c3e1=a54_0x54edc0,_0x223656=new Date(_0x3a9fec),_0xa625c5=String(_0x223656['getHours']())[_0x17c3e1(0x1d9)](0x2,'0'),_0x3ba516=String(_0x223656[_0x17c3e1(0x148)]())[_0x17c3e1(0x1d9)](0x2,'0'),_0x5f36a5=_0xa625c5+':'+_0x3ba516,_0x59d45d=_0x223656[_0x17c3e1(0x1e9)]()===_0x14cb9d[_0x17c3e1(0x1e9)]()&&_0x223656[_0x17c3e1(0x2a5)]()===_0x14cb9d['getMonth']()&&_0x223656['getDate']()===_0x14cb9d['getDate']();if(_0x59d45d)return _0x5f36a5;else{const _0x1245db=String(_0x223656[_0x17c3e1(0x2a5)]()+0x1)[_0x17c3e1(0x1d9)](0x2,'0'),_0x9327b0=String(_0x223656[_0x17c3e1(0x2ac)]())[_0x17c3e1(0x1d9)](0x2,'0');return _0x1245db+'-'+_0x9327b0+'\x20'+_0x5f36a5;}}function formatDate(_0x4da9fb){const _0x5cf475=a54_0x54edc0,_0x4eeceb=_0x4da9fb['getFullYear'](),_0x4a33e7=String(_0x4da9fb[_0x5cf475(0x2a5)]()+0x1)['padStart'](0x2,'0'),_0x2197fd=String(_0x4da9fb[_0x5cf475(0x2ac)]())[_0x5cf475(0x1d9)](0x2,'0');return _0x4eeceb+'-'+_0x4a33e7+'-'+_0x2197fd;}function getTaskStateIcon(_0x155e63){const _0x3cb651={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3cb651[_0x155e63]||'⚪';}function getBarChar(_0x5295fa){const _0x291f48=a54_0x54edc0;return _0x5295fa===_0x291f48(0x279)||_0x5295fa===_0x291f48(0x1cc)?'×':'─';}function getBarColor(_0x3af35b){const _0xaa4b8=a54_0x54edc0,_0x262b93={'success':a54_0x26125e[_0xaa4b8(0x208)],'error':a54_0x26125e[_0xaa4b8(0x16f)],'group_error':a54_0x26125e[_0xaa4b8(0x16f)],'running':a54_0x26125e[_0xaa4b8(0x154)],'blocked':a54_0x26125e[_0xaa4b8(0x21c)],'planned':a54_0x26125e[_0xaa4b8(0x13e)],'canceling':a54_0x26125e[_0xaa4b8(0x21c)]};return _0x262b93[_0x3af35b]||a54_0x26125e['white'];}function parseTaskName(_0x3294db){const _0x1ecc7e=a54_0x54edc0;let _0x170d5e=_0x3294db[_0x1ecc7e(0x249)](/^\++/,'');const _0x49e5d6=_0x170d5e[_0x1ecc7e(0x210)]('+'),_0x3ad7aa=_0x49e5d6[_0x1ecc7e(0x274)]>0x1?_0x49e5d6[_0x1ecc7e(0x274)]-0x2:0x0,_0x1b99c9=_0x49e5d6[_0x49e5d6[_0x1ecc7e(0x274)]-0x1]||_0x170d5e;return{'level':_0x3ad7aa,'name':'+'+_0x1b99c9};}function truncateTaskName(_0x48014a,_0x31ba96){const _0x3ae546=a54_0x54edc0,_0x5867d5=stringWidth(_0x48014a);if(_0x5867d5<=_0x31ba96)return _0x48014a;let _0x25cf80=_0x48014a;while(stringWidth(_0x25cf80+'…')>_0x31ba96&&_0x25cf80['length']>0x0){_0x25cf80=_0x25cf80[_0x3ae546(0x12d)](0x0,-0x1);}return _0x25cf80+'…';}function a54_0x11ab(){const _0x4bc28d=['No\x20sessions\x20with\x20timing\x20information','pollTimeline','\x20project','MAX_TASKS_DISPLAY','jsonl','updatedAt','✔\x20Retry\x20started','fs/promises','replace','workflow:retry','\x20(use\x20--limit\x20to\x20show\x20more)','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aDry\x20run\x20-\x20no\x20project\x20created','Retry\x20a\x20session\x20or\x20attempt','isNewProject','autocomplete','Including\x20subtasks:\x20yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','prepareCloneProject','key','Setting\x20','execute','keys','repeat','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','reason','fromTask','log','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','List\x20all\x20workflow\x20projects','Resume\x20from:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projects','\x20logs','Auto-selected\x20latest\x20session:\x20','workflow:attempt','type','localeCompare','Downloading\x20logs...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','Revision:\x20','MIN_LABEL_COUNT','parse','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','param','✔\x20Found\x20','No\x20projects\x20match\x20pattern:\x20','length','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','message','deleted','duration','error','Project\x20name:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Warning:','session','3382008dDMdcx','workflow:secrets:set','120AgmVZC','Invalid\x20format:\x20','deleteSecret','attempts','getTime','Key\x20cannot\x20be\x20empty','toLowerCase','floor','📋\x20','basename','Failed\x20to\x20fetch\x20attempt\x20data','fill','\x20secrets...','fileSize','attemptId','Show\x20specific\x20attempt\x20details','\x20is\x20not\x20a\x20directory','\x20new','MAX_LABEL_COUNT','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflows\x20found\x20in\x20project:\x20','Listing\x20workflows...','Force:\x20yes','Starting\x20workflow\x20run...','get','6211542goQydR','params','\x20\x20Project:\x20','Total:\x20','\x20\x20New\x20attempt\x20ID:\x20','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','Listing\x20workflow\x20sessions...','msPerChar','cwd','\x0aDry\x20run\x20-\x20nothing\x20pushed','TASK_NAME_WIDTH','getMonth','join','Filter:\x20','\x20\x20Changes:\x20','Retrying\x20session...','has','listSecrets','getDate','Show\x20tasks\x20for\x20an\x20attempt','27420VJsTkm','existingProjectId','startsWith','📁\x20','260694maaxJv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Files\x20to\x20upload:\x20','indexOf','7qHdGgQ','lastAttempt','\x20\x20Project\x20ID:\x20','sessionTime','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','success','window','resolveProject','now','40WyvFSI','Project\x20name\x20is\x20required','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20-\x20','columns','Project\x20directory:\x20','output','changes','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Usage:\x20tdx\x20wf\x20use\x20<project>','context','No\x20sessions\x20found','✔\x20Clone\x20complete','json','set','\x20from\x20session\x20','targetDir','min','renderSingleTimeline','Attempt\x20ID:\x20','parseProjectWorkflowPattern','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','No\x20attempts\x20found\x20in\x20project:\x20','Deleting\x20secret...','buildTimelineData','skipValidation','Workflow:\x20','\x20\x20Source:\x20','Error:\x20','slice','Tip:\x20cd\x20to\x20workflows/','renderTimeline','No\x20matching\x20sessions\x20found','No\x20log\x20content\x20found','workflow:pull','MIN_TIMELINE_WIDTH','108272UmcDlN','resumeFrom','map','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20projects...','toISOString','No\x20sessions\x20found\x20for:\x20','-\x20nothing\x20pushed','Session\x20time:\x20','yes','dim','13OEJKyF','showWorkflowConsoleUrl','includeSubtasks','modified','\x20\x20Revision:\x20','Target:\x20','createdAt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Analyzing\x20changes...','getMinutes','731296xwfCGG','taskName','\x20\x20Workflow:\x20','task','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Error:','trimEnd','Loading\x20session...','readFile','projectId','match','blue','Params:\x20','status','Key:\x20','Include\x20retried:\x20yes','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20of\x20','List\x20workflow\x20execution\x20sessions','write','\x20tasks','\x20\x20Console:\x20','Dry\x20run:\x20yes','\x20deleted','planned','ICON_WIDTH','summary','attempt','Fetching\x20log\x20files...','✔\x20Pushed\x20','push','all','workflow','fullName','follow','isArray','state','finishedAt','red','isTTY','Show\x20logs\x20for\x20a\x20workflow\x20attempt','setSecrets','sessions','Validation:\x20skipped','Error:\x20Project\x20name\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','targetExists','session:','/attempt/','No\x20workflow\x20sessions\x20found','Setting\x20secret...','filesExtracted','canceling','Select\x20a\x20workflow\x20to\x20run','Source\x20directory:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','List\x20workflows','workflow:push','includes','relative','format','\x0aError:','running','done','workflows','💡\x20Tip:\x20Use\x20','executePushProject','newProjectId','MAX_POLL_ITERATIONS','30576096WHWMqy','kill','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Project\x20updated','resolveProjectId','\x0a✔\x20No\x20changes\x20to\x20push','/sessions/','generateSessionTimelineRows','Using\x20attempt\x20','6083lreGkV','workflowProject','data','2uieVZP','Status:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Target:\x20','end','.\x20Expected\x20format:\x20KEY=VALUE','\x20to\x20see\x20detailed\x20logs','resolveProjectDir','workflow:tasks','tasks','substring','Target\x20directory:\x20','pending','stat','\x20unchanged','\x0aFailed\x20to\x20fetch\x20attempt\x20data','...','\x20session','Pattern:\x20','requireProject','startedAt','Source:\x20','find','ICON_SPACING','newProjectName','select','Getting\x20attempt\x20details...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','icon','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Parameters:\x20','\x22\x20already\x20exists\x20(ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20task','✔\x20Push\x20complete','Error:\x20Attempt\x20ID\x20is\x20required','workflowName','logFiles','Updating\x20','delete','table','force','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','→\x20New\x20project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','---\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Kill\x20a\x20running\x20attempt','cyan','Select\x20a\x20session\x20to\x20view\x20timeline:','group_error','session_id','stdout','Cancelled','Downloading\x20project\x20','Deleting\x20project\x20','\x1b[1A\x1b[2K','displayLine','includeRetried','navigateSessionsInteractive','renderSessionsTimeline','projectName','\x20modified','padStart','size','workflow:secrets:delete','✔\x20Downloaded\x20','\x0aPush\x20these\x20changes?','✔\x20Deleted\x20project\x20','No\x20attempts\x20found','/app/workflows/','applyPullProject','Cloning\x20to\x20','Getting\x20attempt\x20tasks...','Loading\x20workflows...','index','Project:\x20','text','diff','getFullYear','Retrying\x20attempt...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','unchanged','Listing\x20secrets...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','download','cancelRequested','Error:\x20Invalid\x20parameter\x20format:\x20','Source\x20directory\x20is\x20required','\x20secret','\x20\x20Session\x20context\x20set\x20to:\x20','sort','verbose','startTime','pullProject','Usage:\x20workflow:delete\x20<project-name-or-id>','Resolving\x20project\x20\x27','sessionId','New\x20project\x20name:\x20','dryRun','(use\x20--limit\x20to\x20see\x20more)','hasChanges','\x0aPolling...\x20(','Secrets\x20to\x20set:\x20','revision:\x20','sourceDir','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','green','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','✔\x20Workflow\x20run\x20started','rows','\x20\x20tdx\x20wf\x20use\x20<project>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','MAX_TIMELINE_WIDTH','split','values','\x22\x20to\x20new\x20project\x20\x22','from','unknown','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x27...','filter','start','Output\x20directory:\x20','No\x20sessions\x20found\x20in\x20project:\x20','workflow:download','yellow','project','limit','utf-8','Task\x20name:\x20','\x20attempt','list','\x20\x20Location:\x20','max','durationMs','Latest\x20session\x20has\x20no\x20attempt','every','title','logs','✔\x20Secret\x20\x27','Listing\x20workflow\x20attempts...','workflow:upload','workflow:clone','Filter:\x20project=','workflow:run','\x20(system)','name','site','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','trim','revision','resolve','new','\x20workflow','splice','isDirectory','\x0a✔\x20Attempt\x20complete','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','clear','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','sys','⚠\x20Showing\x20first\x20'];a54_0x11ab=function(){return _0x4bc28d;};return a54_0x11ab();}function calculateTimeScale(_0x2cd2b4,_0x2baed1){const _0x427eb4=a54_0x54edc0;return{'startTime':_0x2cd2b4['start'],'endTime':_0x2cd2b4['end'],'durationMs':_0x2cd2b4['duration'],'msPerChar':_0x2cd2b4[_0x427eb4(0x278)]/_0x2baed1};}function timeToPosition(_0x5e73bb,_0x50e390,_0x24362e){const _0x46cb67=a54_0x54edc0,_0x49ad19=_0x5e73bb-_0x50e390['startTime'],_0x3e63ca=Math[_0x46cb67(0x287)](_0x49ad19/_0x50e390[_0x46cb67(0x2a1)]);return Math[_0x46cb67(0x224)](0x0,Math['min'](_0x3e63ca,_0x24362e));}function renderTimeAxis(_0x537da9,_0x307343){const _0x5c49cd=a54_0x54edc0,_0x53b249=Math[_0x5c49cd(0x121)](TIMELINE_CONFIG[_0x5c49cd(0x292)],Math[_0x5c49cd(0x224)](TIMELINE_CONFIG[_0x5c49cd(0x26c)],Math[_0x5c49cd(0x287)](_0x307343/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x42ca88=_0x537da9[_0x5c49cd(0x225)]/(_0x53b249-0x1),_0x175462=new Date(_0x537da9[_0x5c49cd(0x1fa)]),_0x569ea4=[];for(let _0x10caf4=0x0;_0x10caf4<_0x53b249;_0x10caf4++){const _0x1a8f29=_0x537da9['startTime']+_0x10caf4*_0x42ca88,_0x298204=timeToPosition(_0x1a8f29,_0x537da9,_0x307343),_0x31b4b5=formatTimestamp(_0x1a8f29,_0x175462);_0x569ea4[_0x5c49cd(0x167)]({'pos':_0x298204,'text':_0x31b4b5});}const _0x5b38f9=new Array(_0x307343)[_0x5c49cd(0x28b)]('\x20');let _0x314bdc=-0x1;for(const {pos:_0xbec1e4,text:_0x33b354}of _0x569ea4){let _0x186ae4=Math['max'](0x0,_0xbec1e4-Math[_0x5c49cd(0x287)](_0x33b354[_0x5c49cd(0x274)]/0x2));_0x186ae4<=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x186ae4=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x186ae4+_0x33b354['length']>_0x307343&&(_0x186ae4=_0x307343-_0x33b354['length']);if(_0x186ae4>=0x0&&_0x186ae4+_0x33b354[_0x5c49cd(0x274)]<=_0x307343&&_0x186ae4>_0x314bdc){for(let _0x421de3=0x0;_0x421de3<_0x33b354[_0x5c49cd(0x274)];_0x421de3++){_0x5b38f9[_0x186ae4+_0x421de3]=_0x33b354[_0x421de3];}_0x314bdc=_0x186ae4+_0x33b354[_0x5c49cd(0x274)]-0x1;}}return _0x5b38f9[_0x5c49cd(0x2a6)]('');}function renderTaskRow(_0x9c78fd,_0x363876,_0x3a7aa9,_0x547e8f){const _0x2bf97f=a54_0x54edc0,{level:_0x7fb029,name:_0x54ced3}=parseTaskName(_0x9c78fd[_0x2bf97f(0x231)]),_0xa4a1a5='\x20'[_0x2bf97f(0x258)](_0x7fb029),_0x5e6f5e=_0x9c78fd[_0x2bf97f(0x2bc)]?'('+formatElapsed(_0x9c78fd[_0x2bf97f(0x2bc)][_0x2bf97f(0x278)])+')':'',_0x310eac=stringWidth(_0x5e6f5e),_0x33886b=_0x7fb029*0x1,_0x21db54=_0x547e8f-_0x33886b-_0x310eac-0x1,_0x13b399=truncateTaskName(_0x54ced3,_0x21db54),_0x7fcf2a=_0xa4a1a5+_0x13b399,_0xd07a2a=stringWidth(_0x7fcf2a),_0x39ded4=_0x547e8f-_0xd07a2a-_0x310eac,_0x54a427=_0x7fcf2a+'\x20'[_0x2bf97f(0x258)](Math['max'](0x1,_0x39ded4))+a54_0x26125e['dim'](_0x5e6f5e),_0x1f74af=getTaskStateIcon(_0x9c78fd[_0x2bf97f(0x16d)]),_0x21e461=new Array(_0x3a7aa9)[_0x2bf97f(0x28b)]('\x20');if(_0x9c78fd['window']){const _0xb5cfb0=timeToPosition(_0x9c78fd[_0x2bf97f(0x2bc)]['start'],_0x363876,_0x3a7aa9),_0x5cc4e4=timeToPosition(_0x9c78fd['window'][_0x2bf97f(0x19e)],_0x363876,_0x3a7aa9),_0x439a40=getBarChar(_0x9c78fd['state']),_0xcf5dbd=Math[_0x2bf97f(0x224)](_0xb5cfb0+0x1,_0x5cc4e4);for(let _0x3bb19e=_0xb5cfb0;_0x3bb19e<Math[_0x2bf97f(0x121)](_0xcf5dbd,_0x3a7aa9);_0x3bb19e++){_0x21e461[_0x3bb19e]=_0x439a40;}}const _0x17cc1b=getBarColor(_0x9c78fd[_0x2bf97f(0x16d)]),_0x30a268=_0x21e461[_0x2bf97f(0x136)](_0x59b302=>_0x59b302==='\x20'?'\x20':_0x17cc1b(_0x59b302))['join']('');return _0x1f74af+'\x20'+_0x54a427+'│'+_0x30a268+'│';}function calculateStats(_0x58f735){const _0x1e565d=a54_0x54edc0,_0x8eb6ca={'total':_0x58f735[_0x1e565d(0x274)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2bfc67 of _0x58f735){if(_0x2bfc67['state']===_0x1e565d(0x2bb))_0x8eb6ca['success']++;else{if(_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x279)||_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x1cc))_0x8eb6ca[_0x1e565d(0x279)]++;else _0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x187)?_0x8eb6ca[_0x1e565d(0x187)]++:_0x8eb6ca[_0x1e565d(0x1a6)]++;}}return _0x8eb6ca;}function formatStats(_0x580882){const _0x3b3773=a54_0x54edc0;return[_0x3b3773(0x29c)+_0x580882['total'],'✅\x20'+_0x580882[_0x3b3773(0x2bb)],'❌\x20'+_0x580882[_0x3b3773(0x279)],'🔄\x20'+_0x580882[_0x3b3773(0x187)],'⏳\x20'+_0x580882[_0x3b3773(0x1a6)]][_0x3b3773(0x2a6)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:timeline';['description']=a54_0x54edc0(0x293);async['execute'](_0x20f606){const _0x150fc0=a54_0x54edc0,{options:_0x428b3e,args:_0x266855,tdx:_0x34fc41}=_0x20f606;let _0xd49f4d,_0x1db12,_0x506bc2=![];if(_0x266855[0x0]){if(_0x266855[0x0][_0x150fc0(0x183)]('.')){const _0x3bf6d7=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x3bf6d7)return 0x1;_0xd49f4d=_0x3bf6d7[_0x150fc0(0x1d7)],_0x1db12=_0x3bf6d7[_0x150fc0(0x1be)];}else{_0x1db12=_0x266855[0x0],_0xd49f4d=_0x428b3e[_0x150fc0(0x198)];if(!_0xd49f4d)return console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x16f)]('Error:'),_0x150fc0(0x180)),0x1;_0x506bc2=!![];}}else{const _0x135ece=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x135ece)return 0x1;_0xd49f4d=_0x135ece['projectName'],_0x1db12=_0x135ece['workflowName'];}if(_0x428b3e['verbose']){if(_0xd49f4d&&_0x1db12)console['error']('Filter:\x20'+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d&&console[_0x150fc0(0x279)](_0x150fc0(0x22e)+_0xd49f4d);}const _0x162520=_0x428b3e[_0x150fc0(0x28e)],_0x25cc4d=_0x428b3e[_0x150fc0(0x1fe)];if(_0x162520){_0x25cc4d&&console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x21c)](_0x150fc0(0x27c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x5435fa=_0x428b3e[_0x150fc0(0x16b)];return _0x5435fa?await this[_0x150fc0(0x242)](_0x20f606,_0x162520):await this[_0x150fc0(0x122)](_0x20f606,_0x162520,_0x428b3e),0x0;}if(_0x25cc4d){const _0x187707=await withSpinner(_0x150fc0(0x150),()=>_0x34fc41['workflow'][_0x150fc0(0x173)]({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':0x64}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x5b5074=_0x187707[_0x150fc0(0x199)][_0x150fc0(0x1b0)](_0x2082f2=>_0x2082f2['id']===_0x25cc4d);if(!_0x5b5074)return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20not\x20found:\x20'+_0x25cc4d),0x1;if(!_0x5b5074[_0x150fc0(0x2b7)]?.['id'])return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20'+_0x25cc4d+'\x20has\x20no\x20attempts'),0x1;const _0x54fc18=_0x5b5074[_0x150fc0(0x2b7)]['id'];_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x196)+_0x54fc18+_0x150fc0(0x11f)+_0x25cc4d);const _0x2b2bd1=_0x428b3e[_0x150fc0(0x16b)];return _0x2b2bd1?await this[_0x150fc0(0x242)](_0x20f606,_0x54fc18):await this['renderSingleTimeline'](_0x20f606,_0x54fc18,_0x428b3e),0x0;}const _0x42ebdc=await withSpinner('Loading\x20sessions...',()=>_0x34fc41['workflow']['sessions']({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':_0x428b3e[_0x150fc0(0x21e)]||0x32}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x3885a6=_0x42ebdc[_0x150fc0(0x199)];if(_0x3885a6[_0x150fc0(0x274)]===0x0){if(_0xd49f4d&&_0x1db12)console[_0x150fc0(0x279)](_0x150fc0(0x13a)+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d?console[_0x150fc0(0x279)](_0x150fc0(0x21a)+_0xd49f4d):(console[_0x150fc0(0x279)](_0x150fc0(0x17a)),console[_0x150fc0(0x279)](a54_0x26125e['dim'](_0x150fc0(0x26e))));return 0x0;}_0x3885a6[_0x150fc0(0x1f8)]((_0x3c6153,_0x11f9f2)=>{const _0x1997c0=_0x150fc0,_0x1e8cc3=_0x3c6153[_0x1997c0(0x2b9)]||'',_0x26b20f=_0x11f9f2['sessionTime']||'';return _0x26b20f[_0x1997c0(0x267)](_0x1e8cc3);});if(_0x428b3e[_0x150fc0(0x11d)]||_0x428b3e[_0x150fc0(0x245)])return await handleSDKOutput(_0x3885a6,_0x428b3e),0x0;let _0x85c937;if(_0x506bc2){const _0x31fadb=_0x3885a6[0x0];if(!_0x31fadb[_0x150fc0(0x2b7)]?.['id'])return console[_0x150fc0(0x279)](_0x150fc0(0x226)),0x0;_0x85c937=_0x31fadb['lastAttempt']['id'],_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x264)+_0x31fadb[_0x150fc0(0x2b9)]);}else{const _0x123a5b=_0x3885a6[_0x150fc0(0x136)](_0x3ab303=>{const _0x3f30b0=_0x150fc0,_0x2d6049=getAttemptStatusDisplay(_0x3ab303[_0x3f30b0(0x2b7)]);return{'title':_0x3ab303[_0x3f30b0(0x21d)]?.[_0x3f30b0(0x231)]+'.'+_0x3ab303['workflow']?.[_0x3f30b0(0x231)]+_0x3f30b0(0x2c2)+_0x3ab303[_0x3f30b0(0x2b9)]+'\x20'+_0x2d6049[_0x3f30b0(0x1b6)],'value':_0x3ab303[_0x3f30b0(0x2b7)]?.['id']||'','description':_0x2d6049[_0x3f30b0(0x1e7)]};}),_0x3d79d5=await a54_0x1aee3d({'type':_0x150fc0(0x1b3),'name':_0x150fc0(0x28e),'message':_0x150fc0(0x1cb),'choices':_0x123a5b[_0x150fc0(0x217)](_0x493c47=>_0x493c47['value']!=='')});if(!_0x3d79d5[_0x150fc0(0x28e)])return 0x0;_0x85c937=_0x3d79d5['attemptId'];}const _0x376301=_0x428b3e['follow'];return _0x376301?await this[_0x150fc0(0x242)](_0x20f606,_0x85c937):await this[_0x150fc0(0x122)](_0x20f606,_0x85c937,_0x428b3e),0x0;}async[a54_0x54edc0(0x122)](_0x282666,_0x40e88b,_0xdf6253){const _0x44617d=a54_0x54edc0,{tdx:_0x1559ff}=_0x282666;let _0x3cf730,_0xf523c4;try{[_0x3cf730,_0xf523c4]=await Promise[_0x44617d(0x168)]([_0x1559ff['workflow']['attempt'](_0x40e88b),_0x1559ff[_0x44617d(0x169)][_0x44617d(0x1a3)](_0x40e88b,![])]);}catch(_0x11af50){console[_0x44617d(0x279)](a54_0x26125e[_0x44617d(0x16f)](_0x44617d(0x28a)));_0xdf6253[_0x44617d(0x1f9)]&&console[_0x44617d(0x279)](_0x11af50);throw _0x11af50;}if(_0xdf6253[_0x44617d(0x11d)]||_0xdf6253[_0x44617d(0x245)]){const _0x32e177=this[_0x44617d(0x128)](_0x3cf730,_0xf523c4);await handleSDKOutput([_0x32e177],_0xdf6253);return;}const _0x470d91=_0x1559ff[_0x44617d(0x2c9)]['site'],_0x4f62c8=this[_0x44617d(0x12f)](_0x3cf730,_0xf523c4,_0x470d91);console['log'](_0x4f62c8);}async[a54_0x54edc0(0x242)](_0xb08079,_0x190dfc){const _0x1ef838=a54_0x54edc0,{tdx:_0x3f17a1}=_0xb08079,_0x2ee38f=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1f07ac=TIMELINE_CONFIG[_0x1ef838(0x18d)];let _0x576d5f=0x0;while(_0x576d5f<_0x1f07ac){process[_0x1ef838(0x1ce)]['isTTY']&&process[_0x1ef838(0x1ce)][_0x1ef838(0x15c)]('\x1bc');let _0x4a15f2,_0xf689b4;try{[_0x4a15f2,_0xf689b4]=await Promise[_0x1ef838(0x168)]([_0x3f17a1[_0x1ef838(0x169)][_0x1ef838(0x164)](_0x190dfc),_0x3f17a1['workflow'][_0x1ef838(0x1a3)](_0x190dfc,![])]);}catch(_0x65ef01){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x16f)](_0x1ef838(0x1a9)));_0x576d5f>0x0&&console[_0x1ef838(0x279)](a54_0x26125e['dim'](_0x1ef838(0x190)+_0x576d5f));throw _0x65ef01;}const _0x189557=_0x3f17a1[_0x1ef838(0x2c9)][_0x1ef838(0x232)],_0x5e3621=this[_0x1ef838(0x12f)](_0x4a15f2,_0xf689b4,_0x189557);console[_0x1ef838(0x25d)](_0x5e3621);const _0xd94f6f=_0x4a15f2[_0x1ef838(0x188)]&&_0xf689b4[_0x1ef838(0x227)](_0x167c4f=>_0x167c4f[_0x1ef838(0x16d)]!==_0x1ef838(0x187)&&_0x167c4f[_0x1ef838(0x16d)]!=='planned');if(_0xd94f6f){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x208)](_0x1ef838(0x23b)));break;}console['error'](a54_0x26125e[_0x1ef838(0x13e)](_0x1ef838(0x203)+_0x576d5f*0x2+_0x1ef838(0x215))),await new Promise(_0x567d6c=>setTimeout(_0x567d6c,_0x2ee38f)),_0x576d5f++;}_0x576d5f>=_0x1f07ac&&console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x21c)](_0x1ef838(0x209)));}[a54_0x54edc0(0x12f)](_0x1ba4a1,_0x12874f,_0x5655f2){const _0xadec5=a54_0x54edc0,_0x5c7da7=[],_0x4c9f62=TIMELINE_CONFIG[_0xadec5(0x2a4)],_0x2be1d3=0x5,_0x2dff32=process[_0xadec5(0x1ce)][_0xadec5(0x2c3)]||0x78,_0x447349=_0x2dff32-_0x4c9f62-_0x2be1d3,_0x36633e=Math[_0xadec5(0x224)](TIMELINE_CONFIG[_0xadec5(0x133)],Math[_0xadec5(0x121)](_0x447349,TIMELINE_CONFIG[_0xadec5(0x20f)])),_0x444847=new Date(_0x1ba4a1[_0xadec5(0x145)])[_0xadec5(0x284)](),_0x4da4e5=_0x1ba4a1['finishedAt']?new Date(_0x1ba4a1[_0xadec5(0x16e)])[_0xadec5(0x284)]():Date['now'](),_0x57a84f={'start':_0x444847,'end':_0x4da4e5,'duration':_0x4da4e5-_0x444847},_0x5a7f44=new Map(),_0x34bc42=[];for(const _0x4b2eb0 of _0x12874f){if(_0x4b2eb0[_0xadec5(0x1ae)]){const _0x3e83ad=new Date(_0x4b2eb0[_0xadec5(0x1ae)])[_0xadec5(0x284)](),_0x2de10b=_0x4b2eb0['updatedAt']?new Date(_0x4b2eb0[_0xadec5(0x246)])[_0xadec5(0x284)]():Date['now'](),_0x542989={'start':_0x3e83ad,'end':_0x2de10b,'duration':_0x2de10b-_0x3e83ad};_0x5a7f44[_0xadec5(0x11e)](_0x4b2eb0['id'],_0x542989),_0x34bc42[_0xadec5(0x167)]({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x214),'window':_0x542989});}else _0x34bc42['push']({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x161),'window':undefined});}_0x34bc42['sort']((_0x56e277,_0x183d7e)=>{const _0xa8d7af=_0xadec5;if(!_0x56e277[_0xa8d7af(0x2bc)])return 0x1;if(!_0x183d7e[_0xa8d7af(0x2bc)])return-0x1;return _0x56e277[_0xa8d7af(0x2bc)]['start']-_0x183d7e[_0xa8d7af(0x2bc)][_0xa8d7af(0x218)];});const _0x5cddeb=_0x34bc42[_0xadec5(0x274)],_0x57fe38=_0x5cddeb>TIMELINE_CONFIG[_0xadec5(0x244)];_0x57fe38&&_0x34bc42[_0xadec5(0x239)](TIMELINE_CONFIG[_0xadec5(0x244)]);const _0x13460d=calculateTimeScale(_0x57a84f,_0x36633e),_0x5d3954=_0x1ba4a1[_0xadec5(0x188)]?_0x1ba4a1[_0xadec5(0x2bb)]?a54_0x26125e[_0xadec5(0x208)](_0xadec5(0x2bb)):a54_0x26125e[_0xadec5(0x16f)](_0xadec5(0x279)):a54_0x26125e[_0xadec5(0x154)]('running'),_0x3eaaa1=_0x1ba4a1['project']?.['id'],_0x4236e4=_0x1ba4a1['sessionId'];let _0x5c5eb0;if(_0x3eaaa1&&_0x4236e4){const _0x20fab7=getWorkflowAttemptUrl(_0x5655f2,_0x3eaaa1,_0x4236e4,_0x1ba4a1['id']);_0x5c5eb0=hyperlink(a54_0x26125e['dim'](_0x1ba4a1['id']),_0x20fab7);}else _0x5c5eb0=a54_0x26125e[_0xadec5(0x13e)](_0x1ba4a1['id']);_0x5c7da7[_0xadec5(0x167)]('Attempt:\x20'+_0x5c5eb0+_0xadec5(0x2c2)+_0x5d3954+_0xadec5(0x2c2)+formatElapsed(_0x57a84f['duration']));if(_0x34bc42['length']>0x0){const _0x29bdd4=renderTimeAxis(_0x13460d,_0x36633e),_0xa7a550=new Date(_0x57a84f['start']),_0x3cc83f=formatDate(_0xa7a550),_0x2113ac=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4c9f62,_0x482c2c=_0x3cc83f[_0xadec5(0x1d9)](_0x2113ac),_0x2e5d22=a54_0x26125e[_0xadec5(0x13e)](_0x482c2c);_0x5c7da7[_0xadec5(0x167)](_0x2e5d22+'\x20'+_0x29bdd4);for(const _0x4739a5 of _0x34bc42){_0x5c7da7['push'](renderTaskRow(_0x4739a5,_0x13460d,_0x36633e,_0x4c9f62));}const _0x18c420=calculateStats(_0x34bc42);_0x5c7da7['push'](formatStats(_0x18c420)),_0x57fe38&&_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['yellow'](_0xadec5(0x240)+TIMELINE_CONFIG[_0xadec5(0x244)]+_0xadec5(0x15a)+_0x5cddeb+_0xadec5(0x15d))),_0x5c7da7[_0xadec5(0x167)](''),_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['dim'](_0xadec5(0x18a))+('tdx\x20wf\x20attempt\x20'+_0x1ba4a1['id']+_0xadec5(0x263))+a54_0x26125e[_0xadec5(0x13e)](_0xadec5(0x1a0)));}else _0x5c7da7['push'](_0xadec5(0x25e));return _0x5c7da7[_0xadec5(0x2a6)]('\x0a');}[a54_0x54edc0(0x128)](_0x3a7a12,_0x3c7ec1){const _0x52f8c0=a54_0x54edc0,_0x5b2ee2=new Date(_0x3a7a12[_0x52f8c0(0x145)])[_0x52f8c0(0x284)](),_0x20e7df=_0x3a7a12[_0x52f8c0(0x16e)]?new Date(_0x3a7a12[_0x52f8c0(0x16e)])['getTime']():Date[_0x52f8c0(0x2be)](),_0xf51666=_0x20e7df-_0x5b2ee2,_0x462639=[];for(const _0x3acb20 of _0x3c7ec1){if(_0x3acb20[_0x52f8c0(0x1ae)]){const _0x645683=new Date(_0x3acb20[_0x52f8c0(0x1ae)])[_0x52f8c0(0x284)](),_0x29e97c=_0x3acb20[_0x52f8c0(0x246)]?new Date(_0x3acb20[_0x52f8c0(0x246)])[_0x52f8c0(0x284)]():Date[_0x52f8c0(0x2be)]();_0x462639['push']({'name':_0x3acb20[_0x52f8c0(0x16a)],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x214),'window':{'start':_0x645683,'end':_0x29e97c,'duration':_0x29e97c-_0x645683}});}else _0x462639[_0x52f8c0(0x167)]({'name':_0x3acb20['fullName'],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x161),'window':undefined});}const _0x20110c=calculateStats(_0x462639);return{'attempt':{'id':_0x3a7a12['id'],'status':_0x3a7a12[_0x52f8c0(0x188)]?_0x3a7a12['success']?'success':_0x52f8c0(0x279):_0x52f8c0(0x187),'createdAt':_0x3a7a12[_0x52f8c0(0x145)],'finishedAt':_0x3a7a12['finishedAt'],'duration_ms':_0xf51666},'tasks':_0x462639[_0x52f8c0(0x136)](_0x12bca8=>({'name':_0x12bca8['name'],'state':_0x12bca8['state'],'startedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)][_0x52f8c0(0x218)])['toISOString']():null,'updatedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)]['end'])[_0x52f8c0(0x139)]():null,'duration_ms':_0x12bca8[_0x52f8c0(0x2bc)]?.[_0x52f8c0(0x278)]||null})),'stats':_0x20110c};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2974bb,_0x232b2d){const _0xe8f6a7=a55_0x31a4,_0x1955b1=_0x2974bb();while(!![]){try{const _0x22d271=-parseInt(_0xe8f6a7(0x10c))/0x1+parseInt(_0xe8f6a7(0x116))/0x2+-parseInt(_0xe8f6a7(0x117))/0x3*(-parseInt(_0xe8f6a7(0x114))/0x4)+parseInt(_0xe8f6a7(0x11d))/0x5*(parseInt(_0xe8f6a7(0x10d))/0x6)+-parseInt(_0xe8f6a7(0x10f))/0x7+-parseInt(_0xe8f6a7(0x111))/0x8*(-parseInt(_0xe8f6a7(0x11c))/0x9)+-parseInt(_0xe8f6a7(0x112))/0xa;if(_0x22d271===_0x232b2d)break;else _0x1955b1['push'](_0x1955b1['shift']());}catch(_0x2a11f9){_0x1955b1['push'](_0x1955b1['shift']());}}}(a55_0x4a01,0x433aa));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a55_0x31a4(_0x41451e,_0x3004d0){_0x41451e=_0x41451e-0x10b;const _0x4a010e=a55_0x4a01();let _0x31a490=_0x4a010e[_0x41451e];return _0x31a490;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a55_0x4a01(){const _0x5c90ec=['X-Trino-User','Authorization','version','tdx','100557fPByuP','55260LqMNFw','replace','13406PmurAA','30gPdaRB','tdx/','3302509XVntsT','Bearer\x20','376yodxIc','3976120bxXreq',';\x20node/','524crQnlR','length','978194dNbLeo','2031uavQyn'];a55_0x4a01=function(){return _0x5c90ec;};return a55_0x4a01();}export function getUserAgent(){const _0x1cb819=a55_0x31a4,_0xf129cf=getVersion(),_0x304883=platform(),_0x26b97c=process[_0x1cb819(0x11a)][_0x1cb819(0x10b)]('v','');return _0x1cb819(0x10e)+_0xf129cf+'\x20('+_0x304883+_0x1cb819(0x113)+_0x26b97c+')';}export function getAuthHeaders(_0x409987,_0x491482,_0xe39203){const _0x5184e2=a55_0x31a4,_0x1a479b=getVersion(),_0x242cd1={'User-Agent':getUserAgent(),'X-TD-Client':_0x5184e2(0x11b),'X-TD-Client-Version':_0x1a479b};if(_0xe39203)_0x242cd1[_0x5184e2(0x119)]=_0x5184e2(0x110)+_0xe39203;else _0x491482&&(_0x242cd1[_0x5184e2(0x119)]='TD1\x20'+_0x491482);return _0x242cd1;}export function toHeaderRecord(_0x364d74){const _0x24b840={};for(const [_0x495356,_0x5620c0]of Object['entries'](_0x364d74)){_0x5620c0!==undefined&&(_0x24b840[_0x495356]=_0x5620c0);}return _0x24b840;}export function getTrinoHeaders(_0x38a59a,_0x229ec1,_0x1f8927){const _0xc481ab=a55_0x31a4,_0x531ce9=getAuthHeaders(_0x38a59a),_0x949b5e=toHeaderRecord(_0x531ce9);if(_0x1f8927)_0x949b5e[_0xc481ab(0x119)]=_0xc481ab(0x110)+_0x1f8927;else _0x229ec1&&(_0x949b5e[_0xc481ab(0x118)]=_0x229ec1);return _0x949b5e;}export function hasAPIKey(_0x33e9de){const _0x43ec44=a55_0x31a4,_0x27c724=getAPIKey();return _0x27c724!==undefined&&_0x27c724[_0x43ec44(0x115)]>0x0;}
1
+ (function(_0x406db8,_0x533c9d){const _0x46ebc3=a55_0x9823,_0x1fbaf3=_0x406db8();while(!![]){try{const _0x41f003=-parseInt(_0x46ebc3(0x187))/0x1+parseInt(_0x46ebc3(0x18e))/0x2*(-parseInt(_0x46ebc3(0x190))/0x3)+-parseInt(_0x46ebc3(0x192))/0x4*(parseInt(_0x46ebc3(0x18c))/0x5)+parseInt(_0x46ebc3(0x195))/0x6*(-parseInt(_0x46ebc3(0x191))/0x7)+parseInt(_0x46ebc3(0x185))/0x8*(parseInt(_0x46ebc3(0x194))/0x9)+parseInt(_0x46ebc3(0x193))/0xa+-parseInt(_0x46ebc3(0x18b))/0xb*(-parseInt(_0x46ebc3(0x18f))/0xc);if(_0x41f003===_0x533c9d)break;else _0x1fbaf3['push'](_0x1fbaf3['shift']());}catch(_0x317f3b){_0x1fbaf3['push'](_0x1fbaf3['shift']());}}}(a55_0x2dda,0x1a42f));import{platform}from'os';import{getAPIKey}from'./config.js';function a55_0x2dda(){const _0x22ad7e=['entries','56277CqEMDe','tdx/','replace','Bearer\x20','11evqEbf','5kBZipG',';\x20node/','206MieUvH','2748600lnrGuv','2724RNFaMW','7ctKRto','286040uQrHDD','897690oHqoWp','90BgpMmG','325446SWAtuq','Authorization','51440mpNKgY'];a55_0x2dda=function(){return _0x22ad7e;};return a55_0x2dda();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x24540a=a55_0x9823,_0x3bea13=getVersion(),_0x3550f5=platform(),_0x306909=process['version'][_0x24540a(0x189)]('v','');return _0x24540a(0x188)+_0x3bea13+'\x20('+_0x3550f5+_0x24540a(0x18d)+_0x306909+')';}export function getAuthHeaders(_0x1d78ff,_0x44d0a4,_0x38d417){const _0x5013c1=a55_0x9823,_0x9ff245=getVersion(),_0x279735={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x9ff245};if(_0x38d417)_0x279735[_0x5013c1(0x184)]=_0x5013c1(0x18a)+_0x38d417;else _0x44d0a4&&(_0x279735[_0x5013c1(0x184)]='TD1\x20'+_0x44d0a4);return _0x279735;}export function toHeaderRecord(_0x100ad2){const _0x348587=a55_0x9823,_0x28e14f={};for(const [_0x2fa103,_0x2da4a6]of Object[_0x348587(0x186)](_0x100ad2)){_0x2da4a6!==undefined&&(_0x28e14f[_0x2fa103]=_0x2da4a6);}return _0x28e14f;}export function getTrinoHeaders(_0x28e630,_0x4b8895,_0xe34410){const _0x463884=a55_0x9823,_0x5e8940=getAuthHeaders(_0x28e630),_0x2d41c7=toHeaderRecord(_0x5e8940);if(_0xe34410)_0x2d41c7[_0x463884(0x184)]=_0x463884(0x18a)+_0xe34410;else _0x4b8895&&(_0x2d41c7['X-Trino-User']=_0x4b8895);return _0x2d41c7;}function a55_0x9823(_0x151e0a,_0x150df8){_0x151e0a=_0x151e0a-0x184;const _0x2dda34=a55_0x2dda();let _0x982368=_0x2dda34[_0x151e0a];return _0x982368;}export function hasAPIKey(_0x175644){const _0x480833=getAPIKey();return _0x480833!==undefined&&_0x480833['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x53c984,_0x55b545){const _0x231180=a56_0x3dc3,_0x57c59b=_0x53c984();while(!![]){try{const _0x3e691d=-parseInt(_0x231180(0xed))/0x1+-parseInt(_0x231180(0xde))/0x2+parseInt(_0x231180(0x109))/0x3+-parseInt(_0x231180(0xdd))/0x4*(parseInt(_0x231180(0xd7))/0x5)+-parseInt(_0x231180(0xe2))/0x6*(-parseInt(_0x231180(0xfb))/0x7)+parseInt(_0x231180(0xca))/0x8*(-parseInt(_0x231180(0xe4))/0x9)+parseInt(_0x231180(0x102))/0xa;if(_0x3e691d===_0x55b545)break;else _0x57c59b['push'](_0x57c59b['shift']());}catch(_0x2b7349){_0x57c59b['push'](_0x57c59b['shift']());}}}(a56_0x23e3,0x77b1e));import{writeFileSync}from'fs';import{spawn}from'child_process';function a56_0x3dc3(_0x438558,_0x23246c){_0x438558=_0x438558-0xc8;const _0x23e392=a56_0x23e3();let _0x3dc3cb=_0x23e392[_0x438558];return _0x3dc3cb;}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x3b1bc0 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x34e4a0){const _0x1aacb8=a56_0x3dc3;return _0x34e4a0['format']===_0x1aacb8(0xd8)||_0x34e4a0[_0x1aacb8(0xd3)]===_0x1aacb8(0x104)||_0x34e4a0[_0x1aacb8(0xd3)]==='tsv'||_0x34e4a0[_0x1aacb8(0xd3)]===_0x1aacb8(0x10d)||_0x34e4a0[_0x1aacb8(0xd8)]===!![]||_0x34e4a0[_0x1aacb8(0x104)]===!![]||_0x34e4a0[_0x1aacb8(0x107)]===!![]||_0x34e4a0[_0x1aacb8(0x10d)]===!![];}export function parseOutputOptions(_0x209182){const _0x44b515=a56_0x3dc3;return{'format':_0x209182['format']||_0x44b515(0x10d),'output':_0x209182[_0x44b515(0xc8)]||'','limit':_0x209182[_0x44b515(0xfc)],'limitStructuredFormats':_0x209182['limitStructuredFormats'],'color':_0x209182[_0x44b515(0xd9)],'noColor':_0x209182[_0x44b515(0xf1)]};}function convertSDKResultToQueryResult(_0x4b9d28){const _0x418424=a56_0x3dc3,_0x67028d=[];if(_0x4b9d28[_0x418424(0xc9)]>0x0){const _0x2634a7=_0x4b9d28[0x0];for(const [_0x24f0b8,_0xa964a6]of Object[_0x418424(0xe0)](_0x2634a7)){let _0x1d1fdb=_0x418424(0xee);if(typeof _0xa964a6===_0x418424(0xf7))_0x1d1fdb=Number[_0x418424(0xda)](_0xa964a6)?_0x418424(0xf0):_0x418424(0xf9);else{if(typeof _0xa964a6===_0x418424(0x10f))_0x1d1fdb=_0x418424(0x10f);else _0xa964a6===null&&(_0x1d1fdb='varchar');}_0x67028d['push']({'name':_0x24f0b8,'type':_0x1d1fdb});}}return{'queryId':_0x418424(0xea),'columns':_0x67028d,'data':_0x4b9d28,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4b9d28[_0x418424(0xc9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5629cd,_0x25b0ae){const _0x390533=convertSDKResultToQueryResult(_0x5629cd);return formatQueryOutput(_0x390533,_0x25b0ae);}export async function formatQueryOutput(_0x58b21e,_0x844f06){const _0x333c27=a56_0x3dc3,{format:_0xeb7124,limit:_0x158b60,output:_0x57bbe2,color:_0x40cf17,noColor:_0x5e834b,limitStructuredFormats:_0xf2e344}=_0x844f06,_0x26f7e2=Boolean(_0x57bbe2)&&!_0x40cf17,_0x1dc573={'color':_0x40cf17,'noColor':_0x5e834b||_0x26f7e2};if(_0xeb7124===_0x333c27(0x10d)){const _0x41d2af=shouldUseLess(_0xeb7124,_0x57bbe2);return formatAsTable(_0x58b21e,_0x158b60,_0x41d2af,_0x1dc573);}const _0x9c044b=_0xf2e344&&Number[_0x333c27(0xe1)](_0x158b60)&&_0x58b21e[_0x333c27(0xdb)]['length']>_0x158b60?{..._0x58b21e,'data':_0x58b21e[_0x333c27(0xdb)][_0x333c27(0xe5)](0x0,_0x158b60)}:_0x58b21e;if(_0xeb7124===_0x333c27(0xd8))return formatAsJSON(_0x9c044b,_0x1dc573);else return _0xeb7124===_0x333c27(0x104)?formatAsJSONL(_0x9c044b,_0x1dc573):formatQueryResult(_0x9c044b,_0xeb7124);}function shouldUseLess(_0x216037,_0x5d2278){const _0x297409=a56_0x3dc3;return(_0x216037===_0x297409(0x10d)||_0x216037==='list')&&process[_0x297409(0xfa)][_0x297409(0x100)]&&!_0x5d2278;}export function resolveOutputOptions(_0x15fbd1){const _0x101413=a56_0x3dc3,_0x1fe014=_0x15fbd1[_0x101413(0xc8)]||'',_0xa0ea6c=resolveOutputFormat(_0x15fbd1['format'],_0x1fe014,'table');let _0x19f4bd=typeof _0x15fbd1[_0x101413(0xfc)]===_0x101413(0xf7)?_0x15fbd1[_0x101413(0xfc)]:parseInt(_0x15fbd1[_0x101413(0xfc)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x15fbd1[_0x101413(0xfc)]===undefined&&shouldUseLess(_0xa0ea6c,_0x1fe014)&&(_0x19f4bd=Infinity),{'format':_0xa0ea6c,'output':_0x1fe014,'limit':_0x19f4bd,'limitStructuredFormats':_0x15fbd1['limitStructuredFormats'],'color':_0x15fbd1['color'],'noColor':_0x15fbd1['noColor']};}export function writeOutput(_0x5503a3,_0x712a8,_0x2e71d2){const _0x4500ea=a56_0x3dc3;return _0x712a8?(writeFileSync(_0x712a8,_0x5503a3),console[_0x4500ea(0x10c)](_0x4500ea(0x10e)+_0x712a8),Promise['resolve']()):shouldUseLess(_0x2e71d2||'','')?new Promise(_0x1a1dc4=>{const _0x4dae48=_0x4500ea,_0x38dbe7=spawn(_0x4dae48(0xd2),['-FXRSn'],{'stdio':['pipe',_0x4dae48(0xe3),_0x4dae48(0xe3)]});let _0x5dd13e=![];_0x38dbe7['on'](_0x4dae48(0x10c),()=>{const _0x4ca914=_0x4dae48;!_0x5dd13e&&(_0x5dd13e=!![],console[_0x4ca914(0xf6)](_0x5503a3),_0x1a1dc4());}),_0x38dbe7['on'](_0x4dae48(0xcb),()=>{!_0x5dd13e&&(_0x5dd13e=!![],_0x1a1dc4());}),_0x38dbe7['on']('spawn',()=>{const _0x17c80e=_0x4dae48;!_0x5dd13e&&_0x38dbe7['stdin']&&(_0x38dbe7[_0x17c80e(0x111)]['on']('error',()=>{}),_0x38dbe7[_0x17c80e(0x111)][_0x17c80e(0xdf)](_0x5503a3),_0x38dbe7[_0x17c80e(0x111)]['end']());}),!_0x38dbe7['stdin']&&(!_0x5dd13e&&(_0x5dd13e=!![],console[_0x4dae48(0xf6)](_0x5503a3),_0x1a1dc4()));}):(console[_0x4500ea(0xf6)](_0x5503a3),Promise[_0x4500ea(0x108)]());}export async function handleSDKOutput(_0x3537a9,_0x330d8a){const _0x2115f9=a56_0x3dc3,_0x4d7221=resolveOutputOptions(_0x330d8a),_0x26dc60=await formatSDKOutput(_0x3537a9,_0x4d7221);await writeOutput(_0x26dc60,_0x4d7221[_0x2115f9(0xc8)]||undefined,_0x4d7221[_0x2115f9(0xd3)]);}export async function handleQueryOutput(_0x25798d,_0x15e573){const _0x3666bf=a56_0x3dc3,_0x5713ab=resolveOutputOptions(_0x15e573),_0xb35790=await formatQueryOutput(_0x25798d,_0x5713ab);await writeOutput(_0xb35790,_0x5713ab['output']||undefined,_0x5713ab[_0x3666bf(0xd3)]);}function a56_0x23e3(){const _0x3367c5=['split','[rule]','debug','140iFFzGD','json','color','isInteger','data','stderr','77008JxIGBl','410962xCOAYs','write','entries','isFinite','12swsurC','inherit','404793tLnyVB','slice','─┬─','repeat','bold','[logs]','sdk-result','params','forEach','146130suRpzR','varchar','padEnd','bigint','noColor','[Object]','rule','join','magenta','log','number','query','double','stdout','1259146jHZzuC','limit','stringify','trim','cyan','isTTY','cmdout','7566380wxDOcC','blue','jsonl','max','─┴─','tsv','resolve','2142939fIhNgK','string','filter','error','table','Results\x20saved\x20to\x20','boolean','object','stdin','[params]','output','length','80KEGeqj','close','push','No\x20data','red','yellow','[query]','map','less','format'];a56_0x23e3=function(){return _0x3367c5;};return a56_0x23e3();}async function formatSingleObject(_0x3dd02a,_0x453906){const _0x547ccd=a56_0x3dc3,{format:_0x4965b7,color:_0x342bfc,noColor:_0x205057}=_0x453906,_0x2587ba={'color':_0x342bfc,'noColor':_0x205057};if(_0x4965b7===_0x547ccd(0xd8)){if(shouldUseColor(_0x2587ba))return colorizeJSON(_0x3dd02a,_0x2587ba);return JSON['stringify'](_0x3dd02a,null,0x2);}else{if(_0x4965b7===_0x547ccd(0x104)){if(shouldUseColor(_0x2587ba))return colorizeJSONCompact(_0x3dd02a,_0x2587ba);return JSON['stringify'](_0x3dd02a);}else{if(_0x4965b7===_0x547ccd(0x107))return Object[_0x547ccd(0xe0)](_0x3dd02a)[_0x547ccd(0xd1)](([_0x2d4b8b,_0x1891da])=>_0x2d4b8b+'\x09'+_0x1891da)[_0x547ccd(0xf4)]('\x0a');else{const _0x2106ea=Object[_0x547ccd(0xe0)](_0x3dd02a);if(_0x2106ea['length']===0x0)return _0x547ccd(0xcd);const _0x211f08=_0x3dd02a[_0x547ccd(0xd6)],_0x325b13=_0x3dd02a[_0x547ccd(0xf8)],_0x2daccd=_0x3dd02a[_0x547ccd(0xeb)],_0x145d3c=_0x3dd02a['rule'],_0x5ce7ad=_0x325b13?typeof _0x325b13===_0x547ccd(0x10a)?_0x325b13:JSON[_0x547ccd(0xfd)](_0x325b13,null,0x2):undefined,_0x294996=_0x2daccd&&Object['keys'](_0x2daccd)['length']>0x0?JSON[_0x547ccd(0xfd)](_0x2daccd,null,0x2):undefined,_0x5d8a9f=_0x145d3c&&Object['keys'](_0x145d3c)['length']>0x0?JSON[_0x547ccd(0xfd)](_0x145d3c,null,0x2):undefined,_0x4eeebe=_0x2106ea[_0x547ccd(0x10b)](([_0x5d48cc])=>_0x5d48cc!==_0x547ccd(0xd6)&&_0x5d48cc!=='query'&&_0x5d48cc!==_0x547ccd(0xeb)&&_0x5d48cc!==_0x547ccd(0xf3)),_0x3784a8=Math['max'](..._0x4eeebe[_0x547ccd(0xd1)](([_0x1b77ce])=>_0x1b77ce[_0x547ccd(0xc9)])),_0x448fa0=Math[_0x547ccd(0x105)](..._0x4eeebe[_0x547ccd(0xd1)](([,_0x53fc82])=>{const _0x3376ad=_0x547ccd;try{const _0x36b551=_0x53fc82===null||_0x53fc82===undefined?'':typeof _0x53fc82===_0x3376ad(0x110)?JSON[_0x3376ad(0xfd)](_0x53fc82):String(_0x53fc82),_0x26c10b=_0x36b551[_0x3376ad(0xd4)]('\x0a');return Math[_0x3376ad(0x105)](..._0x26c10b['map'](_0x27a8e8=>_0x27a8e8[_0x3376ad(0xc9)]),0x0);}catch{return 0x0;}}),0x14),_0x4207e5=[];_0x4207e5[_0x547ccd(0xcc)](colorBorder('┌─'+'─'[_0x547ccd(0xe7)](_0x3784a8)+_0x547ccd(0xe6)+'─'[_0x547ccd(0xe7)](_0x448fa0)+'─┐',_0x2587ba)),_0x4eeebe[_0x547ccd(0xec)](([_0x49d97b,_0x1b0cc6])=>{const _0x842e82=_0x547ccd;let _0x4d6212;try{_0x4d6212=_0x1b0cc6===null||_0x1b0cc6===undefined?'':typeof _0x1b0cc6===_0x842e82(0x110)?JSON[_0x842e82(0xfd)](_0x1b0cc6):String(_0x1b0cc6);}catch{_0x4d6212=_0x842e82(0xf2);}const _0x4dc32c=_0x49d97b[_0x842e82(0xef)](_0x3784a8),_0x2edb6d=_0x4d6212['split']('\x0a');_0x2edb6d[_0x842e82(0xec)]((_0x556d5,_0x1e4274)=>{const _0x2de708=_0x842e82,_0x544914=colorBorder('│',_0x2587ba);_0x1e4274===0x0?_0x4207e5[_0x2de708(0xcc)](_0x544914+'\x20'+_0x4dc32c+'\x20'+_0x544914+'\x20'+_0x556d5['padEnd'](_0x448fa0)+'\x20'+_0x544914):_0x4207e5['push'](_0x544914+'\x20'+'\x20'[_0x2de708(0xe7)](_0x3784a8)+'\x20'+_0x544914+'\x20'+_0x556d5['padEnd'](_0x448fa0)+'\x20'+_0x544914);});}),_0x4207e5['push'](colorBorder('└─'+'─'[_0x547ccd(0xe7)](_0x3784a8)+_0x547ccd(0x106)+'─'[_0x547ccd(0xe7)](_0x448fa0)+'─┘',_0x2587ba));_0x5ce7ad&&(_0x4207e5[_0x547ccd(0xcc)](''),_0x4207e5[_0x547ccd(0xcc)](String(a56_0x3b1bc0[_0x547ccd(0xcf)][_0x547ccd(0xe8)](_0x547ccd(0xd0)))),_0x4207e5[_0x547ccd(0xcc)](_0x5ce7ad));_0x294996&&(_0x4207e5['push'](''),_0x4207e5[_0x547ccd(0xcc)](String(a56_0x3b1bc0[_0x547ccd(0x103)]['bold'](_0x547ccd(0x112)))),_0x4207e5[_0x547ccd(0xcc)](_0x294996));_0x5d8a9f&&(_0x4207e5[_0x547ccd(0xcc)](''),_0x4207e5[_0x547ccd(0xcc)](String(a56_0x3b1bc0[_0x547ccd(0xf5)][_0x547ccd(0xe8)](_0x547ccd(0xd5)))),_0x4207e5[_0x547ccd(0xcc)](_0x5d8a9f));if(_0x211f08){if(_0x211f08[_0x547ccd(0xdc)]){_0x4207e5[_0x547ccd(0xcc)](''),_0x4207e5['push'](String(a56_0x3b1bc0[_0x547ccd(0xce)][_0x547ccd(0xe8)]('[error]')));const _0x2187a9=_0x211f08[_0x547ccd(0xdc)][_0x547ccd(0xd4)]('\x0a');_0x2187a9['forEach'](_0x7ff8ec=>{const _0x1c54a3=_0x547ccd;_0x7ff8ec[_0x1c54a3(0xfe)]()&&_0x4207e5[_0x1c54a3(0xcc)](_0x7ff8ec);});}if(_0x211f08[_0x547ccd(0x101)]){_0x4207e5[_0x547ccd(0xcc)](''),_0x4207e5[_0x547ccd(0xcc)](String(a56_0x3b1bc0[_0x547ccd(0xff)][_0x547ccd(0xe8)](_0x547ccd(0xe9))));const _0x50e16c=_0x211f08[_0x547ccd(0x101)][_0x547ccd(0xd4)]('\x0a');_0x50e16c[_0x547ccd(0xec)](_0x29f046=>{const _0x37634b=_0x547ccd;_0x29f046[_0x37634b(0xfe)]()&&_0x4207e5[_0x37634b(0xcc)](_0x29f046);});}}return _0x4207e5[_0x547ccd(0xf4)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x35fbc8,_0x452017){const _0x4ab7b0=a56_0x3dc3;if(_0x452017[_0x4ab7b0(0xd3)]===_0x4ab7b0(0x10d)){await handleSDKOutput([_0x35fbc8],_0x452017);return;}const _0x312773=resolveOutputOptions(_0x452017),_0x1136a0=await formatSingleObject(_0x35fbc8,_0x312773);await writeOutput(_0x1136a0,_0x312773['output']||undefined,_0x312773[_0x4ab7b0(0xd3)]);}
1
+ (function(_0x56a0b2,_0x10c9f0){const _0x5a6496=a56_0x3c04,_0x3e0167=_0x56a0b2();while(!![]){try{const _0x1aff19=parseInt(_0x5a6496(0x131))/0x1+-parseInt(_0x5a6496(0x118))/0x2+-parseInt(_0x5a6496(0x11b))/0x3+-parseInt(_0x5a6496(0x127))/0x4+-parseInt(_0x5a6496(0x14d))/0x5*(parseInt(_0x5a6496(0x11d))/0x6)+-parseInt(_0x5a6496(0x116))/0x7+parseInt(_0x5a6496(0x13a))/0x8;if(_0x1aff19===_0x10c9f0)break;else _0x3e0167['push'](_0x3e0167['shift']());}catch(_0x5e4a5f){_0x3e0167['push'](_0x3e0167['shift']());}}}(a56_0x50d4,0x5abab));import{writeFileSync}from'fs';function a56_0x3c04(_0x29a66a,_0x1a15bb){_0x29a66a=_0x29a66a-0x10e;const _0x50d46d=a56_0x50d4();let _0x3c044d=_0x50d46d[_0x29a66a];return _0x3c044d;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x171798 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x565a07){const _0x17dddb=a56_0x3c04;return _0x565a07[_0x17dddb(0x135)]==='json'||_0x565a07['format']==='jsonl'||_0x565a07['format']==='tsv'||_0x565a07[_0x17dddb(0x135)]==='table'||_0x565a07[_0x17dddb(0x14b)]===!![]||_0x565a07[_0x17dddb(0x147)]===!![]||_0x565a07[_0x17dddb(0x137)]===!![]||_0x565a07[_0x17dddb(0x12e)]===!![];}export function parseOutputOptions(_0x5c91d5){const _0x2ba242=a56_0x3c04;return{'format':_0x5c91d5[_0x2ba242(0x135)]||_0x2ba242(0x12e),'output':_0x5c91d5[_0x2ba242(0x124)]||'','limit':_0x5c91d5[_0x2ba242(0x12f)],'limitStructuredFormats':_0x5c91d5[_0x2ba242(0x114)],'color':_0x5c91d5['color'],'noColor':_0x5c91d5['noColor']};}function convertSDKResultToQueryResult(_0x31f360){const _0x2dbfd6=a56_0x3c04,_0x501dae=[];if(_0x31f360[_0x2dbfd6(0x115)]>0x0){const _0x4966ca=_0x31f360[0x0];for(const [_0x49691c,_0x506a38]of Object[_0x2dbfd6(0x13d)](_0x4966ca)){let _0x364036='varchar';if(typeof _0x506a38===_0x2dbfd6(0x143))_0x364036=Number[_0x2dbfd6(0x11e)](_0x506a38)?_0x2dbfd6(0x133):'double';else{if(typeof _0x506a38===_0x2dbfd6(0x148))_0x364036=_0x2dbfd6(0x148);else _0x506a38===null&&(_0x364036=_0x2dbfd6(0x14e));}_0x501dae[_0x2dbfd6(0x110)]({'name':_0x49691c,'type':_0x364036});}}return{'queryId':'sdk-result','columns':_0x501dae,'data':_0x31f360,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x31f360[_0x2dbfd6(0x115)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x3aa8d4,_0x326296){const _0x32f118=convertSDKResultToQueryResult(_0x3aa8d4);return formatQueryOutput(_0x32f118,_0x326296);}export async function formatQueryOutput(_0xd4593c,_0x19f5b3){const _0x729707=a56_0x3c04,{format:_0x104410,limit:_0x24f424,output:_0xf6d0fc,color:_0x2d0758,noColor:_0x4d24f8,limitStructuredFormats:_0x233858}=_0x19f5b3,_0x592f00=Boolean(_0xf6d0fc)&&!_0x2d0758,_0x5ddbdb={'color':_0x2d0758,'noColor':_0x4d24f8||_0x592f00};if(_0x104410===_0x729707(0x12e)){const _0x95fc29=shouldUseLess(_0x104410,_0xf6d0fc);return formatAsTable(_0xd4593c,_0x24f424,_0x95fc29,_0x5ddbdb);}const _0x33fd1f=_0x233858&&Number[_0x729707(0x151)](_0x24f424)&&_0xd4593c['data'][_0x729707(0x115)]>_0x24f424?{..._0xd4593c,'data':_0xd4593c[_0x729707(0x126)][_0x729707(0x130)](0x0,_0x24f424)}:_0xd4593c;if(_0x104410===_0x729707(0x14b))return formatAsJSON(_0x33fd1f,_0x5ddbdb);else return _0x104410===_0x729707(0x147)?formatAsJSONL(_0x33fd1f,_0x5ddbdb):formatQueryResult(_0x33fd1f,_0x104410);}function shouldUseLess(_0x2fd2ba,_0xcd6b4d){const _0x85fdc6=a56_0x3c04;return(_0x2fd2ba===_0x85fdc6(0x12e)||_0x2fd2ba===_0x85fdc6(0x152))&&process[_0x85fdc6(0x12c)][_0x85fdc6(0x120)]&&!_0xcd6b4d;}export function resolveOutputOptions(_0xec8cff){const _0xce1f8=a56_0x3c04,_0x1f794c=_0xec8cff[_0xce1f8(0x124)]||'',_0x2f272b=resolveOutputFormat(_0xec8cff[_0xce1f8(0x135)],_0x1f794c,_0xce1f8(0x12e));let _0x502566=typeof _0xec8cff[_0xce1f8(0x12f)]===_0xce1f8(0x143)?_0xec8cff[_0xce1f8(0x12f)]:parseInt(_0xec8cff[_0xce1f8(0x12f)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0xec8cff[_0xce1f8(0x12f)]===undefined&&shouldUseLess(_0x2f272b,_0x1f794c)&&(_0x502566=Infinity),{'format':_0x2f272b,'output':_0x1f794c,'limit':_0x502566,'limitStructuredFormats':_0xec8cff['limitStructuredFormats'],'color':_0xec8cff['color'],'noColor':_0xec8cff[_0xce1f8(0x125)]};}export function writeOutput(_0x5b7b2c,_0x3714a1,_0x228632){const _0x15f7ef=a56_0x3c04;return _0x3714a1?(writeFileSync(_0x3714a1,_0x5b7b2c),console[_0x15f7ef(0x140)]('Results\x20saved\x20to\x20'+_0x3714a1),Promise[_0x15f7ef(0x128)]()):shouldUseLess(_0x228632||'','')?new Promise(_0x570e74=>{const _0x407d10=_0x15f7ef,_0x448653=spawn('less',[_0x407d10(0x10f)],{'stdio':['pipe',_0x407d10(0x144),_0x407d10(0x144)]});let _0xa2e449=![];_0x448653['on'](_0x407d10(0x140),()=>{!_0xa2e449&&(_0xa2e449=!![],console['log'](_0x5b7b2c),_0x570e74());}),_0x448653['on'](_0x407d10(0x12a),()=>{!_0xa2e449&&(_0xa2e449=!![],_0x570e74());}),_0x448653['on'](_0x407d10(0x129),()=>{const _0x4f6935=_0x407d10;!_0xa2e449&&_0x448653[_0x4f6935(0x11c)]&&(_0x448653[_0x4f6935(0x11c)]['on'](_0x4f6935(0x140),()=>{}),_0x448653['stdin']['write'](_0x5b7b2c),_0x448653[_0x4f6935(0x11c)][_0x4f6935(0x112)]());}),!_0x448653[_0x407d10(0x11c)]&&(!_0xa2e449&&(_0xa2e449=!![],console[_0x407d10(0x119)](_0x5b7b2c),_0x570e74()));}):(console[_0x15f7ef(0x119)](_0x5b7b2c),Promise['resolve']());}export async function handleSDKOutput(_0x3d2c9e,_0x42955f){const _0x2794b5=a56_0x3c04,_0x52b624=resolveOutputOptions(_0x42955f),_0x3c392b=await formatSDKOutput(_0x3d2c9e,_0x52b624);await writeOutput(_0x3c392b,_0x52b624[_0x2794b5(0x124)]||undefined,_0x52b624['format']);}function a56_0x50d4(){const _0x1a4d7a=['─┴─','params','stderr','output','noColor','data','1154812AVgiIB','resolve','spawn','close','cmdout','stdout','magenta','table','limit','slice','389715dtdndP','debug','bigint','[rule]','format','max','tsv','repeat','[Object]','20468560VuyYxQ','keys','padEnd','entries','map','blue','error','query','join','number','inherit','object','trim','jsonl','boolean','─┬─','bold','json','split','32610KVZqbg','varchar','string','rule','isFinite','list','forEach','-FXRSn','push','red','end','yellow','limitStructuredFormats','length','4581899ZkLfQO','stringify','1483476klasjM','log','[logs]','1051002eANJtw','stdin','498tzDPKo','isInteger','filter','isTTY'];a56_0x50d4=function(){return _0x1a4d7a;};return a56_0x50d4();}export async function handleQueryOutput(_0x30857b,_0x23d4d4){const _0x193ef7=a56_0x3c04,_0x5676ef=resolveOutputOptions(_0x23d4d4),_0x14ac91=await formatQueryOutput(_0x30857b,_0x5676ef);await writeOutput(_0x14ac91,_0x5676ef[_0x193ef7(0x124)]||undefined,_0x5676ef['format']);}async function formatSingleObject(_0x4d54bf,_0x538532){const _0x384a67=a56_0x3c04,{format:_0x1ac150,color:_0x4ed847,noColor:_0xcbce2b}=_0x538532,_0x4c72f3={'color':_0x4ed847,'noColor':_0xcbce2b};if(_0x1ac150==='json'){if(shouldUseColor(_0x4c72f3))return colorizeJSON(_0x4d54bf,_0x4c72f3);return JSON[_0x384a67(0x117)](_0x4d54bf,null,0x2);}else{if(_0x1ac150===_0x384a67(0x147)){if(shouldUseColor(_0x4c72f3))return colorizeJSONCompact(_0x4d54bf,_0x4c72f3);return JSON['stringify'](_0x4d54bf);}else{if(_0x1ac150==='tsv')return Object['entries'](_0x4d54bf)[_0x384a67(0x13e)](([_0x3ba392,_0x2403b8])=>_0x3ba392+'\x09'+_0x2403b8)[_0x384a67(0x142)]('\x0a');else{const _0x7d8d19=Object[_0x384a67(0x13d)](_0x4d54bf);if(_0x7d8d19[_0x384a67(0x115)]===0x0)return'No\x20data';const _0x276cc6=_0x4d54bf[_0x384a67(0x132)],_0x31e862=_0x4d54bf[_0x384a67(0x141)],_0xd9562=_0x4d54bf[_0x384a67(0x122)],_0x4c534a=_0x4d54bf[_0x384a67(0x150)],_0x5cbc8e=_0x31e862?typeof _0x31e862===_0x384a67(0x14f)?_0x31e862:JSON[_0x384a67(0x117)](_0x31e862,null,0x2):undefined,_0x20d70b=_0xd9562&&Object[_0x384a67(0x13b)](_0xd9562)[_0x384a67(0x115)]>0x0?JSON['stringify'](_0xd9562,null,0x2):undefined,_0x29d246=_0x4c534a&&Object[_0x384a67(0x13b)](_0x4c534a)['length']>0x0?JSON[_0x384a67(0x117)](_0x4c534a,null,0x2):undefined,_0x4b4c2e=_0x7d8d19[_0x384a67(0x11f)](([_0x2c533b])=>_0x2c533b!==_0x384a67(0x132)&&_0x2c533b!==_0x384a67(0x141)&&_0x2c533b!==_0x384a67(0x122)&&_0x2c533b!==_0x384a67(0x150)),_0x3bd516=Math[_0x384a67(0x136)](..._0x4b4c2e['map'](([_0x4e6fca])=>_0x4e6fca[_0x384a67(0x115)])),_0x144d16=Math['max'](..._0x4b4c2e['map'](([,_0x2764d8])=>{const _0x5c06ad=_0x384a67;try{const _0x5df9ea=_0x2764d8===null||_0x2764d8===undefined?'':typeof _0x2764d8===_0x5c06ad(0x145)?JSON['stringify'](_0x2764d8):String(_0x2764d8),_0x121222=_0x5df9ea[_0x5c06ad(0x14c)]('\x0a');return Math[_0x5c06ad(0x136)](..._0x121222[_0x5c06ad(0x13e)](_0x36c20d=>_0x36c20d['length']),0x0);}catch{return 0x0;}}),0x14),_0x436098=[];_0x436098[_0x384a67(0x110)](colorBorder('┌─'+'─'[_0x384a67(0x138)](_0x3bd516)+_0x384a67(0x149)+'─'[_0x384a67(0x138)](_0x144d16)+'─┐',_0x4c72f3)),_0x4b4c2e[_0x384a67(0x10e)](([_0xafbc1e,_0x3f9d20])=>{const _0x375f31=_0x384a67;let _0x3faadd;try{_0x3faadd=_0x3f9d20===null||_0x3f9d20===undefined?'':typeof _0x3f9d20===_0x375f31(0x145)?JSON[_0x375f31(0x117)](_0x3f9d20):String(_0x3f9d20);}catch{_0x3faadd=_0x375f31(0x139);}const _0x3fc3bf=_0xafbc1e[_0x375f31(0x13c)](_0x3bd516),_0x47f814=_0x3faadd[_0x375f31(0x14c)]('\x0a');_0x47f814[_0x375f31(0x10e)]((_0x279bb7,_0x407cd8)=>{const _0x5c90b3=_0x375f31,_0x3985cc=colorBorder('│',_0x4c72f3);_0x407cd8===0x0?_0x436098[_0x5c90b3(0x110)](_0x3985cc+'\x20'+_0x3fc3bf+'\x20'+_0x3985cc+'\x20'+_0x279bb7[_0x5c90b3(0x13c)](_0x144d16)+'\x20'+_0x3985cc):_0x436098['push'](_0x3985cc+'\x20'+'\x20'[_0x5c90b3(0x138)](_0x3bd516)+'\x20'+_0x3985cc+'\x20'+_0x279bb7[_0x5c90b3(0x13c)](_0x144d16)+'\x20'+_0x3985cc);});}),_0x436098[_0x384a67(0x110)](colorBorder('└─'+'─'[_0x384a67(0x138)](_0x3bd516)+_0x384a67(0x121)+'─'['repeat'](_0x144d16)+'─┘',_0x4c72f3));_0x5cbc8e&&(_0x436098['push'](''),_0x436098[_0x384a67(0x110)](String(a56_0x171798[_0x384a67(0x113)][_0x384a67(0x14a)]('[query]'))),_0x436098[_0x384a67(0x110)](_0x5cbc8e));_0x20d70b&&(_0x436098[_0x384a67(0x110)](''),_0x436098[_0x384a67(0x110)](String(a56_0x171798[_0x384a67(0x13f)][_0x384a67(0x14a)]('[params]'))),_0x436098[_0x384a67(0x110)](_0x20d70b));_0x29d246&&(_0x436098[_0x384a67(0x110)](''),_0x436098[_0x384a67(0x110)](String(a56_0x171798[_0x384a67(0x12d)]['bold'](_0x384a67(0x134)))),_0x436098[_0x384a67(0x110)](_0x29d246));if(_0x276cc6){if(_0x276cc6[_0x384a67(0x123)]){_0x436098[_0x384a67(0x110)](''),_0x436098[_0x384a67(0x110)](String(a56_0x171798[_0x384a67(0x111)]['bold']('[error]')));const _0x45357=_0x276cc6[_0x384a67(0x123)][_0x384a67(0x14c)]('\x0a');_0x45357['forEach'](_0x43669b=>{const _0x113098=_0x384a67;_0x43669b[_0x113098(0x146)]()&&_0x436098[_0x113098(0x110)](_0x43669b);});}if(_0x276cc6['cmdout']){_0x436098['push'](''),_0x436098['push'](String(a56_0x171798['cyan'][_0x384a67(0x14a)](_0x384a67(0x11a))));const _0x191b91=_0x276cc6[_0x384a67(0x12b)]['split']('\x0a');_0x191b91[_0x384a67(0x10e)](_0x8040ba=>{const _0x209c68=_0x384a67;_0x8040ba[_0x209c68(0x146)]()&&_0x436098[_0x209c68(0x110)](_0x8040ba);});}}return _0x436098[_0x384a67(0x142)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2cff81,_0x29d9dd){const _0x3919e9=a56_0x3c04;if(_0x29d9dd[_0x3919e9(0x135)]===_0x3919e9(0x12e)){await handleSDKOutput([_0x2cff81],_0x29d9dd);return;}const _0x2ee0c0=resolveOutputOptions(_0x29d9dd),_0x4c54c4=await formatSingleObject(_0x2cff81,_0x2ee0c0);await writeOutput(_0x4c54c4,_0x2ee0c0[_0x3919e9(0x124)]||undefined,_0x2ee0c0['format']);}