@treasuredata/tdx 0.16.5 → 0.16.7

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 (188) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/command.js.map +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/job-command.js +1 -1
  25. package/dist/commands/journey-command.js +1 -1
  26. package/dist/commands/journey-validate-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segment-validate-command.js +1 -1
  42. package/dist/commands/segments.js +1 -1
  43. package/dist/commands/show.js +1 -1
  44. package/dist/commands/status-command.d.ts +20 -0
  45. package/dist/commands/status-command.d.ts.map +1 -0
  46. package/dist/commands/status-command.js +1 -0
  47. package/dist/commands/status-command.js.map +1 -0
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/connection-cache.js +1 -1
  57. package/dist/core/constants.js +1 -1
  58. package/dist/core/credential-cache.js +1 -1
  59. package/dist/core/global-context.d.ts.map +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/global-context.js.map +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/profile.js +1 -1
  64. package/dist/core/project-config.js +1 -1
  65. package/dist/core/session.js +1 -1
  66. package/dist/core/user-cache.js +1 -1
  67. package/dist/core/version.js +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/mcp/server.js +1 -1
  70. package/dist/mcp/tools/index.js +1 -1
  71. package/dist/mcp/tools/tdx-run.js +1 -1
  72. package/dist/mcp/tools/tdx-search.js +1 -1
  73. package/dist/mcp/utils.js +1 -1
  74. package/dist/proxy/anthropic-adapter.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/context-signature.js +1 -1
  77. package/dist/proxy/conversation-utils.js +1 -1
  78. package/dist/proxy/passthrough-server.js +1 -1
  79. package/dist/proxy/server.js +1 -1
  80. package/dist/proxy/session-cache.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.d.ts +3 -1
  85. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/types/agent-def.d.ts +3 -3
  94. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/claude-agent/claude-agent-client.d.ts +13 -0
  97. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  98. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  99. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  100. package/dist/sdk/claude-agent/environment.js +1 -1
  101. package/dist/sdk/claude-agent/index.js +1 -1
  102. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/endpoints.js +1 -1
  105. package/dist/sdk/client/engage-api-client.js +1 -1
  106. package/dist/sdk/client/http-client.js +1 -1
  107. package/dist/sdk/client/llm-api-client.d.ts +9 -1
  108. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  109. package/dist/sdk/client/llm-api-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js.map +1 -1
  111. package/dist/sdk/client/rate-limiter.js +1 -1
  112. package/dist/sdk/client/td-api-client.js +1 -1
  113. package/dist/sdk/client/trino-api-client.js +1 -1
  114. package/dist/sdk/client/workflow-client.js +1 -1
  115. package/dist/sdk/connection-validator.js +1 -1
  116. package/dist/sdk/connection.js +1 -1
  117. package/dist/sdk/engage.js +1 -1
  118. package/dist/sdk/errors.js +1 -1
  119. package/dist/sdk/index.js +1 -1
  120. package/dist/sdk/io/index.js +1 -1
  121. package/dist/sdk/io/node-filesystem.js +1 -1
  122. package/dist/sdk/job.js +1 -1
  123. package/dist/sdk/journey.js +1 -1
  124. package/dist/sdk/llm/chat-cache.js +1 -1
  125. package/dist/sdk/llm/index.d.ts.map +1 -1
  126. package/dist/sdk/llm/index.js +1 -1
  127. package/dist/sdk/llm/index.js.map +1 -1
  128. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  129. package/dist/sdk/llm/model-aliases.js +1 -1
  130. package/dist/sdk/llm/model-factors.js +1 -1
  131. package/dist/sdk/query/index.js +1 -1
  132. package/dist/sdk/query/sql-parser.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-yaml.js +1 -1
  138. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  139. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  140. package/dist/sdk/segment/pull-workflow.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/target-resolution.js +1 -1
  146. package/dist/sdk/segment/tdx-config.js +1 -1
  147. package/dist/sdk/segment/validate-files.js +1 -1
  148. package/dist/sdk/segment/yaml-validator.js +1 -1
  149. package/dist/sdk/segment.js +1 -1
  150. package/dist/sdk/types/index.d.ts +1 -1
  151. package/dist/sdk/types/index.d.ts.map +1 -1
  152. package/dist/sdk/types/index.js +1 -1
  153. package/dist/sdk/types/index.js.map +1 -1
  154. package/dist/sdk/types/llm.d.ts +36 -1
  155. package/dist/sdk/types/llm.d.ts.map +1 -1
  156. package/dist/sdk/types/progress.js +1 -1
  157. package/dist/sdk/user.js +1 -1
  158. package/dist/sdk/util/format-detector.js +1 -1
  159. package/dist/sdk/util/formatters.js +1 -1
  160. package/dist/sdk/util/index.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/clone-workflow.js +1 -1
  163. package/dist/sdk/workflow/index.js +1 -1
  164. package/dist/sdk/workflow/pull-workflow.js +1 -1
  165. package/dist/sdk/workflow/push-workflow.js +1 -1
  166. package/dist/sdk/workflow/tdx-config.js +1 -1
  167. package/dist/sdk/workflow/workflow-utils.js +1 -1
  168. package/dist/utils/async.js +1 -1
  169. package/dist/utils/colors.js +1 -1
  170. package/dist/utils/diff.js +1 -1
  171. package/dist/utils/file-permissions.js +1 -1
  172. package/dist/utils/global-cache.js +1 -1
  173. package/dist/utils/json-loader.js +1 -1
  174. package/dist/utils/local-cache.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/port.js +1 -1
  177. package/dist/utils/process.d.ts +10 -0
  178. package/dist/utils/process.d.ts.map +1 -1
  179. package/dist/utils/process.js +1 -1
  180. package/dist/utils/process.js.map +1 -1
  181. package/dist/utils/prompt.js +1 -1
  182. package/dist/utils/spinner.js +1 -1
  183. package/dist/utils/sse-parser.js +1 -1
  184. package/dist/utils/string-utils.js +1 -1
  185. package/dist/utils/table-ref-parser.js +1 -1
  186. package/dist/utils/tdx-logger.js +1 -1
  187. package/dist/utils/version-check.js +1 -1
  188. 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 a42_0x295940=a42_0x5ddd;(function(_0x231001,_0x2faefd){const _0x202167=a42_0x5ddd,_0x10ecef=_0x231001();while(!![]){try{const _0x4bc20c=parseInt(_0x202167(0x122))/0x1*(-parseInt(_0x202167(0x1c9))/0x2)+-parseInt(_0x202167(0x136))/0x3+-parseInt(_0x202167(0x1fa))/0x4+parseInt(_0x202167(0x8a))/0x5*(-parseInt(_0x202167(0x1ce))/0x6)+parseInt(_0x202167(0xac))/0x7+-parseInt(_0x202167(0x7f))/0x8*(-parseInt(_0x202167(0x16b))/0x9)+parseInt(_0x202167(0x1d4))/0xa*(parseInt(_0x202167(0xd0))/0xb);if(_0x4bc20c===_0x2faefd)break;else _0x10ecef['push'](_0x10ecef['shift']());}catch(_0x4e1552){_0x10ecef['push'](_0x10ecef['shift']());}}}(a42_0x5f2f,0x871b1));import a42_0x1ce5f2 from'chalk';import{existsSync}from'fs';import a42_0x259164 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';function a42_0x5ddd(_0x3c2e1c,_0x8f3295){_0x3c2e1c=_0x3c2e1c-0x69;const _0x5f2fee=a42_0x5f2f();let _0x5ddd25=_0x5f2fee[_0x3c2e1c];return _0x5ddd25;}import a42_0x454db6 from'prompts';function getAttemptStatusDisplay(_0x178e25){const _0x4f4840=a42_0x5ddd;if(!_0x178e25)return{'icon':'⏳','text':''};const {done:_0x958249,success:_0x15ae33,cancelRequested:_0x222213}=_0x178e25;if(!_0x958249)return _0x222213?{'icon':'🛑','text':a42_0x1ce5f2[_0x4f4840(0xc6)](_0x4f4840(0x19f))}:{'icon':'🔄','text':a42_0x1ce5f2[_0x4f4840(0x1aa)](_0x4f4840(0x133))};if(_0x15ae33)return{'icon':'✅','text':a42_0x1ce5f2[_0x4f4840(0x205)](_0x4f4840(0x1be))};return{'icon':'❌','text':a42_0x1ce5f2['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x295940(0xc3)](_0x2bfd3b,_0x25fac3,_0x43d169=0x0){const _0xe85911=a42_0x295940;return _0x2bfd3b[_0x43d169]||_0x25fac3[_0xe85911(0x1cb)];}[a42_0x295940(0x1d1)](_0x3d2387,_0xbbb709,_0x18541d=0x0){const _0x1617d3=a42_0x295940,_0x958887=this[_0x1617d3(0xc3)](_0x3d2387,_0xbbb709,_0x18541d);if(!_0x958887)return console[_0x1617d3(0x1cc)](a42_0x1ce5f2['red'](_0x1617d3(0xa3)),_0x1617d3(0x84)),console[_0x1617d3(0x1cc)](a42_0x1ce5f2[_0x1617d3(0xce)](_0x1617d3(0x16e))),null;return _0x958887;}[a42_0x295940(0xd7)](_0x33aa7a,_0x5bad2c){const _0x3cf752=a42_0x295940;if(_0x33aa7a[0x0]){const _0x1e2e43=_0x33aa7a[0x0]['split']('.');if(_0x1e2e43[_0x3cf752(0x1fc)]===0x1)return{'projectName':_0x1e2e43[0x0],'workflowName':undefined};else return _0x1e2e43[_0x3cf752(0x1fc)]===0x2?{'projectName':_0x1e2e43[0x0],'workflowName':_0x1e2e43[0x1]}:(console['error'](a42_0x1ce5f2['red'](_0x3cf752(0xa3)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x5bad2c[_0x3cf752(0x1cb)],'workflowName':undefined};}[a42_0x295940(0x184)](_0x12f5e6,_0x428a43,_0x581e1b=0x0){const _0x3b743f=a42_0x295940;if(_0x12f5e6[_0x581e1b])return _0x12f5e6[_0x581e1b];if(_0x428a43[_0x3b743f(0x1cb)]){const _0x4d26f2=a42_0x259164['join'](process['cwd'](),_0x3b743f(0xa6),_0x428a43[_0x3b743f(0x1cb)]);if(existsSync(a42_0x259164['join'](_0x4d26f2,_0x3b743f(0x69))))return _0x4d26f2;}return undefined;}async[a42_0x295940(0x1b2)](_0x428538,_0x2c4403,_0x82ff4c){const _0x4003f9=a42_0x295940;try{const _0x53c3eb=await _0x428538['workflow'][_0x4003f9(0xa6)](_0x2c4403,{'limit':0x1});if(_0x53c3eb[_0x4003f9(0x1fc)]>0x0){const _0x72fecb=_0x53c3eb[0x0]['id'],_0x27d79d=getWorkflowUrl(_0x82ff4c,_0x72fecb);console[_0x4003f9(0x1cc)](_0x4003f9(0x188)+a42_0x1ce5f2[_0x4003f9(0x92)](_0x27d79d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x79);[a42_0x295940(0x12d)]=a42_0x295940(0x75);async[a42_0x295940(0x141)](_0x578ff1){const _0x7759f3=a42_0x295940,{options:_0x5b268c,args:_0x587be7,tdx:_0x157340}=_0x578ff1,_0x5da296=_0x587be7[0x0],_0x519a1f=_0x5b268c[_0x7759f3(0x1b5)];if(_0x519a1f)return saveSessionContext({'workflow_project':undefined},_0x5b268c[_0x7759f3(0xc9)]),console[_0x7759f3(0x201)](a42_0x1ce5f2['green'](_0x7759f3(0x158))),0x0;if(!_0x5da296)return console[_0x7759f3(0x1cc)](a42_0x1ce5f2[_0x7759f3(0x19b)](_0x7759f3(0xa3)),_0x7759f3(0x84)),console[_0x7759f3(0x1cc)](a42_0x1ce5f2['dim'](_0x7759f3(0x11a))),console[_0x7759f3(0x1cc)](a42_0x1ce5f2[_0x7759f3(0xce)](_0x7759f3(0x10f))),0x1;const _0x307eca=await withSpinner('Resolving\x20project\x20\x27'+_0x5da296+_0x7759f3(0x11e),()=>_0x157340[_0x7759f3(0x21a)][_0x7759f3(0xcc)](_0x5da296),{'verbose':_0x5b268c['verbose']}),{name:_0x232472}=_0x307eca[_0x7759f3(0xf3)];return saveSessionContext({'workflow_project':_0x232472},_0x5b268c[_0x7759f3(0xc9)]),console[_0x7759f3(0x201)](a42_0x1ce5f2[_0x7759f3(0x205)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a42_0x1ce5f2[_0x7759f3(0x92)](_0x232472))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x199);[a42_0x295940(0x12d)]=a42_0x295940(0x15d);async[a42_0x295940(0x141)](_0x14b96e){const _0x358c81=a42_0x295940,{options:_0x167475,args:_0xdcf46e,tdx:_0x3733df}=_0x14b96e,_0x5e9b5d=_0xdcf46e[0x0];_0x167475['verbose']&&_0x5e9b5d&&console[_0x358c81(0x1cc)](_0x358c81(0x1b4)+_0x5e9b5d);const _0xe979d7=await withSpinner(_0x358c81(0x1bb),()=>_0x3733df['workflow'][_0x358c81(0x128)](_0x5e9b5d,{'limit':_0x167475[_0x358c81(0x14f)]}),{'verbose':_0x167475[_0x358c81(0x10b)]});let _0x176585=_0xe979d7[_0x358c81(0xf3)];_0x176585[_0x358c81(0x171)]((_0x48f65e,_0x255ae4)=>_0x48f65e[_0x358c81(0x1c3)][_0x358c81(0x105)](_0x255ae4[_0x358c81(0x1c3)]));const _0x19a537=_0x167475[_0x358c81(0x14f)]||0x64,_0x11eaa7=_0x176585[_0x358c81(0x1fc)]>=_0x19a537?a42_0x1ce5f2[_0x358c81(0xce)](_0x358c81(0xb7)):'';console[_0x358c81(0x1cc)](_0x358c81(0x9b)+_0x176585[_0x358c81(0x1fc)]+_0x358c81(0x174)+(_0x176585[_0x358c81(0x1fc)]!==0x1?'s':'')+_0x11eaa7);if(_0x167475[_0x358c81(0x6d)]===_0x358c81(0x1e2)||_0x167475['format']==='jsonl'||_0x167475[_0x358c81(0x6d)]==='table')await handleSDKOutput(_0x176585,_0x167475);else{if(_0x176585['length']===0x0)_0x5e9b5d?console[_0x358c81(0x201)](_0x358c81(0x20b)+_0x5e9b5d):console[_0x358c81(0x201)](_0x358c81(0x137));else{const _0x476fdf=_0x176585[_0x358c81(0x1b7)](_0x21f772=>{const _0x2a3cd2=_0x358c81,_0x1aca11=_0x21f772[_0x2a3cd2(0x129)]?.['some'](_0x5641d6=>_0x5641d6[_0x2a3cd2(0x10e)]===_0x2a3cd2(0xbb)),_0x448b34=_0x1aca11?a42_0x1ce5f2['dim'](_0x2a3cd2(0xbe)):'';return _0x2a3cd2(0x216)+_0x21f772[_0x2a3cd2(0x1c3)]+_0x448b34;});await writeOutput(_0x476fdf['join']('\x0a'),_0x167475[_0x358c81(0x206)],_0x358c81(0x182));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a42_0x295940(0x198);[a42_0x295940(0x12d)]=a42_0x295940(0x106);async['execute'](_0x56e1b0){const _0xd7b69b=a42_0x295940,{options:_0x32c1a8,args:_0x53ab4d,tdx:_0x3cb242}=_0x56e1b0,_0x40daea=this[_0xd7b69b(0xc3)](_0x53ab4d,_0x32c1a8);_0x32c1a8[_0xd7b69b(0x10b)]&&_0x40daea&&console[_0xd7b69b(0x1cc)](_0xd7b69b(0xb8)+_0x40daea);const _0x56ffa0=await withSpinner(_0xd7b69b(0x1c7),()=>_0x3cb242['workflow'][_0xd7b69b(0xa6)](_0x40daea,{'limit':_0x32c1a8[_0xd7b69b(0x14f)]}),{'verbose':_0x32c1a8[_0xd7b69b(0x10b)]});let _0x92f336=_0x56ffa0[_0xd7b69b(0xf3)];_0x92f336[_0xd7b69b(0x171)]((_0x58d417,_0x3c9709)=>{const _0x5825c3=_0xd7b69b,_0xd50f90=_0x58d417[_0x5825c3(0x1c3)][_0x5825c3(0x105)](_0x3c9709[_0x5825c3(0x1c3)]);if(_0xd50f90!==0x0)return _0xd50f90;return(_0x58d417[_0x5825c3(0x151)]?.[_0x5825c3(0x1c3)]||'')[_0x5825c3(0x105)](_0x3c9709[_0x5825c3(0x151)]?.[_0x5825c3(0x1c3)]||'');});const _0x29bf31=_0x32c1a8['limit']||0x64,_0x4b6b31=_0x92f336[_0xd7b69b(0x1fc)]>=_0x29bf31?a42_0x1ce5f2[_0xd7b69b(0xce)](_0xd7b69b(0xb7)):'';console[_0xd7b69b(0x1cc)]('✔\x20Found\x20'+_0x92f336['length']+'\x20workflow'+(_0x92f336[_0xd7b69b(0x1fc)]!==0x1?'s':'')+_0x4b6b31);if(_0x32c1a8[_0xd7b69b(0x6d)]===_0xd7b69b(0x1e2)||_0x32c1a8[_0xd7b69b(0x6d)]===_0xd7b69b(0x1db)||_0x32c1a8[_0xd7b69b(0x6d)]===_0xd7b69b(0x6a))await handleSDKOutput(_0x92f336,_0x32c1a8);else{if(_0x92f336[_0xd7b69b(0x1fc)]===0x0)_0x40daea?console['log'](_0xd7b69b(0x202)+_0x40daea):console['log']('No\x20workflows\x20found');else{const _0x472c7a=_0x32c1a8[_0xd7b69b(0x6b)],_0x1e761b=_0x92f336[_0xd7b69b(0x1b7)](_0xcfd0e9=>{const _0x20749e=_0xd7b69b,_0x5b614c=a42_0x1ce5f2[_0x20749e(0xce)]('#'+_0xcfd0e9['id']),_0x1b2850=hyperlink(_0x5b614c,getWorkflowUrl(_0x472c7a,_0xcfd0e9['id'])),_0x2da91d=_0xcfd0e9[_0x20749e(0x151)]?.[_0x20749e(0x1c3)]?a42_0x1ce5f2[_0x20749e(0xce)]('\x20('+_0xcfd0e9[_0x20749e(0x151)][_0x20749e(0x1c3)]+')'):'';return _0x20749e(0x14c)+_0x1b2850+'\x20'+_0xcfd0e9[_0x20749e(0x1c3)]+_0x2da91d;});await writeOutput(_0x1e761b[_0xd7b69b(0xc2)]('\x0a'),_0x32c1a8[_0xd7b69b(0x206)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a42_0x295940(0x19e);[a42_0x295940(0x12d)]=a42_0x295940(0xe6);async[a42_0x295940(0x141)](_0x30cefd){const _0x531cdc=a42_0x295940,{options:_0x6ac4a6,args:_0x3e8a0c,tdx:_0x3a39e2}=_0x30cefd,_0x431639=this[_0x531cdc(0xd7)](_0x3e8a0c,_0x6ac4a6);if(!_0x431639)return 0x1;const {projectName:_0x8d6a99,workflowName:_0x5be5de}=_0x431639;if(_0x6ac4a6[_0x531cdc(0x10b)]){if(_0x8d6a99&&_0x5be5de)console[_0x531cdc(0x1cc)](_0x531cdc(0x20d)+_0x8d6a99+'.'+_0x5be5de);else _0x8d6a99&&console[_0x531cdc(0x1cc)]('Filter:\x20project='+_0x8d6a99);const _0x3dce84=_0x6ac4a6[_0x531cdc(0xd2)];_0x3dce84&&console[_0x531cdc(0x1cc)](_0x531cdc(0x91)+_0x3dce84);}let _0x33e697=0x28;if(process[_0x531cdc(0x1ea)][_0x531cdc(0x154)]&&!_0x6ac4a6['output']&&!_0x6ac4a6['format']){const _0x541ba2=process[_0x531cdc(0x1ea)][_0x531cdc(0x214)]||0x28;_0x33e697=Math[_0x531cdc(0xf7)](0x14,Math[_0x531cdc(0xad)](_0x541ba2*0x2/0x3));}const _0x28bb94=_0x6ac4a6[_0x531cdc(0x14f)]||_0x33e697,_0x18cf7d=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x3a39e2['workflow'][_0x531cdc(0xbd)]({'projectName':_0x8d6a99,'workflowName':_0x5be5de,'status':_0x6ac4a6['status'],'fromTime':_0x6ac4a6[_0x531cdc(0x1a8)],'toTime':_0x6ac4a6['to'],'limit':_0x28bb94}),{'verbose':_0x6ac4a6[_0x531cdc(0x10b)]}),_0x4b7adf=_0x18cf7d[_0x531cdc(0xf3)];_0x4b7adf[_0x531cdc(0x171)]((_0x2e8334,_0x4fb904)=>{const _0xb192af=_0x531cdc,_0x29cd16=_0x2e8334[_0xb192af(0x121)]||'',_0x361951=_0x4fb904[_0xb192af(0x121)]||'';return _0x361951[_0xb192af(0x105)](_0x29cd16);});_0x4b7adf[_0x531cdc(0x1fc)]>=_0x28bb94?console[_0x531cdc(0x1cc)](_0x531cdc(0x203)+_0x4b7adf[_0x531cdc(0x1fc)]+_0x531cdc(0xe0)+a42_0x1ce5f2[_0x531cdc(0xce)](_0x531cdc(0x10a))):console[_0x531cdc(0x1cc)]('✔\x20Found\x20'+_0x4b7adf[_0x531cdc(0x1fc)]+_0x531cdc(0xd6)+(_0x4b7adf[_0x531cdc(0x1fc)]!==0x1?'s':''));if(_0x6ac4a6[_0x531cdc(0x6d)]===_0x531cdc(0x1e2)||_0x6ac4a6['format']==='jsonl'||_0x6ac4a6[_0x531cdc(0x6d)]===_0x531cdc(0x6a))await handleSDKOutput(_0x4b7adf,_0x6ac4a6);else{if(!process['stdout'][_0x531cdc(0x154)]||_0x6ac4a6[_0x531cdc(0x206)]){if(_0x4b7adf[_0x531cdc(0x1fc)]===0x0){if(_0x8d6a99&&_0x5be5de)console[_0x531cdc(0x201)]('No\x20sessions\x20found\x20for:\x20'+_0x8d6a99+'.'+_0x5be5de);else _0x8d6a99?console[_0x531cdc(0x201)](_0x531cdc(0xca)+_0x8d6a99):console[_0x531cdc(0x201)](_0x531cdc(0x139));}else{const _0x3d29f2=_0x6ac4a6[_0x531cdc(0x6b)],_0x4e4b3d=this[_0x531cdc(0x17e)](_0x4b7adf,_0x3d29f2);_0x6ac4a6[_0x531cdc(0x206)]?await writeOutput(_0x4e4b3d,_0x6ac4a6['output'],_0x531cdc(0x182)):console[_0x531cdc(0x201)](_0x4e4b3d);}!_0x8d6a99&&(console['error'](''),console[_0x531cdc(0x1cc)](a42_0x1ce5f2[_0x531cdc(0xce)](_0x531cdc(0x12f))),console[_0x531cdc(0x1cc)](a42_0x1ce5f2[_0x531cdc(0xce)](_0x531cdc(0x21d))+'or'+a42_0x1ce5f2['dim'](_0x531cdc(0xeb))));}else{if(_0x4b7adf[_0x531cdc(0x1fc)]===0x0){if(_0x8d6a99&&_0x5be5de)console[_0x531cdc(0x201)](_0x531cdc(0x189)+_0x8d6a99+'.'+_0x5be5de);else _0x8d6a99?console['log'](_0x531cdc(0xca)+_0x8d6a99):console['log'](_0x531cdc(0x139));}else await this[_0x531cdc(0x1ca)](_0x4b7adf,_0x30cefd,_0x8d6a99);}}return 0x0;}[a42_0x295940(0x17e)](_0x189316,_0x345a84){const _0x3c382c=a42_0x295940,_0x3353d6=[],_0x466629=new Map();let _0x1e768f=Infinity,_0xbc174b=-Infinity;for(const _0x5d43db of _0x189316){if(_0x5d43db[_0x3c382c(0x150)]?.['createdAt']){const _0x597202=new Date(_0x5d43db[_0x3c382c(0x150)][_0x3c382c(0xcd)])[_0x3c382c(0x102)](),_0x54b41a=_0x5d43db[_0x3c382c(0x150)][_0x3c382c(0x18a)]?new Date(_0x5d43db[_0x3c382c(0x150)]['finishedAt'])[_0x3c382c(0x102)]():Date[_0x3c382c(0xf1)](),_0x43d3f4=_0x5d43db['project']?.[_0x3c382c(0x1c3)]||_0x3c382c(0x125);!_0x466629[_0x3c382c(0x1f6)](_0x43d3f4)&&_0x466629[_0x3c382c(0x190)](_0x43d3f4,[]),_0x466629[_0x3c382c(0x1fd)](_0x43d3f4)[_0x3c382c(0x14e)]({'session':_0x5d43db,'startTime':_0x597202,'endTime':_0x54b41a,'duration':_0x54b41a-_0x597202}),_0x1e768f=Math[_0x3c382c(0x1d8)](_0x1e768f,_0x597202),_0xbc174b=Math['max'](_0xbc174b,_0x54b41a);}}if(_0x466629[_0x3c382c(0xc4)]===0x0)return _0x3c382c(0x155);const _0x1e6d09=process[_0x3c382c(0x1ea)][_0x3c382c(0xf6)]||0x78,_0x21edae=0x1e,_0x1a6421=0x32,_0x4834e1=0x4,_0x2da3ce=Math[_0x3c382c(0x1d8)](_0x1a6421,Math['max'](_0x21edae,Math['floor'](_0x1e6d09*0.3))),_0x56eabb=_0x1e6d09-_0x2da3ce-TIMELINE_CONFIG['GUTTER']-0x3-_0x4834e1,_0x63f8ab=_0xbc174b-_0x1e768f,_0xc43567=_0x63f8ab/_0x2da3ce,_0x430094=renderTimeAxis({'startTime':_0x1e768f,'endTime':_0xbc174b,'durationMs':_0x63f8ab,'msPerChar':_0xc43567},_0x2da3ce),_0x20930c=[];for(const _0x328527 of _0x466629['values']()){_0x20930c['push'](..._0x328527);}_0x20930c[_0x3c382c(0x171)]((_0xcd370d,_0xca2b9f)=>_0xca2b9f[_0x3c382c(0x213)]-_0xcd370d['startTime']);const _0x540d2c=new Date(_0x1e768f),_0x2279d6=formatDate(_0x540d2c),_0x3e5552=_0x4834e1+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x3c382c(0x101)]+_0x56eabb,_0x31f6e2='\x20'[_0x3c382c(0x20e)](_0x3e5552-_0x2279d6['length']),_0x33b0eb=_0x31f6e2+a42_0x1ce5f2[_0x3c382c(0xce)](_0x2279d6)+'\x20'+_0x430094;_0x3353d6[_0x3c382c(0x14e)](_0x33b0eb);const _0x202410=0x16;let _0x1e2008=0x0;for(const _0x390200 of _0x20930c){const _0xd3c55=_0x390200[_0x3c382c(0xc9)][_0x3c382c(0x151)]?.[_0x3c382c(0x1c3)]||'?',_0x30c2b0=Math[_0x3c382c(0x1d8)](stringWidth(_0xd3c55),_0x202410);_0x1e2008=Math[_0x3c382c(0xf7)](_0x1e2008,_0x30c2b0);}for(const _0x1c5fea of _0x20930c){const {session:_0x24e29e,startTime:_0x2e19af,endTime:_0x349513,duration:_0x6bf559}=_0x1c5fea,_0x474fda=_0x24e29e['project']?.['id'],_0x154141=_0x24e29e['id'],_0x8d305=_0x24e29e[_0x3c382c(0x151)]?.['name']||'?',_0x4a0283=_0x24e29e[_0x3c382c(0x21a)]?.[_0x3c382c(0x1c3)]||'?';let _0x5861ed,_0x207b26;if(_0x24e29e[_0x3c382c(0x150)]){const _0x226cbe=_0x24e29e['lastAttempt'];!_0x226cbe['done']?(_0x5861ed=_0x226cbe[_0x3c382c(0x96)]?'🛑':'🔄',_0x207b26=_0x226cbe[_0x3c382c(0x96)]?a42_0x1ce5f2['yellow']:a42_0x1ce5f2[_0x3c382c(0x1aa)]):(_0x5861ed=_0x226cbe['success']?'✅':'❌',_0x207b26=_0x226cbe[_0x3c382c(0x1be)]?a42_0x1ce5f2[_0x3c382c(0x205)]:a42_0x1ce5f2['red']);}else _0x5861ed='⏳',_0x207b26=a42_0x1ce5f2[_0x3c382c(0xce)];const _0xbba92c='#'+_0x154141,_0x4d08f2=_0x474fda?hyperlink(_0xbba92c,getWorkflowSessionUrl(_0x345a84,_0x474fda,_0x154141)):_0xbba92c;let _0x20c3a6=_0x8d305;stringWidth(_0x8d305)>_0x202410&&(_0x20c3a6=_0x8d305[_0x3c382c(0x1d6)](0x0,_0x202410-0x1)+'…');const _0xb6819e=a42_0x1ce5f2[_0x3c382c(0xce)](_0x20c3a6),_0x55008a=stringWidth(_0x20c3a6),_0x59982f='\x20'['repeat'](_0x1e2008-stringWidth(_0x20c3a6)+0x2),_0x5b2e87='('+formatElapsed(_0x6bf559)+')',_0x4a927d=stringWidth(_0x5b2e87),_0x46d880=stringWidth(_0xbba92c),_0x3b9825=_0x46d880+0x1+_0x55008a+_0x59982f[_0x3c382c(0x1fc)],_0x456998=_0x56eabb-_0x3b9825-_0x4a927d-0x1-0x8;let _0x74f0e8=_0x4a0283;stringWidth(_0x74f0e8)>_0x456998&&(_0x74f0e8=_0x74f0e8[_0x3c382c(0x1d6)](0x0,_0x456998-0x1)+'…');const _0x201ef8=_0x4d08f2+'\x20'+_0xb6819e+_0x59982f+_0x74f0e8,_0x3ee397=stringWidth(_0x201ef8),_0x51bc37=_0x56eabb-_0x3ee397-_0x4a927d,_0x4b9c56=_0x201ef8+'\x20'['repeat'](Math[_0x3c382c(0xf7)](0x1,_0x51bc37))+a42_0x1ce5f2[_0x3c382c(0xce)](_0x5b2e87),_0x5689e8=Math['floor']((_0x2e19af-_0x1e768f)/_0xc43567),_0x50edaa=Math[_0x3c382c(0xad)]((_0x349513-_0x1e768f)/_0xc43567),_0x445b36=Math['max'](_0x5689e8+0x1,_0x50edaa),_0xa0615b=new Array(_0x2da3ce)['fill']('\x20');for(let _0x27165f=_0x5689e8;_0x27165f<Math[_0x3c382c(0x1d8)](_0x445b36,_0x2da3ce);_0x27165f++){_0xa0615b[_0x27165f]='─';}const _0x5a203a=_0xa0615b[_0x3c382c(0x1b7)](_0x20fba7=>_0x20fba7==='\x20'?'\x20':_0x207b26(_0x20fba7))['join']('');_0x3353d6[_0x3c382c(0x14e)](_0x5861ed+'\x20'+_0x4b9c56+'│'+_0x5a203a+'│');}return _0x3353d6[_0x3c382c(0xc2)]('\x0a');}async['navigateSessionsInteractive'](_0x26b748,_0x11c47f,_0x1cc9d8){const _0x3a7821=a42_0x295940,{options:_0x5d5d18,tdx:_0xb63c46}=_0x11c47f,_0x5d7282=_0x5d5d18[_0x3a7821(0x6b)],{timelineRows:_0x1df51a,timeAxisHeader:_0x4f6bd7}=this[_0x3a7821(0x82)](_0x26b748,_0x5d7282),_0xff6dfb=_0x1df51a[_0x3a7821(0x1d3)](_0x115975=>_0x115975[_0x3a7821(0x1d2)]);if(_0xff6dfb[_0x3a7821(0x1fc)]===0x0){const _0x2e3780=this[_0x3a7821(0x17e)](_0x26b748,_0x5d7282);console[_0x3a7821(0x201)](_0x2e3780);!_0x1cc9d8&&(console[_0x3a7821(0x1cc)](''),console[_0x3a7821(0x1cc)](a42_0x1ce5f2[_0x3a7821(0xce)](_0x3a7821(0x12f))),console[_0x3a7821(0x1cc)](a42_0x1ce5f2[_0x3a7821(0xce)](_0x3a7821(0x21d))+'or'+a42_0x1ce5f2[_0x3a7821(0xce)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x4f6bd7&&console[_0x3a7821(0x201)](_0x4f6bd7);const _0x1429fd=_0x1df51a[_0x3a7821(0x1d3)](_0x37a464=>_0x37a464[_0x3a7821(0x1d2)])[_0x3a7821(0x1b7)](_0x45536c=>({'title':_0x45536c[_0x3a7821(0x107)],'value':_0x45536c[_0x3a7821(0x1d2)]})),_0x31ca84=process[_0x3a7821(0x1ea)]['rows']||0x3c,_0x59a366=Math['max'](0x28,Math['floor'](_0x31ca84*0x2/0x3)),_0x4afa28=await a42_0x454db6({'type':'autocomplete','name':_0x3a7821(0x1d2),'message':_0x3a7821(0x132),'choices':_0x1429fd,'initial':-0x1,'limit':_0x59a366,'clearFirst':!![],'fallback':{'title':_0x3a7821(0x204),'value':null},'suggest':(_0x1e4f30,_0x4b2e71)=>{const _0x569049=_0x3a7821;if(!_0x1e4f30)return Promise['resolve'](_0x4b2e71);const _0x9c00dd=_0x4b2e71['filter'](_0x12baec=>{const _0x274df3=a42_0x5ddd,_0x199225=_0x12baec;return _0x199225['title'][_0x274df3(0xdd)]()['includes'](_0x1e4f30[_0x274df3(0xdd)]());});return Promise[_0x569049(0x15a)](_0x9c00dd);}}),_0x63b033=()=>{const _0x16cc8c=_0x3a7821;process[_0x16cc8c(0x1ea)][_0x16cc8c(0x13c)](_0x16cc8c(0xe1)),process['stdout'][_0x16cc8c(0x13c)](_0x16cc8c(0xe1)),process['stdout']['write'](_0x16cc8c(0xe1));},_0x137483=_0x4afa28&&_0x4afa28[_0x3a7821(0x1d2)]&&_0x4afa28[_0x3a7821(0x1d2)]!==null&&_0x4afa28[_0x3a7821(0x1d2)][_0x3a7821(0x14b)]()!=='';if(!_0x137483){_0x63b033(),console[_0x3a7821(0x201)](a42_0x1ce5f2[_0x3a7821(0xce)](_0x3a7821(0x1cd)));return;}_0x63b033();const _0x32fb6d=_0x26b748[_0x3a7821(0x207)](_0x249af0=>_0x249af0['lastAttempt']?.['id']===_0x4afa28[_0x3a7821(0x1d2)]);if(_0x32fb6d){const _0x3aa838=_0x32fb6d[_0x3a7821(0x151)]?.[_0x3a7821(0x1c3)]||'?',_0x54aaea=_0x32fb6d[_0x3a7821(0x21a)]?.[_0x3a7821(0x1c3)]||'?';console[_0x3a7821(0x201)](_0x3a7821(0x8b)+a42_0x1ce5f2[_0x3a7821(0xce)](_0x3aa838)+',\x20Workflow:\x20'+a42_0x1ce5f2['dim'](_0x54aaea));}const _0x5a5701=new WorkflowTimelineCommand();await _0x5a5701[_0x3a7821(0x141)]({'args':[],'options':{..._0x5d5d18,'attemptId':_0x4afa28['attemptId']},'tdx':_0xb63c46});}[a42_0x295940(0x82)](_0x20e8c4,_0x6a27ec){const _0x355074=a42_0x295940,_0x4b9538=new Map();for(const _0x588059 of _0x20e8c4){_0x588059['id']&&_0x588059['lastAttempt']?.['id']&&_0x4b9538[_0x355074(0x190)](_0x588059['id'],_0x588059[_0x355074(0x150)]['id']);}const _0x12c37e=[];let _0x2c924c='';const _0x4c733c=this['renderSessionsTimeline'](_0x20e8c4,_0x6a27ec),_0x3f5ced=_0x4c733c[_0x355074(0xed)]('\x0a');for(const _0x3628d4 of _0x3f5ced){if(_0x3628d4[_0x355074(0x16c)](_0x355074(0x86))||_0x3628d4['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x2c924c=_0x3628d4;else{if(_0x3628d4[_0x355074(0x115)](/^[✅❌🔄🛑⏳]/)){const _0x518441=_0x3628d4[_0x355074(0x115)](/#(\d+)/),_0xf849bf=_0x518441?_0x518441[0x1]:null,_0x13d5ee=_0xf849bf?_0x4b9538[_0x355074(0x1fd)](_0xf849bf)||null:null,_0x5adb69=_0x20e8c4['find'](_0x1d0238=>_0x1d0238['id']===_0xf849bf),_0x3b47f1=_0x5adb69?.[_0x355074(0x151)]?.[_0x355074(0x1c3)]||'';_0x12c37e[_0x355074(0x14e)]({'displayLine':_0x3628d4,'attemptId':_0x13d5ee,'projectName':_0x3b47f1});}}}return{'timelineRows':_0x12c37e,'timeAxisHeader':_0x2c924c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]='workflow:attempts';[a42_0x295940(0x12d)]=a42_0x295940(0x170);async['execute'](_0x4feed5){const _0x29b08c=a42_0x295940,{options:_0xaa49ce,args:_0x3950b7,tdx:_0x1ddd81}=_0x4feed5,_0x14343a=this[_0x29b08c(0xd7)](_0x3950b7,_0xaa49ce);if(!_0x14343a)return 0x1;const {projectName:_0x1c2e2f,workflowName:_0x24a59a}=_0x14343a,_0xeb6077=_0xaa49ce[_0x29b08c(0xc8)];if(_0xaa49ce[_0x29b08c(0x10b)]){if(_0x1c2e2f&&_0x24a59a)console[_0x29b08c(0x1cc)]('Filter:\x20'+_0x1c2e2f+'.'+_0x24a59a);else _0x1c2e2f&&console['error']('Filter:\x20project='+_0x1c2e2f);_0xeb6077&&console[_0x29b08c(0x1cc)](_0x29b08c(0x1a3));}const _0x4d24ae=await withSpinner(_0x29b08c(0x163),()=>_0x1ddd81[_0x29b08c(0x21a)][_0x29b08c(0xf0)]({'projectName':_0x1c2e2f,'workflowName':_0x24a59a,'includeRetried':_0xeb6077,'limit':_0xaa49ce[_0x29b08c(0x14f)]}),{'verbose':_0xaa49ce[_0x29b08c(0x10b)]}),_0x3e712f=_0x4d24ae[_0x29b08c(0xf3)],_0x857dd0=_0xaa49ce['limit']||0x64,_0x28c003=_0x3e712f['length']>=_0x857dd0?a42_0x1ce5f2[_0x29b08c(0xce)](_0x29b08c(0xb7)):'';console[_0x29b08c(0x1cc)](_0x29b08c(0x9b)+_0x3e712f['length']+_0x29b08c(0xb2)+(_0x3e712f['length']!==0x1?'s':'')+_0x28c003);if(_0xaa49ce[_0x29b08c(0x6d)]==='json'||_0xaa49ce['format']==='jsonl'||_0xaa49ce[_0x29b08c(0x6d)]===_0x29b08c(0x6a))await handleSDKOutput(_0x3e712f,_0xaa49ce);else{if(_0x3e712f['length']===0x0){if(_0x1c2e2f&&_0x24a59a)console[_0x29b08c(0x201)](_0x29b08c(0x1ae)+_0x1c2e2f+'.'+_0x24a59a);else _0x1c2e2f?console[_0x29b08c(0x201)](_0x29b08c(0x146)+_0x1c2e2f):console['log'](_0x29b08c(0x8c));}else{const _0x30414b=_0xaa49ce['site'],_0x26fba5=_0x3e712f[_0x29b08c(0x1b7)](_0x1024e2=>{const _0x431b99=_0x29b08c,_0x457e39=a42_0x1ce5f2['dim']('#'+_0x1024e2['id']),_0x57423d=_0x1024e2[_0x431b99(0x151)]?.['id'],_0x180bec=_0x1024e2['session_id']||_0x1024e2[_0x431b99(0xe9)],_0x2bbb5c=_0x57423d&&_0x180bec?hyperlink(_0x457e39,getWorkflowAttemptUrl(_0x30414b,_0x57423d,_0x180bec,_0x1024e2['id'])):_0x457e39,{icon:_0x2fb42a,text:_0x148125}=getAttemptStatusDisplay(_0x1024e2),_0x1cbf5f=(_0x1024e2['project']?.[_0x431b99(0x1c3)]||'?')+'.'+(_0x1024e2[_0x431b99(0x21a)]?.[_0x431b99(0x1c3)]||'?'),_0x1b856c=_0x1024e2[_0x431b99(0x121)]?a42_0x1ce5f2[_0x431b99(0xce)](_0x1024e2[_0x431b99(0x121)]):'';return(_0x2bbb5c+'\x20'+_0x2fb42a+(_0x148125?'\x20'+_0x148125:'')+'\x20'+_0x1cbf5f+'\x20'+_0x1b856c)[_0x431b99(0x1b6)]();});await writeOutput(_0x26fba5[_0x29b08c(0xc2)]('\x0a'),_0xaa49ce[_0x29b08c(0x206)],_0x29b08c(0x182));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x11b);[a42_0x295940(0x12d)]=a42_0x295940(0x177);async['execute'](_0x5a9718){const _0x538311=a42_0x295940,{options:_0x4fe8c3,args:_0x1ee7bf,tdx:_0x1eea1a}=_0x5a9718,_0x5f2c26=_0x1ee7bf[0x0];if(!_0x5f2c26)return console[_0x538311(0x1cc)](_0x538311(0x178)),0x1;_0x4fe8c3[_0x538311(0x10b)]&&console[_0x538311(0x1cc)]('Attempt\x20ID:\x20'+_0x5f2c26);const _0x35213b=await withSpinner(_0x538311(0x74),()=>_0x1eea1a[_0x538311(0x21a)][_0x538311(0x80)](_0x5f2c26),{'verbose':_0x4fe8c3[_0x538311(0x10b)]}),_0x587fbc=_0x35213b[_0x538311(0xf3)];let _0x50b27e;!_0x587fbc[_0x538311(0xb0)]?_0x50b27e=_0x587fbc['cancelRequested']?'canceling':_0x538311(0x133):_0x50b27e=_0x587fbc[_0x538311(0x1be)]?'success':_0x538311(0x1cc);let _0x493ae0;if(_0x587fbc[_0x538311(0xcd)]&&_0x587fbc['finishedAt']){const _0x5e317f=new Date(_0x587fbc[_0x538311(0xcd)])[_0x538311(0x102)](),_0x1512f7=new Date(_0x587fbc[_0x538311(0x18a)])[_0x538311(0x102)]();_0x493ae0=Math['round']((_0x1512f7-_0x5e317f)/0x3e8);}const _0x12de3b={'attempt_id':_0x587fbc['id'],'status':_0x50b27e,..._0x587fbc[_0x538311(0x131)]!==undefined&&{'index':_0x587fbc['index']},..._0x587fbc[_0x538311(0x151)]&&{'project':_0x587fbc['project']['name']},..._0x587fbc[_0x538311(0x21a)]&&{'workflow':_0x587fbc[_0x538311(0x21a)][_0x538311(0x1c3)]},..._0x587fbc['sessionId']&&{'session_id':_0x587fbc[_0x538311(0xe9)]},..._0x587fbc[_0x538311(0x121)]&&{'session_time':_0x587fbc[_0x538311(0x121)]},..._0x587fbc['retryAttemptName']&&{'retry_attempt':_0x587fbc[_0x538311(0x11f)]},..._0x493ae0!==undefined&&{'duration_sec':_0x493ae0},..._0x587fbc[_0x538311(0xcd)]&&{'created_at':_0x587fbc[_0x538311(0xcd)]},..._0x587fbc[_0x538311(0x18a)]&&{'finished_at':_0x587fbc[_0x538311(0x18a)]},...Object[_0x538311(0x13b)](_0x587fbc[_0x538311(0x1a5)])[_0x538311(0x1fc)]>0x0&&{'params':_0x587fbc[_0x538311(0x1a5)]}};return await handleSingleObjectOutput(_0x12de3b,_0x4fe8c3),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x14d);['description']='Show\x20tasks\x20for\x20an\x20attempt';async[a42_0x295940(0x141)](_0x14b101){const _0x532e26=a42_0x295940,{options:_0x27a447,args:_0xc10998,tdx:_0x469b03}=_0x14b101,_0x32e1a8=_0xc10998[0x0];if(!_0x32e1a8)return console[_0x532e26(0x1cc)](_0x532e26(0x178)),0x1;const _0x49b052=_0x27a447['includeSubtasks'];_0x27a447[_0x532e26(0x10b)]&&(console[_0x532e26(0x1cc)](_0x532e26(0x100)+_0x32e1a8),_0x49b052&&console[_0x532e26(0x1cc)](_0x532e26(0x1ec)));const _0x589481=await withSpinner(_0x532e26(0xcf),()=>_0x469b03['workflow'][_0x532e26(0x160)](_0x32e1a8,_0x49b052||![]),{'verbose':_0x27a447[_0x532e26(0x10b)]}),_0x2232a9=_0x589481[_0x532e26(0xf3)];return console['error']('✔\x20Found\x20'+_0x2232a9[_0x532e26(0x1fc)]+'\x20task'+(_0x2232a9[_0x532e26(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x2232a9,_0x27a447),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x21f);[a42_0x295940(0x12d)]=a42_0x295940(0x10d);async[a42_0x295940(0x141)](_0x217e25){const _0x14ee27=a42_0x295940,{options:_0x24374e,args:_0x2cc9e4,tdx:_0x32c39e}=_0x217e25,_0xf7702c=_0x2cc9e4[0x0];let _0x5e5eb0=_0x2cc9e4[0x1];if(!_0xf7702c)return console[_0x14ee27(0x1cc)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x24374e['verbose']&&(console[_0x14ee27(0x1cc)]('Attempt\x20ID:\x20'+_0xf7702c),_0x5e5eb0&&console[_0x14ee27(0x1cc)](_0x14ee27(0x12a)+_0x5e5eb0));const _0xb113ee=await withSpinner(_0x14ee27(0x165),()=>_0x32c39e[_0x14ee27(0x21a)][_0x14ee27(0x16f)](_0xf7702c,_0x5e5eb0),{'verbose':_0x24374e[_0x14ee27(0x10b)]}),_0xacc772=_0xb113ee[_0x14ee27(0xf3)];if(_0xacc772['length']===0x0)return console[_0x14ee27(0x1cc)](_0x14ee27(0x162)),0x0;if(!_0x5e5eb0&&(_0x24374e['json']||_0x24374e[_0x14ee27(0x6d)]))return await handleSDKOutput(_0xacc772,_0x24374e),0x0;if(!_0x5e5eb0){const _0x409b60=_0xacc772[_0x14ee27(0x1b7)](_0x5ea3f9=>({'title':_0x5ea3f9[_0x14ee27(0x7a)]+'\x20('+formatBytes(_0x5ea3f9[_0x14ee27(0xe4)])+')','value':_0x5ea3f9['taskName']})),_0x15fd05=await a42_0x454db6({'type':_0x14ee27(0xa8),'name':'task','message':_0x14ee27(0x1bd),'choices':_0x409b60});if(!_0x15fd05['task'])return console[_0x14ee27(0x1cc)]('Cancelled'),0x0;_0x5e5eb0=_0x15fd05[_0x14ee27(0x124)];}const _0x2fd247=await withSpinner(_0x14ee27(0x93),()=>_0x32c39e[_0x14ee27(0x21a)][_0x14ee27(0xa4)](_0xf7702c,_0x5e5eb0),{'verbose':_0x24374e[_0x14ee27(0x10b)]}),_0x4ecd6c=_0x2fd247[_0x14ee27(0xf3)];return _0x4ecd6c?console[_0x14ee27(0x201)](_0x4ecd6c):console[_0x14ee27(0x1cc)](_0x14ee27(0x111)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x9f);[a42_0x295940(0x12d)]=a42_0x295940(0xee);async[a42_0x295940(0x141)](_0x567371){const _0x4829ca=a42_0x295940,{options:_0x3c55f7,args:_0x57796e,tdx:_0x447e9b}=_0x567371,_0xeab044=_0x57796e[0x0];if(!_0xeab044)return console[_0x4829ca(0x1cc)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1976b5=_0x3c55f7[_0x4829ca(0xb9)];_0x3c55f7['verbose']&&(console[_0x4829ca(0x1cc)](_0x4829ca(0x100)+_0xeab044),_0x1976b5&&console[_0x4829ca(0x1cc)]('Reason:\x20'+_0x1976b5));if(!_0x3c55f7[_0x4829ca(0x16d)]){const _0x52f93d=await confirmKey(_0x4829ca(0x6c)+_0xeab044+'?');if(!_0x52f93d)return console[_0x4829ca(0x1cc)](_0x4829ca(0x1cd)),0x0;}const _0x567be2=await withSpinner('Killing\x20attempt...',()=>_0x447e9b[_0x4829ca(0x21a)]['kill'](_0xeab044,_0x1976b5),{'verbose':_0x3c55f7[_0x4829ca(0x10b)]}),_0x187bfb=_0x567be2[_0x4829ca(0xf3)];return console[_0x4829ca(0x1cc)]('✔\x20'+_0x187bfb),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x295940(0xaa);['description']=a42_0x295940(0x185);async[a42_0x295940(0x141)](_0x1d7962){const _0x331f35=a42_0x295940,{options:_0x51b2dd,args:_0x570e9b,tdx:_0x4ccaac}=_0x1d7962,_0x556c9e=_0x570e9b[0x0];if(!_0x556c9e)return console[_0x331f35(0x1cc)](_0x331f35(0xc5)),console['error'](_0x331f35(0xd4)),0x1;let _0x49064e=![],_0x106d2a=_0x556c9e;if(_0x556c9e[_0x331f35(0x16c)](_0x331f35(0xfc)))_0x49064e=!![],_0x106d2a=_0x556c9e['substring'](0x8);else{if(_0x556c9e['startsWith'](_0x331f35(0x149)))_0x49064e=![],_0x106d2a=_0x556c9e[_0x331f35(0x8d)](0x8);else return console['error']('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x331f35(0x1cc)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x34eec2=_0x51b2dd[_0x331f35(0x6f)],_0x220083=_0x51b2dd[_0x331f35(0x218)],_0x5ade68=_0x51b2dd[_0x331f35(0x1a5)],_0x36597f=_0x51b2dd[_0x331f35(0x7e)];_0x51b2dd['verbose']&&(console[_0x331f35(0x1cc)](_0x331f35(0x12b)+(_0x49064e?'session':_0x331f35(0x80))+'\x20'+_0x106d2a),_0x34eec2&&console['error'](_0x331f35(0x1e3)+_0x34eec2),_0x220083&&console[_0x331f35(0x1cc)](_0x331f35(0x1f2)+_0x220083),_0x5ade68&&console[_0x331f35(0x1cc)](_0x331f35(0x123)+_0x5ade68),_0x36597f&&console['error']('Force:\x20yes'));let _0x32769a;if(_0x5ade68)try{if(_0x5ade68[_0x331f35(0x16c)]('@')){const _0xc06983=await import(_0x331f35(0x127)),_0x27f0c3=_0x5ade68[_0x331f35(0x8d)](0x1),_0x5d12be=await _0xc06983[_0x331f35(0xde)](_0x27f0c3,_0x331f35(0x172));_0x32769a=JSON[_0x331f35(0x7b)](_0x5d12be);}else _0x32769a=JSON[_0x331f35(0x7b)](_0x5ade68);}catch{return console[_0x331f35(0x1cc)](_0x331f35(0x1b8)),0x1;}if(!_0x51b2dd[_0x331f35(0x16d)]){const _0x1ec175=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x49064e?_0x331f35(0xc9):'attempt')+'\x20'+_0x106d2a+'?');if(!_0x1ec175)return console['error'](_0x331f35(0x1cd)),0x0;}let _0x4c2bcd;_0x49064e?_0x4c2bcd=await withSpinner('Retrying\x20session...',()=>_0x4ccaac[_0x331f35(0x21a)][_0x331f35(0x1c6)](_0x106d2a,{'fromTask':_0x34eec2,'retryParams':_0x32769a}),{'verbose':_0x51b2dd['verbose']}):_0x4c2bcd=await withSpinner(_0x331f35(0x109),()=>_0x4ccaac['workflow'][_0x331f35(0x1e6)](_0x106d2a,{'resumeFrom':_0x220083,'retryParams':_0x32769a,'force':_0x36597f}),{'verbose':_0x51b2dd[_0x331f35(0x10b)]});const _0x40e115=_0x4c2bcd[_0x331f35(0xf3)];return console['error'](_0x331f35(0x212)),console['error'](_0x331f35(0x71)+_0x40e115[_0x331f35(0x1d2)]),console['error'](_0x331f35(0xae)+_0x40e115[_0x331f35(0xe9)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a42_0x295940(0x18e);[a42_0x295940(0x12d)]=a42_0x295940(0xf2);async[a42_0x295940(0x141)](_0xe5fe32){const _0x1513d5=a42_0x295940,{options:_0x8b6f22,args:_0x4667c8,tdx:_0x1b8d94}=_0xe5fe32;let _0x1f8e85=_0x4667c8[0x0];if(!_0x1f8e85){const _0x2ca6d9=this[_0x1513d5(0xc3)]([],_0x8b6f22),_0x253e20=await withSpinner(_0x1513d5(0x1ed),()=>_0x1b8d94[_0x1513d5(0x21a)][_0x1513d5(0xa6)](_0x2ca6d9,{'limit':_0x8b6f22[_0x1513d5(0x14f)]}),{'verbose':_0x8b6f22['verbose']}),_0x3c6d31=_0x253e20[_0x1513d5(0xf3)];if(_0x3c6d31[_0x1513d5(0x1fc)]===0x0)return console[_0x1513d5(0x1cc)](_0x1513d5(0xec)),!_0x2ca6d9&&console[_0x1513d5(0x1cc)](a42_0x1ce5f2['dim'](_0x1513d5(0x16e))),0x1;const _0x45fee7=_0x3c6d31['map'](_0x56a1ac=>({'title':_0x56a1ac[_0x1513d5(0x151)]?.[_0x1513d5(0x1c3)]+'.'+_0x56a1ac[_0x1513d5(0x1c3)],'value':_0x56a1ac['project']?.[_0x1513d5(0x1c3)]+'.'+_0x56a1ac[_0x1513d5(0x1c3)],'description':_0x56a1ac['revision']?_0x1513d5(0x18c)+_0x56a1ac[_0x1513d5(0x148)]:undefined})),_0x277e7d=await a42_0x454db6({'type':_0x1513d5(0xa8),'name':_0x1513d5(0x21a),'message':_0x1513d5(0x21c),'choices':_0x45fee7});if(!_0x277e7d[_0x1513d5(0x21a)])return 0x1;_0x1f8e85=_0x277e7d[_0x1513d5(0x21a)];}if(!_0x1f8e85[_0x1513d5(0x1a4)]('.')){const _0x2fe02a=this[_0x1513d5(0xc3)]([],_0x8b6f22);if(_0x2fe02a)_0x1f8e85=_0x2fe02a+'.'+_0x1f8e85;else return console[_0x1513d5(0x1cc)](a42_0x1ce5f2['red'](_0x1513d5(0xa3)),_0x1513d5(0x1b0)),console[_0x1513d5(0x1cc)](a42_0x1ce5f2[_0x1513d5(0xce)](_0x1513d5(0x16e))),0x1;}const _0x5bc05e=_0x8b6f22[_0x1513d5(0xb3)],_0x5e6e00=_0x8b6f22[_0x1513d5(0x121)],_0x3478d3={};if(_0x5bc05e&&Array[_0x1513d5(0x1a9)](_0x5bc05e))for(const _0x4c84c5 of _0x5bc05e){const _0xcccab7=_0x4c84c5['indexOf']('=');if(_0xcccab7===-0x1)return console[_0x1513d5(0x1cc)](_0x1513d5(0x1f3)+_0x4c84c5),console[_0x1513d5(0x1cc)](_0x1513d5(0x1b9)),0x1;const _0x144043=_0x4c84c5[_0x1513d5(0x8d)](0x0,_0xcccab7),_0x1dcea9=_0x4c84c5[_0x1513d5(0x8d)](_0xcccab7+0x1);try{_0x3478d3[_0x144043]=JSON[_0x1513d5(0x7b)](_0x1dcea9);}catch{_0x3478d3[_0x144043]=_0x1dcea9;}}_0x8b6f22[_0x1513d5(0x10b)]&&(console[_0x1513d5(0x1cc)](_0x1513d5(0x1ac)+_0x1f8e85),Object[_0x1513d5(0x13b)](_0x3478d3)[_0x1513d5(0x1fc)]>0x0&&console[_0x1513d5(0x1cc)]('Parameters:\x20'+JSON[_0x1513d5(0xda)](_0x3478d3)),_0x5e6e00&&console['error'](_0x1513d5(0xa7)+_0x5e6e00));const _0x402be7=await withSpinner(_0x1513d5(0x14a),()=>_0x1b8d94[_0x1513d5(0x21a)][_0x1513d5(0x126)](_0x1f8e85,_0x3478d3,{'sessionTime':_0x5e6e00}),{'verbose':_0x8b6f22[_0x1513d5(0x10b)]}),_0x4bfb69=_0x402be7[_0x1513d5(0xf3)];console[_0x1513d5(0x1cc)]('✔\x20Workflow\x20run\x20started'),console[_0x1513d5(0x1cc)]('\x20\x20Attempt\x20ID:\x20'+_0x4bfb69['id']),console[_0x1513d5(0x1cc)](_0x1513d5(0xae)+_0x4bfb69[_0x1513d5(0xe9)]),console[_0x1513d5(0x1cc)](_0x1513d5(0x9e)+_0x4bfb69['project']?.[_0x1513d5(0x1c3)]),console[_0x1513d5(0x1cc)](_0x1513d5(0xa1)+_0x4bfb69[_0x1513d5(0x21a)]?.['name']);if(_0x4bfb69['project']?.['id']&&_0x4bfb69['sessionId']&&_0x4bfb69['id']){const _0x581678=_0x8b6f22[_0x1513d5(0x6b)],_0x16300c=getConsoleUrl(_0x581678,'/app/workflows/'+_0x4bfb69[_0x1513d5(0x151)]['id']+_0x1513d5(0x116)+_0x4bfb69['sessionId']+_0x1513d5(0x1e8)+_0x4bfb69['id']);console[_0x1513d5(0x1cc)](_0x1513d5(0x188)+a42_0x1ce5f2[_0x1513d5(0x92)](_0x16300c));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x295940(0x1c3)]='workflow:download';[a42_0x295940(0x12d)]=a42_0x295940(0xe3);async['execute'](_0x4b8641){const _0x358dd4=a42_0x295940,{options:_0x5cbc41,args:_0x248e90,tdx:_0x4b7462}=_0x4b8641,_0x28b4a9=_0x248e90[0x0],_0x49e929=_0x248e90[0x1]||'.';if(!_0x28b4a9)return console[_0x358dd4(0x1cc)](_0x358dd4(0x1a1)),console['error'](_0x358dd4(0x9d)),0x1;const _0x1671af=_0x5cbc41[_0x358dd4(0x148)];_0x5cbc41[_0x358dd4(0x10b)]&&(console['error'](_0x358dd4(0x8b)+_0x28b4a9),console[_0x358dd4(0x1cc)]('Output\x20directory:\x20'+_0x49e929),_0x1671af&&console[_0x358dd4(0x1cc)](_0x358dd4(0xdf)+_0x1671af));const _0x1ce42f=await withSpinner(_0x358dd4(0x17d)+_0x28b4a9+'...',()=>_0x4b7462[_0x358dd4(0x21a)][_0x358dd4(0x81)](_0x28b4a9,_0x49e929,{'revision':_0x1671af}),{'verbose':_0x5cbc41['verbose']}),_0x196b14=_0x1ce42f[_0x358dd4(0xf3)];return console[_0x358dd4(0x1cc)]('✔\x20Downloaded\x20'+_0x196b14[_0x358dd4(0x183)]),console['error']('\x20\x20Revision:\x20'+_0x196b14['revision']),console[_0x358dd4(0x1cc)](_0x358dd4(0xd3)+_0x196b14['filesExtracted']),console[_0x358dd4(0x1cc)](_0x358dd4(0x113)+_0x49e929+'/'+_0x196b14[_0x358dd4(0x183)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a42_0x295940(0xf4);['description']=a42_0x295940(0x15f);async[a42_0x295940(0x141)](_0x22d3f2){const _0x542c9f=a42_0x295940,{options:_0x5ecad8,args:_0x2bcbd6,tdx:_0x411994}=_0x22d3f2;let _0x423e90='.',_0x3a82af=_0x5ecad8[_0x542c9f(0x1c3)];if(_0x2bcbd6[0x0]){const {promises:_0x47de86}=await import('fs');try{const _0x5d18b0=await _0x47de86[_0x542c9f(0x181)](_0x2bcbd6[0x0]);if(_0x5d18b0['isDirectory']())_0x423e90=_0x2bcbd6[0x0];else return console[_0x542c9f(0x1cc)](_0x542c9f(0x1f0)+_0x2bcbd6[0x0]+_0x542c9f(0x144)),0x1;}catch{_0x3a82af=_0x2bcbd6[0x0],_0x423e90='.';}}const _0x3b6182=_0x5ecad8[_0x542c9f(0x148)],_0x3035d1=_0x5ecad8[_0x542c9f(0x1f8)];_0x5ecad8[_0x542c9f(0x10b)]&&(console[_0x542c9f(0x1cc)]('Project\x20directory:\x20'+_0x423e90),_0x3a82af&&console['error'](_0x542c9f(0x104)+_0x3a82af),_0x3b6182&&console[_0x542c9f(0x1cc)](_0x542c9f(0xdf)+_0x3b6182),_0x3035d1&&console[_0x542c9f(0x1cc)](_0x542c9f(0xd8)));const _0x32b1eb=await withSpinner(_0x542c9f(0xea),()=>_0x411994[_0x542c9f(0x21a)][_0x542c9f(0x14e)](_0x423e90,{'projectName':_0x3a82af,'revision':_0x3b6182,'skipValidation':_0x3035d1}),{'verbose':_0x5ecad8[_0x542c9f(0x10b)]}),_0x1d5b4b=_0x32b1eb[_0x542c9f(0xf3)];return console[_0x542c9f(0x1cc)]('✔\x20Pushed\x20'+_0x1d5b4b['projectName']),console[_0x542c9f(0x1cc)](_0x542c9f(0x196)+_0x1d5b4b[_0x542c9f(0x120)]),console[_0x542c9f(0x1cc)](_0x542c9f(0x138)+_0x1d5b4b[_0x542c9f(0x148)]),await this['showWorkflowConsoleUrl'](_0x411994,_0x1d5b4b['projectName'],_0x5ecad8['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0xbc);[a42_0x295940(0x12d)]=a42_0x295940(0x1a2);async['execute'](_0x48756a){const _0x50b700=a42_0x295940,{options:_0x3b1255,args:_0x2154b0,tdx:_0x38d34f}=_0x48756a,_0xa9213c=_0x2154b0[0x0],_0xe9b00e=_0x2154b0[0x1];if(!_0xa9213c)return console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0x19b)](_0x50b700(0xa3)),'Project\x20name\x20is\x20required'),console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0xce)](_0x50b700(0x20a))),0x1;const _0x27b6b1=_0x3b1255[_0x50b700(0x148)];_0x3b1255[_0x50b700(0x10b)]&&(console[_0x50b700(0x1cc)]('Project:\x20'+_0xa9213c),_0xe9b00e&&console[_0x50b700(0x1cc)](_0x50b700(0x193)+_0xe9b00e),_0x27b6b1&&console[_0x50b700(0x1cc)](_0x50b700(0xdf)+_0x27b6b1),_0x3b1255[_0x50b700(0x112)]&&console['error'](_0x50b700(0x1f4)));const _0x3fe068=await withSpinner(_0x50b700(0x15b)+_0xa9213c+_0x50b700(0x208),()=>_0x38d34f[_0x50b700(0x21a)][_0x50b700(0x1af)](_0xa9213c,{'targetDir':_0xe9b00e,'revision':_0x27b6b1}),{'verbose':_0x3b1255[_0x50b700(0x10b)]}),_0x93ea70=_0x3fe068[_0x50b700(0xf3)];_0x93ea70[_0x50b700(0x98)]?console[_0x50b700(0x1cc)](_0x50b700(0xb4)+_0x93ea70[_0x50b700(0x183)]):console['error']('✔\x20Project:\x20'+_0x93ea70[_0x50b700(0x183)]);console[_0x50b700(0x1cc)](_0x50b700(0x138)+_0x93ea70[_0x50b700(0x148)]),console['error']('\x20\x20Target:\x20'+(a42_0x259164[_0x50b700(0x15c)](process[_0x50b700(0x1fe)](),_0x93ea70[_0x50b700(0x119)])||'.')),console[_0x50b700(0x1cc)](_0x50b700(0x161)+a42_0x1ce5f2[_0x50b700(0x205)]('+'+_0x93ea70['summary'][_0x50b700(0x1f5)]+'\x20new')+',\x20'+(a42_0x1ce5f2['yellow']('~'+_0x93ea70['summary'][_0x50b700(0x87)]+_0x50b700(0x13a))+',\x20')+(a42_0x1ce5f2[_0x50b700(0x19b)]('-'+_0x93ea70['summary'][_0x50b700(0xe2)]+'\x20deleted')+',\x20')+(''+a42_0x1ce5f2[_0x50b700(0xce)](_0x93ea70['summary'][_0x50b700(0x200)]+_0x50b700(0xab))));for(const _0x3910e7 of _0x93ea70[_0x50b700(0x175)]){_0x3910e7['type']===_0x50b700(0x87)&&_0x3910e7['diff']&&(console['error']('\x0a'+a42_0x1ce5f2[_0x50b700(0x92)](_0x50b700(0x18b)+_0x3910e7['path'])),console[_0x50b700(0x1cc)](_0x3910e7[_0x50b700(0x1e0)]));}if(!_0x93ea70['hasChanges'])return saveSessionContext({'workflow_project':_0x93ea70[_0x50b700(0x183)]},_0x3b1255[_0x50b700(0xc9)]),console[_0x50b700(0x1cc)](a42_0x1ce5f2['green'](_0x50b700(0x1c0))),console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0xce)](_0x50b700(0x9a)+_0x93ea70[_0x50b700(0x183)])),0x0;if(_0x3b1255[_0x50b700(0x112)])return console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0xc6)](_0x50b700(0x1b1))),0x0;if(!_0x3b1255['yes']){const _0x3c2abd=await confirmKey(_0x50b700(0x197));if(!_0x3c2abd)return console[_0x50b700(0x1cc)](_0x50b700(0x1cd)),0x0;}await withSpinner(_0x50b700(0x1c5),()=>_0x38d34f['workflow'][_0x50b700(0x12e)](_0x93ea70,{'revision':_0x27b6b1}),{'verbose':_0x3b1255['verbose']}),saveSessionContext({'workflow_project':_0x93ea70[_0x50b700(0x183)]},_0x3b1255[_0x50b700(0xc9)]),console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0x205)](_0x50b700(0x89)));const _0x1ffe88=a42_0x259164['relative'](process[_0x50b700(0x1fe)](),_0x93ea70[_0x50b700(0x119)])||'.';return console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0xce)](_0x50b700(0x113)+_0x1ffe88)),console[_0x50b700(0x1cc)](a42_0x1ce5f2[_0x50b700(0xce)](_0x50b700(0x9a)+_0x93ea70[_0x50b700(0x183)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a42_0x295940(0x108);[a42_0x295940(0x12d)]=a42_0x295940(0x153);async[a42_0x295940(0x141)](_0x969b50){const _0x45822b=a42_0x295940,{options:_0x32945f,args:_0x1c2774,tdx:_0x1a87d9}=_0x969b50,_0x5722a8=this[_0x45822b(0x184)](_0x1c2774,_0x32945f),_0x418110=_0x32945f[_0x45822b(0x148)],_0x47623f=_0x32945f[_0x45822b(0x1f8)];_0x32945f['verbose']&&(_0x5722a8&&console[_0x45822b(0x1cc)](_0x45822b(0x211)+_0x5722a8),_0x418110&&console[_0x45822b(0x1cc)](_0x45822b(0xdf)+_0x418110),_0x32945f[_0x45822b(0x112)]&&console['error'](_0x45822b(0x1f4)),_0x47623f&&console[_0x45822b(0x1cc)](_0x45822b(0xd8)));let _0xbb0683;try{_0xbb0683=await withSpinner('Analyzing\x20changes...',()=>_0x1a87d9[_0x45822b(0x21a)][_0x45822b(0x219)]({'sourceDir':_0x5722a8,'revision':_0x418110,'skipValidation':_0x47623f}),{'verbose':_0x32945f[_0x45822b(0x10b)]});}catch(_0x532505){if(_0x532505 instanceof Error&&_0x532505['message'][_0x45822b(0x1a4)](_0x45822b(0x1f9)))return console['error'](a42_0x1ce5f2['red'](_0x45822b(0xa3)),_0x45822b(0x21b)),_0x32945f[_0x45822b(0x1cb)]?console[_0x45822b(0x1cc)](a42_0x1ce5f2[_0x45822b(0xce)](_0x45822b(0x130)+_0x32945f[_0x45822b(0x1cb)]+_0x45822b(0x191)+_0x32945f[_0x45822b(0x1cb)]+'\x27')):console['error'](a42_0x1ce5f2['dim']('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x532505;}const _0x8407f=_0xbb0683[_0x45822b(0xf3)];console[_0x45822b(0x1cc)](_0x45822b(0x77)+_0x8407f[_0x45822b(0x183)]),console[_0x45822b(0x1cc)]('\x20\x20Source:\x20'+_0x8407f[_0x45822b(0xe8)]),console[_0x45822b(0x1cc)](_0x45822b(0x138)+_0x8407f['revision']),console[_0x45822b(0x1cc)]('\x20\x20Changes:\x20'+a42_0x1ce5f2[_0x45822b(0x205)]('+'+_0x8407f['summary'][_0x45822b(0x1f5)]+_0x45822b(0x1f7))+',\x20'+(a42_0x1ce5f2[_0x45822b(0xc6)]('~'+_0x8407f[_0x45822b(0xd5)][_0x45822b(0x87)]+_0x45822b(0x13a))+',\x20')+(a42_0x1ce5f2[_0x45822b(0x19b)]('-'+_0x8407f[_0x45822b(0xd5)][_0x45822b(0xe2)]+_0x45822b(0x16a))+',\x20')+(''+a42_0x1ce5f2['dim'](_0x8407f[_0x45822b(0xd5)][_0x45822b(0x200)]+'\x20unchanged')));for(const _0xbf0f59 of _0x8407f[_0x45822b(0x175)]){_0xbf0f59[_0x45822b(0x1eb)]==='modified'&&_0xbf0f59['diff']&&(console[_0x45822b(0x1cc)]('\x0a'+a42_0x1ce5f2[_0x45822b(0x92)](_0x45822b(0x18b)+_0xbf0f59['path'])),console[_0x45822b(0x1cc)](_0xbf0f59[_0x45822b(0x1e0)]));}if(!_0x8407f[_0x45822b(0x1a0)])return console['error'](a42_0x1ce5f2[_0x45822b(0x205)](_0x45822b(0x176))),await this[_0x45822b(0x1b2)](_0x1a87d9,_0x8407f[_0x45822b(0x183)],_0x32945f['site']),0x0;if(_0x32945f['dryRun'])return console[_0x45822b(0x1cc)](a42_0x1ce5f2[_0x45822b(0xc6)](_0x45822b(0xc0))),0x0;if(!_0x32945f[_0x45822b(0x16d)]){const _0x4327c5=await confirmKey(_0x45822b(0xcb));if(!_0x4327c5)return console[_0x45822b(0x1cc)](_0x45822b(0x1cd)),0x0;}const _0x3d2e3f=await withSpinner('Pushing\x20project...',()=>_0x1a87d9[_0x45822b(0x21a)][_0x45822b(0x1df)](_0x8407f),{'verbose':_0x32945f[_0x45822b(0x10b)]}),_0x287d40=_0x3d2e3f[_0x45822b(0xf3)];return console['error'](a42_0x1ce5f2[_0x45822b(0x205)](_0x45822b(0xd9))),console[_0x45822b(0x1cc)]('\x20\x20Project\x20ID:\x20'+_0x287d40[_0x45822b(0x120)]),console[_0x45822b(0x1cc)](_0x45822b(0x138)+_0x287d40[_0x45822b(0x148)]),await this[_0x45822b(0x1b2)](_0x1a87d9,_0x287d40[_0x45822b(0x183)],_0x32945f[_0x45822b(0x6b)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x1e7);[a42_0x295940(0x12d)]=a42_0x295940(0x19a);async['execute'](_0x586603){const _0x327b1e=a42_0x295940,{options:_0x2bab90,args:_0x25a09d,tdx:_0x232832}=_0x586603,_0x2807b5=this[_0x327b1e(0x184)](_0x25a09d,_0x2bab90),_0x48b9d9=_0x2bab90[_0x327b1e(0x1c3)],_0xe21157=_0x2bab90[_0x327b1e(0x148)],_0x5971ed=_0x2bab90[_0x327b1e(0x1f8)];if(!_0x2807b5)return console['error'](a42_0x1ce5f2[_0x327b1e(0x19b)](_0x327b1e(0xa3)),_0x327b1e(0x145)),console[_0x327b1e(0x1cc)](a42_0x1ce5f2[_0x327b1e(0xce)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a42_0x1ce5f2[_0x327b1e(0xce)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x48b9d9)return console['error'](a42_0x1ce5f2['red'](_0x327b1e(0xa3)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x327b1e(0x1cc)](a42_0x1ce5f2['dim'](_0x327b1e(0xe5))),0x1;_0x2bab90[_0x327b1e(0x10b)]&&(console[_0x327b1e(0x1cc)](_0x327b1e(0x211)+_0x2807b5),console['error'](_0x327b1e(0x1e9)+_0x48b9d9),_0xe21157&&console[_0x327b1e(0x1cc)](_0x327b1e(0xdf)+_0xe21157),_0x2bab90[_0x327b1e(0x112)]&&console['error'](_0x327b1e(0x1f4)),_0x5971ed&&console[_0x327b1e(0x1cc)](_0x327b1e(0xd8)));const _0x5b7b15=await withSpinner('Analyzing\x20project...',()=>_0x232832['workflow'][_0x327b1e(0x12c)](_0x2807b5,_0x48b9d9,{'revision':_0xe21157,'skipValidation':_0x5971ed}),{'verbose':_0x2bab90[_0x327b1e(0x10b)]}),_0x2a05a9=_0x5b7b15[_0x327b1e(0xf3)];console[_0x327b1e(0x1cc)]('Source:\x20'+_0x2a05a9['sourceDir']);_0x2a05a9[_0x327b1e(0xb6)]&&console[_0x327b1e(0x1cc)](_0x327b1e(0xfb)+_0x2a05a9[_0x327b1e(0xb6)]);console[_0x327b1e(0x1cc)](_0x327b1e(0x1e9)+_0x2a05a9[_0x327b1e(0x94)]),console['error'](_0x327b1e(0xdf)+_0x2a05a9['revision']),console[_0x327b1e(0x1cc)](_0x327b1e(0x1ff)+_0x2a05a9[_0x327b1e(0x215)]);_0x2a05a9['targetExists']&&(console[_0x327b1e(0x1cc)](a42_0x1ce5f2[_0x327b1e(0xc6)](_0x327b1e(0x11d)+_0x2a05a9[_0x327b1e(0x94)]+_0x327b1e(0x186)+_0x2a05a9[_0x327b1e(0xba)]+')')),console[_0x327b1e(0x1cc)](a42_0x1ce5f2[_0x327b1e(0xc6)](_0x327b1e(0x10c))));if(_0x2bab90[_0x327b1e(0x112)])return console['error'](a42_0x1ce5f2[_0x327b1e(0xc6)](_0x327b1e(0x118))),0x0;if(!_0x2bab90['yes']){const _0x60d5cf=_0x2a05a9[_0x327b1e(0xb6)]||a42_0x259164[_0x327b1e(0x1e4)](_0x2807b5),_0x2ac6c6=_0x2a05a9[_0x327b1e(0x99)]?_0x327b1e(0x166)+_0x48b9d9+_0x327b1e(0x209):_0x327b1e(0xf5)+_0x60d5cf+_0x327b1e(0x1d5)+_0x48b9d9+'\x22?',_0x5c60bf=await confirmKey(_0x2ac6c6);if(!_0x5c60bf)return console[_0x327b1e(0x1cc)]('Cancelled'),0x0;}const _0x56df86=await withSpinner(_0x2a05a9['targetExists']?'Updating\x20'+_0x48b9d9+_0x327b1e(0x208):_0x327b1e(0x1e5)+_0x48b9d9+_0x327b1e(0x208),()=>_0x232832[_0x327b1e(0x21a)]['executeCloneProject'](_0x2a05a9),{'verbose':_0x2bab90[_0x327b1e(0x10b)]}),_0x4a8996=_0x56df86[_0x327b1e(0xf3)];return console[_0x327b1e(0x1cc)](a42_0x1ce5f2[_0x327b1e(0x205)](_0x2a05a9[_0x327b1e(0x99)]?_0x327b1e(0x19d):'✔\x20Clone\x20complete')),console[_0x327b1e(0x1cc)](_0x327b1e(0x9e)+_0x4a8996['newProjectName']),console[_0x327b1e(0x1cc)]('\x20\x20Project\x20ID:\x20'+_0x4a8996[_0x327b1e(0x1ef)]),console[_0x327b1e(0x1cc)](_0x327b1e(0x138)+_0x4a8996['revision']),await this[_0x327b1e(0x1b2)](_0x232832,_0x4a8996['newProjectName'],_0x2bab90[_0x327b1e(0x6b)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x187);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x596462){const _0x7bd7a4=a42_0x295940,{options:_0x4c6ae2,args:_0x366371,tdx:_0x3952b4}=_0x596462,_0x3040cf=_0x366371[0x0];if(!_0x3040cf)return console[_0x7bd7a4(0x1cc)](_0x7bd7a4(0x194)),console[_0x7bd7a4(0x1cc)](_0x7bd7a4(0x180)),0x1;_0x4c6ae2['verbose']&&console[_0x7bd7a4(0x1cc)](_0x7bd7a4(0x8b)+_0x3040cf);if(!_0x4c6ae2[_0x7bd7a4(0x16d)]){const _0x4ff48e=await confirmKey(_0x7bd7a4(0x1d9)+_0x3040cf+_0x7bd7a4(0xdc));if(!_0x4ff48e)return console[_0x7bd7a4(0x1cc)]('Cancelled'),0x0;}const _0x9bd45a=await withSpinner(_0x7bd7a4(0x1b3)+_0x3040cf+'...',()=>_0x3952b4[_0x7bd7a4(0x21a)][_0x7bd7a4(0xdb)](_0x3040cf),{'verbose':_0x4c6ae2[_0x7bd7a4(0x10b)]}),_0x5dfed3=_0x9bd45a[_0x7bd7a4(0xf3)];return console[_0x7bd7a4(0x1cc)](_0x7bd7a4(0x1bc)+_0x5dfed3[_0x7bd7a4(0x183)]),console[_0x7bd7a4(0x1cc)]('\x20\x20Project\x20ID:\x20'+_0x5dfed3['projectId']),0x0;}}export function parseKeyValue(_0xd34f0b){const _0x21be08=a42_0x295940,_0x567f69=_0xd34f0b[_0x21be08(0x13d)]('=');if(_0x567f69===-0x1)throw new Error(_0x21be08(0x1c1)+_0xd34f0b+_0x21be08(0x1da));const _0x362522=_0xd34f0b['substring'](0x0,_0x567f69),_0x2db4a4=_0xd34f0b[_0x21be08(0x8d)](_0x567f69+0x1);if(!_0x362522)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x362522,'value':_0x2db4a4};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x164);[a42_0x295940(0x12d)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a42_0x295940(0x141)](_0x1c410d){const _0x26a628=a42_0x295940,{options:_0x3e9926,args:_0x4cf4cc,tdx:_0x1a37a2}=_0x1c410d,_0x4a9b66=this[_0x26a628(0x1d1)](_0x4cf4cc,_0x3e9926);if(!_0x4a9b66)return 0x1;_0x3e9926[_0x26a628(0x10b)]&&console['error'](_0x26a628(0x8b)+_0x4a9b66);const _0x2e8f6a=await withSpinner(_0x26a628(0x83),()=>_0x1a37a2['workflow']['listSecrets'](_0x4a9b66),{'verbose':_0x3e9926[_0x26a628(0x10b)]}),{secrets:_0x35a1ef}=_0x2e8f6a[_0x26a628(0xf3)];return console['error'](_0x26a628(0x9b)+_0x35a1ef['length']+_0x26a628(0x134)+(_0x35a1ef[_0x26a628(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x35a1ef,_0x3e9926),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x117);[a42_0x295940(0x12d)]=a42_0x295940(0x1fb);async[a42_0x295940(0x141)](_0x2ee1bd){const _0x31aef4=a42_0x295940,{options:_0x1260f3,args:_0x557f1d,tdx:_0x4ca4b4}=_0x2ee1bd;let _0x33e409,_0xf095b3;if(_0x557f1d[_0x31aef4(0x1fc)]>=0x2)_0x33e409=_0x557f1d[0x0],_0xf095b3=_0x557f1d[0x1];else{if(_0x557f1d[_0x31aef4(0x1fc)]===0x1&&_0x1260f3[_0x31aef4(0x1cb)])_0x33e409=_0x1260f3[_0x31aef4(0x1cb)],_0xf095b3=_0x557f1d[0x0];else return _0x557f1d['length']===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x31aef4(0x1cc)](_0x31aef4(0x16e)),0x1):(console[_0x31aef4(0x1cc)](_0x31aef4(0x143)),console['error'](_0x31aef4(0xb5)),0x1);}let _0xc90a35,_0x2ce460;try{({key:_0xc90a35,value:_0x2ce460}=parseKeyValue(_0xf095b3));}catch(_0x6043a){return _0x6043a instanceof Error&&console[_0x31aef4(0x1cc)](a42_0x1ce5f2[_0x31aef4(0x19b)](_0x31aef4(0xa3)),_0x6043a[_0x31aef4(0xfe)]),0x1;}_0x1260f3['verbose']&&(console[_0x31aef4(0x1cc)](_0x31aef4(0x8b)+_0x33e409),console[_0x31aef4(0x1cc)](_0x31aef4(0x15e)+_0xc90a35));const _0x4ff526=await withSpinner(_0x31aef4(0x20f),()=>_0x4ca4b4[_0x31aef4(0x21a)]['setSecret'](_0x33e409,_0xc90a35,_0x2ce460),{'verbose':_0x1260f3[_0x31aef4(0x10b)]}),_0x1c8835=_0x4ff526[_0x31aef4(0xf3)];return console[_0x31aef4(0x1cc)](_0x31aef4(0x9c)+_0x1c8835[_0x31aef4(0x10e)]+_0x31aef4(0x210)+_0x1c8835[_0x31aef4(0x183)]+'\x27'),(_0x1260f3['json']||_0x1260f3[_0x31aef4(0x1db)])&&await handleSingleObjectOutput(_0x1c8835,_0x1260f3),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0xd1);[a42_0x295940(0x12d)]=a42_0x295940(0xa5);async[a42_0x295940(0x141)](_0xa2b239){const _0x3b3a91=a42_0x295940,{options:_0x1ca7be,args:_0x395e6a,tdx:_0x31a08a}=_0xa2b239;let _0x52b34c,_0x230702;if(_0x395e6a[_0x3b3a91(0x1fc)]>=0x2)_0x52b34c=_0x395e6a[0x0],_0x230702=_0x395e6a[0x1];else{if(_0x395e6a['length']===0x1&&_0x1ca7be[_0x3b3a91(0x1cb)])_0x52b34c=_0x1ca7be['workflowProject'],_0x230702=_0x395e6a[0x0];else return _0x395e6a[_0x3b3a91(0x1fc)]===0x1?(console[_0x3b3a91(0x1cc)](_0x3b3a91(0x1a1)),console[_0x3b3a91(0x1cc)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3b3a91(0x1cc)](_0x3b3a91(0x6e)),console[_0x3b3a91(0x1cc)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1ca7be['verbose']&&(console['error'](_0x3b3a91(0x8b)+_0x52b34c),console['error'](_0x3b3a91(0x15e)+_0x230702));if(!_0x1ca7be['yes']){const _0x5aa9c7=await confirmKey(_0x3b3a91(0x167)+_0x230702+'\x27\x20from\x20project\x20\x27'+_0x52b34c+'\x27?');if(!_0x5aa9c7)return console['error'](_0x3b3a91(0x1cd)),0x0;}const _0x1d2a61=await withSpinner(_0x3b3a91(0x11c),()=>_0x31a08a['workflow']['deleteSecret'](_0x52b34c,_0x230702),{'verbose':_0x1ca7be['verbose']}),_0x2b46d4=_0x1d2a61['data'];return console[_0x3b3a91(0x1cc)](_0x3b3a91(0x9c)+_0x2b46d4[_0x3b3a91(0x10e)]+_0x3b3a91(0x7d)+_0x2b46d4[_0x3b3a91(0x183)]+'\x27'),(_0x1ca7be[_0x3b3a91(0x1e2)]||_0x1ca7be[_0x3b3a91(0x1db)])&&await handleSingleObjectOutput(_0x2b46d4,_0x1ca7be),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(_0x248033){const _0x3df047=a42_0x295940,_0x20d1ad=Math[_0x3df047(0xad)](_0x248033/0x3e8),_0x1d6cde=Math[_0x3df047(0xad)](_0x20d1ad/0x3c),_0x3cd74a=Math[_0x3df047(0xad)](_0x1d6cde/0x3c),_0x45aafd=Math[_0x3df047(0xad)](_0x3cd74a/0x18);if(_0x45aafd>0x0){const _0x264042=_0x3cd74a%0x18;return _0x264042>0x0?_0x45aafd+'d\x20'+_0x264042+'h':_0x45aafd+'d';}else{if(_0x3cd74a>0x0){const _0x35e009=_0x1d6cde%0x3c;return _0x35e009>0x0?_0x3cd74a+'h\x20'+_0x35e009+'m':_0x3cd74a+'h';}else{if(_0x1d6cde>0x0){const _0x558d85=_0x20d1ad%0x3c;return _0x558d85>0x0?_0x1d6cde+'m\x20'+_0x558d85+'s':_0x1d6cde+'m';}else return _0x20d1ad+'s';}}}function formatTimestamp(_0x43133c,_0x18e73b){const _0x2510c0=a42_0x295940,_0xc92847=new Date(_0x43133c),_0xceaea7=String(_0xc92847['getHours']())[_0x2510c0(0xaf)](0x2,'0'),_0x2d2d9a=String(_0xc92847['getMinutes']())[_0x2510c0(0xaf)](0x2,'0'),_0x5c69a4=_0xceaea7+':'+_0x2d2d9a,_0x52ff52=_0xc92847[_0x2510c0(0x17b)]()===_0x18e73b[_0x2510c0(0x17b)]()&&_0xc92847[_0x2510c0(0x1bf)]()===_0x18e73b[_0x2510c0(0x1bf)]()&&_0xc92847[_0x2510c0(0x1ee)]()===_0x18e73b[_0x2510c0(0x1ee)]();if(_0x52ff52)return _0x5c69a4;else{const _0x3df18a=String(_0xc92847[_0x2510c0(0x1bf)]()+0x1)[_0x2510c0(0xaf)](0x2,'0'),_0x5ede5a=String(_0xc92847[_0x2510c0(0x1ee)]())[_0x2510c0(0xaf)](0x2,'0');return _0x3df18a+'-'+_0x5ede5a+'\x20'+_0x5c69a4;}}function formatDate(_0x5d8c26){const _0x3b47e6=a42_0x295940,_0x4311ee=_0x5d8c26[_0x3b47e6(0x17b)](),_0x18e349=String(_0x5d8c26[_0x3b47e6(0x1bf)]()+0x1)[_0x3b47e6(0xaf)](0x2,'0'),_0x5280c3=String(_0x5d8c26['getDate']())[_0x3b47e6(0xaf)](0x2,'0');return _0x4311ee+'-'+_0x18e349+'-'+_0x5280c3;}function getTaskStateIcon(_0x5ac565){const _0x3c970b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3c970b[_0x5ac565]||'⚪';}function getBarChar(_0x3500f5){const _0x4b33b1=a42_0x295940;return _0x3500f5===_0x4b33b1(0x1cc)||_0x3500f5===_0x4b33b1(0x1d7)?'×':'─';}function getBarColor(_0x2cb210){const _0x5b5179=a42_0x295940,_0x32965b={'success':a42_0x1ce5f2[_0x5b5179(0x205)],'error':a42_0x1ce5f2[_0x5b5179(0x19b)],'group_error':a42_0x1ce5f2[_0x5b5179(0x19b)],'running':a42_0x1ce5f2[_0x5b5179(0x1aa)],'blocked':a42_0x1ce5f2['yellow'],'planned':a42_0x1ce5f2[_0x5b5179(0xce)],'canceling':a42_0x1ce5f2[_0x5b5179(0xc6)]};return _0x32965b[_0x2cb210]||a42_0x1ce5f2[_0x5b5179(0x179)];}function parseTaskName(_0x363ecc){const _0x307f52=a42_0x295940;let _0x566182=_0x363ecc[_0x307f52(0x19c)](/^\++/,'');const _0x2202cd=_0x566182[_0x307f52(0xed)]('+'),_0xaed4fe=_0x2202cd[_0x307f52(0x1fc)]>0x1?_0x2202cd[_0x307f52(0x1fc)]-0x2:0x0,_0x34be54=_0x2202cd[_0x2202cd[_0x307f52(0x1fc)]-0x1]||_0x566182;return{'level':_0xaed4fe,'name':'+'+_0x34be54};}function truncateTaskName(_0x58da14,_0x2fd249){const _0x361bc4=a42_0x295940,_0x4539b7=stringWidth(_0x58da14);if(_0x4539b7<=_0x2fd249)return _0x58da14;let _0x33af31=_0x58da14;while(stringWidth(_0x33af31+'…')>_0x2fd249&&_0x33af31[_0x361bc4(0x1fc)]>0x0){_0x33af31=_0x33af31[_0x361bc4(0x1d6)](0x0,-0x1);}return _0x33af31+'…';}function a42_0x5f2f(){const _0x4e18f2=['Listing\x20secrets...','Project\x20name\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','modified','pending','✔\x20Pull\x20complete','5jTOWXQ','Project:\x20','No\x20attempts\x20found','substring','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','💡\x20Tip:\x20Use\x20','🔄\x20','Status:\x20','cyan','Downloading\x20logs...','newProjectName','workflow:timeline','cancelRequested','No\x20workflow\x20sessions\x20found','isNewProject','targetExists','\x20\x20Session\x20context\x20set\x20to:\x20','✔\x20Found\x20','✔\x20Secret\x20\x27','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20Project:\x20','workflow:kill','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20Workflow:\x20','workflowName','Error:','logs','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','workflows','Session\x20time:\x20','select','updatedAt','workflow:retry','\x20unchanged','1916355TMxSnH','floor','\x20\x20Session\x20ID:\x20','padStart','done','msPerChar','\x20attempt','param','✔\x20New\x20project:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','sourceProjectName','\x20(use\x20--limit\x20to\x20show\x20more)','Project\x20filter:\x20','reason','existingProjectId','sys','workflow:pull','sessions','\x20(system)','window','\x0aDry\x20run\x20-\x20nothing\x20pushed','MIN_LABEL_COUNT','join','resolveProject','size','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','yellow','renderTimeline','includeRetried','session','No\x20sessions\x20found\x20in\x20project:\x20','\x0aPush\x20these\x20changes?','resolveProjectId','createdAt','dim','Getting\x20attempt\x20tasks...','22jYlhye','workflow:secrets:delete','status','\x20\x20Files\x20extracted:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','summary','\x20session','parseProjectWorkflowPattern','Validation:\x20skipped','✔\x20Push\x20complete','stringify','delete','\x22?\x20This\x20cannot\x20be\x20undone.','toLowerCase','readFile','Revision:\x20','\x20sessions\x20','\x1b[1A\x1b[2K','deleted','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','fileSize','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','List\x20workflow\x20execution\x20sessions','Loading\x20sessions...','sourceDir','sessionId','Pushing\x20workflow\x20project...','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20workflows\x20found','split','Kill\x20a\x20running\x20attempt','POLL_INTERVAL_MS','attempts','now','Start\x20a\x20workflow\x20run','data','workflow:upload','\x0aClone\x20\x22','columns','max','TASK_NAME_WIDTH','every','MAX_TASKS_DISPLAY','Source\x20project:\x20','session:','tdx\x20wf\x20attempt\x20','message','Select\x20a\x20session\x20to\x20view\x20timeline:','Attempt\x20ID:\x20','ICON_SPACING','getTime','Filter:\x20project=','Project\x20name:\x20','localeCompare','List\x20workflows','displayLine','workflow:push','Retrying\x20attempt...','(use\x20--limit\x20to\x20see\x20more)','verbose','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Show\x20logs\x20for\x20a\x20workflow\x20attempt','key','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','No\x20log\x20content\x20found','dryRun','\x20\x20Location:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','match','/sessions/','workflow:secrets:set','\x0aDry\x20run\x20-\x20no\x20project\x20created','targetDir','Usage:\x20tdx\x20wf\x20use\x20<project>','workflow:attempt','Deleting\x20secret...','\x0a⚠\x20Project\x20\x22','\x27...','retryAttemptName','projectId','sessionTime','1lVYKPf','Params:\x20','task','(unknown)','run','fs/promises','projects','metadata','Task\x20name:\x20','Target:\x20','prepareCloneProject','description','applyPullProject','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Tip:\x20cd\x20to\x20workflows/','index','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','running','\x20secret','\x20-\x20','3229965vBXlgb','No\x20workflow\x20projects\x20found','\x20\x20Revision:\x20','No\x20sessions\x20found','\x20modified','keys','write','indexOf','duration','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','toISOString','execute','value','Error:\x20KEY=VALUE\x20is\x20required','\x20is\x20not\x20a\x20directory','Source\x20directory\x20is\x20required','No\x20attempts\x20found\x20in\x20project:\x20','\x0aPolling...\x20(','revision','attempt:','Starting\x20workflow\x20run...','trim','📋\x20','workflow:tasks','push','limit','lastAttempt','project','Latest\x20session\x20has\x20no\x20attempt','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','isTTY','No\x20sessions\x20with\x20timing\x20information','unknown','\x20to\x20see\x20detailed\x20logs','✔\x20Workflow\x20project\x20context\x20cleared.','MAX_POLL_ITERATIONS','resolve','Pulling\x20project\x20','relative','List\x20all\x20workflow\x20projects','Key:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','tasks','\x20\x20Changes:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Listing\x20workflow\x20attempts...','workflow:secrets:list','Fetching\x20log\x20files...','\x0aUpdate\x20existing\x20project\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','state','Auto-selected\x20latest\x20session:\x20','\x20deleted','2163771bJfVzc','startsWith','yes','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','logFiles','List\x20workflow\x20attempts','sort','utf-8','all','\x20project','changes','\x0a✔\x20No\x20changes\x20to\x20push','Show\x20specific\x20attempt\x20details','Error:\x20Attempt\x20ID\x20is\x20required','white','\x20has\x20no\x20attempts','getFullYear','Total:\x20','Downloading\x20project\x20','renderSessionsTimeline','\x0a✔\x20Attempt\x20complete','Usage:\x20workflow:delete\x20<project-name-or-id>','stat','list','projectName','resolveProjectDir','Retry\x20a\x20session\x20or\x20attempt','\x22\x20already\x20exists\x20(ID:\x20','workflow:delete','\x20\x20Console:\x20','No\x20sessions\x20found\x20for:\x20','finishedAt','---\x20','revision:\x20','Attempt:\x20','workflow:run','LABEL_MIN_SPACING','set','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','MAX_TIMELINE_WIDTH','Target\x20directory:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20Project\x20ID:\x20','\x0aApply\x20these\x20changes?','workflow:workflows','workflow:projects','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','red','replace','✔\x20Project\x20updated','workflow:sessions','canceling','hasChanges','Error:\x20Project\x20name\x20is\x20required','Pull\x20workflow\x20project\x20to\x20local\x20folder','Include\x20retried:\x20yes','includes','params','MAX_LABEL_COUNT','LABEL_WIDTH_DIVISOR','from','isArray','blue','planned','Workflow:\x20','ICON_WIDTH','No\x20attempts\x20found\x20for:\x20','pullProject','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x0aDry\x20run\x20-\x20no\x20files\x20written','showWorkflowConsoleUrl','Deleting\x20project\x20','Pattern:\x20','clear','trimEnd','map','Error:\x20Invalid\x20JSON\x20in\x20--params','Expected\x20format:\x20--param\x20key=value','Failed\x20to\x20fetch\x20attempt\x20data','Listing\x20workflow\x20projects...','✔\x20Deleted\x20project\x20','Select\x20a\x20task\x20to\x20view\x20logs:','success','getMonth','\x0a✔\x20Already\x20up\x20to\x20date','Invalid\x20format:\x20','icon','name','\x20from\x20session\x20','Writing\x20files...','retrySession','Listing\x20workflows...','fullName','84718cvMPwV','navigateSessionsInteractive','workflowProject','error','Cancelled','3192246mGisrd','context','end','requireProject','attemptId','filter','9158440iqWsyc','\x22\x20to\x20new\x20project\x20\x22','slice','group_error','min','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','.\x20Expected\x20format:\x20KEY=VALUE','jsonl','\x20of\x20','startedAt','Warning:','executePushProject','diff','start','json','From\x20task:\x20','basename','Cloning\x20to\x20','retryAttempt','workflow:clone','/attempt/','New\x20project\x20name:\x20','stdout','type','Including\x20subtasks:\x20yes','Loading\x20workflows...','getDate','newProjectId','Error:\x20','Using\x20attempt\x20','Resume\x20from:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','Dry\x20run:\x20yes','new','has','\x20new','skipValidation','No\x20workflow\x20tdx.json\x20found','1527372VvcwLp','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','length','get','cwd','Files\x20to\x20upload:\x20','unchanged','log','No\x20workflows\x20found\x20in\x20project:\x20','✔\x20Showing\x20','No\x20matching\x20sessions\x20found','green','output','find','...','\x22\x20with\x20new\x20revision?','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20projects\x20match\x20pattern:\x20','pollTimeline','Filter:\x20','repeat','Setting\x20secret...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Source\x20directory:\x20','✔\x20Retry\x20started','startTime','rows','fileCount','📁\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','resumeFrom','preparePushProject','workflow','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Select\x20a\x20workflow\x20to\x20run','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','splice','workflow:logs','tdx.json','table','site','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','format','Error:\x20Secret\x20key\x20is\x20required','fromTask','buildTimelineData','\x20\x20New\x20attempt\x20ID:\x20','fill','MIN_TIMELINE_WIDTH','Getting\x20attempt\x20details...','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','follow','✔\x20Project:\x20','renderSingleTimeline','workflow:use','taskName','parse','⚠\x20Showing\x20first\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','force','16aqsgjO','attempt','download','generateSessionTimelineRows'];a42_0x5f2f=function(){return _0x4e18f2;};return a42_0x5f2f();}function calculateTimeScale(_0x2c5457,_0x32f39e){const _0x40e61a=a42_0x295940;return{'startTime':_0x2c5457['start'],'endTime':_0x2c5457[_0x40e61a(0x1d0)],'durationMs':_0x2c5457[_0x40e61a(0x13e)],'msPerChar':_0x2c5457[_0x40e61a(0x13e)]/_0x32f39e};}function timeToPosition(_0x4e951e,_0x4b90d8,_0x3b3a4e){const _0x5c5855=a42_0x295940,_0x361f4a=_0x4e951e-_0x4b90d8[_0x5c5855(0x213)],_0xf5e52c=Math[_0x5c5855(0xad)](_0x361f4a/_0x4b90d8[_0x5c5855(0xb1)]);return Math[_0x5c5855(0xf7)](0x0,Math[_0x5c5855(0x1d8)](_0xf5e52c,_0x3b3a4e));}function renderTimeAxis(_0xbe35f,_0x30d843){const _0x30d5b1=a42_0x295940,_0x3deb24=Math[_0x30d5b1(0x1d8)](TIMELINE_CONFIG[_0x30d5b1(0x1a6)],Math[_0x30d5b1(0xf7)](TIMELINE_CONFIG[_0x30d5b1(0xc1)],Math[_0x30d5b1(0xad)](_0x30d843/TIMELINE_CONFIG[_0x30d5b1(0x1a7)]))),_0x163b96=_0xbe35f['durationMs']/(_0x3deb24-0x1),_0x30a47c=new Date(_0xbe35f[_0x30d5b1(0x213)]),_0x44f1e5=[];for(let _0x4253b3=0x0;_0x4253b3<_0x3deb24;_0x4253b3++){const _0x39c2e7=_0xbe35f['startTime']+_0x4253b3*_0x163b96,_0x3e5cd5=timeToPosition(_0x39c2e7,_0xbe35f,_0x30d843),_0x59ec95=formatTimestamp(_0x39c2e7,_0x30a47c);_0x44f1e5['push']({'pos':_0x3e5cd5,'text':_0x59ec95});}const _0x407fc0=new Array(_0x30d843)['fill']('\x20');let _0x513f74=-0x1;for(const {pos:_0x33f02c,text:_0x165dc7}of _0x44f1e5){let _0xf424fb=Math['max'](0x0,_0x33f02c-Math[_0x30d5b1(0xad)](_0x165dc7['length']/0x2));_0xf424fb<=_0x513f74+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0xf424fb=_0x513f74+TIMELINE_CONFIG[_0x30d5b1(0x18f)]+0x1);_0xf424fb+_0x165dc7[_0x30d5b1(0x1fc)]>_0x30d843&&(_0xf424fb=_0x30d843-_0x165dc7[_0x30d5b1(0x1fc)]);if(_0xf424fb>=0x0&&_0xf424fb+_0x165dc7[_0x30d5b1(0x1fc)]<=_0x30d843&&_0xf424fb>_0x513f74){for(let _0x2e158d=0x0;_0x2e158d<_0x165dc7[_0x30d5b1(0x1fc)];_0x2e158d++){_0x407fc0[_0xf424fb+_0x2e158d]=_0x165dc7[_0x2e158d];}_0x513f74=_0xf424fb+_0x165dc7[_0x30d5b1(0x1fc)]-0x1;}}return _0x407fc0[_0x30d5b1(0xc2)]('');}function renderTaskRow(_0x50331b,_0x158273,_0x200352,_0x5bc741){const _0x375e00=a42_0x295940,{level:_0x55322b,name:_0x585537}=parseTaskName(_0x50331b[_0x375e00(0x1c3)]),_0x4e30cc='\x20'['repeat'](_0x55322b),_0x5a9980=_0x50331b[_0x375e00(0xbf)]?'('+formatElapsed(_0x50331b[_0x375e00(0xbf)][_0x375e00(0x13e)])+')':'',_0x455039=stringWidth(_0x5a9980),_0x16d5d1=_0x55322b*0x1,_0x3850f8=_0x5bc741-_0x16d5d1-_0x455039-0x1,_0x28c4f9=truncateTaskName(_0x585537,_0x3850f8),_0x3fd279=_0x4e30cc+_0x28c4f9,_0x483e73=stringWidth(_0x3fd279),_0x38ba61=_0x5bc741-_0x483e73-_0x455039,_0x4a30e2=_0x3fd279+'\x20'['repeat'](Math['max'](0x1,_0x38ba61))+a42_0x1ce5f2[_0x375e00(0xce)](_0x5a9980),_0x235fc3=getTaskStateIcon(_0x50331b[_0x375e00(0x168)]),_0x47f6ce=new Array(_0x200352)[_0x375e00(0x72)]('\x20');if(_0x50331b['window']){const _0xa5cd14=timeToPosition(_0x50331b[_0x375e00(0xbf)][_0x375e00(0x1e1)],_0x158273,_0x200352),_0x13da52=timeToPosition(_0x50331b[_0x375e00(0xbf)][_0x375e00(0x1d0)],_0x158273,_0x200352),_0x24214f=getBarChar(_0x50331b[_0x375e00(0x168)]),_0xb730dc=Math[_0x375e00(0xf7)](_0xa5cd14+0x1,_0x13da52);for(let _0x28c5f9=_0xa5cd14;_0x28c5f9<Math[_0x375e00(0x1d8)](_0xb730dc,_0x200352);_0x28c5f9++){_0x47f6ce[_0x28c5f9]=_0x24214f;}}const _0x11ef8c=getBarColor(_0x50331b[_0x375e00(0x168)]),_0x5d4d42=_0x47f6ce[_0x375e00(0x1b7)](_0x504e2f=>_0x504e2f==='\x20'?'\x20':_0x11ef8c(_0x504e2f))['join']('');return _0x235fc3+'\x20'+_0x4a30e2+'│'+_0x5d4d42+'│';}function calculateStats(_0x74befc){const _0x1a41b4=a42_0x295940,_0x31e705={'total':_0x74befc[_0x1a41b4(0x1fc)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4878b0 of _0x74befc){if(_0x4878b0['state']===_0x1a41b4(0x1be))_0x31e705[_0x1a41b4(0x1be)]++;else{if(_0x4878b0[_0x1a41b4(0x168)]==='error'||_0x4878b0[_0x1a41b4(0x168)]===_0x1a41b4(0x1d7))_0x31e705[_0x1a41b4(0x1cc)]++;else _0x4878b0[_0x1a41b4(0x168)]==='running'?_0x31e705['running']++:_0x31e705[_0x1a41b4(0x88)]++;}}return _0x31e705;}function formatStats(_0x1cd547){const _0x5b2497=a42_0x295940;return[_0x5b2497(0x17c)+_0x1cd547['total'],'✅\x20'+_0x1cd547[_0x5b2497(0x1be)],'❌\x20'+_0x1cd547[_0x5b2497(0x1cc)],_0x5b2497(0x90)+_0x1cd547[_0x5b2497(0x133)],'⏳\x20'+_0x1cd547[_0x5b2497(0x88)]][_0x5b2497(0xc2)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x295940(0x1c3)]=a42_0x295940(0x95);['description']=a42_0x295940(0x195);async[a42_0x295940(0x141)](_0x36f766){const _0x5b4d67=a42_0x295940,{options:_0x192db6,args:_0x26469a,tdx:_0x4894b9}=_0x36f766;let _0x150f61,_0x99abf5,_0x321341=![];if(_0x26469a[0x0]){if(_0x26469a[0x0][_0x5b4d67(0x1a4)]('.')){const _0x118398=this[_0x5b4d67(0xd7)](_0x26469a,_0x192db6);if(!_0x118398)return 0x1;_0x150f61=_0x118398[_0x5b4d67(0x183)],_0x99abf5=_0x118398['workflowName'];}else{_0x99abf5=_0x26469a[0x0],_0x150f61=_0x192db6[_0x5b4d67(0x1cb)];if(!_0x150f61)return console[_0x5b4d67(0x1cc)](a42_0x1ce5f2['red'](_0x5b4d67(0xa3)),_0x5b4d67(0x110)),0x1;_0x321341=!![];}}else{const _0x1516c0=this[_0x5b4d67(0xd7)](_0x26469a,_0x192db6);if(!_0x1516c0)return 0x1;_0x150f61=_0x1516c0[_0x5b4d67(0x183)],_0x99abf5=_0x1516c0[_0x5b4d67(0xa2)];}if(_0x192db6[_0x5b4d67(0x10b)]){if(_0x150f61&&_0x99abf5)console[_0x5b4d67(0x1cc)](_0x5b4d67(0x20d)+_0x150f61+'.'+_0x99abf5);else _0x150f61&&console[_0x5b4d67(0x1cc)](_0x5b4d67(0x103)+_0x150f61);}const _0x41523d=_0x192db6['attemptId'],_0x463fed=_0x192db6[_0x5b4d67(0xe9)];if(_0x41523d){_0x463fed&&console[_0x5b4d67(0x1cc)](a42_0x1ce5f2[_0x5b4d67(0xc6)](_0x5b4d67(0x1de)),_0x5b4d67(0x13f));const _0x1ff307=_0x192db6['follow'];return _0x1ff307?await this[_0x5b4d67(0x20c)](_0x36f766,_0x41523d):await this[_0x5b4d67(0x78)](_0x36f766,_0x41523d,_0x192db6),0x0;}if(_0x463fed){const _0xe17902=await withSpinner('Loading\x20session...',()=>_0x4894b9[_0x5b4d67(0x21a)][_0x5b4d67(0xbd)]({'projectName':_0x150f61,'workflowName':_0x99abf5,'limit':0x64}),{'verbose':_0x192db6['verbose']}),_0x2eaa2d=_0xe17902['data']['find'](_0x32751f=>_0x32751f['id']===_0x463fed);if(!_0x2eaa2d)return console[_0x5b4d67(0x1cc)](a42_0x1ce5f2[_0x5b4d67(0x19b)](_0x5b4d67(0xa3)),'Session\x20not\x20found:\x20'+_0x463fed),0x1;if(!_0x2eaa2d['lastAttempt']?.['id'])return console['error'](a42_0x1ce5f2['red'](_0x5b4d67(0xa3)),'Session\x20'+_0x463fed+_0x5b4d67(0x17a)),0x1;const _0x14f0da=_0x2eaa2d[_0x5b4d67(0x150)]['id'];_0x192db6[_0x5b4d67(0x10b)]&&console[_0x5b4d67(0x1cc)](_0x5b4d67(0x1f1)+_0x14f0da+_0x5b4d67(0x1c4)+_0x463fed);const _0x1c037d=_0x192db6[_0x5b4d67(0x76)];return _0x1c037d?await this[_0x5b4d67(0x20c)](_0x36f766,_0x14f0da):await this[_0x5b4d67(0x78)](_0x36f766,_0x14f0da,_0x192db6),0x0;}const _0x498405=await withSpinner(_0x5b4d67(0xe7),()=>_0x4894b9[_0x5b4d67(0x21a)]['sessions']({'projectName':_0x150f61,'workflowName':_0x99abf5,'limit':_0x192db6['limit']||0x32}),{'verbose':_0x192db6[_0x5b4d67(0x10b)]}),_0x24087b=_0x498405[_0x5b4d67(0xf3)];if(_0x24087b[_0x5b4d67(0x1fc)]===0x0){if(_0x150f61&&_0x99abf5)console[_0x5b4d67(0x1cc)](_0x5b4d67(0x189)+_0x150f61+'.'+_0x99abf5);else _0x150f61?console[_0x5b4d67(0x1cc)](_0x5b4d67(0xca)+_0x150f61):(console['error'](_0x5b4d67(0x97)),console[_0x5b4d67(0x1cc)](a42_0x1ce5f2['dim'](_0x5b4d67(0x114))));return 0x0;}_0x24087b[_0x5b4d67(0x171)]((_0x1cc8b3,_0x4f7e4)=>{const _0xc83450=_0x5b4d67,_0x1284bc=_0x1cc8b3[_0xc83450(0x121)]||'',_0x9fdbf1=_0x4f7e4[_0xc83450(0x121)]||'';return _0x9fdbf1[_0xc83450(0x105)](_0x1284bc);});if(_0x192db6[_0x5b4d67(0x1e2)]||_0x192db6[_0x5b4d67(0x1db)])return await handleSDKOutput(_0x24087b,_0x192db6),0x0;let _0x57f5eb;if(_0x321341){const _0xfa02e2=_0x24087b[0x0];if(!_0xfa02e2[_0x5b4d67(0x150)]?.['id'])return console[_0x5b4d67(0x1cc)](_0x5b4d67(0x152)),0x0;_0x57f5eb=_0xfa02e2[_0x5b4d67(0x150)]['id'],_0x192db6['verbose']&&console[_0x5b4d67(0x1cc)](_0x5b4d67(0x169)+_0xfa02e2[_0x5b4d67(0x121)]);}else{const _0x99c12b=_0x24087b[_0x5b4d67(0x1b7)](_0xe7de31=>{const _0x4dab2c=_0x5b4d67,_0x2bfd13=getAttemptStatusDisplay(_0xe7de31[_0x4dab2c(0x150)]);return{'title':_0xe7de31['project']?.['name']+'.'+_0xe7de31[_0x4dab2c(0x21a)]?.['name']+_0x4dab2c(0x135)+_0xe7de31[_0x4dab2c(0x121)]+'\x20'+_0x2bfd13[_0x4dab2c(0x1c2)],'value':_0xe7de31[_0x4dab2c(0x150)]?.['id']||'','description':_0x2bfd13['text']};}),_0x2761b8=await a42_0x454db6({'type':_0x5b4d67(0xa8),'name':_0x5b4d67(0x1d2),'message':_0x5b4d67(0xff),'choices':_0x99c12b[_0x5b4d67(0x1d3)](_0x3d5be5=>_0x3d5be5[_0x5b4d67(0x142)]!=='')});if(!_0x2761b8[_0x5b4d67(0x1d2)])return 0x0;_0x57f5eb=_0x2761b8[_0x5b4d67(0x1d2)];}const _0x50e189=_0x192db6['follow'];return _0x50e189?await this[_0x5b4d67(0x20c)](_0x36f766,_0x57f5eb):await this[_0x5b4d67(0x78)](_0x36f766,_0x57f5eb,_0x192db6),0x0;}async[a42_0x295940(0x78)](_0x14b6b8,_0x14069f,_0x4e2044){const _0x1b5e5f=a42_0x295940,{tdx:_0x2f1b69}=_0x14b6b8;let _0x56d326,_0x1494ca;try{[_0x56d326,_0x1494ca]=await Promise['all']([_0x2f1b69[_0x1b5e5f(0x21a)][_0x1b5e5f(0x80)](_0x14069f),_0x2f1b69[_0x1b5e5f(0x21a)][_0x1b5e5f(0x160)](_0x14069f,![])]);}catch(_0x3cf142){console[_0x1b5e5f(0x1cc)](a42_0x1ce5f2[_0x1b5e5f(0x19b)](_0x1b5e5f(0x1ba)));_0x4e2044[_0x1b5e5f(0x10b)]&&console[_0x1b5e5f(0x1cc)](_0x3cf142);throw _0x3cf142;}if(_0x4e2044[_0x1b5e5f(0x1e2)]||_0x4e2044['jsonl']){const _0x319bad=this[_0x1b5e5f(0x70)](_0x56d326,_0x1494ca);await handleSDKOutput([_0x319bad],_0x4e2044);return;}const _0x85b766=_0x2f1b69['context']['site'],_0x56aff1=this['renderTimeline'](_0x56d326,_0x1494ca,_0x85b766);console[_0x1b5e5f(0x201)](_0x56aff1);}async[a42_0x295940(0x20c)](_0x3431c5,_0x13befa){const _0x2f89bf=a42_0x295940,{tdx:_0x2ae0ec}=_0x3431c5,_0x560d01=TIMELINE_CONFIG[_0x2f89bf(0xef)],_0x5ccd74=TIMELINE_CONFIG[_0x2f89bf(0x159)];let _0xbf5aba=0x0;while(_0xbf5aba<_0x5ccd74){process['stdout'][_0x2f89bf(0x154)]&&process[_0x2f89bf(0x1ea)]['write']('\x1bc');let _0x4781e3,_0x502b06;try{[_0x4781e3,_0x502b06]=await Promise[_0x2f89bf(0x173)]([_0x2ae0ec['workflow']['attempt'](_0x13befa),_0x2ae0ec[_0x2f89bf(0x21a)][_0x2f89bf(0x160)](_0x13befa,![])]);}catch(_0x1cc2f0){console['error'](a42_0x1ce5f2['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0xbf5aba>0x0&&console['error'](a42_0x1ce5f2['dim'](_0x2f89bf(0xa0)+_0xbf5aba));throw _0x1cc2f0;}const _0x531c4d=_0x2ae0ec[_0x2f89bf(0x1cf)][_0x2f89bf(0x6b)],_0x480fbf=this[_0x2f89bf(0xc7)](_0x4781e3,_0x502b06,_0x531c4d);console[_0x2f89bf(0x201)](_0x480fbf);const _0x4544e2=_0x4781e3['done']&&_0x502b06[_0x2f89bf(0xf9)](_0x5b092a=>_0x5b092a[_0x2f89bf(0x168)]!==_0x2f89bf(0x133)&&_0x5b092a[_0x2f89bf(0x168)]!==_0x2f89bf(0x1ab));if(_0x4544e2){console[_0x2f89bf(0x1cc)](a42_0x1ce5f2[_0x2f89bf(0x205)](_0x2f89bf(0x17f)));break;}console[_0x2f89bf(0x1cc)](a42_0x1ce5f2['dim'](_0x2f89bf(0x147)+_0xbf5aba*0x2+_0x2f89bf(0x217))),await new Promise(_0x142f61=>setTimeout(_0x142f61,_0x560d01)),_0xbf5aba++;}_0xbf5aba>=_0x5ccd74&&console[_0x2f89bf(0x1cc)](a42_0x1ce5f2[_0x2f89bf(0xc6)](_0x2f89bf(0x85)));}['renderTimeline'](_0x47268c,_0x85c7ca,_0x39e72d){const _0x5ead02=a42_0x295940,_0x170b36=[],_0x10a535=TIMELINE_CONFIG[_0x5ead02(0xf8)],_0x3b9466=0x5,_0x5475f5=process[_0x5ead02(0x1ea)][_0x5ead02(0xf6)]||0x78,_0xfc6f3b=_0x5475f5-_0x10a535-_0x3b9466,_0x2d9ffd=Math[_0x5ead02(0xf7)](TIMELINE_CONFIG[_0x5ead02(0x73)],Math[_0x5ead02(0x1d8)](_0xfc6f3b,TIMELINE_CONFIG[_0x5ead02(0x192)])),_0x5167ce=new Date(_0x47268c['createdAt'])[_0x5ead02(0x102)](),_0x18f715=_0x47268c['finishedAt']?new Date(_0x47268c[_0x5ead02(0x18a)])[_0x5ead02(0x102)]():Date[_0x5ead02(0xf1)](),_0x5356ea={'start':_0x5167ce,'end':_0x18f715,'duration':_0x18f715-_0x5167ce},_0x2ce33c=new Map(),_0x4b31d8=[];for(const _0x28e7ae of _0x85c7ca){if(_0x28e7ae[_0x5ead02(0x1dd)]){const _0x5d58ab=new Date(_0x28e7ae['startedAt'])['getTime'](),_0x24c4a9=_0x28e7ae[_0x5ead02(0xa9)]?new Date(_0x28e7ae[_0x5ead02(0xa9)])[_0x5ead02(0x102)]():Date[_0x5ead02(0xf1)](),_0x4ccc65={'start':_0x5d58ab,'end':_0x24c4a9,'duration':_0x24c4a9-_0x5d58ab};_0x2ce33c[_0x5ead02(0x190)](_0x28e7ae['id'],_0x4ccc65),_0x4b31d8['push']({'name':_0x28e7ae['fullName'],'state':_0x28e7ae[_0x5ead02(0x168)]||_0x5ead02(0x156),'window':_0x4ccc65});}else _0x4b31d8[_0x5ead02(0x14e)]({'name':_0x28e7ae['fullName'],'state':_0x28e7ae['state']||_0x5ead02(0x1ab),'window':undefined});}_0x4b31d8[_0x5ead02(0x171)]((_0x3d37f1,_0x5b3a7d)=>{const _0x8746f6=_0x5ead02;if(!_0x3d37f1[_0x8746f6(0xbf)])return 0x1;if(!_0x5b3a7d['window'])return-0x1;return _0x3d37f1[_0x8746f6(0xbf)][_0x8746f6(0x1e1)]-_0x5b3a7d['window'][_0x8746f6(0x1e1)];});const _0x495f8e=_0x4b31d8['length'],_0x2b6e4f=_0x495f8e>TIMELINE_CONFIG[_0x5ead02(0xfa)];_0x2b6e4f&&_0x4b31d8[_0x5ead02(0x21e)](TIMELINE_CONFIG[_0x5ead02(0xfa)]);const _0x1cdfc1=calculateTimeScale(_0x5356ea,_0x2d9ffd),_0xcf6324=_0x47268c[_0x5ead02(0xb0)]?_0x47268c[_0x5ead02(0x1be)]?a42_0x1ce5f2['green'](_0x5ead02(0x1be)):a42_0x1ce5f2[_0x5ead02(0x19b)](_0x5ead02(0x1cc)):a42_0x1ce5f2[_0x5ead02(0x1aa)](_0x5ead02(0x133)),_0x5e35c0=_0x47268c['project']?.['id'],_0x395fd4=_0x47268c[_0x5ead02(0xe9)];let _0x5db470;if(_0x5e35c0&&_0x395fd4){const _0x7b1cf6=getWorkflowAttemptUrl(_0x39e72d,_0x5e35c0,_0x395fd4,_0x47268c['id']);_0x5db470=hyperlink(a42_0x1ce5f2['dim'](_0x47268c['id']),_0x7b1cf6);}else _0x5db470=a42_0x1ce5f2['dim'](_0x47268c['id']);_0x170b36[_0x5ead02(0x14e)](_0x5ead02(0x18d)+_0x5db470+'\x20-\x20'+_0xcf6324+_0x5ead02(0x135)+formatElapsed(_0x5356ea[_0x5ead02(0x13e)]));if(_0x4b31d8[_0x5ead02(0x1fc)]>0x0){const _0xd5ab65=renderTimeAxis(_0x1cdfc1,_0x2d9ffd),_0x1decc9=new Date(_0x5356ea['start']),_0x1ec3d7=formatDate(_0x1decc9),_0x39dae8=TIMELINE_CONFIG[_0x5ead02(0x1ad)]+TIMELINE_CONFIG[_0x5ead02(0x101)]+_0x10a535,_0x4a564b=_0x1ec3d7[_0x5ead02(0xaf)](_0x39dae8),_0x4525f8=a42_0x1ce5f2[_0x5ead02(0xce)](_0x4a564b);_0x170b36['push'](_0x4525f8+'\x20'+_0xd5ab65);for(const _0x14cf9f of _0x4b31d8){_0x170b36[_0x5ead02(0x14e)](renderTaskRow(_0x14cf9f,_0x1cdfc1,_0x2d9ffd,_0x10a535));}const _0x712aad=calculateStats(_0x4b31d8);_0x170b36[_0x5ead02(0x14e)](formatStats(_0x712aad)),_0x2b6e4f&&_0x170b36['push'](a42_0x1ce5f2['yellow'](_0x5ead02(0x7c)+TIMELINE_CONFIG[_0x5ead02(0xfa)]+_0x5ead02(0x1dc)+_0x495f8e+'\x20tasks')),_0x170b36[_0x5ead02(0x14e)](''),_0x170b36['push'](a42_0x1ce5f2['dim'](_0x5ead02(0x8f))+(_0x5ead02(0xfd)+_0x47268c['id']+'\x20logs')+a42_0x1ce5f2[_0x5ead02(0xce)](_0x5ead02(0x157)));}else _0x170b36[_0x5ead02(0x14e)](_0x5ead02(0x8e));return _0x170b36[_0x5ead02(0xc2)]('\x0a');}[a42_0x295940(0x70)](_0x4364bf,_0x783408){const _0x4d9c9b=a42_0x295940,_0x1d663c=new Date(_0x4364bf['createdAt'])['getTime'](),_0x30a1ed=_0x4364bf['finishedAt']?new Date(_0x4364bf['finishedAt'])[_0x4d9c9b(0x102)]():Date[_0x4d9c9b(0xf1)](),_0x1f1e07=_0x30a1ed-_0x1d663c,_0x5d2788=[];for(const _0x191ab9 of _0x783408){if(_0x191ab9[_0x4d9c9b(0x1dd)]){const _0x554156=new Date(_0x191ab9['startedAt'])[_0x4d9c9b(0x102)](),_0x39aa7f=_0x191ab9[_0x4d9c9b(0xa9)]?new Date(_0x191ab9['updatedAt'])[_0x4d9c9b(0x102)]():Date['now']();_0x5d2788['push']({'name':_0x191ab9[_0x4d9c9b(0x1c8)],'state':_0x191ab9[_0x4d9c9b(0x168)]||_0x4d9c9b(0x156),'window':{'start':_0x554156,'end':_0x39aa7f,'duration':_0x39aa7f-_0x554156}});}else _0x5d2788['push']({'name':_0x191ab9[_0x4d9c9b(0x1c8)],'state':_0x191ab9[_0x4d9c9b(0x168)]||_0x4d9c9b(0x1ab),'window':undefined});}const _0x5c73c9=calculateStats(_0x5d2788);return{'attempt':{'id':_0x4364bf['id'],'status':_0x4364bf[_0x4d9c9b(0xb0)]?_0x4364bf[_0x4d9c9b(0x1be)]?_0x4d9c9b(0x1be):_0x4d9c9b(0x1cc):_0x4d9c9b(0x133),'createdAt':_0x4364bf[_0x4d9c9b(0xcd)],'finishedAt':_0x4364bf[_0x4d9c9b(0x18a)],'duration_ms':_0x1f1e07},'tasks':_0x5d2788['map'](_0x5bd3eb=>({'name':_0x5bd3eb[_0x4d9c9b(0x1c3)],'state':_0x5bd3eb[_0x4d9c9b(0x168)],'startedAt':_0x5bd3eb[_0x4d9c9b(0xbf)]?new Date(_0x5bd3eb[_0x4d9c9b(0xbf)][_0x4d9c9b(0x1e1)])['toISOString']():null,'updatedAt':_0x5bd3eb[_0x4d9c9b(0xbf)]?new Date(_0x5bd3eb['window'][_0x4d9c9b(0x1d0)])[_0x4d9c9b(0x140)]():null,'duration_ms':_0x5bd3eb['window']?.['duration']||null})),'stats':_0x5c73c9};}}
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 a43_0x1fe8(){const _0x31871d=['2869560tktkqn','1735eUFmTj','929453jFsHTP','626277eDAfaq','22HZPGUt',';\x20node/','version','2404530tecxxT','X-Trino-User','tdx/','2FeYrBz','8nNwvov','entries','length','4308EATnMj','279244JBzclX','replace','Authorization','570008wThMwg'];a43_0x1fe8=function(){return _0x31871d;};return a43_0x1fe8();}(function(_0x3667d2,_0xdd9427){const _0x43c8e1=a43_0x724f,_0x21da10=_0x3667d2();while(!![]){try{const _0x1411be=parseInt(_0x43c8e1(0xef))/0x1+-parseInt(_0x43c8e1(0xea))/0x2*(-parseInt(_0x43c8e1(0xe3))/0x3)+parseInt(_0x43c8e1(0xf2))/0x4+parseInt(_0x43c8e1(0xe1))/0x5*(-parseInt(_0x43c8e1(0xee))/0x6)+parseInt(_0x43c8e1(0xe2))/0x7+-parseInt(_0x43c8e1(0xeb))/0x8*(-parseInt(_0x43c8e1(0xe7))/0x9)+-parseInt(_0x43c8e1(0xf3))/0xa*(parseInt(_0x43c8e1(0xe4))/0xb);if(_0x1411be===_0xdd9427)break;else _0x21da10['push'](_0x21da10['shift']());}catch(_0x4ce5dc){_0x21da10['push'](_0x21da10['shift']());}}}(a43_0x1fe8,0x32a24));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3b660b=a43_0x724f,_0x53bdd3=getVersion(),_0x93122b=platform(),_0x18920b=process[_0x3b660b(0xe6)][_0x3b660b(0xf0)]('v','');return _0x3b660b(0xe9)+_0x53bdd3+'\x20('+_0x93122b+_0x3b660b(0xe5)+_0x18920b+')';}export function getAuthHeaders(_0x5cb9a5,_0x11bd8a){const _0x1b6330=getVersion(),_0x3bd521={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x1b6330};return _0x11bd8a&&(_0x3bd521['Authorization']='TD1\x20'+_0x11bd8a),_0x3bd521;}export function toHeaderRecord(_0x4e1edf){const _0x1c4c1f=a43_0x724f,_0x2f03e6={};for(const [_0x4926d4,_0x4eae9c]of Object[_0x1c4c1f(0xec)](_0x4e1edf)){_0x4eae9c!==undefined&&(_0x2f03e6[_0x4926d4]=_0x4eae9c);}return _0x2f03e6;}function a43_0x724f(_0x52c48f,_0x18402d){_0x52c48f=_0x52c48f-0xe1;const _0x1fe89a=a43_0x1fe8();let _0x724f10=_0x1fe89a[_0x52c48f];return _0x724f10;}export function getTrinoHeaders(_0x2b0793,_0x535356){const _0x22f2e2=a43_0x724f,_0x2bb091=getAuthHeaders(_0x2b0793,_0x535356),_0xc3cfed=toHeaderRecord(_0x2bb091);return delete _0xc3cfed[_0x22f2e2(0xf1)],_0x535356&&(_0xc3cfed[_0x22f2e2(0xe8)]=_0x535356),_0xc3cfed;}export function hasAPIKey(_0x431fa4){const _0x4a30e7=a43_0x724f,_0x3d0fa2=getAPIKey(_0x431fa4);return _0x3d0fa2!==undefined&&_0x3d0fa2[_0x4a30e7(0xed)]>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(_0x4711ce,_0x239dbf){const _0x41c4df=a44_0x5ad3,_0x494499=_0x4711ce();while(!![]){try{const _0x1fc9c9=-parseInt(_0x41c4df(0x10c))/0x1*(parseInt(_0x41c4df(0xf9))/0x2)+parseInt(_0x41c4df(0xf2))/0x3*(-parseInt(_0x41c4df(0x102))/0x4)+parseInt(_0x41c4df(0x10d))/0x5+-parseInt(_0x41c4df(0xdd))/0x6*(parseInt(_0x41c4df(0xe3))/0x7)+-parseInt(_0x41c4df(0xd7))/0x8+parseInt(_0x41c4df(0x104))/0x9+parseInt(_0x41c4df(0x103))/0xa*(parseInt(_0x41c4df(0xfd))/0xb);if(_0x1fc9c9===_0x239dbf)break;else _0x494499['push'](_0x494499['shift']());}catch(_0x466303){_0x494499['push'](_0x494499['shift']());}}}(a44_0x4fa8,0xd8c1c));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 a44_0x97c409 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3d9623){const _0x3feebf=a44_0x5ad3;return _0x3d9623[_0x3feebf(0xf7)]==='json'||_0x3d9623[_0x3feebf(0xf7)]==='jsonl'||_0x3d9623[_0x3feebf(0xf7)]===_0x3feebf(0x107)||_0x3d9623['format']===_0x3feebf(0xf4)||_0x3d9623['json']===!![]||_0x3d9623[_0x3feebf(0xd2)]===!![]||_0x3d9623['tsv']===!![]||_0x3d9623[_0x3feebf(0xf4)]===!![];}export function parseOutputOptions(_0x2cd0e5){const _0x346979=a44_0x5ad3;return{'format':_0x2cd0e5[_0x346979(0xf7)]||_0x346979(0xf4),'output':_0x2cd0e5[_0x346979(0xe1)]||'','limit':_0x2cd0e5[_0x346979(0xe4)],'color':_0x2cd0e5['color'],'noColor':_0x2cd0e5[_0x346979(0xe5)]};}function convertSDKResultToQueryResult(_0x29eedb){const _0x5ab661=a44_0x5ad3,_0x12d5cb=[];if(_0x29eedb[_0x5ab661(0xff)]>0x0){const _0x9c6df7=_0x29eedb[0x0];for(const [_0x4bf409,_0xa32fc7]of Object[_0x5ab661(0xe0)](_0x9c6df7)){let _0x33a96b=_0x5ab661(0x111);if(typeof _0xa32fc7===_0x5ab661(0x114))_0x33a96b=Number['isInteger'](_0xa32fc7)?_0x5ab661(0xf5):_0x5ab661(0x117);else{if(typeof _0xa32fc7===_0x5ab661(0xe2))_0x33a96b=_0x5ab661(0xe2);else _0xa32fc7===null&&(_0x33a96b='varchar');}_0x12d5cb[_0x5ab661(0xda)]({'name':_0x4bf409,'type':_0x33a96b});}}return{'queryId':_0x5ab661(0x109),'columns':_0x12d5cb,'data':_0x29eedb,'stats':{'state':_0x5ab661(0xfc),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x29eedb[_0x5ab661(0xff)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5866c2,_0x14d12f){const _0x43b748=convertSDKResultToQueryResult(_0x5866c2);return formatQueryOutput(_0x43b748,_0x14d12f);}export async function formatQueryOutput(_0x55c081,_0x4bef43){const _0x44f5df=a44_0x5ad3,{format:_0x2a2e14,limit:_0x8e514,output:_0x7e257f,color:_0x4b3215,noColor:_0x14988e}=_0x4bef43,_0x148e46=Boolean(_0x7e257f)&&!_0x4b3215,_0x1b19c6={'color':_0x4b3215,'noColor':_0x14988e||_0x148e46};if(_0x2a2e14===_0x44f5df(0xf4)){const _0x202794=shouldUseLess(_0x2a2e14,_0x7e257f);return formatAsTable(_0x55c081,_0x8e514,_0x202794,_0x1b19c6);}else{if(_0x2a2e14===_0x44f5df(0x112))return formatAsJSON(_0x55c081,_0x1b19c6);else return _0x2a2e14==='jsonl'?formatAsJSONL(_0x55c081,_0x1b19c6):formatQueryResult(_0x55c081,_0x2a2e14);}}function shouldUseLess(_0x5e384a,_0x57272e){const _0x52e9f5=a44_0x5ad3;return(_0x5e384a===_0x52e9f5(0xf4)||_0x5e384a===_0x52e9f5(0xe8))&&process[_0x52e9f5(0xd6)]['isTTY']&&!_0x57272e;}function a44_0x5ad3(_0xb60697,_0x4d5a1b){_0xb60697=_0xb60697-0xd1;const _0x4fa8a1=a44_0x4fa8();let _0x5ad33a=_0x4fa8a1[_0xb60697];return _0x5ad33a;}export function resolveOutputOptions(_0x5145ae){const _0x4a5150=a44_0x5ad3,_0x20e4a7=resolveOutputFormat(_0x5145ae[_0x4a5150(0xf7)],_0x5145ae['output'],_0x4a5150(0xf4));let _0xacdd40=typeof _0x5145ae[_0x4a5150(0xe4)]===_0x4a5150(0x114)?_0x5145ae['limit']:parseInt(_0x5145ae[_0x4a5150(0xe4)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x22bad3=_0x5145ae['output']||'';return shouldUseLess(_0x20e4a7,_0x22bad3)&&(_0xacdd40=Infinity),{'format':_0x20e4a7,'output':_0x22bad3,'limit':_0xacdd40,'color':_0x5145ae['color'],'noColor':_0x5145ae['noColor']};}function a44_0x4fa8(){const _0x12bf57=['end','push','repeat','pipe','138qTYHJc','[Object]','stdin','entries','output','boolean','316939lvwoYG','limit','noColor','keys','max','list','trim','bold','error','yellow','forEach','blue','map','close','log','3882RnfppM','debug','table','bigint','resolve','format','split','8ZhbjSH','write','padEnd','FINISHED','22733711aIPcBc','params','length','rule','query','608QbKgzy','20HUArOg','552681MbMsWM','less','stringify','tsv','[error]','sdk-result','[logs]','cmdout','305893RYVRGb','1522030rjxbdF','join','magenta','No\x20data','varchar','json','spawn','number','[rule]','object','double','Results\x20saved\x20to\x20','jsonl','[query]','─┴─','inherit','stdout','9198000GGZweO','[params]'];a44_0x4fa8=function(){return _0x12bf57;};return a44_0x4fa8();}export function writeOutput(_0x499aec,_0x4fd83b,_0x16225a){const _0x2b6b1f=a44_0x5ad3;return _0x4fd83b?(writeFileSync(_0x4fd83b,_0x499aec),console[_0x2b6b1f(0xeb)](_0x2b6b1f(0xd1)+_0x4fd83b),Promise['resolve']()):shouldUseLess(_0x16225a||'','')?new Promise(_0x4037ca=>{const _0xe6484a=_0x2b6b1f,_0x4597aa=spawn(_0xe6484a(0x105),['-FXRSn'],{'stdio':[_0xe6484a(0xdc),_0xe6484a(0xd5),_0xe6484a(0xd5)]});let _0x4283c9=![];_0x4597aa['on'](_0xe6484a(0xeb),()=>{!_0x4283c9&&(_0x4283c9=!![],console['log'](_0x499aec),_0x4037ca());}),_0x4597aa['on'](_0xe6484a(0xf0),()=>{!_0x4283c9&&(_0x4283c9=!![],_0x4037ca());}),_0x4597aa['on'](_0xe6484a(0x113),()=>{const _0x305301=_0xe6484a;!_0x4283c9&&_0x4597aa['stdin']&&(_0x4597aa[_0x305301(0xdf)]['on'](_0x305301(0xeb),()=>{}),_0x4597aa['stdin'][_0x305301(0xfa)](_0x499aec),_0x4597aa['stdin'][_0x305301(0xd9)]());}),!_0x4597aa[_0xe6484a(0xdf)]&&(!_0x4283c9&&(_0x4283c9=!![],console['log'](_0x499aec),_0x4037ca()));}):(console[_0x2b6b1f(0xf1)](_0x499aec),Promise[_0x2b6b1f(0xf6)]());}export async function handleSDKOutput(_0x4c1c7d,_0x334f72){const _0x3a4098=a44_0x5ad3,_0x11114d=resolveOutputOptions(_0x334f72),_0x608a23=await formatSDKOutput(_0x4c1c7d,_0x11114d);await writeOutput(_0x608a23,_0x11114d[_0x3a4098(0xe1)]||undefined,_0x11114d[_0x3a4098(0xf7)]);}export async function handleQueryOutput(_0x3d720d,_0x175774){const _0x397eef=a44_0x5ad3,_0x192410=resolveOutputOptions(_0x175774),_0xbfc35a=await formatQueryOutput(_0x3d720d,_0x192410);await writeOutput(_0xbfc35a,_0x192410['output']||undefined,_0x192410[_0x397eef(0xf7)]);}async function formatSingleObject(_0x56ca58,_0x20c213){const _0x341947=a44_0x5ad3,{format:_0x4411c0,color:_0x32fe51,noColor:_0xeb9ca8}=_0x20c213,_0x3819a9={'color':_0x32fe51,'noColor':_0xeb9ca8};if(_0x4411c0===_0x341947(0x112)){if(shouldUseColor(_0x3819a9))return colorizeJSON(_0x56ca58,_0x3819a9);return JSON[_0x341947(0x106)](_0x56ca58,null,0x2);}else{if(_0x4411c0==='jsonl'){if(shouldUseColor(_0x3819a9))return colorizeJSONCompact(_0x56ca58,_0x3819a9);return JSON[_0x341947(0x106)](_0x56ca58);}else{if(_0x4411c0===_0x341947(0x107))return Object['entries'](_0x56ca58)['map'](([_0x128f2a,_0x2de2da])=>_0x128f2a+'\x09'+_0x2de2da)['join']('\x0a');else{const _0x389021=Object['entries'](_0x56ca58);if(_0x389021[_0x341947(0xff)]===0x0)return _0x341947(0x110);const _0x332767=_0x56ca58[_0x341947(0xf3)],_0x4a0f81=_0x56ca58[_0x341947(0x101)],_0x311746=_0x56ca58[_0x341947(0xfe)],_0x1c8f33=_0x56ca58[_0x341947(0x100)],_0x450e76=_0x4a0f81?typeof _0x4a0f81==='string'?_0x4a0f81:JSON[_0x341947(0x106)](_0x4a0f81,null,0x2):undefined,_0x41e4ec=_0x311746&&Object[_0x341947(0xe6)](_0x311746)[_0x341947(0xff)]>0x0?JSON[_0x341947(0x106)](_0x311746,null,0x2):undefined,_0x4824d5=_0x1c8f33&&Object['keys'](_0x1c8f33)[_0x341947(0xff)]>0x0?JSON[_0x341947(0x106)](_0x1c8f33,null,0x2):undefined,_0x45a890=_0x389021['filter'](([_0x1da51a])=>_0x1da51a!==_0x341947(0xf3)&&_0x1da51a!=='query'&&_0x1da51a!==_0x341947(0xfe)&&_0x1da51a!==_0x341947(0x100)),_0x58684a=Math['max'](..._0x45a890[_0x341947(0xef)](([_0x33f663])=>_0x33f663[_0x341947(0xff)])),_0x1c31dd=Math['max'](..._0x45a890['map'](([,_0x1677cb])=>{const _0x3b692d=_0x341947;try{const _0x288d0a=_0x1677cb===null||_0x1677cb===undefined?'':typeof _0x1677cb===_0x3b692d(0x116)?JSON[_0x3b692d(0x106)](_0x1677cb):String(_0x1677cb),_0xdcf133=_0x288d0a['split']('\x0a');return Math[_0x3b692d(0xe7)](..._0xdcf133[_0x3b692d(0xef)](_0x52a9fb=>_0x52a9fb['length']),0x0);}catch{return 0x0;}}),0x14),_0x40e538=[];_0x40e538[_0x341947(0xda)](colorBorder('┌─'+'─'['repeat'](_0x58684a)+'─┬─'+'─'[_0x341947(0xdb)](_0x1c31dd)+'─┐',_0x3819a9)),_0x45a890[_0x341947(0xed)](([_0x3fcd16,_0x396f10])=>{const _0x56199e=_0x341947;let _0x2c1e38;try{_0x2c1e38=_0x396f10===null||_0x396f10===undefined?'':typeof _0x396f10===_0x56199e(0x116)?JSON[_0x56199e(0x106)](_0x396f10):String(_0x396f10);}catch{_0x2c1e38=_0x56199e(0xde);}const _0x382eb0=_0x3fcd16[_0x56199e(0xfb)](_0x58684a),_0x309a0d=_0x2c1e38[_0x56199e(0xf8)]('\x0a');_0x309a0d['forEach']((_0x4a568e,_0x3063a7)=>{const _0x3f8eac=_0x56199e,_0x317a36=colorBorder('│',_0x3819a9);_0x3063a7===0x0?_0x40e538[_0x3f8eac(0xda)](_0x317a36+'\x20'+_0x382eb0+'\x20'+_0x317a36+'\x20'+_0x4a568e['padEnd'](_0x1c31dd)+'\x20'+_0x317a36):_0x40e538[_0x3f8eac(0xda)](_0x317a36+'\x20'+'\x20'[_0x3f8eac(0xdb)](_0x58684a)+'\x20'+_0x317a36+'\x20'+_0x4a568e[_0x3f8eac(0xfb)](_0x1c31dd)+'\x20'+_0x317a36);});}),_0x40e538['push'](colorBorder('└─'+'─'['repeat'](_0x58684a)+_0x341947(0xd4)+'─'['repeat'](_0x1c31dd)+'─┘',_0x3819a9));_0x450e76&&(_0x40e538[_0x341947(0xda)](''),_0x40e538['push'](String(a44_0x97c409[_0x341947(0xec)][_0x341947(0xea)](_0x341947(0xd3)))),_0x40e538[_0x341947(0xda)](_0x450e76));_0x41e4ec&&(_0x40e538[_0x341947(0xda)](''),_0x40e538[_0x341947(0xda)](String(a44_0x97c409[_0x341947(0xee)][_0x341947(0xea)](_0x341947(0xd8)))),_0x40e538['push'](_0x41e4ec));_0x4824d5&&(_0x40e538[_0x341947(0xda)](''),_0x40e538[_0x341947(0xda)](String(a44_0x97c409[_0x341947(0x10f)]['bold'](_0x341947(0x115)))),_0x40e538[_0x341947(0xda)](_0x4824d5));if(_0x332767){if(_0x332767['stderr']){_0x40e538['push'](''),_0x40e538['push'](String(a44_0x97c409['red']['bold'](_0x341947(0x108))));const _0x44ef95=_0x332767['stderr']['split']('\x0a');_0x44ef95['forEach'](_0x2a343f=>{const _0x4788b1=_0x341947;_0x2a343f[_0x4788b1(0xe9)]()&&_0x40e538[_0x4788b1(0xda)](_0x2a343f);});}if(_0x332767['cmdout']){_0x40e538['push'](''),_0x40e538[_0x341947(0xda)](String(a44_0x97c409['cyan'][_0x341947(0xea)](_0x341947(0x10a))));const _0x23e410=_0x332767[_0x341947(0x10b)][_0x341947(0xf8)]('\x0a');_0x23e410[_0x341947(0xed)](_0x1e8815=>{const _0x7271d9=_0x341947;_0x1e8815[_0x7271d9(0xe9)]()&&_0x40e538['push'](_0x1e8815);});}}return _0x40e538[_0x341947(0x10e)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5e8981,_0x4b905e){const _0x117180=a44_0x5ad3;if(_0x4b905e[_0x117180(0xf7)]==='table'){await handleSDKOutput([_0x5e8981],_0x4b905e);return;}const _0x323095=resolveOutputOptions(_0x4b905e),_0x5dbc40=await formatSingleObject(_0x5e8981,_0x323095);await writeOutput(_0x5dbc40,_0x323095[_0x117180(0xe1)]||undefined,_0x323095['format']);}