@treasuredata/tdx 2026.3.14 → 2026.3.16

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 (202) hide show
  1. package/README.md +9 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/commands/activations.js +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-test-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/query/index.js +1 -1
  127. package/dist/sdk/query/sql-parser.js +1 -1
  128. package/dist/sdk/realtime.js +1 -1
  129. package/dist/sdk/schedule.js +1 -1
  130. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  131. package/dist/sdk/segment/fields-display.js +1 -1
  132. package/dist/sdk/segment/file-discovery.js +1 -1
  133. package/dist/sdk/segment/journey-utils.js +1 -1
  134. package/dist/sdk/segment/journey-validator.js +1 -1
  135. package/dist/sdk/segment/journey-yaml.js +1 -1
  136. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  137. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  138. package/dist/sdk/segment/pull-workflow.js +1 -1
  139. package/dist/sdk/segment/push-recovery.js +1 -1
  140. package/dist/sdk/segment/push-workflow.js +1 -1
  141. package/dist/sdk/segment/resolution-context.js +1 -1
  142. package/dist/sdk/segment/segment-path-parser.js +1 -1
  143. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  144. package/dist/sdk/segment/segment-validator.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/types/activation-schema.js +1 -1
  148. package/dist/sdk/segment/types/journey-def.js +1 -1
  149. package/dist/sdk/segment/types/journey-schema.js +1 -1
  150. package/dist/sdk/segment/types/segment-def.js +1 -1
  151. package/dist/sdk/segment/types/segment-schema.js +1 -1
  152. package/dist/sdk/segment/validate-files.js +1 -1
  153. package/dist/sdk/segment/yaml-validator.js +1 -1
  154. package/dist/sdk/segment.js +1 -1
  155. package/dist/sdk/types/index.js +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/paginate.js +1 -1
  162. package/dist/sdk/util/tree-formatter.js +1 -1
  163. package/dist/sdk/workflow/archive-validation.js +1 -1
  164. package/dist/sdk/workflow/clone-workflow.js +1 -1
  165. package/dist/sdk/workflow/index.js +1 -1
  166. package/dist/sdk/workflow/pull-workflow.js +1 -1
  167. package/dist/sdk/workflow/push-workflow.js +1 -1
  168. package/dist/sdk/workflow/tdx-config.js +1 -1
  169. package/dist/sdk/workflow/workflow-utils.js +1 -1
  170. package/dist/test-utils/command-runner.js +1 -1
  171. package/dist/test-utils/factories.js +1 -1
  172. package/dist/test-utils/fixtures.js +1 -1
  173. package/dist/test-utils/http-mock.js +1 -1
  174. package/dist/test-utils/index.js +1 -1
  175. package/dist/utils/async.js +1 -1
  176. package/dist/utils/colors.js +1 -1
  177. package/dist/utils/diff.js +1 -1
  178. package/dist/utils/file-permissions.js +1 -1
  179. package/dist/utils/file-reader.js +1 -1
  180. package/dist/utils/github-releases.js +1 -1
  181. package/dist/utils/global-cache.js +1 -1
  182. package/dist/utils/json-loader.js +1 -1
  183. package/dist/utils/local-cache.js +1 -1
  184. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  185. package/dist/utils/logger/formatters/index.js +1 -1
  186. package/dist/utils/logger/handlers/console-handler.js +1 -1
  187. package/dist/utils/logger/handlers/file-handler.js +1 -1
  188. package/dist/utils/logger/handlers/index.js +1 -1
  189. package/dist/utils/logger/handlers/null-handler.js +1 -1
  190. package/dist/utils/logger/index.js +1 -1
  191. package/dist/utils/logger/logger.js +1 -1
  192. package/dist/utils/logger/types.js +1 -1
  193. package/dist/utils/option-validation.js +1 -1
  194. package/dist/utils/process.js +1 -1
  195. package/dist/utils/prompt.js +1 -1
  196. package/dist/utils/spinner.js +1 -1
  197. package/dist/utils/sse-parser.js +1 -1
  198. package/dist/utils/string-utils.js +1 -1
  199. package/dist/utils/table-ref-parser.js +1 -1
  200. package/dist/utils/tdx-logger.js +1 -1
  201. package/dist/utils/version-check.js +1 -1
  202. package/package.json +2 -2
@@ -1 +1 @@
1
- const a51_0x64d48f=a51_0x483a;(function(_0x40e429,_0xaa7b4f){const _0x2464d3=a51_0x483a,_0x10ec11=_0x40e429();while(!![]){try{const _0x3bbc89=parseInt(_0x2464d3(0x18e))/0x1+-parseInt(_0x2464d3(0x195))/0x2*(-parseInt(_0x2464d3(0x221))/0x3)+parseInt(_0x2464d3(0x2e4))/0x4*(-parseInt(_0x2464d3(0x1c7))/0x5)+parseInt(_0x2464d3(0x1be))/0x6+-parseInt(_0x2464d3(0x2f9))/0x7+parseInt(_0x2464d3(0x26f))/0x8+parseInt(_0x2464d3(0x2b5))/0x9*(-parseInt(_0x2464d3(0x1ec))/0xa);if(_0x3bbc89===_0xaa7b4f)break;else _0x10ec11['push'](_0x10ec11['shift']());}catch(_0x33ae17){_0x10ec11['push'](_0x10ec11['shift']());}}}(a51_0x5dbb,0xe2666));import a51_0x5af198 from'chalk';import{existsSync}from'fs';import a51_0x2409f9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x396bfc from'prompts';function a51_0x483a(_0x5afd5c,_0x397b0c){_0x5afd5c=_0x5afd5c-0x16e;const _0x5dbbd0=a51_0x5dbb();let _0x483a04=_0x5dbbd0[_0x5afd5c];return _0x483a04;}function getAttemptStatusDisplay(_0x2fab74){const _0x439378=a51_0x483a;if(!_0x2fab74)return{'icon':'⏳','text':''};const {done:_0x2f67f1,success:_0x2d96f7,cancelRequested:_0x223918}=_0x2fab74;if(!_0x2f67f1)return _0x223918?{'icon':'🛑','text':a51_0x5af198[_0x439378(0x1f4)]('canceling')}:{'icon':'🔄','text':a51_0x5af198[_0x439378(0x1ef)](_0x439378(0x25a))};if(_0x2d96f7)return{'icon':'✅','text':a51_0x5af198[_0x439378(0x2ef)](_0x439378(0x27f))};return{'icon':'❌','text':a51_0x5af198['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x48cf63,_0x1a6e9c,_0x27ff26=0x0){const _0x48f588=a51_0x483a;return _0x48cf63[_0x27ff26]||_0x1a6e9c[_0x48f588(0x307)];}['requireProject'](_0x1b028d,_0x26ae5f,_0x31592a=0x0){const _0x121fa4=a51_0x483a,_0x23e845=this[_0x121fa4(0x1e6)](_0x1b028d,_0x26ae5f,_0x31592a);if(!_0x23e845)return console[_0x121fa4(0x2a9)](a51_0x5af198['red'](_0x121fa4(0x18c)),'Project\x20name\x20is\x20required'),console[_0x121fa4(0x2a9)](a51_0x5af198[_0x121fa4(0x278)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x23e845;}[a51_0x64d48f(0x2b6)](_0x74cecd,_0x174abc){const _0x50f272=a51_0x64d48f;if(_0x74cecd[0x0]){const _0x2b97c8=_0x74cecd[0x0][_0x50f272(0x283)]('.');if(_0x2b97c8[_0x50f272(0x1d8)]===0x1)return{'projectName':_0x2b97c8[0x0],'workflowName':undefined};else return _0x2b97c8['length']===0x2?{'projectName':_0x2b97c8[0x0],'workflowName':_0x2b97c8[0x1]}:(console['error'](a51_0x5af198[_0x50f272(0x23d)]('Error:'),_0x50f272(0x1c8)),null);}return{'projectName':_0x174abc['workflowProject'],'workflowName':undefined};}[a51_0x64d48f(0x17e)](_0x343ccf,_0x23b66d,_0x1e8ff5=0x0){const _0x58001e=a51_0x64d48f;if(_0x343ccf[_0x1e8ff5])return _0x343ccf[_0x1e8ff5];if(_0x23b66d['workflowProject']){const _0x51844e=a51_0x2409f9[_0x58001e(0x1eb)](process[_0x58001e(0x1ab)](),_0x58001e(0x173),_0x23b66d[_0x58001e(0x307)]);if(existsSync(a51_0x2409f9[_0x58001e(0x1eb)](_0x51844e,_0x58001e(0x2a5))))return _0x51844e;}return undefined;}async[a51_0x64d48f(0x284)](_0x3ed677,_0x983ea8,_0x155bbe){const _0x234b0b=a51_0x64d48f;try{const _0xfebef1=await _0x3ed677[_0x234b0b(0x237)][_0x234b0b(0x173)](_0x983ea8,{'limit':0x1});if(_0xfebef1[_0x234b0b(0x1d8)]>0x0){const _0x410960=_0xfebef1[0x0]['id'],_0x208c76=getWorkflowUrl(_0x155bbe,_0x410960);console[_0x234b0b(0x2a9)](_0x234b0b(0x26d)+a51_0x5af198[_0x234b0b(0x1fe)](_0x208c76));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a51_0x64d48f(0x2f2);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1ce);async[a51_0x64d48f(0x1fb)](_0x457131){const _0x45a1e7=a51_0x64d48f,{options:_0x18f0d7,args:_0x454a3d,tdx:_0x2478be}=_0x457131,_0x4a8c52=_0x454a3d[0x0],_0x53519f=_0x18f0d7[_0x45a1e7(0x21c)];if(_0x53519f)return saveSessionContext({'workflow_project':undefined},_0x18f0d7[_0x45a1e7(0x201)]),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x294))),0x0;if(!_0x4a8c52)return console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x23d)](_0x45a1e7(0x18c)),_0x45a1e7(0x182)),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)](_0x45a1e7(0x2ff))),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5de74d=await withSpinner('Resolving\x20project\x20\x27'+_0x4a8c52+_0x45a1e7(0x301),()=>_0x2478be[_0x45a1e7(0x237)][_0x45a1e7(0x25f)](_0x4a8c52),{'verbose':_0x18f0d7[_0x45a1e7(0x210)]}),{name:_0x35b1e0}=_0x5de74d[_0x45a1e7(0x1aa)];return saveSessionContext({'workflow_project':_0x35b1e0},_0x18f0d7['session']),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x1c3)+a51_0x5af198['cyan'](_0x35b1e0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1a7);[a51_0x64d48f(0x252)]='List\x20all\x20workflow\x20projects';async[a51_0x64d48f(0x1fb)](_0x18a70f){const _0x4145c6=a51_0x64d48f,{options:_0x525db5,args:_0x1e9971,tdx:_0x5d443f}=_0x18a70f,_0x243534=_0x1e9971[0x0];_0x525db5[_0x4145c6(0x210)]&&_0x243534&&console[_0x4145c6(0x2a9)](_0x4145c6(0x26e)+_0x243534);const _0xea5fe4=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5d443f['workflow'][_0x4145c6(0x22a)](_0x243534,{'limit':_0x525db5[_0x4145c6(0x1c4)]}),{'verbose':_0x525db5[_0x4145c6(0x210)]});let _0x2bf4a1=_0xea5fe4[_0x4145c6(0x1aa)];_0x2bf4a1[_0x4145c6(0x19c)]((_0x2078e3,_0x5657ca)=>_0x2078e3[_0x4145c6(0x246)][_0x4145c6(0x2fa)](_0x5657ca[_0x4145c6(0x246)]));const _0x387c4e=_0x525db5['limit']||0x64,_0x3b21f2=_0x2bf4a1[_0x4145c6(0x1d8)]>=_0x387c4e?a51_0x5af198['dim'](_0x4145c6(0x2e7)):'';console[_0x4145c6(0x2a9)](_0x4145c6(0x28d)+_0x2bf4a1[_0x4145c6(0x1d8)]+'\x20project'+(_0x2bf4a1[_0x4145c6(0x1d8)]!==0x1?'s':'')+_0x3b21f2);if(_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x1c1)||_0x525db5[_0x4145c6(0x227)]==='jsonl'||_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x236))await handleSDKOutput(_0x2bf4a1,_0x525db5);else{if(_0x2bf4a1[_0x4145c6(0x1d8)]===0x0)_0x243534?console['log'](_0x4145c6(0x1e5)+_0x243534):console[_0x4145c6(0x2a7)]('No\x20workflow\x20projects\x20found');else{const _0x468d1c=_0x2bf4a1['map'](_0x1ce6ab=>{const _0xbf4276=_0x4145c6,_0xccf6bf=_0x1ce6ab[_0xbf4276(0x25d)]?.[_0xbf4276(0x1d2)](_0x48de33=>_0x48de33[_0xbf4276(0x2be)]===_0xbf4276(0x2c1)),_0x8baa6=_0xccf6bf?a51_0x5af198[_0xbf4276(0x278)]('\x20(system)'):'';return _0xbf4276(0x230)+_0x1ce6ab['name']+_0x8baa6;});await writeOutput(_0x468d1c[_0x4145c6(0x1eb)]('\x0a'),_0x525db5['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x22e);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x18b);async[a51_0x64d48f(0x1fb)](_0x5634e7){const _0x227db1=a51_0x64d48f,{options:_0x145451,args:_0x35a9e5,tdx:_0x53b8c1}=_0x5634e7,_0x46070b=this[_0x227db1(0x1e6)](_0x35a9e5,_0x145451);_0x145451[_0x227db1(0x210)]&&_0x46070b&&console[_0x227db1(0x2a9)](_0x227db1(0x2a1)+_0x46070b);const _0x16b56d=await withSpinner(_0x227db1(0x21e),()=>_0x53b8c1[_0x227db1(0x237)][_0x227db1(0x173)](_0x46070b,{'limit':_0x145451[_0x227db1(0x1c4)]}),{'verbose':_0x145451['verbose']});let _0x5596dc=_0x16b56d['data'];_0x5596dc[_0x227db1(0x19c)]((_0x290635,_0x176a7c)=>{const _0x53696e=_0x227db1,_0x1b9909=_0x290635[_0x53696e(0x246)][_0x53696e(0x2fa)](_0x176a7c[_0x53696e(0x246)]);if(_0x1b9909!==0x0)return _0x1b9909;return(_0x290635[_0x53696e(0x29e)]?.[_0x53696e(0x246)]||'')[_0x53696e(0x2fa)](_0x176a7c['project']?.[_0x53696e(0x246)]||'');});const _0xe7bbb3=_0x145451[_0x227db1(0x1c4)]||0x64,_0x5da02b=_0x5596dc['length']>=_0xe7bbb3?a51_0x5af198[_0x227db1(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x227db1(0x2a9)](_0x227db1(0x28d)+_0x5596dc['length']+_0x227db1(0x1bc)+(_0x5596dc[_0x227db1(0x1d8)]!==0x1?'s':'')+_0x5da02b);if(_0x145451['format']==='json'||_0x145451[_0x227db1(0x227)]==='jsonl'||_0x145451[_0x227db1(0x227)]===_0x227db1(0x236))await handleSDKOutput(_0x5596dc,_0x145451);else{if(_0x5596dc[_0x227db1(0x1d8)]===0x0)_0x46070b?console[_0x227db1(0x2a7)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x46070b):console['log'](_0x227db1(0x285));else{const _0x14d5f7=_0x145451[_0x227db1(0x1a4)],_0x316b70=_0x5596dc['map'](_0x5ca997=>{const _0x5b97e3=_0x227db1,_0x4df686=a51_0x5af198['dim']('#'+_0x5ca997['id']),_0x263325=hyperlink(_0x4df686,getWorkflowUrl(_0x14d5f7,_0x5ca997['id'])),_0x4f4251=_0x5ca997[_0x5b97e3(0x29e)]?.[_0x5b97e3(0x246)]?a51_0x5af198[_0x5b97e3(0x278)]('\x20('+_0x5ca997['project']['name']+')'):'';return'📋\x20'+_0x263325+'\x20'+_0x5ca997['name']+_0x4f4251;});await writeOutput(_0x316b70[_0x227db1(0x1eb)]('\x0a'),_0x145451['output'],_0x227db1(0x209));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:sessions';['description']=a51_0x64d48f(0x22f);async['execute'](_0x549501){const _0x41d8da=a51_0x64d48f,{options:_0x2a2167,args:_0x567ff9,tdx:_0x16608b}=_0x549501,_0x54b634=this[_0x41d8da(0x2b6)](_0x567ff9,_0x2a2167);if(!_0x54b634)return 0x1;const {projectName:_0x3d8246,workflowName:_0x131e07}=_0x54b634;if(_0x2a2167['verbose']){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a9)]('Filter:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246&&console[_0x41d8da(0x2a9)](_0x41d8da(0x2d6)+_0x3d8246);const _0x968ee=_0x2a2167[_0x41d8da(0x2f1)];_0x968ee&&console[_0x41d8da(0x2a9)](_0x41d8da(0x17d)+_0x968ee);}let _0x29e87b=0x28;if(process[_0x41d8da(0x289)]['isTTY']&&!_0x2a2167[_0x41d8da(0x172)]&&!_0x2a2167[_0x41d8da(0x227)]){const _0x4bd7db=process['stdout']['rows']||0x28;_0x29e87b=Math[_0x41d8da(0x2d8)](0x14,Math['floor'](_0x4bd7db*0x2/0x3));}const _0x543d78=_0x2a2167[_0x41d8da(0x1c4)]||_0x29e87b,_0x206d03=await withSpinner(_0x41d8da(0x240),()=>_0x16608b['workflow'][_0x41d8da(0x2d0)]({'projectName':_0x3d8246,'workflowName':_0x131e07,'status':_0x2a2167[_0x41d8da(0x2f1)],'fromTime':_0x2a2167[_0x41d8da(0x197)],'toTime':_0x2a2167['to'],'limit':_0x543d78}),{'verbose':_0x2a2167[_0x41d8da(0x210)]}),_0xf4c024=_0x206d03[_0x41d8da(0x1aa)];_0xf4c024[_0x41d8da(0x19c)]((_0x58d909,_0x593b0)=>{const _0x2aa61a=_0x41d8da,_0x530152=_0x58d909[_0x2aa61a(0x200)]||'',_0x3874ce=_0x593b0[_0x2aa61a(0x200)]||'';return _0x3874ce['localeCompare'](_0x530152);});_0xf4c024[_0x41d8da(0x1d8)]>=_0x543d78?console[_0x41d8da(0x2a9)](_0x41d8da(0x1b9)+_0xf4c024[_0x41d8da(0x1d8)]+'\x20sessions\x20'+a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1b1))):console['error'](_0x41d8da(0x28d)+_0xf4c024['length']+_0x41d8da(0x203)+(_0xf4c024[_0x41d8da(0x1d8)]!==0x1?'s':''));if(_0x2a2167[_0x41d8da(0x227)]==='json'||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x18f)||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x236))await handleSDKOutput(_0xf4c024,_0x2a2167);else{if(!process[_0x41d8da(0x289)][_0x41d8da(0x295)]||_0x2a2167[_0x41d8da(0x172)]){if(_0xf4c024[_0x41d8da(0x1d8)]===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)]('No\x20sessions\x20found\x20for:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console['log'](_0x41d8da(0x261));}else{const _0x14475c=_0x2a2167['site'],_0x2a36ee=this[_0x41d8da(0x1b0)](_0xf4c024,_0x14475c);_0x2a2167[_0x41d8da(0x172)]?await writeOutput(_0x2a36ee,_0x2a2167[_0x41d8da(0x172)],'list'):console[_0x41d8da(0x2a7)](_0x2a36ee);}!_0x3d8246&&(console[_0x41d8da(0x2a9)](''),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1a3))),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5af198['dim'](_0x41d8da(0x175))));}else{if(_0xf4c024['length']===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)](_0x41d8da(0x300)+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console[_0x41d8da(0x2a7)](_0x41d8da(0x261));}else await this['navigateSessionsInteractive'](_0xf4c024,_0x549501,_0x3d8246);}}return 0x0;}[a51_0x64d48f(0x1b0)](_0x4e70c6,_0x319666){const _0x2a8a79=a51_0x64d48f,_0x592721=[],_0x587ff2=new Map();let _0x36ef4=Infinity,_0x43d89b=-Infinity;for(const _0x509e92 of _0x4e70c6){if(_0x509e92[_0x2a8a79(0x296)]?.[_0x2a8a79(0x2e3)]){const _0x1d21c0=new Date(_0x509e92[_0x2a8a79(0x296)]['createdAt'])['getTime'](),_0x1fe9b0=_0x509e92[_0x2a8a79(0x296)][_0x2a8a79(0x2d5)]?new Date(_0x509e92['lastAttempt'][_0x2a8a79(0x2d5)])['getTime']():Date['now'](),_0xaa5e11=_0x509e92[_0x2a8a79(0x29e)]?.['name']||_0x2a8a79(0x299);!_0x587ff2[_0x2a8a79(0x286)](_0xaa5e11)&&_0x587ff2['set'](_0xaa5e11,[]),_0x587ff2['get'](_0xaa5e11)[_0x2a8a79(0x235)]({'session':_0x509e92,'startTime':_0x1d21c0,'endTime':_0x1fe9b0,'duration':_0x1fe9b0-_0x1d21c0}),_0x36ef4=Math[_0x2a8a79(0x254)](_0x36ef4,_0x1d21c0),_0x43d89b=Math['max'](_0x43d89b,_0x1fe9b0);}}if(_0x587ff2['size']===0x0)return _0x2a8a79(0x1a2);const _0x4b04be=process[_0x2a8a79(0x289)][_0x2a8a79(0x29a)]||0x78,_0x5b4407=0x1e,_0x573c0b=0x32,_0x53cb75=0x4,_0x47d4da=Math['min'](_0x573c0b,Math[_0x2a8a79(0x2d8)](_0x5b4407,Math[_0x2a8a79(0x23b)](_0x4b04be*0.3))),_0x2273fc=_0x4b04be-_0x47d4da-TIMELINE_CONFIG[_0x2a8a79(0x267)]-0x3-_0x53cb75,_0x56e229=_0x43d89b-_0x36ef4,_0x37dd66=_0x56e229/_0x47d4da,_0x308b11=renderTimeAxis({'startTime':_0x36ef4,'endTime':_0x43d89b,'durationMs':_0x56e229,'msPerChar':_0x37dd66},_0x47d4da),_0xd7836a=[];for(const _0x218fe3 of _0x587ff2[_0x2a8a79(0x2fc)]()){_0xd7836a[_0x2a8a79(0x235)](..._0x218fe3);}_0xd7836a[_0x2a8a79(0x19c)]((_0x460b51,_0x1a91ba)=>_0x1a91ba['startTime']-_0x460b51[_0x2a8a79(0x180)]);const _0x16036c=new Date(_0x36ef4),_0x5dd253=formatDate(_0x16036c),_0x5c63c1=_0x53cb75+TIMELINE_CONFIG[_0x2a8a79(0x23c)]+TIMELINE_CONFIG[_0x2a8a79(0x274)]+_0x2273fc,_0x372cb2='\x20'['repeat'](_0x5c63c1-_0x5dd253['length']),_0x3b960f=_0x372cb2+a51_0x5af198[_0x2a8a79(0x278)](_0x5dd253)+'\x20'+_0x308b11;_0x592721[_0x2a8a79(0x235)](_0x3b960f);const _0x13e4a9=0x16;let _0x3cd4de=0x0;for(const _0x39477b of _0xd7836a){const _0x167974=_0x39477b[_0x2a8a79(0x201)][_0x2a8a79(0x29e)]?.[_0x2a8a79(0x246)]||'?',_0x36a4e7=Math[_0x2a8a79(0x254)](stringWidth(_0x167974),_0x13e4a9);_0x3cd4de=Math[_0x2a8a79(0x2d8)](_0x3cd4de,_0x36a4e7);}for(const _0xebf499 of _0xd7836a){const {session:_0xd1ae4,startTime:_0x17db7a,endTime:_0x2f1444,duration:_0x53296a}=_0xebf499,_0x5c5202=_0xd1ae4[_0x2a8a79(0x29e)]?.['id'],_0x55af63=_0xd1ae4['id'],_0x17090e=_0xd1ae4['project']?.[_0x2a8a79(0x246)]||'?',_0x5a6aad=_0xd1ae4[_0x2a8a79(0x237)]?.[_0x2a8a79(0x246)]||'?';let _0x2d1c0b,_0x1b099d;if(_0xd1ae4[_0x2a8a79(0x296)]){const _0xbf6a9a=_0xd1ae4[_0x2a8a79(0x296)];!_0xbf6a9a[_0x2a8a79(0x2bf)]?(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x30b)]?'🛑':'🔄',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x30b)]?a51_0x5af198[_0x2a8a79(0x1f4)]:a51_0x5af198[_0x2a8a79(0x1ef)]):(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x27f)]?'✅':'❌',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x27f)]?a51_0x5af198['green']:a51_0x5af198[_0x2a8a79(0x23d)]);}else _0x2d1c0b='⏳',_0x1b099d=a51_0x5af198[_0x2a8a79(0x278)];const _0x364e28='#'+_0x55af63,_0x56db5d=_0x5c5202?hyperlink(_0x364e28,getWorkflowSessionUrl(_0x319666,_0x5c5202,_0x55af63)):_0x364e28;let _0x40ab7d=_0x17090e;stringWidth(_0x17090e)>_0x13e4a9&&(_0x40ab7d=_0x17090e[_0x2a8a79(0x22b)](0x0,_0x13e4a9-0x1)+'…');const _0x1167ac=a51_0x5af198[_0x2a8a79(0x278)](_0x40ab7d),_0x2f285c=stringWidth(_0x40ab7d),_0x3f47f8='\x20'[_0x2a8a79(0x2dc)](_0x3cd4de-stringWidth(_0x40ab7d)+0x2),_0x28127e='('+formatElapsed(_0x53296a)+')',_0x52f0f8=stringWidth(_0x28127e),_0x3b4691=stringWidth(_0x364e28),_0x3d5781=_0x3b4691+0x1+_0x2f285c+_0x3f47f8['length'],_0x3a8d0a=_0x2273fc-_0x3d5781-_0x52f0f8-0x1-0x8;let _0x4f86fa=_0x5a6aad;stringWidth(_0x4f86fa)>_0x3a8d0a&&(_0x4f86fa=_0x4f86fa['slice'](0x0,_0x3a8d0a-0x1)+'…');const _0x578315=_0x56db5d+'\x20'+_0x1167ac+_0x3f47f8+_0x4f86fa,_0x1922b3=stringWidth(_0x578315),_0x36fabb=_0x2273fc-_0x1922b3-_0x52f0f8,_0x1cc456=_0x578315+'\x20'[_0x2a8a79(0x2dc)](Math[_0x2a8a79(0x2d8)](0x1,_0x36fabb))+a51_0x5af198['dim'](_0x28127e),_0x3b865f=Math[_0x2a8a79(0x23b)]((_0x17db7a-_0x36ef4)/_0x37dd66),_0xdbd6a=Math[_0x2a8a79(0x23b)]((_0x2f1444-_0x36ef4)/_0x37dd66),_0x3f5d81=Math['max'](_0x3b865f+0x1,_0xdbd6a),_0xf514ea=new Array(_0x47d4da)[_0x2a8a79(0x184)]('\x20');for(let _0x45ef27=_0x3b865f;_0x45ef27<Math['min'](_0x3f5d81,_0x47d4da);_0x45ef27++){_0xf514ea[_0x45ef27]='─';}const _0x3706e1=_0xf514ea[_0x2a8a79(0x2b9)](_0x238c3b=>_0x238c3b==='\x20'?'\x20':_0x1b099d(_0x238c3b))[_0x2a8a79(0x1eb)]('');_0x592721[_0x2a8a79(0x235)](_0x2d1c0b+'\x20'+_0x1cc456+'│'+_0x3706e1+'│');}return _0x592721[_0x2a8a79(0x1eb)]('\x0a');}async[a51_0x64d48f(0x21a)](_0x273890,_0x8bd827,_0x32b070){const _0x558d72=a51_0x64d48f,{options:_0x4c908e,tdx:_0x409aa}=_0x8bd827,_0x20db77=_0x4c908e[_0x558d72(0x1a4)],{timelineRows:_0x34d10f,timeAxisHeader:_0x2769f3}=this[_0x558d72(0x1ac)](_0x273890,_0x20db77),_0x1aabcc=_0x34d10f[_0x558d72(0x1f7)](_0x563666=>_0x563666[_0x558d72(0x2b1)]);if(_0x1aabcc[_0x558d72(0x1d8)]===0x0){const _0x24bd6b=this[_0x558d72(0x1b0)](_0x273890,_0x20db77);console[_0x558d72(0x2a7)](_0x24bd6b);!_0x32b070&&(console[_0x558d72(0x2a9)](''),console[_0x558d72(0x2a9)](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x1a3))),console['error'](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x293))+'or'+a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x175))));return;}_0x2769f3&&console['log'](_0x2769f3);const _0x38af77=_0x34d10f[_0x558d72(0x1f7)](_0x38021c=>_0x38021c[_0x558d72(0x2b1)])['map'](_0x51b780=>({'title':_0x51b780[_0x558d72(0x2bb)],'value':_0x51b780['attemptId']})),_0x1a2d9d=process[_0x558d72(0x289)][_0x558d72(0x26b)]||0x3c,_0x360c82=Math[_0x558d72(0x2d8)](0x28,Math[_0x558d72(0x23b)](_0x1a2d9d*0x2/0x3)),_0x45d272=await a51_0x396bfc({'type':'autocomplete','name':'attemptId','message':_0x558d72(0x1d6),'choices':_0x38af77,'initial':-0x1,'limit':_0x360c82,'clearFirst':!![],'fallback':{'title':_0x558d72(0x2df),'value':null},'suggest':(_0x2fafee,_0x31b083)=>{const _0x1d0012=_0x558d72;if(!_0x2fafee)return Promise[_0x1d0012(0x2ac)](_0x31b083);const _0xfad743=_0x31b083['filter'](_0x19dec7=>{const _0x4300a8=_0x1d0012,_0x8357cd=_0x19dec7;return _0x8357cd[_0x4300a8(0x1bf)][_0x4300a8(0x1af)]()[_0x4300a8(0x248)](_0x2fafee[_0x4300a8(0x1af)]());});return Promise[_0x1d0012(0x2ac)](_0xfad743);}}),_0x5f111d=()=>{const _0x5340ef=_0x558d72;process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e));},_0x45a584=_0x45d272&&_0x45d272[_0x558d72(0x2b1)]&&_0x45d272[_0x558d72(0x2b1)]!==null&&_0x45d272[_0x558d72(0x2b1)][_0x558d72(0x26c)]()!=='';if(!_0x45a584){_0x5f111d(),console[_0x558d72(0x2a7)](a51_0x5af198['dim']('Cancelled'));return;}_0x5f111d();const _0x163929=_0x273890[_0x558d72(0x305)](_0x1245bd=>_0x1245bd['lastAttempt']?.['id']===_0x45d272['attemptId']);if(_0x163929){const _0x321e8=_0x163929[_0x558d72(0x29e)]?.[_0x558d72(0x246)]||'?',_0x35d4a7=_0x163929['workflow']?.[_0x558d72(0x246)]||'?';console['log'](_0x558d72(0x198)+a51_0x5af198[_0x558d72(0x278)](_0x321e8)+_0x558d72(0x24a)+a51_0x5af198[_0x558d72(0x278)](_0x35d4a7));}const _0x28eecf=new WorkflowTimelineCommand();await _0x28eecf['execute']({'args':[],'options':{..._0x4c908e,'attemptId':_0x45d272[_0x558d72(0x2b1)]},'tdx':_0x409aa});}[a51_0x64d48f(0x1ac)](_0x46dcc9,_0x343f3f){const _0x5730c5=a51_0x64d48f,_0x3598d7=new Map();for(const _0x3e2806 of _0x46dcc9){_0x3e2806['id']&&_0x3e2806['lastAttempt']?.['id']&&_0x3598d7[_0x5730c5(0x2a0)](_0x3e2806['id'],_0x3e2806[_0x5730c5(0x296)]['id']);}const _0x49be2e=[];let _0x11c06e='';const _0x58ea23=this[_0x5730c5(0x1b0)](_0x46dcc9,_0x343f3f),_0x4ff878=_0x58ea23['split']('\x0a');for(const _0xd7b3e0 of _0x4ff878){if(_0xd7b3e0['startsWith'](_0x5730c5(0x276))||_0xd7b3e0[_0x5730c5(0x20c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x11c06e=_0xd7b3e0;else{if(_0xd7b3e0[_0x5730c5(0x20c)](/^[✅❌🔄🛑⏳]/)){const _0x1409fa=_0xd7b3e0[_0x5730c5(0x20c)](/#(\d+)/),_0x49077d=_0x1409fa?_0x1409fa[0x1]:null,_0x48e31e=_0x49077d?_0x3598d7[_0x5730c5(0x247)](_0x49077d)||null:null,_0x4239bf=_0x46dcc9['find'](_0x8bf2c5=>_0x8bf2c5['id']===_0x49077d),_0x123432=_0x4239bf?.['project']?.['name']||'';_0x49be2e[_0x5730c5(0x235)]({'displayLine':_0xd7b3e0,'attemptId':_0x48e31e,'projectName':_0x123432});}}}return{'timelineRows':_0x49be2e,'timeAxisHeader':_0x11c06e};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1b4);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2fe);async[a51_0x64d48f(0x1fb)](_0x560329){const _0x1b5410=a51_0x64d48f,{options:_0x2acdf0,args:_0x276d49,tdx:_0x26e401}=_0x560329,_0x58cea7=this[_0x1b5410(0x2b6)](_0x276d49,_0x2acdf0);if(!_0x58cea7)return 0x1;const {projectName:_0x4c3407,workflowName:_0x1faa0b}=_0x58cea7,_0x591d67=_0x2acdf0[_0x1b5410(0x1f2)];if(_0x2acdf0[_0x1b5410(0x210)]){if(_0x4c3407&&_0x1faa0b)console[_0x1b5410(0x2a9)](_0x1b5410(0x242)+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407&&console[_0x1b5410(0x2a9)]('Filter:\x20project='+_0x4c3407);_0x591d67&&console[_0x1b5410(0x2a9)](_0x1b5410(0x232));}const _0x3ab4d8=await withSpinner(_0x1b5410(0x268),()=>_0x26e401[_0x1b5410(0x237)][_0x1b5410(0x204)]({'projectName':_0x4c3407,'workflowName':_0x1faa0b,'includeRetried':_0x591d67,'limit':_0x2acdf0[_0x1b5410(0x1c4)]}),{'verbose':_0x2acdf0[_0x1b5410(0x210)]}),_0x3d4618=_0x3ab4d8[_0x1b5410(0x1aa)],_0x1e6c8f=_0x2acdf0[_0x1b5410(0x1c4)]||0x64,_0x44dd26=_0x3d4618[_0x1b5410(0x1d8)]>=_0x1e6c8f?a51_0x5af198[_0x1b5410(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b5410(0x2a9)]('✔\x20Found\x20'+_0x3d4618['length']+'\x20attempt'+(_0x3d4618['length']!==0x1?'s':'')+_0x44dd26);if(_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x1c1)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x18f)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x236))await handleSDKOutput(_0x3d4618,_0x2acdf0);else{if(_0x3d4618[_0x1b5410(0x1d8)]===0x0){if(_0x4c3407&&_0x1faa0b)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407?console[_0x1b5410(0x2a7)](_0x1b5410(0x253)+_0x4c3407):console[_0x1b5410(0x2a7)]('No\x20attempts\x20found');}else{const _0x55e19a=_0x2acdf0[_0x1b5410(0x1a4)],_0x3f8cbe=_0x3d4618[_0x1b5410(0x2b9)](_0x4745c9=>{const _0x370607=_0x1b5410,_0x40a357=a51_0x5af198['dim']('#'+_0x4745c9['id']),_0x476f34=_0x4745c9[_0x370607(0x29e)]?.['id'],_0x424517=_0x4745c9['session_id']||_0x4745c9[_0x370607(0x17c)],_0x6301c9=_0x476f34&&_0x424517?hyperlink(_0x40a357,getWorkflowAttemptUrl(_0x55e19a,_0x476f34,_0x424517,_0x4745c9['id'])):_0x40a357,{icon:_0x593ecb,text:_0x5d7c83}=getAttemptStatusDisplay(_0x4745c9),_0x1ce929=(_0x4745c9[_0x370607(0x29e)]?.[_0x370607(0x246)]||'?')+'.'+(_0x4745c9['workflow']?.[_0x370607(0x246)]||'?'),_0x82c5a6=_0x4745c9[_0x370607(0x200)]?a51_0x5af198[_0x370607(0x278)](_0x4745c9[_0x370607(0x200)]):'';return(_0x6301c9+'\x20'+_0x593ecb+(_0x5d7c83?'\x20'+_0x5d7c83:'')+'\x20'+_0x1ce929+'\x20'+_0x82c5a6)[_0x370607(0x24e)]();});await writeOutput(_0x3f8cbe[_0x1b5410(0x1eb)]('\x0a'),_0x2acdf0['output'],_0x1b5410(0x209));}}return 0x0;}}function a51_0x5dbb(){const _0x101345=['fileSize','Error:\x20Invalid\x20parameter\x20format:\x20','\x20has\x20no\x20attempts','join','611930zFBeqx','\x20\x20Changes:\x20','existingProjectId','blue','Key\x20cannot\x20be\x20empty','path','includeRetried','utf-8','yellow','diff','\x20\x20Files\x20extracted:\x20','filter','Listing\x20secrets...','changes','state','execute','getMonth','group_error','cyan','Failed\x20to\x20fetch\x20attempt\x20data','sessionTime','session','fs/promises','\x20session','attempts','isArray','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','MAX_POLL_ITERATIONS','executeCloneProject','list','LABEL_WIDTH_DIVISOR','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','match','fromTask','end','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','verbose','projectName','✔\x20Clone\x20complete','newProjectId','Loading\x20session...','Warning:','yes','\x20\x20Revision:\x20','unknown','workflow:download','navigateSessionsInteractive','Pushing\x20workflow\x20project...','clear','Total:\x20','Listing\x20workflows...','No\x20workflow\x20sessions\x20found','\x0aClone\x20\x22','3Yatgtf','workflow:tasks','run','→\x20New\x20project:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Usage:\x20workflow:delete\x20<project-name-or-id>','format','requireProject','\x20\x20Workflow:\x20','projects','slice','delete','indexOf','workflow:workflows','List\x20workflow\x20execution\x20sessions','📁\x20','...','Include\x20retried:\x20yes','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','push','table','workflow','Attempt:\x20','Downloading\x20project\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','floor','ICON_WIDTH','red','index','revision','Listing\x20workflow\x20sessions...','planned','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x0aPolling...\x20(','workflow:attempt','name','get','includes','\x20\x20Attempt\x20ID:\x20',',\x20Workflow:\x20','listSecrets','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resume\x20from:\x20','trimEnd','MAX_LABEL_COUNT','\x20\x20Session\x20ID:\x20','Fetching\x20log\x20files...','description','No\x20attempts\x20found\x20in\x20project:\x20','min','isDirectory','applyPullProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','attempt:','logs','running','🔄\x20','\x20\x20Source:\x20','metadata','Source\x20directory:\x20','resolveProjectId','\x20new','No\x20sessions\x20found','context','basename','workflow:kill','Task\x20name:\x20','projectId','GUTTER','Listing\x20workflow\x20attempts...','Updating\x20','\x20modified','rows','trim','\x20\x20Console:\x20','Pattern:\x20','7623816pFAUmO','splice','targetDir','\x0aApply\x20these\x20changes?','\x20to\x20see\x20detailed\x20logs','ICON_SPACING','Including\x20subtasks:\x20yes','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','renderSingleTimeline','dim','\x0aError:','modified','-\x20no\x20files\x20written','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x1b[1A\x1b[2K','success','tdx\x20wf\x20attempt\x20','MAX_TIMELINE_WIDTH','download','split','showWorkflowConsoleUrl','No\x20workflows\x20found','has','preparePushProject','text','stdout','pullProject','Using\x20attempt\x20','Files\x20to\x20upload:\x20','✔\x20Found\x20','Session\x20','Revision:\x20','dryRun','keys','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Workflow\x20project\x20context\x20cleared.','isTTY','lastAttempt','MIN_LABEL_COUNT','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','(unknown)','columns','fileCount','Kill\x20a\x20running\x20attempt','Setting\x20secret...','project','Output\x20directory:\x20','set','Project\x20filter:\x20','parse','Show\x20tasks\x20for\x20an\x20attempt','\x22\x20already\x20exists\x20(ID:\x20','tdx.json','\x20\x20New\x20attempt\x20ID:\x20','log','msPerChar','error','follow','\x20\x20Project\x20ID:\x20','resolve','renderTimeline','\x20\x20Session\x20context\x20set\x20to:\x20','readFile','\x20from\x20session\x20','attemptId','Retrying\x20attempt...','MAX_TASKS_DISPLAY','pollTimeline','198bPhDPo','parseProjectWorkflowPattern','workflow:secrets:set','MIN_TIMELINE_WIDTH','map','\x22\x20with\x20new\x20revision?','displayLine','substring','getTime','key','done','workflow:pull','sys','\x0a✔\x20Attempt\x20complete','resumeFrom','select','POLL_INTERVAL_MS','toISOString','now','Dry\x20run:\x20yes','Cloning\x20to\x20','Params:\x20','workflow:logs','sourceProjectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','buildTimelineData','sessions','✔\x20Downloaded\x20','Expected\x20format:\x20--param\x20key=value','Deleting\x20secret...','Source:\x20','finishedAt','Filter:\x20project=','param','max','✔\x20Project\x20updated','skipValidation','session:','repeat','Show\x20specific\x20attempt\x20details','startsWith','No\x20matching\x20sessions\x20found','\x20deleted','retryAttemptName','\x0a✔\x20Already\x20up\x20to\x20date','createdAt','12268DKjqmk','✔\x20Pull\x20complete','Error:\x20Project\x20name\x20is\x20required','\x20(use\x20--limit\x20to\x20show\x20more)','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','value','\x0aDry\x20run\x20-\x20no\x20project\x20created','/attempt/','pending','Analyzing\x20changes...','every','green','setSecrets','status','workflow:use','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getDate','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','✔\x20Deleted\x20project\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','TASK_NAME_WIDTH','3021333cNYKEm','localeCompare','Loading\x20workflows...','values','taskName','List\x20workflow\x20attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20for:\x20','\x27...','hasChanges','Killing\x20attempt...','Select\x20a\x20task\x20to\x20view\x20logs:','find','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflowProject','Source\x20directory\x20is\x20required','Setting\x20','workflow:secrets:delete','cancelRequested','sourceDir','task','\x20logs','LABEL_MIN_SPACING','\x27\x20from\x20project\x20\x27','getMinutes','\x20unchanged','⚠\x20Showing\x20first\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20sessions\x20found\x20in\x20project:\x20','padStart','Latest\x20session\x20has\x20no\x20attempt','params','Attempt\x20ID:\x20','output','workflows','kill','\x20\x20tdx\x20wf\x20use\x20<project>','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','summary','start','\x0aDry\x20run\x20-\x20nothing\x20pushed','Analyzing\x20project...','\x20\x20Project:\x20','sessionId','Status:\x20','resolveProjectDir','Error:\x20Attempt\x20ID\x20is\x20required','startTime','new','Project\x20name\x20is\x20required','Target\x20directory:\x20','fill','✔\x20Workflow\x20run\x20started','duration','✔\x20Pushed\x20','canceling','revision:\x20','Error:\x20Secret\x20key\x20is\x20required','List\x20workflows','Error:','\x20secrets...','815218ExEaeu','jsonl','getHours','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','getFullYear','\x20-\x20','fullName','2296064SXheJM','prepareCloneProject','from','Project:\x20','Project\x20name:\x20','newProjectName','deleted','sort','✔\x20Project:\x20','relative','Auto-selected\x20latest\x20session:\x20','window','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20sessions\x20with\x20timing\x20information','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','site','Workflow:\x20','message','workflow:projects','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Getting\x20attempt\x20tasks...','data','cwd','generateSessionTimelineRows','workflow:run','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','toLowerCase','renderSessionsTimeline','(use\x20--limit\x20to\x20see\x20more)','retrySession','Source\x20project:\x20','workflow:attempts','No\x20log\x20content\x20found','✔\x20Secret\x20\x27','Key:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Showing\x20','attempt','workflow:retry','\x20workflow','Tip:\x20cd\x20to\x20workflows/','2616654gyMawE','title','startedAt','json','\x0a⚠\x20Project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','limit','includeSubtasks','Validation:\x20skipped','1055xkYDOJ','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','targetExists','updatedAt','Getting\x20attempt\x20details...','Error:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Cancelled','all','\x20\x20Location:\x20','some','\x0a✔\x20No\x20changes\x20to\x20push','executePushProject','New\x20project\x20name:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','force','length','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','round','/app/workflows/','Session\x20not\x20found:\x20','No\x20workflow\x20tdx.json\x20found','💡\x20Tip:\x20Use\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Retrying\x20session...','\x22\x20to\x20new\x20project\x20\x22','Target:\x20','Start\x20a\x20workflow\x20run','No\x20projects\x20match\x20pattern:\x20','resolveProject','---\x20'];a51_0x5dbb=function(){return _0x101345;};return a51_0x5dbb();}export class WorkflowAttemptCommand extends BaseCommand{['name']=a51_0x64d48f(0x245);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2dd);async[a51_0x64d48f(0x1fb)](_0x3c4f91){const _0x49be43=a51_0x64d48f,{options:_0x23db0f,args:_0x11a0bb,tdx:_0x116106}=_0x3c4f91,_0x45abf2=_0x11a0bb[0x0];if(!_0x45abf2)return console[_0x49be43(0x2a9)](_0x49be43(0x17f)),0x1;_0x23db0f['verbose']&&console[_0x49be43(0x2a9)](_0x49be43(0x171)+_0x45abf2);const _0xcd5df2=await withSpinner(_0x49be43(0x1cb),()=>_0x116106[_0x49be43(0x237)][_0x49be43(0x1ba)](_0x45abf2),{'verbose':_0x23db0f[_0x49be43(0x210)]}),_0x333d00=_0xcd5df2[_0x49be43(0x1aa)];let _0x1d282c;!_0x333d00[_0x49be43(0x2bf)]?_0x1d282c=_0x333d00['cancelRequested']?_0x49be43(0x188):_0x49be43(0x25a):_0x1d282c=_0x333d00['success']?_0x49be43(0x27f):_0x49be43(0x2a9);let _0x124514;if(_0x333d00[_0x49be43(0x2e3)]&&_0x333d00[_0x49be43(0x2d5)]){const _0x1b3e24=new Date(_0x333d00[_0x49be43(0x2e3)])[_0x49be43(0x2bd)](),_0x2e99b5=new Date(_0x333d00[_0x49be43(0x2d5)])[_0x49be43(0x2bd)]();_0x124514=Math[_0x49be43(0x1db)]((_0x2e99b5-_0x1b3e24)/0x3e8);}const _0x139656={'attempt_id':_0x333d00['id'],'status':_0x1d282c,..._0x333d00[_0x49be43(0x23e)]!==undefined&&{'index':_0x333d00[_0x49be43(0x23e)]},..._0x333d00[_0x49be43(0x29e)]&&{'project':_0x333d00['project'][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x237)]&&{'workflow':_0x333d00[_0x49be43(0x237)][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x17c)]&&{'session_id':_0x333d00[_0x49be43(0x17c)]},..._0x333d00[_0x49be43(0x200)]&&{'session_time':_0x333d00['sessionTime']},..._0x333d00[_0x49be43(0x2e1)]&&{'retry_attempt':_0x333d00['retryAttemptName']},..._0x124514!==undefined&&{'duration_sec':_0x124514},..._0x333d00[_0x49be43(0x2e3)]&&{'created_at':_0x333d00['createdAt']},..._0x333d00[_0x49be43(0x2d5)]&&{'finished_at':_0x333d00[_0x49be43(0x2d5)]},...Object[_0x49be43(0x291)](_0x333d00[_0x49be43(0x170)])['length']>0x0&&{'params':_0x333d00[_0x49be43(0x170)]}};return await handleSingleObjectOutput(_0x139656,_0x23db0f),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x222);['description']=a51_0x64d48f(0x2a3);async[a51_0x64d48f(0x1fb)](_0x5039c1){const _0x1dc2cb=a51_0x64d48f,{options:_0x3db338,args:_0x374e79,tdx:_0x5bd11f}=_0x5039c1,_0xe924d8=_0x374e79[0x0];if(!_0xe924d8)return console['error'](_0x1dc2cb(0x17f)),0x1;const _0x5a866f=_0x3db338[_0x1dc2cb(0x1c5)];_0x3db338['verbose']&&(console[_0x1dc2cb(0x2a9)]('Attempt\x20ID:\x20'+_0xe924d8),_0x5a866f&&console[_0x1dc2cb(0x2a9)](_0x1dc2cb(0x275)));const _0x42723d=await withSpinner(_0x1dc2cb(0x1a9),()=>_0x5bd11f[_0x1dc2cb(0x237)]['tasks'](_0xe924d8,_0x5a866f||![]),{'verbose':_0x3db338[_0x1dc2cb(0x210)]}),_0xa7bba=_0x42723d['data'];return console['error'](_0x1dc2cb(0x28d)+_0xa7bba[_0x1dc2cb(0x1d8)]+'\x20task'+(_0xa7bba[_0x1dc2cb(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0xa7bba,_0x3db338),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a51_0x64d48f(0x2cb);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2cd);async[a51_0x64d48f(0x1fb)](_0x18fa4f){const _0x585928=a51_0x64d48f,{options:_0x338854,args:_0x4213b8,tdx:_0x951695}=_0x18fa4f,_0x5a3143=_0x4213b8[0x0];let _0xccc752=_0x4213b8[0x1];if(!_0x5a3143)return console['error'](_0x585928(0x17f)),0x1;_0x338854[_0x585928(0x210)]&&(console[_0x585928(0x2a9)](_0x585928(0x171)+_0x5a3143),_0xccc752&&console[_0x585928(0x2a9)](_0x585928(0x265)+_0xccc752));const _0x557141=await withSpinner(_0x585928(0x251),()=>_0x951695[_0x585928(0x237)]['logFiles'](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x37c937=_0x557141[_0x585928(0x1aa)];if(_0x37c937[_0x585928(0x1d8)]===0x0)return console[_0x585928(0x2a9)](_0x585928(0x24c)),0x0;if(!_0xccc752&&(_0x338854[_0x585928(0x1c1)]||_0x338854[_0x585928(0x227)]))return await handleSDKOutput(_0x37c937,_0x338854),0x0;if(!_0xccc752){const _0x12577b=_0x37c937['map'](_0x27e44d=>({'title':_0x27e44d['taskName']+'\x20('+formatBytes(_0x27e44d[_0x585928(0x1e8)])+')','value':_0x27e44d[_0x585928(0x2fd)]})),_0x31cb3c=await a51_0x396bfc({'type':_0x585928(0x2c4),'name':'task','message':_0x585928(0x304),'choices':_0x12577b});if(!_0x31cb3c[_0x585928(0x30d)])return console[_0x585928(0x2a9)](_0x585928(0x1cf)),0x0;_0xccc752=_0x31cb3c[_0x585928(0x30d)];}const _0x47bb7b=await withSpinner('Downloading\x20logs...',()=>_0x951695['workflow'][_0x585928(0x259)](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x4d6dbb=_0x47bb7b[_0x585928(0x1aa)];return _0x4d6dbb?console[_0x585928(0x2a7)](_0x4d6dbb):console['error'](_0x585928(0x1b5)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x264);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x29c);async[a51_0x64d48f(0x1fb)](_0x442731){const _0x264cec=a51_0x64d48f,{options:_0x1ed680,args:_0x489cf6,tdx:_0x4fb182}=_0x442731,_0x3e8a43=_0x489cf6[0x0];if(!_0x3e8a43)return console[_0x264cec(0x2a9)](_0x264cec(0x17f)),0x1;const _0x359c62=_0x1ed680['reason'];_0x1ed680[_0x264cec(0x210)]&&(console['error']('Attempt\x20ID:\x20'+_0x3e8a43),_0x359c62&&console[_0x264cec(0x2a9)]('Reason:\x20'+_0x359c62));if(!_0x1ed680[_0x264cec(0x216)]){if(!isInteractive())return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x23d)](_0x264cec(0x279)),_0x264cec(0x257)),console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x278)](_0x264cec(0x2f3))),0x1;const _0x659c2c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3e8a43+'?');if(!_0x659c2c)return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x1f4)](_0x264cec(0x1cf))),0x1;}const _0x5af2e2=await withSpinner(_0x264cec(0x303),()=>_0x4fb182['workflow'][_0x264cec(0x174)](_0x3e8a43,_0x359c62),{'verbose':_0x1ed680[_0x264cec(0x210)]}),_0x1fd97e=_0x5af2e2['data'];return console[_0x264cec(0x2a9)]('✔\x20'+_0x1fd97e),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1bb);[a51_0x64d48f(0x252)]='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x64d48f(0x1fb)](_0x132ad1){const _0x175c81=a51_0x64d48f,{options:_0x165d3a,args:_0x296050,tdx:_0x5eae28}=_0x132ad1,_0x4059d4=_0x296050[0x0];if(!_0x4059d4)return console[_0x175c81(0x2a9)](_0x175c81(0x2f7)),console[_0x175c81(0x2a9)](_0x175c81(0x191)),0x1;let _0x2d4d95=![],_0x451f2b=_0x4059d4;if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x2db)))_0x2d4d95=!![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else{if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x258)))_0x2d4d95=![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else return console[_0x175c81(0x2a9)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x175c81(0x191)),0x1;}const _0x443e13=_0x165d3a[_0x175c81(0x20d)],_0x45e859=_0x165d3a[_0x175c81(0x2c3)],_0x480d4b=_0x165d3a['params'],_0x377e56=_0x165d3a[_0x175c81(0x1d7)];_0x165d3a['verbose']&&(console[_0x175c81(0x2a9)](_0x175c81(0x1e3)+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b),_0x443e13&&console[_0x175c81(0x2a9)]('From\x20task:\x20'+_0x443e13),_0x45e859&&console[_0x175c81(0x2a9)](_0x175c81(0x24d)+_0x45e859),_0x480d4b&&console[_0x175c81(0x2a9)](_0x175c81(0x2ca)+_0x480d4b),_0x377e56&&console[_0x175c81(0x2a9)]('Force:\x20yes'));let _0x2e7503;if(_0x480d4b)try{if(_0x480d4b[_0x175c81(0x2de)]('@')){const _0x188fc4=await import(_0x175c81(0x202)),_0x277ef7=_0x480d4b[_0x175c81(0x2bc)](0x1),_0x165918=await _0x188fc4[_0x175c81(0x2af)](_0x277ef7,_0x175c81(0x1f3));_0x2e7503=JSON[_0x175c81(0x2a2)](_0x165918);}else _0x2e7503=JSON['parse'](_0x480d4b);}catch{return console[_0x175c81(0x2a9)](_0x175c81(0x314)),0x1;}if(!_0x165d3a[_0x175c81(0x216)]){if(!isInteractive())return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x23d)](_0x175c81(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x175c81(0x2a9)](a51_0x5af198['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3c4e96=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b+'?');if(!_0x3c4e96)return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x1f4)](_0x175c81(0x1cf))),0x1;}let _0x5624c3;_0x2d4d95?_0x5624c3=await withSpinner(_0x175c81(0x1e1),()=>_0x5eae28[_0x175c81(0x237)][_0x175c81(0x1b2)](_0x451f2b,{'fromTask':_0x443e13,'retryParams':_0x2e7503}),{'verbose':_0x165d3a['verbose']}):_0x5624c3=await withSpinner(_0x175c81(0x2b2),()=>_0x5eae28[_0x175c81(0x237)]['retryAttempt'](_0x451f2b,{'resumeFrom':_0x45e859,'retryParams':_0x2e7503,'force':_0x377e56}),{'verbose':_0x165d3a[_0x175c81(0x210)]});const _0x185255=_0x5624c3[_0x175c81(0x1aa)];return console[_0x175c81(0x2a9)]('✔\x20Retry\x20started'),console[_0x175c81(0x2a9)](_0x175c81(0x2a6)+_0x185255[_0x175c81(0x2b1)]),console[_0x175c81(0x2a9)](_0x175c81(0x250)+_0x185255[_0x175c81(0x17c)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a51_0x64d48f(0x1ad);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1e4);async['execute'](_0xbb1981){const _0x3b0f77=a51_0x64d48f,{options:_0x21477e,args:_0x2534d0,tdx:_0x1a6219}=_0xbb1981;let _0x551019=_0x2534d0[0x0];if(!_0x551019){const _0x1bde3d=this[_0x3b0f77(0x1e6)]([],_0x21477e),_0x536ec6=await withSpinner(_0x3b0f77(0x2fb),()=>_0x1a6219[_0x3b0f77(0x237)][_0x3b0f77(0x173)](_0x1bde3d,{'limit':_0x21477e[_0x3b0f77(0x1c4)]}),{'verbose':_0x21477e['verbose']}),_0x24e585=_0x536ec6[_0x3b0f77(0x1aa)];if(_0x24e585[_0x3b0f77(0x1d8)]===0x0)return console[_0x3b0f77(0x2a9)]('No\x20workflows\x20found'),!_0x1bde3d&&console[_0x3b0f77(0x2a9)](a51_0x5af198['dim'](_0x3b0f77(0x206))),0x1;const _0x5eab6b=_0x24e585[_0x3b0f77(0x2b9)](_0x17d350=>({'title':_0x17d350[_0x3b0f77(0x29e)]?.[_0x3b0f77(0x246)]+'.'+_0x17d350[_0x3b0f77(0x246)],'value':_0x17d350[_0x3b0f77(0x29e)]?.['name']+'.'+_0x17d350[_0x3b0f77(0x246)],'description':_0x17d350[_0x3b0f77(0x23f)]?_0x3b0f77(0x189)+_0x17d350['revision']:undefined})),_0x149cc4=await a51_0x396bfc({'type':'select','name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x5eab6b});if(!_0x149cc4[_0x3b0f77(0x237)])return 0x1;_0x551019=_0x149cc4[_0x3b0f77(0x237)];}if(!_0x551019[_0x3b0f77(0x248)]('.')){const _0x1d0b86=this[_0x3b0f77(0x1e6)]([],_0x21477e);if(_0x1d0b86)_0x551019=_0x1d0b86+'.'+_0x551019;else return console['error'](a51_0x5af198[_0x3b0f77(0x23d)](_0x3b0f77(0x18c)),_0x3b0f77(0x23a)),console['error'](a51_0x5af198[_0x3b0f77(0x278)](_0x3b0f77(0x206))),0x1;}const _0x3a3e2c=_0x21477e[_0x3b0f77(0x2d7)],_0x53970d=_0x21477e[_0x3b0f77(0x200)],_0x58b46d={};if(_0x3a3e2c&&Array[_0x3b0f77(0x205)](_0x3a3e2c))for(const _0x42ad72 of _0x3a3e2c){const _0x2377c1=_0x42ad72[_0x3b0f77(0x22d)]('=');if(_0x2377c1===-0x1)return console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1e9)+_0x42ad72),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x2d2)),0x1;const _0x43bd8e=_0x42ad72[_0x3b0f77(0x2bc)](0x0,_0x2377c1),_0x5c7d7b=_0x42ad72[_0x3b0f77(0x2bc)](_0x2377c1+0x1);try{_0x58b46d[_0x43bd8e]=JSON[_0x3b0f77(0x2a2)](_0x5c7d7b);}catch{_0x58b46d[_0x43bd8e]=_0x5c7d7b;}}_0x21477e[_0x3b0f77(0x210)]&&(console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1a5)+_0x551019),Object[_0x3b0f77(0x291)](_0x58b46d)[_0x3b0f77(0x1d8)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x58b46d)),_0x53970d&&console[_0x3b0f77(0x2a9)]('Session\x20time:\x20'+_0x53970d));const _0x377bb9=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1a6219['workflow'][_0x3b0f77(0x223)](_0x551019,_0x58b46d,{'sessionTime':_0x53970d}),{'verbose':_0x21477e[_0x3b0f77(0x210)]}),_0x197834=_0x377bb9[_0x3b0f77(0x1aa)];console['error'](_0x3b0f77(0x185)),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x249)+_0x197834['id']),console[_0x3b0f77(0x2a9)]('\x20\x20Session\x20ID:\x20'+_0x197834[_0x3b0f77(0x17c)]),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x17b)+_0x197834[_0x3b0f77(0x29e)]?.['name']),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x229)+_0x197834[_0x3b0f77(0x237)]?.[_0x3b0f77(0x246)]);if(_0x197834[_0x3b0f77(0x29e)]?.['id']&&_0x197834[_0x3b0f77(0x17c)]&&_0x197834['id']){const _0x205cf3=_0x21477e[_0x3b0f77(0x1a4)],_0x4e54ce=getConsoleUrl(_0x205cf3,_0x3b0f77(0x1dc)+_0x197834[_0x3b0f77(0x29e)]['id']+'/sessions/'+_0x197834['sessionId']+_0x3b0f77(0x2eb)+_0x197834['id']);console[_0x3b0f77(0x2a9)](_0x3b0f77(0x26d)+a51_0x5af198[_0x3b0f77(0x1fe)](_0x4e54ce));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x219);['description']=a51_0x64d48f(0x1da);async[a51_0x64d48f(0x1fb)](_0x510bd9){const _0x25cda1=a51_0x64d48f,{options:_0x33ffdc,args:_0x5935ab,tdx:_0x3927af}=_0x510bd9,_0x3ce454=_0x5935ab[0x0],_0x3539ae=_0x5935ab[0x1]||'.';if(!_0x3ce454)return console['error'](_0x25cda1(0x2e6)),console[_0x25cda1(0x2a9)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x119f61=_0x33ffdc[_0x25cda1(0x23f)];_0x33ffdc[_0x25cda1(0x210)]&&(console[_0x25cda1(0x2a9)]('Project:\x20'+_0x3ce454),console[_0x25cda1(0x2a9)](_0x25cda1(0x29f)+_0x3539ae),_0x119f61&&console[_0x25cda1(0x2a9)](_0x25cda1(0x28f)+_0x119f61));const _0x44d46d=await withSpinner(_0x25cda1(0x239)+_0x3ce454+_0x25cda1(0x231),()=>_0x3927af[_0x25cda1(0x237)][_0x25cda1(0x282)](_0x3ce454,_0x3539ae,{'revision':_0x119f61}),{'verbose':_0x33ffdc['verbose']}),_0xc0e6ec=_0x44d46d[_0x25cda1(0x1aa)];return console[_0x25cda1(0x2a9)](_0x25cda1(0x2d1)+_0xc0e6ec[_0x25cda1(0x211)]),console['error'](_0x25cda1(0x217)+_0xc0e6ec[_0x25cda1(0x23f)]),console['error'](_0x25cda1(0x1f6)+_0xc0e6ec['filesExtracted']),console['error'](_0x25cda1(0x1d1)+_0x3539ae+'/'+_0xc0e6ec[_0x25cda1(0x211)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:upload';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1cd);async['execute'](_0x5cd949){const _0x22922f=a51_0x64d48f,{options:_0xe359c1,args:_0x215db2,tdx:_0x383d10}=_0x5cd949;let _0x14ba1d='.',_0x6c2e13=_0xe359c1[_0x22922f(0x246)];if(_0x215db2[0x0]){const {promises:_0x2e78bd}=await import('fs');try{const _0x373aaf=await _0x2e78bd['stat'](_0x215db2[0x0]);if(_0x373aaf[_0x22922f(0x255)]())_0x14ba1d=_0x215db2[0x0];else return console[_0x22922f(0x2a9)](_0x22922f(0x1cc)+_0x215db2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x6c2e13=_0x215db2[0x0],_0x14ba1d='.';}}const _0x8d9743=_0xe359c1[_0x22922f(0x23f)],_0x1cb16e=_0xe359c1[_0x22922f(0x2da)];_0xe359c1['verbose']&&(console[_0x22922f(0x2a9)]('Project\x20directory:\x20'+_0x14ba1d),_0x6c2e13&&console[_0x22922f(0x2a9)](_0x22922f(0x199)+_0x6c2e13),_0x8d9743&&console['error']('Revision:\x20'+_0x8d9743),_0x1cb16e&&console[_0x22922f(0x2a9)](_0x22922f(0x1c6)));const _0x5f0a12=await withSpinner(_0x22922f(0x21b),()=>_0x383d10[_0x22922f(0x237)]['push'](_0x14ba1d,{'projectName':_0x6c2e13,'revision':_0x8d9743,'skipValidation':_0x1cb16e}),{'verbose':_0xe359c1['verbose']}),_0xbacc73=_0x5f0a12[_0x22922f(0x1aa)];return console[_0x22922f(0x2a9)](_0x22922f(0x187)+_0xbacc73[_0x22922f(0x211)]),console[_0x22922f(0x2a9)](_0x22922f(0x2ab)+_0xbacc73[_0x22922f(0x266)]),console['error'](_0x22922f(0x217)+_0xbacc73[_0x22922f(0x23f)]),await this[_0x22922f(0x284)](_0x383d10,_0xbacc73[_0x22922f(0x211)],_0xe359c1[_0x22922f(0x1a4)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2c0);[a51_0x64d48f(0x252)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x4833a7){const _0x4dbc06=a51_0x64d48f,{options:_0x4e070b,args:_0x3412fe,tdx:_0x47c6da}=_0x4833a7,_0x1f6f58=_0x3412fe[0x0],_0x35f535=_0x3412fe[0x1];if(!_0x1f6f58)return console['error'](a51_0x5af198[_0x4dbc06(0x23d)](_0x4dbc06(0x18c)),'Project\x20name\x20is\x20required'),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x298))),0x1;const _0x2fc5a8=_0x4e070b[_0x4dbc06(0x23f)];_0x4e070b[_0x4dbc06(0x210)]&&(console[_0x4dbc06(0x2a9)](_0x4dbc06(0x198)+_0x1f6f58),_0x35f535&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x183)+_0x35f535),_0x2fc5a8&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x28f)+_0x2fc5a8),_0x4e070b[_0x4dbc06(0x290)]&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x2c8)));const _0x5e0f2a=await withSpinner('Pulling\x20project\x20'+_0x1f6f58+_0x4dbc06(0x231),()=>_0x47c6da['workflow'][_0x4dbc06(0x28a)](_0x1f6f58,{'targetDir':_0x35f535,'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),_0x2d5382=_0x5e0f2a[_0x4dbc06(0x1aa)];_0x2d5382['isNewProject']?console['error'](_0x4dbc06(0x224)+_0x2d5382[_0x4dbc06(0x211)]):console[_0x4dbc06(0x2a9)]('→\x20Project:\x20'+_0x2d5382[_0x4dbc06(0x211)]);console[_0x4dbc06(0x2a9)](_0x4dbc06(0x217)+_0x2d5382[_0x4dbc06(0x23f)]),console[_0x4dbc06(0x2a9)]('\x20\x20Target:\x20'+(a51_0x2409f9[_0x4dbc06(0x19e)](process[_0x4dbc06(0x1ab)](),_0x2d5382[_0x4dbc06(0x271)])||'.')),console[_0x4dbc06(0x2a9)]('\x20\x20Changes:\x20'+a51_0x5af198['green']('+'+_0x2d5382[_0x4dbc06(0x177)][_0x4dbc06(0x181)]+_0x4dbc06(0x260))+',\x20'+(a51_0x5af198['yellow']('~'+_0x2d5382['summary']['modified']+_0x4dbc06(0x26a))+',\x20')+(a51_0x5af198[_0x4dbc06(0x23d)]('-'+_0x2d5382['summary'][_0x4dbc06(0x19b)]+_0x4dbc06(0x2e0))+',\x20')+(''+a51_0x5af198['dim'](_0x2d5382[_0x4dbc06(0x177)]['unchanged']+_0x4dbc06(0x312))));for(const _0x2f10f5 of _0x2d5382['changes']){_0x2f10f5['type']===_0x4dbc06(0x27a)&&_0x2f10f5[_0x4dbc06(0x1f5)]&&(console['error']('\x0a'+a51_0x5af198[_0x4dbc06(0x1fe)](_0x4dbc06(0x1e7)+_0x2f10f5[_0x4dbc06(0x1f1)])),console[_0x4dbc06(0x2a9)](_0x2f10f5[_0x4dbc06(0x1f5)]));}if(!_0x2d5382['hasChanges'])return saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console['error'](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e2))),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2d5382[_0x4dbc06(0x211)])),0x0;if(_0x4e070b[_0x4dbc06(0x290)])return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4e070b['yes']){if(!isInteractive())return console[_0x4dbc06(0x2a9)](a51_0x5af198['red'](_0x4dbc06(0x279)),_0x4dbc06(0x257)),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x2f3))),0x1;const _0x499aca=await confirmKey(_0x4dbc06(0x272));if(!_0x499aca)return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)](_0x4dbc06(0x1cf)),_0x4dbc06(0x27b)),0x1;}await withSpinner('Writing\x20files...',()=>_0x47c6da[_0x4dbc06(0x237)][_0x4dbc06(0x256)](_0x2d5382,{'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e5)));const _0x37e743=a51_0x2409f9['relative'](process['cwd'](),_0x2d5382['targetDir'])||'.';return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x1d1)+_0x37e743)),console[_0x4dbc06(0x2a9)](a51_0x5af198['dim'](_0x4dbc06(0x2ae)+_0x2d5382[_0x4dbc06(0x211)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:push';[a51_0x64d48f(0x252)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0x1c2af7){const _0x28fe7=a51_0x64d48f,{options:_0x1617be,args:_0x136267,tdx:_0x554aeb}=_0x1c2af7,_0x53a914=this[_0x28fe7(0x17e)](_0x136267,_0x1617be),_0x56e871=_0x1617be[_0x28fe7(0x23f)],_0x5b8247=_0x1617be[_0x28fe7(0x2da)];_0x1617be['verbose']&&(_0x53a914&&console[_0x28fe7(0x2a9)]('Source\x20directory:\x20'+_0x53a914),_0x56e871&&console[_0x28fe7(0x2a9)](_0x28fe7(0x28f)+_0x56e871),_0x1617be[_0x28fe7(0x290)]&&console['error'](_0x28fe7(0x2c8)),_0x5b8247&&console['error'](_0x28fe7(0x1c6)));let _0x5c3626;try{_0x5c3626=await withSpinner(_0x28fe7(0x2ed),()=>_0x554aeb['workflow'][_0x28fe7(0x287)]({'sourceDir':_0x53a914,'revision':_0x56e871,'skipValidation':_0x5b8247}),{'verbose':_0x1617be[_0x28fe7(0x210)]});}catch(_0x1acdcd){if(_0x1acdcd instanceof Error&&_0x1acdcd[_0x28fe7(0x1a6)][_0x28fe7(0x248)](_0x28fe7(0x1de)))return console['error'](a51_0x5af198['red'](_0x28fe7(0x18c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x1617be[_0x28fe7(0x307)]?console['error'](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1bd)+_0x1617be[_0x28fe7(0x307)]+_0x28fe7(0x20b)+_0x1617be[_0x28fe7(0x307)]+'\x27')):console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1a8))),0x1;throw _0x1acdcd;}const _0x3917c1=_0x5c3626[_0x28fe7(0x1aa)];console['error'](_0x28fe7(0x19d)+_0x3917c1['projectName']),console[_0x28fe7(0x2a9)](_0x28fe7(0x25c)+_0x3917c1[_0x28fe7(0x30c)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3917c1[_0x28fe7(0x23f)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x1ed)+a51_0x5af198['green']('+'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x181)]+_0x28fe7(0x260))+',\x20'+(a51_0x5af198[_0x28fe7(0x1f4)]('~'+_0x3917c1['summary'][_0x28fe7(0x27a)]+_0x28fe7(0x26a))+',\x20')+(a51_0x5af198[_0x28fe7(0x23d)]('-'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x19b)]+_0x28fe7(0x2e0))+',\x20')+(''+a51_0x5af198[_0x28fe7(0x278)](_0x3917c1[_0x28fe7(0x177)]['unchanged']+_0x28fe7(0x312))));for(const _0x2fd1a8 of _0x3917c1[_0x28fe7(0x1f9)]){_0x2fd1a8['type']===_0x28fe7(0x27a)&&_0x2fd1a8[_0x28fe7(0x1f5)]&&(console[_0x28fe7(0x2a9)]('\x0a'+a51_0x5af198[_0x28fe7(0x1fe)](_0x28fe7(0x1e7)+_0x2fd1a8[_0x28fe7(0x1f1)])),console['error'](_0x2fd1a8[_0x28fe7(0x1f5)]));}if(!_0x3917c1[_0x28fe7(0x302)])return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)](_0x28fe7(0x1d3))),await this[_0x28fe7(0x284)](_0x554aeb,_0x3917c1['projectName'],_0x1617be['site']),0x0;if(_0x1617be[_0x28fe7(0x290)])return console[_0x28fe7(0x2a9)](a51_0x5af198['yellow'](_0x28fe7(0x179))),0x0;if(!_0x1617be[_0x28fe7(0x216)]){if(!isInteractive())return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x23d)](_0x28fe7(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x2f3))),0x1;const _0x2a66f0=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2a66f0)return console['error'](a51_0x5af198[_0x28fe7(0x1f4)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const _0x2001b2=await withSpinner('Pushing\x20project...',()=>_0x554aeb[_0x28fe7(0x237)][_0x28fe7(0x1d4)](_0x3917c1),{'verbose':_0x1617be[_0x28fe7(0x210)]}),_0x3667e1=_0x2001b2[_0x28fe7(0x1aa)];return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)]('✔\x20Push\x20complete')),console['error'](_0x28fe7(0x2ab)+_0x3667e1[_0x28fe7(0x266)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3667e1['revision']),await this[_0x28fe7(0x284)](_0x554aeb,_0x3667e1[_0x28fe7(0x211)],_0x1617be[_0x28fe7(0x1a4)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x64d48f(0x1fb)](_0x5e936c){const _0x187cc6=a51_0x64d48f,{options:_0x2455e1,args:_0x4ef1c8,tdx:_0x3905c5}=_0x5e936c,_0x4b5d68=this['resolveProjectDir'](_0x4ef1c8,_0x2455e1),_0x53a374=_0x2455e1[_0x187cc6(0x246)],_0x2b22aa=_0x2455e1[_0x187cc6(0x23f)],_0x5cdbf3=_0x2455e1[_0x187cc6(0x2da)];if(!_0x4b5d68)return console['error'](a51_0x5af198['red'](_0x187cc6(0x18c)),_0x187cc6(0x308)),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x53a374)return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)]('Error:'),_0x187cc6(0x1a1)),console['error'](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),0x1;_0x2455e1['verbose']&&(console[_0x187cc6(0x2a9)](_0x187cc6(0x25e)+_0x4b5d68),console['error'](_0x187cc6(0x1d5)+_0x53a374),_0x2b22aa&&console['error']('Revision:\x20'+_0x2b22aa),_0x2455e1[_0x187cc6(0x290)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x2c8)),_0x5cdbf3&&console[_0x187cc6(0x2a9)]('Validation:\x20skipped'));const _0x5579d0=await withSpinner(_0x187cc6(0x17a),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x196)](_0x4b5d68,_0x53a374,{'revision':_0x2b22aa,'skipValidation':_0x5cdbf3}),{'verbose':_0x2455e1[_0x187cc6(0x210)]}),_0x5d8f11=_0x5579d0[_0x187cc6(0x1aa)];console[_0x187cc6(0x2a9)](_0x187cc6(0x2d4)+_0x5d8f11[_0x187cc6(0x30c)]);_0x5d8f11[_0x187cc6(0x2cc)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x1b3)+_0x5d8f11['sourceProjectName']);console[_0x187cc6(0x2a9)](_0x187cc6(0x1d5)+_0x5d8f11[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28f)+_0x5d8f11[_0x187cc6(0x23f)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28c)+_0x5d8f11[_0x187cc6(0x29b)]);_0x5d8f11[_0x187cc6(0x1c9)]&&(console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1c2)+_0x5d8f11['newProjectName']+_0x187cc6(0x2a4)+_0x5d8f11[_0x187cc6(0x1ee)]+')')),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x20f))));if(_0x2455e1[_0x187cc6(0x290)])return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x2ea))),0x0;if(!_0x2455e1[_0x187cc6(0x216)]){if(!isInteractive())return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)](_0x187cc6(0x279)),_0x187cc6(0x257)),console[_0x187cc6(0x2a9)](a51_0x5af198['dim'](_0x187cc6(0x2f3))),0x1;const _0x3693c7=_0x5d8f11[_0x187cc6(0x2cc)]||a51_0x2409f9[_0x187cc6(0x263)](_0x4b5d68),_0x30ce20=_0x5d8f11[_0x187cc6(0x1c9)]?_0x187cc6(0x292)+_0x53a374+_0x187cc6(0x2ba):_0x187cc6(0x220)+_0x3693c7+_0x187cc6(0x1e2)+_0x53a374+'\x22?',_0x52cd9a=await confirmKey(_0x30ce20);if(!_0x52cd9a)return console['error'](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1cf))),0x1;}const _0x3011b2=await withSpinner(_0x5d8f11['targetExists']?_0x187cc6(0x269)+_0x53a374+_0x187cc6(0x231):_0x187cc6(0x2c9)+_0x53a374+_0x187cc6(0x231),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x208)](_0x5d8f11),{'verbose':_0x2455e1['verbose']}),_0x2d72b9=_0x3011b2[_0x187cc6(0x1aa)];return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x2ef)](_0x5d8f11['targetExists']?_0x187cc6(0x2d9):_0x187cc6(0x212))),console['error'](_0x187cc6(0x17b)+_0x2d72b9[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)]('\x20\x20Project\x20ID:\x20'+_0x2d72b9[_0x187cc6(0x213)]),console[_0x187cc6(0x2a9)]('\x20\x20Revision:\x20'+_0x2d72b9[_0x187cc6(0x23f)]),await this[_0x187cc6(0x284)](_0x3905c5,_0x2d72b9[_0x187cc6(0x19a)],_0x2455e1[_0x187cc6(0x1a4)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x64d48f(0x246)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x64d48f(0x1fb)](_0x4a0771){const _0x5170d5=a51_0x64d48f,{options:_0x43ac44,args:_0x5c225a,tdx:_0x45f59c}=_0x4a0771,_0x8ac369=_0x5c225a[0x0];if(!_0x8ac369)return console[_0x5170d5(0x2a9)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5170d5(0x2a9)](_0x5170d5(0x226)),0x1;_0x43ac44['verbose']&&console['error'](_0x5170d5(0x198)+_0x8ac369);if(!_0x43ac44[_0x5170d5(0x216)]){if(!isInteractive())return console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x278)](_0x5170d5(0x2f3))),0x1;const _0x3bd5fc=await confirmKey(_0x5170d5(0x243)+_0x8ac369+_0x5170d5(0x1b8));if(!_0x3bd5fc)return console['error'](a51_0x5af198['yellow'](_0x5170d5(0x1cf))),0x1;}const _0x1d20af=await withSpinner('Deleting\x20project\x20'+_0x8ac369+_0x5170d5(0x231),()=>_0x45f59c[_0x5170d5(0x237)][_0x5170d5(0x22c)](_0x8ac369),{'verbose':_0x43ac44[_0x5170d5(0x210)]}),_0xc2215e=_0x1d20af[_0x5170d5(0x1aa)];return console['error'](_0x5170d5(0x2f6)+_0xc2215e[_0x5170d5(0x211)]),console[_0x5170d5(0x2a9)](_0x5170d5(0x2ab)+_0xc2215e['projectId']),0x0;}}export function parseKeyValue(_0x244ce1){const _0x5b4d10=a51_0x64d48f,_0x57d6e9=_0x244ce1[_0x5b4d10(0x22d)]('=');if(_0x57d6e9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x244ce1+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x571aa7=_0x244ce1[_0x5b4d10(0x2bc)](0x0,_0x57d6e9),_0x952640=_0x244ce1[_0x5b4d10(0x2bc)](_0x57d6e9+0x1);if(!_0x571aa7)throw new Error(_0x5b4d10(0x1f0));return{'key':_0x571aa7,'value':_0x952640};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1d9);async['execute'](_0x23d7d2){const _0x1128e6=a51_0x64d48f,{options:_0x83358,args:_0x3192b0,tdx:_0x54e4d7}=_0x23d7d2,_0x3be976=this[_0x1128e6(0x228)](_0x3192b0,_0x83358);if(!_0x3be976)return 0x1;_0x83358[_0x1128e6(0x210)]&&console[_0x1128e6(0x2a9)](_0x1128e6(0x198)+_0x3be976);const _0xa16a46=await withSpinner(_0x1128e6(0x1f8),()=>_0x54e4d7[_0x1128e6(0x237)][_0x1128e6(0x24b)](_0x3be976),{'verbose':_0x83358[_0x1128e6(0x210)]}),{secrets:_0x11e015}=_0xa16a46['data'];return console[_0x1128e6(0x2a9)]('✔\x20Found\x20'+_0x11e015[_0x1128e6(0x1d8)]+'\x20secret'+(_0x11e015[_0x1128e6(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x11e015,_0x83358),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2b7);['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x64d48f(0x1fb)](_0x4b58dc){const _0x27f3ac=a51_0x64d48f,{options:_0x1da62c,args:_0x174493,tdx:_0x4d7142}=_0x4b58dc;let _0x54641a,_0x554198;if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&!_0x174493[0x0][_0x27f3ac(0x248)]('='))_0x54641a=_0x174493[0x0],_0x554198=_0x174493['slice'](0x1);else{if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&_0x1da62c[_0x27f3ac(0x307)])_0x54641a=_0x1da62c[_0x27f3ac(0x307)],_0x554198=_0x174493;else return _0x174493['length']>=0x1?(console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2e6)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x27f3ac(0x176)),0x1);}if(_0x554198[_0x27f3ac(0x1d8)]===0x0)return console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2f5)),console['error'](_0x27f3ac(0x176)),0x1;const _0x5f3330={};try{for(const _0x366781 of _0x554198){const {key:_0x555fe8,value:_0x43d777}=parseKeyValue(_0x366781);_0x5f3330[_0x555fe8]=_0x43d777;}}catch(_0x292582){return _0x292582 instanceof Error&&console[_0x27f3ac(0x2a9)](a51_0x5af198[_0x27f3ac(0x23d)]('Error:'),_0x292582[_0x27f3ac(0x1a6)]),0x1;}const _0x52f7c5=Object[_0x27f3ac(0x291)](_0x5f3330);_0x1da62c[_0x27f3ac(0x210)]&&(console['error'](_0x27f3ac(0x198)+_0x54641a),console[_0x27f3ac(0x2a9)]('Secrets\x20to\x20set:\x20'+_0x52f7c5['join'](',\x20')));const _0xb1be3=await withSpinner(_0x52f7c5['length']===0x1?_0x27f3ac(0x29d):_0x27f3ac(0x309)+_0x52f7c5[_0x27f3ac(0x1d8)]+_0x27f3ac(0x18d),()=>_0x4d7142[_0x27f3ac(0x237)][_0x27f3ac(0x2f0)](_0x54641a,_0x5f3330),{'verbose':_0x1da62c[_0x27f3ac(0x210)]}),_0x33b22b=_0xb1be3['data'];return console[_0x27f3ac(0x2a9)](_0x52f7c5[_0x27f3ac(0x1d8)]===0x1?_0x27f3ac(0x1b6)+_0x33b22b[_0x27f3ac(0x291)][0x0]+_0x27f3ac(0x233)+_0x33b22b[_0x27f3ac(0x211)]+'\x27':'✔\x20'+_0x33b22b[_0x27f3ac(0x291)][_0x27f3ac(0x1d8)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x33b22b[_0x27f3ac(0x211)]+'\x27'),(_0x1da62c[_0x27f3ac(0x1c1)]||_0x1da62c['jsonl'])&&await handleSingleObjectOutput(_0x33b22b,_0x1da62c),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x30a);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2e8);async['execute'](_0x21212d){const _0x12bed4=a51_0x64d48f,{options:_0x438896,args:_0x3bbc53,tdx:_0x5bae1a}=_0x21212d;let _0x45b62f,_0x2349c4;if(_0x3bbc53[_0x12bed4(0x1d8)]>=0x2)_0x45b62f=_0x3bbc53[0x0],_0x2349c4=_0x3bbc53[0x1];else{if(_0x3bbc53[_0x12bed4(0x1d8)]===0x1&&_0x438896[_0x12bed4(0x307)])_0x45b62f=_0x438896[_0x12bed4(0x307)],_0x2349c4=_0x3bbc53[0x0];else return _0x3bbc53[_0x12bed4(0x1d8)]===0x1?(console[_0x12bed4(0x2a9)](_0x12bed4(0x2e6)),console[_0x12bed4(0x2a9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x12bed4(0x2a9)](_0x12bed4(0x18a)),console[_0x12bed4(0x2a9)](_0x12bed4(0x2ce)),0x1);}_0x438896[_0x12bed4(0x210)]&&(console['error'](_0x12bed4(0x198)+_0x45b62f),console[_0x12bed4(0x2a9)](_0x12bed4(0x1b7)+_0x2349c4));if(!_0x438896['yes']){if(!isInteractive())return console['error'](a51_0x5af198['red']('\x0aError:'),_0x12bed4(0x257)),console['error'](a51_0x5af198[_0x12bed4(0x278)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x53c2b9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2349c4+_0x12bed4(0x310)+_0x45b62f+'\x27?');if(!_0x53c2b9)return console[_0x12bed4(0x2a9)](a51_0x5af198[_0x12bed4(0x1f4)](_0x12bed4(0x1cf))),0x1;}const _0x42dc21=await withSpinner(_0x12bed4(0x2d3),()=>_0x5bae1a[_0x12bed4(0x237)]['deleteSecret'](_0x45b62f,_0x2349c4),{'verbose':_0x438896[_0x12bed4(0x210)]}),_0x4432fb=_0x42dc21['data'];return console[_0x12bed4(0x2a9)](_0x12bed4(0x1b6)+_0x4432fb[_0x12bed4(0x2be)]+_0x12bed4(0x306)+_0x4432fb[_0x12bed4(0x211)]+'\x27'),(_0x438896[_0x12bed4(0x1c1)]||_0x438896[_0x12bed4(0x18f)])&&await handleSingleObjectOutput(_0x4432fb,_0x438896),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(_0x14bde3){const _0x288a27=a51_0x64d48f,_0x3b2c2d=Math['floor'](_0x14bde3/0x3e8),_0x114451=Math[_0x288a27(0x23b)](_0x3b2c2d/0x3c),_0x588779=Math['floor'](_0x114451/0x3c),_0x285155=Math[_0x288a27(0x23b)](_0x588779/0x18);if(_0x285155>0x0){const _0x2a2a5e=_0x588779%0x18;return _0x2a2a5e>0x0?_0x285155+'d\x20'+_0x2a2a5e+'h':_0x285155+'d';}else{if(_0x588779>0x0){const _0x360ded=_0x114451%0x3c;return _0x360ded>0x0?_0x588779+'h\x20'+_0x360ded+'m':_0x588779+'h';}else{if(_0x114451>0x0){const _0x21569c=_0x3b2c2d%0x3c;return _0x21569c>0x0?_0x114451+'m\x20'+_0x21569c+'s':_0x114451+'m';}else return _0x3b2c2d+'s';}}}function formatTimestamp(_0x3fe6cd,_0xe9e72d){const _0x2ac3a6=a51_0x64d48f,_0x4000b0=new Date(_0x3fe6cd),_0x17bfd5=String(_0x4000b0[_0x2ac3a6(0x190)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x4be3f8=String(_0x4000b0[_0x2ac3a6(0x311)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x3bb1a5=_0x17bfd5+':'+_0x4be3f8,_0x214b1f=_0x4000b0[_0x2ac3a6(0x192)]()===_0xe9e72d[_0x2ac3a6(0x192)]()&&_0x4000b0[_0x2ac3a6(0x1fc)]()===_0xe9e72d[_0x2ac3a6(0x1fc)]()&&_0x4000b0[_0x2ac3a6(0x2f4)]()===_0xe9e72d[_0x2ac3a6(0x2f4)]();if(_0x214b1f)return _0x3bb1a5;else{const _0x113fc4=String(_0x4000b0['getMonth']()+0x1)[_0x2ac3a6(0x16e)](0x2,'0'),_0x2c53fc=String(_0x4000b0['getDate']())[_0x2ac3a6(0x16e)](0x2,'0');return _0x113fc4+'-'+_0x2c53fc+'\x20'+_0x3bb1a5;}}function formatDate(_0x72a56b){const _0x5ca462=a51_0x64d48f,_0x3deaf7=_0x72a56b['getFullYear'](),_0x5b7d7b=String(_0x72a56b[_0x5ca462(0x1fc)]()+0x1)[_0x5ca462(0x16e)](0x2,'0'),_0x1e1606=String(_0x72a56b['getDate']())[_0x5ca462(0x16e)](0x2,'0');return _0x3deaf7+'-'+_0x5b7d7b+'-'+_0x1e1606;}function getTaskStateIcon(_0x1e12ff){const _0x255ecf={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x255ecf[_0x1e12ff]||'⚪';}function getBarChar(_0xfe5fe6){const _0x5a42d9=a51_0x64d48f;return _0xfe5fe6===_0x5a42d9(0x2a9)||_0xfe5fe6===_0x5a42d9(0x1fd)?'×':'─';}function getBarColor(_0xf8207a){const _0x25f035=a51_0x64d48f,_0x42e487={'success':a51_0x5af198[_0x25f035(0x2ef)],'error':a51_0x5af198['red'],'group_error':a51_0x5af198[_0x25f035(0x23d)],'running':a51_0x5af198[_0x25f035(0x1ef)],'blocked':a51_0x5af198['yellow'],'planned':a51_0x5af198[_0x25f035(0x278)],'canceling':a51_0x5af198[_0x25f035(0x1f4)]};return _0x42e487[_0xf8207a]||a51_0x5af198['white'];}function parseTaskName(_0x24fa9e){const _0x875782=a51_0x64d48f;let _0x447c65=_0x24fa9e['replace'](/^\++/,'');const _0x40827d=_0x447c65[_0x875782(0x283)]('+'),_0x81c518=_0x40827d[_0x875782(0x1d8)]>0x1?_0x40827d['length']-0x2:0x0,_0x251c09=_0x40827d[_0x40827d['length']-0x1]||_0x447c65;return{'level':_0x81c518,'name':'+'+_0x251c09};}function truncateTaskName(_0x35aba9,_0x1b02ba){const _0x29b8c3=a51_0x64d48f,_0x49b297=stringWidth(_0x35aba9);if(_0x49b297<=_0x1b02ba)return _0x35aba9;let _0x68a90c=_0x35aba9;while(stringWidth(_0x68a90c+'…')>_0x1b02ba&&_0x68a90c['length']>0x0){_0x68a90c=_0x68a90c[_0x29b8c3(0x22b)](0x0,-0x1);}return _0x68a90c+'…';}function calculateTimeScale(_0x4728e9,_0x2d46a3){const _0x2d71c7=a51_0x64d48f;return{'startTime':_0x4728e9[_0x2d71c7(0x178)],'endTime':_0x4728e9[_0x2d71c7(0x20e)],'durationMs':_0x4728e9[_0x2d71c7(0x186)],'msPerChar':_0x4728e9[_0x2d71c7(0x186)]/_0x2d46a3};}function timeToPosition(_0x46455c,_0x53b1b1,_0x1b1c05){const _0x845e79=a51_0x64d48f,_0x525330=_0x46455c-_0x53b1b1[_0x845e79(0x180)],_0x54ced6=Math[_0x845e79(0x23b)](_0x525330/_0x53b1b1[_0x845e79(0x2a8)]);return Math[_0x845e79(0x2d8)](0x0,Math[_0x845e79(0x254)](_0x54ced6,_0x1b1c05));}function renderTimeAxis(_0x15a8ee,_0x75cbca){const _0x792a12=a51_0x64d48f,_0x2d9466=Math['min'](TIMELINE_CONFIG[_0x792a12(0x24f)],Math[_0x792a12(0x2d8)](TIMELINE_CONFIG[_0x792a12(0x297)],Math[_0x792a12(0x23b)](_0x75cbca/TIMELINE_CONFIG[_0x792a12(0x20a)]))),_0x283229=_0x15a8ee['durationMs']/(_0x2d9466-0x1),_0x17737c=new Date(_0x15a8ee['startTime']),_0x45db2e=[];for(let _0x22b41c=0x0;_0x22b41c<_0x2d9466;_0x22b41c++){const _0x59bfc6=_0x15a8ee[_0x792a12(0x180)]+_0x22b41c*_0x283229,_0x5181a3=timeToPosition(_0x59bfc6,_0x15a8ee,_0x75cbca),_0x47451a=formatTimestamp(_0x59bfc6,_0x17737c);_0x45db2e[_0x792a12(0x235)]({'pos':_0x5181a3,'text':_0x47451a});}const _0x27d4cf=new Array(_0x75cbca)[_0x792a12(0x184)]('\x20');let _0x3e8dd9=-0x1;for(const {pos:_0x144ccc,text:_0x43a867}of _0x45db2e){let _0xde1386=Math[_0x792a12(0x2d8)](0x0,_0x144ccc-Math[_0x792a12(0x23b)](_0x43a867[_0x792a12(0x1d8)]/0x2));_0xde1386<=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]&&(_0xde1386=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]+0x1);_0xde1386+_0x43a867[_0x792a12(0x1d8)]>_0x75cbca&&(_0xde1386=_0x75cbca-_0x43a867[_0x792a12(0x1d8)]);if(_0xde1386>=0x0&&_0xde1386+_0x43a867[_0x792a12(0x1d8)]<=_0x75cbca&&_0xde1386>_0x3e8dd9){for(let _0x5f7e8a=0x0;_0x5f7e8a<_0x43a867[_0x792a12(0x1d8)];_0x5f7e8a++){_0x27d4cf[_0xde1386+_0x5f7e8a]=_0x43a867[_0x5f7e8a];}_0x3e8dd9=_0xde1386+_0x43a867[_0x792a12(0x1d8)]-0x1;}}return _0x27d4cf[_0x792a12(0x1eb)]('');}function renderTaskRow(_0x39d84,_0x39de20,_0x3719bf,_0x396a5f){const _0x26dc19=a51_0x64d48f,{level:_0x5007dc,name:_0x48337f}=parseTaskName(_0x39d84[_0x26dc19(0x246)]),_0x570f7c='\x20'[_0x26dc19(0x2dc)](_0x5007dc),_0x4c215a=_0x39d84[_0x26dc19(0x1a0)]?'('+formatElapsed(_0x39d84[_0x26dc19(0x1a0)][_0x26dc19(0x186)])+')':'',_0x337edf=stringWidth(_0x4c215a),_0x354787=_0x5007dc*0x1,_0x26c4ff=_0x396a5f-_0x354787-_0x337edf-0x1,_0x3f2d9f=truncateTaskName(_0x48337f,_0x26c4ff),_0x332f75=_0x570f7c+_0x3f2d9f,_0x586178=stringWidth(_0x332f75),_0x322101=_0x396a5f-_0x586178-_0x337edf,_0x5c4f04=_0x332f75+'\x20'['repeat'](Math[_0x26dc19(0x2d8)](0x1,_0x322101))+a51_0x5af198['dim'](_0x4c215a),_0x1a88d4=getTaskStateIcon(_0x39d84[_0x26dc19(0x1fa)]),_0x56870f=new Array(_0x3719bf)[_0x26dc19(0x184)]('\x20');if(_0x39d84[_0x26dc19(0x1a0)]){const _0x4a5ef4=timeToPosition(_0x39d84[_0x26dc19(0x1a0)]['start'],_0x39de20,_0x3719bf),_0x9a6a52=timeToPosition(_0x39d84['window'][_0x26dc19(0x20e)],_0x39de20,_0x3719bf),_0xa47de6=getBarChar(_0x39d84[_0x26dc19(0x1fa)]),_0x3e3cb3=Math['max'](_0x4a5ef4+0x1,_0x9a6a52);for(let _0x3d8b4d=_0x4a5ef4;_0x3d8b4d<Math[_0x26dc19(0x254)](_0x3e3cb3,_0x3719bf);_0x3d8b4d++){_0x56870f[_0x3d8b4d]=_0xa47de6;}}const _0x3751c4=getBarColor(_0x39d84[_0x26dc19(0x1fa)]),_0xba2f3=_0x56870f[_0x26dc19(0x2b9)](_0x16db3f=>_0x16db3f==='\x20'?'\x20':_0x3751c4(_0x16db3f))[_0x26dc19(0x1eb)]('');return _0x1a88d4+'\x20'+_0x5c4f04+'│'+_0xba2f3+'│';}function calculateStats(_0xbd01c2){const _0x2a2862=a51_0x64d48f,_0x5154af={'total':_0xbd01c2[_0x2a2862(0x1d8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1940ce of _0xbd01c2){if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x27f))_0x5154af[_0x2a2862(0x27f)]++;else{if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x2a9)||_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x1fd))_0x5154af['error']++;else _0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x25a)?_0x5154af['running']++:_0x5154af[_0x2a2862(0x2ec)]++;}}return _0x5154af;}function formatStats(_0x1d7794){const _0x237b36=a51_0x64d48f;return[_0x237b36(0x21d)+_0x1d7794['total'],'✅\x20'+_0x1d7794['success'],'❌\x20'+_0x1d7794[_0x237b36(0x2a9)],_0x237b36(0x25b)+_0x1d7794[_0x237b36(0x25a)],'⏳\x20'+_0x1d7794[_0x237b36(0x2ec)]][_0x237b36(0x1eb)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:timeline';[a51_0x64d48f(0x252)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x3f7d25){const _0x5af7c1=a51_0x64d48f,{options:_0x281e6b,args:_0x23b939,tdx:_0x295cfd}=_0x3f7d25;let _0x45583e,_0x1b1f35,_0x487520=![];if(_0x23b939[0x0]){if(_0x23b939[0x0][_0x5af7c1(0x248)]('.')){const _0x4e5799=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x4e5799)return 0x1;_0x45583e=_0x4e5799[_0x5af7c1(0x211)],_0x1b1f35=_0x4e5799['workflowName'];}else{_0x1b1f35=_0x23b939[0x0],_0x45583e=_0x281e6b[_0x5af7c1(0x307)];if(!_0x45583e)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x27d)),0x1;_0x487520=!![];}}else{const _0x7fc736=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x7fc736)return 0x1;_0x45583e=_0x7fc736[_0x5af7c1(0x211)],_0x1b1f35=_0x7fc736['workflowName'];}if(_0x281e6b[_0x5af7c1(0x210)]){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x242)+_0x45583e+'.'+_0x1b1f35);else _0x45583e&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x2d6)+_0x45583e);}const _0x2552db=_0x281e6b[_0x5af7c1(0x2b1)],_0x3f4418=_0x281e6b[_0x5af7c1(0x17c)];if(_0x2552db){_0x3f4418&&console['error'](a51_0x5af198[_0x5af7c1(0x1f4)](_0x5af7c1(0x215)),_0x5af7c1(0x234));const _0x5133c0=_0x281e6b[_0x5af7c1(0x2aa)];return _0x5133c0?await this['pollTimeline'](_0x3f7d25,_0x2552db):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x2552db,_0x281e6b),0x0;}if(_0x3f4418){const _0x57f14d=await withSpinner(_0x5af7c1(0x214),()=>_0x295cfd['workflow'][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':0x64}),{'verbose':_0x281e6b[_0x5af7c1(0x210)]}),_0x337afd=_0x57f14d[_0x5af7c1(0x1aa)][_0x5af7c1(0x305)](_0x4d1f42=>_0x4d1f42['id']===_0x3f4418);if(!_0x337afd)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x1dd)+_0x3f4418),0x1;if(!_0x337afd[_0x5af7c1(0x296)]?.['id'])return console['error'](a51_0x5af198['red'](_0x5af7c1(0x18c)),_0x5af7c1(0x28e)+_0x3f4418+_0x5af7c1(0x1ea)),0x1;const _0x145d2d=_0x337afd[_0x5af7c1(0x296)]['id'];_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x28b)+_0x145d2d+_0x5af7c1(0x2b0)+_0x3f4418);const _0x59b68b=_0x281e6b[_0x5af7c1(0x2aa)];return _0x59b68b?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x145d2d):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x145d2d,_0x281e6b),0x0;}const _0x10d243=await withSpinner('Loading\x20sessions...',()=>_0x295cfd[_0x5af7c1(0x237)][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':_0x281e6b['limit']||0x32}),{'verbose':_0x281e6b['verbose']}),_0x2b8029=_0x10d243[_0x5af7c1(0x1aa)];if(_0x2b8029[_0x5af7c1(0x1d8)]===0x0){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x300)+_0x45583e+'.'+_0x1b1f35);else _0x45583e?console[_0x5af7c1(0x2a9)](_0x5af7c1(0x315)+_0x45583e):(console[_0x5af7c1(0x2a9)](_0x5af7c1(0x21f)),console['error'](a51_0x5af198[_0x5af7c1(0x278)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2b8029['sort']((_0x361d07,_0x56fc8e)=>{const _0x3e1cbd=_0x5af7c1,_0x1c8cb5=_0x361d07['sessionTime']||'',_0x165d71=_0x56fc8e['sessionTime']||'';return _0x165d71[_0x3e1cbd(0x2fa)](_0x1c8cb5);});if(_0x281e6b[_0x5af7c1(0x1c1)]||_0x281e6b[_0x5af7c1(0x18f)])return await handleSDKOutput(_0x2b8029,_0x281e6b),0x0;let _0x3b91bb;if(_0x487520){const _0x3eaa3e=_0x2b8029[0x0];if(!_0x3eaa3e[_0x5af7c1(0x296)]?.['id'])return console[_0x5af7c1(0x2a9)](_0x5af7c1(0x16f)),0x0;_0x3b91bb=_0x3eaa3e[_0x5af7c1(0x296)]['id'],_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x19f)+_0x3eaa3e[_0x5af7c1(0x200)]);}else{const _0x11dac2=_0x2b8029[_0x5af7c1(0x2b9)](_0x16749b=>{const _0x380388=_0x5af7c1,_0x2a3b5b=getAttemptStatusDisplay(_0x16749b[_0x380388(0x296)]);return{'title':_0x16749b[_0x380388(0x29e)]?.['name']+'.'+_0x16749b[_0x380388(0x237)]?.[_0x380388(0x246)]+_0x380388(0x193)+_0x16749b[_0x380388(0x200)]+'\x20'+_0x2a3b5b['icon'],'value':_0x16749b[_0x380388(0x296)]?.['id']||'','description':_0x2a3b5b[_0x380388(0x288)]};}),_0x56ae9c=await a51_0x396bfc({'type':_0x5af7c1(0x2c4),'name':_0x5af7c1(0x2b1),'message':_0x5af7c1(0x225),'choices':_0x11dac2[_0x5af7c1(0x1f7)](_0xb9ef8b=>_0xb9ef8b[_0x5af7c1(0x2e9)]!=='')});if(!_0x56ae9c['attemptId'])return 0x0;_0x3b91bb=_0x56ae9c['attemptId'];}const _0xee9f0f=_0x281e6b[_0x5af7c1(0x2aa)];return _0xee9f0f?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x3b91bb):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x3b91bb,_0x281e6b),0x0;}async[a51_0x64d48f(0x277)](_0x5a99c3,_0x13d6bc,_0x393340){const _0x448933=a51_0x64d48f,{tdx:_0x17d839}=_0x5a99c3;let _0x3664d8,_0xe5d3a5;try{[_0x3664d8,_0xe5d3a5]=await Promise[_0x448933(0x1d0)]([_0x17d839[_0x448933(0x237)][_0x448933(0x1ba)](_0x13d6bc),_0x17d839[_0x448933(0x237)]['tasks'](_0x13d6bc,![])]);}catch(_0x2d5b82){console[_0x448933(0x2a9)](a51_0x5af198[_0x448933(0x23d)](_0x448933(0x1ff)));_0x393340[_0x448933(0x210)]&&console[_0x448933(0x2a9)](_0x2d5b82);throw _0x2d5b82;}if(_0x393340[_0x448933(0x1c1)]||_0x393340[_0x448933(0x18f)]){const _0x8a6538=this['buildTimelineData'](_0x3664d8,_0xe5d3a5);await handleSDKOutput([_0x8a6538],_0x393340);return;}const _0x46d9e5=_0x17d839[_0x448933(0x262)][_0x448933(0x1a4)],_0x302ea3=this[_0x448933(0x2ad)](_0x3664d8,_0xe5d3a5,_0x46d9e5);console[_0x448933(0x2a7)](_0x302ea3);}async[a51_0x64d48f(0x2b4)](_0xe1177a,_0x2c94d0){const _0x5710da=a51_0x64d48f,{tdx:_0x5c934e}=_0xe1177a,_0x27d3aa=TIMELINE_CONFIG[_0x5710da(0x2c5)],_0x31e348=TIMELINE_CONFIG[_0x5710da(0x207)];let _0x35edd9=0x0;while(_0x35edd9<_0x31e348){process[_0x5710da(0x289)][_0x5710da(0x295)]&&process['stdout']['write']('\x1bc');let _0x330de3,_0x344b45;try{[_0x330de3,_0x344b45]=await Promise[_0x5710da(0x1d0)]([_0x5c934e['workflow'][_0x5710da(0x1ba)](_0x2c94d0),_0x5c934e['workflow']['tasks'](_0x2c94d0,![])]);}catch(_0x45797b){console['error'](a51_0x5af198[_0x5710da(0x23d)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x35edd9>0x0&&console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x35edd9));throw _0x45797b;}const _0x2fce94=_0x5c934e[_0x5710da(0x262)][_0x5710da(0x1a4)],_0x2df819=this[_0x5710da(0x2ad)](_0x330de3,_0x344b45,_0x2fce94);console[_0x5710da(0x2a7)](_0x2df819);const _0x332589=_0x330de3[_0x5710da(0x2bf)]&&_0x344b45[_0x5710da(0x2ee)](_0x4acd1b=>_0x4acd1b[_0x5710da(0x1fa)]!=='running'&&_0x4acd1b[_0x5710da(0x1fa)]!==_0x5710da(0x241));if(_0x332589){console[_0x5710da(0x2a9)](a51_0x5af198['green'](_0x5710da(0x2c2)));break;}console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)](_0x5710da(0x244)+_0x35edd9*0x2+_0x5710da(0x1e0))),await new Promise(_0x5f2186=>setTimeout(_0x5f2186,_0x27d3aa)),_0x35edd9++;}_0x35edd9>=_0x31e348&&console['error'](a51_0x5af198['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a51_0x64d48f(0x2ad)](_0x243b9c,_0xcc462,_0x3bd040){const _0x325451=a51_0x64d48f,_0x1fb76b=[],_0x174ade=TIMELINE_CONFIG[_0x325451(0x2f8)],_0x36c056=0x5,_0x2099c1=process['stdout']['columns']||0x78,_0x2b601a=_0x2099c1-_0x174ade-_0x36c056,_0x4aa5a9=Math[_0x325451(0x2d8)](TIMELINE_CONFIG[_0x325451(0x2b8)],Math[_0x325451(0x254)](_0x2b601a,TIMELINE_CONFIG[_0x325451(0x281)])),_0x56178a=new Date(_0x243b9c[_0x325451(0x2e3)])['getTime'](),_0x44370c=_0x243b9c[_0x325451(0x2d5)]?new Date(_0x243b9c[_0x325451(0x2d5)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x1a64fe={'start':_0x56178a,'end':_0x44370c,'duration':_0x44370c-_0x56178a},_0x7a47e1=new Map(),_0x20ab59=[];for(const _0x203a07 of _0xcc462){if(_0x203a07[_0x325451(0x1c0)]){const _0x1473ff=new Date(_0x203a07[_0x325451(0x1c0)])[_0x325451(0x2bd)](),_0x1ea258=_0x203a07[_0x325451(0x1ca)]?new Date(_0x203a07[_0x325451(0x1ca)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x2bbb92={'start':_0x1473ff,'end':_0x1ea258,'duration':_0x1ea258-_0x1473ff};_0x7a47e1[_0x325451(0x2a0)](_0x203a07['id'],_0x2bbb92),_0x20ab59['push']({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07['state']||_0x325451(0x218),'window':_0x2bbb92});}else _0x20ab59[_0x325451(0x235)]({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07[_0x325451(0x1fa)]||'planned','window':undefined});}_0x20ab59[_0x325451(0x19c)]((_0x34b5fb,_0x4b6f82)=>{const _0xc1d132=_0x325451;if(!_0x34b5fb[_0xc1d132(0x1a0)])return 0x1;if(!_0x4b6f82[_0xc1d132(0x1a0)])return-0x1;return _0x34b5fb[_0xc1d132(0x1a0)][_0xc1d132(0x178)]-_0x4b6f82['window'][_0xc1d132(0x178)];});const _0x27ab7f=_0x20ab59[_0x325451(0x1d8)],_0x417961=_0x27ab7f>TIMELINE_CONFIG[_0x325451(0x2b3)];_0x417961&&_0x20ab59[_0x325451(0x270)](TIMELINE_CONFIG[_0x325451(0x2b3)]);const _0x3e5756=calculateTimeScale(_0x1a64fe,_0x4aa5a9),_0x3ff71b=_0x243b9c[_0x325451(0x2bf)]?_0x243b9c['success']?a51_0x5af198['green'](_0x325451(0x27f)):a51_0x5af198['red'](_0x325451(0x2a9)):a51_0x5af198['blue'](_0x325451(0x25a)),_0xca535d=_0x243b9c['project']?.['id'],_0x20fe2d=_0x243b9c[_0x325451(0x17c)];let _0x3ec420;if(_0xca535d&&_0x20fe2d){const _0x5bac42=getWorkflowAttemptUrl(_0x3bd040,_0xca535d,_0x20fe2d,_0x243b9c['id']);_0x3ec420=hyperlink(a51_0x5af198[_0x325451(0x278)](_0x243b9c['id']),_0x5bac42);}else _0x3ec420=a51_0x5af198['dim'](_0x243b9c['id']);_0x1fb76b['push'](_0x325451(0x238)+_0x3ec420+_0x325451(0x193)+_0x3ff71b+_0x325451(0x193)+formatElapsed(_0x1a64fe[_0x325451(0x186)]));if(_0x20ab59[_0x325451(0x1d8)]>0x0){const _0x236adb=renderTimeAxis(_0x3e5756,_0x4aa5a9),_0x619643=new Date(_0x1a64fe[_0x325451(0x178)]),_0x13e8d7=formatDate(_0x619643),_0x6940d0=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x325451(0x274)]+_0x174ade,_0x4156d2=_0x13e8d7[_0x325451(0x16e)](_0x6940d0),_0x198e49=a51_0x5af198['dim'](_0x4156d2);_0x1fb76b[_0x325451(0x235)](_0x198e49+'\x20'+_0x236adb);for(const _0x4a01cc of _0x20ab59){_0x1fb76b[_0x325451(0x235)](renderTaskRow(_0x4a01cc,_0x3e5756,_0x4aa5a9,_0x174ade));}const _0x4f5f5c=calculateStats(_0x20ab59);_0x1fb76b['push'](formatStats(_0x4f5f5c)),_0x417961&&_0x1fb76b[_0x325451(0x235)](a51_0x5af198[_0x325451(0x1f4)](_0x325451(0x313)+TIMELINE_CONFIG[_0x325451(0x2b3)]+'\x20of\x20'+_0x27ab7f+'\x20tasks')),_0x1fb76b[_0x325451(0x235)](''),_0x1fb76b['push'](a51_0x5af198['dim'](_0x325451(0x1df))+(_0x325451(0x280)+_0x243b9c['id']+_0x325451(0x30e))+a51_0x5af198[_0x325451(0x278)](_0x325451(0x273)));}else _0x1fb76b[_0x325451(0x235)](_0x325451(0x1ae));return _0x1fb76b[_0x325451(0x1eb)]('\x0a');}[a51_0x64d48f(0x2cf)](_0x2b3114,_0x28b315){const _0x5eb8ce=a51_0x64d48f,_0x20b7c6=new Date(_0x2b3114['createdAt'])[_0x5eb8ce(0x2bd)](),_0x4b9d93=_0x2b3114[_0x5eb8ce(0x2d5)]?new Date(_0x2b3114[_0x5eb8ce(0x2d5)])[_0x5eb8ce(0x2bd)]():Date[_0x5eb8ce(0x2c7)](),_0x50ad21=_0x4b9d93-_0x20b7c6,_0x53d8b3=[];for(const _0x9c6c2b of _0x28b315){if(_0x9c6c2b[_0x5eb8ce(0x1c0)]){const _0x5a8fd8=new Date(_0x9c6c2b['startedAt'])[_0x5eb8ce(0x2bd)](),_0x206d1c=_0x9c6c2b['updatedAt']?new Date(_0x9c6c2b[_0x5eb8ce(0x1ca)])[_0x5eb8ce(0x2bd)]():Date['now']();_0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b['state']||_0x5eb8ce(0x218),'window':{'start':_0x5a8fd8,'end':_0x206d1c,'duration':_0x206d1c-_0x5a8fd8}});}else _0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b[_0x5eb8ce(0x1fa)]||'planned','window':undefined});}const _0x47da7e=calculateStats(_0x53d8b3);return{'attempt':{'id':_0x2b3114['id'],'status':_0x2b3114[_0x5eb8ce(0x2bf)]?_0x2b3114['success']?'success':_0x5eb8ce(0x2a9):_0x5eb8ce(0x25a),'createdAt':_0x2b3114[_0x5eb8ce(0x2e3)],'finishedAt':_0x2b3114['finishedAt'],'duration_ms':_0x50ad21},'tasks':_0x53d8b3[_0x5eb8ce(0x2b9)](_0x37296e=>({'name':_0x37296e[_0x5eb8ce(0x246)],'state':_0x37296e[_0x5eb8ce(0x1fa)],'startedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)][_0x5eb8ce(0x178)])['toISOString']():null,'updatedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)]['end'])[_0x5eb8ce(0x2c6)]():null,'duration_ms':_0x37296e[_0x5eb8ce(0x1a0)]?.['duration']||null})),'stats':_0x47da7e};}}
1
+ const a51_0x3cc69e=a51_0x1488;(function(_0x3aa0f4,_0x144b25){const _0x3abf78=a51_0x1488,_0x156b8c=_0x3aa0f4();while(!![]){try{const _0x7b006b=parseInt(_0x3abf78(0x21e))/0x1*(parseInt(_0x3abf78(0x337))/0x2)+-parseInt(_0x3abf78(0x25e))/0x3*(-parseInt(_0x3abf78(0x1d1))/0x4)+-parseInt(_0x3abf78(0x311))/0x5+parseInt(_0x3abf78(0x2b6))/0x6+parseInt(_0x3abf78(0x217))/0x7*(parseInt(_0x3abf78(0x1ec))/0x8)+-parseInt(_0x3abf78(0x1bb))/0x9+parseInt(_0x3abf78(0x20d))/0xa*(-parseInt(_0x3abf78(0x2fa))/0xb);if(_0x7b006b===_0x144b25)break;else _0x156b8c['push'](_0x156b8c['shift']());}catch(_0x578b10){_0x156b8c['push'](_0x156b8c['shift']());}}}(a51_0x1342,0xeec5f));import a51_0x264b3b from'chalk';import{existsSync}from'fs';import a51_0x5c2dd5 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x51f43d from'prompts';function a51_0x1342(){const _0x38d647=['Target\x20directory:\x20','Setting\x20secret...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Source\x20directory\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','sessionTime','deleted','✔\x20Workflow\x20run\x20started','\x0aDry\x20run\x20-\x20nothing\x20pushed','generateSessionTimelineRows','Retrying\x20attempt...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflowProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20(use\x20--limit\x20to\x20show\x20more)','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','includes','7144504Rsebtl','resolveProjectDir','max','\x20\x20New\x20attempt\x20ID:\x20','\x0aPush\x20these\x20changes?','size','\x20\x20Workflow:\x20','min','canceling','Usage:\x20workflow:delete\x20<project-name-or-id>','find','diff','replace','output','No\x20matching\x20sessions\x20found','No\x20sessions\x20found\x20in\x20project:\x20','durationMs','cyan','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20attempt','Error:\x20Invalid\x20JSON\x20in\x20--params','parseProjectWorkflowPattern','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','done','attempt:','workflow:clone','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','8btyTys','Output\x20directory:\x20','Workflow:\x20','get','basename','Pushing\x20project...','buildTimelineData','Error:\x20Secret\x20key\x20is\x20required','\x20new','Listing\x20secrets...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','logFiles','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:delete','\x20\x20Revision:\x20','(use\x20--limit\x20to\x20see\x20more)','workflow:workflows','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','includeRetried','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Retry\x20started','getTime','Validation:\x20skipped','...','renderTimeline','Downloading\x20logs...','resolve','write','group_error','set','Attempt\x20ID:\x20','Cloning\x20to\x20','20XWpTFN','Starting\x20workflow\x20run...','taskName','\x20\x20Project\x20ID:\x20','pollTimeline','\x20\x20Session\x20ID:\x20','repeat','MAX_LABEL_COUNT','workflow:download','slice','4596907YHxQxI','window','list','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','/app/workflows/','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Fetching\x20log\x20files...','1ZtSGZn','sourceDir','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','startsWith','\x20\x20Project:\x20','navigateSessionsInteractive','projects','\x20\x20Files\x20extracted:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','context','task','Force:\x20yes','listSecrets','now','\x1b[1A\x1b[2K','skipValidation','sessionId','List\x20all\x20workflow\x20projects','\x0aPolling...\x20(','Loading\x20sessions...','workflow:secrets:list','isNewProject','duration','\x0aApply\x20these\x20changes?','verbose','workflow:logs','total','ICON_SPACING','LABEL_MIN_SPACING','Including\x20subtasks:\x20yes','format','\x27...','fullName','description','sessions','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Getting\x20attempt\x20tasks...','Cancelled','\x20secrets\x20set\x20for\x20project\x20\x27','workflow:secrets:delete','projectId','round','changes','tdx.json','deleteSecret','splice','workflowName','getHours','from','sourceProjectName','\x20deleted','trimEnd','clear','No\x20workflows\x20found\x20in\x20project:\x20','\x0a✔\x20Attempt\x20complete','Getting\x20attempt\x20details...','Usage:\x20tdx\x20wf\x20use\x20<project>','Setting\x20','\x20modified','\x20of\x20','\x20task','execute','Project\x20directory:\x20','Pulling\x20project\x20','3RvuyOT','download','all','index','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Auto-selected\x20latest\x20session:\x20','Key\x20cannot\x20be\x20empty','GUTTER','trim','workflow:retry','\x0aError:','Resolving\x20project\x20\x27','workflow:push','\x20logs','yellow','pending','\x0aClone\x20\x22','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','site','\x0a✔\x20No\x20changes\x20to\x20push','\x20to\x20see\x20detailed\x20logs','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','newProjectId','value','Retry\x20a\x20session\x20or\x20attempt','Pull\x20workflow\x20project\x20to\x20local\x20folder','parse','workflow','startTime','table','revision','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0a✔\x20Already\x20up\x20to\x20date','MAX_POLL_ITERATIONS','fill','Killing\x20attempt...','ICON_WIDTH','\x0aUpdate\x20existing\x20project\x20\x22','isDirectory','Retrying\x20session...','stdout','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','attempts','Key:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','success','metadata','values','(unknown)','No\x20projects\x20match\x20pattern:\x20','Failed\x20to\x20fetch\x20attempt\x20data','List\x20workflow\x20attempts','updatedAt','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Analyzing\x20project...','tdx\x20wf\x20attempt\x20','preparePushProject','Filter:\x20project=','New\x20project\x20name:\x20','lastAttempt','✔\x20Showing\x20','\x20is\x20not\x20a\x20directory','title','revision:\x20','✔\x20Deleted\x20project\x20','start','text','msPerChar','\x20\x20Attempt\x20ID:\x20','workflow:run','\x22\x20already\x20exists\x20(ID:\x20','every','\x20workflow','padStart','resumeFrom','\x20\x20Changes:\x20','Loading\x20workflows...','key','green','isTTY','Listing\x20workflow\x20sessions...','startedAt','\x20\x20Console:\x20','Invalid\x20format:\x20','filter','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','unchanged','10383036aQfYsT','No\x20attempts\x20found\x20for:\x20','Dry\x20run:\x20yes','MIN_LABEL_COUNT','No\x20log\x20files\x20found\x20for\x20this\x20attempt','getMonth','modified','Updating\x20','Deleting\x20secret...','Downloading\x20project\x20','🔄\x20','✔\x20Pull\x20complete','Status:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','has','workflow:kill','attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','hasChanges','map','state','jsonl','/sessions/','\x20tasks','No\x20sessions\x20found','Total:\x20','floor','length','\x20project','session:','dryRun','executePushProject','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','running','\x0aFailed\x20to\x20fetch\x20attempt\x20data','delete','retryAttempt','---\x20','⚠\x20Showing\x20first\x20','✔\x20Pushed\x20','\x20sessions\x20','workflow:pull','attemptId','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Target:\x20','stat','Writing\x20files...','finishedAt','newProjectName','limit','\x20unchanged','push','workflow:tasks','Error:\x20Invalid\x20parameter\x20format:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','📁\x20','params','keys','workflow:timeline','✔\x20Workflow\x20project\x20set\x20to:\x20','path','MIN_TIMELINE_WIDTH','No\x20sessions\x20found\x20for:\x20','✔\x20Found\x20','select','red','readFile','22676379YWjyhs','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','targetExists','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x22\x20to\x20new\x20project\x20\x22','some','\x20\x20Source:\x20','param','Deleting\x20project\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','getDate','fromTask','planned','summary','displayLine','\x0aDry\x20run\x20-\x20no\x20project\x20created','createdAt','📋\x20','Files\x20to\x20upload:\x20','Expected\x20format:\x20--param\x20key=value','cancelRequested','Latest\x20session\x20has\x20no\x20attempt','filesExtracted','2549575kpaiEa','Revision:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','cwd','type','\x20secret','Source\x20directory:\x20','Pattern:\x20','Secrets\x20to\x20set:\x20','toLowerCase','yes','reason','workflow:secrets:set','projectName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','resolveProject','dim','rows','blue','retryAttemptName','Project\x20name\x20is\x20required','Task\x20name:\x20','Attempt:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','join','utf-8','renderSessionsTimeline','Error:\x20Attempt\x20ID\x20is\x20required','sort','renderSingleTimeline','tasks','indexOf','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','includeSubtasks','\x20\x20tdx\x20wf\x20use\x20<project>','Source\x20project:\x20','new','List\x20workflow\x20execution\x20sessions','2943624toPkJW','pullProject','✔\x20Workflow\x20project\x20context\x20cleared.','showWorkflowConsoleUrl','applyPullProject','From\x20task:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','fileCount','follow','retrySession','match','Listing\x20workflows...','substring','\x27\x20from\x20project\x20\x27','fs/promises','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','json','session_id','Warning:','Reason:\x20','✔\x20Project\x20updated','Start\x20a\x20workflow\x20run','localeCompare','stringify','Session\x20','session','isArray','Project:\x20','/attempt/','Source:\x20','requireProject','error','Filter:\x20','Project\x20name:\x20','\x20secrets...',',\x20Workflow:\x20','existingProjectId','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20session','Kill\x20a\x20running\x20attempt','end','workflow:use','Error:\x20','split','workflow:attempts','\x20\x20Location:\x20','log','workflows','project','\x20-\x20','Error:','status','No\x20workflow\x20sessions\x20found','MAX_TASKS_DISPLAY','data','getFullYear','Show\x20logs\x20for\x20a\x20workflow\x20attempt','308133BLLGlU','targetDir','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Session\x20time:\x20','Params:\x20'];a51_0x1342=function(){return _0x38d647;};return a51_0x1342();}function getAttemptStatusDisplay(_0x3aebf8){const _0x5a6cc8=a51_0x1488;if(!_0x3aebf8)return{'icon':'⏳','text':''};const {done:_0x2e6883,success:_0x3b0e9a,cancelRequested:_0x16b068}=_0x3aebf8;if(!_0x2e6883)return _0x16b068?{'icon':'🛑','text':a51_0x264b3b['yellow'](_0x5a6cc8(0x1d9))}:{'icon':'🔄','text':a51_0x264b3b[_0x5a6cc8(0x323)](_0x5a6cc8(0x2d8))};if(_0x3b0e9a)return{'icon':'✅','text':a51_0x264b3b[_0x5a6cc8(0x2ad)]('success')};return{'icon':'❌','text':a51_0x264b3b['red'](_0x5a6cc8(0x1a0))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x3cc69e(0x320)](_0xa296f2,_0x5819b3,_0x302d1b=0x0){const _0x246c38=a51_0x3cc69e;return _0xa296f2[_0x302d1b]||_0x5819b3[_0x246c38(0x1cc)];}[a51_0x3cc69e(0x19f)](_0x4e563e,_0x46656c,_0x5c19c0=0x0){const _0x2ff787=a51_0x3cc69e,_0x4043cb=this['resolveProject'](_0x4e563e,_0x46656c,_0x5c19c0);if(!_0x4043cb)return console[_0x2ff787(0x1a0)](a51_0x264b3b[_0x2ff787(0x2f8)](_0x2ff787(0x1b4)),'Project\x20name\x20is\x20required'),console[_0x2ff787(0x1a0)](a51_0x264b3b[_0x2ff787(0x321)](_0x2ff787(0x331))),null;return _0x4043cb;}[a51_0x3cc69e(0x1e6)](_0x4bf324,_0x101f4c){const _0x523175=a51_0x3cc69e;if(_0x4bf324[0x0]){const _0x4b8d03=_0x4bf324[0x0][_0x523175(0x1ad)]('.');if(_0x4b8d03[_0x523175(0x2d2)]===0x1)return{'projectName':_0x4b8d03[0x0],'workflowName':undefined};else return _0x4b8d03[_0x523175(0x2d2)]===0x2?{'projectName':_0x4b8d03[0x0],'workflowName':_0x4b8d03[0x1]}:(console[_0x523175(0x1a0)](a51_0x264b3b[_0x523175(0x2f8)](_0x523175(0x1b4)),_0x523175(0x328)),null);}return{'projectName':_0x101f4c[_0x523175(0x1cc)],'workflowName':undefined};}['resolveProjectDir'](_0x30e7eb,_0x5716b7,_0x37d3cc=0x0){const _0x10ef87=a51_0x3cc69e;if(_0x30e7eb[_0x37d3cc])return _0x30e7eb[_0x37d3cc];if(_0x5716b7[_0x10ef87(0x1cc)]){const _0x4ec539=a51_0x5c2dd5[_0x10ef87(0x329)](process[_0x10ef87(0x314)](),_0x10ef87(0x1b1),_0x5716b7[_0x10ef87(0x1cc)]);if(existsSync(a51_0x5c2dd5[_0x10ef87(0x329)](_0x4ec539,_0x10ef87(0x249))))return _0x4ec539;}return undefined;}async[a51_0x3cc69e(0x33a)](_0x35fd6b,_0x361229,_0x757e21){const _0x302dba=a51_0x3cc69e;try{const _0x59af4f=await _0x35fd6b['workflow'][_0x302dba(0x1b1)](_0x361229,{'limit':0x1});if(_0x59af4f[_0x302dba(0x2d2)]>0x0){const _0x11b2c8=_0x59af4f[0x0]['id'],_0x238a91=getWorkflowUrl(_0x757e21,_0x11b2c8);console[_0x302dba(0x1a0)](_0x302dba(0x2b1)+a51_0x264b3b[_0x302dba(0x1e2)](_0x238a91));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x1ab);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x1cf);async[a51_0x3cc69e(0x25b)](_0x198df1){const _0x42088a=a51_0x3cc69e,{options:_0x2a72ec,args:_0x13ee9e,tdx:_0x2a3016}=_0x198df1,_0x117050=_0x13ee9e[0x0],_0x1c0fa9=_0x2a72ec[_0x42088a(0x252)];if(_0x1c0fa9)return saveSessionContext({'workflow_project':undefined},_0x2a72ec[_0x42088a(0x19a)]),console['log'](a51_0x264b3b[_0x42088a(0x2ad)](_0x42088a(0x339))),0x0;if(!_0x117050)return console[_0x42088a(0x1a0)](a51_0x264b3b[_0x42088a(0x2f8)](_0x42088a(0x1b4)),_0x42088a(0x325)),console[_0x42088a(0x1a0)](a51_0x264b3b[_0x42088a(0x321)](_0x42088a(0x256))),console[_0x42088a(0x1a0)](a51_0x264b3b[_0x42088a(0x321)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0xdb8bdf=await withSpinner(_0x42088a(0x269)+_0x117050+_0x42088a(0x23d),()=>_0x2a3016['workflow']['resolveProjectId'](_0x117050),{'verbose':_0x2a72ec[_0x42088a(0x236)]}),{name:_0x536a22}=_0xdb8bdf[_0x42088a(0x1b8)];return saveSessionContext({'workflow_project':_0x536a22},_0x2a72ec[_0x42088a(0x19a)]),console[_0x42088a(0x1b0)](a51_0x264b3b[_0x42088a(0x2ad)](_0x42088a(0x2f2)+a51_0x264b3b[_0x42088a(0x1e2)](_0x536a22))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]='workflow:projects';[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x22f);async['execute'](_0x347cf7){const _0x470587=a51_0x3cc69e,{options:_0x43a4d7,args:_0x4562d7,tdx:_0xbce9c4}=_0x347cf7,_0x353a7c=_0x4562d7[0x0];_0x43a4d7[_0x470587(0x236)]&&_0x353a7c&&console[_0x470587(0x1a0)](_0x470587(0x318)+_0x353a7c);const _0x5b3cdf=await withSpinner('Listing\x20workflow\x20projects...',()=>_0xbce9c4[_0x470587(0x27a)][_0x470587(0x224)](_0x353a7c,{'limit':_0x43a4d7[_0x470587(0x2e8)]}),{'verbose':_0x43a4d7[_0x470587(0x236)]});let _0x3d7300=_0x5b3cdf[_0x470587(0x1b8)];_0x3d7300['sort']((_0x54d041,_0x50f708)=>_0x54d041[_0x470587(0x1f7)][_0x470587(0x197)](_0x50f708['name']));const _0x34f249=_0x43a4d7[_0x470587(0x2e8)]||0x64,_0x42cc0d=_0x3d7300[_0x470587(0x2d2)]>=_0x34f249?a51_0x264b3b[_0x470587(0x321)](_0x470587(0x1ce)):'';console[_0x470587(0x1a0)](_0x470587(0x2f6)+_0x3d7300[_0x470587(0x2d2)]+_0x470587(0x2d3)+(_0x3d7300['length']!==0x1?'s':'')+_0x42cc0d);if(_0x43a4d7[_0x470587(0x23c)]===_0x470587(0x191)||_0x43a4d7[_0x470587(0x23c)]==='jsonl'||_0x43a4d7['format']===_0x470587(0x27c))await handleSDKOutput(_0x3d7300,_0x43a4d7);else{if(_0x3d7300[_0x470587(0x2d2)]===0x0)_0x353a7c?console[_0x470587(0x1b0)](_0x470587(0x290)+_0x353a7c):console['log']('No\x20workflow\x20projects\x20found');else{const _0x18c2f7=_0x3d7300['map'](_0x5ccd63=>{const _0x29b5f0=_0x470587,_0x403691=_0x5ccd63[_0x29b5f0(0x28d)]?.[_0x29b5f0(0x2ff)](_0x4d33fa=>_0x4d33fa[_0x29b5f0(0x2ac)]==='sys'),_0x9bd394=_0x403691?a51_0x264b3b[_0x29b5f0(0x321)]('\x20(system)'):'';return _0x29b5f0(0x2ee)+_0x5ccd63[_0x29b5f0(0x1f7)]+_0x9bd394;});await writeOutput(_0x18c2f7['join']('\x0a'),_0x43a4d7['output'],_0x470587(0x219));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a51_0x3cc69e(0x1fd);[a51_0x3cc69e(0x23f)]='List\x20workflows';async['execute'](_0x1b2273){const _0x1e685c=a51_0x3cc69e,{options:_0x20ddb2,args:_0x2413e4,tdx:_0xdfa76e}=_0x1b2273,_0x2ee478=this[_0x1e685c(0x320)](_0x2413e4,_0x20ddb2);_0x20ddb2['verbose']&&_0x2ee478&&console[_0x1e685c(0x1a0)]('Project\x20filter:\x20'+_0x2ee478);const _0x32ec7a=await withSpinner(_0x1e685c(0x18c),()=>_0xdfa76e[_0x1e685c(0x27a)][_0x1e685c(0x1b1)](_0x2ee478,{'limit':_0x20ddb2[_0x1e685c(0x2e8)]}),{'verbose':_0x20ddb2[_0x1e685c(0x236)]});let _0x5187d5=_0x32ec7a[_0x1e685c(0x1b8)];_0x5187d5[_0x1e685c(0x32d)]((_0x275059,_0x430226)=>{const _0x230168=_0x1e685c,_0x335266=_0x275059[_0x230168(0x1f7)]['localeCompare'](_0x430226[_0x230168(0x1f7)]);if(_0x335266!==0x0)return _0x335266;return(_0x275059[_0x230168(0x1b2)]?.[_0x230168(0x1f7)]||'')['localeCompare'](_0x430226['project']?.[_0x230168(0x1f7)]||'');});const _0x4cb495=_0x20ddb2[_0x1e685c(0x2e8)]||0x64,_0x3abe1b=_0x5187d5[_0x1e685c(0x2d2)]>=_0x4cb495?a51_0x264b3b['dim'](_0x1e685c(0x1ce)):'';console[_0x1e685c(0x1a0)](_0x1e685c(0x2f6)+_0x5187d5['length']+_0x1e685c(0x2a7)+(_0x5187d5[_0x1e685c(0x2d2)]!==0x1?'s':'')+_0x3abe1b);if(_0x20ddb2['format']==='json'||_0x20ddb2[_0x1e685c(0x23c)]===_0x1e685c(0x2cc)||_0x20ddb2[_0x1e685c(0x23c)]===_0x1e685c(0x27c))await handleSDKOutput(_0x5187d5,_0x20ddb2);else{if(_0x5187d5[_0x1e685c(0x2d2)]===0x0)_0x2ee478?console[_0x1e685c(0x1b0)](_0x1e685c(0x253)+_0x2ee478):console['log']('No\x20workflows\x20found');else{const _0x40a001=_0x20ddb2[_0x1e685c(0x271)],_0x80cdc0=_0x5187d5['map'](_0x52ac58=>{const _0x20d4b8=_0x1e685c,_0x8eac49=a51_0x264b3b['dim']('#'+_0x52ac58['id']),_0x1932fb=hyperlink(_0x8eac49,getWorkflowUrl(_0x40a001,_0x52ac58['id'])),_0x216529=_0x52ac58[_0x20d4b8(0x1b2)]?.['name']?a51_0x264b3b[_0x20d4b8(0x321)]('\x20('+_0x52ac58[_0x20d4b8(0x1b2)][_0x20d4b8(0x1f7)]+')'):'';return _0x20d4b8(0x30b)+_0x1932fb+'\x20'+_0x52ac58[_0x20d4b8(0x1f7)]+_0x216529;});await writeOutput(_0x80cdc0[_0x1e685c(0x329)]('\x0a'),_0x20ddb2[_0x1e685c(0x1de)],_0x1e685c(0x219));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]='workflow:sessions';[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x336);async[a51_0x3cc69e(0x25b)](_0x2be923){const _0x3f9c5c=a51_0x3cc69e,{options:_0x59ee66,args:_0x16c45f,tdx:_0x2002f9}=_0x2be923,_0x622ced=this[_0x3f9c5c(0x1e6)](_0x16c45f,_0x59ee66);if(!_0x622ced)return 0x1;const {projectName:_0xdf1e6a,workflowName:_0x1411c5}=_0x622ced;if(_0x59ee66[_0x3f9c5c(0x236)]){if(_0xdf1e6a&&_0x1411c5)console[_0x3f9c5c(0x1a0)]('Filter:\x20'+_0xdf1e6a+'.'+_0x1411c5);else _0xdf1e6a&&console['error'](_0x3f9c5c(0x298)+_0xdf1e6a);const _0x1617e2=_0x59ee66[_0x3f9c5c(0x1b5)];_0x1617e2&&console['error'](_0x3f9c5c(0x2c2)+_0x1617e2);}let _0x4e0476=0x28;if(process['stdout']['isTTY']&&!_0x59ee66[_0x3f9c5c(0x1de)]&&!_0x59ee66[_0x3f9c5c(0x23c)]){const _0x31b463=process[_0x3f9c5c(0x287)]['rows']||0x28;_0x4e0476=Math[_0x3f9c5c(0x1d3)](0x14,Math['floor'](_0x31b463*0x2/0x3));}const _0x13d211=_0x59ee66[_0x3f9c5c(0x2e8)]||_0x4e0476,_0x42a3f8=await withSpinner(_0x3f9c5c(0x2af),()=>_0x2002f9[_0x3f9c5c(0x27a)]['sessions']({'projectName':_0xdf1e6a,'workflowName':_0x1411c5,'status':_0x59ee66[_0x3f9c5c(0x1b5)],'fromTime':_0x59ee66[_0x3f9c5c(0x24e)],'toTime':_0x59ee66['to'],'limit':_0x13d211}),{'verbose':_0x59ee66[_0x3f9c5c(0x236)]}),_0x44b1b5=_0x42a3f8[_0x3f9c5c(0x1b8)];_0x44b1b5[_0x3f9c5c(0x32d)]((_0x125536,_0x712f49)=>{const _0x3856af=_0x3f9c5c,_0x5efebe=_0x125536[_0x3856af(0x1c5)]||'',_0x6936a=_0x712f49[_0x3856af(0x1c5)]||'';return _0x6936a[_0x3856af(0x197)](_0x5efebe);});_0x44b1b5['length']>=_0x13d211?console['error'](_0x3f9c5c(0x29b)+_0x44b1b5[_0x3f9c5c(0x2d2)]+_0x3f9c5c(0x2df)+a51_0x264b3b['dim'](_0x3f9c5c(0x1fc))):console['error'](_0x3f9c5c(0x2f6)+_0x44b1b5[_0x3f9c5c(0x2d2)]+_0x3f9c5c(0x1a8)+(_0x44b1b5[_0x3f9c5c(0x2d2)]!==0x1?'s':''));if(_0x59ee66[_0x3f9c5c(0x23c)]===_0x3f9c5c(0x191)||_0x59ee66[_0x3f9c5c(0x23c)]===_0x3f9c5c(0x2cc)||_0x59ee66[_0x3f9c5c(0x23c)]==='table')await handleSDKOutput(_0x44b1b5,_0x59ee66);else{if(!process[_0x3f9c5c(0x287)]['isTTY']||_0x59ee66[_0x3f9c5c(0x1de)]){if(_0x44b1b5[_0x3f9c5c(0x2d2)]===0x0){if(_0xdf1e6a&&_0x1411c5)console[_0x3f9c5c(0x1b0)]('No\x20sessions\x20found\x20for:\x20'+_0xdf1e6a+'.'+_0x1411c5);else _0xdf1e6a?console['log'](_0x3f9c5c(0x1e0)+_0xdf1e6a):console['log']('No\x20sessions\x20found');}else{const _0x3774fb=_0x59ee66[_0x3f9c5c(0x271)],_0x8aa369=this[_0x3f9c5c(0x32b)](_0x44b1b5,_0x3774fb);_0x59ee66['output']?await writeOutput(_0x8aa369,_0x59ee66['output'],_0x3f9c5c(0x219)):console[_0x3f9c5c(0x1b0)](_0x8aa369);}!_0xdf1e6a&&(console['error'](''),console['error'](a51_0x264b3b[_0x3f9c5c(0x321)](_0x3f9c5c(0x1a7))),console[_0x3f9c5c(0x1a0)](a51_0x264b3b[_0x3f9c5c(0x321)](_0x3f9c5c(0x31f))+'or'+a51_0x264b3b[_0x3f9c5c(0x321)](_0x3f9c5c(0x333))));}else{if(_0x44b1b5[_0x3f9c5c(0x2d2)]===0x0){if(_0xdf1e6a&&_0x1411c5)console[_0x3f9c5c(0x1b0)](_0x3f9c5c(0x2f5)+_0xdf1e6a+'.'+_0x1411c5);else _0xdf1e6a?console[_0x3f9c5c(0x1b0)](_0x3f9c5c(0x1e0)+_0xdf1e6a):console['log'](_0x3f9c5c(0x2cf));}else await this['navigateSessionsInteractive'](_0x44b1b5,_0x2be923,_0xdf1e6a);}}return 0x0;}[a51_0x3cc69e(0x32b)](_0x2620b9,_0x3c9742){const _0x2c0ea1=a51_0x3cc69e,_0x15a1df=[],_0x1b549d=new Map();let _0x2353de=Infinity,_0x4e1496=-Infinity;for(const _0x252698 of _0x2620b9){if(_0x252698['lastAttempt']?.['createdAt']){const _0x3a5441=new Date(_0x252698[_0x2c0ea1(0x29a)][_0x2c0ea1(0x30a)])['getTime'](),_0x4689a5=_0x252698[_0x2c0ea1(0x29a)]['finishedAt']?new Date(_0x252698['lastAttempt'][_0x2c0ea1(0x2e6)])['getTime']():Date[_0x2c0ea1(0x22b)](),_0x2436d3=_0x252698['project']?.[_0x2c0ea1(0x1f7)]||_0x2c0ea1(0x28f);!_0x1b549d[_0x2c0ea1(0x2c4)](_0x2436d3)&&_0x1b549d[_0x2c0ea1(0x20a)](_0x2436d3,[]),_0x1b549d['get'](_0x2436d3)[_0x2c0ea1(0x2ea)]({'session':_0x252698,'startTime':_0x3a5441,'endTime':_0x4689a5,'duration':_0x4689a5-_0x3a5441}),_0x2353de=Math[_0x2c0ea1(0x1d8)](_0x2353de,_0x3a5441),_0x4e1496=Math[_0x2c0ea1(0x1d3)](_0x4e1496,_0x4689a5);}}if(_0x1b549d[_0x2c0ea1(0x1d6)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x29d659=process['stdout']['columns']||0x78,_0x23da2b=0x1e,_0x2cfc87=0x32,_0x2d7702=0x4,_0x1f335d=Math[_0x2c0ea1(0x1d8)](_0x2cfc87,Math[_0x2c0ea1(0x1d3)](_0x23da2b,Math[_0x2c0ea1(0x2d1)](_0x29d659*0.3))),_0x98db5c=_0x29d659-_0x1f335d-TIMELINE_CONFIG[_0x2c0ea1(0x265)]-0x3-_0x2d7702,_0x7289b0=_0x4e1496-_0x2353de,_0x9bf3de=_0x7289b0/_0x1f335d,_0x2beeb6=renderTimeAxis({'startTime':_0x2353de,'endTime':_0x4e1496,'durationMs':_0x7289b0,'msPerChar':_0x9bf3de},_0x1f335d),_0x8c8436=[];for(const _0x23c4d0 of _0x1b549d[_0x2c0ea1(0x28e)]()){_0x8c8436[_0x2c0ea1(0x2ea)](..._0x23c4d0);}_0x8c8436[_0x2c0ea1(0x32d)]((_0x14ac78,_0x59dc79)=>_0x59dc79['startTime']-_0x14ac78[_0x2c0ea1(0x27b)]);const _0x2b7101=new Date(_0x2353de),_0x5e04f2=formatDate(_0x2b7101),_0x13d985=_0x2d7702+TIMELINE_CONFIG[_0x2c0ea1(0x283)]+TIMELINE_CONFIG[_0x2c0ea1(0x239)]+_0x98db5c,_0x4ff27e='\x20'['repeat'](_0x13d985-_0x5e04f2[_0x2c0ea1(0x2d2)]),_0x379cb9=_0x4ff27e+a51_0x264b3b[_0x2c0ea1(0x321)](_0x5e04f2)+'\x20'+_0x2beeb6;_0x15a1df[_0x2c0ea1(0x2ea)](_0x379cb9);const _0x349f27=0x16;let _0x1d4c12=0x0;for(const _0x3489b9 of _0x8c8436){const _0x278e9d=_0x3489b9[_0x2c0ea1(0x19a)]['project']?.[_0x2c0ea1(0x1f7)]||'?',_0x394e20=Math['min'](stringWidth(_0x278e9d),_0x349f27);_0x1d4c12=Math[_0x2c0ea1(0x1d3)](_0x1d4c12,_0x394e20);}for(const _0x38a781 of _0x8c8436){const {session:_0x2df6ce,startTime:_0x311af4,endTime:_0x4e7f97,duration:_0x21e8cc}=_0x38a781,_0x15e330=_0x2df6ce[_0x2c0ea1(0x1b2)]?.['id'],_0x1e6747=_0x2df6ce['id'],_0x599a0b=_0x2df6ce[_0x2c0ea1(0x1b2)]?.[_0x2c0ea1(0x1f7)]||'?',_0x552c9b=_0x2df6ce[_0x2c0ea1(0x27a)]?.[_0x2c0ea1(0x1f7)]||'?';let _0x58fc0f,_0x1f424c;if(_0x2df6ce[_0x2c0ea1(0x29a)]){const _0x25122f=_0x2df6ce['lastAttempt'];!_0x25122f[_0x2c0ea1(0x1e8)]?(_0x58fc0f=_0x25122f[_0x2c0ea1(0x30e)]?'🛑':'🔄',_0x1f424c=_0x25122f['cancelRequested']?a51_0x264b3b[_0x2c0ea1(0x26c)]:a51_0x264b3b['blue']):(_0x58fc0f=_0x25122f[_0x2c0ea1(0x28c)]?'✅':'❌',_0x1f424c=_0x25122f['success']?a51_0x264b3b[_0x2c0ea1(0x2ad)]:a51_0x264b3b[_0x2c0ea1(0x2f8)]);}else _0x58fc0f='⏳',_0x1f424c=a51_0x264b3b['dim'];const _0x547d23='#'+_0x1e6747,_0x4bda7d=_0x15e330?hyperlink(_0x547d23,getWorkflowSessionUrl(_0x3c9742,_0x15e330,_0x1e6747)):_0x547d23;let _0x27e384=_0x599a0b;stringWidth(_0x599a0b)>_0x349f27&&(_0x27e384=_0x599a0b[_0x2c0ea1(0x216)](0x0,_0x349f27-0x1)+'…');const _0x57e9c6=a51_0x264b3b[_0x2c0ea1(0x321)](_0x27e384),_0x2c7d63=stringWidth(_0x27e384),_0x1623b5='\x20'[_0x2c0ea1(0x213)](_0x1d4c12-stringWidth(_0x27e384)+0x2),_0x3ba4b6='('+formatElapsed(_0x21e8cc)+')',_0x4d153c=stringWidth(_0x3ba4b6),_0x5c6baf=stringWidth(_0x547d23),_0x1beb6e=_0x5c6baf+0x1+_0x2c7d63+_0x1623b5[_0x2c0ea1(0x2d2)],_0x196b2c=_0x98db5c-_0x1beb6e-_0x4d153c-0x1-0x8;let _0x5191fc=_0x552c9b;stringWidth(_0x5191fc)>_0x196b2c&&(_0x5191fc=_0x5191fc[_0x2c0ea1(0x216)](0x0,_0x196b2c-0x1)+'…');const _0xabee2a=_0x4bda7d+'\x20'+_0x57e9c6+_0x1623b5+_0x5191fc,_0x1495b0=stringWidth(_0xabee2a),_0x372c6d=_0x98db5c-_0x1495b0-_0x4d153c,_0x10135c=_0xabee2a+'\x20'[_0x2c0ea1(0x213)](Math[_0x2c0ea1(0x1d3)](0x1,_0x372c6d))+a51_0x264b3b[_0x2c0ea1(0x321)](_0x3ba4b6),_0x5d62af=Math[_0x2c0ea1(0x2d1)]((_0x311af4-_0x2353de)/_0x9bf3de),_0x447add=Math[_0x2c0ea1(0x2d1)]((_0x4e7f97-_0x2353de)/_0x9bf3de),_0x5c6fb6=Math[_0x2c0ea1(0x1d3)](_0x5d62af+0x1,_0x447add),_0x1dd12e=new Array(_0x1f335d)[_0x2c0ea1(0x281)]('\x20');for(let _0x3c684e=_0x5d62af;_0x3c684e<Math['min'](_0x5c6fb6,_0x1f335d);_0x3c684e++){_0x1dd12e[_0x3c684e]='─';}const _0x18b25a=_0x1dd12e[_0x2c0ea1(0x2ca)](_0x405112=>_0x405112==='\x20'?'\x20':_0x1f424c(_0x405112))[_0x2c0ea1(0x329)]('');_0x15a1df['push'](_0x58fc0f+'\x20'+_0x10135c+'│'+_0x18b25a+'│');}return _0x15a1df[_0x2c0ea1(0x329)]('\x0a');}async[a51_0x3cc69e(0x223)](_0x5b9de9,_0x3f3010,_0x25735c){const _0x1b3d45=a51_0x3cc69e,{options:_0x4a0c7d,tdx:_0x48e5ec}=_0x3f3010,_0x5074e5=_0x4a0c7d[_0x1b3d45(0x271)],{timelineRows:_0x4afa7f,timeAxisHeader:_0x1af505}=this[_0x1b3d45(0x1c9)](_0x5b9de9,_0x5074e5),_0x5fbdc7=_0x4afa7f[_0x1b3d45(0x2b3)](_0x35b1ae=>_0x35b1ae[_0x1b3d45(0x2e1)]);if(_0x5fbdc7[_0x1b3d45(0x2d2)]===0x0){const _0x18a1bb=this[_0x1b3d45(0x32b)](_0x5b9de9,_0x5074e5);console[_0x1b3d45(0x1b0)](_0x18a1bb);!_0x25735c&&(console[_0x1b3d45(0x1a0)](''),console[_0x1b3d45(0x1a0)](a51_0x264b3b[_0x1b3d45(0x321)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x1b3d45(0x1a0)](a51_0x264b3b[_0x1b3d45(0x321)](_0x1b3d45(0x31f))+'or'+a51_0x264b3b[_0x1b3d45(0x321)](_0x1b3d45(0x333))));return;}_0x1af505&&console[_0x1b3d45(0x1b0)](_0x1af505);const _0x35e8da=_0x4afa7f[_0x1b3d45(0x2b3)](_0x183a7c=>_0x183a7c[_0x1b3d45(0x2e1)])[_0x1b3d45(0x2ca)](_0x5ae09e=>({'title':_0x5ae09e[_0x1b3d45(0x308)],'value':_0x5ae09e[_0x1b3d45(0x2e1)]})),_0x4ea780=process[_0x1b3d45(0x287)][_0x1b3d45(0x322)]||0x3c,_0x4c3196=Math['max'](0x28,Math[_0x1b3d45(0x2d1)](_0x4ea780*0x2/0x3)),_0x57ae66=await a51_0x51f43d({'type':'autocomplete','name':_0x1b3d45(0x2e1),'message':_0x1b3d45(0x21a),'choices':_0x35e8da,'initial':-0x1,'limit':_0x4c3196,'clearFirst':!![],'fallback':{'title':_0x1b3d45(0x1df),'value':null},'suggest':(_0x3b2ec3,_0x7ceb45)=>{const _0x47313b=_0x1b3d45;if(!_0x3b2ec3)return Promise[_0x47313b(0x207)](_0x7ceb45);const _0x108fac=_0x7ceb45[_0x47313b(0x2b3)](_0x28bb62=>{const _0x11923d=_0x47313b,_0x3b6a9f=_0x28bb62;return _0x3b6a9f[_0x11923d(0x29d)][_0x11923d(0x31a)]()[_0x11923d(0x1d0)](_0x3b2ec3[_0x11923d(0x31a)]());});return Promise[_0x47313b(0x207)](_0x108fac);}}),_0x39d081=()=>{const _0x111eb9=_0x1b3d45;process[_0x111eb9(0x287)][_0x111eb9(0x208)]('\x1b[1A\x1b[2K'),process[_0x111eb9(0x287)][_0x111eb9(0x208)](_0x111eb9(0x22c)),process[_0x111eb9(0x287)][_0x111eb9(0x208)](_0x111eb9(0x22c));},_0x12afc5=_0x57ae66&&_0x57ae66[_0x1b3d45(0x2e1)]&&_0x57ae66[_0x1b3d45(0x2e1)]!==null&&_0x57ae66[_0x1b3d45(0x2e1)][_0x1b3d45(0x266)]()!=='';if(!_0x12afc5){_0x39d081(),console[_0x1b3d45(0x1b0)](a51_0x264b3b[_0x1b3d45(0x321)](_0x1b3d45(0x243)));return;}_0x39d081();const _0x4831c7=_0x5b9de9[_0x1b3d45(0x1db)](_0x48a5f2=>_0x48a5f2[_0x1b3d45(0x29a)]?.['id']===_0x57ae66[_0x1b3d45(0x2e1)]);if(_0x4831c7){const _0x59b9d6=_0x4831c7[_0x1b3d45(0x1b2)]?.[_0x1b3d45(0x1f7)]||'?',_0x846a66=_0x4831c7['workflow']?.[_0x1b3d45(0x1f7)]||'?';console[_0x1b3d45(0x1b0)]('Project:\x20'+a51_0x264b3b[_0x1b3d45(0x321)](_0x59b9d6)+_0x1b3d45(0x1a4)+a51_0x264b3b[_0x1b3d45(0x321)](_0x846a66));}const _0x529d69=new WorkflowTimelineCommand();await _0x529d69[_0x1b3d45(0x25b)]({'args':[],'options':{..._0x4a0c7d,'attemptId':_0x57ae66[_0x1b3d45(0x2e1)]},'tdx':_0x48e5ec});}['generateSessionTimelineRows'](_0x4b5afd,_0xc98484){const _0x50083b=a51_0x3cc69e,_0x57ff88=new Map();for(const _0x24bce0 of _0x4b5afd){_0x24bce0['id']&&_0x24bce0[_0x50083b(0x29a)]?.['id']&&_0x57ff88[_0x50083b(0x20a)](_0x24bce0['id'],_0x24bce0[_0x50083b(0x29a)]['id']);}const _0x54a7ea=[];let _0x25f9a3='';const _0x5be2db=this[_0x50083b(0x32b)](_0x4b5afd,_0xc98484),_0x23c952=_0x5be2db[_0x50083b(0x1ad)]('\x0a');for(const _0x3132c9 of _0x23c952){if(_0x3132c9['startsWith'](_0x50083b(0x2b4))||_0x3132c9[_0x50083b(0x18b)](/^\s+\d{4}-\d{2}-\d{2}/))_0x25f9a3=_0x3132c9;else{if(_0x3132c9['match'](/^[✅❌🔄🛑⏳]/)){const _0x18ac94=_0x3132c9[_0x50083b(0x18b)](/#(\d+)/),_0xe4e442=_0x18ac94?_0x18ac94[0x1]:null,_0x26127c=_0xe4e442?_0x57ff88[_0x50083b(0x1ef)](_0xe4e442)||null:null,_0x939d33=_0x4b5afd[_0x50083b(0x1db)](_0x3cec51=>_0x3cec51['id']===_0xe4e442),_0x15336a=_0x939d33?.['project']?.[_0x50083b(0x1f7)]||'';_0x54a7ea[_0x50083b(0x2ea)]({'displayLine':_0x3132c9,'attemptId':_0x26127c,'projectName':_0x15336a});}}}return{'timelineRows':_0x54a7ea,'timeAxisHeader':_0x25f9a3};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x1ae);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x292);async[a51_0x3cc69e(0x25b)](_0x387fb4){const _0x15f04a=a51_0x3cc69e,{options:_0x5ea851,args:_0x12775e,tdx:_0x4998ac}=_0x387fb4,_0x474b91=this[_0x15f04a(0x1e6)](_0x12775e,_0x5ea851);if(!_0x474b91)return 0x1;const {projectName:_0x595e84,workflowName:_0x29e0ad}=_0x474b91,_0x1bdec6=_0x5ea851[_0x15f04a(0x1ff)];if(_0x5ea851['verbose']){if(_0x595e84&&_0x29e0ad)console[_0x15f04a(0x1a0)]('Filter:\x20'+_0x595e84+'.'+_0x29e0ad);else _0x595e84&&console[_0x15f04a(0x1a0)](_0x15f04a(0x298)+_0x595e84);_0x1bdec6&&console[_0x15f04a(0x1a0)]('Include\x20retried:\x20yes');}const _0x3b831c=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x4998ac[_0x15f04a(0x27a)][_0x15f04a(0x289)]({'projectName':_0x595e84,'workflowName':_0x29e0ad,'includeRetried':_0x1bdec6,'limit':_0x5ea851[_0x15f04a(0x2e8)]}),{'verbose':_0x5ea851[_0x15f04a(0x236)]}),_0x33a146=_0x3b831c[_0x15f04a(0x1b8)],_0xe54f69=_0x5ea851[_0x15f04a(0x2e8)]||0x64,_0x47fa26=_0x33a146['length']>=_0xe54f69?a51_0x264b3b['dim'](_0x15f04a(0x1ce)):'';console[_0x15f04a(0x1a0)]('✔\x20Found\x20'+_0x33a146[_0x15f04a(0x2d2)]+_0x15f04a(0x1e4)+(_0x33a146['length']!==0x1?'s':'')+_0x47fa26);if(_0x5ea851['format']===_0x15f04a(0x191)||_0x5ea851[_0x15f04a(0x23c)]===_0x15f04a(0x2cc)||_0x5ea851[_0x15f04a(0x23c)]===_0x15f04a(0x27c))await handleSDKOutput(_0x33a146,_0x5ea851);else{if(_0x33a146[_0x15f04a(0x2d2)]===0x0){if(_0x595e84&&_0x29e0ad)console['log'](_0x15f04a(0x2b7)+_0x595e84+'.'+_0x29e0ad);else _0x595e84?console[_0x15f04a(0x1b0)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x595e84):console[_0x15f04a(0x1b0)]('No\x20attempts\x20found');}else{const _0x12e9e8=_0x5ea851[_0x15f04a(0x271)],_0x3b520e=_0x33a146['map'](_0x5f1331=>{const _0x1a3d44=_0x15f04a,_0x159143=a51_0x264b3b[_0x1a3d44(0x321)]('#'+_0x5f1331['id']),_0x4c90c1=_0x5f1331[_0x1a3d44(0x1b2)]?.['id'],_0x1c6d64=_0x5f1331[_0x1a3d44(0x192)]||_0x5f1331['sessionId'],_0x118fa2=_0x4c90c1&&_0x1c6d64?hyperlink(_0x159143,getWorkflowAttemptUrl(_0x12e9e8,_0x4c90c1,_0x1c6d64,_0x5f1331['id'])):_0x159143,{icon:_0x105aa9,text:_0x24b1c4}=getAttemptStatusDisplay(_0x5f1331),_0x2185e1=(_0x5f1331[_0x1a3d44(0x1b2)]?.['name']||'?')+'.'+(_0x5f1331[_0x1a3d44(0x27a)]?.[_0x1a3d44(0x1f7)]||'?'),_0x217ba2=_0x5f1331[_0x1a3d44(0x1c5)]?a51_0x264b3b[_0x1a3d44(0x321)](_0x5f1331['sessionTime']):'';return(_0x118fa2+'\x20'+_0x105aa9+(_0x24b1c4?'\x20'+_0x24b1c4:'')+'\x20'+_0x2185e1+'\x20'+_0x217ba2)[_0x1a3d44(0x251)]();});await writeOutput(_0x3b520e['join']('\x0a'),_0x5ea851[_0x15f04a(0x1de)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]='workflow:attempt';[a51_0x3cc69e(0x23f)]='Show\x20specific\x20attempt\x20details';async[a51_0x3cc69e(0x25b)](_0x3d3f4e){const _0x18d60b=a51_0x3cc69e,{options:_0x25beef,args:_0xaa64c,tdx:_0x518ac3}=_0x3d3f4e,_0x26c4c0=_0xaa64c[0x0];if(!_0x26c4c0)return console[_0x18d60b(0x1a0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x25beef[_0x18d60b(0x236)]&&console[_0x18d60b(0x1a0)]('Attempt\x20ID:\x20'+_0x26c4c0);const _0x2a486d=await withSpinner(_0x18d60b(0x255),()=>_0x518ac3[_0x18d60b(0x27a)][_0x18d60b(0x2c6)](_0x26c4c0),{'verbose':_0x25beef[_0x18d60b(0x236)]}),_0x467f53=_0x2a486d[_0x18d60b(0x1b8)];let _0x84e876;!_0x467f53['done']?_0x84e876=_0x467f53[_0x18d60b(0x30e)]?'canceling':_0x18d60b(0x2d8):_0x84e876=_0x467f53[_0x18d60b(0x28c)]?_0x18d60b(0x28c):'error';let _0x375385;if(_0x467f53[_0x18d60b(0x30a)]&&_0x467f53[_0x18d60b(0x2e6)]){const _0x13ad8b=new Date(_0x467f53['createdAt'])['getTime'](),_0x59ace4=new Date(_0x467f53[_0x18d60b(0x2e6)])[_0x18d60b(0x202)]();_0x375385=Math[_0x18d60b(0x247)]((_0x59ace4-_0x13ad8b)/0x3e8);}const _0x2a1bfe={'attempt_id':_0x467f53['id'],'status':_0x84e876,..._0x467f53['index']!==undefined&&{'index':_0x467f53[_0x18d60b(0x261)]},..._0x467f53[_0x18d60b(0x1b2)]&&{'project':_0x467f53[_0x18d60b(0x1b2)][_0x18d60b(0x1f7)]},..._0x467f53[_0x18d60b(0x27a)]&&{'workflow':_0x467f53[_0x18d60b(0x27a)][_0x18d60b(0x1f7)]},..._0x467f53['sessionId']&&{'session_id':_0x467f53[_0x18d60b(0x22e)]},..._0x467f53[_0x18d60b(0x1c5)]&&{'session_time':_0x467f53['sessionTime']},..._0x467f53['retryAttemptName']&&{'retry_attempt':_0x467f53[_0x18d60b(0x324)]},..._0x375385!==undefined&&{'duration_sec':_0x375385},..._0x467f53[_0x18d60b(0x30a)]&&{'created_at':_0x467f53['createdAt']},..._0x467f53['finishedAt']&&{'finished_at':_0x467f53[_0x18d60b(0x2e6)]},...Object[_0x18d60b(0x2f0)](_0x467f53[_0x18d60b(0x2ef)])['length']>0x0&&{'params':_0x467f53[_0x18d60b(0x2ef)]}};return await handleSingleObjectOutput(_0x2a1bfe,_0x25beef),0x0;}}function a51_0x1488(_0x1a9929,_0x178bf3){_0x1a9929=_0x1a9929-0x188;const _0x134269=a51_0x1342();let _0x148818=_0x134269[_0x1a9929];return _0x148818;}export class WorkflowTasksCommand extends BaseCommand{['name']=a51_0x3cc69e(0x2eb);[a51_0x3cc69e(0x23f)]='Show\x20tasks\x20for\x20an\x20attempt';async[a51_0x3cc69e(0x25b)](_0x456948){const _0x3c2791=a51_0x3cc69e,{options:_0x16ddfa,args:_0x4203cd,tdx:_0x460020}=_0x456948,_0x5680de=_0x4203cd[0x0];if(!_0x5680de)return console[_0x3c2791(0x1a0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x18251c=_0x16ddfa[_0x3c2791(0x332)];_0x16ddfa[_0x3c2791(0x236)]&&(console[_0x3c2791(0x1a0)](_0x3c2791(0x20b)+_0x5680de),_0x18251c&&console['error'](_0x3c2791(0x23b)));const _0x7592e8=await withSpinner(_0x3c2791(0x242),()=>_0x460020[_0x3c2791(0x27a)][_0x3c2791(0x32f)](_0x5680de,_0x18251c||![]),{'verbose':_0x16ddfa[_0x3c2791(0x236)]}),_0x23e4e1=_0x7592e8[_0x3c2791(0x1b8)];return console['error'](_0x3c2791(0x2f6)+_0x23e4e1[_0x3c2791(0x2d2)]+_0x3c2791(0x25a)+(_0x23e4e1[_0x3c2791(0x2d2)]!==0x1?'s':'')),await handleSDKOutput(_0x23e4e1,_0x16ddfa),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x237);['description']=a51_0x3cc69e(0x1ba);async[a51_0x3cc69e(0x25b)](_0x42eb83){const _0x3a7049=a51_0x3cc69e,{options:_0x15fe5e,args:_0x11deed,tdx:_0x265af9}=_0x42eb83,_0x25c090=_0x11deed[0x0];let _0x571dad=_0x11deed[0x1];if(!_0x25c090)return console[_0x3a7049(0x1a0)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x15fe5e[_0x3a7049(0x236)]&&(console[_0x3a7049(0x1a0)](_0x3a7049(0x20b)+_0x25c090),_0x571dad&&console[_0x3a7049(0x1a0)](_0x3a7049(0x326)+_0x571dad));const _0x78f476=await withSpinner(_0x3a7049(0x21d),()=>_0x265af9[_0x3a7049(0x27a)][_0x3a7049(0x1f8)](_0x25c090,_0x571dad),{'verbose':_0x15fe5e['verbose']}),_0xe81757=_0x78f476[_0x3a7049(0x1b8)];if(_0xe81757[_0x3a7049(0x2d2)]===0x0)return console[_0x3a7049(0x1a0)](_0x3a7049(0x2ba)),0x0;if(!_0x571dad&&(_0x15fe5e[_0x3a7049(0x191)]||_0x15fe5e[_0x3a7049(0x23c)]))return await handleSDKOutput(_0xe81757,_0x15fe5e),0x0;if(!_0x571dad){const _0x32abb5=_0xe81757['map'](_0x409201=>({'title':_0x409201[_0x3a7049(0x20f)]+'\x20('+formatBytes(_0x409201['fileSize'])+')','value':_0x409201[_0x3a7049(0x20f)]})),_0x17b933=await a51_0x51f43d({'type':_0x3a7049(0x2f7),'name':_0x3a7049(0x228),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x32abb5});if(!_0x17b933['task'])return console['error'](_0x3a7049(0x243)),0x0;_0x571dad=_0x17b933[_0x3a7049(0x228)];}const _0x58bc20=await withSpinner(_0x3a7049(0x206),()=>_0x265af9[_0x3a7049(0x27a)]['logs'](_0x25c090,_0x571dad),{'verbose':_0x15fe5e[_0x3a7049(0x236)]}),_0x16e912=_0x58bc20['data'];return _0x16e912?console[_0x3a7049(0x1b0)](_0x16e912):console[_0x3a7049(0x1a0)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a51_0x3cc69e(0x2c5);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x1a9);async['execute'](_0x20108b){const _0x2ca472=a51_0x3cc69e,{options:_0x50c2b1,args:_0x52614f,tdx:_0x49a990}=_0x20108b,_0x366733=_0x52614f[0x0];if(!_0x366733)return console[_0x2ca472(0x1a0)](_0x2ca472(0x32c)),0x1;const _0x4479a3=_0x50c2b1[_0x2ca472(0x31c)];_0x50c2b1[_0x2ca472(0x236)]&&(console[_0x2ca472(0x1a0)]('Attempt\x20ID:\x20'+_0x366733),_0x4479a3&&console[_0x2ca472(0x1a0)](_0x2ca472(0x194)+_0x4479a3));if(!_0x50c2b1[_0x2ca472(0x31b)]){if(!isInteractive())return console['error'](a51_0x264b3b[_0x2ca472(0x2f8)](_0x2ca472(0x268)),_0x2ca472(0x200)),console[_0x2ca472(0x1a0)](a51_0x264b3b[_0x2ca472(0x321)](_0x2ca472(0x1f6))),0x1;const _0x571df4=await confirmKey(_0x2ca472(0x1f9)+_0x366733+'?');if(!_0x571df4)return console[_0x2ca472(0x1a0)](a51_0x264b3b['yellow'](_0x2ca472(0x243))),0x1;}const _0x1ba689=await withSpinner(_0x2ca472(0x282),()=>_0x49a990[_0x2ca472(0x27a)]['kill'](_0x366733,_0x4479a3),{'verbose':_0x50c2b1[_0x2ca472(0x236)]}),_0x487b56=_0x1ba689[_0x2ca472(0x1b8)];return console[_0x2ca472(0x1a0)]('✔\x20'+_0x487b56),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x267);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x277);async[a51_0x3cc69e(0x25b)](_0x39a66f){const _0x106c8a=a51_0x3cc69e,{options:_0x3f509a,args:_0x1f0dee,tdx:_0x2fa30c}=_0x39a66f,_0x7bb688=_0x1f0dee[0x0];if(!_0x7bb688)return console[_0x106c8a(0x1a0)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x106c8a(0x1a0)](_0x106c8a(0x33e)),0x1;let _0x52aefd=![],_0xab2545=_0x7bb688;if(_0x7bb688['startsWith'](_0x106c8a(0x2d4)))_0x52aefd=!![],_0xab2545=_0x7bb688['substring'](0x8);else{if(_0x7bb688['startsWith'](_0x106c8a(0x1e9)))_0x52aefd=![],_0xab2545=_0x7bb688[_0x106c8a(0x18d)](0x8);else return console[_0x106c8a(0x1a0)](_0x106c8a(0x1eb)),console[_0x106c8a(0x1a0)](_0x106c8a(0x33e)),0x1;}const _0x54c2df=_0x3f509a[_0x106c8a(0x305)],_0xb92ca9=_0x3f509a[_0x106c8a(0x2a9)],_0x54a5cf=_0x3f509a['params'],_0x5016e8=_0x3f509a['force'];_0x3f509a[_0x106c8a(0x236)]&&(console[_0x106c8a(0x1a0)](_0x106c8a(0x2e3)+(_0x52aefd?_0x106c8a(0x19a):_0x106c8a(0x2c6))+'\x20'+_0xab2545),_0x54c2df&&console[_0x106c8a(0x1a0)](_0x106c8a(0x33c)+_0x54c2df),_0xb92ca9&&console['error']('Resume\x20from:\x20'+_0xb92ca9),_0x54a5cf&&console[_0x106c8a(0x1a0)](_0x106c8a(0x1bf)+_0x54a5cf),_0x5016e8&&console[_0x106c8a(0x1a0)](_0x106c8a(0x229)));let _0x5b9a1f;if(_0x54a5cf)try{if(_0x54a5cf[_0x106c8a(0x221)]('@')){const _0x21d326=await import(_0x106c8a(0x18f)),_0x4425cf=_0x54a5cf['substring'](0x1),_0x45bf08=await _0x21d326[_0x106c8a(0x2f9)](_0x4425cf,_0x106c8a(0x32a));_0x5b9a1f=JSON[_0x106c8a(0x279)](_0x45bf08);}else _0x5b9a1f=JSON[_0x106c8a(0x279)](_0x54a5cf);}catch{return console['error'](_0x106c8a(0x1e5)),0x1;}if(!_0x3f509a[_0x106c8a(0x31b)]){if(!isInteractive())return console[_0x106c8a(0x1a0)](a51_0x264b3b[_0x106c8a(0x2f8)](_0x106c8a(0x268)),_0x106c8a(0x200)),console[_0x106c8a(0x1a0)](a51_0x264b3b[_0x106c8a(0x321)](_0x106c8a(0x1f6))),0x1;const _0x7087b0=await confirmKey(_0x106c8a(0x2c7)+(_0x52aefd?_0x106c8a(0x19a):_0x106c8a(0x2c6))+'\x20'+_0xab2545+'?');if(!_0x7087b0)return console[_0x106c8a(0x1a0)](a51_0x264b3b[_0x106c8a(0x26c)]('Cancelled')),0x1;}let _0x501630;_0x52aefd?_0x501630=await withSpinner(_0x106c8a(0x286),()=>_0x2fa30c['workflow'][_0x106c8a(0x18a)](_0xab2545,{'fromTask':_0x54c2df,'retryParams':_0x5b9a1f}),{'verbose':_0x3f509a['verbose']}):_0x501630=await withSpinner(_0x106c8a(0x1ca),()=>_0x2fa30c['workflow'][_0x106c8a(0x2db)](_0xab2545,{'resumeFrom':_0xb92ca9,'retryParams':_0x5b9a1f,'force':_0x5016e8}),{'verbose':_0x3f509a[_0x106c8a(0x236)]});const _0x1c416b=_0x501630[_0x106c8a(0x1b8)];return console[_0x106c8a(0x1a0)](_0x106c8a(0x201)),console[_0x106c8a(0x1a0)](_0x106c8a(0x1d4)+_0x1c416b[_0x106c8a(0x2e1)]),console[_0x106c8a(0x1a0)](_0x106c8a(0x212)+_0x1c416b['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x2a4);['description']=a51_0x3cc69e(0x196);async[a51_0x3cc69e(0x25b)](_0x44d96a){const _0x38f251=a51_0x3cc69e,{options:_0x337208,args:_0x242442,tdx:_0xcd18e}=_0x44d96a;let _0x25f9a8=_0x242442[0x0];if(!_0x25f9a8){const _0x203d44=this[_0x38f251(0x320)]([],_0x337208),_0x2d76b1=await withSpinner(_0x38f251(0x2ab),()=>_0xcd18e[_0x38f251(0x27a)][_0x38f251(0x1b1)](_0x203d44,{'limit':_0x337208[_0x38f251(0x2e8)]}),{'verbose':_0x337208['verbose']}),_0x579d7c=_0x2d76b1[_0x38f251(0x1b8)];if(_0x579d7c[_0x38f251(0x2d2)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x203d44&&console[_0x38f251(0x1a0)](a51_0x264b3b[_0x38f251(0x321)](_0x38f251(0x331))),0x1;const _0x50280a=_0x579d7c['map'](_0x2cc3b8=>({'title':_0x2cc3b8[_0x38f251(0x1b2)]?.['name']+'.'+_0x2cc3b8[_0x38f251(0x1f7)],'value':_0x2cc3b8[_0x38f251(0x1b2)]?.[_0x38f251(0x1f7)]+'.'+_0x2cc3b8['name'],'description':_0x2cc3b8['revision']?_0x38f251(0x29e)+_0x2cc3b8[_0x38f251(0x27d)]:undefined})),_0x39a770=await a51_0x51f43d({'type':_0x38f251(0x2f7),'name':_0x38f251(0x27a),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x50280a});if(!_0x39a770[_0x38f251(0x27a)])return 0x1;_0x25f9a8=_0x39a770[_0x38f251(0x27a)];}if(!_0x25f9a8[_0x38f251(0x1d0)]('.')){const _0x80ec94=this[_0x38f251(0x320)]([],_0x337208);if(_0x80ec94)_0x25f9a8=_0x80ec94+'.'+_0x25f9a8;else return console[_0x38f251(0x1a0)](a51_0x264b3b[_0x38f251(0x2f8)](_0x38f251(0x1b4)),_0x38f251(0x1e3)),console[_0x38f251(0x1a0)](a51_0x264b3b[_0x38f251(0x321)](_0x38f251(0x331))),0x1;}const _0x19ed16=_0x337208[_0x38f251(0x301)],_0x43939e=_0x337208[_0x38f251(0x1c5)],_0x5b97fa={};if(_0x19ed16&&Array[_0x38f251(0x19b)](_0x19ed16))for(const _0x5257db of _0x19ed16){const _0x4a146d=_0x5257db[_0x38f251(0x330)]('=');if(_0x4a146d===-0x1)return console[_0x38f251(0x1a0)](_0x38f251(0x2ec)+_0x5257db),console[_0x38f251(0x1a0)](_0x38f251(0x30d)),0x1;const _0x33a778=_0x5257db[_0x38f251(0x18d)](0x0,_0x4a146d),_0x5ecada=_0x5257db['substring'](_0x4a146d+0x1);try{_0x5b97fa[_0x33a778]=JSON[_0x38f251(0x279)](_0x5ecada);}catch{_0x5b97fa[_0x33a778]=_0x5ecada;}}_0x337208['verbose']&&(console[_0x38f251(0x1a0)](_0x38f251(0x1ee)+_0x25f9a8),Object[_0x38f251(0x2f0)](_0x5b97fa)['length']>0x0&&console['error']('Parameters:\x20'+JSON[_0x38f251(0x198)](_0x5b97fa)),_0x43939e&&console[_0x38f251(0x1a0)](_0x38f251(0x1be)+_0x43939e));const _0x27edcb=await withSpinner(_0x38f251(0x20e),()=>_0xcd18e[_0x38f251(0x27a)]['run'](_0x25f9a8,_0x5b97fa,{'sessionTime':_0x43939e}),{'verbose':_0x337208[_0x38f251(0x236)]}),_0x36f2da=_0x27edcb[_0x38f251(0x1b8)];console['error'](_0x38f251(0x1c7)),console['error'](_0x38f251(0x2a3)+_0x36f2da['id']),console[_0x38f251(0x1a0)](_0x38f251(0x212)+_0x36f2da[_0x38f251(0x22e)]),console[_0x38f251(0x1a0)](_0x38f251(0x222)+_0x36f2da[_0x38f251(0x1b2)]?.[_0x38f251(0x1f7)]),console[_0x38f251(0x1a0)](_0x38f251(0x1d7)+_0x36f2da[_0x38f251(0x27a)]?.[_0x38f251(0x1f7)]);if(_0x36f2da[_0x38f251(0x1b2)]?.['id']&&_0x36f2da['sessionId']&&_0x36f2da['id']){const _0x4265e6=_0x337208[_0x38f251(0x271)],_0x2321d0=getConsoleUrl(_0x4265e6,_0x38f251(0x21b)+_0x36f2da[_0x38f251(0x1b2)]['id']+_0x38f251(0x2cd)+_0x36f2da[_0x38f251(0x22e)]+_0x38f251(0x19d)+_0x36f2da['id']);console[_0x38f251(0x1a0)](_0x38f251(0x2b1)+a51_0x264b3b[_0x38f251(0x1e2)](_0x2321d0));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x3cc69e(0x215);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x262);async[a51_0x3cc69e(0x25b)](_0x119aba){const _0x1fccde=a51_0x3cc69e,{options:_0x55f043,args:_0x5a866c,tdx:_0x34fbd6}=_0x119aba,_0x2feb1c=_0x5a866c[0x0],_0x1cc98b=_0x5a866c[0x1]||'.';if(!_0x2feb1c)return console[_0x1fccde(0x1a0)](_0x1fccde(0x1c4)),console[_0x1fccde(0x1a0)](_0x1fccde(0x1cb)),0x1;const _0x3cdd8f=_0x55f043[_0x1fccde(0x27d)];_0x55f043[_0x1fccde(0x236)]&&(console[_0x1fccde(0x1a0)](_0x1fccde(0x19c)+_0x2feb1c),console[_0x1fccde(0x1a0)](_0x1fccde(0x1ed)+_0x1cc98b),_0x3cdd8f&&console[_0x1fccde(0x1a0)](_0x1fccde(0x312)+_0x3cdd8f));const _0x12b701=await withSpinner(_0x1fccde(0x2bf)+_0x2feb1c+_0x1fccde(0x204),()=>_0x34fbd6[_0x1fccde(0x27a)][_0x1fccde(0x25f)](_0x2feb1c,_0x1cc98b,{'revision':_0x3cdd8f}),{'verbose':_0x55f043[_0x1fccde(0x236)]}),_0x43d2d6=_0x12b701[_0x1fccde(0x1b8)];return console['error']('✔\x20Downloaded\x20'+_0x43d2d6[_0x1fccde(0x31e)]),console['error'](_0x1fccde(0x1fb)+_0x43d2d6[_0x1fccde(0x27d)]),console[_0x1fccde(0x1a0)](_0x1fccde(0x225)+_0x43d2d6[_0x1fccde(0x310)]),console['error']('\x20\x20Location:\x20'+_0x1cc98b+'/'+_0x43d2d6[_0x1fccde(0x31e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]='workflow:upload';['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a51_0x3cc69e(0x25b)](_0x586038){const _0x2877fa=a51_0x3cc69e,{options:_0x25f473,args:_0x48a52a,tdx:_0x51cc0a}=_0x586038;let _0x13ff39='.',_0x2ba713=_0x25f473[_0x2877fa(0x1f7)];if(_0x48a52a[0x0]){const {promises:_0x2b329b}=await import('fs');try{const _0x50ec8f=await _0x2b329b[_0x2877fa(0x2e4)](_0x48a52a[0x0]);if(_0x50ec8f[_0x2877fa(0x285)]())_0x13ff39=_0x48a52a[0x0];else return console[_0x2877fa(0x1a0)](_0x2877fa(0x1ac)+_0x48a52a[0x0]+_0x2877fa(0x29c)),0x1;}catch{_0x2ba713=_0x48a52a[0x0],_0x13ff39='.';}}const _0x129530=_0x25f473[_0x2877fa(0x27d)],_0x48913a=_0x25f473['skipValidation'];_0x25f473[_0x2877fa(0x236)]&&(console[_0x2877fa(0x1a0)](_0x2877fa(0x25c)+_0x13ff39),_0x2ba713&&console[_0x2877fa(0x1a0)](_0x2877fa(0x1a2)+_0x2ba713),_0x129530&&console[_0x2877fa(0x1a0)](_0x2877fa(0x312)+_0x129530),_0x48913a&&console[_0x2877fa(0x1a0)](_0x2877fa(0x203)));const _0x3c904d=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x51cc0a[_0x2877fa(0x27a)][_0x2877fa(0x2ea)](_0x13ff39,{'projectName':_0x2ba713,'revision':_0x129530,'skipValidation':_0x48913a}),{'verbose':_0x25f473['verbose']}),_0x431321=_0x3c904d[_0x2877fa(0x1b8)];return console[_0x2877fa(0x1a0)](_0x2877fa(0x2de)+_0x431321[_0x2877fa(0x31e)]),console[_0x2877fa(0x1a0)](_0x2877fa(0x210)+_0x431321[_0x2877fa(0x246)]),console[_0x2877fa(0x1a0)]('\x20\x20Revision:\x20'+_0x431321[_0x2877fa(0x27d)]),await this['showWorkflowConsoleUrl'](_0x51cc0a,_0x431321['projectName'],_0x25f473[_0x2877fa(0x271)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a51_0x3cc69e(0x2e0);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x278);async[a51_0x3cc69e(0x25b)](_0x3fd936){const _0x2c1d92=a51_0x3cc69e,{options:_0x35690d,args:_0x3ced88,tdx:_0x5565c7}=_0x3fd936,_0xe6f3a2=_0x3ced88[0x0],_0x5f4091=_0x3ced88[0x1];if(!_0xe6f3a2)return console['error'](a51_0x264b3b['red'](_0x2c1d92(0x1b4)),_0x2c1d92(0x325)),console[_0x2c1d92(0x1a0)](a51_0x264b3b[_0x2c1d92(0x321)](_0x2c1d92(0x21c))),0x1;const _0x2b4814=_0x35690d[_0x2c1d92(0x27d)];_0x35690d[_0x2c1d92(0x236)]&&(console[_0x2c1d92(0x1a0)](_0x2c1d92(0x19c)+_0xe6f3a2),_0x5f4091&&console[_0x2c1d92(0x1a0)](_0x2c1d92(0x1c0)+_0x5f4091),_0x2b4814&&console['error'](_0x2c1d92(0x312)+_0x2b4814),_0x35690d[_0x2c1d92(0x2d5)]&&console[_0x2c1d92(0x1a0)](_0x2c1d92(0x2b8)));const _0x35568b=await withSpinner(_0x2c1d92(0x25d)+_0xe6f3a2+_0x2c1d92(0x204),()=>_0x5565c7[_0x2c1d92(0x27a)][_0x2c1d92(0x338)](_0xe6f3a2,{'targetDir':_0x5f4091,'revision':_0x2b4814}),{'verbose':_0x35690d[_0x2c1d92(0x236)]}),_0x4f9b63=_0x35568b[_0x2c1d92(0x1b8)];_0x4f9b63[_0x2c1d92(0x233)]?console[_0x2c1d92(0x1a0)]('→\x20New\x20project:\x20'+_0x4f9b63['projectName']):console['error']('→\x20Project:\x20'+_0x4f9b63['projectName']);console[_0x2c1d92(0x1a0)](_0x2c1d92(0x1fb)+_0x4f9b63[_0x2c1d92(0x27d)]),console[_0x2c1d92(0x1a0)]('\x20\x20Target:\x20'+(a51_0x5c2dd5['relative'](process[_0x2c1d92(0x314)](),_0x4f9b63[_0x2c1d92(0x1bc)])||'.')),console['error'](_0x2c1d92(0x2aa)+a51_0x264b3b[_0x2c1d92(0x2ad)]('+'+_0x4f9b63[_0x2c1d92(0x307)][_0x2c1d92(0x335)]+_0x2c1d92(0x1f4))+',\x20'+(a51_0x264b3b[_0x2c1d92(0x26c)]('~'+_0x4f9b63[_0x2c1d92(0x307)]['modified']+'\x20modified')+',\x20')+(a51_0x264b3b[_0x2c1d92(0x2f8)]('-'+_0x4f9b63[_0x2c1d92(0x307)][_0x2c1d92(0x1c6)]+_0x2c1d92(0x250))+',\x20')+(''+a51_0x264b3b['dim'](_0x4f9b63[_0x2c1d92(0x307)]['unchanged']+_0x2c1d92(0x2e9))));for(const _0x4fa532 of _0x4f9b63['changes']){_0x4fa532[_0x2c1d92(0x315)]==='modified'&&_0x4fa532[_0x2c1d92(0x1dc)]&&(console[_0x2c1d92(0x1a0)]('\x0a'+a51_0x264b3b['cyan']('---\x20'+_0x4fa532[_0x2c1d92(0x2f3)])),console[_0x2c1d92(0x1a0)](_0x4fa532[_0x2c1d92(0x1dc)]));}if(!_0x4f9b63[_0x2c1d92(0x2c9)])return saveSessionContext({'workflow_project':_0x4f9b63[_0x2c1d92(0x31e)]},_0x35690d[_0x2c1d92(0x19a)]),console['error'](a51_0x264b3b[_0x2c1d92(0x2ad)](_0x2c1d92(0x27f))),console[_0x2c1d92(0x1a0)](a51_0x264b3b[_0x2c1d92(0x321)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4f9b63[_0x2c1d92(0x31e)])),0x0;if(_0x35690d[_0x2c1d92(0x2d5)])return console[_0x2c1d92(0x1a0)](a51_0x264b3b['yellow'](_0x2c1d92(0x2c8))),0x0;if(!_0x35690d[_0x2c1d92(0x31b)]){if(!isInteractive())return console[_0x2c1d92(0x1a0)](a51_0x264b3b['red'](_0x2c1d92(0x268)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2c1d92(0x1a0)](a51_0x264b3b[_0x2c1d92(0x321)](_0x2c1d92(0x1f6))),0x1;const _0x3b80e8=await confirmKey(_0x2c1d92(0x235));if(!_0x3b80e8)return console['error'](a51_0x264b3b[_0x2c1d92(0x26c)](_0x2c1d92(0x243)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x2c1d92(0x2e5),()=>_0x5565c7[_0x2c1d92(0x27a)][_0x2c1d92(0x33b)](_0x4f9b63,{'revision':_0x2b4814}),{'verbose':_0x35690d[_0x2c1d92(0x236)]}),saveSessionContext({'workflow_project':_0x4f9b63['projectName']},_0x35690d[_0x2c1d92(0x19a)]),console['error'](a51_0x264b3b['green'](_0x2c1d92(0x2c1)));const _0x1fd7c9=a51_0x5c2dd5['relative'](process[_0x2c1d92(0x314)](),_0x4f9b63[_0x2c1d92(0x1bc)])||'.';return console['error'](a51_0x264b3b[_0x2c1d92(0x321)](_0x2c1d92(0x1af)+_0x1fd7c9)),console['error'](a51_0x264b3b['dim'](_0x2c1d92(0x313)+_0x4f9b63[_0x2c1d92(0x31e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a51_0x3cc69e(0x26a);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x2fd);async['execute'](_0x9775d9){const _0x2a1c33=a51_0x3cc69e,{options:_0x4b6ce5,args:_0x1a7bad,tdx:_0xf743b3}=_0x9775d9,_0x520867=this['resolveProjectDir'](_0x1a7bad,_0x4b6ce5),_0x5cfd14=_0x4b6ce5[_0x2a1c33(0x27d)],_0x115839=_0x4b6ce5[_0x2a1c33(0x22d)];_0x4b6ce5[_0x2a1c33(0x236)]&&(_0x520867&&console['error']('Source\x20directory:\x20'+_0x520867),_0x5cfd14&&console['error'](_0x2a1c33(0x312)+_0x5cfd14),_0x4b6ce5[_0x2a1c33(0x2d5)]&&console[_0x2a1c33(0x1a0)](_0x2a1c33(0x2b8)),_0x115839&&console['error'](_0x2a1c33(0x203)));let _0x35e2dc;try{_0x35e2dc=await withSpinner('Analyzing\x20changes...',()=>_0xf743b3[_0x2a1c33(0x27a)][_0x2a1c33(0x297)]({'sourceDir':_0x520867,'revision':_0x5cfd14,'skipValidation':_0x115839}),{'verbose':_0x4b6ce5[_0x2a1c33(0x236)]});}catch(_0x3f6b08){if(_0x3f6b08 instanceof Error&&_0x3f6b08['message'][_0x2a1c33(0x1d0)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2a1c33(0x1a0)](a51_0x264b3b['red'](_0x2a1c33(0x1b4)),_0x2a1c33(0x1c2)),_0x4b6ce5[_0x2a1c33(0x1cc)]?console[_0x2a1c33(0x1a0)](a51_0x264b3b[_0x2a1c33(0x321)]('Tip:\x20cd\x20to\x20workflows/'+_0x4b6ce5['workflowProject']+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4b6ce5['workflowProject']+'\x27')):console['error'](a51_0x264b3b[_0x2a1c33(0x321)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x3f6b08;}const _0x58926d=_0x35e2dc[_0x2a1c33(0x1b8)];console[_0x2a1c33(0x1a0)]('✔\x20Project:\x20'+_0x58926d['projectName']),console[_0x2a1c33(0x1a0)](_0x2a1c33(0x300)+_0x58926d[_0x2a1c33(0x21f)]),console['error'](_0x2a1c33(0x1fb)+_0x58926d[_0x2a1c33(0x27d)]),console['error'](_0x2a1c33(0x2aa)+a51_0x264b3b[_0x2a1c33(0x2ad)]('+'+_0x58926d['summary'][_0x2a1c33(0x335)]+'\x20new')+',\x20'+(a51_0x264b3b['yellow']('~'+_0x58926d[_0x2a1c33(0x307)][_0x2a1c33(0x2bc)]+_0x2a1c33(0x258))+',\x20')+(a51_0x264b3b[_0x2a1c33(0x2f8)]('-'+_0x58926d['summary'][_0x2a1c33(0x1c6)]+_0x2a1c33(0x250))+',\x20')+(''+a51_0x264b3b[_0x2a1c33(0x321)](_0x58926d[_0x2a1c33(0x307)][_0x2a1c33(0x2b5)]+_0x2a1c33(0x2e9))));for(const _0x389915 of _0x58926d[_0x2a1c33(0x248)]){_0x389915[_0x2a1c33(0x315)]==='modified'&&_0x389915[_0x2a1c33(0x1dc)]&&(console[_0x2a1c33(0x1a0)]('\x0a'+a51_0x264b3b[_0x2a1c33(0x1e2)](_0x2a1c33(0x2dc)+_0x389915[_0x2a1c33(0x2f3)])),console['error'](_0x389915[_0x2a1c33(0x1dc)]));}if(!_0x58926d[_0x2a1c33(0x2c9)])return console[_0x2a1c33(0x1a0)](a51_0x264b3b[_0x2a1c33(0x2ad)](_0x2a1c33(0x272))),await this[_0x2a1c33(0x33a)](_0xf743b3,_0x58926d[_0x2a1c33(0x31e)],_0x4b6ce5[_0x2a1c33(0x271)]),0x0;if(_0x4b6ce5[_0x2a1c33(0x2d5)])return console[_0x2a1c33(0x1a0)](a51_0x264b3b[_0x2a1c33(0x26c)](_0x2a1c33(0x1c8))),0x0;if(!_0x4b6ce5[_0x2a1c33(0x31b)]){if(!isInteractive())return console[_0x2a1c33(0x1a0)](a51_0x264b3b[_0x2a1c33(0x2f8)](_0x2a1c33(0x268)),_0x2a1c33(0x200)),console[_0x2a1c33(0x1a0)](a51_0x264b3b[_0x2a1c33(0x321)](_0x2a1c33(0x1f6))),0x1;const _0x173a06=await confirmKey(_0x2a1c33(0x1d5));if(!_0x173a06)return console['error'](a51_0x264b3b[_0x2a1c33(0x26c)](_0x2a1c33(0x243)),'-\x20nothing\x20pushed'),0x1;}const _0x21ec8c=await withSpinner(_0x2a1c33(0x1f1),()=>_0xf743b3[_0x2a1c33(0x27a)][_0x2a1c33(0x2d6)](_0x58926d),{'verbose':_0x4b6ce5[_0x2a1c33(0x236)]}),_0x5dc401=_0x21ec8c['data'];return console['error'](a51_0x264b3b[_0x2a1c33(0x2ad)]('✔\x20Push\x20complete')),console[_0x2a1c33(0x1a0)](_0x2a1c33(0x210)+_0x5dc401[_0x2a1c33(0x246)]),console[_0x2a1c33(0x1a0)]('\x20\x20Revision:\x20'+_0x5dc401[_0x2a1c33(0x27d)]),await this[_0x2a1c33(0x33a)](_0xf743b3,_0x5dc401['projectName'],_0x4b6ce5['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x1ea);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async['execute'](_0x14b7ac){const _0x22d670=a51_0x3cc69e,{options:_0x14212d,args:_0x412e84,tdx:_0x52a6b5}=_0x14b7ac,_0x437607=this[_0x22d670(0x1d2)](_0x412e84,_0x14212d),_0x1aee15=_0x14212d['name'],_0x3f9db0=_0x14212d[_0x22d670(0x27d)],_0x1fce02=_0x14212d[_0x22d670(0x22d)];if(!_0x437607)return console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x2f8)](_0x22d670(0x1b4)),_0x22d670(0x1c3)),console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x321)](_0x22d670(0x1fe))),console[_0x22d670(0x1a0)](a51_0x264b3b['dim'](_0x22d670(0x1a6))),0x1;if(!_0x1aee15)return console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x2f8)](_0x22d670(0x1b4)),_0x22d670(0x190)),console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x321)](_0x22d670(0x1fe))),0x1;_0x14212d['verbose']&&(console['error'](_0x22d670(0x317)+_0x437607),console[_0x22d670(0x1a0)](_0x22d670(0x299)+_0x1aee15),_0x3f9db0&&console[_0x22d670(0x1a0)](_0x22d670(0x312)+_0x3f9db0),_0x14212d[_0x22d670(0x2d5)]&&console[_0x22d670(0x1a0)](_0x22d670(0x2b8)),_0x1fce02&&console['error']('Validation:\x20skipped'));const _0x33e1f1=await withSpinner(_0x22d670(0x295),()=>_0x52a6b5['workflow']['prepareCloneProject'](_0x437607,_0x1aee15,{'revision':_0x3f9db0,'skipValidation':_0x1fce02}),{'verbose':_0x14212d[_0x22d670(0x236)]}),_0x1bd93b=_0x33e1f1['data'];console[_0x22d670(0x1a0)](_0x22d670(0x19e)+_0x1bd93b['sourceDir']);_0x1bd93b[_0x22d670(0x24f)]&&console[_0x22d670(0x1a0)](_0x22d670(0x334)+_0x1bd93b[_0x22d670(0x24f)]);console['error'](_0x22d670(0x299)+_0x1bd93b[_0x22d670(0x2e7)]),console[_0x22d670(0x1a0)]('Revision:\x20'+_0x1bd93b[_0x22d670(0x27d)]),console[_0x22d670(0x1a0)](_0x22d670(0x30c)+_0x1bd93b[_0x22d670(0x188)]);_0x1bd93b[_0x22d670(0x2fc)]&&(console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x26c)]('\x0a⚠\x20Project\x20\x22'+_0x1bd93b[_0x22d670(0x2e7)]+_0x22d670(0x2a5)+_0x1bd93b[_0x22d670(0x1a5)]+')')),console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x26c)](_0x22d670(0x2c3))));if(_0x14212d[_0x22d670(0x2d5)])return console[_0x22d670(0x1a0)](a51_0x264b3b['yellow'](_0x22d670(0x309))),0x0;if(!_0x14212d[_0x22d670(0x31b)]){if(!isInteractive())return console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x2f8)](_0x22d670(0x268)),_0x22d670(0x200)),console['error'](a51_0x264b3b[_0x22d670(0x321)](_0x22d670(0x1f6))),0x1;const _0x467ed8=_0x1bd93b['sourceProjectName']||a51_0x5c2dd5[_0x22d670(0x1f0)](_0x437607),_0x445632=_0x1bd93b['targetExists']?_0x22d670(0x284)+_0x1aee15+'\x22\x20with\x20new\x20revision?':_0x22d670(0x26e)+_0x467ed8+_0x22d670(0x2fe)+_0x1aee15+'\x22?',_0x3371be=await confirmKey(_0x445632);if(!_0x3371be)return console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x26c)](_0x22d670(0x243))),0x1;}const _0x27f302=await withSpinner(_0x1bd93b['targetExists']?_0x22d670(0x2bd)+_0x1aee15+_0x22d670(0x204):_0x22d670(0x20c)+_0x1aee15+_0x22d670(0x204),()=>_0x52a6b5[_0x22d670(0x27a)]['executeCloneProject'](_0x1bd93b),{'verbose':_0x14212d[_0x22d670(0x236)]}),_0x58bfb3=_0x27f302[_0x22d670(0x1b8)];return console[_0x22d670(0x1a0)](a51_0x264b3b[_0x22d670(0x2ad)](_0x1bd93b[_0x22d670(0x2fc)]?_0x22d670(0x195):'✔\x20Clone\x20complete')),console[_0x22d670(0x1a0)](_0x22d670(0x222)+_0x58bfb3[_0x22d670(0x2e7)]),console[_0x22d670(0x1a0)](_0x22d670(0x210)+_0x58bfb3[_0x22d670(0x275)]),console[_0x22d670(0x1a0)]('\x20\x20Revision:\x20'+_0x58bfb3[_0x22d670(0x27d)]),await this[_0x22d670(0x33a)](_0x52a6b5,_0x58bfb3[_0x22d670(0x2e7)],_0x14212d[_0x22d670(0x271)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x1fa);[a51_0x3cc69e(0x23f)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x3cc69e(0x25b)](_0x21a4f8){const _0x57b6b1=a51_0x3cc69e,{options:_0x1f0756,args:_0x13a768,tdx:_0x450451}=_0x21a4f8,_0x176cd6=_0x13a768[0x0];if(!_0x176cd6)return console[_0x57b6b1(0x1a0)](_0x57b6b1(0x33d)),console[_0x57b6b1(0x1a0)](_0x57b6b1(0x1da)),0x1;_0x1f0756[_0x57b6b1(0x236)]&&console['error'](_0x57b6b1(0x19c)+_0x176cd6);if(!_0x1f0756[_0x57b6b1(0x31b)]){if(!isInteractive())return console[_0x57b6b1(0x1a0)](a51_0x264b3b['red'](_0x57b6b1(0x268)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x264b3b[_0x57b6b1(0x321)](_0x57b6b1(0x1f6))),0x1;const _0x261039=await confirmKey(_0x57b6b1(0x220)+_0x176cd6+_0x57b6b1(0x28b));if(!_0x261039)return console['error'](a51_0x264b3b['yellow']('Cancelled')),0x1;}const _0x52c953=await withSpinner(_0x57b6b1(0x302)+_0x176cd6+_0x57b6b1(0x204),()=>_0x450451[_0x57b6b1(0x27a)][_0x57b6b1(0x2da)](_0x176cd6),{'verbose':_0x1f0756[_0x57b6b1(0x236)]}),_0x5eb4ad=_0x52c953['data'];return console[_0x57b6b1(0x1a0)](_0x57b6b1(0x29f)+_0x5eb4ad[_0x57b6b1(0x31e)]),console[_0x57b6b1(0x1a0)](_0x57b6b1(0x210)+_0x5eb4ad[_0x57b6b1(0x246)]),0x0;}}export function parseKeyValue(_0x15e85b){const _0x3bc0dc=a51_0x3cc69e,_0x479087=_0x15e85b[_0x3bc0dc(0x330)]('=');if(_0x479087===-0x1)throw new Error(_0x3bc0dc(0x2b2)+_0x15e85b+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x2aa43d=_0x15e85b[_0x3bc0dc(0x18d)](0x0,_0x479087),_0x5e3179=_0x15e85b['substring'](_0x479087+0x1);if(!_0x2aa43d)throw new Error(_0x3bc0dc(0x264));return{'key':_0x2aa43d,'value':_0x5e3179};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x232);['description']=a51_0x3cc69e(0x241);async[a51_0x3cc69e(0x25b)](_0xdd28f2){const _0x42f04c=a51_0x3cc69e,{options:_0x4a174a,args:_0x34a50b,tdx:_0x3830b5}=_0xdd28f2,_0x1f4e0c=this[_0x42f04c(0x19f)](_0x34a50b,_0x4a174a);if(!_0x1f4e0c)return 0x1;_0x4a174a['verbose']&&console[_0x42f04c(0x1a0)]('Project:\x20'+_0x1f4e0c);const _0x27891f=await withSpinner(_0x42f04c(0x1f5),()=>_0x3830b5[_0x42f04c(0x27a)][_0x42f04c(0x22a)](_0x1f4e0c),{'verbose':_0x4a174a[_0x42f04c(0x236)]}),{secrets:_0x22e49d}=_0x27891f[_0x42f04c(0x1b8)];return console['error'](_0x42f04c(0x2f6)+_0x22e49d[_0x42f04c(0x2d2)]+_0x42f04c(0x316)+(_0x22e49d[_0x42f04c(0x2d2)]!==0x1?'s':'')),await handleSDKOutput(_0x22e49d,_0x4a174a),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x31d);['description']=a51_0x3cc69e(0x1e7);async[a51_0x3cc69e(0x25b)](_0x55b2f4){const _0x1356e2=a51_0x3cc69e,{options:_0x41d18a,args:_0x595d3b,tdx:_0x35a54b}=_0x55b2f4;let _0x337f95,_0xc89008;if(_0x595d3b['length']>=0x1&&!_0x595d3b[0x0][_0x1356e2(0x1d0)]('='))_0x337f95=_0x595d3b[0x0],_0xc89008=_0x595d3b[_0x1356e2(0x216)](0x1);else{if(_0x595d3b['length']>=0x1&&_0x41d18a[_0x1356e2(0x1cc)])_0x337f95=_0x41d18a[_0x1356e2(0x1cc)],_0xc89008=_0x595d3b;else return _0x595d3b['length']>=0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x1356e2(0x331)),0x1):(console[_0x1356e2(0x1a0)](_0x1356e2(0x26f)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0xc89008[_0x1356e2(0x2d2)]===0x0)return console[_0x1356e2(0x1a0)](_0x1356e2(0x26f)),console[_0x1356e2(0x1a0)](_0x1356e2(0x294)),0x1;const _0x4f6b36={};try{for(const _0x31171e of _0xc89008){const {key:_0x353b98,value:_0x2f4480}=parseKeyValue(_0x31171e);_0x4f6b36[_0x353b98]=_0x2f4480;}}catch(_0x2e5b97){return _0x2e5b97 instanceof Error&&console['error'](a51_0x264b3b['red'](_0x1356e2(0x1b4)),_0x2e5b97['message']),0x1;}const _0x328487=Object[_0x1356e2(0x2f0)](_0x4f6b36);_0x41d18a[_0x1356e2(0x236)]&&(console[_0x1356e2(0x1a0)]('Project:\x20'+_0x337f95),console[_0x1356e2(0x1a0)](_0x1356e2(0x319)+_0x328487['join'](',\x20')));const _0x5a8492=await withSpinner(_0x328487[_0x1356e2(0x2d2)]===0x1?_0x1356e2(0x1c1):_0x1356e2(0x257)+_0x328487[_0x1356e2(0x2d2)]+_0x1356e2(0x1a3),()=>_0x35a54b[_0x1356e2(0x27a)]['setSecrets'](_0x337f95,_0x4f6b36),{'verbose':_0x41d18a[_0x1356e2(0x236)]}),_0x4f4d52=_0x5a8492[_0x1356e2(0x1b8)];return console['error'](_0x328487['length']===0x1?'✔\x20Secret\x20\x27'+_0x4f4d52['keys'][0x0]+_0x1356e2(0x1cd)+_0x4f4d52[_0x1356e2(0x31e)]+'\x27':'✔\x20'+_0x4f4d52['keys']['length']+_0x1356e2(0x244)+_0x4f4d52[_0x1356e2(0x31e)]+'\x27'),(_0x41d18a['json']||_0x41d18a[_0x1356e2(0x2cc)])&&await handleSingleObjectOutput(_0x4f4d52,_0x41d18a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x245);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x2fb);async[a51_0x3cc69e(0x25b)](_0x2a26bf){const _0x2b01be=a51_0x3cc69e,{options:_0x3e7059,args:_0x50ed19,tdx:_0x348c6c}=_0x2a26bf;let _0x1ffa61,_0x2ba2a3;if(_0x50ed19['length']>=0x2)_0x1ffa61=_0x50ed19[0x0],_0x2ba2a3=_0x50ed19[0x1];else{if(_0x50ed19[_0x2b01be(0x2d2)]===0x1&&_0x3e7059[_0x2b01be(0x1cc)])_0x1ffa61=_0x3e7059[_0x2b01be(0x1cc)],_0x2ba2a3=_0x50ed19[0x0];else return _0x50ed19[_0x2b01be(0x2d2)]===0x1?(console[_0x2b01be(0x1a0)](_0x2b01be(0x1c4)),console['error'](_0x2b01be(0x331)),0x1):(console[_0x2b01be(0x1a0)](_0x2b01be(0x1f3)),console['error'](_0x2b01be(0x2ed)),0x1);}_0x3e7059[_0x2b01be(0x236)]&&(console[_0x2b01be(0x1a0)](_0x2b01be(0x19c)+_0x1ffa61),console[_0x2b01be(0x1a0)](_0x2b01be(0x28a)+_0x2ba2a3));if(!_0x3e7059['yes']){if(!isInteractive())return console['error'](a51_0x264b3b[_0x2b01be(0x2f8)](_0x2b01be(0x268)),_0x2b01be(0x200)),console['error'](a51_0x264b3b['dim'](_0x2b01be(0x1f6))),0x1;const _0x153967=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2ba2a3+_0x2b01be(0x18e)+_0x1ffa61+'\x27?');if(!_0x153967)return console[_0x2b01be(0x1a0)](a51_0x264b3b['yellow'](_0x2b01be(0x243))),0x1;}const _0x2ae0a9=await withSpinner(_0x2b01be(0x2be),()=>_0x348c6c[_0x2b01be(0x27a)][_0x2b01be(0x24a)](_0x1ffa61,_0x2ba2a3),{'verbose':_0x3e7059['verbose']}),_0x2318e1=_0x2ae0a9[_0x2b01be(0x1b8)];return console[_0x2b01be(0x1a0)]('✔\x20Secret\x20\x27'+_0x2318e1[_0x2b01be(0x2ac)]+_0x2b01be(0x303)+_0x2318e1[_0x2b01be(0x31e)]+'\x27'),(_0x3e7059[_0x2b01be(0x191)]||_0x3e7059['jsonl'])&&await handleSingleObjectOutput(_0x2318e1,_0x3e7059),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(_0x3631c5){const _0x309c34=a51_0x3cc69e,_0x4cd8c4=Math[_0x309c34(0x2d1)](_0x3631c5/0x3e8),_0x326fbe=Math['floor'](_0x4cd8c4/0x3c),_0x1abaae=Math[_0x309c34(0x2d1)](_0x326fbe/0x3c),_0x1f7cca=Math[_0x309c34(0x2d1)](_0x1abaae/0x18);if(_0x1f7cca>0x0){const _0x1db48c=_0x1abaae%0x18;return _0x1db48c>0x0?_0x1f7cca+'d\x20'+_0x1db48c+'h':_0x1f7cca+'d';}else{if(_0x1abaae>0x0){const _0x39c60a=_0x326fbe%0x3c;return _0x39c60a>0x0?_0x1abaae+'h\x20'+_0x39c60a+'m':_0x1abaae+'h';}else{if(_0x326fbe>0x0){const _0x56e68b=_0x4cd8c4%0x3c;return _0x56e68b>0x0?_0x326fbe+'m\x20'+_0x56e68b+'s':_0x326fbe+'m';}else return _0x4cd8c4+'s';}}}function formatTimestamp(_0x3b9fd8,_0x10c2d7){const _0x7b335b=a51_0x3cc69e,_0x417b6c=new Date(_0x3b9fd8),_0x4d2414=String(_0x417b6c[_0x7b335b(0x24d)]())['padStart'](0x2,'0'),_0x3f443a=String(_0x417b6c['getMinutes']())[_0x7b335b(0x2a8)](0x2,'0'),_0x36f1fb=_0x4d2414+':'+_0x3f443a,_0x4320f9=_0x417b6c[_0x7b335b(0x1b9)]()===_0x10c2d7[_0x7b335b(0x1b9)]()&&_0x417b6c[_0x7b335b(0x2bb)]()===_0x10c2d7['getMonth']()&&_0x417b6c['getDate']()===_0x10c2d7[_0x7b335b(0x304)]();if(_0x4320f9)return _0x36f1fb;else{const _0x4389c8=String(_0x417b6c[_0x7b335b(0x2bb)]()+0x1)[_0x7b335b(0x2a8)](0x2,'0'),_0x1ccffb=String(_0x417b6c[_0x7b335b(0x304)]())[_0x7b335b(0x2a8)](0x2,'0');return _0x4389c8+'-'+_0x1ccffb+'\x20'+_0x36f1fb;}}function formatDate(_0x4c0dc0){const _0xf58ccf=a51_0x3cc69e,_0x380bbb=_0x4c0dc0[_0xf58ccf(0x1b9)](),_0x3e7686=String(_0x4c0dc0[_0xf58ccf(0x2bb)]()+0x1)[_0xf58ccf(0x2a8)](0x2,'0'),_0x1b2d1c=String(_0x4c0dc0[_0xf58ccf(0x304)]())[_0xf58ccf(0x2a8)](0x2,'0');return _0x380bbb+'-'+_0x3e7686+'-'+_0x1b2d1c;}function getTaskStateIcon(_0x41d6e9){const _0x57c25b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x57c25b[_0x41d6e9]||'⚪';}function getBarChar(_0x36ea7a){const _0x1e7c69=a51_0x3cc69e;return _0x36ea7a===_0x1e7c69(0x1a0)||_0x36ea7a===_0x1e7c69(0x209)?'×':'─';}function getBarColor(_0x2089a6){const _0x40f7ac=a51_0x3cc69e,_0x11b825={'success':a51_0x264b3b[_0x40f7ac(0x2ad)],'error':a51_0x264b3b[_0x40f7ac(0x2f8)],'group_error':a51_0x264b3b[_0x40f7ac(0x2f8)],'running':a51_0x264b3b[_0x40f7ac(0x323)],'blocked':a51_0x264b3b[_0x40f7ac(0x26c)],'planned':a51_0x264b3b['dim'],'canceling':a51_0x264b3b['yellow']};return _0x11b825[_0x2089a6]||a51_0x264b3b['white'];}function parseTaskName(_0x3e4ff5){const _0x2bc3be=a51_0x3cc69e;let _0x5a451b=_0x3e4ff5[_0x2bc3be(0x1dd)](/^\++/,'');const _0x5bb869=_0x5a451b[_0x2bc3be(0x1ad)]('+'),_0x5f0f25=_0x5bb869[_0x2bc3be(0x2d2)]>0x1?_0x5bb869[_0x2bc3be(0x2d2)]-0x2:0x0,_0xdde1b6=_0x5bb869[_0x5bb869[_0x2bc3be(0x2d2)]-0x1]||_0x5a451b;return{'level':_0x5f0f25,'name':'+'+_0xdde1b6};}function truncateTaskName(_0x1c8401,_0x3403e5){const _0x57fca0=a51_0x3cc69e,_0x2c6d30=stringWidth(_0x1c8401);if(_0x2c6d30<=_0x3403e5)return _0x1c8401;let _0x3683e7=_0x1c8401;while(stringWidth(_0x3683e7+'…')>_0x3403e5&&_0x3683e7[_0x57fca0(0x2d2)]>0x0){_0x3683e7=_0x3683e7[_0x57fca0(0x216)](0x0,-0x1);}return _0x3683e7+'…';}function calculateTimeScale(_0x1a9e9d,_0x3f5bfe){const _0x5b9715=a51_0x3cc69e;return{'startTime':_0x1a9e9d[_0x5b9715(0x2a0)],'endTime':_0x1a9e9d[_0x5b9715(0x1aa)],'durationMs':_0x1a9e9d[_0x5b9715(0x234)],'msPerChar':_0x1a9e9d[_0x5b9715(0x234)]/_0x3f5bfe};}function timeToPosition(_0xa51697,_0x141af6,_0x18313f){const _0x55f07a=a51_0x3cc69e,_0x7c0a36=_0xa51697-_0x141af6[_0x55f07a(0x27b)],_0x5553b6=Math['floor'](_0x7c0a36/_0x141af6[_0x55f07a(0x2a2)]);return Math[_0x55f07a(0x1d3)](0x0,Math[_0x55f07a(0x1d8)](_0x5553b6,_0x18313f));}function renderTimeAxis(_0x4ac903,_0x2f17aa){const _0x443c14=a51_0x3cc69e,_0x34ce55=Math[_0x443c14(0x1d8)](TIMELINE_CONFIG[_0x443c14(0x214)],Math[_0x443c14(0x1d3)](TIMELINE_CONFIG[_0x443c14(0x2b9)],Math[_0x443c14(0x2d1)](_0x2f17aa/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x17d9f7=_0x4ac903[_0x443c14(0x1e1)]/(_0x34ce55-0x1),_0x2712e5=new Date(_0x4ac903['startTime']),_0x9b8e8c=[];for(let _0x5f1395=0x0;_0x5f1395<_0x34ce55;_0x5f1395++){const _0x58f2b0=_0x4ac903[_0x443c14(0x27b)]+_0x5f1395*_0x17d9f7,_0x12e972=timeToPosition(_0x58f2b0,_0x4ac903,_0x2f17aa),_0x2516c1=formatTimestamp(_0x58f2b0,_0x2712e5);_0x9b8e8c['push']({'pos':_0x12e972,'text':_0x2516c1});}const _0x456012=new Array(_0x2f17aa)[_0x443c14(0x281)]('\x20');let _0xe75efe=-0x1;for(const {pos:_0x4c34eb,text:_0x555d98}of _0x9b8e8c){let _0x4834b1=Math[_0x443c14(0x1d3)](0x0,_0x4c34eb-Math['floor'](_0x555d98[_0x443c14(0x2d2)]/0x2));_0x4834b1<=_0xe75efe+TIMELINE_CONFIG[_0x443c14(0x23a)]&&(_0x4834b1=_0xe75efe+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x4834b1+_0x555d98[_0x443c14(0x2d2)]>_0x2f17aa&&(_0x4834b1=_0x2f17aa-_0x555d98[_0x443c14(0x2d2)]);if(_0x4834b1>=0x0&&_0x4834b1+_0x555d98[_0x443c14(0x2d2)]<=_0x2f17aa&&_0x4834b1>_0xe75efe){for(let _0x2cb5ce=0x0;_0x2cb5ce<_0x555d98['length'];_0x2cb5ce++){_0x456012[_0x4834b1+_0x2cb5ce]=_0x555d98[_0x2cb5ce];}_0xe75efe=_0x4834b1+_0x555d98[_0x443c14(0x2d2)]-0x1;}}return _0x456012[_0x443c14(0x329)]('');}function renderTaskRow(_0x315c4b,_0xfb41e4,_0x11c59a,_0x5c0d8d){const _0xd39089=a51_0x3cc69e,{level:_0x1eefbc,name:_0x1b83cb}=parseTaskName(_0x315c4b['name']),_0x3d92d5='\x20'['repeat'](_0x1eefbc),_0x27ea96=_0x315c4b[_0xd39089(0x218)]?'('+formatElapsed(_0x315c4b['window'][_0xd39089(0x234)])+')':'',_0x2be612=stringWidth(_0x27ea96),_0x28eb2f=_0x1eefbc*0x1,_0x1ea4c9=_0x5c0d8d-_0x28eb2f-_0x2be612-0x1,_0x372625=truncateTaskName(_0x1b83cb,_0x1ea4c9),_0x3fdfa3=_0x3d92d5+_0x372625,_0x37b286=stringWidth(_0x3fdfa3),_0x229f42=_0x5c0d8d-_0x37b286-_0x2be612,_0x27e7b7=_0x3fdfa3+'\x20'[_0xd39089(0x213)](Math[_0xd39089(0x1d3)](0x1,_0x229f42))+a51_0x264b3b[_0xd39089(0x321)](_0x27ea96),_0x45f8d0=getTaskStateIcon(_0x315c4b[_0xd39089(0x2cb)]),_0x4b38a3=new Array(_0x11c59a)[_0xd39089(0x281)]('\x20');if(_0x315c4b[_0xd39089(0x218)]){const _0x4dafa6=timeToPosition(_0x315c4b['window'][_0xd39089(0x2a0)],_0xfb41e4,_0x11c59a),_0x3cdcc5=timeToPosition(_0x315c4b[_0xd39089(0x218)][_0xd39089(0x1aa)],_0xfb41e4,_0x11c59a),_0x4e4fff=getBarChar(_0x315c4b[_0xd39089(0x2cb)]),_0x4e05fc=Math['max'](_0x4dafa6+0x1,_0x3cdcc5);for(let _0x4f20da=_0x4dafa6;_0x4f20da<Math[_0xd39089(0x1d8)](_0x4e05fc,_0x11c59a);_0x4f20da++){_0x4b38a3[_0x4f20da]=_0x4e4fff;}}const _0x1d7fb3=getBarColor(_0x315c4b[_0xd39089(0x2cb)]),_0x60a977=_0x4b38a3[_0xd39089(0x2ca)](_0x2b5408=>_0x2b5408==='\x20'?'\x20':_0x1d7fb3(_0x2b5408))['join']('');return _0x45f8d0+'\x20'+_0x27e7b7+'│'+_0x60a977+'│';}function calculateStats(_0xa36cbd){const _0x14dc30=a51_0x3cc69e,_0x9c21b2={'total':_0xa36cbd[_0x14dc30(0x2d2)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x13526e of _0xa36cbd){if(_0x13526e[_0x14dc30(0x2cb)]===_0x14dc30(0x28c))_0x9c21b2[_0x14dc30(0x28c)]++;else{if(_0x13526e['state']==='error'||_0x13526e[_0x14dc30(0x2cb)]===_0x14dc30(0x209))_0x9c21b2[_0x14dc30(0x1a0)]++;else _0x13526e[_0x14dc30(0x2cb)]===_0x14dc30(0x2d8)?_0x9c21b2[_0x14dc30(0x2d8)]++:_0x9c21b2['pending']++;}}return _0x9c21b2;}function formatStats(_0x1870bc){const _0x2e39f9=a51_0x3cc69e;return[_0x2e39f9(0x2d0)+_0x1870bc[_0x2e39f9(0x238)],'✅\x20'+_0x1870bc['success'],'❌\x20'+_0x1870bc[_0x2e39f9(0x1a0)],_0x2e39f9(0x2c0)+_0x1870bc['running'],'⏳\x20'+_0x1870bc[_0x2e39f9(0x26d)]][_0x2e39f9(0x329)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x3cc69e(0x1f7)]=a51_0x3cc69e(0x2f1);[a51_0x3cc69e(0x23f)]=a51_0x3cc69e(0x288);async[a51_0x3cc69e(0x25b)](_0x5d5e1d){const _0x4352a0=a51_0x3cc69e,{options:_0x509456,args:_0x17a9c2,tdx:_0x3df035}=_0x5d5e1d;let _0x229513,_0x5f1263,_0x134306=![];if(_0x17a9c2[0x0]){if(_0x17a9c2[0x0][_0x4352a0(0x1d0)]('.')){const _0x5876d8=this[_0x4352a0(0x1e6)](_0x17a9c2,_0x509456);if(!_0x5876d8)return 0x1;_0x229513=_0x5876d8[_0x4352a0(0x31e)],_0x5f1263=_0x5876d8['workflowName'];}else{_0x5f1263=_0x17a9c2[0x0],_0x229513=_0x509456[_0x4352a0(0x1cc)];if(!_0x229513)return console[_0x4352a0(0x1a0)](a51_0x264b3b[_0x4352a0(0x2f8)](_0x4352a0(0x1b4)),_0x4352a0(0x274)),0x1;_0x134306=!![];}}else{const _0x161511=this['parseProjectWorkflowPattern'](_0x17a9c2,_0x509456);if(!_0x161511)return 0x1;_0x229513=_0x161511[_0x4352a0(0x31e)],_0x5f1263=_0x161511[_0x4352a0(0x24c)];}if(_0x509456[_0x4352a0(0x236)]){if(_0x229513&&_0x5f1263)console['error'](_0x4352a0(0x1a1)+_0x229513+'.'+_0x5f1263);else _0x229513&&console[_0x4352a0(0x1a0)]('Filter:\x20project='+_0x229513);}const _0x271300=_0x509456['attemptId'],_0x3a9478=_0x509456[_0x4352a0(0x22e)];if(_0x271300){_0x3a9478&&console[_0x4352a0(0x1a0)](a51_0x264b3b[_0x4352a0(0x26c)](_0x4352a0(0x193)),_0x4352a0(0x1bd));const _0x439642=_0x509456['follow'];return _0x439642?await this[_0x4352a0(0x211)](_0x5d5e1d,_0x271300):await this[_0x4352a0(0x32e)](_0x5d5e1d,_0x271300,_0x509456),0x0;}if(_0x3a9478){const _0x123d65=await withSpinner('Loading\x20session...',()=>_0x3df035['workflow'][_0x4352a0(0x240)]({'projectName':_0x229513,'workflowName':_0x5f1263,'limit':0x64}),{'verbose':_0x509456[_0x4352a0(0x236)]}),_0x26542c=_0x123d65[_0x4352a0(0x1b8)][_0x4352a0(0x1db)](_0x16833c=>_0x16833c['id']===_0x3a9478);if(!_0x26542c)return console[_0x4352a0(0x1a0)](a51_0x264b3b[_0x4352a0(0x2f8)](_0x4352a0(0x1b4)),'Session\x20not\x20found:\x20'+_0x3a9478),0x1;if(!_0x26542c[_0x4352a0(0x29a)]?.['id'])return console[_0x4352a0(0x1a0)](a51_0x264b3b['red']('Error:'),_0x4352a0(0x199)+_0x3a9478+'\x20has\x20no\x20attempts'),0x1;const _0x1093c5=_0x26542c[_0x4352a0(0x29a)]['id'];_0x509456[_0x4352a0(0x236)]&&console[_0x4352a0(0x1a0)]('Using\x20attempt\x20'+_0x1093c5+'\x20from\x20session\x20'+_0x3a9478);const _0x414411=_0x509456['follow'];return _0x414411?await this[_0x4352a0(0x211)](_0x5d5e1d,_0x1093c5):await this[_0x4352a0(0x32e)](_0x5d5e1d,_0x1093c5,_0x509456),0x0;}const _0x5deb71=await withSpinner(_0x4352a0(0x231),()=>_0x3df035[_0x4352a0(0x27a)][_0x4352a0(0x240)]({'projectName':_0x229513,'workflowName':_0x5f1263,'limit':_0x509456['limit']||0x32}),{'verbose':_0x509456[_0x4352a0(0x236)]}),_0x4dab83=_0x5deb71[_0x4352a0(0x1b8)];if(_0x4dab83[_0x4352a0(0x2d2)]===0x0){if(_0x229513&&_0x5f1263)console['error'](_0x4352a0(0x2f5)+_0x229513+'.'+_0x5f1263);else _0x229513?console[_0x4352a0(0x1a0)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x229513):(console['error'](_0x4352a0(0x1b6)),console['error'](a51_0x264b3b[_0x4352a0(0x321)](_0x4352a0(0x27e))));return 0x0;}_0x4dab83['sort']((_0x70e9a9,_0x40c357)=>{const _0x51ab57=_0x4352a0,_0x4185a8=_0x70e9a9[_0x51ab57(0x1c5)]||'',_0x26d246=_0x40c357[_0x51ab57(0x1c5)]||'';return _0x26d246[_0x51ab57(0x197)](_0x4185a8);});if(_0x509456[_0x4352a0(0x191)]||_0x509456[_0x4352a0(0x2cc)])return await handleSDKOutput(_0x4dab83,_0x509456),0x0;let _0x63bdb8;if(_0x134306){const _0x57342f=_0x4dab83[0x0];if(!_0x57342f[_0x4352a0(0x29a)]?.['id'])return console['error'](_0x4352a0(0x30f)),0x0;_0x63bdb8=_0x57342f[_0x4352a0(0x29a)]['id'],_0x509456[_0x4352a0(0x236)]&&console[_0x4352a0(0x1a0)](_0x4352a0(0x263)+_0x57342f['sessionTime']);}else{const _0xe48f81=_0x4dab83[_0x4352a0(0x2ca)](_0x513bde=>{const _0x23e828=_0x4352a0,_0x241701=getAttemptStatusDisplay(_0x513bde[_0x23e828(0x29a)]);return{'title':_0x513bde['project']?.[_0x23e828(0x1f7)]+'.'+_0x513bde['workflow']?.[_0x23e828(0x1f7)]+_0x23e828(0x1b3)+_0x513bde[_0x23e828(0x1c5)]+'\x20'+_0x241701['icon'],'value':_0x513bde[_0x23e828(0x29a)]?.['id']||'','description':_0x241701[_0x23e828(0x2a1)]};}),_0x20a822=await a51_0x51f43d({'type':_0x4352a0(0x2f7),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0xe48f81[_0x4352a0(0x2b3)](_0x2e6b2e=>_0x2e6b2e[_0x4352a0(0x276)]!=='')});if(!_0x20a822[_0x4352a0(0x2e1)])return 0x0;_0x63bdb8=_0x20a822[_0x4352a0(0x2e1)];}const _0x272ab8=_0x509456[_0x4352a0(0x189)];return _0x272ab8?await this['pollTimeline'](_0x5d5e1d,_0x63bdb8):await this[_0x4352a0(0x32e)](_0x5d5e1d,_0x63bdb8,_0x509456),0x0;}async[a51_0x3cc69e(0x32e)](_0x5206e7,_0x529f54,_0x25b922){const _0x572f12=a51_0x3cc69e,{tdx:_0x191bec}=_0x5206e7;let _0x1231a4,_0xbcb8d;try{[_0x1231a4,_0xbcb8d]=await Promise[_0x572f12(0x260)]([_0x191bec[_0x572f12(0x27a)]['attempt'](_0x529f54),_0x191bec['workflow']['tasks'](_0x529f54,![])]);}catch(_0xeb1ea7){console[_0x572f12(0x1a0)](a51_0x264b3b['red'](_0x572f12(0x291)));_0x25b922[_0x572f12(0x236)]&&console['error'](_0xeb1ea7);throw _0xeb1ea7;}if(_0x25b922['json']||_0x25b922[_0x572f12(0x2cc)]){const _0x4a1f23=this['buildTimelineData'](_0x1231a4,_0xbcb8d);await handleSDKOutput([_0x4a1f23],_0x25b922);return;}const _0x263ef1=_0x191bec[_0x572f12(0x227)][_0x572f12(0x271)],_0x559f94=this[_0x572f12(0x205)](_0x1231a4,_0xbcb8d,_0x263ef1);console['log'](_0x559f94);}async[a51_0x3cc69e(0x211)](_0x28c6c0,_0x2f662b){const _0x580208=a51_0x3cc69e,{tdx:_0x780e27}=_0x28c6c0,_0x2d991d=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x2bede2=TIMELINE_CONFIG[_0x580208(0x280)];let _0x2f6e98=0x0;while(_0x2f6e98<_0x2bede2){process[_0x580208(0x287)][_0x580208(0x2ae)]&&process[_0x580208(0x287)][_0x580208(0x208)]('\x1bc');let _0x71fb32,_0x2bad4b;try{[_0x71fb32,_0x2bad4b]=await Promise[_0x580208(0x260)]([_0x780e27[_0x580208(0x27a)]['attempt'](_0x2f662b),_0x780e27[_0x580208(0x27a)]['tasks'](_0x2f662b,![])]);}catch(_0x4e977c){console['error'](a51_0x264b3b[_0x580208(0x2f8)](_0x580208(0x2d9)));_0x2f6e98>0x0&&console['error'](a51_0x264b3b[_0x580208(0x321)](_0x580208(0x226)+_0x2f6e98));throw _0x4e977c;}const _0x4084c5=_0x780e27['context']['site'],_0x43fe22=this[_0x580208(0x205)](_0x71fb32,_0x2bad4b,_0x4084c5);console[_0x580208(0x1b0)](_0x43fe22);const _0x38ae87=_0x71fb32[_0x580208(0x1e8)]&&_0x2bad4b[_0x580208(0x2a6)](_0x33263d=>_0x33263d[_0x580208(0x2cb)]!==_0x580208(0x2d8)&&_0x33263d[_0x580208(0x2cb)]!=='planned');if(_0x38ae87){console['error'](a51_0x264b3b[_0x580208(0x2ad)](_0x580208(0x254)));break;}console[_0x580208(0x1a0)](a51_0x264b3b[_0x580208(0x321)](_0x580208(0x230)+_0x2f6e98*0x2+_0x580208(0x2e2))),await new Promise(_0x16a45b=>setTimeout(_0x16a45b,_0x2d991d)),_0x2f6e98++;}_0x2f6e98>=_0x2bede2&&console[_0x580208(0x1a0)](a51_0x264b3b[_0x580208(0x26c)](_0x580208(0x270)));}[a51_0x3cc69e(0x205)](_0xa36bb9,_0x48839d,_0x2815f9){const _0x2f738a=a51_0x3cc69e,_0x197232=[],_0x5ec44c=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x4929dc=0x5,_0xcb9c27=process[_0x2f738a(0x287)]['columns']||0x78,_0x5a6a6c=_0xcb9c27-_0x5ec44c-_0x4929dc,_0x54da5d=Math[_0x2f738a(0x1d3)](TIMELINE_CONFIG[_0x2f738a(0x2f4)],Math['min'](_0x5a6a6c,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4cde8e=new Date(_0xa36bb9['createdAt'])[_0x2f738a(0x202)](),_0x175ad0=_0xa36bb9['finishedAt']?new Date(_0xa36bb9[_0x2f738a(0x2e6)])['getTime']():Date['now'](),_0x1c4914={'start':_0x4cde8e,'end':_0x175ad0,'duration':_0x175ad0-_0x4cde8e},_0x5d9c45=new Map(),_0x30c87f=[];for(const _0x406ca1 of _0x48839d){if(_0x406ca1[_0x2f738a(0x2b0)]){const _0x4d9cba=new Date(_0x406ca1[_0x2f738a(0x2b0)])[_0x2f738a(0x202)](),_0x13d1f4=_0x406ca1[_0x2f738a(0x293)]?new Date(_0x406ca1['updatedAt'])[_0x2f738a(0x202)]():Date[_0x2f738a(0x22b)](),_0x5ba320={'start':_0x4d9cba,'end':_0x13d1f4,'duration':_0x13d1f4-_0x4d9cba};_0x5d9c45[_0x2f738a(0x20a)](_0x406ca1['id'],_0x5ba320),_0x30c87f[_0x2f738a(0x2ea)]({'name':_0x406ca1[_0x2f738a(0x23e)],'state':_0x406ca1[_0x2f738a(0x2cb)]||'unknown','window':_0x5ba320});}else _0x30c87f['push']({'name':_0x406ca1[_0x2f738a(0x23e)],'state':_0x406ca1[_0x2f738a(0x2cb)]||_0x2f738a(0x306),'window':undefined});}_0x30c87f[_0x2f738a(0x32d)]((_0x3da15e,_0x485998)=>{const _0x169b68=_0x2f738a;if(!_0x3da15e[_0x169b68(0x218)])return 0x1;if(!_0x485998[_0x169b68(0x218)])return-0x1;return _0x3da15e[_0x169b68(0x218)][_0x169b68(0x2a0)]-_0x485998[_0x169b68(0x218)]['start'];});const _0x5a788d=_0x30c87f[_0x2f738a(0x2d2)],_0x44213f=_0x5a788d>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x44213f&&_0x30c87f[_0x2f738a(0x24b)](TIMELINE_CONFIG[_0x2f738a(0x1b7)]);const _0x73a0b=calculateTimeScale(_0x1c4914,_0x54da5d),_0x504500=_0xa36bb9[_0x2f738a(0x1e8)]?_0xa36bb9[_0x2f738a(0x28c)]?a51_0x264b3b['green'](_0x2f738a(0x28c)):a51_0x264b3b[_0x2f738a(0x2f8)](_0x2f738a(0x1a0)):a51_0x264b3b['blue']('running'),_0x6b1709=_0xa36bb9[_0x2f738a(0x1b2)]?.['id'],_0x36a70a=_0xa36bb9[_0x2f738a(0x22e)];let _0x4a571c;if(_0x6b1709&&_0x36a70a){const _0x160d48=getWorkflowAttemptUrl(_0x2815f9,_0x6b1709,_0x36a70a,_0xa36bb9['id']);_0x4a571c=hyperlink(a51_0x264b3b[_0x2f738a(0x321)](_0xa36bb9['id']),_0x160d48);}else _0x4a571c=a51_0x264b3b[_0x2f738a(0x321)](_0xa36bb9['id']);_0x197232[_0x2f738a(0x2ea)](_0x2f738a(0x327)+_0x4a571c+_0x2f738a(0x1b3)+_0x504500+_0x2f738a(0x1b3)+formatElapsed(_0x1c4914[_0x2f738a(0x234)]));if(_0x30c87f[_0x2f738a(0x2d2)]>0x0){const _0x3d73b4=renderTimeAxis(_0x73a0b,_0x54da5d),_0x47c357=new Date(_0x1c4914[_0x2f738a(0x2a0)]),_0x2b4860=formatDate(_0x47c357),_0xead4fa=TIMELINE_CONFIG[_0x2f738a(0x283)]+TIMELINE_CONFIG[_0x2f738a(0x239)]+_0x5ec44c,_0x4a0b40=_0x2b4860[_0x2f738a(0x2a8)](_0xead4fa),_0x2ba790=a51_0x264b3b['dim'](_0x4a0b40);_0x197232[_0x2f738a(0x2ea)](_0x2ba790+'\x20'+_0x3d73b4);for(const _0x44c5b2 of _0x30c87f){_0x197232[_0x2f738a(0x2ea)](renderTaskRow(_0x44c5b2,_0x73a0b,_0x54da5d,_0x5ec44c));}const _0x594642=calculateStats(_0x30c87f);_0x197232[_0x2f738a(0x2ea)](formatStats(_0x594642)),_0x44213f&&_0x197232[_0x2f738a(0x2ea)](a51_0x264b3b[_0x2f738a(0x26c)](_0x2f738a(0x2dd)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x2f738a(0x259)+_0x5a788d+_0x2f738a(0x2ce))),_0x197232[_0x2f738a(0x2ea)](''),_0x197232[_0x2f738a(0x2ea)](a51_0x264b3b['dim']('💡\x20Tip:\x20Use\x20')+(_0x2f738a(0x296)+_0xa36bb9['id']+_0x2f738a(0x26b))+a51_0x264b3b[_0x2f738a(0x321)](_0x2f738a(0x273)));}else _0x197232[_0x2f738a(0x2ea)](_0x2f738a(0x2d7));return _0x197232[_0x2f738a(0x329)]('\x0a');}[a51_0x3cc69e(0x1f2)](_0x1a4c5e,_0x4ba68b){const _0x41b078=a51_0x3cc69e,_0x1dee0b=new Date(_0x1a4c5e[_0x41b078(0x30a)])['getTime'](),_0x5bc34e=_0x1a4c5e['finishedAt']?new Date(_0x1a4c5e[_0x41b078(0x2e6)])[_0x41b078(0x202)]():Date[_0x41b078(0x22b)](),_0x501237=_0x5bc34e-_0x1dee0b,_0x59964e=[];for(const _0x506ef0 of _0x4ba68b){if(_0x506ef0[_0x41b078(0x2b0)]){const _0x105caa=new Date(_0x506ef0[_0x41b078(0x2b0)])[_0x41b078(0x202)](),_0x3191cc=_0x506ef0[_0x41b078(0x293)]?new Date(_0x506ef0['updatedAt'])[_0x41b078(0x202)]():Date[_0x41b078(0x22b)]();_0x59964e['push']({'name':_0x506ef0[_0x41b078(0x23e)],'state':_0x506ef0['state']||'unknown','window':{'start':_0x105caa,'end':_0x3191cc,'duration':_0x3191cc-_0x105caa}});}else _0x59964e[_0x41b078(0x2ea)]({'name':_0x506ef0[_0x41b078(0x23e)],'state':_0x506ef0['state']||_0x41b078(0x306),'window':undefined});}const _0x4cb17f=calculateStats(_0x59964e);return{'attempt':{'id':_0x1a4c5e['id'],'status':_0x1a4c5e['done']?_0x1a4c5e[_0x41b078(0x28c)]?_0x41b078(0x28c):_0x41b078(0x1a0):'running','createdAt':_0x1a4c5e['createdAt'],'finishedAt':_0x1a4c5e[_0x41b078(0x2e6)],'duration_ms':_0x501237},'tasks':_0x59964e[_0x41b078(0x2ca)](_0x2d0516=>({'name':_0x2d0516[_0x41b078(0x1f7)],'state':_0x2d0516[_0x41b078(0x2cb)],'startedAt':_0x2d0516[_0x41b078(0x218)]?new Date(_0x2d0516[_0x41b078(0x218)][_0x41b078(0x2a0)])['toISOString']():null,'updatedAt':_0x2d0516[_0x41b078(0x218)]?new Date(_0x2d0516['window'][_0x41b078(0x1aa)])['toISOString']():null,'duration_ms':_0x2d0516[_0x41b078(0x218)]?.[_0x41b078(0x234)]||null})),'stats':_0x4cb17f};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x41dbf4,_0x59b773){const _0x4d9e69=a52_0x5651,_0x5dcf8f=_0x41dbf4();while(!![]){try{const _0x1f7654=parseInt(_0x4d9e69(0xa4))/0x1+parseInt(_0x4d9e69(0xa5))/0x2+-parseInt(_0x4d9e69(0xaf))/0x3*(-parseInt(_0x4d9e69(0xac))/0x4)+-parseInt(_0x4d9e69(0xa8))/0x5+-parseInt(_0x4d9e69(0xae))/0x6*(-parseInt(_0x4d9e69(0xb2))/0x7)+-parseInt(_0x4d9e69(0xad))/0x8*(parseInt(_0x4d9e69(0xb0))/0x9)+-parseInt(_0x4d9e69(0xaa))/0xa*(parseInt(_0x4d9e69(0xa7))/0xb);if(_0x1f7654===_0x59b773)break;else _0x5dcf8f['push'](_0x5dcf8f['shift']());}catch(_0x3fa953){_0x5dcf8f['push'](_0x5dcf8f['shift']());}}}(a52_0xcbbe,0x1c593));import{platform}from'os';function a52_0x5651(_0x56c410,_0x3dc67d){_0x56c410=_0x56c410-0xa1;const _0xcbbebe=a52_0xcbbe();let _0x5651a8=_0xcbbebe[_0x56c410];return _0x5651a8;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0xcbbe(){const _0x38a7bd=[';\x20node/','186161szfUyU','198880nHqArY','tdx/','429PYzhEz','535515yZFLeq','Authorization','11150RaBmWo','Bearer\x20','8bdubWR','462656vuaxyt','42rEVqjU','62025oTsPAA','36yXcKDH','TD1\x20','171080hjqXcW','length','version'];a52_0xcbbe=function(){return _0x38a7bd;};return a52_0xcbbe();}export function getUserAgent(){const _0x4ae000=a52_0x5651,_0xb3320a=getVersion(),_0x1b8ba0=platform(),_0x1a3d39=process[_0x4ae000(0xa2)]['replace']('v','');return _0x4ae000(0xa6)+_0xb3320a+'\x20('+_0x1b8ba0+_0x4ae000(0xa3)+_0x1a3d39+')';}export function getAuthHeaders(_0x380477,_0x47b0d4,_0x580739){const _0x10c9c3=a52_0x5651,_0x565950=getVersion(),_0x20cbb6={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x565950};if(_0x580739)_0x20cbb6['Authorization']=_0x10c9c3(0xab)+_0x580739;else _0x47b0d4&&(_0x20cbb6[_0x10c9c3(0xa9)]=_0x10c9c3(0xb1)+_0x47b0d4);return _0x20cbb6;}export function toHeaderRecord(_0x27184e){const _0xa37b20={};for(const [_0x3bfa11,_0x25989f]of Object['entries'](_0x27184e)){_0x25989f!==undefined&&(_0xa37b20[_0x3bfa11]=_0x25989f);}return _0xa37b20;}export function getTrinoHeaders(_0x125a2b,_0x3756f6,_0xb32806){const _0x4404f6=a52_0x5651,_0x40663f=getAuthHeaders(_0x125a2b),_0x9de953=toHeaderRecord(_0x40663f);if(_0xb32806)_0x9de953[_0x4404f6(0xa9)]=_0x4404f6(0xab)+_0xb32806;else _0x3756f6&&(_0x9de953['X-Trino-User']=_0x3756f6);return _0x9de953;}export function hasAPIKey(_0x219b4e){const _0x22278=a52_0x5651,_0x3fdcc2=getAPIKey();return _0x3fdcc2!==undefined&&_0x3fdcc2[_0x22278(0xa1)]>0x0;}
1
+ (function(_0x1f65ce,_0xa3299e){const _0x25f1d1=a52_0xd68c,_0x116b45=_0x1f65ce();while(!![]){try{const _0x15396e=parseInt(_0x25f1d1(0x1f3))/0x1+-parseInt(_0x25f1d1(0x1ea))/0x2+-parseInt(_0x25f1d1(0x1e3))/0x3*(parseInt(_0x25f1d1(0x1e5))/0x4)+-parseInt(_0x25f1d1(0x1ed))/0x5*(-parseInt(_0x25f1d1(0x1f2))/0x6)+-parseInt(_0x25f1d1(0x1f0))/0x7*(-parseInt(_0x25f1d1(0x1f4))/0x8)+parseInt(_0x25f1d1(0x1e8))/0x9*(parseInt(_0x25f1d1(0x1eb))/0xa)+parseInt(_0x25f1d1(0x1f1))/0xb*(-parseInt(_0x25f1d1(0x1ef))/0xc);if(_0x15396e===_0xa3299e)break;else _0x116b45['push'](_0x116b45['shift']());}catch(_0x5b97e1){_0x116b45['push'](_0x116b45['shift']());}}}(a52_0x4706,0x55dee));function a52_0x4706(){const _0x280bde=['Bearer\x20','4566nKJuSu',';\x20node/','844rmnPhO','entries','version','2200149UjVEgC','X-Trino-User','408976tZXYez','20gaZFtj','Authorization','330yanldw','replace','12588saqOJx','707QatqLw','11121eRCGyE','26970abTYNI','506408XTRyQT','51160yfFpdx'];a52_0x4706=function(){return _0x280bde;};return a52_0x4706();}import{platform}from'os';function a52_0xd68c(_0x3f4842,_0x387fa3){_0x3f4842=_0x3f4842-0x1e2;const _0x4706c5=a52_0x4706();let _0xd68c26=_0x4706c5[_0x3f4842];return _0xd68c26;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x1f1d29=a52_0xd68c,_0x4fc624=getVersion(),_0x43e686=platform(),_0x4d4df3=process[_0x1f1d29(0x1e7)][_0x1f1d29(0x1ee)]('v','');return'tdx/'+_0x4fc624+'\x20('+_0x43e686+_0x1f1d29(0x1e4)+_0x4d4df3+')';}export function getAuthHeaders(_0xcc2a7d,_0x4116d6,_0x1f6be9){const _0x4b4806=a52_0xd68c,_0x185c21=getVersion(),_0x51e29c={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x185c21};if(_0x1f6be9)_0x51e29c[_0x4b4806(0x1ec)]=_0x4b4806(0x1e2)+_0x1f6be9;else _0x4116d6&&(_0x51e29c['Authorization']='TD1\x20'+_0x4116d6);return _0x51e29c;}export function toHeaderRecord(_0x2ddc2d){const _0x3ad98e=a52_0xd68c,_0x387cb0={};for(const [_0x432631,_0x1e25d8]of Object[_0x3ad98e(0x1e6)](_0x2ddc2d)){_0x1e25d8!==undefined&&(_0x387cb0[_0x432631]=_0x1e25d8);}return _0x387cb0;}export function getTrinoHeaders(_0x5974c8,_0x10f6a6,_0x1b8dcc){const _0x7549b4=a52_0xd68c,_0x449f62=getAuthHeaders(_0x5974c8),_0x3c9457=toHeaderRecord(_0x449f62);if(_0x1b8dcc)_0x3c9457[_0x7549b4(0x1ec)]='Bearer\x20'+_0x1b8dcc;else _0x10f6a6&&(_0x3c9457[_0x7549b4(0x1e9)]=_0x10f6a6);return _0x3c9457;}export function hasAPIKey(_0x5788b1){const _0x5cfb33=getAPIKey();return _0x5cfb33!==undefined&&_0x5cfb33['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x15defb,_0x142ee3){const _0x2eb4e3=a53_0xba0a,_0x26bfba=_0x15defb();while(!![]){try{const _0x521888=-parseInt(_0x2eb4e3(0x196))/0x1+-parseInt(_0x2eb4e3(0x1b9))/0x2+parseInt(_0x2eb4e3(0x1c6))/0x3*(-parseInt(_0x2eb4e3(0x19b))/0x4)+-parseInt(_0x2eb4e3(0x1bf))/0x5+parseInt(_0x2eb4e3(0x1c1))/0x6*(parseInt(_0x2eb4e3(0x1d3))/0x7)+-parseInt(_0x2eb4e3(0x1d4))/0x8*(-parseInt(_0x2eb4e3(0x192))/0x9)+-parseInt(_0x2eb4e3(0x1ab))/0xa*(-parseInt(_0x2eb4e3(0x1b0))/0xb);if(_0x521888===_0x142ee3)break;else _0x26bfba['push'](_0x26bfba['shift']());}catch(_0x27ae75){_0x26bfba['push'](_0x26bfba['shift']());}}}(a53_0x22e0,0x61412));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x9b76a7 from'chalk';function a53_0x22e0(){const _0x46fa95=['filter','stringify','write','output','tsv','yellow','189050IkwRHd','data','stdin','repeat','spawn','506PAzaMo','end','string','number','inherit','table','object','length','slice','142814XLoJAL','varchar','query','stdout','debug','keys','2578375bqmieX','padEnd','259110wzWLuO','map','entries','forEach','resolve','814653eMyqoN','magenta','limitStructuredFormats','stderr','list','push','cyan','[logs]','─┬─','rule','isFinite','─┴─','FINISHED','98exClxG','75832HckdZC','boolean','join','limit','isInteger','close','error','max','format','params','81oFgxoT','[rule]','No\x20data','[Object]','302544coPIRD','pipe','trim','log','json','4GnKSbl','isTTY','jsonl','sdk-result','noColor','bold','split','color','less','bigint'];a53_0x22e0=function(){return _0x46fa95;};return a53_0x22e0();}function a53_0xba0a(_0x2d3484,_0x3a2cfb){_0x2d3484=_0x2d3484-0x192;const _0x22e0d8=a53_0x22e0();let _0xba0af6=_0x22e0d8[_0x2d3484];return _0xba0af6;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xc11c4){const _0x35d363=a53_0xba0a;return _0xc11c4['format']===_0x35d363(0x19a)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x19d)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1a9)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1b5)||_0xc11c4['json']===!![]||_0xc11c4['jsonl']===!![]||_0xc11c4[_0x35d363(0x1a9)]===!![]||_0xc11c4['table']===!![];}export function parseOutputOptions(_0x169e5e){const _0x1baa01=a53_0xba0a;return{'format':_0x169e5e['format']||_0x1baa01(0x1b5),'output':_0x169e5e[_0x1baa01(0x1a8)]||'','limit':_0x169e5e['limit'],'limitStructuredFormats':_0x169e5e[_0x1baa01(0x1c8)],'color':_0x169e5e[_0x1baa01(0x1a2)],'noColor':_0x169e5e[_0x1baa01(0x19f)]};}function convertSDKResultToQueryResult(_0x19ca06){const _0x253fca=a53_0xba0a,_0x232bcb=[];if(_0x19ca06[_0x253fca(0x1b7)]>0x0){const _0x4aeba2=_0x19ca06[0x0];for(const [_0x241ee2,_0x354fed]of Object['entries'](_0x4aeba2)){let _0x2ffc23=_0x253fca(0x1ba);if(typeof _0x354fed==='number')_0x2ffc23=Number[_0x253fca(0x1d8)](_0x354fed)?_0x253fca(0x1a4):'double';else{if(typeof _0x354fed===_0x253fca(0x1d5))_0x2ffc23=_0x253fca(0x1d5);else _0x354fed===null&&(_0x2ffc23=_0x253fca(0x1ba));}_0x232bcb['push']({'name':_0x241ee2,'type':_0x2ffc23});}}return{'queryId':_0x253fca(0x19e),'columns':_0x232bcb,'data':_0x19ca06,'stats':{'state':_0x253fca(0x1d2),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x19ca06[_0x253fca(0x1b7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x7b8866,_0x5d8fe2){const _0x5f540c=convertSDKResultToQueryResult(_0x7b8866);return formatQueryOutput(_0x5f540c,_0x5d8fe2);}export async function formatQueryOutput(_0x940c6a,_0x21d00f){const _0x58ea0b=a53_0xba0a,{format:_0x3155d6,limit:_0x5be50d,output:_0x4f9c7d,color:_0x5df2ca,noColor:_0x5339a4,limitStructuredFormats:_0x218bec}=_0x21d00f,_0x1b956d=Boolean(_0x4f9c7d)&&!_0x5df2ca,_0x84fb49={'color':_0x5df2ca,'noColor':_0x5339a4||_0x1b956d};if(_0x3155d6===_0x58ea0b(0x1b5)){const _0x518047=shouldUseLess(_0x3155d6,_0x4f9c7d);return formatAsTable(_0x940c6a,_0x5be50d,_0x518047,_0x84fb49);}const _0x418e57=_0x218bec&&Number[_0x58ea0b(0x1d0)](_0x5be50d)&&_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b7)]>_0x5be50d?{..._0x940c6a,'data':_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b8)](0x0,_0x5be50d)}:_0x940c6a;if(_0x3155d6===_0x58ea0b(0x19a))return formatAsJSON(_0x418e57,_0x84fb49);else return _0x3155d6===_0x58ea0b(0x19d)?formatAsJSONL(_0x418e57,_0x84fb49):formatQueryResult(_0x418e57,_0x3155d6);}function shouldUseLess(_0x18cdbd,_0x551824){const _0x5de25e=a53_0xba0a;return(_0x18cdbd===_0x5de25e(0x1b5)||_0x18cdbd===_0x5de25e(0x1ca))&&process[_0x5de25e(0x1bc)][_0x5de25e(0x19c)]&&!_0x551824;}export function resolveOutputOptions(_0x25ec71){const _0x270886=a53_0xba0a,_0x3bd9ee=_0x25ec71['output']||'',_0x39681a=resolveOutputFormat(_0x25ec71['format'],_0x3bd9ee,_0x270886(0x1b5));let _0xcd99b7=typeof _0x25ec71[_0x270886(0x1d7)]===_0x270886(0x1b3)?_0x25ec71[_0x270886(0x1d7)]:parseInt(_0x25ec71[_0x270886(0x1d7)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x25ec71['limit']===undefined&&shouldUseLess(_0x39681a,_0x3bd9ee)&&(_0xcd99b7=Infinity),{'format':_0x39681a,'output':_0x3bd9ee,'limit':_0xcd99b7,'limitStructuredFormats':_0x25ec71[_0x270886(0x1c8)],'color':_0x25ec71[_0x270886(0x1a2)],'noColor':_0x25ec71[_0x270886(0x19f)]};}export function writeOutput(_0x34a486,_0x207f1d,_0x24397f){const _0x91b530=a53_0xba0a;return _0x207f1d?(writeFileSync(_0x207f1d,_0x34a486),console[_0x91b530(0x1da)]('Results\x20saved\x20to\x20'+_0x207f1d),Promise[_0x91b530(0x1c5)]()):shouldUseLess(_0x24397f||'','')?new Promise(_0x111513=>{const _0x358fde=_0x91b530,_0x5ab744=spawn(_0x358fde(0x1a3),['-FXRSn'],{'stdio':[_0x358fde(0x197),'inherit',_0x358fde(0x1b4)]});let _0x4af442=![];_0x5ab744['on'](_0x358fde(0x1da),()=>{!_0x4af442&&(_0x4af442=!![],console['log'](_0x34a486),_0x111513());}),_0x5ab744['on'](_0x358fde(0x1d9),()=>{!_0x4af442&&(_0x4af442=!![],_0x111513());}),_0x5ab744['on'](_0x358fde(0x1af),()=>{const _0x193843=_0x358fde;!_0x4af442&&_0x5ab744[_0x193843(0x1ad)]&&(_0x5ab744['stdin']['on'](_0x193843(0x1da),()=>{}),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1a7)](_0x34a486),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1b1)]());}),!_0x5ab744['stdin']&&(!_0x4af442&&(_0x4af442=!![],console[_0x358fde(0x199)](_0x34a486),_0x111513()));}):(console[_0x91b530(0x199)](_0x34a486),Promise[_0x91b530(0x1c5)]());}export async function handleSDKOutput(_0x5c03b2,_0x20ed62){const _0x420e46=a53_0xba0a,_0x30bf80=resolveOutputOptions(_0x20ed62),_0x1fcf40=await formatSDKOutput(_0x5c03b2,_0x30bf80);await writeOutput(_0x1fcf40,_0x30bf80[_0x420e46(0x1a8)]||undefined,_0x30bf80[_0x420e46(0x1dc)]);}export async function handleQueryOutput(_0x5350e2,_0x197656){const _0x1963d9=resolveOutputOptions(_0x197656),_0x302fe3=await formatQueryOutput(_0x5350e2,_0x1963d9);await writeOutput(_0x302fe3,_0x1963d9['output']||undefined,_0x1963d9['format']);}async function formatSingleObject(_0x1d11da,_0x487ea){const _0x26cdda=a53_0xba0a,{format:_0x31e2dd,color:_0x492b97,noColor:_0xfc2e3d}=_0x487ea,_0x973eed={'color':_0x492b97,'noColor':_0xfc2e3d};if(_0x31e2dd===_0x26cdda(0x19a)){if(shouldUseColor(_0x973eed))return colorizeJSON(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da,null,0x2);}else{if(_0x31e2dd===_0x26cdda(0x19d)){if(shouldUseColor(_0x973eed))return colorizeJSONCompact(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da);}else{if(_0x31e2dd===_0x26cdda(0x1a9))return Object[_0x26cdda(0x1c3)](_0x1d11da)[_0x26cdda(0x1c2)](([_0x4a874e,_0x15b2cd])=>_0x4a874e+'\x09'+_0x15b2cd)[_0x26cdda(0x1d6)]('\x0a');else{const _0x119f6c=Object[_0x26cdda(0x1c3)](_0x1d11da);if(_0x119f6c['length']===0x0)return _0x26cdda(0x194);const _0x1a9d24=_0x1d11da[_0x26cdda(0x1bd)],_0x44c78c=_0x1d11da[_0x26cdda(0x1bb)],_0xec360f=_0x1d11da[_0x26cdda(0x1dd)],_0x58b278=_0x1d11da[_0x26cdda(0x1cf)],_0x479c58=_0x44c78c?typeof _0x44c78c===_0x26cdda(0x1b2)?_0x44c78c:JSON[_0x26cdda(0x1a6)](_0x44c78c,null,0x2):undefined,_0x521dcc=_0xec360f&&Object[_0x26cdda(0x1be)](_0xec360f)['length']>0x0?JSON[_0x26cdda(0x1a6)](_0xec360f,null,0x2):undefined,_0x1c50c5=_0x58b278&&Object[_0x26cdda(0x1be)](_0x58b278)[_0x26cdda(0x1b7)]>0x0?JSON['stringify'](_0x58b278,null,0x2):undefined,_0x1b4197=_0x119f6c[_0x26cdda(0x1a5)](([_0x2f25fd])=>_0x2f25fd!==_0x26cdda(0x1bd)&&_0x2f25fd!==_0x26cdda(0x1bb)&&_0x2f25fd!==_0x26cdda(0x1dd)&&_0x2f25fd!==_0x26cdda(0x1cf)),_0x39af61=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([_0x31a301])=>_0x31a301[_0x26cdda(0x1b7)])),_0x4fab91=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([,_0x3a49ee])=>{const _0x357676=_0x26cdda;try{const _0x15c039=_0x3a49ee===null||_0x3a49ee===undefined?'':typeof _0x3a49ee===_0x357676(0x1b6)?JSON['stringify'](_0x3a49ee):String(_0x3a49ee),_0x470f29=_0x15c039[_0x357676(0x1a1)]('\x0a');return Math['max'](..._0x470f29[_0x357676(0x1c2)](_0x51db4e=>_0x51db4e[_0x357676(0x1b7)]),0x0);}catch{return 0x0;}}),0x14),_0x8e1748=[];_0x8e1748[_0x26cdda(0x1cb)](colorBorder('┌─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1ce)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┐',_0x973eed)),_0x1b4197[_0x26cdda(0x1c4)](([_0x3f0934,_0x450c34])=>{const _0x276a4b=_0x26cdda;let _0x24be2f;try{_0x24be2f=_0x450c34===null||_0x450c34===undefined?'':typeof _0x450c34==='object'?JSON[_0x276a4b(0x1a6)](_0x450c34):String(_0x450c34);}catch{_0x24be2f=_0x276a4b(0x195);}const _0x2d00b1=_0x3f0934['padEnd'](_0x39af61),_0xa189fa=_0x24be2f[_0x276a4b(0x1a1)]('\x0a');_0xa189fa[_0x276a4b(0x1c4)]((_0x164b16,_0x6a569)=>{const _0x485f14=_0x276a4b,_0x16becd=colorBorder('│',_0x973eed);_0x6a569===0x0?_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+_0x2d00b1+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd):_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+'\x20'[_0x485f14(0x1ae)](_0x39af61)+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd);});}),_0x8e1748[_0x26cdda(0x1cb)](colorBorder('└─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1d1)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┘',_0x973eed));_0x479c58&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1aa)][_0x26cdda(0x1a0)]('[query]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x479c58));_0x521dcc&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7['blue'][_0x26cdda(0x1a0)]('[params]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x521dcc));_0x1c50c5&&(_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7[_0x26cdda(0x1c7)][_0x26cdda(0x1a0)](_0x26cdda(0x193)))),_0x8e1748[_0x26cdda(0x1cb)](_0x1c50c5));if(_0x1a9d24){if(_0x1a9d24[_0x26cdda(0x1c9)]){_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7['red'][_0x26cdda(0x1a0)]('[error]')));const _0x3b043e=_0x1a9d24[_0x26cdda(0x1c9)][_0x26cdda(0x1a1)]('\x0a');_0x3b043e['forEach'](_0x19477b=>{const _0x1219f0=_0x26cdda;_0x19477b[_0x1219f0(0x198)]()&&_0x8e1748[_0x1219f0(0x1cb)](_0x19477b);});}if(_0x1a9d24['cmdout']){_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1cc)][_0x26cdda(0x1a0)](_0x26cdda(0x1cd))));const _0x3a4c10=_0x1a9d24['cmdout'][_0x26cdda(0x1a1)]('\x0a');_0x3a4c10[_0x26cdda(0x1c4)](_0x27903b=>{const _0x12dca3=_0x26cdda;_0x27903b['trim']()&&_0x8e1748[_0x12dca3(0x1cb)](_0x27903b);});}}return _0x8e1748[_0x26cdda(0x1d6)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x139137,_0x22541f){const _0x5477ea=a53_0xba0a;if(_0x22541f[_0x5477ea(0x1dc)]==='table'){await handleSDKOutput([_0x139137],_0x22541f);return;}const _0x195b11=resolveOutputOptions(_0x22541f),_0x41d90d=await formatSingleObject(_0x139137,_0x195b11);await writeOutput(_0x41d90d,_0x195b11[_0x5477ea(0x1a8)]||undefined,_0x195b11[_0x5477ea(0x1dc)]);}
1
+ (function(_0x30d930,_0x49ba96){const _0x336496=a53_0x535c,_0x20b20a=_0x30d930();while(!![]){try{const _0x3c01e2=-parseInt(_0x336496(0x1b4))/0x1*(-parseInt(_0x336496(0x1a6))/0x2)+parseInt(_0x336496(0x19e))/0x3*(parseInt(_0x336496(0x1d3))/0x4)+-parseInt(_0x336496(0x1d9))/0x5+parseInt(_0x336496(0x1d0))/0x6+parseInt(_0x336496(0x19f))/0x7*(parseInt(_0x336496(0x19a))/0x8)+-parseInt(_0x336496(0x1c3))/0x9*(parseInt(_0x336496(0x1db))/0xa)+-parseInt(_0x336496(0x1a4))/0xb;if(_0x3c01e2===_0x49ba96)break;else _0x20b20a['push'](_0x20b20a['shift']());}catch(_0x2ad257){_0x20b20a['push'](_0x20b20a['shift']());}}}(a53_0x7ae9,0xe45f8));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a53_0x535c(_0x238bac,_0x434013){_0x238bac=_0x238bac-0x194;const _0x7ae9f8=a53_0x7ae9();let _0x535cc2=_0x7ae9f8[_0x238bac];return _0x535cc2;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x4f0159 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x55a439){const _0x443545=a53_0x535c;return _0x55a439[_0x443545(0x1b5)]===_0x443545(0x1cc)||_0x55a439[_0x443545(0x1b5)]==='jsonl'||_0x55a439[_0x443545(0x1b5)]===_0x443545(0x1c7)||_0x55a439['format']==='table'||_0x55a439[_0x443545(0x1cc)]===!![]||_0x55a439['jsonl']===!![]||_0x55a439[_0x443545(0x1c7)]===!![]||_0x55a439['table']===!![];}export function parseOutputOptions(_0x95c471){const _0x5dd887=a53_0x535c;return{'format':_0x95c471[_0x5dd887(0x1b5)]||_0x5dd887(0x1d6),'output':_0x95c471[_0x5dd887(0x19c)]||'','limit':_0x95c471[_0x5dd887(0x1a7)],'limitStructuredFormats':_0x95c471[_0x5dd887(0x1bf)],'color':_0x95c471[_0x5dd887(0x1a0)],'noColor':_0x95c471[_0x5dd887(0x1b6)]};}function convertSDKResultToQueryResult(_0xf5f741){const _0x412434=a53_0x535c,_0x2d0391=[];if(_0xf5f741[_0x412434(0x1a2)]>0x0){const _0xf776eb=_0xf5f741[0x0];for(const [_0x4618cd,_0x5d5304]of Object[_0x412434(0x1d5)](_0xf776eb)){let _0x24451b=_0x412434(0x1ce);if(typeof _0x5d5304===_0x412434(0x1c9))_0x24451b=Number[_0x412434(0x1dc)](_0x5d5304)?_0x412434(0x1da):_0x412434(0x1a8);else{if(typeof _0x5d5304===_0x412434(0x1c2))_0x24451b='boolean';else _0x5d5304===null&&(_0x24451b=_0x412434(0x1ce));}_0x2d0391[_0x412434(0x1a9)]({'name':_0x4618cd,'type':_0x24451b});}}return{'queryId':'sdk-result','columns':_0x2d0391,'data':_0xf5f741,'stats':{'state':_0x412434(0x1d7),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xf5f741[_0x412434(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x25b112,_0x1f499f){const _0x4240d1=convertSDKResultToQueryResult(_0x25b112);return formatQueryOutput(_0x4240d1,_0x1f499f);}export async function formatQueryOutput(_0xffb6,_0x133fbf){const _0x404ce0=a53_0x535c,{format:_0x3992b6,limit:_0x3fbbc4,output:_0x177d57,color:_0x4df624,noColor:_0x17132c,limitStructuredFormats:_0x41357e}=_0x133fbf,_0xa76d=Boolean(_0x177d57)&&!_0x4df624,_0x28d14e={'color':_0x4df624,'noColor':_0x17132c||_0xa76d};if(_0x3992b6===_0x404ce0(0x1d6)){const _0x1817ee=shouldUseLess(_0x3992b6,_0x177d57);return formatAsTable(_0xffb6,_0x3fbbc4,_0x1817ee,_0x28d14e);}const _0x4cec5d=_0x41357e&&Number[_0x404ce0(0x1a1)](_0x3fbbc4)&&_0xffb6[_0x404ce0(0x1cd)][_0x404ce0(0x1a2)]>_0x3fbbc4?{..._0xffb6,'data':_0xffb6[_0x404ce0(0x1cd)][_0x404ce0(0x1b1)](0x0,_0x3fbbc4)}:_0xffb6;if(_0x3992b6===_0x404ce0(0x1cc))return formatAsJSON(_0x4cec5d,_0x28d14e);else return _0x3992b6===_0x404ce0(0x1b7)?formatAsJSONL(_0x4cec5d,_0x28d14e):formatQueryResult(_0x4cec5d,_0x3992b6);}function shouldUseLess(_0x409a99,_0x4e9535){const _0x39c4b2=a53_0x535c;return(_0x409a99===_0x39c4b2(0x1d6)||_0x409a99==='list')&&process[_0x39c4b2(0x1b2)]['isTTY']&&!_0x4e9535;}export function resolveOutputOptions(_0x5906fc){const _0x2ec810=a53_0x535c,_0x304098=_0x5906fc[_0x2ec810(0x19c)]||'',_0x4d63be=resolveOutputFormat(_0x5906fc['format'],_0x304098,_0x2ec810(0x1d6));let _0x28b184=typeof _0x5906fc['limit']===_0x2ec810(0x1c9)?_0x5906fc[_0x2ec810(0x1a7)]:parseInt(_0x5906fc[_0x2ec810(0x1a7)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x5906fc[_0x2ec810(0x1a7)]===undefined&&shouldUseLess(_0x4d63be,_0x304098)&&(_0x28b184=Infinity),{'format':_0x4d63be,'output':_0x304098,'limit':_0x28b184,'limitStructuredFormats':_0x5906fc[_0x2ec810(0x1bf)],'color':_0x5906fc[_0x2ec810(0x1a0)],'noColor':_0x5906fc[_0x2ec810(0x1b6)]};}export function writeOutput(_0x595fb6,_0x1b09fb,_0x277038){const _0x4e3812=a53_0x535c;return _0x1b09fb?(writeFileSync(_0x1b09fb,_0x595fb6),console[_0x4e3812(0x1bd)]('Results\x20saved\x20to\x20'+_0x1b09fb),Promise[_0x4e3812(0x1cf)]()):shouldUseLess(_0x277038||'','')?new Promise(_0xcd09d3=>{const _0x3f8a93=_0x4e3812,_0x492cab=spawn(_0x3f8a93(0x1be),[_0x3f8a93(0x1b9)],{'stdio':[_0x3f8a93(0x196),_0x3f8a93(0x1c4),_0x3f8a93(0x1c4)]});let _0x463b4a=![];_0x492cab['on']('error',()=>{const _0x22066b=_0x3f8a93;!_0x463b4a&&(_0x463b4a=!![],console[_0x22066b(0x1ae)](_0x595fb6),_0xcd09d3());}),_0x492cab['on']('close',()=>{!_0x463b4a&&(_0x463b4a=!![],_0xcd09d3());}),_0x492cab['on']('spawn',()=>{const _0x1cb74b=_0x3f8a93;!_0x463b4a&&_0x492cab[_0x1cb74b(0x1a5)]&&(_0x492cab[_0x1cb74b(0x1a5)]['on'](_0x1cb74b(0x1bd),()=>{}),_0x492cab[_0x1cb74b(0x1a5)]['write'](_0x595fb6),_0x492cab[_0x1cb74b(0x1a5)][_0x1cb74b(0x198)]());}),!_0x492cab[_0x3f8a93(0x1a5)]&&(!_0x463b4a&&(_0x463b4a=!![],console['log'](_0x595fb6),_0xcd09d3()));}):(console[_0x4e3812(0x1ae)](_0x595fb6),Promise[_0x4e3812(0x1cf)]());}export async function handleSDKOutput(_0x3d8cf9,_0x2cff55){const _0x66c42f=a53_0x535c,_0xcc6e65=resolveOutputOptions(_0x2cff55),_0x52a136=await formatSDKOutput(_0x3d8cf9,_0xcc6e65);await writeOutput(_0x52a136,_0xcc6e65[_0x66c42f(0x19c)]||undefined,_0xcc6e65['format']);}export async function handleQueryOutput(_0x5f14b8,_0x2fa5ae){const _0x845f80=a53_0x535c,_0x5052d7=resolveOutputOptions(_0x2fa5ae),_0x1ac2a6=await formatQueryOutput(_0x5f14b8,_0x5052d7);await writeOutput(_0x1ac2a6,_0x5052d7[_0x845f80(0x19c)]||undefined,_0x5052d7['format']);}async function formatSingleObject(_0x2020b4,_0x2624fc){const _0x489af8=a53_0x535c,{format:_0x927bed,color:_0x45e81e,noColor:_0x5783fe}=_0x2624fc,_0x11ca88={'color':_0x45e81e,'noColor':_0x5783fe};if(_0x927bed===_0x489af8(0x1cc)){if(shouldUseColor(_0x11ca88))return colorizeJSON(_0x2020b4,_0x11ca88);return JSON[_0x489af8(0x1b0)](_0x2020b4,null,0x2);}else{if(_0x927bed===_0x489af8(0x1b7)){if(shouldUseColor(_0x11ca88))return colorizeJSONCompact(_0x2020b4,_0x11ca88);return JSON[_0x489af8(0x1b0)](_0x2020b4);}else{if(_0x927bed===_0x489af8(0x1c7))return Object['entries'](_0x2020b4)[_0x489af8(0x19d)](([_0x5eb7f8,_0x59326c])=>_0x5eb7f8+'\x09'+_0x59326c)[_0x489af8(0x1af)]('\x0a');else{const _0x46bcd6=Object['entries'](_0x2020b4);if(_0x46bcd6['length']===0x0)return'No\x20data';const _0x55819b=_0x2020b4[_0x489af8(0x1b8)],_0x51cf07=_0x2020b4[_0x489af8(0x1c1)],_0x1afd09=_0x2020b4[_0x489af8(0x1ab)],_0x4c1897=_0x2020b4[_0x489af8(0x1cb)],_0x3c1204=_0x51cf07?typeof _0x51cf07===_0x489af8(0x1ac)?_0x51cf07:JSON['stringify'](_0x51cf07,null,0x2):undefined,_0x222674=_0x1afd09&&Object['keys'](_0x1afd09)[_0x489af8(0x1a2)]>0x0?JSON[_0x489af8(0x1b0)](_0x1afd09,null,0x2):undefined,_0x10c318=_0x4c1897&&Object[_0x489af8(0x1d2)](_0x4c1897)[_0x489af8(0x1a2)]>0x0?JSON[_0x489af8(0x1b0)](_0x4c1897,null,0x2):undefined,_0x4462e0=_0x46bcd6[_0x489af8(0x1bc)](([_0x2a7071])=>_0x2a7071!==_0x489af8(0x1b8)&&_0x2a7071!==_0x489af8(0x1c1)&&_0x2a7071!==_0x489af8(0x1ab)&&_0x2a7071!==_0x489af8(0x1cb)),_0x2c518d=Math['max'](..._0x4462e0[_0x489af8(0x19d)](([_0x35c437])=>_0x35c437[_0x489af8(0x1a2)])),_0x32a29d=Math['max'](..._0x4462e0['map'](([,_0x359dc7])=>{const _0x202697=_0x489af8;try{const _0x284dd4=_0x359dc7===null||_0x359dc7===undefined?'':typeof _0x359dc7===_0x202697(0x1c5)?JSON[_0x202697(0x1b0)](_0x359dc7):String(_0x359dc7),_0x50b53a=_0x284dd4[_0x202697(0x1c8)]('\x0a');return Math[_0x202697(0x1c6)](..._0x50b53a['map'](_0x59876e=>_0x59876e['length']),0x0);}catch{return 0x0;}}),0x14),_0x223f65=[];_0x223f65[_0x489af8(0x1a9)](colorBorder('┌─'+'─'[_0x489af8(0x19b)](_0x2c518d)+_0x489af8(0x1bb)+'─'[_0x489af8(0x19b)](_0x32a29d)+'─┐',_0x11ca88)),_0x4462e0[_0x489af8(0x194)](([_0x5c2aae,_0x347800])=>{const _0x2fafa0=_0x489af8;let _0x43902a;try{_0x43902a=_0x347800===null||_0x347800===undefined?'':typeof _0x347800==='object'?JSON[_0x2fafa0(0x1b0)](_0x347800):String(_0x347800);}catch{_0x43902a=_0x2fafa0(0x1ba);}const _0x20b978=_0x5c2aae[_0x2fafa0(0x1c0)](_0x2c518d),_0x508da6=_0x43902a['split']('\x0a');_0x508da6[_0x2fafa0(0x194)]((_0x4f8749,_0x950074)=>{const _0x54370d=_0x2fafa0,_0x28cba1=colorBorder('│',_0x11ca88);_0x950074===0x0?_0x223f65['push'](_0x28cba1+'\x20'+_0x20b978+'\x20'+_0x28cba1+'\x20'+_0x4f8749[_0x54370d(0x1c0)](_0x32a29d)+'\x20'+_0x28cba1):_0x223f65[_0x54370d(0x1a9)](_0x28cba1+'\x20'+'\x20'[_0x54370d(0x19b)](_0x2c518d)+'\x20'+_0x28cba1+'\x20'+_0x4f8749['padEnd'](_0x32a29d)+'\x20'+_0x28cba1);});}),_0x223f65[_0x489af8(0x1a9)](colorBorder('└─'+'─'['repeat'](_0x2c518d)+'─┴─'+'─'[_0x489af8(0x19b)](_0x32a29d)+'─┘',_0x11ca88));_0x3c1204&&(_0x223f65[_0x489af8(0x1a9)](''),_0x223f65['push'](String(a53_0x4f0159['yellow'][_0x489af8(0x197)](_0x489af8(0x1d4)))),_0x223f65[_0x489af8(0x1a9)](_0x3c1204));_0x222674&&(_0x223f65[_0x489af8(0x1a9)](''),_0x223f65[_0x489af8(0x1a9)](String(a53_0x4f0159[_0x489af8(0x1ad)]['bold'](_0x489af8(0x195)))),_0x223f65[_0x489af8(0x1a9)](_0x222674));_0x10c318&&(_0x223f65[_0x489af8(0x1a9)](''),_0x223f65[_0x489af8(0x1a9)](String(a53_0x4f0159[_0x489af8(0x1aa)][_0x489af8(0x197)]('[rule]'))),_0x223f65['push'](_0x10c318));if(_0x55819b){if(_0x55819b[_0x489af8(0x199)]){_0x223f65[_0x489af8(0x1a9)](''),_0x223f65[_0x489af8(0x1a9)](String(a53_0x4f0159[_0x489af8(0x1d8)][_0x489af8(0x197)](_0x489af8(0x1ca))));const _0xa5af28=_0x55819b['stderr'][_0x489af8(0x1c8)]('\x0a');_0xa5af28[_0x489af8(0x194)](_0x252e3f=>{const _0x22a68d=_0x489af8;_0x252e3f['trim']()&&_0x223f65[_0x22a68d(0x1a9)](_0x252e3f);});}if(_0x55819b[_0x489af8(0x1a3)]){_0x223f65[_0x489af8(0x1a9)](''),_0x223f65[_0x489af8(0x1a9)](String(a53_0x4f0159[_0x489af8(0x1d1)][_0x489af8(0x197)](_0x489af8(0x1dd))));const _0x4a64ca=_0x55819b[_0x489af8(0x1a3)][_0x489af8(0x1c8)]('\x0a');_0x4a64ca[_0x489af8(0x194)](_0x51d598=>{const _0x2a9ee5=_0x489af8;_0x51d598[_0x2a9ee5(0x1b3)]()&&_0x223f65['push'](_0x51d598);});}}return _0x223f65[_0x489af8(0x1af)]('\x0a');}}}}function a53_0x7ae9(){const _0x3be924=['string','blue','log','join','stringify','slice','stdout','trim','16586nLILoe','format','noColor','jsonl','debug','-FXRSn','[Object]','─┬─','filter','error','less','limitStructuredFormats','padEnd','query','boolean','83979zwmJmR','inherit','object','max','tsv','split','number','[error]','rule','json','data','varchar','resolve','1451388lFIBMp','cyan','keys','2129272HhyOBb','[query]','entries','table','FINISHED','red','2155750ZcyZZB','bigint','70lBSSHK','isInteger','[logs]','forEach','[params]','pipe','bold','end','stderr','472aWMiew','repeat','output','map','6oWhlIO','12607sKTsOm','color','isFinite','length','cmdout','6722958GLMCrr','stdin','76zQLqQM','limit','double','push','magenta','params'];a53_0x7ae9=function(){return _0x3be924;};return a53_0x7ae9();}export async function handleSingleObjectOutput(_0x2116bc,_0x54bd7e){const _0x2d7f74=a53_0x535c;if(_0x54bd7e[_0x2d7f74(0x1b5)]===_0x2d7f74(0x1d6)){await handleSDKOutput([_0x2116bc],_0x54bd7e);return;}const _0x4bd0fc=resolveOutputOptions(_0x54bd7e),_0x400da0=await formatSingleObject(_0x2116bc,_0x4bd0fc);await writeOutput(_0x400da0,_0x4bd0fc[_0x2d7f74(0x19c)]||undefined,_0x4bd0fc[_0x2d7f74(0x1b5)]);}