@treasuredata/tdx 0.16.5 → 0.16.6

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 (164) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/mcp-command.js +1 -1
  27. package/dist/commands/parent-segment-command.js +1 -1
  28. package/dist/commands/profile-command.js +1 -1
  29. package/dist/commands/profiles-command.js +1 -1
  30. package/dist/commands/query-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/unset-command.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mcp/server.js +1 -1
  61. package/dist/mcp/tools/index.js +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-search.js +1 -1
  64. package/dist/mcp/utils.js +1 -1
  65. package/dist/proxy/anthropic-adapter.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/context-signature.js +1 -1
  68. package/dist/proxy/conversation-utils.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/server.js +1 -1
  71. package/dist/proxy/session-cache.js +1 -1
  72. package/dist/proxy/sse-usage-parser.js +1 -1
  73. package/dist/sdk/agent/agent-config.js +1 -1
  74. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  75. package/dist/sdk/agent/agent-yaml.js +1 -1
  76. package/dist/sdk/agent/test/evaluator.js +1 -1
  77. package/dist/sdk/agent/test/executor.js +1 -1
  78. package/dist/sdk/agent/test/index.js +1 -1
  79. package/dist/sdk/agent/test/output.js +1 -1
  80. package/dist/sdk/agent/test/parser.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/claude-agent/claude-agent-client.d.ts +13 -0
  83. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  84. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  85. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  86. package/dist/sdk/claude-agent/environment.js +1 -1
  87. package/dist/sdk/claude-agent/index.js +1 -1
  88. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-aliases.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/fields-display.js +1 -1
  116. package/dist/sdk/segment/file-discovery.js +1 -1
  117. package/dist/sdk/segment/journey-utils.js +1 -1
  118. package/dist/sdk/segment/journey-yaml.js +1 -1
  119. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  120. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/pull-workflow.js +1 -1
  122. package/dist/sdk/segment/push-workflow.js +1 -1
  123. package/dist/sdk/segment/resolution-context.js +1 -1
  124. package/dist/sdk/segment/segment-path-parser.js +1 -1
  125. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  126. package/dist/sdk/segment/target-resolution.js +1 -1
  127. package/dist/sdk/segment/tdx-config.js +1 -1
  128. package/dist/sdk/segment/validate-files.js +1 -1
  129. package/dist/sdk/segment/yaml-validator.js +1 -1
  130. package/dist/sdk/segment.js +1 -1
  131. package/dist/sdk/types/index.js +1 -1
  132. package/dist/sdk/types/progress.js +1 -1
  133. package/dist/sdk/user.js +1 -1
  134. package/dist/sdk/util/format-detector.js +1 -1
  135. package/dist/sdk/util/formatters.js +1 -1
  136. package/dist/sdk/util/index.js +1 -1
  137. package/dist/sdk/util/tree-formatter.js +1 -1
  138. package/dist/sdk/workflow/clone-workflow.js +1 -1
  139. package/dist/sdk/workflow/index.js +1 -1
  140. package/dist/sdk/workflow/pull-workflow.js +1 -1
  141. package/dist/sdk/workflow/push-workflow.js +1 -1
  142. package/dist/sdk/workflow/tdx-config.js +1 -1
  143. package/dist/sdk/workflow/workflow-utils.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/global-cache.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/local-cache.js +1 -1
  151. package/dist/utils/option-validation.js +1 -1
  152. package/dist/utils/port.js +1 -1
  153. package/dist/utils/process.d.ts +10 -0
  154. package/dist/utils/process.d.ts.map +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/process.js.map +1 -1
  157. package/dist/utils/prompt.js +1 -1
  158. package/dist/utils/spinner.js +1 -1
  159. package/dist/utils/sse-parser.js +1 -1
  160. package/dist/utils/string-utils.js +1 -1
  161. package/dist/utils/table-ref-parser.js +1 -1
  162. package/dist/utils/tdx-logger.js +1 -1
  163. package/dist/utils/version-check.js +1 -1
  164. package/package.json +1 -1
@@ -1 +1 @@
1
- const a41_0x139d5f=a41_0x1b9e;(function(_0x21d575,_0x16387a){const _0x2e3914=a41_0x1b9e,_0x34b616=_0x21d575();while(!![]){try{const _0x1ff112=parseInt(_0x2e3914(0x1dd))/0x1*(-parseInt(_0x2e3914(0x1ee))/0x2)+parseInt(_0x2e3914(0x256))/0x3*(parseInt(_0x2e3914(0x28b))/0x4)+-parseInt(_0x2e3914(0x2a0))/0x5*(-parseInt(_0x2e3914(0x1a0))/0x6)+parseInt(_0x2e3914(0x17a))/0x7*(parseInt(_0x2e3914(0x293))/0x8)+-parseInt(_0x2e3914(0x190))/0x9+-parseInt(_0x2e3914(0x1d6))/0xa+-parseInt(_0x2e3914(0x24b))/0xb*(-parseInt(_0x2e3914(0x2d6))/0xc);if(_0x1ff112===_0x16387a)break;else _0x34b616['push'](_0x34b616['shift']());}catch(_0x309a00){_0x34b616['push'](_0x34b616['shift']());}}}(a41_0x3efd,0x5c6ce));import a41_0x50b6be from'chalk';import{existsSync}from'fs';import a41_0x145759 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}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 a41_0x116876 from'prompts';function getAttemptStatusDisplay(_0x33d63c){const _0xc5f83d=a41_0x1b9e;if(!_0x33d63c)return{'icon':'⏳','text':''};const {done:_0x295b0d,success:_0x146c4b,cancelRequested:_0x1f83bb}=_0x33d63c;if(!_0x295b0d)return _0x1f83bb?{'icon':'🛑','text':a41_0x50b6be[_0xc5f83d(0x1d8)](_0xc5f83d(0x2cf))}:{'icon':'🔄','text':a41_0x50b6be[_0xc5f83d(0x17c)]('running')};if(_0x146c4b)return{'icon':'✅','text':a41_0x50b6be[_0xc5f83d(0x20b)](_0xc5f83d(0x1fd))};return{'icon':'❌','text':a41_0x50b6be[_0xc5f83d(0x266)](_0xc5f83d(0x295))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0xa433a,_0x2c5c60,_0x17f2a0=0x0){const _0x2434c0=a41_0x1b9e;return _0xa433a[_0x17f2a0]||_0x2c5c60[_0x2434c0(0x25e)];}[a41_0x139d5f(0x243)](_0x33cd7f,_0x236bdf,_0x546e4b=0x0){const _0x53b9ce=a41_0x139d5f,_0x44f6b9=this[_0x53b9ce(0x1c9)](_0x33cd7f,_0x236bdf,_0x546e4b);if(!_0x44f6b9)return console[_0x53b9ce(0x295)](a41_0x50b6be[_0x53b9ce(0x266)](_0x53b9ce(0x232)),_0x53b9ce(0x183)),console['error'](a41_0x50b6be['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x44f6b9;}[a41_0x139d5f(0x1b6)](_0xb5e9fd,_0x36d2d1){const _0xe078ed=a41_0x139d5f;if(_0xb5e9fd[0x0]){const _0xe4e0dd=_0xb5e9fd[0x0][_0xe078ed(0x18d)]('.');if(_0xe4e0dd['length']===0x1)return{'projectName':_0xe4e0dd[0x0],'workflowName':undefined};else return _0xe4e0dd[_0xe078ed(0x207)]===0x2?{'projectName':_0xe4e0dd[0x0],'workflowName':_0xe4e0dd[0x1]}:(console[_0xe078ed(0x295)](a41_0x50b6be[_0xe078ed(0x266)]('Error:'),_0xe078ed(0x1b1)),null);}return{'projectName':_0x36d2d1[_0xe078ed(0x25e)],'workflowName':undefined};}[a41_0x139d5f(0x141)](_0x269213,_0x5d047c,_0x47bddf=0x0){const _0x40dfcd=a41_0x139d5f;if(_0x269213[_0x47bddf])return _0x269213[_0x47bddf];if(_0x5d047c[_0x40dfcd(0x25e)]){const _0x3777b9=a41_0x145759[_0x40dfcd(0x168)](process[_0x40dfcd(0x1bf)](),_0x40dfcd(0x2bc),_0x5d047c[_0x40dfcd(0x25e)]);if(existsSync(a41_0x145759[_0x40dfcd(0x168)](_0x3777b9,_0x40dfcd(0x15e))))return _0x3777b9;}return undefined;}async['showWorkflowConsoleUrl'](_0x151104,_0xb3ceb1,_0xd0cb6a){const _0x160663=a41_0x139d5f;try{const _0x9109e6=await _0x151104['workflow'][_0x160663(0x2bc)](_0xb3ceb1,{'limit':0x1});if(_0x9109e6['length']>0x0){const _0x46496b=_0x9109e6[0x0]['id'],_0xf4fecf=getWorkflowUrl(_0xd0cb6a,_0x46496b);console['error'](_0x160663(0x2c6)+a41_0x50b6be['cyan'](_0xf4fecf));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a41_0x139d5f(0x167)]='workflow:use';[a41_0x139d5f(0x25d)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a41_0x139d5f(0x175)](_0x6edb12){const _0x41b5a1=a41_0x139d5f,{options:_0x55ef68,args:_0x42345f,tdx:_0x3d0ee9}=_0x6edb12,_0x1ed6f9=_0x42345f[0x0],_0x41c010=_0x55ef68[_0x41b5a1(0x1e7)];if(_0x41c010)return saveSessionContext({'workflow_project':undefined},_0x55ef68[_0x41b5a1(0x2b8)]),console[_0x41b5a1(0x215)](a41_0x50b6be[_0x41b5a1(0x20b)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x1ed6f9)return console['error'](a41_0x50b6be['red'](_0x41b5a1(0x232)),_0x41b5a1(0x183)),console['error'](a41_0x50b6be[_0x41b5a1(0x176)](_0x41b5a1(0x2ad))),console[_0x41b5a1(0x295)](a41_0x50b6be[_0x41b5a1(0x176)](_0x41b5a1(0x2e1))),0x1;const _0x569862=await withSpinner(_0x41b5a1(0x29c)+_0x1ed6f9+_0x41b5a1(0x27d),()=>_0x3d0ee9[_0x41b5a1(0x2b6)][_0x41b5a1(0x1fb)](_0x1ed6f9),{'verbose':_0x55ef68['verbose']}),{name:_0x2b93a5}=_0x569862[_0x41b5a1(0x2d9)];return saveSessionContext({'workflow_project':_0x2b93a5},_0x55ef68[_0x41b5a1(0x2b8)]),console[_0x41b5a1(0x215)](a41_0x50b6be[_0x41b5a1(0x20b)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x50b6be[_0x41b5a1(0x2ce)](_0x2b93a5))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x28e);[a41_0x139d5f(0x25d)]='List\x20all\x20workflow\x20projects';async[a41_0x139d5f(0x175)](_0xdc50ae){const _0x7a62c5=a41_0x139d5f,{options:_0x30d664,args:_0x1d89c2,tdx:_0x3e62d9}=_0xdc50ae,_0x2c6924=_0x1d89c2[0x0];_0x30d664[_0x7a62c5(0x1e9)]&&_0x2c6924&&console[_0x7a62c5(0x295)](_0x7a62c5(0x1da)+_0x2c6924);const _0x22ecaa=await withSpinner(_0x7a62c5(0x208),()=>_0x3e62d9['workflow'][_0x7a62c5(0x277)](_0x2c6924,{'limit':_0x30d664[_0x7a62c5(0x1b9)]}),{'verbose':_0x30d664[_0x7a62c5(0x1e9)]});let _0x4c1471=_0x22ecaa[_0x7a62c5(0x2d9)];_0x4c1471['sort']((_0x484ef8,_0x1e037b)=>_0x484ef8[_0x7a62c5(0x167)][_0x7a62c5(0x272)](_0x1e037b['name']));const _0x3ba087=_0x30d664[_0x7a62c5(0x1b9)]||0x64,_0x1162f6=_0x4c1471[_0x7a62c5(0x207)]>=_0x3ba087?a41_0x50b6be['dim'](_0x7a62c5(0x1e4)):'';console['error'](_0x7a62c5(0x262)+_0x4c1471['length']+_0x7a62c5(0x23d)+(_0x4c1471[_0x7a62c5(0x207)]!==0x1?'s':'')+_0x1162f6);if(_0x30d664['format']===_0x7a62c5(0x18f)||_0x30d664[_0x7a62c5(0x1d3)]===_0x7a62c5(0x248)||_0x30d664[_0x7a62c5(0x1d3)]===_0x7a62c5(0x260))await handleSDKOutput(_0x4c1471,_0x30d664);else{if(_0x4c1471[_0x7a62c5(0x207)]===0x0)_0x2c6924?console['log'](_0x7a62c5(0x172)+_0x2c6924):console[_0x7a62c5(0x215)](_0x7a62c5(0x1f9));else{const _0x2a6b78=_0x4c1471[_0x7a62c5(0x2a3)](_0x1f5320=>{const _0x4adc81=_0x7a62c5,_0xbd0ee4=_0x1f5320[_0x4adc81(0x1ac)]?.[_0x4adc81(0x238)](_0xa00788=>_0xa00788['key']==='sys'),_0x5d9529=_0xbd0ee4?a41_0x50b6be[_0x4adc81(0x176)](_0x4adc81(0x224)):'';return _0x4adc81(0x21f)+_0x1f5320[_0x4adc81(0x167)]+_0x5d9529;});await writeOutput(_0x2a6b78[_0x7a62c5(0x168)]('\x0a'),_0x30d664['output'],_0x7a62c5(0x2c5));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x1ad);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x27b);async[a41_0x139d5f(0x175)](_0x1c2648){const _0x3a1550=a41_0x139d5f,{options:_0x5d37fb,args:_0x315236,tdx:_0x4d81c0}=_0x1c2648,_0x28bdd5=this['resolveProject'](_0x315236,_0x5d37fb);_0x5d37fb['verbose']&&_0x28bdd5&&console[_0x3a1550(0x295)](_0x3a1550(0x278)+_0x28bdd5);const _0x5c067c=await withSpinner(_0x3a1550(0x2a7),()=>_0x4d81c0[_0x3a1550(0x2b6)][_0x3a1550(0x2bc)](_0x28bdd5,{'limit':_0x5d37fb['limit']}),{'verbose':_0x5d37fb[_0x3a1550(0x1e9)]});let _0x26aea1=_0x5c067c[_0x3a1550(0x2d9)];_0x26aea1[_0x3a1550(0x161)]((_0x3e2beb,_0x562bc7)=>{const _0x427b6e=_0x3a1550,_0x25b2ac=_0x3e2beb['name']['localeCompare'](_0x562bc7[_0x427b6e(0x167)]);if(_0x25b2ac!==0x0)return _0x25b2ac;return(_0x3e2beb[_0x427b6e(0x1cb)]?.[_0x427b6e(0x167)]||'')[_0x427b6e(0x272)](_0x562bc7['project']?.[_0x427b6e(0x167)]||'');});const _0x7bff14=_0x5d37fb[_0x3a1550(0x1b9)]||0x64,_0x1379c6=_0x26aea1[_0x3a1550(0x207)]>=_0x7bff14?a41_0x50b6be[_0x3a1550(0x176)](_0x3a1550(0x1e4)):'';console[_0x3a1550(0x295)](_0x3a1550(0x262)+_0x26aea1[_0x3a1550(0x207)]+_0x3a1550(0x2c4)+(_0x26aea1[_0x3a1550(0x207)]!==0x1?'s':'')+_0x1379c6);if(_0x5d37fb[_0x3a1550(0x1d3)]===_0x3a1550(0x18f)||_0x5d37fb[_0x3a1550(0x1d3)]===_0x3a1550(0x248)||_0x5d37fb[_0x3a1550(0x1d3)]==='table')await handleSDKOutput(_0x26aea1,_0x5d37fb);else{if(_0x26aea1[_0x3a1550(0x207)]===0x0)_0x28bdd5?console[_0x3a1550(0x215)](_0x3a1550(0x17e)+_0x28bdd5):console['log'](_0x3a1550(0x29d));else{const _0x480f57=_0x5d37fb[_0x3a1550(0x1f8)],_0x4d95f3=_0x26aea1[_0x3a1550(0x2a3)](_0x5f145c=>{const _0x86d637=_0x3a1550,_0x323d87=a41_0x50b6be[_0x86d637(0x176)]('#'+_0x5f145c['id']),_0x29c819=hyperlink(_0x323d87,getWorkflowUrl(_0x480f57,_0x5f145c['id'])),_0x4bff76=_0x5f145c[_0x86d637(0x1cb)]?.[_0x86d637(0x167)]?a41_0x50b6be[_0x86d637(0x176)]('\x20('+_0x5f145c[_0x86d637(0x1cb)][_0x86d637(0x167)]+')'):'';return _0x86d637(0x159)+_0x29c819+'\x20'+_0x5f145c[_0x86d637(0x167)]+_0x4bff76;});await writeOutput(_0x4d95f3[_0x3a1550(0x168)]('\x0a'),_0x5d37fb[_0x3a1550(0x2c1)],_0x3a1550(0x2c5));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x2b1);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x16e);async[a41_0x139d5f(0x175)](_0x37e4b8){const _0x3087e9=a41_0x139d5f,{options:_0xed9a62,args:_0x35175c,tdx:_0x151b4a}=_0x37e4b8,_0x230150=this[_0x3087e9(0x1b6)](_0x35175c,_0xed9a62);if(!_0x230150)return 0x1;const {projectName:_0x46d1ac,workflowName:_0x5bccf1}=_0x230150;if(_0xed9a62[_0x3087e9(0x1e9)]){if(_0x46d1ac&&_0x5bccf1)console['error'](_0x3087e9(0x221)+_0x46d1ac+'.'+_0x5bccf1);else _0x46d1ac&&console[_0x3087e9(0x295)]('Filter:\x20project='+_0x46d1ac);const _0x366439=_0xed9a62[_0x3087e9(0x1f4)];_0x366439&&console['error'](_0x3087e9(0x16b)+_0x366439);}let _0x668ce9=0x28;if(process[_0x3087e9(0x178)][_0x3087e9(0x170)]&&!_0xed9a62[_0x3087e9(0x2c1)]&&!_0xed9a62['format']){const _0x1dee07=process[_0x3087e9(0x178)][_0x3087e9(0x25b)]||0x28;_0x668ce9=Math[_0x3087e9(0x1a9)](0x14,Math[_0x3087e9(0x2ac)](_0x1dee07*0x2/0x3));}const _0x109098=_0xed9a62[_0x3087e9(0x1b9)]||_0x668ce9,_0x4263fd=await withSpinner(_0x3087e9(0x203),()=>_0x151b4a[_0x3087e9(0x2b6)]['sessions']({'projectName':_0x46d1ac,'workflowName':_0x5bccf1,'status':_0xed9a62[_0x3087e9(0x1f4)],'fromTime':_0xed9a62[_0x3087e9(0x18a)],'toTime':_0xed9a62['to'],'limit':_0x109098}),{'verbose':_0xed9a62[_0x3087e9(0x1e9)]}),_0x3082d9=_0x4263fd[_0x3087e9(0x2d9)];_0x3082d9[_0x3087e9(0x161)]((_0x45176a,_0x204cd5)=>{const _0x1eb8f3=_0x3087e9,_0x470c87=_0x45176a[_0x1eb8f3(0x1c1)]||'',_0x33cbce=_0x204cd5['sessionTime']||'';return _0x33cbce['localeCompare'](_0x470c87);});_0x3082d9[_0x3087e9(0x207)]>=_0x109098?console[_0x3087e9(0x295)](_0x3087e9(0x23a)+_0x3082d9[_0x3087e9(0x207)]+_0x3087e9(0x298)+a41_0x50b6be['dim'](_0x3087e9(0x233))):console[_0x3087e9(0x295)]('✔\x20Found\x20'+_0x3082d9[_0x3087e9(0x207)]+_0x3087e9(0x1b4)+(_0x3082d9[_0x3087e9(0x207)]!==0x1?'s':''));if(_0xed9a62[_0x3087e9(0x1d3)]==='json'||_0xed9a62['format']===_0x3087e9(0x248)||_0xed9a62['format']===_0x3087e9(0x260))await handleSDKOutput(_0x3082d9,_0xed9a62);else{if(!process[_0x3087e9(0x178)][_0x3087e9(0x170)]||_0xed9a62[_0x3087e9(0x2c1)]){if(_0x3082d9[_0x3087e9(0x207)]===0x0){if(_0x46d1ac&&_0x5bccf1)console[_0x3087e9(0x215)](_0x3087e9(0x15d)+_0x46d1ac+'.'+_0x5bccf1);else _0x46d1ac?console['log'](_0x3087e9(0x1b8)+_0x46d1ac):console[_0x3087e9(0x215)]('No\x20sessions\x20found');}else{const _0x394ad6=_0xed9a62[_0x3087e9(0x1f8)],_0x4847d7=this['renderSessionsTimeline'](_0x3082d9,_0x394ad6);_0xed9a62['output']?await writeOutput(_0x4847d7,_0xed9a62[_0x3087e9(0x2c1)],_0x3087e9(0x2c5)):console['log'](_0x4847d7);}!_0x46d1ac&&(console[_0x3087e9(0x295)](''),console['error'](a41_0x50b6be[_0x3087e9(0x176)](_0x3087e9(0x22b))),console[_0x3087e9(0x295)](a41_0x50b6be[_0x3087e9(0x176)](_0x3087e9(0x27c))+'or'+a41_0x50b6be[_0x3087e9(0x176)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3082d9['length']===0x0){if(_0x46d1ac&&_0x5bccf1)console[_0x3087e9(0x215)]('No\x20sessions\x20found\x20for:\x20'+_0x46d1ac+'.'+_0x5bccf1);else _0x46d1ac?console[_0x3087e9(0x215)](_0x3087e9(0x1b8)+_0x46d1ac):console['log']('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0x3082d9,_0x37e4b8,_0x46d1ac);}}return 0x0;}[a41_0x139d5f(0x193)](_0x45de5b,_0x32ad85){const _0x50a8a8=a41_0x139d5f,_0x5367da=[],_0x3eef3c=new Map();let _0x672317=Infinity,_0x100f23=-Infinity;for(const _0x54a305 of _0x45de5b){if(_0x54a305[_0x50a8a8(0x218)]?.['createdAt']){const _0x4bd828=new Date(_0x54a305[_0x50a8a8(0x218)][_0x50a8a8(0x290)])['getTime'](),_0x19cc2d=_0x54a305[_0x50a8a8(0x218)][_0x50a8a8(0x299)]?new Date(_0x54a305[_0x50a8a8(0x218)][_0x50a8a8(0x299)])[_0x50a8a8(0x1b5)]():Date[_0x50a8a8(0x2a9)](),_0x4ed25d=_0x54a305[_0x50a8a8(0x1cb)]?.[_0x50a8a8(0x167)]||_0x50a8a8(0x192);!_0x3eef3c['has'](_0x4ed25d)&&_0x3eef3c[_0x50a8a8(0x1bd)](_0x4ed25d,[]),_0x3eef3c[_0x50a8a8(0x1eb)](_0x4ed25d)['push']({'session':_0x54a305,'startTime':_0x4bd828,'endTime':_0x19cc2d,'duration':_0x19cc2d-_0x4bd828}),_0x672317=Math['min'](_0x672317,_0x4bd828),_0x100f23=Math[_0x50a8a8(0x1a9)](_0x100f23,_0x19cc2d);}}if(_0x3eef3c[_0x50a8a8(0x1c3)]===0x0)return _0x50a8a8(0x1a6);const _0x40ccf5=process['stdout'][_0x50a8a8(0x228)]||0x78,_0x2c45f1=0x1e,_0x236e4c=0x32,_0x385472=0x4,_0x227603=Math['min'](_0x236e4c,Math[_0x50a8a8(0x1a9)](_0x2c45f1,Math[_0x50a8a8(0x2ac)](_0x40ccf5*0.3))),_0x54f846=_0x40ccf5-_0x227603-TIMELINE_CONFIG[_0x50a8a8(0x2de)]-0x3-_0x385472,_0x39e77d=_0x100f23-_0x672317,_0x3e7f6d=_0x39e77d/_0x227603,_0x3c4935=renderTimeAxis({'startTime':_0x672317,'endTime':_0x100f23,'durationMs':_0x39e77d,'msPerChar':_0x3e7f6d},_0x227603),_0xd5348=[];for(const _0x277237 of _0x3eef3c['values']()){_0xd5348['push'](..._0x277237);}_0xd5348[_0x50a8a8(0x161)]((_0xd19f0e,_0x566c2f)=>_0x566c2f[_0x50a8a8(0x14b)]-_0xd19f0e['startTime']);const _0xf41167=new Date(_0x672317),_0x70105b=formatDate(_0xf41167),_0x4b5e9f=_0x385472+TIMELINE_CONFIG[_0x50a8a8(0x2bf)]+TIMELINE_CONFIG['ICON_SPACING']+_0x54f846,_0x21d153='\x20'['repeat'](_0x4b5e9f-_0x70105b[_0x50a8a8(0x207)]),_0x3c373d=_0x21d153+a41_0x50b6be[_0x50a8a8(0x176)](_0x70105b)+'\x20'+_0x3c4935;_0x5367da[_0x50a8a8(0x2b2)](_0x3c373d);const _0x4bb98d=0x16;let _0x4587b7=0x0;for(const _0x43f4d9 of _0xd5348){const _0x3d534d=_0x43f4d9['session'][_0x50a8a8(0x1cb)]?.['name']||'?',_0x1129e9=Math[_0x50a8a8(0x253)](stringWidth(_0x3d534d),_0x4bb98d);_0x4587b7=Math[_0x50a8a8(0x1a9)](_0x4587b7,_0x1129e9);}for(const _0x419732 of _0xd5348){const {session:_0x4453cb,startTime:_0x2461b1,endTime:_0x4c7b0e,duration:_0x303125}=_0x419732,_0x29b0ba=_0x4453cb[_0x50a8a8(0x1cb)]?.['id'],_0x566076=_0x4453cb['id'],_0x533c54=_0x4453cb[_0x50a8a8(0x1cb)]?.[_0x50a8a8(0x167)]||'?',_0x28c4b8=_0x4453cb[_0x50a8a8(0x2b6)]?.[_0x50a8a8(0x167)]||'?';let _0x3ff8f0,_0x463ffd;if(_0x4453cb['lastAttempt']){const _0x31ba1d=_0x4453cb['lastAttempt'];!_0x31ba1d[_0x50a8a8(0x13d)]?(_0x3ff8f0=_0x31ba1d[_0x50a8a8(0x22a)]?'🛑':'🔄',_0x463ffd=_0x31ba1d['cancelRequested']?a41_0x50b6be[_0x50a8a8(0x1d8)]:a41_0x50b6be['blue']):(_0x3ff8f0=_0x31ba1d[_0x50a8a8(0x1fd)]?'✅':'❌',_0x463ffd=_0x31ba1d[_0x50a8a8(0x1fd)]?a41_0x50b6be['green']:a41_0x50b6be[_0x50a8a8(0x266)]);}else _0x3ff8f0='⏳',_0x463ffd=a41_0x50b6be[_0x50a8a8(0x176)];const _0x17bf21='#'+_0x566076,_0x21876f=_0x29b0ba?hyperlink(_0x17bf21,getWorkflowSessionUrl(_0x32ad85,_0x29b0ba,_0x566076)):_0x17bf21;let _0x4878ee=_0x533c54;stringWidth(_0x533c54)>_0x4bb98d&&(_0x4878ee=_0x533c54[_0x50a8a8(0x211)](0x0,_0x4bb98d-0x1)+'…');const _0x55862e=a41_0x50b6be[_0x50a8a8(0x176)](_0x4878ee),_0x170791=stringWidth(_0x4878ee),_0x65c3fe='\x20'['repeat'](_0x4587b7-stringWidth(_0x4878ee)+0x2),_0x4684fd='('+formatElapsed(_0x303125)+')',_0x1951b6=stringWidth(_0x4684fd),_0x2643ce=stringWidth(_0x17bf21),_0x356c3d=_0x2643ce+0x1+_0x170791+_0x65c3fe['length'],_0x153dd2=_0x54f846-_0x356c3d-_0x1951b6-0x1-0x8;let _0xa9fb33=_0x28c4b8;stringWidth(_0xa9fb33)>_0x153dd2&&(_0xa9fb33=_0xa9fb33[_0x50a8a8(0x211)](0x0,_0x153dd2-0x1)+'…');const _0x6d50e3=_0x21876f+'\x20'+_0x55862e+_0x65c3fe+_0xa9fb33,_0x3b1bbe=stringWidth(_0x6d50e3),_0x104cd6=_0x54f846-_0x3b1bbe-_0x1951b6,_0x487cbb=_0x6d50e3+'\x20'[_0x50a8a8(0x274)](Math[_0x50a8a8(0x1a9)](0x1,_0x104cd6))+a41_0x50b6be[_0x50a8a8(0x176)](_0x4684fd),_0x1134a7=Math[_0x50a8a8(0x2ac)]((_0x2461b1-_0x672317)/_0x3e7f6d),_0x3e5d36=Math['floor']((_0x4c7b0e-_0x672317)/_0x3e7f6d),_0xf667a6=Math['max'](_0x1134a7+0x1,_0x3e5d36),_0x17f41c=new Array(_0x227603)[_0x50a8a8(0x251)]('\x20');for(let _0x43f9a4=_0x1134a7;_0x43f9a4<Math[_0x50a8a8(0x253)](_0xf667a6,_0x227603);_0x43f9a4++){_0x17f41c[_0x43f9a4]='─';}const _0x189ded=_0x17f41c[_0x50a8a8(0x2a3)](_0x3463b8=>_0x3463b8==='\x20'?'\x20':_0x463ffd(_0x3463b8))[_0x50a8a8(0x168)]('');_0x5367da[_0x50a8a8(0x2b2)](_0x3ff8f0+'\x20'+_0x487cbb+'│'+_0x189ded+'│');}return _0x5367da['join']('\x0a');}async['navigateSessionsInteractive'](_0x4fef3a,_0x194a0d,_0x690eb3){const _0x1c1364=a41_0x139d5f,{options:_0xf49cd4,tdx:_0x1b19bd}=_0x194a0d,_0x223c97=_0xf49cd4['site'],{timelineRows:_0x1176ac,timeAxisHeader:_0x2fa9c8}=this[_0x1c1364(0x1ff)](_0x4fef3a,_0x223c97),_0x3ed817=_0x1176ac[_0x1c1364(0x15b)](_0x452226=>_0x452226[_0x1c1364(0x1d1)]);if(_0x3ed817['length']===0x0){const _0x3f0d36=this['renderSessionsTimeline'](_0x4fef3a,_0x223c97);console['log'](_0x3f0d36);!_0x690eb3&&(console[_0x1c1364(0x295)](''),console[_0x1c1364(0x295)](a41_0x50b6be['dim'](_0x1c1364(0x22b))),console[_0x1c1364(0x295)](a41_0x50b6be[_0x1c1364(0x176)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x50b6be['dim'](_0x1c1364(0x240))));return;}_0x2fa9c8&&console[_0x1c1364(0x215)](_0x2fa9c8);const _0x297d47=_0x1176ac[_0x1c1364(0x15b)](_0xa82e8e=>_0xa82e8e['attemptId'])['map'](_0x524fd3=>({'title':_0x524fd3['displayLine'],'value':_0x524fd3[_0x1c1364(0x1d1)]})),_0x4e214b=process[_0x1c1364(0x178)][_0x1c1364(0x25b)]||0x3c,_0x1b9f0b=Math[_0x1c1364(0x1a9)](0x28,Math[_0x1c1364(0x2ac)](_0x4e214b*0x2/0x3)),_0x16d626=await a41_0x116876({'type':_0x1c1364(0x1cd),'name':'attemptId','message':_0x1c1364(0x22e),'choices':_0x297d47,'initial':-0x1,'limit':_0x1b9f0b,'clearFirst':!![],'fallback':{'title':_0x1c1364(0x267),'value':null},'suggest':(_0x380388,_0x39dd0e)=>{const _0x908bf0=_0x1c1364;if(!_0x380388)return Promise[_0x908bf0(0x2a8)](_0x39dd0e);const _0x337efd=_0x39dd0e['filter'](_0x3ba895=>{const _0x43ba2d=_0x908bf0,_0xfea055=_0x3ba895;return _0xfea055['title'][_0x43ba2d(0x2c7)]()[_0x43ba2d(0x19d)](_0x380388['toLowerCase']());});return Promise[_0x908bf0(0x2a8)](_0x337efd);}}),_0x5ed949=()=>{const _0x3c3259=_0x1c1364;process[_0x3c3259(0x178)][_0x3c3259(0x2df)]('\x1b[1A\x1b[2K'),process['stdout'][_0x3c3259(0x2df)](_0x3c3259(0x2be)),process[_0x3c3259(0x178)]['write'](_0x3c3259(0x2be));},_0x59d41d=_0x16d626&&_0x16d626[_0x1c1364(0x1d1)]&&_0x16d626[_0x1c1364(0x1d1)]!==null&&_0x16d626[_0x1c1364(0x1d1)][_0x1c1364(0x26b)]()!=='';if(!_0x59d41d){_0x5ed949(),console[_0x1c1364(0x215)](a41_0x50b6be[_0x1c1364(0x176)](_0x1c1364(0x2a2)));return;}_0x5ed949();const _0x27e054=_0x4fef3a[_0x1c1364(0x164)](_0x5741c6=>_0x5741c6[_0x1c1364(0x218)]?.['id']===_0x16d626[_0x1c1364(0x1d1)]);if(_0x27e054){const _0xf08ab1=_0x27e054[_0x1c1364(0x1cb)]?.[_0x1c1364(0x167)]||'?',_0xc53959=_0x27e054[_0x1c1364(0x2b6)]?.[_0x1c1364(0x167)]||'?';console[_0x1c1364(0x215)](_0x1c1364(0x209)+a41_0x50b6be[_0x1c1364(0x176)](_0xf08ab1)+_0x1c1364(0x155)+a41_0x50b6be[_0x1c1364(0x176)](_0xc53959));}const _0x436beb=new WorkflowTimelineCommand();await _0x436beb['execute']({'args':[],'options':{..._0xf49cd4,'attemptId':_0x16d626[_0x1c1364(0x1d1)]},'tdx':_0x1b19bd});}['generateSessionTimelineRows'](_0x4f6cc1,_0x12867a){const _0x331711=a41_0x139d5f,_0x4a347d=new Map();for(const _0x22cc64 of _0x4f6cc1){_0x22cc64['id']&&_0x22cc64[_0x331711(0x218)]?.['id']&&_0x4a347d[_0x331711(0x1bd)](_0x22cc64['id'],_0x22cc64[_0x331711(0x218)]['id']);}const _0x275646=[];let _0x222616='';const _0x418566=this['renderSessionsTimeline'](_0x4f6cc1,_0x12867a),_0x57dc87=_0x418566[_0x331711(0x18d)]('\x0a');for(const _0x33230a of _0x57dc87){if(_0x33230a['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x33230a[_0x331711(0x202)](/^\s+\d{4}-\d{2}-\d{2}/))_0x222616=_0x33230a;else{if(_0x33230a[_0x331711(0x202)](/^[✅❌🔄🛑⏳]/)){const _0x2d6bdb=_0x33230a[_0x331711(0x202)](/#(\d+)/),_0x57e1e3=_0x2d6bdb?_0x2d6bdb[0x1]:null,_0x3e1034=_0x57e1e3?_0x4a347d[_0x331711(0x1eb)](_0x57e1e3)||null:null,_0x27ea2b=_0x4f6cc1[_0x331711(0x164)](_0x9d169b=>_0x9d169b['id']===_0x57e1e3),_0x3efc2d=_0x27ea2b?.[_0x331711(0x1cb)]?.[_0x331711(0x167)]||'';_0x275646['push']({'displayLine':_0x33230a,'attemptId':_0x3e1034,'projectName':_0x3efc2d});}}}return{'timelineRows':_0x275646,'timeAxisHeader':_0x222616};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x20e);['description']=a41_0x139d5f(0x28c);async['execute'](_0x123db9){const _0x57ec3a=a41_0x139d5f,{options:_0x1bb77c,args:_0x2dbc07,tdx:_0x4b099b}=_0x123db9,_0x3d9c74=this[_0x57ec3a(0x1b6)](_0x2dbc07,_0x1bb77c);if(!_0x3d9c74)return 0x1;const {projectName:_0x2094d2,workflowName:_0x2b6031}=_0x3d9c74,_0x4d1e9e=_0x1bb77c['includeRetried'];if(_0x1bb77c['verbose']){if(_0x2094d2&&_0x2b6031)console[_0x57ec3a(0x295)](_0x57ec3a(0x221)+_0x2094d2+'.'+_0x2b6031);else _0x2094d2&&console['error'](_0x57ec3a(0x188)+_0x2094d2);_0x4d1e9e&&console['error'](_0x57ec3a(0x29e));}const _0x2040bc=await withSpinner(_0x57ec3a(0x1ae),()=>_0x4b099b['workflow'][_0x57ec3a(0x1e3)]({'projectName':_0x2094d2,'workflowName':_0x2b6031,'includeRetried':_0x4d1e9e,'limit':_0x1bb77c[_0x57ec3a(0x1b9)]}),{'verbose':_0x1bb77c[_0x57ec3a(0x1e9)]}),_0x2a8df1=_0x2040bc['data'],_0x5bd241=_0x1bb77c[_0x57ec3a(0x1b9)]||0x64,_0x4136df=_0x2a8df1[_0x57ec3a(0x207)]>=_0x5bd241?a41_0x50b6be[_0x57ec3a(0x176)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x57ec3a(0x295)](_0x57ec3a(0x262)+_0x2a8df1[_0x57ec3a(0x207)]+_0x57ec3a(0x2d8)+(_0x2a8df1[_0x57ec3a(0x207)]!==0x1?'s':'')+_0x4136df);if(_0x1bb77c[_0x57ec3a(0x1d3)]===_0x57ec3a(0x18f)||_0x1bb77c[_0x57ec3a(0x1d3)]===_0x57ec3a(0x248)||_0x1bb77c[_0x57ec3a(0x1d3)]===_0x57ec3a(0x260))await handleSDKOutput(_0x2a8df1,_0x1bb77c);else{if(_0x2a8df1[_0x57ec3a(0x207)]===0x0){if(_0x2094d2&&_0x2b6031)console[_0x57ec3a(0x215)](_0x57ec3a(0x216)+_0x2094d2+'.'+_0x2b6031);else _0x2094d2?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x2094d2):console['log']('No\x20attempts\x20found');}else{const _0x41e3c8=_0x1bb77c[_0x57ec3a(0x1f8)],_0x50c7ed=_0x2a8df1[_0x57ec3a(0x2a3)](_0x4c7089=>{const _0x520ab1=_0x57ec3a,_0x45a806=a41_0x50b6be[_0x520ab1(0x176)]('#'+_0x4c7089['id']),_0x109e05=_0x4c7089['project']?.['id'],_0xdb1489=_0x4c7089[_0x520ab1(0x2c9)]||_0x4c7089[_0x520ab1(0x223)],_0x1849c3=_0x109e05&&_0xdb1489?hyperlink(_0x45a806,getWorkflowAttemptUrl(_0x41e3c8,_0x109e05,_0xdb1489,_0x4c7089['id'])):_0x45a806,{icon:_0x13163e,text:_0x260787}=getAttemptStatusDisplay(_0x4c7089),_0x2ce38f=(_0x4c7089[_0x520ab1(0x1cb)]?.[_0x520ab1(0x167)]||'?')+'.'+(_0x4c7089['workflow']?.[_0x520ab1(0x167)]||'?'),_0x2047e5=_0x4c7089[_0x520ab1(0x1c1)]?a41_0x50b6be[_0x520ab1(0x176)](_0x4c7089[_0x520ab1(0x1c1)]):'';return(_0x1849c3+'\x20'+_0x13163e+(_0x260787?'\x20'+_0x260787:'')+'\x20'+_0x2ce38f+'\x20'+_0x2047e5)[_0x520ab1(0x204)]();});await writeOutput(_0x50c7ed[_0x57ec3a(0x168)]('\x0a'),_0x1bb77c[_0x57ec3a(0x2c1)],_0x57ec3a(0x2c5));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x19c);['description']=a41_0x139d5f(0x24f);async['execute'](_0x47cec3){const _0x376259=a41_0x139d5f,{options:_0x5bda43,args:_0x142776,tdx:_0x4511ca}=_0x47cec3,_0x235228=_0x142776[0x0];if(!_0x235228)return console[_0x376259(0x295)](_0x376259(0x1ba)),0x1;_0x5bda43['verbose']&&console['error'](_0x376259(0x13e)+_0x235228);const _0x3f81bf=await withSpinner(_0x376259(0x19e),()=>_0x4511ca[_0x376259(0x2b6)][_0x376259(0x189)](_0x235228),{'verbose':_0x5bda43['verbose']}),_0x2923ba=_0x3f81bf[_0x376259(0x2d9)];let _0x24ed92;!_0x2923ba[_0x376259(0x13d)]?_0x24ed92=_0x2923ba[_0x376259(0x22a)]?'canceling':_0x376259(0x21d):_0x24ed92=_0x2923ba['success']?_0x376259(0x1fd):_0x376259(0x295);let _0x1cbc8f;if(_0x2923ba['createdAt']&&_0x2923ba['finishedAt']){const _0xec2466=new Date(_0x2923ba[_0x376259(0x290)])[_0x376259(0x1b5)](),_0xf49e0=new Date(_0x2923ba[_0x376259(0x299)])[_0x376259(0x1b5)]();_0x1cbc8f=Math[_0x376259(0x273)]((_0xf49e0-_0xec2466)/0x3e8);}const _0x48cff7={'attempt_id':_0x2923ba['id'],'status':_0x24ed92,..._0x2923ba['index']!==undefined&&{'index':_0x2923ba[_0x376259(0x269)]},..._0x2923ba['project']&&{'project':_0x2923ba[_0x376259(0x1cb)][_0x376259(0x167)]},..._0x2923ba['workflow']&&{'workflow':_0x2923ba[_0x376259(0x2b6)]['name']},..._0x2923ba['sessionId']&&{'session_id':_0x2923ba[_0x376259(0x223)]},..._0x2923ba[_0x376259(0x1c1)]&&{'session_time':_0x2923ba[_0x376259(0x1c1)]},..._0x2923ba[_0x376259(0x280)]&&{'retry_attempt':_0x2923ba[_0x376259(0x280)]},..._0x1cbc8f!==undefined&&{'duration_sec':_0x1cbc8f},..._0x2923ba[_0x376259(0x290)]&&{'created_at':_0x2923ba[_0x376259(0x290)]},..._0x2923ba[_0x376259(0x299)]&&{'finished_at':_0x2923ba[_0x376259(0x299)]},...Object[_0x376259(0x146)](_0x2923ba[_0x376259(0x1a2)])[_0x376259(0x207)]>0x0&&{'params':_0x2923ba[_0x376259(0x1a2)]}};return await handleSingleObjectOutput(_0x48cff7,_0x5bda43),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x139d5f(0x167)]='workflow:tasks';[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x1d5);async['execute'](_0x3b1b51){const _0x3c9662=a41_0x139d5f,{options:_0x59b27c,args:_0x3c6733,tdx:_0x4e8d0d}=_0x3b1b51,_0x2c92dd=_0x3c6733[0x0];if(!_0x2c92dd)return console[_0x3c9662(0x295)](_0x3c9662(0x1ba)),0x1;const _0x2530bf=_0x59b27c['includeSubtasks'];_0x59b27c['verbose']&&(console[_0x3c9662(0x295)](_0x3c9662(0x13e)+_0x2c92dd),_0x2530bf&&console['error'](_0x3c9662(0x279)));const _0x215244=await withSpinner(_0x3c9662(0x148),()=>_0x4e8d0d[_0x3c9662(0x2b6)][_0x3c9662(0x1af)](_0x2c92dd,_0x2530bf||![]),{'verbose':_0x59b27c[_0x3c9662(0x1e9)]}),_0x226024=_0x215244[_0x3c9662(0x2d9)];return console[_0x3c9662(0x295)]('✔\x20Found\x20'+_0x226024['length']+_0x3c9662(0x214)+(_0x226024[_0x3c9662(0x207)]!==0x1?'s':'')),await handleSDKOutput(_0x226024,_0x59b27c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x139d5f(0x167)]='workflow:logs';['description']=a41_0x139d5f(0x143);async[a41_0x139d5f(0x175)](_0x86d35a){const _0x42e2ea=a41_0x139d5f,{options:_0x1e445f,args:_0x21ae4e,tdx:_0x1436d3}=_0x86d35a,_0x209a41=_0x21ae4e[0x0];let _0x22dc28=_0x21ae4e[0x1];if(!_0x209a41)return console[_0x42e2ea(0x295)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1e445f['verbose']&&(console[_0x42e2ea(0x295)]('Attempt\x20ID:\x20'+_0x209a41),_0x22dc28&&console[_0x42e2ea(0x295)](_0x42e2ea(0x13c)+_0x22dc28));const _0x190a02=await withSpinner(_0x42e2ea(0x249),()=>_0x1436d3[_0x42e2ea(0x2b6)][_0x42e2ea(0x281)](_0x209a41,_0x22dc28),{'verbose':_0x1e445f['verbose']}),_0x11091f=_0x190a02[_0x42e2ea(0x2d9)];if(_0x11091f[_0x42e2ea(0x207)]===0x0)return console[_0x42e2ea(0x295)](_0x42e2ea(0x2a1)),0x0;if(!_0x22dc28&&(_0x1e445f[_0x42e2ea(0x18f)]||_0x1e445f[_0x42e2ea(0x1d3)]))return await handleSDKOutput(_0x11091f,_0x1e445f),0x0;if(!_0x22dc28){const _0xc91245=_0x11091f[_0x42e2ea(0x2a3)](_0x4539c8=>({'title':_0x4539c8[_0x42e2ea(0x201)]+'\x20('+formatBytes(_0x4539c8[_0x42e2ea(0x13f)])+')','value':_0x4539c8[_0x42e2ea(0x201)]})),_0x3ac069=await a41_0x116876({'type':_0x42e2ea(0x2bd),'name':_0x42e2ea(0x2cd),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0xc91245});if(!_0x3ac069[_0x42e2ea(0x2cd)])return console[_0x42e2ea(0x295)]('Cancelled'),0x0;_0x22dc28=_0x3ac069[_0x42e2ea(0x2cd)];}const _0x35ce64=await withSpinner(_0x42e2ea(0x1e5),()=>_0x1436d3[_0x42e2ea(0x2b6)][_0x42e2ea(0x2ba)](_0x209a41,_0x22dc28),{'verbose':_0x1e445f[_0x42e2ea(0x1e9)]}),_0x31cb02=_0x35ce64[_0x42e2ea(0x2d9)];return _0x31cb02?console[_0x42e2ea(0x215)](_0x31cb02):console[_0x42e2ea(0x295)](_0x42e2ea(0x200)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x244);[a41_0x139d5f(0x25d)]='Kill\x20a\x20running\x20attempt';async[a41_0x139d5f(0x175)](_0x1d7e90){const _0x4f12fe=a41_0x139d5f,{options:_0x937b99,args:_0xce7410,tdx:_0x1542e0}=_0x1d7e90,_0x59d177=_0xce7410[0x0];if(!_0x59d177)return console[_0x4f12fe(0x295)](_0x4f12fe(0x1ba)),0x1;const _0x43f23a=_0x937b99['reason'];_0x937b99['verbose']&&(console[_0x4f12fe(0x295)](_0x4f12fe(0x13e)+_0x59d177),_0x43f23a&&console['error'](_0x4f12fe(0x26d)+_0x43f23a));if(!_0x937b99[_0x4f12fe(0x16f)]){const _0x480231=await confirmKey(_0x4f12fe(0x1e2)+_0x59d177+'?');if(!_0x480231)return console['error'](_0x4f12fe(0x2a2)),0x0;}const _0xf4e733=await withSpinner(_0x4f12fe(0x1d2),()=>_0x1542e0[_0x4f12fe(0x2b6)][_0x4f12fe(0x1a7)](_0x59d177,_0x43f23a),{'verbose':_0x937b99[_0x4f12fe(0x1e9)]}),_0x5c2bc3=_0xf4e733['data'];return console[_0x4f12fe(0x295)]('✔\x20'+_0x5c2bc3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x217);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x286);async['execute'](_0x414a98){const _0x47f1fc=a41_0x139d5f,{options:_0x46b90b,args:_0x378771,tdx:_0x1cbda0}=_0x414a98,_0x40b7df=_0x378771[0x0];if(!_0x40b7df)return console[_0x47f1fc(0x295)](_0x47f1fc(0x1b0)),console['error'](_0x47f1fc(0x282)),0x1;let _0x556217=![],_0x547b1e=_0x40b7df;if(_0x40b7df['startsWith']('session:'))_0x556217=!![],_0x547b1e=_0x40b7df[_0x47f1fc(0x1c6)](0x8);else{if(_0x40b7df[_0x47f1fc(0x236)](_0x47f1fc(0x21a)))_0x556217=![],_0x547b1e=_0x40b7df[_0x47f1fc(0x1c6)](0x8);else return console['error'](_0x47f1fc(0x1df)),console['error'](_0x47f1fc(0x282)),0x1;}const _0x210129=_0x46b90b['fromTask'],_0x254564=_0x46b90b[_0x47f1fc(0x226)],_0x2fed99=_0x46b90b['params'],_0x221d7f=_0x46b90b[_0x47f1fc(0x1c4)];_0x46b90b[_0x47f1fc(0x1e9)]&&(console[_0x47f1fc(0x295)](_0x47f1fc(0x24c)+(_0x556217?'session':'attempt')+'\x20'+_0x547b1e),_0x210129&&console[_0x47f1fc(0x295)]('From\x20task:\x20'+_0x210129),_0x254564&&console['error'](_0x47f1fc(0x1c5)+_0x254564),_0x2fed99&&console['error']('Params:\x20'+_0x2fed99),_0x221d7f&&console['error'](_0x47f1fc(0x1f1)));let _0x3f61bc;if(_0x2fed99)try{if(_0x2fed99[_0x47f1fc(0x236)]('@')){const _0x134f7e=await import(_0x47f1fc(0x27e)),_0x2a4b44=_0x2fed99[_0x47f1fc(0x1c6)](0x1),_0x4b3c2c=await _0x134f7e['readFile'](_0x2a4b44,_0x47f1fc(0x261));_0x3f61bc=JSON[_0x47f1fc(0x157)](_0x4b3c2c);}else _0x3f61bc=JSON['parse'](_0x2fed99);}catch{return console[_0x47f1fc(0x295)](_0x47f1fc(0x291)),0x1;}if(!_0x46b90b[_0x47f1fc(0x16f)]){const _0xfb867f=await confirmKey(_0x47f1fc(0x28f)+(_0x556217?_0x47f1fc(0x2b8):_0x47f1fc(0x189))+'\x20'+_0x547b1e+'?');if(!_0xfb867f)return console['error'](_0x47f1fc(0x2a2)),0x0;}let _0x521ab3;_0x556217?_0x521ab3=await withSpinner(_0x47f1fc(0x197),()=>_0x1cbda0[_0x47f1fc(0x2b6)][_0x47f1fc(0x1f3)](_0x547b1e,{'fromTask':_0x210129,'retryParams':_0x3f61bc}),{'verbose':_0x46b90b[_0x47f1fc(0x1e9)]}):_0x521ab3=await withSpinner(_0x47f1fc(0x2d5),()=>_0x1cbda0[_0x47f1fc(0x2b6)][_0x47f1fc(0x22f)](_0x547b1e,{'resumeFrom':_0x254564,'retryParams':_0x3f61bc,'force':_0x221d7f}),{'verbose':_0x46b90b[_0x47f1fc(0x1e9)]});const _0x380c95=_0x521ab3['data'];return console['error'](_0x47f1fc(0x219)),console[_0x47f1fc(0x295)](_0x47f1fc(0x1fa)+_0x380c95[_0x47f1fc(0x1d1)]),console[_0x47f1fc(0x295)]('\x20\x20Session\x20ID:\x20'+_0x380c95[_0x47f1fc(0x223)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]='workflow:run';[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x2d4);async['execute'](_0xdc08f2){const _0x2862dd=a41_0x139d5f,{options:_0x3845a0,args:_0x25355e,tdx:_0x1ca3d6}=_0xdc08f2;let _0x3ea504=_0x25355e[0x0];if(!_0x3ea504){const _0xdc124e=this[_0x2862dd(0x1c9)]([],_0x3845a0),_0x295b06=await withSpinner(_0x2862dd(0x21e),()=>_0x1ca3d6['workflow'][_0x2862dd(0x2bc)](_0xdc124e,{'limit':_0x3845a0['limit']}),{'verbose':_0x3845a0['verbose']}),_0x307ec0=_0x295b06[_0x2862dd(0x2d9)];if(_0x307ec0[_0x2862dd(0x207)]===0x0)return console['error'](_0x2862dd(0x29d)),!_0xdc124e&&console[_0x2862dd(0x295)](a41_0x50b6be[_0x2862dd(0x176)](_0x2862dd(0x17f))),0x1;const _0x569096=_0x307ec0['map'](_0x2cf194=>({'title':_0x2cf194[_0x2862dd(0x1cb)]?.[_0x2862dd(0x167)]+'.'+_0x2cf194[_0x2862dd(0x167)],'value':_0x2cf194[_0x2862dd(0x1cb)]?.[_0x2862dd(0x167)]+'.'+_0x2cf194[_0x2862dd(0x167)],'description':_0x2cf194[_0x2862dd(0x22c)]?_0x2862dd(0x2b7)+_0x2cf194[_0x2862dd(0x22c)]:undefined})),_0x247662=await a41_0x116876({'type':_0x2862dd(0x2bd),'name':_0x2862dd(0x2b6),'message':_0x2862dd(0x264),'choices':_0x569096});if(!_0x247662['workflow'])return 0x1;_0x3ea504=_0x247662[_0x2862dd(0x2b6)];}if(!_0x3ea504[_0x2862dd(0x19d)]('.')){const _0x58584e=this[_0x2862dd(0x1c9)]([],_0x3845a0);if(_0x58584e)_0x3ea504=_0x58584e+'.'+_0x3ea504;else return console[_0x2862dd(0x295)](a41_0x50b6be[_0x2862dd(0x266)](_0x2862dd(0x232)),_0x2862dd(0x1f6)),console[_0x2862dd(0x295)](a41_0x50b6be[_0x2862dd(0x176)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1f0854=_0x3845a0['param'],_0x1fd7c9=_0x3845a0[_0x2862dd(0x1c1)],_0xf7c0c7={};if(_0x1f0854&&Array['isArray'](_0x1f0854))for(const _0x2bad6c of _0x1f0854){const _0x4efa93=_0x2bad6c['indexOf']('=');if(_0x4efa93===-0x1)return console[_0x2862dd(0x295)](_0x2862dd(0x294)+_0x2bad6c),console[_0x2862dd(0x295)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x662fcc=_0x2bad6c[_0x2862dd(0x1c6)](0x0,_0x4efa93),_0x14d4a8=_0x2bad6c[_0x2862dd(0x1c6)](_0x4efa93+0x1);try{_0xf7c0c7[_0x662fcc]=JSON[_0x2862dd(0x157)](_0x14d4a8);}catch{_0xf7c0c7[_0x662fcc]=_0x14d4a8;}}_0x3845a0[_0x2862dd(0x1e9)]&&(console[_0x2862dd(0x295)]('Workflow:\x20'+_0x3ea504),Object['keys'](_0xf7c0c7)[_0x2862dd(0x207)]>0x0&&console[_0x2862dd(0x295)]('Parameters:\x20'+JSON[_0x2862dd(0x276)](_0xf7c0c7)),_0x1fd7c9&&console[_0x2862dd(0x295)]('Session\x20time:\x20'+_0x1fd7c9));const _0xb78b=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1ca3d6[_0x2862dd(0x2b6)][_0x2862dd(0x2d2)](_0x3ea504,_0xf7c0c7,{'sessionTime':_0x1fd7c9}),{'verbose':_0x3845a0['verbose']}),_0x1367dc=_0xb78b[_0x2862dd(0x2d9)];console['error'](_0x2862dd(0x1d7)),console[_0x2862dd(0x295)](_0x2862dd(0x15c)+_0x1367dc['id']),console[_0x2862dd(0x295)](_0x2862dd(0x180)+_0x1367dc['sessionId']),console['error'](_0x2862dd(0x2ca)+_0x1367dc[_0x2862dd(0x1cb)]?.[_0x2862dd(0x167)]),console[_0x2862dd(0x295)](_0x2862dd(0x1fc)+_0x1367dc[_0x2862dd(0x2b6)]?.[_0x2862dd(0x167)]);if(_0x1367dc[_0x2862dd(0x1cb)]?.['id']&&_0x1367dc[_0x2862dd(0x223)]&&_0x1367dc['id']){const _0x218eb4=_0x3845a0[_0x2862dd(0x1f8)],_0x2bba49=getConsoleUrl(_0x218eb4,_0x2862dd(0x287)+_0x1367dc[_0x2862dd(0x1cb)]['id']+_0x2862dd(0x1f5)+_0x1367dc[_0x2862dd(0x223)]+_0x2862dd(0x2b4)+_0x1367dc['id']);console[_0x2862dd(0x295)](_0x2862dd(0x2c6)+a41_0x50b6be[_0x2862dd(0x2ce)](_0x2bba49));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a41_0x139d5f(0x1d0);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x1f0);async['execute'](_0x11dccb){const _0xaff56c=a41_0x139d5f,{options:_0x5430d3,args:_0x17e14b,tdx:_0x483849}=_0x11dccb,_0x36d2d8=_0x17e14b[0x0],_0x243ecb=_0x17e14b[0x1]||'.';if(!_0x36d2d8)return console['error'](_0xaff56c(0x1bb)),console[_0xaff56c(0x295)](_0xaff56c(0x158)),0x1;const _0x5e8494=_0x5430d3[_0xaff56c(0x22c)];_0x5430d3[_0xaff56c(0x1e9)]&&(console[_0xaff56c(0x295)](_0xaff56c(0x209)+_0x36d2d8),console[_0xaff56c(0x295)](_0xaff56c(0x171)+_0x243ecb),_0x5e8494&&console[_0xaff56c(0x295)](_0xaff56c(0x1a4)+_0x5e8494));const _0x484e39=await withSpinner(_0xaff56c(0x1c8)+_0x36d2d8+_0xaff56c(0x20f),()=>_0x483849[_0xaff56c(0x2b6)][_0xaff56c(0x2d7)](_0x36d2d8,_0x243ecb,{'revision':_0x5e8494}),{'verbose':_0x5430d3['verbose']}),_0x474481=_0x484e39[_0xaff56c(0x2d9)];return console['error'](_0xaff56c(0x174)+_0x474481['projectName']),console[_0xaff56c(0x295)](_0xaff56c(0x2aa)+_0x474481[_0xaff56c(0x22c)]),console[_0xaff56c(0x295)]('\x20\x20Files\x20extracted:\x20'+_0x474481[_0xaff56c(0x254)]),console[_0xaff56c(0x295)](_0xaff56c(0x19a)+_0x243ecb+'/'+_0x474481['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']='workflow:upload';[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x257);async[a41_0x139d5f(0x175)](_0x233881){const _0x23ce52=a41_0x139d5f,{options:_0x33ac99,args:_0x46f1dc,tdx:_0x33c6c7}=_0x233881;let _0x3a0fa0='.',_0x3ff983=_0x33ac99[_0x23ce52(0x167)];if(_0x46f1dc[0x0]){const {promises:_0x148818}=await import('fs');try{const _0x112571=await _0x148818['stat'](_0x46f1dc[0x0]);if(_0x112571[_0x23ce52(0x1ca)]())_0x3a0fa0=_0x46f1dc[0x0];else return console['error'](_0x23ce52(0x26e)+_0x46f1dc[0x0]+_0x23ce52(0x151)),0x1;}catch{_0x3ff983=_0x46f1dc[0x0],_0x3a0fa0='.';}}const _0x54d2d9=_0x33ac99[_0x23ce52(0x22c)],_0x53c6e4=_0x33ac99[_0x23ce52(0x222)];_0x33ac99[_0x23ce52(0x1e9)]&&(console[_0x23ce52(0x295)](_0x23ce52(0x166)+_0x3a0fa0),_0x3ff983&&console[_0x23ce52(0x295)](_0x23ce52(0x234)+_0x3ff983),_0x54d2d9&&console[_0x23ce52(0x295)]('Revision:\x20'+_0x54d2d9),_0x53c6e4&&console['error'](_0x23ce52(0x2c3)));const _0xee24a2=await withSpinner(_0x23ce52(0x1be),()=>_0x33c6c7[_0x23ce52(0x2b6)][_0x23ce52(0x2b2)](_0x3a0fa0,{'projectName':_0x3ff983,'revision':_0x54d2d9,'skipValidation':_0x53c6e4}),{'verbose':_0x33ac99[_0x23ce52(0x1e9)]}),_0x53a94d=_0xee24a2['data'];return console[_0x23ce52(0x295)](_0x23ce52(0x297)+_0x53a94d[_0x23ce52(0x205)]),console[_0x23ce52(0x295)](_0x23ce52(0x2c8)+_0x53a94d[_0x23ce52(0x2a6)]),console['error']('\x20\x20Revision:\x20'+_0x53a94d[_0x23ce52(0x22c)]),await this[_0x23ce52(0x150)](_0x33c6c7,_0x53a94d[_0x23ce52(0x205)],_0x33ac99['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x139d5f(0x167)]='workflow:pull';[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x1dc);async[a41_0x139d5f(0x175)](_0x592814){const _0x464a48=a41_0x139d5f,{options:_0x14368b,args:_0x439898,tdx:_0x2fbec5}=_0x592814,_0x5548ad=_0x439898[0x0],_0x297e26=_0x439898[0x1];if(!_0x5548ad)return console[_0x464a48(0x295)](a41_0x50b6be[_0x464a48(0x266)](_0x464a48(0x232)),'Project\x20name\x20is\x20required'),console[_0x464a48(0x295)](a41_0x50b6be[_0x464a48(0x176)](_0x464a48(0x1de))),0x1;const _0x2ff49f=_0x14368b[_0x464a48(0x22c)];_0x14368b[_0x464a48(0x1e9)]&&(console['error']('Project:\x20'+_0x5548ad),_0x297e26&&console['error'](_0x464a48(0x2e0)+_0x297e26),_0x2ff49f&&console[_0x464a48(0x295)](_0x464a48(0x1a4)+_0x2ff49f),_0x14368b[_0x464a48(0x26c)]&&console['error'](_0x464a48(0x2dd)));const _0x593b8b=await withSpinner(_0x464a48(0x288)+_0x5548ad+_0x464a48(0x20f),()=>_0x2fbec5[_0x464a48(0x2b6)][_0x464a48(0x144)](_0x5548ad,{'targetDir':_0x297e26,'revision':_0x2ff49f}),{'verbose':_0x14368b['verbose']}),_0x3dae42=_0x593b8b['data'];_0x3dae42[_0x464a48(0x16d)]?console['error']('✔\x20New\x20project:\x20'+_0x3dae42['projectName']):console[_0x464a48(0x295)](_0x464a48(0x2c0)+_0x3dae42[_0x464a48(0x205)]);console['error'](_0x464a48(0x2aa)+_0x3dae42[_0x464a48(0x22c)]),console[_0x464a48(0x295)](_0x464a48(0x285)+(a41_0x145759[_0x464a48(0x23e)](process[_0x464a48(0x1bf)](),_0x3dae42[_0x464a48(0x16a)])||'.')),console[_0x464a48(0x295)](_0x464a48(0x1b3)+a41_0x50b6be['green']('+'+_0x3dae42[_0x464a48(0x2d0)]['new']+'\x20new')+',\x20'+(a41_0x50b6be['yellow']('~'+_0x3dae42[_0x464a48(0x2d0)][_0x464a48(0x247)]+_0x464a48(0x1c7))+',\x20')+(a41_0x50b6be[_0x464a48(0x266)]('-'+_0x3dae42[_0x464a48(0x2d0)][_0x464a48(0x1cc)]+_0x464a48(0x2d3))+',\x20')+(''+a41_0x50b6be[_0x464a48(0x176)](_0x3dae42[_0x464a48(0x2d0)][_0x464a48(0x1a8)]+_0x464a48(0x19b))));for(const _0x447791 of _0x3dae42['changes']){_0x447791[_0x464a48(0x2cc)]===_0x464a48(0x247)&&_0x447791[_0x464a48(0x23c)]&&(console[_0x464a48(0x295)]('\x0a'+a41_0x50b6be['cyan'](_0x464a48(0x1e0)+_0x447791['path'])),console[_0x464a48(0x295)](_0x447791[_0x464a48(0x23c)]));}if(!_0x3dae42[_0x464a48(0x179)])return saveSessionContext({'workflow_project':_0x3dae42[_0x464a48(0x205)]},_0x14368b[_0x464a48(0x2b8)]),console[_0x464a48(0x295)](a41_0x50b6be[_0x464a48(0x20b)](_0x464a48(0x1e8))),console['error'](a41_0x50b6be[_0x464a48(0x176)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3dae42[_0x464a48(0x205)])),0x0;if(_0x14368b[_0x464a48(0x26c)])return console['error'](a41_0x50b6be[_0x464a48(0x1d8)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x14368b[_0x464a48(0x16f)]){const _0x20a0f5=await confirmKey(_0x464a48(0x1f7));if(!_0x20a0f5)return console[_0x464a48(0x295)]('Cancelled'),0x0;}await withSpinner(_0x464a48(0x198),()=>_0x2fbec5[_0x464a48(0x2b6)][_0x464a48(0x1db)](_0x3dae42,{'revision':_0x2ff49f}),{'verbose':_0x14368b['verbose']}),saveSessionContext({'workflow_project':_0x3dae42['projectName']},_0x14368b[_0x464a48(0x2b8)]),console['error'](a41_0x50b6be['green'](_0x464a48(0x1a5)));const _0x188a01=a41_0x145759['relative'](process['cwd'](),_0x3dae42[_0x464a48(0x16a)])||'.';return console[_0x464a48(0x295)](a41_0x50b6be['dim'](_0x464a48(0x19a)+_0x188a01)),console[_0x464a48(0x295)](a41_0x50b6be[_0x464a48(0x176)](_0x464a48(0x27f)+_0x3dae42[_0x464a48(0x205)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a41_0x139d5f(0x18b);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x246);async[a41_0x139d5f(0x175)](_0x47c6e1){const _0x435cf0=a41_0x139d5f,{options:_0x171e6e,args:_0x44a80b,tdx:_0x495e67}=_0x47c6e1,_0x73942f=this['resolveProjectDir'](_0x44a80b,_0x171e6e),_0x2057c8=_0x171e6e[_0x435cf0(0x22c)],_0x28c6de=_0x171e6e[_0x435cf0(0x222)];_0x171e6e[_0x435cf0(0x1e9)]&&(_0x73942f&&console[_0x435cf0(0x295)](_0x435cf0(0x18c)+_0x73942f),_0x2057c8&&console[_0x435cf0(0x295)](_0x435cf0(0x1a4)+_0x2057c8),_0x171e6e[_0x435cf0(0x26c)]&&console['error']('Dry\x20run:\x20yes'),_0x28c6de&&console['error'](_0x435cf0(0x2c3)));let _0x172c90;try{_0x172c90=await withSpinner('Analyzing\x20changes...',()=>_0x495e67[_0x435cf0(0x2b6)][_0x435cf0(0x187)]({'sourceDir':_0x73942f,'revision':_0x2057c8,'skipValidation':_0x28c6de}),{'verbose':_0x171e6e[_0x435cf0(0x1e9)]});}catch(_0x1b86af){if(_0x1b86af instanceof Error&&_0x1b86af[_0x435cf0(0x242)]['includes'](_0x435cf0(0x252)))return console[_0x435cf0(0x295)](a41_0x50b6be[_0x435cf0(0x266)](_0x435cf0(0x232)),_0x435cf0(0x21c)),_0x171e6e['workflowProject']?console[_0x435cf0(0x295)](a41_0x50b6be['dim'](_0x435cf0(0x186)+_0x171e6e[_0x435cf0(0x25e)]+_0x435cf0(0x245)+_0x171e6e[_0x435cf0(0x25e)]+'\x27')):console[_0x435cf0(0x295)](a41_0x50b6be['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x1b86af;}const _0x34c182=_0x172c90[_0x435cf0(0x2d9)];console[_0x435cf0(0x295)](_0x435cf0(0x2c0)+_0x34c182['projectName']),console[_0x435cf0(0x295)](_0x435cf0(0x28a)+_0x34c182[_0x435cf0(0x1ec)]),console[_0x435cf0(0x295)](_0x435cf0(0x2aa)+_0x34c182['revision']),console[_0x435cf0(0x295)](_0x435cf0(0x1b3)+a41_0x50b6be['green']('+'+_0x34c182['summary'][_0x435cf0(0x275)]+_0x435cf0(0x25c))+',\x20'+(a41_0x50b6be[_0x435cf0(0x1d8)]('~'+_0x34c182[_0x435cf0(0x2d0)][_0x435cf0(0x247)]+_0x435cf0(0x1c7))+',\x20')+(a41_0x50b6be[_0x435cf0(0x266)]('-'+_0x34c182[_0x435cf0(0x2d0)][_0x435cf0(0x1cc)]+_0x435cf0(0x2d3))+',\x20')+(''+a41_0x50b6be[_0x435cf0(0x176)](_0x34c182[_0x435cf0(0x2d0)]['unchanged']+_0x435cf0(0x19b))));for(const _0x28da38 of _0x34c182[_0x435cf0(0x1b7)]){_0x28da38[_0x435cf0(0x2cc)]==='modified'&&_0x28da38[_0x435cf0(0x23c)]&&(console[_0x435cf0(0x295)]('\x0a'+a41_0x50b6be['cyan'](_0x435cf0(0x1e0)+_0x28da38[_0x435cf0(0x284)])),console[_0x435cf0(0x295)](_0x28da38[_0x435cf0(0x23c)]));}if(!_0x34c182[_0x435cf0(0x179)])return console['error'](a41_0x50b6be['green'](_0x435cf0(0x250))),await this['showWorkflowConsoleUrl'](_0x495e67,_0x34c182[_0x435cf0(0x205)],_0x171e6e[_0x435cf0(0x1f8)]),0x0;if(_0x171e6e[_0x435cf0(0x26c)])return console[_0x435cf0(0x295)](a41_0x50b6be[_0x435cf0(0x1d8)](_0x435cf0(0x1ef))),0x0;if(!_0x171e6e[_0x435cf0(0x16f)]){const _0x394f27=await confirmKey(_0x435cf0(0x2da));if(!_0x394f27)return console[_0x435cf0(0x295)](_0x435cf0(0x2a2)),0x0;}const _0x4ac6f4=await withSpinner(_0x435cf0(0x270),()=>_0x495e67[_0x435cf0(0x2b6)][_0x435cf0(0x227)](_0x34c182),{'verbose':_0x171e6e['verbose']}),_0x5890b4=_0x4ac6f4[_0x435cf0(0x2d9)];return console['error'](a41_0x50b6be[_0x435cf0(0x20b)]('✔\x20Push\x20complete')),console[_0x435cf0(0x295)]('\x20\x20Project\x20ID:\x20'+_0x5890b4[_0x435cf0(0x2a6)]),console[_0x435cf0(0x295)](_0x435cf0(0x2aa)+_0x5890b4[_0x435cf0(0x22c)]),await this['showWorkflowConsoleUrl'](_0x495e67,_0x5890b4['projectName'],_0x171e6e['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x18e);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x213);async[a41_0x139d5f(0x175)](_0x20e3e5){const _0x32bbdf=a41_0x139d5f,{options:_0x3baedd,args:_0x20064b,tdx:_0x180be5}=_0x20e3e5,_0x379ba5=this[_0x32bbdf(0x141)](_0x20064b,_0x3baedd),_0x1e9f6f=_0x3baedd[_0x32bbdf(0x167)],_0x73686b=_0x3baedd[_0x32bbdf(0x22c)],_0x1ed525=_0x3baedd['skipValidation'];if(!_0x379ba5)return console[_0x32bbdf(0x295)](a41_0x50b6be[_0x32bbdf(0x266)](_0x32bbdf(0x232)),_0x32bbdf(0x22d)),console['error'](a41_0x50b6be[_0x32bbdf(0x176)](_0x32bbdf(0x29f))),console['error'](a41_0x50b6be[_0x32bbdf(0x176)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x1e9f6f)return console[_0x32bbdf(0x295)](a41_0x50b6be[_0x32bbdf(0x266)](_0x32bbdf(0x232)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x32bbdf(0x295)](a41_0x50b6be['dim'](_0x32bbdf(0x29f))),0x1;_0x3baedd[_0x32bbdf(0x1e9)]&&(console[_0x32bbdf(0x295)](_0x32bbdf(0x18c)+_0x379ba5),console[_0x32bbdf(0x295)]('New\x20project\x20name:\x20'+_0x1e9f6f),_0x73686b&&console[_0x32bbdf(0x295)](_0x32bbdf(0x1a4)+_0x73686b),_0x3baedd[_0x32bbdf(0x26c)]&&console['error'](_0x32bbdf(0x2dd)),_0x1ed525&&console[_0x32bbdf(0x295)](_0x32bbdf(0x2c3)));const _0x138ea6=await withSpinner(_0x32bbdf(0x173),()=>_0x180be5[_0x32bbdf(0x2b6)][_0x32bbdf(0x24d)](_0x379ba5,_0x1e9f6f,{'revision':_0x73686b,'skipValidation':_0x1ed525}),{'verbose':_0x3baedd[_0x32bbdf(0x1e9)]}),_0x3f7f41=_0x138ea6[_0x32bbdf(0x2d9)];console[_0x32bbdf(0x295)](_0x32bbdf(0x149)+_0x3f7f41['sourceDir']);_0x3f7f41[_0x32bbdf(0x235)]&&console['error']('Source\x20project:\x20'+_0x3f7f41[_0x32bbdf(0x235)]);console[_0x32bbdf(0x295)]('New\x20project\x20name:\x20'+_0x3f7f41[_0x32bbdf(0x165)]),console['error'](_0x32bbdf(0x1a4)+_0x3f7f41[_0x32bbdf(0x22c)]),console[_0x32bbdf(0x295)]('Files\x20to\x20upload:\x20'+_0x3f7f41['fileCount']);_0x3f7f41['targetExists']&&(console[_0x32bbdf(0x295)](a41_0x50b6be[_0x32bbdf(0x1d8)](_0x32bbdf(0x268)+_0x3f7f41[_0x32bbdf(0x165)]+_0x32bbdf(0x24e)+_0x3f7f41['existingProjectId']+')')),console[_0x32bbdf(0x295)](a41_0x50b6be[_0x32bbdf(0x1d8)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x3baedd[_0x32bbdf(0x26c)])return console[_0x32bbdf(0x295)](a41_0x50b6be['yellow'](_0x32bbdf(0x153))),0x0;if(!_0x3baedd['yes']){const _0x4360cb=_0x3f7f41[_0x32bbdf(0x235)]||a41_0x145759[_0x32bbdf(0x1aa)](_0x379ba5),_0x3d65b8=_0x3f7f41['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x1e9f6f+_0x32bbdf(0x17d):_0x32bbdf(0x163)+_0x4360cb+_0x32bbdf(0x2b9)+_0x1e9f6f+'\x22?',_0x4578df=await confirmKey(_0x3d65b8);if(!_0x4578df)return console['error']('Cancelled'),0x0;}const _0x3b0424=await withSpinner(_0x3f7f41[_0x32bbdf(0x23f)]?'Updating\x20'+_0x1e9f6f+_0x32bbdf(0x20f):_0x32bbdf(0x14e)+_0x1e9f6f+_0x32bbdf(0x20f),()=>_0x180be5['workflow'][_0x32bbdf(0x2e2)](_0x3f7f41),{'verbose':_0x3baedd[_0x32bbdf(0x1e9)]}),_0x1d1afc=_0x3b0424[_0x32bbdf(0x2d9)];return console[_0x32bbdf(0x295)](a41_0x50b6be['green'](_0x3f7f41[_0x32bbdf(0x23f)]?_0x32bbdf(0x1a3):'✔\x20Clone\x20complete')),console['error'](_0x32bbdf(0x2ca)+_0x1d1afc[_0x32bbdf(0x165)]),console['error'](_0x32bbdf(0x2c8)+_0x1d1afc[_0x32bbdf(0x239)]),console[_0x32bbdf(0x295)](_0x32bbdf(0x2aa)+_0x1d1afc[_0x32bbdf(0x22c)]),await this[_0x32bbdf(0x150)](_0x180be5,_0x1d1afc[_0x32bbdf(0x165)],_0x3baedd[_0x32bbdf(0x1f8)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x139d5f(0x167)]='workflow:delete';[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x160);async[a41_0x139d5f(0x175)](_0x58ebe3){const _0x320453=a41_0x139d5f,{options:_0x18eb4a,args:_0x4b5a72,tdx:_0x4861ef}=_0x58ebe3,_0x2b18d7=_0x4b5a72[0x0];if(!_0x2b18d7)return console[_0x320453(0x295)](_0x320453(0x1fe)),console[_0x320453(0x295)](_0x320453(0x14a)),0x1;_0x18eb4a[_0x320453(0x1e9)]&&console['error'](_0x320453(0x209)+_0x2b18d7);if(!_0x18eb4a['yes']){const _0x513d82=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x2b18d7+_0x320453(0x17b));if(!_0x513d82)return console[_0x320453(0x295)](_0x320453(0x2a2)),0x0;}const _0x50b5a1=await withSpinner(_0x320453(0x27a)+_0x2b18d7+_0x320453(0x20f),()=>_0x4861ef[_0x320453(0x2b6)]['delete'](_0x2b18d7),{'verbose':_0x18eb4a[_0x320453(0x1e9)]}),_0x4a701d=_0x50b5a1['data'];return console[_0x320453(0x295)]('✔\x20Deleted\x20project\x20'+_0x4a701d['projectName']),console[_0x320453(0x295)](_0x320453(0x2c8)+_0x4a701d[_0x320453(0x2a6)]),0x0;}}export function parseKeyValue(_0x234b7a){const _0x108e34=a41_0x139d5f,_0x2701db=_0x234b7a[_0x108e34(0x20d)]('=');if(_0x2701db===-0x1)throw new Error(_0x108e34(0x283)+_0x234b7a+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x31b808=_0x234b7a['substring'](0x0,_0x2701db),_0x5212b0=_0x234b7a[_0x108e34(0x1c6)](_0x2701db+0x1);if(!_0x31b808)throw new Error(_0x108e34(0x265));return{'key':_0x31b808,'value':_0x5212b0};}function a41_0x1b9e(_0x40a8e5,_0x2da084){_0x40a8e5=_0x40a8e5-0x13c;const _0x3efd85=a41_0x3efd();let _0x1b9e5e=_0x3efd85[_0x40a8e5];return _0x1b9e5e;}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x194);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x1ab);async[a41_0x139d5f(0x175)](_0x5493a8){const _0x22784f=a41_0x139d5f,{options:_0x4c6169,args:_0x3c2f26,tdx:_0x27a0fb}=_0x5493a8,_0x2ebba5=this['requireProject'](_0x3c2f26,_0x4c6169);if(!_0x2ebba5)return 0x1;_0x4c6169[_0x22784f(0x1e9)]&&console[_0x22784f(0x295)]('Project:\x20'+_0x2ebba5);const _0x2919e8=await withSpinner(_0x22784f(0x152),()=>_0x27a0fb[_0x22784f(0x2b6)][_0x22784f(0x2cb)](_0x2ebba5),{'verbose':_0x4c6169[_0x22784f(0x1e9)]}),{secrets:_0x514aff}=_0x2919e8[_0x22784f(0x2d9)];return console[_0x22784f(0x295)](_0x22784f(0x262)+_0x514aff[_0x22784f(0x207)]+_0x22784f(0x191)+(_0x514aff[_0x22784f(0x207)]!==0x1?'s':'')),await handleSDKOutput(_0x514aff,_0x4c6169),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x1bc);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x147);async['execute'](_0xba6ae7){const _0x4fdc3d=a41_0x139d5f,{options:_0x3072d7,args:_0x17339a,tdx:_0x551776}=_0xba6ae7;let _0x37b1a3,_0x1ae51a;if(_0x17339a['length']>=0x2)_0x37b1a3=_0x17339a[0x0],_0x1ae51a=_0x17339a[0x1];else{if(_0x17339a[_0x4fdc3d(0x207)]===0x1&&_0x3072d7[_0x4fdc3d(0x25e)])_0x37b1a3=_0x3072d7['workflowProject'],_0x1ae51a=_0x17339a[0x0];else return _0x17339a[_0x4fdc3d(0x207)]===0x1?(console[_0x4fdc3d(0x295)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4fdc3d(0x295)](_0x4fdc3d(0x17f)),0x1):(console['error'](_0x4fdc3d(0x21b)),console[_0x4fdc3d(0x295)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x1cf3b9,_0x6ad84b;try{({key:_0x1cf3b9,value:_0x6ad84b}=parseKeyValue(_0x1ae51a));}catch(_0x1a9f5f){return _0x1a9f5f instanceof Error&&console['error'](a41_0x50b6be[_0x4fdc3d(0x266)](_0x4fdc3d(0x232)),_0x1a9f5f[_0x4fdc3d(0x242)]),0x1;}_0x3072d7['verbose']&&(console[_0x4fdc3d(0x295)](_0x4fdc3d(0x209)+_0x37b1a3),console[_0x4fdc3d(0x295)]('Key:\x20'+_0x1cf3b9));const _0x4dddf6=await withSpinner(_0x4fdc3d(0x1cf),()=>_0x551776[_0x4fdc3d(0x2b6)]['setSecret'](_0x37b1a3,_0x1cf3b9,_0x6ad84b),{'verbose':_0x3072d7[_0x4fdc3d(0x1e9)]}),_0x24bd64=_0x4dddf6['data'];return console[_0x4fdc3d(0x295)]('✔\x20Secret\x20\x27'+_0x24bd64['key']+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x24bd64[_0x4fdc3d(0x205)]+'\x27'),(_0x3072d7[_0x4fdc3d(0x18f)]||_0x3072d7[_0x4fdc3d(0x248)])&&await handleSingleObjectOutput(_0x24bd64,_0x3072d7),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x1c2);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x156);async[a41_0x139d5f(0x175)](_0x443bd8){const _0x125118=a41_0x139d5f,{options:_0x1e3079,args:_0x3d9e3f,tdx:_0x1da4ef}=_0x443bd8;let _0x4082ce,_0x47668b;if(_0x3d9e3f[_0x125118(0x207)]>=0x2)_0x4082ce=_0x3d9e3f[0x0],_0x47668b=_0x3d9e3f[0x1];else{if(_0x3d9e3f['length']===0x1&&_0x1e3079['workflowProject'])_0x4082ce=_0x1e3079[_0x125118(0x25e)],_0x47668b=_0x3d9e3f[0x0];else return _0x3d9e3f['length']===0x1?(console[_0x125118(0x295)](_0x125118(0x1bb)),console[_0x125118(0x295)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x125118(0x25f)),console[_0x125118(0x295)](_0x125118(0x1c0)),0x1);}_0x1e3079[_0x125118(0x1e9)]&&(console[_0x125118(0x295)](_0x125118(0x209)+_0x4082ce),console[_0x125118(0x295)](_0x125118(0x184)+_0x47668b));if(!_0x1e3079[_0x125118(0x16f)]){const _0x4d70e0=await confirmKey(_0x125118(0x231)+_0x47668b+'\x27\x20from\x20project\x20\x27'+_0x4082ce+'\x27?');if(!_0x4d70e0)return console[_0x125118(0x295)]('Cancelled'),0x0;}const _0x503ebf=await withSpinner(_0x125118(0x220),()=>_0x1da4ef[_0x125118(0x2b6)]['deleteSecret'](_0x4082ce,_0x47668b),{'verbose':_0x1e3079[_0x125118(0x1e9)]}),_0xa5e101=_0x503ebf[_0x125118(0x2d9)];return console['error'](_0x125118(0x230)+_0xa5e101[_0x125118(0x271)]+_0x125118(0x162)+_0xa5e101[_0x125118(0x205)]+'\x27'),(_0x1e3079[_0x125118(0x18f)]||_0x1e3079[_0x125118(0x248)])&&await handleSingleObjectOutput(_0xa5e101,_0x1e3079),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(_0x5343f8){const _0xa359b9=a41_0x139d5f,_0x38caee=Math[_0xa359b9(0x2ac)](_0x5343f8/0x3e8),_0x7aa0f0=Math['floor'](_0x38caee/0x3c),_0x50a0f4=Math[_0xa359b9(0x2ac)](_0x7aa0f0/0x3c),_0x5cbc13=Math[_0xa359b9(0x2ac)](_0x50a0f4/0x18);if(_0x5cbc13>0x0){const _0x1acdc2=_0x50a0f4%0x18;return _0x1acdc2>0x0?_0x5cbc13+'d\x20'+_0x1acdc2+'h':_0x5cbc13+'d';}else{if(_0x50a0f4>0x0){const _0x2b429c=_0x7aa0f0%0x3c;return _0x2b429c>0x0?_0x50a0f4+'h\x20'+_0x2b429c+'m':_0x50a0f4+'h';}else{if(_0x7aa0f0>0x0){const _0x9f99d7=_0x38caee%0x3c;return _0x9f99d7>0x0?_0x7aa0f0+'m\x20'+_0x9f99d7+'s':_0x7aa0f0+'m';}else return _0x38caee+'s';}}}function formatTimestamp(_0x3fb892,_0x1d84f0){const _0x481afa=a41_0x139d5f,_0x3c6d14=new Date(_0x3fb892),_0x40716d=String(_0x3c6d14['getHours']())[_0x481afa(0x2af)](0x2,'0'),_0x276beb=String(_0x3c6d14[_0x481afa(0x2ab)]())[_0x481afa(0x2af)](0x2,'0'),_0xf6a034=_0x40716d+':'+_0x276beb,_0x562b24=_0x3c6d14[_0x481afa(0x182)]()===_0x1d84f0[_0x481afa(0x182)]()&&_0x3c6d14[_0x481afa(0x15f)]()===_0x1d84f0['getMonth']()&&_0x3c6d14[_0x481afa(0x19f)]()===_0x1d84f0[_0x481afa(0x19f)]();if(_0x562b24)return _0xf6a034;else{const _0x5b3916=String(_0x3c6d14['getMonth']()+0x1)[_0x481afa(0x2af)](0x2,'0'),_0x1dc3b2=String(_0x3c6d14['getDate']())['padStart'](0x2,'0');return _0x5b3916+'-'+_0x1dc3b2+'\x20'+_0xf6a034;}}function formatDate(_0x58e106){const _0x2248bd=a41_0x139d5f,_0x38b26d=_0x58e106[_0x2248bd(0x182)](),_0x46a570=String(_0x58e106['getMonth']()+0x1)[_0x2248bd(0x2af)](0x2,'0'),_0x5da310=String(_0x58e106['getDate']())[_0x2248bd(0x2af)](0x2,'0');return _0x38b26d+'-'+_0x46a570+'-'+_0x5da310;}function getTaskStateIcon(_0x5f4c1f){const _0x374b85={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x374b85[_0x5f4c1f]||'⚪';}function getBarChar(_0x2347ac){const _0x124d15=a41_0x139d5f;return _0x2347ac===_0x124d15(0x295)||_0x2347ac===_0x124d15(0x1ed)?'×':'─';}function getBarColor(_0x61914a){const _0x4462fe=a41_0x139d5f,_0x1484ea={'success':a41_0x50b6be[_0x4462fe(0x20b)],'error':a41_0x50b6be[_0x4462fe(0x266)],'group_error':a41_0x50b6be[_0x4462fe(0x266)],'running':a41_0x50b6be[_0x4462fe(0x17c)],'blocked':a41_0x50b6be[_0x4462fe(0x1d8)],'planned':a41_0x50b6be[_0x4462fe(0x176)],'canceling':a41_0x50b6be[_0x4462fe(0x1d8)]};return _0x1484ea[_0x61914a]||a41_0x50b6be[_0x4462fe(0x29a)];}function parseTaskName(_0x33c2c0){const _0x497154=a41_0x139d5f;let _0x10d132=_0x33c2c0[_0x497154(0x26a)](/^\++/,'');const _0x4c6680=_0x10d132[_0x497154(0x18d)]('+'),_0xdbd1de=_0x4c6680[_0x497154(0x207)]>0x1?_0x4c6680[_0x497154(0x207)]-0x2:0x0,_0x2018ad=_0x4c6680[_0x4c6680[_0x497154(0x207)]-0x1]||_0x10d132;return{'level':_0xdbd1de,'name':'+'+_0x2018ad};}function truncateTaskName(_0x35c6f9,_0x1bf964){const _0x174e50=a41_0x139d5f,_0x489e3e=stringWidth(_0x35c6f9);if(_0x489e3e<=_0x1bf964)return _0x35c6f9;let _0x50532b=_0x35c6f9;while(stringWidth(_0x50532b+'…')>_0x1bf964&&_0x50532b[_0x174e50(0x207)]>0x0){_0x50532b=_0x50532b[_0x174e50(0x211)](0x0,-0x1);}return _0x50532b+'…';}function calculateTimeScale(_0x7737b1,_0x49adc2){const _0x865d18=a41_0x139d5f;return{'startTime':_0x7737b1[_0x865d18(0x210)],'endTime':_0x7737b1['end'],'durationMs':_0x7737b1[_0x865d18(0x14f)],'msPerChar':_0x7737b1[_0x865d18(0x14f)]/_0x49adc2};}function timeToPosition(_0x5c9ec7,_0x248a46,_0x3bbd92){const _0x4e9bd4=a41_0x139d5f,_0x12b149=_0x5c9ec7-_0x248a46[_0x4e9bd4(0x14b)],_0x135bd5=Math[_0x4e9bd4(0x2ac)](_0x12b149/_0x248a46[_0x4e9bd4(0x2b0)]);return Math['max'](0x0,Math[_0x4e9bd4(0x253)](_0x135bd5,_0x3bbd92));}function renderTimeAxis(_0x567eb6,_0x17aee8){const _0x2f54ca=a41_0x139d5f,_0x67e1a7=Math[_0x2f54ca(0x253)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x2f54ca(0x2ac)](_0x17aee8/TIMELINE_CONFIG[_0x2f54ca(0x241)]))),_0x94de55=_0x567eb6['durationMs']/(_0x67e1a7-0x1),_0x58810b=new Date(_0x567eb6[_0x2f54ca(0x14b)]),_0x4a94c6=[];for(let _0x35e0ab=0x0;_0x35e0ab<_0x67e1a7;_0x35e0ab++){const _0xe48c05=_0x567eb6[_0x2f54ca(0x14b)]+_0x35e0ab*_0x94de55,_0x25bbdc=timeToPosition(_0xe48c05,_0x567eb6,_0x17aee8),_0x4c0646=formatTimestamp(_0xe48c05,_0x58810b);_0x4a94c6[_0x2f54ca(0x2b2)]({'pos':_0x25bbdc,'text':_0x4c0646});}const _0x19e2cd=new Array(_0x17aee8)[_0x2f54ca(0x251)]('\x20');let _0xf91d00=-0x1;for(const {pos:_0x485632,text:_0x4f4018}of _0x4a94c6){let _0xb252ba=Math['max'](0x0,_0x485632-Math[_0x2f54ca(0x2ac)](_0x4f4018[_0x2f54ca(0x207)]/0x2));_0xb252ba<=_0xf91d00+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0xb252ba=_0xf91d00+TIMELINE_CONFIG[_0x2f54ca(0x28d)]+0x1);_0xb252ba+_0x4f4018['length']>_0x17aee8&&(_0xb252ba=_0x17aee8-_0x4f4018[_0x2f54ca(0x207)]);if(_0xb252ba>=0x0&&_0xb252ba+_0x4f4018[_0x2f54ca(0x207)]<=_0x17aee8&&_0xb252ba>_0xf91d00){for(let _0x4bb797=0x0;_0x4bb797<_0x4f4018[_0x2f54ca(0x207)];_0x4bb797++){_0x19e2cd[_0xb252ba+_0x4bb797]=_0x4f4018[_0x4bb797];}_0xf91d00=_0xb252ba+_0x4f4018[_0x2f54ca(0x207)]-0x1;}}return _0x19e2cd['join']('');}function a41_0x3efd(){const _0x535198=['Project\x20filter:\x20','Including\x20subtasks:\x20yes','Deleting\x20project\x20','List\x20workflows','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x27...','fs/promises','\x20\x20Session\x20context\x20set\x20to:\x20','retryAttemptName','logFiles','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Invalid\x20format:\x20','path','\x20\x20Target:\x20','Retry\x20a\x20session\x20or\x20attempt','/app/workflows/','Pulling\x20project\x20','all','\x20\x20Source:\x20','44PhnfiA','List\x20workflow\x20attempts','LABEL_MIN_SPACING','workflow:projects','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','createdAt','Error:\x20Invalid\x20JSON\x20in\x20--params','Loading\x20sessions...','232zlyxQY','Error:\x20Invalid\x20parameter\x20format:\x20','error','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','✔\x20Pushed\x20','\x20sessions\x20','finishedAt','white','workflow:timeline','Resolving\x20project\x20\x27','No\x20workflows\x20found','Include\x20retried:\x20yes','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','8155rZAiwW','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Cancelled','map','context','window','projectId','Listing\x20workflows...','resolve','now','\x20\x20Revision:\x20','getMinutes','floor','Usage:\x20tdx\x20wf\x20use\x20<project>','splice','padStart','msPerChar','workflow:sessions','push','Warning:','/attempt/','text','workflow','revision:\x20','session','\x22\x20to\x20new\x20project\x20\x22','logs','\x0aPolling...\x20(','workflows','select','\x1b[1A\x1b[2K','ICON_WIDTH','✔\x20Project:\x20','output','fullName','Validation:\x20skipped','\x20workflow','list','\x20\x20Console:\x20','toLowerCase','\x20\x20Project\x20ID:\x20','session_id','\x20\x20Project:\x20','listSecrets','type','task','cyan','canceling','summary','POLL_INTERVAL_MS','run','\x20deleted','Start\x20a\x20workflow\x20run','Retrying\x20attempt...','46236whtSio','download','\x20attempt','data','\x0aPush\x20these\x20changes?','updatedAt','Loading\x20session...','Dry\x20run:\x20yes','GUTTER','write','Target\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','executeCloneProject','Latest\x20session\x20has\x20no\x20attempt','Task\x20name:\x20','done','Attempt\x20ID:\x20','fileSize','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','resolveProjectDir','\x20-\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','pullProject','value','keys','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Getting\x20attempt\x20tasks...','Source:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','startTime','MIN_TIMELINE_WIDTH','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Cloning\x20to\x20','duration','showWorkflowConsoleUrl','\x20is\x20not\x20a\x20directory','Listing\x20secrets...','\x0aDry\x20run\x20-\x20no\x20project\x20created','⚠\x20Showing\x20first\x20',',\x20Workflow:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','parse','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','📋\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','filter','\x20\x20Attempt\x20ID:\x20','No\x20sessions\x20found\x20for:\x20','tdx.json','getMonth','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','sort','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aClone\x20\x22','find','newProjectName','Project\x20directory:\x20','name','join','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','targetDir','Status:\x20','end','isNewProject','List\x20workflow\x20execution\x20sessions','yes','isTTY','Output\x20directory:\x20','No\x20projects\x20match\x20pattern:\x20','Analyzing\x20project...','✔\x20Downloaded\x20','execute','dim','Attempt:\x20','stdout','hasChanges','1232JoXhyJ','\x22?\x20This\x20cannot\x20be\x20undone.','blue','\x22\x20with\x20new\x20revision?','No\x20workflows\x20found\x20in\x20project:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Session\x20ID:\x20','MAX_TASKS_DISPLAY','getFullYear','Project\x20name\x20is\x20required','Key:\x20','MAX_TIMELINE_WIDTH','Tip:\x20cd\x20to\x20workflows/','preparePushProject','Filter:\x20project=','attempt','from','workflow:push','Source\x20directory:\x20','split','workflow:clone','json','5631363rjzMap','\x20secret','(unknown)','renderSessionsTimeline','workflow:secrets:list','💡\x20Tip:\x20Use\x20','pollTimeline','Retrying\x20session...','Writing\x20files...','sessions','\x20\x20Location:\x20','\x20unchanged','workflow:attempt','includes','Getting\x20attempt\x20details...','getDate','1086XNIxGa','\x20to\x20see\x20detailed\x20logs','params','✔\x20Project\x20updated','Revision:\x20','✔\x20Pull\x20complete','No\x20sessions\x20with\x20timing\x20information','kill','unchanged','max','basename','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','metadata','workflow:workflows','Listing\x20workflow\x20attempts...','tasks','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','renderSingleTimeline','\x20\x20Changes:\x20','\x20session','getTime','parseProjectWorkflowPattern','changes','No\x20sessions\x20found\x20in\x20project:\x20','limit','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Project\x20name\x20is\x20required','workflow:secrets:set','set','Pushing\x20workflow\x20project...','cwd','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','sessionTime','workflow:secrets:delete','size','force','Resume\x20from:\x20','substring','\x20modified','Downloading\x20project\x20','resolveProject','isDirectory','project','deleted','autocomplete','ICON_SPACING','Setting\x20secret...','workflow:download','attemptId','Killing\x20attempt...','format','renderTimeline','Show\x20tasks\x20for\x20an\x20attempt','3345120XWWaux','✔\x20Workflow\x20run\x20started','yellow','Auto-selected\x20latest\x20session:\x20','Pattern:\x20','applyPullProject','Pull\x20workflow\x20project\x20to\x20local\x20folder','36JKpuLq','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','---\x20','every','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','attempts','\x20(use\x20--limit\x20to\x20show\x20more)','Downloading\x20logs...','follow','clear','\x0a✔\x20Already\x20up\x20to\x20date','verbose','startedAt','get','sourceDir','group_error','12102qIgzmW','\x0aDry\x20run\x20-\x20nothing\x20pushed','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Force:\x20yes','toISOString','retrySession','status','/sessions/','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x0aApply\x20these\x20changes?','site','No\x20workflow\x20projects\x20found','\x20\x20New\x20attempt\x20ID:\x20','resolveProjectId','\x20\x20Workflow:\x20','success','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','generateSessionTimelineRows','No\x20log\x20content\x20found','taskName','match','Listing\x20workflow\x20sessions...','trimEnd','projectName','planned','length','Listing\x20workflow\x20projects...','Project:\x20','No\x20workflow\x20sessions\x20found','green','unknown','indexOf','workflow:attempts','...','start','slice','Session\x20','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20task','log','No\x20attempts\x20found\x20for:\x20','workflow:retry','lastAttempt','✔\x20Retry\x20started','attempt:','Error:\x20KEY=VALUE\x20is\x20required','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','running','Loading\x20workflows...','📁\x20','Deleting\x20secret...','Filter:\x20','skipValidation','sessionId','\x20(system)','\x20has\x20no\x20attempts','resumeFrom','executePushProject','columns','\x0aFailed\x20to\x20fetch\x20attempt\x20data','cancelRequested','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','revision','Source\x20directory\x20is\x20required','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','retryAttempt','✔\x20Secret\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Error:','(use\x20--limit\x20to\x20see\x20more)','Project\x20name:\x20','sourceProjectName','startsWith','state','some','newProjectId','✔\x20Showing\x20','workflowName','diff','\x20project','relative','targetExists','\x20\x20tdx\x20wf\x20use\x20<project>','LABEL_WIDTH_DIVISOR','message','requireProject','workflow:kill','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','modified','jsonl','Fetching\x20log\x20files...','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','1870mmbQSs','Target:\x20','prepareCloneProject','\x22\x20already\x20exists\x20(ID:\x20','Show\x20specific\x20attempt\x20details','\x0a✔\x20No\x20changes\x20to\x20push','fill','No\x20workflow\x20tdx.json\x20found','min','filesExtracted','Select\x20a\x20session\x20to\x20view\x20timeline:','163992JJGgxi','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20of\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','rows','\x20new','description','workflowProject','Error:\x20Secret\x20key\x20is\x20required','table','utf-8','✔\x20Found\x20','buildTimelineData','Select\x20a\x20workflow\x20to\x20run','Key\x20cannot\x20be\x20empty','red','No\x20matching\x20sessions\x20found','\x0a⚠\x20Project\x20\x22','index','replace','trim','dryRun','Reason:\x20','Error:\x20','Failed\x20to\x20fetch\x20attempt\x20data','Pushing\x20project...','key','localeCompare','round','repeat','new','stringify','projects'];a41_0x3efd=function(){return _0x535198;};return a41_0x3efd();}function renderTaskRow(_0x596436,_0x5ddc82,_0x15bd13,_0x14267d){const _0x1a5d37=a41_0x139d5f,{level:_0x3768fb,name:_0x59e956}=parseTaskName(_0x596436[_0x1a5d37(0x167)]),_0xbd6cfd='\x20'[_0x1a5d37(0x274)](_0x3768fb),_0x535606=_0x596436['window']?'('+formatElapsed(_0x596436['window'][_0x1a5d37(0x14f)])+')':'',_0x32658b=stringWidth(_0x535606),_0x3c7a10=_0x3768fb*0x1,_0x5ab146=_0x14267d-_0x3c7a10-_0x32658b-0x1,_0x37876d=truncateTaskName(_0x59e956,_0x5ab146),_0x41ca5f=_0xbd6cfd+_0x37876d,_0x11708a=stringWidth(_0x41ca5f),_0x3e5f1c=_0x14267d-_0x11708a-_0x32658b,_0x1a6304=_0x41ca5f+'\x20'[_0x1a5d37(0x274)](Math['max'](0x1,_0x3e5f1c))+a41_0x50b6be[_0x1a5d37(0x176)](_0x535606),_0x1f4e01=getTaskStateIcon(_0x596436[_0x1a5d37(0x237)]),_0x1f8b6d=new Array(_0x15bd13)[_0x1a5d37(0x251)]('\x20');if(_0x596436['window']){const _0x375c91=timeToPosition(_0x596436[_0x1a5d37(0x2a5)][_0x1a5d37(0x210)],_0x5ddc82,_0x15bd13),_0x711ed5=timeToPosition(_0x596436[_0x1a5d37(0x2a5)][_0x1a5d37(0x16c)],_0x5ddc82,_0x15bd13),_0x30955e=getBarChar(_0x596436[_0x1a5d37(0x237)]),_0x4282d9=Math[_0x1a5d37(0x1a9)](_0x375c91+0x1,_0x711ed5);for(let _0xac399a=_0x375c91;_0xac399a<Math[_0x1a5d37(0x253)](_0x4282d9,_0x15bd13);_0xac399a++){_0x1f8b6d[_0xac399a]=_0x30955e;}}const _0x180467=getBarColor(_0x596436[_0x1a5d37(0x237)]),_0x4c1ee8=_0x1f8b6d[_0x1a5d37(0x2a3)](_0xc0ce61=>_0xc0ce61==='\x20'?'\x20':_0x180467(_0xc0ce61))[_0x1a5d37(0x168)]('');return _0x1f4e01+'\x20'+_0x1a6304+'│'+_0x4c1ee8+'│';}function calculateStats(_0x3abf0b){const _0x2df286=a41_0x139d5f,_0x16596e={'total':_0x3abf0b[_0x2df286(0x207)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x129327 of _0x3abf0b){if(_0x129327[_0x2df286(0x237)]==='success')_0x16596e[_0x2df286(0x1fd)]++;else{if(_0x129327[_0x2df286(0x237)]===_0x2df286(0x295)||_0x129327[_0x2df286(0x237)]===_0x2df286(0x1ed))_0x16596e[_0x2df286(0x295)]++;else _0x129327[_0x2df286(0x237)]===_0x2df286(0x21d)?_0x16596e[_0x2df286(0x21d)]++:_0x16596e['pending']++;}}return _0x16596e;}function formatStats(_0x3619d3){const _0x2bf7f8=a41_0x139d5f;return['Total:\x20'+_0x3619d3['total'],'✅\x20'+_0x3619d3[_0x2bf7f8(0x1fd)],'❌\x20'+_0x3619d3['error'],'🔄\x20'+_0x3619d3['running'],'⏳\x20'+_0x3619d3['pending']][_0x2bf7f8(0x168)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x139d5f(0x167)]=a41_0x139d5f(0x29b);[a41_0x139d5f(0x25d)]=a41_0x139d5f(0x25a);async[a41_0x139d5f(0x175)](_0x5b8fc4){const _0x89ad7c=a41_0x139d5f,{options:_0x1e79d2,args:_0x13f125,tdx:_0x539182}=_0x5b8fc4;let _0x17b811,_0x10bfa5,_0x46ddd3=![];if(_0x13f125[0x0]){if(_0x13f125[0x0][_0x89ad7c(0x19d)]('.')){const _0x38a09d=this['parseProjectWorkflowPattern'](_0x13f125,_0x1e79d2);if(!_0x38a09d)return 0x1;_0x17b811=_0x38a09d[_0x89ad7c(0x205)],_0x10bfa5=_0x38a09d[_0x89ad7c(0x23b)];}else{_0x10bfa5=_0x13f125[0x0],_0x17b811=_0x1e79d2[_0x89ad7c(0x25e)];if(!_0x17b811)return console[_0x89ad7c(0x295)](a41_0x50b6be[_0x89ad7c(0x266)]('Error:'),_0x89ad7c(0x15a)),0x1;_0x46ddd3=!![];}}else{const _0x4101bf=this[_0x89ad7c(0x1b6)](_0x13f125,_0x1e79d2);if(!_0x4101bf)return 0x1;_0x17b811=_0x4101bf[_0x89ad7c(0x205)],_0x10bfa5=_0x4101bf['workflowName'];}if(_0x1e79d2['verbose']){if(_0x17b811&&_0x10bfa5)console[_0x89ad7c(0x295)]('Filter:\x20'+_0x17b811+'.'+_0x10bfa5);else _0x17b811&&console[_0x89ad7c(0x295)](_0x89ad7c(0x188)+_0x17b811);}const _0x13d736=_0x1e79d2['attemptId'],_0x24d378=_0x1e79d2[_0x89ad7c(0x223)];if(_0x13d736){_0x24d378&&console[_0x89ad7c(0x295)](a41_0x50b6be[_0x89ad7c(0x1d8)](_0x89ad7c(0x2b3)),_0x89ad7c(0x258));const _0x50ab16=_0x1e79d2['follow'];return _0x50ab16?await this[_0x89ad7c(0x196)](_0x5b8fc4,_0x13d736):await this['renderSingleTimeline'](_0x5b8fc4,_0x13d736,_0x1e79d2),0x0;}if(_0x24d378){const _0x52606a=await withSpinner(_0x89ad7c(0x2dc),()=>_0x539182['workflow'][_0x89ad7c(0x199)]({'projectName':_0x17b811,'workflowName':_0x10bfa5,'limit':0x64}),{'verbose':_0x1e79d2[_0x89ad7c(0x1e9)]}),_0x8cf572=_0x52606a[_0x89ad7c(0x2d9)]['find'](_0x229d94=>_0x229d94['id']===_0x24d378);if(!_0x8cf572)return console[_0x89ad7c(0x295)](a41_0x50b6be[_0x89ad7c(0x266)](_0x89ad7c(0x232)),'Session\x20not\x20found:\x20'+_0x24d378),0x1;if(!_0x8cf572[_0x89ad7c(0x218)]?.['id'])return console[_0x89ad7c(0x295)](a41_0x50b6be[_0x89ad7c(0x266)](_0x89ad7c(0x232)),_0x89ad7c(0x212)+_0x24d378+_0x89ad7c(0x225)),0x1;const _0x4d55a8=_0x8cf572[_0x89ad7c(0x218)]['id'];_0x1e79d2[_0x89ad7c(0x1e9)]&&console[_0x89ad7c(0x295)]('Using\x20attempt\x20'+_0x4d55a8+'\x20from\x20session\x20'+_0x24d378);const _0x3982ac=_0x1e79d2[_0x89ad7c(0x1e6)];return _0x3982ac?await this[_0x89ad7c(0x196)](_0x5b8fc4,_0x4d55a8):await this[_0x89ad7c(0x1b2)](_0x5b8fc4,_0x4d55a8,_0x1e79d2),0x0;}const _0x4b368b=await withSpinner(_0x89ad7c(0x292),()=>_0x539182[_0x89ad7c(0x2b6)][_0x89ad7c(0x199)]({'projectName':_0x17b811,'workflowName':_0x10bfa5,'limit':_0x1e79d2[_0x89ad7c(0x1b9)]||0x32}),{'verbose':_0x1e79d2['verbose']}),_0x1379fa=_0x4b368b[_0x89ad7c(0x2d9)];if(_0x1379fa[_0x89ad7c(0x207)]===0x0){if(_0x17b811&&_0x10bfa5)console['error'](_0x89ad7c(0x15d)+_0x17b811+'.'+_0x10bfa5);else _0x17b811?console['error'](_0x89ad7c(0x1b8)+_0x17b811):(console[_0x89ad7c(0x295)](_0x89ad7c(0x20a)),console[_0x89ad7c(0x295)](a41_0x50b6be[_0x89ad7c(0x176)](_0x89ad7c(0x296))));return 0x0;}_0x1379fa[_0x89ad7c(0x161)]((_0x1840a8,_0x4f11bc)=>{const _0x63a546=_0x89ad7c,_0x371a3a=_0x1840a8[_0x63a546(0x1c1)]||'',_0x58b0fe=_0x4f11bc[_0x63a546(0x1c1)]||'';return _0x58b0fe[_0x63a546(0x272)](_0x371a3a);});if(_0x1e79d2[_0x89ad7c(0x18f)]||_0x1e79d2[_0x89ad7c(0x248)])return await handleSDKOutput(_0x1379fa,_0x1e79d2),0x0;let _0x3d24ba;if(_0x46ddd3){const _0x52edc1=_0x1379fa[0x0];if(!_0x52edc1[_0x89ad7c(0x218)]?.['id'])return console['error'](_0x89ad7c(0x2e3)),0x0;_0x3d24ba=_0x52edc1[_0x89ad7c(0x218)]['id'],_0x1e79d2[_0x89ad7c(0x1e9)]&&console[_0x89ad7c(0x295)](_0x89ad7c(0x1d9)+_0x52edc1['sessionTime']);}else{const _0x5e4660=_0x1379fa[_0x89ad7c(0x2a3)](_0x1b688d=>{const _0x3ae744=_0x89ad7c,_0x3e30e5=getAttemptStatusDisplay(_0x1b688d[_0x3ae744(0x218)]);return{'title':_0x1b688d['project']?.[_0x3ae744(0x167)]+'.'+_0x1b688d[_0x3ae744(0x2b6)]?.[_0x3ae744(0x167)]+_0x3ae744(0x142)+_0x1b688d[_0x3ae744(0x1c1)]+'\x20'+_0x3e30e5['icon'],'value':_0x1b688d[_0x3ae744(0x218)]?.['id']||'','description':_0x3e30e5[_0x3ae744(0x2b5)]};}),_0x4be4be=await a41_0x116876({'type':_0x89ad7c(0x2bd),'name':_0x89ad7c(0x1d1),'message':_0x89ad7c(0x255),'choices':_0x5e4660[_0x89ad7c(0x15b)](_0x2b4cc2=>_0x2b4cc2[_0x89ad7c(0x145)]!=='')});if(!_0x4be4be['attemptId'])return 0x0;_0x3d24ba=_0x4be4be['attemptId'];}const _0x153d6b=_0x1e79d2[_0x89ad7c(0x1e6)];return _0x153d6b?await this[_0x89ad7c(0x196)](_0x5b8fc4,_0x3d24ba):await this[_0x89ad7c(0x1b2)](_0x5b8fc4,_0x3d24ba,_0x1e79d2),0x0;}async[a41_0x139d5f(0x1b2)](_0x244078,_0x4cd971,_0x29ac98){const _0x44c9d4=a41_0x139d5f,{tdx:_0x42221e}=_0x244078;let _0x47b658,_0x219d7f;try{[_0x47b658,_0x219d7f]=await Promise['all']([_0x42221e[_0x44c9d4(0x2b6)][_0x44c9d4(0x189)](_0x4cd971),_0x42221e['workflow'][_0x44c9d4(0x1af)](_0x4cd971,![])]);}catch(_0x20d641){console[_0x44c9d4(0x295)](a41_0x50b6be[_0x44c9d4(0x266)](_0x44c9d4(0x26f)));_0x29ac98[_0x44c9d4(0x1e9)]&&console['error'](_0x20d641);throw _0x20d641;}if(_0x29ac98[_0x44c9d4(0x18f)]||_0x29ac98[_0x44c9d4(0x248)]){const _0x1d9f2e=this[_0x44c9d4(0x263)](_0x47b658,_0x219d7f);await handleSDKOutput([_0x1d9f2e],_0x29ac98);return;}const _0x4669f0=_0x42221e[_0x44c9d4(0x2a4)][_0x44c9d4(0x1f8)],_0x5718f6=this[_0x44c9d4(0x1d4)](_0x47b658,_0x219d7f,_0x4669f0);console[_0x44c9d4(0x215)](_0x5718f6);}async[a41_0x139d5f(0x196)](_0x2fea82,_0x2a97c8){const _0x2c76c0=a41_0x139d5f,{tdx:_0x11f3b7}=_0x2fea82,_0x2c6264=TIMELINE_CONFIG[_0x2c76c0(0x2d1)],_0x4da198=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x30525b=0x0;while(_0x30525b<_0x4da198){process[_0x2c76c0(0x178)][_0x2c76c0(0x170)]&&process[_0x2c76c0(0x178)][_0x2c76c0(0x2df)]('\x1bc');let _0x38bf7,_0x5b52cc;try{[_0x38bf7,_0x5b52cc]=await Promise[_0x2c76c0(0x289)]([_0x11f3b7['workflow'][_0x2c76c0(0x189)](_0x2a97c8),_0x11f3b7['workflow'][_0x2c76c0(0x1af)](_0x2a97c8,![])]);}catch(_0x21fdf6){console[_0x2c76c0(0x295)](a41_0x50b6be[_0x2c76c0(0x266)](_0x2c76c0(0x229)));_0x30525b>0x0&&console[_0x2c76c0(0x295)](a41_0x50b6be[_0x2c76c0(0x176)](_0x2c76c0(0x140)+_0x30525b));throw _0x21fdf6;}const _0x163bad=_0x11f3b7['context'][_0x2c76c0(0x1f8)],_0xec7477=this[_0x2c76c0(0x1d4)](_0x38bf7,_0x5b52cc,_0x163bad);console[_0x2c76c0(0x215)](_0xec7477);const _0x4b587c=_0x38bf7[_0x2c76c0(0x13d)]&&_0x5b52cc[_0x2c76c0(0x1e1)](_0x4c8f2b=>_0x4c8f2b[_0x2c76c0(0x237)]!==_0x2c76c0(0x21d)&&_0x4c8f2b['state']!==_0x2c76c0(0x206));if(_0x4b587c){console[_0x2c76c0(0x295)](a41_0x50b6be['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0x2c76c0(0x295)](a41_0x50b6be[_0x2c76c0(0x176)](_0x2c76c0(0x2bb)+_0x30525b*0x2+_0x2c76c0(0x169))),await new Promise(_0xbd0cc8=>setTimeout(_0xbd0cc8,_0x2c6264)),_0x30525b++;}_0x30525b>=_0x4da198&&console[_0x2c76c0(0x295)](a41_0x50b6be[_0x2c76c0(0x1d8)](_0x2c76c0(0x24a)));}[a41_0x139d5f(0x1d4)](_0x1b009a,_0x41f070,_0x5855d7){const _0x3341ff=a41_0x139d5f,_0x751450=[],_0x4dc042=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x444318=0x5,_0x407ef4=process[_0x3341ff(0x178)][_0x3341ff(0x228)]||0x78,_0x2de1e7=_0x407ef4-_0x4dc042-_0x444318,_0x45e371=Math[_0x3341ff(0x1a9)](TIMELINE_CONFIG[_0x3341ff(0x14c)],Math['min'](_0x2de1e7,TIMELINE_CONFIG[_0x3341ff(0x185)])),_0x2a27e0=new Date(_0x1b009a[_0x3341ff(0x290)])[_0x3341ff(0x1b5)](),_0x5a8508=_0x1b009a[_0x3341ff(0x299)]?new Date(_0x1b009a[_0x3341ff(0x299)])[_0x3341ff(0x1b5)]():Date[_0x3341ff(0x2a9)](),_0x46031c={'start':_0x2a27e0,'end':_0x5a8508,'duration':_0x5a8508-_0x2a27e0},_0xb26a66=new Map(),_0x3453fa=[];for(const _0x51b09f of _0x41f070){if(_0x51b09f['startedAt']){const _0x336927=new Date(_0x51b09f[_0x3341ff(0x1ea)])[_0x3341ff(0x1b5)](),_0x3eefce=_0x51b09f[_0x3341ff(0x2db)]?new Date(_0x51b09f[_0x3341ff(0x2db)])[_0x3341ff(0x1b5)]():Date[_0x3341ff(0x2a9)](),_0x58e4e7={'start':_0x336927,'end':_0x3eefce,'duration':_0x3eefce-_0x336927};_0xb26a66['set'](_0x51b09f['id'],_0x58e4e7),_0x3453fa['push']({'name':_0x51b09f[_0x3341ff(0x2c2)],'state':_0x51b09f[_0x3341ff(0x237)]||_0x3341ff(0x20c),'window':_0x58e4e7});}else _0x3453fa[_0x3341ff(0x2b2)]({'name':_0x51b09f[_0x3341ff(0x2c2)],'state':_0x51b09f[_0x3341ff(0x237)]||'planned','window':undefined});}_0x3453fa['sort']((_0x2bf0bd,_0xd36b2e)=>{const _0x58cdad=_0x3341ff;if(!_0x2bf0bd[_0x58cdad(0x2a5)])return 0x1;if(!_0xd36b2e[_0x58cdad(0x2a5)])return-0x1;return _0x2bf0bd['window']['start']-_0xd36b2e['window']['start'];});const _0x1f799c=_0x3453fa['length'],_0x1ebbe1=_0x1f799c>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x1ebbe1&&_0x3453fa[_0x3341ff(0x2ae)](TIMELINE_CONFIG[_0x3341ff(0x181)]);const _0x3652bf=calculateTimeScale(_0x46031c,_0x45e371),_0x4d70ee=_0x1b009a['done']?_0x1b009a['success']?a41_0x50b6be[_0x3341ff(0x20b)](_0x3341ff(0x1fd)):a41_0x50b6be['red'](_0x3341ff(0x295)):a41_0x50b6be[_0x3341ff(0x17c)](_0x3341ff(0x21d)),_0x542838=_0x1b009a[_0x3341ff(0x1cb)]?.['id'],_0x1dfb50=_0x1b009a[_0x3341ff(0x223)];let _0xf7b629;if(_0x542838&&_0x1dfb50){const _0x30ac08=getWorkflowAttemptUrl(_0x5855d7,_0x542838,_0x1dfb50,_0x1b009a['id']);_0xf7b629=hyperlink(a41_0x50b6be[_0x3341ff(0x176)](_0x1b009a['id']),_0x30ac08);}else _0xf7b629=a41_0x50b6be[_0x3341ff(0x176)](_0x1b009a['id']);_0x751450[_0x3341ff(0x2b2)](_0x3341ff(0x177)+_0xf7b629+_0x3341ff(0x142)+_0x4d70ee+_0x3341ff(0x142)+formatElapsed(_0x46031c[_0x3341ff(0x14f)]));if(_0x3453fa[_0x3341ff(0x207)]>0x0){const _0x5c0a30=renderTimeAxis(_0x3652bf,_0x45e371),_0x297509=new Date(_0x46031c[_0x3341ff(0x210)]),_0x3537e2=formatDate(_0x297509),_0x479f33=TIMELINE_CONFIG[_0x3341ff(0x2bf)]+TIMELINE_CONFIG[_0x3341ff(0x1ce)]+_0x4dc042,_0x10c2be=_0x3537e2[_0x3341ff(0x2af)](_0x479f33),_0x176648=a41_0x50b6be['dim'](_0x10c2be);_0x751450[_0x3341ff(0x2b2)](_0x176648+'\x20'+_0x5c0a30);for(const _0xb399bf of _0x3453fa){_0x751450[_0x3341ff(0x2b2)](renderTaskRow(_0xb399bf,_0x3652bf,_0x45e371,_0x4dc042));}const _0x2a108d=calculateStats(_0x3453fa);_0x751450[_0x3341ff(0x2b2)](formatStats(_0x2a108d)),_0x1ebbe1&&_0x751450['push'](a41_0x50b6be[_0x3341ff(0x1d8)](_0x3341ff(0x154)+TIMELINE_CONFIG[_0x3341ff(0x181)]+_0x3341ff(0x259)+_0x1f799c+'\x20tasks')),_0x751450[_0x3341ff(0x2b2)](''),_0x751450[_0x3341ff(0x2b2)](a41_0x50b6be[_0x3341ff(0x176)](_0x3341ff(0x195))+('tdx\x20wf\x20attempt\x20'+_0x1b009a['id']+'\x20logs')+a41_0x50b6be['dim'](_0x3341ff(0x1a1)));}else _0x751450[_0x3341ff(0x2b2)](_0x3341ff(0x14d));return _0x751450['join']('\x0a');}[a41_0x139d5f(0x263)](_0x4b3322,_0x57c030){const _0x32f4ac=a41_0x139d5f,_0xf89ed9=new Date(_0x4b3322['createdAt'])[_0x32f4ac(0x1b5)](),_0x288568=_0x4b3322[_0x32f4ac(0x299)]?new Date(_0x4b3322['finishedAt'])[_0x32f4ac(0x1b5)]():Date['now'](),_0x514415=_0x288568-_0xf89ed9,_0x436ee8=[];for(const _0x2d557d of _0x57c030){if(_0x2d557d[_0x32f4ac(0x1ea)]){const _0x470d53=new Date(_0x2d557d[_0x32f4ac(0x1ea)])['getTime'](),_0x4153cc=_0x2d557d[_0x32f4ac(0x2db)]?new Date(_0x2d557d[_0x32f4ac(0x2db)])[_0x32f4ac(0x1b5)]():Date[_0x32f4ac(0x2a9)]();_0x436ee8['push']({'name':_0x2d557d[_0x32f4ac(0x2c2)],'state':_0x2d557d[_0x32f4ac(0x237)]||'unknown','window':{'start':_0x470d53,'end':_0x4153cc,'duration':_0x4153cc-_0x470d53}});}else _0x436ee8[_0x32f4ac(0x2b2)]({'name':_0x2d557d[_0x32f4ac(0x2c2)],'state':_0x2d557d[_0x32f4ac(0x237)]||_0x32f4ac(0x206),'window':undefined});}const _0x58dda7=calculateStats(_0x436ee8);return{'attempt':{'id':_0x4b3322['id'],'status':_0x4b3322[_0x32f4ac(0x13d)]?_0x4b3322['success']?_0x32f4ac(0x1fd):_0x32f4ac(0x295):_0x32f4ac(0x21d),'createdAt':_0x4b3322['createdAt'],'finishedAt':_0x4b3322[_0x32f4ac(0x299)],'duration_ms':_0x514415},'tasks':_0x436ee8['map'](_0x1f06e3=>({'name':_0x1f06e3[_0x32f4ac(0x167)],'state':_0x1f06e3[_0x32f4ac(0x237)],'startedAt':_0x1f06e3[_0x32f4ac(0x2a5)]?new Date(_0x1f06e3[_0x32f4ac(0x2a5)][_0x32f4ac(0x210)])[_0x32f4ac(0x1f2)]():null,'updatedAt':_0x1f06e3[_0x32f4ac(0x2a5)]?new Date(_0x1f06e3[_0x32f4ac(0x2a5)][_0x32f4ac(0x16c)])[_0x32f4ac(0x1f2)]():null,'duration_ms':_0x1f06e3[_0x32f4ac(0x2a5)]?.['duration']||null})),'stats':_0x58dda7};}}
1
+ const a41_0x5bd115=a41_0x20a5;(function(_0x34e908,_0x4811d7){const _0x4914cf=a41_0x20a5,_0x38c78a=_0x34e908();while(!![]){try{const _0x248c08=-parseInt(_0x4914cf(0x110))/0x1+-parseInt(_0x4914cf(0x120))/0x2+parseInt(_0x4914cf(0x125))/0x3*(parseInt(_0x4914cf(0x1dd))/0x4)+-parseInt(_0x4914cf(0x23b))/0x5+parseInt(_0x4914cf(0x1bd))/0x6+parseInt(_0x4914cf(0xda))/0x7+parseInt(_0x4914cf(0x132))/0x8;if(_0x248c08===_0x4811d7)break;else _0x38c78a['push'](_0x38c78a['shift']());}catch(_0xf347fa){_0x38c78a['push'](_0x38c78a['shift']());}}}(a41_0x1fc3,0x30cd0));import a41_0x542931 from'chalk';import{existsSync}from'fs';import a41_0x584037 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}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 a41_0x2444a6 from'prompts';function getAttemptStatusDisplay(_0x2451c0){const _0xfc1376=a41_0x20a5;if(!_0x2451c0)return{'icon':'⏳','text':''};const {done:_0x5b7a53,success:_0x5c9c5f,cancelRequested:_0x170318}=_0x2451c0;if(!_0x5b7a53)return _0x170318?{'icon':'🛑','text':a41_0x542931[_0xfc1376(0x241)](_0xfc1376(0xdc))}:{'icon':'🔄','text':a41_0x542931['blue'](_0xfc1376(0x1a2))};if(_0x5c9c5f)return{'icon':'✅','text':a41_0x542931['green'](_0xfc1376(0x177))};return{'icon':'❌','text':a41_0x542931[_0xfc1376(0x1e7)](_0xfc1376(0x211))};}export class WorkflowBaseCommand extends BaseCommand{[a41_0x5bd115(0x232)](_0x59a864,_0x383491,_0x57c309=0x0){const _0x5bac10=a41_0x5bd115;return _0x59a864[_0x57c309]||_0x383491[_0x5bac10(0x24b)];}['requireProject'](_0x52c357,_0x331222,_0x1ed07f=0x0){const _0x4e85d7=a41_0x5bd115,_0x217fe7=this[_0x4e85d7(0x232)](_0x52c357,_0x331222,_0x1ed07f);if(!_0x217fe7)return console[_0x4e85d7(0x211)](a41_0x542931['red']('Error:'),_0x4e85d7(0x10f)),console['error'](a41_0x542931['dim'](_0x4e85d7(0x1b0))),null;return _0x217fe7;}[a41_0x5bd115(0x157)](_0x76ea2d,_0xb60119){const _0x832f48=a41_0x5bd115;if(_0x76ea2d[0x0]){const _0x320b99=_0x76ea2d[0x0][_0x832f48(0x14c)]('.');if(_0x320b99[_0x832f48(0xc8)]===0x1)return{'projectName':_0x320b99[0x0],'workflowName':undefined};else return _0x320b99[_0x832f48(0xc8)]===0x2?{'projectName':_0x320b99[0x0],'workflowName':_0x320b99[0x1]}:(console[_0x832f48(0x211)](a41_0x542931[_0x832f48(0x1e7)]('Error:'),_0x832f48(0x144)),null);}return{'projectName':_0xb60119[_0x832f48(0x24b)],'workflowName':undefined};}[a41_0x5bd115(0x207)](_0x1bd9ad,_0xfc97e7,_0x3bb1b7=0x0){const _0x41a493=a41_0x5bd115;if(_0x1bd9ad[_0x3bb1b7])return _0x1bd9ad[_0x3bb1b7];if(_0xfc97e7[_0x41a493(0x24b)]){const _0x596224=a41_0x584037[_0x41a493(0x11c)](process[_0x41a493(0xf9)](),'workflows',_0xfc97e7[_0x41a493(0x24b)]);if(existsSync(a41_0x584037[_0x41a493(0x11c)](_0x596224,_0x41a493(0x14d))))return _0x596224;}return undefined;}async['showWorkflowConsoleUrl'](_0xd47d4d,_0x50555b,_0x47e5b0){const _0x5182aa=a41_0x5bd115;try{const _0x1cc2e7=await _0xd47d4d[_0x5182aa(0x20b)][_0x5182aa(0x116)](_0x50555b,{'limit':0x1});if(_0x1cc2e7[_0x5182aa(0xc8)]>0x0){const _0x3fd320=_0x1cc2e7[0x0]['id'],_0x29c0bc=getWorkflowUrl(_0x47e5b0,_0x3fd320);console[_0x5182aa(0x211)](_0x5182aa(0x17a)+a41_0x542931['cyan'](_0x29c0bc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x5bd115(0x190);[a41_0x5bd115(0x22f)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x48f1f0){const _0x53f1d1=a41_0x5bd115,{options:_0x16a4a4,args:_0x564efe,tdx:_0x2fc466}=_0x48f1f0,_0x159d99=_0x564efe[0x0],_0x5cc9e3=_0x16a4a4[_0x53f1d1(0x106)];if(_0x5cc9e3)return saveSessionContext({'workflow_project':undefined},_0x16a4a4[_0x53f1d1(0x17e)]),console[_0x53f1d1(0xcc)](a41_0x542931[_0x53f1d1(0x1c8)](_0x53f1d1(0xd4))),0x0;if(!_0x159d99)return console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x1e7)](_0x53f1d1(0x15a)),'Project\x20name\x20is\x20required'),console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x145)](_0x53f1d1(0x149))),console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x145)](_0x53f1d1(0x12a))),0x1;const _0x5235a4=await withSpinner(_0x53f1d1(0x11f)+_0x159d99+_0x53f1d1(0x19b),()=>_0x2fc466[_0x53f1d1(0x20b)][_0x53f1d1(0x19a)](_0x159d99),{'verbose':_0x16a4a4[_0x53f1d1(0x1c7)]}),{name:_0x5aeeab}=_0x5235a4['data'];return saveSessionContext({'workflow_project':_0x5aeeab},_0x16a4a4[_0x53f1d1(0x17e)]),console[_0x53f1d1(0xcc)](a41_0x542931[_0x53f1d1(0x1c8)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x542931[_0x53f1d1(0xc9)](_0x5aeeab))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a41_0x5bd115(0x220);['description']='List\x20all\x20workflow\x20projects';async[a41_0x5bd115(0x237)](_0x2bffd5){const _0x4be448=a41_0x5bd115,{options:_0x492f1f,args:_0x259794,tdx:_0x398885}=_0x2bffd5,_0x292c4b=_0x259794[0x0];_0x492f1f[_0x4be448(0x1c7)]&&_0x292c4b&&console['error'](_0x4be448(0x1b3)+_0x292c4b);const _0x44d297=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x398885[_0x4be448(0x20b)][_0x4be448(0x197)](_0x292c4b,{'limit':_0x492f1f[_0x4be448(0xfd)]}),{'verbose':_0x492f1f[_0x4be448(0x1c7)]});let _0x25a125=_0x44d297['data'];_0x25a125[_0x4be448(0x139)]((_0x54961b,_0xe3f5e7)=>_0x54961b[_0x4be448(0x23f)][_0x4be448(0x191)](_0xe3f5e7[_0x4be448(0x23f)]));const _0x4aab6b=_0x492f1f['limit']||0x64,_0x201677=_0x25a125[_0x4be448(0xc8)]>=_0x4aab6b?a41_0x542931[_0x4be448(0x145)](_0x4be448(0x244)):'';console[_0x4be448(0x211)](_0x4be448(0x1bc)+_0x25a125[_0x4be448(0xc8)]+'\x20project'+(_0x25a125[_0x4be448(0xc8)]!==0x1?'s':'')+_0x201677);if(_0x492f1f['format']==='json'||_0x492f1f[_0x4be448(0xd6)]===_0x4be448(0x1a9)||_0x492f1f[_0x4be448(0xd6)]==='table')await handleSDKOutput(_0x25a125,_0x492f1f);else{if(_0x25a125[_0x4be448(0xc8)]===0x0)_0x292c4b?console[_0x4be448(0xcc)](_0x4be448(0x101)+_0x292c4b):console['log'](_0x4be448(0x155));else{const _0x2bbc33=_0x25a125['map'](_0x3a30f4=>{const _0x2a1339=_0x4be448,_0xd6f713=_0x3a30f4[_0x2a1339(0x224)]?.[_0x2a1339(0xe8)](_0x4c2f9f=>_0x4c2f9f[_0x2a1339(0x1db)]===_0x2a1339(0x108)),_0x1397de=_0xd6f713?a41_0x542931[_0x2a1339(0x145)]('\x20(system)'):'';return _0x2a1339(0x1b1)+_0x3a30f4['name']+_0x1397de;});await writeOutput(_0x2bbc33[_0x4be448(0x11c)]('\x0a'),_0x492f1f[_0x4be448(0x1b6)],_0x4be448(0x202));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x183);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x161);async['execute'](_0x2948d4){const _0x5854ae=a41_0x5bd115,{options:_0x5c8b79,args:_0x2ca42a,tdx:_0x3ad3d6}=_0x2948d4,_0x567efe=this[_0x5854ae(0x232)](_0x2ca42a,_0x5c8b79);_0x5c8b79[_0x5854ae(0x1c7)]&&_0x567efe&&console[_0x5854ae(0x211)]('Project\x20filter:\x20'+_0x567efe);const _0xb096d5=await withSpinner(_0x5854ae(0xbf),()=>_0x3ad3d6[_0x5854ae(0x20b)][_0x5854ae(0x116)](_0x567efe,{'limit':_0x5c8b79[_0x5854ae(0xfd)]}),{'verbose':_0x5c8b79['verbose']});let _0x42d737=_0xb096d5[_0x5854ae(0x102)];_0x42d737[_0x5854ae(0x139)]((_0x488d57,_0x11624f)=>{const _0x2709ff=_0x5854ae,_0x36655c=_0x488d57['name'][_0x2709ff(0x191)](_0x11624f[_0x2709ff(0x23f)]);if(_0x36655c!==0x0)return _0x36655c;return(_0x488d57[_0x2709ff(0x18f)]?.[_0x2709ff(0x23f)]||'')['localeCompare'](_0x11624f[_0x2709ff(0x18f)]?.['name']||'');});const _0x2a31ab=_0x5c8b79[_0x5854ae(0xfd)]||0x64,_0x19aa4c=_0x42d737[_0x5854ae(0xc8)]>=_0x2a31ab?a41_0x542931[_0x5854ae(0x145)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5854ae(0x211)](_0x5854ae(0x1bc)+_0x42d737[_0x5854ae(0xc8)]+'\x20workflow'+(_0x42d737[_0x5854ae(0xc8)]!==0x1?'s':'')+_0x19aa4c);if(_0x5c8b79['format']===_0x5854ae(0x184)||_0x5c8b79[_0x5854ae(0xd6)]==='jsonl'||_0x5c8b79[_0x5854ae(0xd6)]===_0x5854ae(0x141))await handleSDKOutput(_0x42d737,_0x5c8b79);else{if(_0x42d737[_0x5854ae(0xc8)]===0x0)_0x567efe?console[_0x5854ae(0xcc)](_0x5854ae(0x1b8)+_0x567efe):console[_0x5854ae(0xcc)](_0x5854ae(0x1a8));else{const _0x196aac=_0x5c8b79[_0x5854ae(0x16a)],_0x2d880e=_0x42d737[_0x5854ae(0x233)](_0x2b8a22=>{const _0x2c916d=_0x5854ae,_0x385132=a41_0x542931[_0x2c916d(0x145)]('#'+_0x2b8a22['id']),_0x2d7c50=hyperlink(_0x385132,getWorkflowUrl(_0x196aac,_0x2b8a22['id'])),_0x1c092b=_0x2b8a22[_0x2c916d(0x18f)]?.[_0x2c916d(0x23f)]?a41_0x542931[_0x2c916d(0x145)]('\x20('+_0x2b8a22[_0x2c916d(0x18f)][_0x2c916d(0x23f)]+')'):'';return _0x2c916d(0x20f)+_0x2d7c50+'\x20'+_0x2b8a22[_0x2c916d(0x23f)]+_0x1c092b;});await writeOutput(_0x2d880e[_0x5854ae(0x11c)]('\x0a'),_0x5c8b79[_0x5854ae(0x1b6)],_0x5854ae(0x202));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x20e);['description']=a41_0x5bd115(0xdf);async['execute'](_0x589cb1){const _0x327ecc=a41_0x5bd115,{options:_0x41ce4c,args:_0xef7ae2,tdx:_0x417e48}=_0x589cb1,_0x3d9d4b=this['parseProjectWorkflowPattern'](_0xef7ae2,_0x41ce4c);if(!_0x3d9d4b)return 0x1;const {projectName:_0x2ea1e1,workflowName:_0x5dbca7}=_0x3d9d4b;if(_0x41ce4c[_0x327ecc(0x1c7)]){if(_0x2ea1e1&&_0x5dbca7)console['error'](_0x327ecc(0x1f5)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1&&console[_0x327ecc(0x211)]('Filter:\x20project='+_0x2ea1e1);const _0x309f03=_0x41ce4c['status'];_0x309f03&&console[_0x327ecc(0x211)](_0x327ecc(0xfa)+_0x309f03);}let _0x16c627=0x28;if(process[_0x327ecc(0x128)][_0x327ecc(0x250)]&&!_0x41ce4c[_0x327ecc(0x1b6)]&&!_0x41ce4c[_0x327ecc(0xd6)]){const _0x99c3ad=process[_0x327ecc(0x128)]['rows']||0x28;_0x16c627=Math[_0x327ecc(0x185)](0x14,Math[_0x327ecc(0x180)](_0x99c3ad*0x2/0x3));}const _0x1e6249=_0x41ce4c[_0x327ecc(0xfd)]||_0x16c627,_0x1f3f3e=await withSpinner(_0x327ecc(0x121),()=>_0x417e48[_0x327ecc(0x20b)][_0x327ecc(0x235)]({'projectName':_0x2ea1e1,'workflowName':_0x5dbca7,'status':_0x41ce4c['status'],'fromTime':_0x41ce4c[_0x327ecc(0xc3)],'toTime':_0x41ce4c['to'],'limit':_0x1e6249}),{'verbose':_0x41ce4c[_0x327ecc(0x1c7)]}),_0x2082b1=_0x1f3f3e[_0x327ecc(0x102)];_0x2082b1['sort']((_0x498456,_0x3ea5bd)=>{const _0x17aca3=_0x327ecc,_0xa34d86=_0x498456[_0x17aca3(0x1d3)]||'',_0x471f40=_0x3ea5bd[_0x17aca3(0x1d3)]||'';return _0x471f40[_0x17aca3(0x191)](_0xa34d86);});_0x2082b1[_0x327ecc(0xc8)]>=_0x1e6249?console[_0x327ecc(0x211)](_0x327ecc(0x1b5)+_0x2082b1['length']+'\x20sessions\x20'+a41_0x542931[_0x327ecc(0x145)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x327ecc(0x211)]('✔\x20Found\x20'+_0x2082b1[_0x327ecc(0xc8)]+_0x327ecc(0x100)+(_0x2082b1[_0x327ecc(0xc8)]!==0x1?'s':''));if(_0x41ce4c[_0x327ecc(0xd6)]==='json'||_0x41ce4c['format']===_0x327ecc(0x1a9)||_0x41ce4c[_0x327ecc(0xd6)]===_0x327ecc(0x141))await handleSDKOutput(_0x2082b1,_0x41ce4c);else{if(!process[_0x327ecc(0x128)][_0x327ecc(0x250)]||_0x41ce4c[_0x327ecc(0x1b6)]){if(_0x2082b1[_0x327ecc(0xc8)]===0x0){if(_0x2ea1e1&&_0x5dbca7)console[_0x327ecc(0xcc)](_0x327ecc(0xcb)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1?console[_0x327ecc(0xcc)](_0x327ecc(0xf7)+_0x2ea1e1):console[_0x327ecc(0xcc)](_0x327ecc(0x229));}else{const _0x4c0e26=_0x41ce4c[_0x327ecc(0x16a)],_0x31658c=this[_0x327ecc(0x21d)](_0x2082b1,_0x4c0e26);_0x41ce4c[_0x327ecc(0x1b6)]?await writeOutput(_0x31658c,_0x41ce4c[_0x327ecc(0x1b6)],_0x327ecc(0x202)):console['log'](_0x31658c);}!_0x2ea1e1&&(console[_0x327ecc(0x211)](''),console[_0x327ecc(0x211)](a41_0x542931[_0x327ecc(0x145)](_0x327ecc(0x134))),console[_0x327ecc(0x211)](a41_0x542931[_0x327ecc(0x145)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x542931['dim'](_0x327ecc(0x14f))));}else{if(_0x2082b1['length']===0x0){if(_0x2ea1e1&&_0x5dbca7)console[_0x327ecc(0xcc)](_0x327ecc(0xcb)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1?console[_0x327ecc(0xcc)](_0x327ecc(0xf7)+_0x2ea1e1):console[_0x327ecc(0xcc)](_0x327ecc(0x229));}else await this[_0x327ecc(0x1cb)](_0x2082b1,_0x589cb1,_0x2ea1e1);}}return 0x0;}[a41_0x5bd115(0x21d)](_0x4bda0b,_0x38e9b8){const _0x35e602=a41_0x5bd115,_0x7c41d7=[],_0x5927d2=new Map();let _0x63003c=Infinity,_0x43d96e=-Infinity;for(const _0xd95611 of _0x4bda0b){if(_0xd95611[_0x35e602(0x1df)]?.[_0x35e602(0x12c)]){const _0x34f596=new Date(_0xd95611[_0x35e602(0x1df)]['createdAt'])[_0x35e602(0x137)](),_0x43a766=_0xd95611[_0x35e602(0x1df)][_0x35e602(0x1e2)]?new Date(_0xd95611[_0x35e602(0x1df)][_0x35e602(0x1e2)])[_0x35e602(0x137)]():Date[_0x35e602(0x1c9)](),_0x163635=_0xd95611[_0x35e602(0x18f)]?.[_0x35e602(0x23f)]||_0x35e602(0xc4);!_0x5927d2[_0x35e602(0xef)](_0x163635)&&_0x5927d2['set'](_0x163635,[]),_0x5927d2[_0x35e602(0x210)](_0x163635)[_0x35e602(0x249)]({'session':_0xd95611,'startTime':_0x34f596,'endTime':_0x43a766,'duration':_0x43a766-_0x34f596}),_0x63003c=Math[_0x35e602(0x219)](_0x63003c,_0x34f596),_0x43d96e=Math[_0x35e602(0x185)](_0x43d96e,_0x43a766);}}if(_0x5927d2['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x543971=process['stdout']['columns']||0x78,_0x4a68a3=0x1e,_0x436b12=0x32,_0x2e239b=0x4,_0x29a746=Math[_0x35e602(0x219)](_0x436b12,Math[_0x35e602(0x185)](_0x4a68a3,Math['floor'](_0x543971*0.3))),_0x1c071b=_0x543971-_0x29a746-TIMELINE_CONFIG[_0x35e602(0x236)]-0x3-_0x2e239b,_0x3ec801=_0x43d96e-_0x63003c,_0x137462=_0x3ec801/_0x29a746,_0x488cc9=renderTimeAxis({'startTime':_0x63003c,'endTime':_0x43d96e,'durationMs':_0x3ec801,'msPerChar':_0x137462},_0x29a746),_0x35036a=[];for(const _0x594847 of _0x5927d2['values']()){_0x35036a['push'](..._0x594847);}_0x35036a[_0x35e602(0x139)]((_0x3c0cd1,_0x55dacf)=>_0x55dacf['startTime']-_0x3c0cd1[_0x35e602(0x1e9)]);const _0x13b3d2=new Date(_0x63003c),_0x34830c=formatDate(_0x13b3d2),_0x239bb0=_0x2e239b+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x35e602(0x142)]+_0x1c071b,_0x4fabe7='\x20'['repeat'](_0x239bb0-_0x34830c[_0x35e602(0xc8)]),_0x2f467e=_0x4fabe7+a41_0x542931[_0x35e602(0x145)](_0x34830c)+'\x20'+_0x488cc9;_0x7c41d7[_0x35e602(0x249)](_0x2f467e);const _0x2bfc3b=0x16;let _0x1d3869=0x0;for(const _0x510afd of _0x35036a){const _0x341b6c=_0x510afd[_0x35e602(0x17e)][_0x35e602(0x18f)]?.['name']||'?',_0x4b6ba9=Math[_0x35e602(0x219)](stringWidth(_0x341b6c),_0x2bfc3b);_0x1d3869=Math[_0x35e602(0x185)](_0x1d3869,_0x4b6ba9);}for(const _0x4467e6 of _0x35036a){const {session:_0x12959c,startTime:_0x304688,endTime:_0x4b87b0,duration:_0x333a1c}=_0x4467e6,_0x494358=_0x12959c[_0x35e602(0x18f)]?.['id'],_0xa6426e=_0x12959c['id'],_0x5e9428=_0x12959c[_0x35e602(0x18f)]?.[_0x35e602(0x23f)]||'?',_0x4e306e=_0x12959c[_0x35e602(0x20b)]?.[_0x35e602(0x23f)]||'?';let _0x1194d7,_0x4fc9c6;if(_0x12959c[_0x35e602(0x1df)]){const _0x3be885=_0x12959c[_0x35e602(0x1df)];!_0x3be885[_0x35e602(0x174)]?(_0x1194d7=_0x3be885[_0x35e602(0x187)]?'🛑':'🔄',_0x4fc9c6=_0x3be885[_0x35e602(0x187)]?a41_0x542931['yellow']:a41_0x542931[_0x35e602(0x1ef)]):(_0x1194d7=_0x3be885[_0x35e602(0x177)]?'✅':'❌',_0x4fc9c6=_0x3be885[_0x35e602(0x177)]?a41_0x542931[_0x35e602(0x1c8)]:a41_0x542931['red']);}else _0x1194d7='⏳',_0x4fc9c6=a41_0x542931['dim'];const _0x12403e='#'+_0xa6426e,_0x4f594a=_0x494358?hyperlink(_0x12403e,getWorkflowSessionUrl(_0x38e9b8,_0x494358,_0xa6426e)):_0x12403e;let _0x556604=_0x5e9428;stringWidth(_0x5e9428)>_0x2bfc3b&&(_0x556604=_0x5e9428['slice'](0x0,_0x2bfc3b-0x1)+'…');const _0x466bb3=a41_0x542931[_0x35e602(0x145)](_0x556604),_0x24b4a2=stringWidth(_0x556604),_0x4edd07='\x20'['repeat'](_0x1d3869-stringWidth(_0x556604)+0x2),_0x41f267='('+formatElapsed(_0x333a1c)+')',_0x56e558=stringWidth(_0x41f267),_0x18ad61=stringWidth(_0x12403e),_0x524651=_0x18ad61+0x1+_0x24b4a2+_0x4edd07[_0x35e602(0xc8)],_0x4afe5e=_0x1c071b-_0x524651-_0x56e558-0x1-0x8;let _0x1937b7=_0x4e306e;stringWidth(_0x1937b7)>_0x4afe5e&&(_0x1937b7=_0x1937b7[_0x35e602(0x1f9)](0x0,_0x4afe5e-0x1)+'…');const _0x57a288=_0x4f594a+'\x20'+_0x466bb3+_0x4edd07+_0x1937b7,_0x223c64=stringWidth(_0x57a288),_0x3ae006=_0x1c071b-_0x223c64-_0x56e558,_0x13905b=_0x57a288+'\x20'[_0x35e602(0x1f1)](Math[_0x35e602(0x185)](0x1,_0x3ae006))+a41_0x542931[_0x35e602(0x145)](_0x41f267),_0x21f868=Math[_0x35e602(0x180)]((_0x304688-_0x63003c)/_0x137462),_0x265956=Math['floor']((_0x4b87b0-_0x63003c)/_0x137462),_0x349fd2=Math[_0x35e602(0x185)](_0x21f868+0x1,_0x265956),_0x59a5c1=new Array(_0x29a746)['fill']('\x20');for(let _0x3d7a2b=_0x21f868;_0x3d7a2b<Math[_0x35e602(0x219)](_0x349fd2,_0x29a746);_0x3d7a2b++){_0x59a5c1[_0x3d7a2b]='─';}const _0x26750e=_0x59a5c1[_0x35e602(0x233)](_0x1198b6=>_0x1198b6==='\x20'?'\x20':_0x4fc9c6(_0x1198b6))[_0x35e602(0x11c)]('');_0x7c41d7['push'](_0x1194d7+'\x20'+_0x13905b+'│'+_0x26750e+'│');}return _0x7c41d7[_0x35e602(0x11c)]('\x0a');}async[a41_0x5bd115(0x1cb)](_0x31e574,_0x1812eb,_0x3c684){const _0x29c948=a41_0x5bd115,{options:_0x1f4455,tdx:_0x56776b}=_0x1812eb,_0x572a9e=_0x1f4455['site'],{timelineRows:_0x585706,timeAxisHeader:_0x2cad88}=this[_0x29c948(0x24c)](_0x31e574,_0x572a9e),_0x317c24=_0x585706[_0x29c948(0x1d0)](_0x1d47c3=>_0x1d47c3['attemptId']);if(_0x317c24[_0x29c948(0xc8)]===0x0){const _0x2cec4a=this['renderSessionsTimeline'](_0x31e574,_0x572a9e);console[_0x29c948(0xcc)](_0x2cec4a);!_0x3c684&&(console['error'](''),console[_0x29c948(0x211)](a41_0x542931['dim'](_0x29c948(0x134))),console[_0x29c948(0x211)](a41_0x542931[_0x29c948(0x145)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x542931[_0x29c948(0x145)](_0x29c948(0x14f))));return;}_0x2cad88&&console[_0x29c948(0xcc)](_0x2cad88);const _0x17a05e=_0x585706[_0x29c948(0x1d0)](_0x57214b=>_0x57214b[_0x29c948(0x1a0)])['map'](_0x142b90=>({'title':_0x142b90[_0x29c948(0x181)],'value':_0x142b90[_0x29c948(0x1a0)]})),_0x583c5e=process[_0x29c948(0x128)][_0x29c948(0x1f8)]||0x3c,_0x4dfbe7=Math[_0x29c948(0x185)](0x28,Math[_0x29c948(0x180)](_0x583c5e*0x2/0x3)),_0x19533d=await a41_0x2444a6({'type':'autocomplete','name':_0x29c948(0x1a0),'message':_0x29c948(0x23e),'choices':_0x17a05e,'initial':-0x1,'limit':_0x4dfbe7,'clearFirst':!![],'fallback':{'title':_0x29c948(0x138),'value':null},'suggest':(_0x2ccf29,_0x4a2015)=>{const _0x12eed1=_0x29c948;if(!_0x2ccf29)return Promise[_0x12eed1(0x152)](_0x4a2015);const _0x423136=_0x4a2015['filter'](_0x4967a4=>{const _0x7c4a21=_0x12eed1,_0x4a62e9=_0x4967a4;return _0x4a62e9['title'][_0x7c4a21(0x10b)]()['includes'](_0x2ccf29['toLowerCase']());});return Promise['resolve'](_0x423136);}}),_0x31a139=()=>{const _0x13c809=_0x29c948;process[_0x13c809(0x128)][_0x13c809(0x16c)]('\x1b[1A\x1b[2K'),process[_0x13c809(0x128)][_0x13c809(0x16c)](_0x13c809(0xf2)),process['stdout'][_0x13c809(0x16c)](_0x13c809(0xf2));},_0x3d566=_0x19533d&&_0x19533d[_0x29c948(0x1a0)]&&_0x19533d[_0x29c948(0x1a0)]!==null&&_0x19533d['attemptId'][_0x29c948(0x11e)]()!=='';if(!_0x3d566){_0x31a139(),console[_0x29c948(0xcc)](a41_0x542931[_0x29c948(0x145)](_0x29c948(0x13e)));return;}_0x31a139();const _0x26a22c=_0x31e574['find'](_0x16901c=>_0x16901c[_0x29c948(0x1df)]?.['id']===_0x19533d[_0x29c948(0x1a0)]);if(_0x26a22c){const _0x420da2=_0x26a22c['project']?.['name']||'?',_0x231b8c=_0x26a22c[_0x29c948(0x20b)]?.[_0x29c948(0x23f)]||'?';console[_0x29c948(0xcc)](_0x29c948(0x179)+a41_0x542931[_0x29c948(0x145)](_0x420da2)+_0x29c948(0x136)+a41_0x542931[_0x29c948(0x145)](_0x231b8c));}const _0x5a7763=new WorkflowTimelineCommand();await _0x5a7763[_0x29c948(0x237)]({'args':[],'options':{..._0x1f4455,'attemptId':_0x19533d['attemptId']},'tdx':_0x56776b});}['generateSessionTimelineRows'](_0x50ae39,_0x526ec7){const _0x1c0c9f=a41_0x5bd115,_0x5d6e49=new Map();for(const _0x1c56e4 of _0x50ae39){_0x1c56e4['id']&&_0x1c56e4[_0x1c0c9f(0x1df)]?.['id']&&_0x5d6e49[_0x1c0c9f(0x1c2)](_0x1c56e4['id'],_0x1c56e4[_0x1c0c9f(0x1df)]['id']);}const _0x710b36=[];let _0x43c917='';const _0x38e6c1=this[_0x1c0c9f(0x21d)](_0x50ae39,_0x526ec7),_0x4e3290=_0x38e6c1['split']('\x0a');for(const _0x2380e5 of _0x4e3290){if(_0x2380e5[_0x1c0c9f(0x15b)](_0x1c0c9f(0x1ca))||_0x2380e5[_0x1c0c9f(0x14a)](/^\s+\d{4}-\d{2}-\d{2}/))_0x43c917=_0x2380e5;else{if(_0x2380e5[_0x1c0c9f(0x14a)](/^[✅❌🔄🛑⏳]/)){const _0x44c813=_0x2380e5['match'](/#(\d+)/),_0xc2ed83=_0x44c813?_0x44c813[0x1]:null,_0x59ee6b=_0xc2ed83?_0x5d6e49['get'](_0xc2ed83)||null:null,_0x496a91=_0x50ae39['find'](_0x4635ae=>_0x4635ae['id']===_0xc2ed83),_0x297f16=_0x496a91?.[_0x1c0c9f(0x18f)]?.[_0x1c0c9f(0x23f)]||'';_0x710b36['push']({'displayLine':_0x2380e5,'attemptId':_0x59ee6b,'projectName':_0x297f16});}}}return{'timelineRows':_0x710b36,'timeAxisHeader':_0x43c917};}}function a41_0x20a5(_0x1d49b5,_0x15c86e){_0x1d49b5=_0x1d49b5-0xb6;const _0x1fc37b=a41_0x1fc3();let _0x20a55a=_0x1fc37b[_0x1d49b5];return _0x20a55a;}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x239);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x126);async[a41_0x5bd115(0x237)](_0x4180fa){const _0x453fb4=a41_0x5bd115,{options:_0x58e590,args:_0x16375b,tdx:_0x3e3c04}=_0x4180fa,_0x17c6d5=this['parseProjectWorkflowPattern'](_0x16375b,_0x58e590);if(!_0x17c6d5)return 0x1;const {projectName:_0x1fbfd3,workflowName:_0x37cc37}=_0x17c6d5,_0x1bb1f5=_0x58e590[_0x453fb4(0x18b)];if(_0x58e590['verbose']){if(_0x1fbfd3&&_0x37cc37)console[_0x453fb4(0x211)](_0x453fb4(0x1f5)+_0x1fbfd3+'.'+_0x37cc37);else _0x1fbfd3&&console[_0x453fb4(0x211)](_0x453fb4(0x135)+_0x1fbfd3);_0x1bb1f5&&console['error'](_0x453fb4(0x213));}const _0x4dc0e8=await withSpinner(_0x453fb4(0x104),()=>_0x3e3c04[_0x453fb4(0x20b)][_0x453fb4(0xe9)]({'projectName':_0x1fbfd3,'workflowName':_0x37cc37,'includeRetried':_0x1bb1f5,'limit':_0x58e590[_0x453fb4(0xfd)]}),{'verbose':_0x58e590[_0x453fb4(0x1c7)]}),_0xaceef5=_0x4dc0e8[_0x453fb4(0x102)],_0x459974=_0x58e590[_0x453fb4(0xfd)]||0x64,_0x285d7e=_0xaceef5[_0x453fb4(0xc8)]>=_0x459974?a41_0x542931[_0x453fb4(0x145)](_0x453fb4(0x244)):'';console['error'](_0x453fb4(0x1bc)+_0xaceef5[_0x453fb4(0xc8)]+_0x453fb4(0x1fa)+(_0xaceef5[_0x453fb4(0xc8)]!==0x1?'s':'')+_0x285d7e);if(_0x58e590[_0x453fb4(0xd6)]===_0x453fb4(0x184)||_0x58e590[_0x453fb4(0xd6)]==='jsonl'||_0x58e590['format']==='table')await handleSDKOutput(_0xaceef5,_0x58e590);else{if(_0xaceef5[_0x453fb4(0xc8)]===0x0){if(_0x1fbfd3&&_0x37cc37)console['log'](_0x453fb4(0x23a)+_0x1fbfd3+'.'+_0x37cc37);else _0x1fbfd3?console[_0x453fb4(0xcc)](_0x453fb4(0x13d)+_0x1fbfd3):console['log']('No\x20attempts\x20found');}else{const _0x28c6f5=_0x58e590[_0x453fb4(0x16a)],_0x51b8f9=_0xaceef5[_0x453fb4(0x233)](_0x47d7ea=>{const _0x5087d1=_0x453fb4,_0x599087=a41_0x542931[_0x5087d1(0x145)]('#'+_0x47d7ea['id']),_0x4a760a=_0x47d7ea[_0x5087d1(0x18f)]?.['id'],_0x9d065b=_0x47d7ea[_0x5087d1(0xd9)]||_0x47d7ea[_0x5087d1(0x204)],_0x85c086=_0x4a760a&&_0x9d065b?hyperlink(_0x599087,getWorkflowAttemptUrl(_0x28c6f5,_0x4a760a,_0x9d065b,_0x47d7ea['id'])):_0x599087,{icon:_0x39450d,text:_0x226300}=getAttemptStatusDisplay(_0x47d7ea),_0x192303=(_0x47d7ea[_0x5087d1(0x18f)]?.[_0x5087d1(0x23f)]||'?')+'.'+(_0x47d7ea[_0x5087d1(0x20b)]?.[_0x5087d1(0x23f)]||'?'),_0x57596e=_0x47d7ea[_0x5087d1(0x1d3)]?a41_0x542931[_0x5087d1(0x145)](_0x47d7ea[_0x5087d1(0x1d3)]):'';return(_0x85c086+'\x20'+_0x39450d+(_0x226300?'\x20'+_0x226300:'')+'\x20'+_0x192303+'\x20'+_0x57596e)[_0x5087d1(0x215)]();});await writeOutput(_0x51b8f9[_0x453fb4(0x11c)]('\x0a'),_0x58e590['output'],_0x453fb4(0x202));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x251);[a41_0x5bd115(0x22f)]='Show\x20specific\x20attempt\x20details';async[a41_0x5bd115(0x237)](_0xbefd95){const _0x3f5102=a41_0x5bd115,{options:_0x4f54a5,args:_0x3e2992,tdx:_0x44dc2c}=_0xbefd95,_0x5edad2=_0x3e2992[0x0];if(!_0x5edad2)return console['error'](_0x3f5102(0x18c)),0x1;_0x4f54a5[_0x3f5102(0x1c7)]&&console[_0x3f5102(0x211)](_0x3f5102(0x1af)+_0x5edad2);const _0xf6448e=await withSpinner('Getting\x20attempt\x20details...',()=>_0x44dc2c[_0x3f5102(0x20b)][_0x3f5102(0xfb)](_0x5edad2),{'verbose':_0x4f54a5[_0x3f5102(0x1c7)]}),_0x2d08ef=_0xf6448e['data'];let _0x54bfe3;!_0x2d08ef[_0x3f5102(0x174)]?_0x54bfe3=_0x2d08ef[_0x3f5102(0x187)]?'canceling':_0x3f5102(0x1a2):_0x54bfe3=_0x2d08ef[_0x3f5102(0x177)]?_0x3f5102(0x177):'error';let _0x83196f;if(_0x2d08ef[_0x3f5102(0x12c)]&&_0x2d08ef['finishedAt']){const _0x5acb3d=new Date(_0x2d08ef[_0x3f5102(0x12c)])['getTime'](),_0x345562=new Date(_0x2d08ef['finishedAt'])[_0x3f5102(0x137)]();_0x83196f=Math[_0x3f5102(0x175)]((_0x345562-_0x5acb3d)/0x3e8);}const _0x36eb7a={'attempt_id':_0x2d08ef['id'],'status':_0x54bfe3,..._0x2d08ef[_0x3f5102(0x17f)]!==undefined&&{'index':_0x2d08ef[_0x3f5102(0x17f)]},..._0x2d08ef[_0x3f5102(0x18f)]&&{'project':_0x2d08ef[_0x3f5102(0x18f)][_0x3f5102(0x23f)]},..._0x2d08ef[_0x3f5102(0x20b)]&&{'workflow':_0x2d08ef[_0x3f5102(0x20b)][_0x3f5102(0x23f)]},..._0x2d08ef[_0x3f5102(0x204)]&&{'session_id':_0x2d08ef[_0x3f5102(0x204)]},..._0x2d08ef[_0x3f5102(0x1d3)]&&{'session_time':_0x2d08ef[_0x3f5102(0x1d3)]},..._0x2d08ef[_0x3f5102(0x1c5)]&&{'retry_attempt':_0x2d08ef[_0x3f5102(0x1c5)]},..._0x83196f!==undefined&&{'duration_sec':_0x83196f},..._0x2d08ef[_0x3f5102(0x12c)]&&{'created_at':_0x2d08ef['createdAt']},..._0x2d08ef[_0x3f5102(0x1e2)]&&{'finished_at':_0x2d08ef[_0x3f5102(0x1e2)]},...Object[_0x3f5102(0x1dc)](_0x2d08ef[_0x3f5102(0xd7)])[_0x3f5102(0xc8)]>0x0&&{'params':_0x2d08ef[_0x3f5102(0xd7)]}};return await handleSingleObjectOutput(_0x36eb7a,_0x4f54a5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:tasks';['description']=a41_0x5bd115(0xde);async['execute'](_0x285fcd){const _0x188b2a=a41_0x5bd115,{options:_0x582d05,args:_0x35a53e,tdx:_0x400130}=_0x285fcd,_0x115a7c=_0x35a53e[0x0];if(!_0x115a7c)return console[_0x188b2a(0x211)](_0x188b2a(0x18c)),0x1;const _0x2832b9=_0x582d05[_0x188b2a(0x1aa)];_0x582d05['verbose']&&(console[_0x188b2a(0x211)]('Attempt\x20ID:\x20'+_0x115a7c),_0x2832b9&&console[_0x188b2a(0x211)](_0x188b2a(0x1f7)));const _0x4c8061=await withSpinner(_0x188b2a(0x13f),()=>_0x400130[_0x188b2a(0x20b)][_0x188b2a(0x129)](_0x115a7c,_0x2832b9||![]),{'verbose':_0x582d05['verbose']}),_0x4cb4cc=_0x4c8061[_0x188b2a(0x102)];return console[_0x188b2a(0x211)](_0x188b2a(0x1bc)+_0x4cb4cc[_0x188b2a(0xc8)]+_0x188b2a(0xba)+(_0x4cb4cc['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cb4cc,_0x582d05),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:logs';[a41_0x5bd115(0x22f)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xffa00){const _0x249542=a41_0x5bd115,{options:_0x38e9c9,args:_0x596e07,tdx:_0x506f78}=_0xffa00,_0x14bc11=_0x596e07[0x0];let _0x4bbe48=_0x596e07[0x1];if(!_0x14bc11)return console[_0x249542(0x211)](_0x249542(0x18c)),0x1;_0x38e9c9[_0x249542(0x1c7)]&&(console[_0x249542(0x211)](_0x249542(0x1af)+_0x14bc11),_0x4bbe48&&console[_0x249542(0x211)]('Task\x20name:\x20'+_0x4bbe48));const _0x362b0e=await withSpinner(_0x249542(0xf8),()=>_0x506f78['workflow'][_0x249542(0x192)](_0x14bc11,_0x4bbe48),{'verbose':_0x38e9c9[_0x249542(0x1c7)]}),_0x234005=_0x362b0e[_0x249542(0x102)];if(_0x234005[_0x249542(0xc8)]===0x0)return console[_0x249542(0x211)](_0x249542(0x1eb)),0x0;if(!_0x4bbe48&&(_0x38e9c9[_0x249542(0x184)]||_0x38e9c9[_0x249542(0xd6)]))return await handleSDKOutput(_0x234005,_0x38e9c9),0x0;if(!_0x4bbe48){const _0x48169d=_0x234005[_0x249542(0x233)](_0x11ec37=>({'title':_0x11ec37['taskName']+'\x20('+formatBytes(_0x11ec37[_0x249542(0x21c)])+')','value':_0x11ec37[_0x249542(0x195)]})),_0x35f6ee=await a41_0x2444a6({'type':'select','name':'task','message':_0x249542(0x1a1),'choices':_0x48169d});if(!_0x35f6ee['task'])return console[_0x249542(0x211)](_0x249542(0x13e)),0x0;_0x4bbe48=_0x35f6ee['task'];}const _0x4c666b=await withSpinner(_0x249542(0x223),()=>_0x506f78[_0x249542(0x20b)]['logs'](_0x14bc11,_0x4bbe48),{'verbose':_0x38e9c9[_0x249542(0x1c7)]}),_0x2e3597=_0x4c666b[_0x249542(0x102)];return _0x2e3597?console[_0x249542(0xcc)](_0x2e3597):console[_0x249542(0x211)](_0x249542(0x22b)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0xb6);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x1ae);async[a41_0x5bd115(0x237)](_0x2cac72){const _0x455649=a41_0x5bd115,{options:_0x38cf33,args:_0x4c1034,tdx:_0x7b9a34}=_0x2cac72,_0x39c17e=_0x4c1034[0x0];if(!_0x39c17e)return console['error'](_0x455649(0x18c)),0x1;const _0x18a644=_0x38cf33['reason'];_0x38cf33[_0x455649(0x1c7)]&&(console['error'](_0x455649(0x1af)+_0x39c17e),_0x18a644&&console[_0x455649(0x211)](_0x455649(0x240)+_0x18a644));if(!_0x38cf33[_0x455649(0x24d)]){const _0x23a80a=await confirmKey(_0x455649(0x105)+_0x39c17e+'?');if(!_0x23a80a)return console[_0x455649(0x211)](_0x455649(0x13e)),0x0;}const _0x5e7a1c=await withSpinner(_0x455649(0x217),()=>_0x7b9a34[_0x455649(0x20b)]['kill'](_0x39c17e,_0x18a644),{'verbose':_0x38cf33[_0x455649(0x1c7)]}),_0x4f234c=_0x5e7a1c['data'];return console[_0x455649(0x211)]('✔\x20'+_0x4f234c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:retry';[a41_0x5bd115(0x22f)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x27ea7b){const _0x1da6bb=a41_0x5bd115,{options:_0x4d7ddd,args:_0xc782ca,tdx:_0x3d2d1d}=_0x27ea7b,_0x4bee87=_0xc782ca[0x0];if(!_0x4bee87)return console[_0x1da6bb(0x211)](_0x1da6bb(0x1fb)),console['error'](_0x1da6bb(0x13c)),0x1;let _0x1019cb=![],_0x3b6caa=_0x4bee87;if(_0x4bee87['startsWith'](_0x1da6bb(0x1b4)))_0x1019cb=!![],_0x3b6caa=_0x4bee87[_0x1da6bb(0x18a)](0x8);else{if(_0x4bee87[_0x1da6bb(0x15b)](_0x1da6bb(0x10a)))_0x1019cb=![],_0x3b6caa=_0x4bee87[_0x1da6bb(0x18a)](0x8);else return console['error'](_0x1da6bb(0x17b)),console['error'](_0x1da6bb(0x13c)),0x1;}const _0x44aa9b=_0x4d7ddd[_0x1da6bb(0x1d5)],_0x3e65ff=_0x4d7ddd[_0x1da6bb(0x198)],_0x56d1e1=_0x4d7ddd[_0x1da6bb(0xd7)],_0x1d1213=_0x4d7ddd[_0x1da6bb(0x1bf)];_0x4d7ddd['verbose']&&(console['error'](_0x1da6bb(0x1d6)+(_0x1019cb?_0x1da6bb(0x17e):'attempt')+'\x20'+_0x3b6caa),_0x44aa9b&&console['error'](_0x1da6bb(0xdd)+_0x44aa9b),_0x3e65ff&&console[_0x1da6bb(0x211)](_0x1da6bb(0xe5)+_0x3e65ff),_0x56d1e1&&console['error'](_0x1da6bb(0x21a)+_0x56d1e1),_0x1d1213&&console[_0x1da6bb(0x211)](_0x1da6bb(0x150)));let _0x230ce5;if(_0x56d1e1)try{if(_0x56d1e1['startsWith']('@')){const _0x30c0c6=await import(_0x1da6bb(0x156)),_0x7759a0=_0x56d1e1[_0x1da6bb(0x18a)](0x1),_0x24b48d=await _0x30c0c6[_0x1da6bb(0xe6)](_0x7759a0,'utf-8');_0x230ce5=JSON[_0x1da6bb(0x151)](_0x24b48d);}else _0x230ce5=JSON[_0x1da6bb(0x151)](_0x56d1e1);}catch{return console[_0x1da6bb(0x211)](_0x1da6bb(0xf4)),0x1;}if(!_0x4d7ddd[_0x1da6bb(0x24d)]){const _0x2480c0=await confirmKey(_0x1da6bb(0x21b)+(_0x1019cb?_0x1da6bb(0x17e):_0x1da6bb(0xfb))+'\x20'+_0x3b6caa+'?');if(!_0x2480c0)return console[_0x1da6bb(0x211)](_0x1da6bb(0x13e)),0x0;}let _0x31559e;_0x1019cb?_0x31559e=await withSpinner(_0x1da6bb(0x193),()=>_0x3d2d1d['workflow'][_0x1da6bb(0x245)](_0x3b6caa,{'fromTask':_0x44aa9b,'retryParams':_0x230ce5}),{'verbose':_0x4d7ddd[_0x1da6bb(0x1c7)]}):_0x31559e=await withSpinner('Retrying\x20attempt...',()=>_0x3d2d1d['workflow']['retryAttempt'](_0x3b6caa,{'resumeFrom':_0x3e65ff,'retryParams':_0x230ce5,'force':_0x1d1213}),{'verbose':_0x4d7ddd[_0x1da6bb(0x1c7)]});const _0xce18a5=_0x31559e[_0x1da6bb(0x102)];return console[_0x1da6bb(0x211)](_0x1da6bb(0x172)),console[_0x1da6bb(0x211)]('\x20\x20New\x20attempt\x20ID:\x20'+_0xce18a5[_0x1da6bb(0x1a0)]),console[_0x1da6bb(0x211)](_0x1da6bb(0x19e)+_0xce18a5[_0x1da6bb(0x204)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x14e);[a41_0x5bd115(0x22f)]='Start\x20a\x20workflow\x20run';async[a41_0x5bd115(0x237)](_0x4f65b0){const _0x1af40e=a41_0x5bd115,{options:_0x1bfe6d,args:_0x1983a8,tdx:_0x1e2583}=_0x4f65b0;let _0x4549c8=_0x1983a8[0x0];if(!_0x4549c8){const _0x19fe50=this['resolveProject']([],_0x1bfe6d),_0x50fa7d=await withSpinner('Loading\x20workflows...',()=>_0x1e2583[_0x1af40e(0x20b)][_0x1af40e(0x116)](_0x19fe50,{'limit':_0x1bfe6d[_0x1af40e(0xfd)]}),{'verbose':_0x1bfe6d[_0x1af40e(0x1c7)]}),_0x350ada=_0x50fa7d[_0x1af40e(0x102)];if(_0x350ada[_0x1af40e(0xc8)]===0x0)return console['error'](_0x1af40e(0x1a8)),!_0x19fe50&&console[_0x1af40e(0x211)](a41_0x542931[_0x1af40e(0x145)](_0x1af40e(0x1b0))),0x1;const _0xecb53e=_0x350ada[_0x1af40e(0x233)](_0x274ad8=>({'title':_0x274ad8[_0x1af40e(0x18f)]?.[_0x1af40e(0x23f)]+'.'+_0x274ad8['name'],'value':_0x274ad8[_0x1af40e(0x18f)]?.['name']+'.'+_0x274ad8['name'],'description':_0x274ad8['revision']?'revision:\x20'+_0x274ad8[_0x1af40e(0x159)]:undefined})),_0x555cf3=await a41_0x2444a6({'type':_0x1af40e(0x1b9),'name':_0x1af40e(0x20b),'message':_0x1af40e(0x1d9),'choices':_0xecb53e});if(!_0x555cf3[_0x1af40e(0x20b)])return 0x1;_0x4549c8=_0x555cf3['workflow'];}if(!_0x4549c8['includes']('.')){const _0x1c204a=this['resolveProject']([],_0x1bfe6d);if(_0x1c204a)_0x4549c8=_0x1c204a+'.'+_0x4549c8;else return console[_0x1af40e(0x211)](a41_0x542931[_0x1af40e(0x1e7)](_0x1af40e(0x15a)),_0x1af40e(0xbd)),console['error'](a41_0x542931['dim'](_0x1af40e(0x1b0))),0x1;}const _0x1d0b01=_0x1bfe6d['param'],_0x37a332=_0x1bfe6d[_0x1af40e(0x1d3)],_0x1ba1b4={};if(_0x1d0b01&&Array[_0x1af40e(0xd1)](_0x1d0b01))for(const _0x2ff51b of _0x1d0b01){const _0x27dba7=_0x2ff51b[_0x1af40e(0x246)]('=');if(_0x27dba7===-0x1)return console[_0x1af40e(0x211)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2ff51b),console['error'](_0x1af40e(0x1d8)),0x1;const _0x20624f=_0x2ff51b[_0x1af40e(0x18a)](0x0,_0x27dba7),_0x3937dd=_0x2ff51b['substring'](_0x27dba7+0x1);try{_0x1ba1b4[_0x20624f]=JSON[_0x1af40e(0x151)](_0x3937dd);}catch{_0x1ba1b4[_0x20624f]=_0x3937dd;}}_0x1bfe6d[_0x1af40e(0x1c7)]&&(console[_0x1af40e(0x211)](_0x1af40e(0x154)+_0x4549c8),Object['keys'](_0x1ba1b4)[_0x1af40e(0xc8)]>0x0&&console[_0x1af40e(0x211)](_0x1af40e(0x1ab)+JSON['stringify'](_0x1ba1b4)),_0x37a332&&console[_0x1af40e(0x211)](_0x1af40e(0x122)+_0x37a332));const _0x9c0217=await withSpinner(_0x1af40e(0x146),()=>_0x1e2583[_0x1af40e(0x20b)][_0x1af40e(0x127)](_0x4549c8,_0x1ba1b4,{'sessionTime':_0x37a332}),{'verbose':_0x1bfe6d['verbose']}),_0x2fd073=_0x9c0217[_0x1af40e(0x102)];console[_0x1af40e(0x211)](_0x1af40e(0x10e)),console[_0x1af40e(0x211)](_0x1af40e(0x206)+_0x2fd073['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x2fd073[_0x1af40e(0x204)]),console[_0x1af40e(0x211)](_0x1af40e(0x173)+_0x2fd073['project']?.[_0x1af40e(0x23f)]),console['error'](_0x1af40e(0x165)+_0x2fd073['workflow']?.['name']);if(_0x2fd073[_0x1af40e(0x18f)]?.['id']&&_0x2fd073['sessionId']&&_0x2fd073['id']){const _0x29a610=_0x1bfe6d[_0x1af40e(0x16a)],_0x3ce165=getConsoleUrl(_0x29a610,_0x1af40e(0xc5)+_0x2fd073['project']['id']+_0x1af40e(0x163)+_0x2fd073['sessionId']+_0x1af40e(0x1f4)+_0x2fd073['id']);console[_0x1af40e(0x211)](_0x1af40e(0x17a)+a41_0x542931[_0x1af40e(0xc9)](_0x3ce165));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a41_0x5bd115(0x114);['description']=a41_0x5bd115(0xdb);async[a41_0x5bd115(0x237)](_0x5cebeb){const _0x1a4d0d=a41_0x5bd115,{options:_0x49b851,args:_0x24a780,tdx:_0x146c4e}=_0x5cebeb,_0x42be7d=_0x24a780[0x0],_0x4a6272=_0x24a780[0x1]||'.';if(!_0x42be7d)return console[_0x1a4d0d(0x211)](_0x1a4d0d(0xd0)),console['error'](_0x1a4d0d(0x1cf)),0x1;const _0x21d3b5=_0x49b851[_0x1a4d0d(0x159)];_0x49b851[_0x1a4d0d(0x1c7)]&&(console[_0x1a4d0d(0x211)]('Project:\x20'+_0x42be7d),console[_0x1a4d0d(0x211)]('Output\x20directory:\x20'+_0x4a6272),_0x21d3b5&&console['error'](_0x1a4d0d(0xfc)+_0x21d3b5));const _0x1219bb=await withSpinner(_0x1a4d0d(0x188)+_0x42be7d+'...',()=>_0x146c4e['workflow']['download'](_0x42be7d,_0x4a6272,{'revision':_0x21d3b5}),{'verbose':_0x49b851[_0x1a4d0d(0x1c7)]}),_0x5eb0b4=_0x1219bb[_0x1a4d0d(0x102)];return console[_0x1a4d0d(0x211)]('✔\x20Downloaded\x20'+_0x5eb0b4[_0x1a4d0d(0x169)]),console['error'](_0x1a4d0d(0x117)+_0x5eb0b4['revision']),console[_0x1a4d0d(0x211)](_0x1a4d0d(0x12b)+_0x5eb0b4['filesExtracted']),console[_0x1a4d0d(0x211)](_0x1a4d0d(0x221)+_0x4a6272+'/'+_0x5eb0b4[_0x1a4d0d(0x169)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x1f6);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xcd);async[a41_0x5bd115(0x237)](_0x4cd28e){const _0x1b17d1=a41_0x5bd115,{options:_0x56f324,args:_0x58b75b,tdx:_0x108c93}=_0x4cd28e;let _0x13360f='.',_0x3681d4=_0x56f324[_0x1b17d1(0x23f)];if(_0x58b75b[0x0]){const {promises:_0x9fbe59}=await import('fs');try{const _0x47e2e2=await _0x9fbe59[_0x1b17d1(0x1d7)](_0x58b75b[0x0]);if(_0x47e2e2[_0x1b17d1(0x20d)]())_0x13360f=_0x58b75b[0x0];else return console[_0x1b17d1(0x211)](_0x1b17d1(0x160)+_0x58b75b[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3681d4=_0x58b75b[0x0],_0x13360f='.';}}const _0x3a69ec=_0x56f324['revision'],_0x4cef43=_0x56f324[_0x1b17d1(0xd2)];_0x56f324['verbose']&&(console[_0x1b17d1(0x211)](_0x1b17d1(0x1e1)+_0x13360f),_0x3681d4&&console[_0x1b17d1(0x211)]('Project\x20name:\x20'+_0x3681d4),_0x3a69ec&&console[_0x1b17d1(0x211)](_0x1b17d1(0xfc)+_0x3a69ec),_0x4cef43&&console['error']('Validation:\x20skipped'));const _0x3f6557=await withSpinner(_0x1b17d1(0x1da),()=>_0x108c93['workflow'][_0x1b17d1(0x249)](_0x13360f,{'projectName':_0x3681d4,'revision':_0x3a69ec,'skipValidation':_0x4cef43}),{'verbose':_0x56f324[_0x1b17d1(0x1c7)]}),_0x1799f5=_0x3f6557[_0x1b17d1(0x102)];return console[_0x1b17d1(0x211)]('✔\x20Pushed\x20'+_0x1799f5[_0x1b17d1(0x169)]),console[_0x1b17d1(0x211)](_0x1b17d1(0x218)+_0x1799f5['projectId']),console[_0x1b17d1(0x211)](_0x1b17d1(0x117)+_0x1799f5[_0x1b17d1(0x159)]),await this[_0x1b17d1(0x19d)](_0x108c93,_0x1799f5[_0x1b17d1(0x169)],_0x56f324[_0x1b17d1(0x16a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:pull';[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xe4);async[a41_0x5bd115(0x237)](_0x117ecf){const _0xd40ddb=a41_0x5bd115,{options:_0x4b082e,args:_0x43336e,tdx:_0x2b5aec}=_0x117ecf,_0x356a05=_0x43336e[0x0],_0x5e424a=_0x43336e[0x1];if(!_0x356a05)return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1e7)]('Error:'),_0xd40ddb(0x10f)),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x13b))),0x1;const _0x13be04=_0x4b082e['revision'];_0x4b082e[_0xd40ddb(0x1c7)]&&(console[_0xd40ddb(0x211)](_0xd40ddb(0x179)+_0x356a05),_0x5e424a&&console['error'](_0xd40ddb(0x216)+_0x5e424a),_0x13be04&&console['error'](_0xd40ddb(0xfc)+_0x13be04),_0x4b082e[_0xd40ddb(0x1c3)]&&console['error'](_0xd40ddb(0x124)));const _0x5c8176=await withSpinner(_0xd40ddb(0x19f)+_0x356a05+'...',()=>_0x2b5aec[_0xd40ddb(0x20b)][_0xd40ddb(0x22d)](_0x356a05,{'targetDir':_0x5e424a,'revision':_0x13be04}),{'verbose':_0x4b082e[_0xd40ddb(0x1c7)]}),_0x3d7eb4=_0x5c8176['data'];_0x3d7eb4[_0xd40ddb(0x166)]?console[_0xd40ddb(0x211)](_0xd40ddb(0x131)+_0x3d7eb4[_0xd40ddb(0x169)]):console[_0xd40ddb(0x211)]('✔\x20Project:\x20'+_0x3d7eb4[_0xd40ddb(0x169)]);console['error'](_0xd40ddb(0x117)+_0x3d7eb4['revision']),console[_0xd40ddb(0x211)](_0xd40ddb(0x113)+(a41_0x584037[_0xd40ddb(0x231)](process[_0xd40ddb(0xf9)](),_0x3d7eb4[_0xd40ddb(0x14b)])||'.')),console['error'](_0xd40ddb(0xed)+a41_0x542931[_0xd40ddb(0x1c8)]('+'+_0x3d7eb4['summary']['new']+_0xd40ddb(0xec))+',\x20'+(a41_0x542931[_0xd40ddb(0x241)]('~'+_0x3d7eb4[_0xd40ddb(0x1de)][_0xd40ddb(0x199)]+_0xd40ddb(0x203))+',\x20')+(a41_0x542931[_0xd40ddb(0x1e7)]('-'+_0x3d7eb4[_0xd40ddb(0x1de)][_0xd40ddb(0xe0)]+'\x20deleted')+',\x20')+(''+a41_0x542931[_0xd40ddb(0x145)](_0x3d7eb4[_0xd40ddb(0x1de)]['unchanged']+_0xd40ddb(0x186))));for(const _0x193f58 of _0x3d7eb4[_0xd40ddb(0xd3)]){_0x193f58[_0xd40ddb(0x147)]===_0xd40ddb(0x199)&&_0x193f58[_0xd40ddb(0x11d)]&&(console[_0xd40ddb(0x211)]('\x0a'+a41_0x542931[_0xd40ddb(0xc9)](_0xd40ddb(0x24a)+_0x193f58[_0xd40ddb(0x21e)])),console[_0xd40ddb(0x211)](_0x193f58[_0xd40ddb(0x11d)]));}if(!_0x3d7eb4[_0xd40ddb(0x22c)])return saveSessionContext({'workflow_project':_0x3d7eb4['projectName']},_0x4b082e['session']),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1c8)](_0xd40ddb(0x18d))),console[_0xd40ddb(0x211)](a41_0x542931['dim'](_0xd40ddb(0x243)+_0x3d7eb4[_0xd40ddb(0x169)])),0x0;if(_0x4b082e[_0xd40ddb(0x1c3)])return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x241)](_0xd40ddb(0x23c))),0x0;if(!_0x4b082e['yes']){const _0x4358a7=await confirmKey(_0xd40ddb(0x1ea));if(!_0x4358a7)return console['error'](_0xd40ddb(0x13e)),0x0;}await withSpinner('Writing\x20files...',()=>_0x2b5aec[_0xd40ddb(0x20b)][_0xd40ddb(0x1f2)](_0x3d7eb4,{'revision':_0x13be04}),{'verbose':_0x4b082e['verbose']}),saveSessionContext({'workflow_project':_0x3d7eb4[_0xd40ddb(0x169)]},_0x4b082e[_0xd40ddb(0x17e)]),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1c8)](_0xd40ddb(0x1fe)));const _0x5e6ae8=a41_0x584037['relative'](process[_0xd40ddb(0xf9)](),_0x3d7eb4['targetDir'])||'.';return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x221)+_0x5e6ae8)),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x243)+_0x3d7eb4[_0xd40ddb(0x169)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]='workflow:push';[a41_0x5bd115(0x22f)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a41_0x5bd115(0x237)](_0xbd08f6){const _0x17624a=a41_0x5bd115,{options:_0x239ffe,args:_0x1e9934,tdx:_0x12420b}=_0xbd08f6,_0x91e15f=this[_0x17624a(0x207)](_0x1e9934,_0x239ffe),_0x2b36e7=_0x239ffe[_0x17624a(0x159)],_0x25cd2f=_0x239ffe[_0x17624a(0xd2)];_0x239ffe[_0x17624a(0x1c7)]&&(_0x91e15f&&console[_0x17624a(0x211)](_0x17624a(0xe1)+_0x91e15f),_0x2b36e7&&console[_0x17624a(0x211)](_0x17624a(0xfc)+_0x2b36e7),_0x239ffe[_0x17624a(0x1c3)]&&console[_0x17624a(0x211)](_0x17624a(0x124)),_0x25cd2f&&console['error'](_0x17624a(0x19c)));let _0x2de04c;try{_0x2de04c=await withSpinner(_0x17624a(0xf5),()=>_0x12420b['workflow']['preparePushProject']({'sourceDir':_0x91e15f,'revision':_0x2b36e7,'skipValidation':_0x25cd2f}),{'verbose':_0x239ffe[_0x17624a(0x1c7)]});}catch(_0x5f4e63){if(_0x5f4e63 instanceof Error&&_0x5f4e63[_0x17624a(0x1f3)][_0x17624a(0xbc)](_0x17624a(0x222)))return console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x1e7)](_0x17624a(0x15a)),_0x17624a(0x1fd)),_0x239ffe[_0x17624a(0x24b)]?console['error'](a41_0x542931[_0x17624a(0x145)]('Tip:\x20cd\x20to\x20workflows/'+_0x239ffe[_0x17624a(0x24b)]+_0x17624a(0x168)+_0x239ffe[_0x17624a(0x24b)]+'\x27')):console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x145)](_0x17624a(0x1e8))),0x1;throw _0x5f4e63;}const _0x7e102b=_0x2de04c['data'];console[_0x17624a(0x211)]('✔\x20Project:\x20'+_0x7e102b[_0x17624a(0x169)]),console[_0x17624a(0x211)](_0x17624a(0x148)+_0x7e102b[_0x17624a(0xe7)]),console[_0x17624a(0x211)]('\x20\x20Revision:\x20'+_0x7e102b[_0x17624a(0x159)]),console[_0x17624a(0x211)](_0x17624a(0xed)+a41_0x542931[_0x17624a(0x1c8)]('+'+_0x7e102b[_0x17624a(0x1de)]['new']+_0x17624a(0xec))+',\x20'+(a41_0x542931[_0x17624a(0x241)]('~'+_0x7e102b[_0x17624a(0x1de)][_0x17624a(0x199)]+_0x17624a(0x203))+',\x20')+(a41_0x542931[_0x17624a(0x1e7)]('-'+_0x7e102b[_0x17624a(0x1de)]['deleted']+_0x17624a(0x20a))+',\x20')+(''+a41_0x542931['dim'](_0x7e102b[_0x17624a(0x1de)]['unchanged']+_0x17624a(0x186))));for(const _0x889220 of _0x7e102b[_0x17624a(0xd3)]){_0x889220[_0x17624a(0x147)]===_0x17624a(0x199)&&_0x889220['diff']&&(console[_0x17624a(0x211)]('\x0a'+a41_0x542931[_0x17624a(0xc9)](_0x17624a(0x24a)+_0x889220[_0x17624a(0x21e)])),console[_0x17624a(0x211)](_0x889220[_0x17624a(0x11d)]));}if(!_0x7e102b[_0x17624a(0x22c)])return console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x1c8)](_0x17624a(0xf3))),await this['showWorkflowConsoleUrl'](_0x12420b,_0x7e102b['projectName'],_0x239ffe['site']),0x0;if(_0x239ffe[_0x17624a(0x1c3)])return console[_0x17624a(0x211)](a41_0x542931['yellow'](_0x17624a(0x15f))),0x0;if(!_0x239ffe[_0x17624a(0x24d)]){const _0x57ce42=await confirmKey(_0x17624a(0x194));if(!_0x57ce42)return console[_0x17624a(0x211)](_0x17624a(0x13e)),0x0;}const _0x586263=await withSpinner(_0x17624a(0xc6),()=>_0x12420b[_0x17624a(0x20b)][_0x17624a(0x118)](_0x7e102b),{'verbose':_0x239ffe[_0x17624a(0x1c7)]}),_0x5e8137=_0x586263[_0x17624a(0x102)];return console['error'](a41_0x542931[_0x17624a(0x1c8)](_0x17624a(0x18e))),console[_0x17624a(0x211)](_0x17624a(0x218)+_0x5e8137[_0x17624a(0xfe)]),console[_0x17624a(0x211)](_0x17624a(0x117)+_0x5e8137[_0x17624a(0x159)]),await this[_0x17624a(0x19d)](_0x12420b,_0x5e8137['projectName'],_0x239ffe[_0x17624a(0x16a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a41_0x5bd115(0x123);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x234);async[a41_0x5bd115(0x237)](_0x460b6){const _0x3b11ff=a41_0x5bd115,{options:_0x54d4fc,args:_0x29c06a,tdx:_0x17e03a}=_0x460b6,_0x150528=this[_0x3b11ff(0x207)](_0x29c06a,_0x54d4fc),_0x17bf55=_0x54d4fc[_0x3b11ff(0x23f)],_0x1452b1=_0x54d4fc[_0x3b11ff(0x159)],_0x44b657=_0x54d4fc[_0x3b11ff(0xd2)];if(!_0x150528)return console['error'](a41_0x542931[_0x3b11ff(0x1e7)](_0x3b11ff(0x15a)),'Source\x20directory\x20is\x20required'),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0x176))),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0xe3))),0x1;if(!_0x17bf55)return console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x1e7)](_0x3b11ff(0x15a)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0x176))),0x1;_0x54d4fc[_0x3b11ff(0x1c7)]&&(console[_0x3b11ff(0x211)]('Source\x20directory:\x20'+_0x150528),console[_0x3b11ff(0x211)]('New\x20project\x20name:\x20'+_0x17bf55),_0x1452b1&&console['error'](_0x3b11ff(0xfc)+_0x1452b1),_0x54d4fc[_0x3b11ff(0x1c3)]&&console['error'](_0x3b11ff(0x124)),_0x44b657&&console[_0x3b11ff(0x211)](_0x3b11ff(0x19c)));const _0x32d2c0=await withSpinner(_0x3b11ff(0x201),()=>_0x17e03a['workflow'][_0x3b11ff(0x119)](_0x150528,_0x17bf55,{'revision':_0x1452b1,'skipValidation':_0x44b657}),{'verbose':_0x54d4fc[_0x3b11ff(0x1c7)]}),_0x30590b=_0x32d2c0[_0x3b11ff(0x102)];console[_0x3b11ff(0x211)](_0x3b11ff(0x143)+_0x30590b['sourceDir']);_0x30590b[_0x3b11ff(0x13a)]&&console[_0x3b11ff(0x211)]('Source\x20project:\x20'+_0x30590b['sourceProjectName']);console[_0x3b11ff(0x211)](_0x3b11ff(0xc0)+_0x30590b[_0x3b11ff(0x238)]),console['error']('Revision:\x20'+_0x30590b[_0x3b11ff(0x159)]),console[_0x3b11ff(0x211)]('Files\x20to\x20upload:\x20'+_0x30590b['fileCount']);_0x30590b[_0x3b11ff(0x1ec)]&&(console['error'](a41_0x542931[_0x3b11ff(0x241)](_0x3b11ff(0x1ad)+_0x30590b['newProjectName']+_0x3b11ff(0xc7)+_0x30590b[_0x3b11ff(0x1a3)]+')')),console['error'](a41_0x542931[_0x3b11ff(0x241)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x54d4fc[_0x3b11ff(0x1c3)])return console[_0x3b11ff(0x211)](a41_0x542931['yellow'](_0x3b11ff(0x247))),0x0;if(!_0x54d4fc[_0x3b11ff(0x24d)]){const _0xa23e2b=_0x30590b[_0x3b11ff(0x13a)]||a41_0x584037[_0x3b11ff(0x228)](_0x150528),_0x4039d0=_0x30590b[_0x3b11ff(0x1ec)]?_0x3b11ff(0x1be)+_0x17bf55+_0x3b11ff(0xb8):_0x3b11ff(0x200)+_0xa23e2b+_0x3b11ff(0xc2)+_0x17bf55+'\x22?',_0x4279f0=await confirmKey(_0x4039d0);if(!_0x4279f0)return console[_0x3b11ff(0x211)]('Cancelled'),0x0;}const _0x421975=await withSpinner(_0x30590b[_0x3b11ff(0x1ec)]?'Updating\x20'+_0x17bf55+_0x3b11ff(0x16f):'Cloning\x20to\x20'+_0x17bf55+_0x3b11ff(0x16f),()=>_0x17e03a[_0x3b11ff(0x20b)]['executeCloneProject'](_0x30590b),{'verbose':_0x54d4fc[_0x3b11ff(0x1c7)]}),_0x13d51f=_0x421975[_0x3b11ff(0x102)];return console['error'](a41_0x542931['green'](_0x30590b[_0x3b11ff(0x1ec)]?_0x3b11ff(0xea):_0x3b11ff(0x109))),console['error'](_0x3b11ff(0x173)+_0x13d51f[_0x3b11ff(0x238)]),console[_0x3b11ff(0x211)](_0x3b11ff(0x218)+_0x13d51f[_0x3b11ff(0x212)]),console[_0x3b11ff(0x211)](_0x3b11ff(0x117)+_0x13d51f['revision']),await this[_0x3b11ff(0x19d)](_0x17e03a,_0x13d51f[_0x3b11ff(0x238)],_0x54d4fc[_0x3b11ff(0x16a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a41_0x5bd115(0x24e);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x1b7);async[a41_0x5bd115(0x237)](_0x1efbad){const _0x4710c6=a41_0x5bd115,{options:_0x58b222,args:_0x33ce3,tdx:_0x2fa0fd}=_0x1efbad,_0x1d1a81=_0x33ce3[0x0];if(!_0x1d1a81)return console[_0x4710c6(0x211)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4710c6(0xf6)),0x1;_0x58b222[_0x4710c6(0x1c7)]&&console[_0x4710c6(0x211)](_0x4710c6(0x179)+_0x1d1a81);if(!_0x58b222[_0x4710c6(0x24d)]){const _0x5a1cab=await confirmKey(_0x4710c6(0x1a7)+_0x1d1a81+_0x4710c6(0xbb));if(!_0x5a1cab)return console[_0x4710c6(0x211)](_0x4710c6(0x13e)),0x0;}const _0x14232f=await withSpinner('Deleting\x20project\x20'+_0x1d1a81+_0x4710c6(0x16f),()=>_0x2fa0fd[_0x4710c6(0x20b)][_0x4710c6(0x153)](_0x1d1a81),{'verbose':_0x58b222[_0x4710c6(0x1c7)]}),_0x619d1d=_0x14232f[_0x4710c6(0x102)];return console[_0x4710c6(0x211)](_0x4710c6(0x1cd)+_0x619d1d[_0x4710c6(0x169)]),console['error'](_0x4710c6(0x218)+_0x619d1d[_0x4710c6(0xfe)]),0x0;}}export function parseKeyValue(_0x598625){const _0x2f816c=a41_0x5bd115,_0x55160e=_0x598625[_0x2f816c(0x246)]('=');if(_0x55160e===-0x1)throw new Error('Invalid\x20format:\x20'+_0x598625+_0x2f816c(0x16e));const _0x20f3b9=_0x598625[_0x2f816c(0x18a)](0x0,_0x55160e),_0x295801=_0x598625['substring'](_0x55160e+0x1);if(!_0x20f3b9)throw new Error(_0x2f816c(0x214));return{'key':_0x20f3b9,'value':_0x295801};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';['description']=a41_0x5bd115(0x158);async[a41_0x5bd115(0x237)](_0x4350f9){const _0x565b60=a41_0x5bd115,{options:_0x4cc5a4,args:_0x4980c9,tdx:_0x1092d4}=_0x4350f9,_0x21d97a=this[_0x565b60(0x112)](_0x4980c9,_0x4cc5a4);if(!_0x21d97a)return 0x1;_0x4cc5a4[_0x565b60(0x1c7)]&&console['error'](_0x565b60(0x179)+_0x21d97a);const _0x55c984=await withSpinner('Listing\x20secrets...',()=>_0x1092d4[_0x565b60(0x20b)]['listSecrets'](_0x21d97a),{'verbose':_0x4cc5a4[_0x565b60(0x1c7)]}),{secrets:_0x227022}=_0x55c984[_0x565b60(0x102)];return console[_0x565b60(0x211)](_0x565b60(0x1bc)+_0x227022[_0x565b60(0xc8)]+_0x565b60(0x1c4)+(_0x227022['length']!==0x1?'s':'')),await handleSDKOutput(_0x227022,_0x4cc5a4),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]='workflow:secrets:set';[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xff);async['execute'](_0x47023b){const _0x529ea2=a41_0x5bd115,{options:_0x3488bf,args:_0x3a4f4d,tdx:_0x2867b1}=_0x47023b;let _0x50e889,_0x7ac016;if(_0x3a4f4d[_0x529ea2(0xc8)]>=0x2)_0x50e889=_0x3a4f4d[0x0],_0x7ac016=_0x3a4f4d[0x1];else{if(_0x3a4f4d['length']===0x1&&_0x3488bf[_0x529ea2(0x24b)])_0x50e889=_0x3488bf[_0x529ea2(0x24b)],_0x7ac016=_0x3a4f4d[0x0];else return _0x3a4f4d['length']===0x1?(console[_0x529ea2(0x211)](_0x529ea2(0xd0)),console[_0x529ea2(0x211)](_0x529ea2(0x1b0)),0x1):(console['error'](_0x529ea2(0x17c)),console['error'](_0x529ea2(0xeb)),0x1);}let _0x2d8597,_0xc855b4;try{({key:_0x2d8597,value:_0xc855b4}=parseKeyValue(_0x7ac016));}catch(_0x2ad947){return _0x2ad947 instanceof Error&&console[_0x529ea2(0x211)](a41_0x542931['red'](_0x529ea2(0x15a)),_0x2ad947[_0x529ea2(0x1f3)]),0x1;}_0x3488bf[_0x529ea2(0x1c7)]&&(console[_0x529ea2(0x211)]('Project:\x20'+_0x50e889),console[_0x529ea2(0x211)](_0x529ea2(0x15c)+_0x2d8597));const _0x6c3aea=await withSpinner('Setting\x20secret...',()=>_0x2867b1['workflow']['setSecret'](_0x50e889,_0x2d8597,_0xc855b4),{'verbose':_0x3488bf['verbose']}),_0x552941=_0x6c3aea[_0x529ea2(0x102)];return console[_0x529ea2(0x211)](_0x529ea2(0x189)+_0x552941[_0x529ea2(0x1db)]+_0x529ea2(0x230)+_0x552941[_0x529ea2(0x169)]+'\x27'),(_0x3488bf['json']||_0x3488bf['jsonl'])&&await handleSingleObjectOutput(_0x552941,_0x3488bf),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a41_0x5bd115(0x208);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x162);async[a41_0x5bd115(0x237)](_0x10c5b2){const _0x4300e5=a41_0x5bd115,{options:_0x5d2275,args:_0x1fb0e2,tdx:_0x4dd481}=_0x10c5b2;let _0x9910ca,_0x1d0d3f;if(_0x1fb0e2[_0x4300e5(0xc8)]>=0x2)_0x9910ca=_0x1fb0e2[0x0],_0x1d0d3f=_0x1fb0e2[0x1];else{if(_0x1fb0e2[_0x4300e5(0xc8)]===0x1&&_0x5d2275[_0x4300e5(0x24b)])_0x9910ca=_0x5d2275[_0x4300e5(0x24b)],_0x1d0d3f=_0x1fb0e2[0x0];else return _0x1fb0e2['length']===0x1?(console[_0x4300e5(0x211)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4300e5(0x211)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4300e5(0x211)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x4300e5(0x1ba)),0x1);}_0x5d2275['verbose']&&(console[_0x4300e5(0x211)](_0x4300e5(0x179)+_0x9910ca),console[_0x4300e5(0x211)](_0x4300e5(0x15c)+_0x1d0d3f));if(!_0x5d2275[_0x4300e5(0x24d)]){const _0x45ffb7=await confirmKey(_0x4300e5(0x1d1)+_0x1d0d3f+_0x4300e5(0x12f)+_0x9910ca+'\x27?');if(!_0x45ffb7)return console[_0x4300e5(0x211)]('Cancelled'),0x0;}const _0x6b6b87=await withSpinner('Deleting\x20secret...',()=>_0x4dd481['workflow'][_0x4300e5(0x1b2)](_0x9910ca,_0x1d0d3f),{'verbose':_0x5d2275[_0x4300e5(0x1c7)]}),_0x5808c2=_0x6b6b87[_0x4300e5(0x102)];return console[_0x4300e5(0x211)](_0x4300e5(0x189)+_0x5808c2[_0x4300e5(0x1db)]+_0x4300e5(0x1c6)+_0x5808c2[_0x4300e5(0x169)]+'\x27'),(_0x5d2275[_0x4300e5(0x184)]||_0x5d2275[_0x4300e5(0x1a9)])&&await handleSingleObjectOutput(_0x5808c2,_0x5d2275),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(_0x2fce3c){const _0x2d239c=a41_0x5bd115,_0x4bec85=Math[_0x2d239c(0x180)](_0x2fce3c/0x3e8),_0x56b78a=Math[_0x2d239c(0x180)](_0x4bec85/0x3c),_0x505ed8=Math['floor'](_0x56b78a/0x3c),_0x5f4a48=Math[_0x2d239c(0x180)](_0x505ed8/0x18);if(_0x5f4a48>0x0){const _0x363a50=_0x505ed8%0x18;return _0x363a50>0x0?_0x5f4a48+'d\x20'+_0x363a50+'h':_0x5f4a48+'d';}else{if(_0x505ed8>0x0){const _0x920e21=_0x56b78a%0x3c;return _0x920e21>0x0?_0x505ed8+'h\x20'+_0x920e21+'m':_0x505ed8+'h';}else{if(_0x56b78a>0x0){const _0x206ecd=_0x4bec85%0x3c;return _0x206ecd>0x0?_0x56b78a+'m\x20'+_0x206ecd+'s':_0x56b78a+'m';}else return _0x4bec85+'s';}}}function formatTimestamp(_0x2947cd,_0x5b1c91){const _0x1409a4=a41_0x5bd115,_0x101686=new Date(_0x2947cd),_0x2e3dfb=String(_0x101686[_0x1409a4(0x1c1)]())['padStart'](0x2,'0'),_0x3debb3=String(_0x101686[_0x1409a4(0x1c0)]())[_0x1409a4(0x12e)](0x2,'0'),_0x169f13=_0x2e3dfb+':'+_0x3debb3,_0x13af7f=_0x101686[_0x1409a4(0x11a)]()===_0x5b1c91[_0x1409a4(0x11a)]()&&_0x101686['getMonth']()===_0x5b1c91[_0x1409a4(0x1a6)]()&&_0x101686[_0x1409a4(0x196)]()===_0x5b1c91[_0x1409a4(0x196)]();if(_0x13af7f)return _0x169f13;else{const _0x3f43a2=String(_0x101686[_0x1409a4(0x1a6)]()+0x1)['padStart'](0x2,'0'),_0x34e79e=String(_0x101686[_0x1409a4(0x196)]())[_0x1409a4(0x12e)](0x2,'0');return _0x3f43a2+'-'+_0x34e79e+'\x20'+_0x169f13;}}function formatDate(_0xdd6f86){const _0x5d6e1d=a41_0x5bd115,_0x400d67=_0xdd6f86['getFullYear'](),_0x3c729a=String(_0xdd6f86[_0x5d6e1d(0x1a6)]()+0x1)[_0x5d6e1d(0x12e)](0x2,'0'),_0x4cc789=String(_0xdd6f86['getDate']())[_0x5d6e1d(0x12e)](0x2,'0');return _0x400d67+'-'+_0x3c729a+'-'+_0x4cc789;}function getTaskStateIcon(_0x131801){const _0x3de723={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3de723[_0x131801]||'⚪';}function a41_0x1fc3(){const _0x5f288e=['Dry\x20run:\x20yes','3rUJWRx','List\x20workflow\x20attempts','run','stdout','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Files\x20extracted:\x20','createdAt','\x20has\x20no\x20attempts','padStart','\x27\x20from\x20project\x20\x27','MAX_TASKS_DISPLAY','✔\x20New\x20project:\x20','2331400NAmxzU','every','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Filter:\x20project=',',\x20Workflow:\x20','getTime','No\x20matching\x20sessions\x20found','sort','sourceProjectName','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20attempts\x20found\x20in\x20project:\x20','Cancelled','Getting\x20attempt\x20tasks...','MAX_LABEL_COUNT','table','ICON_SPACING','Source:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','dim','Starting\x20workflow\x20run...','type','\x20\x20Source:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','match','targetDir','split','tdx.json','workflow:run','\x20\x20tdx\x20wf\x20use\x20<project>','Force:\x20yes','parse','resolve','delete','Workflow:\x20','No\x20workflow\x20projects\x20found','fs/promises','parseProjectWorkflowPattern','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','revision','Error:','startsWith','Key:\x20','\x20-\x20','MAX_TIMELINE_WIDTH','\x0aDry\x20run\x20-\x20nothing\x20pushed','Error:\x20','List\x20workflows','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','/sessions/','fill','\x20\x20Workflow:\x20','isNewProject','\x20tasks','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','projectName','site','TASK_NAME_WIDTH','write','icon','.\x20Expected\x20format:\x20KEY=VALUE','...','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','value','✔\x20Retry\x20started','\x20\x20Project:\x20','done','round','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','success','\x20from\x20session\x20','Project:\x20','\x20\x20Console:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Error:\x20KEY=VALUE\x20is\x20required','planned','session','index','floor','displayLine','Total:\x20','workflow:workflows','json','max','\x20unchanged','cancelRequested','Downloading\x20project\x20','✔\x20Secret\x20\x27','substring','includeRetried','Error:\x20Attempt\x20ID\x20is\x20required','\x0a✔\x20Already\x20up\x20to\x20date','✔\x20Push\x20complete','project','workflow:use','localeCompare','logFiles','Retrying\x20session...','\x0aPush\x20these\x20changes?','taskName','getDate','projects','resumeFrom','modified','resolveProjectId','\x27...','Validation:\x20skipped','showWorkflowConsoleUrl','\x20\x20Session\x20ID:\x20','Pulling\x20project\x20','attemptId','Select\x20a\x20task\x20to\x20view\x20logs:','running','existingProjectId','tdx\x20wf\x20attempt\x20','all','getMonth','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','No\x20workflows\x20found','jsonl','includeSubtasks','Parameters:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0a⚠\x20Project\x20\x22','Kill\x20a\x20running\x20attempt','Attempt\x20ID:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','📁\x20','deleteSecret','Pattern:\x20','session:','✔\x20Showing\x20','output','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflows\x20found\x20in\x20project:\x20','select','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aPolling...\x20(','✔\x20Found\x20','1677396KHjlLX','\x0aUpdate\x20existing\x20project\x20\x22','force','getMinutes','getHours','set','dryRun','\x20secret','retryAttemptName','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','verbose','green','now','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','navigateSessionsInteractive','text','✔\x20Deleted\x20project\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','filter','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','duration','sessionTime','replace','fromTask','Target:\x20','stat','Expected\x20format:\x20--param\x20key=value','Select\x20a\x20workflow\x20to\x20run','Pushing\x20workflow\x20project...','key','keys','359224ZBjDGJ','summary','lastAttempt','ICON_WIDTH','Project\x20directory:\x20','finishedAt','Session\x20not\x20found:\x20','Loading\x20sessions...','fullName','unknown','red','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','startTime','\x0aApply\x20these\x20changes?','No\x20log\x20files\x20found\x20for\x20this\x20attempt','targetExists','renderTimeline','follow','blue','pending','repeat','applyPullProject','message','/attempt/','Filter:\x20','workflow:upload','Including\x20subtasks:\x20yes','rows','slice','\x20attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Loading\x20session...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Pull\x20complete','POLL_INTERVAL_MS','\x0aClone\x20\x22','Analyzing\x20project...','list','\x20modified','sessionId','LABEL_MIN_SPACING','\x20\x20Attempt\x20ID:\x20','resolveProjectDir','workflow:secrets:delete','start','\x20deleted','workflow','context','isDirectory','workflow:sessions','📋\x20','get','error','newProjectId','Include\x20retried:\x20yes','Key\x20cannot\x20be\x20empty','trimEnd','Target\x20directory:\x20','Killing\x20attempt...','\x20\x20Project\x20ID:\x20','min','Params:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','fileSize','renderSessionsTimeline','path','find','workflow:projects','\x20\x20Location:\x20','No\x20workflow\x20tdx.json\x20found','Downloading\x20logs...','metadata','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','pollTimeline','\x0a✔\x20Attempt\x20complete','basename','No\x20sessions\x20found','MIN_LABEL_COUNT','No\x20log\x20content\x20found','hasChanges','pullProject','updatedAt','description','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','relative','resolveProject','map','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','sessions','GUTTER','execute','newProjectName','workflow:attempts','No\x20attempts\x20found\x20for:\x20','450515WpmBmm','\x0aDry\x20run\x20-\x20no\x20files\x20written','splice','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','name','Reason:\x20','yellow','workflow:timeline','\x20\x20Session\x20context\x20set\x20to:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','retrySession','indexOf','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20of\x20','push','---\x20','workflowProject','generateSessionTimelineRows','yes','workflow:delete','workflowName','isTTY','workflow:attempt','workflow:kill','state','\x22\x20with\x20new\x20revision?','Latest\x20session\x20has\x20no\x20attempt','\x20task','\x22?\x20This\x20cannot\x20be\x20undone.','includes','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','buildTimelineData','Listing\x20workflows...','New\x20project\x20name:\x20','LABEL_WIDTH_DIVISOR','\x22\x20to\x20new\x20project\x20\x22','from','(unknown)','/app/workflows/','Pushing\x20project...','\x22\x20already\x20exists\x20(ID:\x20','length','cyan','renderSingleTimeline','No\x20sessions\x20found\x20for:\x20','log','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Session\x20','group_error','Error:\x20Project\x20name\x20is\x20required','isArray','skipValidation','changes','✔\x20Workflow\x20project\x20context\x20cleared.','MIN_TIMELINE_WIDTH','format','params','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','session_id','1023988ZZKeTa','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','canceling','From\x20task:\x20','Show\x20tasks\x20for\x20an\x20attempt','List\x20workflow\x20execution\x20sessions','deleted','Source\x20directory:\x20','⚠\x20Showing\x20first\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Pull\x20workflow\x20project\x20to\x20local\x20folder','Resume\x20from:\x20','readFile','sourceDir','some','attempts','✔\x20Project\x20updated','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x20new','\x20\x20Changes:\x20','window','has','startedAt','\x20logs','\x1b[1A\x1b[2K','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Invalid\x20JSON\x20in\x20--params','Analyzing\x20changes...','Usage:\x20workflow:delete\x20<project-name-or-id>','No\x20sessions\x20found\x20in\x20project:\x20','Fetching\x20log\x20files...','cwd','Status:\x20','attempt','Revision:\x20','limit','projectId','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20session','No\x20projects\x20match\x20pattern:\x20','data','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Listing\x20workflow\x20attempts...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','clear','msPerChar','sys','✔\x20Clone\x20complete','attempt:','toLowerCase','toISOString','🔄\x20','✔\x20Workflow\x20run\x20started','Project\x20name\x20is\x20required','285210EpfuWy','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','requireProject','\x20\x20Target:\x20','workflow:download','end','workflows','\x20\x20Revision:\x20','executePushProject','prepareCloneProject','getFullYear','Attempt:\x20','join','diff','trim','Resolving\x20project\x20\x27','463760PkwFAg','Listing\x20workflow\x20sessions...','Session\x20time:\x20','workflow:clone'];a41_0x1fc3=function(){return _0x5f288e;};return a41_0x1fc3();}function getBarChar(_0x285ad1){const _0x4566bf=a41_0x5bd115;return _0x285ad1==='error'||_0x285ad1===_0x4566bf(0xcf)?'×':'─';}function getBarColor(_0xf32be2){const _0x1e18c3=a41_0x5bd115,_0xb9a9c8={'success':a41_0x542931[_0x1e18c3(0x1c8)],'error':a41_0x542931[_0x1e18c3(0x1e7)],'group_error':a41_0x542931[_0x1e18c3(0x1e7)],'running':a41_0x542931[_0x1e18c3(0x1ef)],'blocked':a41_0x542931[_0x1e18c3(0x241)],'planned':a41_0x542931[_0x1e18c3(0x145)],'canceling':a41_0x542931[_0x1e18c3(0x241)]};return _0xb9a9c8[_0xf32be2]||a41_0x542931['white'];}function parseTaskName(_0x5e9ef6){const _0x3e648a=a41_0x5bd115;let _0x4cadf0=_0x5e9ef6[_0x3e648a(0x1d4)](/^\++/,'');const _0x5db20c=_0x4cadf0[_0x3e648a(0x14c)]('+'),_0xbdbcaf=_0x5db20c[_0x3e648a(0xc8)]>0x1?_0x5db20c[_0x3e648a(0xc8)]-0x2:0x0,_0x30fb75=_0x5db20c[_0x5db20c['length']-0x1]||_0x4cadf0;return{'level':_0xbdbcaf,'name':'+'+_0x30fb75};}function truncateTaskName(_0x5ce3aa,_0x35992f){const _0x452762=a41_0x5bd115,_0x59f92f=stringWidth(_0x5ce3aa);if(_0x59f92f<=_0x35992f)return _0x5ce3aa;let _0x1f8ecf=_0x5ce3aa;while(stringWidth(_0x1f8ecf+'…')>_0x35992f&&_0x1f8ecf[_0x452762(0xc8)]>0x0){_0x1f8ecf=_0x1f8ecf[_0x452762(0x1f9)](0x0,-0x1);}return _0x1f8ecf+'…';}function calculateTimeScale(_0x488546,_0x52c025){const _0x2e6b1c=a41_0x5bd115;return{'startTime':_0x488546[_0x2e6b1c(0x209)],'endTime':_0x488546['end'],'durationMs':_0x488546['duration'],'msPerChar':_0x488546['duration']/_0x52c025};}function timeToPosition(_0xa5a1f9,_0x5b1aa6,_0x1dafcb){const _0x2e7b74=a41_0x5bd115,_0x179df7=_0xa5a1f9-_0x5b1aa6[_0x2e7b74(0x1e9)],_0x13e452=Math[_0x2e7b74(0x180)](_0x179df7/_0x5b1aa6[_0x2e7b74(0x107)]);return Math[_0x2e7b74(0x185)](0x0,Math[_0x2e7b74(0x219)](_0x13e452,_0x1dafcb));}function renderTimeAxis(_0x649791,_0x41af3a){const _0x2b4346=a41_0x5bd115,_0x387e37=Math[_0x2b4346(0x219)](TIMELINE_CONFIG[_0x2b4346(0x140)],Math[_0x2b4346(0x185)](TIMELINE_CONFIG[_0x2b4346(0x22a)],Math[_0x2b4346(0x180)](_0x41af3a/TIMELINE_CONFIG[_0x2b4346(0xc1)]))),_0x4b457b=_0x649791['durationMs']/(_0x387e37-0x1),_0x4231d1=new Date(_0x649791[_0x2b4346(0x1e9)]),_0x37c7d1=[];for(let _0xa9113=0x0;_0xa9113<_0x387e37;_0xa9113++){const _0x5b9a6b=_0x649791['startTime']+_0xa9113*_0x4b457b,_0x2d4784=timeToPosition(_0x5b9a6b,_0x649791,_0x41af3a),_0x4aa026=formatTimestamp(_0x5b9a6b,_0x4231d1);_0x37c7d1[_0x2b4346(0x249)]({'pos':_0x2d4784,'text':_0x4aa026});}const _0x2a5283=new Array(_0x41af3a)[_0x2b4346(0x164)]('\x20');let _0xfcf407=-0x1;for(const {pos:_0x36a595,text:_0x44e9f4}of _0x37c7d1){let _0x2136c5=Math[_0x2b4346(0x185)](0x0,_0x36a595-Math[_0x2b4346(0x180)](_0x44e9f4[_0x2b4346(0xc8)]/0x2));_0x2136c5<=_0xfcf407+TIMELINE_CONFIG[_0x2b4346(0x205)]&&(_0x2136c5=_0xfcf407+TIMELINE_CONFIG[_0x2b4346(0x205)]+0x1);_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]>_0x41af3a&&(_0x2136c5=_0x41af3a-_0x44e9f4[_0x2b4346(0xc8)]);if(_0x2136c5>=0x0&&_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]<=_0x41af3a&&_0x2136c5>_0xfcf407){for(let _0xf7af7e=0x0;_0xf7af7e<_0x44e9f4[_0x2b4346(0xc8)];_0xf7af7e++){_0x2a5283[_0x2136c5+_0xf7af7e]=_0x44e9f4[_0xf7af7e];}_0xfcf407=_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]-0x1;}}return _0x2a5283[_0x2b4346(0x11c)]('');}function renderTaskRow(_0x4edcfb,_0x3fcc7a,_0x4f11d8,_0xa293ca){const _0x5b49b7=a41_0x5bd115,{level:_0x645ff4,name:_0x37efd2}=parseTaskName(_0x4edcfb[_0x5b49b7(0x23f)]),_0x1bb955='\x20'['repeat'](_0x645ff4),_0x32f318=_0x4edcfb['window']?'('+formatElapsed(_0x4edcfb[_0x5b49b7(0xee)]['duration'])+')':'',_0x4b485d=stringWidth(_0x32f318),_0x2fd234=_0x645ff4*0x1,_0x59d788=_0xa293ca-_0x2fd234-_0x4b485d-0x1,_0x13b638=truncateTaskName(_0x37efd2,_0x59d788),_0xc5c86a=_0x1bb955+_0x13b638,_0x51e0d1=stringWidth(_0xc5c86a),_0x16edd0=_0xa293ca-_0x51e0d1-_0x4b485d,_0x2f941e=_0xc5c86a+'\x20'['repeat'](Math['max'](0x1,_0x16edd0))+a41_0x542931[_0x5b49b7(0x145)](_0x32f318),_0x103292=getTaskStateIcon(_0x4edcfb[_0x5b49b7(0xb7)]),_0x948917=new Array(_0x4f11d8)[_0x5b49b7(0x164)]('\x20');if(_0x4edcfb[_0x5b49b7(0xee)]){const _0x403679=timeToPosition(_0x4edcfb[_0x5b49b7(0xee)][_0x5b49b7(0x209)],_0x3fcc7a,_0x4f11d8),_0x450696=timeToPosition(_0x4edcfb[_0x5b49b7(0xee)][_0x5b49b7(0x115)],_0x3fcc7a,_0x4f11d8),_0x50a546=getBarChar(_0x4edcfb[_0x5b49b7(0xb7)]),_0x203b1e=Math[_0x5b49b7(0x185)](_0x403679+0x1,_0x450696);for(let _0x3a71de=_0x403679;_0x3a71de<Math[_0x5b49b7(0x219)](_0x203b1e,_0x4f11d8);_0x3a71de++){_0x948917[_0x3a71de]=_0x50a546;}}const _0x584cac=getBarColor(_0x4edcfb[_0x5b49b7(0xb7)]),_0xeaf526=_0x948917['map'](_0x2d9693=>_0x2d9693==='\x20'?'\x20':_0x584cac(_0x2d9693))[_0x5b49b7(0x11c)]('');return _0x103292+'\x20'+_0x2f941e+'│'+_0xeaf526+'│';}function calculateStats(_0x389e27){const _0x195eb6=a41_0x5bd115,_0x252149={'total':_0x389e27[_0x195eb6(0xc8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4656c6 of _0x389e27){if(_0x4656c6[_0x195eb6(0xb7)]===_0x195eb6(0x177))_0x252149[_0x195eb6(0x177)]++;else{if(_0x4656c6['state']===_0x195eb6(0x211)||_0x4656c6[_0x195eb6(0xb7)]==='group_error')_0x252149[_0x195eb6(0x211)]++;else _0x4656c6['state']===_0x195eb6(0x1a2)?_0x252149['running']++:_0x252149[_0x195eb6(0x1f0)]++;}}return _0x252149;}function formatStats(_0x578a56){const _0x1d2bfe=a41_0x5bd115;return[_0x1d2bfe(0x182)+_0x578a56['total'],'✅\x20'+_0x578a56[_0x1d2bfe(0x177)],'❌\x20'+_0x578a56[_0x1d2bfe(0x211)],_0x1d2bfe(0x10d)+_0x578a56[_0x1d2bfe(0x1a2)],'⏳\x20'+_0x578a56[_0x1d2bfe(0x1f0)]][_0x1d2bfe(0x11c)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x242);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x111);async[a41_0x5bd115(0x237)](_0x1a1a01){const _0x44f49e=a41_0x5bd115,{options:_0x59a61f,args:_0x36e610,tdx:_0x1f8da7}=_0x1a1a01;let _0x5ad96b,_0x13717c,_0x4297e2=![];if(_0x36e610[0x0]){if(_0x36e610[0x0][_0x44f49e(0xbc)]('.')){const _0x32cef9=this['parseProjectWorkflowPattern'](_0x36e610,_0x59a61f);if(!_0x32cef9)return 0x1;_0x5ad96b=_0x32cef9[_0x44f49e(0x169)],_0x13717c=_0x32cef9[_0x44f49e(0x24f)];}else{_0x13717c=_0x36e610[0x0],_0x5ad96b=_0x59a61f[_0x44f49e(0x24b)];if(!_0x5ad96b)return console['error'](a41_0x542931[_0x44f49e(0x1e7)]('Error:'),_0x44f49e(0x225)),0x1;_0x4297e2=!![];}}else{const _0x2f8828=this[_0x44f49e(0x157)](_0x36e610,_0x59a61f);if(!_0x2f8828)return 0x1;_0x5ad96b=_0x2f8828[_0x44f49e(0x169)],_0x13717c=_0x2f8828['workflowName'];}if(_0x59a61f[_0x44f49e(0x1c7)]){if(_0x5ad96b&&_0x13717c)console[_0x44f49e(0x211)](_0x44f49e(0x1f5)+_0x5ad96b+'.'+_0x13717c);else _0x5ad96b&&console[_0x44f49e(0x211)](_0x44f49e(0x135)+_0x5ad96b);}const _0x19b8a2=_0x59a61f[_0x44f49e(0x1a0)],_0x586d22=_0x59a61f[_0x44f49e(0x204)];if(_0x19b8a2){_0x586d22&&console['error'](a41_0x542931[_0x44f49e(0x241)]('Warning:'),_0x44f49e(0x170));const _0x52578a=_0x59a61f[_0x44f49e(0x1ee)];return _0x52578a?await this['pollTimeline'](_0x1a1a01,_0x19b8a2):await this['renderSingleTimeline'](_0x1a1a01,_0x19b8a2,_0x59a61f),0x0;}if(_0x586d22){const _0x3e3379=await withSpinner(_0x44f49e(0x1fc),()=>_0x1f8da7[_0x44f49e(0x20b)][_0x44f49e(0x235)]({'projectName':_0x5ad96b,'workflowName':_0x13717c,'limit':0x64}),{'verbose':_0x59a61f[_0x44f49e(0x1c7)]}),_0x307309=_0x3e3379[_0x44f49e(0x102)][_0x44f49e(0x21f)](_0x1ae679=>_0x1ae679['id']===_0x586d22);if(!_0x307309)return console[_0x44f49e(0x211)](a41_0x542931['red'](_0x44f49e(0x15a)),_0x44f49e(0x1e3)+_0x586d22),0x1;if(!_0x307309[_0x44f49e(0x1df)]?.['id'])return console[_0x44f49e(0x211)](a41_0x542931[_0x44f49e(0x1e7)](_0x44f49e(0x15a)),_0x44f49e(0xce)+_0x586d22+_0x44f49e(0x12d)),0x1;const _0x2fb1de=_0x307309[_0x44f49e(0x1df)]['id'];_0x59a61f[_0x44f49e(0x1c7)]&&console[_0x44f49e(0x211)]('Using\x20attempt\x20'+_0x2fb1de+_0x44f49e(0x178)+_0x586d22);const _0x3c3797=_0x59a61f[_0x44f49e(0x1ee)];return _0x3c3797?await this['pollTimeline'](_0x1a1a01,_0x2fb1de):await this[_0x44f49e(0xca)](_0x1a1a01,_0x2fb1de,_0x59a61f),0x0;}const _0xb9d1a0=await withSpinner(_0x44f49e(0x1e4),()=>_0x1f8da7[_0x44f49e(0x20b)][_0x44f49e(0x235)]({'projectName':_0x5ad96b,'workflowName':_0x13717c,'limit':_0x59a61f[_0x44f49e(0xfd)]||0x32}),{'verbose':_0x59a61f['verbose']}),_0x4c6304=_0xb9d1a0['data'];if(_0x4c6304[_0x44f49e(0xc8)]===0x0){if(_0x5ad96b&&_0x13717c)console[_0x44f49e(0x211)](_0x44f49e(0xcb)+_0x5ad96b+'.'+_0x13717c);else _0x5ad96b?console[_0x44f49e(0x211)](_0x44f49e(0xf7)+_0x5ad96b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x44f49e(0x211)](a41_0x542931[_0x44f49e(0x145)](_0x44f49e(0xd8))));return 0x0;}_0x4c6304[_0x44f49e(0x139)]((_0x2882f5,_0x22fc6c)=>{const _0x1afba3=_0x44f49e,_0x4e6e3b=_0x2882f5[_0x1afba3(0x1d3)]||'',_0x906459=_0x22fc6c[_0x1afba3(0x1d3)]||'';return _0x906459[_0x1afba3(0x191)](_0x4e6e3b);});if(_0x59a61f[_0x44f49e(0x184)]||_0x59a61f[_0x44f49e(0x1a9)])return await handleSDKOutput(_0x4c6304,_0x59a61f),0x0;let _0x180644;if(_0x4297e2){const _0x5be066=_0x4c6304[0x0];if(!_0x5be066['lastAttempt']?.['id'])return console[_0x44f49e(0x211)](_0x44f49e(0xb9)),0x0;_0x180644=_0x5be066[_0x44f49e(0x1df)]['id'],_0x59a61f[_0x44f49e(0x1c7)]&&console[_0x44f49e(0x211)]('Auto-selected\x20latest\x20session:\x20'+_0x5be066[_0x44f49e(0x1d3)]);}else{const _0x2493e8=_0x4c6304[_0x44f49e(0x233)](_0x6a4878=>{const _0x1c47b3=_0x44f49e,_0xebfd5f=getAttemptStatusDisplay(_0x6a4878[_0x1c47b3(0x1df)]);return{'title':_0x6a4878['project']?.[_0x1c47b3(0x23f)]+'.'+_0x6a4878['workflow']?.[_0x1c47b3(0x23f)]+_0x1c47b3(0x15d)+_0x6a4878[_0x1c47b3(0x1d3)]+'\x20'+_0xebfd5f[_0x1c47b3(0x16d)],'value':_0x6a4878[_0x1c47b3(0x1df)]?.['id']||'','description':_0xebfd5f[_0x1c47b3(0x1cc)]};}),_0x3bb51f=await a41_0x2444a6({'type':_0x44f49e(0x1b9),'name':_0x44f49e(0x1a0),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2493e8['filter'](_0x464188=>_0x464188[_0x44f49e(0x171)]!=='')});if(!_0x3bb51f[_0x44f49e(0x1a0)])return 0x0;_0x180644=_0x3bb51f[_0x44f49e(0x1a0)];}const _0x4a8e76=_0x59a61f[_0x44f49e(0x1ee)];return _0x4a8e76?await this[_0x44f49e(0x226)](_0x1a1a01,_0x180644):await this['renderSingleTimeline'](_0x1a1a01,_0x180644,_0x59a61f),0x0;}async[a41_0x5bd115(0xca)](_0x2a5baf,_0x30aeea,_0x308be5){const _0x558a73=a41_0x5bd115,{tdx:_0x30048f}=_0x2a5baf;let _0x16b42f,_0x56e23b;try{[_0x16b42f,_0x56e23b]=await Promise[_0x558a73(0x1a5)]([_0x30048f[_0x558a73(0x20b)][_0x558a73(0xfb)](_0x30aeea),_0x30048f[_0x558a73(0x20b)][_0x558a73(0x129)](_0x30aeea,![])]);}catch(_0x117c5b){console['error'](a41_0x542931[_0x558a73(0x1e7)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x308be5[_0x558a73(0x1c7)]&&console[_0x558a73(0x211)](_0x117c5b);throw _0x117c5b;}if(_0x308be5[_0x558a73(0x184)]||_0x308be5[_0x558a73(0x1a9)]){const _0x342b82=this[_0x558a73(0xbe)](_0x16b42f,_0x56e23b);await handleSDKOutput([_0x342b82],_0x308be5);return;}const _0x644b73=_0x30048f['context']['site'],_0x8b96f6=this[_0x558a73(0x1ed)](_0x16b42f,_0x56e23b,_0x644b73);console['log'](_0x8b96f6);}async[a41_0x5bd115(0x226)](_0x3ade28,_0x3bb892){const _0x406082=a41_0x5bd115,{tdx:_0x5015b4}=_0x3ade28,_0x5746e2=TIMELINE_CONFIG[_0x406082(0x1ff)],_0x44962e=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x134fd1=0x0;while(_0x134fd1<_0x44962e){process[_0x406082(0x128)][_0x406082(0x250)]&&process['stdout'][_0x406082(0x16c)]('\x1bc');let _0x46b331,_0x576811;try{[_0x46b331,_0x576811]=await Promise[_0x406082(0x1a5)]([_0x5015b4[_0x406082(0x20b)][_0x406082(0xfb)](_0x3bb892),_0x5015b4[_0x406082(0x20b)][_0x406082(0x129)](_0x3bb892,![])]);}catch(_0x3cc88f){console[_0x406082(0x211)](a41_0x542931[_0x406082(0x1e7)](_0x406082(0x1ce)));_0x134fd1>0x0&&console[_0x406082(0x211)](a41_0x542931[_0x406082(0x145)](_0x406082(0x1ac)+_0x134fd1));throw _0x3cc88f;}const _0x401d4a=_0x5015b4[_0x406082(0x20c)]['site'],_0xe31f54=this[_0x406082(0x1ed)](_0x46b331,_0x576811,_0x401d4a);console[_0x406082(0xcc)](_0xe31f54);const _0x378815=_0x46b331[_0x406082(0x174)]&&_0x576811[_0x406082(0x133)](_0x352361=>_0x352361[_0x406082(0xb7)]!=='running'&&_0x352361['state']!==_0x406082(0x17d));if(_0x378815){console[_0x406082(0x211)](a41_0x542931['green'](_0x406082(0x227)));break;}console['error'](a41_0x542931[_0x406082(0x145)](_0x406082(0x1bb)+_0x134fd1*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x2171e7=>setTimeout(_0x2171e7,_0x5746e2)),_0x134fd1++;}_0x134fd1>=_0x44962e&&console['error'](a41_0x542931[_0x406082(0x241)](_0x406082(0x103)));}[a41_0x5bd115(0x1ed)](_0x30ac0d,_0x2c9207,_0x1d6e3e){const _0x5c7821=a41_0x5bd115,_0x1dddfd=[],_0x1e2b19=TIMELINE_CONFIG[_0x5c7821(0x16b)],_0x185737=0x5,_0x5a1156=process[_0x5c7821(0x128)]['columns']||0x78,_0x195dff=_0x5a1156-_0x1e2b19-_0x185737,_0xb85281=Math[_0x5c7821(0x185)](TIMELINE_CONFIG[_0x5c7821(0xd5)],Math[_0x5c7821(0x219)](_0x195dff,TIMELINE_CONFIG[_0x5c7821(0x15e)])),_0x133994=new Date(_0x30ac0d[_0x5c7821(0x12c)])[_0x5c7821(0x137)](),_0x360134=_0x30ac0d[_0x5c7821(0x1e2)]?new Date(_0x30ac0d[_0x5c7821(0x1e2)])[_0x5c7821(0x137)]():Date[_0x5c7821(0x1c9)](),_0x3e1183={'start':_0x133994,'end':_0x360134,'duration':_0x360134-_0x133994},_0x51e106=new Map(),_0x3397fd=[];for(const _0x5a2830 of _0x2c9207){if(_0x5a2830[_0x5c7821(0xf0)]){const _0x5dd905=new Date(_0x5a2830[_0x5c7821(0xf0)])[_0x5c7821(0x137)](),_0x696b64=_0x5a2830[_0x5c7821(0x22e)]?new Date(_0x5a2830[_0x5c7821(0x22e)])['getTime']():Date[_0x5c7821(0x1c9)](),_0x5a2ffe={'start':_0x5dd905,'end':_0x696b64,'duration':_0x696b64-_0x5dd905};_0x51e106[_0x5c7821(0x1c2)](_0x5a2830['id'],_0x5a2ffe),_0x3397fd['push']({'name':_0x5a2830[_0x5c7821(0x1e5)],'state':_0x5a2830[_0x5c7821(0xb7)]||'unknown','window':_0x5a2ffe});}else _0x3397fd[_0x5c7821(0x249)]({'name':_0x5a2830[_0x5c7821(0x1e5)],'state':_0x5a2830[_0x5c7821(0xb7)]||_0x5c7821(0x17d),'window':undefined});}_0x3397fd['sort']((_0x229a55,_0x5bbdc5)=>{const _0x4c56bd=_0x5c7821;if(!_0x229a55[_0x4c56bd(0xee)])return 0x1;if(!_0x5bbdc5[_0x4c56bd(0xee)])return-0x1;return _0x229a55[_0x4c56bd(0xee)][_0x4c56bd(0x209)]-_0x5bbdc5[_0x4c56bd(0xee)]['start'];});const _0xf13b5f=_0x3397fd['length'],_0x1172f9=_0xf13b5f>TIMELINE_CONFIG[_0x5c7821(0x130)];_0x1172f9&&_0x3397fd[_0x5c7821(0x23d)](TIMELINE_CONFIG[_0x5c7821(0x130)]);const _0x860d31=calculateTimeScale(_0x3e1183,_0xb85281),_0x14f6f7=_0x30ac0d[_0x5c7821(0x174)]?_0x30ac0d[_0x5c7821(0x177)]?a41_0x542931[_0x5c7821(0x1c8)](_0x5c7821(0x177)):a41_0x542931['red'](_0x5c7821(0x211)):a41_0x542931['blue'](_0x5c7821(0x1a2)),_0x588028=_0x30ac0d[_0x5c7821(0x18f)]?.['id'],_0x35f9dd=_0x30ac0d[_0x5c7821(0x204)];let _0x3e9dd1;if(_0x588028&&_0x35f9dd){const _0x261ede=getWorkflowAttemptUrl(_0x1d6e3e,_0x588028,_0x35f9dd,_0x30ac0d['id']);_0x3e9dd1=hyperlink(a41_0x542931['dim'](_0x30ac0d['id']),_0x261ede);}else _0x3e9dd1=a41_0x542931['dim'](_0x30ac0d['id']);_0x1dddfd[_0x5c7821(0x249)](_0x5c7821(0x11b)+_0x3e9dd1+_0x5c7821(0x15d)+_0x14f6f7+_0x5c7821(0x15d)+formatElapsed(_0x3e1183[_0x5c7821(0x1d2)]));if(_0x3397fd[_0x5c7821(0xc8)]>0x0){const _0x51bcc7=renderTimeAxis(_0x860d31,_0xb85281),_0x4d83c6=new Date(_0x3e1183['start']),_0x392e9b=formatDate(_0x4d83c6),_0x18f55f=TIMELINE_CONFIG[_0x5c7821(0x1e0)]+TIMELINE_CONFIG[_0x5c7821(0x142)]+_0x1e2b19,_0x447ed8=_0x392e9b[_0x5c7821(0x12e)](_0x18f55f),_0x14cf28=a41_0x542931[_0x5c7821(0x145)](_0x447ed8);_0x1dddfd['push'](_0x14cf28+'\x20'+_0x51bcc7);for(const _0x23920e of _0x3397fd){_0x1dddfd[_0x5c7821(0x249)](renderTaskRow(_0x23920e,_0x860d31,_0xb85281,_0x1e2b19));}const _0x409caf=calculateStats(_0x3397fd);_0x1dddfd['push'](formatStats(_0x409caf)),_0x1172f9&&_0x1dddfd[_0x5c7821(0x249)](a41_0x542931[_0x5c7821(0x241)](_0x5c7821(0xe2)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5c7821(0x248)+_0xf13b5f+_0x5c7821(0x167))),_0x1dddfd[_0x5c7821(0x249)](''),_0x1dddfd['push'](a41_0x542931['dim']('💡\x20Tip:\x20Use\x20')+(_0x5c7821(0x1a4)+_0x30ac0d['id']+_0x5c7821(0xf1))+a41_0x542931[_0x5c7821(0x145)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1dddfd['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1dddfd[_0x5c7821(0x11c)]('\x0a');}[a41_0x5bd115(0xbe)](_0x529f6d,_0x370042){const _0x423ec1=a41_0x5bd115,_0x3ed891=new Date(_0x529f6d[_0x423ec1(0x12c)])['getTime'](),_0x4c5f68=_0x529f6d[_0x423ec1(0x1e2)]?new Date(_0x529f6d[_0x423ec1(0x1e2)])[_0x423ec1(0x137)]():Date[_0x423ec1(0x1c9)](),_0x2f5b33=_0x4c5f68-_0x3ed891,_0x22b333=[];for(const _0x3ef3c2 of _0x370042){if(_0x3ef3c2[_0x423ec1(0xf0)]){const _0x335fa8=new Date(_0x3ef3c2[_0x423ec1(0xf0)])['getTime'](),_0x11e692=_0x3ef3c2[_0x423ec1(0x22e)]?new Date(_0x3ef3c2[_0x423ec1(0x22e)])[_0x423ec1(0x137)]():Date['now']();_0x22b333[_0x423ec1(0x249)]({'name':_0x3ef3c2[_0x423ec1(0x1e5)],'state':_0x3ef3c2[_0x423ec1(0xb7)]||_0x423ec1(0x1e6),'window':{'start':_0x335fa8,'end':_0x11e692,'duration':_0x11e692-_0x335fa8}});}else _0x22b333['push']({'name':_0x3ef3c2[_0x423ec1(0x1e5)],'state':_0x3ef3c2[_0x423ec1(0xb7)]||_0x423ec1(0x17d),'window':undefined});}const _0x1b9909=calculateStats(_0x22b333);return{'attempt':{'id':_0x529f6d['id'],'status':_0x529f6d[_0x423ec1(0x174)]?_0x529f6d[_0x423ec1(0x177)]?_0x423ec1(0x177):'error':_0x423ec1(0x1a2),'createdAt':_0x529f6d[_0x423ec1(0x12c)],'finishedAt':_0x529f6d[_0x423ec1(0x1e2)],'duration_ms':_0x2f5b33},'tasks':_0x22b333[_0x423ec1(0x233)](_0x5cd957=>({'name':_0x5cd957[_0x423ec1(0x23f)],'state':_0x5cd957[_0x423ec1(0xb7)],'startedAt':_0x5cd957[_0x423ec1(0xee)]?new Date(_0x5cd957[_0x423ec1(0xee)]['start'])[_0x423ec1(0x10c)]():null,'updatedAt':_0x5cd957['window']?new Date(_0x5cd957[_0x423ec1(0xee)][_0x423ec1(0x115)])[_0x423ec1(0x10c)]():null,'duration_ms':_0x5cd957['window']?.[_0x423ec1(0x1d2)]||null})),'stats':_0x1b9909};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2bfa1f,_0x55929f){const _0x1410aa=a42_0x22f3,_0x359bd3=_0x2bfa1f();while(!![]){try{const _0x17f9d0=-parseInt(_0x1410aa(0xdc))/0x1*(parseInt(_0x1410aa(0xdd))/0x2)+-parseInt(_0x1410aa(0xd0))/0x3+-parseInt(_0x1410aa(0xdb))/0x4+-parseInt(_0x1410aa(0xd1))/0x5*(-parseInt(_0x1410aa(0xd8))/0x6)+-parseInt(_0x1410aa(0xd3))/0x7*(-parseInt(_0x1410aa(0xd6))/0x8)+parseInt(_0x1410aa(0xcf))/0x9+parseInt(_0x1410aa(0xd5))/0xa;if(_0x17f9d0===_0x55929f)break;else _0x359bd3['push'](_0x359bd3['shift']());}catch(_0x37e364){_0x359bd3['push'](_0x359bd3['shift']());}}}(a42_0x282c,0x306e1));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x22f3(_0x4794ce,_0xc48179){_0x4794ce=_0x4794ce-0xcf;const _0x282c4f=a42_0x282c();let _0x22f35f=_0x282c4f[_0x4794ce];return _0x22f35f;}export function getUserAgent(){const _0x2c7da0=a42_0x22f3,_0x56d1ec=getVersion(),_0x2b6490=platform(),_0x4a2356=process['version'][_0x2c7da0(0xd2)]('v','');return'tdx/'+_0x56d1ec+'\x20('+_0x2b6490+_0x2c7da0(0xd9)+_0x4a2356+')';}function a42_0x282c(){const _0x99ac60=['TD1\x20','1221748sMCeAk','77933TNxbWb','10qfvszb','X-Trino-User','524385bolmGf','122448zKllVL','11065aidYmq','replace','91Emyofi','Authorization','2804240lYIhjB','135008QeHlrB','length','1020UZGOYE',';\x20node/'];a42_0x282c=function(){return _0x99ac60;};return a42_0x282c();}export function getAuthHeaders(_0x418da5,_0x5acc30){const _0x4a660c=a42_0x22f3,_0x41c234=getVersion(),_0x1513a1={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x41c234};return _0x5acc30&&(_0x1513a1[_0x4a660c(0xd4)]=_0x4a660c(0xda)+_0x5acc30),_0x1513a1;}export function toHeaderRecord(_0xfbff04){const _0x2d8dd0={};for(const [_0xdd0279,_0x5a2a39]of Object['entries'](_0xfbff04)){_0x5a2a39!==undefined&&(_0x2d8dd0[_0xdd0279]=_0x5a2a39);}return _0x2d8dd0;}export function getTrinoHeaders(_0x5e509b,_0xb36611){const _0x20c705=a42_0x22f3,_0x46d095=getAuthHeaders(_0x5e509b,_0xb36611),_0x338e8f=toHeaderRecord(_0x46d095);return delete _0x338e8f['Authorization'],_0xb36611&&(_0x338e8f[_0x20c705(0xde)]=_0xb36611),_0x338e8f;}export function hasAPIKey(_0x34760c){const _0x2a8343=a42_0x22f3,_0x445c5f=getAPIKey(_0x34760c);return _0x445c5f!==undefined&&_0x445c5f[_0x2a8343(0xd7)]>0x0;}
1
+ (function(_0x3a0c21,_0x357941){const _0x583cdf=a42_0x5086,_0x2a7fd0=_0x3a0c21();while(!![]){try{const _0x3f9a17=parseInt(_0x583cdf(0x126))/0x1+-parseInt(_0x583cdf(0x128))/0x2+parseInt(_0x583cdf(0x12d))/0x3+-parseInt(_0x583cdf(0x136))/0x4*(parseInt(_0x583cdf(0x12f))/0x5)+parseInt(_0x583cdf(0x135))/0x6+-parseInt(_0x583cdf(0x12a))/0x7+parseInt(_0x583cdf(0x12e))/0x8*(parseInt(_0x583cdf(0x134))/0x9);if(_0x3f9a17===_0x357941)break;else _0x2a7fd0['push'](_0x2a7fd0['shift']());}catch(_0x5acef7){_0x2a7fd0['push'](_0x2a7fd0['shift']());}}}(a42_0x27e2,0x3b8fe));function a42_0x5086(_0x347ce8,_0x4c1125){_0x347ce8=_0x347ce8-0x126;const _0x27e2d=a42_0x27e2();let _0x50863d=_0x27e2d[_0x347ce8];return _0x50863d;}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a42_0x27e2(){const _0xc10ba4=['2083256eiKnHW','tdx/',';\x20node/','624075wTaGrY','16KcEdeg','5CeyyzP','Authorization','entries','TD1\x20','version','1645191HFVxGo','539250WjhTum','783024eSdoVW','293875MSKSAV','length','440086eDjfei','tdx'];a42_0x27e2=function(){return _0xc10ba4;};return a42_0x27e2();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2b1b29=a42_0x5086,_0x3a12fc=getVersion(),_0x4d8d09=platform(),_0x39c3e1=process[_0x2b1b29(0x133)]['replace']('v','');return _0x2b1b29(0x12b)+_0x3a12fc+'\x20('+_0x4d8d09+_0x2b1b29(0x12c)+_0x39c3e1+')';}export function getAuthHeaders(_0x5c26f5,_0x131aaa){const _0x11590e=a42_0x5086,_0xa4b585=getVersion(),_0x3082d8={'User-Agent':getUserAgent(),'X-TD-Client':_0x11590e(0x129),'X-TD-Client-Version':_0xa4b585};return _0x131aaa&&(_0x3082d8[_0x11590e(0x130)]=_0x11590e(0x132)+_0x131aaa),_0x3082d8;}export function toHeaderRecord(_0x5bc347){const _0x1cf27f=a42_0x5086,_0x495fdc={};for(const [_0x1dfbe5,_0x344b91]of Object[_0x1cf27f(0x131)](_0x5bc347)){_0x344b91!==undefined&&(_0x495fdc[_0x1dfbe5]=_0x344b91);}return _0x495fdc;}export function getTrinoHeaders(_0x32ac24,_0xe58d04){const _0xc3497e=a42_0x5086,_0x598497=getAuthHeaders(_0x32ac24,_0xe58d04),_0x2bded5=toHeaderRecord(_0x598497);return delete _0x2bded5[_0xc3497e(0x130)],_0xe58d04&&(_0x2bded5['X-Trino-User']=_0xe58d04),_0x2bded5;}export function hasAPIKey(_0x20d9d6){const _0x4b4c3d=a42_0x5086,_0x445471=getAPIKey(_0x20d9d6);return _0x445471!==undefined&&_0x445471[_0x4b4c3d(0x127)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x16f6e9,_0x155b9f){const _0x4c05b7=a43_0xaa61,_0x5010f9=_0x16f6e9();while(!![]){try{const _0x4fdb10=parseInt(_0x4c05b7(0x20c))/0x1*(parseInt(_0x4c05b7(0x1f5))/0x2)+parseInt(_0x4c05b7(0x214))/0x3+-parseInt(_0x4c05b7(0x1f4))/0x4+-parseInt(_0x4c05b7(0x222))/0x5*(parseInt(_0x4c05b7(0x1fb))/0x6)+-parseInt(_0x4c05b7(0x1e4))/0x7+parseInt(_0x4c05b7(0x1fa))/0x8*(parseInt(_0x4c05b7(0x201))/0x9)+parseInt(_0x4c05b7(0x206))/0xa*(parseInt(_0x4c05b7(0x200))/0xb);if(_0x4fdb10===_0x155b9f)break;else _0x5010f9['push'](_0x5010f9['shift']());}catch(_0x2ee247){_0x5010f9['push'](_0x5010f9['shift']());}}}(a43_0x2f3b,0x77357));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 a43_0x36abf7 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x571578){const _0x28f3ff=a43_0xaa61;return _0x571578[_0x28f3ff(0x229)]==='json'||_0x571578[_0x28f3ff(0x229)]===_0x28f3ff(0x221)||_0x571578[_0x28f3ff(0x229)]===_0x28f3ff(0x1e7)||_0x571578[_0x28f3ff(0x229)]==='table'||_0x571578[_0x28f3ff(0x217)]===!![]||_0x571578[_0x28f3ff(0x221)]===!![]||_0x571578[_0x28f3ff(0x1e7)]===!![]||_0x571578[_0x28f3ff(0x1e5)]===!![];}export function parseOutputOptions(_0x331ee9){const _0x6e03ab=a43_0xaa61;return{'format':_0x331ee9[_0x6e03ab(0x229)]||_0x6e03ab(0x1e5),'output':_0x331ee9[_0x6e03ab(0x1e8)]||'','limit':_0x331ee9[_0x6e03ab(0x1ee)],'color':_0x331ee9[_0x6e03ab(0x218)],'noColor':_0x331ee9['noColor']};}function a43_0x2f3b(){const _0x1ea281=['inherit','FINISHED','1402158QihQMH','[error]','max','json','color','string','forEach','pipe','repeat','[Object]','padEnd','varchar','push','jsonl','11305QQSICP','noColor','stringify','cyan','split','object','blue','format','write','[logs]','keys','146979YLsNDi','table','yellow','tsv','output','number','-FXRSn','stdin','params','length','limit','trim','debug','─┬─','log','[rule]','2778384lQGjyd','14cCeMGf','bigint','list','boolean','[query]','138552FOTfam','1044SLryAF','magenta','[params]','spawn','join','13750aJbvdj','9QnSwhF','isTTY','cmdout','less','rule','2470ZwxYeR','map','query','─┴─','No\x20data','entries','114833IbeIYG','bold','filter','end','isInteger','red'];a43_0x2f3b=function(){return _0x1ea281;};return a43_0x2f3b();}function convertSDKResultToQueryResult(_0x1d251e){const _0xfbed46=a43_0xaa61,_0x3bef48=[];if(_0x1d251e[_0xfbed46(0x1ed)]>0x0){const _0x4caaf9=_0x1d251e[0x0];for(const [_0xa14f75,_0x53f028]of Object[_0xfbed46(0x20b)](_0x4caaf9)){let _0x18d7dc=_0xfbed46(0x21f);if(typeof _0x53f028==='number')_0x18d7dc=Number[_0xfbed46(0x210)](_0x53f028)?_0xfbed46(0x1f6):'double';else{if(typeof _0x53f028==='boolean')_0x18d7dc=_0xfbed46(0x1f8);else _0x53f028===null&&(_0x18d7dc=_0xfbed46(0x21f));}_0x3bef48[_0xfbed46(0x220)]({'name':_0xa14f75,'type':_0x18d7dc});}}return{'queryId':'sdk-result','columns':_0x3bef48,'data':_0x1d251e,'stats':{'state':_0xfbed46(0x213),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1d251e[_0xfbed46(0x1ed)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5384d0,_0xa30f36){const _0x35aea8=convertSDKResultToQueryResult(_0x5384d0);return formatQueryOutput(_0x35aea8,_0xa30f36);}export async function formatQueryOutput(_0x4938e5,_0x11eb8a){const _0x4e2ade=a43_0xaa61,{format:_0x3578f2,limit:_0x4031eb,output:_0x4843f3,color:_0x1c3799,noColor:_0x1cca07}=_0x11eb8a,_0x516f10=Boolean(_0x4843f3)&&!_0x1c3799,_0x12d7b3={'color':_0x1c3799,'noColor':_0x1cca07||_0x516f10};if(_0x3578f2===_0x4e2ade(0x1e5)){const _0x52f94a=shouldUseLess(_0x3578f2,_0x4843f3);return formatAsTable(_0x4938e5,_0x4031eb,_0x52f94a,_0x12d7b3);}else{if(_0x3578f2===_0x4e2ade(0x217))return formatAsJSON(_0x4938e5,_0x12d7b3);else return _0x3578f2==='jsonl'?formatAsJSONL(_0x4938e5,_0x12d7b3):formatQueryResult(_0x4938e5,_0x3578f2);}}function a43_0xaa61(_0x1c78bf,_0x4ea782){_0x1c78bf=_0x1c78bf-0x1e2;const _0x2f3be1=a43_0x2f3b();let _0xaa6166=_0x2f3be1[_0x1c78bf];return _0xaa6166;}function shouldUseLess(_0x4761bf,_0x3c6ca1){const _0x361f65=a43_0xaa61;return(_0x4761bf==='table'||_0x4761bf===_0x361f65(0x1f7))&&process['stdout'][_0x361f65(0x202)]&&!_0x3c6ca1;}export function resolveOutputOptions(_0x273f74){const _0x279627=a43_0xaa61,_0xbe8c95=resolveOutputFormat(_0x273f74[_0x279627(0x229)],_0x273f74['output'],_0x279627(0x1e5));let _0x5b18b5=typeof _0x273f74[_0x279627(0x1ee)]===_0x279627(0x1e9)?_0x273f74[_0x279627(0x1ee)]:parseInt(_0x273f74[_0x279627(0x1ee)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x31e491=_0x273f74['output']||'';return shouldUseLess(_0xbe8c95,_0x31e491)&&(_0x5b18b5=Infinity),{'format':_0xbe8c95,'output':_0x31e491,'limit':_0x5b18b5,'color':_0x273f74[_0x279627(0x218)],'noColor':_0x273f74[_0x279627(0x223)]};}export function writeOutput(_0x428fc1,_0x4e867e,_0x34ff60){const _0x251970=a43_0xaa61;return _0x4e867e?(writeFileSync(_0x4e867e,_0x428fc1),console['error']('Results\x20saved\x20to\x20'+_0x4e867e),Promise['resolve']()):shouldUseLess(_0x34ff60||'','')?new Promise(_0x5d0131=>{const _0x16c370=a43_0xaa61,_0x458ae4=spawn(_0x16c370(0x204),[_0x16c370(0x1ea)],{'stdio':[_0x16c370(0x21b),_0x16c370(0x212),'inherit']});let _0x4a0946=![];_0x458ae4['on']('error',()=>{const _0x442c06=_0x16c370;!_0x4a0946&&(_0x4a0946=!![],console[_0x442c06(0x1f2)](_0x428fc1),_0x5d0131());}),_0x458ae4['on']('close',()=>{!_0x4a0946&&(_0x4a0946=!![],_0x5d0131());}),_0x458ae4['on'](_0x16c370(0x1fe),()=>{const _0x185fbd=_0x16c370;!_0x4a0946&&_0x458ae4[_0x185fbd(0x1eb)]&&(_0x458ae4['stdin']['on']('error',()=>{}),_0x458ae4['stdin'][_0x185fbd(0x22a)](_0x428fc1),_0x458ae4[_0x185fbd(0x1eb)][_0x185fbd(0x20f)]());}),!_0x458ae4[_0x16c370(0x1eb)]&&(!_0x4a0946&&(_0x4a0946=!![],console['log'](_0x428fc1),_0x5d0131()));}):(console[_0x251970(0x1f2)](_0x428fc1),Promise['resolve']());}export async function handleSDKOutput(_0x466edb,_0x372841){const _0x108b60=a43_0xaa61,_0x3db317=resolveOutputOptions(_0x372841),_0x313134=await formatSDKOutput(_0x466edb,_0x3db317);await writeOutput(_0x313134,_0x3db317[_0x108b60(0x1e8)]||undefined,_0x3db317[_0x108b60(0x229)]);}export async function handleQueryOutput(_0x4f6c26,_0x338806){const _0x236e47=a43_0xaa61,_0x172498=resolveOutputOptions(_0x338806),_0x473fc5=await formatQueryOutput(_0x4f6c26,_0x172498);await writeOutput(_0x473fc5,_0x172498[_0x236e47(0x1e8)]||undefined,_0x172498[_0x236e47(0x229)]);}async function formatSingleObject(_0x11239a,_0x45e738){const _0x14ce05=a43_0xaa61,{format:_0x1a121c,color:_0x44838d,noColor:_0x1353c5}=_0x45e738,_0x1c77dd={'color':_0x44838d,'noColor':_0x1353c5};if(_0x1a121c===_0x14ce05(0x217)){if(shouldUseColor(_0x1c77dd))return colorizeJSON(_0x11239a,_0x1c77dd);return JSON['stringify'](_0x11239a,null,0x2);}else{if(_0x1a121c===_0x14ce05(0x221)){if(shouldUseColor(_0x1c77dd))return colorizeJSONCompact(_0x11239a,_0x1c77dd);return JSON['stringify'](_0x11239a);}else{if(_0x1a121c===_0x14ce05(0x1e7))return Object[_0x14ce05(0x20b)](_0x11239a)[_0x14ce05(0x207)](([_0x14eb20,_0x581829])=>_0x14eb20+'\x09'+_0x581829)[_0x14ce05(0x1ff)]('\x0a');else{const _0xf1c255=Object[_0x14ce05(0x20b)](_0x11239a);if(_0xf1c255[_0x14ce05(0x1ed)]===0x0)return _0x14ce05(0x20a);const _0xf4f56c=_0x11239a[_0x14ce05(0x1f0)],_0x5ef69f=_0x11239a[_0x14ce05(0x208)],_0x618f40=_0x11239a[_0x14ce05(0x1ec)],_0x48565b=_0x11239a['rule'],_0x592607=_0x5ef69f?typeof _0x5ef69f===_0x14ce05(0x219)?_0x5ef69f:JSON[_0x14ce05(0x224)](_0x5ef69f,null,0x2):undefined,_0xc990f5=_0x618f40&&Object[_0x14ce05(0x1e3)](_0x618f40)['length']>0x0?JSON[_0x14ce05(0x224)](_0x618f40,null,0x2):undefined,_0x2fb022=_0x48565b&&Object[_0x14ce05(0x1e3)](_0x48565b)[_0x14ce05(0x1ed)]>0x0?JSON[_0x14ce05(0x224)](_0x48565b,null,0x2):undefined,_0x2dbe33=_0xf1c255[_0x14ce05(0x20e)](([_0xfab285])=>_0xfab285!==_0x14ce05(0x1f0)&&_0xfab285!==_0x14ce05(0x208)&&_0xfab285!==_0x14ce05(0x1ec)&&_0xfab285!==_0x14ce05(0x205)),_0x116b0b=Math['max'](..._0x2dbe33[_0x14ce05(0x207)](([_0xfea833])=>_0xfea833['length'])),_0x3ee902=Math[_0x14ce05(0x216)](..._0x2dbe33[_0x14ce05(0x207)](([,_0x1d6410])=>{const _0x1b5a21=_0x14ce05;try{const _0x5cfb69=_0x1d6410===null||_0x1d6410===undefined?'':typeof _0x1d6410==='object'?JSON[_0x1b5a21(0x224)](_0x1d6410):String(_0x1d6410),_0x50a2ea=_0x5cfb69[_0x1b5a21(0x226)]('\x0a');return Math[_0x1b5a21(0x216)](..._0x50a2ea['map'](_0xda2bfc=>_0xda2bfc[_0x1b5a21(0x1ed)]),0x0);}catch{return 0x0;}}),0x14),_0x3e5af2=[];_0x3e5af2['push'](colorBorder('┌─'+'─'['repeat'](_0x116b0b)+_0x14ce05(0x1f1)+'─'[_0x14ce05(0x21c)](_0x3ee902)+'─┐',_0x1c77dd)),_0x2dbe33[_0x14ce05(0x21a)](([_0x3892f9,_0x368cb6])=>{const _0x3395c1=_0x14ce05;let _0x5e85ba;try{_0x5e85ba=_0x368cb6===null||_0x368cb6===undefined?'':typeof _0x368cb6===_0x3395c1(0x227)?JSON[_0x3395c1(0x224)](_0x368cb6):String(_0x368cb6);}catch{_0x5e85ba=_0x3395c1(0x21d);}const _0x15d850=_0x3892f9['padEnd'](_0x116b0b),_0x28df18=_0x5e85ba[_0x3395c1(0x226)]('\x0a');_0x28df18[_0x3395c1(0x21a)]((_0x51dab8,_0x23e765)=>{const _0x47d243=_0x3395c1,_0x3daaec=colorBorder('│',_0x1c77dd);_0x23e765===0x0?_0x3e5af2[_0x47d243(0x220)](_0x3daaec+'\x20'+_0x15d850+'\x20'+_0x3daaec+'\x20'+_0x51dab8[_0x47d243(0x21e)](_0x3ee902)+'\x20'+_0x3daaec):_0x3e5af2[_0x47d243(0x220)](_0x3daaec+'\x20'+'\x20'[_0x47d243(0x21c)](_0x116b0b)+'\x20'+_0x3daaec+'\x20'+_0x51dab8[_0x47d243(0x21e)](_0x3ee902)+'\x20'+_0x3daaec);});}),_0x3e5af2[_0x14ce05(0x220)](colorBorder('└─'+'─'[_0x14ce05(0x21c)](_0x116b0b)+_0x14ce05(0x209)+'─'[_0x14ce05(0x21c)](_0x3ee902)+'─┘',_0x1c77dd));_0x592607&&(_0x3e5af2[_0x14ce05(0x220)](''),_0x3e5af2[_0x14ce05(0x220)](String(a43_0x36abf7[_0x14ce05(0x1e6)]['bold'](_0x14ce05(0x1f9)))),_0x3e5af2['push'](_0x592607));_0xc990f5&&(_0x3e5af2[_0x14ce05(0x220)](''),_0x3e5af2[_0x14ce05(0x220)](String(a43_0x36abf7[_0x14ce05(0x228)][_0x14ce05(0x20d)](_0x14ce05(0x1fd)))),_0x3e5af2['push'](_0xc990f5));_0x2fb022&&(_0x3e5af2[_0x14ce05(0x220)](''),_0x3e5af2[_0x14ce05(0x220)](String(a43_0x36abf7[_0x14ce05(0x1fc)][_0x14ce05(0x20d)](_0x14ce05(0x1f3)))),_0x3e5af2[_0x14ce05(0x220)](_0x2fb022));if(_0xf4f56c){if(_0xf4f56c['stderr']){_0x3e5af2[_0x14ce05(0x220)](''),_0x3e5af2[_0x14ce05(0x220)](String(a43_0x36abf7[_0x14ce05(0x211)]['bold'](_0x14ce05(0x215))));const _0x3b811d=_0xf4f56c['stderr']['split']('\x0a');_0x3b811d[_0x14ce05(0x21a)](_0x4a157e=>{const _0x1db5dc=_0x14ce05;_0x4a157e[_0x1db5dc(0x1ef)]()&&_0x3e5af2[_0x1db5dc(0x220)](_0x4a157e);});}if(_0xf4f56c[_0x14ce05(0x203)]){_0x3e5af2[_0x14ce05(0x220)](''),_0x3e5af2[_0x14ce05(0x220)](String(a43_0x36abf7[_0x14ce05(0x225)][_0x14ce05(0x20d)](_0x14ce05(0x1e2))));const _0x3c09cd=_0xf4f56c['cmdout'][_0x14ce05(0x226)]('\x0a');_0x3c09cd['forEach'](_0x3c7822=>{const _0x29975d=_0x14ce05;_0x3c7822[_0x29975d(0x1ef)]()&&_0x3e5af2[_0x29975d(0x220)](_0x3c7822);});}}return _0x3e5af2['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x438846,_0xafc9c8){const _0x1b29c8=a43_0xaa61;if(_0xafc9c8[_0x1b29c8(0x229)]===_0x1b29c8(0x1e5)){await handleSDKOutput([_0x438846],_0xafc9c8);return;}const _0x61f037=resolveOutputOptions(_0xafc9c8),_0x25136a=await formatSingleObject(_0x438846,_0x61f037);await writeOutput(_0x25136a,_0x61f037[_0x1b29c8(0x1e8)]||undefined,_0x61f037[_0x1b29c8(0x229)]);}
1
+ (function(_0x3e33da,_0x5155e1){const _0x45eb8a=a43_0x3c64,_0xd564fb=_0x3e33da();while(!![]){try{const _0x192589=-parseInt(_0x45eb8a(0x18d))/0x1+parseInt(_0x45eb8a(0x1b1))/0x2+parseInt(_0x45eb8a(0x19f))/0x3*(-parseInt(_0x45eb8a(0x185))/0x4)+parseInt(_0x45eb8a(0x1c3))/0x5*(parseInt(_0x45eb8a(0x1bd))/0x6)+-parseInt(_0x45eb8a(0x1a1))/0x7+-parseInt(_0x45eb8a(0x1ae))/0x8+-parseInt(_0x45eb8a(0x1b3))/0x9*(-parseInt(_0x45eb8a(0x191))/0xa);if(_0x192589===_0x5155e1)break;else _0xd564fb['push'](_0xd564fb['shift']());}catch(_0x196e51){_0xd564fb['push'](_0xd564fb['shift']());}}}(a43_0x3f3d,0x5edc6));import{writeFileSync}from'fs';import{spawn}from'child_process';function a43_0x3f3d(){const _0x10c410=['─┬─','611744XUqVsK','tsv','18tdbRSf','map','entries','log','sdk-result','FINISHED','red','noColor','debug','limit','404574aVcOZZ','forEach','padEnd','bold','jsonl','push','55rpoEAF','isTTY','number','stderr','68tNeuSB','spawn','end','color','max','filter','repeat','format','489714WMGCQS','less','pipe','─┴─','4635850eBXNdR','write','inherit','stdout','json','boolean','params','cmdout','stdin','trim','length','[rule]','object','varchar','1347evXQHV','split','3758475CVcJOv','resolve','query','Results\x20saved\x20to\x20','[params]','list','join','output','rule','stringify','table','[logs]','error','4415512BPdKlt','No\x20data'];a43_0x3f3d=function(){return _0x10c410;};return a43_0x3f3d();}import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a43_0x5a8589 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x37a8c8){const _0x3a7ac3=a43_0x3c64;return _0x37a8c8['format']===_0x3a7ac3(0x195)||_0x37a8c8[_0x3a7ac3(0x18c)]===_0x3a7ac3(0x1c1)||_0x37a8c8['format']==='tsv'||_0x37a8c8[_0x3a7ac3(0x18c)]===_0x3a7ac3(0x1ab)||_0x37a8c8[_0x3a7ac3(0x195)]===!![]||_0x37a8c8['jsonl']===!![]||_0x37a8c8[_0x3a7ac3(0x1b2)]===!![]||_0x37a8c8[_0x3a7ac3(0x1ab)]===!![];}export function parseOutputOptions(_0x4e86fa){const _0x4e4429=a43_0x3c64;return{'format':_0x4e86fa['format']||_0x4e4429(0x1ab),'output':_0x4e86fa[_0x4e4429(0x1a8)]||'','limit':_0x4e86fa[_0x4e4429(0x1bc)],'color':_0x4e86fa[_0x4e4429(0x188)],'noColor':_0x4e86fa[_0x4e4429(0x1ba)]};}function convertSDKResultToQueryResult(_0x2d86f6){const _0x37ec02=a43_0x3c64,_0x4fd8b8=[];if(_0x2d86f6[_0x37ec02(0x19b)]>0x0){const _0x4313b5=_0x2d86f6[0x0];for(const [_0x1353bc,_0x453e2d]of Object[_0x37ec02(0x1b5)](_0x4313b5)){let _0x4af018=_0x37ec02(0x19e);if(typeof _0x453e2d===_0x37ec02(0x183))_0x4af018=Number['isInteger'](_0x453e2d)?'bigint':'double';else{if(typeof _0x453e2d===_0x37ec02(0x196))_0x4af018=_0x37ec02(0x196);else _0x453e2d===null&&(_0x4af018=_0x37ec02(0x19e));}_0x4fd8b8[_0x37ec02(0x1c2)]({'name':_0x1353bc,'type':_0x4af018});}}return{'queryId':_0x37ec02(0x1b7),'columns':_0x4fd8b8,'data':_0x2d86f6,'stats':{'state':_0x37ec02(0x1b8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2d86f6[_0x37ec02(0x19b)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4a1c9b,_0x2c75e0){const _0x3349fb=convertSDKResultToQueryResult(_0x4a1c9b);return formatQueryOutput(_0x3349fb,_0x2c75e0);}export async function formatQueryOutput(_0x5483b4,_0x20aaf5){const _0x24e4c2=a43_0x3c64,{format:_0x2a429a,limit:_0x514cf8,output:_0x4676f0,color:_0x2eec72,noColor:_0x4675c3}=_0x20aaf5,_0x53d28e=Boolean(_0x4676f0)&&!_0x2eec72,_0x286f26={'color':_0x2eec72,'noColor':_0x4675c3||_0x53d28e};if(_0x2a429a===_0x24e4c2(0x1ab)){const _0x5b31d2=shouldUseLess(_0x2a429a,_0x4676f0);return formatAsTable(_0x5483b4,_0x514cf8,_0x5b31d2,_0x286f26);}else{if(_0x2a429a===_0x24e4c2(0x195))return formatAsJSON(_0x5483b4,_0x286f26);else return _0x2a429a===_0x24e4c2(0x1c1)?formatAsJSONL(_0x5483b4,_0x286f26):formatQueryResult(_0x5483b4,_0x2a429a);}}function a43_0x3c64(_0x196cfb,_0x28e503){_0x196cfb=_0x196cfb-0x182;const _0x3f3d26=a43_0x3f3d();let _0x3c647b=_0x3f3d26[_0x196cfb];return _0x3c647b;}function shouldUseLess(_0x4b59d5,_0x3c49ff){const _0x528f3b=a43_0x3c64;return(_0x4b59d5===_0x528f3b(0x1ab)||_0x4b59d5===_0x528f3b(0x1a6))&&process[_0x528f3b(0x194)][_0x528f3b(0x182)]&&!_0x3c49ff;}export function resolveOutputOptions(_0x1b82f9){const _0x394157=a43_0x3c64,_0x131a2c=resolveOutputFormat(_0x1b82f9[_0x394157(0x18c)],_0x1b82f9[_0x394157(0x1a8)],_0x394157(0x1ab));let _0x3c6f19=typeof _0x1b82f9['limit']==='number'?_0x1b82f9[_0x394157(0x1bc)]:parseInt(_0x1b82f9['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x8ed7b2=_0x1b82f9[_0x394157(0x1a8)]||'';return shouldUseLess(_0x131a2c,_0x8ed7b2)&&(_0x3c6f19=Infinity),{'format':_0x131a2c,'output':_0x8ed7b2,'limit':_0x3c6f19,'color':_0x1b82f9['color'],'noColor':_0x1b82f9[_0x394157(0x1ba)]};}export function writeOutput(_0x2f7c62,_0x1dafd2,_0x1012af){const _0x229c10=a43_0x3c64;return _0x1dafd2?(writeFileSync(_0x1dafd2,_0x2f7c62),console[_0x229c10(0x1ad)](_0x229c10(0x1a4)+_0x1dafd2),Promise[_0x229c10(0x1a2)]()):shouldUseLess(_0x1012af||'','')?new Promise(_0x5c9358=>{const _0x5b4410=_0x229c10,_0x22a3e3=spawn(_0x5b4410(0x18e),['-FXRSn'],{'stdio':[_0x5b4410(0x18f),'inherit',_0x5b4410(0x193)]});let _0x115f36=![];_0x22a3e3['on'](_0x5b4410(0x1ad),()=>{!_0x115f36&&(_0x115f36=!![],console['log'](_0x2f7c62),_0x5c9358());}),_0x22a3e3['on']('close',()=>{!_0x115f36&&(_0x115f36=!![],_0x5c9358());}),_0x22a3e3['on'](_0x5b4410(0x186),()=>{const _0x3c2c9c=_0x5b4410;!_0x115f36&&_0x22a3e3[_0x3c2c9c(0x199)]&&(_0x22a3e3[_0x3c2c9c(0x199)]['on'](_0x3c2c9c(0x1ad),()=>{}),_0x22a3e3['stdin'][_0x3c2c9c(0x192)](_0x2f7c62),_0x22a3e3[_0x3c2c9c(0x199)][_0x3c2c9c(0x187)]());}),!_0x22a3e3[_0x5b4410(0x199)]&&(!_0x115f36&&(_0x115f36=!![],console[_0x5b4410(0x1b6)](_0x2f7c62),_0x5c9358()));}):(console[_0x229c10(0x1b6)](_0x2f7c62),Promise[_0x229c10(0x1a2)]());}export async function handleSDKOutput(_0x5aca3a,_0x35bb05){const _0xfa6f86=a43_0x3c64,_0xba2046=resolveOutputOptions(_0x35bb05),_0x1c5090=await formatSDKOutput(_0x5aca3a,_0xba2046);await writeOutput(_0x1c5090,_0xba2046[_0xfa6f86(0x1a8)]||undefined,_0xba2046[_0xfa6f86(0x18c)]);}export async function handleQueryOutput(_0x129843,_0x27b933){const _0x24b517=a43_0x3c64,_0xbc0865=resolveOutputOptions(_0x27b933),_0x4ddf53=await formatQueryOutput(_0x129843,_0xbc0865);await writeOutput(_0x4ddf53,_0xbc0865[_0x24b517(0x1a8)]||undefined,_0xbc0865[_0x24b517(0x18c)]);}async function formatSingleObject(_0x1e4f53,_0x4d308a){const _0x1409fd=a43_0x3c64,{format:_0x67a706,color:_0x10325b,noColor:_0x40aac2}=_0x4d308a,_0x11e63c={'color':_0x10325b,'noColor':_0x40aac2};if(_0x67a706===_0x1409fd(0x195)){if(shouldUseColor(_0x11e63c))return colorizeJSON(_0x1e4f53,_0x11e63c);return JSON[_0x1409fd(0x1aa)](_0x1e4f53,null,0x2);}else{if(_0x67a706==='jsonl'){if(shouldUseColor(_0x11e63c))return colorizeJSONCompact(_0x1e4f53,_0x11e63c);return JSON[_0x1409fd(0x1aa)](_0x1e4f53);}else{if(_0x67a706===_0x1409fd(0x1b2))return Object[_0x1409fd(0x1b5)](_0x1e4f53)['map'](([_0x8f129b,_0x9a84d4])=>_0x8f129b+'\x09'+_0x9a84d4)[_0x1409fd(0x1a7)]('\x0a');else{const _0x503712=Object['entries'](_0x1e4f53);if(_0x503712[_0x1409fd(0x19b)]===0x0)return _0x1409fd(0x1af);const _0x46cb9b=_0x1e4f53['debug'],_0x786646=_0x1e4f53[_0x1409fd(0x1a3)],_0x12da6d=_0x1e4f53[_0x1409fd(0x197)],_0xa63e2a=_0x1e4f53[_0x1409fd(0x1a9)],_0x39e264=_0x786646?typeof _0x786646==='string'?_0x786646:JSON[_0x1409fd(0x1aa)](_0x786646,null,0x2):undefined,_0x5841b3=_0x12da6d&&Object['keys'](_0x12da6d)[_0x1409fd(0x19b)]>0x0?JSON[_0x1409fd(0x1aa)](_0x12da6d,null,0x2):undefined,_0x30569e=_0xa63e2a&&Object['keys'](_0xa63e2a)[_0x1409fd(0x19b)]>0x0?JSON[_0x1409fd(0x1aa)](_0xa63e2a,null,0x2):undefined,_0x13b562=_0x503712[_0x1409fd(0x18a)](([_0x28c7e3])=>_0x28c7e3!==_0x1409fd(0x1bb)&&_0x28c7e3!==_0x1409fd(0x1a3)&&_0x28c7e3!==_0x1409fd(0x197)&&_0x28c7e3!==_0x1409fd(0x1a9)),_0x2c9677=Math[_0x1409fd(0x189)](..._0x13b562[_0x1409fd(0x1b4)](([_0x24b047])=>_0x24b047[_0x1409fd(0x19b)])),_0x13cb5e=Math[_0x1409fd(0x189)](..._0x13b562[_0x1409fd(0x1b4)](([,_0x164f09])=>{const _0x22ae37=_0x1409fd;try{const _0x1ac791=_0x164f09===null||_0x164f09===undefined?'':typeof _0x164f09===_0x22ae37(0x19d)?JSON['stringify'](_0x164f09):String(_0x164f09),_0x59dade=_0x1ac791[_0x22ae37(0x1a0)]('\x0a');return Math[_0x22ae37(0x189)](..._0x59dade[_0x22ae37(0x1b4)](_0x2cfc70=>_0x2cfc70[_0x22ae37(0x19b)]),0x0);}catch{return 0x0;}}),0x14),_0x33d9b0=[];_0x33d9b0[_0x1409fd(0x1c2)](colorBorder('┌─'+'─'[_0x1409fd(0x18b)](_0x2c9677)+_0x1409fd(0x1b0)+'─'[_0x1409fd(0x18b)](_0x13cb5e)+'─┐',_0x11e63c)),_0x13b562[_0x1409fd(0x1be)](([_0x524af9,_0x463055])=>{const _0x4f2aeb=_0x1409fd;let _0x2b5c65;try{_0x2b5c65=_0x463055===null||_0x463055===undefined?'':typeof _0x463055===_0x4f2aeb(0x19d)?JSON[_0x4f2aeb(0x1aa)](_0x463055):String(_0x463055);}catch{_0x2b5c65='[Object]';}const _0x1ce748=_0x524af9[_0x4f2aeb(0x1bf)](_0x2c9677),_0x2e44ea=_0x2b5c65[_0x4f2aeb(0x1a0)]('\x0a');_0x2e44ea[_0x4f2aeb(0x1be)]((_0x438ba7,_0xb98a47)=>{const _0x1f11cd=_0x4f2aeb,_0x16214a=colorBorder('│',_0x11e63c);_0xb98a47===0x0?_0x33d9b0['push'](_0x16214a+'\x20'+_0x1ce748+'\x20'+_0x16214a+'\x20'+_0x438ba7[_0x1f11cd(0x1bf)](_0x13cb5e)+'\x20'+_0x16214a):_0x33d9b0[_0x1f11cd(0x1c2)](_0x16214a+'\x20'+'\x20'[_0x1f11cd(0x18b)](_0x2c9677)+'\x20'+_0x16214a+'\x20'+_0x438ba7[_0x1f11cd(0x1bf)](_0x13cb5e)+'\x20'+_0x16214a);});}),_0x33d9b0[_0x1409fd(0x1c2)](colorBorder('└─'+'─'[_0x1409fd(0x18b)](_0x2c9677)+_0x1409fd(0x190)+'─'['repeat'](_0x13cb5e)+'─┘',_0x11e63c));_0x39e264&&(_0x33d9b0[_0x1409fd(0x1c2)](''),_0x33d9b0[_0x1409fd(0x1c2)](String(a43_0x5a8589['yellow'][_0x1409fd(0x1c0)]('[query]'))),_0x33d9b0['push'](_0x39e264));_0x5841b3&&(_0x33d9b0[_0x1409fd(0x1c2)](''),_0x33d9b0[_0x1409fd(0x1c2)](String(a43_0x5a8589['blue'][_0x1409fd(0x1c0)](_0x1409fd(0x1a5)))),_0x33d9b0[_0x1409fd(0x1c2)](_0x5841b3));_0x30569e&&(_0x33d9b0[_0x1409fd(0x1c2)](''),_0x33d9b0[_0x1409fd(0x1c2)](String(a43_0x5a8589['magenta'][_0x1409fd(0x1c0)](_0x1409fd(0x19c)))),_0x33d9b0['push'](_0x30569e));if(_0x46cb9b){if(_0x46cb9b[_0x1409fd(0x184)]){_0x33d9b0[_0x1409fd(0x1c2)](''),_0x33d9b0['push'](String(a43_0x5a8589[_0x1409fd(0x1b9)][_0x1409fd(0x1c0)]('[error]')));const _0x19620a=_0x46cb9b[_0x1409fd(0x184)][_0x1409fd(0x1a0)]('\x0a');_0x19620a[_0x1409fd(0x1be)](_0xa4f425=>{const _0x4c5da1=_0x1409fd;_0xa4f425[_0x4c5da1(0x19a)]()&&_0x33d9b0['push'](_0xa4f425);});}if(_0x46cb9b['cmdout']){_0x33d9b0[_0x1409fd(0x1c2)](''),_0x33d9b0[_0x1409fd(0x1c2)](String(a43_0x5a8589['cyan'][_0x1409fd(0x1c0)](_0x1409fd(0x1ac))));const _0xafe9b0=_0x46cb9b[_0x1409fd(0x198)][_0x1409fd(0x1a0)]('\x0a');_0xafe9b0[_0x1409fd(0x1be)](_0x53711e=>{const _0x188434=_0x1409fd;_0x53711e['trim']()&&_0x33d9b0[_0x188434(0x1c2)](_0x53711e);});}}return _0x33d9b0[_0x1409fd(0x1a7)]('\x0a');}}}}export async function handleSingleObjectOutput(_0xc88874,_0x5aaaa1){const _0x1bfabe=a43_0x3c64;if(_0x5aaaa1[_0x1bfabe(0x18c)]===_0x1bfabe(0x1ab)){await handleSDKOutput([_0xc88874],_0x5aaaa1);return;}const _0x310dbf=resolveOutputOptions(_0x5aaaa1),_0x374e58=await formatSingleObject(_0xc88874,_0x310dbf);await writeOutput(_0x374e58,_0x310dbf[_0x1bfabe(0x1a8)]||undefined,_0x310dbf[_0x1bfabe(0x18c)]);}