@treasuredata/tdx 2026.3.51 → 2026.3.52

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 (218) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/cas/cas-api-client.js +1 -1
  92. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  93. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  94. package/dist/sdk/cas/index.js +1 -1
  95. package/dist/sdk/cas/pull-workflow.js +1 -1
  96. package/dist/sdk/cas/push-workflow.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/engage-api-client.js +1 -1
  101. package/dist/sdk/client/http-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js +1 -1
  103. package/dist/sdk/client/oauth-refresh.js +1 -1
  104. package/dist/sdk/client/rate-limiter.js +1 -1
  105. package/dist/sdk/client/td-api-client.js +1 -1
  106. package/dist/sdk/client/trino-api-client.js +1 -1
  107. package/dist/sdk/client/workflow-client.js +1 -1
  108. package/dist/sdk/connection-validator.js +1 -1
  109. package/dist/sdk/connection.js +1 -1
  110. package/dist/sdk/delivery.js +1 -1
  111. package/dist/sdk/engage/campaign-pull.js +1 -1
  112. package/dist/sdk/engage/campaign-push.js +1 -1
  113. package/dist/sdk/engage/campaign-validator.js +1 -1
  114. package/dist/sdk/engage/campaign-yaml.js +1 -1
  115. package/dist/sdk/engage/template-pull.js +1 -1
  116. package/dist/sdk/engage/template-push.js +1 -1
  117. package/dist/sdk/engage/template-validator.js +1 -1
  118. package/dist/sdk/engage/template-yaml.js +1 -1
  119. package/dist/sdk/engage/types/campaign-def.js +1 -1
  120. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  121. package/dist/sdk/engage/types/template-schema.js +1 -1
  122. package/dist/sdk/engage.js +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/index.js +1 -1
  125. package/dist/sdk/io/index.js +1 -1
  126. package/dist/sdk/io/node-filesystem.js +1 -1
  127. package/dist/sdk/job.js +1 -1
  128. package/dist/sdk/journey.js +1 -1
  129. package/dist/sdk/llm/chat-cache.js +1 -1
  130. package/dist/sdk/llm/index.js +1 -1
  131. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/personalization.js +1 -1
  134. package/dist/sdk/policy.js +1 -1
  135. package/dist/sdk/query/index.js +1 -1
  136. package/dist/sdk/query/sql-parser.js +1 -1
  137. package/dist/sdk/realtime.js +1 -1
  138. package/dist/sdk/schedule.js +1 -1
  139. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  140. package/dist/sdk/segment/fields-display.js +1 -1
  141. package/dist/sdk/segment/file-discovery.js +1 -1
  142. package/dist/sdk/segment/journey-utils.js +1 -1
  143. package/dist/sdk/segment/journey-validator.js +1 -1
  144. package/dist/sdk/segment/journey-yaml.js +1 -1
  145. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  146. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/pull-workflow.js +1 -1
  148. package/dist/sdk/segment/push-recovery.js +1 -1
  149. package/dist/sdk/segment/push-workflow.js +1 -1
  150. package/dist/sdk/segment/resolution-context.js +1 -1
  151. package/dist/sdk/segment/segment-path-parser.js +1 -1
  152. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  153. package/dist/sdk/segment/segment-validator.js +1 -1
  154. package/dist/sdk/segment/target-resolution.js +1 -1
  155. package/dist/sdk/segment/tdx-config.js +1 -1
  156. package/dist/sdk/segment/types/activation-schema.js +1 -1
  157. package/dist/sdk/segment/types/journey-def.js +1 -1
  158. package/dist/sdk/segment/types/journey-schema.js +1 -1
  159. package/dist/sdk/segment/types/segment-def.js +1 -1
  160. package/dist/sdk/segment/types/segment-schema.js +1 -1
  161. package/dist/sdk/segment/validate-files.js +1 -1
  162. package/dist/sdk/segment/yaml-validator.js +1 -1
  163. package/dist/sdk/segment.js +1 -1
  164. package/dist/sdk/types/index.js +1 -1
  165. package/dist/sdk/types/progress.js +1 -1
  166. package/dist/sdk/types/workspace.js +1 -1
  167. package/dist/sdk/user.js +1 -1
  168. package/dist/sdk/util/format-detector.js +1 -1
  169. package/dist/sdk/util/formatters.js +1 -1
  170. package/dist/sdk/util/index.js +1 -1
  171. package/dist/sdk/util/paginate.js +1 -1
  172. package/dist/sdk/util/tree-formatter.js +1 -1
  173. package/dist/sdk/workflow/archive-validation.js +1 -1
  174. package/dist/sdk/workflow/clone-workflow.js +1 -1
  175. package/dist/sdk/workflow/index.js +1 -1
  176. package/dist/sdk/workflow/pull-workflow.js +1 -1
  177. package/dist/sdk/workflow/push-workflow.js +1 -1
  178. package/dist/sdk/workflow/tdx-config.js +1 -1
  179. package/dist/sdk/workflow/workflow-utils.js +1 -1
  180. package/dist/sdk/workspace/frontmatter.js +1 -1
  181. package/dist/sdk/workspace/git.js +1 -1
  182. package/dist/sdk/workspace/index.js +1 -1
  183. package/dist/sdk/workspace/templates.js +1 -1
  184. package/dist/sdk/workspace/weekly.js +1 -1
  185. package/dist/sdk/workspace/wikilinks.js +1 -1
  186. package/dist/test-utils/command-runner.js +1 -1
  187. package/dist/test-utils/factories.js +1 -1
  188. package/dist/test-utils/fixtures.js +1 -1
  189. package/dist/test-utils/http-mock.js +1 -1
  190. package/dist/test-utils/index.js +1 -1
  191. package/dist/utils/async.js +1 -1
  192. package/dist/utils/colors.js +1 -1
  193. package/dist/utils/diff.js +1 -1
  194. package/dist/utils/file-permissions.js +1 -1
  195. package/dist/utils/file-reader.js +1 -1
  196. package/dist/utils/github-releases.js +1 -1
  197. package/dist/utils/global-cache.js +1 -1
  198. package/dist/utils/json-loader.js +1 -1
  199. package/dist/utils/local-cache.js +1 -1
  200. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  201. package/dist/utils/logger/formatters/index.js +1 -1
  202. package/dist/utils/logger/handlers/console-handler.js +1 -1
  203. package/dist/utils/logger/handlers/file-handler.js +1 -1
  204. package/dist/utils/logger/handlers/index.js +1 -1
  205. package/dist/utils/logger/handlers/null-handler.js +1 -1
  206. package/dist/utils/logger/index.js +1 -1
  207. package/dist/utils/logger/logger.js +1 -1
  208. package/dist/utils/logger/types.js +1 -1
  209. package/dist/utils/option-validation.js +1 -1
  210. package/dist/utils/process.js +1 -1
  211. package/dist/utils/prompt.js +1 -1
  212. package/dist/utils/spinner.js +1 -1
  213. package/dist/utils/sse-parser.js +1 -1
  214. package/dist/utils/string-utils.js +1 -1
  215. package/dist/utils/table-ref-parser.js +1 -1
  216. package/dist/utils/tdx-logger.js +1 -1
  217. package/dist/utils/version-check.js +1 -1
  218. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x33c6d3=a54_0x3a29;(function(_0x5cd03d,_0x4b4cc5){const _0x41cb58=a54_0x3a29,_0x3bf64a=_0x5cd03d();while(!![]){try{const _0x555535=parseInt(_0x41cb58(0x1c5))/0x1+-parseInt(_0x41cb58(0x22b))/0x2*(parseInt(_0x41cb58(0x1a7))/0x3)+parseInt(_0x41cb58(0x208))/0x4*(-parseInt(_0x41cb58(0x112))/0x5)+-parseInt(_0x41cb58(0x191))/0x6+parseInt(_0x41cb58(0x14c))/0x7+-parseInt(_0x41cb58(0x152))/0x8*(parseInt(_0x41cb58(0x1a5))/0x9)+-parseInt(_0x41cb58(0x2a3))/0xa*(-parseInt(_0x41cb58(0x229))/0xb);if(_0x555535===_0x4b4cc5)break;else _0x3bf64a['push'](_0x3bf64a['shift']());}catch(_0x36619e){_0x3bf64a['push'](_0x3bf64a['shift']());}}}(a54_0xfb90,0x4e196));import a54_0x4ee8b0 from'chalk';import{existsSync}from'fs';import a54_0x5ab332 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x253b2e from'prompts';function getAttemptStatusDisplay(_0x45c84b){const _0xdaf9bf=a54_0x3a29;if(!_0x45c84b)return{'icon':'⏳','text':''};const {done:_0x49db20,success:_0x2b074b,cancelRequested:_0x20a0b6}=_0x45c84b;if(!_0x49db20)return _0x20a0b6?{'icon':'🛑','text':a54_0x4ee8b0['yellow'](_0xdaf9bf(0x203))}:{'icon':'🔄','text':a54_0x4ee8b0[_0xdaf9bf(0x185)](_0xdaf9bf(0x1b4))};if(_0x2b074b)return{'icon':'✅','text':a54_0x4ee8b0[_0xdaf9bf(0x24b)](_0xdaf9bf(0x255))};return{'icon':'❌','text':a54_0x4ee8b0['red'](_0xdaf9bf(0x21c))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x33c6d3(0x156)](_0x2d3042,_0x15c18a,_0x2040ab=0x0){return _0x2d3042[_0x2040ab]||_0x15c18a['workflowProject'];}['requireProject'](_0x39fea3,_0x290c36,_0xdc453c=0x0){const _0x54cc6d=a54_0x33c6d3,_0x13d7ee=this[_0x54cc6d(0x156)](_0x39fea3,_0x290c36,_0xdc453c);if(!_0x13d7ee)return console[_0x54cc6d(0x21c)](a54_0x4ee8b0[_0x54cc6d(0x1ca)]('Error:'),'Project\x20name\x20is\x20required'),console['error'](a54_0x4ee8b0[_0x54cc6d(0x1ad)](_0x54cc6d(0x1d6))),null;return _0x13d7ee;}['parseProjectWorkflowPattern'](_0x8c36a0,_0x465c3c){const _0x2a10f2=a54_0x33c6d3;if(_0x8c36a0[0x0]){const _0x2488e2=_0x8c36a0[0x0][_0x2a10f2(0x2ab)]('.');if(_0x2488e2[_0x2a10f2(0x241)]===0x1)return{'projectName':_0x2488e2[0x0],'workflowName':undefined};else return _0x2488e2[_0x2a10f2(0x241)]===0x2?{'projectName':_0x2488e2[0x0],'workflowName':_0x2488e2[0x1]}:(console[_0x2a10f2(0x21c)](a54_0x4ee8b0[_0x2a10f2(0x1ca)](_0x2a10f2(0x22d)),_0x2a10f2(0x275)),null);}return{'projectName':_0x465c3c[_0x2a10f2(0x13c)],'workflowName':undefined};}['resolveProjectDir'](_0x1e3cb9,_0x39f149,_0x8ba13=0x0){const _0x2309bc=a54_0x33c6d3;if(_0x1e3cb9[_0x8ba13])return _0x1e3cb9[_0x8ba13];if(_0x39f149['workflowProject']){const _0x478574=a54_0x5ab332[_0x2309bc(0x2b4)](process[_0x2309bc(0x1ee)](),_0x2309bc(0x22a),_0x39f149[_0x2309bc(0x13c)]);if(existsSync(a54_0x5ab332[_0x2309bc(0x2b4)](_0x478574,_0x2309bc(0x130))))return _0x478574;}return undefined;}async[a54_0x33c6d3(0x1c0)](_0x273c2f,_0x346b9c,_0x477774){const _0x4ca8c3=a54_0x33c6d3;try{const _0x1e00a1=await _0x273c2f[_0x4ca8c3(0x218)][_0x4ca8c3(0x22a)](_0x346b9c,{'limit':0x1});if(_0x1e00a1['length']>0x0){const _0x35d05a=_0x1e00a1[0x0]['id'],_0x2891fb=getWorkflowUrl(_0x477774,_0x35d05a);console['error'](_0x4ca8c3(0x2a1)+a54_0x4ee8b0['cyan'](_0x2891fb));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x33c6d3(0x24d);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x18f);async[a54_0x33c6d3(0x2a6)](_0x4182b1){const _0x5668a8=a54_0x33c6d3,{options:_0xc039aa,args:_0x30a01d,tdx:_0x589356}=_0x4182b1,_0x473ef7=_0x30a01d[0x0],_0x2a19e8=_0xc039aa[_0x5668a8(0x2a4)];if(_0x2a19e8)return saveSessionContext({'workflow_project':undefined},_0xc039aa[_0x5668a8(0x1e1)]),console['log'](a54_0x4ee8b0[_0x5668a8(0x24b)](_0x5668a8(0x121))),0x0;if(!_0x473ef7)return console[_0x5668a8(0x21c)](a54_0x4ee8b0[_0x5668a8(0x1ca)](_0x5668a8(0x22d)),_0x5668a8(0x192)),console[_0x5668a8(0x21c)](a54_0x4ee8b0[_0x5668a8(0x1ad)](_0x5668a8(0x264))),console['error'](a54_0x4ee8b0[_0x5668a8(0x1ad)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x35973c=await withSpinner('Resolving\x20project\x20\x27'+_0x473ef7+_0x5668a8(0x1fa),()=>_0x589356[_0x5668a8(0x218)][_0x5668a8(0x169)](_0x473ef7),{'verbose':_0xc039aa[_0x5668a8(0x17e)]}),{name:_0x1a5ec2}=_0x35973c[_0x5668a8(0x27d)];return saveSessionContext({'workflow_project':_0x1a5ec2},_0xc039aa[_0x5668a8(0x1e1)]),console[_0x5668a8(0x16c)](a54_0x4ee8b0[_0x5668a8(0x24b)](_0x5668a8(0x19e)+a54_0x4ee8b0[_0x5668a8(0x174)](_0x1a5ec2))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x18b);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x154);async[a54_0x33c6d3(0x2a6)](_0x55778a){const _0x20b8a6=a54_0x33c6d3,{options:_0xd8f257,args:_0x1c2edb,tdx:_0x6cd2bb}=_0x55778a,_0x5eb91a=_0x1c2edb[0x0];_0xd8f257[_0x20b8a6(0x17e)]&&_0x5eb91a&&console[_0x20b8a6(0x21c)](_0x20b8a6(0x1de)+_0x5eb91a);const _0x366e0d=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x6cd2bb[_0x20b8a6(0x218)][_0x20b8a6(0x16f)](_0x5eb91a,{'limit':_0xd8f257[_0x20b8a6(0x10f)]}),{'verbose':_0xd8f257['verbose']});let _0x14e4f3=_0x366e0d[_0x20b8a6(0x27d)];_0x14e4f3[_0x20b8a6(0x29a)]((_0xe2af52,_0x458b8a)=>_0xe2af52['name'][_0x20b8a6(0x263)](_0x458b8a[_0x20b8a6(0x2b3)]));const _0x3e5243=_0xd8f257[_0x20b8a6(0x10f)]||0x64,_0x5448a1=_0x14e4f3[_0x20b8a6(0x241)]>=_0x3e5243?a54_0x4ee8b0[_0x20b8a6(0x1ad)](_0x20b8a6(0x161)):'';console[_0x20b8a6(0x21c)](_0x20b8a6(0x194)+_0x14e4f3[_0x20b8a6(0x241)]+'\x20project'+(_0x14e4f3[_0x20b8a6(0x241)]!==0x1?'s':'')+_0x5448a1);if(_0xd8f257[_0x20b8a6(0x1a0)]===_0x20b8a6(0x124)||_0xd8f257[_0x20b8a6(0x1a0)]==='jsonl'||_0xd8f257[_0x20b8a6(0x1a0)]===_0x20b8a6(0x29c))await handleSDKOutput(_0x14e4f3,_0xd8f257);else{if(_0x14e4f3[_0x20b8a6(0x241)]===0x0)_0x5eb91a?console[_0x20b8a6(0x16c)]('No\x20projects\x20match\x20pattern:\x20'+_0x5eb91a):console[_0x20b8a6(0x16c)](_0x20b8a6(0x26b));else{const _0x20fc5e=_0x14e4f3[_0x20b8a6(0x166)](_0x3e05b7=>{const _0x1161ea=_0x20b8a6,_0x34e241=_0x3e05b7['metadata']?.[_0x1161ea(0x266)](_0x380c0f=>_0x380c0f[_0x1161ea(0x23b)]===_0x1161ea(0x247)),_0x12658f=_0x34e241?a54_0x4ee8b0[_0x1161ea(0x1ad)]('\x20(system)'):'';return _0x1161ea(0x11f)+_0x3e05b7[_0x1161ea(0x2b3)]+_0x12658f;});await writeOutput(_0x20fc5e[_0x20b8a6(0x2b4)]('\x0a'),_0xd8f257[_0x20b8a6(0x202)],_0x20b8a6(0x1bf));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x20a);async[a54_0x33c6d3(0x2a6)](_0x56341e){const _0x276d08=a54_0x33c6d3,{options:_0x4cb9fb,args:_0x4cb487,tdx:_0x158ace}=_0x56341e,_0x3391e0=this[_0x276d08(0x156)](_0x4cb487,_0x4cb9fb);_0x4cb9fb[_0x276d08(0x17e)]&&_0x3391e0&&console[_0x276d08(0x21c)](_0x276d08(0x1d0)+_0x3391e0);const _0xda8478=await withSpinner(_0x276d08(0x25b),()=>_0x158ace[_0x276d08(0x218)][_0x276d08(0x22a)](_0x3391e0,{'limit':_0x4cb9fb['limit']}),{'verbose':_0x4cb9fb['verbose']});let _0x452c97=_0xda8478[_0x276d08(0x27d)];_0x452c97[_0x276d08(0x29a)]((_0x25f213,_0x4c58bb)=>{const _0x573242=_0x276d08,_0x226e33=_0x25f213[_0x573242(0x2b3)][_0x573242(0x263)](_0x4c58bb[_0x573242(0x2b3)]);if(_0x226e33!==0x0)return _0x226e33;return(_0x25f213[_0x573242(0x1e9)]?.[_0x573242(0x2b3)]||'')[_0x573242(0x263)](_0x4c58bb[_0x573242(0x1e9)]?.[_0x573242(0x2b3)]||'');});const _0x3b4d7f=_0x4cb9fb[_0x276d08(0x10f)]||0x64,_0x5940f9=_0x452c97['length']>=_0x3b4d7f?a54_0x4ee8b0['dim'](_0x276d08(0x161)):'';console['error'](_0x276d08(0x194)+_0x452c97['length']+_0x276d08(0x248)+(_0x452c97[_0x276d08(0x241)]!==0x1?'s':'')+_0x5940f9);if(_0x4cb9fb[_0x276d08(0x1a0)]===_0x276d08(0x124)||_0x4cb9fb[_0x276d08(0x1a0)]===_0x276d08(0x198)||_0x4cb9fb['format']===_0x276d08(0x29c))await handleSDKOutput(_0x452c97,_0x4cb9fb);else{if(_0x452c97['length']===0x0)_0x3391e0?console[_0x276d08(0x16c)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x3391e0):console[_0x276d08(0x16c)]('No\x20workflows\x20found');else{const _0x179c83=_0x4cb9fb[_0x276d08(0x26d)],_0x51a34c=_0x452c97[_0x276d08(0x166)](_0x28fedf=>{const _0x5bb916=_0x276d08,_0x20b5d3=a54_0x4ee8b0[_0x5bb916(0x1ad)]('#'+_0x28fedf['id']),_0x4ce3a1=hyperlink(_0x20b5d3,getWorkflowUrl(_0x179c83,_0x28fedf['id'])),_0x286462=_0x28fedf[_0x5bb916(0x1e9)]?.[_0x5bb916(0x2b3)]?a54_0x4ee8b0[_0x5bb916(0x1ad)]('\x20('+_0x28fedf[_0x5bb916(0x1e9)][_0x5bb916(0x2b3)]+')'):'';return _0x5bb916(0x280)+_0x4ce3a1+'\x20'+_0x28fedf[_0x5bb916(0x2b3)]+_0x286462;});await writeOutput(_0x51a34c[_0x276d08(0x2b4)]('\x0a'),_0x4cb9fb['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x1b0);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x23d);async['execute'](_0xcf0a27){const _0xf67fc=a54_0x33c6d3,{options:_0x435925,args:_0x30a1fb,tdx:_0x6a400d}=_0xcf0a27,_0xbda71b=this['parseProjectWorkflowPattern'](_0x30a1fb,_0x435925);if(!_0xbda71b)return 0x1;const {projectName:_0x410496,workflowName:_0x4e8412}=_0xbda71b;if(_0x435925['verbose']){if(_0x410496&&_0x4e8412)console[_0xf67fc(0x21c)](_0xf67fc(0x23c)+_0x410496+'.'+_0x4e8412);else _0x410496&&console['error'](_0xf67fc(0x186)+_0x410496);const _0x2f4919=_0x435925[_0xf67fc(0x265)];_0x2f4919&&console[_0xf67fc(0x21c)](_0xf67fc(0x2a2)+_0x2f4919);}let _0x4db5ba=0x28;if(process[_0xf67fc(0x182)][_0xf67fc(0x1fe)]&&!_0x435925[_0xf67fc(0x202)]&&!_0x435925[_0xf67fc(0x1a0)]){const _0x393467=process['stdout']['rows']||0x28;_0x4db5ba=Math['max'](0x14,Math[_0xf67fc(0x2aa)](_0x393467*0x2/0x3));}const _0x2f3a62=_0x435925[_0xf67fc(0x10f)]||_0x4db5ba,_0x38f1d3=await withSpinner(_0xf67fc(0x145),()=>_0x6a400d[_0xf67fc(0x218)]['sessions']({'projectName':_0x410496,'workflowName':_0x4e8412,'status':_0x435925[_0xf67fc(0x265)],'fromTime':_0x435925[_0xf67fc(0x146)],'toTime':_0x435925['to'],'limit':_0x2f3a62}),{'verbose':_0x435925[_0xf67fc(0x17e)]}),_0x35d8f0=_0x38f1d3[_0xf67fc(0x27d)];_0x35d8f0[_0xf67fc(0x29a)]((_0x346c83,_0x335022)=>{const _0x19fc51=_0xf67fc,_0x5506f8=_0x346c83[_0x19fc51(0x178)]||'',_0x2abe13=_0x335022[_0x19fc51(0x178)]||'';return _0x2abe13[_0x19fc51(0x263)](_0x5506f8);});_0x35d8f0[_0xf67fc(0x241)]>=_0x2f3a62?console[_0xf67fc(0x21c)]('✔\x20Showing\x20'+_0x35d8f0[_0xf67fc(0x241)]+'\x20sessions\x20'+a54_0x4ee8b0[_0xf67fc(0x1ad)](_0xf67fc(0x237))):console[_0xf67fc(0x21c)](_0xf67fc(0x194)+_0x35d8f0['length']+_0xf67fc(0x189)+(_0x35d8f0[_0xf67fc(0x241)]!==0x1?'s':''));if(_0x435925[_0xf67fc(0x1a0)]===_0xf67fc(0x124)||_0x435925['format']===_0xf67fc(0x198)||_0x435925['format']===_0xf67fc(0x29c))await handleSDKOutput(_0x35d8f0,_0x435925);else{if(!process[_0xf67fc(0x182)]['isTTY']||_0x435925['output']){if(_0x35d8f0['length']===0x0){if(_0x410496&&_0x4e8412)console['log'](_0xf67fc(0x24e)+_0x410496+'.'+_0x4e8412);else _0x410496?console['log'](_0xf67fc(0x1f8)+_0x410496):console[_0xf67fc(0x16c)](_0xf67fc(0x207));}else{const _0x31e3ae=_0x435925[_0xf67fc(0x26d)],_0x1511f0=this['renderSessionsTimeline'](_0x35d8f0,_0x31e3ae);_0x435925['output']?await writeOutput(_0x1511f0,_0x435925['output'],_0xf67fc(0x1bf)):console[_0xf67fc(0x16c)](_0x1511f0);}!_0x410496&&(console[_0xf67fc(0x21c)](''),console[_0xf67fc(0x21c)](a54_0x4ee8b0['dim'](_0xf67fc(0x244))),console[_0xf67fc(0x21c)](a54_0x4ee8b0[_0xf67fc(0x1ad)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4ee8b0[_0xf67fc(0x1ad)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x35d8f0[_0xf67fc(0x241)]===0x0){if(_0x410496&&_0x4e8412)console[_0xf67fc(0x16c)](_0xf67fc(0x24e)+_0x410496+'.'+_0x4e8412);else _0x410496?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x410496):console[_0xf67fc(0x16c)](_0xf67fc(0x207));}else await this[_0xf67fc(0x2bc)](_0x35d8f0,_0xcf0a27,_0x410496);}}return 0x0;}[a54_0x33c6d3(0x257)](_0x4bbdcc,_0x2573fb){const _0x368431=a54_0x33c6d3,_0x9ef50=[],_0x3cec9b=new Map();let _0x157ba5=Infinity,_0x1f73e6=-Infinity;for(const _0x52682a of _0x4bbdcc){if(_0x52682a[_0x368431(0x1a8)]?.[_0x368431(0x15d)]){const _0x56e7b3=new Date(_0x52682a[_0x368431(0x1a8)][_0x368431(0x15d)])[_0x368431(0x23e)](),_0x41729c=_0x52682a[_0x368431(0x1a8)][_0x368431(0x1dd)]?new Date(_0x52682a[_0x368431(0x1a8)]['finishedAt'])[_0x368431(0x23e)]():Date['now'](),_0x25c633=_0x52682a['project']?.[_0x368431(0x2b3)]||'(unknown)';!_0x3cec9b['has'](_0x25c633)&&_0x3cec9b[_0x368431(0x21f)](_0x25c633,[]),_0x3cec9b['get'](_0x25c633)[_0x368431(0x24a)]({'session':_0x52682a,'startTime':_0x56e7b3,'endTime':_0x41729c,'duration':_0x41729c-_0x56e7b3}),_0x157ba5=Math['min'](_0x157ba5,_0x56e7b3),_0x1f73e6=Math['max'](_0x1f73e6,_0x41729c);}}if(_0x3cec9b[_0x368431(0x2b5)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x17b13e=process[_0x368431(0x182)][_0x368431(0x1e4)]||0x78,_0x545722=0x1e,_0x55c20e=0x32,_0x12d9f2=0x4,_0x1ff1e9=Math[_0x368431(0x249)](_0x55c20e,Math[_0x368431(0x14b)](_0x545722,Math[_0x368431(0x2aa)](_0x17b13e*0.3))),_0x1b74fa=_0x17b13e-_0x1ff1e9-TIMELINE_CONFIG[_0x368431(0x1b6)]-0x3-_0x12d9f2,_0x58bca7=_0x1f73e6-_0x157ba5,_0xb901dd=_0x58bca7/_0x1ff1e9,_0x3e659c=renderTimeAxis({'startTime':_0x157ba5,'endTime':_0x1f73e6,'durationMs':_0x58bca7,'msPerChar':_0xb901dd},_0x1ff1e9),_0x56a35a=[];for(const _0x11a323 of _0x3cec9b[_0x368431(0x274)]()){_0x56a35a[_0x368431(0x24a)](..._0x11a323);}_0x56a35a[_0x368431(0x29a)]((_0x351b58,_0xaa98f)=>_0xaa98f[_0x368431(0x1f1)]-_0x351b58[_0x368431(0x1f1)]);const _0x526317=new Date(_0x157ba5),_0x290442=formatDate(_0x526317),_0x365cce=_0x12d9f2+TIMELINE_CONFIG[_0x368431(0x232)]+TIMELINE_CONFIG[_0x368431(0x298)]+_0x1b74fa,_0x519f35='\x20'[_0x368431(0x25e)](_0x365cce-_0x290442[_0x368431(0x241)]),_0x5e2b8b=_0x519f35+a54_0x4ee8b0[_0x368431(0x1ad)](_0x290442)+'\x20'+_0x3e659c;_0x9ef50[_0x368431(0x24a)](_0x5e2b8b);const _0x4ddf49=0x16;let _0x2c5509=0x0;for(const _0x4c1bcf of _0x56a35a){const _0x2a80b0=_0x4c1bcf[_0x368431(0x1e1)][_0x368431(0x1e9)]?.['name']||'?',_0x55a1b8=Math[_0x368431(0x249)](stringWidth(_0x2a80b0),_0x4ddf49);_0x2c5509=Math[_0x368431(0x14b)](_0x2c5509,_0x55a1b8);}for(const _0x112b43 of _0x56a35a){const {session:_0x367dae,startTime:_0x17749f,endTime:_0x496870,duration:_0x547773}=_0x112b43,_0x223ff=_0x367dae['project']?.['id'],_0x519785=_0x367dae['id'],_0x543856=_0x367dae[_0x368431(0x1e9)]?.[_0x368431(0x2b3)]||'?',_0x333e73=_0x367dae[_0x368431(0x218)]?.['name']||'?';let _0x457c05,_0x3b5498;if(_0x367dae[_0x368431(0x1a8)]){const _0x5f44ed=_0x367dae[_0x368431(0x1a8)];!_0x5f44ed[_0x368431(0x2ad)]?(_0x457c05=_0x5f44ed[_0x368431(0x1e0)]?'🛑':'🔄',_0x3b5498=_0x5f44ed[_0x368431(0x1e0)]?a54_0x4ee8b0[_0x368431(0x292)]:a54_0x4ee8b0[_0x368431(0x185)]):(_0x457c05=_0x5f44ed['success']?'✅':'❌',_0x3b5498=_0x5f44ed[_0x368431(0x255)]?a54_0x4ee8b0[_0x368431(0x24b)]:a54_0x4ee8b0['red']);}else _0x457c05='⏳',_0x3b5498=a54_0x4ee8b0['dim'];const _0x25681c='#'+_0x519785,_0x480585=_0x223ff?hyperlink(_0x25681c,getWorkflowSessionUrl(_0x2573fb,_0x223ff,_0x519785)):_0x25681c;let _0x189664=_0x543856;stringWidth(_0x543856)>_0x4ddf49&&(_0x189664=_0x543856['slice'](0x0,_0x4ddf49-0x1)+'…');const _0x3afe00=a54_0x4ee8b0[_0x368431(0x1ad)](_0x189664),_0x26b905=stringWidth(_0x189664),_0x49a72a='\x20'['repeat'](_0x2c5509-stringWidth(_0x189664)+0x2),_0x3a754b='('+formatElapsed(_0x547773)+')',_0x558059=stringWidth(_0x3a754b),_0x5d4d5c=stringWidth(_0x25681c),_0x5d3549=_0x5d4d5c+0x1+_0x26b905+_0x49a72a[_0x368431(0x241)],_0x406b4e=_0x1b74fa-_0x5d3549-_0x558059-0x1-0x8;let _0x2bf66c=_0x333e73;stringWidth(_0x2bf66c)>_0x406b4e&&(_0x2bf66c=_0x2bf66c[_0x368431(0x125)](0x0,_0x406b4e-0x1)+'…');const _0x28cb39=_0x480585+'\x20'+_0x3afe00+_0x49a72a+_0x2bf66c,_0xf400ff=stringWidth(_0x28cb39),_0x5d1cab=_0x1b74fa-_0xf400ff-_0x558059,_0x2f9071=_0x28cb39+'\x20'[_0x368431(0x25e)](Math[_0x368431(0x14b)](0x1,_0x5d1cab))+a54_0x4ee8b0[_0x368431(0x1ad)](_0x3a754b),_0x24da47=Math['floor']((_0x17749f-_0x157ba5)/_0xb901dd),_0x3520b1=Math[_0x368431(0x2aa)]((_0x496870-_0x157ba5)/_0xb901dd),_0x242dbb=Math['max'](_0x24da47+0x1,_0x3520b1),_0x888c44=new Array(_0x1ff1e9)['fill']('\x20');for(let _0x246757=_0x24da47;_0x246757<Math[_0x368431(0x249)](_0x242dbb,_0x1ff1e9);_0x246757++){_0x888c44[_0x246757]='─';}const _0x258f4a=_0x888c44[_0x368431(0x166)](_0x17d0af=>_0x17d0af==='\x20'?'\x20':_0x3b5498(_0x17d0af))[_0x368431(0x2b4)]('');_0x9ef50['push'](_0x457c05+'\x20'+_0x2f9071+'│'+_0x258f4a+'│');}return _0x9ef50[_0x368431(0x2b4)]('\x0a');}async['navigateSessionsInteractive'](_0x21a927,_0x495bf5,_0x41d7a6){const _0x7578ff=a54_0x33c6d3,{options:_0x2b0c33,tdx:_0x58615f}=_0x495bf5,_0x1d2764=_0x2b0c33[_0x7578ff(0x26d)],{timelineRows:_0x822700,timeAxisHeader:_0x3cb853}=this[_0x7578ff(0x224)](_0x21a927,_0x1d2764),_0xdc415=_0x822700[_0x7578ff(0x1df)](_0x20cb53=>_0x20cb53['attemptId']);if(_0xdc415['length']===0x0){const _0x569ae3=this[_0x7578ff(0x257)](_0x21a927,_0x1d2764);console[_0x7578ff(0x16c)](_0x569ae3);!_0x41d7a6&&(console[_0x7578ff(0x21c)](''),console[_0x7578ff(0x21c)](a54_0x4ee8b0['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x7578ff(0x21c)](a54_0x4ee8b0[_0x7578ff(0x1ad)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4ee8b0['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x3cb853&&console[_0x7578ff(0x16c)](_0x3cb853);const _0x59c6dc=_0x822700[_0x7578ff(0x1df)](_0x2ae64d=>_0x2ae64d[_0x7578ff(0x148)])[_0x7578ff(0x166)](_0x430f76=>({'title':_0x430f76['displayLine'],'value':_0x430f76[_0x7578ff(0x148)]})),_0x2b5479=process[_0x7578ff(0x182)][_0x7578ff(0x281)]||0x3c,_0x409514=Math[_0x7578ff(0x14b)](0x28,Math[_0x7578ff(0x2aa)](_0x2b5479*0x2/0x3)),_0x51dd2a=await a54_0x253b2e({'type':_0x7578ff(0x159),'name':_0x7578ff(0x148),'message':_0x7578ff(0x250),'choices':_0x59c6dc,'initial':-0x1,'limit':_0x409514,'clearFirst':!![],'fallback':{'title':_0x7578ff(0x10c),'value':null},'suggest':(_0x37a2e8,_0x28fb51)=>{const _0x3f4a24=_0x7578ff;if(!_0x37a2e8)return Promise[_0x3f4a24(0x1d2)](_0x28fb51);const _0x3c45e2=_0x28fb51[_0x3f4a24(0x1df)](_0x2986d2=>{const _0x5a3529=_0x3f4a24,_0x1c95fa=_0x2986d2;return _0x1c95fa[_0x5a3529(0x184)][_0x5a3529(0x1c7)]()['includes'](_0x37a2e8['toLowerCase']());});return Promise[_0x3f4a24(0x1d2)](_0x3c45e2);}}),_0x18a03b=()=>{const _0x1349b3=_0x7578ff;process['stdout']['write'](_0x1349b3(0x234)),process[_0x1349b3(0x182)]['write']('\x1b[1A\x1b[2K'),process['stdout']['write'](_0x1349b3(0x234));},_0xd28f79=_0x51dd2a&&_0x51dd2a[_0x7578ff(0x148)]&&_0x51dd2a['attemptId']!==null&&_0x51dd2a[_0x7578ff(0x148)][_0x7578ff(0x142)]()!=='';if(!_0xd28f79){_0x18a03b(),console[_0x7578ff(0x16c)](a54_0x4ee8b0[_0x7578ff(0x1ad)](_0x7578ff(0x1b9)));return;}_0x18a03b();const _0x430a4e=_0x21a927[_0x7578ff(0x270)](_0x263156=>_0x263156[_0x7578ff(0x1a8)]?.['id']===_0x51dd2a['attemptId']);if(_0x430a4e){const _0x56a9b4=_0x430a4e[_0x7578ff(0x1e9)]?.[_0x7578ff(0x2b3)]||'?',_0x49c657=_0x430a4e[_0x7578ff(0x218)]?.[_0x7578ff(0x2b3)]||'?';console[_0x7578ff(0x16c)](_0x7578ff(0x1fb)+a54_0x4ee8b0['dim'](_0x56a9b4)+_0x7578ff(0x11d)+a54_0x4ee8b0[_0x7578ff(0x1ad)](_0x49c657));}const _0x44e1f4=new WorkflowTimelineCommand();await _0x44e1f4[_0x7578ff(0x2a6)]({'args':[],'options':{..._0x2b0c33,'attemptId':_0x51dd2a[_0x7578ff(0x148)]},'tdx':_0x58615f});}[a54_0x33c6d3(0x224)](_0x52384a,_0x5b64bb){const _0x4133c6=a54_0x33c6d3,_0x5b9096=new Map();for(const _0x3139d2 of _0x52384a){_0x3139d2['id']&&_0x3139d2[_0x4133c6(0x1a8)]?.['id']&&_0x5b9096['set'](_0x3139d2['id'],_0x3139d2[_0x4133c6(0x1a8)]['id']);}const _0x41a6bf=[];let _0x1d03a1='';const _0x30002a=this[_0x4133c6(0x257)](_0x52384a,_0x5b64bb),_0x2e63fc=_0x30002a['split']('\x0a');for(const _0x2631f8 of _0x2e63fc){if(_0x2631f8[_0x4133c6(0x279)](_0x4133c6(0x1d8))||_0x2631f8[_0x4133c6(0x13e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1d03a1=_0x2631f8;else{if(_0x2631f8[_0x4133c6(0x13e)](/^[✅❌🔄🛑⏳]/)){const _0xdc47fb=_0x2631f8['match'](/#(\d+)/),_0x1663b3=_0xdc47fb?_0xdc47fb[0x1]:null,_0x49b1f7=_0x1663b3?_0x5b9096['get'](_0x1663b3)||null:null,_0x4221c2=_0x52384a['find'](_0x24243f=>_0x24243f['id']===_0x1663b3),_0x1f1a07=_0x4221c2?.[_0x4133c6(0x1e9)]?.[_0x4133c6(0x2b3)]||'';_0x41a6bf[_0x4133c6(0x24a)]({'displayLine':_0x2631f8,'attemptId':_0x49b1f7,'projectName':_0x1f1a07});}}}return{'timelineRows':_0x41a6bf,'timeAxisHeader':_0x1d03a1};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x1d1);[a54_0x33c6d3(0x273)]='List\x20workflow\x20attempts';async['execute'](_0xd02676){const _0x2561e6=a54_0x33c6d3,{options:_0x497c4d,args:_0x4cea15,tdx:_0x5e16d0}=_0xd02676,_0x427d32=this[_0x2561e6(0x209)](_0x4cea15,_0x497c4d);if(!_0x427d32)return 0x1;const {projectName:_0x2cdcd0,workflowName:_0x4b192a}=_0x427d32,_0x39a2f4=_0x497c4d['includeRetried'];if(_0x497c4d[_0x2561e6(0x17e)]){if(_0x2cdcd0&&_0x4b192a)console[_0x2561e6(0x21c)](_0x2561e6(0x23c)+_0x2cdcd0+'.'+_0x4b192a);else _0x2cdcd0&&console[_0x2561e6(0x21c)](_0x2561e6(0x186)+_0x2cdcd0);_0x39a2f4&&console[_0x2561e6(0x21c)](_0x2561e6(0x290));}const _0x233e7c=await withSpinner(_0x2561e6(0x2a7),()=>_0x5e16d0[_0x2561e6(0x218)][_0x2561e6(0x170)]({'projectName':_0x2cdcd0,'workflowName':_0x4b192a,'includeRetried':_0x39a2f4,'limit':_0x497c4d[_0x2561e6(0x10f)]}),{'verbose':_0x497c4d['verbose']}),_0x15895d=_0x233e7c[_0x2561e6(0x27d)],_0x56aced=_0x497c4d['limit']||0x64,_0x4fa349=_0x15895d[_0x2561e6(0x241)]>=_0x56aced?a54_0x4ee8b0[_0x2561e6(0x1ad)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2561e6(0x21c)]('✔\x20Found\x20'+_0x15895d[_0x2561e6(0x241)]+_0x2561e6(0x111)+(_0x15895d[_0x2561e6(0x241)]!==0x1?'s':'')+_0x4fa349);if(_0x497c4d[_0x2561e6(0x1a0)]==='json'||_0x497c4d[_0x2561e6(0x1a0)]===_0x2561e6(0x198)||_0x497c4d[_0x2561e6(0x1a0)]===_0x2561e6(0x29c))await handleSDKOutput(_0x15895d,_0x497c4d);else{if(_0x15895d[_0x2561e6(0x241)]===0x0){if(_0x2cdcd0&&_0x4b192a)console[_0x2561e6(0x16c)](_0x2561e6(0x132)+_0x2cdcd0+'.'+_0x4b192a);else _0x2cdcd0?console['log'](_0x2561e6(0x268)+_0x2cdcd0):console[_0x2561e6(0x16c)](_0x2561e6(0x137));}else{const _0x593e15=_0x497c4d['site'],_0x2b9c68=_0x15895d[_0x2561e6(0x166)](_0x2c83d1=>{const _0x531948=_0x2561e6,_0xb91131=a54_0x4ee8b0[_0x531948(0x1ad)]('#'+_0x2c83d1['id']),_0x229689=_0x2c83d1[_0x531948(0x1e9)]?.['id'],_0x1e803b=_0x2c83d1[_0x531948(0x25f)]||_0x2c83d1['sessionId'],_0x13eca5=_0x229689&&_0x1e803b?hyperlink(_0xb91131,getWorkflowAttemptUrl(_0x593e15,_0x229689,_0x1e803b,_0x2c83d1['id'])):_0xb91131,{icon:_0x11415e,text:_0x506c58}=getAttemptStatusDisplay(_0x2c83d1),_0x117992=(_0x2c83d1[_0x531948(0x1e9)]?.[_0x531948(0x2b3)]||'?')+'.'+(_0x2c83d1[_0x531948(0x218)]?.[_0x531948(0x2b3)]||'?'),_0x5227e3=_0x2c83d1[_0x531948(0x178)]?a54_0x4ee8b0['dim'](_0x2c83d1[_0x531948(0x178)]):'';return(_0x13eca5+'\x20'+_0x11415e+(_0x506c58?'\x20'+_0x506c58:'')+'\x20'+_0x117992+'\x20'+_0x5227e3)[_0x531948(0x173)]();});await writeOutput(_0x2b9c68[_0x2561e6(0x2b4)]('\x0a'),_0x497c4d[_0x2561e6(0x202)],_0x2561e6(0x1bf));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x15c);['description']=a54_0x33c6d3(0x260);async['execute'](_0x1cc4aa){const _0x42d5c7=a54_0x33c6d3,{options:_0xca698a,args:_0x1860ef,tdx:_0x3e8d9b}=_0x1cc4aa,_0x30c5c2=_0x1860ef[0x0];if(!_0x30c5c2)return console[_0x42d5c7(0x21c)](_0x42d5c7(0x2b9)),0x1;_0xca698a[_0x42d5c7(0x17e)]&&console[_0x42d5c7(0x21c)](_0x42d5c7(0x187)+_0x30c5c2);const _0x705611=await withSpinner(_0x42d5c7(0x16b),()=>_0x3e8d9b[_0x42d5c7(0x218)][_0x42d5c7(0x27c)](_0x30c5c2),{'verbose':_0xca698a[_0x42d5c7(0x17e)]}),_0xb6fef3=_0x705611['data'];let _0x218e5c;!_0xb6fef3[_0x42d5c7(0x2ad)]?_0x218e5c=_0xb6fef3[_0x42d5c7(0x1e0)]?'canceling':_0x42d5c7(0x1b4):_0x218e5c=_0xb6fef3[_0x42d5c7(0x255)]?_0x42d5c7(0x255):'error';let _0x507628;if(_0xb6fef3[_0x42d5c7(0x15d)]&&_0xb6fef3[_0x42d5c7(0x1dd)]){const _0x4c1b73=new Date(_0xb6fef3[_0x42d5c7(0x15d)])[_0x42d5c7(0x23e)](),_0x5b167b=new Date(_0xb6fef3['finishedAt'])[_0x42d5c7(0x23e)]();_0x507628=Math[_0x42d5c7(0x114)]((_0x5b167b-_0x4c1b73)/0x3e8);}const _0x43976a={'attempt_id':_0xb6fef3['id'],'status':_0x218e5c,..._0xb6fef3[_0x42d5c7(0x277)]!==undefined&&{'index':_0xb6fef3[_0x42d5c7(0x277)]},..._0xb6fef3[_0x42d5c7(0x1e9)]&&{'project':_0xb6fef3[_0x42d5c7(0x1e9)]['name']},..._0xb6fef3[_0x42d5c7(0x218)]&&{'workflow':_0xb6fef3[_0x42d5c7(0x218)][_0x42d5c7(0x2b3)]},..._0xb6fef3[_0x42d5c7(0x294)]&&{'session_id':_0xb6fef3['sessionId']},..._0xb6fef3[_0x42d5c7(0x178)]&&{'session_time':_0xb6fef3['sessionTime']},..._0xb6fef3[_0x42d5c7(0x1a4)]&&{'retry_attempt':_0xb6fef3[_0x42d5c7(0x1a4)]},..._0x507628!==undefined&&{'duration_sec':_0x507628},..._0xb6fef3['createdAt']&&{'created_at':_0xb6fef3['createdAt']},..._0xb6fef3[_0x42d5c7(0x1dd)]&&{'finished_at':_0xb6fef3['finishedAt']},...Object[_0x42d5c7(0x113)](_0xb6fef3[_0x42d5c7(0x1fd)])[_0x42d5c7(0x241)]>0x0&&{'params':_0xb6fef3[_0x42d5c7(0x1fd)]}};return await handleSingleObjectOutput(_0x43976a,_0xca698a),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x15b);[a54_0x33c6d3(0x273)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x301f75){const _0x2df97d=a54_0x33c6d3,{options:_0x4e7a6c,args:_0x250cbe,tdx:_0x318506}=_0x301f75,_0x3bc605=_0x250cbe[0x0];if(!_0x3bc605)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x4cd869=_0x4e7a6c['includeSubtasks'];_0x4e7a6c[_0x2df97d(0x17e)]&&(console[_0x2df97d(0x21c)]('Attempt\x20ID:\x20'+_0x3bc605),_0x4cd869&&console[_0x2df97d(0x21c)](_0x2df97d(0x19f)));const _0xd948ef=await withSpinner(_0x2df97d(0x13b),()=>_0x318506['workflow'][_0x2df97d(0x1d3)](_0x3bc605,_0x4cd869||![]),{'verbose':_0x4e7a6c[_0x2df97d(0x17e)]}),_0x5a802d=_0xd948ef[_0x2df97d(0x27d)];return console[_0x2df97d(0x21c)](_0x2df97d(0x194)+_0x5a802d['length']+_0x2df97d(0x1e8)+(_0x5a802d['length']!==0x1?'s':'')),await handleSDKOutput(_0x5a802d,_0x4e7a6c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x143);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x16e);async['execute'](_0x486ff1){const _0x2380f1=a54_0x33c6d3,{options:_0x5d18f4,args:_0x44e243,tdx:_0x625cd6}=_0x486ff1,_0x26bba4=_0x44e243[0x0];let _0xf633a1=_0x44e243[0x1];if(!_0x26bba4)return console[_0x2380f1(0x21c)](_0x2380f1(0x2b9)),0x1;_0x5d18f4[_0x2380f1(0x17e)]&&(console[_0x2380f1(0x21c)]('Attempt\x20ID:\x20'+_0x26bba4),_0xf633a1&&console[_0x2380f1(0x21c)]('Task\x20name:\x20'+_0xf633a1));const _0x19e388=await withSpinner('Fetching\x20log\x20files...',()=>_0x625cd6[_0x2380f1(0x218)][_0x2380f1(0x25a)](_0x26bba4,_0xf633a1),{'verbose':_0x5d18f4[_0x2380f1(0x17e)]}),_0x295d6b=_0x19e388[_0x2380f1(0x27d)];if(_0x295d6b[_0x2380f1(0x241)]===0x0)return console[_0x2380f1(0x21c)](_0x2380f1(0x1cf)),0x0;if(!_0xf633a1&&(_0x5d18f4[_0x2380f1(0x124)]||_0x5d18f4['format']))return await handleSDKOutput(_0x295d6b,_0x5d18f4),0x0;if(!_0xf633a1){const _0xb49803=_0x295d6b[_0x2380f1(0x166)](_0x3e22c1=>({'title':_0x3e22c1[_0x2380f1(0x21d)]+'\x20('+formatBytes(_0x3e22c1['fileSize'])+')','value':_0x3e22c1['taskName']})),_0x41b6b3=await a54_0x253b2e({'type':_0x2380f1(0x215),'name':_0x2380f1(0x291),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0xb49803});if(!_0x41b6b3[_0x2380f1(0x291)])return console[_0x2380f1(0x21c)](_0x2380f1(0x1b9)),0x0;_0xf633a1=_0x41b6b3['task'];}const _0x31dfc1=await withSpinner(_0x2380f1(0x24f),()=>_0x625cd6[_0x2380f1(0x218)]['logs'](_0x26bba4,_0xf633a1),{'verbose':_0x5d18f4['verbose']}),_0x27d7e9=_0x31dfc1['data'];return _0x27d7e9?console[_0x2380f1(0x16c)](_0x27d7e9):console[_0x2380f1(0x21c)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]='workflow:kill';[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x201);async[a54_0x33c6d3(0x2a6)](_0x4fb636){const _0x256085=a54_0x33c6d3,{options:_0x34d20c,args:_0x47d8b3,tdx:_0x26770e}=_0x4fb636,_0x423aba=_0x47d8b3[0x0];if(!_0x423aba)return console[_0x256085(0x21c)](_0x256085(0x2b9)),0x1;const _0x522b7c=_0x34d20c[_0x256085(0x27b)];_0x34d20c[_0x256085(0x17e)]&&(console[_0x256085(0x21c)]('Attempt\x20ID:\x20'+_0x423aba),_0x522b7c&&console[_0x256085(0x21c)](_0x256085(0x1e7)+_0x522b7c));if(!_0x34d20c[_0x256085(0x1dc)]){if(!isInteractive())return console[_0x256085(0x21c)](a54_0x4ee8b0[_0x256085(0x1ca)](_0x256085(0x228)),_0x256085(0x20c)),console[_0x256085(0x21c)](a54_0x4ee8b0['dim'](_0x256085(0x28c))),0x1;const _0x2d81e3=await confirmKey(_0x256085(0x284)+_0x423aba+'?');if(!_0x2d81e3)return console[_0x256085(0x21c)](a54_0x4ee8b0[_0x256085(0x292)](_0x256085(0x1b9))),0x1;}const _0x3d908b=await withSpinner(_0x256085(0x204),()=>_0x26770e[_0x256085(0x218)][_0x256085(0x2af)](_0x423aba,_0x522b7c),{'verbose':_0x34d20c[_0x256085(0x17e)]}),_0xecec5d=_0x3d908b[_0x256085(0x27d)];return console['error']('✔\x20'+_0xecec5d),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a54_0x33c6d3(0x135);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x282);async[a54_0x33c6d3(0x2a6)](_0x12e92e){const _0x37ffc6=a54_0x33c6d3,{options:_0x3d4364,args:_0x43a7d7,tdx:_0x4c0e7a}=_0x12e92e,_0x5673b6=_0x43a7d7[0x0];if(!_0x5673b6)return console[_0x37ffc6(0x21c)](_0x37ffc6(0x110)),console[_0x37ffc6(0x21c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5d04b6=![],_0x3790ac=_0x5673b6;if(_0x5673b6[_0x37ffc6(0x279)](_0x37ffc6(0x126)))_0x5d04b6=!![],_0x3790ac=_0x5673b6[_0x37ffc6(0x163)](0x8);else{if(_0x5673b6['startsWith'](_0x37ffc6(0x115)))_0x5d04b6=![],_0x3790ac=_0x5673b6[_0x37ffc6(0x163)](0x8);else return console['error'](_0x37ffc6(0x122)),console[_0x37ffc6(0x21c)](_0x37ffc6(0x289)),0x1;}const _0x5d5bbd=_0x3d4364['fromTask'],_0x2bcbff=_0x3d4364[_0x37ffc6(0x1ce)],_0x4b9f5c=_0x3d4364[_0x37ffc6(0x1fd)],_0x3ee9af=_0x3d4364['force'];_0x3d4364[_0x37ffc6(0x17e)]&&(console[_0x37ffc6(0x21c)]('Target:\x20'+(_0x5d04b6?_0x37ffc6(0x1e1):_0x37ffc6(0x27c))+'\x20'+_0x3790ac),_0x5d5bbd&&console[_0x37ffc6(0x21c)](_0x37ffc6(0x2bb)+_0x5d5bbd),_0x2bcbff&&console['error'](_0x37ffc6(0x155)+_0x2bcbff),_0x4b9f5c&&console[_0x37ffc6(0x21c)]('Params:\x20'+_0x4b9f5c),_0x3ee9af&&console[_0x37ffc6(0x21c)](_0x37ffc6(0x18e)));let _0x88663b;if(_0x4b9f5c)try{if(_0x4b9f5c[_0x37ffc6(0x279)]('@')){const _0x4015f4=await import('fs/promises'),_0x34f71f=_0x4b9f5c[_0x37ffc6(0x163)](0x1),_0xb07881=await _0x4015f4['readFile'](_0x34f71f,_0x37ffc6(0x216));_0x88663b=JSON[_0x37ffc6(0x193)](_0xb07881);}else _0x88663b=JSON[_0x37ffc6(0x193)](_0x4b9f5c);}catch{return console['error'](_0x37ffc6(0x230)),0x1;}if(!_0x3d4364[_0x37ffc6(0x1dc)]){if(!isInteractive())return console[_0x37ffc6(0x21c)](a54_0x4ee8b0[_0x37ffc6(0x1ca)](_0x37ffc6(0x228)),_0x37ffc6(0x20c)),console['error'](a54_0x4ee8b0[_0x37ffc6(0x1ad)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x374dc7=await confirmKey(_0x37ffc6(0x1c8)+(_0x5d04b6?_0x37ffc6(0x1e1):_0x37ffc6(0x27c))+'\x20'+_0x3790ac+'?');if(!_0x374dc7)return console[_0x37ffc6(0x21c)](a54_0x4ee8b0[_0x37ffc6(0x292)](_0x37ffc6(0x1b9))),0x1;}let _0x4be110;_0x5d04b6?_0x4be110=await withSpinner(_0x37ffc6(0x165),()=>_0x4c0e7a[_0x37ffc6(0x218)]['retrySession'](_0x3790ac,{'fromTask':_0x5d5bbd,'retryParams':_0x88663b}),{'verbose':_0x3d4364['verbose']}):_0x4be110=await withSpinner('Retrying\x20attempt...',()=>_0x4c0e7a['workflow']['retryAttempt'](_0x3790ac,{'resumeFrom':_0x2bcbff,'retryParams':_0x88663b,'force':_0x3ee9af}),{'verbose':_0x3d4364[_0x37ffc6(0x17e)]});const _0x138f9f=_0x4be110[_0x37ffc6(0x27d)];return console[_0x37ffc6(0x21c)](_0x37ffc6(0x1be)),console[_0x37ffc6(0x21c)](_0x37ffc6(0x28f)+_0x138f9f[_0x37ffc6(0x148)]),console[_0x37ffc6(0x21c)](_0x37ffc6(0x235)+_0x138f9f[_0x37ffc6(0x294)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x167);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x10e);async[a54_0x33c6d3(0x2a6)](_0x282da3){const _0x19f89b=a54_0x33c6d3,{options:_0x39f39b,args:_0x8b6aa1,tdx:_0x4675e0}=_0x282da3;let _0x11289f=_0x8b6aa1[0x0];if(!_0x11289f){const _0x5a582b=this[_0x19f89b(0x156)]([],_0x39f39b),_0x52c0ec=await withSpinner(_0x19f89b(0x25d),()=>_0x4675e0[_0x19f89b(0x218)][_0x19f89b(0x22a)](_0x5a582b,{'limit':_0x39f39b[_0x19f89b(0x10f)]}),{'verbose':_0x39f39b[_0x19f89b(0x17e)]}),_0x9792ec=_0x52c0ec[_0x19f89b(0x27d)];if(_0x9792ec[_0x19f89b(0x241)]===0x0)return console[_0x19f89b(0x21c)]('No\x20workflows\x20found'),!_0x5a582b&&console[_0x19f89b(0x21c)](a54_0x4ee8b0[_0x19f89b(0x1ad)](_0x19f89b(0x1d6))),0x1;const _0x2a859c=_0x9792ec[_0x19f89b(0x166)](_0x9ae36c=>({'title':_0x9ae36c[_0x19f89b(0x1e9)]?.['name']+'.'+_0x9ae36c[_0x19f89b(0x2b3)],'value':_0x9ae36c['project']?.[_0x19f89b(0x2b3)]+'.'+_0x9ae36c['name'],'description':_0x9ae36c[_0x19f89b(0x22c)]?_0x19f89b(0x2a0)+_0x9ae36c[_0x19f89b(0x22c)]:undefined})),_0x31291b=await a54_0x253b2e({'type':_0x19f89b(0x215),'name':_0x19f89b(0x218),'message':_0x19f89b(0x1b2),'choices':_0x2a859c});if(!_0x31291b[_0x19f89b(0x218)])return 0x1;_0x11289f=_0x31291b[_0x19f89b(0x218)];}if(!_0x11289f['includes']('.')){const _0x9fd5db=this[_0x19f89b(0x156)]([],_0x39f39b);if(_0x9fd5db)_0x11289f=_0x9fd5db+'.'+_0x11289f;else return console['error'](a54_0x4ee8b0[_0x19f89b(0x1ca)](_0x19f89b(0x22d)),_0x19f89b(0x1f9)),console[_0x19f89b(0x21c)](a54_0x4ee8b0[_0x19f89b(0x1ad)](_0x19f89b(0x1d6))),0x1;}const _0x506b4f=_0x39f39b[_0x19f89b(0x19d)],_0x304c53=_0x39f39b[_0x19f89b(0x178)],_0x2af528={};if(_0x506b4f&&Array[_0x19f89b(0x177)](_0x506b4f))for(const _0x3746ff of _0x506b4f){const _0x18ffa4=_0x3746ff[_0x19f89b(0x206)]('=');if(_0x18ffa4===-0x1)return console['error'](_0x19f89b(0x21a)+_0x3746ff),console['error'](_0x19f89b(0x22f)),0x1;const _0x27ad12=_0x3746ff['substring'](0x0,_0x18ffa4),_0x1e56be=_0x3746ff[_0x19f89b(0x163)](_0x18ffa4+0x1);try{_0x2af528[_0x27ad12]=JSON[_0x19f89b(0x193)](_0x1e56be);}catch{_0x2af528[_0x27ad12]=_0x1e56be;}}_0x39f39b[_0x19f89b(0x17e)]&&(console[_0x19f89b(0x21c)]('Workflow:\x20'+_0x11289f),Object[_0x19f89b(0x113)](_0x2af528)[_0x19f89b(0x241)]>0x0&&console['error'](_0x19f89b(0x2b8)+JSON[_0x19f89b(0x254)](_0x2af528)),_0x304c53&&console[_0x19f89b(0x21c)]('Session\x20time:\x20'+_0x304c53));const _0x4cb810=await withSpinner(_0x19f89b(0x285),()=>_0x4675e0[_0x19f89b(0x218)][_0x19f89b(0x19b)](_0x11289f,_0x2af528,{'sessionTime':_0x304c53}),{'verbose':_0x39f39b[_0x19f89b(0x17e)]}),_0x4ea44d=_0x4cb810[_0x19f89b(0x27d)];console[_0x19f89b(0x21c)](_0x19f89b(0x1f4)),console[_0x19f89b(0x21c)]('\x20\x20Attempt\x20ID:\x20'+_0x4ea44d['id']),console['error'](_0x19f89b(0x235)+_0x4ea44d[_0x19f89b(0x294)]),console[_0x19f89b(0x21c)]('\x20\x20Project:\x20'+_0x4ea44d['project']?.[_0x19f89b(0x2b3)]),console[_0x19f89b(0x21c)](_0x19f89b(0x1fc)+_0x4ea44d[_0x19f89b(0x218)]?.[_0x19f89b(0x2b3)]);if(_0x4ea44d[_0x19f89b(0x1e9)]?.['id']&&_0x4ea44d[_0x19f89b(0x294)]&&_0x4ea44d['id']){const _0x403606=_0x39f39b[_0x19f89b(0x26d)],_0xf280e1=getConsoleUrl(_0x403606,_0x19f89b(0x16d)+_0x4ea44d[_0x19f89b(0x1e9)]['id']+_0x19f89b(0x225)+_0x4ea44d[_0x19f89b(0x294)]+_0x19f89b(0x133)+_0x4ea44d['id']);console[_0x19f89b(0x21c)](_0x19f89b(0x2a1)+a54_0x4ee8b0[_0x19f89b(0x174)](_0xf280e1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x242);[a54_0x33c6d3(0x273)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x3766b0){const _0x8c628c=a54_0x33c6d3,{options:_0x1eb10a,args:_0x50d229,tdx:_0x2cb49c}=_0x3766b0,_0x280faa=_0x50d229[0x0],_0x48bbe1=_0x50d229[0x1]||'.';if(!_0x280faa)return console[_0x8c628c(0x21c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x8c628c(0x21c)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3275ab=_0x1eb10a['revision'];_0x1eb10a[_0x8c628c(0x17e)]&&(console['error'](_0x8c628c(0x1fb)+_0x280faa),console[_0x8c628c(0x21c)](_0x8c628c(0x1e3)+_0x48bbe1),_0x3275ab&&console[_0x8c628c(0x21c)]('Revision:\x20'+_0x3275ab));const _0xb7e15b=await withSpinner(_0x8c628c(0x151)+_0x280faa+_0x8c628c(0x12f),()=>_0x2cb49c['workflow'][_0x8c628c(0x1c9)](_0x280faa,_0x48bbe1,{'revision':_0x3275ab}),{'verbose':_0x1eb10a[_0x8c628c(0x17e)]}),_0x1c80c3=_0xb7e15b[_0x8c628c(0x27d)];return console[_0x8c628c(0x21c)]('✔\x20Downloaded\x20'+_0x1c80c3['projectName']),console[_0x8c628c(0x21c)](_0x8c628c(0x29e)+_0x1c80c3[_0x8c628c(0x22c)]),console[_0x8c628c(0x21c)]('\x20\x20Files\x20extracted:\x20'+_0x1c80c3[_0x8c628c(0x1a6)]),console[_0x8c628c(0x21c)](_0x8c628c(0x164)+_0x48bbe1+'/'+_0x1c80c3[_0x8c628c(0x1d5)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x1bd);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x52d016){const _0x27da26=a54_0x33c6d3,{options:_0x4c73ee,args:_0x435c32,tdx:_0x13df7c}=_0x52d016;let _0x2b5c1f='.',_0x2204c6=_0x4c73ee['name'];if(_0x435c32[0x0]){const {promises:_0x200f04}=await import('fs');try{const _0x1e931c=await _0x200f04[_0x27da26(0x220)](_0x435c32[0x0]);if(_0x1e931c[_0x27da26(0x1ae)]())_0x2b5c1f=_0x435c32[0x0];else return console[_0x27da26(0x21c)]('Error:\x20'+_0x435c32[0x0]+_0x27da26(0x1f6)),0x1;}catch{_0x2204c6=_0x435c32[0x0],_0x2b5c1f='.';}}const _0x103160=_0x4c73ee[_0x27da26(0x22c)],_0x254c2c=_0x4c73ee[_0x27da26(0x295)];_0x4c73ee['verbose']&&(console['error'](_0x27da26(0x27a)+_0x2b5c1f),_0x2204c6&&console[_0x27da26(0x21c)]('Project\x20name:\x20'+_0x2204c6),_0x103160&&console[_0x27da26(0x21c)](_0x27da26(0x278)+_0x103160),_0x254c2c&&console[_0x27da26(0x21c)](_0x27da26(0x29d)));const _0x20f4b1=await withSpinner(_0x27da26(0x27e),()=>_0x13df7c[_0x27da26(0x218)][_0x27da26(0x24a)](_0x2b5c1f,{'projectName':_0x2204c6,'revision':_0x103160,'skipValidation':_0x254c2c}),{'verbose':_0x4c73ee['verbose']}),_0x193689=_0x20f4b1[_0x27da26(0x27d)];return console[_0x27da26(0x21c)]('✔\x20Pushed\x20'+_0x193689['projectName']),console[_0x27da26(0x21c)](_0x27da26(0x1c6)+_0x193689[_0x27da26(0x256)]),console['error']('\x20\x20Revision:\x20'+_0x193689[_0x27da26(0x22c)]),await this[_0x27da26(0x1c0)](_0x13df7c,_0x193689[_0x27da26(0x1d5)],_0x4c73ee['site']),0x0;}}function a54_0x3a29(_0xe8e547,_0x42189){_0xe8e547=_0xe8e547-0x10a;const _0xfb90b7=a54_0xfb90();let _0x3a2924=_0xfb90b7[_0xe8e547];return _0x3a2924;}export class WorkflowPullCommand extends BaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x27f);['description']=a54_0x33c6d3(0x23f);async[a54_0x33c6d3(0x2a6)](_0xe14bd0){const _0x16ef90=a54_0x33c6d3,{options:_0x450ada,args:_0x44db6d,tdx:_0x3d2866}=_0xe14bd0,_0x5f53f4=_0x44db6d[0x0],_0x24c573=_0x44db6d[0x1];if(!_0x5f53f4)return console[_0x16ef90(0x21c)](a54_0x4ee8b0['red']('Error:'),_0x16ef90(0x192)),console['error'](a54_0x4ee8b0['dim'](_0x16ef90(0x15f))),0x1;const _0x24f417=_0x450ada['revision'];_0x450ada[_0x16ef90(0x17e)]&&(console[_0x16ef90(0x21c)](_0x16ef90(0x1fb)+_0x5f53f4),_0x24c573&&console[_0x16ef90(0x21c)]('Target\x20directory:\x20'+_0x24c573),_0x24f417&&console[_0x16ef90(0x21c)](_0x16ef90(0x278)+_0x24f417),_0x450ada[_0x16ef90(0x190)]&&console[_0x16ef90(0x21c)](_0x16ef90(0x1ba)));const _0x4a896b=await withSpinner(_0x16ef90(0x1a3)+_0x5f53f4+_0x16ef90(0x12f),()=>_0x3d2866[_0x16ef90(0x218)][_0x16ef90(0x1c4)](_0x5f53f4,{'targetDir':_0x24c573,'revision':_0x24f417}),{'verbose':_0x450ada['verbose']}),_0x54a3b5=_0x4a896b[_0x16ef90(0x27d)];_0x54a3b5[_0x16ef90(0x160)]?console[_0x16ef90(0x21c)](_0x16ef90(0x2b1)+_0x54a3b5[_0x16ef90(0x1d5)]):console[_0x16ef90(0x21c)](_0x16ef90(0x2ac)+_0x54a3b5[_0x16ef90(0x1d5)]);console[_0x16ef90(0x21c)](_0x16ef90(0x29e)+_0x54a3b5[_0x16ef90(0x22c)]),console[_0x16ef90(0x21c)](_0x16ef90(0x1c1)+(a54_0x5ab332[_0x16ef90(0x223)](process[_0x16ef90(0x1ee)](),_0x54a3b5[_0x16ef90(0x136)])||'.')),console[_0x16ef90(0x21c)](_0x16ef90(0x2ae)+a54_0x4ee8b0['green']('+'+_0x54a3b5[_0x16ef90(0x297)][_0x16ef90(0x214)]+_0x16ef90(0x117))+',\x20'+(a54_0x4ee8b0['yellow']('~'+_0x54a3b5[_0x16ef90(0x297)][_0x16ef90(0x28d)]+'\x20modified')+',\x20')+(a54_0x4ee8b0[_0x16ef90(0x1ca)]('-'+_0x54a3b5[_0x16ef90(0x297)][_0x16ef90(0x259)]+'\x20deleted')+',\x20')+(''+a54_0x4ee8b0[_0x16ef90(0x1ad)](_0x54a3b5['summary'][_0x16ef90(0x17d)]+_0x16ef90(0x2a5))));for(const _0xfb5114 of _0x54a3b5[_0x16ef90(0x276)]){_0xfb5114[_0x16ef90(0x2bd)]===_0x16ef90(0x28d)&&_0xfb5114[_0x16ef90(0x29f)]&&(console['error']('\x0a'+a54_0x4ee8b0[_0x16ef90(0x174)](_0x16ef90(0x26c)+_0xfb5114[_0x16ef90(0x10d)])),console[_0x16ef90(0x21c)](_0xfb5114[_0x16ef90(0x29f)]));}if(!_0x54a3b5[_0x16ef90(0x296)])return saveSessionContext({'workflow_project':_0x54a3b5[_0x16ef90(0x1d5)]},_0x450ada[_0x16ef90(0x1e1)]),console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x24b)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x1ad)](_0x16ef90(0x139)+_0x54a3b5[_0x16ef90(0x1d5)])),0x0;if(_0x450ada[_0x16ef90(0x190)])return console[_0x16ef90(0x21c)](a54_0x4ee8b0['yellow'](_0x16ef90(0x12c))),0x0;if(!_0x450ada[_0x16ef90(0x1dc)]){if(!isInteractive())return console['error'](a54_0x4ee8b0[_0x16ef90(0x1ca)]('\x0aError:'),_0x16ef90(0x20c)),console[_0x16ef90(0x21c)](a54_0x4ee8b0['dim'](_0x16ef90(0x28c))),0x1;const _0x3ac45c=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x3ac45c)return console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x292)](_0x16ef90(0x1b9)),_0x16ef90(0x17c)),0x1;}await withSpinner(_0x16ef90(0x16a),()=>_0x3d2866[_0x16ef90(0x218)][_0x16ef90(0x211)](_0x54a3b5,{'revision':_0x24f417}),{'verbose':_0x450ada[_0x16ef90(0x17e)]}),saveSessionContext({'workflow_project':_0x54a3b5[_0x16ef90(0x1d5)]},_0x450ada['session']),console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x24b)](_0x16ef90(0x11b)));const _0x440e1c=a54_0x5ab332[_0x16ef90(0x223)](process[_0x16ef90(0x1ee)](),_0x54a3b5[_0x16ef90(0x136)])||'.';return console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x1ad)](_0x16ef90(0x164)+_0x440e1c)),console[_0x16ef90(0x21c)](a54_0x4ee8b0[_0x16ef90(0x1ad)](_0x16ef90(0x139)+_0x54a3b5[_0x16ef90(0x1d5)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']=a54_0x33c6d3(0x243);async[a54_0x33c6d3(0x2a6)](_0x5e24dc){const _0x3297c9=a54_0x33c6d3,{options:_0x16847d,args:_0x3d776a,tdx:_0x593488}=_0x5e24dc,_0x568d9d=this['resolveProjectDir'](_0x3d776a,_0x16847d),_0x5dd10d=_0x16847d[_0x3297c9(0x22c)],_0x337b1b=_0x16847d[_0x3297c9(0x295)];_0x16847d[_0x3297c9(0x17e)]&&(_0x568d9d&&console[_0x3297c9(0x21c)]('Source\x20directory:\x20'+_0x568d9d),_0x5dd10d&&console[_0x3297c9(0x21c)](_0x3297c9(0x278)+_0x5dd10d),_0x16847d[_0x3297c9(0x190)]&&console[_0x3297c9(0x21c)](_0x3297c9(0x1ba)),_0x337b1b&&console['error'](_0x3297c9(0x29d)));let _0x383f83;try{_0x383f83=await withSpinner(_0x3297c9(0x116),()=>_0x593488[_0x3297c9(0x218)][_0x3297c9(0x1cb)]({'sourceDir':_0x568d9d,'revision':_0x5dd10d,'skipValidation':_0x337b1b}),{'verbose':_0x16847d['verbose']});}catch(_0x119799){if(_0x119799 instanceof Error&&_0x119799['message'][_0x3297c9(0x168)](_0x3297c9(0x199)))return console[_0x3297c9(0x21c)](a54_0x4ee8b0['red'](_0x3297c9(0x22d)),_0x3297c9(0x1e2)),_0x16847d[_0x3297c9(0x13c)]?console[_0x3297c9(0x21c)](a54_0x4ee8b0['dim'](_0x3297c9(0x2ba)+_0x16847d[_0x3297c9(0x13c)]+_0x3297c9(0x1f5)+_0x16847d[_0x3297c9(0x13c)]+'\x27')):console[_0x3297c9(0x21c)](a54_0x4ee8b0[_0x3297c9(0x1ad)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x119799;}const _0xfeceb4=_0x383f83['data'];console[_0x3297c9(0x21c)](_0x3297c9(0x23a)+_0xfeceb4['projectName']),console['error'](_0x3297c9(0x2b6)+_0xfeceb4[_0x3297c9(0x1e6)]),console['error'](_0x3297c9(0x29e)+_0xfeceb4['revision']),console[_0x3297c9(0x21c)](_0x3297c9(0x2ae)+a54_0x4ee8b0['green']('+'+_0xfeceb4['summary'][_0x3297c9(0x214)]+_0x3297c9(0x117))+',\x20'+(a54_0x4ee8b0[_0x3297c9(0x292)]('~'+_0xfeceb4[_0x3297c9(0x297)][_0x3297c9(0x28d)]+_0x3297c9(0x175))+',\x20')+(a54_0x4ee8b0[_0x3297c9(0x1ca)]('-'+_0xfeceb4['summary'][_0x3297c9(0x259)]+_0x3297c9(0x20e))+',\x20')+(''+a54_0x4ee8b0[_0x3297c9(0x1ad)](_0xfeceb4[_0x3297c9(0x297)]['unchanged']+'\x20unchanged')));for(const _0x4df7e5 of _0xfeceb4[_0x3297c9(0x276)]){_0x4df7e5[_0x3297c9(0x2bd)]==='modified'&&_0x4df7e5[_0x3297c9(0x29f)]&&(console[_0x3297c9(0x21c)]('\x0a'+a54_0x4ee8b0[_0x3297c9(0x174)](_0x3297c9(0x26c)+_0x4df7e5[_0x3297c9(0x10d)])),console[_0x3297c9(0x21c)](_0x4df7e5['diff']));}if(!_0xfeceb4[_0x3297c9(0x296)])return console[_0x3297c9(0x21c)](a54_0x4ee8b0[_0x3297c9(0x24b)](_0x3297c9(0x251))),await this[_0x3297c9(0x1c0)](_0x593488,_0xfeceb4[_0x3297c9(0x1d5)],_0x16847d[_0x3297c9(0x26d)]),0x0;if(_0x16847d['dryRun'])return console[_0x3297c9(0x21c)](a54_0x4ee8b0[_0x3297c9(0x292)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x16847d[_0x3297c9(0x1dc)]){if(!isInteractive())return console[_0x3297c9(0x21c)](a54_0x4ee8b0['red'](_0x3297c9(0x228)),_0x3297c9(0x20c)),console[_0x3297c9(0x21c)](a54_0x4ee8b0[_0x3297c9(0x1ad)](_0x3297c9(0x28c))),0x1;const _0x10a591=await confirmKey(_0x3297c9(0x153));if(!_0x10a591)return console[_0x3297c9(0x21c)](a54_0x4ee8b0['yellow'](_0x3297c9(0x1b9)),_0x3297c9(0x2a9)),0x1;}const _0x17f525=await withSpinner(_0x3297c9(0x253),()=>_0x593488[_0x3297c9(0x218)]['executePushProject'](_0xfeceb4),{'verbose':_0x16847d['verbose']}),_0x537076=_0x17f525[_0x3297c9(0x27d)];return console[_0x3297c9(0x21c)](a54_0x4ee8b0[_0x3297c9(0x24b)](_0x3297c9(0x226))),console[_0x3297c9(0x21c)]('\x20\x20Project\x20ID:\x20'+_0x537076['projectId']),console[_0x3297c9(0x21c)](_0x3297c9(0x29e)+_0x537076[_0x3297c9(0x22c)]),await this[_0x3297c9(0x1c0)](_0x593488,_0x537076[_0x3297c9(0x1d5)],_0x16847d[_0x3297c9(0x26d)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x1aa);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x15e);async['execute'](_0x1699a6){const _0x36d98c=a54_0x33c6d3,{options:_0x2b4512,args:_0x46b200,tdx:_0x5cae56}=_0x1699a6,_0x1de761=this['resolveProjectDir'](_0x46b200,_0x2b4512),_0x489686=_0x2b4512[_0x36d98c(0x2b3)],_0x5a61b6=_0x2b4512[_0x36d98c(0x22c)],_0x570aa7=_0x2b4512[_0x36d98c(0x295)];if(!_0x1de761)return console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ca)](_0x36d98c(0x22d)),_0x36d98c(0x25c)),console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ad)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ad)](_0x36d98c(0x210))),0x1;if(!_0x489686)return console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ca)](_0x36d98c(0x22d)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x36d98c(0x21c)](a54_0x4ee8b0['dim'](_0x36d98c(0x128))),0x1;_0x2b4512[_0x36d98c(0x17e)]&&(console[_0x36d98c(0x21c)](_0x36d98c(0x1b8)+_0x1de761),console[_0x36d98c(0x21c)](_0x36d98c(0x26a)+_0x489686),_0x5a61b6&&console[_0x36d98c(0x21c)]('Revision:\x20'+_0x5a61b6),_0x2b4512['dryRun']&&console[_0x36d98c(0x21c)](_0x36d98c(0x1ba)),_0x570aa7&&console[_0x36d98c(0x21c)](_0x36d98c(0x29d)));const _0x1c2790=await withSpinner(_0x36d98c(0x272),()=>_0x5cae56[_0x36d98c(0x218)]['prepareCloneProject'](_0x1de761,_0x489686,{'revision':_0x5a61b6,'skipValidation':_0x570aa7}),{'verbose':_0x2b4512[_0x36d98c(0x17e)]}),_0x58a374=_0x1c2790['data'];console[_0x36d98c(0x21c)](_0x36d98c(0x140)+_0x58a374[_0x36d98c(0x1e6)]);_0x58a374[_0x36d98c(0x1ed)]&&console['error']('Source\x20project:\x20'+_0x58a374[_0x36d98c(0x1ed)]);console['error'](_0x36d98c(0x26a)+_0x58a374[_0x36d98c(0x12d)]),console[_0x36d98c(0x21c)](_0x36d98c(0x278)+_0x58a374[_0x36d98c(0x22c)]),console[_0x36d98c(0x21c)](_0x36d98c(0x172)+_0x58a374['fileCount']);_0x58a374[_0x36d98c(0x196)]&&(console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x292)](_0x36d98c(0x240)+_0x58a374[_0x36d98c(0x12d)]+_0x36d98c(0x212)+_0x58a374[_0x36d98c(0x28a)]+')')),console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x292)](_0x36d98c(0x157))));if(_0x2b4512[_0x36d98c(0x190)])return console[_0x36d98c(0x21c)](a54_0x4ee8b0['yellow']('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x2b4512[_0x36d98c(0x1dc)]){if(!isInteractive())return console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ca)](_0x36d98c(0x228)),_0x36d98c(0x20c)),console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x1ad)](_0x36d98c(0x28c))),0x1;const _0x2d56ec=_0x58a374[_0x36d98c(0x1ed)]||a54_0x5ab332[_0x36d98c(0x267)](_0x1de761),_0x5a8bea=_0x58a374[_0x36d98c(0x196)]?_0x36d98c(0x24c)+_0x489686+_0x36d98c(0x197):_0x36d98c(0x246)+_0x2d56ec+_0x36d98c(0x118)+_0x489686+'\x22?',_0xa721e6=await confirmKey(_0x5a8bea);if(!_0xa721e6)return console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x292)](_0x36d98c(0x1b9))),0x1;}const _0x545460=await withSpinner(_0x58a374[_0x36d98c(0x196)]?_0x36d98c(0x1e5)+_0x489686+_0x36d98c(0x12f):'Cloning\x20to\x20'+_0x489686+_0x36d98c(0x12f),()=>_0x5cae56['workflow'][_0x36d98c(0x13d)](_0x58a374),{'verbose':_0x2b4512[_0x36d98c(0x17e)]}),_0x1624a9=_0x545460[_0x36d98c(0x27d)];return console[_0x36d98c(0x21c)](a54_0x4ee8b0[_0x36d98c(0x24b)](_0x58a374[_0x36d98c(0x196)]?'✔\x20Project\x20updated':_0x36d98c(0x20f))),console[_0x36d98c(0x21c)](_0x36d98c(0x238)+_0x1624a9[_0x36d98c(0x12d)]),console[_0x36d98c(0x21c)](_0x36d98c(0x1c6)+_0x1624a9[_0x36d98c(0x11e)]),console['error'](_0x36d98c(0x29e)+_0x1624a9['revision']),await this[_0x36d98c(0x1c0)](_0x5cae56,_0x1624a9[_0x36d98c(0x12d)],_0x2b4512[_0x36d98c(0x26d)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a54_0x33c6d3(0x18c);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x12b);async[a54_0x33c6d3(0x2a6)](_0x2c3e16){const _0x1b7582=a54_0x33c6d3,{options:_0x5b74f3,args:_0x2205b0,tdx:_0x584e2b}=_0x2c3e16,_0x2768ed=_0x2205b0[0x0];if(!_0x2768ed)return console[_0x1b7582(0x21c)](_0x1b7582(0x200)),console[_0x1b7582(0x21c)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x5b74f3[_0x1b7582(0x17e)]&&console['error']('Project:\x20'+_0x2768ed);if(!_0x5b74f3['yes']){if(!isInteractive())return console['error'](a54_0x4ee8b0[_0x1b7582(0x1ca)]('\x0aError:'),_0x1b7582(0x20c)),console[_0x1b7582(0x21c)](a54_0x4ee8b0[_0x1b7582(0x1ad)](_0x1b7582(0x28c))),0x1;const _0x10af11=await confirmKey(_0x1b7582(0x219)+_0x2768ed+_0x1b7582(0x287));if(!_0x10af11)return console['error'](a54_0x4ee8b0[_0x1b7582(0x292)](_0x1b7582(0x1b9))),0x1;}const _0x30c66b=await withSpinner(_0x1b7582(0x221)+_0x2768ed+_0x1b7582(0x12f),()=>_0x584e2b[_0x1b7582(0x218)][_0x1b7582(0x15a)](_0x2768ed),{'verbose':_0x5b74f3['verbose']}),_0x116e3d=_0x30c66b['data'];return console[_0x1b7582(0x21c)](_0x1b7582(0x13a)+_0x116e3d[_0x1b7582(0x1d5)]),console[_0x1b7582(0x21c)](_0x1b7582(0x1c6)+_0x116e3d['projectId']),0x0;}}export function parseKeyValue(_0x56f4c1){const _0xf2a9a2=a54_0x33c6d3,_0x2e7eca=_0x56f4c1[_0xf2a9a2(0x206)]('=');if(_0x2e7eca===-0x1)throw new Error(_0xf2a9a2(0x1ab)+_0x56f4c1+_0xf2a9a2(0x1f3));const _0x2e79b2=_0x56f4c1[_0xf2a9a2(0x163)](0x0,_0x2e7eca),_0xc6a442=_0x56f4c1[_0xf2a9a2(0x163)](_0x2e7eca+0x1);if(!_0x2e79b2)throw new Error(_0xf2a9a2(0x1db));return{'key':_0x2e79b2,'value':_0xc6a442};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x258);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x21e);async[a54_0x33c6d3(0x2a6)](_0x440887){const _0x571c13=a54_0x33c6d3,{options:_0x50d331,args:_0x4932e1,tdx:_0x5220a1}=_0x440887,_0x1de70a=this[_0x571c13(0x18a)](_0x4932e1,_0x50d331);if(!_0x1de70a)return 0x1;_0x50d331[_0x571c13(0x17e)]&&console['error'](_0x571c13(0x1fb)+_0x1de70a);const _0x288d1d=await withSpinner(_0x571c13(0x20d),()=>_0x5220a1[_0x571c13(0x218)][_0x571c13(0x134)](_0x1de70a),{'verbose':_0x50d331[_0x571c13(0x17e)]}),{secrets:_0x3de02b}=_0x288d1d['data'];return console[_0x571c13(0x21c)](_0x571c13(0x194)+_0x3de02b[_0x571c13(0x241)]+_0x571c13(0x236)+(_0x3de02b[_0x571c13(0x241)]!==0x1?'s':'')),await handleSDKOutput(_0x3de02b,_0x50d331),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]='workflow:secrets:set';[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x11a);async['execute'](_0x2c55e0){const _0x196368=a54_0x33c6d3,{options:_0x567b08,args:_0x184dc8,tdx:_0x290240}=_0x2c55e0;let _0x2fc927,_0x5daafb;if(_0x184dc8[_0x196368(0x241)]>=0x1&&!_0x184dc8[0x0]['includes']('='))_0x2fc927=_0x184dc8[0x0],_0x5daafb=_0x184dc8['slice'](0x1);else{if(_0x184dc8[_0x196368(0x241)]>=0x1&&_0x567b08[_0x196368(0x13c)])_0x2fc927=_0x567b08[_0x196368(0x13c)],_0x5daafb=_0x184dc8;else return _0x184dc8[_0x196368(0x241)]>=0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x196368(0x21c)](_0x196368(0x1d6)),0x1):(console[_0x196368(0x21c)](_0x196368(0x1a9)),console[_0x196368(0x21c)](_0x196368(0x19c)),0x1);}if(_0x5daafb[_0x196368(0x241)]===0x0)return console[_0x196368(0x21c)](_0x196368(0x1a9)),console[_0x196368(0x21c)](_0x196368(0x19c)),0x1;const _0xbc294e={};try{for(const _0x3511f1 of _0x5daafb){const {key:_0x397f0c,value:_0x58cbda}=parseKeyValue(_0x3511f1);_0xbc294e[_0x397f0c]=_0x58cbda;}}catch(_0x36f90f){return _0x36f90f instanceof Error&&console[_0x196368(0x21c)](a54_0x4ee8b0[_0x196368(0x1ca)](_0x196368(0x22d)),_0x36f90f[_0x196368(0x176)]),0x1;}const _0x5efdfe=Object[_0x196368(0x113)](_0xbc294e);_0x567b08[_0x196368(0x17e)]&&(console[_0x196368(0x21c)]('Project:\x20'+_0x2fc927),console[_0x196368(0x21c)](_0x196368(0x181)+_0x5efdfe[_0x196368(0x2b4)](',\x20')));const _0x297e11=await withSpinner(_0x5efdfe[_0x196368(0x241)]===0x1?_0x196368(0x1ac):_0x196368(0x188)+_0x5efdfe[_0x196368(0x241)]+_0x196368(0x18d),()=>_0x290240[_0x196368(0x218)][_0x196368(0x29b)](_0x2fc927,_0xbc294e),{'verbose':_0x567b08[_0x196368(0x17e)]}),_0x3a7e78=_0x297e11[_0x196368(0x27d)];return console[_0x196368(0x21c)](_0x5efdfe[_0x196368(0x241)]===0x1?'✔\x20Secret\x20\x27'+_0x3a7e78[_0x196368(0x113)][0x0]+_0x196368(0x1f2)+_0x3a7e78[_0x196368(0x1d5)]+'\x27':'✔\x20'+_0x3a7e78['keys'][_0x196368(0x241)]+_0x196368(0x162)+_0x3a7e78['projectName']+'\x27'),(_0x567b08[_0x196368(0x124)]||_0x567b08['jsonl'])&&await handleSingleObjectOutput(_0x3a7e78,_0x567b08),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x33c6d3(0x2b3)]=a54_0x33c6d3(0x120);['description']=a54_0x33c6d3(0x17b);async['execute'](_0x1f5d84){const _0x24af17=a54_0x33c6d3,{options:_0x4a8e70,args:_0x5b0624,tdx:_0x3e94e2}=_0x1f5d84;let _0x190a87,_0x5955b9;if(_0x5b0624[_0x24af17(0x241)]>=0x2)_0x190a87=_0x5b0624[0x0],_0x5955b9=_0x5b0624[0x1];else{if(_0x5b0624['length']===0x1&&_0x4a8e70[_0x24af17(0x13c)])_0x190a87=_0x4a8e70[_0x24af17(0x13c)],_0x5955b9=_0x5b0624[0x0];else return _0x5b0624[_0x24af17(0x241)]===0x1?(console[_0x24af17(0x21c)](_0x24af17(0x1a2)),console[_0x24af17(0x21c)](_0x24af17(0x1d6)),0x1):(console[_0x24af17(0x21c)](_0x24af17(0x183)),console[_0x24af17(0x21c)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x4a8e70[_0x24af17(0x17e)]&&(console[_0x24af17(0x21c)](_0x24af17(0x1fb)+_0x190a87),console['error'](_0x24af17(0x227)+_0x5955b9));if(!_0x4a8e70['yes']){if(!isInteractive())return console[_0x24af17(0x21c)](a54_0x4ee8b0['red']('\x0aError:'),_0x24af17(0x20c)),console[_0x24af17(0x21c)](a54_0x4ee8b0[_0x24af17(0x1ad)](_0x24af17(0x28c))),0x1;const _0x34951b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5955b9+_0x24af17(0x1ec)+_0x190a87+'\x27?');if(!_0x34951b)return console[_0x24af17(0x21c)](a54_0x4ee8b0[_0x24af17(0x292)](_0x24af17(0x1b9))),0x1;}const _0x10342a=await withSpinner(_0x24af17(0x1b1),()=>_0x3e94e2[_0x24af17(0x218)][_0x24af17(0x293)](_0x190a87,_0x5955b9),{'verbose':_0x4a8e70[_0x24af17(0x17e)]}),_0xde7851=_0x10342a[_0x24af17(0x27d)];return console['error'](_0x24af17(0x150)+_0xde7851[_0x24af17(0x23b)]+_0x24af17(0x245)+_0xde7851['projectName']+'\x27'),(_0x4a8e70[_0x24af17(0x124)]||_0x4a8e70['jsonl'])&&await handleSingleObjectOutput(_0xde7851,_0x4a8e70),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(_0x45c9d8){const _0x51cfb3=a54_0x33c6d3,_0x4b065d=Math[_0x51cfb3(0x2aa)](_0x45c9d8/0x3e8),_0x577587=Math[_0x51cfb3(0x2aa)](_0x4b065d/0x3c),_0x5c73bf=Math[_0x51cfb3(0x2aa)](_0x577587/0x3c),_0x5682e1=Math['floor'](_0x5c73bf/0x18);if(_0x5682e1>0x0){const _0x4f03b5=_0x5c73bf%0x18;return _0x4f03b5>0x0?_0x5682e1+'d\x20'+_0x4f03b5+'h':_0x5682e1+'d';}else{if(_0x5c73bf>0x0){const _0x4130bb=_0x577587%0x3c;return _0x4130bb>0x0?_0x5c73bf+'h\x20'+_0x4130bb+'m':_0x5c73bf+'h';}else{if(_0x577587>0x0){const _0x5e169f=_0x4b065d%0x3c;return _0x5e169f>0x0?_0x577587+'m\x20'+_0x5e169f+'s':_0x577587+'m';}else return _0x4b065d+'s';}}}function formatTimestamp(_0x2f2a7f,_0xfb1c08){const _0x4ac804=a54_0x33c6d3,_0x36e861=new Date(_0x2f2a7f),_0x4764bf=String(_0x36e861[_0x4ac804(0x10a)]())[_0x4ac804(0x1b3)](0x2,'0'),_0x48d689=String(_0x36e861[_0x4ac804(0x2b2)]())['padStart'](0x2,'0'),_0x3ef831=_0x4764bf+':'+_0x48d689,_0x3eafea=_0x36e861[_0x4ac804(0x1c2)]()===_0xfb1c08[_0x4ac804(0x1c2)]()&&_0x36e861[_0x4ac804(0x269)]()===_0xfb1c08[_0x4ac804(0x269)]()&&_0x36e861['getDate']()===_0xfb1c08[_0x4ac804(0x1bc)]();if(_0x3eafea)return _0x3ef831;else{const _0x2458da=String(_0x36e861[_0x4ac804(0x269)]()+0x1)[_0x4ac804(0x1b3)](0x2,'0'),_0x46b301=String(_0x36e861[_0x4ac804(0x1bc)]())[_0x4ac804(0x1b3)](0x2,'0');return _0x2458da+'-'+_0x46b301+'\x20'+_0x3ef831;}}function formatDate(_0x39bd85){const _0x148832=a54_0x33c6d3,_0x368ce0=_0x39bd85['getFullYear'](),_0x5174c1=String(_0x39bd85[_0x148832(0x269)]()+0x1)[_0x148832(0x1b3)](0x2,'0'),_0x189213=String(_0x39bd85[_0x148832(0x1bc)]())[_0x148832(0x1b3)](0x2,'0');return _0x368ce0+'-'+_0x5174c1+'-'+_0x189213;}function a54_0xfb90(){const _0x1c4386=['Listing\x20workflow\x20attempts...','renderSingleTimeline','-\x20nothing\x20pushed','floor','split','→\x20Project:\x20','done','\x20\x20Changes:\x20','kill','icon','→\x20New\x20project:\x20','getMinutes','name','join','size','\x20\x20Source:\x20','startedAt','Parameters:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Tip:\x20cd\x20to\x20workflows/','From\x20task:\x20','navigateSessionsInteractive','type','getHours','window','No\x20matching\x20sessions\x20found','path','Start\x20a\x20workflow\x20run','limit','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20attempt','1510CHjtsm','keys','round','attempt:','Analyzing\x20changes...','\x20new','\x22\x20to\x20new\x20project\x20\x22','Total:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','✔\x20Pull\x20complete','\x20-\x20',',\x20Workflow:\x20','newProjectId','📁\x20','workflow:secrets:delete','✔\x20Workflow\x20project\x20context\x20cleared.','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','state','json','slice','session:','Using\x20attempt\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','replace','text','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x0aDry\x20run\x20-\x20no\x20files\x20written','newProjectName','MIN_LABEL_COUNT','...','tdx.json','Session\x20not\x20found:\x20','No\x20attempts\x20found\x20for:\x20','/attempt/','listSecrets','workflow:retry','targetDir','No\x20attempts\x20found','MAX_POLL_ITERATIONS','\x20\x20Session\x20context\x20set\x20to:\x20','✔\x20Deleted\x20project\x20','Getting\x20attempt\x20tasks...','workflowProject','executeCloneProject','match','pending','Source:\x20','pollTimeline','trim','workflow:logs','all','Listing\x20workflow\x20sessions...','from','duration','attemptId','fullName','unknown','max','4224801iNqdpR','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','end','renderTimeline','✔\x20Secret\x20\x27','Downloading\x20project\x20','2408496PfPkZa','\x0aPush\x20these\x20changes?','List\x20all\x20workflow\x20projects','Resume\x20from:\x20','resolveProject','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','tdx\x20wf\x20attempt\x20','autocomplete','delete','workflow:tasks','workflow:attempt','createdAt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','isNewProject','\x20(use\x20--limit\x20to\x20show\x20more)','\x20secrets\x20set\x20for\x20project\x20\x27','substring','\x20\x20Location:\x20','Retrying\x20session...','map','workflow:run','includes','resolveProjectId','Writing\x20files...','Getting\x20attempt\x20details...','log','/app/workflows/','Show\x20logs\x20for\x20a\x20workflow\x20attempt','projects','attempts','planned','Files\x20to\x20upload:\x20','trimEnd','cyan','\x20modified','message','isArray','sessionTime','Latest\x20session\x20has\x20no\x20attempt','follow','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','-\x20no\x20files\x20written','unchanged','verbose','Loading\x20session...','white','Secrets\x20to\x20set:\x20','stdout','Error:\x20Secret\x20key\x20is\x20required','title','blue','Filter:\x20project=','Attempt\x20ID:\x20','Setting\x20','\x20session','requireProject','workflow:projects','workflow:delete','\x20secrets...','Force:\x20yes','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','dryRun','2165334zbFZvg','Project\x20name\x20is\x20required','parse','✔\x20Found\x20','workflowName','targetExists','\x22\x20with\x20new\x20revision?','jsonl','No\x20workflow\x20tdx.json\x20found','LABEL_MIN_SPACING','run','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','param','✔\x20Workflow\x20project\x20set\x20to:\x20','Including\x20subtasks:\x20yes','format','toISOString','Error:\x20Project\x20name\x20is\x20required','Pulling\x20project\x20','retryAttemptName','18mmMNdx','filesExtracted','12EllLBi','lastAttempt','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','workflow:clone','Invalid\x20format:\x20','Setting\x20secret...','dim','isDirectory','MAX_TIMELINE_WIDTH','workflow:sessions','Deleting\x20secret...','Select\x20a\x20workflow\x20to\x20run','padStart','running','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','GUTTER','\x20has\x20no\x20attempts','Source\x20directory:\x20','Cancelled','Dry\x20run:\x20yes','group_error','getDate','workflow:upload','✔\x20Retry\x20started','list','showWorkflowConsoleUrl','\x20\x20Target:\x20','getFullYear','every','pullProject','425525ARcLcv','\x20\x20Project\x20ID:\x20','toLowerCase','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','download','red','preparePushProject','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','start','resumeFrom','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Project\x20filter:\x20','workflow:attempts','resolve','tasks','context','projectName','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','write','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Failed\x20to\x20fetch\x20attempt\x20data','now','Key\x20cannot\x20be\x20empty','yes','finishedAt','Pattern:\x20','filter','cancelRequested','session','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Output\x20directory:\x20','columns','Updating\x20','sourceDir','Reason:\x20','\x20task','project','TASK_NAME_WIDTH','Loading\x20sessions...','\x27\x20from\x20project\x20\x27','sourceProjectName','cwd','fill','updatedAt','startTime','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','.\x20Expected\x20format:\x20KEY=VALUE','✔\x20Workflow\x20run\x20started','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20is\x20not\x20a\x20directory','durationMs','No\x20sessions\x20found\x20in\x20project:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x27...','Project:\x20','\x20\x20Workflow:\x20','params','isTTY','🔄\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Kill\x20a\x20running\x20attempt','output','canceling','Killing\x20attempt...','total','indexOf','No\x20sessions\x20found','2236AqZMlp','parseProjectWorkflowPattern','List\x20workflows','workflow:timeline','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Listing\x20secrets...','\x20deleted','✔\x20Clone\x20complete','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','applyPullProject','\x22\x20already\x20exists\x20(ID:\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','new','select','utf-8','MIN_TIMELINE_WIDTH','workflow','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Error:\x20Invalid\x20parameter\x20format:\x20','value','error','taskName','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','set','stat','Deleting\x20project\x20','No\x20workflow\x20sessions\x20found','relative','generateSessionTimelineRows','/sessions/','✔\x20Push\x20complete','Key:\x20','\x0aError:','11GSesUp','workflows','26512CDVkoU','revision','Error:','splice','Expected\x20format:\x20--param\x20key=value','Error:\x20Invalid\x20JSON\x20in\x20--params','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','ICON_WIDTH','\x20tasks','\x1b[1A\x1b[2K','\x20\x20Session\x20ID:\x20','\x20secret','(use\x20--limit\x20to\x20see\x20more)','\x20\x20Project:\x20','\x20of\x20','✔\x20Project:\x20','key','Filter:\x20','List\x20workflow\x20execution\x20sessions','getTime','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x0a⚠\x20Project\x20\x22','length','workflow:download','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aClone\x20\x22','sys','\x20workflow','min','push','green','\x0aUpdate\x20existing\x20project\x20\x22','workflow:use','No\x20sessions\x20found\x20for:\x20','Downloading\x20logs...','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x0a✔\x20No\x20changes\x20to\x20push','sessions','Pushing\x20project...','stringify','success','projectId','renderSessionsTimeline','workflow:secrets:list','deleted','logFiles','Listing\x20workflows...','Source\x20directory\x20is\x20required','Loading\x20workflows...','repeat','session_id','Show\x20specific\x20attempt\x20details','buildTimelineData','⚠\x20Showing\x20first\x20','localeCompare','Usage:\x20tdx\x20wf\x20use\x20<project>','status','some','basename','No\x20attempts\x20found\x20in\x20project:\x20','getMonth','New\x20project\x20name:\x20','No\x20workflow\x20projects\x20found','---\x20','site','\x20logs','\x20to\x20see\x20detailed\x20logs','find','msPerChar','Analyzing\x20project...','description','values','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','changes','index','Revision:\x20','startsWith','Project\x20directory:\x20','reason','attempt','data','Pushing\x20workflow\x20project...','workflow:pull','📋\x20','rows','Retry\x20a\x20session\x20or\x20attempt','\x20from\x20session\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Starting\x20workflow\x20run...','Attempt:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','Auto-selected\x20latest\x20session:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','existingProjectId','MAX_TASKS_DISPLAY','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','modified','Session\x20','\x20\x20New\x20attempt\x20ID:\x20','Include\x20retried:\x20yes','task','yellow','deleteSecret','sessionId','skipValidation','hasChanges','summary','ICON_SPACING','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','sort','setSecrets','table','Validation:\x20skipped','\x20\x20Revision:\x20','diff','revision:\x20','\x20\x20Console:\x20','Status:\x20','4756810lZlEiG','clear','\x20unchanged','execute'];a54_0xfb90=function(){return _0x1c4386;};return a54_0xfb90();}function getTaskStateIcon(_0x4ab791){const _0x1741c8={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1741c8[_0x4ab791]||'⚪';}function getBarChar(_0x52db7b){const _0x208dec=a54_0x33c6d3;return _0x52db7b===_0x208dec(0x21c)||_0x52db7b==='group_error'?'×':'─';}function getBarColor(_0x131579){const _0x548d66=a54_0x33c6d3,_0x1c9f57={'success':a54_0x4ee8b0['green'],'error':a54_0x4ee8b0[_0x548d66(0x1ca)],'group_error':a54_0x4ee8b0[_0x548d66(0x1ca)],'running':a54_0x4ee8b0[_0x548d66(0x185)],'blocked':a54_0x4ee8b0[_0x548d66(0x292)],'planned':a54_0x4ee8b0[_0x548d66(0x1ad)],'canceling':a54_0x4ee8b0[_0x548d66(0x292)]};return _0x1c9f57[_0x131579]||a54_0x4ee8b0[_0x548d66(0x180)];}function parseTaskName(_0x268ce5){const _0x28ec8f=a54_0x33c6d3;let _0x34bd86=_0x268ce5[_0x28ec8f(0x129)](/^\++/,'');const _0xe6707=_0x34bd86[_0x28ec8f(0x2ab)]('+'),_0x50ee2e=_0xe6707['length']>0x1?_0xe6707['length']-0x2:0x0,_0x2b95b3=_0xe6707[_0xe6707[_0x28ec8f(0x241)]-0x1]||_0x34bd86;return{'level':_0x50ee2e,'name':'+'+_0x2b95b3};}function truncateTaskName(_0x393725,_0x26c139){const _0x2b5dfe=a54_0x33c6d3,_0x594f31=stringWidth(_0x393725);if(_0x594f31<=_0x26c139)return _0x393725;let _0x2eda91=_0x393725;while(stringWidth(_0x2eda91+'…')>_0x26c139&&_0x2eda91[_0x2b5dfe(0x241)]>0x0){_0x2eda91=_0x2eda91['slice'](0x0,-0x1);}return _0x2eda91+'…';}function calculateTimeScale(_0x5bae3c,_0x527f80){const _0x1bae34=a54_0x33c6d3;return{'startTime':_0x5bae3c[_0x1bae34(0x1cd)],'endTime':_0x5bae3c[_0x1bae34(0x14e)],'durationMs':_0x5bae3c[_0x1bae34(0x147)],'msPerChar':_0x5bae3c[_0x1bae34(0x147)]/_0x527f80};}function timeToPosition(_0x3dbf21,_0x3390c5,_0x1e6ea8){const _0x50eebc=a54_0x33c6d3,_0x54af82=_0x3dbf21-_0x3390c5['startTime'],_0x4cb47d=Math[_0x50eebc(0x2aa)](_0x54af82/_0x3390c5[_0x50eebc(0x271)]);return Math[_0x50eebc(0x14b)](0x0,Math[_0x50eebc(0x249)](_0x4cb47d,_0x1e6ea8));}function renderTimeAxis(_0x1c8a0f,_0x26b9bd){const _0x48557e=a54_0x33c6d3,_0x5a1d66=Math[_0x48557e(0x249)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x48557e(0x14b)](TIMELINE_CONFIG[_0x48557e(0x12e)],Math[_0x48557e(0x2aa)](_0x26b9bd/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x29b008=_0x1c8a0f[_0x48557e(0x1f7)]/(_0x5a1d66-0x1),_0x249a9f=new Date(_0x1c8a0f[_0x48557e(0x1f1)]),_0x41a7a1=[];for(let _0x46156a=0x0;_0x46156a<_0x5a1d66;_0x46156a++){const _0x579601=_0x1c8a0f[_0x48557e(0x1f1)]+_0x46156a*_0x29b008,_0x230c8c=timeToPosition(_0x579601,_0x1c8a0f,_0x26b9bd),_0x1aafc4=formatTimestamp(_0x579601,_0x249a9f);_0x41a7a1[_0x48557e(0x24a)]({'pos':_0x230c8c,'text':_0x1aafc4});}const _0x8d8cb3=new Array(_0x26b9bd)[_0x48557e(0x1ef)]('\x20');let _0x2049a0=-0x1;for(const {pos:_0x96c14d,text:_0x2abc59}of _0x41a7a1){let _0x1d6ffa=Math['max'](0x0,_0x96c14d-Math[_0x48557e(0x2aa)](_0x2abc59[_0x48557e(0x241)]/0x2));_0x1d6ffa<=_0x2049a0+TIMELINE_CONFIG[_0x48557e(0x19a)]&&(_0x1d6ffa=_0x2049a0+TIMELINE_CONFIG[_0x48557e(0x19a)]+0x1);_0x1d6ffa+_0x2abc59[_0x48557e(0x241)]>_0x26b9bd&&(_0x1d6ffa=_0x26b9bd-_0x2abc59['length']);if(_0x1d6ffa>=0x0&&_0x1d6ffa+_0x2abc59[_0x48557e(0x241)]<=_0x26b9bd&&_0x1d6ffa>_0x2049a0){for(let _0x5831fb=0x0;_0x5831fb<_0x2abc59[_0x48557e(0x241)];_0x5831fb++){_0x8d8cb3[_0x1d6ffa+_0x5831fb]=_0x2abc59[_0x5831fb];}_0x2049a0=_0x1d6ffa+_0x2abc59[_0x48557e(0x241)]-0x1;}}return _0x8d8cb3[_0x48557e(0x2b4)]('');}function renderTaskRow(_0x543416,_0x559327,_0x437bfa,_0x45d580){const _0x4b83c8=a54_0x33c6d3,{level:_0xe64c44,name:_0x2ef755}=parseTaskName(_0x543416[_0x4b83c8(0x2b3)]),_0x16c4d4='\x20'[_0x4b83c8(0x25e)](_0xe64c44),_0x3a8b03=_0x543416['window']?'('+formatElapsed(_0x543416[_0x4b83c8(0x10b)][_0x4b83c8(0x147)])+')':'',_0xb3317b=stringWidth(_0x3a8b03),_0x45803f=_0xe64c44*0x1,_0x74deb6=_0x45d580-_0x45803f-_0xb3317b-0x1,_0x4db66f=truncateTaskName(_0x2ef755,_0x74deb6),_0x2988b5=_0x16c4d4+_0x4db66f,_0x4d925c=stringWidth(_0x2988b5),_0x349047=_0x45d580-_0x4d925c-_0xb3317b,_0xb70a0e=_0x2988b5+'\x20'[_0x4b83c8(0x25e)](Math[_0x4b83c8(0x14b)](0x1,_0x349047))+a54_0x4ee8b0[_0x4b83c8(0x1ad)](_0x3a8b03),_0x24602c=getTaskStateIcon(_0x543416['state']),_0x15c662=new Array(_0x437bfa)[_0x4b83c8(0x1ef)]('\x20');if(_0x543416['window']){const _0x3ff157=timeToPosition(_0x543416['window'][_0x4b83c8(0x1cd)],_0x559327,_0x437bfa),_0x4cc4d0=timeToPosition(_0x543416['window'][_0x4b83c8(0x14e)],_0x559327,_0x437bfa),_0x52f40f=getBarChar(_0x543416[_0x4b83c8(0x123)]),_0x4854cd=Math[_0x4b83c8(0x14b)](_0x3ff157+0x1,_0x4cc4d0);for(let _0x275d4c=_0x3ff157;_0x275d4c<Math['min'](_0x4854cd,_0x437bfa);_0x275d4c++){_0x15c662[_0x275d4c]=_0x52f40f;}}const _0xc467a8=getBarColor(_0x543416[_0x4b83c8(0x123)]),_0x251d13=_0x15c662['map'](_0x2bf911=>_0x2bf911==='\x20'?'\x20':_0xc467a8(_0x2bf911))[_0x4b83c8(0x2b4)]('');return _0x24602c+'\x20'+_0xb70a0e+'│'+_0x251d13+'│';}function calculateStats(_0x50027d){const _0x28d6a3=a54_0x33c6d3,_0x344ee1={'total':_0x50027d[_0x28d6a3(0x241)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x611624 of _0x50027d){if(_0x611624[_0x28d6a3(0x123)]===_0x28d6a3(0x255))_0x344ee1[_0x28d6a3(0x255)]++;else{if(_0x611624[_0x28d6a3(0x123)]===_0x28d6a3(0x21c)||_0x611624['state']===_0x28d6a3(0x1bb))_0x344ee1[_0x28d6a3(0x21c)]++;else _0x611624[_0x28d6a3(0x123)]===_0x28d6a3(0x1b4)?_0x344ee1[_0x28d6a3(0x1b4)]++:_0x344ee1['pending']++;}}return _0x344ee1;}function formatStats(_0x12492b){const _0x35b6e0=a54_0x33c6d3;return[_0x35b6e0(0x119)+_0x12492b[_0x35b6e0(0x205)],'✅\x20'+_0x12492b[_0x35b6e0(0x255)],'❌\x20'+_0x12492b['error'],_0x35b6e0(0x1ff)+_0x12492b[_0x35b6e0(0x1b4)],'⏳\x20'+_0x12492b[_0x35b6e0(0x13f)]][_0x35b6e0(0x2b4)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x33c6d3(0x20b);[a54_0x33c6d3(0x273)]=a54_0x33c6d3(0x213);async['execute'](_0x153ff5){const _0x4fa5a5=a54_0x33c6d3,{options:_0x38d152,args:_0x46067b,tdx:_0x3c714b}=_0x153ff5;let _0x1426d7,_0x374c82,_0x16b6e4=![];if(_0x46067b[0x0]){if(_0x46067b[0x0][_0x4fa5a5(0x168)]('.')){const _0x11a080=this['parseProjectWorkflowPattern'](_0x46067b,_0x38d152);if(!_0x11a080)return 0x1;_0x1426d7=_0x11a080['projectName'],_0x374c82=_0x11a080[_0x4fa5a5(0x195)];}else{_0x374c82=_0x46067b[0x0],_0x1426d7=_0x38d152[_0x4fa5a5(0x13c)];if(!_0x1426d7)return console[_0x4fa5a5(0x21c)](a54_0x4ee8b0[_0x4fa5a5(0x1ca)](_0x4fa5a5(0x22d)),_0x4fa5a5(0x1cc)),0x1;_0x16b6e4=!![];}}else{const _0x137237=this['parseProjectWorkflowPattern'](_0x46067b,_0x38d152);if(!_0x137237)return 0x1;_0x1426d7=_0x137237[_0x4fa5a5(0x1d5)],_0x374c82=_0x137237[_0x4fa5a5(0x195)];}if(_0x38d152[_0x4fa5a5(0x17e)]){if(_0x1426d7&&_0x374c82)console['error'](_0x4fa5a5(0x23c)+_0x1426d7+'.'+_0x374c82);else _0x1426d7&&console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x186)+_0x1426d7);}const _0x54a310=_0x38d152[_0x4fa5a5(0x148)],_0x18801d=_0x38d152[_0x4fa5a5(0x294)];if(_0x54a310){_0x18801d&&console['error'](a54_0x4ee8b0[_0x4fa5a5(0x292)]('Warning:'),_0x4fa5a5(0x231));const _0x347567=_0x38d152['follow'];return _0x347567?await this[_0x4fa5a5(0x141)](_0x153ff5,_0x54a310):await this[_0x4fa5a5(0x2a8)](_0x153ff5,_0x54a310,_0x38d152),0x0;}if(_0x18801d){const _0x5f4692=await withSpinner(_0x4fa5a5(0x17f),()=>_0x3c714b['workflow'][_0x4fa5a5(0x252)]({'projectName':_0x1426d7,'workflowName':_0x374c82,'limit':0x64}),{'verbose':_0x38d152['verbose']}),_0x49765c=_0x5f4692['data'][_0x4fa5a5(0x270)](_0x4bda8d=>_0x4bda8d['id']===_0x18801d);if(!_0x49765c)return console['error'](a54_0x4ee8b0[_0x4fa5a5(0x1ca)]('Error:'),_0x4fa5a5(0x131)+_0x18801d),0x1;if(!_0x49765c['lastAttempt']?.['id'])return console['error'](a54_0x4ee8b0['red'](_0x4fa5a5(0x22d)),_0x4fa5a5(0x28e)+_0x18801d+_0x4fa5a5(0x1b7)),0x1;const _0x1a99ff=_0x49765c[_0x4fa5a5(0x1a8)]['id'];_0x38d152['verbose']&&console['error'](_0x4fa5a5(0x127)+_0x1a99ff+_0x4fa5a5(0x283)+_0x18801d);const _0x1fc479=_0x38d152[_0x4fa5a5(0x17a)];return _0x1fc479?await this['pollTimeline'](_0x153ff5,_0x1a99ff):await this[_0x4fa5a5(0x2a8)](_0x153ff5,_0x1a99ff,_0x38d152),0x0;}const _0x13fa93=await withSpinner(_0x4fa5a5(0x1eb),()=>_0x3c714b[_0x4fa5a5(0x218)][_0x4fa5a5(0x252)]({'projectName':_0x1426d7,'workflowName':_0x374c82,'limit':_0x38d152[_0x4fa5a5(0x10f)]||0x32}),{'verbose':_0x38d152[_0x4fa5a5(0x17e)]}),_0x5b563f=_0x13fa93['data'];if(_0x5b563f[_0x4fa5a5(0x241)]===0x0){if(_0x1426d7&&_0x374c82)console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x24e)+_0x1426d7+'.'+_0x374c82);else _0x1426d7?console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x1f8)+_0x1426d7):(console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x222)),console[_0x4fa5a5(0x21c)](a54_0x4ee8b0[_0x4fa5a5(0x1ad)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x5b563f[_0x4fa5a5(0x29a)]((_0x4f9dde,_0x184476)=>{const _0x24942f=_0x4fa5a5,_0x3f2164=_0x4f9dde[_0x24942f(0x178)]||'',_0x5af674=_0x184476[_0x24942f(0x178)]||'';return _0x5af674[_0x24942f(0x263)](_0x3f2164);});if(_0x38d152['json']||_0x38d152[_0x4fa5a5(0x198)])return await handleSDKOutput(_0x5b563f,_0x38d152),0x0;let _0x3d1563;if(_0x16b6e4){const _0x4aa9c7=_0x5b563f[0x0];if(!_0x4aa9c7['lastAttempt']?.['id'])return console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x179)),0x0;_0x3d1563=_0x4aa9c7[_0x4fa5a5(0x1a8)]['id'],_0x38d152[_0x4fa5a5(0x17e)]&&console[_0x4fa5a5(0x21c)](_0x4fa5a5(0x288)+_0x4aa9c7[_0x4fa5a5(0x178)]);}else{const _0xf48476=_0x5b563f[_0x4fa5a5(0x166)](_0x22529d=>{const _0x35bcad=_0x4fa5a5,_0x4313fe=getAttemptStatusDisplay(_0x22529d[_0x35bcad(0x1a8)]);return{'title':_0x22529d[_0x35bcad(0x1e9)]?.['name']+'.'+_0x22529d['workflow']?.[_0x35bcad(0x2b3)]+_0x35bcad(0x11c)+_0x22529d[_0x35bcad(0x178)]+'\x20'+_0x4313fe[_0x35bcad(0x2b0)],'value':_0x22529d['lastAttempt']?.['id']||'','description':_0x4313fe[_0x35bcad(0x12a)]};}),_0x34620b=await a54_0x253b2e({'type':_0x4fa5a5(0x215),'name':_0x4fa5a5(0x148),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0xf48476[_0x4fa5a5(0x1df)](_0x13e05e=>_0x13e05e[_0x4fa5a5(0x21b)]!=='')});if(!_0x34620b['attemptId'])return 0x0;_0x3d1563=_0x34620b[_0x4fa5a5(0x148)];}const _0x1dff2d=_0x38d152[_0x4fa5a5(0x17a)];return _0x1dff2d?await this[_0x4fa5a5(0x141)](_0x153ff5,_0x3d1563):await this[_0x4fa5a5(0x2a8)](_0x153ff5,_0x3d1563,_0x38d152),0x0;}async['renderSingleTimeline'](_0x2b3bfb,_0x44f541,_0x497c57){const _0x3f20f2=a54_0x33c6d3,{tdx:_0x82e08e}=_0x2b3bfb;let _0x3d872d,_0x53d560;try{[_0x3d872d,_0x53d560]=await Promise[_0x3f20f2(0x144)]([_0x82e08e[_0x3f20f2(0x218)][_0x3f20f2(0x27c)](_0x44f541),_0x82e08e['workflow'][_0x3f20f2(0x1d3)](_0x44f541,![])]);}catch(_0x290a36){console['error'](a54_0x4ee8b0[_0x3f20f2(0x1ca)](_0x3f20f2(0x1d9)));_0x497c57[_0x3f20f2(0x17e)]&&console[_0x3f20f2(0x21c)](_0x290a36);throw _0x290a36;}if(_0x497c57[_0x3f20f2(0x124)]||_0x497c57['jsonl']){const _0x70951f=this['buildTimelineData'](_0x3d872d,_0x53d560);await handleSDKOutput([_0x70951f],_0x497c57);return;}const _0x42a5e8=_0x82e08e[_0x3f20f2(0x1d4)][_0x3f20f2(0x26d)],_0xbe90f0=this[_0x3f20f2(0x14f)](_0x3d872d,_0x53d560,_0x42a5e8);console[_0x3f20f2(0x16c)](_0xbe90f0);}async[a54_0x33c6d3(0x141)](_0x3c7da3,_0x31c460){const _0x190eb4=a54_0x33c6d3,{tdx:_0x4d8bd0}=_0x3c7da3,_0x1879ca=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x25bd2d=TIMELINE_CONFIG[_0x190eb4(0x138)];let _0x2644b8=0x0;while(_0x2644b8<_0x25bd2d){process[_0x190eb4(0x182)][_0x190eb4(0x1fe)]&&process[_0x190eb4(0x182)][_0x190eb4(0x1d7)]('\x1bc');let _0x573ad7,_0x3beaea;try{[_0x573ad7,_0x3beaea]=await Promise[_0x190eb4(0x144)]([_0x4d8bd0[_0x190eb4(0x218)][_0x190eb4(0x27c)](_0x31c460),_0x4d8bd0[_0x190eb4(0x218)][_0x190eb4(0x1d3)](_0x31c460,![])]);}catch(_0x1f3ead){console[_0x190eb4(0x21c)](a54_0x4ee8b0[_0x190eb4(0x1ca)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x2644b8>0x0&&console[_0x190eb4(0x21c)](a54_0x4ee8b0[_0x190eb4(0x1ad)](_0x190eb4(0x1b5)+_0x2644b8));throw _0x1f3ead;}const _0x4a0334=_0x4d8bd0['context'][_0x190eb4(0x26d)],_0x281c5a=this[_0x190eb4(0x14f)](_0x573ad7,_0x3beaea,_0x4a0334);console['log'](_0x281c5a);const _0x311fb1=_0x573ad7[_0x190eb4(0x2ad)]&&_0x3beaea[_0x190eb4(0x1c3)](_0x2f4ef7=>_0x2f4ef7[_0x190eb4(0x123)]!==_0x190eb4(0x1b4)&&_0x2f4ef7[_0x190eb4(0x123)]!==_0x190eb4(0x171));if(_0x311fb1){console[_0x190eb4(0x21c)](a54_0x4ee8b0[_0x190eb4(0x24b)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a54_0x4ee8b0[_0x190eb4(0x1ad)]('\x0aPolling...\x20('+_0x2644b8*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x256d70=>setTimeout(_0x256d70,_0x1879ca)),_0x2644b8++;}_0x2644b8>=_0x25bd2d&&console[_0x190eb4(0x21c)](a54_0x4ee8b0[_0x190eb4(0x292)](_0x190eb4(0x299)));}[a54_0x33c6d3(0x14f)](_0x3525ac,_0x379747,_0x5745f8){const _0x35eb5f=a54_0x33c6d3,_0x1da3eb=[],_0x3e508c=TIMELINE_CONFIG[_0x35eb5f(0x1ea)],_0x13205b=0x5,_0x1f71c1=process[_0x35eb5f(0x182)][_0x35eb5f(0x1e4)]||0x78,_0x551a73=_0x1f71c1-_0x3e508c-_0x13205b,_0x11af5a=Math[_0x35eb5f(0x14b)](TIMELINE_CONFIG[_0x35eb5f(0x217)],Math[_0x35eb5f(0x249)](_0x551a73,TIMELINE_CONFIG[_0x35eb5f(0x1af)])),_0x3de957=new Date(_0x3525ac[_0x35eb5f(0x15d)])[_0x35eb5f(0x23e)](),_0x16ab73=_0x3525ac[_0x35eb5f(0x1dd)]?new Date(_0x3525ac['finishedAt'])['getTime']():Date['now'](),_0x44f04e={'start':_0x3de957,'end':_0x16ab73,'duration':_0x16ab73-_0x3de957},_0x49938f=new Map(),_0xdd8871=[];for(const _0x5a2ded of _0x379747){if(_0x5a2ded[_0x35eb5f(0x2b7)]){const _0x18913c=new Date(_0x5a2ded[_0x35eb5f(0x2b7)])[_0x35eb5f(0x23e)](),_0x565a86=_0x5a2ded[_0x35eb5f(0x1f0)]?new Date(_0x5a2ded['updatedAt'])[_0x35eb5f(0x23e)]():Date[_0x35eb5f(0x1da)](),_0x291b8e={'start':_0x18913c,'end':_0x565a86,'duration':_0x565a86-_0x18913c};_0x49938f[_0x35eb5f(0x21f)](_0x5a2ded['id'],_0x291b8e),_0xdd8871[_0x35eb5f(0x24a)]({'name':_0x5a2ded[_0x35eb5f(0x149)],'state':_0x5a2ded[_0x35eb5f(0x123)]||_0x35eb5f(0x14a),'window':_0x291b8e});}else _0xdd8871[_0x35eb5f(0x24a)]({'name':_0x5a2ded[_0x35eb5f(0x149)],'state':_0x5a2ded[_0x35eb5f(0x123)]||'planned','window':undefined});}_0xdd8871['sort']((_0x1253e3,_0x12560b)=>{const _0x46f5db=_0x35eb5f;if(!_0x1253e3[_0x46f5db(0x10b)])return 0x1;if(!_0x12560b[_0x46f5db(0x10b)])return-0x1;return _0x1253e3[_0x46f5db(0x10b)]['start']-_0x12560b['window'][_0x46f5db(0x1cd)];});const _0x13fbb2=_0xdd8871['length'],_0x54db50=_0x13fbb2>TIMELINE_CONFIG[_0x35eb5f(0x28b)];_0x54db50&&_0xdd8871[_0x35eb5f(0x22e)](TIMELINE_CONFIG[_0x35eb5f(0x28b)]);const _0x2560ef=calculateTimeScale(_0x44f04e,_0x11af5a),_0x38f612=_0x3525ac[_0x35eb5f(0x2ad)]?_0x3525ac[_0x35eb5f(0x255)]?a54_0x4ee8b0[_0x35eb5f(0x24b)](_0x35eb5f(0x255)):a54_0x4ee8b0[_0x35eb5f(0x1ca)](_0x35eb5f(0x21c)):a54_0x4ee8b0[_0x35eb5f(0x185)](_0x35eb5f(0x1b4)),_0x277842=_0x3525ac[_0x35eb5f(0x1e9)]?.['id'],_0x25b89e=_0x3525ac[_0x35eb5f(0x294)];let _0x43ce68;if(_0x277842&&_0x25b89e){const _0x538a44=getWorkflowAttemptUrl(_0x5745f8,_0x277842,_0x25b89e,_0x3525ac['id']);_0x43ce68=hyperlink(a54_0x4ee8b0[_0x35eb5f(0x1ad)](_0x3525ac['id']),_0x538a44);}else _0x43ce68=a54_0x4ee8b0[_0x35eb5f(0x1ad)](_0x3525ac['id']);_0x1da3eb[_0x35eb5f(0x24a)](_0x35eb5f(0x286)+_0x43ce68+_0x35eb5f(0x11c)+_0x38f612+'\x20-\x20'+formatElapsed(_0x44f04e['duration']));if(_0xdd8871[_0x35eb5f(0x241)]>0x0){const _0x21d67d=renderTimeAxis(_0x2560ef,_0x11af5a),_0x4ffb84=new Date(_0x44f04e[_0x35eb5f(0x1cd)]),_0x49c6b5=formatDate(_0x4ffb84),_0x1f8695=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x35eb5f(0x298)]+_0x3e508c,_0x58981c=_0x49c6b5[_0x35eb5f(0x1b3)](_0x1f8695),_0x3f75ec=a54_0x4ee8b0[_0x35eb5f(0x1ad)](_0x58981c);_0x1da3eb[_0x35eb5f(0x24a)](_0x3f75ec+'\x20'+_0x21d67d);for(const _0x7e82aa of _0xdd8871){_0x1da3eb[_0x35eb5f(0x24a)](renderTaskRow(_0x7e82aa,_0x2560ef,_0x11af5a,_0x3e508c));}const _0x437737=calculateStats(_0xdd8871);_0x1da3eb[_0x35eb5f(0x24a)](formatStats(_0x437737)),_0x54db50&&_0x1da3eb[_0x35eb5f(0x24a)](a54_0x4ee8b0[_0x35eb5f(0x292)](_0x35eb5f(0x262)+TIMELINE_CONFIG[_0x35eb5f(0x28b)]+_0x35eb5f(0x239)+_0x13fbb2+_0x35eb5f(0x233))),_0x1da3eb[_0x35eb5f(0x24a)](''),_0x1da3eb[_0x35eb5f(0x24a)](a54_0x4ee8b0['dim']('💡\x20Tip:\x20Use\x20')+(_0x35eb5f(0x158)+_0x3525ac['id']+_0x35eb5f(0x26e))+a54_0x4ee8b0[_0x35eb5f(0x1ad)](_0x35eb5f(0x26f)));}else _0x1da3eb[_0x35eb5f(0x24a)](_0x35eb5f(0x14d));return _0x1da3eb[_0x35eb5f(0x2b4)]('\x0a');}[a54_0x33c6d3(0x261)](_0x163cd3,_0x328676){const _0x60ac0a=a54_0x33c6d3,_0x3e371c=new Date(_0x163cd3[_0x60ac0a(0x15d)])['getTime'](),_0x59ceed=_0x163cd3[_0x60ac0a(0x1dd)]?new Date(_0x163cd3[_0x60ac0a(0x1dd)])[_0x60ac0a(0x23e)]():Date[_0x60ac0a(0x1da)](),_0x30a2b6=_0x59ceed-_0x3e371c,_0x23a2b2=[];for(const _0xb46261 of _0x328676){if(_0xb46261[_0x60ac0a(0x2b7)]){const _0x5e4497=new Date(_0xb46261[_0x60ac0a(0x2b7)])[_0x60ac0a(0x23e)](),_0xfe4fe8=_0xb46261['updatedAt']?new Date(_0xb46261['updatedAt'])[_0x60ac0a(0x23e)]():Date[_0x60ac0a(0x1da)]();_0x23a2b2[_0x60ac0a(0x24a)]({'name':_0xb46261[_0x60ac0a(0x149)],'state':_0xb46261[_0x60ac0a(0x123)]||_0x60ac0a(0x14a),'window':{'start':_0x5e4497,'end':_0xfe4fe8,'duration':_0xfe4fe8-_0x5e4497}});}else _0x23a2b2[_0x60ac0a(0x24a)]({'name':_0xb46261[_0x60ac0a(0x149)],'state':_0xb46261[_0x60ac0a(0x123)]||_0x60ac0a(0x171),'window':undefined});}const _0x43d7c4=calculateStats(_0x23a2b2);return{'attempt':{'id':_0x163cd3['id'],'status':_0x163cd3[_0x60ac0a(0x2ad)]?_0x163cd3['success']?_0x60ac0a(0x255):_0x60ac0a(0x21c):_0x60ac0a(0x1b4),'createdAt':_0x163cd3[_0x60ac0a(0x15d)],'finishedAt':_0x163cd3[_0x60ac0a(0x1dd)],'duration_ms':_0x30a2b6},'tasks':_0x23a2b2['map'](_0x3bab10=>({'name':_0x3bab10['name'],'state':_0x3bab10['state'],'startedAt':_0x3bab10['window']?new Date(_0x3bab10[_0x60ac0a(0x10b)]['start'])[_0x60ac0a(0x1a1)]():null,'updatedAt':_0x3bab10[_0x60ac0a(0x10b)]?new Date(_0x3bab10[_0x60ac0a(0x10b)][_0x60ac0a(0x14e)])[_0x60ac0a(0x1a1)]():null,'duration_ms':_0x3bab10['window']?.['duration']||null})),'stats':_0x43d7c4};}}
1
+ const a54_0x2cd64f=a54_0x1c09;(function(_0x9f59c1,_0x390114){const _0x350c52=a54_0x1c09,_0x2c0078=_0x9f59c1();while(!![]){try{const _0x599084=-parseInt(_0x350c52(0x266))/0x1+parseInt(_0x350c52(0x230))/0x2*(parseInt(_0x350c52(0x25f))/0x3)+-parseInt(_0x350c52(0x26b))/0x4*(-parseInt(_0x350c52(0x2d3))/0x5)+-parseInt(_0x350c52(0x2d9))/0x6*(parseInt(_0x350c52(0x2b8))/0x7)+parseInt(_0x350c52(0x151))/0x8*(parseInt(_0x350c52(0x2a5))/0x9)+-parseInt(_0x350c52(0x27d))/0xa+parseInt(_0x350c52(0x285))/0xb;if(_0x599084===_0x390114)break;else _0x2c0078['push'](_0x2c0078['shift']());}catch(_0x2e1eac){_0x2c0078['push'](_0x2c0078['shift']());}}}(a54_0x52df,0xcac14));import a54_0x22d6d4 from'chalk';import{existsSync}from'fs';import a54_0x49f5e from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0xbf6bfc from'prompts';function getAttemptStatusDisplay(_0x5dd4e2){const _0x5ee1f6=a54_0x1c09;if(!_0x5dd4e2)return{'icon':'⏳','text':''};const {done:_0x45d643,success:_0x53914c,cancelRequested:_0x3f1d86}=_0x5dd4e2;if(!_0x45d643)return _0x3f1d86?{'icon':'🛑','text':a54_0x22d6d4[_0x5ee1f6(0x1d6)](_0x5ee1f6(0x1cb))}:{'icon':'🔄','text':a54_0x22d6d4[_0x5ee1f6(0x176)]('running')};if(_0x53914c)return{'icon':'✅','text':a54_0x22d6d4[_0x5ee1f6(0x145)](_0x5ee1f6(0x197))};return{'icon':'❌','text':a54_0x22d6d4[_0x5ee1f6(0x297)](_0x5ee1f6(0x29e))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x2cd64f(0x28e)](_0xca1c34,_0x524d95,_0x3f144d=0x0){return _0xca1c34[_0x3f144d]||_0x524d95['workflowProject'];}['requireProject'](_0x5612be,_0x20472b,_0x4ba1e0=0x0){const _0x57b043=a54_0x2cd64f,_0x53cd29=this[_0x57b043(0x28e)](_0x5612be,_0x20472b,_0x4ba1e0);if(!_0x53cd29)return console[_0x57b043(0x29e)](a54_0x22d6d4['red'](_0x57b043(0x1ae)),'Project\x20name\x20is\x20required'),console[_0x57b043(0x29e)](a54_0x22d6d4[_0x57b043(0x149)](_0x57b043(0x1ee))),null;return _0x53cd29;}['parseProjectWorkflowPattern'](_0x50d45e,_0x205933){const _0x475a91=a54_0x2cd64f;if(_0x50d45e[0x0]){const _0x5d27a4=_0x50d45e[0x0][_0x475a91(0x1d5)]('.');if(_0x5d27a4[_0x475a91(0x289)]===0x1)return{'projectName':_0x5d27a4[0x0],'workflowName':undefined};else return _0x5d27a4['length']===0x2?{'projectName':_0x5d27a4[0x0],'workflowName':_0x5d27a4[0x1]}:(console[_0x475a91(0x29e)](a54_0x22d6d4[_0x475a91(0x297)](_0x475a91(0x1ae)),_0x475a91(0x196)),null);}return{'projectName':_0x205933[_0x475a91(0x22f)],'workflowName':undefined};}['resolveProjectDir'](_0x36e642,_0x4baa76,_0x5470dd=0x0){const _0x2bb7d1=a54_0x2cd64f;if(_0x36e642[_0x5470dd])return _0x36e642[_0x5470dd];if(_0x4baa76[_0x2bb7d1(0x22f)]){const _0x2ae8f8=a54_0x49f5e[_0x2bb7d1(0x184)](process['cwd'](),_0x2bb7d1(0x13f),_0x4baa76['workflowProject']);if(existsSync(a54_0x49f5e[_0x2bb7d1(0x184)](_0x2ae8f8,_0x2bb7d1(0x281))))return _0x2ae8f8;}return undefined;}async[a54_0x2cd64f(0x29d)](_0x1a5c40,_0x358e37,_0x568d9a){const _0x2f0a14=a54_0x2cd64f;try{const _0xb94cb7=await _0x1a5c40['workflow']['workflows'](_0x358e37,{'limit':0x1});if(_0xb94cb7[_0x2f0a14(0x289)]>0x0){const _0x32f5c4=_0xb94cb7[0x0]['id'],_0x4a2a8b=getWorkflowUrl(_0x568d9a,_0x32f5c4);console[_0x2f0a14(0x29e)](_0x2f0a14(0x1c3)+a54_0x22d6d4[_0x2f0a14(0x159)](_0x4a2a8b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x222);[a54_0x2cd64f(0x167)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a54_0x2cd64f(0x223)](_0x1fa99b){const _0x5efbb4=a54_0x2cd64f,{options:_0x5d171c,args:_0x22c60e,tdx:_0x157b1d}=_0x1fa99b,_0x496a9a=_0x22c60e[0x0],_0x1fdd74=_0x5d171c[_0x5efbb4(0x177)];if(_0x1fdd74)return saveSessionContext({'workflow_project':undefined},_0x5d171c[_0x5efbb4(0x218)]),console['log'](a54_0x22d6d4[_0x5efbb4(0x145)](_0x5efbb4(0x267))),0x0;if(!_0x496a9a)return console['error'](a54_0x22d6d4['red'](_0x5efbb4(0x1ae)),'Project\x20name\x20is\x20required'),console[_0x5efbb4(0x29e)](a54_0x22d6d4['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x5efbb4(0x29e)](a54_0x22d6d4[_0x5efbb4(0x149)](_0x5efbb4(0x296))),0x1;const _0x540df5=await withSpinner(_0x5efbb4(0x290)+_0x496a9a+_0x5efbb4(0x1aa),()=>_0x157b1d[_0x5efbb4(0x199)][_0x5efbb4(0x28b)](_0x496a9a),{'verbose':_0x5d171c[_0x5efbb4(0x20a)]}),{name:_0x154a07}=_0x540df5[_0x5efbb4(0x1e5)];return saveSessionContext({'workflow_project':_0x154a07},_0x5d171c[_0x5efbb4(0x218)]),console['log'](a54_0x22d6d4['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x22d6d4[_0x5efbb4(0x159)](_0x154a07))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x2cd64f(0x181);['description']=a54_0x2cd64f(0x2a8);async[a54_0x2cd64f(0x223)](_0xef7567){const _0x2c7b5d=a54_0x2cd64f,{options:_0x2b8d97,args:_0x3cfd2b,tdx:_0x21eff4}=_0xef7567,_0x333783=_0x3cfd2b[0x0];_0x2b8d97[_0x2c7b5d(0x20a)]&&_0x333783&&console[_0x2c7b5d(0x29e)](_0x2c7b5d(0x2be)+_0x333783);const _0x18e607=await withSpinner(_0x2c7b5d(0x14c),()=>_0x21eff4['workflow'][_0x2c7b5d(0x27f)](_0x333783,{'limit':_0x2b8d97[_0x2c7b5d(0x24a)]}),{'verbose':_0x2b8d97[_0x2c7b5d(0x20a)]});let _0x3494db=_0x18e607[_0x2c7b5d(0x1e5)];_0x3494db[_0x2c7b5d(0x19b)]((_0x37db90,_0x23f8bf)=>_0x37db90[_0x2c7b5d(0x131)][_0x2c7b5d(0x2b4)](_0x23f8bf['name']));const _0xb3d7c9=_0x2b8d97['limit']||0x64,_0x100f42=_0x3494db[_0x2c7b5d(0x289)]>=_0xb3d7c9?a54_0x22d6d4[_0x2c7b5d(0x149)](_0x2c7b5d(0x134)):'';console[_0x2c7b5d(0x29e)](_0x2c7b5d(0x125)+_0x3494db[_0x2c7b5d(0x289)]+_0x2c7b5d(0x18b)+(_0x3494db[_0x2c7b5d(0x289)]!==0x1?'s':'')+_0x100f42);if(_0x2b8d97[_0x2c7b5d(0x183)]==='json'||_0x2b8d97[_0x2c7b5d(0x183)]===_0x2c7b5d(0x2c6)||_0x2b8d97[_0x2c7b5d(0x183)]==='table')await handleSDKOutput(_0x3494db,_0x2b8d97);else{if(_0x3494db[_0x2c7b5d(0x289)]===0x0)_0x333783?console['log'](_0x2c7b5d(0x2a2)+_0x333783):console[_0x2c7b5d(0x188)](_0x2c7b5d(0x201));else{const _0x50e2af=_0x3494db[_0x2c7b5d(0x245)](_0x3cd21c=>{const _0x518edb=_0x2c7b5d,_0x1a43e8=_0x3cd21c[_0x518edb(0x248)]?.[_0x518edb(0x283)](_0x5034c6=>_0x5034c6[_0x518edb(0x2a0)]===_0x518edb(0x227)),_0x38fa59=_0x1a43e8?a54_0x22d6d4['dim']('\x20(system)'):'';return _0x518edb(0x262)+_0x3cd21c[_0x518edb(0x131)]+_0x38fa59;});await writeOutput(_0x50e2af[_0x2c7b5d(0x184)]('\x0a'),_0x2b8d97[_0x2c7b5d(0x25b)],_0x2c7b5d(0x1ff));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a54_0x2cd64f(0x27e);['description']=a54_0x2cd64f(0x147);async[a54_0x2cd64f(0x223)](_0x257789){const _0x330cdb=a54_0x2cd64f,{options:_0x3c3355,args:_0x4aadbc,tdx:_0x36bd43}=_0x257789,_0xbcc175=this['resolveProject'](_0x4aadbc,_0x3c3355);_0x3c3355['verbose']&&_0xbcc175&&console[_0x330cdb(0x29e)]('Project\x20filter:\x20'+_0xbcc175);const _0xdb7460=await withSpinner(_0x330cdb(0x142),()=>_0x36bd43[_0x330cdb(0x199)][_0x330cdb(0x13f)](_0xbcc175,{'limit':_0x3c3355[_0x330cdb(0x24a)]}),{'verbose':_0x3c3355[_0x330cdb(0x20a)]});let _0x5ef525=_0xdb7460[_0x330cdb(0x1e5)];_0x5ef525[_0x330cdb(0x19b)]((_0x9edf3a,_0x4c6cab)=>{const _0x4c9c14=_0x330cdb,_0x5ed6e8=_0x9edf3a[_0x4c9c14(0x131)]['localeCompare'](_0x4c6cab[_0x4c9c14(0x131)]);if(_0x5ed6e8!==0x0)return _0x5ed6e8;return(_0x9edf3a[_0x4c9c14(0x241)]?.[_0x4c9c14(0x131)]||'')[_0x4c9c14(0x2b4)](_0x4c6cab[_0x4c9c14(0x241)]?.[_0x4c9c14(0x131)]||'');});const _0x46ec70=_0x3c3355[_0x330cdb(0x24a)]||0x64,_0x2fd484=_0x5ef525['length']>=_0x46ec70?a54_0x22d6d4['dim'](_0x330cdb(0x134)):'';console[_0x330cdb(0x29e)](_0x330cdb(0x125)+_0x5ef525['length']+_0x330cdb(0x128)+(_0x5ef525[_0x330cdb(0x289)]!==0x1?'s':'')+_0x2fd484);if(_0x3c3355['format']===_0x330cdb(0x175)||_0x3c3355[_0x330cdb(0x183)]==='jsonl'||_0x3c3355['format']===_0x330cdb(0x1a0))await handleSDKOutput(_0x5ef525,_0x3c3355);else{if(_0x5ef525[_0x330cdb(0x289)]===0x0)_0xbcc175?console[_0x330cdb(0x188)](_0x330cdb(0x24d)+_0xbcc175):console['log'](_0x330cdb(0x16a));else{const _0x309733=_0x3c3355['site'],_0x581384=_0x5ef525[_0x330cdb(0x245)](_0x21e13d=>{const _0x1313aa=_0x330cdb,_0x28fff0=a54_0x22d6d4[_0x1313aa(0x149)]('#'+_0x21e13d['id']),_0x21dec5=hyperlink(_0x28fff0,getWorkflowUrl(_0x309733,_0x21e13d['id'])),_0xb9f6ed=_0x21e13d[_0x1313aa(0x241)]?.['name']?a54_0x22d6d4[_0x1313aa(0x149)]('\x20('+_0x21e13d[_0x1313aa(0x241)][_0x1313aa(0x131)]+')'):'';return _0x1313aa(0x133)+_0x21dec5+'\x20'+_0x21e13d[_0x1313aa(0x131)]+_0xb9f6ed;});await writeOutput(_0x581384[_0x330cdb(0x184)]('\x0a'),_0x3c3355[_0x330cdb(0x25b)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x1f2);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x2af);async['execute'](_0xdcfce0){const _0x32f139=a54_0x2cd64f,{options:_0x23d400,args:_0xd01aa7,tdx:_0x4c96fc}=_0xdcfce0,_0x156e1c=this[_0x32f139(0x15f)](_0xd01aa7,_0x23d400);if(!_0x156e1c)return 0x1;const {projectName:_0x49ae32,workflowName:_0x24e4f0}=_0x156e1c;if(_0x23d400[_0x32f139(0x20a)]){if(_0x49ae32&&_0x24e4f0)console[_0x32f139(0x29e)](_0x32f139(0x1f8)+_0x49ae32+'.'+_0x24e4f0);else _0x49ae32&&console[_0x32f139(0x29e)]('Filter:\x20project='+_0x49ae32);const _0x325df0=_0x23d400[_0x32f139(0x29c)];_0x325df0&&console['error']('Status:\x20'+_0x325df0);}let _0x18355f=0x28;if(process[_0x32f139(0x25e)][_0x32f139(0x265)]&&!_0x23d400[_0x32f139(0x25b)]&&!_0x23d400[_0x32f139(0x183)]){const _0x23e758=process['stdout'][_0x32f139(0x28f)]||0x28;_0x18355f=Math[_0x32f139(0x123)](0x14,Math[_0x32f139(0x180)](_0x23e758*0x2/0x3));}const _0x41eb63=_0x23d400['limit']||_0x18355f,_0x129f13=await withSpinner(_0x32f139(0x24e),()=>_0x4c96fc[_0x32f139(0x199)][_0x32f139(0x272)]({'projectName':_0x49ae32,'workflowName':_0x24e4f0,'status':_0x23d400['status'],'fromTime':_0x23d400[_0x32f139(0x270)],'toTime':_0x23d400['to'],'limit':_0x41eb63}),{'verbose':_0x23d400[_0x32f139(0x20a)]}),_0x1503ef=_0x129f13[_0x32f139(0x1e5)];_0x1503ef['sort']((_0x1c739f,_0x122707)=>{const _0x56b997=_0x32f139,_0x1c35e5=_0x1c739f[_0x56b997(0x1ea)]||'',_0x456cc1=_0x122707[_0x56b997(0x1ea)]||'';return _0x456cc1['localeCompare'](_0x1c35e5);});_0x1503ef[_0x32f139(0x289)]>=_0x41eb63?console[_0x32f139(0x29e)](_0x32f139(0x2d2)+_0x1503ef['length']+'\x20sessions\x20'+a54_0x22d6d4[_0x32f139(0x149)](_0x32f139(0x236))):console[_0x32f139(0x29e)](_0x32f139(0x125)+_0x1503ef[_0x32f139(0x289)]+'\x20session'+(_0x1503ef['length']!==0x1?'s':''));if(_0x23d400['format']===_0x32f139(0x175)||_0x23d400[_0x32f139(0x183)]===_0x32f139(0x2c6)||_0x23d400[_0x32f139(0x183)]===_0x32f139(0x1a0))await handleSDKOutput(_0x1503ef,_0x23d400);else{if(!process[_0x32f139(0x25e)][_0x32f139(0x265)]||_0x23d400[_0x32f139(0x25b)]){if(_0x1503ef[_0x32f139(0x289)]===0x0){if(_0x49ae32&&_0x24e4f0)console[_0x32f139(0x188)](_0x32f139(0x2c1)+_0x49ae32+'.'+_0x24e4f0);else _0x49ae32?console['log'](_0x32f139(0x282)+_0x49ae32):console[_0x32f139(0x188)](_0x32f139(0x14e));}else{const _0x29ca70=_0x23d400[_0x32f139(0x298)],_0x126a80=this[_0x32f139(0x194)](_0x1503ef,_0x29ca70);_0x23d400[_0x32f139(0x25b)]?await writeOutput(_0x126a80,_0x23d400[_0x32f139(0x25b)],_0x32f139(0x1ff)):console[_0x32f139(0x188)](_0x126a80);}!_0x49ae32&&(console[_0x32f139(0x29e)](''),console[_0x32f139(0x29e)](a54_0x22d6d4[_0x32f139(0x149)](_0x32f139(0x22d))),console['error'](a54_0x22d6d4[_0x32f139(0x149)](_0x32f139(0x2b0))+'or'+a54_0x22d6d4[_0x32f139(0x149)](_0x32f139(0x179))));}else{if(_0x1503ef[_0x32f139(0x289)]===0x0){if(_0x49ae32&&_0x24e4f0)console[_0x32f139(0x188)]('No\x20sessions\x20found\x20for:\x20'+_0x49ae32+'.'+_0x24e4f0);else _0x49ae32?console[_0x32f139(0x188)](_0x32f139(0x282)+_0x49ae32):console[_0x32f139(0x188)](_0x32f139(0x14e));}else await this[_0x32f139(0x269)](_0x1503ef,_0xdcfce0,_0x49ae32);}}return 0x0;}[a54_0x2cd64f(0x194)](_0x3ab2ab,_0x3e3cd2){const _0x4900c3=a54_0x2cd64f,_0x580995=[],_0x37eea2=new Map();let _0x3761a2=Infinity,_0x47ef47=-Infinity;for(const _0x4aa297 of _0x3ab2ab){if(_0x4aa297[_0x4900c3(0x29a)]?.[_0x4900c3(0x215)]){const _0x5ae4d0=new Date(_0x4aa297[_0x4900c3(0x29a)][_0x4900c3(0x215)])['getTime'](),_0x1a9c1c=_0x4aa297[_0x4900c3(0x29a)][_0x4900c3(0x20f)]?new Date(_0x4aa297[_0x4900c3(0x29a)][_0x4900c3(0x20f)])[_0x4900c3(0x20d)]():Date[_0x4900c3(0x2ab)](),_0x5c0a09=_0x4aa297['project']?.[_0x4900c3(0x131)]||_0x4900c3(0x2d8);!_0x37eea2[_0x4900c3(0x2cb)](_0x5c0a09)&&_0x37eea2[_0x4900c3(0x257)](_0x5c0a09,[]),_0x37eea2[_0x4900c3(0x190)](_0x5c0a09)[_0x4900c3(0x2a3)]({'session':_0x4aa297,'startTime':_0x5ae4d0,'endTime':_0x1a9c1c,'duration':_0x1a9c1c-_0x5ae4d0}),_0x3761a2=Math[_0x4900c3(0x228)](_0x3761a2,_0x5ae4d0),_0x47ef47=Math[_0x4900c3(0x123)](_0x47ef47,_0x1a9c1c);}}if(_0x37eea2['size']===0x0)return _0x4900c3(0x16f);const _0x2ff0d8=process[_0x4900c3(0x25e)][_0x4900c3(0x26d)]||0x78,_0x1a1782=0x1e,_0x16a8e9=0x32,_0x2fa31f=0x4,_0x475cf4=Math['min'](_0x16a8e9,Math[_0x4900c3(0x123)](_0x1a1782,Math['floor'](_0x2ff0d8*0.3))),_0x5ab025=_0x2ff0d8-_0x475cf4-TIMELINE_CONFIG[_0x4900c3(0x273)]-0x3-_0x2fa31f,_0x28b62c=_0x47ef47-_0x3761a2,_0xf67662=_0x28b62c/_0x475cf4,_0x2f0712=renderTimeAxis({'startTime':_0x3761a2,'endTime':_0x47ef47,'durationMs':_0x28b62c,'msPerChar':_0xf67662},_0x475cf4),_0x4ca95d=[];for(const _0x59f49f of _0x37eea2['values']()){_0x4ca95d[_0x4900c3(0x2a3)](..._0x59f49f);}_0x4ca95d[_0x4900c3(0x19b)]((_0x338d2e,_0x4e2ec4)=>_0x4e2ec4['startTime']-_0x338d2e[_0x4900c3(0x1e7)]);const _0x10454b=new Date(_0x3761a2),_0x506a8f=formatDate(_0x10454b),_0x6b9184=_0x2fa31f+TIMELINE_CONFIG[_0x4900c3(0x144)]+TIMELINE_CONFIG['ICON_SPACING']+_0x5ab025,_0x282d17='\x20'[_0x4900c3(0x243)](_0x6b9184-_0x506a8f[_0x4900c3(0x289)]),_0x211cb5=_0x282d17+a54_0x22d6d4['dim'](_0x506a8f)+'\x20'+_0x2f0712;_0x580995['push'](_0x211cb5);const _0x1f7991=0x16;let _0x535c8a=0x0;for(const _0x2e7b1f of _0x4ca95d){const _0x275993=_0x2e7b1f[_0x4900c3(0x218)][_0x4900c3(0x241)]?.[_0x4900c3(0x131)]||'?',_0x56469b=Math[_0x4900c3(0x228)](stringWidth(_0x275993),_0x1f7991);_0x535c8a=Math[_0x4900c3(0x123)](_0x535c8a,_0x56469b);}for(const _0x39e162 of _0x4ca95d){const {session:_0x2a7e3e,startTime:_0x24de22,endTime:_0x2de8a8,duration:_0x202801}=_0x39e162,_0x2dca00=_0x2a7e3e[_0x4900c3(0x241)]?.['id'],_0x596446=_0x2a7e3e['id'],_0x31ac3f=_0x2a7e3e[_0x4900c3(0x241)]?.[_0x4900c3(0x131)]||'?',_0x8179ad=_0x2a7e3e[_0x4900c3(0x199)]?.[_0x4900c3(0x131)]||'?';let _0x529d7a,_0x50a1e6;if(_0x2a7e3e[_0x4900c3(0x29a)]){const _0x25ff4a=_0x2a7e3e[_0x4900c3(0x29a)];!_0x25ff4a[_0x4900c3(0x1d7)]?(_0x529d7a=_0x25ff4a[_0x4900c3(0x256)]?'🛑':'🔄',_0x50a1e6=_0x25ff4a[_0x4900c3(0x256)]?a54_0x22d6d4[_0x4900c3(0x1d6)]:a54_0x22d6d4[_0x4900c3(0x176)]):(_0x529d7a=_0x25ff4a[_0x4900c3(0x197)]?'✅':'❌',_0x50a1e6=_0x25ff4a['success']?a54_0x22d6d4[_0x4900c3(0x145)]:a54_0x22d6d4['red']);}else _0x529d7a='⏳',_0x50a1e6=a54_0x22d6d4['dim'];const _0x26bda2='#'+_0x596446,_0x3457d7=_0x2dca00?hyperlink(_0x26bda2,getWorkflowSessionUrl(_0x3e3cd2,_0x2dca00,_0x596446)):_0x26bda2;let _0x4e9b67=_0x31ac3f;stringWidth(_0x31ac3f)>_0x1f7991&&(_0x4e9b67=_0x31ac3f[_0x4900c3(0x1ba)](0x0,_0x1f7991-0x1)+'…');const _0x1bcb34=a54_0x22d6d4[_0x4900c3(0x149)](_0x4e9b67),_0x27ed37=stringWidth(_0x4e9b67),_0x48a895='\x20'[_0x4900c3(0x243)](_0x535c8a-stringWidth(_0x4e9b67)+0x2),_0x4ec415='('+formatElapsed(_0x202801)+')',_0x5bda9e=stringWidth(_0x4ec415),_0x53f777=stringWidth(_0x26bda2),_0x3aaff6=_0x53f777+0x1+_0x27ed37+_0x48a895[_0x4900c3(0x289)],_0x367439=_0x5ab025-_0x3aaff6-_0x5bda9e-0x1-0x8;let _0x5b40db=_0x8179ad;stringWidth(_0x5b40db)>_0x367439&&(_0x5b40db=_0x5b40db[_0x4900c3(0x1ba)](0x0,_0x367439-0x1)+'…');const _0x36fc40=_0x3457d7+'\x20'+_0x1bcb34+_0x48a895+_0x5b40db,_0x4abdb3=stringWidth(_0x36fc40),_0x4693f5=_0x5ab025-_0x4abdb3-_0x5bda9e,_0x361d97=_0x36fc40+'\x20'[_0x4900c3(0x243)](Math[_0x4900c3(0x123)](0x1,_0x4693f5))+a54_0x22d6d4[_0x4900c3(0x149)](_0x4ec415),_0x1a7ee4=Math[_0x4900c3(0x180)]((_0x24de22-_0x3761a2)/_0xf67662),_0x2eaf82=Math[_0x4900c3(0x180)]((_0x2de8a8-_0x3761a2)/_0xf67662),_0xbae08d=Math[_0x4900c3(0x123)](_0x1a7ee4+0x1,_0x2eaf82),_0x549234=new Array(_0x475cf4)['fill']('\x20');for(let _0x5e9a88=_0x1a7ee4;_0x5e9a88<Math[_0x4900c3(0x228)](_0xbae08d,_0x475cf4);_0x5e9a88++){_0x549234[_0x5e9a88]='─';}const _0x590f29=_0x549234['map'](_0x39a799=>_0x39a799==='\x20'?'\x20':_0x50a1e6(_0x39a799))[_0x4900c3(0x184)]('');_0x580995[_0x4900c3(0x2a3)](_0x529d7a+'\x20'+_0x361d97+'│'+_0x590f29+'│');}return _0x580995[_0x4900c3(0x184)]('\x0a');}async[a54_0x2cd64f(0x269)](_0xa140e2,_0x51412a,_0x843235){const _0x3f269e=a54_0x2cd64f,{options:_0x3aee71,tdx:_0x148e3e}=_0x51412a,_0x112869=_0x3aee71[_0x3f269e(0x298)],{timelineRows:_0x87d705,timeAxisHeader:_0x3dcff1}=this[_0x3f269e(0x1bc)](_0xa140e2,_0x112869),_0x29b794=_0x87d705[_0x3f269e(0x299)](_0x23a53b=>_0x23a53b[_0x3f269e(0x20c)]);if(_0x29b794[_0x3f269e(0x289)]===0x0){const _0x4b8eff=this['renderSessionsTimeline'](_0xa140e2,_0x112869);console[_0x3f269e(0x188)](_0x4b8eff);!_0x843235&&(console[_0x3f269e(0x29e)](''),console[_0x3f269e(0x29e)](a54_0x22d6d4[_0x3f269e(0x149)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a54_0x22d6d4['dim'](_0x3f269e(0x2b0))+'or'+a54_0x22d6d4[_0x3f269e(0x149)](_0x3f269e(0x179))));return;}_0x3dcff1&&console['log'](_0x3dcff1);const _0x16ea14=_0x87d705[_0x3f269e(0x299)](_0x405727=>_0x405727['attemptId'])[_0x3f269e(0x245)](_0x38cc3f=>({'title':_0x38cc3f[_0x3f269e(0x14f)],'value':_0x38cc3f['attemptId']})),_0x4ae877=process[_0x3f269e(0x25e)][_0x3f269e(0x28f)]||0x3c,_0x17a1ed=Math[_0x3f269e(0x123)](0x28,Math['floor'](_0x4ae877*0x2/0x3)),_0x348864=await a54_0xbf6bfc({'type':_0x3f269e(0x1b6),'name':_0x3f269e(0x20c),'message':_0x3f269e(0x16b),'choices':_0x16ea14,'initial':-0x1,'limit':_0x17a1ed,'clearFirst':!![],'fallback':{'title':_0x3f269e(0x24c),'value':null},'suggest':(_0x2a8f63,_0x406adc)=>{const _0x7e399e=_0x3f269e;if(!_0x2a8f63)return Promise[_0x7e399e(0x1b4)](_0x406adc);const _0x22c985=_0x406adc['filter'](_0x1243f9=>{const _0xe1a496=_0x7e399e,_0x361130=_0x1243f9;return _0x361130[_0xe1a496(0x1d4)]['toLowerCase']()[_0xe1a496(0x2d5)](_0x2a8f63['toLowerCase']());});return Promise[_0x7e399e(0x1b4)](_0x22c985);}}),_0x26495a=()=>{const _0x534a91=_0x3f269e;process[_0x534a91(0x25e)][_0x534a91(0x139)](_0x534a91(0x292)),process[_0x534a91(0x25e)]['write'](_0x534a91(0x292)),process[_0x534a91(0x25e)][_0x534a91(0x139)](_0x534a91(0x292));},_0x49f5e5=_0x348864&&_0x348864[_0x3f269e(0x20c)]&&_0x348864[_0x3f269e(0x20c)]!==null&&_0x348864[_0x3f269e(0x20c)][_0x3f269e(0x17f)]()!=='';if(!_0x49f5e5){_0x26495a(),console[_0x3f269e(0x188)](a54_0x22d6d4[_0x3f269e(0x149)]('Cancelled'));return;}_0x26495a();const _0x1be71d=_0xa140e2[_0x3f269e(0x240)](_0x2efabf=>_0x2efabf[_0x3f269e(0x29a)]?.['id']===_0x348864[_0x3f269e(0x20c)]);if(_0x1be71d){const _0x16daa4=_0x1be71d[_0x3f269e(0x241)]?.['name']||'?',_0x2936b5=_0x1be71d[_0x3f269e(0x199)]?.['name']||'?';console[_0x3f269e(0x188)](_0x3f269e(0x26e)+a54_0x22d6d4['dim'](_0x16daa4)+_0x3f269e(0x2a9)+a54_0x22d6d4[_0x3f269e(0x149)](_0x2936b5));}const _0x2a04a2=new WorkflowTimelineCommand();await _0x2a04a2[_0x3f269e(0x223)]({'args':[],'options':{..._0x3aee71,'attemptId':_0x348864[_0x3f269e(0x20c)]},'tdx':_0x148e3e});}[a54_0x2cd64f(0x1bc)](_0xe47c35,_0x35edad){const _0x3b6c73=a54_0x2cd64f,_0x1c1196=new Map();for(const _0x5e0f6c of _0xe47c35){_0x5e0f6c['id']&&_0x5e0f6c['lastAttempt']?.['id']&&_0x1c1196[_0x3b6c73(0x257)](_0x5e0f6c['id'],_0x5e0f6c['lastAttempt']['id']);}const _0xc9573a=[];let _0xe3ab94='';const _0x2e7139=this[_0x3b6c73(0x194)](_0xe47c35,_0x35edad),_0x246010=_0x2e7139[_0x3b6c73(0x1d5)]('\x0a');for(const _0x2b89ff of _0x246010){if(_0x2b89ff[_0x3b6c73(0x1c4)](_0x3b6c73(0x162))||_0x2b89ff[_0x3b6c73(0x28d)](/^\s+\d{4}-\d{2}-\d{2}/))_0xe3ab94=_0x2b89ff;else{if(_0x2b89ff[_0x3b6c73(0x28d)](/^[✅❌🔄🛑⏳]/)){const _0xe60bcb=_0x2b89ff[_0x3b6c73(0x28d)](/#(\d+)/),_0xf6fbf0=_0xe60bcb?_0xe60bcb[0x1]:null,_0x3634ed=_0xf6fbf0?_0x1c1196[_0x3b6c73(0x190)](_0xf6fbf0)||null:null,_0x427f68=_0xe47c35['find'](_0x2c749b=>_0x2c749b['id']===_0xf6fbf0),_0x13d5c3=_0x427f68?.[_0x3b6c73(0x241)]?.[_0x3b6c73(0x131)]||'';_0xc9573a[_0x3b6c73(0x2a3)]({'displayLine':_0x2b89ff,'attemptId':_0x3634ed,'projectName':_0x13d5c3});}}}return{'timelineRows':_0xc9573a,'timeAxisHeader':_0xe3ab94};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x1f5);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x12e);async[a54_0x2cd64f(0x223)](_0x188b70){const _0x104d96=a54_0x2cd64f,{options:_0x22cd0d,args:_0x57881b,tdx:_0x4c8cf1}=_0x188b70,_0x3e2e3e=this[_0x104d96(0x15f)](_0x57881b,_0x22cd0d);if(!_0x3e2e3e)return 0x1;const {projectName:_0x24601b,workflowName:_0x287c11}=_0x3e2e3e,_0x3a9ebd=_0x22cd0d[_0x104d96(0x178)];if(_0x22cd0d[_0x104d96(0x20a)]){if(_0x24601b&&_0x287c11)console['error'](_0x104d96(0x1f8)+_0x24601b+'.'+_0x287c11);else _0x24601b&&console[_0x104d96(0x29e)]('Filter:\x20project='+_0x24601b);_0x3a9ebd&&console[_0x104d96(0x29e)]('Include\x20retried:\x20yes');}const _0x123526=await withSpinner(_0x104d96(0x19a),()=>_0x4c8cf1[_0x104d96(0x199)][_0x104d96(0x200)]({'projectName':_0x24601b,'workflowName':_0x287c11,'includeRetried':_0x3a9ebd,'limit':_0x22cd0d['limit']}),{'verbose':_0x22cd0d[_0x104d96(0x20a)]}),_0x4c3239=_0x123526[_0x104d96(0x1e5)],_0x34ac21=_0x22cd0d['limit']||0x64,_0x11ea92=_0x4c3239[_0x104d96(0x289)]>=_0x34ac21?a54_0x22d6d4['dim'](_0x104d96(0x134)):'';console[_0x104d96(0x29e)](_0x104d96(0x125)+_0x4c3239[_0x104d96(0x289)]+_0x104d96(0x28c)+(_0x4c3239[_0x104d96(0x289)]!==0x1?'s':'')+_0x11ea92);if(_0x22cd0d[_0x104d96(0x183)]==='json'||_0x22cd0d[_0x104d96(0x183)]===_0x104d96(0x2c6)||_0x22cd0d[_0x104d96(0x183)]===_0x104d96(0x1a0))await handleSDKOutput(_0x4c3239,_0x22cd0d);else{if(_0x4c3239[_0x104d96(0x289)]===0x0){if(_0x24601b&&_0x287c11)console[_0x104d96(0x188)](_0x104d96(0x27a)+_0x24601b+'.'+_0x287c11);else _0x24601b?console[_0x104d96(0x188)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x24601b):console['log']('No\x20attempts\x20found');}else{const _0x410583=_0x22cd0d[_0x104d96(0x298)],_0x437b2d=_0x4c3239[_0x104d96(0x245)](_0x22aaca=>{const _0x2abb41=_0x104d96,_0x330319=a54_0x22d6d4[_0x2abb41(0x149)]('#'+_0x22aaca['id']),_0x360468=_0x22aaca[_0x2abb41(0x241)]?.['id'],_0x421885=_0x22aaca[_0x2abb41(0x21f)]||_0x22aaca[_0x2abb41(0x1a9)],_0x1590c3=_0x360468&&_0x421885?hyperlink(_0x330319,getWorkflowAttemptUrl(_0x410583,_0x360468,_0x421885,_0x22aaca['id'])):_0x330319,{icon:_0x4f2f7c,text:_0x48bffd}=getAttemptStatusDisplay(_0x22aaca),_0x1fab0f=(_0x22aaca[_0x2abb41(0x241)]?.['name']||'?')+'.'+(_0x22aaca[_0x2abb41(0x199)]?.[_0x2abb41(0x131)]||'?'),_0x2c18b6=_0x22aaca[_0x2abb41(0x1ea)]?a54_0x22d6d4[_0x2abb41(0x149)](_0x22aaca[_0x2abb41(0x1ea)]):'';return(_0x1590c3+'\x20'+_0x4f2f7c+(_0x48bffd?'\x20'+_0x48bffd:'')+'\x20'+_0x1fab0f+'\x20'+_0x2c18b6)[_0x2abb41(0x1f7)]();});await writeOutput(_0x437b2d[_0x104d96(0x184)]('\x0a'),_0x22cd0d[_0x104d96(0x25b)],_0x104d96(0x1ff));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x2c3);['description']=a54_0x2cd64f(0x13a);async['execute'](_0x4b3cf8){const _0x2df1d9=a54_0x2cd64f,{options:_0x32a03c,args:_0x48c5ec,tdx:_0x79fd54}=_0x4b3cf8,_0x427c1d=_0x48c5ec[0x0];if(!_0x427c1d)return console[_0x2df1d9(0x29e)](_0x2df1d9(0x221)),0x1;_0x32a03c[_0x2df1d9(0x20a)]&&console[_0x2df1d9(0x29e)](_0x2df1d9(0x2c5)+_0x427c1d);const _0x4d3079=await withSpinner(_0x2df1d9(0x1b3),()=>_0x79fd54[_0x2df1d9(0x199)][_0x2df1d9(0x293)](_0x427c1d),{'verbose':_0x32a03c[_0x2df1d9(0x20a)]}),_0x22dbab=_0x4d3079[_0x2df1d9(0x1e5)];let _0xcd40a5;!_0x22dbab[_0x2df1d9(0x1d7)]?_0xcd40a5=_0x22dbab[_0x2df1d9(0x256)]?_0x2df1d9(0x1cb):_0x2df1d9(0x1f0):_0xcd40a5=_0x22dbab['success']?_0x2df1d9(0x197):_0x2df1d9(0x29e);let _0x3469cb;if(_0x22dbab[_0x2df1d9(0x215)]&&_0x22dbab[_0x2df1d9(0x20f)]){const _0x52fc68=new Date(_0x22dbab[_0x2df1d9(0x215)])['getTime'](),_0x186e77=new Date(_0x22dbab['finishedAt'])['getTime']();_0x3469cb=Math['round']((_0x186e77-_0x52fc68)/0x3e8);}const _0x1a8976={'attempt_id':_0x22dbab['id'],'status':_0xcd40a5,..._0x22dbab[_0x2df1d9(0x284)]!==undefined&&{'index':_0x22dbab[_0x2df1d9(0x284)]},..._0x22dbab[_0x2df1d9(0x241)]&&{'project':_0x22dbab['project'][_0x2df1d9(0x131)]},..._0x22dbab['workflow']&&{'workflow':_0x22dbab[_0x2df1d9(0x199)][_0x2df1d9(0x131)]},..._0x22dbab[_0x2df1d9(0x1a9)]&&{'session_id':_0x22dbab[_0x2df1d9(0x1a9)]},..._0x22dbab[_0x2df1d9(0x1ea)]&&{'session_time':_0x22dbab['sessionTime']},..._0x22dbab[_0x2df1d9(0x2d6)]&&{'retry_attempt':_0x22dbab[_0x2df1d9(0x2d6)]},..._0x3469cb!==undefined&&{'duration_sec':_0x3469cb},..._0x22dbab['createdAt']&&{'created_at':_0x22dbab['createdAt']},..._0x22dbab[_0x2df1d9(0x20f)]&&{'finished_at':_0x22dbab[_0x2df1d9(0x20f)]},...Object[_0x2df1d9(0x140)](_0x22dbab[_0x2df1d9(0x1a4)])['length']>0x0&&{'params':_0x22dbab[_0x2df1d9(0x1a4)]}};return await handleSingleObjectOutput(_0x1a8976,_0x32a03c),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x21d);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x14a);async[a54_0x2cd64f(0x223)](_0x2d65f8){const _0x5828ef=a54_0x2cd64f,{options:_0x527625,args:_0xede4f9,tdx:_0xef582c}=_0x2d65f8,_0x30753b=_0xede4f9[0x0];if(!_0x30753b)return console['error'](_0x5828ef(0x221)),0x1;const _0xfbbbea=_0x527625['includeSubtasks'];_0x527625[_0x5828ef(0x20a)]&&(console[_0x5828ef(0x29e)](_0x5828ef(0x2c5)+_0x30753b),_0xfbbbea&&console[_0x5828ef(0x29e)](_0x5828ef(0x138)));const _0x2d9f1b=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0xef582c['workflow']['tasks'](_0x30753b,_0xfbbbea||![]),{'verbose':_0x527625[_0x5828ef(0x20a)]}),_0x3d3257=_0x2d9f1b[_0x5828ef(0x1e5)];return console['error'](_0x5828ef(0x125)+_0x3d3257[_0x5828ef(0x289)]+_0x5828ef(0x25a)+(_0x3d3257[_0x5828ef(0x289)]!==0x1?'s':'')),await handleSDKOutput(_0x3d3257,_0x527625),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x250);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x279);async['execute'](_0x21acbb){const _0x559c69=a54_0x2cd64f,{options:_0x4f30ad,args:_0x24c626,tdx:_0x2c83eb}=_0x21acbb,_0x34bd12=_0x24c626[0x0];let _0x26a98c=_0x24c626[0x1];if(!_0x34bd12)return console[_0x559c69(0x29e)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x4f30ad[_0x559c69(0x20a)]&&(console[_0x559c69(0x29e)]('Attempt\x20ID:\x20'+_0x34bd12),_0x26a98c&&console[_0x559c69(0x29e)]('Task\x20name:\x20'+_0x26a98c));const _0xb9968a=await withSpinner(_0x559c69(0x1c9),()=>_0x2c83eb[_0x559c69(0x199)]['logFiles'](_0x34bd12,_0x26a98c),{'verbose':_0x4f30ad['verbose']}),_0x4fd57c=_0xb9968a[_0x559c69(0x1e5)];if(_0x4fd57c['length']===0x0)return console[_0x559c69(0x29e)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x26a98c&&(_0x4f30ad[_0x559c69(0x175)]||_0x4f30ad['format']))return await handleSDKOutput(_0x4fd57c,_0x4f30ad),0x0;if(!_0x26a98c){const _0x49df61=_0x4fd57c[_0x559c69(0x245)](_0x3953cc=>({'title':_0x3953cc[_0x559c69(0x2a7)]+'\x20('+formatBytes(_0x3953cc[_0x559c69(0x2b3)])+')','value':_0x3953cc[_0x559c69(0x2a7)]})),_0x54c5fb=await a54_0xbf6bfc({'type':_0x559c69(0x15c),'name':'task','message':_0x559c69(0x209),'choices':_0x49df61});if(!_0x54c5fb[_0x559c69(0x1ca)])return console[_0x559c69(0x29e)](_0x559c69(0x17e)),0x0;_0x26a98c=_0x54c5fb['task'];}const _0x121a13=await withSpinner(_0x559c69(0x2ac),()=>_0x2c83eb[_0x559c69(0x199)][_0x559c69(0x263)](_0x34bd12,_0x26a98c),{'verbose':_0x4f30ad['verbose']}),_0x39d3d1=_0x121a13[_0x559c69(0x1e5)];return _0x39d3d1?console['log'](_0x39d3d1):console[_0x559c69(0x29e)](_0x559c69(0x2b5)),0x0;}}function a54_0x52df(){const _0x2b6bf6=['autocomplete','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Analyzing\x20changes...','slice','\x20of\x20','generateSessionTimelineRows','✔\x20Downloaded\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','skipValidation','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Loading\x20workflows...','unchanged','\x20\x20Console:\x20','startsWith','Session\x20','Target\x20directory:\x20','delete','Parameters:\x20','Fetching\x20log\x20files...','task','canceling','Error:\x20Project\x20name\x20is\x20required','workflow:timeline','resolveProjectDir','workflow:secrets:set','---\x20','\x20\x20Project\x20ID:\x20','context','/app/workflows/','title','split','yellow','done','Force:\x20yes','Attempt:\x20','attempt:','modified','relative','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22\x20already\x20exists\x20(ID:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','setSecrets','requireProject','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Loading\x20session...','getMonth','data','Target:\x20','startTime','getHours','\x20unchanged','sessionTime','\x20\x20Source:\x20','Key:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','total','running','Key\x20cannot\x20be\x20empty','workflow:sessions','group_error','\x20secret','workflow:attempts','MAX_TIMELINE_WIDTH','trimEnd','Filter:\x20','Resume\x20from:\x20','\x0aPolling...\x20(','Project\x20directory:\x20','Source:\x20','Listing\x20secrets...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','list','attempts','No\x20workflow\x20projects\x20found','\x20logs','\x0a⚠\x20Project\x20\x22','changes','dryRun','Latest\x20session\x20has\x20no\x20attempt','\x22\x20to\x20new\x20project\x20\x22','MIN_TIMELINE_WIDTH','Select\x20a\x20task\x20to\x20view\x20logs:','verbose','unknown','attemptId','getTime','✔\x20Retry\x20started','finishedAt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Total:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','projectId','/sessions/','createdAt','Kill\x20a\x20running\x20attempt','fromTask','session','/attempt/','startedAt','TASK_NAME_WIDTH','Tip:\x20cd\x20to\x20workflows/','workflow:tasks','-\x20nothing\x20pushed','session_id','Revision:\x20','Error:\x20Attempt\x20ID\x20is\x20required','workflow:use','execute','Project\x20name\x20is\x20required','Error:\x20Secret\x20key\x20is\x20required','revision:\x20','sys','min','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','workflow:upload','new','✔\x20Project\x20updated','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','planned','workflowProject','208108XzLTOq','state','workflow:download','path','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','(use\x20--limit\x20to\x20see\x20more)','toISOString','end','isDirectory','cwd','Killing\x20attempt...','MIN_LABEL_COUNT','MAX_TASKS_DISPLAY','\x20new','buildTimelineData','find','project','newProjectName','repeat','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','map','\x20deleted','Start\x20a\x20workflow\x20run','metadata','\x20\x20Session\x20ID:\x20','limit','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20matching\x20sessions\x20found','No\x20workflows\x20found\x20in\x20project:\x20','Listing\x20workflow\x20sessions...','Files\x20to\x20upload:\x20','workflow:logs','message','workflowName','getMinutes','Invalid\x20format:\x20','padStart','cancelRequested','set','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20tasks','\x20task','output','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aUpdate\x20existing\x20project\x20\x22','stdout','3OwsQzA','Auto-selected\x20latest\x20session:\x20','Reason:\x20','📁\x20','logs','✔\x20Pull\x20complete','isTTY','1471648ysmKqO','✔\x20Workflow\x20project\x20context\x20cleared.','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','navigateSessionsInteractive','✔\x20Secret\x20\x27','108gYHJUp','type','columns','Project:\x20','tdx\x20wf\x20attempt\x20','from','Retrying\x20attempt...','sessions','GUTTER','fullName','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:kill','start','white','Show\x20logs\x20for\x20a\x20workflow\x20attempt','No\x20attempts\x20found\x20for:\x20','durationMs','updatedAt','8245770Ysycaz','workflow:workflows','projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','tdx.json','No\x20sessions\x20found\x20in\x20project:\x20','some','index','20001047mLSHbz','MAX_LABEL_COUNT','MAX_POLL_ITERATIONS','💡\x20Tip:\x20Use\x20','length','Setting\x20','resolveProjectId','\x20attempt','match','resolveProject','rows','Resolving\x20project\x20\x27','diff','\x1b[1A\x1b[2K','attempt','Deleting\x20project\x20','existingProjectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','red','site','filter','lastAttempt','\x0a✔\x20Already\x20up\x20to\x20date','status','showWorkflowConsoleUrl','error','\x20to\x20see\x20detailed\x20logs','key','replace','No\x20projects\x20match\x20pattern:\x20','push','ICON_SPACING','91062cfBKZA','Usage:\x20workflow:delete\x20<project-name-or-id>','taskName','List\x20all\x20workflow\x20projects',',\x20Workflow:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','now','Downloading\x20logs...','Writing\x20files...','renderTimeline','List\x20workflow\x20execution\x20sessions','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','executePushProject','fileSize','localeCompare','No\x20log\x20content\x20found','Validation:\x20skipped','\x20secrets...','4829111GGvnyb','run','Failed\x20to\x20fetch\x20attempt\x20data','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','duration','Pattern:\x20','Project\x20name:\x20','Deleting\x20secret...','No\x20sessions\x20found\x20for:\x20','\x20\x20Files\x20extracted:\x20','workflow:attempt','msPerChar','Attempt\x20ID:\x20','jsonl','\x20\x20Revision:\x20','Updating\x20','preparePushProject','sourceDir','has','Cloning\x20to\x20','stringify','⚠\x20Showing\x20first\x20','revision','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','isNewProject','✔\x20Showing\x20','288955SgLmMS','listSecrets','includes','retryAttemptName','\x20\x20Changes:\x20','(unknown)','6KMxxJe','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','max','hasChanges','✔\x20Found\x20','Pushing\x20project...','getFullYear','\x20workflow','LABEL_MIN_SPACING','targetDir','isArray','Output\x20directory:\x20','readFile','List\x20workflow\x20attempts','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','name','\x20\x20Project:\x20','📋\x20','\x20(use\x20--limit\x20to\x20show\x20more)','-\x20no\x20files\x20written','POLL_INTERVAL_MS','getDate','Including\x20subtasks:\x20yes','write','Show\x20specific\x20attempt\x20details','→\x20Project:\x20','\x20\x20New\x20attempt\x20ID:\x20','\x27\x20from\x20project\x20\x27','summary','workflows','keys','targetExists','Listing\x20workflows...','Dry\x20run:\x20yes','ICON_WIDTH','green','Loading\x20sessions...','List\x20workflows','retrySession','dim','Show\x20tasks\x20for\x20an\x20attempt','tasks','Listing\x20workflow\x20projects...','...','No\x20sessions\x20found','displayLine','\x22\x20with\x20new\x20revision?','264kyivJT','parse','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','pollTimeline','→\x20New\x20project:\x20','workflow:secrets:delete','\x20modified','\x20\x20Target:\x20','cyan','value','\x20-\x20','select','\x20from\x20session\x20','New\x20project\x20name:\x20','parseProjectWorkflowPattern','every','workflow:retry','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x0a✔\x20Attempt\x20complete','renderSingleTimeline','\x22?\x20This\x20cannot\x20be\x20undone.','description','fileCount','✔\x20Clone\x20complete','No\x20workflows\x20found','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','newProjectId','indexOf','Source\x20directory\x20is\x20required','No\x20sessions\x20with\x20timing\x20information','\x0aPush\x20these\x20changes?','Pull\x20workflow\x20project\x20to\x20local\x20folder','sourceProjectName','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','LABEL_WIDTH_DIVISOR','json','blue','clear','includeRetried','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20Location:\x20','From\x20task:\x20','\x20\x20Workflow:\x20','✔\x20Project:\x20','Cancelled','trim','floor','workflow:projects','\x0aError:','format','join','Error:\x20Invalid\x20JSON\x20in\x20--params','yes','Session\x20time:\x20','log','Error:\x20','prepareCloneProject','\x20project','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','retryAttempt','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','download','get','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Pulling\x20project\x20','Warning:','renderSessionsTimeline','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','success','Source\x20project:\x20','workflow','Listing\x20workflow\x20attempts...','sort','applyPullProject','window','Select\x20a\x20workflow\x20to\x20run','Secrets\x20to\x20set:\x20','table','Session\x20not\x20found:\x20','substring','follow','params','Analyzing\x20project...','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Starting\x20workflow\x20run...','Retrying\x20session...','sessionId','\x27...','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:delete','✔\x20Workflow\x20run\x20started','Error:','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Setting\x20secret...','Params:\x20','projectName','Getting\x20attempt\x20details...','resolve','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]'];a54_0x52df=function(){return _0x2b6bf6;};return a54_0x52df();}export class WorkflowKillCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x276);['description']=a54_0x2cd64f(0x216);async[a54_0x2cd64f(0x223)](_0x21d8e0){const _0x337fd8=a54_0x2cd64f,{options:_0x4e7e73,args:_0x485f75,tdx:_0x4cb7b2}=_0x21d8e0,_0x16a5d8=_0x485f75[0x0];if(!_0x16a5d8)return console['error'](_0x337fd8(0x221)),0x1;const _0x45783b=_0x4e7e73['reason'];_0x4e7e73[_0x337fd8(0x20a)]&&(console['error'](_0x337fd8(0x2c5)+_0x16a5d8),_0x45783b&&console[_0x337fd8(0x29e)](_0x337fd8(0x261)+_0x45783b));if(!_0x4e7e73[_0x337fd8(0x186)]){if(!isInteractive())return console[_0x337fd8(0x29e)](a54_0x22d6d4[_0x337fd8(0x297)](_0x337fd8(0x182)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x337fd8(0x29e)](a54_0x22d6d4[_0x337fd8(0x149)](_0x337fd8(0x18e))),0x1;const _0x2fe177=await confirmKey(_0x337fd8(0x244)+_0x16a5d8+'?');if(!_0x2fe177)return console['error'](a54_0x22d6d4[_0x337fd8(0x1d6)](_0x337fd8(0x17e))),0x1;}const _0x37ef9e=await withSpinner(_0x337fd8(0x23b),()=>_0x4cb7b2[_0x337fd8(0x199)]['kill'](_0x16a5d8,_0x45783b),{'verbose':_0x4e7e73[_0x337fd8(0x20a)]}),_0x4641ae=_0x37ef9e[_0x337fd8(0x1e5)];return console['error']('✔\x20'+_0x4641ae),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x161);[a54_0x2cd64f(0x167)]='Retry\x20a\x20session\x20or\x20attempt';async[a54_0x2cd64f(0x223)](_0x1b516d){const _0x379b91=a54_0x2cd64f,{options:_0x1b75e7,args:_0x41f6a7,tdx:_0x1fab3a}=_0x1b516d,_0x26f3cb=_0x41f6a7[0x0];if(!_0x26f3cb)return console['error'](_0x379b91(0x1af)),console['error'](_0x379b91(0x18c)),0x1;let _0x5cc33d=![],_0x35a490=_0x26f3cb;if(_0x26f3cb[_0x379b91(0x1c4)]('session:'))_0x5cc33d=!![],_0x35a490=_0x26f3cb[_0x379b91(0x1a2)](0x8);else{if(_0x26f3cb[_0x379b91(0x1c4)](_0x379b91(0x1da)))_0x5cc33d=![],_0x35a490=_0x26f3cb[_0x379b91(0x1a2)](0x8);else return console[_0x379b91(0x29e)](_0x379b91(0x1dd)),console[_0x379b91(0x29e)](_0x379b91(0x18c)),0x1;}const _0x2e0831=_0x1b75e7[_0x379b91(0x217)],_0x225778=_0x1b75e7['resumeFrom'],_0x39f376=_0x1b75e7[_0x379b91(0x1a4)],_0x2d28c9=_0x1b75e7['force'];_0x1b75e7[_0x379b91(0x20a)]&&(console[_0x379b91(0x29e)](_0x379b91(0x1e6)+(_0x5cc33d?_0x379b91(0x218):_0x379b91(0x293))+'\x20'+_0x35a490),_0x2e0831&&console[_0x379b91(0x29e)](_0x379b91(0x17b)+_0x2e0831),_0x225778&&console['error'](_0x379b91(0x1f9)+_0x225778),_0x39f376&&console['error'](_0x379b91(0x1b1)+_0x39f376),_0x2d28c9&&console[_0x379b91(0x29e)](_0x379b91(0x1d8)));let _0x52a36a;if(_0x39f376)try{if(_0x39f376['startsWith']('@')){const _0x2c8e3b=await import('fs/promises'),_0x4a7e39=_0x39f376[_0x379b91(0x1a2)](0x1),_0x2cc48b=await _0x2c8e3b[_0x379b91(0x12d)](_0x4a7e39,'utf-8');_0x52a36a=JSON['parse'](_0x2cc48b);}else _0x52a36a=JSON[_0x379b91(0x152)](_0x39f376);}catch{return console[_0x379b91(0x29e)](_0x379b91(0x185)),0x1;}if(!_0x1b75e7[_0x379b91(0x186)]){if(!isInteractive())return console[_0x379b91(0x29e)](a54_0x22d6d4['red'](_0x379b91(0x182)),_0x379b91(0x24b)),console[_0x379b91(0x29e)](a54_0x22d6d4[_0x379b91(0x149)](_0x379b91(0x18e))),0x1;const _0x50f659=await confirmKey(_0x379b91(0x2bb)+(_0x5cc33d?_0x379b91(0x218):_0x379b91(0x293))+'\x20'+_0x35a490+'?');if(!_0x50f659)return console[_0x379b91(0x29e)](a54_0x22d6d4['yellow']('Cancelled')),0x1;}let _0x54a3c9;_0x5cc33d?_0x54a3c9=await withSpinner(_0x379b91(0x1a8),()=>_0x1fab3a[_0x379b91(0x199)][_0x379b91(0x148)](_0x35a490,{'fromTask':_0x2e0831,'retryParams':_0x52a36a}),{'verbose':_0x1b75e7[_0x379b91(0x20a)]}):_0x54a3c9=await withSpinner(_0x379b91(0x271),()=>_0x1fab3a[_0x379b91(0x199)][_0x379b91(0x18d)](_0x35a490,{'resumeFrom':_0x225778,'retryParams':_0x52a36a,'force':_0x2d28c9}),{'verbose':_0x1b75e7[_0x379b91(0x20a)]});const _0x4b4098=_0x54a3c9[_0x379b91(0x1e5)];return console[_0x379b91(0x29e)](_0x379b91(0x20e)),console[_0x379b91(0x29e)](_0x379b91(0x13c)+_0x4b4098['attemptId']),console[_0x379b91(0x29e)](_0x379b91(0x249)+_0x4b4098[_0x379b91(0x1a9)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]='workflow:run';['description']=a54_0x2cd64f(0x247);async[a54_0x2cd64f(0x223)](_0x4b5296){const _0x2f88cb=a54_0x2cd64f,{options:_0x3ac845,args:_0x39c05d,tdx:_0x2b6511}=_0x4b5296;let _0x365cfd=_0x39c05d[0x0];if(!_0x365cfd){const _0x4af3c9=this[_0x2f88cb(0x28e)]([],_0x3ac845),_0x531671=await withSpinner(_0x2f88cb(0x1c1),()=>_0x2b6511['workflow'][_0x2f88cb(0x13f)](_0x4af3c9,{'limit':_0x3ac845[_0x2f88cb(0x24a)]}),{'verbose':_0x3ac845[_0x2f88cb(0x20a)]}),_0x5b411f=_0x531671['data'];if(_0x5b411f[_0x2f88cb(0x289)]===0x0)return console[_0x2f88cb(0x29e)]('No\x20workflows\x20found'),!_0x4af3c9&&console[_0x2f88cb(0x29e)](a54_0x22d6d4[_0x2f88cb(0x149)](_0x2f88cb(0x1ee))),0x1;const _0x2eb562=_0x5b411f['map'](_0x2f28d3=>({'title':_0x2f28d3[_0x2f88cb(0x241)]?.['name']+'.'+_0x2f28d3['name'],'value':_0x2f28d3['project']?.[_0x2f88cb(0x131)]+'.'+_0x2f28d3[_0x2f88cb(0x131)],'description':_0x2f28d3[_0x2f88cb(0x2cf)]?_0x2f88cb(0x226)+_0x2f28d3[_0x2f88cb(0x2cf)]:undefined})),_0x341945=await a54_0xbf6bfc({'type':_0x2f88cb(0x15c),'name':_0x2f88cb(0x199),'message':_0x2f88cb(0x19e),'choices':_0x2eb562});if(!_0x341945[_0x2f88cb(0x199)])return 0x1;_0x365cfd=_0x341945[_0x2f88cb(0x199)];}if(!_0x365cfd[_0x2f88cb(0x2d5)]('.')){const _0x2682eb=this[_0x2f88cb(0x28e)]([],_0x3ac845);if(_0x2682eb)_0x365cfd=_0x2682eb+'.'+_0x365cfd;else return console[_0x2f88cb(0x29e)](a54_0x22d6d4[_0x2f88cb(0x297)](_0x2f88cb(0x1ae)),_0x2f88cb(0x275)),console[_0x2f88cb(0x29e)](a54_0x22d6d4[_0x2f88cb(0x149)](_0x2f88cb(0x1ee))),0x1;}const _0x23dda5=_0x3ac845['param'],_0x4ffc4a=_0x3ac845[_0x2f88cb(0x1ea)],_0x4cc57c={};if(_0x23dda5&&Array[_0x2f88cb(0x12b)](_0x23dda5))for(const _0x41d6b4 of _0x23dda5){const _0x3d847f=_0x41d6b4[_0x2f88cb(0x16d)]('=');if(_0x3d847f===-0x1)return console[_0x2f88cb(0x29e)](_0x2f88cb(0x25c)+_0x41d6b4),console[_0x2f88cb(0x29e)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x32ac64=_0x41d6b4[_0x2f88cb(0x1a2)](0x0,_0x3d847f),_0x4bb811=_0x41d6b4[_0x2f88cb(0x1a2)](_0x3d847f+0x1);try{_0x4cc57c[_0x32ac64]=JSON[_0x2f88cb(0x152)](_0x4bb811);}catch{_0x4cc57c[_0x32ac64]=_0x4bb811;}}_0x3ac845['verbose']&&(console['error']('Workflow:\x20'+_0x365cfd),Object[_0x2f88cb(0x140)](_0x4cc57c)[_0x2f88cb(0x289)]>0x0&&console[_0x2f88cb(0x29e)](_0x2f88cb(0x1c8)+JSON[_0x2f88cb(0x2cd)](_0x4cc57c)),_0x4ffc4a&&console[_0x2f88cb(0x29e)](_0x2f88cb(0x187)+_0x4ffc4a));const _0x56d90c=await withSpinner(_0x2f88cb(0x1a7),()=>_0x2b6511[_0x2f88cb(0x199)][_0x2f88cb(0x2b9)](_0x365cfd,_0x4cc57c,{'sessionTime':_0x4ffc4a}),{'verbose':_0x3ac845[_0x2f88cb(0x20a)]}),_0x56f90c=_0x56d90c['data'];console[_0x2f88cb(0x29e)](_0x2f88cb(0x1ad)),console[_0x2f88cb(0x29e)]('\x20\x20Attempt\x20ID:\x20'+_0x56f90c['id']),console['error'](_0x2f88cb(0x249)+_0x56f90c[_0x2f88cb(0x1a9)]),console[_0x2f88cb(0x29e)](_0x2f88cb(0x132)+_0x56f90c['project']?.[_0x2f88cb(0x131)]),console[_0x2f88cb(0x29e)](_0x2f88cb(0x17c)+_0x56f90c['workflow']?.[_0x2f88cb(0x131)]);if(_0x56f90c['project']?.['id']&&_0x56f90c['sessionId']&&_0x56f90c['id']){const _0x2f6877=_0x3ac845[_0x2f88cb(0x298)],_0x164d6d=getConsoleUrl(_0x2f6877,_0x2f88cb(0x1d3)+_0x56f90c['project']['id']+_0x2f88cb(0x214)+_0x56f90c[_0x2f88cb(0x1a9)]+_0x2f88cb(0x219)+_0x56f90c['id']);console['error']('\x20\x20Console:\x20'+a54_0x22d6d4[_0x2f88cb(0x159)](_0x164d6d));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x232);['description']=a54_0x2cd64f(0x173);async['execute'](_0x32ffe5){const _0x542a20=a54_0x2cd64f,{options:_0x540ca3,args:_0x491f94,tdx:_0x1a80ae}=_0x32ffe5,_0x52035d=_0x491f94[0x0],_0x2ffeca=_0x491f94[0x1]||'.';if(!_0x52035d)return console[_0x542a20(0x29e)](_0x542a20(0x1cc)),console['error'](_0x542a20(0x191)),0x1;const _0x5626a4=_0x540ca3[_0x542a20(0x2cf)];_0x540ca3[_0x542a20(0x20a)]&&(console['error'](_0x542a20(0x26e)+_0x52035d),console[_0x542a20(0x29e)](_0x542a20(0x12c)+_0x2ffeca),_0x5626a4&&console[_0x542a20(0x29e)](_0x542a20(0x220)+_0x5626a4));const _0xab2d1a=await withSpinner('Downloading\x20project\x20'+_0x52035d+_0x542a20(0x14d),()=>_0x1a80ae[_0x542a20(0x199)][_0x542a20(0x18f)](_0x52035d,_0x2ffeca,{'revision':_0x5626a4}),{'verbose':_0x540ca3[_0x542a20(0x20a)]}),_0x2b2ff6=_0xab2d1a[_0x542a20(0x1e5)];return console[_0x542a20(0x29e)](_0x542a20(0x1bd)+_0x2b2ff6['projectName']),console[_0x542a20(0x29e)](_0x542a20(0x2c7)+_0x2b2ff6[_0x542a20(0x2cf)]),console[_0x542a20(0x29e)](_0x542a20(0x2c2)+_0x2b2ff6['filesExtracted']),console[_0x542a20(0x29e)]('\x20\x20Location:\x20'+_0x2ffeca+'/'+_0x2b2ff6['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x22a);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x2b1);async[a54_0x2cd64f(0x223)](_0x587c7e){const _0x15a5dd=a54_0x2cd64f,{options:_0x450ff1,args:_0x383a6e,tdx:_0x2ed350}=_0x587c7e;let _0x40a1f3='.',_0x5acf02=_0x450ff1['name'];if(_0x383a6e[0x0]){const {promises:_0x414abf}=await import('fs');try{const _0x9a929d=await _0x414abf['stat'](_0x383a6e[0x0]);if(_0x9a929d[_0x15a5dd(0x239)]())_0x40a1f3=_0x383a6e[0x0];else return console[_0x15a5dd(0x29e)](_0x15a5dd(0x189)+_0x383a6e[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5acf02=_0x383a6e[0x0],_0x40a1f3='.';}}const _0x27c1af=_0x450ff1[_0x15a5dd(0x2cf)],_0x535a3b=_0x450ff1['skipValidation'];_0x450ff1[_0x15a5dd(0x20a)]&&(console[_0x15a5dd(0x29e)](_0x15a5dd(0x1fb)+_0x40a1f3),_0x5acf02&&console[_0x15a5dd(0x29e)](_0x15a5dd(0x2bf)+_0x5acf02),_0x27c1af&&console[_0x15a5dd(0x29e)](_0x15a5dd(0x220)+_0x27c1af),_0x535a3b&&console['error']('Validation:\x20skipped'));const _0x24ccd3=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x2ed350[_0x15a5dd(0x199)]['push'](_0x40a1f3,{'projectName':_0x5acf02,'revision':_0x27c1af,'skipValidation':_0x535a3b}),{'verbose':_0x450ff1[_0x15a5dd(0x20a)]}),_0x1c629f=_0x24ccd3[_0x15a5dd(0x1e5)];return console['error']('✔\x20Pushed\x20'+_0x1c629f[_0x15a5dd(0x1b2)]),console['error'](_0x15a5dd(0x1d1)+_0x1c629f[_0x15a5dd(0x213)]),console[_0x15a5dd(0x29e)](_0x15a5dd(0x2c7)+_0x1c629f[_0x15a5dd(0x2cf)]),await this[_0x15a5dd(0x29d)](_0x2ed350,_0x1c629f[_0x15a5dd(0x1b2)],_0x450ff1['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x2cd64f(0x131)]='workflow:pull';[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x171);async[a54_0x2cd64f(0x223)](_0x234753){const _0x56e1b8=a54_0x2cd64f,{options:_0x2a7a4f,args:_0x3fece1,tdx:_0x33408f}=_0x234753,_0x5a5064=_0x3fece1[0x0],_0x3be60c=_0x3fece1[0x1];if(!_0x5a5064)return console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x297)](_0x56e1b8(0x1ae)),_0x56e1b8(0x224)),console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x149)](_0x56e1b8(0x1b5))),0x1;const _0x1eea95=_0x2a7a4f['revision'];_0x2a7a4f[_0x56e1b8(0x20a)]&&(console[_0x56e1b8(0x29e)](_0x56e1b8(0x26e)+_0x5a5064),_0x3be60c&&console[_0x56e1b8(0x29e)](_0x56e1b8(0x1c6)+_0x3be60c),_0x1eea95&&console[_0x56e1b8(0x29e)]('Revision:\x20'+_0x1eea95),_0x2a7a4f[_0x56e1b8(0x205)]&&console[_0x56e1b8(0x29e)]('Dry\x20run:\x20yes'));const _0x3bc52a=await withSpinner(_0x56e1b8(0x192)+_0x5a5064+_0x56e1b8(0x14d),()=>_0x33408f[_0x56e1b8(0x199)]['pullProject'](_0x5a5064,{'targetDir':_0x3be60c,'revision':_0x1eea95}),{'verbose':_0x2a7a4f[_0x56e1b8(0x20a)]}),_0x3099e0=_0x3bc52a[_0x56e1b8(0x1e5)];_0x3099e0[_0x56e1b8(0x2d1)]?console[_0x56e1b8(0x29e)](_0x56e1b8(0x155)+_0x3099e0[_0x56e1b8(0x1b2)]):console[_0x56e1b8(0x29e)](_0x56e1b8(0x13b)+_0x3099e0[_0x56e1b8(0x1b2)]);console['error'](_0x56e1b8(0x2c7)+_0x3099e0[_0x56e1b8(0x2cf)]),console['error'](_0x56e1b8(0x158)+(a54_0x49f5e['relative'](process[_0x56e1b8(0x23a)](),_0x3099e0[_0x56e1b8(0x12a)])||'.')),console['error'](_0x56e1b8(0x2d7)+a54_0x22d6d4[_0x56e1b8(0x145)]('+'+_0x3099e0[_0x56e1b8(0x13e)][_0x56e1b8(0x22b)]+_0x56e1b8(0x23e))+',\x20'+(a54_0x22d6d4['yellow']('~'+_0x3099e0[_0x56e1b8(0x13e)]['modified']+_0x56e1b8(0x157))+',\x20')+(a54_0x22d6d4[_0x56e1b8(0x297)]('-'+_0x3099e0[_0x56e1b8(0x13e)]['deleted']+_0x56e1b8(0x246))+',\x20')+(''+a54_0x22d6d4['dim'](_0x3099e0[_0x56e1b8(0x13e)][_0x56e1b8(0x1c2)]+_0x56e1b8(0x1e9))));for(const _0x2c5566 of _0x3099e0[_0x56e1b8(0x204)]){_0x2c5566[_0x56e1b8(0x26c)]===_0x56e1b8(0x1db)&&_0x2c5566[_0x56e1b8(0x291)]&&(console[_0x56e1b8(0x29e)]('\x0a'+a54_0x22d6d4[_0x56e1b8(0x159)](_0x56e1b8(0x1d0)+_0x2c5566['path'])),console['error'](_0x2c5566[_0x56e1b8(0x291)]));}if(!_0x3099e0[_0x56e1b8(0x124)])return saveSessionContext({'workflow_project':_0x3099e0['projectName']},_0x2a7a4f[_0x56e1b8(0x218)]),console[_0x56e1b8(0x29e)](a54_0x22d6d4['green'](_0x56e1b8(0x29b))),console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x149)](_0x56e1b8(0x1ab)+_0x3099e0[_0x56e1b8(0x1b2)])),0x0;if(_0x2a7a4f[_0x56e1b8(0x205)])return console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x1d6)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x2a7a4f[_0x56e1b8(0x186)]){if(!isInteractive())return console[_0x56e1b8(0x29e)](a54_0x22d6d4['red'](_0x56e1b8(0x182)),_0x56e1b8(0x24b)),console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4ffffc=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x4ffffc)return console[_0x56e1b8(0x29e)](a54_0x22d6d4[_0x56e1b8(0x1d6)](_0x56e1b8(0x17e)),_0x56e1b8(0x135)),0x1;}await withSpinner(_0x56e1b8(0x2ad),()=>_0x33408f[_0x56e1b8(0x199)][_0x56e1b8(0x19c)](_0x3099e0,{'revision':_0x1eea95}),{'verbose':_0x2a7a4f[_0x56e1b8(0x20a)]}),saveSessionContext({'workflow_project':_0x3099e0[_0x56e1b8(0x1b2)]},_0x2a7a4f['session']),console['error'](a54_0x22d6d4[_0x56e1b8(0x145)](_0x56e1b8(0x264)));const _0x1eb77a=a54_0x49f5e[_0x56e1b8(0x1dc)](process[_0x56e1b8(0x23a)](),_0x3099e0[_0x56e1b8(0x12a)])||'.';return console['error'](a54_0x22d6d4[_0x56e1b8(0x149)](_0x56e1b8(0x17a)+_0x1eb77a)),console['error'](a54_0x22d6d4[_0x56e1b8(0x149)](_0x56e1b8(0x1ab)+_0x3099e0[_0x56e1b8(0x1b2)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]='workflow:push';[a54_0x2cd64f(0x167)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a54_0x2cd64f(0x223)](_0x3458c3){const _0x7aab2a=a54_0x2cd64f,{options:_0x2d6e69,args:_0x480dc7,tdx:_0x4fba29}=_0x3458c3,_0x3fc016=this[_0x7aab2a(0x1ce)](_0x480dc7,_0x2d6e69),_0x42744a=_0x2d6e69[_0x7aab2a(0x2cf)],_0x50ce6a=_0x2d6e69['skipValidation'];_0x2d6e69[_0x7aab2a(0x20a)]&&(_0x3fc016&&console[_0x7aab2a(0x29e)]('Source\x20directory:\x20'+_0x3fc016),_0x42744a&&console[_0x7aab2a(0x29e)](_0x7aab2a(0x220)+_0x42744a),_0x2d6e69['dryRun']&&console['error'](_0x7aab2a(0x143)),_0x50ce6a&&console['error'](_0x7aab2a(0x2b6)));let _0x48daf8;try{_0x48daf8=await withSpinner(_0x7aab2a(0x1b9),()=>_0x4fba29['workflow'][_0x7aab2a(0x2c9)]({'sourceDir':_0x3fc016,'revision':_0x42744a,'skipValidation':_0x50ce6a}),{'verbose':_0x2d6e69[_0x7aab2a(0x20a)]});}catch(_0x266e31){if(_0x266e31 instanceof Error&&_0x266e31[_0x7aab2a(0x251)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x297)]('Error:'),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2d6e69[_0x7aab2a(0x22f)]?console['error'](a54_0x22d6d4[_0x7aab2a(0x149)](_0x7aab2a(0x21c)+_0x2d6e69['workflowProject']+_0x7aab2a(0x153)+_0x2d6e69[_0x7aab2a(0x22f)]+'\x27')):console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x149)](_0x7aab2a(0x258))),0x1;throw _0x266e31;}const _0x37139f=_0x48daf8[_0x7aab2a(0x1e5)];console[_0x7aab2a(0x29e)](_0x7aab2a(0x17d)+_0x37139f[_0x7aab2a(0x1b2)]),console['error'](_0x7aab2a(0x1eb)+_0x37139f[_0x7aab2a(0x2ca)]),console[_0x7aab2a(0x29e)](_0x7aab2a(0x2c7)+_0x37139f['revision']),console['error']('\x20\x20Changes:\x20'+a54_0x22d6d4[_0x7aab2a(0x145)]('+'+_0x37139f['summary'][_0x7aab2a(0x22b)]+_0x7aab2a(0x23e))+',\x20'+(a54_0x22d6d4[_0x7aab2a(0x1d6)]('~'+_0x37139f[_0x7aab2a(0x13e)][_0x7aab2a(0x1db)]+_0x7aab2a(0x157))+',\x20')+(a54_0x22d6d4[_0x7aab2a(0x297)]('-'+_0x37139f[_0x7aab2a(0x13e)]['deleted']+'\x20deleted')+',\x20')+(''+a54_0x22d6d4[_0x7aab2a(0x149)](_0x37139f[_0x7aab2a(0x13e)][_0x7aab2a(0x1c2)]+_0x7aab2a(0x1e9))));for(const _0x5197ed of _0x37139f['changes']){_0x5197ed[_0x7aab2a(0x26c)]===_0x7aab2a(0x1db)&&_0x5197ed[_0x7aab2a(0x291)]&&(console[_0x7aab2a(0x29e)]('\x0a'+a54_0x22d6d4['cyan'](_0x7aab2a(0x1d0)+_0x5197ed[_0x7aab2a(0x233)])),console['error'](_0x5197ed['diff']));}if(!_0x37139f['hasChanges'])return console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x145)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x7aab2a(0x29d)](_0x4fba29,_0x37139f[_0x7aab2a(0x1b2)],_0x2d6e69[_0x7aab2a(0x298)]),0x0;if(_0x2d6e69[_0x7aab2a(0x205)])return console['error'](a54_0x22d6d4[_0x7aab2a(0x1d6)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2d6e69[_0x7aab2a(0x186)]){if(!isInteractive())return console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x297)](_0x7aab2a(0x182)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x149)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1c9b29=await confirmKey(_0x7aab2a(0x170));if(!_0x1c9b29)return console[_0x7aab2a(0x29e)](a54_0x22d6d4[_0x7aab2a(0x1d6)](_0x7aab2a(0x17e)),_0x7aab2a(0x21e)),0x1;}const _0x485a6c=await withSpinner(_0x7aab2a(0x126),()=>_0x4fba29[_0x7aab2a(0x199)][_0x7aab2a(0x2b2)](_0x37139f),{'verbose':_0x2d6e69['verbose']}),_0x504ebc=_0x485a6c[_0x7aab2a(0x1e5)];return console['error'](a54_0x22d6d4[_0x7aab2a(0x145)]('✔\x20Push\x20complete')),console[_0x7aab2a(0x29e)](_0x7aab2a(0x1d1)+_0x504ebc[_0x7aab2a(0x213)]),console[_0x7aab2a(0x29e)]('\x20\x20Revision:\x20'+_0x504ebc[_0x7aab2a(0x2cf)]),await this[_0x7aab2a(0x29d)](_0x4fba29,_0x504ebc['projectName'],_0x2d6e69[_0x7aab2a(0x298)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]='workflow:clone';[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x1b7);async[a54_0x2cd64f(0x223)](_0x4f6bc0){const _0x469631=a54_0x2cd64f,{options:_0x46fd88,args:_0x4a315c,tdx:_0x11aa3e}=_0x4f6bc0,_0x7f570b=this[_0x469631(0x1ce)](_0x4a315c,_0x46fd88),_0x515ea0=_0x46fd88[_0x469631(0x131)],_0x35d488=_0x46fd88[_0x469631(0x2cf)],_0x14b2a3=_0x46fd88[_0x469631(0x1bf)];if(!_0x7f570b)return console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x297)]('Error:'),_0x469631(0x16e)),console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x149)](_0x469631(0x195))),console['error'](a54_0x22d6d4[_0x469631(0x149)](_0x469631(0x1fe))),0x1;if(!_0x515ea0)return console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x297)](_0x469631(0x1ae)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x469631(0x29e)](a54_0x22d6d4['dim'](_0x469631(0x195))),0x1;_0x46fd88[_0x469631(0x20a)]&&(console[_0x469631(0x29e)]('Source\x20directory:\x20'+_0x7f570b),console['error'](_0x469631(0x15e)+_0x515ea0),_0x35d488&&console[_0x469631(0x29e)](_0x469631(0x220)+_0x35d488),_0x46fd88[_0x469631(0x205)]&&console['error'](_0x469631(0x143)),_0x14b2a3&&console['error'](_0x469631(0x2b6)));const _0x3a2078=await withSpinner(_0x469631(0x1a5),()=>_0x11aa3e[_0x469631(0x199)][_0x469631(0x18a)](_0x7f570b,_0x515ea0,{'revision':_0x35d488,'skipValidation':_0x14b2a3}),{'verbose':_0x46fd88[_0x469631(0x20a)]}),_0x1e1a0b=_0x3a2078[_0x469631(0x1e5)];console[_0x469631(0x29e)](_0x469631(0x1fc)+_0x1e1a0b[_0x469631(0x2ca)]);_0x1e1a0b[_0x469631(0x172)]&&console['error'](_0x469631(0x198)+_0x1e1a0b[_0x469631(0x172)]);console[_0x469631(0x29e)](_0x469631(0x15e)+_0x1e1a0b['newProjectName']),console[_0x469631(0x29e)](_0x469631(0x220)+_0x1e1a0b[_0x469631(0x2cf)]),console[_0x469631(0x29e)](_0x469631(0x24f)+_0x1e1a0b[_0x469631(0x168)]);_0x1e1a0b[_0x469631(0x141)]&&(console['error'](a54_0x22d6d4[_0x469631(0x1d6)](_0x469631(0x203)+_0x1e1a0b[_0x469631(0x242)]+_0x469631(0x1de)+_0x1e1a0b[_0x469631(0x295)]+')')),console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x1d6)](_0x469631(0x229))));if(_0x46fd88[_0x469631(0x205)])return console[_0x469631(0x29e)](a54_0x22d6d4['yellow'](_0x469631(0x212))),0x0;if(!_0x46fd88[_0x469631(0x186)]){if(!isInteractive())return console[_0x469631(0x29e)](a54_0x22d6d4['red'](_0x469631(0x182)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x149)](_0x469631(0x18e))),0x1;const _0xcb74fe=_0x1e1a0b[_0x469631(0x172)]||a54_0x49f5e['basename'](_0x7f570b),_0x5758c6=_0x1e1a0b['targetExists']?_0x469631(0x25d)+_0x515ea0+_0x469631(0x150):'\x0aClone\x20\x22'+_0xcb74fe+_0x469631(0x207)+_0x515ea0+'\x22?',_0x5eef91=await confirmKey(_0x5758c6);if(!_0x5eef91)return console['error'](a54_0x22d6d4[_0x469631(0x1d6)](_0x469631(0x17e))),0x1;}const _0xdcad30=await withSpinner(_0x1e1a0b['targetExists']?_0x469631(0x2c8)+_0x515ea0+_0x469631(0x14d):_0x469631(0x2cc)+_0x515ea0+_0x469631(0x14d),()=>_0x11aa3e['workflow']['executeCloneProject'](_0x1e1a0b),{'verbose':_0x46fd88[_0x469631(0x20a)]}),_0x43362f=_0xdcad30[_0x469631(0x1e5)];return console[_0x469631(0x29e)](a54_0x22d6d4[_0x469631(0x145)](_0x1e1a0b[_0x469631(0x141)]?_0x469631(0x22c):_0x469631(0x169))),console[_0x469631(0x29e)](_0x469631(0x132)+_0x43362f[_0x469631(0x242)]),console[_0x469631(0x29e)]('\x20\x20Project\x20ID:\x20'+_0x43362f[_0x469631(0x16c)]),console[_0x469631(0x29e)](_0x469631(0x2c7)+_0x43362f[_0x469631(0x2cf)]),await this[_0x469631(0x29d)](_0x11aa3e,_0x43362f[_0x469631(0x242)],_0x46fd88[_0x469631(0x298)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x1ac);[a54_0x2cd64f(0x167)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x2cd64f(0x223)](_0x2d5177){const _0x3b9da1=a54_0x2cd64f,{options:_0x761e9,args:_0x4ead59,tdx:_0x23b56e}=_0x2d5177,_0x25f812=_0x4ead59[0x0];if(!_0x25f812)return console[_0x3b9da1(0x29e)](_0x3b9da1(0x280)),console['error'](_0x3b9da1(0x2a6)),0x1;_0x761e9[_0x3b9da1(0x20a)]&&console['error'](_0x3b9da1(0x26e)+_0x25f812);if(!_0x761e9[_0x3b9da1(0x186)]){if(!isInteractive())return console[_0x3b9da1(0x29e)](a54_0x22d6d4['red']('\x0aError:'),_0x3b9da1(0x24b)),console[_0x3b9da1(0x29e)](a54_0x22d6d4[_0x3b9da1(0x149)](_0x3b9da1(0x18e))),0x1;const _0x2f37b0=await confirmKey(_0x3b9da1(0x2d0)+_0x25f812+_0x3b9da1(0x166));if(!_0x2f37b0)return console[_0x3b9da1(0x29e)](a54_0x22d6d4[_0x3b9da1(0x1d6)](_0x3b9da1(0x17e))),0x1;}const _0x13bed8=await withSpinner(_0x3b9da1(0x294)+_0x25f812+'...',()=>_0x23b56e[_0x3b9da1(0x199)][_0x3b9da1(0x1c7)](_0x25f812),{'verbose':_0x761e9['verbose']}),_0x48eaa1=_0x13bed8[_0x3b9da1(0x1e5)];return console[_0x3b9da1(0x29e)]('✔\x20Deleted\x20project\x20'+_0x48eaa1[_0x3b9da1(0x1b2)]),console[_0x3b9da1(0x29e)](_0x3b9da1(0x1d1)+_0x48eaa1[_0x3b9da1(0x213)]),0x0;}}export function parseKeyValue(_0x5c1092){const _0x2f0e2b=a54_0x2cd64f,_0x2eb6b4=_0x5c1092[_0x2f0e2b(0x16d)]('=');if(_0x2eb6b4===-0x1)throw new Error(_0x2f0e2b(0x254)+_0x5c1092+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x5c91e5=_0x5c1092[_0x2f0e2b(0x1a2)](0x0,_0x2eb6b4),_0x925ef2=_0x5c1092[_0x2f0e2b(0x1a2)](_0x2eb6b4+0x1);if(!_0x5c91e5)throw new Error(_0x2f0e2b(0x1f1));return{'key':_0x5c91e5,'value':_0x925ef2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]='workflow:secrets:list';[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x234);async['execute'](_0x2e52f9){const _0x1cf961=a54_0x2cd64f,{options:_0x1c71f2,args:_0x17744f,tdx:_0x3853e6}=_0x2e52f9,_0x159d7b=this[_0x1cf961(0x1e1)](_0x17744f,_0x1c71f2);if(!_0x159d7b)return 0x1;_0x1c71f2['verbose']&&console['error'](_0x1cf961(0x26e)+_0x159d7b);const _0x54a611=await withSpinner(_0x1cf961(0x1fd),()=>_0x3853e6[_0x1cf961(0x199)][_0x1cf961(0x2d4)](_0x159d7b),{'verbose':_0x1c71f2['verbose']}),{secrets:_0x541673}=_0x54a611[_0x1cf961(0x1e5)];return console[_0x1cf961(0x29e)]('✔\x20Found\x20'+_0x541673[_0x1cf961(0x289)]+_0x1cf961(0x1f4)+(_0x541673[_0x1cf961(0x289)]!==0x1?'s':'')),await handleSDKOutput(_0x541673,_0x1c71f2),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x1cf);[a54_0x2cd64f(0x167)]=a54_0x2cd64f(0x268);async[a54_0x2cd64f(0x223)](_0x376d81){const _0x17ffd0=a54_0x2cd64f,{options:_0x1c5ee7,args:_0x559e30,tdx:_0x310a72}=_0x376d81;let _0x33ccf6,_0x58602c;if(_0x559e30['length']>=0x1&&!_0x559e30[0x0][_0x17ffd0(0x2d5)]('='))_0x33ccf6=_0x559e30[0x0],_0x58602c=_0x559e30[_0x17ffd0(0x1ba)](0x1);else{if(_0x559e30[_0x17ffd0(0x289)]>=0x1&&_0x1c5ee7['workflowProject'])_0x33ccf6=_0x1c5ee7[_0x17ffd0(0x22f)],_0x58602c=_0x559e30;else return _0x559e30[_0x17ffd0(0x289)]>=0x1?(console[_0x17ffd0(0x29e)](_0x17ffd0(0x1cc)),console['error'](_0x17ffd0(0x1ee)),0x1):(console['error'](_0x17ffd0(0x163)),console[_0x17ffd0(0x29e)](_0x17ffd0(0x210)),0x1);}if(_0x58602c[_0x17ffd0(0x289)]===0x0)return console[_0x17ffd0(0x29e)](_0x17ffd0(0x163)),console[_0x17ffd0(0x29e)](_0x17ffd0(0x210)),0x1;const _0x533da7={};try{for(const _0x4b2b67 of _0x58602c){const {key:_0x451bff,value:_0x51ff4}=parseKeyValue(_0x4b2b67);_0x533da7[_0x451bff]=_0x51ff4;}}catch(_0x10785e){return _0x10785e instanceof Error&&console[_0x17ffd0(0x29e)](a54_0x22d6d4['red'](_0x17ffd0(0x1ae)),_0x10785e[_0x17ffd0(0x251)]),0x1;}const _0x5a407f=Object['keys'](_0x533da7);_0x1c5ee7[_0x17ffd0(0x20a)]&&(console['error'](_0x17ffd0(0x26e)+_0x33ccf6),console[_0x17ffd0(0x29e)](_0x17ffd0(0x19f)+_0x5a407f[_0x17ffd0(0x184)](',\x20')));const _0x524f3d=await withSpinner(_0x5a407f[_0x17ffd0(0x289)]===0x1?_0x17ffd0(0x1b0):_0x17ffd0(0x28a)+_0x5a407f['length']+_0x17ffd0(0x2b7),()=>_0x310a72[_0x17ffd0(0x199)][_0x17ffd0(0x1e0)](_0x33ccf6,_0x533da7),{'verbose':_0x1c5ee7[_0x17ffd0(0x20a)]}),_0xed865d=_0x524f3d[_0x17ffd0(0x1e5)];return console[_0x17ffd0(0x29e)](_0x5a407f[_0x17ffd0(0x289)]===0x1?_0x17ffd0(0x26a)+_0xed865d[_0x17ffd0(0x140)][0x0]+_0x17ffd0(0x1c0)+_0xed865d[_0x17ffd0(0x1b2)]+'\x27':'✔\x20'+_0xed865d['keys'][_0x17ffd0(0x289)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0xed865d['projectName']+'\x27'),(_0x1c5ee7[_0x17ffd0(0x175)]||_0x1c5ee7[_0x17ffd0(0x2c6)])&&await handleSingleObjectOutput(_0xed865d,_0x1c5ee7),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x2cd64f(0x131)]=a54_0x2cd64f(0x156);['description']=a54_0x2cd64f(0x1e2);async['execute'](_0x32f497){const _0x3fc401=a54_0x2cd64f,{options:_0x43720c,args:_0x19df16,tdx:_0x5a4950}=_0x32f497;let _0x3829f0,_0x30098d;if(_0x19df16[_0x3fc401(0x289)]>=0x2)_0x3829f0=_0x19df16[0x0],_0x30098d=_0x19df16[0x1];else{if(_0x19df16[_0x3fc401(0x289)]===0x1&&_0x43720c[_0x3fc401(0x22f)])_0x3829f0=_0x43720c[_0x3fc401(0x22f)],_0x30098d=_0x19df16[0x0];else return _0x19df16['length']===0x1?(console[_0x3fc401(0x29e)](_0x3fc401(0x1cc)),console[_0x3fc401(0x29e)](_0x3fc401(0x1ee)),0x1):(console[_0x3fc401(0x29e)](_0x3fc401(0x225)),console[_0x3fc401(0x29e)](_0x3fc401(0x1ed)),0x1);}_0x43720c[_0x3fc401(0x20a)]&&(console[_0x3fc401(0x29e)](_0x3fc401(0x26e)+_0x3829f0),console[_0x3fc401(0x29e)](_0x3fc401(0x1ec)+_0x30098d));if(!_0x43720c[_0x3fc401(0x186)]){if(!isInteractive())return console['error'](a54_0x22d6d4[_0x3fc401(0x297)](_0x3fc401(0x182)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x22d6d4[_0x3fc401(0x149)](_0x3fc401(0x18e))),0x1;const _0x3f8d20=await confirmKey(_0x3fc401(0x2da)+_0x30098d+_0x3fc401(0x13d)+_0x3829f0+'\x27?');if(!_0x3f8d20)return console[_0x3fc401(0x29e)](a54_0x22d6d4[_0x3fc401(0x1d6)]('Cancelled')),0x1;}const _0x2ea573=await withSpinner(_0x3fc401(0x2c0),()=>_0x5a4950[_0x3fc401(0x199)]['deleteSecret'](_0x3829f0,_0x30098d),{'verbose':_0x43720c[_0x3fc401(0x20a)]}),_0x1faaa2=_0x2ea573[_0x3fc401(0x1e5)];return console[_0x3fc401(0x29e)](_0x3fc401(0x26a)+_0x1faaa2['key']+_0x3fc401(0x2bc)+_0x1faaa2[_0x3fc401(0x1b2)]+'\x27'),(_0x43720c[_0x3fc401(0x175)]||_0x43720c['jsonl'])&&await handleSingleObjectOutput(_0x1faaa2,_0x43720c),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(_0x2013cb){const _0x59c5e0=a54_0x2cd64f,_0x3788c9=Math[_0x59c5e0(0x180)](_0x2013cb/0x3e8),_0x3f5932=Math[_0x59c5e0(0x180)](_0x3788c9/0x3c),_0x5271da=Math[_0x59c5e0(0x180)](_0x3f5932/0x3c),_0x3d7750=Math[_0x59c5e0(0x180)](_0x5271da/0x18);if(_0x3d7750>0x0){const _0x5503bf=_0x5271da%0x18;return _0x5503bf>0x0?_0x3d7750+'d\x20'+_0x5503bf+'h':_0x3d7750+'d';}else{if(_0x5271da>0x0){const _0x4d8c4d=_0x3f5932%0x3c;return _0x4d8c4d>0x0?_0x5271da+'h\x20'+_0x4d8c4d+'m':_0x5271da+'h';}else{if(_0x3f5932>0x0){const _0x1d0c11=_0x3788c9%0x3c;return _0x1d0c11>0x0?_0x3f5932+'m\x20'+_0x1d0c11+'s':_0x3f5932+'m';}else return _0x3788c9+'s';}}}function formatTimestamp(_0x215427,_0x23c46f){const _0x3e4840=a54_0x2cd64f,_0x58eb3a=new Date(_0x215427),_0x27464c=String(_0x58eb3a[_0x3e4840(0x1e8)]())[_0x3e4840(0x255)](0x2,'0'),_0x3c4753=String(_0x58eb3a[_0x3e4840(0x253)]())['padStart'](0x2,'0'),_0x577bc1=_0x27464c+':'+_0x3c4753,_0x1a7053=_0x58eb3a[_0x3e4840(0x127)]()===_0x23c46f[_0x3e4840(0x127)]()&&_0x58eb3a[_0x3e4840(0x1e4)]()===_0x23c46f[_0x3e4840(0x1e4)]()&&_0x58eb3a[_0x3e4840(0x137)]()===_0x23c46f[_0x3e4840(0x137)]();if(_0x1a7053)return _0x577bc1;else{const _0x4fc11f=String(_0x58eb3a[_0x3e4840(0x1e4)]()+0x1)[_0x3e4840(0x255)](0x2,'0'),_0x4c29d5=String(_0x58eb3a[_0x3e4840(0x137)]())[_0x3e4840(0x255)](0x2,'0');return _0x4fc11f+'-'+_0x4c29d5+'\x20'+_0x577bc1;}}function formatDate(_0x49ddf0){const _0xb9e79=a54_0x2cd64f,_0x188414=_0x49ddf0['getFullYear'](),_0x2e9a70=String(_0x49ddf0[_0xb9e79(0x1e4)]()+0x1)[_0xb9e79(0x255)](0x2,'0'),_0x56fc14=String(_0x49ddf0[_0xb9e79(0x137)]())[_0xb9e79(0x255)](0x2,'0');return _0x188414+'-'+_0x2e9a70+'-'+_0x56fc14;}function getTaskStateIcon(_0x143279){const _0x33c494={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x33c494[_0x143279]||'⚪';}function getBarChar(_0x18cdb8){return _0x18cdb8==='error'||_0x18cdb8==='group_error'?'×':'─';}function getBarColor(_0x4a148){const _0x4b917f=a54_0x2cd64f,_0x13a327={'success':a54_0x22d6d4[_0x4b917f(0x145)],'error':a54_0x22d6d4['red'],'group_error':a54_0x22d6d4[_0x4b917f(0x297)],'running':a54_0x22d6d4['blue'],'blocked':a54_0x22d6d4['yellow'],'planned':a54_0x22d6d4[_0x4b917f(0x149)],'canceling':a54_0x22d6d4[_0x4b917f(0x1d6)]};return _0x13a327[_0x4a148]||a54_0x22d6d4[_0x4b917f(0x278)];}function a54_0x1c09(_0x259d2a,_0x56067a){_0x259d2a=_0x259d2a-0x123;const _0x52df85=a54_0x52df();let _0x1c09e2=_0x52df85[_0x259d2a];return _0x1c09e2;}function parseTaskName(_0x4b72ec){const _0x23f993=a54_0x2cd64f;let _0x4884a9=_0x4b72ec[_0x23f993(0x2a1)](/^\++/,'');const _0x4a9156=_0x4884a9[_0x23f993(0x1d5)]('+'),_0x417710=_0x4a9156[_0x23f993(0x289)]>0x1?_0x4a9156[_0x23f993(0x289)]-0x2:0x0,_0x5d974f=_0x4a9156[_0x4a9156['length']-0x1]||_0x4884a9;return{'level':_0x417710,'name':'+'+_0x5d974f};}function truncateTaskName(_0x2169aa,_0x2e085e){const _0x2364b1=a54_0x2cd64f,_0x4dad67=stringWidth(_0x2169aa);if(_0x4dad67<=_0x2e085e)return _0x2169aa;let _0x2f2a7c=_0x2169aa;while(stringWidth(_0x2f2a7c+'…')>_0x2e085e&&_0x2f2a7c[_0x2364b1(0x289)]>0x0){_0x2f2a7c=_0x2f2a7c[_0x2364b1(0x1ba)](0x0,-0x1);}return _0x2f2a7c+'…';}function calculateTimeScale(_0x3d0757,_0x4a9eb2){const _0x55edb7=a54_0x2cd64f;return{'startTime':_0x3d0757['start'],'endTime':_0x3d0757[_0x55edb7(0x238)],'durationMs':_0x3d0757[_0x55edb7(0x2bd)],'msPerChar':_0x3d0757[_0x55edb7(0x2bd)]/_0x4a9eb2};}function timeToPosition(_0x53fc31,_0x262714,_0x4fb95a){const _0x15a5f1=a54_0x2cd64f,_0x42ce95=_0x53fc31-_0x262714[_0x15a5f1(0x1e7)],_0x1af302=Math['floor'](_0x42ce95/_0x262714[_0x15a5f1(0x2c4)]);return Math[_0x15a5f1(0x123)](0x0,Math[_0x15a5f1(0x228)](_0x1af302,_0x4fb95a));}function renderTimeAxis(_0x33e939,_0x55fa7d){const _0x17c896=a54_0x2cd64f,_0x2d6cec=Math[_0x17c896(0x228)](TIMELINE_CONFIG[_0x17c896(0x286)],Math[_0x17c896(0x123)](TIMELINE_CONFIG[_0x17c896(0x23c)],Math[_0x17c896(0x180)](_0x55fa7d/TIMELINE_CONFIG[_0x17c896(0x174)]))),_0x57f42a=_0x33e939[_0x17c896(0x27b)]/(_0x2d6cec-0x1),_0x345475=new Date(_0x33e939[_0x17c896(0x1e7)]),_0x51bce0=[];for(let _0x250b21=0x0;_0x250b21<_0x2d6cec;_0x250b21++){const _0x1ea336=_0x33e939['startTime']+_0x250b21*_0x57f42a,_0x1813f1=timeToPosition(_0x1ea336,_0x33e939,_0x55fa7d),_0x1701c3=formatTimestamp(_0x1ea336,_0x345475);_0x51bce0[_0x17c896(0x2a3)]({'pos':_0x1813f1,'text':_0x1701c3});}const _0x6688e6=new Array(_0x55fa7d)['fill']('\x20');let _0x161c5e=-0x1;for(const {pos:_0x282613,text:_0x136534}of _0x51bce0){let _0x1c1f57=Math[_0x17c896(0x123)](0x0,_0x282613-Math[_0x17c896(0x180)](_0x136534[_0x17c896(0x289)]/0x2));_0x1c1f57<=_0x161c5e+TIMELINE_CONFIG[_0x17c896(0x129)]&&(_0x1c1f57=_0x161c5e+TIMELINE_CONFIG[_0x17c896(0x129)]+0x1);_0x1c1f57+_0x136534[_0x17c896(0x289)]>_0x55fa7d&&(_0x1c1f57=_0x55fa7d-_0x136534[_0x17c896(0x289)]);if(_0x1c1f57>=0x0&&_0x1c1f57+_0x136534[_0x17c896(0x289)]<=_0x55fa7d&&_0x1c1f57>_0x161c5e){for(let _0x2f8f12=0x0;_0x2f8f12<_0x136534[_0x17c896(0x289)];_0x2f8f12++){_0x6688e6[_0x1c1f57+_0x2f8f12]=_0x136534[_0x2f8f12];}_0x161c5e=_0x1c1f57+_0x136534[_0x17c896(0x289)]-0x1;}}return _0x6688e6[_0x17c896(0x184)]('');}function renderTaskRow(_0x1b9bfc,_0x1f0e33,_0x236032,_0x5b588e){const _0x509070=a54_0x2cd64f,{level:_0x136d5d,name:_0x485e54}=parseTaskName(_0x1b9bfc['name']),_0x317833='\x20'[_0x509070(0x243)](_0x136d5d),_0x461f2b=_0x1b9bfc[_0x509070(0x19d)]?'('+formatElapsed(_0x1b9bfc[_0x509070(0x19d)][_0x509070(0x2bd)])+')':'',_0x4ca5a1=stringWidth(_0x461f2b),_0x254ca3=_0x136d5d*0x1,_0x6b262f=_0x5b588e-_0x254ca3-_0x4ca5a1-0x1,_0x1c57dd=truncateTaskName(_0x485e54,_0x6b262f),_0x243476=_0x317833+_0x1c57dd,_0x36ac96=stringWidth(_0x243476),_0x5e6add=_0x5b588e-_0x36ac96-_0x4ca5a1,_0x2a472d=_0x243476+'\x20'[_0x509070(0x243)](Math[_0x509070(0x123)](0x1,_0x5e6add))+a54_0x22d6d4['dim'](_0x461f2b),_0x16849c=getTaskStateIcon(_0x1b9bfc[_0x509070(0x231)]),_0xec8090=new Array(_0x236032)['fill']('\x20');if(_0x1b9bfc['window']){const _0x51444d=timeToPosition(_0x1b9bfc[_0x509070(0x19d)]['start'],_0x1f0e33,_0x236032),_0x53a99f=timeToPosition(_0x1b9bfc[_0x509070(0x19d)]['end'],_0x1f0e33,_0x236032),_0x3970b9=getBarChar(_0x1b9bfc[_0x509070(0x231)]),_0x3fe815=Math[_0x509070(0x123)](_0x51444d+0x1,_0x53a99f);for(let _0xb0a10=_0x51444d;_0xb0a10<Math['min'](_0x3fe815,_0x236032);_0xb0a10++){_0xec8090[_0xb0a10]=_0x3970b9;}}const _0x4c7d37=getBarColor(_0x1b9bfc[_0x509070(0x231)]),_0xe3f6c5=_0xec8090[_0x509070(0x245)](_0x425579=>_0x425579==='\x20'?'\x20':_0x4c7d37(_0x425579))[_0x509070(0x184)]('');return _0x16849c+'\x20'+_0x2a472d+'│'+_0xe3f6c5+'│';}function calculateStats(_0x1de172){const _0x4249c9=a54_0x2cd64f,_0xcf3ae4={'total':_0x1de172[_0x4249c9(0x289)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x11f9f7 of _0x1de172){if(_0x11f9f7[_0x4249c9(0x231)]===_0x4249c9(0x197))_0xcf3ae4['success']++;else{if(_0x11f9f7[_0x4249c9(0x231)]===_0x4249c9(0x29e)||_0x11f9f7[_0x4249c9(0x231)]===_0x4249c9(0x1f3))_0xcf3ae4[_0x4249c9(0x29e)]++;else _0x11f9f7['state']===_0x4249c9(0x1f0)?_0xcf3ae4[_0x4249c9(0x1f0)]++:_0xcf3ae4['pending']++;}}return _0xcf3ae4;}function formatStats(_0x4bc341){const _0x3f0237=a54_0x2cd64f;return[_0x3f0237(0x211)+_0x4bc341[_0x3f0237(0x1ef)],'✅\x20'+_0x4bc341['success'],'❌\x20'+_0x4bc341[_0x3f0237(0x29e)],'🔄\x20'+_0x4bc341['running'],'⏳\x20'+_0x4bc341['pending']][_0x3f0237(0x184)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x2cd64f(0x1cd);[a54_0x2cd64f(0x167)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x2cd64f(0x223)](_0xfce624){const _0x2fa2f8=a54_0x2cd64f,{options:_0x39644f,args:_0x34b5f0,tdx:_0x8c3cf0}=_0xfce624;let _0x2c7435,_0xb860eb,_0x3c70c9=![];if(_0x34b5f0[0x0]){if(_0x34b5f0[0x0][_0x2fa2f8(0x2d5)]('.')){const _0x54842e=this[_0x2fa2f8(0x15f)](_0x34b5f0,_0x39644f);if(!_0x54842e)return 0x1;_0x2c7435=_0x54842e[_0x2fa2f8(0x1b2)],_0xb860eb=_0x54842e[_0x2fa2f8(0x252)];}else{_0xb860eb=_0x34b5f0[0x0],_0x2c7435=_0x39644f['workflowProject'];if(!_0x2c7435)return console[_0x2fa2f8(0x29e)](a54_0x22d6d4[_0x2fa2f8(0x297)](_0x2fa2f8(0x1ae)),_0x2fa2f8(0x2aa)),0x1;_0x3c70c9=!![];}}else{const _0x3d9e19=this[_0x2fa2f8(0x15f)](_0x34b5f0,_0x39644f);if(!_0x3d9e19)return 0x1;_0x2c7435=_0x3d9e19['projectName'],_0xb860eb=_0x3d9e19['workflowName'];}if(_0x39644f[_0x2fa2f8(0x20a)]){if(_0x2c7435&&_0xb860eb)console[_0x2fa2f8(0x29e)](_0x2fa2f8(0x1f8)+_0x2c7435+'.'+_0xb860eb);else _0x2c7435&&console[_0x2fa2f8(0x29e)]('Filter:\x20project='+_0x2c7435);}const _0x3f1339=_0x39644f[_0x2fa2f8(0x20c)],_0x3d1383=_0x39644f[_0x2fa2f8(0x1a9)];if(_0x3f1339){_0x3d1383&&console[_0x2fa2f8(0x29e)](a54_0x22d6d4['yellow'](_0x2fa2f8(0x193)),_0x2fa2f8(0x1df));const _0x387a62=_0x39644f[_0x2fa2f8(0x1a3)];return _0x387a62?await this[_0x2fa2f8(0x154)](_0xfce624,_0x3f1339):await this[_0x2fa2f8(0x165)](_0xfce624,_0x3f1339,_0x39644f),0x0;}if(_0x3d1383){const _0x9411ff=await withSpinner(_0x2fa2f8(0x1e3),()=>_0x8c3cf0[_0x2fa2f8(0x199)][_0x2fa2f8(0x272)]({'projectName':_0x2c7435,'workflowName':_0xb860eb,'limit':0x64}),{'verbose':_0x39644f[_0x2fa2f8(0x20a)]}),_0x3c5ec6=_0x9411ff[_0x2fa2f8(0x1e5)][_0x2fa2f8(0x240)](_0xb2f730=>_0xb2f730['id']===_0x3d1383);if(!_0x3c5ec6)return console[_0x2fa2f8(0x29e)](a54_0x22d6d4[_0x2fa2f8(0x297)](_0x2fa2f8(0x1ae)),_0x2fa2f8(0x1a1)+_0x3d1383),0x1;if(!_0x3c5ec6[_0x2fa2f8(0x29a)]?.['id'])return console[_0x2fa2f8(0x29e)](a54_0x22d6d4[_0x2fa2f8(0x297)]('Error:'),_0x2fa2f8(0x1c5)+_0x3d1383+'\x20has\x20no\x20attempts'),0x1;const _0x4b6533=_0x3c5ec6[_0x2fa2f8(0x29a)]['id'];_0x39644f['verbose']&&console[_0x2fa2f8(0x29e)]('Using\x20attempt\x20'+_0x4b6533+_0x2fa2f8(0x15d)+_0x3d1383);const _0x482617=_0x39644f[_0x2fa2f8(0x1a3)];return _0x482617?await this['pollTimeline'](_0xfce624,_0x4b6533):await this[_0x2fa2f8(0x165)](_0xfce624,_0x4b6533,_0x39644f),0x0;}const _0x18fc4a=await withSpinner(_0x2fa2f8(0x146),()=>_0x8c3cf0[_0x2fa2f8(0x199)]['sessions']({'projectName':_0x2c7435,'workflowName':_0xb860eb,'limit':_0x39644f['limit']||0x32}),{'verbose':_0x39644f[_0x2fa2f8(0x20a)]}),_0x85dfab=_0x18fc4a[_0x2fa2f8(0x1e5)];if(_0x85dfab[_0x2fa2f8(0x289)]===0x0){if(_0x2c7435&&_0xb860eb)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x2c7435+'.'+_0xb860eb);else _0x2c7435?console['error'](_0x2fa2f8(0x282)+_0x2c7435):(console[_0x2fa2f8(0x29e)]('No\x20workflow\x20sessions\x20found'),console[_0x2fa2f8(0x29e)](a54_0x22d6d4[_0x2fa2f8(0x149)](_0x2fa2f8(0x1a6))));return 0x0;}_0x85dfab[_0x2fa2f8(0x19b)]((_0x28d87e,_0x595eaf)=>{const _0x56cf18=_0x2fa2f8,_0x1f9419=_0x28d87e['sessionTime']||'',_0x513d8f=_0x595eaf[_0x56cf18(0x1ea)]||'';return _0x513d8f['localeCompare'](_0x1f9419);});if(_0x39644f[_0x2fa2f8(0x175)]||_0x39644f['jsonl'])return await handleSDKOutput(_0x85dfab,_0x39644f),0x0;let _0xfdb485;if(_0x3c70c9){const _0x8c11ab=_0x85dfab[0x0];if(!_0x8c11ab['lastAttempt']?.['id'])return console[_0x2fa2f8(0x29e)](_0x2fa2f8(0x206)),0x0;_0xfdb485=_0x8c11ab[_0x2fa2f8(0x29a)]['id'],_0x39644f[_0x2fa2f8(0x20a)]&&console[_0x2fa2f8(0x29e)](_0x2fa2f8(0x260)+_0x8c11ab[_0x2fa2f8(0x1ea)]);}else{const _0x2df4cd=_0x85dfab['map'](_0x2d6600=>{const _0x4a5916=_0x2fa2f8,_0x3becb4=getAttemptStatusDisplay(_0x2d6600[_0x4a5916(0x29a)]);return{'title':_0x2d6600[_0x4a5916(0x241)]?.[_0x4a5916(0x131)]+'.'+_0x2d6600[_0x4a5916(0x199)]?.[_0x4a5916(0x131)]+_0x4a5916(0x15b)+_0x2d6600[_0x4a5916(0x1ea)]+'\x20'+_0x3becb4['icon'],'value':_0x2d6600[_0x4a5916(0x29a)]?.['id']||'','description':_0x3becb4['text']};}),_0x1f3358=await a54_0xbf6bfc({'type':_0x2fa2f8(0x15c),'name':_0x2fa2f8(0x20c),'message':_0x2fa2f8(0x1be),'choices':_0x2df4cd[_0x2fa2f8(0x299)](_0x32a24f=>_0x32a24f[_0x2fa2f8(0x15a)]!=='')});if(!_0x1f3358[_0x2fa2f8(0x20c)])return 0x0;_0xfdb485=_0x1f3358[_0x2fa2f8(0x20c)];}const _0x592d96=_0x39644f[_0x2fa2f8(0x1a3)];return _0x592d96?await this[_0x2fa2f8(0x154)](_0xfce624,_0xfdb485):await this[_0x2fa2f8(0x165)](_0xfce624,_0xfdb485,_0x39644f),0x0;}async[a54_0x2cd64f(0x165)](_0x7a4e9d,_0x185ebd,_0x15c835){const _0xbf1abe=a54_0x2cd64f,{tdx:_0x140048}=_0x7a4e9d;let _0x33ef5d,_0x3c4a4d;try{[_0x33ef5d,_0x3c4a4d]=await Promise['all']([_0x140048[_0xbf1abe(0x199)][_0xbf1abe(0x293)](_0x185ebd),_0x140048[_0xbf1abe(0x199)][_0xbf1abe(0x14b)](_0x185ebd,![])]);}catch(_0x1ddcbc){console[_0xbf1abe(0x29e)](a54_0x22d6d4['red'](_0xbf1abe(0x2ba)));_0x15c835[_0xbf1abe(0x20a)]&&console['error'](_0x1ddcbc);throw _0x1ddcbc;}if(_0x15c835[_0xbf1abe(0x175)]||_0x15c835[_0xbf1abe(0x2c6)]){const _0x14c698=this[_0xbf1abe(0x23f)](_0x33ef5d,_0x3c4a4d);await handleSDKOutput([_0x14c698],_0x15c835);return;}const _0x4d371d=_0x140048[_0xbf1abe(0x1d2)]['site'],_0x1e549d=this[_0xbf1abe(0x2ae)](_0x33ef5d,_0x3c4a4d,_0x4d371d);console[_0xbf1abe(0x188)](_0x1e549d);}async['pollTimeline'](_0x1afa95,_0x1c6066){const _0x30f851=a54_0x2cd64f,{tdx:_0x52efe1}=_0x1afa95,_0x412257=TIMELINE_CONFIG[_0x30f851(0x136)],_0x51b550=TIMELINE_CONFIG[_0x30f851(0x287)];let _0x136381=0x0;while(_0x136381<_0x51b550){process[_0x30f851(0x25e)][_0x30f851(0x265)]&&process[_0x30f851(0x25e)][_0x30f851(0x139)]('\x1bc');let _0x416338,_0x3e5afe;try{[_0x416338,_0x3e5afe]=await Promise['all']([_0x52efe1[_0x30f851(0x199)][_0x30f851(0x293)](_0x1c6066),_0x52efe1[_0x30f851(0x199)][_0x30f851(0x14b)](_0x1c6066,![])]);}catch(_0x17ba06){console['error'](a54_0x22d6d4['red'](_0x30f851(0x1b8)));_0x136381>0x0&&console[_0x30f851(0x29e)](a54_0x22d6d4[_0x30f851(0x149)](_0x30f851(0x12f)+_0x136381));throw _0x17ba06;}const _0x108ff7=_0x52efe1[_0x30f851(0x1d2)][_0x30f851(0x298)],_0xc4e9cd=this[_0x30f851(0x2ae)](_0x416338,_0x3e5afe,_0x108ff7);console[_0x30f851(0x188)](_0xc4e9cd);const _0x2c86d2=_0x416338[_0x30f851(0x1d7)]&&_0x3e5afe[_0x30f851(0x160)](_0x54b960=>_0x54b960[_0x30f851(0x231)]!==_0x30f851(0x1f0)&&_0x54b960['state']!==_0x30f851(0x22e));if(_0x2c86d2){console[_0x30f851(0x29e)](a54_0x22d6d4[_0x30f851(0x145)](_0x30f851(0x164)));break;}console[_0x30f851(0x29e)](a54_0x22d6d4[_0x30f851(0x149)](_0x30f851(0x1fa)+_0x136381*0x2+_0x30f851(0x235))),await new Promise(_0xdcf203=>setTimeout(_0xdcf203,_0x412257)),_0x136381++;}_0x136381>=_0x51b550&&console[_0x30f851(0x29e)](a54_0x22d6d4[_0x30f851(0x1d6)](_0x30f851(0x130)));}['renderTimeline'](_0x42571d,_0x451cad,_0x25df8b){const _0x4c33ac=a54_0x2cd64f,_0x40ff70=[],_0x5e34c7=TIMELINE_CONFIG[_0x4c33ac(0x21b)],_0x4b24b8=0x5,_0x90b6ee=process[_0x4c33ac(0x25e)][_0x4c33ac(0x26d)]||0x78,_0x447d02=_0x90b6ee-_0x5e34c7-_0x4b24b8,_0xf98b48=Math[_0x4c33ac(0x123)](TIMELINE_CONFIG[_0x4c33ac(0x208)],Math[_0x4c33ac(0x228)](_0x447d02,TIMELINE_CONFIG[_0x4c33ac(0x1f6)])),_0x137204=new Date(_0x42571d[_0x4c33ac(0x215)])[_0x4c33ac(0x20d)](),_0x87e824=_0x42571d[_0x4c33ac(0x20f)]?new Date(_0x42571d['finishedAt'])[_0x4c33ac(0x20d)]():Date[_0x4c33ac(0x2ab)](),_0x2cb0bd={'start':_0x137204,'end':_0x87e824,'duration':_0x87e824-_0x137204},_0x255960=new Map(),_0x2702f5=[];for(const _0x3a124e of _0x451cad){if(_0x3a124e[_0x4c33ac(0x21a)]){const _0x117fa1=new Date(_0x3a124e['startedAt'])[_0x4c33ac(0x20d)](),_0x4b4d3f=_0x3a124e[_0x4c33ac(0x27c)]?new Date(_0x3a124e[_0x4c33ac(0x27c)])[_0x4c33ac(0x20d)]():Date[_0x4c33ac(0x2ab)](),_0x11f0b7={'start':_0x117fa1,'end':_0x4b4d3f,'duration':_0x4b4d3f-_0x117fa1};_0x255960[_0x4c33ac(0x257)](_0x3a124e['id'],_0x11f0b7),_0x2702f5[_0x4c33ac(0x2a3)]({'name':_0x3a124e[_0x4c33ac(0x274)],'state':_0x3a124e[_0x4c33ac(0x231)]||_0x4c33ac(0x20b),'window':_0x11f0b7});}else _0x2702f5['push']({'name':_0x3a124e[_0x4c33ac(0x274)],'state':_0x3a124e[_0x4c33ac(0x231)]||_0x4c33ac(0x22e),'window':undefined});}_0x2702f5[_0x4c33ac(0x19b)]((_0x28962b,_0x40eede)=>{const _0xec562d=_0x4c33ac;if(!_0x28962b['window'])return 0x1;if(!_0x40eede[_0xec562d(0x19d)])return-0x1;return _0x28962b[_0xec562d(0x19d)][_0xec562d(0x277)]-_0x40eede[_0xec562d(0x19d)][_0xec562d(0x277)];});const _0x51cdc7=_0x2702f5[_0x4c33ac(0x289)],_0x3c1ea8=_0x51cdc7>TIMELINE_CONFIG[_0x4c33ac(0x23d)];_0x3c1ea8&&_0x2702f5['splice'](TIMELINE_CONFIG[_0x4c33ac(0x23d)]);const _0x565e28=calculateTimeScale(_0x2cb0bd,_0xf98b48),_0x443b65=_0x42571d[_0x4c33ac(0x1d7)]?_0x42571d[_0x4c33ac(0x197)]?a54_0x22d6d4[_0x4c33ac(0x145)]('success'):a54_0x22d6d4[_0x4c33ac(0x297)](_0x4c33ac(0x29e)):a54_0x22d6d4['blue'](_0x4c33ac(0x1f0)),_0x284232=_0x42571d[_0x4c33ac(0x241)]?.['id'],_0x1d4caa=_0x42571d[_0x4c33ac(0x1a9)];let _0x123c24;if(_0x284232&&_0x1d4caa){const _0x40ad91=getWorkflowAttemptUrl(_0x25df8b,_0x284232,_0x1d4caa,_0x42571d['id']);_0x123c24=hyperlink(a54_0x22d6d4['dim'](_0x42571d['id']),_0x40ad91);}else _0x123c24=a54_0x22d6d4[_0x4c33ac(0x149)](_0x42571d['id']);_0x40ff70[_0x4c33ac(0x2a3)](_0x4c33ac(0x1d9)+_0x123c24+_0x4c33ac(0x15b)+_0x443b65+'\x20-\x20'+formatElapsed(_0x2cb0bd[_0x4c33ac(0x2bd)]));if(_0x2702f5[_0x4c33ac(0x289)]>0x0){const _0xbb087f=renderTimeAxis(_0x565e28,_0xf98b48),_0x11fa73=new Date(_0x2cb0bd[_0x4c33ac(0x277)]),_0x23f673=formatDate(_0x11fa73),_0x552332=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4c33ac(0x2a4)]+_0x5e34c7,_0x5dc499=_0x23f673[_0x4c33ac(0x255)](_0x552332),_0x4c0a43=a54_0x22d6d4[_0x4c33ac(0x149)](_0x5dc499);_0x40ff70[_0x4c33ac(0x2a3)](_0x4c0a43+'\x20'+_0xbb087f);for(const _0x46451e of _0x2702f5){_0x40ff70[_0x4c33ac(0x2a3)](renderTaskRow(_0x46451e,_0x565e28,_0xf98b48,_0x5e34c7));}const _0x48a911=calculateStats(_0x2702f5);_0x40ff70['push'](formatStats(_0x48a911)),_0x3c1ea8&&_0x40ff70['push'](a54_0x22d6d4[_0x4c33ac(0x1d6)](_0x4c33ac(0x2ce)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x4c33ac(0x1bb)+_0x51cdc7+_0x4c33ac(0x259))),_0x40ff70[_0x4c33ac(0x2a3)](''),_0x40ff70['push'](a54_0x22d6d4[_0x4c33ac(0x149)](_0x4c33ac(0x288))+(_0x4c33ac(0x26f)+_0x42571d['id']+_0x4c33ac(0x202))+a54_0x22d6d4['dim'](_0x4c33ac(0x29f)));}else _0x40ff70[_0x4c33ac(0x2a3)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x40ff70[_0x4c33ac(0x184)]('\x0a');}[a54_0x2cd64f(0x23f)](_0x441244,_0x11d822){const _0x2a70e5=a54_0x2cd64f,_0x1a819d=new Date(_0x441244[_0x2a70e5(0x215)])[_0x2a70e5(0x20d)](),_0x2907b0=_0x441244['finishedAt']?new Date(_0x441244[_0x2a70e5(0x20f)])['getTime']():Date[_0x2a70e5(0x2ab)](),_0x30c955=_0x2907b0-_0x1a819d,_0x190deb=[];for(const _0x118295 of _0x11d822){if(_0x118295[_0x2a70e5(0x21a)]){const _0x4a5ef7=new Date(_0x118295[_0x2a70e5(0x21a)])[_0x2a70e5(0x20d)](),_0x415e61=_0x118295[_0x2a70e5(0x27c)]?new Date(_0x118295[_0x2a70e5(0x27c)])[_0x2a70e5(0x20d)]():Date[_0x2a70e5(0x2ab)]();_0x190deb[_0x2a70e5(0x2a3)]({'name':_0x118295[_0x2a70e5(0x274)],'state':_0x118295[_0x2a70e5(0x231)]||_0x2a70e5(0x20b),'window':{'start':_0x4a5ef7,'end':_0x415e61,'duration':_0x415e61-_0x4a5ef7}});}else _0x190deb['push']({'name':_0x118295['fullName'],'state':_0x118295[_0x2a70e5(0x231)]||_0x2a70e5(0x22e),'window':undefined});}const _0xa529a1=calculateStats(_0x190deb);return{'attempt':{'id':_0x441244['id'],'status':_0x441244[_0x2a70e5(0x1d7)]?_0x441244[_0x2a70e5(0x197)]?_0x2a70e5(0x197):_0x2a70e5(0x29e):'running','createdAt':_0x441244[_0x2a70e5(0x215)],'finishedAt':_0x441244['finishedAt'],'duration_ms':_0x30c955},'tasks':_0x190deb[_0x2a70e5(0x245)](_0x29663f=>({'name':_0x29663f[_0x2a70e5(0x131)],'state':_0x29663f[_0x2a70e5(0x231)],'startedAt':_0x29663f[_0x2a70e5(0x19d)]?new Date(_0x29663f['window'][_0x2a70e5(0x277)])[_0x2a70e5(0x237)]():null,'updatedAt':_0x29663f[_0x2a70e5(0x19d)]?new Date(_0x29663f['window']['end'])[_0x2a70e5(0x237)]():null,'duration_ms':_0x29663f['window']?.[_0x2a70e5(0x2bd)]||null})),'stats':_0xa529a1};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x149cd2,_0x239cc3){const _0x2c971e=a55_0x9f59,_0x55e430=_0x149cd2();while(!![]){try{const _0x3afd4a=parseInt(_0x2c971e(0x18f))/0x1*(-parseInt(_0x2c971e(0x186))/0x2)+-parseInt(_0x2c971e(0x180))/0x3+parseInt(_0x2c971e(0x18d))/0x4+parseInt(_0x2c971e(0x18a))/0x5+-parseInt(_0x2c971e(0x17e))/0x6*(parseInt(_0x2c971e(0x187))/0x7)+parseInt(_0x2c971e(0x189))/0x8*(parseInt(_0x2c971e(0x18b))/0x9)+parseInt(_0x2c971e(0x182))/0xa;if(_0x3afd4a===_0x239cc3)break;else _0x55e430['push'](_0x55e430['shift']());}catch(_0x35f354){_0x55e430['push'](_0x55e430['shift']());}}}(a55_0x147e,0xa9a18));import{platform}from'os';function a55_0x9f59(_0x12d2d6,_0x58ae0b){_0x12d2d6=_0x12d2d6-0x17e;const _0x147e04=a55_0x147e();let _0x9f59e4=_0x147e04[_0x12d2d6];return _0x9f59e4;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x116327=a55_0x9f59,_0x3cb44a=getVersion(),_0x17def5=platform(),_0x247933=process[_0x116327(0x181)][_0x116327(0x183)]('v','');return _0x116327(0x18c)+_0x3cb44a+'\x20('+_0x17def5+_0x116327(0x17f)+_0x247933+')';}export function getAuthHeaders(_0x224509,_0x1effcc,_0x3677d7){const _0x338047=a55_0x9f59,_0x24787c=getVersion(),_0x178e49={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x24787c};if(_0x3677d7)_0x178e49[_0x338047(0x185)]=_0x338047(0x184)+_0x3677d7;else _0x1effcc&&(_0x178e49[_0x338047(0x185)]=_0x338047(0x188)+_0x1effcc);return _0x178e49;}function a55_0x147e(){const _0x36b6b9=['TD1\x20','324464nNnlez','2412040KlMYYm','288pYfPzR','tdx/','2265252ysfrZq','length','3GVdETm','6AyVqmX',';\x20node/','2152059xQHYGA','version','3825450QklTMs','replace','Bearer\x20','Authorization','757858HSxBXY','1261218GvUsmn'];a55_0x147e=function(){return _0x36b6b9;};return a55_0x147e();}export function toHeaderRecord(_0x3b2bc7){const _0x379a83={};for(const [_0x23c97d,_0x512b43]of Object['entries'](_0x3b2bc7)){_0x512b43!==undefined&&(_0x379a83[_0x23c97d]=_0x512b43);}return _0x379a83;}export function getTrinoHeaders(_0x4df45f,_0x478054,_0x3d9240){const _0x39215b=a55_0x9f59,_0x38ad5f=getAuthHeaders(_0x4df45f),_0x230572=toHeaderRecord(_0x38ad5f);if(_0x3d9240)_0x230572[_0x39215b(0x185)]=_0x39215b(0x184)+_0x3d9240;else _0x478054&&(_0x230572['X-Trino-User']=_0x478054);return _0x230572;}export function hasAPIKey(_0x434a99){const _0x4afad6=a55_0x9f59,_0x114bfc=getAPIKey();return _0x114bfc!==undefined&&_0x114bfc[_0x4afad6(0x18e)]>0x0;}
1
+ (function(_0x2a21a4,_0x548ff4){const _0x4990a8=a55_0x43b1,_0x24537d=_0x2a21a4();while(!![]){try{const _0x144980=parseInt(_0x4990a8(0x1ac))/0x1*(-parseInt(_0x4990a8(0x1a6))/0x2)+parseInt(_0x4990a8(0x1b8))/0x3*(-parseInt(_0x4990a8(0x1b3))/0x4)+-parseInt(_0x4990a8(0x1ba))/0x5+-parseInt(_0x4990a8(0x1a8))/0x6+parseInt(_0x4990a8(0x1a9))/0x7*(parseInt(_0x4990a8(0x1aa))/0x8)+parseInt(_0x4990a8(0x1b6))/0x9*(parseInt(_0x4990a8(0x1bb))/0xa)+-parseInt(_0x4990a8(0x1a7))/0xb*(-parseInt(_0x4990a8(0x1a5))/0xc);if(_0x144980===_0x548ff4)break;else _0x24537d['push'](_0x24537d['shift']());}catch(_0x42c190){_0x24537d['push'](_0x24537d['shift']());}}}(a55_0x1b85,0xf419c));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a55_0x1b85(){const _0x28a76f=['tdx/','TD1\x20','988RGQwhb','Authorization','length','3700530qGgFat','version','16293vbbAkk','Bearer\x20','8348290omlTTD','10elwmfZ','396rJVzDO','18timwhK','1752652ynbjxc','4442532NLGqTg','1883DyYgCB','22504jFWUIX','tdx','186050npIYcS','replace','X-Trino-User','entries',';\x20node/'];a55_0x1b85=function(){return _0x28a76f;};return a55_0x1b85();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x4c01de=a55_0x43b1,_0x5703b0=getVersion(),_0x398316=platform(),_0x104feb=process[_0x4c01de(0x1b7)][_0x4c01de(0x1ad)]('v','');return _0x4c01de(0x1b1)+_0x5703b0+'\x20('+_0x398316+_0x4c01de(0x1b0)+_0x104feb+')';}function a55_0x43b1(_0x4cafc6,_0x496b06){_0x4cafc6=_0x4cafc6-0x1a5;const _0x1b8581=a55_0x1b85();let _0x43b185=_0x1b8581[_0x4cafc6];return _0x43b185;}export function getAuthHeaders(_0x81fe6d,_0xba2074,_0x1f9f65){const _0x69bce4=a55_0x43b1,_0x34e244=getVersion(),_0x509b25={'User-Agent':getUserAgent(),'X-TD-Client':_0x69bce4(0x1ab),'X-TD-Client-Version':_0x34e244};if(_0x1f9f65)_0x509b25[_0x69bce4(0x1b4)]='Bearer\x20'+_0x1f9f65;else _0xba2074&&(_0x509b25[_0x69bce4(0x1b4)]=_0x69bce4(0x1b2)+_0xba2074);return _0x509b25;}export function toHeaderRecord(_0x390cb4){const _0x2b1b92=a55_0x43b1,_0x48aa03={};for(const [_0x231379,_0x4c61d7]of Object[_0x2b1b92(0x1af)](_0x390cb4)){_0x4c61d7!==undefined&&(_0x48aa03[_0x231379]=_0x4c61d7);}return _0x48aa03;}export function getTrinoHeaders(_0x2e8f81,_0x2f73ad,_0x1aae66){const _0x364756=a55_0x43b1,_0x4902f6=getAuthHeaders(_0x2e8f81),_0x4bea2a=toHeaderRecord(_0x4902f6);if(_0x1aae66)_0x4bea2a[_0x364756(0x1b4)]=_0x364756(0x1b9)+_0x1aae66;else _0x2f73ad&&(_0x4bea2a[_0x364756(0x1ae)]=_0x2f73ad);return _0x4bea2a;}export function hasAPIKey(_0x33b086){const _0x322613=a55_0x43b1,_0xfeddc9=getAPIKey();return _0xfeddc9!==undefined&&_0xfeddc9[_0x322613(0x1b5)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x2ba92c,_0x403c7f){const _0xe7d89c=a56_0x336c,_0x353dad=_0x2ba92c();while(!![]){try{const _0x2c2092=-parseInt(_0xe7d89c(0x110))/0x1+-parseInt(_0xe7d89c(0x131))/0x2+parseInt(_0xe7d89c(0xff))/0x3*(parseInt(_0xe7d89c(0x123))/0x4)+parseInt(_0xe7d89c(0x11a))/0x5+-parseInt(_0xe7d89c(0x11b))/0x6+-parseInt(_0xe7d89c(0x13e))/0x7+parseInt(_0xe7d89c(0x114))/0x8*(parseInt(_0xe7d89c(0x10a))/0x9);if(_0x2c2092===_0x403c7f)break;else _0x353dad['push'](_0x353dad['shift']());}catch(_0x2feb94){_0x353dad['push'](_0x353dad['shift']());}}}(a56_0xb920,0x77140));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';function a56_0xb920(){const _0x174257=['cmdout','red','entries','stringify','params','log','push','string','327BUooNf','Results\x20saved\x20to\x20','map','length','table','FINISHED','varchar','magenta','close','join','bold','4779aotUlW','limit','tsv','padEnd','json','split','642057dITBAe','list','[error]','jsonl','22136yrSajw','[Object]','format','number','isTTY','boolean','1618405LQPoup','733728mdgNFV','end','[rule]','query','noColor','rule','isInteger','stderr','12348jOnwBk','color','-FXRSn','debug','filter','─┬─','stdout','[params]','output','max','blue','trim','[query]','yellow','434402lUSdjy','data','keys','stdin','double','cyan','isFinite','bigint','object','repeat','sdk-result','No\x20data','error','4621057ZWDwAD','write','forEach'];a56_0xb920=function(){return _0x174257;};return a56_0xb920();}import a56_0x528313 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x39ea26){const _0x4ff1cc=a56_0x336c;return _0x39ea26[_0x4ff1cc(0x116)]===_0x4ff1cc(0x10e)||_0x39ea26['format']==='jsonl'||_0x39ea26[_0x4ff1cc(0x116)]===_0x4ff1cc(0x10c)||_0x39ea26[_0x4ff1cc(0x116)]==='table'||_0x39ea26[_0x4ff1cc(0x10e)]===!![]||_0x39ea26[_0x4ff1cc(0x113)]===!![]||_0x39ea26['tsv']===!![]||_0x39ea26[_0x4ff1cc(0x103)]===!![];}export function parseOutputOptions(_0x26cdd7){const _0x71276c=a56_0x336c;return{'format':_0x26cdd7[_0x71276c(0x116)]||_0x71276c(0x103),'output':_0x26cdd7[_0x71276c(0x12b)]||'','limit':_0x26cdd7[_0x71276c(0x10b)],'limitStructuredFormats':_0x26cdd7['limitStructuredFormats'],'color':_0x26cdd7[_0x71276c(0x124)],'noColor':_0x26cdd7[_0x71276c(0x11f)]};}function convertSDKResultToQueryResult(_0x170fcc){const _0x6922a8=a56_0x336c,_0x33594c=[];if(_0x170fcc['length']>0x0){const _0x189a25=_0x170fcc[0x0];for(const [_0x1d2dc1,_0x5b2aa7]of Object[_0x6922a8(0xf9)](_0x189a25)){let _0x2966f0=_0x6922a8(0x105);if(typeof _0x5b2aa7===_0x6922a8(0x117))_0x2966f0=Number[_0x6922a8(0x121)](_0x5b2aa7)?_0x6922a8(0x138):_0x6922a8(0x135);else{if(typeof _0x5b2aa7===_0x6922a8(0x119))_0x2966f0=_0x6922a8(0x119);else _0x5b2aa7===null&&(_0x2966f0=_0x6922a8(0x105));}_0x33594c[_0x6922a8(0xfd)]({'name':_0x1d2dc1,'type':_0x2966f0});}}return{'queryId':_0x6922a8(0x13b),'columns':_0x33594c,'data':_0x170fcc,'stats':{'state':_0x6922a8(0x104),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x170fcc[_0x6922a8(0x102)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x2a95f9,_0x5c7186){const _0x5e60e1=convertSDKResultToQueryResult(_0x2a95f9);return formatQueryOutput(_0x5e60e1,_0x5c7186);}export async function formatQueryOutput(_0x5ece71,_0x284374){const _0x36ff1e=a56_0x336c,{format:_0x5f115a,limit:_0x28c49d,output:_0x37986a,color:_0x5456fc,noColor:_0x18a9ee,limitStructuredFormats:_0x4580f2}=_0x284374,_0x1701bf=Boolean(_0x37986a)&&!_0x5456fc,_0x448ace={'color':_0x5456fc,'noColor':_0x18a9ee||_0x1701bf};if(_0x5f115a===_0x36ff1e(0x103)){const _0x3197ba=shouldUseLess(_0x5f115a,_0x37986a);return formatAsTable(_0x5ece71,_0x28c49d,_0x3197ba,_0x448ace);}const _0x4a344e=_0x4580f2&&Number[_0x36ff1e(0x137)](_0x28c49d)&&_0x5ece71[_0x36ff1e(0x132)][_0x36ff1e(0x102)]>_0x28c49d?{..._0x5ece71,'data':_0x5ece71[_0x36ff1e(0x132)]['slice'](0x0,_0x28c49d)}:_0x5ece71;if(_0x5f115a===_0x36ff1e(0x10e))return formatAsJSON(_0x4a344e,_0x448ace);else return _0x5f115a===_0x36ff1e(0x113)?formatAsJSONL(_0x4a344e,_0x448ace):formatQueryResult(_0x4a344e,_0x5f115a);}function shouldUseLess(_0x516994,_0x53275a){const _0x62987a=a56_0x336c;return(_0x516994===_0x62987a(0x103)||_0x516994===_0x62987a(0x111))&&process[_0x62987a(0x129)][_0x62987a(0x118)]&&!_0x53275a;}export function resolveOutputOptions(_0x5bdf70){const _0x5108f4=a56_0x336c,_0x13aaee=_0x5bdf70['output']||'',_0x45c7ab=resolveOutputFormat(_0x5bdf70[_0x5108f4(0x116)],_0x13aaee,_0x5108f4(0x103));let _0xc9582f=typeof _0x5bdf70[_0x5108f4(0x10b)]==='number'?_0x5bdf70[_0x5108f4(0x10b)]:parseInt(_0x5bdf70[_0x5108f4(0x10b)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x5bdf70[_0x5108f4(0x10b)]===undefined&&shouldUseLess(_0x45c7ab,_0x13aaee)&&(_0xc9582f=Infinity),{'format':_0x45c7ab,'output':_0x13aaee,'limit':_0xc9582f,'limitStructuredFormats':_0x5bdf70['limitStructuredFormats'],'color':_0x5bdf70[_0x5108f4(0x124)],'noColor':_0x5bdf70[_0x5108f4(0x11f)]};}export function writeOutput(_0xa62316,_0x3b9adf,_0x4fa2bb){const _0x4aa491=a56_0x336c;return _0x3b9adf?(writeFileSync(_0x3b9adf,_0xa62316),console[_0x4aa491(0x13d)](_0x4aa491(0x100)+_0x3b9adf),Promise['resolve']()):shouldUseLess(_0x4fa2bb||'','')?new Promise(_0x54c301=>{const _0xe5f7b3=_0x4aa491,_0x140c67=spawn('less',[_0xe5f7b3(0x125)],{'stdio':['pipe','inherit','inherit']});let _0x437fd7=![];_0x140c67['on']('error',()=>{!_0x437fd7&&(_0x437fd7=!![],console['log'](_0xa62316),_0x54c301());}),_0x140c67['on'](_0xe5f7b3(0x107),()=>{!_0x437fd7&&(_0x437fd7=!![],_0x54c301());}),_0x140c67['on']('spawn',()=>{const _0x32d4f3=_0xe5f7b3;!_0x437fd7&&_0x140c67[_0x32d4f3(0x134)]&&(_0x140c67[_0x32d4f3(0x134)]['on'](_0x32d4f3(0x13d),()=>{}),_0x140c67[_0x32d4f3(0x134)][_0x32d4f3(0x13f)](_0xa62316),_0x140c67[_0x32d4f3(0x134)][_0x32d4f3(0x11c)]());}),!_0x140c67[_0xe5f7b3(0x134)]&&(!_0x437fd7&&(_0x437fd7=!![],console['log'](_0xa62316),_0x54c301()));}):(console[_0x4aa491(0xfc)](_0xa62316),Promise['resolve']());}export async function handleSDKOutput(_0x3c96e9,_0x573585){const _0x145057=a56_0x336c,_0x2b344b=resolveOutputOptions(_0x573585),_0x4c4a1c=await formatSDKOutput(_0x3c96e9,_0x2b344b);await writeOutput(_0x4c4a1c,_0x2b344b[_0x145057(0x12b)]||undefined,_0x2b344b[_0x145057(0x116)]);}function a56_0x336c(_0x5784da,_0x18f4c7){_0x5784da=_0x5784da-0xf9;const _0xb92076=a56_0xb920();let _0x336c1d=_0xb92076[_0x5784da];return _0x336c1d;}export async function handleQueryOutput(_0x41d2f1,_0xb0e772){const _0xc4a957=a56_0x336c,_0x33d70d=resolveOutputOptions(_0xb0e772),_0x3c4f10=await formatQueryOutput(_0x41d2f1,_0x33d70d);await writeOutput(_0x3c4f10,_0x33d70d[_0xc4a957(0x12b)]||undefined,_0x33d70d[_0xc4a957(0x116)]);}async function formatSingleObject(_0x20ca43,_0x10502e){const _0x49ad3c=a56_0x336c,{format:_0x19d3de,color:_0x5f48a3,noColor:_0xbb4de6}=_0x10502e,_0x12fddb={'color':_0x5f48a3,'noColor':_0xbb4de6};if(_0x19d3de===_0x49ad3c(0x10e)){if(shouldUseColor(_0x12fddb))return colorizeJSON(_0x20ca43,_0x12fddb);return JSON[_0x49ad3c(0xfa)](_0x20ca43,null,0x2);}else{if(_0x19d3de===_0x49ad3c(0x113)){if(shouldUseColor(_0x12fddb))return colorizeJSONCompact(_0x20ca43,_0x12fddb);return JSON[_0x49ad3c(0xfa)](_0x20ca43);}else{if(_0x19d3de===_0x49ad3c(0x10c))return Object['entries'](_0x20ca43)[_0x49ad3c(0x101)](([_0x24d1d5,_0x5f57ba])=>_0x24d1d5+'\x09'+_0x5f57ba)['join']('\x0a');else{const _0x33a62f=Object[_0x49ad3c(0xf9)](_0x20ca43);if(_0x33a62f[_0x49ad3c(0x102)]===0x0)return _0x49ad3c(0x13c);const _0x2d31b1=_0x20ca43[_0x49ad3c(0x126)],_0x1bc394=_0x20ca43[_0x49ad3c(0x11e)],_0x11c5ca=_0x20ca43[_0x49ad3c(0xfb)],_0x548583=_0x20ca43[_0x49ad3c(0x120)],_0x91be4e=_0x1bc394?typeof _0x1bc394===_0x49ad3c(0xfe)?_0x1bc394:JSON[_0x49ad3c(0xfa)](_0x1bc394,null,0x2):undefined,_0x43d286=_0x11c5ca&&Object[_0x49ad3c(0x133)](_0x11c5ca)[_0x49ad3c(0x102)]>0x0?JSON[_0x49ad3c(0xfa)](_0x11c5ca,null,0x2):undefined,_0x4e53e6=_0x548583&&Object[_0x49ad3c(0x133)](_0x548583)[_0x49ad3c(0x102)]>0x0?JSON[_0x49ad3c(0xfa)](_0x548583,null,0x2):undefined,_0x41bfc3=_0x33a62f[_0x49ad3c(0x127)](([_0x10c821])=>_0x10c821!==_0x49ad3c(0x126)&&_0x10c821!==_0x49ad3c(0x11e)&&_0x10c821!==_0x49ad3c(0xfb)&&_0x10c821!==_0x49ad3c(0x120)),_0x286126=Math[_0x49ad3c(0x12c)](..._0x41bfc3[_0x49ad3c(0x101)](([_0x40028e])=>_0x40028e[_0x49ad3c(0x102)])),_0x212504=Math[_0x49ad3c(0x12c)](..._0x41bfc3[_0x49ad3c(0x101)](([,_0xcf1e03])=>{const _0x1baf17=_0x49ad3c;try{const _0x59516d=_0xcf1e03===null||_0xcf1e03===undefined?'':typeof _0xcf1e03===_0x1baf17(0x139)?JSON['stringify'](_0xcf1e03):String(_0xcf1e03),_0x167946=_0x59516d[_0x1baf17(0x10f)]('\x0a');return Math[_0x1baf17(0x12c)](..._0x167946[_0x1baf17(0x101)](_0xb25918=>_0xb25918[_0x1baf17(0x102)]),0x0);}catch{return 0x0;}}),0x14),_0x42638f=[];_0x42638f[_0x49ad3c(0xfd)](colorBorder('┌─'+'─'['repeat'](_0x286126)+_0x49ad3c(0x128)+'─'[_0x49ad3c(0x13a)](_0x212504)+'─┐',_0x12fddb)),_0x41bfc3[_0x49ad3c(0x140)](([_0x467ca1,_0x2d259e])=>{const _0x3afa2d=_0x49ad3c;let _0x389280;try{_0x389280=_0x2d259e===null||_0x2d259e===undefined?'':typeof _0x2d259e===_0x3afa2d(0x139)?JSON[_0x3afa2d(0xfa)](_0x2d259e):String(_0x2d259e);}catch{_0x389280=_0x3afa2d(0x115);}const _0x321458=_0x467ca1[_0x3afa2d(0x10d)](_0x286126),_0x23c761=_0x389280['split']('\x0a');_0x23c761['forEach']((_0x4ed299,_0x9f6380)=>{const _0x44a840=_0x3afa2d,_0x592c1c=colorBorder('│',_0x12fddb);_0x9f6380===0x0?_0x42638f[_0x44a840(0xfd)](_0x592c1c+'\x20'+_0x321458+'\x20'+_0x592c1c+'\x20'+_0x4ed299[_0x44a840(0x10d)](_0x212504)+'\x20'+_0x592c1c):_0x42638f[_0x44a840(0xfd)](_0x592c1c+'\x20'+'\x20'['repeat'](_0x286126)+'\x20'+_0x592c1c+'\x20'+_0x4ed299[_0x44a840(0x10d)](_0x212504)+'\x20'+_0x592c1c);});}),_0x42638f[_0x49ad3c(0xfd)](colorBorder('└─'+'─'['repeat'](_0x286126)+'─┴─'+'─'[_0x49ad3c(0x13a)](_0x212504)+'─┘',_0x12fddb));_0x91be4e&&(_0x42638f['push'](''),_0x42638f[_0x49ad3c(0xfd)](String(a56_0x528313[_0x49ad3c(0x130)][_0x49ad3c(0x109)](_0x49ad3c(0x12f)))),_0x42638f[_0x49ad3c(0xfd)](_0x91be4e));_0x43d286&&(_0x42638f['push'](''),_0x42638f[_0x49ad3c(0xfd)](String(a56_0x528313[_0x49ad3c(0x12d)][_0x49ad3c(0x109)](_0x49ad3c(0x12a)))),_0x42638f['push'](_0x43d286));_0x4e53e6&&(_0x42638f[_0x49ad3c(0xfd)](''),_0x42638f[_0x49ad3c(0xfd)](String(a56_0x528313[_0x49ad3c(0x106)][_0x49ad3c(0x109)](_0x49ad3c(0x11d)))),_0x42638f[_0x49ad3c(0xfd)](_0x4e53e6));if(_0x2d31b1){if(_0x2d31b1[_0x49ad3c(0x122)]){_0x42638f[_0x49ad3c(0xfd)](''),_0x42638f['push'](String(a56_0x528313[_0x49ad3c(0x142)]['bold'](_0x49ad3c(0x112))));const _0x20356f=_0x2d31b1[_0x49ad3c(0x122)]['split']('\x0a');_0x20356f[_0x49ad3c(0x140)](_0x1e5fa1=>{const _0x2f82b3=_0x49ad3c;_0x1e5fa1[_0x2f82b3(0x12e)]()&&_0x42638f['push'](_0x1e5fa1);});}if(_0x2d31b1[_0x49ad3c(0x141)]){_0x42638f[_0x49ad3c(0xfd)](''),_0x42638f[_0x49ad3c(0xfd)](String(a56_0x528313[_0x49ad3c(0x136)][_0x49ad3c(0x109)]('[logs]')));const _0x5ad9d=_0x2d31b1['cmdout']['split']('\x0a');_0x5ad9d[_0x49ad3c(0x140)](_0x370729=>{const _0x53b003=_0x49ad3c;_0x370729[_0x53b003(0x12e)]()&&_0x42638f[_0x53b003(0xfd)](_0x370729);});}}return _0x42638f[_0x49ad3c(0x108)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5520f6,_0x1a9c94){const _0xe976be=a56_0x336c;if(_0x1a9c94[_0xe976be(0x116)]===_0xe976be(0x103)){await handleSDKOutput([_0x5520f6],_0x1a9c94);return;}const _0x2dbf9e=resolveOutputOptions(_0x1a9c94),_0x4592cd=await formatSingleObject(_0x5520f6,_0x2dbf9e);await writeOutput(_0x4592cd,_0x2dbf9e[_0xe976be(0x12b)]||undefined,_0x2dbf9e['format']);}
1
+ (function(_0x31e57d,_0x269d67){const _0x585620=a56_0x22c8,_0x53c395=_0x31e57d();while(!![]){try{const _0x19a641=parseInt(_0x585620(0x200))/0x1*(-parseInt(_0x585620(0x1f2))/0x2)+parseInt(_0x585620(0x212))/0x3+-parseInt(_0x585620(0x218))/0x4*(parseInt(_0x585620(0x1ec))/0x5)+-parseInt(_0x585620(0x1f0))/0x6+-parseInt(_0x585620(0x1e7))/0x7*(parseInt(_0x585620(0x201))/0x8)+parseInt(_0x585620(0x1dd))/0x9+-parseInt(_0x585620(0x1da))/0xa*(-parseInt(_0x585620(0x1fd))/0xb);if(_0x19a641===_0x269d67)break;else _0x53c395['push'](_0x53c395['shift']());}catch(_0x15e237){_0x53c395['push'](_0x53c395['shift']());}}}(a56_0x5536,0xefe3e));import{writeFileSync}from'fs';function a56_0x22c8(_0x15cfde,_0x53b32b){_0x15cfde=_0x15cfde-0x1d5;const _0x553630=a56_0x5536();let _0x22c80b=_0x553630[_0x15cfde];return _0x22c80b;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x186369 from'chalk';function a56_0x5536(){const _0x473e4e=['bigint','end','stdout','3363261DYadep','split','limitStructuredFormats','spawn','isInteger','slice','12GILrjF','[error]','max','isFinite','inherit','join','magenta','padEnd','push','jsonl','rule','less','debug','color','list','3372860maidLo','length','write','465822RJUVVw','FINISHED','varchar','stringify','bold','cmdout','No\x20data','[logs]','trim','pipe','11885776sGUWpF','forEach','map','─┬─','stderr','1551265WavRbO','limit','json','close','1293726LuxAWC','[query]','26HDNgeL','output','sdk-result','query','filter','keys','number','repeat','stdin','log','entries','143YlOpwJ','[rule]','tsv','133125cQiAyt','8VzBwCE','error','red','double','cyan','noColor','Results\x20saved\x20to\x20','format','isTTY','resolve','object','params','table','yellow'];a56_0x5536=function(){return _0x473e4e;};return a56_0x5536();}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3a7ace){const _0x3fcc6b=a56_0x22c8;return _0x3a7ace[_0x3fcc6b(0x208)]===_0x3fcc6b(0x1ee)||_0x3a7ace['format']==='jsonl'||_0x3a7ace['format']===_0x3fcc6b(0x1ff)||_0x3a7ace[_0x3fcc6b(0x208)]===_0x3fcc6b(0x20d)||_0x3a7ace[_0x3fcc6b(0x1ee)]===!![]||_0x3a7ace[_0x3fcc6b(0x221)]===!![]||_0x3a7ace[_0x3fcc6b(0x1ff)]===!![]||_0x3a7ace[_0x3fcc6b(0x20d)]===!![];}export function parseOutputOptions(_0x2a2640){const _0x3d4cfb=a56_0x22c8;return{'format':_0x2a2640['format']||_0x3d4cfb(0x20d),'output':_0x2a2640[_0x3d4cfb(0x1f3)]||'','limit':_0x2a2640[_0x3d4cfb(0x1ed)],'limitStructuredFormats':_0x2a2640[_0x3d4cfb(0x214)],'color':_0x2a2640[_0x3d4cfb(0x1d8)],'noColor':_0x2a2640[_0x3d4cfb(0x206)]};}function convertSDKResultToQueryResult(_0x1c4c32){const _0x55671d=a56_0x22c8,_0x1247d5=[];if(_0x1c4c32[_0x55671d(0x1db)]>0x0){const _0x28d963=_0x1c4c32[0x0];for(const [_0x3d6298,_0x371bfc]of Object[_0x55671d(0x1fc)](_0x28d963)){let _0x387f92=_0x55671d(0x1df);if(typeof _0x371bfc==='number')_0x387f92=Number[_0x55671d(0x216)](_0x371bfc)?_0x55671d(0x20f):_0x55671d(0x204);else{if(typeof _0x371bfc==='boolean')_0x387f92='boolean';else _0x371bfc===null&&(_0x387f92=_0x55671d(0x1df));}_0x1247d5[_0x55671d(0x220)]({'name':_0x3d6298,'type':_0x387f92});}}return{'queryId':_0x55671d(0x1f4),'columns':_0x1247d5,'data':_0x1c4c32,'stats':{'state':_0x55671d(0x1de),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1c4c32[_0x55671d(0x1db)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5b0dc,_0x56c16a){const _0xb189a4=convertSDKResultToQueryResult(_0x5b0dc);return formatQueryOutput(_0xb189a4,_0x56c16a);}export async function formatQueryOutput(_0x12de53,_0x5514b7){const _0x2a4f29=a56_0x22c8,{format:_0x1edd9b,limit:_0x2a8d13,output:_0x4e42b0,color:_0x101707,noColor:_0x46f38b,limitStructuredFormats:_0x16c2f6}=_0x5514b7,_0x22167a=Boolean(_0x4e42b0)&&!_0x101707,_0x1a28a7={'color':_0x101707,'noColor':_0x46f38b||_0x22167a};if(_0x1edd9b===_0x2a4f29(0x20d)){const _0x1bbef3=shouldUseLess(_0x1edd9b,_0x4e42b0);return formatAsTable(_0x12de53,_0x2a8d13,_0x1bbef3,_0x1a28a7);}const _0x3278f9=_0x16c2f6&&Number[_0x2a4f29(0x21b)](_0x2a8d13)&&_0x12de53['data'][_0x2a4f29(0x1db)]>_0x2a8d13?{..._0x12de53,'data':_0x12de53['data'][_0x2a4f29(0x217)](0x0,_0x2a8d13)}:_0x12de53;if(_0x1edd9b===_0x2a4f29(0x1ee))return formatAsJSON(_0x3278f9,_0x1a28a7);else return _0x1edd9b===_0x2a4f29(0x221)?formatAsJSONL(_0x3278f9,_0x1a28a7):formatQueryResult(_0x3278f9,_0x1edd9b);}function shouldUseLess(_0x554b39,_0x44990a){const _0xd589c0=a56_0x22c8;return(_0x554b39===_0xd589c0(0x20d)||_0x554b39===_0xd589c0(0x1d9))&&process[_0xd589c0(0x211)][_0xd589c0(0x209)]&&!_0x44990a;}export function resolveOutputOptions(_0x2997d3){const _0x272b31=a56_0x22c8,_0xf9e707=_0x2997d3[_0x272b31(0x1f3)]||'',_0x7ace21=resolveOutputFormat(_0x2997d3[_0x272b31(0x208)],_0xf9e707,'table');let _0x2c69fc=typeof _0x2997d3['limit']===_0x272b31(0x1f8)?_0x2997d3[_0x272b31(0x1ed)]:parseInt(_0x2997d3[_0x272b31(0x1ed)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2997d3[_0x272b31(0x1ed)]===undefined&&shouldUseLess(_0x7ace21,_0xf9e707)&&(_0x2c69fc=Infinity),{'format':_0x7ace21,'output':_0xf9e707,'limit':_0x2c69fc,'limitStructuredFormats':_0x2997d3[_0x272b31(0x214)],'color':_0x2997d3[_0x272b31(0x1d8)],'noColor':_0x2997d3[_0x272b31(0x206)]};}export function writeOutput(_0x23a767,_0x41120a,_0x219107){const _0x8086dc=a56_0x22c8;return _0x41120a?(writeFileSync(_0x41120a,_0x23a767),console[_0x8086dc(0x202)](_0x8086dc(0x207)+_0x41120a),Promise['resolve']()):shouldUseLess(_0x219107||'','')?new Promise(_0x4c2fa9=>{const _0x32c513=_0x8086dc,_0x58af7b=spawn(_0x32c513(0x1d6),['-FXRSn'],{'stdio':[_0x32c513(0x1e6),_0x32c513(0x21c),_0x32c513(0x21c)]});let _0x118c35=![];_0x58af7b['on'](_0x32c513(0x202),()=>{const _0x1ac9b6=_0x32c513;!_0x118c35&&(_0x118c35=!![],console[_0x1ac9b6(0x1fb)](_0x23a767),_0x4c2fa9());}),_0x58af7b['on'](_0x32c513(0x1ef),()=>{!_0x118c35&&(_0x118c35=!![],_0x4c2fa9());}),_0x58af7b['on'](_0x32c513(0x215),()=>{const _0x487db3=_0x32c513;!_0x118c35&&_0x58af7b['stdin']&&(_0x58af7b['stdin']['on'](_0x487db3(0x202),()=>{}),_0x58af7b['stdin'][_0x487db3(0x1dc)](_0x23a767),_0x58af7b[_0x487db3(0x1fa)][_0x487db3(0x210)]());}),!_0x58af7b[_0x32c513(0x1fa)]&&(!_0x118c35&&(_0x118c35=!![],console['log'](_0x23a767),_0x4c2fa9()));}):(console[_0x8086dc(0x1fb)](_0x23a767),Promise[_0x8086dc(0x20a)]());}export async function handleSDKOutput(_0xdd1940,_0x351d7e){const _0x15a0a3=a56_0x22c8,_0x3896c2=resolveOutputOptions(_0x351d7e),_0x5c8ab3=await formatSDKOutput(_0xdd1940,_0x3896c2);await writeOutput(_0x5c8ab3,_0x3896c2[_0x15a0a3(0x1f3)]||undefined,_0x3896c2[_0x15a0a3(0x208)]);}export async function handleQueryOutput(_0x2a0a16,_0x3f11d2){const _0x1a0fe9=a56_0x22c8,_0x40af89=resolveOutputOptions(_0x3f11d2),_0x20bebd=await formatQueryOutput(_0x2a0a16,_0x40af89);await writeOutput(_0x20bebd,_0x40af89['output']||undefined,_0x40af89[_0x1a0fe9(0x208)]);}async function formatSingleObject(_0x31df83,_0x4fdef0){const _0x152571=a56_0x22c8,{format:_0xff209f,color:_0x5191b1,noColor:_0xcf8a4f}=_0x4fdef0,_0x157bed={'color':_0x5191b1,'noColor':_0xcf8a4f};if(_0xff209f===_0x152571(0x1ee)){if(shouldUseColor(_0x157bed))return colorizeJSON(_0x31df83,_0x157bed);return JSON[_0x152571(0x1e0)](_0x31df83,null,0x2);}else{if(_0xff209f===_0x152571(0x221)){if(shouldUseColor(_0x157bed))return colorizeJSONCompact(_0x31df83,_0x157bed);return JSON[_0x152571(0x1e0)](_0x31df83);}else{if(_0xff209f===_0x152571(0x1ff))return Object[_0x152571(0x1fc)](_0x31df83)[_0x152571(0x1e9)](([_0x435976,_0x8f3565])=>_0x435976+'\x09'+_0x8f3565)[_0x152571(0x21d)]('\x0a');else{const _0x79195d=Object[_0x152571(0x1fc)](_0x31df83);if(_0x79195d['length']===0x0)return _0x152571(0x1e3);const _0x2035d9=_0x31df83[_0x152571(0x1d7)],_0x3b12e6=_0x31df83[_0x152571(0x1f5)],_0x100bd6=_0x31df83[_0x152571(0x20c)],_0x1de7ed=_0x31df83[_0x152571(0x1d5)],_0x1a0890=_0x3b12e6?typeof _0x3b12e6==='string'?_0x3b12e6:JSON[_0x152571(0x1e0)](_0x3b12e6,null,0x2):undefined,_0x23424c=_0x100bd6&&Object[_0x152571(0x1f7)](_0x100bd6)[_0x152571(0x1db)]>0x0?JSON[_0x152571(0x1e0)](_0x100bd6,null,0x2):undefined,_0x36e8a4=_0x1de7ed&&Object[_0x152571(0x1f7)](_0x1de7ed)[_0x152571(0x1db)]>0x0?JSON[_0x152571(0x1e0)](_0x1de7ed,null,0x2):undefined,_0x50431d=_0x79195d[_0x152571(0x1f6)](([_0x372be1])=>_0x372be1!==_0x152571(0x1d7)&&_0x372be1!==_0x152571(0x1f5)&&_0x372be1!==_0x152571(0x20c)&&_0x372be1!==_0x152571(0x1d5)),_0x505683=Math[_0x152571(0x21a)](..._0x50431d[_0x152571(0x1e9)](([_0x4272f1])=>_0x4272f1[_0x152571(0x1db)])),_0x1ab68d=Math[_0x152571(0x21a)](..._0x50431d[_0x152571(0x1e9)](([,_0x4fa36c])=>{const _0x2f2c0f=_0x152571;try{const _0x660b9b=_0x4fa36c===null||_0x4fa36c===undefined?'':typeof _0x4fa36c===_0x2f2c0f(0x20b)?JSON[_0x2f2c0f(0x1e0)](_0x4fa36c):String(_0x4fa36c),_0x33d034=_0x660b9b[_0x2f2c0f(0x213)]('\x0a');return Math['max'](..._0x33d034[_0x2f2c0f(0x1e9)](_0x50c63a=>_0x50c63a[_0x2f2c0f(0x1db)]),0x0);}catch{return 0x0;}}),0x14),_0x2faa55=[];_0x2faa55[_0x152571(0x220)](colorBorder('┌─'+'─'[_0x152571(0x1f9)](_0x505683)+_0x152571(0x1ea)+'─'[_0x152571(0x1f9)](_0x1ab68d)+'─┐',_0x157bed)),_0x50431d[_0x152571(0x1e8)](([_0x40be9d,_0x2cb70a])=>{const _0x11c528=_0x152571;let _0xd78317;try{_0xd78317=_0x2cb70a===null||_0x2cb70a===undefined?'':typeof _0x2cb70a===_0x11c528(0x20b)?JSON[_0x11c528(0x1e0)](_0x2cb70a):String(_0x2cb70a);}catch{_0xd78317='[Object]';}const _0x154353=_0x40be9d[_0x11c528(0x21f)](_0x505683),_0xc59852=_0xd78317[_0x11c528(0x213)]('\x0a');_0xc59852[_0x11c528(0x1e8)]((_0x3a5878,_0x29fbe5)=>{const _0x57cfe0=_0x11c528,_0x3ce395=colorBorder('│',_0x157bed);_0x29fbe5===0x0?_0x2faa55[_0x57cfe0(0x220)](_0x3ce395+'\x20'+_0x154353+'\x20'+_0x3ce395+'\x20'+_0x3a5878[_0x57cfe0(0x21f)](_0x1ab68d)+'\x20'+_0x3ce395):_0x2faa55[_0x57cfe0(0x220)](_0x3ce395+'\x20'+'\x20'[_0x57cfe0(0x1f9)](_0x505683)+'\x20'+_0x3ce395+'\x20'+_0x3a5878[_0x57cfe0(0x21f)](_0x1ab68d)+'\x20'+_0x3ce395);});}),_0x2faa55[_0x152571(0x220)](colorBorder('└─'+'─'[_0x152571(0x1f9)](_0x505683)+'─┴─'+'─'[_0x152571(0x1f9)](_0x1ab68d)+'─┘',_0x157bed));_0x1a0890&&(_0x2faa55[_0x152571(0x220)](''),_0x2faa55[_0x152571(0x220)](String(a56_0x186369[_0x152571(0x20e)]['bold'](_0x152571(0x1f1)))),_0x2faa55[_0x152571(0x220)](_0x1a0890));_0x23424c&&(_0x2faa55[_0x152571(0x220)](''),_0x2faa55[_0x152571(0x220)](String(a56_0x186369['blue'][_0x152571(0x1e1)]('[params]'))),_0x2faa55[_0x152571(0x220)](_0x23424c));_0x36e8a4&&(_0x2faa55[_0x152571(0x220)](''),_0x2faa55['push'](String(a56_0x186369[_0x152571(0x21e)][_0x152571(0x1e1)](_0x152571(0x1fe)))),_0x2faa55['push'](_0x36e8a4));if(_0x2035d9){if(_0x2035d9[_0x152571(0x1eb)]){_0x2faa55['push'](''),_0x2faa55[_0x152571(0x220)](String(a56_0x186369[_0x152571(0x203)][_0x152571(0x1e1)](_0x152571(0x219))));const _0x364ce5=_0x2035d9[_0x152571(0x1eb)][_0x152571(0x213)]('\x0a');_0x364ce5[_0x152571(0x1e8)](_0x131c78=>{const _0x335cab=_0x152571;_0x131c78[_0x335cab(0x1e5)]()&&_0x2faa55[_0x335cab(0x220)](_0x131c78);});}if(_0x2035d9[_0x152571(0x1e2)]){_0x2faa55[_0x152571(0x220)](''),_0x2faa55['push'](String(a56_0x186369[_0x152571(0x205)][_0x152571(0x1e1)](_0x152571(0x1e4))));const _0x5c2ad9=_0x2035d9[_0x152571(0x1e2)][_0x152571(0x213)]('\x0a');_0x5c2ad9[_0x152571(0x1e8)](_0x1d0b76=>{_0x1d0b76['trim']()&&_0x2faa55['push'](_0x1d0b76);});}}return _0x2faa55[_0x152571(0x21d)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x13e75c,_0x2f467f){const _0x3ab84a=a56_0x22c8;if(_0x2f467f[_0x3ab84a(0x208)]===_0x3ab84a(0x20d)){await handleSDKOutput([_0x13e75c],_0x2f467f);return;}const _0x4e5766=resolveOutputOptions(_0x2f467f),_0x4f6c4f=await formatSingleObject(_0x13e75c,_0x4e5766);await writeOutput(_0x4f6c4f,_0x4e5766[_0x3ab84a(0x1f3)]||undefined,_0x4e5766[_0x3ab84a(0x208)]);}