@treasuredata/tdx 2026.3.35 → 2026.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a55_0x1e66bb=a55_0x2594;(function(_0x2a15e6,_0x5249a4){const _0x2449f1=a55_0x2594,_0x44618e=_0x2a15e6();while(!![]){try{const _0x4d7cb5=parseInt(_0x2449f1(0x27c))/0x1+parseInt(_0x2449f1(0x2fc))/0x2*(-parseInt(_0x2449f1(0x258))/0x3)+parseInt(_0x2449f1(0x292))/0x4+parseInt(_0x2449f1(0x1c9))/0x5*(-parseInt(_0x2449f1(0x2e0))/0x6)+-parseInt(_0x2449f1(0x226))/0x7+parseInt(_0x2449f1(0x32e))/0x8*(-parseInt(_0x2449f1(0x2b1))/0x9)+-parseInt(_0x2449f1(0x331))/0xa*(-parseInt(_0x2449f1(0x351))/0xb);if(_0x4d7cb5===_0x5249a4)break;else _0x44618e['push'](_0x44618e['shift']());}catch(_0x427c6b){_0x44618e['push'](_0x44618e['shift']());}}}(a55_0x453e,0xecd1f));import a55_0x4b0078 from'chalk';import{existsSync}from'fs';import a55_0x596494 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 a55_0x264e0e from'prompts';function getAttemptStatusDisplay(_0x18631e){const _0x47b87d=a55_0x2594;if(!_0x18631e)return{'icon':'⏳','text':''};const {done:_0x33b5df,success:_0x556c67,cancelRequested:_0x5d51be}=_0x18631e;if(!_0x33b5df)return _0x5d51be?{'icon':'🛑','text':a55_0x4b0078[_0x47b87d(0x26e)](_0x47b87d(0x2a8))}:{'icon':'🔄','text':a55_0x4b0078[_0x47b87d(0x340)](_0x47b87d(0x2e1))};if(_0x556c67)return{'icon':'✅','text':a55_0x4b0078['green'](_0x47b87d(0x2bb))};return{'icon':'❌','text':a55_0x4b0078[_0x47b87d(0x1bf)](_0x47b87d(0x26a))};}export class WorkflowBaseCommand extends BaseCommand{[a55_0x1e66bb(0x200)](_0x4eb964,_0x381e68,_0x452846=0x0){const _0x527750=a55_0x1e66bb;return _0x4eb964[_0x452846]||_0x381e68[_0x527750(0x1fe)];}[a55_0x1e66bb(0x254)](_0x235818,_0x57db21,_0x12cd24=0x0){const _0x2c28a1=a55_0x1e66bb,_0x3283ad=this[_0x2c28a1(0x200)](_0x235818,_0x57db21,_0x12cd24);if(!_0x3283ad)return console[_0x2c28a1(0x26a)](a55_0x4b0078[_0x2c28a1(0x1bf)](_0x2c28a1(0x290)),_0x2c28a1(0x276)),console['error'](a55_0x4b0078[_0x2c28a1(0x35c)](_0x2c28a1(0x245))),null;return _0x3283ad;}[a55_0x1e66bb(0x22b)](_0x2a527e,_0x4dc025){const _0x1c11ab=a55_0x1e66bb;if(_0x2a527e[0x0]){const _0x52eceb=_0x2a527e[0x0][_0x1c11ab(0x1bc)]('.');if(_0x52eceb[_0x1c11ab(0x2b4)]===0x1)return{'projectName':_0x52eceb[0x0],'workflowName':undefined};else return _0x52eceb[_0x1c11ab(0x2b4)]===0x2?{'projectName':_0x52eceb[0x0],'workflowName':_0x52eceb[0x1]}:(console[_0x1c11ab(0x26a)](a55_0x4b0078[_0x1c11ab(0x1bf)](_0x1c11ab(0x290)),_0x1c11ab(0x1c5)),null);}return{'projectName':_0x4dc025[_0x1c11ab(0x1fe)],'workflowName':undefined};}[a55_0x1e66bb(0x347)](_0xa4fbe1,_0x4c14ab,_0x5e53a4=0x0){const _0x504833=a55_0x1e66bb;if(_0xa4fbe1[_0x5e53a4])return _0xa4fbe1[_0x5e53a4];if(_0x4c14ab[_0x504833(0x1fe)]){const _0x207208=a55_0x596494['join'](process[_0x504833(0x203)](),_0x504833(0x252),_0x4c14ab['workflowProject']);if(existsSync(a55_0x596494['join'](_0x207208,_0x504833(0x291))))return _0x207208;}return undefined;}async[a55_0x1e66bb(0x33f)](_0x76bfca,_0x2901e7,_0x32452e){const _0x379d38=a55_0x1e66bb;try{const _0x2cf3fe=await _0x76bfca[_0x379d38(0x2a5)][_0x379d38(0x252)](_0x2901e7,{'limit':0x1});if(_0x2cf3fe[_0x379d38(0x2b4)]>0x0){const _0x121ce1=_0x2cf3fe[0x0]['id'],_0x34c974=getWorkflowUrl(_0x32452e,_0x121ce1);console[_0x379d38(0x26a)](_0x379d38(0x1d8)+a55_0x4b0078['cyan'](_0x34c974));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x28c);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x2f4);async[a55_0x1e66bb(0x2a0)](_0x33ba88){const _0x17f1ef=a55_0x1e66bb,{options:_0x1a5fec,args:_0x244b6a,tdx:_0x45ae02}=_0x33ba88,_0x55f228=_0x244b6a[0x0],_0x194c9a=_0x1a5fec['clear'];if(_0x194c9a)return saveSessionContext({'workflow_project':undefined},_0x1a5fec[_0x17f1ef(0x1f0)]),console[_0x17f1ef(0x289)](a55_0x4b0078['green'](_0x17f1ef(0x2aa))),0x0;if(!_0x55f228)return console[_0x17f1ef(0x26a)](a55_0x4b0078[_0x17f1ef(0x1bf)](_0x17f1ef(0x290)),'Project\x20name\x20is\x20required'),console['error'](a55_0x4b0078[_0x17f1ef(0x35c)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x17f1ef(0x26a)](a55_0x4b0078['dim'](_0x17f1ef(0x28d))),0x1;const _0xfcaa4a=await withSpinner(_0x17f1ef(0x2a1)+_0x55f228+_0x17f1ef(0x24f),()=>_0x45ae02['workflow'][_0x17f1ef(0x2e7)](_0x55f228),{'verbose':_0x1a5fec[_0x17f1ef(0x328)]}),{name:_0x2d04eb}=_0xfcaa4a[_0x17f1ef(0x1cd)];return saveSessionContext({'workflow_project':_0x2d04eb},_0x1a5fec[_0x17f1ef(0x1f0)]),console['log'](a55_0x4b0078[_0x17f1ef(0x357)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a55_0x4b0078[_0x17f1ef(0x2ed)](_0x2d04eb))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x242);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x34d);async['execute'](_0x37cea3){const _0x21f003=a55_0x1e66bb,{options:_0x3918df,args:_0x30b0ad,tdx:_0x178a13}=_0x37cea3,_0x2f7c30=_0x30b0ad[0x0];_0x3918df[_0x21f003(0x328)]&&_0x2f7c30&&console[_0x21f003(0x26a)]('Pattern:\x20'+_0x2f7c30);const _0x528b95=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x178a13['workflow'][_0x21f003(0x1dc)](_0x2f7c30,{'limit':_0x3918df[_0x21f003(0x2e8)]}),{'verbose':_0x3918df[_0x21f003(0x328)]});let _0x54d2bf=_0x528b95[_0x21f003(0x1cd)];_0x54d2bf[_0x21f003(0x311)]((_0x59d221,_0x6b396e)=>_0x59d221[_0x21f003(0x293)]['localeCompare'](_0x6b396e[_0x21f003(0x293)]));const _0xe20614=_0x3918df[_0x21f003(0x2e8)]||0x64,_0x3d148e=_0x54d2bf[_0x21f003(0x2b4)]>=_0xe20614?a55_0x4b0078[_0x21f003(0x35c)](_0x21f003(0x25e)):'';console[_0x21f003(0x26a)](_0x21f003(0x244)+_0x54d2bf['length']+_0x21f003(0x1bd)+(_0x54d2bf[_0x21f003(0x2b4)]!==0x1?'s':'')+_0x3d148e);if(_0x3918df[_0x21f003(0x1de)]==='json'||_0x3918df['format']===_0x21f003(0x32a)||_0x3918df[_0x21f003(0x1de)]===_0x21f003(0x2d0))await handleSDKOutput(_0x54d2bf,_0x3918df);else{if(_0x54d2bf['length']===0x0)_0x2f7c30?console[_0x21f003(0x289)](_0x21f003(0x307)+_0x2f7c30):console[_0x21f003(0x289)](_0x21f003(0x259));else{const _0x5206e6=_0x54d2bf[_0x21f003(0x23e)](_0x421a52=>{const _0x3355ae=_0x21f003,_0x265363=_0x421a52['metadata']?.[_0x3355ae(0x1fc)](_0x3e7e5a=>_0x3e7e5a['key']===_0x3355ae(0x28b)),_0x455b92=_0x265363?a55_0x4b0078[_0x3355ae(0x35c)](_0x3355ae(0x34a)):'';return _0x3355ae(0x364)+_0x421a52[_0x3355ae(0x293)]+_0x455b92;});await writeOutput(_0x5206e6[_0x21f003(0x2ff)]('\x0a'),_0x3918df[_0x21f003(0x30c)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a55_0x1e66bb(0x248);['description']=a55_0x1e66bb(0x343);async[a55_0x1e66bb(0x2a0)](_0x1019a1){const _0x3e2437=a55_0x1e66bb,{options:_0x498fd5,args:_0x43a7cb,tdx:_0x3d868e}=_0x1019a1,_0x24125f=this[_0x3e2437(0x200)](_0x43a7cb,_0x498fd5);_0x498fd5['verbose']&&_0x24125f&&console[_0x3e2437(0x26a)]('Project\x20filter:\x20'+_0x24125f);const _0x1574d8=await withSpinner('Listing\x20workflows...',()=>_0x3d868e['workflow']['workflows'](_0x24125f,{'limit':_0x498fd5[_0x3e2437(0x2e8)]}),{'verbose':_0x498fd5[_0x3e2437(0x328)]});let _0x4bf020=_0x1574d8[_0x3e2437(0x1cd)];_0x4bf020[_0x3e2437(0x311)]((_0x49f1ff,_0x2950a4)=>{const _0x343367=_0x3e2437,_0x188561=_0x49f1ff[_0x343367(0x293)][_0x343367(0x257)](_0x2950a4['name']);if(_0x188561!==0x0)return _0x188561;return(_0x49f1ff[_0x343367(0x1db)]?.[_0x343367(0x293)]||'')[_0x343367(0x257)](_0x2950a4['project']?.[_0x343367(0x293)]||'');});const _0x48253d=_0x498fd5['limit']||0x64,_0x3a6e63=_0x4bf020[_0x3e2437(0x2b4)]>=_0x48253d?a55_0x4b0078['dim'](_0x3e2437(0x25e)):'';console[_0x3e2437(0x26a)]('✔\x20Found\x20'+_0x4bf020[_0x3e2437(0x2b4)]+_0x3e2437(0x2e3)+(_0x4bf020[_0x3e2437(0x2b4)]!==0x1?'s':'')+_0x3a6e63);if(_0x498fd5[_0x3e2437(0x1de)]===_0x3e2437(0x247)||_0x498fd5[_0x3e2437(0x1de)]==='jsonl'||_0x498fd5[_0x3e2437(0x1de)]===_0x3e2437(0x2d0))await handleSDKOutput(_0x4bf020,_0x498fd5);else{if(_0x4bf020[_0x3e2437(0x2b4)]===0x0)_0x24125f?console[_0x3e2437(0x289)](_0x3e2437(0x33a)+_0x24125f):console[_0x3e2437(0x289)](_0x3e2437(0x335));else{const _0x4b57ae=_0x498fd5['site'],_0x4047ab=_0x4bf020[_0x3e2437(0x23e)](_0x1d75a1=>{const _0x1fd8ec=_0x3e2437,_0x5c238f=a55_0x4b0078['dim']('#'+_0x1d75a1['id']),_0x198235=hyperlink(_0x5c238f,getWorkflowUrl(_0x4b57ae,_0x1d75a1['id'])),_0x13f4ee=_0x1d75a1[_0x1fd8ec(0x1db)]?.[_0x1fd8ec(0x293)]?a55_0x4b0078[_0x1fd8ec(0x35c)]('\x20('+_0x1d75a1['project']['name']+')'):'';return _0x1fd8ec(0x249)+_0x198235+'\x20'+_0x1d75a1[_0x1fd8ec(0x293)]+_0x13f4ee;});await writeOutput(_0x4047ab[_0x3e2437(0x2ff)]('\x0a'),_0x498fd5[_0x3e2437(0x30c)],_0x3e2437(0x362));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x23d);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x204);async[a55_0x1e66bb(0x2a0)](_0x37f539){const _0x38bc61=a55_0x1e66bb,{options:_0x1a99c3,args:_0x3a0222,tdx:_0x5d4184}=_0x37f539,_0x29ede1=this[_0x38bc61(0x22b)](_0x3a0222,_0x1a99c3);if(!_0x29ede1)return 0x1;const {projectName:_0x4b3312,workflowName:_0x524778}=_0x29ede1;if(_0x1a99c3[_0x38bc61(0x328)]){if(_0x4b3312&&_0x524778)console[_0x38bc61(0x26a)]('Filter:\x20'+_0x4b3312+'.'+_0x524778);else _0x4b3312&&console['error'](_0x38bc61(0x1ca)+_0x4b3312);const _0x124d85=_0x1a99c3[_0x38bc61(0x2c4)];_0x124d85&&console[_0x38bc61(0x26a)]('Status:\x20'+_0x124d85);}let _0x3d2094=0x28;if(process[_0x38bc61(0x256)][_0x38bc61(0x24a)]&&!_0x1a99c3[_0x38bc61(0x30c)]&&!_0x1a99c3[_0x38bc61(0x1de)]){const _0x10aa59=process[_0x38bc61(0x256)][_0x38bc61(0x306)]||0x28;_0x3d2094=Math[_0x38bc61(0x1c2)](0x14,Math[_0x38bc61(0x309)](_0x10aa59*0x2/0x3));}const _0x257690=_0x1a99c3[_0x38bc61(0x2e8)]||_0x3d2094,_0x2a42a6=await withSpinner(_0x38bc61(0x2ef),()=>_0x5d4184[_0x38bc61(0x2a5)][_0x38bc61(0x20f)]({'projectName':_0x4b3312,'workflowName':_0x524778,'status':_0x1a99c3[_0x38bc61(0x2c4)],'fromTime':_0x1a99c3[_0x38bc61(0x2ce)],'toTime':_0x1a99c3['to'],'limit':_0x257690}),{'verbose':_0x1a99c3[_0x38bc61(0x328)]}),_0x482e0d=_0x2a42a6[_0x38bc61(0x1cd)];_0x482e0d[_0x38bc61(0x311)]((_0x1adbb7,_0x4f4cd2)=>{const _0x28d6d6=_0x38bc61,_0x82160a=_0x1adbb7[_0x28d6d6(0x360)]||'',_0x2ca76c=_0x4f4cd2[_0x28d6d6(0x360)]||'';return _0x2ca76c['localeCompare'](_0x82160a);});_0x482e0d[_0x38bc61(0x2b4)]>=_0x257690?console['error'](_0x38bc61(0x2fd)+_0x482e0d[_0x38bc61(0x2b4)]+_0x38bc61(0x36c)+a55_0x4b0078['dim'](_0x38bc61(0x1ea))):console['error'](_0x38bc61(0x244)+_0x482e0d[_0x38bc61(0x2b4)]+_0x38bc61(0x2e4)+(_0x482e0d[_0x38bc61(0x2b4)]!==0x1?'s':''));if(_0x1a99c3[_0x38bc61(0x1de)]===_0x38bc61(0x247)||_0x1a99c3[_0x38bc61(0x1de)]===_0x38bc61(0x32a)||_0x1a99c3['format']===_0x38bc61(0x2d0))await handleSDKOutput(_0x482e0d,_0x1a99c3);else{if(!process[_0x38bc61(0x256)]['isTTY']||_0x1a99c3[_0x38bc61(0x30c)]){if(_0x482e0d[_0x38bc61(0x2b4)]===0x0){if(_0x4b3312&&_0x524778)console[_0x38bc61(0x289)](_0x38bc61(0x264)+_0x4b3312+'.'+_0x524778);else _0x4b3312?console[_0x38bc61(0x289)](_0x38bc61(0x28f)+_0x4b3312):console[_0x38bc61(0x289)](_0x38bc61(0x2c6));}else{const _0x4e9bf3=_0x1a99c3[_0x38bc61(0x319)],_0x45a546=this[_0x38bc61(0x34b)](_0x482e0d,_0x4e9bf3);_0x1a99c3[_0x38bc61(0x30c)]?await writeOutput(_0x45a546,_0x1a99c3[_0x38bc61(0x30c)],'list'):console[_0x38bc61(0x289)](_0x45a546);}!_0x4b3312&&(console[_0x38bc61(0x26a)](''),console[_0x38bc61(0x26a)](a55_0x4b0078[_0x38bc61(0x35c)](_0x38bc61(0x206))),console['error'](a55_0x4b0078[_0x38bc61(0x35c)](_0x38bc61(0x270))+'or'+a55_0x4b0078[_0x38bc61(0x35c)](_0x38bc61(0x29c))));}else{if(_0x482e0d[_0x38bc61(0x2b4)]===0x0){if(_0x4b3312&&_0x524778)console['log'](_0x38bc61(0x264)+_0x4b3312+'.'+_0x524778);else _0x4b3312?console[_0x38bc61(0x289)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4b3312):console[_0x38bc61(0x289)](_0x38bc61(0x2c6));}else await this[_0x38bc61(0x219)](_0x482e0d,_0x37f539,_0x4b3312);}}return 0x0;}['renderSessionsTimeline'](_0x14a7a8,_0x37a0a0){const _0x151784=a55_0x1e66bb,_0x4184cf=[],_0x2ce742=new Map();let _0x105f15=Infinity,_0x1ce3af=-Infinity;for(const _0x56b507 of _0x14a7a8){if(_0x56b507[_0x151784(0x1f8)]?.[_0x151784(0x269)]){const _0x47570d=new Date(_0x56b507[_0x151784(0x1f8)][_0x151784(0x269)])[_0x151784(0x1fa)](),_0x498a63=_0x56b507['lastAttempt'][_0x151784(0x1d0)]?new Date(_0x56b507[_0x151784(0x1f8)][_0x151784(0x1d0)])[_0x151784(0x1fa)]():Date[_0x151784(0x33c)](),_0x5059c3=_0x56b507['project']?.['name']||_0x151784(0x1c4);!_0x2ce742['has'](_0x5059c3)&&_0x2ce742[_0x151784(0x35d)](_0x5059c3,[]),_0x2ce742['get'](_0x5059c3)['push']({'session':_0x56b507,'startTime':_0x47570d,'endTime':_0x498a63,'duration':_0x498a63-_0x47570d}),_0x105f15=Math['min'](_0x105f15,_0x47570d),_0x1ce3af=Math[_0x151784(0x1c2)](_0x1ce3af,_0x498a63);}}if(_0x2ce742['size']===0x0)return _0x151784(0x1e9);const _0x1fc9d7=process[_0x151784(0x256)][_0x151784(0x232)]||0x78,_0x21146a=0x1e,_0x190e15=0x32,_0x3d0e1d=0x4,_0x5cd4e4=Math['min'](_0x190e15,Math[_0x151784(0x1c2)](_0x21146a,Math[_0x151784(0x309)](_0x1fc9d7*0.3))),_0x1f3834=_0x1fc9d7-_0x5cd4e4-TIMELINE_CONFIG[_0x151784(0x2e5)]-0x3-_0x3d0e1d,_0x3447d2=_0x1ce3af-_0x105f15,_0xd8f5c4=_0x3447d2/_0x5cd4e4,_0xf0e6d3=renderTimeAxis({'startTime':_0x105f15,'endTime':_0x1ce3af,'durationMs':_0x3447d2,'msPerChar':_0xd8f5c4},_0x5cd4e4),_0x50eae0=[];for(const _0x144c80 of _0x2ce742[_0x151784(0x23b)]()){_0x50eae0['push'](..._0x144c80);}_0x50eae0[_0x151784(0x311)]((_0x304984,_0x4acf5a)=>_0x4acf5a[_0x151784(0x239)]-_0x304984[_0x151784(0x239)]);const _0x5ce631=new Date(_0x105f15),_0x3f9da0=formatDate(_0x5ce631),_0x5ecc85=_0x3d0e1d+TIMELINE_CONFIG[_0x151784(0x221)]+TIMELINE_CONFIG[_0x151784(0x1f1)]+_0x1f3834,_0x1993a7='\x20'['repeat'](_0x5ecc85-_0x3f9da0['length']),_0x1902e9=_0x1993a7+a55_0x4b0078[_0x151784(0x35c)](_0x3f9da0)+'\x20'+_0xf0e6d3;_0x4184cf[_0x151784(0x1d3)](_0x1902e9);const _0x12671e=0x16;let _0x41048c=0x0;for(const _0x4ed8a6 of _0x50eae0){const _0xb323dc=_0x4ed8a6[_0x151784(0x1f0)][_0x151784(0x1db)]?.[_0x151784(0x293)]||'?',_0x4977a3=Math[_0x151784(0x301)](stringWidth(_0xb323dc),_0x12671e);_0x41048c=Math[_0x151784(0x1c2)](_0x41048c,_0x4977a3);}for(const _0x55e9d9 of _0x50eae0){const {session:_0x1af2f7,startTime:_0x5e0233,endTime:_0x3e1eeb,duration:_0x4ee1f6}=_0x55e9d9,_0x2e8a97=_0x1af2f7[_0x151784(0x1db)]?.['id'],_0x2bf7e8=_0x1af2f7['id'],_0x126bba=_0x1af2f7[_0x151784(0x1db)]?.[_0x151784(0x293)]||'?',_0xf3562f=_0x1af2f7[_0x151784(0x2a5)]?.[_0x151784(0x293)]||'?';let _0x2762eb,_0x50dbd9;if(_0x1af2f7[_0x151784(0x1f8)]){const _0x3b910b=_0x1af2f7[_0x151784(0x1f8)];!_0x3b910b[_0x151784(0x341)]?(_0x2762eb=_0x3b910b[_0x151784(0x1e5)]?'🛑':'🔄',_0x50dbd9=_0x3b910b['cancelRequested']?a55_0x4b0078[_0x151784(0x26e)]:a55_0x4b0078[_0x151784(0x340)]):(_0x2762eb=_0x3b910b[_0x151784(0x2bb)]?'✅':'❌',_0x50dbd9=_0x3b910b['success']?a55_0x4b0078[_0x151784(0x357)]:a55_0x4b0078[_0x151784(0x1bf)]);}else _0x2762eb='⏳',_0x50dbd9=a55_0x4b0078[_0x151784(0x35c)];const _0x3a1fca='#'+_0x2bf7e8,_0x179a22=_0x2e8a97?hyperlink(_0x3a1fca,getWorkflowSessionUrl(_0x37a0a0,_0x2e8a97,_0x2bf7e8)):_0x3a1fca;let _0x3f7d79=_0x126bba;stringWidth(_0x126bba)>_0x12671e&&(_0x3f7d79=_0x126bba[_0x151784(0x1ce)](0x0,_0x12671e-0x1)+'…');const _0x30907f=a55_0x4b0078[_0x151784(0x35c)](_0x3f7d79),_0x7f3f1c=stringWidth(_0x3f7d79),_0x3a20b2='\x20'[_0x151784(0x20b)](_0x41048c-stringWidth(_0x3f7d79)+0x2),_0x57929c='('+formatElapsed(_0x4ee1f6)+')',_0x309a15=stringWidth(_0x57929c),_0xfbf79f=stringWidth(_0x3a1fca),_0x515ccc=_0xfbf79f+0x1+_0x7f3f1c+_0x3a20b2[_0x151784(0x2b4)],_0x14af50=_0x1f3834-_0x515ccc-_0x309a15-0x1-0x8;let _0x300da6=_0xf3562f;stringWidth(_0x300da6)>_0x14af50&&(_0x300da6=_0x300da6[_0x151784(0x1ce)](0x0,_0x14af50-0x1)+'…');const _0xc5395c=_0x179a22+'\x20'+_0x30907f+_0x3a20b2+_0x300da6,_0x5902a4=stringWidth(_0xc5395c),_0x521f34=_0x1f3834-_0x5902a4-_0x309a15,_0x3ea9b7=_0xc5395c+'\x20'[_0x151784(0x20b)](Math[_0x151784(0x1c2)](0x1,_0x521f34))+a55_0x4b0078[_0x151784(0x35c)](_0x57929c),_0xca6c9e=Math[_0x151784(0x309)]((_0x5e0233-_0x105f15)/_0xd8f5c4),_0x4c1cf9=Math[_0x151784(0x309)]((_0x3e1eeb-_0x105f15)/_0xd8f5c4),_0x5dd06d=Math['max'](_0xca6c9e+0x1,_0x4c1cf9),_0xc07ce7=new Array(_0x5cd4e4)['fill']('\x20');for(let _0x123203=_0xca6c9e;_0x123203<Math['min'](_0x5dd06d,_0x5cd4e4);_0x123203++){_0xc07ce7[_0x123203]='─';}const _0x1395a6=_0xc07ce7[_0x151784(0x23e)](_0x9af85d=>_0x9af85d==='\x20'?'\x20':_0x50dbd9(_0x9af85d))[_0x151784(0x2ff)]('');_0x4184cf[_0x151784(0x1d3)](_0x2762eb+'\x20'+_0x3ea9b7+'│'+_0x1395a6+'│');}return _0x4184cf[_0x151784(0x2ff)]('\x0a');}async[a55_0x1e66bb(0x219)](_0x384f3b,_0x591fe9,_0x5f31bd){const _0x2bdd60=a55_0x1e66bb,{options:_0x288198,tdx:_0x349c52}=_0x591fe9,_0x4a0af2=_0x288198[_0x2bdd60(0x319)],{timelineRows:_0x18df61,timeAxisHeader:_0x21ca58}=this[_0x2bdd60(0x1c0)](_0x384f3b,_0x4a0af2),_0x3d9708=_0x18df61['filter'](_0x38d4a9=>_0x38d4a9['attemptId']);if(_0x3d9708[_0x2bdd60(0x2b4)]===0x0){const _0x28cbc4=this['renderSessionsTimeline'](_0x384f3b,_0x4a0af2);console[_0x2bdd60(0x289)](_0x28cbc4);!_0x5f31bd&&(console['error'](''),console[_0x2bdd60(0x26a)](a55_0x4b0078[_0x2bdd60(0x35c)](_0x2bdd60(0x206))),console[_0x2bdd60(0x26a)](a55_0x4b0078[_0x2bdd60(0x35c)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a55_0x4b0078[_0x2bdd60(0x35c)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x21ca58&&console[_0x2bdd60(0x289)](_0x21ca58);const _0x41a30c=_0x18df61['filter'](_0x57ab11=>_0x57ab11[_0x2bdd60(0x1ec)])[_0x2bdd60(0x23e)](_0xda9f79=>({'title':_0xda9f79['displayLine'],'value':_0xda9f79[_0x2bdd60(0x1ec)]})),_0x13011d=process[_0x2bdd60(0x256)][_0x2bdd60(0x306)]||0x3c,_0x185d3c=Math[_0x2bdd60(0x1c2)](0x28,Math[_0x2bdd60(0x309)](_0x13011d*0x2/0x3)),_0x1e524e=await a55_0x264e0e({'type':_0x2bdd60(0x322),'name':_0x2bdd60(0x1ec),'message':_0x2bdd60(0x1e8),'choices':_0x41a30c,'initial':-0x1,'limit':_0x185d3c,'clearFirst':!![],'fallback':{'title':_0x2bdd60(0x342),'value':null},'suggest':(_0x335d63,_0x1f0d00)=>{const _0x422087=_0x2bdd60;if(!_0x335d63)return Promise[_0x422087(0x1cf)](_0x1f0d00);const _0x8cd4a1=_0x1f0d00[_0x422087(0x218)](_0x457ffb=>{const _0x4c7286=_0x422087,_0x469b72=_0x457ffb;return _0x469b72[_0x4c7286(0x1c3)][_0x4c7286(0x265)]()[_0x4c7286(0x210)](_0x335d63['toLowerCase']());});return Promise[_0x422087(0x1cf)](_0x8cd4a1);}}),_0x4a4494=()=>{const _0x2cc280=_0x2bdd60;process[_0x2cc280(0x256)][_0x2cc280(0x274)]('\x1b[1A\x1b[2K'),process['stdout']['write'](_0x2cc280(0x25c)),process['stdout']['write'](_0x2cc280(0x25c));},_0x2383aa=_0x1e524e&&_0x1e524e[_0x2bdd60(0x1ec)]&&_0x1e524e[_0x2bdd60(0x1ec)]!==null&&_0x1e524e[_0x2bdd60(0x1ec)][_0x2bdd60(0x23f)]()!=='';if(!_0x2383aa){_0x4a4494(),console['log'](a55_0x4b0078[_0x2bdd60(0x35c)](_0x2bdd60(0x2dd)));return;}_0x4a4494();const _0x422d01=_0x384f3b['find'](_0x48739b=>_0x48739b['lastAttempt']?.['id']===_0x1e524e['attemptId']);if(_0x422d01){const _0x318d11=_0x422d01[_0x2bdd60(0x1db)]?.[_0x2bdd60(0x293)]||'?',_0x53e82d=_0x422d01[_0x2bdd60(0x2a5)]?.[_0x2bdd60(0x293)]||'?';console[_0x2bdd60(0x289)](_0x2bdd60(0x2c2)+a55_0x4b0078[_0x2bdd60(0x35c)](_0x318d11)+_0x2bdd60(0x2b6)+a55_0x4b0078[_0x2bdd60(0x35c)](_0x53e82d));}const _0x436076=new WorkflowTimelineCommand();await _0x436076[_0x2bdd60(0x2a0)]({'args':[],'options':{..._0x288198,'attemptId':_0x1e524e['attemptId']},'tdx':_0x349c52});}[a55_0x1e66bb(0x1c0)](_0x39cdfb,_0x1ef637){const _0x54693b=a55_0x1e66bb,_0x321ed9=new Map();for(const _0x19fe66 of _0x39cdfb){_0x19fe66['id']&&_0x19fe66[_0x54693b(0x1f8)]?.['id']&&_0x321ed9[_0x54693b(0x35d)](_0x19fe66['id'],_0x19fe66[_0x54693b(0x1f8)]['id']);}const _0x4821aa=[];let _0xe43479='';const _0xe96b98=this[_0x54693b(0x34b)](_0x39cdfb,_0x1ef637),_0xe5b318=_0xe96b98[_0x54693b(0x1bc)]('\x0a');for(const _0x3c3bb2 of _0xe5b318){if(_0x3c3bb2[_0x54693b(0x32b)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x3c3bb2[_0x54693b(0x29f)](/^\s+\d{4}-\d{2}-\d{2}/))_0xe43479=_0x3c3bb2;else{if(_0x3c3bb2[_0x54693b(0x29f)](/^[✅❌🔄🛑⏳]/)){const _0x105c2e=_0x3c3bb2[_0x54693b(0x29f)](/#(\d+)/),_0x32c825=_0x105c2e?_0x105c2e[0x1]:null,_0x1c70c4=_0x32c825?_0x321ed9[_0x54693b(0x325)](_0x32c825)||null:null,_0x300ea2=_0x39cdfb[_0x54693b(0x1eb)](_0x1ef8c0=>_0x1ef8c0['id']===_0x32c825),_0x543f89=_0x300ea2?.[_0x54693b(0x1db)]?.[_0x54693b(0x293)]||'';_0x4821aa['push']({'displayLine':_0x3c3bb2,'attemptId':_0x1c70c4,'projectName':_0x543f89});}}}return{'timelineRows':_0x4821aa,'timeAxisHeader':_0xe43479};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]='workflow:attempts';[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x315);async[a55_0x1e66bb(0x2a0)](_0x3915b5){const _0x13e995=a55_0x1e66bb,{options:_0x35a799,args:_0x46ddaa,tdx:_0x27d99b}=_0x3915b5,_0x18d5d2=this[_0x13e995(0x22b)](_0x46ddaa,_0x35a799);if(!_0x18d5d2)return 0x1;const {projectName:_0x49782b,workflowName:_0xf8d229}=_0x18d5d2,_0x4f1947=_0x35a799[_0x13e995(0x1f5)];if(_0x35a799['verbose']){if(_0x49782b&&_0xf8d229)console[_0x13e995(0x26a)]('Filter:\x20'+_0x49782b+'.'+_0xf8d229);else _0x49782b&&console[_0x13e995(0x26a)](_0x13e995(0x1ca)+_0x49782b);_0x4f1947&&console['error']('Include\x20retried:\x20yes');}const _0x26d75c=await withSpinner(_0x13e995(0x201),()=>_0x27d99b[_0x13e995(0x2a5)][_0x13e995(0x1e0)]({'projectName':_0x49782b,'workflowName':_0xf8d229,'includeRetried':_0x4f1947,'limit':_0x35a799['limit']}),{'verbose':_0x35a799['verbose']}),_0x4954ed=_0x26d75c[_0x13e995(0x1cd)],_0x3deafb=_0x35a799[_0x13e995(0x2e8)]||0x64,_0xb27853=_0x4954ed['length']>=_0x3deafb?a55_0x4b0078[_0x13e995(0x35c)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x13e995(0x244)+_0x4954ed[_0x13e995(0x2b4)]+_0x13e995(0x1e6)+(_0x4954ed[_0x13e995(0x2b4)]!==0x1?'s':'')+_0xb27853);if(_0x35a799[_0x13e995(0x1de)]===_0x13e995(0x247)||_0x35a799[_0x13e995(0x1de)]===_0x13e995(0x32a)||_0x35a799[_0x13e995(0x1de)]===_0x13e995(0x2d0))await handleSDKOutput(_0x4954ed,_0x35a799);else{if(_0x4954ed[_0x13e995(0x2b4)]===0x0){if(_0x49782b&&_0xf8d229)console[_0x13e995(0x289)](_0x13e995(0x215)+_0x49782b+'.'+_0xf8d229);else _0x49782b?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x49782b):console[_0x13e995(0x289)](_0x13e995(0x283));}else{const _0xdae507=_0x35a799[_0x13e995(0x319)],_0x217c83=_0x4954ed[_0x13e995(0x23e)](_0x25c31b=>{const _0x546107=_0x13e995,_0x1e483f=a55_0x4b0078[_0x546107(0x35c)]('#'+_0x25c31b['id']),_0x5f3aeb=_0x25c31b[_0x546107(0x1db)]?.['id'],_0x42ca65=_0x25c31b[_0x546107(0x2b2)]||_0x25c31b[_0x546107(0x25d)],_0x1c128f=_0x5f3aeb&&_0x42ca65?hyperlink(_0x1e483f,getWorkflowAttemptUrl(_0xdae507,_0x5f3aeb,_0x42ca65,_0x25c31b['id'])):_0x1e483f,{icon:_0x46dade,text:_0x4845ff}=getAttemptStatusDisplay(_0x25c31b),_0x23ebd5=(_0x25c31b[_0x546107(0x1db)]?.['name']||'?')+'.'+(_0x25c31b['workflow']?.[_0x546107(0x293)]||'?'),_0x4bac06=_0x25c31b[_0x546107(0x360)]?a55_0x4b0078[_0x546107(0x35c)](_0x25c31b[_0x546107(0x360)]):'';return(_0x1c128f+'\x20'+_0x46dade+(_0x4845ff?'\x20'+_0x4845ff:'')+'\x20'+_0x23ebd5+'\x20'+_0x4bac06)[_0x546107(0x35a)]();});await writeOutput(_0x217c83['join']('\x0a'),_0x35a799[_0x13e995(0x30c)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a55_0x1e66bb(0x293)]='workflow:attempt';['description']=a55_0x1e66bb(0x286);async[a55_0x1e66bb(0x2a0)](_0x3ef5a9){const _0x1b35a5=a55_0x1e66bb,{options:_0x4cf516,args:_0x4792a7,tdx:_0x57d707}=_0x3ef5a9,_0x1eb3f3=_0x4792a7[0x0];if(!_0x1eb3f3)return console[_0x1b35a5(0x26a)](_0x1b35a5(0x359)),0x1;_0x4cf516['verbose']&&console['error']('Attempt\x20ID:\x20'+_0x1eb3f3);const _0x12d67f=await withSpinner(_0x1b35a5(0x365),()=>_0x57d707[_0x1b35a5(0x2a5)][_0x1b35a5(0x255)](_0x1eb3f3),{'verbose':_0x4cf516['verbose']}),_0x51add3=_0x12d67f[_0x1b35a5(0x1cd)];let _0x3748b6;!_0x51add3[_0x1b35a5(0x341)]?_0x3748b6=_0x51add3[_0x1b35a5(0x1e5)]?'canceling':_0x1b35a5(0x2e1):_0x3748b6=_0x51add3[_0x1b35a5(0x2bb)]?_0x1b35a5(0x2bb):_0x1b35a5(0x26a);let _0x2990ee;if(_0x51add3[_0x1b35a5(0x269)]&&_0x51add3[_0x1b35a5(0x1d0)]){const _0x2a5790=new Date(_0x51add3[_0x1b35a5(0x269)])[_0x1b35a5(0x1fa)](),_0x2f7880=new Date(_0x51add3['finishedAt'])[_0x1b35a5(0x1fa)]();_0x2990ee=Math[_0x1b35a5(0x334)]((_0x2f7880-_0x2a5790)/0x3e8);}const _0x3d516f={'attempt_id':_0x51add3['id'],'status':_0x3748b6,..._0x51add3[_0x1b35a5(0x352)]!==undefined&&{'index':_0x51add3['index']},..._0x51add3[_0x1b35a5(0x1db)]&&{'project':_0x51add3['project']['name']},..._0x51add3[_0x1b35a5(0x2a5)]&&{'workflow':_0x51add3['workflow'][_0x1b35a5(0x293)]},..._0x51add3[_0x1b35a5(0x25d)]&&{'session_id':_0x51add3[_0x1b35a5(0x25d)]},..._0x51add3[_0x1b35a5(0x360)]&&{'session_time':_0x51add3[_0x1b35a5(0x360)]},..._0x51add3[_0x1b35a5(0x344)]&&{'retry_attempt':_0x51add3[_0x1b35a5(0x344)]},..._0x2990ee!==undefined&&{'duration_sec':_0x2990ee},..._0x51add3['createdAt']&&{'created_at':_0x51add3['createdAt']},..._0x51add3[_0x1b35a5(0x1d0)]&&{'finished_at':_0x51add3[_0x1b35a5(0x1d0)]},...Object['keys'](_0x51add3[_0x1b35a5(0x33b)])[_0x1b35a5(0x2b4)]>0x0&&{'params':_0x51add3[_0x1b35a5(0x33b)]}};return await handleSingleObjectOutput(_0x3d516f,_0x4cf516),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']='workflow:tasks';[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x30b);async['execute'](_0xe67978){const _0x59089b=a55_0x1e66bb,{options:_0x89cfa0,args:_0x4301a8,tdx:_0x38ad8a}=_0xe67978,_0xc3d1c=_0x4301a8[0x0];if(!_0xc3d1c)return console['error'](_0x59089b(0x359)),0x1;const _0x35d379=_0x89cfa0[_0x59089b(0x211)];_0x89cfa0[_0x59089b(0x328)]&&(console[_0x59089b(0x26a)](_0x59089b(0x34f)+_0xc3d1c),_0x35d379&&console['error'](_0x59089b(0x2de)));const _0x303c10=await withSpinner(_0x59089b(0x29d),()=>_0x38ad8a[_0x59089b(0x2a5)][_0x59089b(0x2fa)](_0xc3d1c,_0x35d379||![]),{'verbose':_0x89cfa0['verbose']}),_0x3f6339=_0x303c10['data'];return console[_0x59089b(0x26a)](_0x59089b(0x244)+_0x3f6339[_0x59089b(0x2b4)]+_0x59089b(0x209)+(_0x3f6339[_0x59089b(0x2b4)]!==0x1?'s':'')),await handleSDKOutput(_0x3f6339,_0x89cfa0),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x1f9);['description']=a55_0x1e66bb(0x2ea);async[a55_0x1e66bb(0x2a0)](_0x57e68c){const _0x394d4e=a55_0x1e66bb,{options:_0x1eb5e2,args:_0x4b6d79,tdx:_0xdc6a02}=_0x57e68c,_0x3893ed=_0x4b6d79[0x0];let _0x49c43d=_0x4b6d79[0x1];if(!_0x3893ed)return console[_0x394d4e(0x26a)](_0x394d4e(0x359)),0x1;_0x1eb5e2[_0x394d4e(0x328)]&&(console[_0x394d4e(0x26a)](_0x394d4e(0x34f)+_0x3893ed),_0x49c43d&&console[_0x394d4e(0x26a)](_0x394d4e(0x234)+_0x49c43d));const _0x70a9b1=await withSpinner(_0x394d4e(0x350),()=>_0xdc6a02[_0x394d4e(0x2a5)]['logFiles'](_0x3893ed,_0x49c43d),{'verbose':_0x1eb5e2[_0x394d4e(0x328)]}),_0xa5939d=_0x70a9b1['data'];if(_0xa5939d[_0x394d4e(0x2b4)]===0x0)return console[_0x394d4e(0x26a)](_0x394d4e(0x2c9)),0x0;if(!_0x49c43d&&(_0x1eb5e2['json']||_0x1eb5e2['format']))return await handleSDKOutput(_0xa5939d,_0x1eb5e2),0x0;if(!_0x49c43d){const _0x18c4a3=_0xa5939d[_0x394d4e(0x23e)](_0x42dd52=>({'title':_0x42dd52[_0x394d4e(0x28e)]+'\x20('+formatBytes(_0x42dd52['fileSize'])+')','value':_0x42dd52[_0x394d4e(0x28e)]})),_0x48683e=await a55_0x264e0e({'type':_0x394d4e(0x29b),'name':_0x394d4e(0x31f),'message':_0x394d4e(0x2bf),'choices':_0x18c4a3});if(!_0x48683e['task'])return console[_0x394d4e(0x26a)]('Cancelled'),0x0;_0x49c43d=_0x48683e[_0x394d4e(0x31f)];}const _0x1a0a81=await withSpinner('Downloading\x20logs...',()=>_0xdc6a02[_0x394d4e(0x2a5)]['logs'](_0x3893ed,_0x49c43d),{'verbose':_0x1eb5e2['verbose']}),_0x7c58e6=_0x1a0a81['data'];return _0x7c58e6?console[_0x394d4e(0x289)](_0x7c58e6):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x2c8);['description']=a55_0x1e66bb(0x2f3);async['execute'](_0x5aab38){const _0xba11bf=a55_0x1e66bb,{options:_0x14baa8,args:_0x44180e,tdx:_0x1a442b}=_0x5aab38,_0x90418=_0x44180e[0x0];if(!_0x90418)return console[_0xba11bf(0x26a)](_0xba11bf(0x359)),0x1;const _0x51460a=_0x14baa8['reason'];_0x14baa8[_0xba11bf(0x328)]&&(console[_0xba11bf(0x26a)](_0xba11bf(0x34f)+_0x90418),_0x51460a&&console['error'](_0xba11bf(0x277)+_0x51460a));if(!_0x14baa8['yes']){if(!isInteractive())return console['error'](a55_0x4b0078[_0xba11bf(0x1bf)](_0xba11bf(0x261)),_0xba11bf(0x2d1)),console[_0xba11bf(0x26a)](a55_0x4b0078[_0xba11bf(0x35c)](_0xba11bf(0x2b0))),0x1;const _0x3ddc59=await confirmKey(_0xba11bf(0x2eb)+_0x90418+'?');if(!_0x3ddc59)return console['error'](a55_0x4b0078['yellow'](_0xba11bf(0x2dd))),0x1;}const _0x4e0292=await withSpinner(_0xba11bf(0x35f),()=>_0x1a442b[_0xba11bf(0x2a5)][_0xba11bf(0x296)](_0x90418,_0x51460a),{'verbose':_0x14baa8[_0xba11bf(0x328)]}),_0xb667ad=_0x4e0292['data'];return console[_0xba11bf(0x26a)]('✔\x20'+_0xb667ad),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a55_0x1e66bb(0x293)]='workflow:retry';[a55_0x1e66bb(0x2f7)]='Retry\x20a\x20session\x20or\x20attempt';async[a55_0x1e66bb(0x2a0)](_0x20b347){const _0x4fb56f=a55_0x1e66bb,{options:_0x4bc3ea,args:_0x47be2b,tdx:_0x3d54bc}=_0x20b347,_0x525bf7=_0x47be2b[0x0];if(!_0x525bf7)return console[_0x4fb56f(0x26a)](_0x4fb56f(0x1d4)),console[_0x4fb56f(0x26a)](_0x4fb56f(0x1f2)),0x1;let _0x2c2c63=![],_0x54be9a=_0x525bf7;if(_0x525bf7['startsWith']('session:'))_0x2c2c63=!![],_0x54be9a=_0x525bf7['substring'](0x8);else{if(_0x525bf7[_0x4fb56f(0x32b)]('attempt:'))_0x2c2c63=![],_0x54be9a=_0x525bf7[_0x4fb56f(0x363)](0x8);else return console[_0x4fb56f(0x26a)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x4fb56f(0x26a)](_0x4fb56f(0x1f2)),0x1;}const _0x71c72e=_0x4bc3ea[_0x4fb56f(0x36b)],_0x574eae=_0x4bc3ea[_0x4fb56f(0x26d)],_0xbc7aa1=_0x4bc3ea[_0x4fb56f(0x33b)],_0x4902ef=_0x4bc3ea['force'];_0x4bc3ea[_0x4fb56f(0x328)]&&(console[_0x4fb56f(0x26a)](_0x4fb56f(0x33d)+(_0x2c2c63?_0x4fb56f(0x1f0):_0x4fb56f(0x255))+'\x20'+_0x54be9a),_0x71c72e&&console['error']('From\x20task:\x20'+_0x71c72e),_0x574eae&&console[_0x4fb56f(0x26a)](_0x4fb56f(0x2ac)+_0x574eae),_0xbc7aa1&&console[_0x4fb56f(0x26a)](_0x4fb56f(0x323)+_0xbc7aa1),_0x4902ef&&console[_0x4fb56f(0x26a)](_0x4fb56f(0x21b)));let _0x5d930b;if(_0xbc7aa1)try{if(_0xbc7aa1[_0x4fb56f(0x32b)]('@')){const _0xc823fa=await import('fs/promises'),_0x134338=_0xbc7aa1[_0x4fb56f(0x363)](0x1),_0x4947d8=await _0xc823fa[_0x4fb56f(0x1ed)](_0x134338,_0x4fb56f(0x2c0));_0x5d930b=JSON[_0x4fb56f(0x2c1)](_0x4947d8);}else _0x5d930b=JSON[_0x4fb56f(0x2c1)](_0xbc7aa1);}catch{return console[_0x4fb56f(0x26a)](_0x4fb56f(0x20a)),0x1;}if(!_0x4bc3ea['yes']){if(!isInteractive())return console[_0x4fb56f(0x26a)](a55_0x4b0078['red'](_0x4fb56f(0x261)),_0x4fb56f(0x2d1)),console[_0x4fb56f(0x26a)](a55_0x4b0078[_0x4fb56f(0x35c)](_0x4fb56f(0x2b0))),0x1;const _0x52f676=await confirmKey(_0x4fb56f(0x2ab)+(_0x2c2c63?_0x4fb56f(0x1f0):'attempt')+'\x20'+_0x54be9a+'?');if(!_0x52f676)return console[_0x4fb56f(0x26a)](a55_0x4b0078[_0x4fb56f(0x26e)](_0x4fb56f(0x2dd))),0x1;}let _0x3e30c8;_0x2c2c63?_0x3e30c8=await withSpinner(_0x4fb56f(0x294),()=>_0x3d54bc[_0x4fb56f(0x2a5)][_0x4fb56f(0x225)](_0x54be9a,{'fromTask':_0x71c72e,'retryParams':_0x5d930b}),{'verbose':_0x4bc3ea['verbose']}):_0x3e30c8=await withSpinner('Retrying\x20attempt...',()=>_0x3d54bc[_0x4fb56f(0x2a5)][_0x4fb56f(0x30e)](_0x54be9a,{'resumeFrom':_0x574eae,'retryParams':_0x5d930b,'force':_0x4902ef}),{'verbose':_0x4bc3ea[_0x4fb56f(0x328)]});const _0x454909=_0x3e30c8[_0x4fb56f(0x1cd)];return console['error'](_0x4fb56f(0x2da)),console[_0x4fb56f(0x26a)](_0x4fb56f(0x2a2)+_0x454909[_0x4fb56f(0x1ec)]),console['error'](_0x4fb56f(0x27a)+_0x454909[_0x4fb56f(0x25d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a55_0x1e66bb(0x223);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x25f);async[a55_0x1e66bb(0x2a0)](_0x5f1c6e){const _0x2119ab=a55_0x1e66bb,{options:_0x4bf1d6,args:_0x8f37e2,tdx:_0x56f5e2}=_0x5f1c6e;let _0x31bf5b=_0x8f37e2[0x0];if(!_0x31bf5b){const _0x2e81b0=this[_0x2119ab(0x200)]([],_0x4bf1d6),_0x487b78=await withSpinner(_0x2119ab(0x355),()=>_0x56f5e2[_0x2119ab(0x2a5)][_0x2119ab(0x252)](_0x2e81b0,{'limit':_0x4bf1d6['limit']}),{'verbose':_0x4bf1d6['verbose']}),_0x586286=_0x487b78['data'];if(_0x586286[_0x2119ab(0x2b4)]===0x0)return console[_0x2119ab(0x26a)](_0x2119ab(0x335)),!_0x2e81b0&&console[_0x2119ab(0x26a)](a55_0x4b0078[_0x2119ab(0x35c)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x2f9cdf=_0x586286['map'](_0x4d8e26=>({'title':_0x4d8e26[_0x2119ab(0x1db)]?.[_0x2119ab(0x293)]+'.'+_0x4d8e26[_0x2119ab(0x293)],'value':_0x4d8e26[_0x2119ab(0x1db)]?.[_0x2119ab(0x293)]+'.'+_0x4d8e26['name'],'description':_0x4d8e26['revision']?'revision:\x20'+_0x4d8e26[_0x2119ab(0x2f1)]:undefined})),_0x5d40d7=await a55_0x264e0e({'type':'select','name':_0x2119ab(0x2a5),'message':_0x2119ab(0x1d1),'choices':_0x2f9cdf});if(!_0x5d40d7[_0x2119ab(0x2a5)])return 0x1;_0x31bf5b=_0x5d40d7[_0x2119ab(0x2a5)];}if(!_0x31bf5b[_0x2119ab(0x210)]('.')){const _0x39ff82=this['resolveProject']([],_0x4bf1d6);if(_0x39ff82)_0x31bf5b=_0x39ff82+'.'+_0x31bf5b;else return console[_0x2119ab(0x26a)](a55_0x4b0078[_0x2119ab(0x1bf)]('Error:'),_0x2119ab(0x285)),console['error'](a55_0x4b0078[_0x2119ab(0x35c)](_0x2119ab(0x245))),0x1;}const _0x39b34b=_0x4bf1d6[_0x2119ab(0x2cd)],_0x29670e=_0x4bf1d6[_0x2119ab(0x360)],_0x42c876={};if(_0x39b34b&&Array['isArray'](_0x39b34b))for(const _0x5536d6 of _0x39b34b){const _0x15e35a=_0x5536d6[_0x2119ab(0x2fb)]('=');if(_0x15e35a===-0x1)return console[_0x2119ab(0x26a)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x5536d6),console[_0x2119ab(0x26a)](_0x2119ab(0x330)),0x1;const _0x3adb42=_0x5536d6[_0x2119ab(0x363)](0x0,_0x15e35a),_0x348e51=_0x5536d6['substring'](_0x15e35a+0x1);try{_0x42c876[_0x3adb42]=JSON[_0x2119ab(0x2c1)](_0x348e51);}catch{_0x42c876[_0x3adb42]=_0x348e51;}}_0x4bf1d6[_0x2119ab(0x328)]&&(console[_0x2119ab(0x26a)](_0x2119ab(0x349)+_0x31bf5b),Object['keys'](_0x42c876)[_0x2119ab(0x2b4)]>0x0&&console[_0x2119ab(0x26a)](_0x2119ab(0x34e)+JSON[_0x2119ab(0x30a)](_0x42c876)),_0x29670e&&console[_0x2119ab(0x26a)](_0x2119ab(0x26c)+_0x29670e));const _0x2b80df=await withSpinner(_0x2119ab(0x217),()=>_0x56f5e2['workflow'][_0x2119ab(0x299)](_0x31bf5b,_0x42c876,{'sessionTime':_0x29670e}),{'verbose':_0x4bf1d6[_0x2119ab(0x328)]}),_0x30b3de=_0x2b80df[_0x2119ab(0x1cd)];console[_0x2119ab(0x26a)](_0x2119ab(0x31e)),console[_0x2119ab(0x26a)]('\x20\x20Attempt\x20ID:\x20'+_0x30b3de['id']),console['error'](_0x2119ab(0x27a)+_0x30b3de[_0x2119ab(0x25d)]),console['error'](_0x2119ab(0x21e)+_0x30b3de[_0x2119ab(0x1db)]?.['name']),console[_0x2119ab(0x26a)]('\x20\x20Workflow:\x20'+_0x30b3de[_0x2119ab(0x2a5)]?.[_0x2119ab(0x293)]);if(_0x30b3de['project']?.['id']&&_0x30b3de[_0x2119ab(0x25d)]&&_0x30b3de['id']){const _0x1742bb=_0x4bf1d6[_0x2119ab(0x319)],_0xed48c1=getConsoleUrl(_0x1742bb,'/app/workflows/'+_0x30b3de[_0x2119ab(0x1db)]['id']+_0x2119ab(0x243)+_0x30b3de['sessionId']+_0x2119ab(0x310)+_0x30b3de['id']);console[_0x2119ab(0x26a)](_0x2119ab(0x1d8)+a55_0x4b0078[_0x2119ab(0x2ed)](_0xed48c1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x28a);['description']=a55_0x1e66bb(0x2af);async[a55_0x1e66bb(0x2a0)](_0x5dc01f){const _0x3cd78b=a55_0x1e66bb,{options:_0x5a00d5,args:_0x588d53,tdx:_0x3453ed}=_0x5dc01f,_0x2b4693=_0x588d53[0x0],_0x500a7e=_0x588d53[0x1]||'.';if(!_0x2b4693)return console[_0x3cd78b(0x26a)](_0x3cd78b(0x237)),console[_0x3cd78b(0x26a)](_0x3cd78b(0x1fd)),0x1;const _0x33b599=_0x5a00d5[_0x3cd78b(0x2f1)];_0x5a00d5['verbose']&&(console[_0x3cd78b(0x26a)](_0x3cd78b(0x2c2)+_0x2b4693),console[_0x3cd78b(0x26a)](_0x3cd78b(0x2f0)+_0x500a7e),_0x33b599&&console[_0x3cd78b(0x26a)]('Revision:\x20'+_0x33b599));const _0x3bbff4=await withSpinner(_0x3cd78b(0x1d7)+_0x2b4693+'...',()=>_0x3453ed[_0x3cd78b(0x2a5)][_0x3cd78b(0x2b9)](_0x2b4693,_0x500a7e,{'revision':_0x33b599}),{'verbose':_0x5a00d5[_0x3cd78b(0x328)]}),_0x3d759c=_0x3bbff4[_0x3cd78b(0x1cd)];return console['error'](_0x3cd78b(0x298)+_0x3d759c[_0x3cd78b(0x1e7)]),console['error'](_0x3cd78b(0x22e)+_0x3d759c[_0x3cd78b(0x2f1)]),console[_0x3cd78b(0x26a)](_0x3cd78b(0x25a)+_0x3d759c[_0x3cd78b(0x24e)]),console[_0x3cd78b(0x26a)](_0x3cd78b(0x1dd)+_0x500a7e+'/'+_0x3d759c[_0x3cd78b(0x1e7)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x205);[a55_0x1e66bb(0x2f7)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a55_0x1e66bb(0x2a0)](_0x10d4c6){const _0x4fd448=a55_0x1e66bb,{options:_0x693b00,args:_0x2629d2,tdx:_0x2fd7c3}=_0x10d4c6;let _0x17f387='.',_0x5d09e0=_0x693b00[_0x4fd448(0x293)];if(_0x2629d2[0x0]){const {promises:_0x3d9e2e}=await import('fs');try{const _0x274125=await _0x3d9e2e[_0x4fd448(0x21c)](_0x2629d2[0x0]);if(_0x274125[_0x4fd448(0x332)]())_0x17f387=_0x2629d2[0x0];else return console['error'](_0x4fd448(0x27f)+_0x2629d2[0x0]+_0x4fd448(0x2bc)),0x1;}catch{_0x5d09e0=_0x2629d2[0x0],_0x17f387='.';}}const _0x38bd13=_0x693b00[_0x4fd448(0x2f1)],_0x51cbf2=_0x693b00[_0x4fd448(0x316)];_0x693b00[_0x4fd448(0x328)]&&(console[_0x4fd448(0x26a)]('Project\x20directory:\x20'+_0x17f387),_0x5d09e0&&console[_0x4fd448(0x26a)](_0x4fd448(0x2c5)+_0x5d09e0),_0x38bd13&&console[_0x4fd448(0x26a)](_0x4fd448(0x20c)+_0x38bd13),_0x51cbf2&&console[_0x4fd448(0x26a)](_0x4fd448(0x31c)));const _0x2486e3=await withSpinner(_0x4fd448(0x313),()=>_0x2fd7c3[_0x4fd448(0x2a5)][_0x4fd448(0x1d3)](_0x17f387,{'projectName':_0x5d09e0,'revision':_0x38bd13,'skipValidation':_0x51cbf2}),{'verbose':_0x693b00[_0x4fd448(0x328)]}),_0x126ce2=_0x2486e3[_0x4fd448(0x1cd)];return console[_0x4fd448(0x26a)](_0x4fd448(0x2b8)+_0x126ce2[_0x4fd448(0x1e7)]),console[_0x4fd448(0x26a)](_0x4fd448(0x2cc)+_0x126ce2[_0x4fd448(0x297)]),console[_0x4fd448(0x26a)](_0x4fd448(0x22e)+_0x126ce2[_0x4fd448(0x2f1)]),await this[_0x4fd448(0x33f)](_0x2fd7c3,_0x126ce2[_0x4fd448(0x1e7)],_0x693b00[_0x4fd448(0x319)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x366);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x314);async[a55_0x1e66bb(0x2a0)](_0x47eb0d){const _0x583ec4=a55_0x1e66bb,{options:_0x3bdf6d,args:_0x21e9e7,tdx:_0x4592bb}=_0x47eb0d,_0x105a71=_0x21e9e7[0x0],_0x114b46=_0x21e9e7[0x1];if(!_0x105a71)return console[_0x583ec4(0x26a)](a55_0x4b0078[_0x583ec4(0x1bf)](_0x583ec4(0x290)),_0x583ec4(0x276)),console[_0x583ec4(0x26a)](a55_0x4b0078['dim'](_0x583ec4(0x2a4))),0x1;const _0x2fd308=_0x3bdf6d[_0x583ec4(0x2f1)];_0x3bdf6d[_0x583ec4(0x328)]&&(console['error'](_0x583ec4(0x2c2)+_0x105a71),_0x114b46&&console[_0x583ec4(0x26a)]('Target\x20directory:\x20'+_0x114b46),_0x2fd308&&console[_0x583ec4(0x26a)](_0x583ec4(0x20c)+_0x2fd308),_0x3bdf6d[_0x583ec4(0x22f)]&&console[_0x583ec4(0x26a)](_0x583ec4(0x31d)));const _0x23d0f4=await withSpinner(_0x583ec4(0x251)+_0x105a71+_0x583ec4(0x2ae),()=>_0x4592bb['workflow']['pullProject'](_0x105a71,{'targetDir':_0x114b46,'revision':_0x2fd308}),{'verbose':_0x3bdf6d[_0x583ec4(0x328)]}),_0x451d3a=_0x23d0f4[_0x583ec4(0x1cd)];_0x451d3a[_0x583ec4(0x275)]?console[_0x583ec4(0x26a)](_0x583ec4(0x333)+_0x451d3a[_0x583ec4(0x1e7)]):console[_0x583ec4(0x26a)](_0x583ec4(0x29e)+_0x451d3a[_0x583ec4(0x1e7)]);console[_0x583ec4(0x26a)](_0x583ec4(0x22e)+_0x451d3a['revision']),console[_0x583ec4(0x26a)](_0x583ec4(0x236)+(a55_0x596494['relative'](process['cwd'](),_0x451d3a[_0x583ec4(0x1d6)])||'.')),console[_0x583ec4(0x26a)](_0x583ec4(0x213)+a55_0x4b0078[_0x583ec4(0x357)]('+'+_0x451d3a['summary']['new']+_0x583ec4(0x1ff))+',\x20'+(a55_0x4b0078[_0x583ec4(0x26e)]('~'+_0x451d3a[_0x583ec4(0x1e3)][_0x583ec4(0x2bd)]+'\x20modified')+',\x20')+(a55_0x4b0078[_0x583ec4(0x1bf)]('-'+_0x451d3a[_0x583ec4(0x1e3)][_0x583ec4(0x346)]+_0x583ec4(0x207))+',\x20')+(''+a55_0x4b0078[_0x583ec4(0x35c)](_0x451d3a[_0x583ec4(0x1e3)]['unchanged']+'\x20unchanged')));for(const _0x4c420c of _0x451d3a[_0x583ec4(0x33e)]){_0x4c420c[_0x583ec4(0x1cb)]===_0x583ec4(0x2bd)&&_0x4c420c['diff']&&(console[_0x583ec4(0x26a)]('\x0a'+a55_0x4b0078['cyan']('---\x20'+_0x4c420c[_0x583ec4(0x1ee)])),console[_0x583ec4(0x26a)](_0x4c420c[_0x583ec4(0x30d)]));}if(!_0x451d3a['hasChanges'])return saveSessionContext({'workflow_project':_0x451d3a[_0x583ec4(0x1e7)]},_0x3bdf6d['session']),console['error'](a55_0x4b0078[_0x583ec4(0x357)](_0x583ec4(0x336))),console[_0x583ec4(0x26a)](a55_0x4b0078['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x451d3a[_0x583ec4(0x1e7)])),0x0;if(_0x3bdf6d[_0x583ec4(0x22f)])return console['error'](a55_0x4b0078[_0x583ec4(0x26e)](_0x583ec4(0x1df))),0x0;if(!_0x3bdf6d[_0x583ec4(0x214)]){if(!isInteractive())return console['error'](a55_0x4b0078['red'](_0x583ec4(0x261)),_0x583ec4(0x2d1)),console['error'](a55_0x4b0078['dim'](_0x583ec4(0x2b0))),0x1;const _0x4b5546=await confirmKey(_0x583ec4(0x361));if(!_0x4b5546)return console[_0x583ec4(0x26a)](a55_0x4b0078[_0x583ec4(0x26e)](_0x583ec4(0x2dd)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x583ec4(0x2e6),()=>_0x4592bb[_0x583ec4(0x2a5)][_0x583ec4(0x1e4)](_0x451d3a,{'revision':_0x2fd308}),{'verbose':_0x3bdf6d[_0x583ec4(0x328)]}),saveSessionContext({'workflow_project':_0x451d3a[_0x583ec4(0x1e7)]},_0x3bdf6d['session']),console['error'](a55_0x4b0078[_0x583ec4(0x357)](_0x583ec4(0x34c)));const _0x108835=a55_0x596494[_0x583ec4(0x280)](process[_0x583ec4(0x203)](),_0x451d3a[_0x583ec4(0x1d6)])||'.';return console[_0x583ec4(0x26a)](a55_0x4b0078[_0x583ec4(0x35c)](_0x583ec4(0x1dd)+_0x108835)),console[_0x583ec4(0x26a)](a55_0x4b0078[_0x583ec4(0x35c)](_0x583ec4(0x267)+_0x451d3a[_0x583ec4(0x1e7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x246);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x21d);async[a55_0x1e66bb(0x2a0)](_0x49b6ac){const _0x425238=a55_0x1e66bb,{options:_0x56494f,args:_0x318fee,tdx:_0x453900}=_0x49b6ac,_0x1836c5=this[_0x425238(0x347)](_0x318fee,_0x56494f),_0x22e88f=_0x56494f[_0x425238(0x2f1)],_0x2efd9e=_0x56494f[_0x425238(0x316)];_0x56494f['verbose']&&(_0x1836c5&&console[_0x425238(0x26a)](_0x425238(0x241)+_0x1836c5),_0x22e88f&&console[_0x425238(0x26a)]('Revision:\x20'+_0x22e88f),_0x56494f['dryRun']&&console['error'](_0x425238(0x31d)),_0x2efd9e&&console[_0x425238(0x26a)]('Validation:\x20skipped'));let _0x3c4844;try{_0x3c4844=await withSpinner(_0x425238(0x235),()=>_0x453900[_0x425238(0x2a5)][_0x425238(0x288)]({'sourceDir':_0x1836c5,'revision':_0x22e88f,'skipValidation':_0x2efd9e}),{'verbose':_0x56494f[_0x425238(0x328)]});}catch(_0xe9c3fb){if(_0xe9c3fb instanceof Error&&_0xe9c3fb['message'][_0x425238(0x210)](_0x425238(0x312)))return console[_0x425238(0x26a)](a55_0x4b0078[_0x425238(0x1bf)](_0x425238(0x290)),_0x425238(0x2cb)),_0x56494f[_0x425238(0x1fe)]?console['error'](a55_0x4b0078[_0x425238(0x35c)](_0x425238(0x304)+_0x56494f[_0x425238(0x1fe)]+_0x425238(0x295)+_0x56494f[_0x425238(0x1fe)]+'\x27')):console[_0x425238(0x26a)](a55_0x4b0078[_0x425238(0x35c)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0xe9c3fb;}const _0x18898b=_0x3c4844[_0x425238(0x1cd)];console['error'](_0x425238(0x30f)+_0x18898b[_0x425238(0x1e7)]),console['error'](_0x425238(0x1e2)+_0x18898b[_0x425238(0x35b)]),console[_0x425238(0x26a)](_0x425238(0x22e)+_0x18898b[_0x425238(0x2f1)]),console[_0x425238(0x26a)](_0x425238(0x213)+a55_0x4b0078[_0x425238(0x357)]('+'+_0x18898b[_0x425238(0x1e3)][_0x425238(0x27b)]+_0x425238(0x1ff))+',\x20'+(a55_0x4b0078[_0x425238(0x26e)]('~'+_0x18898b[_0x425238(0x1e3)][_0x425238(0x2bd)]+'\x20modified')+',\x20')+(a55_0x4b0078[_0x425238(0x1bf)]('-'+_0x18898b[_0x425238(0x1e3)][_0x425238(0x346)]+_0x425238(0x207))+',\x20')+(''+a55_0x4b0078[_0x425238(0x35c)](_0x18898b[_0x425238(0x1e3)][_0x425238(0x2fe)]+_0x425238(0x233))));for(const _0x2c602e of _0x18898b[_0x425238(0x33e)]){_0x2c602e[_0x425238(0x1cb)]==='modified'&&_0x2c602e[_0x425238(0x30d)]&&(console['error']('\x0a'+a55_0x4b0078['cyan']('---\x20'+_0x2c602e[_0x425238(0x1ee)])),console[_0x425238(0x26a)](_0x2c602e[_0x425238(0x30d)]));}if(!_0x18898b[_0x425238(0x202)])return console[_0x425238(0x26a)](a55_0x4b0078['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x425238(0x33f)](_0x453900,_0x18898b[_0x425238(0x1e7)],_0x56494f['site']),0x0;if(_0x56494f[_0x425238(0x22f)])return console[_0x425238(0x26a)](a55_0x4b0078[_0x425238(0x26e)](_0x425238(0x1f4))),0x0;if(!_0x56494f[_0x425238(0x214)]){if(!isInteractive())return console[_0x425238(0x26a)](a55_0x4b0078[_0x425238(0x1bf)](_0x425238(0x261)),_0x425238(0x2d1)),console['error'](a55_0x4b0078[_0x425238(0x35c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xaf3296=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0xaf3296)return console['error'](a55_0x4b0078[_0x425238(0x26e)]('Cancelled'),_0x425238(0x2ba)),0x1;}const _0x4f736d=await withSpinner('Pushing\x20project...',()=>_0x453900[_0x425238(0x2a5)][_0x425238(0x227)](_0x18898b),{'verbose':_0x56494f['verbose']}),_0x1c1f40=_0x4f736d['data'];return console['error'](a55_0x4b0078[_0x425238(0x357)](_0x425238(0x2a9))),console['error'](_0x425238(0x2cc)+_0x1c1f40['projectId']),console[_0x425238(0x26a)](_0x425238(0x22e)+_0x1c1f40[_0x425238(0x2f1)]),await this[_0x425238(0x33f)](_0x453900,_0x1c1f40[_0x425238(0x1e7)],_0x56494f[_0x425238(0x319)]),0x0;}}function a55_0x2594(_0x1614ae,_0x383748){_0x1614ae=_0x1614ae-0x1bc;const _0x453eec=a55_0x453e();let _0x259430=_0x453eec[_0x1614ae];return _0x259430;}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a55_0x1e66bb(0x1fb);[a55_0x1e66bb(0x2f7)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a55_0x1e66bb(0x2a0)](_0x372d07){const _0x506190=a55_0x1e66bb,{options:_0x5a7bf9,args:_0x1104ba,tdx:_0x301c2c}=_0x372d07,_0x4d63e9=this[_0x506190(0x347)](_0x1104ba,_0x5a7bf9),_0x8c8628=_0x5a7bf9[_0x506190(0x293)],_0xebb8f1=_0x5a7bf9[_0x506190(0x2f1)],_0x28ed52=_0x5a7bf9[_0x506190(0x316)];if(!_0x4d63e9)return console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x1bf)](_0x506190(0x290)),_0x506190(0x228)),console[_0x506190(0x26a)](a55_0x4b0078['dim'](_0x506190(0x271))),console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x35c)](_0x506190(0x1da))),0x1;if(!_0x8c8628)return console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x1bf)]('Error:'),_0x506190(0x220)),console[_0x506190(0x26a)](a55_0x4b0078['dim'](_0x506190(0x271))),0x1;_0x5a7bf9[_0x506190(0x328)]&&(console[_0x506190(0x26a)](_0x506190(0x241)+_0x4d63e9),console['error'](_0x506190(0x345)+_0x8c8628),_0xebb8f1&&console[_0x506190(0x26a)](_0x506190(0x20c)+_0xebb8f1),_0x5a7bf9['dryRun']&&console['error'](_0x506190(0x31d)),_0x28ed52&&console['error'](_0x506190(0x31c)));const _0xcb6efc=await withSpinner(_0x506190(0x23a),()=>_0x301c2c[_0x506190(0x2a5)][_0x506190(0x2d3)](_0x4d63e9,_0x8c8628,{'revision':_0xebb8f1,'skipValidation':_0x28ed52}),{'verbose':_0x5a7bf9[_0x506190(0x328)]}),_0x1dcb61=_0xcb6efc[_0x506190(0x1cd)];console['error'](_0x506190(0x212)+_0x1dcb61[_0x506190(0x35b)]);_0x1dcb61[_0x506190(0x22a)]&&console[_0x506190(0x26a)]('Source\x20project:\x20'+_0x1dcb61[_0x506190(0x22a)]);console['error'](_0x506190(0x345)+_0x1dcb61[_0x506190(0x35e)]),console[_0x506190(0x26a)](_0x506190(0x20c)+_0x1dcb61[_0x506190(0x2f1)]),console[_0x506190(0x26a)](_0x506190(0x281)+_0x1dcb61['fileCount']);_0x1dcb61[_0x506190(0x216)]&&(console['error'](a55_0x4b0078[_0x506190(0x26e)]('\x0a⚠\x20Project\x20\x22'+_0x1dcb61[_0x506190(0x35e)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x1dcb61['existingProjectId']+')')),console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x26e)](_0x506190(0x302))));if(_0x5a7bf9[_0x506190(0x22f)])return console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x26e)](_0x506190(0x268))),0x0;if(!_0x5a7bf9[_0x506190(0x214)]){if(!isInteractive())return console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x1bf)](_0x506190(0x261)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x506190(0x26a)](a55_0x4b0078[_0x506190(0x35c)](_0x506190(0x2b0))),0x1;const _0x227417=_0x1dcb61['sourceProjectName']||a55_0x596494[_0x506190(0x368)](_0x4d63e9),_0x4b7916=_0x1dcb61['targetExists']?_0x506190(0x1e1)+_0x8c8628+_0x506190(0x300):_0x506190(0x284)+_0x227417+_0x506190(0x224)+_0x8c8628+'\x22?',_0xc87702=await confirmKey(_0x4b7916);if(!_0xc87702)return console[_0x506190(0x26a)](a55_0x4b0078['yellow']('Cancelled')),0x1;}const _0x13808d=await withSpinner(_0x1dcb61['targetExists']?'Updating\x20'+_0x8c8628+'...':_0x506190(0x31a)+_0x8c8628+'...',()=>_0x301c2c[_0x506190(0x2a5)][_0x506190(0x324)](_0x1dcb61),{'verbose':_0x5a7bf9[_0x506190(0x328)]}),_0x4fc19b=_0x13808d[_0x506190(0x1cd)];return console['error'](a55_0x4b0078[_0x506190(0x357)](_0x1dcb61[_0x506190(0x216)]?_0x506190(0x2db):_0x506190(0x338))),console[_0x506190(0x26a)](_0x506190(0x21e)+_0x4fc19b[_0x506190(0x35e)]),console['error'](_0x506190(0x2cc)+_0x4fc19b[_0x506190(0x29a)]),console[_0x506190(0x26a)](_0x506190(0x22e)+_0x4fc19b['revision']),await this[_0x506190(0x33f)](_0x301c2c,_0x4fc19b[_0x506190(0x35e)],_0x5a7bf9['site']),0x0;}}function a55_0x453e(){const _0x4b80d5=['run','newProjectId','select','\x20\x20tdx\x20wf\x20use\x20<project>','Getting\x20attempt\x20tasks...','→\x20Project:\x20','match','execute','Resolving\x20project\x20\x27','\x20\x20New\x20attempt\x20ID:\x20','getHours','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','workflow','replace','getMonth','canceling','✔\x20Push\x20complete','✔\x20Workflow\x20project\x20context\x20cleared.','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Resume\x20from:\x20','Auto-selected\x20latest\x20session:\x20','...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','666FXZxKM','session_id','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','length','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required',',\x20Workflow:\x20','TASK_NAME_WIDTH','✔\x20Pushed\x20','download','-\x20nothing\x20pushed','success','\x20is\x20not\x20a\x20directory','modified','message','Select\x20a\x20task\x20to\x20view\x20logs:','utf-8','parse','Project:\x20','MAX_TASKS_DISPLAY','status','Project\x20name:\x20','No\x20sessions\x20found','padStart','workflow:kill','No\x20log\x20files\x20found\x20for\x20this\x20attempt','⚠\x20Showing\x20first\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','\x20\x20Project\x20ID:\x20','param','from','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','table','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','fullName','prepareCloneProject','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','splice','context','\x0a✔\x20Attempt\x20complete','Listing\x20secrets...','Deleting\x20secret...','✔\x20Retry\x20started','✔\x20Project\x20updated','\x20of\x20','Cancelled','Including\x20subtasks:\x20yes','durationMs','194874HibdUc','running','keys','\x20workflow','\x20session','GUTTER','Writing\x20files...','resolveProjectId','limit','renderSingleTimeline','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:secrets:set','cyan','MIN_TIMELINE_WIDTH','Listing\x20workflow\x20sessions...','Output\x20directory:\x20','revision','getMinutes','Kill\x20a\x20running\x20attempt','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Warning:','description','white','Key\x20cannot\x20be\x20empty','tasks','indexOf','39298YihxZn','✔\x20Showing\x20','unchanged','join','\x22\x20with\x20new\x20revision?','min','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','follow','Tip:\x20cd\x20to\x20workflows/','fill','rows','No\x20projects\x20match\x20pattern:\x20','\x20-\x20','floor','stringify','Show\x20tasks\x20for\x20an\x20attempt','output','diff','retryAttempt','✔\x20Project:\x20','/attempt/','sort','No\x20workflow\x20tdx.json\x20found','Pushing\x20workflow\x20project...','Pull\x20workflow\x20project\x20to\x20local\x20folder','List\x20workflow\x20attempts','skipValidation','group_error','getDate','site','Cloning\x20to\x20','pollTimeline','Validation:\x20skipped','Dry\x20run:\x20yes','✔\x20Workflow\x20run\x20started','task','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Total:\x20','autocomplete','Params:\x20','executeCloneProject','get','workflow:timeline','deleteSecret','verbose','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','jsonl','startsWith','\x20from\x20session\x20','workflowName','86096vqtYZs','getFullYear','Expected\x20format:\x20--param\x20key=value','450pPybdE','isDirectory','→\x20New\x20project:\x20','round','No\x20workflows\x20found','\x0a✔\x20Already\x20up\x20to\x20date','buildTimelineData','✔\x20Clone\x20complete','updatedAt','No\x20workflows\x20found\x20in\x20project:\x20','params','now','Target:\x20','changes','showWorkflowConsoleUrl','blue','done','No\x20matching\x20sessions\x20found','List\x20workflows','retryAttemptName','New\x20project\x20name:\x20','deleted','resolveProjectDir','Setting\x20secret...','Workflow:\x20','\x20(system)','renderSessionsTimeline','✔\x20Pull\x20complete','List\x20all\x20workflow\x20projects','Parameters:\x20','Attempt\x20ID:\x20','Fetching\x20log\x20files...','1106699uqoKlj','index','POLL_INTERVAL_MS','Latest\x20session\x20has\x20no\x20attempt','Loading\x20workflows...','Attempt:\x20','green','planned','Error:\x20Attempt\x20ID\x20is\x20required','trimEnd','sourceDir','dim','set','newProjectName','Killing\x20attempt...','sessionTime','\x0aApply\x20these\x20changes?','list','substring','📁\x20','Getting\x20attempt\x20details...','workflow:pull','Failed\x20to\x20fetch\x20attempt\x20data','basename','listSecrets','Select\x20a\x20session\x20to\x20view\x20timeline:','fromTask','\x20sessions\x20','split','\x20project','workflow:delete','red','generateSessionTimelineRows','workflow:secrets:delete','max','title','(unknown)','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','all','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','170BIpfvy','Filter:\x20project=','type','setSecrets','data','slice','resolve','finishedAt','Select\x20a\x20workflow\x20to\x20run','start','push','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','targetDir','Downloading\x20project\x20','\x20\x20Console:\x20','duration','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','project','projects','\x20\x20Location:\x20','format','\x0aDry\x20run\x20-\x20no\x20files\x20written','attempts','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20Source:\x20','summary','applyPullProject','cancelRequested','\x20attempt','projectName','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20sessions\x20with\x20timing\x20information','(use\x20--limit\x20to\x20see\x20more)','find','attemptId','readFile','path','every','session','ICON_SPACING','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20logs','\x0aDry\x20run\x20-\x20nothing\x20pushed','includeRetried','toISOString','\x20secrets\x20set\x20for\x20project\x20\x27','lastAttempt','workflow:logs','getTime','workflow:clone','some','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflowProject','\x20new','resolveProject','Listing\x20workflow\x20attempts...','hasChanges','cwd','List\x20workflow\x20execution\x20sessions','workflow:upload','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20deleted','Filter:\x20','\x20task','Error:\x20Invalid\x20JSON\x20in\x20--params','repeat','Revision:\x20','workflow:secrets:list','Deleting\x20project\x20','sessions','includes','includeSubtasks','Source:\x20','\x20\x20Changes:\x20','yes','No\x20attempts\x20found\x20for:\x20','targetExists','Starting\x20workflow\x20run...','filter','navigateSessionsInteractive','delete','Force:\x20yes','stat','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20\x20Project:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','ICON_WIDTH','unknown','workflow:run','\x22\x20to\x20new\x20project\x20\x22','retrySession','8473164MEhjFp','executePushProject','Source\x20directory\x20is\x20required','Setting\x20','sourceProjectName','parseProjectWorkflowPattern','window','LABEL_MIN_SPACING','\x20\x20Revision:\x20','dryRun','total','Session\x20not\x20found:\x20','columns','\x20unchanged','Task\x20name:\x20','Analyzing\x20changes...','\x20\x20Target:\x20','Error:\x20Project\x20name\x20is\x20required','\x20secrets...','startTime','Analyzing\x20project...','values','\x27\x20from\x20project\x20\x27','workflow:sessions','map','trim','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Source\x20directory:\x20','workflow:projects','/sessions/','✔\x20Found\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:push','json','workflow:workflows','📋\x20','isTTY','Session\x20','renderTimeline','MAX_LABEL_COUNT','filesExtracted','\x27...','🔄\x20','Pulling\x20project\x20','workflows','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','requireProject','attempt','stdout','localeCompare','267kqjuvC','No\x20workflow\x20projects\x20found','\x20\x20Files\x20extracted:\x20','\x20to\x20see\x20detailed\x20logs','\x1b[1A\x1b[2K','sessionId','\x20(use\x20--limit\x20to\x20show\x20more)','Start\x20a\x20workflow\x20run','startedAt','\x0aError:','Loading\x20sessions...','value','No\x20sessions\x20found\x20for:\x20','toLowerCase','pending','\x20\x20Session\x20context\x20set\x20to:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','createdAt','error','Error:\x20Secret\x20key\x20is\x20required','Session\x20time:\x20','resumeFrom','yellow','MAX_POLL_ITERATIONS','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x0aFailed\x20to\x20fetch\x20attempt\x20data','MIN_LABEL_COUNT','write','isNewProject','Project\x20name\x20is\x20required','Reason:\x20','Using\x20attempt\x20','text','\x20\x20Session\x20ID:\x20','new','652082KwgYHb','✔\x20Secret\x20\x27','end','Error:\x20','relative','Files\x20to\x20upload:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','No\x20attempts\x20found','\x0aClone\x20\x22','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Show\x20specific\x20attempt\x20details','state','preparePushProject','log','workflow:download','sys','workflow:use','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','taskName','No\x20sessions\x20found\x20in\x20project:\x20','Error:','tdx.json','2601660IKHXHw','name','Retrying\x20session...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','kill','projectId','✔\x20Downloaded\x20'];a55_0x453e=function(){return _0x4b80d5;};return a55_0x453e();}export class WorkflowDeleteCommand extends BaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x1be);['description']=a55_0x1e66bb(0x329);async[a55_0x1e66bb(0x2a0)](_0x5136b6){const _0x20da29=a55_0x1e66bb,{options:_0x47c202,args:_0x126cf6,tdx:_0x54129b}=_0x5136b6,_0x165343=_0x126cf6[0x0];if(!_0x165343)return console[_0x20da29(0x26a)](_0x20da29(0x2b5)),console[_0x20da29(0x26a)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x47c202['verbose']&&console[_0x20da29(0x26a)](_0x20da29(0x2c2)+_0x165343);if(!_0x47c202[_0x20da29(0x214)]){if(!isInteractive())return console[_0x20da29(0x26a)](a55_0x4b0078[_0x20da29(0x1bf)](_0x20da29(0x261)),_0x20da29(0x2d1)),console[_0x20da29(0x26a)](a55_0x4b0078[_0x20da29(0x35c)](_0x20da29(0x2b0))),0x1;const _0x58a328=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x165343+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x58a328)return console[_0x20da29(0x26a)](a55_0x4b0078[_0x20da29(0x26e)](_0x20da29(0x2dd))),0x1;}const _0x5aaf50=await withSpinner(_0x20da29(0x20e)+_0x165343+'...',()=>_0x54129b[_0x20da29(0x2a5)][_0x20da29(0x21a)](_0x165343),{'verbose':_0x47c202[_0x20da29(0x328)]}),_0x5e0b29=_0x5aaf50['data'];return console['error']('✔\x20Deleted\x20project\x20'+_0x5e0b29[_0x20da29(0x1e7)]),console['error'](_0x20da29(0x2cc)+_0x5e0b29[_0x20da29(0x297)]),0x0;}}export function parseKeyValue(_0x1ae098){const _0x2b3b5c=a55_0x1e66bb,_0x446a9a=_0x1ae098['indexOf']('=');if(_0x446a9a===-0x1)throw new Error('Invalid\x20format:\x20'+_0x1ae098+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x350656=_0x1ae098[_0x2b3b5c(0x363)](0x0,_0x446a9a),_0x460da6=_0x1ae098['substring'](_0x446a9a+0x1);if(!_0x350656)throw new Error(_0x2b3b5c(0x2f9));return{'key':_0x350656,'value':_0x460da6};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x20d);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a55_0x1e66bb(0x2a0)](_0x50b659){const _0xa96d46=a55_0x1e66bb,{options:_0x25fb1d,args:_0x2ccc24,tdx:_0x370338}=_0x50b659,_0x387b68=this[_0xa96d46(0x254)](_0x2ccc24,_0x25fb1d);if(!_0x387b68)return 0x1;_0x25fb1d['verbose']&&console['error'](_0xa96d46(0x2c2)+_0x387b68);const _0xc2bdf9=await withSpinner(_0xa96d46(0x2d8),()=>_0x370338[_0xa96d46(0x2a5)][_0xa96d46(0x369)](_0x387b68),{'verbose':_0x25fb1d[_0xa96d46(0x328)]}),{secrets:_0x42614a}=_0xc2bdf9[_0xa96d46(0x1cd)];return console[_0xa96d46(0x26a)](_0xa96d46(0x244)+_0x42614a[_0xa96d46(0x2b4)]+'\x20secret'+(_0x42614a[_0xa96d46(0x2b4)]!==0x1?'s':'')),await handleSDKOutput(_0x42614a,_0x25fb1d),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x2ec);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x2d4);async[a55_0x1e66bb(0x2a0)](_0x33f3e6){const _0x32a58e=a55_0x1e66bb,{options:_0x396418,args:_0x440ef2,tdx:_0x16acee}=_0x33f3e6;let _0x43ef9b,_0x4b576f;if(_0x440ef2[_0x32a58e(0x2b4)]>=0x1&&!_0x440ef2[0x0]['includes']('='))_0x43ef9b=_0x440ef2[0x0],_0x4b576f=_0x440ef2['slice'](0x1);else{if(_0x440ef2['length']>=0x1&&_0x396418[_0x32a58e(0x1fe)])_0x43ef9b=_0x396418[_0x32a58e(0x1fe)],_0x4b576f=_0x440ef2;else return _0x440ef2['length']>=0x1?(console['error'](_0x32a58e(0x237)),console['error'](_0x32a58e(0x245)),0x1):(console[_0x32a58e(0x26a)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x32a58e(0x26a)](_0x32a58e(0x253)),0x1);}if(_0x4b576f['length']===0x0)return console[_0x32a58e(0x26a)](_0x32a58e(0x1c6)),console[_0x32a58e(0x26a)](_0x32a58e(0x253)),0x1;const _0x10d1f5={};try{for(const _0x17f90c of _0x4b576f){const {key:_0x190dae,value:_0x1b8333}=parseKeyValue(_0x17f90c);_0x10d1f5[_0x190dae]=_0x1b8333;}}catch(_0x587ed6){return _0x587ed6 instanceof Error&&console[_0x32a58e(0x26a)](a55_0x4b0078['red'](_0x32a58e(0x290)),_0x587ed6[_0x32a58e(0x2be)]),0x1;}const _0x2f43c1=Object['keys'](_0x10d1f5);_0x396418[_0x32a58e(0x328)]&&(console[_0x32a58e(0x26a)](_0x32a58e(0x2c2)+_0x43ef9b),console[_0x32a58e(0x26a)]('Secrets\x20to\x20set:\x20'+_0x2f43c1[_0x32a58e(0x2ff)](',\x20')));const _0xdb177e=await withSpinner(_0x2f43c1[_0x32a58e(0x2b4)]===0x1?_0x32a58e(0x348):_0x32a58e(0x229)+_0x2f43c1[_0x32a58e(0x2b4)]+_0x32a58e(0x238),()=>_0x16acee[_0x32a58e(0x2a5)][_0x32a58e(0x1cc)](_0x43ef9b,_0x10d1f5),{'verbose':_0x396418[_0x32a58e(0x328)]}),_0x479253=_0xdb177e[_0x32a58e(0x1cd)];return console['error'](_0x2f43c1[_0x32a58e(0x2b4)]===0x1?_0x32a58e(0x27d)+_0x479253[_0x32a58e(0x2e2)][0x0]+_0x32a58e(0x2cf)+_0x479253['projectName']+'\x27':'✔\x20'+_0x479253[_0x32a58e(0x2e2)][_0x32a58e(0x2b4)]+_0x32a58e(0x1f7)+_0x479253[_0x32a58e(0x1e7)]+'\x27'),(_0x396418[_0x32a58e(0x247)]||_0x396418[_0x32a58e(0x32a)])&&await handleSingleObjectOutput(_0x479253,_0x396418),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a55_0x1e66bb(0x1c1);[a55_0x1e66bb(0x2f7)]=a55_0x1e66bb(0x21f);async[a55_0x1e66bb(0x2a0)](_0x2227d0){const _0x41e45b=a55_0x1e66bb,{options:_0x328372,args:_0x1a5d09,tdx:_0x26ceee}=_0x2227d0;let _0x204b8f,_0x1da1f5;if(_0x1a5d09[_0x41e45b(0x2b4)]>=0x2)_0x204b8f=_0x1a5d09[0x0],_0x1da1f5=_0x1a5d09[0x1];else{if(_0x1a5d09['length']===0x1&&_0x328372[_0x41e45b(0x1fe)])_0x204b8f=_0x328372['workflowProject'],_0x1da1f5=_0x1a5d09[0x0];else return _0x1a5d09['length']===0x1?(console[_0x41e45b(0x26a)](_0x41e45b(0x237)),console[_0x41e45b(0x26a)](_0x41e45b(0x245)),0x1):(console[_0x41e45b(0x26a)](_0x41e45b(0x26b)),console[_0x41e45b(0x26a)](_0x41e45b(0x320)),0x1);}_0x328372[_0x41e45b(0x328)]&&(console['error'](_0x41e45b(0x2c2)+_0x204b8f),console[_0x41e45b(0x26a)]('Key:\x20'+_0x1da1f5));if(!_0x328372[_0x41e45b(0x214)]){if(!isInteractive())return console['error'](a55_0x4b0078[_0x41e45b(0x1bf)](_0x41e45b(0x261)),_0x41e45b(0x2d1)),console[_0x41e45b(0x26a)](a55_0x4b0078['dim'](_0x41e45b(0x2b0))),0x1;const _0x2d88a9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x1da1f5+_0x41e45b(0x23c)+_0x204b8f+'\x27?');if(!_0x2d88a9)return console[_0x41e45b(0x26a)](a55_0x4b0078['yellow'](_0x41e45b(0x2dd))),0x1;}const _0x4d820e=await withSpinner(_0x41e45b(0x2d9),()=>_0x26ceee[_0x41e45b(0x2a5)][_0x41e45b(0x327)](_0x204b8f,_0x1da1f5),{'verbose':_0x328372[_0x41e45b(0x328)]}),_0x58b7e6=_0x4d820e[_0x41e45b(0x1cd)];return console[_0x41e45b(0x26a)](_0x41e45b(0x27d)+_0x58b7e6['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x58b7e6[_0x41e45b(0x1e7)]+'\x27'),(_0x328372[_0x41e45b(0x247)]||_0x328372[_0x41e45b(0x32a)])&&await handleSingleObjectOutput(_0x58b7e6,_0x328372),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(_0x317979){const _0x318dfa=a55_0x1e66bb,_0x183374=Math[_0x318dfa(0x309)](_0x317979/0x3e8),_0x22d1a2=Math[_0x318dfa(0x309)](_0x183374/0x3c),_0x378ea5=Math['floor'](_0x22d1a2/0x3c),_0x11c5f4=Math[_0x318dfa(0x309)](_0x378ea5/0x18);if(_0x11c5f4>0x0){const _0x1fac3b=_0x378ea5%0x18;return _0x1fac3b>0x0?_0x11c5f4+'d\x20'+_0x1fac3b+'h':_0x11c5f4+'d';}else{if(_0x378ea5>0x0){const _0x5a52d3=_0x22d1a2%0x3c;return _0x5a52d3>0x0?_0x378ea5+'h\x20'+_0x5a52d3+'m':_0x378ea5+'h';}else{if(_0x22d1a2>0x0){const _0x552b12=_0x183374%0x3c;return _0x552b12>0x0?_0x22d1a2+'m\x20'+_0x552b12+'s':_0x22d1a2+'m';}else return _0x183374+'s';}}}function formatTimestamp(_0x1911ae,_0x9793da){const _0xa064a3=a55_0x1e66bb,_0x2f6084=new Date(_0x1911ae),_0x2fcafa=String(_0x2f6084[_0xa064a3(0x2a3)]())[_0xa064a3(0x2c7)](0x2,'0'),_0x4503da=String(_0x2f6084[_0xa064a3(0x2f2)]())['padStart'](0x2,'0'),_0x26c172=_0x2fcafa+':'+_0x4503da,_0x59fcda=_0x2f6084[_0xa064a3(0x32f)]()===_0x9793da[_0xa064a3(0x32f)]()&&_0x2f6084[_0xa064a3(0x2a7)]()===_0x9793da[_0xa064a3(0x2a7)]()&&_0x2f6084[_0xa064a3(0x318)]()===_0x9793da[_0xa064a3(0x318)]();if(_0x59fcda)return _0x26c172;else{const _0x3dcc46=String(_0x2f6084[_0xa064a3(0x2a7)]()+0x1)[_0xa064a3(0x2c7)](0x2,'0'),_0x320d9d=String(_0x2f6084[_0xa064a3(0x318)]())[_0xa064a3(0x2c7)](0x2,'0');return _0x3dcc46+'-'+_0x320d9d+'\x20'+_0x26c172;}}function formatDate(_0x5b5123){const _0x3a0497=a55_0x1e66bb,_0x9c7eb3=_0x5b5123[_0x3a0497(0x32f)](),_0x438939=String(_0x5b5123[_0x3a0497(0x2a7)]()+0x1)[_0x3a0497(0x2c7)](0x2,'0'),_0x1c9ada=String(_0x5b5123[_0x3a0497(0x318)]())[_0x3a0497(0x2c7)](0x2,'0');return _0x9c7eb3+'-'+_0x438939+'-'+_0x1c9ada;}function getTaskStateIcon(_0xfd2d7f){const _0x1a14ea={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1a14ea[_0xfd2d7f]||'⚪';}function getBarChar(_0x32ff25){const _0x920ce6=a55_0x1e66bb;return _0x32ff25===_0x920ce6(0x26a)||_0x32ff25===_0x920ce6(0x317)?'×':'─';}function getBarColor(_0x31270d){const _0xb2ca70=a55_0x1e66bb,_0x23c295={'success':a55_0x4b0078['green'],'error':a55_0x4b0078['red'],'group_error':a55_0x4b0078['red'],'running':a55_0x4b0078[_0xb2ca70(0x340)],'blocked':a55_0x4b0078[_0xb2ca70(0x26e)],'planned':a55_0x4b0078[_0xb2ca70(0x35c)],'canceling':a55_0x4b0078[_0xb2ca70(0x26e)]};return _0x23c295[_0x31270d]||a55_0x4b0078[_0xb2ca70(0x2f8)];}function parseTaskName(_0x1c40dd){const _0x258852=a55_0x1e66bb;let _0xf88fe1=_0x1c40dd[_0x258852(0x2a6)](/^\++/,'');const _0x4d3e8a=_0xf88fe1['split']('+'),_0x1c995a=_0x4d3e8a[_0x258852(0x2b4)]>0x1?_0x4d3e8a[_0x258852(0x2b4)]-0x2:0x0,_0x3541f7=_0x4d3e8a[_0x4d3e8a[_0x258852(0x2b4)]-0x1]||_0xf88fe1;return{'level':_0x1c995a,'name':'+'+_0x3541f7};}function truncateTaskName(_0x561e88,_0x2295f6){const _0x19a782=a55_0x1e66bb,_0x12ae68=stringWidth(_0x561e88);if(_0x12ae68<=_0x2295f6)return _0x561e88;let _0x319b23=_0x561e88;while(stringWidth(_0x319b23+'…')>_0x2295f6&&_0x319b23[_0x19a782(0x2b4)]>0x0){_0x319b23=_0x319b23['slice'](0x0,-0x1);}return _0x319b23+'…';}function calculateTimeScale(_0x49e66c,_0x283ead){const _0x3f6ed4=a55_0x1e66bb;return{'startTime':_0x49e66c[_0x3f6ed4(0x1d2)],'endTime':_0x49e66c[_0x3f6ed4(0x27e)],'durationMs':_0x49e66c[_0x3f6ed4(0x1d9)],'msPerChar':_0x49e66c[_0x3f6ed4(0x1d9)]/_0x283ead};}function timeToPosition(_0xc549fe,_0x473aa5,_0x80a7f6){const _0x2502e0=a55_0x1e66bb,_0x4c83ff=_0xc549fe-_0x473aa5[_0x2502e0(0x239)],_0x587298=Math[_0x2502e0(0x309)](_0x4c83ff/_0x473aa5['msPerChar']);return Math[_0x2502e0(0x1c2)](0x0,Math[_0x2502e0(0x301)](_0x587298,_0x80a7f6));}function renderTimeAxis(_0x53b48e,_0x267ec1){const _0xb625cb=a55_0x1e66bb,_0x1aaebc=Math[_0xb625cb(0x301)](TIMELINE_CONFIG[_0xb625cb(0x24d)],Math['max'](TIMELINE_CONFIG[_0xb625cb(0x273)],Math[_0xb625cb(0x309)](_0x267ec1/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x1d912a=_0x53b48e[_0xb625cb(0x2df)]/(_0x1aaebc-0x1),_0x379aba=new Date(_0x53b48e[_0xb625cb(0x239)]),_0x484d83=[];for(let _0x2649ab=0x0;_0x2649ab<_0x1aaebc;_0x2649ab++){const _0x1a8cb3=_0x53b48e[_0xb625cb(0x239)]+_0x2649ab*_0x1d912a,_0xb7f563=timeToPosition(_0x1a8cb3,_0x53b48e,_0x267ec1),_0x55a660=formatTimestamp(_0x1a8cb3,_0x379aba);_0x484d83[_0xb625cb(0x1d3)]({'pos':_0xb7f563,'text':_0x55a660});}const _0x34a69e=new Array(_0x267ec1)[_0xb625cb(0x305)]('\x20');let _0x3ea35b=-0x1;for(const {pos:_0x145c4f,text:_0x5602d5}of _0x484d83){let _0x5d64e0=Math[_0xb625cb(0x1c2)](0x0,_0x145c4f-Math[_0xb625cb(0x309)](_0x5602d5[_0xb625cb(0x2b4)]/0x2));_0x5d64e0<=_0x3ea35b+TIMELINE_CONFIG[_0xb625cb(0x22d)]&&(_0x5d64e0=_0x3ea35b+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x5d64e0+_0x5602d5['length']>_0x267ec1&&(_0x5d64e0=_0x267ec1-_0x5602d5[_0xb625cb(0x2b4)]);if(_0x5d64e0>=0x0&&_0x5d64e0+_0x5602d5[_0xb625cb(0x2b4)]<=_0x267ec1&&_0x5d64e0>_0x3ea35b){for(let _0x50ebaf=0x0;_0x50ebaf<_0x5602d5[_0xb625cb(0x2b4)];_0x50ebaf++){_0x34a69e[_0x5d64e0+_0x50ebaf]=_0x5602d5[_0x50ebaf];}_0x3ea35b=_0x5d64e0+_0x5602d5[_0xb625cb(0x2b4)]-0x1;}}return _0x34a69e[_0xb625cb(0x2ff)]('');}function renderTaskRow(_0x4adc76,_0x472a56,_0x3f597f,_0x564900){const _0x3926a7=a55_0x1e66bb,{level:_0x518b80,name:_0x1ac7fe}=parseTaskName(_0x4adc76['name']),_0x2afbf8='\x20'[_0x3926a7(0x20b)](_0x518b80),_0x18d432=_0x4adc76[_0x3926a7(0x22c)]?'('+formatElapsed(_0x4adc76[_0x3926a7(0x22c)][_0x3926a7(0x1d9)])+')':'',_0x2a6da6=stringWidth(_0x18d432),_0x560c2f=_0x518b80*0x1,_0x192294=_0x564900-_0x560c2f-_0x2a6da6-0x1,_0x3946ec=truncateTaskName(_0x1ac7fe,_0x192294),_0x56b21b=_0x2afbf8+_0x3946ec,_0x380f22=stringWidth(_0x56b21b),_0x569744=_0x564900-_0x380f22-_0x2a6da6,_0x2ab686=_0x56b21b+'\x20'[_0x3926a7(0x20b)](Math[_0x3926a7(0x1c2)](0x1,_0x569744))+a55_0x4b0078['dim'](_0x18d432),_0x413652=getTaskStateIcon(_0x4adc76[_0x3926a7(0x287)]),_0x1d9b28=new Array(_0x3f597f)['fill']('\x20');if(_0x4adc76[_0x3926a7(0x22c)]){const _0x389b3c=timeToPosition(_0x4adc76['window'][_0x3926a7(0x1d2)],_0x472a56,_0x3f597f),_0x5e8d47=timeToPosition(_0x4adc76[_0x3926a7(0x22c)][_0x3926a7(0x27e)],_0x472a56,_0x3f597f),_0x24f64e=getBarChar(_0x4adc76[_0x3926a7(0x287)]),_0x1145c0=Math[_0x3926a7(0x1c2)](_0x389b3c+0x1,_0x5e8d47);for(let _0x2dccfc=_0x389b3c;_0x2dccfc<Math[_0x3926a7(0x301)](_0x1145c0,_0x3f597f);_0x2dccfc++){_0x1d9b28[_0x2dccfc]=_0x24f64e;}}const _0x4ff6dc=getBarColor(_0x4adc76[_0x3926a7(0x287)]),_0x4125ca=_0x1d9b28[_0x3926a7(0x23e)](_0xf0dc80=>_0xf0dc80==='\x20'?'\x20':_0x4ff6dc(_0xf0dc80))[_0x3926a7(0x2ff)]('');return _0x413652+'\x20'+_0x2ab686+'│'+_0x4125ca+'│';}function calculateStats(_0x51f186){const _0x5b3f8d=a55_0x1e66bb,_0x560cab={'total':_0x51f186['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x9649b7 of _0x51f186){if(_0x9649b7[_0x5b3f8d(0x287)]==='success')_0x560cab['success']++;else{if(_0x9649b7[_0x5b3f8d(0x287)]==='error'||_0x9649b7[_0x5b3f8d(0x287)]===_0x5b3f8d(0x317))_0x560cab[_0x5b3f8d(0x26a)]++;else _0x9649b7['state']===_0x5b3f8d(0x2e1)?_0x560cab[_0x5b3f8d(0x2e1)]++:_0x560cab[_0x5b3f8d(0x266)]++;}}return _0x560cab;}function formatStats(_0x28335a){const _0x3a8cce=a55_0x1e66bb;return[_0x3a8cce(0x321)+_0x28335a[_0x3a8cce(0x230)],'✅\x20'+_0x28335a[_0x3a8cce(0x2bb)],'❌\x20'+_0x28335a[_0x3a8cce(0x26a)],_0x3a8cce(0x250)+_0x28335a['running'],'⏳\x20'+_0x28335a[_0x3a8cce(0x266)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a55_0x1e66bb(0x293)]=a55_0x1e66bb(0x326);['description']=a55_0x1e66bb(0x2f5);async[a55_0x1e66bb(0x2a0)](_0x3a3a82){const _0x1bf29d=a55_0x1e66bb,{options:_0x54411d,args:_0x3afd46,tdx:_0x87a5e0}=_0x3a3a82;let _0x3e5966,_0x59ccbc,_0x4401c2=![];if(_0x3afd46[0x0]){if(_0x3afd46[0x0][_0x1bf29d(0x210)]('.')){const _0x33a89e=this[_0x1bf29d(0x22b)](_0x3afd46,_0x54411d);if(!_0x33a89e)return 0x1;_0x3e5966=_0x33a89e[_0x1bf29d(0x1e7)],_0x59ccbc=_0x33a89e[_0x1bf29d(0x32d)];}else{_0x59ccbc=_0x3afd46[0x0],_0x3e5966=_0x54411d[_0x1bf29d(0x1fe)];if(!_0x3e5966)return console[_0x1bf29d(0x26a)](a55_0x4b0078[_0x1bf29d(0x1bf)](_0x1bf29d(0x290)),_0x1bf29d(0x1c8)),0x1;_0x4401c2=!![];}}else{const _0x16a909=this[_0x1bf29d(0x22b)](_0x3afd46,_0x54411d);if(!_0x16a909)return 0x1;_0x3e5966=_0x16a909[_0x1bf29d(0x1e7)],_0x59ccbc=_0x16a909['workflowName'];}if(_0x54411d[_0x1bf29d(0x328)]){if(_0x3e5966&&_0x59ccbc)console['error'](_0x1bf29d(0x208)+_0x3e5966+'.'+_0x59ccbc);else _0x3e5966&&console[_0x1bf29d(0x26a)](_0x1bf29d(0x1ca)+_0x3e5966);}const _0x197031=_0x54411d['attemptId'],_0x54362d=_0x54411d[_0x1bf29d(0x25d)];if(_0x197031){_0x54362d&&console[_0x1bf29d(0x26a)](a55_0x4b0078[_0x1bf29d(0x26e)](_0x1bf29d(0x2f6)),_0x1bf29d(0x282));const _0x3645e5=_0x54411d[_0x1bf29d(0x303)];return _0x3645e5?await this[_0x1bf29d(0x31b)](_0x3a3a82,_0x197031):await this['renderSingleTimeline'](_0x3a3a82,_0x197031,_0x54411d),0x0;}if(_0x54362d){const _0x4047f8=await withSpinner('Loading\x20session...',()=>_0x87a5e0[_0x1bf29d(0x2a5)]['sessions']({'projectName':_0x3e5966,'workflowName':_0x59ccbc,'limit':0x64}),{'verbose':_0x54411d[_0x1bf29d(0x328)]}),_0x2d5c71=_0x4047f8[_0x1bf29d(0x1cd)][_0x1bf29d(0x1eb)](_0x3c661c=>_0x3c661c['id']===_0x54362d);if(!_0x2d5c71)return console[_0x1bf29d(0x26a)](a55_0x4b0078[_0x1bf29d(0x1bf)](_0x1bf29d(0x290)),_0x1bf29d(0x231)+_0x54362d),0x1;if(!_0x2d5c71[_0x1bf29d(0x1f8)]?.['id'])return console[_0x1bf29d(0x26a)](a55_0x4b0078['red'](_0x1bf29d(0x290)),_0x1bf29d(0x24b)+_0x54362d+'\x20has\x20no\x20attempts'),0x1;const _0x59179b=_0x2d5c71[_0x1bf29d(0x1f8)]['id'];_0x54411d['verbose']&&console[_0x1bf29d(0x26a)](_0x1bf29d(0x278)+_0x59179b+_0x1bf29d(0x32c)+_0x54362d);const _0x1dc8fd=_0x54411d[_0x1bf29d(0x303)];return _0x1dc8fd?await this[_0x1bf29d(0x31b)](_0x3a3a82,_0x59179b):await this[_0x1bf29d(0x2e9)](_0x3a3a82,_0x59179b,_0x54411d),0x0;}const _0x33b0f1=await withSpinner(_0x1bf29d(0x262),()=>_0x87a5e0['workflow'][_0x1bf29d(0x20f)]({'projectName':_0x3e5966,'workflowName':_0x59ccbc,'limit':_0x54411d[_0x1bf29d(0x2e8)]||0x32}),{'verbose':_0x54411d['verbose']}),_0x2829ba=_0x33b0f1[_0x1bf29d(0x1cd)];if(_0x2829ba[_0x1bf29d(0x2b4)]===0x0){if(_0x3e5966&&_0x59ccbc)console[_0x1bf29d(0x26a)]('No\x20sessions\x20found\x20for:\x20'+_0x3e5966+'.'+_0x59ccbc);else _0x3e5966?console[_0x1bf29d(0x26a)](_0x1bf29d(0x28f)+_0x3e5966):(console[_0x1bf29d(0x26a)]('No\x20workflow\x20sessions\x20found'),console[_0x1bf29d(0x26a)](a55_0x4b0078['dim'](_0x1bf29d(0x1d5))));return 0x0;}_0x2829ba[_0x1bf29d(0x311)]((_0x365259,_0x18bff3)=>{const _0x1bec93=_0x1bf29d,_0x137afb=_0x365259['sessionTime']||'',_0x4a3c92=_0x18bff3[_0x1bec93(0x360)]||'';return _0x4a3c92[_0x1bec93(0x257)](_0x137afb);});if(_0x54411d[_0x1bf29d(0x247)]||_0x54411d['jsonl'])return await handleSDKOutput(_0x2829ba,_0x54411d),0x0;let _0x3ac238;if(_0x4401c2){const _0x19d1b3=_0x2829ba[0x0];if(!_0x19d1b3[_0x1bf29d(0x1f8)]?.['id'])return console[_0x1bf29d(0x26a)](_0x1bf29d(0x354)),0x0;_0x3ac238=_0x19d1b3[_0x1bf29d(0x1f8)]['id'],_0x54411d['verbose']&&console[_0x1bf29d(0x26a)](_0x1bf29d(0x2ad)+_0x19d1b3[_0x1bf29d(0x360)]);}else{const _0x3b8cf9=_0x2829ba['map'](_0xfbdb92=>{const _0x462915=_0x1bf29d,_0x3e35a9=getAttemptStatusDisplay(_0xfbdb92[_0x462915(0x1f8)]);return{'title':_0xfbdb92[_0x462915(0x1db)]?.[_0x462915(0x293)]+'.'+_0xfbdb92[_0x462915(0x2a5)]?.[_0x462915(0x293)]+_0x462915(0x308)+_0xfbdb92[_0x462915(0x360)]+'\x20'+_0x3e35a9['icon'],'value':_0xfbdb92['lastAttempt']?.['id']||'','description':_0x3e35a9[_0x462915(0x279)]};}),_0x3fb39d=await a55_0x264e0e({'type':_0x1bf29d(0x29b),'name':'attemptId','message':_0x1bf29d(0x36a),'choices':_0x3b8cf9[_0x1bf29d(0x218)](_0x5ad3ee=>_0x5ad3ee[_0x1bf29d(0x263)]!=='')});if(!_0x3fb39d['attemptId'])return 0x0;_0x3ac238=_0x3fb39d[_0x1bf29d(0x1ec)];}const _0x566fc1=_0x54411d[_0x1bf29d(0x303)];return _0x566fc1?await this[_0x1bf29d(0x31b)](_0x3a3a82,_0x3ac238):await this[_0x1bf29d(0x2e9)](_0x3a3a82,_0x3ac238,_0x54411d),0x0;}async['renderSingleTimeline'](_0x5805c6,_0x4c227e,_0x102a85){const _0x194ad3=a55_0x1e66bb,{tdx:_0x2aa1b9}=_0x5805c6;let _0x1b9df1,_0x3716cd;try{[_0x1b9df1,_0x3716cd]=await Promise[_0x194ad3(0x1c7)]([_0x2aa1b9[_0x194ad3(0x2a5)][_0x194ad3(0x255)](_0x4c227e),_0x2aa1b9['workflow'][_0x194ad3(0x2fa)](_0x4c227e,![])]);}catch(_0x460b7f){console[_0x194ad3(0x26a)](a55_0x4b0078[_0x194ad3(0x1bf)](_0x194ad3(0x367)));_0x102a85[_0x194ad3(0x328)]&&console[_0x194ad3(0x26a)](_0x460b7f);throw _0x460b7f;}if(_0x102a85[_0x194ad3(0x247)]||_0x102a85['jsonl']){const _0xb090ad=this[_0x194ad3(0x337)](_0x1b9df1,_0x3716cd);await handleSDKOutput([_0xb090ad],_0x102a85);return;}const _0x528b38=_0x2aa1b9[_0x194ad3(0x2d6)][_0x194ad3(0x319)],_0x2033b1=this[_0x194ad3(0x24c)](_0x1b9df1,_0x3716cd,_0x528b38);console[_0x194ad3(0x289)](_0x2033b1);}async[a55_0x1e66bb(0x31b)](_0x3f516e,_0xa16a7e){const _0x17df44=a55_0x1e66bb,{tdx:_0x18a43c}=_0x3f516e,_0x29dfeb=TIMELINE_CONFIG[_0x17df44(0x353)],_0x58aec6=TIMELINE_CONFIG[_0x17df44(0x26f)];let _0x460a60=0x0;while(_0x460a60<_0x58aec6){process[_0x17df44(0x256)][_0x17df44(0x24a)]&&process['stdout'][_0x17df44(0x274)]('\x1bc');let _0x399061,_0x10c100;try{[_0x399061,_0x10c100]=await Promise[_0x17df44(0x1c7)]([_0x18a43c[_0x17df44(0x2a5)][_0x17df44(0x255)](_0xa16a7e),_0x18a43c[_0x17df44(0x2a5)][_0x17df44(0x2fa)](_0xa16a7e,![])]);}catch(_0x1bf659){console['error'](a55_0x4b0078[_0x17df44(0x1bf)](_0x17df44(0x272)));_0x460a60>0x0&&console['error'](a55_0x4b0078[_0x17df44(0x35c)](_0x17df44(0x240)+_0x460a60));throw _0x1bf659;}const _0x2cf795=_0x18a43c[_0x17df44(0x2d6)][_0x17df44(0x319)],_0x54d035=this[_0x17df44(0x24c)](_0x399061,_0x10c100,_0x2cf795);console[_0x17df44(0x289)](_0x54d035);const _0x31edbc=_0x399061['done']&&_0x10c100[_0x17df44(0x1ef)](_0xcdf2b3=>_0xcdf2b3[_0x17df44(0x287)]!=='running'&&_0xcdf2b3[_0x17df44(0x287)]!==_0x17df44(0x358));if(_0x31edbc){console['error'](a55_0x4b0078[_0x17df44(0x357)](_0x17df44(0x2d7)));break;}console[_0x17df44(0x26a)](a55_0x4b0078[_0x17df44(0x35c)]('\x0aPolling...\x20('+_0x460a60*0x2+_0x17df44(0x2b3))),await new Promise(_0x49a09b=>setTimeout(_0x49a09b,_0x29dfeb)),_0x460a60++;}_0x460a60>=_0x58aec6&&console[_0x17df44(0x26a)](a55_0x4b0078['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a55_0x1e66bb(0x24c)](_0x3a202a,_0x1ba180,_0x1fbb42){const _0x540210=a55_0x1e66bb,_0x4cd7e5=[],_0x233bc6=TIMELINE_CONFIG[_0x540210(0x2b7)],_0x2ca332=0x5,_0x44c174=process[_0x540210(0x256)][_0x540210(0x232)]||0x78,_0x3d6098=_0x44c174-_0x233bc6-_0x2ca332,_0x1dba7c=Math['max'](TIMELINE_CONFIG[_0x540210(0x2ee)],Math['min'](_0x3d6098,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1e07fa=new Date(_0x3a202a['createdAt'])[_0x540210(0x1fa)](),_0x3b24ab=_0x3a202a['finishedAt']?new Date(_0x3a202a[_0x540210(0x1d0)])['getTime']():Date[_0x540210(0x33c)](),_0xbf5641={'start':_0x1e07fa,'end':_0x3b24ab,'duration':_0x3b24ab-_0x1e07fa},_0x4c4258=new Map(),_0x5e6bc8=[];for(const _0x260a85 of _0x1ba180){if(_0x260a85[_0x540210(0x260)]){const _0x1ed494=new Date(_0x260a85[_0x540210(0x260)])[_0x540210(0x1fa)](),_0x1b06bc=_0x260a85['updatedAt']?new Date(_0x260a85['updatedAt'])['getTime']():Date[_0x540210(0x33c)](),_0x29efc1={'start':_0x1ed494,'end':_0x1b06bc,'duration':_0x1b06bc-_0x1ed494};_0x4c4258['set'](_0x260a85['id'],_0x29efc1),_0x5e6bc8[_0x540210(0x1d3)]({'name':_0x260a85[_0x540210(0x2d2)],'state':_0x260a85[_0x540210(0x287)]||_0x540210(0x222),'window':_0x29efc1});}else _0x5e6bc8[_0x540210(0x1d3)]({'name':_0x260a85[_0x540210(0x2d2)],'state':_0x260a85[_0x540210(0x287)]||_0x540210(0x358),'window':undefined});}_0x5e6bc8[_0x540210(0x311)]((_0x243405,_0x576ba6)=>{const _0x23247e=_0x540210;if(!_0x243405[_0x23247e(0x22c)])return 0x1;if(!_0x576ba6['window'])return-0x1;return _0x243405[_0x23247e(0x22c)]['start']-_0x576ba6[_0x23247e(0x22c)][_0x23247e(0x1d2)];});const _0xfad85c=_0x5e6bc8[_0x540210(0x2b4)],_0x5bddb1=_0xfad85c>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x5bddb1&&_0x5e6bc8[_0x540210(0x2d5)](TIMELINE_CONFIG[_0x540210(0x2c3)]);const _0xa1c9e9=calculateTimeScale(_0xbf5641,_0x1dba7c),_0x3fb46c=_0x3a202a[_0x540210(0x341)]?_0x3a202a[_0x540210(0x2bb)]?a55_0x4b0078[_0x540210(0x357)](_0x540210(0x2bb)):a55_0x4b0078['red'](_0x540210(0x26a)):a55_0x4b0078['blue'](_0x540210(0x2e1)),_0x403426=_0x3a202a[_0x540210(0x1db)]?.['id'],_0x49853d=_0x3a202a[_0x540210(0x25d)];let _0x457023;if(_0x403426&&_0x49853d){const _0x3c0d58=getWorkflowAttemptUrl(_0x1fbb42,_0x403426,_0x49853d,_0x3a202a['id']);_0x457023=hyperlink(a55_0x4b0078[_0x540210(0x35c)](_0x3a202a['id']),_0x3c0d58);}else _0x457023=a55_0x4b0078[_0x540210(0x35c)](_0x3a202a['id']);_0x4cd7e5[_0x540210(0x1d3)](_0x540210(0x356)+_0x457023+_0x540210(0x308)+_0x3fb46c+_0x540210(0x308)+formatElapsed(_0xbf5641['duration']));if(_0x5e6bc8[_0x540210(0x2b4)]>0x0){const _0x5dea22=renderTimeAxis(_0xa1c9e9,_0x1dba7c),_0x1d7f01=new Date(_0xbf5641[_0x540210(0x1d2)]),_0x5a197e=formatDate(_0x1d7f01),_0x582df3=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x540210(0x1f1)]+_0x233bc6,_0xfd6566=_0x5a197e['padStart'](_0x582df3),_0x5482f3=a55_0x4b0078[_0x540210(0x35c)](_0xfd6566);_0x4cd7e5[_0x540210(0x1d3)](_0x5482f3+'\x20'+_0x5dea22);for(const _0x492347 of _0x5e6bc8){_0x4cd7e5[_0x540210(0x1d3)](renderTaskRow(_0x492347,_0xa1c9e9,_0x1dba7c,_0x233bc6));}const _0x3017d4=calculateStats(_0x5e6bc8);_0x4cd7e5[_0x540210(0x1d3)](formatStats(_0x3017d4)),_0x5bddb1&&_0x4cd7e5['push'](a55_0x4b0078[_0x540210(0x26e)](_0x540210(0x2ca)+TIMELINE_CONFIG[_0x540210(0x2c3)]+_0x540210(0x2dc)+_0xfad85c+'\x20tasks')),_0x4cd7e5['push'](''),_0x4cd7e5[_0x540210(0x1d3)](a55_0x4b0078['dim']('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x3a202a['id']+_0x540210(0x1f3))+a55_0x4b0078['dim'](_0x540210(0x25b)));}else _0x4cd7e5[_0x540210(0x1d3)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x4cd7e5['join']('\x0a');}[a55_0x1e66bb(0x337)](_0x129249,_0x362429){const _0x268d48=a55_0x1e66bb,_0x58c37d=new Date(_0x129249[_0x268d48(0x269)])[_0x268d48(0x1fa)](),_0x15323a=_0x129249[_0x268d48(0x1d0)]?new Date(_0x129249[_0x268d48(0x1d0)])[_0x268d48(0x1fa)]():Date[_0x268d48(0x33c)](),_0x1c3478=_0x15323a-_0x58c37d,_0x5a9a9f=[];for(const _0x346f5a of _0x362429){if(_0x346f5a[_0x268d48(0x260)]){const _0x250c99=new Date(_0x346f5a[_0x268d48(0x260)])[_0x268d48(0x1fa)](),_0x27a94b=_0x346f5a[_0x268d48(0x339)]?new Date(_0x346f5a['updatedAt'])[_0x268d48(0x1fa)]():Date[_0x268d48(0x33c)]();_0x5a9a9f['push']({'name':_0x346f5a[_0x268d48(0x2d2)],'state':_0x346f5a['state']||_0x268d48(0x222),'window':{'start':_0x250c99,'end':_0x27a94b,'duration':_0x27a94b-_0x250c99}});}else _0x5a9a9f[_0x268d48(0x1d3)]({'name':_0x346f5a['fullName'],'state':_0x346f5a[_0x268d48(0x287)]||_0x268d48(0x358),'window':undefined});}const _0x5e2faf=calculateStats(_0x5a9a9f);return{'attempt':{'id':_0x129249['id'],'status':_0x129249['done']?_0x129249['success']?_0x268d48(0x2bb):_0x268d48(0x26a):_0x268d48(0x2e1),'createdAt':_0x129249[_0x268d48(0x269)],'finishedAt':_0x129249[_0x268d48(0x1d0)],'duration_ms':_0x1c3478},'tasks':_0x5a9a9f[_0x268d48(0x23e)](_0x368041=>({'name':_0x368041[_0x268d48(0x293)],'state':_0x368041[_0x268d48(0x287)],'startedAt':_0x368041[_0x268d48(0x22c)]?new Date(_0x368041[_0x268d48(0x22c)][_0x268d48(0x1d2)])[_0x268d48(0x1f6)]():null,'updatedAt':_0x368041['window']?new Date(_0x368041[_0x268d48(0x22c)][_0x268d48(0x27e)])['toISOString']():null,'duration_ms':_0x368041['window']?.[_0x268d48(0x1d9)]||null})),'stats':_0x5e2faf};}}
1
+ const a55_0x3bfdbb=a55_0x2662;(function(_0xd06b2b,_0x10748f){const _0x53b205=a55_0x2662,_0x775c97=_0xd06b2b();while(!![]){try{const _0x249deb=-parseInt(_0x53b205(0x11c))/0x1+-parseInt(_0x53b205(0x1b8))/0x2+parseInt(_0x53b205(0x152))/0x3+parseInt(_0x53b205(0x15e))/0x4+-parseInt(_0x53b205(0x208))/0x5*(parseInt(_0x53b205(0x1a5))/0x6)+-parseInt(_0x53b205(0x163))/0x7+parseInt(_0x53b205(0x111))/0x8*(parseInt(_0x53b205(0x203))/0x9);if(_0x249deb===_0x10748f)break;else _0x775c97['push'](_0x775c97['shift']());}catch(_0xe0f7e5){_0x775c97['push'](_0x775c97['shift']());}}}(a55_0x5920,0x7c97d));import a55_0x21a99a from'chalk';import{existsSync}from'fs';import a55_0x4cc59e 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 a55_0x3388aa from'prompts';function getAttemptStatusDisplay(_0x38affb){const _0x25a251=a55_0x2662;if(!_0x38affb)return{'icon':'⏳','text':''};const {done:_0x3fed7d,success:_0x3ae051,cancelRequested:_0x2f2063}=_0x38affb;if(!_0x3fed7d)return _0x2f2063?{'icon':'🛑','text':a55_0x21a99a[_0x25a251(0x80)](_0x25a251(0x1e9))}:{'icon':'🔄','text':a55_0x21a99a[_0x25a251(0xfd)](_0x25a251(0x1e4))};if(_0x3ae051)return{'icon':'✅','text':a55_0x21a99a[_0x25a251(0x199)](_0x25a251(0x192))};return{'icon':'❌','text':a55_0x21a99a['red'](_0x25a251(0x1e6))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x313df5,_0x146cca,_0x2b81e3=0x0){return _0x313df5[_0x2b81e3]||_0x146cca['workflowProject'];}[a55_0x3bfdbb(0x184)](_0x356ad1,_0x3c38d5,_0x300076=0x0){const _0x27acb4=a55_0x3bfdbb,_0x25cb54=this[_0x27acb4(0x12b)](_0x356ad1,_0x3c38d5,_0x300076);if(!_0x25cb54)return console[_0x27acb4(0x1e6)](a55_0x21a99a['red'](_0x27acb4(0x10a)),'Project\x20name\x20is\x20required'),console[_0x27acb4(0x1e6)](a55_0x21a99a['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x25cb54;}[a55_0x3bfdbb(0x16a)](_0x263d47,_0x572733){const _0x1ff064=a55_0x3bfdbb;if(_0x263d47[0x0]){const _0x6839b9=_0x263d47[0x0]['split']('.');if(_0x6839b9[_0x1ff064(0x101)]===0x1)return{'projectName':_0x6839b9[0x0],'workflowName':undefined};else return _0x6839b9[_0x1ff064(0x101)]===0x2?{'projectName':_0x6839b9[0x0],'workflowName':_0x6839b9[0x1]}:(console[_0x1ff064(0x1e6)](a55_0x21a99a[_0x1ff064(0x97)]('Error:'),_0x1ff064(0x193)),null);}return{'projectName':_0x572733[_0x1ff064(0x172)],'workflowName':undefined};}[a55_0x3bfdbb(0xf2)](_0x22062d,_0x5e3f47,_0x16998a=0x0){const _0x4ca470=a55_0x3bfdbb;if(_0x22062d[_0x16998a])return _0x22062d[_0x16998a];if(_0x5e3f47[_0x4ca470(0x172)]){const _0x148464=a55_0x4cc59e[_0x4ca470(0x11e)](process[_0x4ca470(0x7f)](),_0x4ca470(0x171),_0x5e3f47[_0x4ca470(0x172)]);if(existsSync(a55_0x4cc59e[_0x4ca470(0x11e)](_0x148464,_0x4ca470(0x14f))))return _0x148464;}return undefined;}async[a55_0x3bfdbb(0x20f)](_0x16abfb,_0x3b3452,_0x3dd94d){const _0x367e52=a55_0x3bfdbb;try{const _0x3c21c9=await _0x16abfb[_0x367e52(0x14e)]['workflows'](_0x3b3452,{'limit':0x1});if(_0x3c21c9[_0x367e52(0x101)]>0x0){const _0x2d5d26=_0x3c21c9[0x0]['id'],_0x1dd727=getWorkflowUrl(_0x3dd94d,_0x2d5d26);console[_0x367e52(0x1e6)](_0x367e52(0xa3)+a55_0x21a99a[_0x367e52(0x12a)](_0x1dd727));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a55_0x3bfdbb(0x1b3)]='workflow:use';['description']=a55_0x3bfdbb(0xdd);async[a55_0x3bfdbb(0xce)](_0x122994){const _0x9d8cf9=a55_0x3bfdbb,{options:_0x724339,args:_0x1f5261,tdx:_0x317140}=_0x122994,_0x59425a=_0x1f5261[0x0],_0x147c17=_0x724339[_0x9d8cf9(0x204)];if(_0x147c17)return saveSessionContext({'workflow_project':undefined},_0x724339[_0x9d8cf9(0x1ea)]),console[_0x9d8cf9(0x10c)](a55_0x21a99a[_0x9d8cf9(0x199)](_0x9d8cf9(0x181))),0x0;if(!_0x59425a)return console[_0x9d8cf9(0x1e6)](a55_0x21a99a[_0x9d8cf9(0x97)]('Error:'),_0x9d8cf9(0xea)),console[_0x9d8cf9(0x1e6)](a55_0x21a99a['dim'](_0x9d8cf9(0xaf))),console[_0x9d8cf9(0x1e6)](a55_0x21a99a[_0x9d8cf9(0x1d6)](_0x9d8cf9(0xf7))),0x1;const _0x227b83=await withSpinner('Resolving\x20project\x20\x27'+_0x59425a+_0x9d8cf9(0x112),()=>_0x317140[_0x9d8cf9(0x14e)]['resolveProjectId'](_0x59425a),{'verbose':_0x724339[_0x9d8cf9(0x1c3)]}),{name:_0x35682d}=_0x227b83[_0x9d8cf9(0x18f)];return saveSessionContext({'workflow_project':_0x35682d},_0x724339[_0x9d8cf9(0x1ea)]),console[_0x9d8cf9(0x10c)](a55_0x21a99a[_0x9d8cf9(0x199)](_0x9d8cf9(0x155)+a55_0x21a99a[_0x9d8cf9(0x12a)](_0x35682d))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a55_0x3bfdbb(0xe1);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x102);async[a55_0x3bfdbb(0xce)](_0x59d318){const _0x2f98b2=a55_0x3bfdbb,{options:_0x5e8837,args:_0x51263b,tdx:_0x4bfa17}=_0x59d318,_0x49e8ab=_0x51263b[0x0];_0x5e8837[_0x2f98b2(0x1c3)]&&_0x49e8ab&&console[_0x2f98b2(0x1e6)](_0x2f98b2(0xf4)+_0x49e8ab);const _0x452629=await withSpinner(_0x2f98b2(0xb6),()=>_0x4bfa17[_0x2f98b2(0x14e)][_0x2f98b2(0x1d4)](_0x49e8ab,{'limit':_0x5e8837[_0x2f98b2(0x76)]}),{'verbose':_0x5e8837[_0x2f98b2(0x1c3)]});let _0x2f7945=_0x452629['data'];_0x2f7945[_0x2f98b2(0x14a)]((_0x2f4096,_0x56253e)=>_0x2f4096[_0x2f98b2(0x1b3)][_0x2f98b2(0x103)](_0x56253e['name']));const _0x498478=_0x5e8837['limit']||0x64,_0x2b8733=_0x2f7945['length']>=_0x498478?a55_0x21a99a[_0x2f98b2(0x1d6)](_0x2f98b2(0xc2)):'';console[_0x2f98b2(0x1e6)](_0x2f98b2(0x197)+_0x2f7945[_0x2f98b2(0x101)]+_0x2f98b2(0xfa)+(_0x2f7945[_0x2f98b2(0x101)]!==0x1?'s':'')+_0x2b8733);if(_0x5e8837[_0x2f98b2(0x1e0)]==='json'||_0x5e8837[_0x2f98b2(0x1e0)]===_0x2f98b2(0xf3)||_0x5e8837[_0x2f98b2(0x1e0)]===_0x2f98b2(0x100))await handleSDKOutput(_0x2f7945,_0x5e8837);else{if(_0x2f7945['length']===0x0)_0x49e8ab?console[_0x2f98b2(0x10c)]('No\x20projects\x20match\x20pattern:\x20'+_0x49e8ab):console[_0x2f98b2(0x10c)](_0x2f98b2(0x156));else{const _0x511fdf=_0x2f7945['map'](_0x5eb18d=>{const _0x13bc9e=_0x2f98b2,_0x4c649c=_0x5eb18d[_0x13bc9e(0x10d)]?.[_0x13bc9e(0x17a)](_0x11d927=>_0x11d927[_0x13bc9e(0x92)]===_0x13bc9e(0x144)),_0x42927b=_0x4c649c?a55_0x21a99a[_0x13bc9e(0x1d6)](_0x13bc9e(0xe5)):'';return _0x13bc9e(0x212)+_0x5eb18d[_0x13bc9e(0x1b3)]+_0x42927b;});await writeOutput(_0x511fdf['join']('\x0a'),_0x5e8837[_0x2f98b2(0x154)],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x123);['description']=a55_0x3bfdbb(0x211);async['execute'](_0x126e92){const _0x3afdfe=a55_0x3bfdbb,{options:_0x2ebc46,args:_0x163a8e,tdx:_0x29a3cf}=_0x126e92,_0x565c63=this[_0x3afdfe(0x12b)](_0x163a8e,_0x2ebc46);_0x2ebc46['verbose']&&_0x565c63&&console[_0x3afdfe(0x1e6)]('Project\x20filter:\x20'+_0x565c63);const _0xae5820=await withSpinner(_0x3afdfe(0x1d3),()=>_0x29a3cf[_0x3afdfe(0x14e)][_0x3afdfe(0x171)](_0x565c63,{'limit':_0x2ebc46[_0x3afdfe(0x76)]}),{'verbose':_0x2ebc46[_0x3afdfe(0x1c3)]});let _0xfab247=_0xae5820[_0x3afdfe(0x18f)];_0xfab247[_0x3afdfe(0x14a)]((_0x162e94,_0x3e40f3)=>{const _0x19d9d8=_0x3afdfe,_0x3682a3=_0x162e94[_0x19d9d8(0x1b3)][_0x19d9d8(0x103)](_0x3e40f3['name']);if(_0x3682a3!==0x0)return _0x3682a3;return(_0x162e94[_0x19d9d8(0xc5)]?.[_0x19d9d8(0x1b3)]||'')[_0x19d9d8(0x103)](_0x3e40f3['project']?.[_0x19d9d8(0x1b3)]||'');});const _0x3a4d56=_0x2ebc46[_0x3afdfe(0x76)]||0x64,_0x2762ff=_0xfab247[_0x3afdfe(0x101)]>=_0x3a4d56?a55_0x21a99a[_0x3afdfe(0x1d6)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3afdfe(0x1e6)](_0x3afdfe(0x197)+_0xfab247[_0x3afdfe(0x101)]+_0x3afdfe(0xad)+(_0xfab247[_0x3afdfe(0x101)]!==0x1?'s':'')+_0x2762ff);if(_0x2ebc46[_0x3afdfe(0x1e0)]===_0x3afdfe(0x106)||_0x2ebc46['format']===_0x3afdfe(0xf3)||_0x2ebc46[_0x3afdfe(0x1e0)]===_0x3afdfe(0x100))await handleSDKOutput(_0xfab247,_0x2ebc46);else{if(_0xfab247[_0x3afdfe(0x101)]===0x0)_0x565c63?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x565c63):console[_0x3afdfe(0x10c)](_0x3afdfe(0x1a7));else{const _0xb150af=_0x2ebc46[_0x3afdfe(0xcb)],_0x2456fd=_0xfab247[_0x3afdfe(0xc6)](_0x5f3d1e=>{const _0x19d486=_0x3afdfe,_0x41667c=a55_0x21a99a[_0x19d486(0x1d6)]('#'+_0x5f3d1e['id']),_0x12bd57=hyperlink(_0x41667c,getWorkflowUrl(_0xb150af,_0x5f3d1e['id'])),_0x5b3616=_0x5f3d1e[_0x19d486(0xc5)]?.[_0x19d486(0x1b3)]?a55_0x21a99a[_0x19d486(0x1d6)]('\x20('+_0x5f3d1e['project'][_0x19d486(0x1b3)]+')'):'';return'📋\x20'+_0x12bd57+'\x20'+_0x5f3d1e['name']+_0x5b3616;});await writeOutput(_0x2456fd[_0x3afdfe(0x11e)]('\x0a'),_0x2ebc46[_0x3afdfe(0x154)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x1d1);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x141);async[a55_0x3bfdbb(0xce)](_0xd3d080){const _0x744330=a55_0x3bfdbb,{options:_0x4e6949,args:_0x256dd2,tdx:_0x525c01}=_0xd3d080,_0xe50c9a=this[_0x744330(0x16a)](_0x256dd2,_0x4e6949);if(!_0xe50c9a)return 0x1;const {projectName:_0x4825ed,workflowName:_0xca529c}=_0xe50c9a;if(_0x4e6949[_0x744330(0x1c3)]){if(_0x4825ed&&_0xca529c)console['error'](_0x744330(0xd6)+_0x4825ed+'.'+_0xca529c);else _0x4825ed&&console[_0x744330(0x1e6)](_0x744330(0xa4)+_0x4825ed);const _0x1efac0=_0x4e6949['status'];_0x1efac0&&console[_0x744330(0x1e6)](_0x744330(0x108)+_0x1efac0);}let _0x97ad48=0x28;if(process[_0x744330(0x105)][_0x744330(0x11b)]&&!_0x4e6949['output']&&!_0x4e6949['format']){const _0x187821=process[_0x744330(0x105)][_0x744330(0x148)]||0x28;_0x97ad48=Math[_0x744330(0x1e5)](0x14,Math[_0x744330(0x14c)](_0x187821*0x2/0x3));}const _0x12fa5d=_0x4e6949[_0x744330(0x76)]||_0x97ad48,_0x33394d=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x525c01[_0x744330(0x14e)]['sessions']({'projectName':_0x4825ed,'workflowName':_0xca529c,'status':_0x4e6949[_0x744330(0x133)],'fromTime':_0x4e6949[_0x744330(0xa0)],'toTime':_0x4e6949['to'],'limit':_0x12fa5d}),{'verbose':_0x4e6949[_0x744330(0x1c3)]}),_0x128566=_0x33394d[_0x744330(0x18f)];_0x128566[_0x744330(0x14a)]((_0xd6198d,_0x4d1dd1)=>{const _0x5aa895=_0x744330,_0x4e8f2f=_0xd6198d['sessionTime']||'',_0x23f7f6=_0x4d1dd1[_0x5aa895(0xe8)]||'';return _0x23f7f6[_0x5aa895(0x103)](_0x4e8f2f);});_0x128566[_0x744330(0x101)]>=_0x12fa5d?console[_0x744330(0x1e6)]('✔\x20Showing\x20'+_0x128566[_0x744330(0x101)]+'\x20sessions\x20'+a55_0x21a99a['dim'](_0x744330(0x1dd))):console[_0x744330(0x1e6)]('✔\x20Found\x20'+_0x128566[_0x744330(0x101)]+'\x20session'+(_0x128566[_0x744330(0x101)]!==0x1?'s':''));if(_0x4e6949['format']===_0x744330(0x106)||_0x4e6949[_0x744330(0x1e0)]==='jsonl'||_0x4e6949['format']===_0x744330(0x100))await handleSDKOutput(_0x128566,_0x4e6949);else{if(!process[_0x744330(0x105)][_0x744330(0x11b)]||_0x4e6949[_0x744330(0x154)]){if(_0x128566['length']===0x0){if(_0x4825ed&&_0xca529c)console[_0x744330(0x10c)](_0x744330(0x116)+_0x4825ed+'.'+_0xca529c);else _0x4825ed?console[_0x744330(0x10c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4825ed):console[_0x744330(0x10c)](_0x744330(0x120));}else{const _0xac3e57=_0x4e6949[_0x744330(0xcb)],_0x574d11=this[_0x744330(0xff)](_0x128566,_0xac3e57);_0x4e6949[_0x744330(0x154)]?await writeOutput(_0x574d11,_0x4e6949[_0x744330(0x154)],_0x744330(0xa8)):console[_0x744330(0x10c)](_0x574d11);}!_0x4825ed&&(console[_0x744330(0x1e6)](''),console[_0x744330(0x1e6)](a55_0x21a99a[_0x744330(0x1d6)](_0x744330(0x95))),console[_0x744330(0x1e6)](a55_0x21a99a[_0x744330(0x1d6)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a55_0x21a99a[_0x744330(0x1d6)](_0x744330(0x8a))));}else{if(_0x128566['length']===0x0){if(_0x4825ed&&_0xca529c)console['log'](_0x744330(0x116)+_0x4825ed+'.'+_0xca529c);else _0x4825ed?console[_0x744330(0x10c)](_0x744330(0x153)+_0x4825ed):console['log']('No\x20sessions\x20found');}else await this[_0x744330(0x1b9)](_0x128566,_0xd3d080,_0x4825ed);}}return 0x0;}[a55_0x3bfdbb(0xff)](_0x31d2d5,_0x21e44b){const _0x18870d=a55_0x3bfdbb,_0x1ee78d=[],_0x212bf0=new Map();let _0x19ce30=Infinity,_0x162672=-Infinity;for(const _0x28baba of _0x31d2d5){if(_0x28baba['lastAttempt']?.[_0x18870d(0xf9)]){const _0x35552e=new Date(_0x28baba[_0x18870d(0x17e)]['createdAt'])[_0x18870d(0x189)](),_0x325de6=_0x28baba['lastAttempt'][_0x18870d(0xb8)]?new Date(_0x28baba[_0x18870d(0x17e)][_0x18870d(0xb8)])[_0x18870d(0x189)]():Date['now'](),_0x1ce920=_0x28baba[_0x18870d(0xc5)]?.[_0x18870d(0x1b3)]||_0x18870d(0x14d);!_0x212bf0[_0x18870d(0x12d)](_0x1ce920)&&_0x212bf0[_0x18870d(0xda)](_0x1ce920,[]),_0x212bf0[_0x18870d(0x1e7)](_0x1ce920)[_0x18870d(0x7a)]({'session':_0x28baba,'startTime':_0x35552e,'endTime':_0x325de6,'duration':_0x325de6-_0x35552e}),_0x19ce30=Math[_0x18870d(0x134)](_0x19ce30,_0x35552e),_0x162672=Math['max'](_0x162672,_0x325de6);}}if(_0x212bf0[_0x18870d(0x94)]===0x0)return _0x18870d(0x175);const _0x3e31e5=process['stdout'][_0x18870d(0xec)]||0x78,_0x65c68=0x1e,_0xb1c45d=0x32,_0x228014=0x4,_0xc595e=Math[_0x18870d(0x134)](_0xb1c45d,Math[_0x18870d(0x1e5)](_0x65c68,Math[_0x18870d(0x14c)](_0x3e31e5*0.3))),_0x2be818=_0x3e31e5-_0xc595e-TIMELINE_CONFIG[_0x18870d(0xba)]-0x3-_0x228014,_0x3ec65c=_0x162672-_0x19ce30,_0x1a7d0f=_0x3ec65c/_0xc595e,_0x4954dd=renderTimeAxis({'startTime':_0x19ce30,'endTime':_0x162672,'durationMs':_0x3ec65c,'msPerChar':_0x1a7d0f},_0xc595e),_0x30e944=[];for(const _0x3a5d79 of _0x212bf0[_0x18870d(0x183)]()){_0x30e944[_0x18870d(0x7a)](..._0x3a5d79);}_0x30e944['sort']((_0x3bbb0c,_0x1b6aa1)=>_0x1b6aa1[_0x18870d(0xbd)]-_0x3bbb0c[_0x18870d(0xbd)]);const _0x24fe5b=new Date(_0x19ce30),_0x110f51=formatDate(_0x24fe5b),_0x21467e=_0x228014+TIMELINE_CONFIG[_0x18870d(0x200)]+TIMELINE_CONFIG[_0x18870d(0x83)]+_0x2be818,_0xf7a6ed='\x20'[_0x18870d(0x8d)](_0x21467e-_0x110f51[_0x18870d(0x101)]),_0x39251c=_0xf7a6ed+a55_0x21a99a['dim'](_0x110f51)+'\x20'+_0x4954dd;_0x1ee78d[_0x18870d(0x7a)](_0x39251c);const _0x593f11=0x16;let _0x3e7376=0x0;for(const _0x353f50 of _0x30e944){const _0x2488ac=_0x353f50[_0x18870d(0x1ea)]['project']?.['name']||'?',_0x201a46=Math[_0x18870d(0x134)](stringWidth(_0x2488ac),_0x593f11);_0x3e7376=Math['max'](_0x3e7376,_0x201a46);}for(const _0x39b701 of _0x30e944){const {session:_0x198dfc,startTime:_0x5430f1,endTime:_0x1730de,duration:_0x47d050}=_0x39b701,_0x3cd200=_0x198dfc[_0x18870d(0xc5)]?.['id'],_0x3eccc9=_0x198dfc['id'],_0x559c18=_0x198dfc[_0x18870d(0xc5)]?.[_0x18870d(0x1b3)]||'?',_0x942865=_0x198dfc['workflow']?.[_0x18870d(0x1b3)]||'?';let _0x3f0f1f,_0x418055;if(_0x198dfc[_0x18870d(0x17e)]){const _0x95e9aa=_0x198dfc[_0x18870d(0x17e)];!_0x95e9aa[_0x18870d(0x13c)]?(_0x3f0f1f=_0x95e9aa[_0x18870d(0x179)]?'🛑':'🔄',_0x418055=_0x95e9aa[_0x18870d(0x179)]?a55_0x21a99a[_0x18870d(0x80)]:a55_0x21a99a[_0x18870d(0xfd)]):(_0x3f0f1f=_0x95e9aa[_0x18870d(0x192)]?'✅':'❌',_0x418055=_0x95e9aa[_0x18870d(0x192)]?a55_0x21a99a['green']:a55_0x21a99a[_0x18870d(0x97)]);}else _0x3f0f1f='⏳',_0x418055=a55_0x21a99a['dim'];const _0x251c1e='#'+_0x3eccc9,_0x3070dd=_0x3cd200?hyperlink(_0x251c1e,getWorkflowSessionUrl(_0x21e44b,_0x3cd200,_0x3eccc9)):_0x251c1e;let _0x3ba42f=_0x559c18;stringWidth(_0x559c18)>_0x593f11&&(_0x3ba42f=_0x559c18[_0x18870d(0x187)](0x0,_0x593f11-0x1)+'…');const _0x226222=a55_0x21a99a[_0x18870d(0x1d6)](_0x3ba42f),_0x3d4130=stringWidth(_0x3ba42f),_0x13ce71='\x20'['repeat'](_0x3e7376-stringWidth(_0x3ba42f)+0x2),_0x17884a='('+formatElapsed(_0x47d050)+')',_0x2ed40a=stringWidth(_0x17884a),_0x2927f6=stringWidth(_0x251c1e),_0xcfaca=_0x2927f6+0x1+_0x3d4130+_0x13ce71[_0x18870d(0x101)],_0x27fa0b=_0x2be818-_0xcfaca-_0x2ed40a-0x1-0x8;let _0x329e97=_0x942865;stringWidth(_0x329e97)>_0x27fa0b&&(_0x329e97=_0x329e97[_0x18870d(0x187)](0x0,_0x27fa0b-0x1)+'…');const _0x4ebae4=_0x3070dd+'\x20'+_0x226222+_0x13ce71+_0x329e97,_0x16fc3c=stringWidth(_0x4ebae4),_0xb0acf6=_0x2be818-_0x16fc3c-_0x2ed40a,_0x40e357=_0x4ebae4+'\x20'['repeat'](Math[_0x18870d(0x1e5)](0x1,_0xb0acf6))+a55_0x21a99a[_0x18870d(0x1d6)](_0x17884a),_0x42af45=Math[_0x18870d(0x14c)]((_0x5430f1-_0x19ce30)/_0x1a7d0f),_0x4fb065=Math[_0x18870d(0x14c)]((_0x1730de-_0x19ce30)/_0x1a7d0f),_0x2927ac=Math[_0x18870d(0x1e5)](_0x42af45+0x1,_0x4fb065),_0x164055=new Array(_0xc595e)[_0x18870d(0x72)]('\x20');for(let _0xd6e21d=_0x42af45;_0xd6e21d<Math[_0x18870d(0x134)](_0x2927ac,_0xc595e);_0xd6e21d++){_0x164055[_0xd6e21d]='─';}const _0x2564ab=_0x164055['map'](_0x376d96=>_0x376d96==='\x20'?'\x20':_0x418055(_0x376d96))[_0x18870d(0x11e)]('');_0x1ee78d['push'](_0x3f0f1f+'\x20'+_0x40e357+'│'+_0x2564ab+'│');}return _0x1ee78d[_0x18870d(0x11e)]('\x0a');}async[a55_0x3bfdbb(0x1b9)](_0x5d1726,_0x52cc6f,_0x242704){const _0x17f718=a55_0x3bfdbb,{options:_0xa39f56,tdx:_0x5427e2}=_0x52cc6f,_0x2ad08b=_0xa39f56[_0x17f718(0xcb)],{timelineRows:_0x1ef8a7,timeAxisHeader:_0x3c7e36}=this['generateSessionTimelineRows'](_0x5d1726,_0x2ad08b),_0x3f4320=_0x1ef8a7[_0x17f718(0x12f)](_0x337371=>_0x337371[_0x17f718(0x11f)]);if(_0x3f4320['length']===0x0){const _0x36a89e=this[_0x17f718(0xff)](_0x5d1726,_0x2ad08b);console[_0x17f718(0x10c)](_0x36a89e);!_0x242704&&(console[_0x17f718(0x1e6)](''),console[_0x17f718(0x1e6)](a55_0x21a99a[_0x17f718(0x1d6)](_0x17f718(0x95))),console[_0x17f718(0x1e6)](a55_0x21a99a[_0x17f718(0x1d6)](_0x17f718(0xef))+'or'+a55_0x21a99a[_0x17f718(0x1d6)](_0x17f718(0x8a))));return;}_0x3c7e36&&console[_0x17f718(0x10c)](_0x3c7e36);const _0x5928c6=_0x1ef8a7[_0x17f718(0x12f)](_0x2474a2=>_0x2474a2[_0x17f718(0x11f)])[_0x17f718(0xc6)](_0x4fcab5=>({'title':_0x4fcab5[_0x17f718(0x71)],'value':_0x4fcab5['attemptId']})),_0x2ac66c=process[_0x17f718(0x105)]['rows']||0x3c,_0x4b047d=Math[_0x17f718(0x1e5)](0x28,Math[_0x17f718(0x14c)](_0x2ac66c*0x2/0x3)),_0x3caa13=await a55_0x3388aa({'type':_0x17f718(0x1bf),'name':_0x17f718(0x11f),'message':_0x17f718(0x90),'choices':_0x5928c6,'initial':-0x1,'limit':_0x4b047d,'clearFirst':!![],'fallback':{'title':_0x17f718(0x122),'value':null},'suggest':(_0x22ec6a,_0x2fdc79)=>{const _0x184145=_0x17f718;if(!_0x22ec6a)return Promise[_0x184145(0x178)](_0x2fdc79);const _0x28b27b=_0x2fdc79['filter'](_0x5504c7=>{const _0x408e2f=_0x184145,_0x3f0a28=_0x5504c7;return _0x3f0a28['title'][_0x408e2f(0xc0)]()[_0x408e2f(0x109)](_0x22ec6a[_0x408e2f(0xc0)]());});return Promise[_0x184145(0x178)](_0x28b27b);}}),_0xfa35e7=()=>{const _0x340288=_0x17f718;process[_0x340288(0x105)]['write']('\x1b[1A\x1b[2K'),process[_0x340288(0x105)][_0x340288(0x8b)](_0x340288(0x1c1)),process[_0x340288(0x105)][_0x340288(0x8b)](_0x340288(0x1c1));},_0x32f6c7=_0x3caa13&&_0x3caa13[_0x17f718(0x11f)]&&_0x3caa13[_0x17f718(0x11f)]!==null&&_0x3caa13['attemptId'][_0x17f718(0xc3)]()!=='';if(!_0x32f6c7){_0xfa35e7(),console[_0x17f718(0x10c)](a55_0x21a99a[_0x17f718(0x1d6)]('Cancelled'));return;}_0xfa35e7();const _0x3db0a7=_0x5d1726['find'](_0xf43a08=>_0xf43a08[_0x17f718(0x17e)]?.['id']===_0x3caa13[_0x17f718(0x11f)]);if(_0x3db0a7){const _0x2ca2b2=_0x3db0a7[_0x17f718(0xc5)]?.[_0x17f718(0x1b3)]||'?',_0x17da67=_0x3db0a7[_0x17f718(0x14e)]?.[_0x17f718(0x1b3)]||'?';console['log']('Project:\x20'+a55_0x21a99a[_0x17f718(0x1d6)](_0x2ca2b2)+',\x20Workflow:\x20'+a55_0x21a99a['dim'](_0x17da67));}const _0x509efe=new WorkflowTimelineCommand();await _0x509efe[_0x17f718(0xce)]({'args':[],'options':{..._0xa39f56,'attemptId':_0x3caa13[_0x17f718(0x11f)]},'tdx':_0x5427e2});}[a55_0x3bfdbb(0x214)](_0x44e313,_0x396817){const _0x5d894b=a55_0x3bfdbb,_0x12e5e6=new Map();for(const _0x5af065 of _0x44e313){_0x5af065['id']&&_0x5af065[_0x5d894b(0x17e)]?.['id']&&_0x12e5e6['set'](_0x5af065['id'],_0x5af065[_0x5d894b(0x17e)]['id']);}const _0x4bfbdb=[];let _0x92ac7c='';const _0x28448b=this[_0x5d894b(0xff)](_0x44e313,_0x396817),_0xbfae95=_0x28448b[_0x5d894b(0x99)]('\x0a');for(const _0xc1f929 of _0xbfae95){if(_0xc1f929[_0x5d894b(0x1db)](_0x5d894b(0x177))||_0xc1f929[_0x5d894b(0x165)](/^\s+\d{4}-\d{2}-\d{2}/))_0x92ac7c=_0xc1f929;else{if(_0xc1f929[_0x5d894b(0x165)](/^[✅❌🔄🛑⏳]/)){const _0x1f7c6b=_0xc1f929[_0x5d894b(0x165)](/#(\d+)/),_0x153ab2=_0x1f7c6b?_0x1f7c6b[0x1]:null,_0x26365f=_0x153ab2?_0x12e5e6[_0x5d894b(0x1e7)](_0x153ab2)||null:null,_0x36b1f1=_0x44e313['find'](_0x28bc56=>_0x28bc56['id']===_0x153ab2),_0x489b4f=_0x36b1f1?.['project']?.[_0x5d894b(0x1b3)]||'';_0x4bfbdb[_0x5d894b(0x7a)]({'displayLine':_0xc1f929,'attemptId':_0x26365f,'projectName':_0x489b4f});}}}return{'timelineRows':_0x4bfbdb,'timeAxisHeader':_0x92ac7c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]='workflow:attempts';[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x7e);async[a55_0x3bfdbb(0xce)](_0x3a8384){const _0x262d44=a55_0x3bfdbb,{options:_0x40a8ac,args:_0x54a771,tdx:_0x52b946}=_0x3a8384,_0xc8c745=this[_0x262d44(0x16a)](_0x54a771,_0x40a8ac);if(!_0xc8c745)return 0x1;const {projectName:_0x51c6ec,workflowName:_0x199c7a}=_0xc8c745,_0x3e5856=_0x40a8ac[_0x262d44(0x194)];if(_0x40a8ac['verbose']){if(_0x51c6ec&&_0x199c7a)console['error'](_0x262d44(0xd6)+_0x51c6ec+'.'+_0x199c7a);else _0x51c6ec&&console[_0x262d44(0x1e6)](_0x262d44(0xa4)+_0x51c6ec);_0x3e5856&&console[_0x262d44(0x1e6)](_0x262d44(0x1f6));}const _0x2208b6=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x52b946[_0x262d44(0x14e)][_0x262d44(0x86)]({'projectName':_0x51c6ec,'workflowName':_0x199c7a,'includeRetried':_0x3e5856,'limit':_0x40a8ac[_0x262d44(0x76)]}),{'verbose':_0x40a8ac[_0x262d44(0x1c3)]}),_0x189f42=_0x2208b6[_0x262d44(0x18f)],_0x3a5737=_0x40a8ac[_0x262d44(0x76)]||0x64,_0x40f38c=_0x189f42[_0x262d44(0x101)]>=_0x3a5737?a55_0x21a99a['dim'](_0x262d44(0xc2)):'';console['error'](_0x262d44(0x197)+_0x189f42[_0x262d44(0x101)]+_0x262d44(0x215)+(_0x189f42['length']!==0x1?'s':'')+_0x40f38c);if(_0x40a8ac[_0x262d44(0x1e0)]===_0x262d44(0x106)||_0x40a8ac['format']===_0x262d44(0xf3)||_0x40a8ac[_0x262d44(0x1e0)]==='table')await handleSDKOutput(_0x189f42,_0x40a8ac);else{if(_0x189f42[_0x262d44(0x101)]===0x0){if(_0x51c6ec&&_0x199c7a)console[_0x262d44(0x10c)](_0x262d44(0x1fb)+_0x51c6ec+'.'+_0x199c7a);else _0x51c6ec?console['log'](_0x262d44(0x15d)+_0x51c6ec):console[_0x262d44(0x10c)](_0x262d44(0x15b));}else{const _0x31821a=_0x40a8ac[_0x262d44(0xcb)],_0x28a900=_0x189f42[_0x262d44(0xc6)](_0x5a4147=>{const _0xd7f347=_0x262d44,_0x34d273=a55_0x21a99a['dim']('#'+_0x5a4147['id']),_0x210faa=_0x5a4147[_0xd7f347(0xc5)]?.['id'],_0x412f0b=_0x5a4147[_0xd7f347(0x125)]||_0x5a4147[_0xd7f347(0x129)],_0x15c8c1=_0x210faa&&_0x412f0b?hyperlink(_0x34d273,getWorkflowAttemptUrl(_0x31821a,_0x210faa,_0x412f0b,_0x5a4147['id'])):_0x34d273,{icon:_0x819cec,text:_0x2c47b4}=getAttemptStatusDisplay(_0x5a4147),_0x9f1660=(_0x5a4147['project']?.['name']||'?')+'.'+(_0x5a4147[_0xd7f347(0x14e)]?.[_0xd7f347(0x1b3)]||'?'),_0x1efc48=_0x5a4147['sessionTime']?a55_0x21a99a[_0xd7f347(0x1d6)](_0x5a4147[_0xd7f347(0xe8)]):'';return(_0x15c8c1+'\x20'+_0x819cec+(_0x2c47b4?'\x20'+_0x2c47b4:'')+'\x20'+_0x9f1660+'\x20'+_0x1efc48)['trimEnd']();});await writeOutput(_0x28a900[_0x262d44(0x11e)]('\x0a'),_0x40a8ac[_0x262d44(0x154)],_0x262d44(0xa8));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a55_0x3bfdbb(0x8c)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x517fdb){const _0x536cb6=a55_0x3bfdbb,{options:_0x50ec9f,args:_0x51b2d8,tdx:_0x12a8ed}=_0x517fdb,_0x33d8d7=_0x51b2d8[0x0];if(!_0x33d8d7)return console['error'](_0x536cb6(0x73)),0x1;_0x50ec9f[_0x536cb6(0x1c3)]&&console[_0x536cb6(0x1e6)]('Attempt\x20ID:\x20'+_0x33d8d7);const _0x268b38=await withSpinner(_0x536cb6(0xb3),()=>_0x12a8ed[_0x536cb6(0x14e)]['attempt'](_0x33d8d7),{'verbose':_0x50ec9f[_0x536cb6(0x1c3)]}),_0x5022c9=_0x268b38['data'];let _0x5659fc;!_0x5022c9[_0x536cb6(0x13c)]?_0x5659fc=_0x5022c9[_0x536cb6(0x179)]?'canceling':'running':_0x5659fc=_0x5022c9[_0x536cb6(0x192)]?_0x536cb6(0x192):_0x536cb6(0x1e6);let _0x490110;if(_0x5022c9[_0x536cb6(0xf9)]&&_0x5022c9['finishedAt']){const _0x22490e=new Date(_0x5022c9[_0x536cb6(0xf9)])[_0x536cb6(0x189)](),_0x497dec=new Date(_0x5022c9[_0x536cb6(0xb8)])['getTime']();_0x490110=Math[_0x536cb6(0xcf)]((_0x497dec-_0x22490e)/0x3e8);}const _0x17cb6e={'attempt_id':_0x5022c9['id'],'status':_0x5659fc,..._0x5022c9[_0x536cb6(0x1c5)]!==undefined&&{'index':_0x5022c9[_0x536cb6(0x1c5)]},..._0x5022c9[_0x536cb6(0xc5)]&&{'project':_0x5022c9['project'][_0x536cb6(0x1b3)]},..._0x5022c9[_0x536cb6(0x14e)]&&{'workflow':_0x5022c9[_0x536cb6(0x14e)][_0x536cb6(0x1b3)]},..._0x5022c9[_0x536cb6(0x129)]&&{'session_id':_0x5022c9[_0x536cb6(0x129)]},..._0x5022c9[_0x536cb6(0xe8)]&&{'session_time':_0x5022c9['sessionTime']},..._0x5022c9[_0x536cb6(0x1d0)]&&{'retry_attempt':_0x5022c9[_0x536cb6(0x1d0)]},..._0x490110!==undefined&&{'duration_sec':_0x490110},..._0x5022c9[_0x536cb6(0xf9)]&&{'created_at':_0x5022c9[_0x536cb6(0xf9)]},..._0x5022c9[_0x536cb6(0xb8)]&&{'finished_at':_0x5022c9[_0x536cb6(0xb8)]},...Object[_0x536cb6(0x1c6)](_0x5022c9[_0x536cb6(0x1a3)])[_0x536cb6(0x101)]>0x0&&{'params':_0x5022c9['params']}};return await handleSingleObjectOutput(_0x17cb6e,_0x50ec9f),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a55_0x3bfdbb(0x166);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x174);async[a55_0x3bfdbb(0xce)](_0x333cc7){const _0x4c2370=a55_0x3bfdbb,{options:_0x57d530,args:_0x5a28a5,tdx:_0x5d57e7}=_0x333cc7,_0x5ce899=_0x5a28a5[0x0];if(!_0x5ce899)return console[_0x4c2370(0x1e6)](_0x4c2370(0x73)),0x1;const _0x201a22=_0x57d530[_0x4c2370(0xb9)];_0x57d530[_0x4c2370(0x1c3)]&&(console['error'](_0x4c2370(0xdf)+_0x5ce899),_0x201a22&&console[_0x4c2370(0x1e6)](_0x4c2370(0x10b)));const _0x2802e8=await withSpinner(_0x4c2370(0x128),()=>_0x5d57e7['workflow'][_0x4c2370(0x1cd)](_0x5ce899,_0x201a22||![]),{'verbose':_0x57d530[_0x4c2370(0x1c3)]}),_0x20c543=_0x2802e8[_0x4c2370(0x18f)];return console[_0x4c2370(0x1e6)](_0x4c2370(0x197)+_0x20c543[_0x4c2370(0x101)]+_0x4c2370(0x16d)+(_0x20c543['length']!==0x1?'s':'')),await handleSDKOutput(_0x20c543,_0x57d530),0x0;}}function a55_0x5920(){const _0x56d498=['Target:\x20','startsWith','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','(use\x20--limit\x20to\x20see\x20more)','Source:\x20','summary','format','stat','newProjectName','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','running','max','error','get','padStart','canceling','session','Fetching\x20log\x20files...','revision:\x20','Source\x20project:\x20','LABEL_MIN_SPACING','⚠\x20Showing\x20first\x20','\x22\x20to\x20new\x20project\x20\x22','---\x20','✔\x20Pushed\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','prepareCloneProject','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Include\x20retried:\x20yes','MAX_TIMELINE_WIDTH','task','deleted','kill','No\x20attempts\x20found\x20for:\x20','Downloading\x20logs...','Source\x20directory\x20is\x20required','Resume\x20from:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','ICON_WIDTH','Retrying\x20attempt...','\x0aPush\x20these\x20changes?','2686581KUzQqf','clear','listSecrets','delete','Source\x20directory:\x20','65AyJHiu','✔\x20Downloaded\x20','Validation:\x20skipped','Revision:\x20','\x20\x20Revision:\x20','sessions','✔\x20Secret\x20\x27','showWorkflowConsoleUrl','Select\x20a\x20session\x20to\x20view\x20timeline:','List\x20workflows','📁\x20','download','generateSessionTimelineRows','\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','MAX_LABEL_COUNT','displayLine','fill','Error:\x20Attempt\x20ID\x20is\x20required','buildTimelineData','Key:\x20','limit','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','getHours','replace','push','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Params:\x20','\x20of\x20','List\x20workflow\x20attempts','cwd','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a✔\x20No\x20changes\x20to\x20push','ICON_SPACING','...','skipValidation','attempts','MIN_LABEL_COUNT','New\x20project\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20\x20tdx\x20wf\x20use\x20<project>','write','description','repeat','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x27\x20from\x20project\x20\x27','key','\x20\x20Project:\x20','size','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20modified','red','dryRun','split','Usage:\x20workflow:delete\x20<project-name-or-id>','end','new','now','path','select','from','workflow:timeline','✔\x20Project\x20updated','\x20\x20Console:\x20','Filter:\x20project=','workflow:download','\x20\x20Source:\x20','\x20\x20Workflow:\x20','list','startedAt','Listing\x20secrets...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','targetExists','\x20workflow','\x20\x20Session\x20ID:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','existingProjectId','toISOString','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Getting\x20attempt\x20details...','✔\x20Pull\x20complete','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Listing\x20workflow\x20projects...','fullName','finishedAt','includeSubtasks','GUTTER','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','getMinutes','startTime','changes','workflow:retry','toLowerCase','durationMs','\x20(use\x20--limit\x20to\x20show\x20more)','trim','\x20\x20Target:\x20','project','map','renderTimeline','Pushing\x20project...','\x0aError:','\x20\x20Project\x20ID:\x20','site','\x0a✔\x20Already\x20up\x20to\x20date','diff','execute','round','msPerChar','\x20unchanged','applyPullProject','unknown','\x0aApply\x20these\x20changes?','Killing\x20attempt...','Filter:\x20','pullProject','Dry\x20run:\x20yes','sourceDir','set','updatedAt','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Attempt\x20ID:\x20','workflow:pull','workflow:projects','Project\x20name:\x20','Kill\x20a\x20running\x20attempt','workflow:push','\x20(system)','Project:\x20','Setting\x20secret...','sessionTime','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Project\x20name\x20is\x20required','projectName','columns','force','Error:\x20Project\x20name\x20is\x20required','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Updating\x20','relative','resolveProjectDir','jsonl','Pattern:\x20','duration','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','isDirectory','createdAt','\x20project','all','every','blue','\x20\x20Changes:\x20','renderSessionsTimeline','table','length','List\x20all\x20workflow\x20projects','localeCompare','start','stdout','json','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Status:\x20','includes','Error:','Including\x20subtasks:\x20yes','log','metadata','projectId','workflowName','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','72ZnccpG','\x27...','workflow:secrets:list','\x20logs','TASK_NAME_WIDTH','No\x20sessions\x20found\x20for:\x20','planned','\x20-\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','✔\x20Clone\x20complete','isTTY','883331JUIcju','✔\x20Project:\x20','join','attemptId','No\x20sessions\x20found','parse','No\x20matching\x20sessions\x20found','workflow:workflows','\x0a⚠\x20Project\x20\x22','session_id','\x20\x20Session\x20context\x20set\x20to:\x20','run','Getting\x20attempt\x20tasks...','sessionId','cyan','resolveProject','renderSingleTimeline','has','\x20tasks','filter','attempt','\x20to\x20see\x20detailed\x20logs','getDate','status','min','reason','Task\x20name:\x20','filesExtracted','Warning:','newProjectId','getFullYear','context','done','workflow:logs','Session\x20time:\x20','fromTask','state','List\x20workflow\x20execution\x20sessions','Pulling\x20project\x20','Cloning\x20to\x20','sys','\x0aClone\x20\x22','substring','Failed\x20to\x20fetch\x20attempt\x20data','rows','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','sort','Invalid\x20format:\x20','floor','(unknown)','workflow','tdx.json','→\x20Project:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2005056GVpvfo','No\x20sessions\x20found\x20in\x20project:\x20','output','✔\x20Workflow\x20project\x20set\x20to:\x20','No\x20workflow\x20projects\x20found','\x20new','\x20\x20New\x20attempt\x20ID:\x20','retryAttempt','\x20has\x20no\x20attempts','No\x20attempts\x20found','workflow:delete','No\x20attempts\x20found\x20in\x20project:\x20','530264vxTvfM','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','revision','5092878dVhpSC','workflow:kill','match','workflow:tasks','Pushing\x20workflow\x20project...','follow','resumeFrom','parseProjectWorkflowPattern','getMonth','pollTimeline','\x20task','✔\x20Workflow\x20run\x20started','yes','\x20is\x20not\x20a\x20directory','workflows','workflowProject','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Show\x20tasks\x20for\x20an\x20attempt','No\x20sessions\x20with\x20timing\x20information','Retrying\x20session...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','resolve','cancelRequested','some','Error:\x20Invalid\x20JSON\x20in\x20--params','total','LABEL_WIDTH_DIVISOR','lastAttempt','retrySession','taskName','✔\x20Workflow\x20project\x20context\x20cleared.','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','values','requireProject','deleteSecret','Project\x20directory:\x20','slice','modified','getTime','\x22\x20with\x20new\x20revision?','sourceProjectName','basename','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20secrets...','data','fs/promises','unchanged','success','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','includeRetried','\x20deleted','Tip:\x20cd\x20to\x20workflows/','✔\x20Found\x20','targetDir','green','utf-8','/sessions/','Downloading\x20project\x20','No\x20workflow\x20sessions\x20found','\x0aDry\x20run\x20-\x20no\x20project\x20created','group_error','Attempt:\x20','param','Setting\x20','params','\x20secret','404526oBbDwA','.\x20Expected\x20format:\x20KEY=VALUE','No\x20workflows\x20found','POLL_INTERVAL_MS','MAX_TASKS_DISPLAY','window','workflow:upload','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x0aPolling...\x20(','Expected\x20format:\x20--param\x20key=value','\x0aDry\x20run\x20-\x20no\x20files\x20written','Loading\x20sessions...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','name','hasChanges','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','isNewProject','Cancelled','979616SMfgYg','navigateSessionsInteractive','Using\x20attempt\x20','fileSize','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Location:\x20','workflow:secrets:delete','autocomplete','executePushProject','\x1b[1A\x1b[2K','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','verbose','Retry\x20a\x20session\x20or\x20attempt','index','keys','Output\x20directory:\x20','✔\x20Deleted\x20project\x20','tdx\x20wf\x20attempt\x20','workflow:clone','Pull\x20workflow\x20project\x20to\x20local\x20folder','find','tasks','✔\x20Push\x20complete','MIN_TIMELINE_WIDTH','retryAttemptName','workflow:sessions','\x20\x20Attempt\x20ID:\x20','Listing\x20workflows...','projects','No\x20log\x20content\x20found','dim','message','-\x20nothing\x20pushed','/app/workflows/'];a55_0x5920=function(){return _0x56d498;};return a55_0x5920();}export class WorkflowLogsCommand extends BaseCommand{['name']=a55_0x3bfdbb(0x13d);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0xe9);async[a55_0x3bfdbb(0xce)](_0x47e243){const _0x4c9937=a55_0x3bfdbb,{options:_0x53596c,args:_0x593100,tdx:_0x3b29e3}=_0x47e243,_0x4bb4ec=_0x593100[0x0];let _0x22f14b=_0x593100[0x1];if(!_0x4bb4ec)return console[_0x4c9937(0x1e6)](_0x4c9937(0x73)),0x1;_0x53596c[_0x4c9937(0x1c3)]&&(console['error'](_0x4c9937(0xdf)+_0x4bb4ec),_0x22f14b&&console[_0x4c9937(0x1e6)](_0x4c9937(0x136)+_0x22f14b));const _0x47e97d=await withSpinner(_0x4c9937(0x1eb),()=>_0x3b29e3[_0x4c9937(0x14e)]['logFiles'](_0x4bb4ec,_0x22f14b),{'verbose':_0x53596c[_0x4c9937(0x1c3)]}),_0x484e03=_0x47e97d['data'];if(_0x484e03[_0x4c9937(0x101)]===0x0)return console['error'](_0x4c9937(0x7b)),0x0;if(!_0x22f14b&&(_0x53596c['json']||_0x53596c['format']))return await handleSDKOutput(_0x484e03,_0x53596c),0x0;if(!_0x22f14b){const _0x2b70bc=_0x484e03[_0x4c9937(0xc6)](_0x273b71=>({'title':_0x273b71[_0x4c9937(0x180)]+'\x20('+formatBytes(_0x273b71[_0x4c9937(0x1bb)])+')','value':_0x273b71['taskName']})),_0x721609=await a55_0x3388aa({'type':_0x4c9937(0x9f),'name':_0x4c9937(0x1f8),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x2b70bc});if(!_0x721609['task'])return console[_0x4c9937(0x1e6)](_0x4c9937(0x1b7)),0x0;_0x22f14b=_0x721609[_0x4c9937(0x1f8)];}const _0x19541d=await withSpinner(_0x4c9937(0x1fc),()=>_0x3b29e3[_0x4c9937(0x14e)]['logs'](_0x4bb4ec,_0x22f14b),{'verbose':_0x53596c['verbose']}),_0x542214=_0x19541d[_0x4c9937(0x18f)];return _0x542214?console['log'](_0x542214):console['error'](_0x4c9937(0x1d5)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x164);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0xe3);async[a55_0x3bfdbb(0xce)](_0x581d1f){const _0x3930c9=a55_0x3bfdbb,{options:_0xd0b067,args:_0x1c820b,tdx:_0x18360d}=_0x581d1f,_0x381f60=_0x1c820b[0x0];if(!_0x381f60)return console[_0x3930c9(0x1e6)](_0x3930c9(0x73)),0x1;const _0x424319=_0xd0b067[_0x3930c9(0x135)];_0xd0b067['verbose']&&(console[_0x3930c9(0x1e6)](_0x3930c9(0xdf)+_0x381f60),_0x424319&&console[_0x3930c9(0x1e6)]('Reason:\x20'+_0x424319));if(!_0xd0b067[_0x3930c9(0x16f)]){if(!isInteractive())return console[_0x3930c9(0x1e6)](a55_0x21a99a['red']('\x0aError:'),_0x3930c9(0x161)),console[_0x3930c9(0x1e6)](a55_0x21a99a[_0x3930c9(0x1d6)](_0x3930c9(0x81))),0x1;const _0x135824=await confirmKey(_0x3930c9(0xf6)+_0x381f60+'?');if(!_0x135824)return console[_0x3930c9(0x1e6)](a55_0x21a99a[_0x3930c9(0x80)](_0x3930c9(0x1b7))),0x1;}const _0x26ac61=await withSpinner(_0x3930c9(0xd5),()=>_0x18360d['workflow'][_0x3930c9(0x1fa)](_0x381f60,_0x424319),{'verbose':_0xd0b067[_0x3930c9(0x1c3)]}),_0x5d2966=_0x26ac61[_0x3930c9(0x18f)];return console['error']('✔\x20'+_0x5d2966),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0xbf);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x1c4);async[a55_0x3bfdbb(0xce)](_0x1445c9){const _0x39f3a7=a55_0x3bfdbb,{options:_0xf786c6,args:_0x3db5ae,tdx:_0x3cd5af}=_0x1445c9,_0xea78b8=_0x3db5ae[0x0];if(!_0xea78b8)return console['error'](_0x39f3a7(0x1bc)),console[_0x39f3a7(0x1e6)](_0x39f3a7(0x1b1)),0x1;let _0x2f508b=![],_0x3174bb=_0xea78b8;if(_0xea78b8[_0x39f3a7(0x1db)]('session:'))_0x2f508b=!![],_0x3174bb=_0xea78b8['substring'](0x8);else{if(_0xea78b8[_0x39f3a7(0x1db)]('attempt:'))_0x2f508b=![],_0x3174bb=_0xea78b8[_0x39f3a7(0x146)](0x8);else return console[_0x39f3a7(0x1e6)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x39f3a7(0x1b1)),0x1;}const _0x586f15=_0xf786c6[_0x39f3a7(0x13f)],_0x33e602=_0xf786c6[_0x39f3a7(0x169)],_0xc2fcd1=_0xf786c6[_0x39f3a7(0x1a3)],_0x31c77a=_0xf786c6[_0x39f3a7(0xed)];_0xf786c6['verbose']&&(console[_0x39f3a7(0x1e6)](_0x39f3a7(0x1da)+(_0x2f508b?_0x39f3a7(0x1ea):_0x39f3a7(0x130))+'\x20'+_0x3174bb),_0x586f15&&console[_0x39f3a7(0x1e6)]('From\x20task:\x20'+_0x586f15),_0x33e602&&console[_0x39f3a7(0x1e6)](_0x39f3a7(0x1fe)+_0x33e602),_0xc2fcd1&&console['error'](_0x39f3a7(0x7c)+_0xc2fcd1),_0x31c77a&&console[_0x39f3a7(0x1e6)]('Force:\x20yes'));let _0x507f9d;if(_0xc2fcd1)try{if(_0xc2fcd1['startsWith']('@')){const _0x592d9d=await import(_0x39f3a7(0x190)),_0x5b6039=_0xc2fcd1[_0x39f3a7(0x146)](0x1),_0x7fdb6a=await _0x592d9d['readFile'](_0x5b6039,_0x39f3a7(0x19a));_0x507f9d=JSON[_0x39f3a7(0x121)](_0x7fdb6a);}else _0x507f9d=JSON[_0x39f3a7(0x121)](_0xc2fcd1);}catch{return console[_0x39f3a7(0x1e6)](_0x39f3a7(0x17b)),0x1;}if(!_0xf786c6[_0x39f3a7(0x16f)]){if(!isInteractive())return console[_0x39f3a7(0x1e6)](a55_0x21a99a[_0x39f3a7(0x97)](_0x39f3a7(0xc9)),_0x39f3a7(0x161)),console[_0x39f3a7(0x1e6)](a55_0x21a99a['dim'](_0x39f3a7(0x81))),0x1;const _0x33eed9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2f508b?_0x39f3a7(0x1ea):_0x39f3a7(0x130))+'\x20'+_0x3174bb+'?');if(!_0x33eed9)return console[_0x39f3a7(0x1e6)](a55_0x21a99a[_0x39f3a7(0x80)]('Cancelled')),0x1;}let _0x26cdc9;_0x2f508b?_0x26cdc9=await withSpinner(_0x39f3a7(0x176),()=>_0x3cd5af[_0x39f3a7(0x14e)][_0x39f3a7(0x17f)](_0x3174bb,{'fromTask':_0x586f15,'retryParams':_0x507f9d}),{'verbose':_0xf786c6[_0x39f3a7(0x1c3)]}):_0x26cdc9=await withSpinner(_0x39f3a7(0x201),()=>_0x3cd5af['workflow'][_0x39f3a7(0x159)](_0x3174bb,{'resumeFrom':_0x33e602,'retryParams':_0x507f9d,'force':_0x31c77a}),{'verbose':_0xf786c6[_0x39f3a7(0x1c3)]});const _0x3ce978=_0x26cdc9[_0x39f3a7(0x18f)];return console[_0x39f3a7(0x1e6)]('✔\x20Retry\x20started'),console['error'](_0x39f3a7(0x158)+_0x3ce978[_0x39f3a7(0x11f)]),console['error'](_0x39f3a7(0xae)+_0x3ce978[_0x39f3a7(0x129)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]='workflow:run';['description']='Start\x20a\x20workflow\x20run';async['execute'](_0x202da2){const _0x161f48=a55_0x3bfdbb,{options:_0x52e5dd,args:_0x1e2735,tdx:_0x53f7ce}=_0x202da2;let _0xf69da2=_0x1e2735[0x0];if(!_0xf69da2){const _0xdfb2a7=this[_0x161f48(0x12b)]([],_0x52e5dd),_0x13a035=await withSpinner('Loading\x20workflows...',()=>_0x53f7ce[_0x161f48(0x14e)]['workflows'](_0xdfb2a7,{'limit':_0x52e5dd[_0x161f48(0x76)]}),{'verbose':_0x52e5dd[_0x161f48(0x1c3)]}),_0x48c654=_0x13a035[_0x161f48(0x18f)];if(_0x48c654[_0x161f48(0x101)]===0x0)return console[_0x161f48(0x1e6)](_0x161f48(0x1a7)),!_0xdfb2a7&&console[_0x161f48(0x1e6)](a55_0x21a99a[_0x161f48(0x1d6)](_0x161f48(0xdc))),0x1;const _0x4e4e6a=_0x48c654[_0x161f48(0xc6)](_0x42db15=>({'title':_0x42db15[_0x161f48(0xc5)]?.[_0x161f48(0x1b3)]+'.'+_0x42db15[_0x161f48(0x1b3)],'value':_0x42db15['project']?.[_0x161f48(0x1b3)]+'.'+_0x42db15[_0x161f48(0x1b3)],'description':_0x42db15['revision']?_0x161f48(0x1ec)+_0x42db15[_0x161f48(0x162)]:undefined})),_0x48e886=await a55_0x3388aa({'type':_0x161f48(0x9f),'name':_0x161f48(0x14e),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x4e4e6a});if(!_0x48e886[_0x161f48(0x14e)])return 0x1;_0xf69da2=_0x48e886['workflow'];}if(!_0xf69da2[_0x161f48(0x109)]('.')){const _0x4e8641=this[_0x161f48(0x12b)]([],_0x52e5dd);if(_0x4e8641)_0xf69da2=_0x4e8641+'.'+_0xf69da2;else return console['error'](a55_0x21a99a[_0x161f48(0x97)](_0x161f48(0x10a)),_0x161f48(0x1ff)),console[_0x161f48(0x1e6)](a55_0x21a99a[_0x161f48(0x1d6)](_0x161f48(0xdc))),0x1;}const _0x56725a=_0x52e5dd[_0x161f48(0x1a1)],_0x3adbae=_0x52e5dd[_0x161f48(0xe8)],_0x264e81={};if(_0x56725a&&Array['isArray'](_0x56725a))for(const _0x2f1bac of _0x56725a){const _0x2ac4d6=_0x2f1bac['indexOf']('=');if(_0x2ac4d6===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2f1bac),console[_0x161f48(0x1e6)](_0x161f48(0x1ae)),0x1;const _0x216ef7=_0x2f1bac[_0x161f48(0x146)](0x0,_0x2ac4d6),_0x16505f=_0x2f1bac['substring'](_0x2ac4d6+0x1);try{_0x264e81[_0x216ef7]=JSON['parse'](_0x16505f);}catch{_0x264e81[_0x216ef7]=_0x16505f;}}_0x52e5dd[_0x161f48(0x1c3)]&&(console[_0x161f48(0x1e6)]('Workflow:\x20'+_0xf69da2),Object['keys'](_0x264e81)[_0x161f48(0x101)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x264e81)),_0x3adbae&&console[_0x161f48(0x1e6)](_0x161f48(0x13e)+_0x3adbae));const _0x2a407c=await withSpinner('Starting\x20workflow\x20run...',()=>_0x53f7ce['workflow'][_0x161f48(0x127)](_0xf69da2,_0x264e81,{'sessionTime':_0x3adbae}),{'verbose':_0x52e5dd[_0x161f48(0x1c3)]}),_0x38e0a5=_0x2a407c[_0x161f48(0x18f)];console[_0x161f48(0x1e6)](_0x161f48(0x16e)),console[_0x161f48(0x1e6)](_0x161f48(0x1d2)+_0x38e0a5['id']),console[_0x161f48(0x1e6)](_0x161f48(0xae)+_0x38e0a5[_0x161f48(0x129)]),console[_0x161f48(0x1e6)](_0x161f48(0x93)+_0x38e0a5[_0x161f48(0xc5)]?.[_0x161f48(0x1b3)]),console[_0x161f48(0x1e6)](_0x161f48(0xa7)+_0x38e0a5[_0x161f48(0x14e)]?.[_0x161f48(0x1b3)]);if(_0x38e0a5[_0x161f48(0xc5)]?.['id']&&_0x38e0a5[_0x161f48(0x129)]&&_0x38e0a5['id']){const _0x215eb5=_0x52e5dd[_0x161f48(0xcb)],_0xe00852=getConsoleUrl(_0x215eb5,_0x161f48(0x1d9)+_0x38e0a5[_0x161f48(0xc5)]['id']+_0x161f48(0x19b)+_0x38e0a5[_0x161f48(0x129)]+'/attempt/'+_0x38e0a5['id']);console[_0x161f48(0x1e6)]('\x20\x20Console:\x20'+a55_0x21a99a[_0x161f48(0x12a)](_0xe00852));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a55_0x3bfdbb(0xa5);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x1ac);async['execute'](_0x37e737){const _0x5f4afe=a55_0x3bfdbb,{options:_0x115933,args:_0x2ba847,tdx:_0x1de64f}=_0x37e737,_0x27ab21=_0x2ba847[0x0],_0x42744a=_0x2ba847[0x1]||'.';if(!_0x27ab21)return console[_0x5f4afe(0x1e6)](_0x5f4afe(0xee)),console[_0x5f4afe(0x1e6)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x3f8dff=_0x115933[_0x5f4afe(0x162)];_0x115933[_0x5f4afe(0x1c3)]&&(console[_0x5f4afe(0x1e6)](_0x5f4afe(0xe6)+_0x27ab21),console[_0x5f4afe(0x1e6)](_0x5f4afe(0x1c7)+_0x42744a),_0x3f8dff&&console[_0x5f4afe(0x1e6)](_0x5f4afe(0x20b)+_0x3f8dff));const _0x10d8ef=await withSpinner(_0x5f4afe(0x19c)+_0x27ab21+_0x5f4afe(0x84),()=>_0x1de64f[_0x5f4afe(0x14e)][_0x5f4afe(0x213)](_0x27ab21,_0x42744a,{'revision':_0x3f8dff}),{'verbose':_0x115933['verbose']}),_0x457af7=_0x10d8ef[_0x5f4afe(0x18f)];return console['error'](_0x5f4afe(0x209)+_0x457af7[_0x5f4afe(0xeb)]),console['error'](_0x5f4afe(0x20c)+_0x457af7[_0x5f4afe(0x162)]),console[_0x5f4afe(0x1e6)]('\x20\x20Files\x20extracted:\x20'+_0x457af7[_0x5f4afe(0x137)]),console['error']('\x20\x20Location:\x20'+_0x42744a+'/'+_0x457af7[_0x5f4afe(0xeb)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x1ab);['description']=a55_0x3bfdbb(0x107);async[a55_0x3bfdbb(0xce)](_0x475ff2){const _0xdb8db3=a55_0x3bfdbb,{options:_0x24052d,args:_0x119402,tdx:_0x42070b}=_0x475ff2;let _0x39d697='.',_0x2b802e=_0x24052d[_0xdb8db3(0x1b3)];if(_0x119402[0x0]){const {promises:_0x3c7c75}=await import('fs');try{const _0x3e6aa6=await _0x3c7c75[_0xdb8db3(0x1e1)](_0x119402[0x0]);if(_0x3e6aa6[_0xdb8db3(0xf8)]())_0x39d697=_0x119402[0x0];else return console[_0xdb8db3(0x1e6)]('Error:\x20'+_0x119402[0x0]+_0xdb8db3(0x170)),0x1;}catch{_0x2b802e=_0x119402[0x0],_0x39d697='.';}}const _0x5641f9=_0x24052d[_0xdb8db3(0x162)],_0x556f09=_0x24052d[_0xdb8db3(0x85)];_0x24052d[_0xdb8db3(0x1c3)]&&(console[_0xdb8db3(0x1e6)](_0xdb8db3(0x186)+_0x39d697),_0x2b802e&&console[_0xdb8db3(0x1e6)](_0xdb8db3(0xe2)+_0x2b802e),_0x5641f9&&console[_0xdb8db3(0x1e6)]('Revision:\x20'+_0x5641f9),_0x556f09&&console[_0xdb8db3(0x1e6)](_0xdb8db3(0x20a)));const _0x389868=await withSpinner(_0xdb8db3(0x167),()=>_0x42070b[_0xdb8db3(0x14e)][_0xdb8db3(0x7a)](_0x39d697,{'projectName':_0x2b802e,'revision':_0x5641f9,'skipValidation':_0x556f09}),{'verbose':_0x24052d[_0xdb8db3(0x1c3)]}),_0x66e5f7=_0x389868['data'];return console[_0xdb8db3(0x1e6)](_0xdb8db3(0x1f2)+_0x66e5f7[_0xdb8db3(0xeb)]),console[_0xdb8db3(0x1e6)](_0xdb8db3(0xca)+_0x66e5f7[_0xdb8db3(0x10e)]),console['error'](_0xdb8db3(0x20c)+_0x66e5f7[_0xdb8db3(0x162)]),await this[_0xdb8db3(0x20f)](_0x42070b,_0x66e5f7[_0xdb8db3(0xeb)],_0x24052d[_0xdb8db3(0xcb)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0xe0);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x1cb);async['execute'](_0x46c5ef){const _0x26a20e=a55_0x3bfdbb,{options:_0x2df238,args:_0x1b988b,tdx:_0x244146}=_0x46c5ef,_0x23bc9c=_0x1b988b[0x0],_0x424bb1=_0x1b988b[0x1];if(!_0x23bc9c)return console[_0x26a20e(0x1e6)](a55_0x21a99a['red'](_0x26a20e(0x10a)),'Project\x20name\x20is\x20required'),console[_0x26a20e(0x1e6)](a55_0x21a99a[_0x26a20e(0x1d6)](_0x26a20e(0x1b2))),0x1;const _0x2071a0=_0x2df238[_0x26a20e(0x162)];_0x2df238[_0x26a20e(0x1c3)]&&(console[_0x26a20e(0x1e6)](_0x26a20e(0xe6)+_0x23bc9c),_0x424bb1&&console['error']('Target\x20directory:\x20'+_0x424bb1),_0x2071a0&&console['error'](_0x26a20e(0x20b)+_0x2071a0),_0x2df238['dryRun']&&console['error'](_0x26a20e(0xd8)));const _0x1e2d41=await withSpinner(_0x26a20e(0x142)+_0x23bc9c+'...',()=>_0x244146[_0x26a20e(0x14e)][_0x26a20e(0xd7)](_0x23bc9c,{'targetDir':_0x424bb1,'revision':_0x2071a0}),{'verbose':_0x2df238['verbose']}),_0x24d4f5=_0x1e2d41[_0x26a20e(0x18f)];_0x24d4f5[_0x26a20e(0x1b6)]?console[_0x26a20e(0x1e6)]('→\x20New\x20project:\x20'+_0x24d4f5['projectName']):console[_0x26a20e(0x1e6)](_0x26a20e(0x150)+_0x24d4f5[_0x26a20e(0xeb)]);console[_0x26a20e(0x1e6)]('\x20\x20Revision:\x20'+_0x24d4f5['revision']),console['error'](_0x26a20e(0xc4)+(a55_0x4cc59e[_0x26a20e(0xf1)](process['cwd'](),_0x24d4f5[_0x26a20e(0x198)])||'.')),console[_0x26a20e(0x1e6)](_0x26a20e(0xfe)+a55_0x21a99a[_0x26a20e(0x199)]('+'+_0x24d4f5[_0x26a20e(0x1df)][_0x26a20e(0x9c)]+_0x26a20e(0x157))+',\x20'+(a55_0x21a99a[_0x26a20e(0x80)]('~'+_0x24d4f5['summary'][_0x26a20e(0x188)]+_0x26a20e(0x96))+',\x20')+(a55_0x21a99a[_0x26a20e(0x97)]('-'+_0x24d4f5[_0x26a20e(0x1df)]['deleted']+_0x26a20e(0x195))+',\x20')+(''+a55_0x21a99a['dim'](_0x24d4f5['summary'][_0x26a20e(0x191)]+_0x26a20e(0xd1))));for(const _0x5b8161 of _0x24d4f5[_0x26a20e(0xbe)]){_0x5b8161['type']==='modified'&&_0x5b8161['diff']&&(console['error']('\x0a'+a55_0x21a99a[_0x26a20e(0x12a)](_0x26a20e(0x1f1)+_0x5b8161[_0x26a20e(0x9e)])),console['error'](_0x5b8161[_0x26a20e(0xcd)]));}if(!_0x24d4f5[_0x26a20e(0x1b4)])return saveSessionContext({'workflow_project':_0x24d4f5[_0x26a20e(0xeb)]},_0x2df238[_0x26a20e(0x1ea)]),console['error'](a55_0x21a99a[_0x26a20e(0x199)](_0x26a20e(0xcc))),console['error'](a55_0x21a99a[_0x26a20e(0x1d6)](_0x26a20e(0x126)+_0x24d4f5[_0x26a20e(0xeb)])),0x0;if(_0x2df238[_0x26a20e(0x98)])return console[_0x26a20e(0x1e6)](a55_0x21a99a[_0x26a20e(0x80)](_0x26a20e(0x1af))),0x0;if(!_0x2df238[_0x26a20e(0x16f)]){if(!isInteractive())return console['error'](a55_0x21a99a[_0x26a20e(0x97)](_0x26a20e(0xc9)),_0x26a20e(0x161)),console['error'](a55_0x21a99a[_0x26a20e(0x1d6)](_0x26a20e(0x81))),0x1;const _0x2b83f6=await confirmKey(_0x26a20e(0xd4));if(!_0x2b83f6)return console[_0x26a20e(0x1e6)](a55_0x21a99a[_0x26a20e(0x80)](_0x26a20e(0x1b7)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x244146[_0x26a20e(0x14e)][_0x26a20e(0xd2)](_0x24d4f5,{'revision':_0x2071a0}),{'verbose':_0x2df238[_0x26a20e(0x1c3)]}),saveSessionContext({'workflow_project':_0x24d4f5['projectName']},_0x2df238[_0x26a20e(0x1ea)]),console['error'](a55_0x21a99a[_0x26a20e(0x199)](_0x26a20e(0xb4)));const _0x562c7c=a55_0x4cc59e[_0x26a20e(0xf1)](process[_0x26a20e(0x7f)](),_0x24d4f5[_0x26a20e(0x198)])||'.';return console[_0x26a20e(0x1e6)](a55_0x21a99a[_0x26a20e(0x1d6)](_0x26a20e(0x1bd)+_0x562c7c)),console['error'](a55_0x21a99a['dim'](_0x26a20e(0x126)+_0x24d4f5['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0xe4);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x119);async[a55_0x3bfdbb(0xce)](_0x3e8976){const _0x450d75=a55_0x3bfdbb,{options:_0x34710b,args:_0xe004de,tdx:_0x129d17}=_0x3e8976,_0x21fb3b=this[_0x450d75(0xf2)](_0xe004de,_0x34710b),_0x29a978=_0x34710b[_0x450d75(0x162)],_0x6886aa=_0x34710b[_0x450d75(0x85)];_0x34710b[_0x450d75(0x1c3)]&&(_0x21fb3b&&console[_0x450d75(0x1e6)](_0x450d75(0x207)+_0x21fb3b),_0x29a978&&console[_0x450d75(0x1e6)]('Revision:\x20'+_0x29a978),_0x34710b[_0x450d75(0x98)]&&console[_0x450d75(0x1e6)](_0x450d75(0xd8)),_0x6886aa&&console[_0x450d75(0x1e6)](_0x450d75(0x20a)));let _0x20f967;try{_0x20f967=await withSpinner('Analyzing\x20changes...',()=>_0x129d17['workflow']['preparePushProject']({'sourceDir':_0x21fb3b,'revision':_0x29a978,'skipValidation':_0x6886aa}),{'verbose':_0x34710b[_0x450d75(0x1c3)]});}catch(_0x4ecb93){if(_0x4ecb93 instanceof Error&&_0x4ecb93[_0x450d75(0x1d7)][_0x450d75(0x109)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x97)](_0x450d75(0x10a)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x34710b[_0x450d75(0x172)]?console['error'](a55_0x21a99a[_0x450d75(0x1d6)](_0x450d75(0x196)+_0x34710b[_0x450d75(0x172)]+_0x450d75(0x1e3)+_0x34710b[_0x450d75(0x172)]+'\x27')):console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x1d6)](_0x450d75(0x151))),0x1;throw _0x4ecb93;}const _0x3a89ee=_0x20f967[_0x450d75(0x18f)];console[_0x450d75(0x1e6)](_0x450d75(0x11d)+_0x3a89ee['projectName']),console[_0x450d75(0x1e6)](_0x450d75(0xa6)+_0x3a89ee['sourceDir']),console[_0x450d75(0x1e6)]('\x20\x20Revision:\x20'+_0x3a89ee[_0x450d75(0x162)]),console[_0x450d75(0x1e6)]('\x20\x20Changes:\x20'+a55_0x21a99a['green']('+'+_0x3a89ee[_0x450d75(0x1df)]['new']+_0x450d75(0x157))+',\x20'+(a55_0x21a99a[_0x450d75(0x80)]('~'+_0x3a89ee[_0x450d75(0x1df)][_0x450d75(0x188)]+'\x20modified')+',\x20')+(a55_0x21a99a[_0x450d75(0x97)]('-'+_0x3a89ee[_0x450d75(0x1df)][_0x450d75(0x1f9)]+_0x450d75(0x195))+',\x20')+(''+a55_0x21a99a['dim'](_0x3a89ee['summary']['unchanged']+_0x450d75(0xd1))));for(const _0xafc7c5 of _0x3a89ee[_0x450d75(0xbe)]){_0xafc7c5['type']===_0x450d75(0x188)&&_0xafc7c5[_0x450d75(0xcd)]&&(console[_0x450d75(0x1e6)]('\x0a'+a55_0x21a99a[_0x450d75(0x12a)](_0x450d75(0x1f1)+_0xafc7c5[_0x450d75(0x9e)])),console['error'](_0xafc7c5[_0x450d75(0xcd)]));}if(!_0x3a89ee['hasChanges'])return console[_0x450d75(0x1e6)](a55_0x21a99a['green'](_0x450d75(0x82))),await this[_0x450d75(0x20f)](_0x129d17,_0x3a89ee[_0x450d75(0xeb)],_0x34710b['site']),0x0;if(_0x34710b['dryRun'])return console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x80)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x34710b[_0x450d75(0x16f)]){if(!isInteractive())return console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x97)](_0x450d75(0xc9)),_0x450d75(0x161)),console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x1d6)](_0x450d75(0x81))),0x1;const _0x5ebfff=await confirmKey(_0x450d75(0x202));if(!_0x5ebfff)return console[_0x450d75(0x1e6)](a55_0x21a99a[_0x450d75(0x80)](_0x450d75(0x1b7)),_0x450d75(0x1d8)),0x1;}const _0x1aea8d=await withSpinner(_0x450d75(0xc8),()=>_0x129d17[_0x450d75(0x14e)][_0x450d75(0x1c0)](_0x3a89ee),{'verbose':_0x34710b[_0x450d75(0x1c3)]}),_0x821682=_0x1aea8d[_0x450d75(0x18f)];return console[_0x450d75(0x1e6)](a55_0x21a99a['green'](_0x450d75(0x1ce))),console['error'](_0x450d75(0xca)+_0x821682[_0x450d75(0x10e)]),console['error'](_0x450d75(0x20c)+_0x821682[_0x450d75(0x162)]),await this['showWorkflowConsoleUrl'](_0x129d17,_0x821682[_0x450d75(0xeb)],_0x34710b[_0x450d75(0xcb)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x1ca);[a55_0x3bfdbb(0x8c)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a55_0x3bfdbb(0xce)](_0x52602c){const _0x4b6388=a55_0x3bfdbb,{options:_0x117e94,args:_0x4749c5,tdx:_0x384755}=_0x52602c,_0x45ec80=this[_0x4b6388(0xf2)](_0x4749c5,_0x117e94),_0x140090=_0x117e94[_0x4b6388(0x1b3)],_0x948e74=_0x117e94[_0x4b6388(0x162)],_0x14fbc4=_0x117e94[_0x4b6388(0x85)];if(!_0x45ec80)return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x97)](_0x4b6388(0x10a)),_0x4b6388(0x1fd)),console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x1d6)](_0x4b6388(0x160))),console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x1d6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x140090)return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x97)](_0x4b6388(0x10a)),_0x4b6388(0x149)),console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x1d6)](_0x4b6388(0x160))),0x1;_0x117e94['verbose']&&(console[_0x4b6388(0x1e6)]('Source\x20directory:\x20'+_0x45ec80),console[_0x4b6388(0x1e6)](_0x4b6388(0x88)+_0x140090),_0x948e74&&console[_0x4b6388(0x1e6)](_0x4b6388(0x20b)+_0x948e74),_0x117e94['dryRun']&&console[_0x4b6388(0x1e6)](_0x4b6388(0xd8)),_0x14fbc4&&console[_0x4b6388(0x1e6)](_0x4b6388(0x20a)));const _0x49d982=await withSpinner('Analyzing\x20project...',()=>_0x384755[_0x4b6388(0x14e)][_0x4b6388(0x1f4)](_0x45ec80,_0x140090,{'revision':_0x948e74,'skipValidation':_0x14fbc4}),{'verbose':_0x117e94[_0x4b6388(0x1c3)]}),_0x2a75cb=_0x49d982[_0x4b6388(0x18f)];console[_0x4b6388(0x1e6)](_0x4b6388(0x1de)+_0x2a75cb[_0x4b6388(0xd9)]);_0x2a75cb['sourceProjectName']&&console[_0x4b6388(0x1e6)](_0x4b6388(0x1ed)+_0x2a75cb[_0x4b6388(0x18b)]);console[_0x4b6388(0x1e6)](_0x4b6388(0x88)+_0x2a75cb['newProjectName']),console['error'](_0x4b6388(0x20b)+_0x2a75cb['revision']),console[_0x4b6388(0x1e6)]('Files\x20to\x20upload:\x20'+_0x2a75cb['fileCount']);_0x2a75cb[_0x4b6388(0xac)]&&(console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x80)](_0x4b6388(0x124)+_0x2a75cb[_0x4b6388(0x1e2)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x2a75cb[_0x4b6388(0xb0)]+')')),console['error'](a55_0x21a99a['yellow'](_0x4b6388(0x18d))));if(_0x117e94[_0x4b6388(0x98)])return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x80)](_0x4b6388(0x19e))),0x0;if(!_0x117e94['yes']){if(!isInteractive())return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x97)](_0x4b6388(0xc9)),_0x4b6388(0x161)),console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x1d6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2ebef4=_0x2a75cb[_0x4b6388(0x18b)]||a55_0x4cc59e[_0x4b6388(0x18c)](_0x45ec80),_0x3d607c=_0x2a75cb[_0x4b6388(0xac)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x140090+_0x4b6388(0x18a):_0x4b6388(0x145)+_0x2ebef4+_0x4b6388(0x1f0)+_0x140090+'\x22?',_0x3cc821=await confirmKey(_0x3d607c);if(!_0x3cc821)return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x80)]('Cancelled')),0x1;}const _0x34e703=await withSpinner(_0x2a75cb[_0x4b6388(0xac)]?_0x4b6388(0xf0)+_0x140090+_0x4b6388(0x84):_0x4b6388(0x143)+_0x140090+_0x4b6388(0x84),()=>_0x384755[_0x4b6388(0x14e)]['executeCloneProject'](_0x2a75cb),{'verbose':_0x117e94[_0x4b6388(0x1c3)]}),_0x1773ff=_0x34e703[_0x4b6388(0x18f)];return console[_0x4b6388(0x1e6)](a55_0x21a99a[_0x4b6388(0x199)](_0x2a75cb['targetExists']?_0x4b6388(0xa2):_0x4b6388(0x11a))),console[_0x4b6388(0x1e6)](_0x4b6388(0x93)+_0x1773ff[_0x4b6388(0x1e2)]),console[_0x4b6388(0x1e6)]('\x20\x20Project\x20ID:\x20'+_0x1773ff[_0x4b6388(0x139)]),console[_0x4b6388(0x1e6)](_0x4b6388(0x20c)+_0x1773ff[_0x4b6388(0x162)]),await this[_0x4b6388(0x20f)](_0x384755,_0x1773ff['newProjectName'],_0x117e94[_0x4b6388(0xcb)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x15c);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0xbb);async[a55_0x3bfdbb(0xce)](_0x2a64ba){const _0x49d4ad=a55_0x3bfdbb,{options:_0x211498,args:_0x1120e8,tdx:_0x2ca63d}=_0x2a64ba,_0x133495=_0x1120e8[0x0];if(!_0x133495)return console[_0x49d4ad(0x1e6)](_0x49d4ad(0x8f)),console[_0x49d4ad(0x1e6)](_0x49d4ad(0x9a)),0x1;_0x211498[_0x49d4ad(0x1c3)]&&console[_0x49d4ad(0x1e6)](_0x49d4ad(0xe6)+_0x133495);if(!_0x211498[_0x49d4ad(0x16f)]){if(!isInteractive())return console[_0x49d4ad(0x1e6)](a55_0x21a99a[_0x49d4ad(0x97)](_0x49d4ad(0xc9)),_0x49d4ad(0x161)),console[_0x49d4ad(0x1e6)](a55_0x21a99a[_0x49d4ad(0x1d6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x58bec0=await confirmKey(_0x49d4ad(0x1f5)+_0x133495+_0x49d4ad(0x216));if(!_0x58bec0)return console[_0x49d4ad(0x1e6)](a55_0x21a99a[_0x49d4ad(0x80)](_0x49d4ad(0x1b7))),0x1;}const _0x1e99bb=await withSpinner('Deleting\x20project\x20'+_0x133495+_0x49d4ad(0x84),()=>_0x2ca63d['workflow'][_0x49d4ad(0x206)](_0x133495),{'verbose':_0x211498['verbose']}),_0x1f4f54=_0x1e99bb['data'];return console[_0x49d4ad(0x1e6)](_0x49d4ad(0x1c8)+_0x1f4f54[_0x49d4ad(0xeb)]),console['error'](_0x49d4ad(0xca)+_0x1f4f54[_0x49d4ad(0x10e)]),0x0;}}export function parseKeyValue(_0x3c8e15){const _0x4fa0a7=a55_0x3bfdbb,_0x210b5f=_0x3c8e15['indexOf']('=');if(_0x210b5f===-0x1)throw new Error(_0x4fa0a7(0x14b)+_0x3c8e15+_0x4fa0a7(0x1a6));const _0x5533be=_0x3c8e15[_0x4fa0a7(0x146)](0x0,_0x210b5f),_0x14fa2d=_0x3c8e15[_0x4fa0a7(0x146)](_0x210b5f+0x1);if(!_0x5533be)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x5533be,'value':_0x14fa2d};}function a55_0x2662(_0xe3777e,_0x2eec9d){_0xe3777e=_0xe3777e-0x70;const _0x5920a7=a55_0x5920();let _0x2662cc=_0x5920a7[_0xe3777e];return _0x2662cc;}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x113);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x1dc);async[a55_0x3bfdbb(0xce)](_0x259d56){const _0x373723=a55_0x3bfdbb,{options:_0x326fd3,args:_0x19e984,tdx:_0x595a89}=_0x259d56,_0xf7369f=this[_0x373723(0x184)](_0x19e984,_0x326fd3);if(!_0xf7369f)return 0x1;_0x326fd3[_0x373723(0x1c3)]&&console[_0x373723(0x1e6)](_0x373723(0xe6)+_0xf7369f);const _0x59841b=await withSpinner(_0x373723(0xaa),()=>_0x595a89[_0x373723(0x14e)][_0x373723(0x205)](_0xf7369f),{'verbose':_0x326fd3[_0x373723(0x1c3)]}),{secrets:_0x40302c}=_0x59841b[_0x373723(0x18f)];return console[_0x373723(0x1e6)](_0x373723(0x197)+_0x40302c['length']+_0x373723(0x1a4)+(_0x40302c['length']!==0x1?'s':'')),await handleSDKOutput(_0x40302c,_0x326fd3),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']='workflow:secrets:set';[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x77);async[a55_0x3bfdbb(0xce)](_0xde66de){const _0xf4d1b0=a55_0x3bfdbb,{options:_0x2b94b2,args:_0x19a2b6,tdx:_0x581695}=_0xde66de;let _0x4b9bde,_0x18c68b;if(_0x19a2b6['length']>=0x1&&!_0x19a2b6[0x0][_0xf4d1b0(0x109)]('='))_0x4b9bde=_0x19a2b6[0x0],_0x18c68b=_0x19a2b6[_0xf4d1b0(0x187)](0x1);else{if(_0x19a2b6[_0xf4d1b0(0x101)]>=0x1&&_0x2b94b2[_0xf4d1b0(0x172)])_0x4b9bde=_0x2b94b2['workflowProject'],_0x18c68b=_0x19a2b6;else return _0x19a2b6['length']>=0x1?(console[_0xf4d1b0(0x1e6)](_0xf4d1b0(0xee)),console[_0xf4d1b0(0x1e6)](_0xf4d1b0(0xdc)),0x1):(console['error'](_0xf4d1b0(0xde)),console[_0xf4d1b0(0x1e6)](_0xf4d1b0(0x8e)),0x1);}if(_0x18c68b[_0xf4d1b0(0x101)]===0x0)return console[_0xf4d1b0(0x1e6)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0xf4d1b0(0x1e6)](_0xf4d1b0(0x8e)),0x1;const _0x5d1c46={};try{for(const _0x30b42d of _0x18c68b){const {key:_0x326641,value:_0x10e77c}=parseKeyValue(_0x30b42d);_0x5d1c46[_0x326641]=_0x10e77c;}}catch(_0x15edeb){return _0x15edeb instanceof Error&&console[_0xf4d1b0(0x1e6)](a55_0x21a99a[_0xf4d1b0(0x97)](_0xf4d1b0(0x10a)),_0x15edeb[_0xf4d1b0(0x1d7)]),0x1;}const _0x413ce8=Object['keys'](_0x5d1c46);_0x2b94b2[_0xf4d1b0(0x1c3)]&&(console[_0xf4d1b0(0x1e6)](_0xf4d1b0(0xe6)+_0x4b9bde),console[_0xf4d1b0(0x1e6)]('Secrets\x20to\x20set:\x20'+_0x413ce8[_0xf4d1b0(0x11e)](',\x20')));const _0x58ae08=await withSpinner(_0x413ce8[_0xf4d1b0(0x101)]===0x1?_0xf4d1b0(0xe7):_0xf4d1b0(0x1a2)+_0x413ce8['length']+_0xf4d1b0(0x18e),()=>_0x581695[_0xf4d1b0(0x14e)]['setSecrets'](_0x4b9bde,_0x5d1c46),{'verbose':_0x2b94b2['verbose']}),_0x1e0c4c=_0x58ae08['data'];return console[_0xf4d1b0(0x1e6)](_0x413ce8[_0xf4d1b0(0x101)]===0x1?_0xf4d1b0(0x20e)+_0x1e0c4c['keys'][0x0]+_0xf4d1b0(0x1b5)+_0x1e0c4c['projectName']+'\x27':'✔\x20'+_0x1e0c4c[_0xf4d1b0(0x1c6)][_0xf4d1b0(0x101)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x1e0c4c[_0xf4d1b0(0xeb)]+'\x27'),(_0x2b94b2[_0xf4d1b0(0x106)]||_0x2b94b2['jsonl'])&&await handleSingleObjectOutput(_0x1e0c4c,_0x2b94b2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a55_0x3bfdbb(0x1b3)]=a55_0x3bfdbb(0x1be);[a55_0x3bfdbb(0x8c)]=a55_0x3bfdbb(0x15f);async[a55_0x3bfdbb(0xce)](_0x3f72dc){const _0x845f69=a55_0x3bfdbb,{options:_0x9a4d1,args:_0x5247ec,tdx:_0xee4d81}=_0x3f72dc;let _0x632c45,_0x5cf00d;if(_0x5247ec['length']>=0x2)_0x632c45=_0x5247ec[0x0],_0x5cf00d=_0x5247ec[0x1];else{if(_0x5247ec[_0x845f69(0x101)]===0x1&&_0x9a4d1[_0x845f69(0x172)])_0x632c45=_0x9a4d1[_0x845f69(0x172)],_0x5cf00d=_0x5247ec[0x0];else return _0x5247ec[_0x845f69(0x101)]===0x1?(console['error'](_0x845f69(0xee)),console['error'](_0x845f69(0xdc)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x845f69(0x1e6)](_0x845f69(0xab)),0x1);}_0x9a4d1[_0x845f69(0x1c3)]&&(console[_0x845f69(0x1e6)](_0x845f69(0xe6)+_0x632c45),console['error'](_0x845f69(0x75)+_0x5cf00d));if(!_0x9a4d1[_0x845f69(0x16f)]){if(!isInteractive())return console[_0x845f69(0x1e6)](a55_0x21a99a[_0x845f69(0x97)]('\x0aError:'),_0x845f69(0x161)),console['error'](a55_0x21a99a[_0x845f69(0x1d6)](_0x845f69(0x81))),0x1;const _0x406c7a=await confirmKey(_0x845f69(0x89)+_0x5cf00d+_0x845f69(0x91)+_0x632c45+'\x27?');if(!_0x406c7a)return console[_0x845f69(0x1e6)](a55_0x21a99a[_0x845f69(0x80)]('Cancelled')),0x1;}const _0xe9ae01=await withSpinner('Deleting\x20secret...',()=>_0xee4d81[_0x845f69(0x14e)][_0x845f69(0x185)](_0x632c45,_0x5cf00d),{'verbose':_0x9a4d1['verbose']}),_0x476d48=_0xe9ae01[_0x845f69(0x18f)];return console[_0x845f69(0x1e6)](_0x845f69(0x20e)+_0x476d48['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x476d48[_0x845f69(0xeb)]+'\x27'),(_0x9a4d1['json']||_0x9a4d1['jsonl'])&&await handleSingleObjectOutput(_0x476d48,_0x9a4d1),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(_0x1ea211){const _0x14d7f5=a55_0x3bfdbb,_0x392ce8=Math[_0x14d7f5(0x14c)](_0x1ea211/0x3e8),_0x1a9ed1=Math['floor'](_0x392ce8/0x3c),_0x5d9cd5=Math[_0x14d7f5(0x14c)](_0x1a9ed1/0x3c),_0xaca090=Math[_0x14d7f5(0x14c)](_0x5d9cd5/0x18);if(_0xaca090>0x0){const _0x420295=_0x5d9cd5%0x18;return _0x420295>0x0?_0xaca090+'d\x20'+_0x420295+'h':_0xaca090+'d';}else{if(_0x5d9cd5>0x0){const _0x3ca80=_0x1a9ed1%0x3c;return _0x3ca80>0x0?_0x5d9cd5+'h\x20'+_0x3ca80+'m':_0x5d9cd5+'h';}else{if(_0x1a9ed1>0x0){const _0x4dc67d=_0x392ce8%0x3c;return _0x4dc67d>0x0?_0x1a9ed1+'m\x20'+_0x4dc67d+'s':_0x1a9ed1+'m';}else return _0x392ce8+'s';}}}function formatTimestamp(_0xd20950,_0x45e899){const _0x1c6948=a55_0x3bfdbb,_0x188c43=new Date(_0xd20950),_0x211de7=String(_0x188c43[_0x1c6948(0x78)]())[_0x1c6948(0x1e8)](0x2,'0'),_0x566744=String(_0x188c43[_0x1c6948(0xbc)]())['padStart'](0x2,'0'),_0x116b51=_0x211de7+':'+_0x566744,_0x2ed463=_0x188c43['getFullYear']()===_0x45e899[_0x1c6948(0x13a)]()&&_0x188c43[_0x1c6948(0x16b)]()===_0x45e899[_0x1c6948(0x16b)]()&&_0x188c43['getDate']()===_0x45e899['getDate']();if(_0x2ed463)return _0x116b51;else{const _0x5011b2=String(_0x188c43[_0x1c6948(0x16b)]()+0x1)[_0x1c6948(0x1e8)](0x2,'0'),_0x504e82=String(_0x188c43[_0x1c6948(0x132)]())['padStart'](0x2,'0');return _0x5011b2+'-'+_0x504e82+'\x20'+_0x116b51;}}function formatDate(_0x58601e){const _0x9b42fe=a55_0x3bfdbb,_0x4d52d6=_0x58601e['getFullYear'](),_0x40d09a=String(_0x58601e[_0x9b42fe(0x16b)]()+0x1)[_0x9b42fe(0x1e8)](0x2,'0'),_0x1ca623=String(_0x58601e['getDate']())[_0x9b42fe(0x1e8)](0x2,'0');return _0x4d52d6+'-'+_0x40d09a+'-'+_0x1ca623;}function getTaskStateIcon(_0xde024d){const _0x21e543={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x21e543[_0xde024d]||'⚪';}function getBarChar(_0x171b6d){const _0x335707=a55_0x3bfdbb;return _0x171b6d===_0x335707(0x1e6)||_0x171b6d===_0x335707(0x19f)?'×':'─';}function getBarColor(_0x31fcba){const _0x69e5e9=a55_0x3bfdbb,_0x397e03={'success':a55_0x21a99a['green'],'error':a55_0x21a99a['red'],'group_error':a55_0x21a99a[_0x69e5e9(0x97)],'running':a55_0x21a99a[_0x69e5e9(0xfd)],'blocked':a55_0x21a99a[_0x69e5e9(0x80)],'planned':a55_0x21a99a['dim'],'canceling':a55_0x21a99a[_0x69e5e9(0x80)]};return _0x397e03[_0x31fcba]||a55_0x21a99a['white'];}function parseTaskName(_0x270e8d){const _0x472f74=a55_0x3bfdbb;let _0x4e1556=_0x270e8d[_0x472f74(0x79)](/^\++/,'');const _0x4c1d1f=_0x4e1556[_0x472f74(0x99)]('+'),_0x35d2e4=_0x4c1d1f['length']>0x1?_0x4c1d1f[_0x472f74(0x101)]-0x2:0x0,_0x3dcee0=_0x4c1d1f[_0x4c1d1f[_0x472f74(0x101)]-0x1]||_0x4e1556;return{'level':_0x35d2e4,'name':'+'+_0x3dcee0};}function truncateTaskName(_0x267a9a,_0x90a4d8){const _0x1d0255=a55_0x3bfdbb,_0x5356dc=stringWidth(_0x267a9a);if(_0x5356dc<=_0x90a4d8)return _0x267a9a;let _0x100bb3=_0x267a9a;while(stringWidth(_0x100bb3+'…')>_0x90a4d8&&_0x100bb3[_0x1d0255(0x101)]>0x0){_0x100bb3=_0x100bb3[_0x1d0255(0x187)](0x0,-0x1);}return _0x100bb3+'…';}function calculateTimeScale(_0x2754a5,_0x4c92e5){const _0x212b83=a55_0x3bfdbb;return{'startTime':_0x2754a5[_0x212b83(0x104)],'endTime':_0x2754a5[_0x212b83(0x9b)],'durationMs':_0x2754a5[_0x212b83(0xf5)],'msPerChar':_0x2754a5[_0x212b83(0xf5)]/_0x4c92e5};}function timeToPosition(_0x1b9e93,_0x1ac6f5,_0x5d63c3){const _0x453ec5=a55_0x3bfdbb,_0x529e90=_0x1b9e93-_0x1ac6f5[_0x453ec5(0xbd)],_0x18c1fb=Math[_0x453ec5(0x14c)](_0x529e90/_0x1ac6f5[_0x453ec5(0xd0)]);return Math[_0x453ec5(0x1e5)](0x0,Math[_0x453ec5(0x134)](_0x18c1fb,_0x5d63c3));}function renderTimeAxis(_0x9ba0e2,_0x37d887){const _0x2ffb1d=a55_0x3bfdbb,_0x2faf39=Math[_0x2ffb1d(0x134)](TIMELINE_CONFIG[_0x2ffb1d(0x70)],Math[_0x2ffb1d(0x1e5)](TIMELINE_CONFIG[_0x2ffb1d(0x87)],Math[_0x2ffb1d(0x14c)](_0x37d887/TIMELINE_CONFIG[_0x2ffb1d(0x17d)]))),_0x57a3de=_0x9ba0e2[_0x2ffb1d(0xc1)]/(_0x2faf39-0x1),_0x507045=new Date(_0x9ba0e2['startTime']),_0x1a3f0b=[];for(let _0x33bb4c=0x0;_0x33bb4c<_0x2faf39;_0x33bb4c++){const _0x27ffe6=_0x9ba0e2['startTime']+_0x33bb4c*_0x57a3de,_0x527382=timeToPosition(_0x27ffe6,_0x9ba0e2,_0x37d887),_0x53e2c2=formatTimestamp(_0x27ffe6,_0x507045);_0x1a3f0b[_0x2ffb1d(0x7a)]({'pos':_0x527382,'text':_0x53e2c2});}const _0xcf8248=new Array(_0x37d887)['fill']('\x20');let _0x493a90=-0x1;for(const {pos:_0x287b73,text:_0x73c7}of _0x1a3f0b){let _0x5c1284=Math[_0x2ffb1d(0x1e5)](0x0,_0x287b73-Math[_0x2ffb1d(0x14c)](_0x73c7[_0x2ffb1d(0x101)]/0x2));_0x5c1284<=_0x493a90+TIMELINE_CONFIG[_0x2ffb1d(0x1ee)]&&(_0x5c1284=_0x493a90+TIMELINE_CONFIG[_0x2ffb1d(0x1ee)]+0x1);_0x5c1284+_0x73c7['length']>_0x37d887&&(_0x5c1284=_0x37d887-_0x73c7[_0x2ffb1d(0x101)]);if(_0x5c1284>=0x0&&_0x5c1284+_0x73c7[_0x2ffb1d(0x101)]<=_0x37d887&&_0x5c1284>_0x493a90){for(let _0x2cf57a=0x0;_0x2cf57a<_0x73c7[_0x2ffb1d(0x101)];_0x2cf57a++){_0xcf8248[_0x5c1284+_0x2cf57a]=_0x73c7[_0x2cf57a];}_0x493a90=_0x5c1284+_0x73c7[_0x2ffb1d(0x101)]-0x1;}}return _0xcf8248['join']('');}function renderTaskRow(_0x3c112c,_0x260a3f,_0x19069b,_0x38eaba){const _0xe2c3f9=a55_0x3bfdbb,{level:_0x39106d,name:_0x3899fb}=parseTaskName(_0x3c112c[_0xe2c3f9(0x1b3)]),_0x3e5869='\x20'[_0xe2c3f9(0x8d)](_0x39106d),_0x3b1722=_0x3c112c['window']?'('+formatElapsed(_0x3c112c[_0xe2c3f9(0x1aa)][_0xe2c3f9(0xf5)])+')':'',_0x419d75=stringWidth(_0x3b1722),_0x2225d2=_0x39106d*0x1,_0x682cad=_0x38eaba-_0x2225d2-_0x419d75-0x1,_0x412b4c=truncateTaskName(_0x3899fb,_0x682cad),_0x3d2d16=_0x3e5869+_0x412b4c,_0x33dbb6=stringWidth(_0x3d2d16),_0x1555a8=_0x38eaba-_0x33dbb6-_0x419d75,_0x5d635d=_0x3d2d16+'\x20'['repeat'](Math['max'](0x1,_0x1555a8))+a55_0x21a99a[_0xe2c3f9(0x1d6)](_0x3b1722),_0x4469a2=getTaskStateIcon(_0x3c112c[_0xe2c3f9(0x140)]),_0x9e31a6=new Array(_0x19069b)[_0xe2c3f9(0x72)]('\x20');if(_0x3c112c[_0xe2c3f9(0x1aa)]){const _0xf5d95a=timeToPosition(_0x3c112c['window'][_0xe2c3f9(0x104)],_0x260a3f,_0x19069b),_0xdb0e3=timeToPosition(_0x3c112c[_0xe2c3f9(0x1aa)][_0xe2c3f9(0x9b)],_0x260a3f,_0x19069b),_0x26731f=getBarChar(_0x3c112c['state']),_0x11951d=Math[_0xe2c3f9(0x1e5)](_0xf5d95a+0x1,_0xdb0e3);for(let _0x56f13b=_0xf5d95a;_0x56f13b<Math[_0xe2c3f9(0x134)](_0x11951d,_0x19069b);_0x56f13b++){_0x9e31a6[_0x56f13b]=_0x26731f;}}const _0x341013=getBarColor(_0x3c112c[_0xe2c3f9(0x140)]),_0x3a8097=_0x9e31a6[_0xe2c3f9(0xc6)](_0x5ab40d=>_0x5ab40d==='\x20'?'\x20':_0x341013(_0x5ab40d))['join']('');return _0x4469a2+'\x20'+_0x5d635d+'│'+_0x3a8097+'│';}function calculateStats(_0x1542d8){const _0x1e2c16=a55_0x3bfdbb,_0x1350ec={'total':_0x1542d8[_0x1e2c16(0x101)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2b8833 of _0x1542d8){if(_0x2b8833[_0x1e2c16(0x140)]==='success')_0x1350ec[_0x1e2c16(0x192)]++;else{if(_0x2b8833['state']===_0x1e2c16(0x1e6)||_0x2b8833[_0x1e2c16(0x140)]===_0x1e2c16(0x19f))_0x1350ec[_0x1e2c16(0x1e6)]++;else _0x2b8833[_0x1e2c16(0x140)]===_0x1e2c16(0x1e4)?_0x1350ec[_0x1e2c16(0x1e4)]++:_0x1350ec['pending']++;}}return _0x1350ec;}function formatStats(_0x2d2131){const _0x5cf628=a55_0x3bfdbb;return['Total:\x20'+_0x2d2131[_0x5cf628(0x17c)],'✅\x20'+_0x2d2131[_0x5cf628(0x192)],'❌\x20'+_0x2d2131[_0x5cf628(0x1e6)],'🔄\x20'+_0x2d2131[_0x5cf628(0x1e4)],'⏳\x20'+_0x2d2131['pending']][_0x5cf628(0x11e)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a55_0x3bfdbb(0xa1);['description']=a55_0x3bfdbb(0xb5);async[a55_0x3bfdbb(0xce)](_0x7db31d){const _0x3dd9de=a55_0x3bfdbb,{options:_0xa9823c,args:_0x7bb305,tdx:_0x35fad4}=_0x7db31d;let _0x4dd3a1,_0x12ff19,_0xef131a=![];if(_0x7bb305[0x0]){if(_0x7bb305[0x0]['includes']('.')){const _0x387189=this[_0x3dd9de(0x16a)](_0x7bb305,_0xa9823c);if(!_0x387189)return 0x1;_0x4dd3a1=_0x387189[_0x3dd9de(0xeb)],_0x12ff19=_0x387189[_0x3dd9de(0x10f)];}else{_0x12ff19=_0x7bb305[0x0],_0x4dd3a1=_0xa9823c[_0x3dd9de(0x172)];if(!_0x4dd3a1)return console[_0x3dd9de(0x1e6)](a55_0x21a99a['red'](_0x3dd9de(0x10a)),_0x3dd9de(0x182)),0x1;_0xef131a=!![];}}else{const _0x5df210=this[_0x3dd9de(0x16a)](_0x7bb305,_0xa9823c);if(!_0x5df210)return 0x1;_0x4dd3a1=_0x5df210[_0x3dd9de(0xeb)],_0x12ff19=_0x5df210[_0x3dd9de(0x10f)];}if(_0xa9823c[_0x3dd9de(0x1c3)]){if(_0x4dd3a1&&_0x12ff19)console[_0x3dd9de(0x1e6)](_0x3dd9de(0xd6)+_0x4dd3a1+'.'+_0x12ff19);else _0x4dd3a1&&console['error'](_0x3dd9de(0xa4)+_0x4dd3a1);}const _0xd71742=_0xa9823c[_0x3dd9de(0x11f)],_0x1cd716=_0xa9823c[_0x3dd9de(0x129)];if(_0xd71742){_0x1cd716&&console[_0x3dd9de(0x1e6)](a55_0x21a99a['yellow'](_0x3dd9de(0x138)),_0x3dd9de(0xb2));const _0x527f47=_0xa9823c[_0x3dd9de(0x168)];return _0x527f47?await this[_0x3dd9de(0x16c)](_0x7db31d,_0xd71742):await this[_0x3dd9de(0x12c)](_0x7db31d,_0xd71742,_0xa9823c),0x0;}if(_0x1cd716){const _0x5b28aa=await withSpinner('Loading\x20session...',()=>_0x35fad4[_0x3dd9de(0x14e)][_0x3dd9de(0x20d)]({'projectName':_0x4dd3a1,'workflowName':_0x12ff19,'limit':0x64}),{'verbose':_0xa9823c['verbose']}),_0x19ad59=_0x5b28aa['data'][_0x3dd9de(0x1cc)](_0x137cf6=>_0x137cf6['id']===_0x1cd716);if(!_0x19ad59)return console['error'](a55_0x21a99a[_0x3dd9de(0x97)](_0x3dd9de(0x10a)),'Session\x20not\x20found:\x20'+_0x1cd716),0x1;if(!_0x19ad59[_0x3dd9de(0x17e)]?.['id'])return console['error'](a55_0x21a99a[_0x3dd9de(0x97)]('Error:'),'Session\x20'+_0x1cd716+_0x3dd9de(0x15a)),0x1;const _0x2283fd=_0x19ad59[_0x3dd9de(0x17e)]['id'];_0xa9823c[_0x3dd9de(0x1c3)]&&console['error'](_0x3dd9de(0x1ba)+_0x2283fd+'\x20from\x20session\x20'+_0x1cd716);const _0x3a148e=_0xa9823c[_0x3dd9de(0x168)];return _0x3a148e?await this[_0x3dd9de(0x16c)](_0x7db31d,_0x2283fd):await this['renderSingleTimeline'](_0x7db31d,_0x2283fd,_0xa9823c),0x0;}const _0x2356bd=await withSpinner(_0x3dd9de(0x1b0),()=>_0x35fad4[_0x3dd9de(0x14e)][_0x3dd9de(0x20d)]({'projectName':_0x4dd3a1,'workflowName':_0x12ff19,'limit':_0xa9823c['limit']||0x32}),{'verbose':_0xa9823c[_0x3dd9de(0x1c3)]}),_0x3f5609=_0x2356bd[_0x3dd9de(0x18f)];if(_0x3f5609[_0x3dd9de(0x101)]===0x0){if(_0x4dd3a1&&_0x12ff19)console['error'](_0x3dd9de(0x116)+_0x4dd3a1+'.'+_0x12ff19);else _0x4dd3a1?console[_0x3dd9de(0x1e6)](_0x3dd9de(0x153)+_0x4dd3a1):(console[_0x3dd9de(0x1e6)](_0x3dd9de(0x19d)),console[_0x3dd9de(0x1e6)](a55_0x21a99a[_0x3dd9de(0x1d6)](_0x3dd9de(0x173))));return 0x0;}_0x3f5609[_0x3dd9de(0x14a)]((_0x257974,_0x6e0349)=>{const _0x54f2a2=_0x3dd9de,_0x1593ab=_0x257974[_0x54f2a2(0xe8)]||'',_0x2e299c=_0x6e0349['sessionTime']||'';return _0x2e299c[_0x54f2a2(0x103)](_0x1593ab);});if(_0xa9823c[_0x3dd9de(0x106)]||_0xa9823c[_0x3dd9de(0xf3)])return await handleSDKOutput(_0x3f5609,_0xa9823c),0x0;let _0x1882e9;if(_0xef131a){const _0x2707be=_0x3f5609[0x0];if(!_0x2707be[_0x3dd9de(0x17e)]?.['id'])return console[_0x3dd9de(0x1e6)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x1882e9=_0x2707be[_0x3dd9de(0x17e)]['id'],_0xa9823c[_0x3dd9de(0x1c3)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x2707be[_0x3dd9de(0xe8)]);}else{const _0xc2ae5=_0x3f5609[_0x3dd9de(0xc6)](_0xbd9279=>{const _0x515236=_0x3dd9de,_0x4e3395=getAttemptStatusDisplay(_0xbd9279['lastAttempt']);return{'title':_0xbd9279[_0x515236(0xc5)]?.[_0x515236(0x1b3)]+'.'+_0xbd9279[_0x515236(0x14e)]?.[_0x515236(0x1b3)]+_0x515236(0x118)+_0xbd9279[_0x515236(0xe8)]+'\x20'+_0x4e3395['icon'],'value':_0xbd9279[_0x515236(0x17e)]?.['id']||'','description':_0x4e3395['text']};}),_0x12ffd7=await a55_0x3388aa({'type':_0x3dd9de(0x9f),'name':'attemptId','message':_0x3dd9de(0x210),'choices':_0xc2ae5['filter'](_0x40b621=>_0x40b621['value']!=='')});if(!_0x12ffd7[_0x3dd9de(0x11f)])return 0x0;_0x1882e9=_0x12ffd7[_0x3dd9de(0x11f)];}const _0x4a2aab=_0xa9823c[_0x3dd9de(0x168)];return _0x4a2aab?await this[_0x3dd9de(0x16c)](_0x7db31d,_0x1882e9):await this[_0x3dd9de(0x12c)](_0x7db31d,_0x1882e9,_0xa9823c),0x0;}async[a55_0x3bfdbb(0x12c)](_0x57427a,_0xcb84cc,_0x5777a1){const _0x4ac4c2=a55_0x3bfdbb,{tdx:_0x4e1eac}=_0x57427a;let _0x983f63,_0x306eb5;try{[_0x983f63,_0x306eb5]=await Promise[_0x4ac4c2(0xfb)]([_0x4e1eac['workflow'][_0x4ac4c2(0x130)](_0xcb84cc),_0x4e1eac['workflow'][_0x4ac4c2(0x1cd)](_0xcb84cc,![])]);}catch(_0x1df990){console['error'](a55_0x21a99a[_0x4ac4c2(0x97)](_0x4ac4c2(0x147)));_0x5777a1[_0x4ac4c2(0x1c3)]&&console[_0x4ac4c2(0x1e6)](_0x1df990);throw _0x1df990;}if(_0x5777a1[_0x4ac4c2(0x106)]||_0x5777a1[_0x4ac4c2(0xf3)]){const _0x2c78e2=this[_0x4ac4c2(0x74)](_0x983f63,_0x306eb5);await handleSDKOutput([_0x2c78e2],_0x5777a1);return;}const _0x3b972c=_0x4e1eac[_0x4ac4c2(0x13b)]['site'],_0x40a926=this['renderTimeline'](_0x983f63,_0x306eb5,_0x3b972c);console['log'](_0x40a926);}async[a55_0x3bfdbb(0x16c)](_0x5d152a,_0x568ba1){const _0x2ef7ae=a55_0x3bfdbb,{tdx:_0x3976fb}=_0x5d152a,_0x8ac390=TIMELINE_CONFIG[_0x2ef7ae(0x1a8)],_0x4db623=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x31dcd7=0x0;while(_0x31dcd7<_0x4db623){process['stdout'][_0x2ef7ae(0x11b)]&&process['stdout'][_0x2ef7ae(0x8b)]('\x1bc');let _0x230440,_0xe983b9;try{[_0x230440,_0xe983b9]=await Promise[_0x2ef7ae(0xfb)]([_0x3976fb[_0x2ef7ae(0x14e)][_0x2ef7ae(0x130)](_0x568ba1),_0x3976fb[_0x2ef7ae(0x14e)][_0x2ef7ae(0x1cd)](_0x568ba1,![])]);}catch(_0x4521d6){console['error'](a55_0x21a99a[_0x2ef7ae(0x97)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x31dcd7>0x0&&console[_0x2ef7ae(0x1e6)](a55_0x21a99a['dim']('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x31dcd7));throw _0x4521d6;}const _0x31836c=_0x3976fb[_0x2ef7ae(0x13b)][_0x2ef7ae(0xcb)],_0x4a9b0c=this[_0x2ef7ae(0xc7)](_0x230440,_0xe983b9,_0x31836c);console[_0x2ef7ae(0x10c)](_0x4a9b0c);const _0x28986f=_0x230440[_0x2ef7ae(0x13c)]&&_0xe983b9[_0x2ef7ae(0xfc)](_0x41501c=>_0x41501c[_0x2ef7ae(0x140)]!==_0x2ef7ae(0x1e4)&&_0x41501c[_0x2ef7ae(0x140)]!=='planned');if(_0x28986f){console[_0x2ef7ae(0x1e6)](a55_0x21a99a[_0x2ef7ae(0x199)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a55_0x21a99a['dim'](_0x2ef7ae(0x1ad)+_0x31dcd7*0x2+_0x2ef7ae(0x110))),await new Promise(_0x149c05=>setTimeout(_0x149c05,_0x8ac390)),_0x31dcd7++;}_0x31dcd7>=_0x4db623&&console['error'](a55_0x21a99a[_0x2ef7ae(0x80)](_0x2ef7ae(0x1c2)));}[a55_0x3bfdbb(0xc7)](_0x552db8,_0x3cf4b0,_0x1b0c49){const _0x445497=a55_0x3bfdbb,_0x1dd5be=[],_0x21b85e=TIMELINE_CONFIG[_0x445497(0x115)],_0x1e73f1=0x5,_0x2117d0=process['stdout'][_0x445497(0xec)]||0x78,_0x2938dc=_0x2117d0-_0x21b85e-_0x1e73f1,_0x1103bd=Math['max'](TIMELINE_CONFIG[_0x445497(0x1cf)],Math['min'](_0x2938dc,TIMELINE_CONFIG[_0x445497(0x1f7)])),_0x476856=new Date(_0x552db8[_0x445497(0xf9)])[_0x445497(0x189)](),_0x504375=_0x552db8[_0x445497(0xb8)]?new Date(_0x552db8[_0x445497(0xb8)])[_0x445497(0x189)]():Date[_0x445497(0x9d)](),_0x1fcbf8={'start':_0x476856,'end':_0x504375,'duration':_0x504375-_0x476856},_0x1fac01=new Map(),_0xac30d6=[];for(const _0xe5705a of _0x3cf4b0){if(_0xe5705a['startedAt']){const _0x13d5db=new Date(_0xe5705a['startedAt'])[_0x445497(0x189)](),_0x47febc=_0xe5705a[_0x445497(0xdb)]?new Date(_0xe5705a[_0x445497(0xdb)])[_0x445497(0x189)]():Date[_0x445497(0x9d)](),_0x4c627a={'start':_0x13d5db,'end':_0x47febc,'duration':_0x47febc-_0x13d5db};_0x1fac01[_0x445497(0xda)](_0xe5705a['id'],_0x4c627a),_0xac30d6[_0x445497(0x7a)]({'name':_0xe5705a[_0x445497(0xb7)],'state':_0xe5705a['state']||_0x445497(0xd3),'window':_0x4c627a});}else _0xac30d6[_0x445497(0x7a)]({'name':_0xe5705a[_0x445497(0xb7)],'state':_0xe5705a[_0x445497(0x140)]||_0x445497(0x117),'window':undefined});}_0xac30d6[_0x445497(0x14a)]((_0x152437,_0x17c4ba)=>{const _0x2aac48=_0x445497;if(!_0x152437[_0x2aac48(0x1aa)])return 0x1;if(!_0x17c4ba[_0x2aac48(0x1aa)])return-0x1;return _0x152437['window']['start']-_0x17c4ba[_0x2aac48(0x1aa)]['start'];});const _0x1eb210=_0xac30d6[_0x445497(0x101)],_0x13b67c=_0x1eb210>TIMELINE_CONFIG[_0x445497(0x1a9)];_0x13b67c&&_0xac30d6['splice'](TIMELINE_CONFIG[_0x445497(0x1a9)]);const _0x2b61c7=calculateTimeScale(_0x1fcbf8,_0x1103bd),_0x58ef1f=_0x552db8[_0x445497(0x13c)]?_0x552db8[_0x445497(0x192)]?a55_0x21a99a[_0x445497(0x199)](_0x445497(0x192)):a55_0x21a99a['red'](_0x445497(0x1e6)):a55_0x21a99a['blue']('running'),_0x320a35=_0x552db8[_0x445497(0xc5)]?.['id'],_0x4a2f29=_0x552db8['sessionId'];let _0x45ca87;if(_0x320a35&&_0x4a2f29){const _0x1b2add=getWorkflowAttemptUrl(_0x1b0c49,_0x320a35,_0x4a2f29,_0x552db8['id']);_0x45ca87=hyperlink(a55_0x21a99a[_0x445497(0x1d6)](_0x552db8['id']),_0x1b2add);}else _0x45ca87=a55_0x21a99a[_0x445497(0x1d6)](_0x552db8['id']);_0x1dd5be[_0x445497(0x7a)](_0x445497(0x1a0)+_0x45ca87+'\x20-\x20'+_0x58ef1f+'\x20-\x20'+formatElapsed(_0x1fcbf8[_0x445497(0xf5)]));if(_0xac30d6[_0x445497(0x101)]>0x0){const _0x469951=renderTimeAxis(_0x2b61c7,_0x1103bd),_0xe35869=new Date(_0x1fcbf8[_0x445497(0x104)]),_0x54759a=formatDate(_0xe35869),_0x50574a=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x445497(0x83)]+_0x21b85e,_0x5a0d6f=_0x54759a[_0x445497(0x1e8)](_0x50574a),_0x3707f1=a55_0x21a99a[_0x445497(0x1d6)](_0x5a0d6f);_0x1dd5be[_0x445497(0x7a)](_0x3707f1+'\x20'+_0x469951);for(const _0x172077 of _0xac30d6){_0x1dd5be[_0x445497(0x7a)](renderTaskRow(_0x172077,_0x2b61c7,_0x1103bd,_0x21b85e));}const _0xbb963c=calculateStats(_0xac30d6);_0x1dd5be[_0x445497(0x7a)](formatStats(_0xbb963c)),_0x13b67c&&_0x1dd5be[_0x445497(0x7a)](a55_0x21a99a[_0x445497(0x80)](_0x445497(0x1ef)+TIMELINE_CONFIG[_0x445497(0x1a9)]+_0x445497(0x7d)+_0x1eb210+_0x445497(0x12e))),_0x1dd5be[_0x445497(0x7a)](''),_0x1dd5be[_0x445497(0x7a)](a55_0x21a99a[_0x445497(0x1d6)]('💡\x20Tip:\x20Use\x20')+(_0x445497(0x1c9)+_0x552db8['id']+_0x445497(0x114))+a55_0x21a99a[_0x445497(0x1d6)](_0x445497(0x131)));}else _0x1dd5be['push'](_0x445497(0x1f3));return _0x1dd5be[_0x445497(0x11e)]('\x0a');}[a55_0x3bfdbb(0x74)](_0xcf5d1b,_0x55ba09){const _0x26e549=a55_0x3bfdbb,_0x1a59f5=new Date(_0xcf5d1b['createdAt'])[_0x26e549(0x189)](),_0x291cc1=_0xcf5d1b[_0x26e549(0xb8)]?new Date(_0xcf5d1b[_0x26e549(0xb8)])[_0x26e549(0x189)]():Date[_0x26e549(0x9d)](),_0x17bc8c=_0x291cc1-_0x1a59f5,_0x3af3f3=[];for(const _0x12a353 of _0x55ba09){if(_0x12a353[_0x26e549(0xa9)]){const _0x4ec33b=new Date(_0x12a353[_0x26e549(0xa9)])[_0x26e549(0x189)](),_0x2417c8=_0x12a353['updatedAt']?new Date(_0x12a353[_0x26e549(0xdb)])[_0x26e549(0x189)]():Date['now']();_0x3af3f3[_0x26e549(0x7a)]({'name':_0x12a353['fullName'],'state':_0x12a353[_0x26e549(0x140)]||_0x26e549(0xd3),'window':{'start':_0x4ec33b,'end':_0x2417c8,'duration':_0x2417c8-_0x4ec33b}});}else _0x3af3f3[_0x26e549(0x7a)]({'name':_0x12a353['fullName'],'state':_0x12a353[_0x26e549(0x140)]||_0x26e549(0x117),'window':undefined});}const _0x48a0d4=calculateStats(_0x3af3f3);return{'attempt':{'id':_0xcf5d1b['id'],'status':_0xcf5d1b[_0x26e549(0x13c)]?_0xcf5d1b['success']?_0x26e549(0x192):_0x26e549(0x1e6):_0x26e549(0x1e4),'createdAt':_0xcf5d1b[_0x26e549(0xf9)],'finishedAt':_0xcf5d1b[_0x26e549(0xb8)],'duration_ms':_0x17bc8c},'tasks':_0x3af3f3[_0x26e549(0xc6)](_0x5217b5=>({'name':_0x5217b5[_0x26e549(0x1b3)],'state':_0x5217b5[_0x26e549(0x140)],'startedAt':_0x5217b5[_0x26e549(0x1aa)]?new Date(_0x5217b5[_0x26e549(0x1aa)][_0x26e549(0x104)])[_0x26e549(0xb1)]():null,'updatedAt':_0x5217b5[_0x26e549(0x1aa)]?new Date(_0x5217b5['window'][_0x26e549(0x9b)])[_0x26e549(0xb1)]():null,'duration_ms':_0x5217b5[_0x26e549(0x1aa)]?.['duration']||null})),'stats':_0x48a0d4};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x39ae85,_0x574912){const _0x2075d3=a56_0x6f38,_0x222f40=_0x39ae85();while(!![]){try{const _0x163393=-parseInt(_0x2075d3(0x1e4))/0x1*(-parseInt(_0x2075d3(0x1dc))/0x2)+parseInt(_0x2075d3(0x1e5))/0x3*(-parseInt(_0x2075d3(0x1d8))/0x4)+parseInt(_0x2075d3(0x1dd))/0x5*(-parseInt(_0x2075d3(0x1e7))/0x6)+-parseInt(_0x2075d3(0x1d3))/0x7*(-parseInt(_0x2075d3(0x1e6))/0x8)+-parseInt(_0x2075d3(0x1d9))/0x9+parseInt(_0x2075d3(0x1da))/0xa+parseInt(_0x2075d3(0x1d4))/0xb;if(_0x163393===_0x574912)break;else _0x222f40['push'](_0x222f40['shift']());}catch(_0x4efc78){_0x222f40['push'](_0x222f40['shift']());}}}(a56_0x3d0c,0x81303));import{platform}from'os';import{getAPIKey}from'./config.js';function a56_0x3d0c(){const _0x440e7e=['entries',';\x20node/','tdx/','4NXMCzA','362997FYEYFf','3785470qWQigZ','TD1\x20','1363544bpgBrz','4600985iXGbPb','length','replace','Authorization','tdx','version','Bearer\x20','1oRTXnQ','691347CvZpoI','8agBvRP','6xUavPM','3063704GhZATc','2443573dLNjVc'];a56_0x3d0c=function(){return _0x440e7e;};return a56_0x3d0c();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0xe4026a=a56_0x6f38,_0x50d790=getVersion(),_0xf868d=platform(),_0x19abfb=process[_0xe4026a(0x1e2)][_0xe4026a(0x1df)]('v','');return _0xe4026a(0x1d7)+_0x50d790+'\x20('+_0xf868d+_0xe4026a(0x1d6)+_0x19abfb+')';}export function getAuthHeaders(_0x211058,_0x1b5197,_0x41da35){const _0xe32560=a56_0x6f38,_0x54a60f=getVersion(),_0x2da6b0={'User-Agent':getUserAgent(),'X-TD-Client':_0xe32560(0x1e1),'X-TD-Client-Version':_0x54a60f};if(_0x41da35)_0x2da6b0[_0xe32560(0x1e0)]=_0xe32560(0x1e3)+_0x41da35;else _0x1b5197&&(_0x2da6b0[_0xe32560(0x1e0)]=_0xe32560(0x1db)+_0x1b5197);return _0x2da6b0;}export function toHeaderRecord(_0x5f5de9){const _0x25bdb5=a56_0x6f38,_0x3f74e9={};for(const [_0xee22fe,_0x47f5f5]of Object[_0x25bdb5(0x1d5)](_0x5f5de9)){_0x47f5f5!==undefined&&(_0x3f74e9[_0xee22fe]=_0x47f5f5);}return _0x3f74e9;}export function getTrinoHeaders(_0x519e1a,_0x5e6ceb,_0x35d791){const _0x36ce74=a56_0x6f38,_0x4016f1=getAuthHeaders(_0x519e1a),_0x227bc4=toHeaderRecord(_0x4016f1);if(_0x35d791)_0x227bc4[_0x36ce74(0x1e0)]='Bearer\x20'+_0x35d791;else _0x5e6ceb&&(_0x227bc4['X-Trino-User']=_0x5e6ceb);return _0x227bc4;}function a56_0x6f38(_0x265585,_0xf30647){_0x265585=_0x265585-0x1d3;const _0x3d0c40=a56_0x3d0c();let _0x6f3825=_0x3d0c40[_0x265585];return _0x6f3825;}export function hasAPIKey(_0x1fb230){const _0xdf816c=a56_0x6f38,_0x2dec1e=getAPIKey();return _0x2dec1e!==undefined&&_0x2dec1e[_0xdf816c(0x1de)]>0x0;}
1
+ (function(_0x2a1889,_0x4f5bad){const _0x3b1c36=a56_0x4b98,_0xcb37ae=_0x2a1889();while(!![]){try{const _0x12f61a=-parseInt(_0x3b1c36(0x101))/0x1+parseInt(_0x3b1c36(0x10a))/0x2+parseInt(_0x3b1c36(0x107))/0x3*(-parseInt(_0x3b1c36(0x108))/0x4)+-parseInt(_0x3b1c36(0x100))/0x5*(parseInt(_0x3b1c36(0x111))/0x6)+parseInt(_0x3b1c36(0xff))/0x7*(-parseInt(_0x3b1c36(0x102))/0x8)+parseInt(_0x3b1c36(0x103))/0x9+-parseInt(_0x3b1c36(0x10e))/0xa*(-parseInt(_0x3b1c36(0x104))/0xb);if(_0x12f61a===_0x4f5bad)break;else _0xcb37ae['push'](_0xcb37ae['shift']());}catch(_0x199122){_0xcb37ae['push'](_0xcb37ae['shift']());}}}(a56_0xdecd,0xdffaf));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a56_0x4b98(_0x3d87fd,_0x425afa){_0x3d87fd=_0x3d87fd-0xfe;const _0xdecd72=a56_0xdecd();let _0x4b9896=_0xdecd72[_0x3d87fd];return _0x4b9896;}export function getUserAgent(){const _0x31bf06=a56_0x4b98,_0x2de076=getVersion(),_0x408b65=platform(),_0x2bb8d6=process[_0x31bf06(0x109)][_0x31bf06(0x105)]('v','');return _0x31bf06(0x10c)+_0x2de076+'\x20('+_0x408b65+';\x20node/'+_0x2bb8d6+')';}export function getAuthHeaders(_0x333fcf,_0xd695ff,_0x2e78ed){const _0x5cedfa=a56_0x4b98,_0x517d5b=getVersion(),_0x228c65={'User-Agent':getUserAgent(),'X-TD-Client':_0x5cedfa(0x106),'X-TD-Client-Version':_0x517d5b};if(_0x2e78ed)_0x228c65[_0x5cedfa(0x110)]=_0x5cedfa(0x10d)+_0x2e78ed;else _0xd695ff&&(_0x228c65[_0x5cedfa(0x110)]=_0x5cedfa(0x10f)+_0xd695ff);return _0x228c65;}export function toHeaderRecord(_0x1cf4fd){const _0x547d45=a56_0x4b98,_0x22d2cb={};for(const [_0xeb609d,_0x4672cd]of Object[_0x547d45(0x10b)](_0x1cf4fd)){_0x4672cd!==undefined&&(_0x22d2cb[_0xeb609d]=_0x4672cd);}return _0x22d2cb;}export function getTrinoHeaders(_0x487417,_0x42b2ed,_0x3c006f){const _0x55232a=a56_0x4b98,_0x1256fc=getAuthHeaders(_0x487417),_0x1003f3=toHeaderRecord(_0x1256fc);if(_0x3c006f)_0x1003f3[_0x55232a(0x110)]=_0x55232a(0x10d)+_0x3c006f;else _0x42b2ed&&(_0x1003f3['X-Trino-User']=_0x42b2ed);return _0x1003f3;}function a56_0xdecd(){const _0x3974a1=['length','10449523ENWgcF','905YFkTrP','164157ouhjLh','8zbTTRN','11759418CSsKQo','12419rCRbLl','replace','tdx','896343UgiOuD','16dxDalb','version','508978VxhyaZ','entries','tdx/','Bearer\x20','20420dPXXZC','TD1\x20','Authorization','3216XrLSYI'];a56_0xdecd=function(){return _0x3974a1;};return a56_0xdecd();}export function hasAPIKey(_0x22eeb7){const _0x39907c=a56_0x4b98,_0x43efc5=getAPIKey();return _0x43efc5!==undefined&&_0x43efc5[_0x39907c(0xfe)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x15224e,_0x144cd5){const _0x442df7=a57_0x1312,_0x5d1097=_0x15224e();while(!![]){try{const _0x27be25=parseInt(_0x442df7(0x1b6))/0x1*(parseInt(_0x442df7(0x1b4))/0x2)+parseInt(_0x442df7(0x1b8))/0x3+parseInt(_0x442df7(0x1b9))/0x4+parseInt(_0x442df7(0x1ae))/0x5+parseInt(_0x442df7(0x1c7))/0x6+parseInt(_0x442df7(0x1ac))/0x7*(parseInt(_0x442df7(0x1d9))/0x8)+parseInt(_0x442df7(0x1bc))/0x9*(-parseInt(_0x442df7(0x1bd))/0xa);if(_0x27be25===_0x144cd5)break;else _0x5d1097['push'](_0x5d1097['shift']());}catch(_0x11f3bd){_0x5d1097['push'](_0x5d1097['shift']());}}}(a57_0x5512,0x7c2a4));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 a57_0x2b6a7b from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2bb05b){const _0x2e3e90=a57_0x1312;return _0x2bb05b['format']==='json'||_0x2bb05b[_0x2e3e90(0x1ba)]===_0x2e3e90(0x1d0)||_0x2bb05b[_0x2e3e90(0x1ba)]===_0x2e3e90(0x1c1)||_0x2bb05b[_0x2e3e90(0x1ba)]===_0x2e3e90(0x198)||_0x2bb05b[_0x2e3e90(0x1ca)]===!![]||_0x2bb05b[_0x2e3e90(0x1d0)]===!![]||_0x2bb05b[_0x2e3e90(0x1c1)]===!![]||_0x2bb05b[_0x2e3e90(0x198)]===!![];}export function parseOutputOptions(_0x36e22c){const _0x4d59bb=a57_0x1312;return{'format':_0x36e22c[_0x4d59bb(0x1ba)]||'table','output':_0x36e22c[_0x4d59bb(0x1cd)]||'','limit':_0x36e22c[_0x4d59bb(0x1c0)],'limitStructuredFormats':_0x36e22c['limitStructuredFormats'],'color':_0x36e22c[_0x4d59bb(0x196)],'noColor':_0x36e22c[_0x4d59bb(0x1bb)]};}function convertSDKResultToQueryResult(_0x2ba486){const _0x1696c7=a57_0x1312,_0x4d385b=[];if(_0x2ba486[_0x1696c7(0x1bf)]>0x0){const _0x88d148=_0x2ba486[0x0];for(const [_0x2e96ac,_0x4ec50e]of Object['entries'](_0x88d148)){let _0x507690=_0x1696c7(0x1a2);if(typeof _0x4ec50e===_0x1696c7(0x1b0))_0x507690=Number[_0x1696c7(0x19c)](_0x4ec50e)?_0x1696c7(0x1b1):'double';else{if(typeof _0x4ec50e===_0x1696c7(0x1d3))_0x507690=_0x1696c7(0x1d3);else _0x4ec50e===null&&(_0x507690=_0x1696c7(0x1a2));}_0x4d385b['push']({'name':_0x2e96ac,'type':_0x507690});}}return{'queryId':'sdk-result','columns':_0x4d385b,'data':_0x2ba486,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2ba486['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4dd038,_0x13edf9){const _0x4e358c=convertSDKResultToQueryResult(_0x4dd038);return formatQueryOutput(_0x4e358c,_0x13edf9);}export async function formatQueryOutput(_0x350df1,_0x1693e4){const _0x3c9f46=a57_0x1312,{format:_0x11fc4a,limit:_0x64705a,output:_0x36b012,color:_0x3cb631,noColor:_0x471f48,limitStructuredFormats:_0x540499}=_0x1693e4,_0x4f0eac=Boolean(_0x36b012)&&!_0x3cb631,_0x335913={'color':_0x3cb631,'noColor':_0x471f48||_0x4f0eac};if(_0x11fc4a===_0x3c9f46(0x198)){const _0x399545=shouldUseLess(_0x11fc4a,_0x36b012);return formatAsTable(_0x350df1,_0x64705a,_0x399545,_0x335913);}const _0x12ffb6=_0x540499&&Number['isFinite'](_0x64705a)&&_0x350df1[_0x3c9f46(0x1b7)][_0x3c9f46(0x1bf)]>_0x64705a?{..._0x350df1,'data':_0x350df1[_0x3c9f46(0x1b7)][_0x3c9f46(0x1ce)](0x0,_0x64705a)}:_0x350df1;if(_0x11fc4a===_0x3c9f46(0x1ca))return formatAsJSON(_0x12ffb6,_0x335913);else return _0x11fc4a==='jsonl'?formatAsJSONL(_0x12ffb6,_0x335913):formatQueryResult(_0x12ffb6,_0x11fc4a);}function shouldUseLess(_0x1416b1,_0xf9f4d8){const _0x18568c=a57_0x1312;return(_0x1416b1===_0x18568c(0x198)||_0x1416b1===_0x18568c(0x1c5))&&process[_0x18568c(0x1a7)][_0x18568c(0x1a8)]&&!_0xf9f4d8;}export function resolveOutputOptions(_0x2b2b39){const _0x255a1b=a57_0x1312,_0x5e035d=_0x2b2b39['output']||'',_0x12cfc3=resolveOutputFormat(_0x2b2b39[_0x255a1b(0x1ba)],_0x5e035d,_0x255a1b(0x198));let _0x41aca1=typeof _0x2b2b39[_0x255a1b(0x1c0)]===_0x255a1b(0x1b0)?_0x2b2b39[_0x255a1b(0x1c0)]:parseInt(_0x2b2b39['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2b2b39['limit']===undefined&&shouldUseLess(_0x12cfc3,_0x5e035d)&&(_0x41aca1=Infinity),{'format':_0x12cfc3,'output':_0x5e035d,'limit':_0x41aca1,'limitStructuredFormats':_0x2b2b39[_0x255a1b(0x1aa)],'color':_0x2b2b39['color'],'noColor':_0x2b2b39[_0x255a1b(0x1bb)]};}function a57_0x1312(_0x543d23,_0x34fac5){_0x543d23=_0x543d23-0x195;const _0x551265=a57_0x5512();let _0x131219=_0x551265[_0x543d23];return _0x131219;}function a57_0x5512(){const _0x235832=['data','979845QZwJaf','1958468wvwEUR','format','noColor','18335223afnpEX','10uwtNWC','push','length','limit','tsv','split','padEnd','string','list','debug','4477026LBRQwF','-FXRSn','keys','json','error','stderr','output','slice','inherit','jsonl','less','cmdout','boolean','cyan','spawn','No\x20data','[query]','pipe','13096KXEvUo','log','[error]','trim','end','forEach','[logs]','color','stdin','table','magenta','resolve','map','isInteger','stringify','repeat','params','─┬─','filter','varchar','[params]','bold','─┴─','red','stdout','isTTY','rule','limitStructuredFormats','[Object]','266Xkzzcf','max','866465XPPWka','query','number','bigint','write','join','1495850hdCJMc','entries','1iRMHEI'];a57_0x5512=function(){return _0x235832;};return a57_0x5512();}export function writeOutput(_0x1e11de,_0x25675e,_0x5900a6){const _0x5d5db0=a57_0x1312;return _0x25675e?(writeFileSync(_0x25675e,_0x1e11de),console[_0x5d5db0(0x1cb)]('Results\x20saved\x20to\x20'+_0x25675e),Promise[_0x5d5db0(0x19a)]()):shouldUseLess(_0x5900a6||'','')?new Promise(_0x595e6a=>{const _0x3e2f62=_0x5d5db0,_0x1b3f2c=spawn(_0x3e2f62(0x1d1),[_0x3e2f62(0x1c8)],{'stdio':[_0x3e2f62(0x1d8),_0x3e2f62(0x1cf),_0x3e2f62(0x1cf)]});let _0x516434=![];_0x1b3f2c['on'](_0x3e2f62(0x1cb),()=>{const _0x2e1abd=_0x3e2f62;!_0x516434&&(_0x516434=!![],console[_0x2e1abd(0x1da)](_0x1e11de),_0x595e6a());}),_0x1b3f2c['on']('close',()=>{!_0x516434&&(_0x516434=!![],_0x595e6a());}),_0x1b3f2c['on'](_0x3e2f62(0x1d5),()=>{const _0x4349e8=_0x3e2f62;!_0x516434&&_0x1b3f2c[_0x4349e8(0x197)]&&(_0x1b3f2c[_0x4349e8(0x197)]['on'](_0x4349e8(0x1cb),()=>{}),_0x1b3f2c['stdin'][_0x4349e8(0x1b2)](_0x1e11de),_0x1b3f2c['stdin'][_0x4349e8(0x1dd)]());}),!_0x1b3f2c[_0x3e2f62(0x197)]&&(!_0x516434&&(_0x516434=!![],console['log'](_0x1e11de),_0x595e6a()));}):(console[_0x5d5db0(0x1da)](_0x1e11de),Promise[_0x5d5db0(0x19a)]());}export async function handleSDKOutput(_0x2542fd,_0x4d1983){const _0x9be8e8=a57_0x1312,_0x1c4818=resolveOutputOptions(_0x4d1983),_0x43b88e=await formatSDKOutput(_0x2542fd,_0x1c4818);await writeOutput(_0x43b88e,_0x1c4818[_0x9be8e8(0x1cd)]||undefined,_0x1c4818['format']);}export async function handleQueryOutput(_0x274c91,_0x44d958){const _0x489b87=a57_0x1312,_0x127a8f=resolveOutputOptions(_0x44d958),_0x36830b=await formatQueryOutput(_0x274c91,_0x127a8f);await writeOutput(_0x36830b,_0x127a8f[_0x489b87(0x1cd)]||undefined,_0x127a8f['format']);}async function formatSingleObject(_0x2f84d0,_0x25c88e){const _0x53dce5=a57_0x1312,{format:_0x17c8d1,color:_0x419a89,noColor:_0x59f2db}=_0x25c88e,_0xefe756={'color':_0x419a89,'noColor':_0x59f2db};if(_0x17c8d1===_0x53dce5(0x1ca)){if(shouldUseColor(_0xefe756))return colorizeJSON(_0x2f84d0,_0xefe756);return JSON['stringify'](_0x2f84d0,null,0x2);}else{if(_0x17c8d1==='jsonl'){if(shouldUseColor(_0xefe756))return colorizeJSONCompact(_0x2f84d0,_0xefe756);return JSON[_0x53dce5(0x19d)](_0x2f84d0);}else{if(_0x17c8d1===_0x53dce5(0x1c1))return Object[_0x53dce5(0x1b5)](_0x2f84d0)[_0x53dce5(0x19b)](([_0x1ba082,_0x122acd])=>_0x1ba082+'\x09'+_0x122acd)[_0x53dce5(0x1b3)]('\x0a');else{const _0xd6e611=Object[_0x53dce5(0x1b5)](_0x2f84d0);if(_0xd6e611['length']===0x0)return _0x53dce5(0x1d6);const _0x2d559a=_0x2f84d0[_0x53dce5(0x1c6)],_0x473747=_0x2f84d0[_0x53dce5(0x1af)],_0x4ec085=_0x2f84d0[_0x53dce5(0x19f)],_0x414509=_0x2f84d0[_0x53dce5(0x1a9)],_0x20e9b8=_0x473747?typeof _0x473747===_0x53dce5(0x1c4)?_0x473747:JSON['stringify'](_0x473747,null,0x2):undefined,_0x3cce1e=_0x4ec085&&Object[_0x53dce5(0x1c9)](_0x4ec085)[_0x53dce5(0x1bf)]>0x0?JSON[_0x53dce5(0x19d)](_0x4ec085,null,0x2):undefined,_0x4d6c15=_0x414509&&Object[_0x53dce5(0x1c9)](_0x414509)[_0x53dce5(0x1bf)]>0x0?JSON[_0x53dce5(0x19d)](_0x414509,null,0x2):undefined,_0x532e74=_0xd6e611[_0x53dce5(0x1a1)](([_0x1b4f29])=>_0x1b4f29!==_0x53dce5(0x1c6)&&_0x1b4f29!==_0x53dce5(0x1af)&&_0x1b4f29!=='params'&&_0x1b4f29!=='rule'),_0x32831c=Math[_0x53dce5(0x1ad)](..._0x532e74[_0x53dce5(0x19b)](([_0x32cc44])=>_0x32cc44[_0x53dce5(0x1bf)])),_0x2ff08b=Math[_0x53dce5(0x1ad)](..._0x532e74['map'](([,_0x1ba4d9])=>{const _0x4f81bc=_0x53dce5;try{const _0x3cf9ae=_0x1ba4d9===null||_0x1ba4d9===undefined?'':typeof _0x1ba4d9==='object'?JSON['stringify'](_0x1ba4d9):String(_0x1ba4d9),_0x219a25=_0x3cf9ae[_0x4f81bc(0x1c2)]('\x0a');return Math[_0x4f81bc(0x1ad)](..._0x219a25['map'](_0x280a20=>_0x280a20[_0x4f81bc(0x1bf)]),0x0);}catch{return 0x0;}}),0x14),_0x4e3260=[];_0x4e3260[_0x53dce5(0x1be)](colorBorder('┌─'+'─'[_0x53dce5(0x19e)](_0x32831c)+_0x53dce5(0x1a0)+'─'['repeat'](_0x2ff08b)+'─┐',_0xefe756)),_0x532e74[_0x53dce5(0x1de)](([_0x5a436f,_0x2056dc])=>{const _0x342b82=_0x53dce5;let _0x120910;try{_0x120910=_0x2056dc===null||_0x2056dc===undefined?'':typeof _0x2056dc==='object'?JSON[_0x342b82(0x19d)](_0x2056dc):String(_0x2056dc);}catch{_0x120910=_0x342b82(0x1ab);}const _0x18b642=_0x5a436f[_0x342b82(0x1c3)](_0x32831c),_0x4a5227=_0x120910[_0x342b82(0x1c2)]('\x0a');_0x4a5227[_0x342b82(0x1de)]((_0x4146af,_0x2e2f73)=>{const _0x39b105=_0x342b82,_0x4bcf07=colorBorder('│',_0xefe756);_0x2e2f73===0x0?_0x4e3260[_0x39b105(0x1be)](_0x4bcf07+'\x20'+_0x18b642+'\x20'+_0x4bcf07+'\x20'+_0x4146af[_0x39b105(0x1c3)](_0x2ff08b)+'\x20'+_0x4bcf07):_0x4e3260[_0x39b105(0x1be)](_0x4bcf07+'\x20'+'\x20'[_0x39b105(0x19e)](_0x32831c)+'\x20'+_0x4bcf07+'\x20'+_0x4146af[_0x39b105(0x1c3)](_0x2ff08b)+'\x20'+_0x4bcf07);});}),_0x4e3260[_0x53dce5(0x1be)](colorBorder('└─'+'─'[_0x53dce5(0x19e)](_0x32831c)+_0x53dce5(0x1a5)+'─'[_0x53dce5(0x19e)](_0x2ff08b)+'─┘',_0xefe756));_0x20e9b8&&(_0x4e3260[_0x53dce5(0x1be)](''),_0x4e3260[_0x53dce5(0x1be)](String(a57_0x2b6a7b['yellow']['bold'](_0x53dce5(0x1d7)))),_0x4e3260[_0x53dce5(0x1be)](_0x20e9b8));_0x3cce1e&&(_0x4e3260[_0x53dce5(0x1be)](''),_0x4e3260[_0x53dce5(0x1be)](String(a57_0x2b6a7b['blue']['bold'](_0x53dce5(0x1a3)))),_0x4e3260[_0x53dce5(0x1be)](_0x3cce1e));_0x4d6c15&&(_0x4e3260[_0x53dce5(0x1be)](''),_0x4e3260['push'](String(a57_0x2b6a7b[_0x53dce5(0x199)]['bold']('[rule]'))),_0x4e3260[_0x53dce5(0x1be)](_0x4d6c15));if(_0x2d559a){if(_0x2d559a[_0x53dce5(0x1cc)]){_0x4e3260[_0x53dce5(0x1be)](''),_0x4e3260['push'](String(a57_0x2b6a7b[_0x53dce5(0x1a6)][_0x53dce5(0x1a4)](_0x53dce5(0x1db))));const _0x3c651b=_0x2d559a['stderr'][_0x53dce5(0x1c2)]('\x0a');_0x3c651b[_0x53dce5(0x1de)](_0x5b6358=>{const _0x38f5f8=_0x53dce5;_0x5b6358[_0x38f5f8(0x1dc)]()&&_0x4e3260[_0x38f5f8(0x1be)](_0x5b6358);});}if(_0x2d559a[_0x53dce5(0x1d2)]){_0x4e3260['push'](''),_0x4e3260['push'](String(a57_0x2b6a7b[_0x53dce5(0x1d4)]['bold'](_0x53dce5(0x195))));const _0x448d64=_0x2d559a[_0x53dce5(0x1d2)][_0x53dce5(0x1c2)]('\x0a');_0x448d64['forEach'](_0x49ebc9=>{const _0x349135=_0x53dce5;_0x49ebc9['trim']()&&_0x4e3260[_0x349135(0x1be)](_0x49ebc9);});}}return _0x4e3260[_0x53dce5(0x1b3)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3f660,_0x112c83){const _0x5f038f=a57_0x1312;if(_0x112c83['format']===_0x5f038f(0x198)){await handleSDKOutput([_0x3f660],_0x112c83);return;}const _0x1bfc30=resolveOutputOptions(_0x112c83),_0x48a959=await formatSingleObject(_0x3f660,_0x1bfc30);await writeOutput(_0x48a959,_0x1bfc30[_0x5f038f(0x1cd)]||undefined,_0x1bfc30[_0x5f038f(0x1ba)]);}
1
+ (function(_0x1ba536,_0x4ad448){const _0x32fd0e=a57_0x2294,_0x4b37ab=_0x1ba536();while(!![]){try{const _0x1f56f4=parseInt(_0x32fd0e(0x1dc))/0x1*(-parseInt(_0x32fd0e(0x1f2))/0x2)+-parseInt(_0x32fd0e(0x1e1))/0x3*(-parseInt(_0x32fd0e(0x1ab))/0x4)+-parseInt(_0x32fd0e(0x1f6))/0x5+parseInt(_0x32fd0e(0x1cd))/0x6*(-parseInt(_0x32fd0e(0x1e5))/0x7)+parseInt(_0x32fd0e(0x1d2))/0x8*(parseInt(_0x32fd0e(0x1da))/0x9)+parseInt(_0x32fd0e(0x1d3))/0xa*(-parseInt(_0x32fd0e(0x1d1))/0xb)+-parseInt(_0x32fd0e(0x1ae))/0xc*(-parseInt(_0x32fd0e(0x1ad))/0xd);if(_0x1f56f4===_0x4ad448)break;else _0x4b37ab['push'](_0x4b37ab['shift']());}catch(_0x3fd130){_0x4b37ab['push'](_0x4b37ab['shift']());}}}(a57_0x4f85,0x9c012));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a57_0x4f85(){const _0x13f10e=['magenta','push','data','error','limit','stringify','padEnd','write','[error]','color','close','repeat','output','[query]','jsonl','─┴─','keys','rule','FINISHED','10488cKbfeP','bigint','split','trim','187011ntzQqE','472GqXDMp','50tPFyJj','[params]','forEach','bold','─┬─','red','string','57573jKTkxo','entries','1MjyyGm','tsv','sdk-result','isInteger','cmdout','18993AxZeLR','query','[logs]','debug','1064FeMrgP','slice','stderr','limitStructuredFormats','inherit','isTTY','stdout','-FXRSn','pipe','table','join','resolve','blue','1240222iVimTk','varchar','format','[rule]','3717775cFOSDn','number','list','404egriDc','noColor','13rNQbmC','16038084XIazCX','json','params','length','log','Results\x20saved\x20to\x20','filter','isFinite','stdin','double','map','less'];a57_0x4f85=function(){return _0x13f10e;};return a57_0x4f85();}function a57_0x2294(_0xb2fc,_0x568f9d){_0xb2fc=_0xb2fc-0x1a9;const _0x4f85f2=a57_0x4f85();let _0x22940d=_0x4f85f2[_0xb2fc];return _0x22940d;}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a57_0x3fcdc6 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2b64b8){const _0x2248ec=a57_0x2294;return _0x2b64b8['format']==='json'||_0x2b64b8['format']===_0x2248ec(0x1c8)||_0x2b64b8['format']==='tsv'||_0x2b64b8[_0x2248ec(0x1f4)]===_0x2248ec(0x1ee)||_0x2b64b8[_0x2248ec(0x1af)]===!![]||_0x2b64b8['jsonl']===!![]||_0x2b64b8[_0x2248ec(0x1dd)]===!![]||_0x2b64b8[_0x2248ec(0x1ee)]===!![];}export function parseOutputOptions(_0x25b226){const _0x575db4=a57_0x2294;return{'format':_0x25b226[_0x575db4(0x1f4)]||_0x575db4(0x1ee),'output':_0x25b226['output']||'','limit':_0x25b226[_0x575db4(0x1be)],'limitStructuredFormats':_0x25b226[_0x575db4(0x1e8)],'color':_0x25b226[_0x575db4(0x1c3)],'noColor':_0x25b226[_0x575db4(0x1ac)]};}function convertSDKResultToQueryResult(_0x2982e6){const _0x11f601=a57_0x2294,_0x585948=[];if(_0x2982e6[_0x11f601(0x1b1)]>0x0){const _0x2f4cae=_0x2982e6[0x0];for(const [_0x3f61bc,_0x20e616]of Object[_0x11f601(0x1db)](_0x2f4cae)){let _0x19a72b=_0x11f601(0x1f3);if(typeof _0x20e616===_0x11f601(0x1a9))_0x19a72b=Number[_0x11f601(0x1df)](_0x20e616)?_0x11f601(0x1ce):_0x11f601(0x1b7);else{if(typeof _0x20e616==='boolean')_0x19a72b='boolean';else _0x20e616===null&&(_0x19a72b='varchar');}_0x585948['push']({'name':_0x3f61bc,'type':_0x19a72b});}}return{'queryId':_0x11f601(0x1de),'columns':_0x585948,'data':_0x2982e6,'stats':{'state':_0x11f601(0x1cc),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2982e6['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x30b8eb,_0x81454f){const _0x4bb6ce=convertSDKResultToQueryResult(_0x30b8eb);return formatQueryOutput(_0x4bb6ce,_0x81454f);}export async function formatQueryOutput(_0x387d87,_0x26b052){const _0x5ca1e6=a57_0x2294,{format:_0x3e21ea,limit:_0x44557c,output:_0x41bdfa,color:_0x2d8a8b,noColor:_0x23a905,limitStructuredFormats:_0x93b2ef}=_0x26b052,_0x18f93e=Boolean(_0x41bdfa)&&!_0x2d8a8b,_0x2099c6={'color':_0x2d8a8b,'noColor':_0x23a905||_0x18f93e};if(_0x3e21ea===_0x5ca1e6(0x1ee)){const _0x2c7045=shouldUseLess(_0x3e21ea,_0x41bdfa);return formatAsTable(_0x387d87,_0x44557c,_0x2c7045,_0x2099c6);}const _0x5b29e2=_0x93b2ef&&Number[_0x5ca1e6(0x1b5)](_0x44557c)&&_0x387d87[_0x5ca1e6(0x1bc)]['length']>_0x44557c?{..._0x387d87,'data':_0x387d87['data'][_0x5ca1e6(0x1e6)](0x0,_0x44557c)}:_0x387d87;if(_0x3e21ea===_0x5ca1e6(0x1af))return formatAsJSON(_0x5b29e2,_0x2099c6);else return _0x3e21ea==='jsonl'?formatAsJSONL(_0x5b29e2,_0x2099c6):formatQueryResult(_0x5b29e2,_0x3e21ea);}function shouldUseLess(_0x5173b1,_0x1de9ed){const _0x18e82f=a57_0x2294;return(_0x5173b1==='table'||_0x5173b1===_0x18e82f(0x1aa))&&process[_0x18e82f(0x1eb)][_0x18e82f(0x1ea)]&&!_0x1de9ed;}export function resolveOutputOptions(_0x3ee4e0){const _0x25b876=a57_0x2294,_0x4f6188=_0x3ee4e0[_0x25b876(0x1c6)]||'',_0x40e23c=resolveOutputFormat(_0x3ee4e0['format'],_0x4f6188,_0x25b876(0x1ee));let _0xadf6b=typeof _0x3ee4e0[_0x25b876(0x1be)]==='number'?_0x3ee4e0[_0x25b876(0x1be)]:parseInt(_0x3ee4e0[_0x25b876(0x1be)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x3ee4e0['limit']===undefined&&shouldUseLess(_0x40e23c,_0x4f6188)&&(_0xadf6b=Infinity),{'format':_0x40e23c,'output':_0x4f6188,'limit':_0xadf6b,'limitStructuredFormats':_0x3ee4e0[_0x25b876(0x1e8)],'color':_0x3ee4e0[_0x25b876(0x1c3)],'noColor':_0x3ee4e0[_0x25b876(0x1ac)]};}export function writeOutput(_0x34c95e,_0xc7a660,_0x19eafd){const _0x4cdf0d=a57_0x2294;return _0xc7a660?(writeFileSync(_0xc7a660,_0x34c95e),console[_0x4cdf0d(0x1bd)](_0x4cdf0d(0x1b3)+_0xc7a660),Promise[_0x4cdf0d(0x1f0)]()):shouldUseLess(_0x19eafd||'','')?new Promise(_0x2390fc=>{const _0xced493=_0x4cdf0d,_0x1fe93d=spawn(_0xced493(0x1b9),[_0xced493(0x1ec)],{'stdio':[_0xced493(0x1ed),_0xced493(0x1e9),_0xced493(0x1e9)]});let _0x38c589=![];_0x1fe93d['on'](_0xced493(0x1bd),()=>{const _0x3d2563=_0xced493;!_0x38c589&&(_0x38c589=!![],console[_0x3d2563(0x1b2)](_0x34c95e),_0x2390fc());}),_0x1fe93d['on'](_0xced493(0x1c4),()=>{!_0x38c589&&(_0x38c589=!![],_0x2390fc());}),_0x1fe93d['on']('spawn',()=>{const _0x1df01b=_0xced493;!_0x38c589&&_0x1fe93d[_0x1df01b(0x1b6)]&&(_0x1fe93d[_0x1df01b(0x1b6)]['on'](_0x1df01b(0x1bd),()=>{}),_0x1fe93d[_0x1df01b(0x1b6)][_0x1df01b(0x1c1)](_0x34c95e),_0x1fe93d[_0x1df01b(0x1b6)]['end']());}),!_0x1fe93d['stdin']&&(!_0x38c589&&(_0x38c589=!![],console[_0xced493(0x1b2)](_0x34c95e),_0x2390fc()));}):(console[_0x4cdf0d(0x1b2)](_0x34c95e),Promise[_0x4cdf0d(0x1f0)]());}export async function handleSDKOutput(_0x390a11,_0xe955a){const _0x1972f5=a57_0x2294,_0x35e666=resolveOutputOptions(_0xe955a),_0x5247a7=await formatSDKOutput(_0x390a11,_0x35e666);await writeOutput(_0x5247a7,_0x35e666[_0x1972f5(0x1c6)]||undefined,_0x35e666['format']);}export async function handleQueryOutput(_0x52383a,_0x3c3029){const _0x253253=resolveOutputOptions(_0x3c3029),_0x4e1c63=await formatQueryOutput(_0x52383a,_0x253253);await writeOutput(_0x4e1c63,_0x253253['output']||undefined,_0x253253['format']);}async function formatSingleObject(_0x32bcd3,_0x21d42b){const _0x2049c1=a57_0x2294,{format:_0x4e087b,color:_0x2ae092,noColor:_0x3e299c}=_0x21d42b,_0x795cc9={'color':_0x2ae092,'noColor':_0x3e299c};if(_0x4e087b==='json'){if(shouldUseColor(_0x795cc9))return colorizeJSON(_0x32bcd3,_0x795cc9);return JSON[_0x2049c1(0x1bf)](_0x32bcd3,null,0x2);}else{if(_0x4e087b===_0x2049c1(0x1c8)){if(shouldUseColor(_0x795cc9))return colorizeJSONCompact(_0x32bcd3,_0x795cc9);return JSON[_0x2049c1(0x1bf)](_0x32bcd3);}else{if(_0x4e087b===_0x2049c1(0x1dd))return Object[_0x2049c1(0x1db)](_0x32bcd3)['map'](([_0x2638c8,_0x250b80])=>_0x2638c8+'\x09'+_0x250b80)['join']('\x0a');else{const _0x4a1870=Object[_0x2049c1(0x1db)](_0x32bcd3);if(_0x4a1870[_0x2049c1(0x1b1)]===0x0)return'No\x20data';const _0x16ee9b=_0x32bcd3['debug'],_0x169d33=_0x32bcd3[_0x2049c1(0x1e2)],_0x40768b=_0x32bcd3[_0x2049c1(0x1b0)],_0x516c98=_0x32bcd3[_0x2049c1(0x1cb)],_0x4c370a=_0x169d33?typeof _0x169d33===_0x2049c1(0x1d9)?_0x169d33:JSON[_0x2049c1(0x1bf)](_0x169d33,null,0x2):undefined,_0x8fc180=_0x40768b&&Object['keys'](_0x40768b)[_0x2049c1(0x1b1)]>0x0?JSON[_0x2049c1(0x1bf)](_0x40768b,null,0x2):undefined,_0x40f102=_0x516c98&&Object[_0x2049c1(0x1ca)](_0x516c98)['length']>0x0?JSON[_0x2049c1(0x1bf)](_0x516c98,null,0x2):undefined,_0x2544f8=_0x4a1870[_0x2049c1(0x1b4)](([_0x34d227])=>_0x34d227!==_0x2049c1(0x1e4)&&_0x34d227!==_0x2049c1(0x1e2)&&_0x34d227!==_0x2049c1(0x1b0)&&_0x34d227!==_0x2049c1(0x1cb)),_0x54e27a=Math['max'](..._0x2544f8['map'](([_0x596bce])=>_0x596bce[_0x2049c1(0x1b1)])),_0x53a351=Math['max'](..._0x2544f8[_0x2049c1(0x1b8)](([,_0xe342f3])=>{const _0x52d7cd=_0x2049c1;try{const _0x52de77=_0xe342f3===null||_0xe342f3===undefined?'':typeof _0xe342f3==='object'?JSON[_0x52d7cd(0x1bf)](_0xe342f3):String(_0xe342f3),_0xe8c605=_0x52de77['split']('\x0a');return Math['max'](..._0xe8c605[_0x52d7cd(0x1b8)](_0x1d80db=>_0x1d80db[_0x52d7cd(0x1b1)]),0x0);}catch{return 0x0;}}),0x14),_0x430a5e=[];_0x430a5e['push'](colorBorder('┌─'+'─'['repeat'](_0x54e27a)+_0x2049c1(0x1d7)+'─'['repeat'](_0x53a351)+'─┐',_0x795cc9)),_0x2544f8[_0x2049c1(0x1d5)](([_0x180c15,_0x26bbdf])=>{const _0x353d0c=_0x2049c1;let _0x5581d2;try{_0x5581d2=_0x26bbdf===null||_0x26bbdf===undefined?'':typeof _0x26bbdf==='object'?JSON['stringify'](_0x26bbdf):String(_0x26bbdf);}catch{_0x5581d2='[Object]';}const _0x295708=_0x180c15[_0x353d0c(0x1c0)](_0x54e27a),_0x4bfe6e=_0x5581d2[_0x353d0c(0x1cf)]('\x0a');_0x4bfe6e['forEach']((_0x5d19b8,_0x3011cb)=>{const _0x298fe5=_0x353d0c,_0x3f17cd=colorBorder('│',_0x795cc9);_0x3011cb===0x0?_0x430a5e[_0x298fe5(0x1bb)](_0x3f17cd+'\x20'+_0x295708+'\x20'+_0x3f17cd+'\x20'+_0x5d19b8[_0x298fe5(0x1c0)](_0x53a351)+'\x20'+_0x3f17cd):_0x430a5e['push'](_0x3f17cd+'\x20'+'\x20'[_0x298fe5(0x1c5)](_0x54e27a)+'\x20'+_0x3f17cd+'\x20'+_0x5d19b8[_0x298fe5(0x1c0)](_0x53a351)+'\x20'+_0x3f17cd);});}),_0x430a5e[_0x2049c1(0x1bb)](colorBorder('└─'+'─'['repeat'](_0x54e27a)+_0x2049c1(0x1c9)+'─'[_0x2049c1(0x1c5)](_0x53a351)+'─┘',_0x795cc9));_0x4c370a&&(_0x430a5e['push'](''),_0x430a5e[_0x2049c1(0x1bb)](String(a57_0x3fcdc6['yellow'][_0x2049c1(0x1d6)](_0x2049c1(0x1c7)))),_0x430a5e[_0x2049c1(0x1bb)](_0x4c370a));_0x8fc180&&(_0x430a5e[_0x2049c1(0x1bb)](''),_0x430a5e[_0x2049c1(0x1bb)](String(a57_0x3fcdc6[_0x2049c1(0x1f1)]['bold'](_0x2049c1(0x1d4)))),_0x430a5e[_0x2049c1(0x1bb)](_0x8fc180));_0x40f102&&(_0x430a5e[_0x2049c1(0x1bb)](''),_0x430a5e['push'](String(a57_0x3fcdc6[_0x2049c1(0x1ba)]['bold'](_0x2049c1(0x1f5)))),_0x430a5e['push'](_0x40f102));if(_0x16ee9b){if(_0x16ee9b[_0x2049c1(0x1e7)]){_0x430a5e['push'](''),_0x430a5e[_0x2049c1(0x1bb)](String(a57_0x3fcdc6[_0x2049c1(0x1d8)][_0x2049c1(0x1d6)](_0x2049c1(0x1c2))));const _0xbcd9c3=_0x16ee9b[_0x2049c1(0x1e7)][_0x2049c1(0x1cf)]('\x0a');_0xbcd9c3[_0x2049c1(0x1d5)](_0x12abe0=>{const _0x3f0153=_0x2049c1;_0x12abe0['trim']()&&_0x430a5e[_0x3f0153(0x1bb)](_0x12abe0);});}if(_0x16ee9b['cmdout']){_0x430a5e[_0x2049c1(0x1bb)](''),_0x430a5e['push'](String(a57_0x3fcdc6['cyan'][_0x2049c1(0x1d6)](_0x2049c1(0x1e3))));const _0x57a843=_0x16ee9b[_0x2049c1(0x1e0)]['split']('\x0a');_0x57a843[_0x2049c1(0x1d5)](_0x166739=>{const _0x3e83e7=_0x2049c1;_0x166739[_0x3e83e7(0x1d0)]()&&_0x430a5e['push'](_0x166739);});}}return _0x430a5e[_0x2049c1(0x1ef)]('\x0a');}}}}export async function handleSingleObjectOutput(_0xd80d4f,_0x3eebd2){const _0x3123f6=a57_0x2294;if(_0x3eebd2['format']===_0x3123f6(0x1ee)){await handleSDKOutput([_0xd80d4f],_0x3eebd2);return;}const _0x468ce3=resolveOutputOptions(_0x3eebd2),_0x797b56=await formatSingleObject(_0xd80d4f,_0x468ce3);await writeOutput(_0x797b56,_0x468ce3[_0x3123f6(0x1c6)]||undefined,_0x468ce3[_0x3123f6(0x1f4)]);}