@treasuredata/tdx 0.29.2 → 0.29.3

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 (187) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/upgrade-command.js +1 -1
  47. package/dist/commands/use-command.js +1 -1
  48. package/dist/commands/user-command.js +1 -1
  49. package/dist/commands/workflow-command.js +1 -1
  50. package/dist/core/auth.js +1 -1
  51. package/dist/core/command-output.js +1 -1
  52. package/dist/core/config.js +1 -1
  53. package/dist/core/connection-cache.js +1 -1
  54. package/dist/core/constants.js +1 -1
  55. package/dist/core/credential-cache.js +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/keychain.js +1 -1
  58. package/dist/core/profile.js +1 -1
  59. package/dist/core/project-config.js +1 -1
  60. package/dist/core/session.js +1 -1
  61. package/dist/core/user-cache.js +1 -1
  62. package/dist/core/version.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/mcp/server.js +1 -1
  65. package/dist/mcp/tools/index.js +1 -1
  66. package/dist/mcp/tools/tdx-run.js +1 -1
  67. package/dist/mcp/tools/tdx-search.js +1 -1
  68. package/dist/mcp/utils.js +1 -1
  69. package/dist/proxy/claude-usage-tracker.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/sse-usage-parser.js +1 -1
  72. package/dist/sdk/agent/agent-config.js +1 -1
  73. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  74. package/dist/sdk/agent/agent-yaml.js +1 -1
  75. package/dist/sdk/agent/test/evaluator.js +1 -1
  76. package/dist/sdk/agent/test/executor.js +1 -1
  77. package/dist/sdk/agent/test/index.js +1 -1
  78. package/dist/sdk/agent/test/output.js +1 -1
  79. package/dist/sdk/agent/test/parser.js +1 -1
  80. package/dist/sdk/agent/tool-target-registry.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/delivery-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/delivery.js +1 -1
  95. package/dist/sdk/engage/campaign-pull.js +1 -1
  96. package/dist/sdk/engage/campaign-push.js +1 -1
  97. package/dist/sdk/engage/campaign-validator.js +1 -1
  98. package/dist/sdk/engage/campaign-yaml.js +1 -1
  99. package/dist/sdk/engage/types/campaign-def.js +1 -1
  100. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  101. package/dist/sdk/engage.js +1 -1
  102. package/dist/sdk/errors.js +1 -1
  103. package/dist/sdk/index.js +1 -1
  104. package/dist/sdk/io/index.js +1 -1
  105. package/dist/sdk/io/node-filesystem.js +1 -1
  106. package/dist/sdk/job.js +1 -1
  107. package/dist/sdk/journey.js +1 -1
  108. package/dist/sdk/llm/chat-cache.js +1 -1
  109. package/dist/sdk/llm/index.js +1 -1
  110. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/personalization.js +1 -1
  113. package/dist/sdk/query/index.js +1 -1
  114. package/dist/sdk/query/sql-parser.js +1 -1
  115. package/dist/sdk/realtime.js +1 -1
  116. package/dist/sdk/schedule.js +1 -1
  117. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  118. package/dist/sdk/segment/fields-display.js +1 -1
  119. package/dist/sdk/segment/file-discovery.js +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-validator.js +1 -1
  122. package/dist/sdk/segment/journey-yaml.js +1 -1
  123. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  124. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  125. package/dist/sdk/segment/pull-workflow.js +1 -1
  126. package/dist/sdk/segment/push-recovery.js +1 -1
  127. package/dist/sdk/segment/push-workflow.js +1 -1
  128. package/dist/sdk/segment/resolution-context.js +1 -1
  129. package/dist/sdk/segment/segment-path-parser.js +1 -1
  130. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  131. package/dist/sdk/segment/segment-validator.js +1 -1
  132. package/dist/sdk/segment/target-resolution.js +1 -1
  133. package/dist/sdk/segment/tdx-config.js +1 -1
  134. package/dist/sdk/segment/types/activation-schema.js +1 -1
  135. package/dist/sdk/segment/types/journey-def.js +1 -1
  136. package/dist/sdk/segment/types/journey-schema.js +1 -1
  137. package/dist/sdk/segment/types/segment-def.js +1 -1
  138. package/dist/sdk/segment/types/segment-schema.js +1 -1
  139. package/dist/sdk/segment/validate-files.js +1 -1
  140. package/dist/sdk/segment/yaml-validator.js +1 -1
  141. package/dist/sdk/segment.js +1 -1
  142. package/dist/sdk/types/index.js +1 -1
  143. package/dist/sdk/types/progress.js +1 -1
  144. package/dist/sdk/user.js +1 -1
  145. package/dist/sdk/util/format-detector.js +1 -1
  146. package/dist/sdk/util/formatters.js +1 -1
  147. package/dist/sdk/util/index.js +1 -1
  148. package/dist/sdk/util/tree-formatter.js +1 -1
  149. package/dist/sdk/workflow/archive-validation.js +1 -1
  150. package/dist/sdk/workflow/clone-workflow.js +1 -1
  151. package/dist/sdk/workflow/index.js +1 -1
  152. package/dist/sdk/workflow/pull-workflow.js +1 -1
  153. package/dist/sdk/workflow/push-workflow.js +1 -1
  154. package/dist/sdk/workflow/tdx-config.js +1 -1
  155. package/dist/sdk/workflow/workflow-utils.js +1 -1
  156. package/dist/test-utils/command-runner.js +1 -1
  157. package/dist/test-utils/factories.js +1 -1
  158. package/dist/test-utils/fixtures.js +1 -1
  159. package/dist/test-utils/http-mock.js +1 -1
  160. package/dist/test-utils/index.js +1 -1
  161. package/dist/utils/async.js +1 -1
  162. package/dist/utils/colors.js +1 -1
  163. package/dist/utils/diff.js +1 -1
  164. package/dist/utils/file-permissions.js +1 -1
  165. package/dist/utils/file-reader.js +1 -1
  166. package/dist/utils/global-cache.js +1 -1
  167. package/dist/utils/json-loader.js +1 -1
  168. package/dist/utils/local-cache.js +1 -1
  169. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  170. package/dist/utils/logger/formatters/index.js +1 -1
  171. package/dist/utils/logger/handlers/console-handler.js +1 -1
  172. package/dist/utils/logger/handlers/file-handler.js +1 -1
  173. package/dist/utils/logger/handlers/index.js +1 -1
  174. package/dist/utils/logger/handlers/null-handler.js +1 -1
  175. package/dist/utils/logger/index.js +1 -1
  176. package/dist/utils/logger/logger.js +1 -1
  177. package/dist/utils/logger/types.js +1 -1
  178. package/dist/utils/option-validation.js +1 -1
  179. package/dist/utils/process.js +1 -1
  180. package/dist/utils/prompt.js +1 -1
  181. package/dist/utils/spinner.js +1 -1
  182. package/dist/utils/sse-parser.js +1 -1
  183. package/dist/utils/string-utils.js +1 -1
  184. package/dist/utils/table-ref-parser.js +1 -1
  185. package/dist/utils/tdx-logger.js +1 -1
  186. package/dist/utils/version-check.js +1 -1
  187. package/package.json +1 -1
@@ -1 +1 @@
1
- const a47_0x3f412b=a47_0x4c19;(function(_0xfa0699,_0xa7a5c7){const _0x4d5282=a47_0x4c19,_0x1fcc67=_0xfa0699();while(!![]){try{const _0x35f2f2=-parseInt(_0x4d5282(0x117))/0x1+parseInt(_0x4d5282(0x183))/0x2*(-parseInt(_0x4d5282(0x1ab))/0x3)+parseInt(_0x4d5282(0x286))/0x4+parseInt(_0x4d5282(0x13e))/0x5*(-parseInt(_0x4d5282(0x1e9))/0x6)+-parseInt(_0x4d5282(0x225))/0x7+parseInt(_0x4d5282(0x197))/0x8+parseInt(_0x4d5282(0x28b))/0x9;if(_0x35f2f2===_0xa7a5c7)break;else _0x1fcc67['push'](_0x1fcc67['shift']());}catch(_0x221563){_0x1fcc67['push'](_0x1fcc67['shift']());}}}(a47_0x3e77,0x9ab9e));import a47_0x2874bf from'chalk';import{existsSync}from'fs';import a47_0x19d684 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 a47_0x5ff89f from'prompts';function getAttemptStatusDisplay(_0x27edec){const _0x37bba6=a47_0x4c19;if(!_0x27edec)return{'icon':'⏳','text':''};const {done:_0x2427e2,success:_0x3c368f,cancelRequested:_0x3d1d4e}=_0x27edec;if(!_0x2427e2)return _0x3d1d4e?{'icon':'🛑','text':a47_0x2874bf[_0x37bba6(0x23d)](_0x37bba6(0x283))}:{'icon':'🔄','text':a47_0x2874bf[_0x37bba6(0x147)](_0x37bba6(0x1e3))};if(_0x3c368f)return{'icon':'✅','text':a47_0x2874bf[_0x37bba6(0x11b)](_0x37bba6(0x137))};return{'icon':'❌','text':a47_0x2874bf[_0x37bba6(0x148)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a47_0x3f412b(0x10e)](_0x2b4e25,_0x506f01,_0x59088a=0x0){const _0x31e0aa=a47_0x3f412b;return _0x2b4e25[_0x59088a]||_0x506f01[_0x31e0aa(0x144)];}[a47_0x3f412b(0xf6)](_0x1c8366,_0x10c594,_0x9cfa89=0x0){const _0x472f6c=a47_0x3f412b,_0x32d0a6=this[_0x472f6c(0x10e)](_0x1c8366,_0x10c594,_0x9cfa89);if(!_0x32d0a6)return console['error'](a47_0x2874bf[_0x472f6c(0x148)](_0x472f6c(0x133)),'Project\x20name\x20is\x20required'),console['error'](a47_0x2874bf[_0x472f6c(0x297)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x32d0a6;}[a47_0x3f412b(0x263)](_0x39bf0e,_0x4b6602){const _0x2a32d4=a47_0x3f412b;if(_0x39bf0e[0x0]){const _0x38b9b5=_0x39bf0e[0x0]['split']('.');if(_0x38b9b5[_0x2a32d4(0x25d)]===0x1)return{'projectName':_0x38b9b5[0x0],'workflowName':undefined};else return _0x38b9b5[_0x2a32d4(0x25d)]===0x2?{'projectName':_0x38b9b5[0x0],'workflowName':_0x38b9b5[0x1]}:(console[_0x2a32d4(0x1a3)](a47_0x2874bf[_0x2a32d4(0x148)](_0x2a32d4(0x133)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x4b6602['workflowProject'],'workflowName':undefined};}[a47_0x3f412b(0x1ce)](_0x1ad84d,_0x38ff65,_0x270f2a=0x0){const _0x454a17=a47_0x3f412b;if(_0x1ad84d[_0x270f2a])return _0x1ad84d[_0x270f2a];if(_0x38ff65['workflowProject']){const _0xa11a55=a47_0x19d684[_0x454a17(0x1b4)](process[_0x454a17(0x22e)](),_0x454a17(0x125),_0x38ff65[_0x454a17(0x144)]);if(existsSync(a47_0x19d684[_0x454a17(0x1b4)](_0xa11a55,_0x454a17(0x22b))))return _0xa11a55;}return undefined;}async[a47_0x3f412b(0x1fc)](_0x30fbcb,_0x4b34ba,_0x5b3ed5){const _0x596a95=a47_0x3f412b;try{const _0x45b14a=await _0x30fbcb[_0x596a95(0x184)][_0x596a95(0x125)](_0x4b34ba,{'limit':0x1});if(_0x45b14a[_0x596a95(0x25d)]>0x0){const _0x56aa5b=_0x45b14a[0x0]['id'],_0x2a1ff4=getWorkflowUrl(_0x5b3ed5,_0x56aa5b);console[_0x596a95(0x1a3)](_0x596a95(0xf7)+a47_0x2874bf['cyan'](_0x2a1ff4));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x24d);[a47_0x3f412b(0xf3)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a47_0x3f412b(0x207)](_0x2d1cd5){const _0x2d711d=a47_0x3f412b,{options:_0x3a7c6b,args:_0x4957ce,tdx:_0x227360}=_0x2d1cd5,_0x4fc619=_0x4957ce[0x0],_0x17d24d=_0x3a7c6b[_0x2d711d(0x14d)];if(_0x17d24d)return saveSessionContext({'workflow_project':undefined},_0x3a7c6b[_0x2d711d(0x1cc)]),console[_0x2d711d(0x104)](a47_0x2874bf['green'](_0x2d711d(0x10d))),0x0;if(!_0x4fc619)return console[_0x2d711d(0x1a3)](a47_0x2874bf[_0x2d711d(0x148)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x2d711d(0x1a3)](a47_0x2874bf[_0x2d711d(0x297)](_0x2d711d(0x1d8))),console[_0x2d711d(0x1a3)](a47_0x2874bf[_0x2d711d(0x297)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5ce145=await withSpinner(_0x2d711d(0x1bd)+_0x4fc619+_0x2d711d(0x1b9),()=>_0x227360['workflow'][_0x2d711d(0x195)](_0x4fc619),{'verbose':_0x3a7c6b[_0x2d711d(0x1aa)]}),{name:_0x4f1e45}=_0x5ce145[_0x2d711d(0x276)];return saveSessionContext({'workflow_project':_0x4f1e45},_0x3a7c6b[_0x2d711d(0x1cc)]),console[_0x2d711d(0x104)](a47_0x2874bf['green'](_0x2d711d(0x174)+a47_0x2874bf['cyan'](_0x4f1e45))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a47_0x3f412b(0x200);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x212);async[a47_0x3f412b(0x207)](_0x3090f9){const _0x527d9a=a47_0x3f412b,{options:_0x40fb14,args:_0x36bdfa,tdx:_0x4f803f}=_0x3090f9,_0xc19dba=_0x36bdfa[0x0];_0x40fb14[_0x527d9a(0x1aa)]&&_0xc19dba&&console['error'](_0x527d9a(0x11c)+_0xc19dba);const _0x296fe8=await withSpinner(_0x527d9a(0x180),()=>_0x4f803f[_0x527d9a(0x184)]['projects'](_0xc19dba,{'limit':_0x40fb14[_0x527d9a(0x1f8)]}),{'verbose':_0x40fb14[_0x527d9a(0x1aa)]});let _0xa44ed1=_0x296fe8[_0x527d9a(0x276)];_0xa44ed1['sort']((_0x279fd9,_0x1f65a0)=>_0x279fd9['name']['localeCompare'](_0x1f65a0[_0x527d9a(0x280)]));const _0x40d1a3=_0x40fb14['limit']||0x64,_0x2c64ce=_0xa44ed1[_0x527d9a(0x25d)]>=_0x40d1a3?a47_0x2874bf['dim'](_0x527d9a(0x187)):'';console[_0x527d9a(0x1a3)](_0x527d9a(0x1db)+_0xa44ed1[_0x527d9a(0x25d)]+'\x20project'+(_0xa44ed1['length']!==0x1?'s':'')+_0x2c64ce);if(_0x40fb14[_0x527d9a(0x281)]===_0x527d9a(0x1a8)||_0x40fb14[_0x527d9a(0x281)]===_0x527d9a(0x13d)||_0x40fb14[_0x527d9a(0x281)]===_0x527d9a(0x1e0))await handleSDKOutput(_0xa44ed1,_0x40fb14);else{if(_0xa44ed1[_0x527d9a(0x25d)]===0x0)_0xc19dba?console[_0x527d9a(0x104)](_0x527d9a(0x16b)+_0xc19dba):console[_0x527d9a(0x104)]('No\x20workflow\x20projects\x20found');else{const _0x541d35=_0xa44ed1[_0x527d9a(0x11e)](_0x1351f1=>{const _0x1e8d6a=_0x527d9a,_0x3e9a00=_0x1351f1['metadata']?.[_0x1e8d6a(0x273)](_0x194ec4=>_0x194ec4['key']===_0x1e8d6a(0x16c)),_0x5e92ad=_0x3e9a00?a47_0x2874bf[_0x1e8d6a(0x297)](_0x1e8d6a(0x236)):'';return _0x1e8d6a(0x264)+_0x1351f1[_0x1e8d6a(0x280)]+_0x5e92ad;});await writeOutput(_0x541d35[_0x527d9a(0x1b4)]('\x0a'),_0x40fb14['output'],_0x527d9a(0x288));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x169);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x210);async[a47_0x3f412b(0x207)](_0x26e9e7){const _0x489524=a47_0x3f412b,{options:_0x1965c7,args:_0x5f2b67,tdx:_0x2b2300}=_0x26e9e7,_0x2cad4c=this[_0x489524(0x10e)](_0x5f2b67,_0x1965c7);_0x1965c7[_0x489524(0x1aa)]&&_0x2cad4c&&console[_0x489524(0x1a3)](_0x489524(0x134)+_0x2cad4c);const _0x53b883=await withSpinner(_0x489524(0x21a),()=>_0x2b2300['workflow'][_0x489524(0x125)](_0x2cad4c,{'limit':_0x1965c7[_0x489524(0x1f8)]}),{'verbose':_0x1965c7['verbose']});let _0x2f5ccf=_0x53b883[_0x489524(0x276)];_0x2f5ccf[_0x489524(0x298)]((_0x1665b7,_0x48ab28)=>{const _0x3f84a4=_0x489524,_0x24b86c=_0x1665b7[_0x3f84a4(0x280)]['localeCompare'](_0x48ab28[_0x3f84a4(0x280)]);if(_0x24b86c!==0x0)return _0x24b86c;return(_0x1665b7[_0x3f84a4(0x1d2)]?.['name']||'')[_0x3f84a4(0x15c)](_0x48ab28['project']?.['name']||'');});const _0x5ab667=_0x1965c7[_0x489524(0x1f8)]||0x64,_0x38ef69=_0x2f5ccf[_0x489524(0x25d)]>=_0x5ab667?a47_0x2874bf[_0x489524(0x297)](_0x489524(0x187)):'';console[_0x489524(0x1a3)]('✔\x20Found\x20'+_0x2f5ccf[_0x489524(0x25d)]+_0x489524(0x108)+(_0x2f5ccf['length']!==0x1?'s':'')+_0x38ef69);if(_0x1965c7['format']==='json'||_0x1965c7[_0x489524(0x281)]===_0x489524(0x13d)||_0x1965c7[_0x489524(0x281)]==='table')await handleSDKOutput(_0x2f5ccf,_0x1965c7);else{if(_0x2f5ccf[_0x489524(0x25d)]===0x0)_0x2cad4c?console['log'](_0x489524(0x18f)+_0x2cad4c):console['log'](_0x489524(0x24a));else{const _0x3848de=_0x1965c7[_0x489524(0x1dd)],_0x49d9e7=_0x2f5ccf[_0x489524(0x11e)](_0x217af1=>{const _0x566cc4=_0x489524,_0x31ade7=a47_0x2874bf['dim']('#'+_0x217af1['id']),_0x4e94d5=hyperlink(_0x31ade7,getWorkflowUrl(_0x3848de,_0x217af1['id'])),_0x46cdda=_0x217af1[_0x566cc4(0x1d2)]?.[_0x566cc4(0x280)]?a47_0x2874bf[_0x566cc4(0x297)]('\x20('+_0x217af1[_0x566cc4(0x1d2)][_0x566cc4(0x280)]+')'):'';return _0x566cc4(0x27d)+_0x4e94d5+'\x20'+_0x217af1[_0x566cc4(0x280)]+_0x46cdda;});await writeOutput(_0x49d9e7[_0x489524(0x1b4)]('\x0a'),_0x1965c7[_0x489524(0x220)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a47_0x3f412b(0x274);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x1d1);async['execute'](_0x228b5e){const _0x20fa10=a47_0x3f412b,{options:_0xfb6934,args:_0x332a2e,tdx:_0x4c69e7}=_0x228b5e,_0x5f5161=this[_0x20fa10(0x263)](_0x332a2e,_0xfb6934);if(!_0x5f5161)return 0x1;const {projectName:_0x5b8e82,workflowName:_0x4ce1c4}=_0x5f5161;if(_0xfb6934[_0x20fa10(0x1aa)]){if(_0x5b8e82&&_0x4ce1c4)console[_0x20fa10(0x1a3)](_0x20fa10(0x216)+_0x5b8e82+'.'+_0x4ce1c4);else _0x5b8e82&&console[_0x20fa10(0x1a3)](_0x20fa10(0x250)+_0x5b8e82);const _0x490790=_0xfb6934[_0x20fa10(0xec)];_0x490790&&console[_0x20fa10(0x1a3)]('Status:\x20'+_0x490790);}let _0xf2b76a=0x28;if(process[_0x20fa10(0x243)][_0x20fa10(0x232)]&&!_0xfb6934[_0x20fa10(0x220)]&&!_0xfb6934[_0x20fa10(0x281)]){const _0x3c0198=process[_0x20fa10(0x243)][_0x20fa10(0x143)]||0x28;_0xf2b76a=Math[_0x20fa10(0x12b)](0x14,Math[_0x20fa10(0x21d)](_0x3c0198*0x2/0x3));}const _0x427c46=_0xfb6934[_0x20fa10(0x1f8)]||_0xf2b76a,_0x273b04=await withSpinner(_0x20fa10(0x272),()=>_0x4c69e7[_0x20fa10(0x184)]['sessions']({'projectName':_0x5b8e82,'workflowName':_0x4ce1c4,'status':_0xfb6934[_0x20fa10(0xec)],'fromTime':_0xfb6934[_0x20fa10(0x24c)],'toTime':_0xfb6934['to'],'limit':_0x427c46}),{'verbose':_0xfb6934[_0x20fa10(0x1aa)]}),_0x499cf8=_0x273b04['data'];_0x499cf8[_0x20fa10(0x298)]((_0x4b203b,_0xb9117e)=>{const _0x33cd27=_0x20fa10,_0x18de4d=_0x4b203b[_0x33cd27(0x122)]||'',_0x56baea=_0xb9117e['sessionTime']||'';return _0x56baea[_0x33cd27(0x15c)](_0x18de4d);});_0x499cf8[_0x20fa10(0x25d)]>=_0x427c46?console['error'](_0x20fa10(0x132)+_0x499cf8[_0x20fa10(0x25d)]+_0x20fa10(0xf2)+a47_0x2874bf[_0x20fa10(0x297)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x20fa10(0x1a3)](_0x20fa10(0x1db)+_0x499cf8[_0x20fa10(0x25d)]+_0x20fa10(0x268)+(_0x499cf8[_0x20fa10(0x25d)]!==0x1?'s':''));if(_0xfb6934[_0x20fa10(0x281)]===_0x20fa10(0x1a8)||_0xfb6934[_0x20fa10(0x281)]==='jsonl'||_0xfb6934[_0x20fa10(0x281)]===_0x20fa10(0x1e0))await handleSDKOutput(_0x499cf8,_0xfb6934);else{if(!process[_0x20fa10(0x243)][_0x20fa10(0x232)]||_0xfb6934['output']){if(_0x499cf8[_0x20fa10(0x25d)]===0x0){if(_0x5b8e82&&_0x4ce1c4)console['log'](_0x20fa10(0x142)+_0x5b8e82+'.'+_0x4ce1c4);else _0x5b8e82?console[_0x20fa10(0x104)](_0x20fa10(0x21b)+_0x5b8e82):console[_0x20fa10(0x104)](_0x20fa10(0x269));}else{const _0xb6745f=_0xfb6934['site'],_0x1c4ef9=this[_0x20fa10(0x1cd)](_0x499cf8,_0xb6745f);_0xfb6934[_0x20fa10(0x220)]?await writeOutput(_0x1c4ef9,_0xfb6934[_0x20fa10(0x220)],'list'):console[_0x20fa10(0x104)](_0x1c4ef9);}!_0x5b8e82&&(console[_0x20fa10(0x1a3)](''),console[_0x20fa10(0x1a3)](a47_0x2874bf[_0x20fa10(0x297)](_0x20fa10(0x196))),console[_0x20fa10(0x1a3)](a47_0x2874bf['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a47_0x2874bf[_0x20fa10(0x297)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x499cf8[_0x20fa10(0x25d)]===0x0){if(_0x5b8e82&&_0x4ce1c4)console[_0x20fa10(0x104)](_0x20fa10(0x142)+_0x5b8e82+'.'+_0x4ce1c4);else _0x5b8e82?console[_0x20fa10(0x104)](_0x20fa10(0x21b)+_0x5b8e82):console[_0x20fa10(0x104)](_0x20fa10(0x269));}else await this[_0x20fa10(0x284)](_0x499cf8,_0x228b5e,_0x5b8e82);}}return 0x0;}[a47_0x3f412b(0x1cd)](_0x8cbbe,_0x2dcabe){const _0x1afc12=a47_0x3f412b,_0x1f5f7a=[],_0xb76d03=new Map();let _0x367889=Infinity,_0x5c3007=-Infinity;for(const _0x1367a6 of _0x8cbbe){if(_0x1367a6[_0x1afc12(0x202)]?.[_0x1afc12(0x194)]){const _0x17ffac=new Date(_0x1367a6[_0x1afc12(0x202)][_0x1afc12(0x194)])[_0x1afc12(0x241)](),_0x207b14=_0x1367a6[_0x1afc12(0x202)][_0x1afc12(0x27b)]?new Date(_0x1367a6[_0x1afc12(0x202)][_0x1afc12(0x27b)])[_0x1afc12(0x241)]():Date[_0x1afc12(0xf4)](),_0x14a89e=_0x1367a6[_0x1afc12(0x1d2)]?.[_0x1afc12(0x280)]||_0x1afc12(0x199);!_0xb76d03[_0x1afc12(0x266)](_0x14a89e)&&_0xb76d03['set'](_0x14a89e,[]),_0xb76d03[_0x1afc12(0x252)](_0x14a89e)['push']({'session':_0x1367a6,'startTime':_0x17ffac,'endTime':_0x207b14,'duration':_0x207b14-_0x17ffac}),_0x367889=Math[_0x1afc12(0x146)](_0x367889,_0x17ffac),_0x5c3007=Math[_0x1afc12(0x12b)](_0x5c3007,_0x207b14);}}if(_0xb76d03[_0x1afc12(0x1b2)]===0x0)return _0x1afc12(0x251);const _0x66fad0=process[_0x1afc12(0x243)][_0x1afc12(0x221)]||0x78,_0x78dba2=0x1e,_0x45a9ae=0x32,_0x350d5f=0x4,_0x5a0212=Math[_0x1afc12(0x146)](_0x45a9ae,Math['max'](_0x78dba2,Math[_0x1afc12(0x21d)](_0x66fad0*0.3))),_0x2ce053=_0x66fad0-_0x5a0212-TIMELINE_CONFIG[_0x1afc12(0x138)]-0x3-_0x350d5f,_0x3a68a4=_0x5c3007-_0x367889,_0x28631b=_0x3a68a4/_0x5a0212,_0x564236=renderTimeAxis({'startTime':_0x367889,'endTime':_0x5c3007,'durationMs':_0x3a68a4,'msPerChar':_0x28631b},_0x5a0212),_0x3f99c5=[];for(const _0x552f47 of _0xb76d03[_0x1afc12(0x1ed)]()){_0x3f99c5[_0x1afc12(0x119)](..._0x552f47);}_0x3f99c5[_0x1afc12(0x298)]((_0x758188,_0x59e35d)=>_0x59e35d['startTime']-_0x758188[_0x1afc12(0x233)]);const _0x3781e6=new Date(_0x367889),_0x400c0f=formatDate(_0x3781e6),_0x493477=_0x350d5f+TIMELINE_CONFIG[_0x1afc12(0x279)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2ce053,_0x32ea58='\x20'['repeat'](_0x493477-_0x400c0f[_0x1afc12(0x25d)]),_0x30561f=_0x32ea58+a47_0x2874bf[_0x1afc12(0x297)](_0x400c0f)+'\x20'+_0x564236;_0x1f5f7a[_0x1afc12(0x119)](_0x30561f);const _0x4111d0=0x16;let _0x437c6c=0x0;for(const _0x10fc6c of _0x3f99c5){const _0x7770a3=_0x10fc6c[_0x1afc12(0x1cc)][_0x1afc12(0x1d2)]?.[_0x1afc12(0x280)]||'?',_0x282366=Math['min'](stringWidth(_0x7770a3),_0x4111d0);_0x437c6c=Math[_0x1afc12(0x12b)](_0x437c6c,_0x282366);}for(const _0x145b03 of _0x3f99c5){const {session:_0x503794,startTime:_0x224448,endTime:_0x4e5fc5,duration:_0x1e6277}=_0x145b03,_0x40fe8f=_0x503794[_0x1afc12(0x1d2)]?.['id'],_0x11242a=_0x503794['id'],_0x521021=_0x503794[_0x1afc12(0x1d2)]?.[_0x1afc12(0x280)]||'?',_0x5984a0=_0x503794[_0x1afc12(0x184)]?.['name']||'?';let _0x45553c,_0x7f172;if(_0x503794[_0x1afc12(0x202)]){const _0x210ca8=_0x503794['lastAttempt'];!_0x210ca8[_0x1afc12(0x237)]?(_0x45553c=_0x210ca8[_0x1afc12(0x214)]?'🛑':'🔄',_0x7f172=_0x210ca8[_0x1afc12(0x214)]?a47_0x2874bf[_0x1afc12(0x23d)]:a47_0x2874bf[_0x1afc12(0x147)]):(_0x45553c=_0x210ca8[_0x1afc12(0x137)]?'✅':'❌',_0x7f172=_0x210ca8[_0x1afc12(0x137)]?a47_0x2874bf['green']:a47_0x2874bf[_0x1afc12(0x148)]);}else _0x45553c='⏳',_0x7f172=a47_0x2874bf['dim'];const _0x374f8d='#'+_0x11242a,_0x35a39b=_0x40fe8f?hyperlink(_0x374f8d,getWorkflowSessionUrl(_0x2dcabe,_0x40fe8f,_0x11242a)):_0x374f8d;let _0x5aa9c0=_0x521021;stringWidth(_0x521021)>_0x4111d0&&(_0x5aa9c0=_0x521021['slice'](0x0,_0x4111d0-0x1)+'…');const _0x3f5f20=a47_0x2874bf[_0x1afc12(0x297)](_0x5aa9c0),_0x36b6fa=stringWidth(_0x5aa9c0),_0x3642eb='\x20'[_0x1afc12(0x157)](_0x437c6c-stringWidth(_0x5aa9c0)+0x2),_0x2d219f='('+formatElapsed(_0x1e6277)+')',_0x995459=stringWidth(_0x2d219f),_0x29fa0f=stringWidth(_0x374f8d),_0x24e3a6=_0x29fa0f+0x1+_0x36b6fa+_0x3642eb[_0x1afc12(0x25d)],_0x1488b0=_0x2ce053-_0x24e3a6-_0x995459-0x1-0x8;let _0x34b4d7=_0x5984a0;stringWidth(_0x34b4d7)>_0x1488b0&&(_0x34b4d7=_0x34b4d7[_0x1afc12(0x23e)](0x0,_0x1488b0-0x1)+'…');const _0x3740c2=_0x35a39b+'\x20'+_0x3f5f20+_0x3642eb+_0x34b4d7,_0x112fa4=stringWidth(_0x3740c2),_0x38afbb=_0x2ce053-_0x112fa4-_0x995459,_0x51e4bb=_0x3740c2+'\x20'[_0x1afc12(0x157)](Math[_0x1afc12(0x12b)](0x1,_0x38afbb))+a47_0x2874bf[_0x1afc12(0x297)](_0x2d219f),_0x4417f0=Math[_0x1afc12(0x21d)]((_0x224448-_0x367889)/_0x28631b),_0xb7836e=Math[_0x1afc12(0x21d)]((_0x4e5fc5-_0x367889)/_0x28631b),_0x243686=Math[_0x1afc12(0x12b)](_0x4417f0+0x1,_0xb7836e),_0x2a3ff8=new Array(_0x5a0212)[_0x1afc12(0x11a)]('\x20');for(let _0x1c30a6=_0x4417f0;_0x1c30a6<Math[_0x1afc12(0x146)](_0x243686,_0x5a0212);_0x1c30a6++){_0x2a3ff8[_0x1c30a6]='─';}const _0x4d85e0=_0x2a3ff8[_0x1afc12(0x11e)](_0x586cb9=>_0x586cb9==='\x20'?'\x20':_0x7f172(_0x586cb9))['join']('');_0x1f5f7a['push'](_0x45553c+'\x20'+_0x51e4bb+'│'+_0x4d85e0+'│');}return _0x1f5f7a[_0x1afc12(0x1b4)]('\x0a');}async[a47_0x3f412b(0x284)](_0x23ebd9,_0x3312b2,_0x4dee37){const _0x53c28e=a47_0x3f412b,{options:_0x314359,tdx:_0x2bb854}=_0x3312b2,_0x1a392f=_0x314359[_0x53c28e(0x1dd)],{timelineRows:_0x35627b,timeAxisHeader:_0x1df1ed}=this[_0x53c28e(0xfd)](_0x23ebd9,_0x1a392f),_0x94a4fb=_0x35627b[_0x53c28e(0x167)](_0xc00489=>_0xc00489[_0x53c28e(0x22c)]);if(_0x94a4fb[_0x53c28e(0x25d)]===0x0){const _0x330fc0=this['renderSessionsTimeline'](_0x23ebd9,_0x1a392f);console[_0x53c28e(0x104)](_0x330fc0);!_0x4dee37&&(console[_0x53c28e(0x1a3)](''),console[_0x53c28e(0x1a3)](a47_0x2874bf[_0x53c28e(0x297)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x53c28e(0x1a3)](a47_0x2874bf['dim'](_0x53c28e(0x171))+'or'+a47_0x2874bf[_0x53c28e(0x297)](_0x53c28e(0x1c9))));return;}_0x1df1ed&&console['log'](_0x1df1ed);const _0x1cb127=_0x35627b[_0x53c28e(0x167)](_0x4d4419=>_0x4d4419['attemptId'])[_0x53c28e(0x11e)](_0x542327=>({'title':_0x542327[_0x53c28e(0x1a2)],'value':_0x542327['attemptId']})),_0x5ab4e=process[_0x53c28e(0x243)][_0x53c28e(0x143)]||0x3c,_0x419aee=Math[_0x53c28e(0x12b)](0x28,Math[_0x53c28e(0x21d)](_0x5ab4e*0x2/0x3)),_0x3d267f=await a47_0x5ff89f({'type':'autocomplete','name':_0x53c28e(0x22c),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x1cb127,'initial':-0x1,'limit':_0x419aee,'clearFirst':!![],'fallback':{'title':_0x53c28e(0x181),'value':null},'suggest':(_0x329091,_0x324c30)=>{const _0x445479=_0x53c28e;if(!_0x329091)return Promise[_0x445479(0x16d)](_0x324c30);const _0xa20a2f=_0x324c30[_0x445479(0x167)](_0x2f5985=>{const _0x19d9f0=_0x445479,_0x12f780=_0x2f5985;return _0x12f780[_0x19d9f0(0x219)][_0x19d9f0(0x1c0)]()[_0x19d9f0(0x25a)](_0x329091[_0x19d9f0(0x1c0)]());});return Promise[_0x445479(0x16d)](_0xa20a2f);}}),_0x13d876=()=>{const _0x245075=_0x53c28e;process[_0x245075(0x243)][_0x245075(0x135)]('\x1b[1A\x1b[2K'),process[_0x245075(0x243)][_0x245075(0x135)](_0x245075(0xfa)),process[_0x245075(0x243)][_0x245075(0x135)](_0x245075(0xfa));},_0x4f834=_0x3d267f&&_0x3d267f[_0x53c28e(0x22c)]&&_0x3d267f[_0x53c28e(0x22c)]!==null&&_0x3d267f[_0x53c28e(0x22c)]['trim']()!=='';if(!_0x4f834){_0x13d876(),console[_0x53c28e(0x104)](a47_0x2874bf[_0x53c28e(0x297)](_0x53c28e(0x139)));return;}_0x13d876();const _0x5530d=_0x23ebd9['find'](_0x58e017=>_0x58e017[_0x53c28e(0x202)]?.['id']===_0x3d267f[_0x53c28e(0x22c)]);if(_0x5530d){const _0x4d2961=_0x5530d[_0x53c28e(0x1d2)]?.[_0x53c28e(0x280)]||'?',_0x240018=_0x5530d[_0x53c28e(0x184)]?.[_0x53c28e(0x280)]||'?';console[_0x53c28e(0x104)](_0x53c28e(0x222)+a47_0x2874bf['dim'](_0x4d2961)+',\x20Workflow:\x20'+a47_0x2874bf[_0x53c28e(0x297)](_0x240018));}const _0xf0678d=new WorkflowTimelineCommand();await _0xf0678d['execute']({'args':[],'options':{..._0x314359,'attemptId':_0x3d267f[_0x53c28e(0x22c)]},'tdx':_0x2bb854});}[a47_0x3f412b(0xfd)](_0xfc5480,_0x3d89ae){const _0x283277=a47_0x3f412b,_0x8deba=new Map();for(const _0x399acf of _0xfc5480){_0x399acf['id']&&_0x399acf[_0x283277(0x202)]?.['id']&&_0x8deba[_0x283277(0x1e1)](_0x399acf['id'],_0x399acf[_0x283277(0x202)]['id']);}const _0x19d2b6=[];let _0x5edfa0='';const _0x169a65=this[_0x283277(0x1cd)](_0xfc5480,_0x3d89ae),_0x9d8a2e=_0x169a65[_0x283277(0x1a0)]('\x0a');for(const _0x580b03 of _0x9d8a2e){if(_0x580b03[_0x283277(0x177)](_0x283277(0x15b))||_0x580b03['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x5edfa0=_0x580b03;else{if(_0x580b03[_0x283277(0x141)](/^[✅❌🔄🛑⏳]/)){const _0x5bd25e=_0x580b03[_0x283277(0x141)](/#(\d+)/),_0x30fa04=_0x5bd25e?_0x5bd25e[0x1]:null,_0x1918fe=_0x30fa04?_0x8deba[_0x283277(0x252)](_0x30fa04)||null:null,_0x58d41c=_0xfc5480['find'](_0x3c12e3=>_0x3c12e3['id']===_0x30fa04),_0x9e7baa=_0x58d41c?.[_0x283277(0x1d2)]?.[_0x283277(0x280)]||'';_0x19d2b6['push']({'displayLine':_0x580b03,'attemptId':_0x1918fe,'projectName':_0x9e7baa});}}}return{'timelineRows':_0x19d2b6,'timeAxisHeader':_0x5edfa0};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x1be);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x27c);async[a47_0x3f412b(0x207)](_0x2e1464){const _0x78ff31=a47_0x3f412b,{options:_0x3f7bbd,args:_0x3eb336,tdx:_0x579174}=_0x2e1464,_0x52495f=this['parseProjectWorkflowPattern'](_0x3eb336,_0x3f7bbd);if(!_0x52495f)return 0x1;const {projectName:_0x2f762c,workflowName:_0x3b2edc}=_0x52495f,_0x56448f=_0x3f7bbd[_0x78ff31(0x28e)];if(_0x3f7bbd['verbose']){if(_0x2f762c&&_0x3b2edc)console[_0x78ff31(0x1a3)]('Filter:\x20'+_0x2f762c+'.'+_0x3b2edc);else _0x2f762c&&console[_0x78ff31(0x1a3)](_0x78ff31(0x250)+_0x2f762c);_0x56448f&&console[_0x78ff31(0x1a3)](_0x78ff31(0x107));}const _0x172080=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x579174[_0x78ff31(0x184)][_0x78ff31(0x289)]({'projectName':_0x2f762c,'workflowName':_0x3b2edc,'includeRetried':_0x56448f,'limit':_0x3f7bbd[_0x78ff31(0x1f8)]}),{'verbose':_0x3f7bbd[_0x78ff31(0x1aa)]}),_0x4f3fdf=_0x172080[_0x78ff31(0x276)],_0x3588e6=_0x3f7bbd[_0x78ff31(0x1f8)]||0x64,_0x594d94=_0x4f3fdf[_0x78ff31(0x25d)]>=_0x3588e6?a47_0x2874bf[_0x78ff31(0x297)](_0x78ff31(0x187)):'';console[_0x78ff31(0x1a3)](_0x78ff31(0x1db)+_0x4f3fdf['length']+_0x78ff31(0x118)+(_0x4f3fdf[_0x78ff31(0x25d)]!==0x1?'s':'')+_0x594d94);if(_0x3f7bbd[_0x78ff31(0x281)]===_0x78ff31(0x1a8)||_0x3f7bbd[_0x78ff31(0x281)]===_0x78ff31(0x13d)||_0x3f7bbd[_0x78ff31(0x281)]===_0x78ff31(0x1e0))await handleSDKOutput(_0x4f3fdf,_0x3f7bbd);else{if(_0x4f3fdf[_0x78ff31(0x25d)]===0x0){if(_0x2f762c&&_0x3b2edc)console[_0x78ff31(0x104)](_0x78ff31(0x1a6)+_0x2f762c+'.'+_0x3b2edc);else _0x2f762c?console[_0x78ff31(0x104)](_0x78ff31(0x1eb)+_0x2f762c):console['log'](_0x78ff31(0x20d));}else{const _0x266e46=_0x3f7bbd['site'],_0x1fdc9d=_0x4f3fdf['map'](_0x4f2480=>{const _0x5da280=_0x78ff31,_0x11783d=a47_0x2874bf['dim']('#'+_0x4f2480['id']),_0x3456ab=_0x4f2480[_0x5da280(0x1d2)]?.['id'],_0x203e64=_0x4f2480[_0x5da280(0x1d7)]||_0x4f2480[_0x5da280(0x1f7)],_0x2043cd=_0x3456ab&&_0x203e64?hyperlink(_0x11783d,getWorkflowAttemptUrl(_0x266e46,_0x3456ab,_0x203e64,_0x4f2480['id'])):_0x11783d,{icon:_0x4eaf1c,text:_0x1718ed}=getAttemptStatusDisplay(_0x4f2480),_0x1cac03=(_0x4f2480[_0x5da280(0x1d2)]?.[_0x5da280(0x280)]||'?')+'.'+(_0x4f2480[_0x5da280(0x184)]?.[_0x5da280(0x280)]||'?'),_0x50cb7f=_0x4f2480[_0x5da280(0x122)]?a47_0x2874bf['dim'](_0x4f2480[_0x5da280(0x122)]):'';return(_0x2043cd+'\x20'+_0x4eaf1c+(_0x1718ed?'\x20'+_0x1718ed:'')+'\x20'+_0x1cac03+'\x20'+_0x50cb7f)['trimEnd']();});await writeOutput(_0x1fdc9d[_0x78ff31(0x1b4)]('\x0a'),_0x3f7bbd[_0x78ff31(0x220)],_0x78ff31(0x288));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x1e8);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x140);async[a47_0x3f412b(0x207)](_0x3ba893){const _0x59e292=a47_0x3f412b,{options:_0x2bb521,args:_0x2d2cbd,tdx:_0x530ce4}=_0x3ba893,_0x562c7e=_0x2d2cbd[0x0];if(!_0x562c7e)return console[_0x59e292(0x1a3)](_0x59e292(0x27e)),0x1;_0x2bb521[_0x59e292(0x1aa)]&&console[_0x59e292(0x1a3)](_0x59e292(0x17b)+_0x562c7e);const _0xe3322e=await withSpinner('Getting\x20attempt\x20details...',()=>_0x530ce4[_0x59e292(0x184)][_0x59e292(0x12c)](_0x562c7e),{'verbose':_0x2bb521[_0x59e292(0x1aa)]}),_0x280983=_0xe3322e[_0x59e292(0x276)];let _0x243fae;!_0x280983[_0x59e292(0x237)]?_0x243fae=_0x280983[_0x59e292(0x214)]?_0x59e292(0x283):_0x59e292(0x1e3):_0x243fae=_0x280983[_0x59e292(0x137)]?_0x59e292(0x137):_0x59e292(0x1a3);let _0x5243c7;if(_0x280983['createdAt']&&_0x280983[_0x59e292(0x27b)]){const _0x4a76f1=new Date(_0x280983[_0x59e292(0x194)])['getTime'](),_0x2f483a=new Date(_0x280983['finishedAt'])['getTime']();_0x5243c7=Math[_0x59e292(0x1f1)]((_0x2f483a-_0x4a76f1)/0x3e8);}const _0x131096={'attempt_id':_0x280983['id'],'status':_0x243fae,..._0x280983['index']!==undefined&&{'index':_0x280983[_0x59e292(0x22d)]},..._0x280983['project']&&{'project':_0x280983[_0x59e292(0x1d2)]['name']},..._0x280983[_0x59e292(0x184)]&&{'workflow':_0x280983['workflow']['name']},..._0x280983[_0x59e292(0x1f7)]&&{'session_id':_0x280983['sessionId']},..._0x280983['sessionTime']&&{'session_time':_0x280983[_0x59e292(0x122)]},..._0x280983['retryAttemptName']&&{'retry_attempt':_0x280983[_0x59e292(0x229)]},..._0x5243c7!==undefined&&{'duration_sec':_0x5243c7},..._0x280983[_0x59e292(0x194)]&&{'created_at':_0x280983[_0x59e292(0x194)]},..._0x280983['finishedAt']&&{'finished_at':_0x280983[_0x59e292(0x27b)]},...Object[_0x59e292(0x1d0)](_0x280983['params'])[_0x59e292(0x25d)]>0x0&&{'params':_0x280983[_0x59e292(0x128)]}};return await handleSingleObjectOutput(_0x131096,_0x2bb521),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a47_0x3f412b(0x280)]='workflow:tasks';['description']=a47_0x3f412b(0x1d9);async[a47_0x3f412b(0x207)](_0x4df13d){const _0x1065e6=a47_0x3f412b,{options:_0x5a5aaa,args:_0x13c354,tdx:_0x123c84}=_0x4df13d,_0x738304=_0x13c354[0x0];if(!_0x738304)return console['error'](_0x1065e6(0x27e)),0x1;const _0xe6cb75=_0x5a5aaa[_0x1065e6(0x226)];_0x5a5aaa[_0x1065e6(0x1aa)]&&(console['error'](_0x1065e6(0x17b)+_0x738304),_0xe6cb75&&console[_0x1065e6(0x1a3)](_0x1065e6(0x105)));const _0x3d42ad=await withSpinner(_0x1065e6(0x293),()=>_0x123c84[_0x1065e6(0x184)][_0x1065e6(0x1b5)](_0x738304,_0xe6cb75||![]),{'verbose':_0x5a5aaa[_0x1065e6(0x1aa)]}),_0xbdaf0d=_0x3d42ad[_0x1065e6(0x276)];return console[_0x1065e6(0x1a3)](_0x1065e6(0x1db)+_0xbdaf0d[_0x1065e6(0x25d)]+'\x20task'+(_0xbdaf0d[_0x1065e6(0x25d)]!==0x1?'s':'')),await handleSDKOutput(_0xbdaf0d,_0x5a5aaa),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a47_0x3f412b(0x112);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x106);async[a47_0x3f412b(0x207)](_0x5efb62){const _0x84baa2=a47_0x3f412b,{options:_0x465d69,args:_0x18f52d,tdx:_0x431da3}=_0x5efb62,_0x4040e9=_0x18f52d[0x0];let _0x49e132=_0x18f52d[0x1];if(!_0x4040e9)return console[_0x84baa2(0x1a3)](_0x84baa2(0x27e)),0x1;_0x465d69[_0x84baa2(0x1aa)]&&(console[_0x84baa2(0x1a3)](_0x84baa2(0x17b)+_0x4040e9),_0x49e132&&console['error'](_0x84baa2(0x271)+_0x49e132));const _0x3fd139=await withSpinner('Fetching\x20log\x20files...',()=>_0x431da3[_0x84baa2(0x184)]['logFiles'](_0x4040e9,_0x49e132),{'verbose':_0x465d69['verbose']}),_0x329316=_0x3fd139[_0x84baa2(0x276)];if(_0x329316['length']===0x0)return console[_0x84baa2(0x1a3)](_0x84baa2(0x239)),0x0;if(!_0x49e132&&(_0x465d69[_0x84baa2(0x1a8)]||_0x465d69[_0x84baa2(0x281)]))return await handleSDKOutput(_0x329316,_0x465d69),0x0;if(!_0x49e132){const _0x5e02a2=_0x329316[_0x84baa2(0x11e)](_0x5671c1=>({'title':_0x5671c1['taskName']+'\x20('+formatBytes(_0x5671c1[_0x84baa2(0x161)])+')','value':_0x5671c1['taskName']})),_0x5d95d1=await a47_0x5ff89f({'type':_0x84baa2(0x168),'name':'task','message':_0x84baa2(0x203),'choices':_0x5e02a2});if(!_0x5d95d1[_0x84baa2(0x27a)])return console[_0x84baa2(0x1a3)]('Cancelled'),0x0;_0x49e132=_0x5d95d1[_0x84baa2(0x27a)];}const _0x5198f6=await withSpinner(_0x84baa2(0x178),()=>_0x431da3['workflow']['logs'](_0x4040e9,_0x49e132),{'verbose':_0x465d69[_0x84baa2(0x1aa)]}),_0xa73f6b=_0x5198f6[_0x84baa2(0x276)];return _0xa73f6b?console[_0x84baa2(0x104)](_0xa73f6b):console[_0x84baa2(0x1a3)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x150);['description']='Kill\x20a\x20running\x20attempt';async['execute'](_0x3c1218){const _0x41baba=a47_0x3f412b,{options:_0x3ebc71,args:_0x2554ad,tdx:_0x47fce7}=_0x3c1218,_0x182fbd=_0x2554ad[0x0];if(!_0x182fbd)return console[_0x41baba(0x1a3)](_0x41baba(0x27e)),0x1;const _0x154ac3=_0x3ebc71['reason'];_0x3ebc71[_0x41baba(0x1aa)]&&(console['error']('Attempt\x20ID:\x20'+_0x182fbd),_0x154ac3&&console[_0x41baba(0x1a3)](_0x41baba(0x267)+_0x154ac3));if(!_0x3ebc71[_0x41baba(0x245)]){if(!isInteractive())return console[_0x41baba(0x1a3)](a47_0x2874bf[_0x41baba(0x148)](_0x41baba(0x1de)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a47_0x2874bf[_0x41baba(0x297)](_0x41baba(0x23f))),0x1;const _0x8a4b5b=await confirmKey(_0x41baba(0x1df)+_0x182fbd+'?');if(!_0x8a4b5b)return console[_0x41baba(0x1a3)](a47_0x2874bf[_0x41baba(0x23d)](_0x41baba(0x139))),0x1;}const _0x4cc780=await withSpinner(_0x41baba(0x282),()=>_0x47fce7['workflow'][_0x41baba(0x18a)](_0x182fbd,_0x154ac3),{'verbose':_0x3ebc71[_0x41baba(0x1aa)]}),_0x2880cd=_0x4cc780[_0x41baba(0x276)];return console['error']('✔\x20'+_0x2880cd),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a47_0x3f412b(0x280)]='workflow:retry';['description']=a47_0x3f412b(0x12e);async[a47_0x3f412b(0x207)](_0x2578ba){const _0x2e59ff=a47_0x3f412b,{options:_0x2590ac,args:_0x3c0be9,tdx:_0x3d4ad5}=_0x2578ba,_0x12a640=_0x3c0be9[0x0];if(!_0x12a640)return console[_0x2e59ff(0x1a3)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x2e59ff(0x1a3)](_0x2e59ff(0x290)),0x1;let _0x36336b=![],_0x52ca24=_0x12a640;if(_0x12a640['startsWith']('session:'))_0x36336b=!![],_0x52ca24=_0x12a640[_0x2e59ff(0x191)](0x8);else{if(_0x12a640[_0x2e59ff(0x177)](_0x2e59ff(0x1fd)))_0x36336b=![],_0x52ca24=_0x12a640[_0x2e59ff(0x191)](0x8);else return console[_0x2e59ff(0x1a3)](_0x2e59ff(0xee)),console[_0x2e59ff(0x1a3)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5a7cfc=_0x2590ac[_0x2e59ff(0x158)],_0x2e19f0=_0x2590ac[_0x2e59ff(0x22a)],_0x15d794=_0x2590ac[_0x2e59ff(0x128)],_0x38340c=_0x2590ac[_0x2e59ff(0x260)];_0x2590ac[_0x2e59ff(0x1aa)]&&(console[_0x2e59ff(0x1a3)](_0x2e59ff(0x285)+(_0x36336b?_0x2e59ff(0x1cc):_0x2e59ff(0x12c))+'\x20'+_0x52ca24),_0x5a7cfc&&console[_0x2e59ff(0x1a3)](_0x2e59ff(0x294)+_0x5a7cfc),_0x2e19f0&&console[_0x2e59ff(0x1a3)]('Resume\x20from:\x20'+_0x2e19f0),_0x15d794&&console['error']('Params:\x20'+_0x15d794),_0x38340c&&console[_0x2e59ff(0x1a3)](_0x2e59ff(0x17c)));let _0x36f7b6;if(_0x15d794)try{if(_0x15d794['startsWith']('@')){const _0x352e48=await import(_0x2e59ff(0x242)),_0x1e641a=_0x15d794['substring'](0x1),_0x12e70a=await _0x352e48[_0x2e59ff(0x287)](_0x1e641a,'utf-8');_0x36f7b6=JSON[_0x2e59ff(0x131)](_0x12e70a);}else _0x36f7b6=JSON[_0x2e59ff(0x131)](_0x15d794);}catch{return console[_0x2e59ff(0x1a3)](_0x2e59ff(0x1f4)),0x1;}if(!_0x2590ac['yes']){if(!isInteractive())return console['error'](a47_0x2874bf[_0x2e59ff(0x148)](_0x2e59ff(0x1de)),_0x2e59ff(0x201)),console[_0x2e59ff(0x1a3)](a47_0x2874bf['dim'](_0x2e59ff(0x23f))),0x1;const _0x3f9792=await confirmKey(_0x2e59ff(0x159)+(_0x36336b?_0x2e59ff(0x1cc):'attempt')+'\x20'+_0x52ca24+'?');if(!_0x3f9792)return console[_0x2e59ff(0x1a3)](a47_0x2874bf['yellow']('Cancelled')),0x1;}let _0x50ccb3;_0x36336b?_0x50ccb3=await withSpinner(_0x2e59ff(0x18d),()=>_0x3d4ad5['workflow'][_0x2e59ff(0x13c)](_0x52ca24,{'fromTask':_0x5a7cfc,'retryParams':_0x36f7b6}),{'verbose':_0x2590ac[_0x2e59ff(0x1aa)]}):_0x50ccb3=await withSpinner(_0x2e59ff(0x130),()=>_0x3d4ad5['workflow'][_0x2e59ff(0x257)](_0x52ca24,{'resumeFrom':_0x2e19f0,'retryParams':_0x36f7b6,'force':_0x38340c}),{'verbose':_0x2590ac['verbose']});const _0x35a3e9=_0x50ccb3[_0x2e59ff(0x276)];return console[_0x2e59ff(0x1a3)](_0x2e59ff(0x1d4)),console[_0x2e59ff(0x1a3)](_0x2e59ff(0x1ee)+_0x35a3e9['attemptId']),console[_0x2e59ff(0x1a3)](_0x2e59ff(0x224)+_0x35a3e9[_0x2e59ff(0x1f7)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']='workflow:run';[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x116);async[a47_0x3f412b(0x207)](_0x565309){const _0x4b8c20=a47_0x3f412b,{options:_0x5af472,args:_0x412d44,tdx:_0xe3b221}=_0x565309;let _0x3507b4=_0x412d44[0x0];if(!_0x3507b4){const _0xe51ff7=this[_0x4b8c20(0x10e)]([],_0x5af472),_0xe44948=await withSpinner(_0x4b8c20(0x151),()=>_0xe3b221[_0x4b8c20(0x184)][_0x4b8c20(0x125)](_0xe51ff7,{'limit':_0x5af472[_0x4b8c20(0x1f8)]}),{'verbose':_0x5af472[_0x4b8c20(0x1aa)]}),_0x77626=_0xe44948[_0x4b8c20(0x276)];if(_0x77626[_0x4b8c20(0x25d)]===0x0)return console[_0x4b8c20(0x1a3)](_0x4b8c20(0x24a)),!_0xe51ff7&&console[_0x4b8c20(0x1a3)](a47_0x2874bf[_0x4b8c20(0x297)](_0x4b8c20(0x1e2))),0x1;const _0x516dfa=_0x77626[_0x4b8c20(0x11e)](_0x21b989=>({'title':_0x21b989[_0x4b8c20(0x1d2)]?.[_0x4b8c20(0x280)]+'.'+_0x21b989[_0x4b8c20(0x280)],'value':_0x21b989[_0x4b8c20(0x1d2)]?.[_0x4b8c20(0x280)]+'.'+_0x21b989[_0x4b8c20(0x280)],'description':_0x21b989[_0x4b8c20(0x11f)]?_0x4b8c20(0x1cf)+_0x21b989[_0x4b8c20(0x11f)]:undefined})),_0x45ce11=await a47_0x5ff89f({'type':_0x4b8c20(0x168),'name':_0x4b8c20(0x184),'message':_0x4b8c20(0x172),'choices':_0x516dfa});if(!_0x45ce11['workflow'])return 0x1;_0x3507b4=_0x45ce11[_0x4b8c20(0x184)];}if(!_0x3507b4[_0x4b8c20(0x25a)]('.')){const _0x3453f5=this['resolveProject']([],_0x5af472);if(_0x3453f5)_0x3507b4=_0x3453f5+'.'+_0x3507b4;else return console['error'](a47_0x2874bf[_0x4b8c20(0x148)](_0x4b8c20(0x133)),_0x4b8c20(0x156)),console[_0x4b8c20(0x1a3)](a47_0x2874bf[_0x4b8c20(0x297)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x3ff05f=_0x5af472[_0x4b8c20(0x292)],_0x504ea6=_0x5af472[_0x4b8c20(0x122)],_0x399a63={};if(_0x3ff05f&&Array['isArray'](_0x3ff05f))for(const _0x511df4 of _0x3ff05f){const _0x18010f=_0x511df4[_0x4b8c20(0x129)]('=');if(_0x18010f===-0x1)return console[_0x4b8c20(0x1a3)](_0x4b8c20(0x1f2)+_0x511df4),console['error'](_0x4b8c20(0x240)),0x1;const _0x87970=_0x511df4[_0x4b8c20(0x191)](0x0,_0x18010f),_0x20ce7a=_0x511df4[_0x4b8c20(0x191)](_0x18010f+0x1);try{_0x399a63[_0x87970]=JSON[_0x4b8c20(0x131)](_0x20ce7a);}catch{_0x399a63[_0x87970]=_0x20ce7a;}}_0x5af472[_0x4b8c20(0x1aa)]&&(console[_0x4b8c20(0x1a3)](_0x4b8c20(0x1ea)+_0x3507b4),Object['keys'](_0x399a63)[_0x4b8c20(0x25d)]>0x0&&console[_0x4b8c20(0x1a3)]('Parameters:\x20'+JSON['stringify'](_0x399a63)),_0x504ea6&&console[_0x4b8c20(0x1a3)](_0x4b8c20(0x162)+_0x504ea6));const _0x2a2145=await withSpinner('Starting\x20workflow\x20run...',()=>_0xe3b221[_0x4b8c20(0x184)]['run'](_0x3507b4,_0x399a63,{'sessionTime':_0x504ea6}),{'verbose':_0x5af472[_0x4b8c20(0x1aa)]}),_0x4b302d=_0x2a2145[_0x4b8c20(0x276)];console[_0x4b8c20(0x1a3)]('✔\x20Workflow\x20run\x20started'),console[_0x4b8c20(0x1a3)](_0x4b8c20(0x259)+_0x4b302d['id']),console[_0x4b8c20(0x1a3)](_0x4b8c20(0x224)+_0x4b302d[_0x4b8c20(0x1f7)]),console[_0x4b8c20(0x1a3)]('\x20\x20Project:\x20'+_0x4b302d['project']?.[_0x4b8c20(0x280)]),console[_0x4b8c20(0x1a3)]('\x20\x20Workflow:\x20'+_0x4b302d[_0x4b8c20(0x184)]?.['name']);if(_0x4b302d['project']?.['id']&&_0x4b302d[_0x4b8c20(0x1f7)]&&_0x4b302d['id']){const _0x59f975=_0x5af472[_0x4b8c20(0x1dd)],_0x5292c7=getConsoleUrl(_0x59f975,_0x4b8c20(0x111)+_0x4b302d[_0x4b8c20(0x1d2)]['id']+_0x4b8c20(0x21f)+_0x4b302d[_0x4b8c20(0x1f7)]+_0x4b8c20(0xea)+_0x4b302d['id']);console[_0x4b8c20(0x1a3)](_0x4b8c20(0xf7)+a47_0x2874bf['cyan'](_0x5292c7));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a47_0x3f412b(0x16a);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x153);async[a47_0x3f412b(0x207)](_0x27675a){const _0x1172bc=a47_0x3f412b,{options:_0x2b3374,args:_0x5937b0,tdx:_0x465800}=_0x27675a,_0x3e7bc5=_0x5937b0[0x0],_0x95eeb0=_0x5937b0[0x1]||'.';if(!_0x3e7bc5)return console[_0x1172bc(0x1a3)](_0x1172bc(0x22f)),console[_0x1172bc(0x1a3)](_0x1172bc(0x1ec)),0x1;const _0x181fe0=_0x2b3374[_0x1172bc(0x11f)];_0x2b3374[_0x1172bc(0x1aa)]&&(console[_0x1172bc(0x1a3)]('Project:\x20'+_0x3e7bc5),console[_0x1172bc(0x1a3)](_0x1172bc(0x1c2)+_0x95eeb0),_0x181fe0&&console[_0x1172bc(0x1a3)](_0x1172bc(0x1a7)+_0x181fe0));const _0x4cc682=await withSpinner(_0x1172bc(0x16e)+_0x3e7bc5+_0x1172bc(0xf1),()=>_0x465800['workflow'][_0x1172bc(0x103)](_0x3e7bc5,_0x95eeb0,{'revision':_0x181fe0}),{'verbose':_0x2b3374[_0x1172bc(0x1aa)]}),_0x52874b=_0x4cc682[_0x1172bc(0x276)];return console['error'](_0x1172bc(0x192)+_0x52874b[_0x1172bc(0x20e)]),console['error'](_0x1172bc(0x25f)+_0x52874b[_0x1172bc(0x11f)]),console[_0x1172bc(0x1a3)]('\x20\x20Files\x20extracted:\x20'+_0x52874b[_0x1172bc(0x258)]),console['error'](_0x1172bc(0x1fb)+_0x95eeb0+'/'+_0x52874b[_0x1172bc(0x20e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x165);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0xeb);async[a47_0x3f412b(0x207)](_0x1e7986){const _0x2081b9=a47_0x3f412b,{options:_0x135d86,args:_0x2d26f8,tdx:_0x3f0d7f}=_0x1e7986;let _0x67e7a4='.',_0x2c64cc=_0x135d86[_0x2081b9(0x280)];if(_0x2d26f8[0x0]){const {promises:_0x51539e}=await import('fs');try{const _0x20c8b2=await _0x51539e[_0x2081b9(0x28f)](_0x2d26f8[0x0]);if(_0x20c8b2[_0x2081b9(0x1b6)]())_0x67e7a4=_0x2d26f8[0x0];else return console['error'](_0x2081b9(0x19e)+_0x2d26f8[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x2c64cc=_0x2d26f8[0x0],_0x67e7a4='.';}}const _0x2d709c=_0x135d86['revision'],_0x4fc7c2=_0x135d86[_0x2081b9(0x15d)];_0x135d86[_0x2081b9(0x1aa)]&&(console[_0x2081b9(0x1a3)](_0x2081b9(0x291)+_0x67e7a4),_0x2c64cc&&console[_0x2081b9(0x1a3)](_0x2081b9(0x20b)+_0x2c64cc),_0x2d709c&&console[_0x2081b9(0x1a3)](_0x2081b9(0x1a7)+_0x2d709c),_0x4fc7c2&&console[_0x2081b9(0x1a3)](_0x2081b9(0x1c5)));const _0x3f507e=await withSpinner(_0x2081b9(0x126),()=>_0x3f0d7f[_0x2081b9(0x184)][_0x2081b9(0x119)](_0x67e7a4,{'projectName':_0x2c64cc,'revision':_0x2d709c,'skipValidation':_0x4fc7c2}),{'verbose':_0x135d86['verbose']}),_0x4a95a4=_0x3f507e[_0x2081b9(0x276)];return console[_0x2081b9(0x1a3)](_0x2081b9(0x28d)+_0x4a95a4[_0x2081b9(0x20e)]),console['error'](_0x2081b9(0x227)+_0x4a95a4[_0x2081b9(0x231)]),console['error'](_0x2081b9(0x25f)+_0x4a95a4['revision']),await this[_0x2081b9(0x1fc)](_0x3f0d7f,_0x4a95a4[_0x2081b9(0x20e)],_0x135d86[_0x2081b9(0x1dd)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x193);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x1ae);async['execute'](_0x9041ca){const _0xd30d32=a47_0x3f412b,{options:_0x2f57d3,args:_0x54d103,tdx:_0x41ef15}=_0x9041ca,_0x4fd646=_0x54d103[0x0],_0x1203f8=_0x54d103[0x1];if(!_0x4fd646)return console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x148)](_0xd30d32(0x133)),_0xd30d32(0x19f)),console['error'](a47_0x2874bf[_0xd30d32(0x297)](_0xd30d32(0x1d5))),0x1;const _0x23f175=_0x2f57d3[_0xd30d32(0x11f)];_0x2f57d3['verbose']&&(console[_0xd30d32(0x1a3)](_0xd30d32(0x222)+_0x4fd646),_0x1203f8&&console[_0xd30d32(0x1a3)](_0xd30d32(0x1fe)+_0x1203f8),_0x23f175&&console[_0xd30d32(0x1a3)](_0xd30d32(0x1a7)+_0x23f175),_0x2f57d3[_0xd30d32(0x25b)]&&console[_0xd30d32(0x1a3)](_0xd30d32(0x19d)));const _0x1dea20=await withSpinner(_0xd30d32(0x13b)+_0x4fd646+_0xd30d32(0xf1),()=>_0x41ef15[_0xd30d32(0x184)][_0xd30d32(0x209)](_0x4fd646,{'targetDir':_0x1203f8,'revision':_0x23f175}),{'verbose':_0x2f57d3[_0xd30d32(0x1aa)]}),_0x545f7e=_0x1dea20[_0xd30d32(0x276)];_0x545f7e[_0xd30d32(0x256)]?console[_0xd30d32(0x1a3)]('→\x20New\x20project:\x20'+_0x545f7e[_0xd30d32(0x20e)]):console['error']('→\x20Project:\x20'+_0x545f7e[_0xd30d32(0x20e)]);console['error'](_0xd30d32(0x25f)+_0x545f7e['revision']),console[_0xd30d32(0x1a3)](_0xd30d32(0x228)+(a47_0x19d684[_0xd30d32(0x160)](process[_0xd30d32(0x22e)](),_0x545f7e[_0xd30d32(0x230)])||'.')),console[_0xd30d32(0x1a3)](_0xd30d32(0x1ac)+a47_0x2874bf[_0xd30d32(0x11b)]('+'+_0x545f7e['summary'][_0xd30d32(0x28a)]+_0xd30d32(0x164))+',\x20'+(a47_0x2874bf[_0xd30d32(0x23d)]('~'+_0x545f7e[_0xd30d32(0x27f)][_0xd30d32(0x1e7)]+_0xd30d32(0x12a))+',\x20')+(a47_0x2874bf[_0xd30d32(0x148)]('-'+_0x545f7e[_0xd30d32(0x27f)][_0xd30d32(0x185)]+_0xd30d32(0x1bb))+',\x20')+(''+a47_0x2874bf[_0xd30d32(0x297)](_0x545f7e[_0xd30d32(0x27f)][_0xd30d32(0x1af)]+_0xd30d32(0x17e))));for(const _0x29f4f6 of _0x545f7e[_0xd30d32(0x186)]){_0x29f4f6[_0xd30d32(0x204)]===_0xd30d32(0x1e7)&&_0x29f4f6[_0xd30d32(0xfc)]&&(console[_0xd30d32(0x1a3)]('\x0a'+a47_0x2874bf[_0xd30d32(0x1b8)](_0xd30d32(0x14b)+_0x29f4f6[_0xd30d32(0x1c8)])),console['error'](_0x29f4f6['diff']));}if(!_0x545f7e[_0xd30d32(0x234)])return saveSessionContext({'workflow_project':_0x545f7e[_0xd30d32(0x20e)]},_0x2f57d3[_0xd30d32(0x1cc)]),console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x11b)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x297)](_0xd30d32(0x1ba)+_0x545f7e['projectName'])),0x0;if(_0x2f57d3[_0xd30d32(0x25b)])return console[_0xd30d32(0x1a3)](a47_0x2874bf['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x2f57d3[_0xd30d32(0x245)]){if(!isInteractive())return console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x148)](_0xd30d32(0x1de)),_0xd30d32(0x201)),console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x297)](_0xd30d32(0x23f))),0x1;const _0xfc6575=await confirmKey(_0xd30d32(0x270));if(!_0xfc6575)return console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x23d)](_0xd30d32(0x139)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0xd30d32(0x10a),()=>_0x41ef15['workflow'][_0xd30d32(0x247)](_0x545f7e,{'revision':_0x23f175}),{'verbose':_0x2f57d3['verbose']}),saveSessionContext({'workflow_project':_0x545f7e[_0xd30d32(0x20e)]},_0x2f57d3[_0xd30d32(0x1cc)]),console[_0xd30d32(0x1a3)](a47_0x2874bf[_0xd30d32(0x11b)]('✔\x20Pull\x20complete'));const _0x4c5b42=a47_0x19d684['relative'](process[_0xd30d32(0x22e)](),_0x545f7e['targetDir'])||'.';return console[_0xd30d32(0x1a3)](a47_0x2874bf['dim'](_0xd30d32(0x1fb)+_0x4c5b42)),console[_0xd30d32(0x1a3)](a47_0x2874bf['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x545f7e[_0xd30d32(0x20e)])),0x0;}}function a47_0x4c19(_0x30b9f7,_0x560eb4){_0x30b9f7=_0x30b9f7-0xea;const _0x3e774c=a47_0x3e77();let _0x4c1960=_0x3e774c[_0x30b9f7];return _0x4c1960;}export class WorkflowPushCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x15e);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x149);async[a47_0x3f412b(0x207)](_0x9d43bf){const _0x3a58ba=a47_0x3f412b,{options:_0x12ebad,args:_0x32a155,tdx:_0x337d0b}=_0x9d43bf,_0x41b9b7=this[_0x3a58ba(0x1ce)](_0x32a155,_0x12ebad),_0x652333=_0x12ebad[_0x3a58ba(0x11f)],_0x161c70=_0x12ebad[_0x3a58ba(0x15d)];_0x12ebad[_0x3a58ba(0x1aa)]&&(_0x41b9b7&&console[_0x3a58ba(0x1a3)]('Source\x20directory:\x20'+_0x41b9b7),_0x652333&&console[_0x3a58ba(0x1a3)](_0x3a58ba(0x1a7)+_0x652333),_0x12ebad[_0x3a58ba(0x25b)]&&console[_0x3a58ba(0x1a3)](_0x3a58ba(0x19d)),_0x161c70&&console[_0x3a58ba(0x1a3)](_0x3a58ba(0x1c5)));let _0x430fa6;try{_0x430fa6=await withSpinner(_0x3a58ba(0x173),()=>_0x337d0b[_0x3a58ba(0x184)][_0x3a58ba(0x1f5)]({'sourceDir':_0x41b9b7,'revision':_0x652333,'skipValidation':_0x161c70}),{'verbose':_0x12ebad[_0x3a58ba(0x1aa)]});}catch(_0x39f260){if(_0x39f260 instanceof Error&&_0x39f260[_0x3a58ba(0x26f)][_0x3a58ba(0x25a)](_0x3a58ba(0x102)))return console['error'](a47_0x2874bf[_0x3a58ba(0x148)](_0x3a58ba(0x133)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x12ebad['workflowProject']?console['error'](a47_0x2874bf['dim'](_0x3a58ba(0x1ff)+_0x12ebad['workflowProject']+_0x3a58ba(0x206)+_0x12ebad['workflowProject']+'\x27')):console[_0x3a58ba(0x1a3)](a47_0x2874bf[_0x3a58ba(0x297)](_0x3a58ba(0x1b1))),0x1;throw _0x39f260;}const _0x566a6d=_0x430fa6[_0x3a58ba(0x276)];console[_0x3a58ba(0x1a3)](_0x3a58ba(0x124)+_0x566a6d[_0x3a58ba(0x20e)]),console[_0x3a58ba(0x1a3)](_0x3a58ba(0x1fa)+_0x566a6d['sourceDir']),console[_0x3a58ba(0x1a3)](_0x3a58ba(0x25f)+_0x566a6d[_0x3a58ba(0x11f)]),console[_0x3a58ba(0x1a3)](_0x3a58ba(0x1ac)+a47_0x2874bf[_0x3a58ba(0x11b)]('+'+_0x566a6d[_0x3a58ba(0x27f)][_0x3a58ba(0x28a)]+_0x3a58ba(0x164))+',\x20'+(a47_0x2874bf[_0x3a58ba(0x23d)]('~'+_0x566a6d[_0x3a58ba(0x27f)]['modified']+_0x3a58ba(0x12a))+',\x20')+(a47_0x2874bf[_0x3a58ba(0x148)]('-'+_0x566a6d[_0x3a58ba(0x27f)]['deleted']+_0x3a58ba(0x1bb))+',\x20')+(''+a47_0x2874bf[_0x3a58ba(0x297)](_0x566a6d[_0x3a58ba(0x27f)][_0x3a58ba(0x1af)]+_0x3a58ba(0x17e))));for(const _0x3d8f6a of _0x566a6d[_0x3a58ba(0x186)]){_0x3d8f6a[_0x3a58ba(0x204)]==='modified'&&_0x3d8f6a[_0x3a58ba(0xfc)]&&(console['error']('\x0a'+a47_0x2874bf[_0x3a58ba(0x1b8)]('---\x20'+_0x3d8f6a[_0x3a58ba(0x1c8)])),console['error'](_0x3d8f6a[_0x3a58ba(0xfc)]));}if(!_0x566a6d[_0x3a58ba(0x234)])return console[_0x3a58ba(0x1a3)](a47_0x2874bf[_0x3a58ba(0x11b)](_0x3a58ba(0x21e))),await this[_0x3a58ba(0x1fc)](_0x337d0b,_0x566a6d['projectName'],_0x12ebad[_0x3a58ba(0x1dd)]),0x0;if(_0x12ebad[_0x3a58ba(0x25b)])return console[_0x3a58ba(0x1a3)](a47_0x2874bf[_0x3a58ba(0x23d)](_0x3a58ba(0x14a))),0x0;if(!_0x12ebad['yes']){if(!isInteractive())return console[_0x3a58ba(0x1a3)](a47_0x2874bf['red'](_0x3a58ba(0x1de)),_0x3a58ba(0x201)),console['error'](a47_0x2874bf[_0x3a58ba(0x297)](_0x3a58ba(0x23f))),0x1;const _0x1af69c=await confirmKey(_0x3a58ba(0x15f));if(!_0x1af69c)return console[_0x3a58ba(0x1a3)](a47_0x2874bf['yellow'](_0x3a58ba(0x139)),_0x3a58ba(0x28c)),0x1;}const _0x2e91b7=await withSpinner(_0x3a58ba(0x205),()=>_0x337d0b[_0x3a58ba(0x184)][_0x3a58ba(0x1d6)](_0x566a6d),{'verbose':_0x12ebad[_0x3a58ba(0x1aa)]}),_0x421e73=_0x2e91b7['data'];return console[_0x3a58ba(0x1a3)](a47_0x2874bf[_0x3a58ba(0x11b)](_0x3a58ba(0x255))),console[_0x3a58ba(0x1a3)]('\x20\x20Project\x20ID:\x20'+_0x421e73[_0x3a58ba(0x231)]),console['error'](_0x3a58ba(0x25f)+_0x421e73[_0x3a58ba(0x11f)]),await this[_0x3a58ba(0x1fc)](_0x337d0b,_0x421e73[_0x3a58ba(0x20e)],_0x12ebad[_0x3a58ba(0x1dd)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x213);async[a47_0x3f412b(0x207)](_0x5a6575){const _0x2a7304=a47_0x3f412b,{options:_0x2bf6e5,args:_0x17d67a,tdx:_0xab0e62}=_0x5a6575,_0xafa21b=this[_0x2a7304(0x1ce)](_0x17d67a,_0x2bf6e5),_0x1706a9=_0x2bf6e5['name'],_0xd00b87=_0x2bf6e5[_0x2a7304(0x11f)],_0x429d41=_0x2bf6e5[_0x2a7304(0x15d)];if(!_0xafa21b)return console['error'](a47_0x2874bf['red']('Error:'),_0x2a7304(0x170)),console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x297)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x297)](_0x2a7304(0x24b))),0x1;if(!_0x1706a9)return console['error'](a47_0x2874bf[_0x2a7304(0x148)](_0x2a7304(0x133)),_0x2a7304(0x1bc)),console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x297)](_0x2a7304(0x1c4))),0x1;_0x2bf6e5[_0x2a7304(0x1aa)]&&(console[_0x2a7304(0x1a3)](_0x2a7304(0xf8)+_0xafa21b),console[_0x2a7304(0x1a3)](_0x2a7304(0x1b3)+_0x1706a9),_0xd00b87&&console[_0x2a7304(0x1a3)]('Revision:\x20'+_0xd00b87),_0x2bf6e5['dryRun']&&console[_0x2a7304(0x1a3)]('Dry\x20run:\x20yes'),_0x429d41&&console[_0x2a7304(0x1a3)](_0x2a7304(0x1c5)));const _0x1c4e77=await withSpinner(_0x2a7304(0x152),()=>_0xab0e62['workflow']['prepareCloneProject'](_0xafa21b,_0x1706a9,{'revision':_0xd00b87,'skipValidation':_0x429d41}),{'verbose':_0x2bf6e5[_0x2a7304(0x1aa)]}),_0x30bf7c=_0x1c4e77[_0x2a7304(0x276)];console['error'](_0x2a7304(0x265)+_0x30bf7c[_0x2a7304(0x136)]);_0x30bf7c['sourceProjectName']&&console[_0x2a7304(0x1a3)](_0x2a7304(0x1e6)+_0x30bf7c[_0x2a7304(0x155)]);console[_0x2a7304(0x1a3)](_0x2a7304(0x1b3)+_0x30bf7c[_0x2a7304(0x1dc)]),console[_0x2a7304(0x1a3)]('Revision:\x20'+_0x30bf7c[_0x2a7304(0x11f)]),console[_0x2a7304(0x1a3)](_0x2a7304(0x176)+_0x30bf7c[_0x2a7304(0x16f)]);_0x30bf7c['targetExists']&&(console['error'](a47_0x2874bf[_0x2a7304(0x23d)](_0x2a7304(0x1da)+_0x30bf7c[_0x2a7304(0x1dc)]+_0x2a7304(0x1f9)+_0x30bf7c[_0x2a7304(0x299)]+')')),console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x23d)](_0x2a7304(0x12f))));if(_0x2bf6e5[_0x2a7304(0x25b)])return console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x23d)](_0x2a7304(0x189))),0x0;if(!_0x2bf6e5['yes']){if(!isInteractive())return console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x148)](_0x2a7304(0x1de)),_0x2a7304(0x201)),console['error'](a47_0x2874bf[_0x2a7304(0x297)](_0x2a7304(0x23f))),0x1;const _0x212938=_0x30bf7c[_0x2a7304(0x155)]||a47_0x19d684[_0x2a7304(0xf0)](_0xafa21b),_0x535e99=_0x30bf7c[_0x2a7304(0x1b0)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1706a9+_0x2a7304(0x1c7):_0x2a7304(0x127)+_0x212938+_0x2a7304(0x115)+_0x1706a9+'\x22?',_0x38f5d7=await confirmKey(_0x535e99);if(!_0x38f5d7)return console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x23d)](_0x2a7304(0x139))),0x1;}const _0xba9e3c=await withSpinner(_0x30bf7c[_0x2a7304(0x1b0)]?_0x2a7304(0x295)+_0x1706a9+'...':_0x2a7304(0x110)+_0x1706a9+'...',()=>_0xab0e62[_0x2a7304(0x184)][_0x2a7304(0x26d)](_0x30bf7c),{'verbose':_0x2bf6e5['verbose']}),_0x736ace=_0xba9e3c[_0x2a7304(0x276)];return console[_0x2a7304(0x1a3)](a47_0x2874bf[_0x2a7304(0x11b)](_0x30bf7c[_0x2a7304(0x1b0)]?_0x2a7304(0x29a):_0x2a7304(0x10c))),console[_0x2a7304(0x1a3)](_0x2a7304(0xfe)+_0x736ace[_0x2a7304(0x1dc)]),console[_0x2a7304(0x1a3)](_0x2a7304(0x227)+_0x736ace[_0x2a7304(0x1cb)]),console['error']('\x20\x20Revision:\x20'+_0x736ace[_0x2a7304(0x11f)]),await this['showWorkflowConsoleUrl'](_0xab0e62,_0x736ace['newProjectName'],_0x2bf6e5['site']),0x0;}}function a47_0x3e77(){const _0x461153=['ICON_WIDTH','task','finishedAt','List\x20workflow\x20attempts','📋\x20','Error:\x20Attempt\x20ID\x20is\x20required','summary','name','format','Killing\x20attempt...','canceling','navigateSessionsInteractive','Target:\x20','2938500RiIoLe','readFile','list','attempts','new','17991594QhFbAj','-\x20nothing\x20pushed','✔\x20Pushed\x20','includeRetried','stat','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Project\x20directory:\x20','param','Getting\x20attempt\x20tasks...','From\x20task:\x20','Updating\x20','Session\x20','dim','sort','existingProjectId','✔\x20Project\x20updated','/attempt/','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','status','find','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','duration','basename','...','\x20sessions\x20','description','now','pollTimeline','requireProject','\x20\x20Console:\x20','Source\x20directory:\x20','updatedAt','\x1b[1A\x1b[2K','fullName','diff','generateSessionTimelineRows','\x20\x20Project:\x20','\x27\x20from\x20project\x20\x27','delete','workflow:secrets:delete','No\x20workflow\x20tdx.json\x20found','download','log','Including\x20subtasks:\x20yes','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Include\x20retried:\x20yes','\x20workflow','unknown','Writing\x20files...','\x0aFailed\x20to\x20fetch\x20attempt\x20data','✔\x20Clone\x20complete','✔\x20Workflow\x20project\x20context\x20cleared.','resolveProject','.\x20Expected\x20format:\x20KEY=VALUE','Cloning\x20to\x20','/app/workflows/','workflow:logs','Attempt:\x20','🔄\x20','\x22\x20to\x20new\x20project\x20\x22','Start\x20a\x20workflow\x20run','926091EMlIPr','\x20attempt','push','fill','green','Pattern:\x20','workflow:secrets:list','map','revision','Key:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','sessionTime','\x20-\x20','✔\x20Project:\x20','workflows','Pushing\x20workflow\x20project...','\x0aClone\x20\x22','params','indexOf','\x20modified','max','attempt','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Retry\x20a\x20session\x20or\x20attempt','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Retrying\x20attempt...','parse','✔\x20Showing\x20','Error:','Project\x20filter:\x20','write','sourceDir','success','GUTTER','Cancelled','start','Pulling\x20project\x20','retrySession','jsonl','5oZVqTl','Setting\x20secret...','Show\x20specific\x20attempt\x20details','match','No\x20sessions\x20found\x20for:\x20','rows','workflowProject','text','min','blue','red','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x0aDry\x20run\x20-\x20nothing\x20pushed','---\x20','icon','clear','key','getFullYear','workflow:kill','Loading\x20workflows...','Analyzing\x20project...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','toISOString','sourceProjectName','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','repeat','fromTask','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','getMonth','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','localeCompare','skipValidation','workflow:push','\x0aPush\x20these\x20changes?','relative','fileSize','Session\x20time:\x20','end','\x20new','workflow:upload','workflowName','filter','select','workflow:workflows','workflow:download','No\x20projects\x20match\x20pattern:\x20','sys','resolve','Downloading\x20project\x20','fileCount','Source\x20directory\x20is\x20required','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Select\x20a\x20workflow\x20to\x20run','Analyzing\x20changes...','✔\x20Workflow\x20project\x20set\x20to:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Files\x20to\x20upload:\x20','startsWith','Downloading\x20logs...','POLL_INTERVAL_MS','LABEL_MIN_SPACING','Attempt\x20ID:\x20','Force:\x20yes','ICON_SPACING','\x20unchanged','LABEL_WIDTH_DIVISOR','Listing\x20workflow\x20projects...','No\x20matching\x20sessions\x20found','\x20secret','178CPdsLH','workflow','deleted','changes','\x20(use\x20--limit\x20to\x20show\x20more)','\x20from\x20session\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','kill','\x0aPolling...\x20(','Deleting\x20secret...','Retrying\x20session...','context','No\x20workflows\x20found\x20in\x20project:\x20','renderSingleTimeline','substring','✔\x20Downloaded\x20','workflow:pull','createdAt','resolveProjectId','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','2685736kIIBBB','white','(unknown)','Latest\x20session\x20has\x20no\x20attempt','Auto-selected\x20latest\x20session:\x20','startedAt','Dry\x20run:\x20yes','Error:\x20','Project\x20name\x20is\x20required','split','follow','displayLine','error','renderTimeline','\x20tasks','No\x20attempts\x20found\x20for:\x20','Revision:\x20','json','tdx\x20wf\x20attempt\x20','verbose','24141DbpUDi','\x20\x20Changes:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','unchanged','targetExists','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','size','New\x20project\x20name:\x20','join','tasks','isDirectory','\x0a✔\x20Attempt\x20complete','cyan','\x27...','\x20\x20Session\x20context\x20set\x20to:\x20','\x20deleted','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Resolving\x20project\x20\x27','workflow:attempts','No\x20workflow\x20sessions\x20found','toLowerCase','Session\x20not\x20found:\x20','Output\x20directory:\x20','workflow:timeline','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Validation:\x20skipped','getHours','\x22\x20with\x20new\x20revision?','path','\x20\x20tdx\x20wf\x20use\x20<project>','Select\x20a\x20session\x20to\x20view\x20timeline:','newProjectId','session','renderSessionsTimeline','resolveProjectDir','revision:\x20','keys','List\x20workflow\x20execution\x20sessions','project','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','✔\x20Retry\x20started','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','executePushProject','session_id','Usage:\x20tdx\x20wf\x20use\x20<project>','Show\x20tasks\x20for\x20an\x20attempt','\x0a⚠\x20Project\x20\x22','✔\x20Found\x20','newProjectName','site','\x0aError:','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','table','set','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','running','Warning:','Error:\x20Secret\x20key\x20is\x20required','Source\x20project:\x20','modified','workflow:attempt','4426434vQSVtM','Workflow:\x20','No\x20attempts\x20found\x20in\x20project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','values','\x20\x20New\x20attempt\x20ID:\x20','every','MAX_TASKS_DISPLAY','round','Error:\x20Invalid\x20parameter\x20format:\x20','Listing\x20secrets...','Error:\x20Invalid\x20JSON\x20in\x20--params','preparePushProject','Key\x20cannot\x20be\x20empty','sessionId','limit','\x22\x20already\x20exists\x20(ID:\x20','\x20\x20Source:\x20','\x20\x20Location:\x20','showWorkflowConsoleUrl','attempt:','Target\x20directory:\x20','Tip:\x20cd\x20to\x20workflows/','workflow:projects','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','lastAttempt','Select\x20a\x20task\x20to\x20view\x20logs:','type','Pushing\x20project...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','execute','all','pullProject','Error:\x20KEY=VALUE\x20is\x20required','Project\x20name:\x20','MAX_POLL_ITERATIONS','No\x20attempts\x20found','projectName','getMinutes','List\x20workflows','state','List\x20all\x20workflow\x20projects','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','cancelRequested','⚠\x20Showing\x20first\x20','Filter:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x22?\x20This\x20cannot\x20be\x20undone.','title','Listing\x20workflows...','No\x20sessions\x20found\x20in\x20project:\x20','padStart','floor','\x0a✔\x20No\x20changes\x20to\x20push','/sessions/','output','columns','Project:\x20','group_error','\x20\x20Session\x20ID:\x20','389459sDzzwO','includeSubtasks','\x20\x20Project\x20ID:\x20','\x20\x20Target:\x20','retryAttemptName','resumeFrom','tdx.json','attemptId','index','cwd','Error:\x20Project\x20name\x20is\x20required','targetDir','projectId','isTTY','startTime','hasChanges','💡\x20Tip:\x20Use\x20','\x20(system)','done','workflow:secrets:set','No\x20log\x20files\x20found\x20for\x20this\x20attempt','workflow:delete','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','yellow','slice','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Expected\x20format:\x20--param\x20key=value','getTime','fs/promises','stdout','\x20has\x20no\x20attempts','yes','buildTimelineData','applyPullProject','splice','Failed\x20to\x20fetch\x20attempt\x20data','No\x20workflows\x20found','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','from','workflow:use','deleteSecret','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Filter:\x20project=','No\x20sessions\x20with\x20timing\x20information','get','planned','pending','✔\x20Push\x20complete','isNewProject','retryAttempt','filesExtracted','\x20\x20Attempt\x20ID:\x20','includes','dryRun','sessions','length','✔\x20Deleted\x20project\x20','\x20\x20Revision:\x20','force','\x20of\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','parseProjectWorkflowPattern','📁\x20','Source:\x20','has','Reason:\x20','\x20session','No\x20sessions\x20found','Loading\x20session...','listSecrets','window','executeCloneProject','Usage:\x20workflow:delete\x20<project-name-or-id>','message','\x0aApply\x20these\x20changes?','Task\x20name:\x20','Listing\x20workflow\x20sessions...','some','workflow:sessions','setSecret','data','total','Last\x20successful\x20update\x20was\x20at\x20iteration\x20'];a47_0x3e77=function(){return _0x461153;};return a47_0x3e77();}export class WorkflowDeleteCommand extends BaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x23a);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a47_0x3f412b(0x207)](_0x4891a1){const _0x5dfcf9=a47_0x3f412b,{options:_0x59d6d5,args:_0x30a804,tdx:_0x309135}=_0x4891a1,_0x49d296=_0x30a804[0x0];if(!_0x49d296)return console[_0x5dfcf9(0x1a3)](_0x5dfcf9(0x23c)),console['error'](_0x5dfcf9(0x26e)),0x1;_0x59d6d5[_0x5dfcf9(0x1aa)]&&console[_0x5dfcf9(0x1a3)]('Project:\x20'+_0x49d296);if(!_0x59d6d5[_0x5dfcf9(0x245)]){if(!isInteractive())return console[_0x5dfcf9(0x1a3)](a47_0x2874bf[_0x5dfcf9(0x148)]('\x0aError:'),_0x5dfcf9(0x201)),console[_0x5dfcf9(0x1a3)](a47_0x2874bf[_0x5dfcf9(0x297)](_0x5dfcf9(0x23f))),0x1;const _0x8b9989=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x49d296+_0x5dfcf9(0x218));if(!_0x8b9989)return console[_0x5dfcf9(0x1a3)](a47_0x2874bf['yellow'](_0x5dfcf9(0x139))),0x1;}const _0x32bb9e=await withSpinner('Deleting\x20project\x20'+_0x49d296+_0x5dfcf9(0xf1),()=>_0x309135['workflow'][_0x5dfcf9(0x100)](_0x49d296),{'verbose':_0x59d6d5[_0x5dfcf9(0x1aa)]}),_0x4b823c=_0x32bb9e[_0x5dfcf9(0x276)];return console[_0x5dfcf9(0x1a3)](_0x5dfcf9(0x25e)+_0x4b823c['projectName']),console[_0x5dfcf9(0x1a3)](_0x5dfcf9(0x227)+_0x4b823c[_0x5dfcf9(0x231)]),0x0;}}export function parseKeyValue(_0x1e5add){const _0x29e8b5=a47_0x3f412b,_0x37c64a=_0x1e5add[_0x29e8b5(0x129)]('=');if(_0x37c64a===-0x1)throw new Error('Invalid\x20format:\x20'+_0x1e5add+_0x29e8b5(0x10f));const _0x1b7a0e=_0x1e5add[_0x29e8b5(0x191)](0x0,_0x37c64a),_0x1f2561=_0x1e5add[_0x29e8b5(0x191)](_0x37c64a+0x1);if(!_0x1b7a0e)throw new Error(_0x29e8b5(0x1f6));return{'key':_0x1b7a0e,'value':_0x1f2561};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x11d);['description']=a47_0x3f412b(0x175);async[a47_0x3f412b(0x207)](_0x27595b){const _0x4fe9a4=a47_0x3f412b,{options:_0x1d0997,args:_0x524664,tdx:_0x3b8cf3}=_0x27595b,_0x46cdec=this[_0x4fe9a4(0xf6)](_0x524664,_0x1d0997);if(!_0x46cdec)return 0x1;_0x1d0997['verbose']&&console['error'](_0x4fe9a4(0x222)+_0x46cdec);const _0x5dfa6f=await withSpinner(_0x4fe9a4(0x1f3),()=>_0x3b8cf3[_0x4fe9a4(0x184)][_0x4fe9a4(0x26b)](_0x46cdec),{'verbose':_0x1d0997[_0x4fe9a4(0x1aa)]}),{secrets:_0xeb3cff}=_0x5dfa6f[_0x4fe9a4(0x276)];return console[_0x4fe9a4(0x1a3)]('✔\x20Found\x20'+_0xeb3cff[_0x4fe9a4(0x25d)]+_0x4fe9a4(0x182)+(_0xeb3cff[_0x4fe9a4(0x25d)]!==0x1?'s':'')),await handleSDKOutput(_0xeb3cff,_0x1d0997),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x238);[a47_0x3f412b(0xf3)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async['execute'](_0x31a81b){const _0x3b119a=a47_0x3f412b,{options:_0xd048a2,args:_0x345c6f,tdx:_0x6c6dad}=_0x31a81b;let _0x501012,_0x63705f;if(_0x345c6f[_0x3b119a(0x25d)]>=0x2)_0x501012=_0x345c6f[0x0],_0x63705f=_0x345c6f[0x1];else{if(_0x345c6f[_0x3b119a(0x25d)]===0x1&&_0xd048a2[_0x3b119a(0x144)])_0x501012=_0xd048a2[_0x3b119a(0x144)],_0x63705f=_0x345c6f[0x0];else return _0x345c6f[_0x3b119a(0x25d)]===0x1?(console[_0x3b119a(0x1a3)](_0x3b119a(0x22f)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3b119a(0x1a3)](_0x3b119a(0x20a)),console[_0x3b119a(0x1a3)](_0x3b119a(0x1d3)),0x1);}let _0x237739,_0x2281e8;try{({key:_0x237739,value:_0x2281e8}=parseKeyValue(_0x63705f));}catch(_0x99d737){return _0x99d737 instanceof Error&&console[_0x3b119a(0x1a3)](a47_0x2874bf[_0x3b119a(0x148)](_0x3b119a(0x133)),_0x99d737[_0x3b119a(0x26f)]),0x1;}_0xd048a2[_0x3b119a(0x1aa)]&&(console[_0x3b119a(0x1a3)](_0x3b119a(0x222)+_0x501012),console[_0x3b119a(0x1a3)](_0x3b119a(0x120)+_0x237739));const _0x43c445=await withSpinner(_0x3b119a(0x13f),()=>_0x6c6dad['workflow'][_0x3b119a(0x275)](_0x501012,_0x237739,_0x2281e8),{'verbose':_0xd048a2['verbose']}),_0x396035=_0x43c445[_0x3b119a(0x276)];return console[_0x3b119a(0x1a3)]('✔\x20Secret\x20\x27'+_0x396035[_0x3b119a(0x14e)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x396035[_0x3b119a(0x20e)]+'\x27'),(_0xd048a2['json']||_0xd048a2['jsonl'])&&await handleSingleObjectOutput(_0x396035,_0xd048a2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x101);[a47_0x3f412b(0xf3)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a47_0x3f412b(0x207)](_0x41d070){const _0x252a3c=a47_0x3f412b,{options:_0x2b7f99,args:_0x571aba,tdx:_0x20cefa}=_0x41d070;let _0x20f445,_0x5e7448;if(_0x571aba[_0x252a3c(0x25d)]>=0x2)_0x20f445=_0x571aba[0x0],_0x5e7448=_0x571aba[0x1];else{if(_0x571aba[_0x252a3c(0x25d)]===0x1&&_0x2b7f99['workflowProject'])_0x20f445=_0x2b7f99[_0x252a3c(0x144)],_0x5e7448=_0x571aba[0x0];else return _0x571aba[_0x252a3c(0x25d)]===0x1?(console['error'](_0x252a3c(0x22f)),console[_0x252a3c(0x1a3)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x252a3c(0x1a3)](_0x252a3c(0x1e5)),console[_0x252a3c(0x1a3)](_0x252a3c(0x24f)),0x1);}_0x2b7f99['verbose']&&(console[_0x252a3c(0x1a3)]('Project:\x20'+_0x20f445),console[_0x252a3c(0x1a3)](_0x252a3c(0x120)+_0x5e7448));if(!_0x2b7f99[_0x252a3c(0x245)]){if(!isInteractive())return console[_0x252a3c(0x1a3)](a47_0x2874bf['red'](_0x252a3c(0x1de)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x252a3c(0x1a3)](a47_0x2874bf[_0x252a3c(0x297)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3471bc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5e7448+_0x252a3c(0xff)+_0x20f445+'\x27?');if(!_0x3471bc)return console[_0x252a3c(0x1a3)](a47_0x2874bf[_0x252a3c(0x23d)]('Cancelled')),0x1;}const _0x54cff1=await withSpinner(_0x252a3c(0x18c),()=>_0x20cefa['workflow'][_0x252a3c(0x24e)](_0x20f445,_0x5e7448),{'verbose':_0x2b7f99[_0x252a3c(0x1aa)]}),_0x2bb957=_0x54cff1['data'];return console[_0x252a3c(0x1a3)]('✔\x20Secret\x20\x27'+_0x2bb957[_0x252a3c(0x14e)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x2bb957[_0x252a3c(0x20e)]+'\x27'),(_0x2b7f99[_0x252a3c(0x1a8)]||_0x2b7f99['jsonl'])&&await handleSingleObjectOutput(_0x2bb957,_0x2b7f99),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(_0x441d47){const _0x2e871c=a47_0x3f412b,_0x2fb387=Math['floor'](_0x441d47/0x3e8),_0x2380d5=Math['floor'](_0x2fb387/0x3c),_0x41f4cd=Math['floor'](_0x2380d5/0x3c),_0x189b49=Math[_0x2e871c(0x21d)](_0x41f4cd/0x18);if(_0x189b49>0x0){const _0x5b9663=_0x41f4cd%0x18;return _0x5b9663>0x0?_0x189b49+'d\x20'+_0x5b9663+'h':_0x189b49+'d';}else{if(_0x41f4cd>0x0){const _0x3b40ce=_0x2380d5%0x3c;return _0x3b40ce>0x0?_0x41f4cd+'h\x20'+_0x3b40ce+'m':_0x41f4cd+'h';}else{if(_0x2380d5>0x0){const _0x505c97=_0x2fb387%0x3c;return _0x505c97>0x0?_0x2380d5+'m\x20'+_0x505c97+'s':_0x2380d5+'m';}else return _0x2fb387+'s';}}}function formatTimestamp(_0x42ce5c,_0x40a75f){const _0x1d7b70=a47_0x3f412b,_0x2ee9c9=new Date(_0x42ce5c),_0x1dc50d=String(_0x2ee9c9[_0x1d7b70(0x1c6)]())[_0x1d7b70(0x21c)](0x2,'0'),_0x318895=String(_0x2ee9c9[_0x1d7b70(0x20f)]())[_0x1d7b70(0x21c)](0x2,'0'),_0x49d975=_0x1dc50d+':'+_0x318895,_0x1c4b6e=_0x2ee9c9[_0x1d7b70(0x14f)]()===_0x40a75f[_0x1d7b70(0x14f)]()&&_0x2ee9c9[_0x1d7b70(0x15a)]()===_0x40a75f[_0x1d7b70(0x15a)]()&&_0x2ee9c9['getDate']()===_0x40a75f['getDate']();if(_0x1c4b6e)return _0x49d975;else{const _0xb85c5=String(_0x2ee9c9[_0x1d7b70(0x15a)]()+0x1)[_0x1d7b70(0x21c)](0x2,'0'),_0x25ec3f=String(_0x2ee9c9['getDate']())[_0x1d7b70(0x21c)](0x2,'0');return _0xb85c5+'-'+_0x25ec3f+'\x20'+_0x49d975;}}function formatDate(_0x2f31f3){const _0x1ff30d=a47_0x3f412b,_0xab5166=_0x2f31f3['getFullYear'](),_0x59566e=String(_0x2f31f3[_0x1ff30d(0x15a)]()+0x1)[_0x1ff30d(0x21c)](0x2,'0'),_0x3689ea=String(_0x2f31f3['getDate']())[_0x1ff30d(0x21c)](0x2,'0');return _0xab5166+'-'+_0x59566e+'-'+_0x3689ea;}function getTaskStateIcon(_0x49e2af){const _0x2f5a5b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2f5a5b[_0x49e2af]||'⚪';}function getBarChar(_0x55eb72){const _0x119c25=a47_0x3f412b;return _0x55eb72===_0x119c25(0x1a3)||_0x55eb72===_0x119c25(0x223)?'×':'─';}function getBarColor(_0x32ad2a){const _0x260a72=a47_0x3f412b,_0x34f5da={'success':a47_0x2874bf[_0x260a72(0x11b)],'error':a47_0x2874bf[_0x260a72(0x148)],'group_error':a47_0x2874bf[_0x260a72(0x148)],'running':a47_0x2874bf['blue'],'blocked':a47_0x2874bf['yellow'],'planned':a47_0x2874bf[_0x260a72(0x297)],'canceling':a47_0x2874bf[_0x260a72(0x23d)]};return _0x34f5da[_0x32ad2a]||a47_0x2874bf[_0x260a72(0x198)];}function parseTaskName(_0x57a34d){const _0x315f56=a47_0x3f412b;let _0x1519f1=_0x57a34d['replace'](/^\++/,'');const _0x48d189=_0x1519f1[_0x315f56(0x1a0)]('+'),_0x48b6ce=_0x48d189[_0x315f56(0x25d)]>0x1?_0x48d189['length']-0x2:0x0,_0x41b1d3=_0x48d189[_0x48d189[_0x315f56(0x25d)]-0x1]||_0x1519f1;return{'level':_0x48b6ce,'name':'+'+_0x41b1d3};}function truncateTaskName(_0x55087d,_0x425183){const _0x4e92b9=stringWidth(_0x55087d);if(_0x4e92b9<=_0x425183)return _0x55087d;let _0x2e5140=_0x55087d;while(stringWidth(_0x2e5140+'…')>_0x425183&&_0x2e5140['length']>0x0){_0x2e5140=_0x2e5140['slice'](0x0,-0x1);}return _0x2e5140+'…';}function calculateTimeScale(_0x5d7fa6,_0x3812d6){const _0x5431f0=a47_0x3f412b;return{'startTime':_0x5d7fa6[_0x5431f0(0x13a)],'endTime':_0x5d7fa6[_0x5431f0(0x163)],'durationMs':_0x5d7fa6[_0x5431f0(0xef)],'msPerChar':_0x5d7fa6['duration']/_0x3812d6};}function timeToPosition(_0x1c9def,_0x1f17c1,_0x1abd77){const _0x3d6e61=a47_0x3f412b,_0x255144=_0x1c9def-_0x1f17c1[_0x3d6e61(0x233)],_0x267f5c=Math[_0x3d6e61(0x21d)](_0x255144/_0x1f17c1['msPerChar']);return Math[_0x3d6e61(0x12b)](0x0,Math[_0x3d6e61(0x146)](_0x267f5c,_0x1abd77));}function renderTimeAxis(_0x41c645,_0x4ef57e){const _0x52d9b5=a47_0x3f412b,_0x334a63=Math[_0x52d9b5(0x146)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x52d9b5(0x12b)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x52d9b5(0x21d)](_0x4ef57e/TIMELINE_CONFIG[_0x52d9b5(0x17f)]))),_0x23b678=_0x41c645['durationMs']/(_0x334a63-0x1),_0x37c72=new Date(_0x41c645['startTime']),_0x107603=[];for(let _0xff8cfe=0x0;_0xff8cfe<_0x334a63;_0xff8cfe++){const _0x3e747c=_0x41c645[_0x52d9b5(0x233)]+_0xff8cfe*_0x23b678,_0x2c7eec=timeToPosition(_0x3e747c,_0x41c645,_0x4ef57e),_0x5ba7db=formatTimestamp(_0x3e747c,_0x37c72);_0x107603[_0x52d9b5(0x119)]({'pos':_0x2c7eec,'text':_0x5ba7db});}const _0x274892=new Array(_0x4ef57e)['fill']('\x20');let _0x11e88e=-0x1;for(const {pos:_0x5f379a,text:_0x120323}of _0x107603){let _0x1fddd9=Math['max'](0x0,_0x5f379a-Math[_0x52d9b5(0x21d)](_0x120323['length']/0x2));_0x1fddd9<=_0x11e88e+TIMELINE_CONFIG[_0x52d9b5(0x17a)]&&(_0x1fddd9=_0x11e88e+TIMELINE_CONFIG[_0x52d9b5(0x17a)]+0x1);_0x1fddd9+_0x120323['length']>_0x4ef57e&&(_0x1fddd9=_0x4ef57e-_0x120323[_0x52d9b5(0x25d)]);if(_0x1fddd9>=0x0&&_0x1fddd9+_0x120323[_0x52d9b5(0x25d)]<=_0x4ef57e&&_0x1fddd9>_0x11e88e){for(let _0x352897=0x0;_0x352897<_0x120323[_0x52d9b5(0x25d)];_0x352897++){_0x274892[_0x1fddd9+_0x352897]=_0x120323[_0x352897];}_0x11e88e=_0x1fddd9+_0x120323[_0x52d9b5(0x25d)]-0x1;}}return _0x274892[_0x52d9b5(0x1b4)]('');}function renderTaskRow(_0x5d0423,_0x28a133,_0x2a862c,_0x26aaba){const _0x4b26e2=a47_0x3f412b,{level:_0x12e635,name:_0x3224a3}=parseTaskName(_0x5d0423['name']),_0x2e67e3='\x20'['repeat'](_0x12e635),_0x127246=_0x5d0423['window']?'('+formatElapsed(_0x5d0423[_0x4b26e2(0x26c)]['duration'])+')':'',_0x282f34=stringWidth(_0x127246),_0x2caec2=_0x12e635*0x1,_0x1a2dab=_0x26aaba-_0x2caec2-_0x282f34-0x1,_0x5a7073=truncateTaskName(_0x3224a3,_0x1a2dab),_0x320b64=_0x2e67e3+_0x5a7073,_0x4e974f=stringWidth(_0x320b64),_0x163150=_0x26aaba-_0x4e974f-_0x282f34,_0x5ac60c=_0x320b64+'\x20'[_0x4b26e2(0x157)](Math[_0x4b26e2(0x12b)](0x1,_0x163150))+a47_0x2874bf[_0x4b26e2(0x297)](_0x127246),_0x52cfa2=getTaskStateIcon(_0x5d0423[_0x4b26e2(0x211)]),_0x4a7892=new Array(_0x2a862c)[_0x4b26e2(0x11a)]('\x20');if(_0x5d0423[_0x4b26e2(0x26c)]){const _0x3bb514=timeToPosition(_0x5d0423[_0x4b26e2(0x26c)][_0x4b26e2(0x13a)],_0x28a133,_0x2a862c),_0x3905c3=timeToPosition(_0x5d0423['window'][_0x4b26e2(0x163)],_0x28a133,_0x2a862c),_0x4b1a6d=getBarChar(_0x5d0423[_0x4b26e2(0x211)]),_0x197356=Math[_0x4b26e2(0x12b)](_0x3bb514+0x1,_0x3905c3);for(let _0x169f9e=_0x3bb514;_0x169f9e<Math[_0x4b26e2(0x146)](_0x197356,_0x2a862c);_0x169f9e++){_0x4a7892[_0x169f9e]=_0x4b1a6d;}}const _0x24828a=getBarColor(_0x5d0423[_0x4b26e2(0x211)]),_0x3f373c=_0x4a7892[_0x4b26e2(0x11e)](_0x3d64c3=>_0x3d64c3==='\x20'?'\x20':_0x24828a(_0x3d64c3))[_0x4b26e2(0x1b4)]('');return _0x52cfa2+'\x20'+_0x5ac60c+'│'+_0x3f373c+'│';}function calculateStats(_0x1b6811){const _0x417420=a47_0x3f412b,_0x362f70={'total':_0x1b6811[_0x417420(0x25d)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x56c76d of _0x1b6811){if(_0x56c76d['state']===_0x417420(0x137))_0x362f70[_0x417420(0x137)]++;else{if(_0x56c76d[_0x417420(0x211)]==='error'||_0x56c76d[_0x417420(0x211)]===_0x417420(0x223))_0x362f70[_0x417420(0x1a3)]++;else _0x56c76d[_0x417420(0x211)]==='running'?_0x362f70[_0x417420(0x1e3)]++:_0x362f70[_0x417420(0x254)]++;}}return _0x362f70;}function formatStats(_0x191d88){const _0x56e964=a47_0x3f412b;return['Total:\x20'+_0x191d88[_0x56e964(0x277)],'✅\x20'+_0x191d88[_0x56e964(0x137)],'❌\x20'+_0x191d88[_0x56e964(0x1a3)],_0x56e964(0x114)+_0x191d88['running'],'⏳\x20'+_0x191d88['pending']][_0x56e964(0x1b4)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x3f412b(0x280)]=a47_0x3f412b(0x1c3);[a47_0x3f412b(0xf3)]=a47_0x3f412b(0x1ad);async['execute'](_0x1a6c39){const _0xe796ea=a47_0x3f412b,{options:_0x4fa541,args:_0x1828a5,tdx:_0x55731d}=_0x1a6c39;let _0x20e054,_0x2ef4ca,_0x2f4e25=![];if(_0x1828a5[0x0]){if(_0x1828a5[0x0][_0xe796ea(0x25a)]('.')){const _0x44200d=this[_0xe796ea(0x263)](_0x1828a5,_0x4fa541);if(!_0x44200d)return 0x1;_0x20e054=_0x44200d['projectName'],_0x2ef4ca=_0x44200d[_0xe796ea(0x166)];}else{_0x2ef4ca=_0x1828a5[0x0],_0x20e054=_0x4fa541[_0xe796ea(0x144)];if(!_0x20e054)return console['error'](a47_0x2874bf['red'](_0xe796ea(0x133)),_0xe796ea(0x262)),0x1;_0x2f4e25=!![];}}else{const _0x1e9e31=this[_0xe796ea(0x263)](_0x1828a5,_0x4fa541);if(!_0x1e9e31)return 0x1;_0x20e054=_0x1e9e31[_0xe796ea(0x20e)],_0x2ef4ca=_0x1e9e31[_0xe796ea(0x166)];}if(_0x4fa541[_0xe796ea(0x1aa)]){if(_0x20e054&&_0x2ef4ca)console['error']('Filter:\x20'+_0x20e054+'.'+_0x2ef4ca);else _0x20e054&&console[_0xe796ea(0x1a3)]('Filter:\x20project='+_0x20e054);}const _0x46df86=_0x4fa541[_0xe796ea(0x22c)],_0x477d10=_0x4fa541[_0xe796ea(0x1f7)];if(_0x46df86){_0x477d10&&console[_0xe796ea(0x1a3)](a47_0x2874bf['yellow'](_0xe796ea(0x1e4)),_0xe796ea(0x12d));const _0xb5528f=_0x4fa541[_0xe796ea(0x1a1)];return _0xb5528f?await this['pollTimeline'](_0x1a6c39,_0x46df86):await this['renderSingleTimeline'](_0x1a6c39,_0x46df86,_0x4fa541),0x0;}if(_0x477d10){const _0x5ad802=await withSpinner(_0xe796ea(0x26a),()=>_0x55731d[_0xe796ea(0x184)][_0xe796ea(0x25c)]({'projectName':_0x20e054,'workflowName':_0x2ef4ca,'limit':0x64}),{'verbose':_0x4fa541[_0xe796ea(0x1aa)]}),_0x41caab=_0x5ad802[_0xe796ea(0x276)][_0xe796ea(0xed)](_0x3b17ff=>_0x3b17ff['id']===_0x477d10);if(!_0x41caab)return console['error'](a47_0x2874bf[_0xe796ea(0x148)](_0xe796ea(0x133)),_0xe796ea(0x1c1)+_0x477d10),0x1;if(!_0x41caab[_0xe796ea(0x202)]?.['id'])return console['error'](a47_0x2874bf['red']('Error:'),_0xe796ea(0x296)+_0x477d10+_0xe796ea(0x244)),0x1;const _0x459296=_0x41caab[_0xe796ea(0x202)]['id'];_0x4fa541[_0xe796ea(0x1aa)]&&console['error']('Using\x20attempt\x20'+_0x459296+_0xe796ea(0x188)+_0x477d10);const _0x23cc38=_0x4fa541['follow'];return _0x23cc38?await this[_0xe796ea(0xf5)](_0x1a6c39,_0x459296):await this[_0xe796ea(0x190)](_0x1a6c39,_0x459296,_0x4fa541),0x0;}const _0x5c0878=await withSpinner('Loading\x20sessions...',()=>_0x55731d[_0xe796ea(0x184)][_0xe796ea(0x25c)]({'projectName':_0x20e054,'workflowName':_0x2ef4ca,'limit':_0x4fa541[_0xe796ea(0x1f8)]||0x32}),{'verbose':_0x4fa541['verbose']}),_0xb04a6=_0x5c0878[_0xe796ea(0x276)];if(_0xb04a6['length']===0x0){if(_0x20e054&&_0x2ef4ca)console[_0xe796ea(0x1a3)](_0xe796ea(0x142)+_0x20e054+'.'+_0x2ef4ca);else _0x20e054?console[_0xe796ea(0x1a3)](_0xe796ea(0x21b)+_0x20e054):(console[_0xe796ea(0x1a3)](_0xe796ea(0x1bf)),console[_0xe796ea(0x1a3)](a47_0x2874bf[_0xe796ea(0x297)](_0xe796ea(0x23b))));return 0x0;}_0xb04a6[_0xe796ea(0x298)]((_0x1ef9c6,_0xe3de5d)=>{const _0x382d77=_0xe796ea,_0x2e799b=_0x1ef9c6['sessionTime']||'',_0x2c8a8b=_0xe3de5d[_0x382d77(0x122)]||'';return _0x2c8a8b[_0x382d77(0x15c)](_0x2e799b);});if(_0x4fa541['json']||_0x4fa541['jsonl'])return await handleSDKOutput(_0xb04a6,_0x4fa541),0x0;let _0x31d0d3;if(_0x2f4e25){const _0x4272f7=_0xb04a6[0x0];if(!_0x4272f7[_0xe796ea(0x202)]?.['id'])return console[_0xe796ea(0x1a3)](_0xe796ea(0x19a)),0x0;_0x31d0d3=_0x4272f7[_0xe796ea(0x202)]['id'],_0x4fa541[_0xe796ea(0x1aa)]&&console[_0xe796ea(0x1a3)](_0xe796ea(0x19b)+_0x4272f7['sessionTime']);}else{const _0x5b074f=_0xb04a6[_0xe796ea(0x11e)](_0x1a30ae=>{const _0x294d84=_0xe796ea,_0x2e0799=getAttemptStatusDisplay(_0x1a30ae['lastAttempt']);return{'title':_0x1a30ae[_0x294d84(0x1d2)]?.[_0x294d84(0x280)]+'.'+_0x1a30ae[_0x294d84(0x184)]?.[_0x294d84(0x280)]+_0x294d84(0x123)+_0x1a30ae[_0x294d84(0x122)]+'\x20'+_0x2e0799[_0x294d84(0x14c)],'value':_0x1a30ae[_0x294d84(0x202)]?.['id']||'','description':_0x2e0799[_0x294d84(0x145)]};}),_0x2a84ca=await a47_0x5ff89f({'type':_0xe796ea(0x168),'name':'attemptId','message':_0xe796ea(0x1ca),'choices':_0x5b074f[_0xe796ea(0x167)](_0x444b1d=>_0x444b1d['value']!=='')});if(!_0x2a84ca[_0xe796ea(0x22c)])return 0x0;_0x31d0d3=_0x2a84ca[_0xe796ea(0x22c)];}const _0x39b83e=_0x4fa541['follow'];return _0x39b83e?await this[_0xe796ea(0xf5)](_0x1a6c39,_0x31d0d3):await this[_0xe796ea(0x190)](_0x1a6c39,_0x31d0d3,_0x4fa541),0x0;}async[a47_0x3f412b(0x190)](_0x10f0cb,_0x4d3a77,_0x343381){const _0x4abd60=a47_0x3f412b,{tdx:_0x531fb3}=_0x10f0cb;let _0x181941,_0x116b11;try{[_0x181941,_0x116b11]=await Promise['all']([_0x531fb3[_0x4abd60(0x184)][_0x4abd60(0x12c)](_0x4d3a77),_0x531fb3[_0x4abd60(0x184)][_0x4abd60(0x1b5)](_0x4d3a77,![])]);}catch(_0x320d5f){console[_0x4abd60(0x1a3)](a47_0x2874bf[_0x4abd60(0x148)](_0x4abd60(0x249)));_0x343381[_0x4abd60(0x1aa)]&&console[_0x4abd60(0x1a3)](_0x320d5f);throw _0x320d5f;}if(_0x343381[_0x4abd60(0x1a8)]||_0x343381[_0x4abd60(0x13d)]){const _0x50f3c4=this[_0x4abd60(0x246)](_0x181941,_0x116b11);await handleSDKOutput([_0x50f3c4],_0x343381);return;}const _0x4194fb=_0x531fb3[_0x4abd60(0x18e)]['site'],_0x573564=this['renderTimeline'](_0x181941,_0x116b11,_0x4194fb);console[_0x4abd60(0x104)](_0x573564);}async[a47_0x3f412b(0xf5)](_0x5f36d5,_0x364988){const _0x20de9a=a47_0x3f412b,{tdx:_0x168bbe}=_0x5f36d5,_0x5510d8=TIMELINE_CONFIG[_0x20de9a(0x179)],_0x250d0f=TIMELINE_CONFIG[_0x20de9a(0x20c)];let _0x2d169b=0x0;while(_0x2d169b<_0x250d0f){process[_0x20de9a(0x243)][_0x20de9a(0x232)]&&process[_0x20de9a(0x243)]['write']('\x1bc');let _0xd1ab0,_0x20db92;try{[_0xd1ab0,_0x20db92]=await Promise[_0x20de9a(0x208)]([_0x168bbe[_0x20de9a(0x184)][_0x20de9a(0x12c)](_0x364988),_0x168bbe[_0x20de9a(0x184)][_0x20de9a(0x1b5)](_0x364988,![])]);}catch(_0x406276){console[_0x20de9a(0x1a3)](a47_0x2874bf[_0x20de9a(0x148)](_0x20de9a(0x10b)));_0x2d169b>0x0&&console[_0x20de9a(0x1a3)](a47_0x2874bf[_0x20de9a(0x297)](_0x20de9a(0x278)+_0x2d169b));throw _0x406276;}const _0x5bb38a=_0x168bbe[_0x20de9a(0x18e)][_0x20de9a(0x1dd)],_0x43faee=this[_0x20de9a(0x1a4)](_0xd1ab0,_0x20db92,_0x5bb38a);console[_0x20de9a(0x104)](_0x43faee);const _0x104a1f=_0xd1ab0['done']&&_0x20db92[_0x20de9a(0x1ef)](_0x177deb=>_0x177deb[_0x20de9a(0x211)]!==_0x20de9a(0x1e3)&&_0x177deb[_0x20de9a(0x211)]!==_0x20de9a(0x253));if(_0x104a1f){console[_0x20de9a(0x1a3)](a47_0x2874bf[_0x20de9a(0x11b)](_0x20de9a(0x1b7)));break;}console['error'](a47_0x2874bf[_0x20de9a(0x297)](_0x20de9a(0x18b)+_0x2d169b*0x2+_0x20de9a(0x121))),await new Promise(_0xd4c954=>setTimeout(_0xd4c954,_0x5510d8)),_0x2d169b++;}_0x2d169b>=_0x250d0f&&console[_0x20de9a(0x1a3)](a47_0x2874bf[_0x20de9a(0x23d)](_0x20de9a(0x217)));}[a47_0x3f412b(0x1a4)](_0x123b2c,_0x3a02e8,_0x6b0914){const _0x29cf17=a47_0x3f412b,_0x1959b3=[],_0x368662=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x4e6481=0x5,_0x554aa9=process['stdout'][_0x29cf17(0x221)]||0x78,_0x5dfef3=_0x554aa9-_0x368662-_0x4e6481,_0x212e3e=Math[_0x29cf17(0x12b)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0x5dfef3,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x36062c=new Date(_0x123b2c['createdAt'])[_0x29cf17(0x241)](),_0x4e9c73=_0x123b2c['finishedAt']?new Date(_0x123b2c[_0x29cf17(0x27b)])[_0x29cf17(0x241)]():Date['now'](),_0x281fef={'start':_0x36062c,'end':_0x4e9c73,'duration':_0x4e9c73-_0x36062c},_0x116e54=new Map(),_0xda05bf=[];for(const _0x331f25 of _0x3a02e8){if(_0x331f25[_0x29cf17(0x19c)]){const _0x2055da=new Date(_0x331f25[_0x29cf17(0x19c)])[_0x29cf17(0x241)](),_0x4c00d9=_0x331f25[_0x29cf17(0xf9)]?new Date(_0x331f25['updatedAt'])[_0x29cf17(0x241)]():Date[_0x29cf17(0xf4)](),_0x1552fa={'start':_0x2055da,'end':_0x4c00d9,'duration':_0x4c00d9-_0x2055da};_0x116e54['set'](_0x331f25['id'],_0x1552fa),_0xda05bf[_0x29cf17(0x119)]({'name':_0x331f25[_0x29cf17(0xfb)],'state':_0x331f25['state']||_0x29cf17(0x109),'window':_0x1552fa});}else _0xda05bf['push']({'name':_0x331f25[_0x29cf17(0xfb)],'state':_0x331f25[_0x29cf17(0x211)]||_0x29cf17(0x253),'window':undefined});}_0xda05bf[_0x29cf17(0x298)]((_0x6ecfb8,_0x3cbae7)=>{const _0x578eea=_0x29cf17;if(!_0x6ecfb8['window'])return 0x1;if(!_0x3cbae7[_0x578eea(0x26c)])return-0x1;return _0x6ecfb8['window']['start']-_0x3cbae7[_0x578eea(0x26c)][_0x578eea(0x13a)];});const _0x45a65d=_0xda05bf[_0x29cf17(0x25d)],_0x426390=_0x45a65d>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x426390&&_0xda05bf[_0x29cf17(0x248)](TIMELINE_CONFIG[_0x29cf17(0x1f0)]);const _0x1fba73=calculateTimeScale(_0x281fef,_0x212e3e),_0x32c640=_0x123b2c['done']?_0x123b2c['success']?a47_0x2874bf[_0x29cf17(0x11b)](_0x29cf17(0x137)):a47_0x2874bf['red']('error'):a47_0x2874bf[_0x29cf17(0x147)](_0x29cf17(0x1e3)),_0x7c3cb0=_0x123b2c[_0x29cf17(0x1d2)]?.['id'],_0x58c467=_0x123b2c[_0x29cf17(0x1f7)];let _0x4f975d;if(_0x7c3cb0&&_0x58c467){const _0x50ccee=getWorkflowAttemptUrl(_0x6b0914,_0x7c3cb0,_0x58c467,_0x123b2c['id']);_0x4f975d=hyperlink(a47_0x2874bf[_0x29cf17(0x297)](_0x123b2c['id']),_0x50ccee);}else _0x4f975d=a47_0x2874bf[_0x29cf17(0x297)](_0x123b2c['id']);_0x1959b3['push'](_0x29cf17(0x113)+_0x4f975d+'\x20-\x20'+_0x32c640+_0x29cf17(0x123)+formatElapsed(_0x281fef[_0x29cf17(0xef)]));if(_0xda05bf[_0x29cf17(0x25d)]>0x0){const _0x50720b=renderTimeAxis(_0x1fba73,_0x212e3e),_0x538756=new Date(_0x281fef[_0x29cf17(0x13a)]),_0x12cb89=formatDate(_0x538756),_0x47dfec=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x29cf17(0x17d)]+_0x368662,_0x1b9a6b=_0x12cb89[_0x29cf17(0x21c)](_0x47dfec),_0x58cb23=a47_0x2874bf[_0x29cf17(0x297)](_0x1b9a6b);_0x1959b3[_0x29cf17(0x119)](_0x58cb23+'\x20'+_0x50720b);for(const _0x4d0867 of _0xda05bf){_0x1959b3['push'](renderTaskRow(_0x4d0867,_0x1fba73,_0x212e3e,_0x368662));}const _0x422922=calculateStats(_0xda05bf);_0x1959b3[_0x29cf17(0x119)](formatStats(_0x422922)),_0x426390&&_0x1959b3[_0x29cf17(0x119)](a47_0x2874bf[_0x29cf17(0x23d)](_0x29cf17(0x215)+TIMELINE_CONFIG[_0x29cf17(0x1f0)]+_0x29cf17(0x261)+_0x45a65d+_0x29cf17(0x1a5))),_0x1959b3[_0x29cf17(0x119)](''),_0x1959b3[_0x29cf17(0x119)](a47_0x2874bf[_0x29cf17(0x297)](_0x29cf17(0x235))+(_0x29cf17(0x1a9)+_0x123b2c['id']+'\x20logs')+a47_0x2874bf[_0x29cf17(0x297)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1959b3[_0x29cf17(0x119)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1959b3['join']('\x0a');}[a47_0x3f412b(0x246)](_0x7c6da6,_0x310f16){const _0x11dd6e=a47_0x3f412b,_0x515d2a=new Date(_0x7c6da6[_0x11dd6e(0x194)])[_0x11dd6e(0x241)](),_0xef6cbc=_0x7c6da6[_0x11dd6e(0x27b)]?new Date(_0x7c6da6[_0x11dd6e(0x27b)])[_0x11dd6e(0x241)]():Date['now'](),_0x2cb0a3=_0xef6cbc-_0x515d2a,_0x37cf33=[];for(const _0x4df5cd of _0x310f16){if(_0x4df5cd[_0x11dd6e(0x19c)]){const _0x252384=new Date(_0x4df5cd[_0x11dd6e(0x19c)])[_0x11dd6e(0x241)](),_0x3abaa0=_0x4df5cd[_0x11dd6e(0xf9)]?new Date(_0x4df5cd[_0x11dd6e(0xf9)])[_0x11dd6e(0x241)]():Date['now']();_0x37cf33[_0x11dd6e(0x119)]({'name':_0x4df5cd['fullName'],'state':_0x4df5cd['state']||_0x11dd6e(0x109),'window':{'start':_0x252384,'end':_0x3abaa0,'duration':_0x3abaa0-_0x252384}});}else _0x37cf33['push']({'name':_0x4df5cd[_0x11dd6e(0xfb)],'state':_0x4df5cd[_0x11dd6e(0x211)]||'planned','window':undefined});}const _0x553389=calculateStats(_0x37cf33);return{'attempt':{'id':_0x7c6da6['id'],'status':_0x7c6da6[_0x11dd6e(0x237)]?_0x7c6da6[_0x11dd6e(0x137)]?'success':_0x11dd6e(0x1a3):'running','createdAt':_0x7c6da6[_0x11dd6e(0x194)],'finishedAt':_0x7c6da6[_0x11dd6e(0x27b)],'duration_ms':_0x2cb0a3},'tasks':_0x37cf33[_0x11dd6e(0x11e)](_0x480752=>({'name':_0x480752[_0x11dd6e(0x280)],'state':_0x480752[_0x11dd6e(0x211)],'startedAt':_0x480752[_0x11dd6e(0x26c)]?new Date(_0x480752['window'][_0x11dd6e(0x13a)])['toISOString']():null,'updatedAt':_0x480752[_0x11dd6e(0x26c)]?new Date(_0x480752[_0x11dd6e(0x26c)]['end'])[_0x11dd6e(0x154)]():null,'duration_ms':_0x480752[_0x11dd6e(0x26c)]?.['duration']||null})),'stats':_0x553389};}}
1
+ const a47_0x3bd9fa=a47_0x2f5c;function a47_0xe2c9(){const _0x174ea4=['Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','window','revision','duration','Session\x20','Fetching\x20log\x20files...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x0aApply\x20these\x20changes?','startedAt','running','\x20is\x20not\x20a\x20directory','displayLine','new','Killing\x20attempt...','metadata','\x20\x20Changes:\x20','232KPBDpA','No\x20sessions\x20found','Loading\x20session...','Project\x20name\x20is\x20required','path','workflow','LABEL_MIN_SPACING','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','resolveProject','updatedAt','run','\x27\x20from\x20project\x20\x27','split','workflow:secrets:delete','⚠\x20Showing\x20first\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Source\x20project:\x20','GUTTER','isNewProject','slice','workflow:use','\x27...','workflow:secrets:set','targetExists','\x20(system)','status','\x20session','✔\x20Deleted\x20project\x20','10Jnhakw','📁\x20','\x0a✔\x20No\x20changes\x20to\x20push','parse','\x20from\x20session\x20','requireProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sys','msPerChar','\x20secret','Resolving\x20project\x20\x27','find','start','(use\x20--limit\x20to\x20see\x20more)','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','No\x20workflow\x20sessions\x20found','Project:\x20','table','Cancelled','\x20\x20Location:\x20','Retrying\x20session...','follow','get','Key:\x20','✔\x20Found\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','toLowerCase','getTime','Show\x20logs\x20for\x20a\x20workflow\x20attempt','durationMs','✔\x20Push\x20complete','workflow:tasks','\x20\x20Session\x20context\x20set\x20to:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflows\x20found\x20in\x20project:\x20','workflow:logs','\x0a✔\x20Already\x20up\x20to\x20date','Task\x20name:\x20','renderTimeline','revision:\x20','type','📋\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','relative','→\x20Project:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','error','workflowName','Files\x20to\x20upload:\x20','1775640mRrlHW','newProjectName','unchanged','log','LABEL_WIDTH_DIVISOR','Cloning\x20to\x20','Getting\x20attempt\x20tasks...','\x20attempt','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','splice','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','round','Pull\x20workflow\x20project\x20to\x20local\x20folder','params','/attempt/','Expected\x20format:\x20--param\x20key=value','Project\x20name:\x20','No\x20attempts\x20found','New\x20project\x20name:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','includes','task','\x20\x20Session\x20ID:\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20workflow\x20tdx.json\x20found','end','\x20sessions\x20','rows','\x20task','sourceDir','listSecrets','Error:\x20Project\x20name\x20is\x20required','session:','\x1b[1A\x1b[2K','167057ESHAzt','startsWith','Show\x20specific\x20attempt\x20details','join','includeSubtasks','context','yes','No\x20sessions\x20with\x20timing\x20information','Total:\x20','every','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Latest\x20session\x20has\x20no\x20attempt','workflow:pull','\x20deleted','createdAt','isArray','total','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','length','map','Error:\x20Invalid\x20parameter\x20format:\x20','text','Filter:\x20','MAX_TIMELINE_WIDTH','workflow:push','trim','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Params:\x20','No\x20workflows\x20found','cyan','state','pollTimeline','7QitPla','✔\x20Secret\x20\x27','Downloading\x20project\x20','cancelRequested','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Target\x20directory:\x20','white','param','11065xMhnPy','\x0aDry\x20run\x20-\x20no\x20files\x20written','Include\x20retried:\x20yes','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','kill','From\x20task:\x20','limit','targetDir','taskName','Select\x20a\x20task\x20to\x20view\x20logs:','\x20\x20Project\x20ID:\x20','padStart','push','project','workflow:kill','💡\x20Tip:\x20Use\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Pattern:\x20','Force:\x20yes','stdout','Error:\x20Invalid\x20JSON\x20in\x20--params','summary','workflow:delete','Deleting\x20project\x20','Updating\x20','Loading\x20workflows...','170465tHGutm','Source:\x20','attemptId','workflow:sessions','dim','\x20unchanged','logs','existingProjectId','message','workflow:upload','floor','index','buildTimelineData','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','readFile','name','cwd','List\x20workflows','done','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:clone','Analyzing\x20project...','Source\x20directory:\x20','workflowProject','Getting\x20attempt\x20details...','match','No\x20workflow\x20projects\x20found','No\x20attempts\x20found\x20in\x20project:\x20','\x20\x20Attempt\x20ID:\x20','from','navigateSessionsInteractive','substring','showWorkflowConsoleUrl','No\x20sessions\x20found\x20for:\x20','toISOString','max','now','Source\x20directory\x20is\x20required','\x0aPolling...\x20(','workflow:timeline','\x20to\x20see\x20detailed\x20logs','\x20\x20Revision:\x20','repeat','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','canceling','No\x20projects\x20match\x20pattern:\x20',',\x20Workflow:\x20','Retry\x20a\x20session\x20or\x20attempt','site','Loading\x20sessions...','No\x20sessions\x20found\x20in\x20project:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','jsonl','10QSOHOc','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','key','Retrying\x20attempt...','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Error:\x20KEY=VALUE\x20is\x20required','sort','logFiles','\x20\x20New\x20attempt\x20ID:\x20','keys','Usage:\x20tdx\x20wf\x20use\x20<project>','Starting\x20workflow\x20run...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','124617SbVdCh','fill','utf-8','attempt','Using\x20attempt\x20','(unknown)','filter','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','projectId','workflow:secrets:list','Reason:\x20','session','Including\x20subtasks:\x20yes','Attempt\x20ID:\x20','\x0aUpdate\x20existing\x20project\x20\x22','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','has','No\x20log\x20content\x20found','Warning:','description','\x20\x20tdx\x20wf\x20use\x20<project>','✔\x20Retry\x20started','Project\x20filter:\x20','Start\x20a\x20workflow\x20run','-\x20nothing\x20pushed','skipValidation','parseProjectWorkflowPattern','fileSize','retryAttemptName','List\x20all\x20workflow\x20projects','\x0aError:','Parameters:\x20','\x20\x20Target:\x20','projects','isTTY','Auto-selected\x20latest\x20session:\x20','Error:\x20','---\x20','dryRun','Pulling\x20project\x20','isDirectory','✔\x20Project\x20updated','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','finishedAt','tdx\x20wf\x20attempt\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Analyzing\x20changes...','execute','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x22?\x20This\x20cannot\x20be\x20undone.','tasks','executePushProject','Error:\x20Attempt\x20ID\x20is\x20required','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','✔\x20Workflow\x20run\x20started','✔\x20Pushed\x20','output','projectName','green','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','columns','Project\x20directory:\x20','1128zflMTw','lastAttempt','Validation:\x20skipped','Failed\x20to\x20fetch\x20attempt\x20data','changes','trimEnd','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','✔\x20Project:\x20','sessionId','MIN_TIMELINE_WIDTH','ICON_WIDTH','Error:','\x20(use\x20--limit\x20to\x20show\x20more)','data','Pushing\x20project...','ICON_SPACING','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Session\x20time:\x20','delete','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','verbose','getMinutes','🔄\x20','workflow:attempts','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','sessionTime','Select\x20a\x20workflow\x20to\x20run','✔\x20Workflow\x20project\x20context\x20cleared.','retrySession','force','Deleting\x20secret...','Revision:\x20','...','✔\x20Clone\x20complete','generateSessionTimelineRows','Session\x20not\x20found:\x20','\x22\x20with\x20new\x20revision?','MAX_TASKS_DISPLAY','diff','✔\x20Workflow\x20project\x20set\x20to:\x20','fs/promises','\x20\x20Files\x20extracted:\x20','→\x20New\x20project:\x20','format','Resume\x20from:\x20','\x20project','Listing\x20secrets...','replace','modified','2925066cKkRub','group_error','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Error:\x20Secret\x20key\x20is\x20required','List\x20workflow\x20attempts','Setting\x20secret...','workflow:run','min','\x22\x20to\x20new\x20project\x20\x22','planned','Writing\x20files...','getMonth','resolveProjectId','renderSessionsTimeline','Dry\x20run:\x20yes','success','all','resolve','pending','sessions','\x20\x20Console:\x20','Filter:\x20project=','\x20new','Kill\x20a\x20running\x20attempt','localeCompare','\x22\x20already\x20exists\x20(ID:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x0a✔\x20Attempt\x20complete','red','renderSingleTimeline','yellow','TASK_NAME_WIDTH','unknown','\x20\x20Project:\x20','fullName','getFullYear','workflow:retry','session_id','select','set','json','startTime','\x20modified','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','workflow:attempt','Usage:\x20workflow:delete\x20<project-name-or-id>','2563038leMhfD','write','\x20of\x20','list','getDate','\x20\x20Source:\x20','List\x20workflow\x20execution\x20sessions','resolveProjectDir','Status:\x20','indexOf','deleted','download','getHours','blue','workflows','\x20-\x20','sourceProjectName'];a47_0xe2c9=function(){return _0x174ea4;};return a47_0xe2c9();}(function(_0x258edd,_0xa38951){const _0x39f696=a47_0x2f5c,_0x209694=_0x258edd();while(!![]){try{const _0x3fedff=-parseInt(_0x39f696(0x235))/0x1+parseInt(_0x39f696(0xb7))/0x2*(parseInt(_0x39f696(0xc4))/0x3)+parseInt(_0x39f696(0x183))/0x4*(-parseInt(_0x39f696(0x21b))/0x5)+-parseInt(_0x39f696(0x134))/0x6+-parseInt(_0x39f696(0x213))/0x7*(parseInt(_0x39f696(0x1d0))/0x8)+parseInt(_0x39f696(0x162))/0x9*(-parseInt(_0x39f696(0x19f))/0xa)+-parseInt(_0x39f696(0x1f2))/0xb*(-parseInt(_0x39f696(0x103))/0xc);if(_0x3fedff===_0xa38951)break;else _0x209694['push'](_0x209694['shift']());}catch(_0x3dac82){_0x209694['push'](_0x209694['shift']());}}}(a47_0xe2c9,0x538be));import a47_0x270f7b from'chalk';import{existsSync}from'fs';import a47_0x2e35c1 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 a47_0x5f4a46 from'prompts';function getAttemptStatusDisplay(_0x178cc9){const _0xff0055=a47_0x2f5c;if(!_0x178cc9)return{'icon':'⏳','text':''};const {done:_0x577471,success:_0x366238,cancelRequested:_0x15eec5}=_0x178cc9;if(!_0x577471)return _0x15eec5?{'icon':'🛑','text':a47_0x270f7b[_0xff0055(0x152)](_0xff0055(0xae))}:{'icon':'🔄','text':a47_0x270f7b[_0xff0055(0x16f)](_0xff0055(0x17c))};if(_0x366238)return{'icon':'✅','text':a47_0x270f7b['green']('success')};return{'icon':'❌','text':a47_0x270f7b[_0xff0055(0x150)]('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x1d0c9f,_0x3fc5a4,_0xa3beec=0x0){const _0x58c864=a47_0x2f5c;return _0x1d0c9f[_0xa3beec]||_0x3fc5a4[_0x58c864(0x24c)];}[a47_0x3bd9fa(0x1a4)](_0x54d0ae,_0x30c363,_0x3873b5=0x0){const _0x19bb1a=a47_0x3bd9fa,_0xea1909=this[_0x19bb1a(0x18b)](_0x54d0ae,_0x30c363,_0x3873b5);if(!_0xea1909)return console[_0x19bb1a(0x1cd)](a47_0x270f7b[_0x19bb1a(0x150)]('Error:'),_0x19bb1a(0x186)),console[_0x19bb1a(0x1cd)](a47_0x270f7b[_0x19bb1a(0x239)](_0x19bb1a(0x113))),null;return _0xea1909;}[a47_0x3bd9fa(0xde)](_0x23105a,_0x29d793){const _0x4dc626=a47_0x3bd9fa;if(_0x23105a[0x0]){const _0x4ea3c6=_0x23105a[0x0]['split']('.');if(_0x4ea3c6[_0x4dc626(0x204)]===0x1)return{'projectName':_0x4ea3c6[0x0],'workflowName':undefined};else return _0x4ea3c6['length']===0x2?{'projectName':_0x4ea3c6[0x0],'workflowName':_0x4ea3c6[0x1]}:(console[_0x4dc626(0x1cd)](a47_0x270f7b[_0x4dc626(0x150)](_0x4dc626(0x10e)),_0x4dc626(0xd3)),null);}return{'projectName':_0x29d793['workflowProject'],'workflowName':undefined};}[a47_0x3bd9fa(0x169)](_0xa4051f,_0x51fd5a,_0x5cd862=0x0){const _0x52cad7=a47_0x3bd9fa;if(_0xa4051f[_0x5cd862])return _0xa4051f[_0x5cd862];if(_0x51fd5a[_0x52cad7(0x24c)]){const _0x5f4420=a47_0x2e35c1[_0x52cad7(0x1f5)](process['cwd'](),_0x52cad7(0x170),_0x51fd5a[_0x52cad7(0x24c)]);if(existsSync(a47_0x2e35c1[_0x52cad7(0x1f5)](_0x5f4420,'tdx.json')))return _0x5f4420;}return undefined;}async[a47_0x3bd9fa(0xa2)](_0xa3d026,_0x598172,_0x2a8764){const _0x4d3071=a47_0x3bd9fa;try{const _0x3215a9=await _0xa3d026[_0x4d3071(0x188)][_0x4d3071(0x170)](_0x598172,{'limit':0x1});if(_0x3215a9['length']>0x0){const _0x1f5c41=_0x3215a9[0x0]['id'],_0x39da20=getWorkflowUrl(_0x2a8764,_0x1f5c41);console['error'](_0x4d3071(0x148)+a47_0x270f7b[_0x4d3071(0x210)](_0x39da20));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x197);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0xe3ecff){const _0x98f471=a47_0x3bd9fa,{options:_0x51c476,args:_0x329c02,tdx:_0xb0e0a4}=_0xe3ecff,_0x14d77d=_0x329c02[0x0],_0x5cc589=_0x51c476['clear'];if(_0x5cc589)return saveSessionContext({'workflow_project':undefined},_0x51c476[_0x98f471(0xcf)]),console[_0x98f471(0x1d3)](a47_0x270f7b[_0x98f471(0xff)](_0x98f471(0x11e))),0x0;if(!_0x14d77d)return console[_0x98f471(0x1cd)](a47_0x270f7b[_0x98f471(0x150)](_0x98f471(0x10e)),_0x98f471(0x186)),console['error'](a47_0x270f7b[_0x98f471(0x239)](_0x98f471(0xc1))),console[_0x98f471(0x1cd)](a47_0x270f7b[_0x98f471(0x239)](_0x98f471(0x179))),0x1;const _0x443674=await withSpinner(_0x98f471(0x1a9)+_0x14d77d+_0x98f471(0x198),()=>_0xb0e0a4['workflow'][_0x98f471(0x140)](_0x14d77d),{'verbose':_0x51c476[_0x98f471(0x117)]}),{name:_0x267dff}=_0x443674[_0x98f471(0x110)];return saveSessionContext({'workflow_project':_0x267dff},_0x51c476[_0x98f471(0xcf)]),console['log'](a47_0x270f7b['green'](_0x98f471(0x12a)+a47_0x270f7b[_0x98f471(0x210)](_0x267dff))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]='workflow:projects';[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0xe1);async[a47_0x3bd9fa(0xf3)](_0x4e3af5){const _0x463b5a=a47_0x3bd9fa,{options:_0x5d3a98,args:_0x337dd3,tdx:_0xd928b}=_0x4e3af5,_0x317071=_0x337dd3[0x0];_0x5d3a98[_0x463b5a(0x117)]&&_0x317071&&console[_0x463b5a(0x1cd)](_0x463b5a(0x22c)+_0x317071);const _0x4751b2=await withSpinner('Listing\x20workflow\x20projects...',()=>_0xd928b[_0x463b5a(0x188)][_0x463b5a(0xe5)](_0x317071,{'limit':_0x5d3a98['limit']}),{'verbose':_0x5d3a98[_0x463b5a(0x117)]});let _0x42573e=_0x4751b2[_0x463b5a(0x110)];_0x42573e['sort']((_0x39ff12,_0x5d2581)=>_0x39ff12[_0x463b5a(0x244)][_0x463b5a(0x14c)](_0x5d2581[_0x463b5a(0x244)]));const _0x15fc69=_0x5d3a98[_0x463b5a(0x221)]||0x64,_0x333458=_0x42573e[_0x463b5a(0x204)]>=_0x15fc69?a47_0x270f7b['dim'](_0x463b5a(0x10f)):'';console[_0x463b5a(0x1cd)]('✔\x20Found\x20'+_0x42573e[_0x463b5a(0x204)]+_0x463b5a(0x130)+(_0x42573e[_0x463b5a(0x204)]!==0x1?'s':'')+_0x333458);if(_0x5d3a98[_0x463b5a(0x12e)]===_0x463b5a(0x15c)||_0x5d3a98[_0x463b5a(0x12e)]===_0x463b5a(0xb6)||_0x5d3a98['format']===_0x463b5a(0x1b0))await handleSDKOutput(_0x42573e,_0x5d3a98);else{if(_0x42573e[_0x463b5a(0x204)]===0x0)_0x317071?console['log'](_0x463b5a(0xaf)+_0x317071):console[_0x463b5a(0x1d3)](_0x463b5a(0x24f));else{const _0x327e1f=_0x42573e[_0x463b5a(0x205)](_0x5f0af4=>{const _0x47a250=_0x463b5a,_0x28af44=_0x5f0af4[_0x47a250(0x181)]?.['some'](_0x1e26a3=>_0x1e26a3[_0x47a250(0xb9)]===_0x47a250(0x1a6)),_0x3586a8=_0x28af44?a47_0x270f7b[_0x47a250(0x239)](_0x47a250(0x19b)):'';return _0x47a250(0x1a0)+_0x5f0af4[_0x47a250(0x244)]+_0x3586a8;});await writeOutput(_0x327e1f[_0x463b5a(0x1f5)]('\x0a'),_0x5d3a98[_0x463b5a(0xfd)],_0x463b5a(0x165));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';['description']=a47_0x3bd9fa(0x246);async['execute'](_0x2aa0fe){const _0x25537a=a47_0x3bd9fa,{options:_0x5b43d1,args:_0x183d9c,tdx:_0x1ea8c0}=_0x2aa0fe,_0x251837=this[_0x25537a(0x18b)](_0x183d9c,_0x5b43d1);_0x5b43d1[_0x25537a(0x117)]&&_0x251837&&console[_0x25537a(0x1cd)](_0x25537a(0xda)+_0x251837);const _0x3202cd=await withSpinner('Listing\x20workflows...',()=>_0x1ea8c0[_0x25537a(0x188)][_0x25537a(0x170)](_0x251837,{'limit':_0x5b43d1['limit']}),{'verbose':_0x5b43d1['verbose']});let _0x4e2386=_0x3202cd[_0x25537a(0x110)];_0x4e2386[_0x25537a(0xbd)]((_0x2b0eec,_0x25d09d)=>{const _0x8bfb9a=_0x25537a,_0xb77104=_0x2b0eec['name'][_0x8bfb9a(0x14c)](_0x25d09d[_0x8bfb9a(0x244)]);if(_0xb77104!==0x0)return _0xb77104;return(_0x2b0eec['project']?.[_0x8bfb9a(0x244)]||'')[_0x8bfb9a(0x14c)](_0x25d09d['project']?.[_0x8bfb9a(0x244)]||'');});const _0x169602=_0x5b43d1['limit']||0x64,_0x222d22=_0x4e2386[_0x25537a(0x204)]>=_0x169602?a47_0x270f7b['dim'](_0x25537a(0x10f)):'';console[_0x25537a(0x1cd)](_0x25537a(0x1b7)+_0x4e2386[_0x25537a(0x204)]+'\x20workflow'+(_0x4e2386[_0x25537a(0x204)]!==0x1?'s':'')+_0x222d22);if(_0x5b43d1[_0x25537a(0x12e)]===_0x25537a(0x15c)||_0x5b43d1[_0x25537a(0x12e)]===_0x25537a(0xb6)||_0x5b43d1['format']===_0x25537a(0x1b0))await handleSDKOutput(_0x4e2386,_0x5b43d1);else{if(_0x4e2386[_0x25537a(0x204)]===0x0)_0x251837?console[_0x25537a(0x1d3)](_0x25537a(0x1c1)+_0x251837):console[_0x25537a(0x1d3)](_0x25537a(0x20f));else{const _0x4590c8=_0x5b43d1[_0x25537a(0xb2)],_0x3a8cfe=_0x4e2386[_0x25537a(0x205)](_0x51b0c9=>{const _0xe3e52d=_0x25537a,_0x88569=a47_0x270f7b[_0xe3e52d(0x239)]('#'+_0x51b0c9['id']),_0x135fd8=hyperlink(_0x88569,getWorkflowUrl(_0x4590c8,_0x51b0c9['id'])),_0x3c7657=_0x51b0c9[_0xe3e52d(0x228)]?.['name']?a47_0x270f7b['dim']('\x20('+_0x51b0c9[_0xe3e52d(0x228)]['name']+')'):'';return _0xe3e52d(0x1c8)+_0x135fd8+'\x20'+_0x51b0c9[_0xe3e52d(0x244)]+_0x3c7657;});await writeOutput(_0x3a8cfe[_0x25537a(0x1f5)]('\x0a'),_0x5b43d1[_0x25537a(0xfd)],_0x25537a(0x165));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x238);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x168);async[a47_0x3bd9fa(0xf3)](_0x9580f8){const _0x49e4de=a47_0x3bd9fa,{options:_0xe10ac6,args:_0x545572,tdx:_0x19be9b}=_0x9580f8,_0x54a0fa=this[_0x49e4de(0xde)](_0x545572,_0xe10ac6);if(!_0x54a0fa)return 0x1;const {projectName:_0x39dbd2,workflowName:_0x32ad28}=_0x54a0fa;if(_0xe10ac6[_0x49e4de(0x117)]){if(_0x39dbd2&&_0x32ad28)console[_0x49e4de(0x1cd)](_0x49e4de(0x208)+_0x39dbd2+'.'+_0x32ad28);else _0x39dbd2&&console[_0x49e4de(0x1cd)](_0x49e4de(0x149)+_0x39dbd2);const _0x320904=_0xe10ac6[_0x49e4de(0x19c)];_0x320904&&console['error'](_0x49e4de(0x16a)+_0x320904);}let _0x450e39=0x28;if(process[_0x49e4de(0x22e)]['isTTY']&&!_0xe10ac6[_0x49e4de(0xfd)]&&!_0xe10ac6[_0x49e4de(0x12e)]){const _0x431418=process['stdout'][_0x49e4de(0x1eb)]||0x28;_0x450e39=Math['max'](0x14,Math[_0x49e4de(0x23f)](_0x431418*0x2/0x3));}const _0x232c0d=_0xe10ac6[_0x49e4de(0x221)]||_0x450e39,_0x425f7c=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x19be9b[_0x49e4de(0x188)][_0x49e4de(0x147)]({'projectName':_0x39dbd2,'workflowName':_0x32ad28,'status':_0xe10ac6[_0x49e4de(0x19c)],'fromTime':_0xe10ac6[_0x49e4de(0x252)],'toTime':_0xe10ac6['to'],'limit':_0x232c0d}),{'verbose':_0xe10ac6[_0x49e4de(0x117)]}),_0x4c377d=_0x425f7c[_0x49e4de(0x110)];_0x4c377d[_0x49e4de(0xbd)]((_0x94684b,_0x45a2f7)=>{const _0x3d959a=_0x49e4de,_0x17c654=_0x94684b[_0x3d959a(0x11c)]||'',_0x514f4f=_0x45a2f7[_0x3d959a(0x11c)]||'';return _0x514f4f['localeCompare'](_0x17c654);});_0x4c377d[_0x49e4de(0x204)]>=_0x232c0d?console[_0x49e4de(0x1cd)]('✔\x20Showing\x20'+_0x4c377d[_0x49e4de(0x204)]+_0x49e4de(0x1ea)+a47_0x270f7b[_0x49e4de(0x239)](_0x49e4de(0x1ac))):console['error'](_0x49e4de(0x1b7)+_0x4c377d[_0x49e4de(0x204)]+_0x49e4de(0x19d)+(_0x4c377d['length']!==0x1?'s':''));if(_0xe10ac6[_0x49e4de(0x12e)]===_0x49e4de(0x15c)||_0xe10ac6[_0x49e4de(0x12e)]===_0x49e4de(0xb6)||_0xe10ac6[_0x49e4de(0x12e)]===_0x49e4de(0x1b0))await handleSDKOutput(_0x4c377d,_0xe10ac6);else{if(!process[_0x49e4de(0x22e)][_0x49e4de(0xe6)]||_0xe10ac6[_0x49e4de(0xfd)]){if(_0x4c377d[_0x49e4de(0x204)]===0x0){if(_0x39dbd2&&_0x32ad28)console[_0x49e4de(0x1d3)](_0x49e4de(0xa3)+_0x39dbd2+'.'+_0x32ad28);else _0x39dbd2?console[_0x49e4de(0x1d3)](_0x49e4de(0xb4)+_0x39dbd2):console[_0x49e4de(0x1d3)]('No\x20sessions\x20found');}else{const _0x22c604=_0xe10ac6[_0x49e4de(0xb2)],_0x12f3a4=this[_0x49e4de(0x141)](_0x4c377d,_0x22c604);_0xe10ac6[_0x49e4de(0xfd)]?await writeOutput(_0x12f3a4,_0xe10ac6[_0x49e4de(0xfd)],'list'):console[_0x49e4de(0x1d3)](_0x12f3a4);}!_0x39dbd2&&(console[_0x49e4de(0x1cd)](''),console[_0x49e4de(0x1cd)](a47_0x270f7b[_0x49e4de(0x239)](_0x49e4de(0x11b))),console[_0x49e4de(0x1cd)](a47_0x270f7b['dim'](_0x49e4de(0xbb))+'or'+a47_0x270f7b[_0x49e4de(0x239)](_0x49e4de(0xd8))));}else{if(_0x4c377d[_0x49e4de(0x204)]===0x0){if(_0x39dbd2&&_0x32ad28)console[_0x49e4de(0x1d3)](_0x49e4de(0xa3)+_0x39dbd2+'.'+_0x32ad28);else _0x39dbd2?console[_0x49e4de(0x1d3)](_0x49e4de(0xb4)+_0x39dbd2):console[_0x49e4de(0x1d3)](_0x49e4de(0x184));}else await this[_0x49e4de(0x253)](_0x4c377d,_0x9580f8,_0x39dbd2);}}return 0x0;}[a47_0x3bd9fa(0x141)](_0x47957c,_0x33e649){const _0x1d8ac4=a47_0x3bd9fa,_0x523968=[],_0x539192=new Map();let _0x57579b=Infinity,_0x25bbc0=-Infinity;for(const _0x17de69 of _0x47957c){if(_0x17de69[_0x1d8ac4(0x104)]?.[_0x1d8ac4(0x200)]){const _0x504eba=new Date(_0x17de69[_0x1d8ac4(0x104)][_0x1d8ac4(0x200)])[_0x1d8ac4(0x1ba)](),_0x140702=_0x17de69[_0x1d8ac4(0x104)]['finishedAt']?new Date(_0x17de69[_0x1d8ac4(0x104)][_0x1d8ac4(0xef)])[_0x1d8ac4(0x1ba)]():Date['now'](),_0x1d5e1e=_0x17de69[_0x1d8ac4(0x228)]?.[_0x1d8ac4(0x244)]||_0x1d8ac4(0xc9);!_0x539192[_0x1d8ac4(0xd4)](_0x1d5e1e)&&_0x539192[_0x1d8ac4(0x15b)](_0x1d5e1e,[]),_0x539192[_0x1d8ac4(0x1b5)](_0x1d5e1e)['push']({'session':_0x17de69,'startTime':_0x504eba,'endTime':_0x140702,'duration':_0x140702-_0x504eba}),_0x57579b=Math[_0x1d8ac4(0x13b)](_0x57579b,_0x504eba),_0x25bbc0=Math[_0x1d8ac4(0xa5)](_0x25bbc0,_0x140702);}}if(_0x539192['size']===0x0)return _0x1d8ac4(0x1f9);const _0xd0d021=process[_0x1d8ac4(0x22e)][_0x1d8ac4(0x101)]||0x78,_0x54ea28=0x1e,_0x11569b=0x32,_0x4edfb7=0x4,_0x3aaab8=Math[_0x1d8ac4(0x13b)](_0x11569b,Math['max'](_0x54ea28,Math[_0x1d8ac4(0x23f)](_0xd0d021*0.3))),_0x5c1da5=_0xd0d021-_0x3aaab8-TIMELINE_CONFIG[_0x1d8ac4(0x194)]-0x3-_0x4edfb7,_0x561730=_0x25bbc0-_0x57579b,_0x49f5f0=_0x561730/_0x3aaab8,_0x419f08=renderTimeAxis({'startTime':_0x57579b,'endTime':_0x25bbc0,'durationMs':_0x561730,'msPerChar':_0x49f5f0},_0x3aaab8),_0x85d303=[];for(const _0x300374 of _0x539192['values']()){_0x85d303[_0x1d8ac4(0x227)](..._0x300374);}_0x85d303[_0x1d8ac4(0xbd)]((_0x138a4b,_0x3fd3e9)=>_0x3fd3e9[_0x1d8ac4(0x15d)]-_0x138a4b['startTime']);const _0xdc9742=new Date(_0x57579b),_0x670325=formatDate(_0xdc9742),_0xecc284=_0x4edfb7+TIMELINE_CONFIG[_0x1d8ac4(0x10d)]+TIMELINE_CONFIG[_0x1d8ac4(0x112)]+_0x5c1da5,_0x25bddf='\x20'[_0x1d8ac4(0xac)](_0xecc284-_0x670325['length']),_0x5f0434=_0x25bddf+a47_0x270f7b[_0x1d8ac4(0x239)](_0x670325)+'\x20'+_0x419f08;_0x523968[_0x1d8ac4(0x227)](_0x5f0434);const _0x4c122f=0x16;let _0x50c2d2=0x0;for(const _0x533326 of _0x85d303){const _0xc20ccb=_0x533326[_0x1d8ac4(0xcf)][_0x1d8ac4(0x228)]?.[_0x1d8ac4(0x244)]||'?',_0x45e150=Math[_0x1d8ac4(0x13b)](stringWidth(_0xc20ccb),_0x4c122f);_0x50c2d2=Math[_0x1d8ac4(0xa5)](_0x50c2d2,_0x45e150);}for(const _0x357d52 of _0x85d303){const {session:_0x582569,startTime:_0x57a5dd,endTime:_0x14e84f,duration:_0x42e76a}=_0x357d52,_0x100af1=_0x582569['project']?.['id'],_0x1bc661=_0x582569['id'],_0x165737=_0x582569[_0x1d8ac4(0x228)]?.[_0x1d8ac4(0x244)]||'?',_0x1e3c4f=_0x582569['workflow']?.['name']||'?';let _0xac5f79,_0x48a3b4;if(_0x582569[_0x1d8ac4(0x104)]){const _0x3637df=_0x582569['lastAttempt'];!_0x3637df[_0x1d8ac4(0x247)]?(_0xac5f79=_0x3637df[_0x1d8ac4(0x216)]?'🛑':'🔄',_0x48a3b4=_0x3637df[_0x1d8ac4(0x216)]?a47_0x270f7b['yellow']:a47_0x270f7b[_0x1d8ac4(0x16f)]):(_0xac5f79=_0x3637df[_0x1d8ac4(0x143)]?'✅':'❌',_0x48a3b4=_0x3637df[_0x1d8ac4(0x143)]?a47_0x270f7b[_0x1d8ac4(0xff)]:a47_0x270f7b['red']);}else _0xac5f79='⏳',_0x48a3b4=a47_0x270f7b[_0x1d8ac4(0x239)];const _0x9f7f14='#'+_0x1bc661,_0x1da6ee=_0x100af1?hyperlink(_0x9f7f14,getWorkflowSessionUrl(_0x33e649,_0x100af1,_0x1bc661)):_0x9f7f14;let _0x4c75fd=_0x165737;stringWidth(_0x165737)>_0x4c122f&&(_0x4c75fd=_0x165737[_0x1d8ac4(0x196)](0x0,_0x4c122f-0x1)+'…');const _0x52e7d2=a47_0x270f7b['dim'](_0x4c75fd),_0x522a9e=stringWidth(_0x4c75fd),_0x386ebc='\x20'[_0x1d8ac4(0xac)](_0x50c2d2-stringWidth(_0x4c75fd)+0x2),_0x4cd607='('+formatElapsed(_0x42e76a)+')',_0x246bce=stringWidth(_0x4cd607),_0x38f442=stringWidth(_0x9f7f14),_0x170ed1=_0x38f442+0x1+_0x522a9e+_0x386ebc[_0x1d8ac4(0x204)],_0x1b403c=_0x5c1da5-_0x170ed1-_0x246bce-0x1-0x8;let _0xfcb385=_0x1e3c4f;stringWidth(_0xfcb385)>_0x1b403c&&(_0xfcb385=_0xfcb385[_0x1d8ac4(0x196)](0x0,_0x1b403c-0x1)+'…');const _0x415a0c=_0x1da6ee+'\x20'+_0x52e7d2+_0x386ebc+_0xfcb385,_0x3cb0b0=stringWidth(_0x415a0c),_0x505266=_0x5c1da5-_0x3cb0b0-_0x246bce,_0x2fb8dd=_0x415a0c+'\x20'[_0x1d8ac4(0xac)](Math[_0x1d8ac4(0xa5)](0x1,_0x505266))+a47_0x270f7b[_0x1d8ac4(0x239)](_0x4cd607),_0x13c496=Math[_0x1d8ac4(0x23f)]((_0x57a5dd-_0x57579b)/_0x49f5f0),_0x1abe31=Math[_0x1d8ac4(0x23f)]((_0x14e84f-_0x57579b)/_0x49f5f0),_0x1bd4ff=Math[_0x1d8ac4(0xa5)](_0x13c496+0x1,_0x1abe31),_0x44c7f1=new Array(_0x3aaab8)['fill']('\x20');for(let _0x5edf97=_0x13c496;_0x5edf97<Math[_0x1d8ac4(0x13b)](_0x1bd4ff,_0x3aaab8);_0x5edf97++){_0x44c7f1[_0x5edf97]='─';}const _0x3762b8=_0x44c7f1[_0x1d8ac4(0x205)](_0x233324=>_0x233324==='\x20'?'\x20':_0x48a3b4(_0x233324))[_0x1d8ac4(0x1f5)]('');_0x523968[_0x1d8ac4(0x227)](_0xac5f79+'\x20'+_0x2fb8dd+'│'+_0x3762b8+'│');}return _0x523968[_0x1d8ac4(0x1f5)]('\x0a');}async[a47_0x3bd9fa(0x253)](_0x5bae4e,_0x37d2e2,_0x53ff27){const _0x124ece=a47_0x3bd9fa,{options:_0x80ec0,tdx:_0xc71d07}=_0x37d2e2,_0x45ed19=_0x80ec0[_0x124ece(0xb2)],{timelineRows:_0x30b6be,timeAxisHeader:_0x102c65}=this[_0x124ece(0x125)](_0x5bae4e,_0x45ed19),_0x1c45db=_0x30b6be[_0x124ece(0xca)](_0x436932=>_0x436932[_0x124ece(0x237)]);if(_0x1c45db[_0x124ece(0x204)]===0x0){const _0x43cfcd=this['renderSessionsTimeline'](_0x5bae4e,_0x45ed19);console['log'](_0x43cfcd);!_0x53ff27&&(console['error'](''),console['error'](a47_0x270f7b[_0x124ece(0x239)](_0x124ece(0x11b))),console[_0x124ece(0x1cd)](a47_0x270f7b[_0x124ece(0x239)](_0x124ece(0xbb))+'or'+a47_0x270f7b[_0x124ece(0x239)](_0x124ece(0xd8))));return;}_0x102c65&&console[_0x124ece(0x1d3)](_0x102c65);const _0x22e79b=_0x30b6be[_0x124ece(0xca)](_0x578bcd=>_0x578bcd['attemptId'])[_0x124ece(0x205)](_0x6c5594=>({'title':_0x6c5594[_0x124ece(0x17e)],'value':_0x6c5594[_0x124ece(0x237)]})),_0x547318=process[_0x124ece(0x22e)][_0x124ece(0x1eb)]||0x3c,_0x12fa6b=Math[_0x124ece(0xa5)](0x28,Math[_0x124ece(0x23f)](_0x547318*0x2/0x3)),_0x5e10ba=await a47_0x5f4a46({'type':'autocomplete','name':'attemptId','message':_0x124ece(0xee),'choices':_0x22e79b,'initial':-0x1,'limit':_0x12fa6b,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x2787a8,_0x4d1a84)=>{const _0x4dd42a=_0x124ece;if(!_0x2787a8)return Promise['resolve'](_0x4d1a84);const _0x26670d=_0x4d1a84['filter'](_0x40076d=>{const _0x26fe6e=a47_0x2f5c,_0x4ce4d5=_0x40076d;return _0x4ce4d5['title'][_0x26fe6e(0x1b9)]()['includes'](_0x2787a8['toLowerCase']());});return Promise[_0x4dd42a(0x145)](_0x26670d);}}),_0x26e7f1=()=>{const _0x4e33d7=_0x124ece;process['stdout'][_0x4e33d7(0x163)](_0x4e33d7(0x1f1)),process[_0x4e33d7(0x22e)]['write'](_0x4e33d7(0x1f1)),process[_0x4e33d7(0x22e)][_0x4e33d7(0x163)]('\x1b[1A\x1b[2K');},_0x4eb692=_0x5e10ba&&_0x5e10ba[_0x124ece(0x237)]&&_0x5e10ba['attemptId']!==null&&_0x5e10ba[_0x124ece(0x237)][_0x124ece(0x20b)]()!=='';if(!_0x4eb692){_0x26e7f1(),console[_0x124ece(0x1d3)](a47_0x270f7b[_0x124ece(0x239)](_0x124ece(0x1b1)));return;}_0x26e7f1();const _0x58d4fa=_0x5bae4e['find'](_0x3d37a5=>_0x3d37a5[_0x124ece(0x104)]?.['id']===_0x5e10ba['attemptId']);if(_0x58d4fa){const _0x5c6bf5=_0x58d4fa['project']?.[_0x124ece(0x244)]||'?',_0x2d9cd8=_0x58d4fa[_0x124ece(0x188)]?.[_0x124ece(0x244)]||'?';console['log']('Project:\x20'+a47_0x270f7b[_0x124ece(0x239)](_0x5c6bf5)+_0x124ece(0xb0)+a47_0x270f7b['dim'](_0x2d9cd8));}const _0xa3fa7d=new WorkflowTimelineCommand();await _0xa3fa7d[_0x124ece(0xf3)]({'args':[],'options':{..._0x80ec0,'attemptId':_0x5e10ba['attemptId']},'tdx':_0xc71d07});}['generateSessionTimelineRows'](_0xdc02bd,_0x3075c6){const _0x3886c3=a47_0x3bd9fa,_0x40af2d=new Map();for(const _0x2ef786 of _0xdc02bd){_0x2ef786['id']&&_0x2ef786[_0x3886c3(0x104)]?.['id']&&_0x40af2d[_0x3886c3(0x15b)](_0x2ef786['id'],_0x2ef786['lastAttempt']['id']);}const _0xfec132=[];let _0x523332='';const _0x5bed67=this[_0x3886c3(0x141)](_0xdc02bd,_0x3075c6),_0x35b0f0=_0x5bed67['split']('\x0a');for(const _0x46386c of _0x35b0f0){if(_0x46386c['startsWith'](_0x3886c3(0x1d8))||_0x46386c[_0x3886c3(0x24e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x523332=_0x46386c;else{if(_0x46386c[_0x3886c3(0x24e)](/^[✅❌🔄🛑⏳]/)){const _0x1f5df5=_0x46386c[_0x3886c3(0x24e)](/#(\d+)/),_0x41d4e3=_0x1f5df5?_0x1f5df5[0x1]:null,_0x1725ea=_0x41d4e3?_0x40af2d[_0x3886c3(0x1b5)](_0x41d4e3)||null:null,_0x5793af=_0xdc02bd[_0x3886c3(0x1aa)](_0x1483e4=>_0x1483e4['id']===_0x41d4e3),_0x1219ae=_0x5793af?.[_0x3886c3(0x228)]?.[_0x3886c3(0x244)]||'';_0xfec132[_0x3886c3(0x227)]({'displayLine':_0x46386c,'attemptId':_0x1725ea,'projectName':_0x1219ae});}}}return{'timelineRows':_0xfec132,'timeAxisHeader':_0x523332};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x11a);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x138);async['execute'](_0x52ecc1){const _0x4c881f=a47_0x3bd9fa,{options:_0x3a856b,args:_0x45508d,tdx:_0x29c55e}=_0x52ecc1,_0x40cf8d=this['parseProjectWorkflowPattern'](_0x45508d,_0x3a856b);if(!_0x40cf8d)return 0x1;const {projectName:_0x218820,workflowName:_0x2eae7e}=_0x40cf8d,_0x5d71ee=_0x3a856b['includeRetried'];if(_0x3a856b[_0x4c881f(0x117)]){if(_0x218820&&_0x2eae7e)console[_0x4c881f(0x1cd)](_0x4c881f(0x208)+_0x218820+'.'+_0x2eae7e);else _0x218820&&console[_0x4c881f(0x1cd)](_0x4c881f(0x149)+_0x218820);_0x5d71ee&&console[_0x4c881f(0x1cd)](_0x4c881f(0x21d));}const _0x32d96f=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x29c55e[_0x4c881f(0x188)]['attempts']({'projectName':_0x218820,'workflowName':_0x2eae7e,'includeRetried':_0x5d71ee,'limit':_0x3a856b[_0x4c881f(0x221)]}),{'verbose':_0x3a856b[_0x4c881f(0x117)]}),_0x8d661c=_0x32d96f['data'],_0x362211=_0x3a856b[_0x4c881f(0x221)]||0x64,_0x599e56=_0x8d661c[_0x4c881f(0x204)]>=_0x362211?a47_0x270f7b['dim'](_0x4c881f(0x10f)):'';console[_0x4c881f(0x1cd)](_0x4c881f(0x1b7)+_0x8d661c[_0x4c881f(0x204)]+_0x4c881f(0x1d7)+(_0x8d661c[_0x4c881f(0x204)]!==0x1?'s':'')+_0x599e56);if(_0x3a856b['format']===_0x4c881f(0x15c)||_0x3a856b[_0x4c881f(0x12e)]===_0x4c881f(0xb6)||_0x3a856b['format']===_0x4c881f(0x1b0))await handleSDKOutput(_0x8d661c,_0x3a856b);else{if(_0x8d661c['length']===0x0){if(_0x218820&&_0x2eae7e)console[_0x4c881f(0x1d3)]('No\x20attempts\x20found\x20for:\x20'+_0x218820+'.'+_0x2eae7e);else _0x218820?console[_0x4c881f(0x1d3)](_0x4c881f(0x250)+_0x218820):console[_0x4c881f(0x1d3)](_0x4c881f(0x1e1));}else{const _0xb857df=_0x3a856b[_0x4c881f(0xb2)],_0x289334=_0x8d661c[_0x4c881f(0x205)](_0x201ab2=>{const _0x288ab2=_0x4c881f,_0x362927=a47_0x270f7b['dim']('#'+_0x201ab2['id']),_0x97a811=_0x201ab2['project']?.['id'],_0x28547a=_0x201ab2[_0x288ab2(0x159)]||_0x201ab2[_0x288ab2(0x10b)],_0xcbfed2=_0x97a811&&_0x28547a?hyperlink(_0x362927,getWorkflowAttemptUrl(_0xb857df,_0x97a811,_0x28547a,_0x201ab2['id'])):_0x362927,{icon:_0x53747a,text:_0x31e421}=getAttemptStatusDisplay(_0x201ab2),_0x383916=(_0x201ab2[_0x288ab2(0x228)]?.['name']||'?')+'.'+(_0x201ab2[_0x288ab2(0x188)]?.['name']||'?'),_0x441520=_0x201ab2['sessionTime']?a47_0x270f7b[_0x288ab2(0x239)](_0x201ab2['sessionTime']):'';return(_0xcbfed2+'\x20'+_0x53747a+(_0x31e421?'\x20'+_0x31e421:'')+'\x20'+_0x383916+'\x20'+_0x441520)[_0x288ab2(0x108)]();});await writeOutput(_0x289334[_0x4c881f(0x1f5)]('\x0a'),_0x3a856b[_0x4c881f(0xfd)],_0x4c881f(0x165));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a47_0x3bd9fa(0x160);['description']=a47_0x3bd9fa(0x1f4);async[a47_0x3bd9fa(0xf3)](_0xd406ab){const _0x31b20e=a47_0x3bd9fa,{options:_0x1809f5,args:_0x530ad3,tdx:_0x2ba79b}=_0xd406ab,_0x32f1ec=_0x530ad3[0x0];if(!_0x32f1ec)return console[_0x31b20e(0x1cd)](_0x31b20e(0xf9)),0x1;_0x1809f5[_0x31b20e(0x117)]&&console[_0x31b20e(0x1cd)](_0x31b20e(0xd1)+_0x32f1ec);const _0x430687=await withSpinner(_0x31b20e(0x24d),()=>_0x2ba79b[_0x31b20e(0x188)]['attempt'](_0x32f1ec),{'verbose':_0x1809f5['verbose']}),_0x2a460b=_0x430687[_0x31b20e(0x110)];let _0x34341f;!_0x2a460b[_0x31b20e(0x247)]?_0x34341f=_0x2a460b[_0x31b20e(0x216)]?'canceling':'running':_0x34341f=_0x2a460b['success']?_0x31b20e(0x143):'error';let _0x23a4da;if(_0x2a460b[_0x31b20e(0x200)]&&_0x2a460b[_0x31b20e(0xef)]){const _0x1df24a=new Date(_0x2a460b[_0x31b20e(0x200)])[_0x31b20e(0x1ba)](),_0x5b2ce1=new Date(_0x2a460b[_0x31b20e(0xef)])[_0x31b20e(0x1ba)]();_0x23a4da=Math[_0x31b20e(0x1db)]((_0x5b2ce1-_0x1df24a)/0x3e8);}const _0x3ca2ae={'attempt_id':_0x2a460b['id'],'status':_0x34341f,..._0x2a460b[_0x31b20e(0x240)]!==undefined&&{'index':_0x2a460b[_0x31b20e(0x240)]},..._0x2a460b['project']&&{'project':_0x2a460b[_0x31b20e(0x228)][_0x31b20e(0x244)]},..._0x2a460b[_0x31b20e(0x188)]&&{'workflow':_0x2a460b[_0x31b20e(0x188)][_0x31b20e(0x244)]},..._0x2a460b[_0x31b20e(0x10b)]&&{'session_id':_0x2a460b[_0x31b20e(0x10b)]},..._0x2a460b['sessionTime']&&{'session_time':_0x2a460b[_0x31b20e(0x11c)]},..._0x2a460b[_0x31b20e(0xe0)]&&{'retry_attempt':_0x2a460b[_0x31b20e(0xe0)]},..._0x23a4da!==undefined&&{'duration_sec':_0x23a4da},..._0x2a460b[_0x31b20e(0x200)]&&{'created_at':_0x2a460b['createdAt']},..._0x2a460b[_0x31b20e(0xef)]&&{'finished_at':_0x2a460b[_0x31b20e(0xef)]},...Object[_0x31b20e(0xc0)](_0x2a460b[_0x31b20e(0x1dd)])[_0x31b20e(0x204)]>0x0&&{'params':_0x2a460b[_0x31b20e(0x1dd)]}};return await handleSingleObjectOutput(_0x3ca2ae,_0x1809f5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x1be);[a47_0x3bd9fa(0xd7)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x285807){const _0x13b1ba=a47_0x3bd9fa,{options:_0x1881d9,args:_0x18c4d3,tdx:_0x8169c9}=_0x285807,_0x332e86=_0x18c4d3[0x0];if(!_0x332e86)return console[_0x13b1ba(0x1cd)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x4ca0c3=_0x1881d9[_0x13b1ba(0x1f6)];_0x1881d9['verbose']&&(console['error'](_0x13b1ba(0xd1)+_0x332e86),_0x4ca0c3&&console['error'](_0x13b1ba(0xd0)));const _0x31b0d8=await withSpinner(_0x13b1ba(0x1d6),()=>_0x8169c9[_0x13b1ba(0x188)][_0x13b1ba(0xf7)](_0x332e86,_0x4ca0c3||![]),{'verbose':_0x1881d9[_0x13b1ba(0x117)]}),_0x54c615=_0x31b0d8['data'];return console[_0x13b1ba(0x1cd)](_0x13b1ba(0x1b7)+_0x54c615[_0x13b1ba(0x204)]+_0x13b1ba(0x1ec)+(_0x54c615[_0x13b1ba(0x204)]!==0x1?'s':'')),await handleSDKOutput(_0x54c615,_0x1881d9),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x1c2);['description']=a47_0x3bd9fa(0x1bb);async[a47_0x3bd9fa(0xf3)](_0x5c7f22){const _0x49f370=a47_0x3bd9fa,{options:_0xf9fea6,args:_0x2c8a31,tdx:_0x24c496}=_0x5c7f22,_0x2991dd=_0x2c8a31[0x0];let _0x2d414e=_0x2c8a31[0x1];if(!_0x2991dd)return console['error'](_0x49f370(0xf9)),0x1;_0xf9fea6[_0x49f370(0x117)]&&(console[_0x49f370(0x1cd)](_0x49f370(0xd1)+_0x2991dd),_0x2d414e&&console[_0x49f370(0x1cd)](_0x49f370(0x1c4)+_0x2d414e));const _0x566015=await withSpinner(_0x49f370(0x178),()=>_0x24c496[_0x49f370(0x188)][_0x49f370(0xbe)](_0x2991dd,_0x2d414e),{'verbose':_0xf9fea6[_0x49f370(0x117)]}),_0x4cb47e=_0x566015[_0x49f370(0x110)];if(_0x4cb47e[_0x49f370(0x204)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2d414e&&(_0xf9fea6[_0x49f370(0x15c)]||_0xf9fea6[_0x49f370(0x12e)]))return await handleSDKOutput(_0x4cb47e,_0xf9fea6),0x0;if(!_0x2d414e){const _0x4e43a7=_0x4cb47e[_0x49f370(0x205)](_0x1da108=>({'title':_0x1da108['taskName']+'\x20('+formatBytes(_0x1da108[_0x49f370(0xdf)])+')','value':_0x1da108[_0x49f370(0x223)]})),_0x1d1224=await a47_0x5f4a46({'type':_0x49f370(0x15a),'name':_0x49f370(0x1e5),'message':_0x49f370(0x224),'choices':_0x4e43a7});if(!_0x1d1224[_0x49f370(0x1e5)])return console['error'](_0x49f370(0x1b1)),0x0;_0x2d414e=_0x1d1224[_0x49f370(0x1e5)];}const _0x5e9e84=await withSpinner('Downloading\x20logs...',()=>_0x24c496[_0x49f370(0x188)][_0x49f370(0x23b)](_0x2991dd,_0x2d414e),{'verbose':_0xf9fea6[_0x49f370(0x117)]}),_0x568e1c=_0x5e9e84[_0x49f370(0x110)];return _0x568e1c?console[_0x49f370(0x1d3)](_0x568e1c):console[_0x49f370(0x1cd)](_0x49f370(0xd5)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x229);['description']=a47_0x3bd9fa(0x14b);async[a47_0x3bd9fa(0xf3)](_0x590434){const _0x18ba92=a47_0x3bd9fa,{options:_0x54a0bb,args:_0x53c690,tdx:_0x4547f3}=_0x590434,_0x4eef09=_0x53c690[0x0];if(!_0x4eef09)return console['error'](_0x18ba92(0xf9)),0x1;const _0x263895=_0x54a0bb['reason'];_0x54a0bb['verbose']&&(console[_0x18ba92(0x1cd)](_0x18ba92(0xd1)+_0x4eef09),_0x263895&&console[_0x18ba92(0x1cd)](_0x18ba92(0xce)+_0x263895));if(!_0x54a0bb[_0x18ba92(0x1f8)]){if(!isInteractive())return console[_0x18ba92(0x1cd)](a47_0x270f7b[_0x18ba92(0x150)](_0x18ba92(0xe2)),_0x18ba92(0x1e3)),console[_0x18ba92(0x1cd)](a47_0x270f7b[_0x18ba92(0x239)](_0x18ba92(0x1a5))),0x1;const _0xa29d6a=await confirmKey(_0x18ba92(0x109)+_0x4eef09+'?');if(!_0xa29d6a)return console['error'](a47_0x270f7b[_0x18ba92(0x152)](_0x18ba92(0x1b1))),0x1;}const _0x16d5f5=await withSpinner(_0x18ba92(0x180),()=>_0x4547f3[_0x18ba92(0x188)][_0x18ba92(0x21f)](_0x4eef09,_0x263895),{'verbose':_0x54a0bb[_0x18ba92(0x117)]}),_0x2355ad=_0x16d5f5[_0x18ba92(0x110)];return console[_0x18ba92(0x1cd)]('✔\x20'+_0x2355ad),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a47_0x3bd9fa(0x158);['description']=a47_0x3bd9fa(0xb1);async[a47_0x3bd9fa(0xf3)](_0x16b690){const _0x301a91=a47_0x3bd9fa,{options:_0x37c96a,args:_0x219436,tdx:_0x153cfb}=_0x16b690,_0x4818b4=_0x219436[0x0];if(!_0x4818b4)return console[_0x301a91(0x1cd)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x301a91(0x1cd)](_0x301a91(0xb5)),0x1;let _0x57b723=![],_0x2e30a5=_0x4818b4;if(_0x4818b4[_0x301a91(0x1f3)](_0x301a91(0x1f0)))_0x57b723=!![],_0x2e30a5=_0x4818b4['substring'](0x8);else{if(_0x4818b4[_0x301a91(0x1f3)]('attempt:'))_0x57b723=![],_0x2e30a5=_0x4818b4[_0x301a91(0x254)](0x8);else return console['error'](_0x301a91(0xad)),console[_0x301a91(0x1cd)](_0x301a91(0xb5)),0x1;}const _0x500ce4=_0x37c96a['fromTask'],_0x277582=_0x37c96a['resumeFrom'],_0x404add=_0x37c96a['params'],_0x1f15af=_0x37c96a[_0x301a91(0x120)];_0x37c96a[_0x301a91(0x117)]&&(console[_0x301a91(0x1cd)]('Target:\x20'+(_0x57b723?_0x301a91(0xcf):'attempt')+'\x20'+_0x2e30a5),_0x500ce4&&console[_0x301a91(0x1cd)](_0x301a91(0x220)+_0x500ce4),_0x277582&&console[_0x301a91(0x1cd)](_0x301a91(0x12f)+_0x277582),_0x404add&&console[_0x301a91(0x1cd)](_0x301a91(0x20e)+_0x404add),_0x1f15af&&console[_0x301a91(0x1cd)](_0x301a91(0x22d)));let _0x5b939e;if(_0x404add)try{if(_0x404add['startsWith']('@')){const _0xb0a50f=await import(_0x301a91(0x12b)),_0x1dd290=_0x404add['substring'](0x1),_0xeed6f9=await _0xb0a50f[_0x301a91(0x243)](_0x1dd290,_0x301a91(0xc6));_0x5b939e=JSON[_0x301a91(0x1a2)](_0xeed6f9);}else _0x5b939e=JSON[_0x301a91(0x1a2)](_0x404add);}catch{return console[_0x301a91(0x1cd)](_0x301a91(0x22f)),0x1;}if(!_0x37c96a[_0x301a91(0x1f8)]){if(!isInteractive())return console[_0x301a91(0x1cd)](a47_0x270f7b['red'](_0x301a91(0xe2)),_0x301a91(0x1e3)),console[_0x301a91(0x1cd)](a47_0x270f7b[_0x301a91(0x239)](_0x301a91(0x1a5))),0x1;const _0x602e12=await confirmKey(_0x301a91(0x15f)+(_0x57b723?_0x301a91(0xcf):'attempt')+'\x20'+_0x2e30a5+'?');if(!_0x602e12)return console[_0x301a91(0x1cd)](a47_0x270f7b[_0x301a91(0x152)]('Cancelled')),0x1;}let _0x1c3ea5;_0x57b723?_0x1c3ea5=await withSpinner(_0x301a91(0x1b3),()=>_0x153cfb['workflow'][_0x301a91(0x11f)](_0x2e30a5,{'fromTask':_0x500ce4,'retryParams':_0x5b939e}),{'verbose':_0x37c96a['verbose']}):_0x1c3ea5=await withSpinner(_0x301a91(0xba),()=>_0x153cfb[_0x301a91(0x188)]['retryAttempt'](_0x2e30a5,{'resumeFrom':_0x277582,'retryParams':_0x5b939e,'force':_0x1f15af}),{'verbose':_0x37c96a[_0x301a91(0x117)]});const _0x37b14e=_0x1c3ea5[_0x301a91(0x110)];return console[_0x301a91(0x1cd)](_0x301a91(0xd9)),console[_0x301a91(0x1cd)](_0x301a91(0xbf)+_0x37b14e[_0x301a91(0x237)]),console[_0x301a91(0x1cd)](_0x301a91(0x1e6)+_0x37b14e['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x13a);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0xdb);async[a47_0x3bd9fa(0xf3)](_0x20b04e){const _0x1d68cb=a47_0x3bd9fa,{options:_0x14e104,args:_0xf65091,tdx:_0x3e8570}=_0x20b04e;let _0x5c0c7f=_0xf65091[0x0];if(!_0x5c0c7f){const _0x4ea7c0=this['resolveProject']([],_0x14e104),_0x39b633=await withSpinner(_0x1d68cb(0x234),()=>_0x3e8570[_0x1d68cb(0x188)][_0x1d68cb(0x170)](_0x4ea7c0,{'limit':_0x14e104['limit']}),{'verbose':_0x14e104[_0x1d68cb(0x117)]}),_0x3c67c0=_0x39b633[_0x1d68cb(0x110)];if(_0x3c67c0[_0x1d68cb(0x204)]===0x0)return console[_0x1d68cb(0x1cd)](_0x1d68cb(0x20f)),!_0x4ea7c0&&console[_0x1d68cb(0x1cd)](a47_0x270f7b[_0x1d68cb(0x239)](_0x1d68cb(0x113))),0x1;const _0x5f53b1=_0x3c67c0[_0x1d68cb(0x205)](_0x4f7d84=>({'title':_0x4f7d84[_0x1d68cb(0x228)]?.[_0x1d68cb(0x244)]+'.'+_0x4f7d84['name'],'value':_0x4f7d84[_0x1d68cb(0x228)]?.[_0x1d68cb(0x244)]+'.'+_0x4f7d84[_0x1d68cb(0x244)],'description':_0x4f7d84[_0x1d68cb(0x175)]?_0x1d68cb(0x1c6)+_0x4f7d84['revision']:undefined})),_0x45a21f=await a47_0x5f4a46({'type':'select','name':'workflow','message':_0x1d68cb(0x11d),'choices':_0x5f53b1});if(!_0x45a21f[_0x1d68cb(0x188)])return 0x1;_0x5c0c7f=_0x45a21f[_0x1d68cb(0x188)];}if(!_0x5c0c7f[_0x1d68cb(0x1e4)]('.')){const _0x5b4559=this[_0x1d68cb(0x18b)]([],_0x14e104);if(_0x5b4559)_0x5c0c7f=_0x5b4559+'.'+_0x5c0c7f;else return console[_0x1d68cb(0x1cd)](a47_0x270f7b['red']('Error:'),_0x1d68cb(0xf5)),console[_0x1d68cb(0x1cd)](a47_0x270f7b['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x2db8db=_0x14e104[_0x1d68cb(0x21a)],_0x3118c4=_0x14e104[_0x1d68cb(0x11c)],_0x18d366={};if(_0x2db8db&&Array[_0x1d68cb(0x201)](_0x2db8db))for(const _0x803f27 of _0x2db8db){const _0x42db45=_0x803f27[_0x1d68cb(0x16b)]('=');if(_0x42db45===-0x1)return console[_0x1d68cb(0x1cd)](_0x1d68cb(0x206)+_0x803f27),console[_0x1d68cb(0x1cd)](_0x1d68cb(0x1df)),0x1;const _0x3f07a8=_0x803f27[_0x1d68cb(0x254)](0x0,_0x42db45),_0x13c61f=_0x803f27[_0x1d68cb(0x254)](_0x42db45+0x1);try{_0x18d366[_0x3f07a8]=JSON[_0x1d68cb(0x1a2)](_0x13c61f);}catch{_0x18d366[_0x3f07a8]=_0x13c61f;}}_0x14e104[_0x1d68cb(0x117)]&&(console[_0x1d68cb(0x1cd)]('Workflow:\x20'+_0x5c0c7f),Object[_0x1d68cb(0xc0)](_0x18d366)[_0x1d68cb(0x204)]>0x0&&console[_0x1d68cb(0x1cd)](_0x1d68cb(0xe3)+JSON['stringify'](_0x18d366)),_0x3118c4&&console[_0x1d68cb(0x1cd)](_0x1d68cb(0x114)+_0x3118c4));const _0x2dbc0c=await withSpinner(_0x1d68cb(0xc2),()=>_0x3e8570[_0x1d68cb(0x188)][_0x1d68cb(0x18d)](_0x5c0c7f,_0x18d366,{'sessionTime':_0x3118c4}),{'verbose':_0x14e104[_0x1d68cb(0x117)]}),_0x20955a=_0x2dbc0c[_0x1d68cb(0x110)];console[_0x1d68cb(0x1cd)](_0x1d68cb(0xfb)),console[_0x1d68cb(0x1cd)](_0x1d68cb(0x251)+_0x20955a['id']),console[_0x1d68cb(0x1cd)](_0x1d68cb(0x1e6)+_0x20955a[_0x1d68cb(0x10b)]),console['error'](_0x1d68cb(0x155)+_0x20955a['project']?.['name']),console[_0x1d68cb(0x1cd)]('\x20\x20Workflow:\x20'+_0x20955a[_0x1d68cb(0x188)]?.['name']);if(_0x20955a[_0x1d68cb(0x228)]?.['id']&&_0x20955a['sessionId']&&_0x20955a['id']){const _0x5e53b9=_0x14e104[_0x1d68cb(0xb2)],_0x45ef6a=getConsoleUrl(_0x5e53b9,'/app/workflows/'+_0x20955a['project']['id']+'/sessions/'+_0x20955a['sessionId']+_0x1d68cb(0x1de)+_0x20955a['id']);console['error']('\x20\x20Console:\x20'+a47_0x270f7b['cyan'](_0x45ef6a));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]='workflow:download';[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x1cc);async[a47_0x3bd9fa(0xf3)](_0x2f0238){const _0x42bebe=a47_0x3bd9fa,{options:_0x5a0872,args:_0x2b7ac8,tdx:_0xf9644a}=_0x2f0238,_0x6e1713=_0x2b7ac8[0x0],_0x51debb=_0x2b7ac8[0x1]||'.';if(!_0x6e1713)return console[_0x42bebe(0x1cd)](_0x42bebe(0x1ef)),console[_0x42bebe(0x1cd)](_0x42bebe(0x18a)),0x1;const _0x20bc99=_0x5a0872[_0x42bebe(0x175)];_0x5a0872['verbose']&&(console[_0x42bebe(0x1cd)]('Project:\x20'+_0x6e1713),console[_0x42bebe(0x1cd)]('Output\x20directory:\x20'+_0x51debb),_0x20bc99&&console[_0x42bebe(0x1cd)](_0x42bebe(0x122)+_0x20bc99));const _0x5dbd86=await withSpinner(_0x42bebe(0x215)+_0x6e1713+_0x42bebe(0x123),()=>_0xf9644a[_0x42bebe(0x188)][_0x42bebe(0x16d)](_0x6e1713,_0x51debb,{'revision':_0x20bc99}),{'verbose':_0x5a0872[_0x42bebe(0x117)]}),_0xfe3a46=_0x5dbd86['data'];return console[_0x42bebe(0x1cd)]('✔\x20Downloaded\x20'+_0xfe3a46[_0x42bebe(0xfe)]),console['error']('\x20\x20Revision:\x20'+_0xfe3a46['revision']),console[_0x42bebe(0x1cd)](_0x42bebe(0x12c)+_0xfe3a46['filesExtracted']),console['error'](_0x42bebe(0x1b2)+_0x51debb+'/'+_0xfe3a46[_0x42bebe(0xfe)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a47_0x3bd9fa(0x23e);['description']=a47_0x3bd9fa(0x116);async[a47_0x3bd9fa(0xf3)](_0x34d24d){const _0x234eb5=a47_0x3bd9fa,{options:_0x70046c,args:_0x33af91,tdx:_0x515817}=_0x34d24d;let _0xd1b16f='.',_0x618990=_0x70046c[_0x234eb5(0x244)];if(_0x33af91[0x0]){const {promises:_0x51e439}=await import('fs');try{const _0x344b05=await _0x51e439['stat'](_0x33af91[0x0]);if(_0x344b05[_0x234eb5(0xec)]())_0xd1b16f=_0x33af91[0x0];else return console[_0x234eb5(0x1cd)](_0x234eb5(0xe8)+_0x33af91[0x0]+_0x234eb5(0x17d)),0x1;}catch{_0x618990=_0x33af91[0x0],_0xd1b16f='.';}}const _0x47012e=_0x70046c[_0x234eb5(0x175)],_0x933619=_0x70046c[_0x234eb5(0xdd)];_0x70046c[_0x234eb5(0x117)]&&(console[_0x234eb5(0x1cd)](_0x234eb5(0x102)+_0xd1b16f),_0x618990&&console[_0x234eb5(0x1cd)](_0x234eb5(0x1e0)+_0x618990),_0x47012e&&console[_0x234eb5(0x1cd)]('Revision:\x20'+_0x47012e),_0x933619&&console['error'](_0x234eb5(0x105)));const _0x1ad301=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x515817[_0x234eb5(0x188)][_0x234eb5(0x227)](_0xd1b16f,{'projectName':_0x618990,'revision':_0x47012e,'skipValidation':_0x933619}),{'verbose':_0x70046c[_0x234eb5(0x117)]}),_0x570aa0=_0x1ad301[_0x234eb5(0x110)];return console['error'](_0x234eb5(0xfc)+_0x570aa0[_0x234eb5(0xfe)]),console[_0x234eb5(0x1cd)](_0x234eb5(0x225)+_0x570aa0['projectId']),console[_0x234eb5(0x1cd)]('\x20\x20Revision:\x20'+_0x570aa0[_0x234eb5(0x175)]),await this[_0x234eb5(0xa2)](_0x515817,_0x570aa0[_0x234eb5(0xfe)],_0x70046c[_0x234eb5(0xb2)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x1fe);['description']=a47_0x3bd9fa(0x1dc);async[a47_0x3bd9fa(0xf3)](_0xbe9ce7){const _0x20e205=a47_0x3bd9fa,{options:_0x145fe0,args:_0x4be755,tdx:_0x31a60e}=_0xbe9ce7,_0x434e3c=_0x4be755[0x0],_0x5f520e=_0x4be755[0x1];if(!_0x434e3c)return console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x150)](_0x20e205(0x10e)),_0x20e205(0x186)),console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x239)](_0x20e205(0x1da))),0x1;const _0x31398a=_0x145fe0[_0x20e205(0x175)];_0x145fe0[_0x20e205(0x117)]&&(console[_0x20e205(0x1cd)](_0x20e205(0x1af)+_0x434e3c),_0x5f520e&&console[_0x20e205(0x1cd)](_0x20e205(0x218)+_0x5f520e),_0x31398a&&console[_0x20e205(0x1cd)]('Revision:\x20'+_0x31398a),_0x145fe0[_0x20e205(0xea)]&&console[_0x20e205(0x1cd)](_0x20e205(0x142)));const _0x43594b=await withSpinner(_0x20e205(0xeb)+_0x434e3c+_0x20e205(0x123),()=>_0x31a60e[_0x20e205(0x188)]['pullProject'](_0x434e3c,{'targetDir':_0x5f520e,'revision':_0x31398a}),{'verbose':_0x145fe0['verbose']}),_0x44234b=_0x43594b['data'];_0x44234b[_0x20e205(0x195)]?console[_0x20e205(0x1cd)](_0x20e205(0x12d)+_0x44234b[_0x20e205(0xfe)]):console[_0x20e205(0x1cd)](_0x20e205(0x1cb)+_0x44234b[_0x20e205(0xfe)]);console[_0x20e205(0x1cd)]('\x20\x20Revision:\x20'+_0x44234b[_0x20e205(0x175)]),console['error'](_0x20e205(0xe4)+(a47_0x2e35c1['relative'](process[_0x20e205(0x245)](),_0x44234b[_0x20e205(0x222)])||'.')),console['error'](_0x20e205(0x182)+a47_0x270f7b[_0x20e205(0xff)]('+'+_0x44234b[_0x20e205(0x230)][_0x20e205(0x17f)]+_0x20e205(0x14a))+',\x20'+(a47_0x270f7b[_0x20e205(0x152)]('~'+_0x44234b[_0x20e205(0x230)][_0x20e205(0x133)]+_0x20e205(0x15e))+',\x20')+(a47_0x270f7b[_0x20e205(0x150)]('-'+_0x44234b[_0x20e205(0x230)][_0x20e205(0x16c)]+_0x20e205(0x1ff))+',\x20')+(''+a47_0x270f7b[_0x20e205(0x239)](_0x44234b[_0x20e205(0x230)][_0x20e205(0x1d2)]+_0x20e205(0x23a))));for(const _0x47910c of _0x44234b['changes']){_0x47910c[_0x20e205(0x1c7)]===_0x20e205(0x133)&&_0x47910c[_0x20e205(0x129)]&&(console[_0x20e205(0x1cd)]('\x0a'+a47_0x270f7b[_0x20e205(0x210)](_0x20e205(0xe9)+_0x47910c[_0x20e205(0x187)])),console[_0x20e205(0x1cd)](_0x47910c[_0x20e205(0x129)]));}if(!_0x44234b['hasChanges'])return saveSessionContext({'workflow_project':_0x44234b[_0x20e205(0xfe)]},_0x145fe0[_0x20e205(0xcf)]),console['error'](a47_0x270f7b[_0x20e205(0xff)](_0x20e205(0x1c3))),console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x239)](_0x20e205(0x1bf)+_0x44234b['projectName'])),0x0;if(_0x145fe0[_0x20e205(0xea)])return console['error'](a47_0x270f7b[_0x20e205(0x152)](_0x20e205(0x21c))),0x0;if(!_0x145fe0['yes']){if(!isInteractive())return console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x150)](_0x20e205(0xe2)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x239)](_0x20e205(0x1a5))),0x1;const _0x5b2ec5=await confirmKey(_0x20e205(0x17a));if(!_0x5b2ec5)return console['error'](a47_0x270f7b['yellow']('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x20e205(0x13e),()=>_0x31a60e[_0x20e205(0x188)]['applyPullProject'](_0x44234b,{'revision':_0x31398a}),{'verbose':_0x145fe0['verbose']}),saveSessionContext({'workflow_project':_0x44234b[_0x20e205(0xfe)]},_0x145fe0[_0x20e205(0xcf)]),console['error'](a47_0x270f7b[_0x20e205(0xff)]('✔\x20Pull\x20complete'));const _0x56b86b=a47_0x2e35c1[_0x20e205(0x1ca)](process[_0x20e205(0x245)](),_0x44234b[_0x20e205(0x222)])||'.';return console[_0x20e205(0x1cd)](a47_0x270f7b[_0x20e205(0x239)]('\x20\x20Location:\x20'+_0x56b86b)),console[_0x20e205(0x1cd)](a47_0x270f7b['dim'](_0x20e205(0x1bf)+_0x44234b[_0x20e205(0xfe)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a47_0x3bd9fa(0x20a);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x20d);async[a47_0x3bd9fa(0xf3)](_0x5cebe1){const _0x4b8623=a47_0x3bd9fa,{options:_0x5d0483,args:_0x3851a7,tdx:_0x5d6b03}=_0x5cebe1,_0x1c5eae=this[_0x4b8623(0x169)](_0x3851a7,_0x5d0483),_0x29a90e=_0x5d0483[_0x4b8623(0x175)],_0x3a5b86=_0x5d0483['skipValidation'];_0x5d0483[_0x4b8623(0x117)]&&(_0x1c5eae&&console[_0x4b8623(0x1cd)]('Source\x20directory:\x20'+_0x1c5eae),_0x29a90e&&console[_0x4b8623(0x1cd)](_0x4b8623(0x122)+_0x29a90e),_0x5d0483['dryRun']&&console['error'](_0x4b8623(0x142)),_0x3a5b86&&console[_0x4b8623(0x1cd)](_0x4b8623(0x105)));let _0x18cbdf;try{_0x18cbdf=await withSpinner(_0x4b8623(0xf2),()=>_0x5d6b03['workflow']['preparePushProject']({'sourceDir':_0x1c5eae,'revision':_0x29a90e,'skipValidation':_0x3a5b86}),{'verbose':_0x5d0483[_0x4b8623(0x117)]});}catch(_0x4bac8b){if(_0x4bac8b instanceof Error&&_0x4bac8b[_0x4b8623(0x23d)][_0x4b8623(0x1e4)](_0x4b8623(0x1e8)))return console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0x150)](_0x4b8623(0x10e)),_0x4b8623(0x1b8)),_0x5d0483[_0x4b8623(0x24c)]?console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0x239)]('Tip:\x20cd\x20to\x20workflows/'+_0x5d0483['workflowProject']+_0x4b8623(0x192)+_0x5d0483['workflowProject']+'\x27')):console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0x239)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x4bac8b;}const _0x638b97=_0x18cbdf[_0x4b8623(0x110)];console['error'](_0x4b8623(0x10a)+_0x638b97[_0x4b8623(0xfe)]),console[_0x4b8623(0x1cd)](_0x4b8623(0x167)+_0x638b97[_0x4b8623(0x1ed)]),console[_0x4b8623(0x1cd)](_0x4b8623(0xab)+_0x638b97[_0x4b8623(0x175)]),console[_0x4b8623(0x1cd)](_0x4b8623(0x182)+a47_0x270f7b[_0x4b8623(0xff)]('+'+_0x638b97[_0x4b8623(0x230)]['new']+_0x4b8623(0x14a))+',\x20'+(a47_0x270f7b['yellow']('~'+_0x638b97[_0x4b8623(0x230)]['modified']+_0x4b8623(0x15e))+',\x20')+(a47_0x270f7b[_0x4b8623(0x150)]('-'+_0x638b97[_0x4b8623(0x230)][_0x4b8623(0x16c)]+_0x4b8623(0x1ff))+',\x20')+(''+a47_0x270f7b[_0x4b8623(0x239)](_0x638b97[_0x4b8623(0x230)]['unchanged']+_0x4b8623(0x23a))));for(const _0x3e81fa of _0x638b97[_0x4b8623(0x107)]){_0x3e81fa[_0x4b8623(0x1c7)]===_0x4b8623(0x133)&&_0x3e81fa[_0x4b8623(0x129)]&&(console[_0x4b8623(0x1cd)]('\x0a'+a47_0x270f7b['cyan'](_0x4b8623(0xe9)+_0x3e81fa['path'])),console[_0x4b8623(0x1cd)](_0x3e81fa['diff']));}if(!_0x638b97['hasChanges'])return console['error'](a47_0x270f7b[_0x4b8623(0xff)](_0x4b8623(0x1a1))),await this[_0x4b8623(0xa2)](_0x5d6b03,_0x638b97[_0x4b8623(0xfe)],_0x5d0483[_0x4b8623(0xb2)]),0x0;if(_0x5d0483['dryRun'])return console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0x152)](_0x4b8623(0x1e7))),0x0;if(!_0x5d0483[_0x4b8623(0x1f8)]){if(!isInteractive())return console['error'](a47_0x270f7b[_0x4b8623(0x150)](_0x4b8623(0xe2)),_0x4b8623(0x1e3)),console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0x239)](_0x4b8623(0x1a5))),0x1;const _0x3ee400=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x3ee400)return console[_0x4b8623(0x1cd)](a47_0x270f7b['yellow'](_0x4b8623(0x1b1)),_0x4b8623(0xdc)),0x1;}const _0xb0f4b1=await withSpinner(_0x4b8623(0x111),()=>_0x5d6b03[_0x4b8623(0x188)][_0x4b8623(0xf8)](_0x638b97),{'verbose':_0x5d0483[_0x4b8623(0x117)]}),_0x1cf21e=_0xb0f4b1['data'];return console[_0x4b8623(0x1cd)](a47_0x270f7b[_0x4b8623(0xff)](_0x4b8623(0x1bd))),console[_0x4b8623(0x1cd)](_0x4b8623(0x225)+_0x1cf21e['projectId']),console[_0x4b8623(0x1cd)](_0x4b8623(0xab)+_0x1cf21e['revision']),await this['showWorkflowConsoleUrl'](_0x5d6b03,_0x1cf21e['projectName'],_0x5d0483[_0x4b8623(0xb2)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x249);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x173);async[a47_0x3bd9fa(0xf3)](_0x1e00f2){const _0x46f145=a47_0x3bd9fa,{options:_0x34ba93,args:_0x3e012f,tdx:_0x5edaf2}=_0x1e00f2,_0x1d1a7a=this[_0x46f145(0x169)](_0x3e012f,_0x34ba93),_0xc81d93=_0x34ba93['name'],_0x57b361=_0x34ba93[_0x46f145(0x175)],_0x2a75c5=_0x34ba93['skipValidation'];if(!_0x1d1a7a)return console[_0x46f145(0x1cd)](a47_0x270f7b['red'](_0x46f145(0x10e)),_0x46f145(0xa7)),console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x239)](_0x46f145(0x203))),console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x239)](_0x46f145(0x1ad))),0x1;if(!_0xc81d93)return console['error'](a47_0x270f7b['red'](_0x46f145(0x10e)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console['error'](a47_0x270f7b[_0x46f145(0x239)](_0x46f145(0x203))),0x1;_0x34ba93[_0x46f145(0x117)]&&(console['error'](_0x46f145(0x24b)+_0x1d1a7a),console[_0x46f145(0x1cd)](_0x46f145(0x1e2)+_0xc81d93),_0x57b361&&console[_0x46f145(0x1cd)](_0x46f145(0x122)+_0x57b361),_0x34ba93[_0x46f145(0xea)]&&console['error'](_0x46f145(0x142)),_0x2a75c5&&console[_0x46f145(0x1cd)](_0x46f145(0x105)));const _0x566113=await withSpinner(_0x46f145(0x24a),()=>_0x5edaf2[_0x46f145(0x188)]['prepareCloneProject'](_0x1d1a7a,_0xc81d93,{'revision':_0x57b361,'skipValidation':_0x2a75c5}),{'verbose':_0x34ba93['verbose']}),_0x20cdab=_0x566113[_0x46f145(0x110)];console[_0x46f145(0x1cd)](_0x46f145(0x236)+_0x20cdab['sourceDir']);_0x20cdab[_0x46f145(0x172)]&&console[_0x46f145(0x1cd)](_0x46f145(0x193)+_0x20cdab[_0x46f145(0x172)]);console[_0x46f145(0x1cd)](_0x46f145(0x1e2)+_0x20cdab[_0x46f145(0x1d1)]),console[_0x46f145(0x1cd)](_0x46f145(0x122)+_0x20cdab[_0x46f145(0x175)]),console[_0x46f145(0x1cd)](_0x46f145(0x1cf)+_0x20cdab['fileCount']);_0x20cdab['targetExists']&&(console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x152)]('\x0a⚠\x20Project\x20\x22'+_0x20cdab[_0x46f145(0x1d1)]+_0x46f145(0x14d)+_0x20cdab[_0x46f145(0x23c)]+')')),console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x152)](_0x46f145(0x136))));if(_0x34ba93[_0x46f145(0xea)])return console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x152)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x34ba93[_0x46f145(0x1f8)]){if(!isInteractive())return console['error'](a47_0x270f7b[_0x46f145(0x150)](_0x46f145(0xe2)),_0x46f145(0x1e3)),console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0x239)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x8c735=_0x20cdab[_0x46f145(0x172)]||a47_0x2e35c1['basename'](_0x1d1a7a),_0x16d3d1=_0x20cdab[_0x46f145(0x19a)]?_0x46f145(0xd2)+_0xc81d93+_0x46f145(0x127):'\x0aClone\x20\x22'+_0x8c735+_0x46f145(0x13c)+_0xc81d93+'\x22?',_0x4be327=await confirmKey(_0x16d3d1);if(!_0x4be327)return console['error'](a47_0x270f7b['yellow'](_0x46f145(0x1b1))),0x1;}const _0x50fdb7=await withSpinner(_0x20cdab[_0x46f145(0x19a)]?_0x46f145(0x233)+_0xc81d93+_0x46f145(0x123):_0x46f145(0x1d5)+_0xc81d93+_0x46f145(0x123),()=>_0x5edaf2['workflow']['executeCloneProject'](_0x20cdab),{'verbose':_0x34ba93[_0x46f145(0x117)]}),_0x5a897c=_0x50fdb7[_0x46f145(0x110)];return console[_0x46f145(0x1cd)](a47_0x270f7b[_0x46f145(0xff)](_0x20cdab['targetExists']?_0x46f145(0xed):_0x46f145(0x124))),console['error'](_0x46f145(0x155)+_0x5a897c[_0x46f145(0x1d1)]),console[_0x46f145(0x1cd)](_0x46f145(0x225)+_0x5a897c['newProjectId']),console['error'](_0x46f145(0xab)+_0x5a897c['revision']),await this['showWorkflowConsoleUrl'](_0x5edaf2,_0x5a897c[_0x46f145(0x1d1)],_0x34ba93[_0x46f145(0xb2)]),0x0;}}function a47_0x2f5c(_0x51e548,_0x331695){_0x51e548=_0x51e548-0xa2;const _0xe2c936=a47_0xe2c9();let _0x2f5c08=_0xe2c936[_0x51e548];return _0x2f5c08;}export class WorkflowDeleteCommand extends BaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x231);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x1c0);async[a47_0x3bd9fa(0xf3)](_0x6caaad){const _0x5dcdab=a47_0x3bd9fa,{options:_0x124a7d,args:_0x11e027,tdx:_0x206c69}=_0x6caaad,_0x3b55fe=_0x11e027[0x0];if(!_0x3b55fe)return console['error'](_0x5dcdab(0x248)),console[_0x5dcdab(0x1cd)](_0x5dcdab(0x161)),0x1;_0x124a7d[_0x5dcdab(0x117)]&&console[_0x5dcdab(0x1cd)]('Project:\x20'+_0x3b55fe);if(!_0x124a7d[_0x5dcdab(0x1f8)]){if(!isInteractive())return console[_0x5dcdab(0x1cd)](a47_0x270f7b[_0x5dcdab(0x150)](_0x5dcdab(0xe2)),_0x5dcdab(0x1e3)),console[_0x5dcdab(0x1cd)](a47_0x270f7b[_0x5dcdab(0x239)](_0x5dcdab(0x1a5))),0x1;const _0xf9a0e6=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x3b55fe+_0x5dcdab(0xf6));if(!_0xf9a0e6)return console[_0x5dcdab(0x1cd)](a47_0x270f7b[_0x5dcdab(0x152)]('Cancelled')),0x1;}const _0x5880c3=await withSpinner(_0x5dcdab(0x232)+_0x3b55fe+'...',()=>_0x206c69[_0x5dcdab(0x188)][_0x5dcdab(0x115)](_0x3b55fe),{'verbose':_0x124a7d[_0x5dcdab(0x117)]}),_0x3b1abe=_0x5880c3[_0x5dcdab(0x110)];return console[_0x5dcdab(0x1cd)](_0x5dcdab(0x19e)+_0x3b1abe[_0x5dcdab(0xfe)]),console[_0x5dcdab(0x1cd)]('\x20\x20Project\x20ID:\x20'+_0x3b1abe[_0x5dcdab(0xcc)]),0x0;}}export function parseKeyValue(_0x4299bc){const _0x1db796=a47_0x3bd9fa,_0xb2ca84=_0x4299bc[_0x1db796(0x16b)]('=');if(_0xb2ca84===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4299bc+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x3ed8a9=_0x4299bc[_0x1db796(0x254)](0x0,_0xb2ca84),_0x598295=_0x4299bc['substring'](_0xb2ca84+0x1);if(!_0x3ed8a9)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x3ed8a9,'value':_0x598295};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0xcd);[a47_0x3bd9fa(0xd7)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a47_0x3bd9fa(0xf3)](_0x201769){const _0x134bf9=a47_0x3bd9fa,{options:_0x27f687,args:_0x8e9fde,tdx:_0x50bb0b}=_0x201769,_0x51802d=this[_0x134bf9(0x1a4)](_0x8e9fde,_0x27f687);if(!_0x51802d)return 0x1;_0x27f687[_0x134bf9(0x117)]&&console[_0x134bf9(0x1cd)]('Project:\x20'+_0x51802d);const _0x4cc928=await withSpinner(_0x134bf9(0x131),()=>_0x50bb0b[_0x134bf9(0x188)][_0x134bf9(0x1ee)](_0x51802d),{'verbose':_0x27f687[_0x134bf9(0x117)]}),{secrets:_0x253070}=_0x4cc928[_0x134bf9(0x110)];return console[_0x134bf9(0x1cd)](_0x134bf9(0x1b7)+_0x253070[_0x134bf9(0x204)]+_0x134bf9(0x1a8)+(_0x253070['length']!==0x1?'s':'')),await handleSDKOutput(_0x253070,_0x27f687),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x199);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x1c9);async[a47_0x3bd9fa(0xf3)](_0x5087d5){const _0x2ed549=a47_0x3bd9fa,{options:_0x5ac060,args:_0x6aad4c,tdx:_0x5045f1}=_0x5087d5;let _0x6bcf7,_0x3de083;if(_0x6aad4c[_0x2ed549(0x204)]>=0x2)_0x6bcf7=_0x6aad4c[0x0],_0x3de083=_0x6aad4c[0x1];else{if(_0x6aad4c[_0x2ed549(0x204)]===0x1&&_0x5ac060[_0x2ed549(0x24c)])_0x6bcf7=_0x5ac060[_0x2ed549(0x24c)],_0x3de083=_0x6aad4c[0x0];else return _0x6aad4c['length']===0x1?(console[_0x2ed549(0x1cd)](_0x2ed549(0x1ef)),console['error'](_0x2ed549(0x113)),0x1):(console[_0x2ed549(0x1cd)](_0x2ed549(0xbc)),console['error'](_0x2ed549(0xb8)),0x1);}let _0x3cd650,_0x4d5369;try{({key:_0x3cd650,value:_0x4d5369}=parseKeyValue(_0x3de083));}catch(_0x2fb623){return _0x2fb623 instanceof Error&&console[_0x2ed549(0x1cd)](a47_0x270f7b[_0x2ed549(0x150)](_0x2ed549(0x10e)),_0x2fb623[_0x2ed549(0x23d)]),0x1;}_0x5ac060[_0x2ed549(0x117)]&&(console[_0x2ed549(0x1cd)](_0x2ed549(0x1af)+_0x6bcf7),console[_0x2ed549(0x1cd)](_0x2ed549(0x1b6)+_0x3cd650));const _0x410374=await withSpinner(_0x2ed549(0x139),()=>_0x5045f1[_0x2ed549(0x188)]['setSecret'](_0x6bcf7,_0x3cd650,_0x4d5369),{'verbose':_0x5ac060['verbose']}),_0x2965db=_0x410374[_0x2ed549(0x110)];return console[_0x2ed549(0x1cd)](_0x2ed549(0x214)+_0x2965db[_0x2ed549(0xb9)]+_0x2ed549(0xfa)+_0x2965db[_0x2ed549(0xfe)]+'\x27'),(_0x5ac060['json']||_0x5ac060[_0x2ed549(0xb6)])&&await handleSingleObjectOutput(_0x2965db,_0x5ac060),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0x190);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x242);async[a47_0x3bd9fa(0xf3)](_0x1e2e8c){const _0x24e90e=a47_0x3bd9fa,{options:_0x4c07a9,args:_0x5ed7f4,tdx:_0xce3b58}=_0x1e2e8c;let _0x17de27,_0x59ccba;if(_0x5ed7f4[_0x24e90e(0x204)]>=0x2)_0x17de27=_0x5ed7f4[0x0],_0x59ccba=_0x5ed7f4[0x1];else{if(_0x5ed7f4['length']===0x1&&_0x4c07a9[_0x24e90e(0x24c)])_0x17de27=_0x4c07a9[_0x24e90e(0x24c)],_0x59ccba=_0x5ed7f4[0x0];else return _0x5ed7f4[_0x24e90e(0x204)]===0x1?(console[_0x24e90e(0x1cd)](_0x24e90e(0x1ef)),console[_0x24e90e(0x1cd)](_0x24e90e(0x113)),0x1):(console[_0x24e90e(0x1cd)](_0x24e90e(0x137)),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x4c07a9['verbose']&&(console[_0x24e90e(0x1cd)](_0x24e90e(0x1af)+_0x17de27),console['error'](_0x24e90e(0x1b6)+_0x59ccba));if(!_0x4c07a9[_0x24e90e(0x1f8)]){if(!isInteractive())return console[_0x24e90e(0x1cd)](a47_0x270f7b[_0x24e90e(0x150)](_0x24e90e(0xe2)),_0x24e90e(0x1e3)),console[_0x24e90e(0x1cd)](a47_0x270f7b[_0x24e90e(0x239)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4a9ff6=await confirmKey(_0x24e90e(0x217)+_0x59ccba+_0x24e90e(0x18e)+_0x17de27+'\x27?');if(!_0x4a9ff6)return console[_0x24e90e(0x1cd)](a47_0x270f7b[_0x24e90e(0x152)]('Cancelled')),0x1;}const _0x4b6acd=await withSpinner(_0x24e90e(0x121),()=>_0xce3b58[_0x24e90e(0x188)]['deleteSecret'](_0x17de27,_0x59ccba),{'verbose':_0x4c07a9['verbose']}),_0x278333=_0x4b6acd[_0x24e90e(0x110)];return console['error']('✔\x20Secret\x20\x27'+_0x278333[_0x24e90e(0xb9)]+_0x24e90e(0x22b)+_0x278333['projectName']+'\x27'),(_0x4c07a9[_0x24e90e(0x15c)]||_0x4c07a9[_0x24e90e(0xb6)])&&await handleSingleObjectOutput(_0x278333,_0x4c07a9),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(_0x5643be){const _0x107b57=a47_0x3bd9fa,_0x1280da=Math[_0x107b57(0x23f)](_0x5643be/0x3e8),_0xffc8f9=Math['floor'](_0x1280da/0x3c),_0x152408=Math[_0x107b57(0x23f)](_0xffc8f9/0x3c),_0x5d6ec4=Math['floor'](_0x152408/0x18);if(_0x5d6ec4>0x0){const _0x69fdfe=_0x152408%0x18;return _0x69fdfe>0x0?_0x5d6ec4+'d\x20'+_0x69fdfe+'h':_0x5d6ec4+'d';}else{if(_0x152408>0x0){const _0x270bcb=_0xffc8f9%0x3c;return _0x270bcb>0x0?_0x152408+'h\x20'+_0x270bcb+'m':_0x152408+'h';}else{if(_0xffc8f9>0x0){const _0x3a7082=_0x1280da%0x3c;return _0x3a7082>0x0?_0xffc8f9+'m\x20'+_0x3a7082+'s':_0xffc8f9+'m';}else return _0x1280da+'s';}}}function formatTimestamp(_0x118f9c,_0x38ae15){const _0x360d43=a47_0x3bd9fa,_0xac7f62=new Date(_0x118f9c),_0x4d5e58=String(_0xac7f62[_0x360d43(0x16e)]())['padStart'](0x2,'0'),_0x18a0f4=String(_0xac7f62[_0x360d43(0x118)]())[_0x360d43(0x226)](0x2,'0'),_0x318af7=_0x4d5e58+':'+_0x18a0f4,_0xe83a9f=_0xac7f62[_0x360d43(0x157)]()===_0x38ae15['getFullYear']()&&_0xac7f62['getMonth']()===_0x38ae15['getMonth']()&&_0xac7f62[_0x360d43(0x166)]()===_0x38ae15['getDate']();if(_0xe83a9f)return _0x318af7;else{const _0x1319d4=String(_0xac7f62[_0x360d43(0x13f)]()+0x1)[_0x360d43(0x226)](0x2,'0'),_0x4c56ef=String(_0xac7f62['getDate']())[_0x360d43(0x226)](0x2,'0');return _0x1319d4+'-'+_0x4c56ef+'\x20'+_0x318af7;}}function formatDate(_0x374b8a){const _0x44ee1d=a47_0x3bd9fa,_0x184652=_0x374b8a[_0x44ee1d(0x157)](),_0x9a6adb=String(_0x374b8a[_0x44ee1d(0x13f)]()+0x1)[_0x44ee1d(0x226)](0x2,'0'),_0x2fcec0=String(_0x374b8a[_0x44ee1d(0x166)]())[_0x44ee1d(0x226)](0x2,'0');return _0x184652+'-'+_0x9a6adb+'-'+_0x2fcec0;}function getTaskStateIcon(_0x129220){const _0x56479c={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x56479c[_0x129220]||'⚪';}function getBarChar(_0xd3e98d){const _0x28bfd0=a47_0x3bd9fa;return _0xd3e98d===_0x28bfd0(0x1cd)||_0xd3e98d===_0x28bfd0(0x135)?'×':'─';}function getBarColor(_0x47ada7){const _0x362166=a47_0x3bd9fa,_0x416253={'success':a47_0x270f7b[_0x362166(0xff)],'error':a47_0x270f7b[_0x362166(0x150)],'group_error':a47_0x270f7b['red'],'running':a47_0x270f7b['blue'],'blocked':a47_0x270f7b[_0x362166(0x152)],'planned':a47_0x270f7b[_0x362166(0x239)],'canceling':a47_0x270f7b[_0x362166(0x152)]};return _0x416253[_0x47ada7]||a47_0x270f7b[_0x362166(0x219)];}function parseTaskName(_0x5b4ffb){const _0x3d2ba8=a47_0x3bd9fa;let _0x37216c=_0x5b4ffb[_0x3d2ba8(0x132)](/^\++/,'');const _0x1e14eb=_0x37216c[_0x3d2ba8(0x18f)]('+'),_0x107848=_0x1e14eb['length']>0x1?_0x1e14eb[_0x3d2ba8(0x204)]-0x2:0x0,_0x1dd23a=_0x1e14eb[_0x1e14eb[_0x3d2ba8(0x204)]-0x1]||_0x37216c;return{'level':_0x107848,'name':'+'+_0x1dd23a};}function truncateTaskName(_0xf6f527,_0x28c62d){const _0x3f48bd=a47_0x3bd9fa,_0x28e4be=stringWidth(_0xf6f527);if(_0x28e4be<=_0x28c62d)return _0xf6f527;let _0x1a79a9=_0xf6f527;while(stringWidth(_0x1a79a9+'…')>_0x28c62d&&_0x1a79a9['length']>0x0){_0x1a79a9=_0x1a79a9[_0x3f48bd(0x196)](0x0,-0x1);}return _0x1a79a9+'…';}function calculateTimeScale(_0x2cc0f1,_0x5c475e){const _0x5ac1db=a47_0x3bd9fa;return{'startTime':_0x2cc0f1[_0x5ac1db(0x1ab)],'endTime':_0x2cc0f1[_0x5ac1db(0x1e9)],'durationMs':_0x2cc0f1[_0x5ac1db(0x176)],'msPerChar':_0x2cc0f1[_0x5ac1db(0x176)]/_0x5c475e};}function timeToPosition(_0x549386,_0x6ee1fe,_0x2899d0){const _0x4c993e=a47_0x3bd9fa,_0x1ca80a=_0x549386-_0x6ee1fe[_0x4c993e(0x15d)],_0x1a73ee=Math[_0x4c993e(0x23f)](_0x1ca80a/_0x6ee1fe[_0x4c993e(0x1a7)]);return Math['max'](0x0,Math[_0x4c993e(0x13b)](_0x1a73ee,_0x2899d0));}function renderTimeAxis(_0x3da928,_0x33c0fb){const _0x2f371f=a47_0x3bd9fa,_0x554cef=Math[_0x2f371f(0x13b)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x2f371f(0xa5)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x2f371f(0x23f)](_0x33c0fb/TIMELINE_CONFIG[_0x2f371f(0x1d4)]))),_0x5db5d1=_0x3da928[_0x2f371f(0x1bc)]/(_0x554cef-0x1),_0x2a9bd6=new Date(_0x3da928[_0x2f371f(0x15d)]),_0xb16c39=[];for(let _0x104bc9=0x0;_0x104bc9<_0x554cef;_0x104bc9++){const _0x4229db=_0x3da928[_0x2f371f(0x15d)]+_0x104bc9*_0x5db5d1,_0x2159ec=timeToPosition(_0x4229db,_0x3da928,_0x33c0fb),_0x432e26=formatTimestamp(_0x4229db,_0x2a9bd6);_0xb16c39[_0x2f371f(0x227)]({'pos':_0x2159ec,'text':_0x432e26});}const _0x3cf4f2=new Array(_0x33c0fb)[_0x2f371f(0xc5)]('\x20');let _0x3f2c09=-0x1;for(const {pos:_0x348b0e,text:_0x412253}of _0xb16c39){let _0x69992=Math[_0x2f371f(0xa5)](0x0,_0x348b0e-Math[_0x2f371f(0x23f)](_0x412253[_0x2f371f(0x204)]/0x2));_0x69992<=_0x3f2c09+TIMELINE_CONFIG[_0x2f371f(0x189)]&&(_0x69992=_0x3f2c09+TIMELINE_CONFIG[_0x2f371f(0x189)]+0x1);_0x69992+_0x412253['length']>_0x33c0fb&&(_0x69992=_0x33c0fb-_0x412253[_0x2f371f(0x204)]);if(_0x69992>=0x0&&_0x69992+_0x412253[_0x2f371f(0x204)]<=_0x33c0fb&&_0x69992>_0x3f2c09){for(let _0x55747c=0x0;_0x55747c<_0x412253[_0x2f371f(0x204)];_0x55747c++){_0x3cf4f2[_0x69992+_0x55747c]=_0x412253[_0x55747c];}_0x3f2c09=_0x69992+_0x412253[_0x2f371f(0x204)]-0x1;}}return _0x3cf4f2[_0x2f371f(0x1f5)]('');}function renderTaskRow(_0x577ee8,_0x28790c,_0x5f2af0,_0x3f3078){const _0x362d40=a47_0x3bd9fa,{level:_0x3e292a,name:_0x30a666}=parseTaskName(_0x577ee8[_0x362d40(0x244)]),_0x23f67a='\x20'['repeat'](_0x3e292a),_0x19bf5a=_0x577ee8[_0x362d40(0x174)]?'('+formatElapsed(_0x577ee8['window'][_0x362d40(0x176)])+')':'',_0x2fedf7=stringWidth(_0x19bf5a),_0xe9f79e=_0x3e292a*0x1,_0x4319cb=_0x3f3078-_0xe9f79e-_0x2fedf7-0x1,_0x3b34a7=truncateTaskName(_0x30a666,_0x4319cb),_0xa72a0b=_0x23f67a+_0x3b34a7,_0x366a0d=stringWidth(_0xa72a0b),_0x1acec8=_0x3f3078-_0x366a0d-_0x2fedf7,_0x80292f=_0xa72a0b+'\x20'[_0x362d40(0xac)](Math['max'](0x1,_0x1acec8))+a47_0x270f7b['dim'](_0x19bf5a),_0x28dffa=getTaskStateIcon(_0x577ee8[_0x362d40(0x211)]),_0x385561=new Array(_0x5f2af0)[_0x362d40(0xc5)]('\x20');if(_0x577ee8[_0x362d40(0x174)]){const _0x1dce15=timeToPosition(_0x577ee8['window']['start'],_0x28790c,_0x5f2af0),_0x74fa9c=timeToPosition(_0x577ee8[_0x362d40(0x174)]['end'],_0x28790c,_0x5f2af0),_0x26bdb0=getBarChar(_0x577ee8[_0x362d40(0x211)]),_0x1bc954=Math[_0x362d40(0xa5)](_0x1dce15+0x1,_0x74fa9c);for(let _0x4f3372=_0x1dce15;_0x4f3372<Math[_0x362d40(0x13b)](_0x1bc954,_0x5f2af0);_0x4f3372++){_0x385561[_0x4f3372]=_0x26bdb0;}}const _0x29d248=getBarColor(_0x577ee8[_0x362d40(0x211)]),_0x384f9b=_0x385561[_0x362d40(0x205)](_0x269da6=>_0x269da6==='\x20'?'\x20':_0x29d248(_0x269da6))['join']('');return _0x28dffa+'\x20'+_0x80292f+'│'+_0x384f9b+'│';}function calculateStats(_0xe05ffb){const _0x20e2d9=a47_0x3bd9fa,_0x43f6cb={'total':_0xe05ffb[_0x20e2d9(0x204)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xe8a85d of _0xe05ffb){if(_0xe8a85d[_0x20e2d9(0x211)]===_0x20e2d9(0x143))_0x43f6cb[_0x20e2d9(0x143)]++;else{if(_0xe8a85d[_0x20e2d9(0x211)]===_0x20e2d9(0x1cd)||_0xe8a85d['state']==='group_error')_0x43f6cb['error']++;else _0xe8a85d[_0x20e2d9(0x211)]===_0x20e2d9(0x17c)?_0x43f6cb[_0x20e2d9(0x17c)]++:_0x43f6cb[_0x20e2d9(0x146)]++;}}return _0x43f6cb;}function formatStats(_0x22a354){const _0xb6a456=a47_0x3bd9fa;return[_0xb6a456(0x1fa)+_0x22a354[_0xb6a456(0x202)],'✅\x20'+_0x22a354['success'],'❌\x20'+_0x22a354['error'],_0xb6a456(0x119)+_0x22a354[_0xb6a456(0x17c)],'⏳\x20'+_0x22a354[_0xb6a456(0x146)]][_0xb6a456(0x1f5)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a47_0x3bd9fa(0x244)]=a47_0x3bd9fa(0xa9);[a47_0x3bd9fa(0xd7)]=a47_0x3bd9fa(0x100);async[a47_0x3bd9fa(0xf3)](_0x2f349b){const _0x3644d4=a47_0x3bd9fa,{options:_0x2ca9cb,args:_0x7607e1,tdx:_0x192ab6}=_0x2f349b;let _0x681b73,_0x3b3a1b,_0x238837=![];if(_0x7607e1[0x0]){if(_0x7607e1[0x0][_0x3644d4(0x1e4)]('.')){const _0x117e6e=this[_0x3644d4(0xde)](_0x7607e1,_0x2ca9cb);if(!_0x117e6e)return 0x1;_0x681b73=_0x117e6e[_0x3644d4(0xfe)],_0x3b3a1b=_0x117e6e['workflowName'];}else{_0x3b3a1b=_0x7607e1[0x0],_0x681b73=_0x2ca9cb[_0x3644d4(0x24c)];if(!_0x681b73)return console[_0x3644d4(0x1cd)](a47_0x270f7b[_0x3644d4(0x150)](_0x3644d4(0x10e)),_0x3644d4(0x1fc)),0x1;_0x238837=!![];}}else{const _0xbaca74=this['parseProjectWorkflowPattern'](_0x7607e1,_0x2ca9cb);if(!_0xbaca74)return 0x1;_0x681b73=_0xbaca74['projectName'],_0x3b3a1b=_0xbaca74[_0x3644d4(0x1ce)];}if(_0x2ca9cb[_0x3644d4(0x117)]){if(_0x681b73&&_0x3b3a1b)console[_0x3644d4(0x1cd)](_0x3644d4(0x208)+_0x681b73+'.'+_0x3b3a1b);else _0x681b73&&console[_0x3644d4(0x1cd)](_0x3644d4(0x149)+_0x681b73);}const _0x23b88b=_0x2ca9cb[_0x3644d4(0x237)],_0x20f9ba=_0x2ca9cb[_0x3644d4(0x10b)];if(_0x23b88b){_0x20f9ba&&console[_0x3644d4(0x1cd)](a47_0x270f7b['yellow'](_0x3644d4(0xd6)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x488370=_0x2ca9cb[_0x3644d4(0x1b4)];return _0x488370?await this[_0x3644d4(0x212)](_0x2f349b,_0x23b88b):await this[_0x3644d4(0x151)](_0x2f349b,_0x23b88b,_0x2ca9cb),0x0;}if(_0x20f9ba){const _0x4cbd99=await withSpinner(_0x3644d4(0x185),()=>_0x192ab6[_0x3644d4(0x188)]['sessions']({'projectName':_0x681b73,'workflowName':_0x3b3a1b,'limit':0x64}),{'verbose':_0x2ca9cb['verbose']}),_0x279c88=_0x4cbd99[_0x3644d4(0x110)]['find'](_0x1b8eca=>_0x1b8eca['id']===_0x20f9ba);if(!_0x279c88)return console[_0x3644d4(0x1cd)](a47_0x270f7b[_0x3644d4(0x150)]('Error:'),_0x3644d4(0x126)+_0x20f9ba),0x1;if(!_0x279c88[_0x3644d4(0x104)]?.['id'])return console[_0x3644d4(0x1cd)](a47_0x270f7b[_0x3644d4(0x150)](_0x3644d4(0x10e)),_0x3644d4(0x177)+_0x20f9ba+'\x20has\x20no\x20attempts'),0x1;const _0x418d52=_0x279c88['lastAttempt']['id'];_0x2ca9cb['verbose']&&console[_0x3644d4(0x1cd)](_0x3644d4(0xc8)+_0x418d52+_0x3644d4(0x1a3)+_0x20f9ba);const _0x26f7d4=_0x2ca9cb[_0x3644d4(0x1b4)];return _0x26f7d4?await this['pollTimeline'](_0x2f349b,_0x418d52):await this[_0x3644d4(0x151)](_0x2f349b,_0x418d52,_0x2ca9cb),0x0;}const _0x2e5961=await withSpinner(_0x3644d4(0xb3),()=>_0x192ab6[_0x3644d4(0x188)][_0x3644d4(0x147)]({'projectName':_0x681b73,'workflowName':_0x3b3a1b,'limit':_0x2ca9cb['limit']||0x32}),{'verbose':_0x2ca9cb[_0x3644d4(0x117)]}),_0xaf39c4=_0x2e5961['data'];if(_0xaf39c4[_0x3644d4(0x204)]===0x0){if(_0x681b73&&_0x3b3a1b)console[_0x3644d4(0x1cd)](_0x3644d4(0xa3)+_0x681b73+'.'+_0x3b3a1b);else _0x681b73?console['error'](_0x3644d4(0xb4)+_0x681b73):(console[_0x3644d4(0x1cd)](_0x3644d4(0x1ae)),console[_0x3644d4(0x1cd)](a47_0x270f7b[_0x3644d4(0x239)](_0x3644d4(0xcb))));return 0x0;}_0xaf39c4['sort']((_0x2a51dd,_0x4225ba)=>{const _0x194997=_0x3644d4,_0x12e543=_0x2a51dd[_0x194997(0x11c)]||'',_0xd39ad4=_0x4225ba['sessionTime']||'';return _0xd39ad4[_0x194997(0x14c)](_0x12e543);});if(_0x2ca9cb[_0x3644d4(0x15c)]||_0x2ca9cb[_0x3644d4(0xb6)])return await handleSDKOutput(_0xaf39c4,_0x2ca9cb),0x0;let _0x574d1d;if(_0x238837){const _0x27a9cb=_0xaf39c4[0x0];if(!_0x27a9cb[_0x3644d4(0x104)]?.['id'])return console[_0x3644d4(0x1cd)](_0x3644d4(0x1fd)),0x0;_0x574d1d=_0x27a9cb[_0x3644d4(0x104)]['id'],_0x2ca9cb[_0x3644d4(0x117)]&&console['error'](_0x3644d4(0xe7)+_0x27a9cb['sessionTime']);}else{const _0x2e5331=_0xaf39c4['map'](_0x4f5769=>{const _0x4c1e3c=_0x3644d4,_0x1a07ad=getAttemptStatusDisplay(_0x4f5769[_0x4c1e3c(0x104)]);return{'title':_0x4f5769[_0x4c1e3c(0x228)]?.[_0x4c1e3c(0x244)]+'.'+_0x4f5769['workflow']?.[_0x4c1e3c(0x244)]+'\x20-\x20'+_0x4f5769[_0x4c1e3c(0x11c)]+'\x20'+_0x1a07ad['icon'],'value':_0x4f5769[_0x4c1e3c(0x104)]?.['id']||'','description':_0x1a07ad[_0x4c1e3c(0x207)]};}),_0x3ccf7e=await a47_0x5f4a46({'type':_0x3644d4(0x15a),'name':'attemptId','message':_0x3644d4(0xf1),'choices':_0x2e5331['filter'](_0x398b9f=>_0x398b9f['value']!=='')});if(!_0x3ccf7e[_0x3644d4(0x237)])return 0x0;_0x574d1d=_0x3ccf7e[_0x3644d4(0x237)];}const _0x40772a=_0x2ca9cb['follow'];return _0x40772a?await this[_0x3644d4(0x212)](_0x2f349b,_0x574d1d):await this['renderSingleTimeline'](_0x2f349b,_0x574d1d,_0x2ca9cb),0x0;}async[a47_0x3bd9fa(0x151)](_0x5e9a9a,_0x35bab2,_0x1abd25){const _0xbda769=a47_0x3bd9fa,{tdx:_0x37de58}=_0x5e9a9a;let _0x2cef1d,_0x289b48;try{[_0x2cef1d,_0x289b48]=await Promise[_0xbda769(0x144)]([_0x37de58[_0xbda769(0x188)][_0xbda769(0xc7)](_0x35bab2),_0x37de58[_0xbda769(0x188)][_0xbda769(0xf7)](_0x35bab2,![])]);}catch(_0x4880e3){console['error'](a47_0x270f7b[_0xbda769(0x150)](_0xbda769(0x106)));_0x1abd25[_0xbda769(0x117)]&&console['error'](_0x4880e3);throw _0x4880e3;}if(_0x1abd25[_0xbda769(0x15c)]||_0x1abd25['jsonl']){const _0x4739a5=this[_0xbda769(0x241)](_0x2cef1d,_0x289b48);await handleSDKOutput([_0x4739a5],_0x1abd25);return;}const _0x366d87=_0x37de58[_0xbda769(0x1f7)][_0xbda769(0xb2)],_0x5a16d9=this[_0xbda769(0x1c5)](_0x2cef1d,_0x289b48,_0x366d87);console[_0xbda769(0x1d3)](_0x5a16d9);}async['pollTimeline'](_0x9331af,_0x21c0cd){const _0x4ba47c=a47_0x3bd9fa,{tdx:_0x366406}=_0x9331af,_0x2c1215=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x56e28f=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x490b79=0x0;while(_0x490b79<_0x56e28f){process[_0x4ba47c(0x22e)]['isTTY']&&process[_0x4ba47c(0x22e)][_0x4ba47c(0x163)]('\x1bc');let _0x308e87,_0x306dd7;try{[_0x308e87,_0x306dd7]=await Promise[_0x4ba47c(0x144)]([_0x366406[_0x4ba47c(0x188)][_0x4ba47c(0xc7)](_0x21c0cd),_0x366406[_0x4ba47c(0x188)][_0x4ba47c(0xf7)](_0x21c0cd,![])]);}catch(_0x21e7cf){console[_0x4ba47c(0x1cd)](a47_0x270f7b[_0x4ba47c(0x150)](_0x4ba47c(0x14e)));_0x490b79>0x0&&console[_0x4ba47c(0x1cd)](a47_0x270f7b[_0x4ba47c(0x239)](_0x4ba47c(0x21e)+_0x490b79));throw _0x21e7cf;}const _0x21bfc1=_0x366406[_0x4ba47c(0x1f7)][_0x4ba47c(0xb2)],_0x3f84be=this['renderTimeline'](_0x308e87,_0x306dd7,_0x21bfc1);console[_0x4ba47c(0x1d3)](_0x3f84be);const _0x2a5ef4=_0x308e87[_0x4ba47c(0x247)]&&_0x306dd7[_0x4ba47c(0x1fb)](_0x51eb27=>_0x51eb27[_0x4ba47c(0x211)]!==_0x4ba47c(0x17c)&&_0x51eb27[_0x4ba47c(0x211)]!==_0x4ba47c(0x13d));if(_0x2a5ef4){console['error'](a47_0x270f7b[_0x4ba47c(0xff)](_0x4ba47c(0x14f)));break;}console[_0x4ba47c(0x1cd)](a47_0x270f7b['dim'](_0x4ba47c(0xa8)+_0x490b79*0x2+_0x4ba47c(0xf4))),await new Promise(_0x351877=>setTimeout(_0x351877,_0x2c1215)),_0x490b79++;}_0x490b79>=_0x56e28f&&console['error'](a47_0x270f7b[_0x4ba47c(0x152)](_0x4ba47c(0xc3)));}[a47_0x3bd9fa(0x1c5)](_0xc40a4d,_0x5249a8,_0x4e787e){const _0x1b895c=a47_0x3bd9fa,_0x1361e8=[],_0x29e6b3=TIMELINE_CONFIG[_0x1b895c(0x153)],_0x178904=0x5,_0x1331df=process[_0x1b895c(0x22e)][_0x1b895c(0x101)]||0x78,_0x13d514=_0x1331df-_0x29e6b3-_0x178904,_0x56a864=Math[_0x1b895c(0xa5)](TIMELINE_CONFIG[_0x1b895c(0x10c)],Math[_0x1b895c(0x13b)](_0x13d514,TIMELINE_CONFIG[_0x1b895c(0x209)])),_0x41f912=new Date(_0xc40a4d[_0x1b895c(0x200)])['getTime'](),_0x238740=_0xc40a4d[_0x1b895c(0xef)]?new Date(_0xc40a4d[_0x1b895c(0xef)])[_0x1b895c(0x1ba)]():Date[_0x1b895c(0xa6)](),_0x4d00c9={'start':_0x41f912,'end':_0x238740,'duration':_0x238740-_0x41f912},_0x428074=new Map(),_0x38eb7a=[];for(const _0x476a3a of _0x5249a8){if(_0x476a3a[_0x1b895c(0x17b)]){const _0x556c58=new Date(_0x476a3a[_0x1b895c(0x17b)])[_0x1b895c(0x1ba)](),_0x78f12f=_0x476a3a[_0x1b895c(0x18c)]?new Date(_0x476a3a[_0x1b895c(0x18c)])[_0x1b895c(0x1ba)]():Date[_0x1b895c(0xa6)](),_0x18ead8={'start':_0x556c58,'end':_0x78f12f,'duration':_0x78f12f-_0x556c58};_0x428074[_0x1b895c(0x15b)](_0x476a3a['id'],_0x18ead8),_0x38eb7a[_0x1b895c(0x227)]({'name':_0x476a3a[_0x1b895c(0x156)],'state':_0x476a3a[_0x1b895c(0x211)]||_0x1b895c(0x154),'window':_0x18ead8});}else _0x38eb7a[_0x1b895c(0x227)]({'name':_0x476a3a['fullName'],'state':_0x476a3a['state']||_0x1b895c(0x13d),'window':undefined});}_0x38eb7a[_0x1b895c(0xbd)]((_0x13cbc8,_0x115c35)=>{const _0x2f471c=_0x1b895c;if(!_0x13cbc8[_0x2f471c(0x174)])return 0x1;if(!_0x115c35[_0x2f471c(0x174)])return-0x1;return _0x13cbc8[_0x2f471c(0x174)][_0x2f471c(0x1ab)]-_0x115c35[_0x2f471c(0x174)][_0x2f471c(0x1ab)];});const _0x2b703=_0x38eb7a[_0x1b895c(0x204)],_0xc49db=_0x2b703>TIMELINE_CONFIG[_0x1b895c(0x128)];_0xc49db&&_0x38eb7a[_0x1b895c(0x1d9)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0xd93ab1=calculateTimeScale(_0x4d00c9,_0x56a864),_0x3fbfac=_0xc40a4d[_0x1b895c(0x247)]?_0xc40a4d['success']?a47_0x270f7b[_0x1b895c(0xff)]('success'):a47_0x270f7b[_0x1b895c(0x150)](_0x1b895c(0x1cd)):a47_0x270f7b[_0x1b895c(0x16f)](_0x1b895c(0x17c)),_0x349bcb=_0xc40a4d['project']?.['id'],_0x11f9d9=_0xc40a4d[_0x1b895c(0x10b)];let _0x51feed;if(_0x349bcb&&_0x11f9d9){const _0x51ae7f=getWorkflowAttemptUrl(_0x4e787e,_0x349bcb,_0x11f9d9,_0xc40a4d['id']);_0x51feed=hyperlink(a47_0x270f7b[_0x1b895c(0x239)](_0xc40a4d['id']),_0x51ae7f);}else _0x51feed=a47_0x270f7b[_0x1b895c(0x239)](_0xc40a4d['id']);_0x1361e8[_0x1b895c(0x227)]('Attempt:\x20'+_0x51feed+_0x1b895c(0x171)+_0x3fbfac+_0x1b895c(0x171)+formatElapsed(_0x4d00c9[_0x1b895c(0x176)]));if(_0x38eb7a[_0x1b895c(0x204)]>0x0){const _0x4e892e=renderTimeAxis(_0xd93ab1,_0x56a864),_0x2b2179=new Date(_0x4d00c9['start']),_0x4e4508=formatDate(_0x2b2179),_0x51620d=TIMELINE_CONFIG[_0x1b895c(0x10d)]+TIMELINE_CONFIG[_0x1b895c(0x112)]+_0x29e6b3,_0x3802ff=_0x4e4508['padStart'](_0x51620d),_0x24321d=a47_0x270f7b[_0x1b895c(0x239)](_0x3802ff);_0x1361e8[_0x1b895c(0x227)](_0x24321d+'\x20'+_0x4e892e);for(const _0x40182d of _0x38eb7a){_0x1361e8[_0x1b895c(0x227)](renderTaskRow(_0x40182d,_0xd93ab1,_0x56a864,_0x29e6b3));}const _0x37ed77=calculateStats(_0x38eb7a);_0x1361e8[_0x1b895c(0x227)](formatStats(_0x37ed77)),_0xc49db&&_0x1361e8[_0x1b895c(0x227)](a47_0x270f7b[_0x1b895c(0x152)](_0x1b895c(0x191)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1b895c(0x164)+_0x2b703+'\x20tasks')),_0x1361e8[_0x1b895c(0x227)](''),_0x1361e8['push'](a47_0x270f7b[_0x1b895c(0x239)](_0x1b895c(0x22a))+(_0x1b895c(0xf0)+_0xc40a4d['id']+'\x20logs')+a47_0x270f7b['dim'](_0x1b895c(0xaa)));}else _0x1361e8[_0x1b895c(0x227)](_0x1b895c(0x20c));return _0x1361e8[_0x1b895c(0x1f5)]('\x0a');}[a47_0x3bd9fa(0x241)](_0x4653a8,_0x20b967){const _0x2a5f3e=a47_0x3bd9fa,_0x4abbdd=new Date(_0x4653a8[_0x2a5f3e(0x200)])['getTime'](),_0x3806bc=_0x4653a8['finishedAt']?new Date(_0x4653a8['finishedAt'])[_0x2a5f3e(0x1ba)]():Date[_0x2a5f3e(0xa6)](),_0x2d11d1=_0x3806bc-_0x4abbdd,_0x2d4d9c=[];for(const _0x4b1a18 of _0x20b967){if(_0x4b1a18[_0x2a5f3e(0x17b)]){const _0x5a9089=new Date(_0x4b1a18['startedAt'])[_0x2a5f3e(0x1ba)](),_0x2324d8=_0x4b1a18[_0x2a5f3e(0x18c)]?new Date(_0x4b1a18[_0x2a5f3e(0x18c)])[_0x2a5f3e(0x1ba)]():Date[_0x2a5f3e(0xa6)]();_0x2d4d9c['push']({'name':_0x4b1a18[_0x2a5f3e(0x156)],'state':_0x4b1a18[_0x2a5f3e(0x211)]||_0x2a5f3e(0x154),'window':{'start':_0x5a9089,'end':_0x2324d8,'duration':_0x2324d8-_0x5a9089}});}else _0x2d4d9c['push']({'name':_0x4b1a18[_0x2a5f3e(0x156)],'state':_0x4b1a18[_0x2a5f3e(0x211)]||'planned','window':undefined});}const _0x377115=calculateStats(_0x2d4d9c);return{'attempt':{'id':_0x4653a8['id'],'status':_0x4653a8[_0x2a5f3e(0x247)]?_0x4653a8[_0x2a5f3e(0x143)]?'success':_0x2a5f3e(0x1cd):_0x2a5f3e(0x17c),'createdAt':_0x4653a8[_0x2a5f3e(0x200)],'finishedAt':_0x4653a8[_0x2a5f3e(0xef)],'duration_ms':_0x2d11d1},'tasks':_0x2d4d9c[_0x2a5f3e(0x205)](_0x3c9335=>({'name':_0x3c9335[_0x2a5f3e(0x244)],'state':_0x3c9335[_0x2a5f3e(0x211)],'startedAt':_0x3c9335[_0x2a5f3e(0x174)]?new Date(_0x3c9335[_0x2a5f3e(0x174)][_0x2a5f3e(0x1ab)])[_0x2a5f3e(0xa4)]():null,'updatedAt':_0x3c9335[_0x2a5f3e(0x174)]?new Date(_0x3c9335['window'][_0x2a5f3e(0x1e9)])[_0x2a5f3e(0xa4)]():null,'duration_ms':_0x3c9335[_0x2a5f3e(0x174)]?.[_0x2a5f3e(0x176)]||null})),'stats':_0x377115};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x6298f0,_0x486cc8){const _0x41c71a=a48_0x38ec,_0x47b8cf=_0x6298f0();while(!![]){try{const _0x15c232=parseInt(_0x41c71a(0x80))/0x1*(-parseInt(_0x41c71a(0x84))/0x2)+parseInt(_0x41c71a(0x78))/0x3+parseInt(_0x41c71a(0x87))/0x4*(parseInt(_0x41c71a(0x7e))/0x5)+-parseInt(_0x41c71a(0x86))/0x6*(parseInt(_0x41c71a(0x74))/0x7)+parseInt(_0x41c71a(0x75))/0x8+parseInt(_0x41c71a(0x82))/0x9+-parseInt(_0x41c71a(0x7f))/0xa;if(_0x15c232===_0x486cc8)break;else _0x47b8cf['push'](_0x47b8cf['shift']());}catch(_0x23d708){_0x47b8cf['push'](_0x47b8cf['shift']());}}}(a48_0x598c,0x29d62));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5dd383=a48_0x38ec,_0x9e95f8=getVersion(),_0x1c80b2=platform(),_0x27b248=process[_0x5dd383(0x7c)][_0x5dd383(0x77)]('v','');return _0x5dd383(0x7a)+_0x9e95f8+'\x20('+_0x1c80b2+_0x5dd383(0x7d)+_0x27b248+')';}function a48_0x598c(){const _0x4e1f31=['entries','version',';\x20node/','837860tzyILC','5118580dzjFva','55NWPqoi','Authorization','1054944dCKmZl','length','838ysWpgJ','X-Trino-User','6VNXNkM','8gbLcBX','1012095LfCsfh','917576zWsoOH','TD1\x20','replace','851379dGIoRe','tdx','tdx/'];a48_0x598c=function(){return _0x4e1f31;};return a48_0x598c();}export function getAuthHeaders(_0x4cd655,_0x140c5c){const _0x496881=a48_0x38ec,_0x32a5ef=getVersion(),_0x1178f6={'User-Agent':getUserAgent(),'X-TD-Client':_0x496881(0x79),'X-TD-Client-Version':_0x32a5ef};return _0x140c5c&&(_0x1178f6['Authorization']=_0x496881(0x76)+_0x140c5c),_0x1178f6;}export function toHeaderRecord(_0x2fe7ad){const _0x347f4f=a48_0x38ec,_0x6cdd72={};for(const [_0x30ed4c,_0x37226c]of Object[_0x347f4f(0x7b)](_0x2fe7ad)){_0x37226c!==undefined&&(_0x6cdd72[_0x30ed4c]=_0x37226c);}return _0x6cdd72;}function a48_0x38ec(_0x28b83d,_0x48433e){_0x28b83d=_0x28b83d-0x74;const _0x598cc7=a48_0x598c();let _0x38ec94=_0x598cc7[_0x28b83d];return _0x38ec94;}export function getTrinoHeaders(_0x207f4e,_0x420701){const _0x5eddeb=a48_0x38ec,_0x14e887=getAuthHeaders(_0x207f4e,_0x420701),_0x1c3ea3=toHeaderRecord(_0x14e887);return delete _0x1c3ea3[_0x5eddeb(0x81)],_0x420701&&(_0x1c3ea3[_0x5eddeb(0x85)]=_0x420701),_0x1c3ea3;}export function hasAPIKey(_0x4b2b9f){const _0x3355d0=a48_0x38ec,_0x5db8de=getAPIKey();return _0x5db8de!==undefined&&_0x5db8de[_0x3355d0(0x83)]>0x0;}
1
+ (function(_0x5646e4,_0x3c4e30){const _0x4e383a=a48_0x34eb,_0x3439d7=_0x5646e4();while(!![]){try{const _0x283f4f=parseInt(_0x4e383a(0xb5))/0x1*(-parseInt(_0x4e383a(0xb8))/0x2)+parseInt(_0x4e383a(0xbd))/0x3+parseInt(_0x4e383a(0xb3))/0x4*(parseInt(_0x4e383a(0xb4))/0x5)+parseInt(_0x4e383a(0xad))/0x6*(parseInt(_0x4e383a(0xb6))/0x7)+-parseInt(_0x4e383a(0xb7))/0x8*(parseInt(_0x4e383a(0xba))/0x9)+parseInt(_0x4e383a(0xb9))/0xa+-parseInt(_0x4e383a(0xbc))/0xb*(-parseInt(_0x4e383a(0xac))/0xc);if(_0x283f4f===_0x3c4e30)break;else _0x3439d7['push'](_0x3439d7['shift']());}catch(_0x187a69){_0x3439d7['push'](_0x3439d7['shift']());}}}(a48_0x4e87,0xbe893));import{platform}from'os';function a48_0x34eb(_0x5669b2,_0x17d714){_0x5669b2=_0x5669b2-0xab;const _0x4e878e=a48_0x4e87();let _0x34eb17=_0x4e878e[_0x5669b2];return _0x34eb17;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x1772a1=a48_0x34eb,_0x2aa4cb=getVersion(),_0x108f0a=platform(),_0x15aab6=process[_0x1772a1(0xaf)][_0x1772a1(0xbb)]('v','');return'tdx/'+_0x2aa4cb+'\x20('+_0x108f0a+_0x1772a1(0xab)+_0x15aab6+')';}export function getAuthHeaders(_0x2612d5,_0x361d2a){const _0x5146f8=a48_0x34eb,_0x64bc2e=getVersion(),_0x14ef0a={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x64bc2e};return _0x361d2a&&(_0x14ef0a[_0x5146f8(0xb0)]=_0x5146f8(0xae)+_0x361d2a),_0x14ef0a;}export function toHeaderRecord(_0xba4553){const _0x3279b1=a48_0x34eb,_0x523f2c={};for(const [_0xa7fc08,_0x12b8b0]of Object[_0x3279b1(0xb1)](_0xba4553)){_0x12b8b0!==undefined&&(_0x523f2c[_0xa7fc08]=_0x12b8b0);}return _0x523f2c;}export function getTrinoHeaders(_0x2d0d64,_0x19b1e2){const _0x586bf0=a48_0x34eb,_0x1eefb3=getAuthHeaders(_0x2d0d64,_0x19b1e2),_0x9cb5ca=toHeaderRecord(_0x1eefb3);return delete _0x9cb5ca[_0x586bf0(0xb0)],_0x19b1e2&&(_0x9cb5ca['X-Trino-User']=_0x19b1e2),_0x9cb5ca;}export function hasAPIKey(_0x487182){const _0x4e9ff1=a48_0x34eb,_0x539aa3=getAPIKey();return _0x539aa3!==undefined&&_0x539aa3[_0x4e9ff1(0xb2)]>0x0;}function a48_0x4e87(){const _0x3ce51b=['4513kNWmCg','777ARzTVG','3750064aYlycF','418ksQSnj','804930qYMUpX','18MKhfFe','replace','4274776jVDDKB','1812672seGugm',';\x20node/','36KdnygJ','12246VnRfBL','TD1\x20','version','Authorization','entries','length','8hZYtzG','1460130fArhml'];a48_0x4e87=function(){return _0x3ce51b;};return a48_0x4e87();}
@@ -1 +1 @@
1
- (function(_0x1355f2,_0x2c14f7){const _0x28f952=a49_0x1a14,_0x522592=_0x1355f2();while(!![]){try{const _0x6cffbf=-parseInt(_0x28f952(0x88))/0x1+-parseInt(_0x28f952(0x80))/0x2+-parseInt(_0x28f952(0xb6))/0x3+-parseInt(_0x28f952(0xb3))/0x4+-parseInt(_0x28f952(0x87))/0x5*(parseInt(_0x28f952(0x8f))/0x6)+-parseInt(_0x28f952(0xad))/0x7*(-parseInt(_0x28f952(0x9a))/0x8)+-parseInt(_0x28f952(0xbd))/0x9*(-parseInt(_0x28f952(0x9b))/0xa);if(_0x6cffbf===_0x2c14f7)break;else _0x522592['push'](_0x522592['shift']());}catch(_0x5ea287){_0x522592['push'](_0x522592['shift']());}}}(a49_0x77ff,0x6b9f9));function a49_0x1a14(_0x297795,_0x33cbf8){_0x297795=_0x297795-0x7b;const _0x77ff3=a49_0x77ff();let _0x1a14d4=_0x77ff3[_0x297795];return _0x1a14d4;}import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a49_0x556910 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4beebb){const _0x463624=a49_0x1a14;return _0x4beebb['format']===_0x463624(0x8b)||_0x4beebb[_0x463624(0x84)]===_0x463624(0x7c)||_0x4beebb[_0x463624(0x84)]===_0x463624(0xa1)||_0x4beebb[_0x463624(0x84)]==='table'||_0x4beebb['json']===!![]||_0x4beebb['jsonl']===!![]||_0x4beebb[_0x463624(0xa1)]===!![]||_0x4beebb[_0x463624(0xb5)]===!![];}export function parseOutputOptions(_0x55d7e7){const _0x29b683=a49_0x1a14;return{'format':_0x55d7e7[_0x29b683(0x84)]||_0x29b683(0xb5),'output':_0x55d7e7[_0x29b683(0xbb)]||'','limit':_0x55d7e7[_0x29b683(0x8d)],'color':_0x55d7e7['color'],'noColor':_0x55d7e7['noColor']};}function convertSDKResultToQueryResult(_0xfb21b3){const _0x3bc2c0=a49_0x1a14,_0x4cc0e3=[];if(_0xfb21b3[_0x3bc2c0(0x9f)]>0x0){const _0x27327d=_0xfb21b3[0x0];for(const [_0x36bd1b,_0x24379b]of Object[_0x3bc2c0(0xaf)](_0x27327d)){let _0x1e1078=_0x3bc2c0(0xb1);if(typeof _0x24379b===_0x3bc2c0(0x97))_0x1e1078=Number['isInteger'](_0x24379b)?_0x3bc2c0(0xbc):_0x3bc2c0(0x7f);else{if(typeof _0x24379b===_0x3bc2c0(0x7e))_0x1e1078=_0x3bc2c0(0x7e);else _0x24379b===null&&(_0x1e1078=_0x3bc2c0(0xb1));}_0x4cc0e3[_0x3bc2c0(0x90)]({'name':_0x36bd1b,'type':_0x1e1078});}}return{'queryId':_0x3bc2c0(0x8a),'columns':_0x4cc0e3,'data':_0xfb21b3,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xfb21b3[_0x3bc2c0(0x9f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2f77af,_0x391880){const _0x28fd09=convertSDKResultToQueryResult(_0x2f77af);return formatQueryOutput(_0x28fd09,_0x391880);}export async function formatQueryOutput(_0x1dcd3b,_0x17c659){const _0x5e11e=a49_0x1a14,{format:_0x4d1803,limit:_0x49941e,output:_0x43ef06,color:_0x167f21,noColor:_0xfb4e1b}=_0x17c659,_0x8a830a=Boolean(_0x43ef06)&&!_0x167f21,_0x1161e4={'color':_0x167f21,'noColor':_0xfb4e1b||_0x8a830a};if(_0x4d1803===_0x5e11e(0xb5)){const _0x3bb312=shouldUseLess(_0x4d1803,_0x43ef06);return formatAsTable(_0x1dcd3b,_0x49941e,_0x3bb312,_0x1161e4);}else{if(_0x4d1803===_0x5e11e(0x8b))return formatAsJSON(_0x1dcd3b,_0x1161e4);else return _0x4d1803===_0x5e11e(0x7c)?formatAsJSONL(_0x1dcd3b,_0x1161e4):formatQueryResult(_0x1dcd3b,_0x4d1803);}}function shouldUseLess(_0x23f194,_0x154202){const _0x1c9f36=a49_0x1a14;return(_0x23f194===_0x1c9f36(0xb5)||_0x23f194==='list')&&process[_0x1c9f36(0xbf)][_0x1c9f36(0xb7)]&&!_0x154202;}export function resolveOutputOptions(_0x2b8adc){const _0x1568ad=a49_0x1a14,_0x1473fd=resolveOutputFormat(_0x2b8adc[_0x1568ad(0x84)],_0x2b8adc['output'],'table');let _0x2b4e5e=typeof _0x2b8adc[_0x1568ad(0x8d)]===_0x1568ad(0x97)?_0x2b8adc[_0x1568ad(0x8d)]:parseInt(_0x2b8adc['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x22b5f2=_0x2b8adc[_0x1568ad(0xbb)]||'';return shouldUseLess(_0x1473fd,_0x22b5f2)&&(_0x2b4e5e=Infinity),{'format':_0x1473fd,'output':_0x22b5f2,'limit':_0x2b4e5e,'color':_0x2b8adc[_0x1568ad(0xa4)],'noColor':_0x2b8adc[_0x1568ad(0x96)]};}export function writeOutput(_0x49a5a1,_0x28f1a7,_0x1b6ffb){const _0x686d88=a49_0x1a14;return _0x28f1a7?(writeFileSync(_0x28f1a7,_0x49a5a1),console[_0x686d88(0xb0)](_0x686d88(0xa9)+_0x28f1a7),Promise['resolve']()):shouldUseLess(_0x1b6ffb||'','')?new Promise(_0x22b04c=>{const _0xc452e2=_0x686d88,_0x359828=spawn(_0xc452e2(0x89),[_0xc452e2(0xa2)],{'stdio':[_0xc452e2(0xba),'inherit','inherit']});let _0x563461=![];_0x359828['on'](_0xc452e2(0xb0),()=>{const _0x2ee514=_0xc452e2;!_0x563461&&(_0x563461=!![],console[_0x2ee514(0xae)](_0x49a5a1),_0x22b04c());}),_0x359828['on']('close',()=>{!_0x563461&&(_0x563461=!![],_0x22b04c());}),_0x359828['on'](_0xc452e2(0xa8),()=>{const _0x57e72f=_0xc452e2;!_0x563461&&_0x359828[_0x57e72f(0x94)]&&(_0x359828[_0x57e72f(0x94)]['on'](_0x57e72f(0xb0),()=>{}),_0x359828[_0x57e72f(0x94)][_0x57e72f(0xaa)](_0x49a5a1),_0x359828[_0x57e72f(0x94)][_0x57e72f(0x92)]());}),!_0x359828[_0xc452e2(0x94)]&&(!_0x563461&&(_0x563461=!![],console[_0xc452e2(0xae)](_0x49a5a1),_0x22b04c()));}):(console[_0x686d88(0xae)](_0x49a5a1),Promise[_0x686d88(0xa7)]());}export async function handleSDKOutput(_0x3722a4,_0x4d7de2){const _0x25e07e=a49_0x1a14,_0x13427d=resolveOutputOptions(_0x4d7de2),_0x508f95=await formatSDKOutput(_0x3722a4,_0x13427d);await writeOutput(_0x508f95,_0x13427d['output']||undefined,_0x13427d[_0x25e07e(0x84)]);}export async function handleQueryOutput(_0x654af9,_0x2882fd){const _0x41d66d=a49_0x1a14,_0x409303=resolveOutputOptions(_0x2882fd),_0x3f0e97=await formatQueryOutput(_0x654af9,_0x409303);await writeOutput(_0x3f0e97,_0x409303[_0x41d66d(0xbb)]||undefined,_0x409303['format']);}async function formatSingleObject(_0x37eda4,_0x42657e){const _0xb43da3=a49_0x1a14,{format:_0x111440,color:_0x34d3e0,noColor:_0x50c752}=_0x42657e,_0x26427b={'color':_0x34d3e0,'noColor':_0x50c752};if(_0x111440===_0xb43da3(0x8b)){if(shouldUseColor(_0x26427b))return colorizeJSON(_0x37eda4,_0x26427b);return JSON[_0xb43da3(0xb8)](_0x37eda4,null,0x2);}else{if(_0x111440===_0xb43da3(0x7c)){if(shouldUseColor(_0x26427b))return colorizeJSONCompact(_0x37eda4,_0x26427b);return JSON['stringify'](_0x37eda4);}else{if(_0x111440===_0xb43da3(0xa1))return Object[_0xb43da3(0xaf)](_0x37eda4)['map'](([_0x13cfba,_0x412c93])=>_0x13cfba+'\x09'+_0x412c93)[_0xb43da3(0x8e)]('\x0a');else{const _0x299cc4=Object[_0xb43da3(0xaf)](_0x37eda4);if(_0x299cc4['length']===0x0)return _0xb43da3(0x82);const _0x23826b=_0x37eda4['debug'],_0x5bc666=_0x37eda4[_0xb43da3(0xb4)],_0x35047b=_0x37eda4['params'],_0x54a5e9=_0x37eda4[_0xb43da3(0x9d)],_0x5ab2e8=_0x5bc666?typeof _0x5bc666===_0xb43da3(0xa5)?_0x5bc666:JSON['stringify'](_0x5bc666,null,0x2):undefined,_0x187252=_0x35047b&&Object[_0xb43da3(0xac)](_0x35047b)[_0xb43da3(0x9f)]>0x0?JSON[_0xb43da3(0xb8)](_0x35047b,null,0x2):undefined,_0x32e915=_0x54a5e9&&Object[_0xb43da3(0xac)](_0x54a5e9)['length']>0x0?JSON[_0xb43da3(0xb8)](_0x54a5e9,null,0x2):undefined,_0x4aebb2=_0x299cc4[_0xb43da3(0x86)](([_0xad9280])=>_0xad9280!==_0xb43da3(0x9c)&&_0xad9280!==_0xb43da3(0xb4)&&_0xad9280!==_0xb43da3(0xa0)&&_0xad9280!==_0xb43da3(0x9d)),_0x5c19e4=Math['max'](..._0x4aebb2['map'](([_0x3cc01d])=>_0x3cc01d[_0xb43da3(0x9f)])),_0x3cf454=Math[_0xb43da3(0xc2)](..._0x4aebb2[_0xb43da3(0x81)](([,_0x5d0ab8])=>{const _0x512db6=_0xb43da3;try{const _0x188d91=_0x5d0ab8===null||_0x5d0ab8===undefined?'':typeof _0x5d0ab8===_0x512db6(0x9e)?JSON[_0x512db6(0xb8)](_0x5d0ab8):String(_0x5d0ab8),_0xf76f5b=_0x188d91[_0x512db6(0x99)]('\x0a');return Math[_0x512db6(0xc2)](..._0xf76f5b[_0x512db6(0x81)](_0xe1e298=>_0xe1e298['length']),0x0);}catch{return 0x0;}}),0x14),_0x5c1357=[];_0x5c1357[_0xb43da3(0x90)](colorBorder('┌─'+'─'[_0xb43da3(0x91)](_0x5c19e4)+_0xb43da3(0x93)+'─'[_0xb43da3(0x91)](_0x3cf454)+'─┐',_0x26427b)),_0x4aebb2[_0xb43da3(0xc0)](([_0x50d12b,_0x5384bd])=>{const _0x5d04b2=_0xb43da3;let _0x2bda75;try{_0x2bda75=_0x5384bd===null||_0x5384bd===undefined?'':typeof _0x5384bd===_0x5d04b2(0x9e)?JSON[_0x5d04b2(0xb8)](_0x5384bd):String(_0x5384bd);}catch{_0x2bda75=_0x5d04b2(0xb2);}const _0x2a9121=_0x50d12b['padEnd'](_0x5c19e4),_0x5b6e64=_0x2bda75[_0x5d04b2(0x99)]('\x0a');_0x5b6e64[_0x5d04b2(0xc0)]((_0x3d93db,_0x461555)=>{const _0x37d009=_0x5d04b2,_0x103de4=colorBorder('│',_0x26427b);_0x461555===0x0?_0x5c1357[_0x37d009(0x90)](_0x103de4+'\x20'+_0x2a9121+'\x20'+_0x103de4+'\x20'+_0x3d93db[_0x37d009(0x83)](_0x3cf454)+'\x20'+_0x103de4):_0x5c1357[_0x37d009(0x90)](_0x103de4+'\x20'+'\x20'[_0x37d009(0x91)](_0x5c19e4)+'\x20'+_0x103de4+'\x20'+_0x3d93db[_0x37d009(0x83)](_0x3cf454)+'\x20'+_0x103de4);});}),_0x5c1357[_0xb43da3(0x90)](colorBorder('└─'+'─'['repeat'](_0x5c19e4)+'─┴─'+'─'[_0xb43da3(0x91)](_0x3cf454)+'─┘',_0x26427b));_0x5ab2e8&&(_0x5c1357['push'](''),_0x5c1357['push'](String(a49_0x556910[_0xb43da3(0xbe)]['bold'](_0xb43da3(0xa6)))),_0x5c1357[_0xb43da3(0x90)](_0x5ab2e8));_0x187252&&(_0x5c1357[_0xb43da3(0x90)](''),_0x5c1357[_0xb43da3(0x90)](String(a49_0x556910['blue'][_0xb43da3(0x7b)](_0xb43da3(0xc1)))),_0x5c1357['push'](_0x187252));_0x32e915&&(_0x5c1357[_0xb43da3(0x90)](''),_0x5c1357[_0xb43da3(0x90)](String(a49_0x556910['magenta'][_0xb43da3(0x7b)](_0xb43da3(0x98)))),_0x5c1357[_0xb43da3(0x90)](_0x32e915));if(_0x23826b){if(_0x23826b['stderr']){_0x5c1357['push'](''),_0x5c1357[_0xb43da3(0x90)](String(a49_0x556910[_0xb43da3(0x7d)][_0xb43da3(0x7b)](_0xb43da3(0xa3))));const _0x44a3fd=_0x23826b[_0xb43da3(0x95)]['split']('\x0a');_0x44a3fd[_0xb43da3(0xc0)](_0x2e4666=>{const _0x3f29fd=_0xb43da3;_0x2e4666[_0x3f29fd(0x8c)]()&&_0x5c1357[_0x3f29fd(0x90)](_0x2e4666);});}if(_0x23826b[_0xb43da3(0x85)]){_0x5c1357[_0xb43da3(0x90)](''),_0x5c1357[_0xb43da3(0x90)](String(a49_0x556910[_0xb43da3(0xb9)][_0xb43da3(0x7b)](_0xb43da3(0xab))));const _0x48d92c=_0x23826b['cmdout'][_0xb43da3(0x99)]('\x0a');_0x48d92c[_0xb43da3(0xc0)](_0x5b5707=>{const _0x197be1=_0xb43da3;_0x5b5707[_0x197be1(0x8c)]()&&_0x5c1357[_0x197be1(0x90)](_0x5b5707);});}}return _0x5c1357[_0xb43da3(0x8e)]('\x0a');}}}}function a49_0x77ff(){const _0xe37891=['1867116BGojUy','query','table','657915jDvdZa','isTTY','stringify','cyan','pipe','output','bigint','1440XqQmjT','yellow','stdout','forEach','[params]','max','bold','jsonl','red','boolean','double','944860qlUmFP','map','No\x20data','padEnd','format','cmdout','filter','2795JIviTt','829752AySbsf','less','sdk-result','json','trim','limit','join','1374KkcWXu','push','repeat','end','─┬─','stdin','stderr','noColor','number','[rule]','split','16WEBYIQ','136520ioRmZx','debug','rule','object','length','params','tsv','-FXRSn','[error]','color','string','[query]','resolve','spawn','Results\x20saved\x20to\x20','write','[logs]','keys','1304737EMTPRF','log','entries','error','varchar','[Object]'];a49_0x77ff=function(){return _0xe37891;};return a49_0x77ff();}export async function handleSingleObjectOutput(_0x2c9541,_0x3bc023){const _0xeb5333=a49_0x1a14;if(_0x3bc023[_0xeb5333(0x84)]==='table'){await handleSDKOutput([_0x2c9541],_0x3bc023);return;}const _0x3b05f5=resolveOutputOptions(_0x3bc023),_0x39aef1=await formatSingleObject(_0x2c9541,_0x3b05f5);await writeOutput(_0x39aef1,_0x3b05f5[_0xeb5333(0xbb)]||undefined,_0x3b05f5[_0xeb5333(0x84)]);}
1
+ (function(_0x5539af,_0x4c7374){const _0x67796f=a49_0x36e4,_0x5e6a67=_0x5539af();while(!![]){try{const _0x135231=-parseInt(_0x67796f(0x1c4))/0x1*(parseInt(_0x67796f(0x195))/0x2)+-parseInt(_0x67796f(0x1aa))/0x3+-parseInt(_0x67796f(0x1cb))/0x4*(parseInt(_0x67796f(0x19d))/0x5)+parseInt(_0x67796f(0x1ab))/0x6+parseInt(_0x67796f(0x1bc))/0x7*(-parseInt(_0x67796f(0x18c))/0x8)+-parseInt(_0x67796f(0x1ae))/0x9*(-parseInt(_0x67796f(0x1af))/0xa)+parseInt(_0x67796f(0x19c))/0xb*(parseInt(_0x67796f(0x1a3))/0xc);if(_0x135231===_0x4c7374)break;else _0x5e6a67['push'](_0x5e6a67['shift']());}catch(_0xffdcf1){_0x5e6a67['push'](_0x5e6a67['shift']());}}}(a49_0x1250,0xee0a2));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a49_0x2f8fe8 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x9e0c18){const _0x208f9=a49_0x36e4;return _0x9e0c18['format']===_0x208f9(0x1b4)||_0x9e0c18[_0x208f9(0x18b)]==='jsonl'||_0x9e0c18[_0x208f9(0x18b)]===_0x208f9(0x193)||_0x9e0c18[_0x208f9(0x18b)]===_0x208f9(0x186)||_0x9e0c18[_0x208f9(0x1b4)]===!![]||_0x9e0c18['jsonl']===!![]||_0x9e0c18[_0x208f9(0x193)]===!![]||_0x9e0c18[_0x208f9(0x186)]===!![];}export function parseOutputOptions(_0x3693e5){const _0x95ac3=a49_0x36e4;return{'format':_0x3693e5[_0x95ac3(0x18b)]||_0x95ac3(0x186),'output':_0x3693e5[_0x95ac3(0x1ca)]||'','limit':_0x3693e5[_0x95ac3(0x1be)],'color':_0x3693e5['color'],'noColor':_0x3693e5['noColor']};}function a49_0x36e4(_0x33f91e,_0x396058){_0x33f91e=_0x33f91e-0x184;const _0x125025=a49_0x1250();let _0x36e41b=_0x125025[_0x33f91e];return _0x36e41b;}function convertSDKResultToQueryResult(_0x2c8d69){const _0x27c2c3=a49_0x36e4,_0x5e0057=[];if(_0x2c8d69[_0x27c2c3(0x1a5)]>0x0){const _0x11c9ee=_0x2c8d69[0x0];for(const [_0x2a44b7,_0x308f17]of Object[_0x27c2c3(0x1d0)](_0x11c9ee)){let _0x381f44=_0x27c2c3(0x190);if(typeof _0x308f17===_0x27c2c3(0x199))_0x381f44=Number[_0x27c2c3(0x1b0)](_0x308f17)?_0x27c2c3(0x1a4):_0x27c2c3(0x1a0);else{if(typeof _0x308f17==='boolean')_0x381f44=_0x27c2c3(0x1c7);else _0x308f17===null&&(_0x381f44=_0x27c2c3(0x190));}_0x5e0057[_0x27c2c3(0x18e)]({'name':_0x2a44b7,'type':_0x381f44});}}return{'queryId':_0x27c2c3(0x19e),'columns':_0x5e0057,'data':_0x2c8d69,'stats':{'state':_0x27c2c3(0x198),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2c8d69[_0x27c2c3(0x1a5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x518ca1,_0x1e0ae9){const _0x3d3129=convertSDKResultToQueryResult(_0x518ca1);return formatQueryOutput(_0x3d3129,_0x1e0ae9);}export async function formatQueryOutput(_0x90ce36,_0x577fcd){const _0x214154=a49_0x36e4,{format:_0x2f2f50,limit:_0x47da4b,output:_0x58b1b8,color:_0x29afb1,noColor:_0x4af2b6}=_0x577fcd,_0x542fe4=Boolean(_0x58b1b8)&&!_0x29afb1,_0xd2a477={'color':_0x29afb1,'noColor':_0x4af2b6||_0x542fe4};if(_0x2f2f50==='table'){const _0x2e76f9=shouldUseLess(_0x2f2f50,_0x58b1b8);return formatAsTable(_0x90ce36,_0x47da4b,_0x2e76f9,_0xd2a477);}else{if(_0x2f2f50===_0x214154(0x1b4))return formatAsJSON(_0x90ce36,_0xd2a477);else return _0x2f2f50===_0x214154(0x1ad)?formatAsJSONL(_0x90ce36,_0xd2a477):formatQueryResult(_0x90ce36,_0x2f2f50);}}function shouldUseLess(_0x3a1e3f,_0x174740){const _0x5208f0=a49_0x36e4;return(_0x3a1e3f===_0x5208f0(0x186)||_0x3a1e3f===_0x5208f0(0x184))&&process[_0x5208f0(0x1cd)]['isTTY']&&!_0x174740;}export function resolveOutputOptions(_0xfed79){const _0x45f416=a49_0x36e4,_0x6bb0e7=resolveOutputFormat(_0xfed79[_0x45f416(0x18b)],_0xfed79[_0x45f416(0x1ca)],_0x45f416(0x186));let _0x556dcc=typeof _0xfed79[_0x45f416(0x1be)]==='number'?_0xfed79[_0x45f416(0x1be)]:parseInt(_0xfed79[_0x45f416(0x1be)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4fb8c6=_0xfed79[_0x45f416(0x1ca)]||'';return shouldUseLess(_0x6bb0e7,_0x4fb8c6)&&(_0x556dcc=Infinity),{'format':_0x6bb0e7,'output':_0x4fb8c6,'limit':_0x556dcc,'color':_0xfed79[_0x45f416(0x196)],'noColor':_0xfed79[_0x45f416(0x1c9)]};}export function writeOutput(_0x1d831f,_0x28ae8c,_0xbbdb73){const _0x5e32ad=a49_0x36e4;return _0x28ae8c?(writeFileSync(_0x28ae8c,_0x1d831f),console[_0x5e32ad(0x194)](_0x5e32ad(0x192)+_0x28ae8c),Promise[_0x5e32ad(0x1a9)]()):shouldUseLess(_0xbbdb73||'','')?new Promise(_0x482b06=>{const _0xad3a1a=_0x5e32ad,_0x4f982d=spawn(_0xad3a1a(0x1cf),[_0xad3a1a(0x1c6)],{'stdio':[_0xad3a1a(0x1cc),'inherit',_0xad3a1a(0x1c1)]});let _0x380781=![];_0x4f982d['on'](_0xad3a1a(0x194),()=>{!_0x380781&&(_0x380781=!![],console['log'](_0x1d831f),_0x482b06());}),_0x4f982d['on'](_0xad3a1a(0x1bf),()=>{!_0x380781&&(_0x380781=!![],_0x482b06());}),_0x4f982d['on'](_0xad3a1a(0x1b1),()=>{const _0x1f815c=_0xad3a1a;!_0x380781&&_0x4f982d[_0x1f815c(0x1b6)]&&(_0x4f982d[_0x1f815c(0x1b6)]['on']('error',()=>{}),_0x4f982d[_0x1f815c(0x1b6)][_0x1f815c(0x1b2)](_0x1d831f),_0x4f982d[_0x1f815c(0x1b6)][_0x1f815c(0x18f)]());}),!_0x4f982d[_0xad3a1a(0x1b6)]&&(!_0x380781&&(_0x380781=!![],console[_0xad3a1a(0x1c5)](_0x1d831f),_0x482b06()));}):(console[_0x5e32ad(0x1c5)](_0x1d831f),Promise[_0x5e32ad(0x1a9)]());}export async function handleSDKOutput(_0x53a953,_0x35d9a3){const _0x5eaa69=a49_0x36e4,_0x28381d=resolveOutputOptions(_0x35d9a3),_0xc092a=await formatSDKOutput(_0x53a953,_0x28381d);await writeOutput(_0xc092a,_0x28381d[_0x5eaa69(0x1ca)]||undefined,_0x28381d[_0x5eaa69(0x18b)]);}export async function handleQueryOutput(_0x18101b,_0x468fb5){const _0x20a04d=a49_0x36e4,_0x4eace3=resolveOutputOptions(_0x468fb5),_0x177eaa=await formatQueryOutput(_0x18101b,_0x4eace3);await writeOutput(_0x177eaa,_0x4eace3['output']||undefined,_0x4eace3[_0x20a04d(0x18b)]);}function a49_0x1250(){const _0x2d669b=['map','inherit','blue','split','421MjnYIs','log','-FXRSn','boolean','trim','noColor','output','5126720TJTyHr','pipe','stdout','No\x20data','less','entries','filter','─┴─','list','padEnd','table','object','[Object]','cmdout','rule','format','232TdFOAK','[logs]','push','end','varchar','red','Results\x20saved\x20to\x20','tsv','error','358iXlydR','color','cyan','FINISHED','number','keys','forEach','230439wirTAj','5sBPCQI','sdk-result','bold','double','[rule]','[error]','1512fLDFSu','bigint','length','params','join','─┬─','resolve','1492893UzxnKv','1783530qrgNbi','[query]','jsonl','7700598ttGbut','10ORjSzl','isInteger','spawn','write','stringify','json','magenta','stdin','query','max','stderr','repeat','yellow','232393MeSzAQ','debug','limit','close'];a49_0x1250=function(){return _0x2d669b;};return a49_0x1250();}async function formatSingleObject(_0x643939,_0x5ad526){const _0x580823=a49_0x36e4,{format:_0x51f695,color:_0x3bd532,noColor:_0x52202a}=_0x5ad526,_0x4a6ef3={'color':_0x3bd532,'noColor':_0x52202a};if(_0x51f695===_0x580823(0x1b4)){if(shouldUseColor(_0x4a6ef3))return colorizeJSON(_0x643939,_0x4a6ef3);return JSON['stringify'](_0x643939,null,0x2);}else{if(_0x51f695===_0x580823(0x1ad)){if(shouldUseColor(_0x4a6ef3))return colorizeJSONCompact(_0x643939,_0x4a6ef3);return JSON[_0x580823(0x1b3)](_0x643939);}else{if(_0x51f695===_0x580823(0x193))return Object['entries'](_0x643939)[_0x580823(0x1c0)](([_0x3008e8,_0x2a87f8])=>_0x3008e8+'\x09'+_0x2a87f8)[_0x580823(0x1a7)]('\x0a');else{const _0x5942bf=Object[_0x580823(0x1d0)](_0x643939);if(_0x5942bf[_0x580823(0x1a5)]===0x0)return _0x580823(0x1ce);const _0x1ec0ae=_0x643939['debug'],_0x3f7bdd=_0x643939['query'],_0x2dfda4=_0x643939[_0x580823(0x1a6)],_0x3afb6a=_0x643939[_0x580823(0x18a)],_0x47bffb=_0x3f7bdd?typeof _0x3f7bdd==='string'?_0x3f7bdd:JSON[_0x580823(0x1b3)](_0x3f7bdd,null,0x2):undefined,_0x25331c=_0x2dfda4&&Object[_0x580823(0x19a)](_0x2dfda4)[_0x580823(0x1a5)]>0x0?JSON[_0x580823(0x1b3)](_0x2dfda4,null,0x2):undefined,_0x32d639=_0x3afb6a&&Object[_0x580823(0x19a)](_0x3afb6a)[_0x580823(0x1a5)]>0x0?JSON[_0x580823(0x1b3)](_0x3afb6a,null,0x2):undefined,_0x1cb1db=_0x5942bf[_0x580823(0x1d1)](([_0x38abb7])=>_0x38abb7!==_0x580823(0x1bd)&&_0x38abb7!==_0x580823(0x1b7)&&_0x38abb7!==_0x580823(0x1a6)&&_0x38abb7!==_0x580823(0x18a)),_0x4be8d5=Math[_0x580823(0x1b8)](..._0x1cb1db[_0x580823(0x1c0)](([_0x202e2b])=>_0x202e2b[_0x580823(0x1a5)])),_0x37c16b=Math[_0x580823(0x1b8)](..._0x1cb1db[_0x580823(0x1c0)](([,_0x497d4c])=>{const _0xa81bcb=_0x580823;try{const _0x12244f=_0x497d4c===null||_0x497d4c===undefined?'':typeof _0x497d4c===_0xa81bcb(0x187)?JSON[_0xa81bcb(0x1b3)](_0x497d4c):String(_0x497d4c),_0x38a46e=_0x12244f[_0xa81bcb(0x1c3)]('\x0a');return Math[_0xa81bcb(0x1b8)](..._0x38a46e[_0xa81bcb(0x1c0)](_0x253f10=>_0x253f10['length']),0x0);}catch{return 0x0;}}),0x14),_0x536c41=[];_0x536c41[_0x580823(0x18e)](colorBorder('┌─'+'─'[_0x580823(0x1ba)](_0x4be8d5)+_0x580823(0x1a8)+'─'[_0x580823(0x1ba)](_0x37c16b)+'─┐',_0x4a6ef3)),_0x1cb1db[_0x580823(0x19b)](([_0x3c7424,_0x142574])=>{const _0x1b82d9=_0x580823;let _0x1ca910;try{_0x1ca910=_0x142574===null||_0x142574===undefined?'':typeof _0x142574===_0x1b82d9(0x187)?JSON[_0x1b82d9(0x1b3)](_0x142574):String(_0x142574);}catch{_0x1ca910=_0x1b82d9(0x188);}const _0x258b65=_0x3c7424[_0x1b82d9(0x185)](_0x4be8d5),_0x47e1ce=_0x1ca910[_0x1b82d9(0x1c3)]('\x0a');_0x47e1ce[_0x1b82d9(0x19b)]((_0x491705,_0x2eb5b8)=>{const _0x579c7f=_0x1b82d9,_0xf3e713=colorBorder('│',_0x4a6ef3);_0x2eb5b8===0x0?_0x536c41[_0x579c7f(0x18e)](_0xf3e713+'\x20'+_0x258b65+'\x20'+_0xf3e713+'\x20'+_0x491705[_0x579c7f(0x185)](_0x37c16b)+'\x20'+_0xf3e713):_0x536c41[_0x579c7f(0x18e)](_0xf3e713+'\x20'+'\x20'[_0x579c7f(0x1ba)](_0x4be8d5)+'\x20'+_0xf3e713+'\x20'+_0x491705['padEnd'](_0x37c16b)+'\x20'+_0xf3e713);});}),_0x536c41[_0x580823(0x18e)](colorBorder('└─'+'─'[_0x580823(0x1ba)](_0x4be8d5)+_0x580823(0x1d2)+'─'[_0x580823(0x1ba)](_0x37c16b)+'─┘',_0x4a6ef3));_0x47bffb&&(_0x536c41[_0x580823(0x18e)](''),_0x536c41[_0x580823(0x18e)](String(a49_0x2f8fe8[_0x580823(0x1bb)][_0x580823(0x19f)](_0x580823(0x1ac)))),_0x536c41[_0x580823(0x18e)](_0x47bffb));_0x25331c&&(_0x536c41[_0x580823(0x18e)](''),_0x536c41['push'](String(a49_0x2f8fe8[_0x580823(0x1c2)][_0x580823(0x19f)]('[params]'))),_0x536c41[_0x580823(0x18e)](_0x25331c));_0x32d639&&(_0x536c41[_0x580823(0x18e)](''),_0x536c41[_0x580823(0x18e)](String(a49_0x2f8fe8[_0x580823(0x1b5)][_0x580823(0x19f)](_0x580823(0x1a1)))),_0x536c41[_0x580823(0x18e)](_0x32d639));if(_0x1ec0ae){if(_0x1ec0ae[_0x580823(0x1b9)]){_0x536c41[_0x580823(0x18e)](''),_0x536c41['push'](String(a49_0x2f8fe8[_0x580823(0x191)][_0x580823(0x19f)](_0x580823(0x1a2))));const _0x207bfa=_0x1ec0ae[_0x580823(0x1b9)][_0x580823(0x1c3)]('\x0a');_0x207bfa[_0x580823(0x19b)](_0x55b799=>{const _0x3c70bb=_0x580823;_0x55b799[_0x3c70bb(0x1c8)]()&&_0x536c41[_0x3c70bb(0x18e)](_0x55b799);});}if(_0x1ec0ae[_0x580823(0x189)]){_0x536c41['push'](''),_0x536c41['push'](String(a49_0x2f8fe8[_0x580823(0x197)][_0x580823(0x19f)](_0x580823(0x18d))));const _0x38f0a3=_0x1ec0ae[_0x580823(0x189)][_0x580823(0x1c3)]('\x0a');_0x38f0a3['forEach'](_0x5cd486=>{const _0x2539e4=_0x580823;_0x5cd486[_0x2539e4(0x1c8)]()&&_0x536c41[_0x2539e4(0x18e)](_0x5cd486);});}}return _0x536c41[_0x580823(0x1a7)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5028d4,_0x51f036){const _0xf30339=a49_0x36e4;if(_0x51f036['format']==='table'){await handleSDKOutput([_0x5028d4],_0x51f036);return;}const _0x31987d=resolveOutputOptions(_0x51f036),_0x2d895e=await formatSingleObject(_0x5028d4,_0x31987d);await writeOutput(_0x2d895e,_0x31987d[_0xf30339(0x1ca)]||undefined,_0x31987d['format']);}