@treasuredata/tdx 0.16.16 → 0.16.18

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 (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.d.ts.map +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js.map +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/anthropic-adapter.js +1 -1
  67. package/dist/proxy/claude-usage-tracker.js +1 -1
  68. package/dist/proxy/context-signature.js +1 -1
  69. package/dist/proxy/conversation-utils.js +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/api.js +1 -1
  83. package/dist/sdk/client/cdp-api-client.js +1 -1
  84. package/dist/sdk/client/endpoints.js +1 -1
  85. package/dist/sdk/client/engage-api-client.js +1 -1
  86. package/dist/sdk/client/http-client.js +1 -1
  87. package/dist/sdk/client/llm-api-client.js +1 -1
  88. package/dist/sdk/client/rate-limiter.js +1 -1
  89. package/dist/sdk/client/td-api-client.js +1 -1
  90. package/dist/sdk/client/trino-api-client.js +1 -1
  91. package/dist/sdk/client/workflow-client.js +1 -1
  92. package/dist/sdk/connection-validator.js +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.js +1 -1
  96. package/dist/sdk/index.js +1 -1
  97. package/dist/sdk/io/index.js +1 -1
  98. package/dist/sdk/io/node-filesystem.js +1 -1
  99. package/dist/sdk/job.js +1 -1
  100. package/dist/sdk/journey.js +1 -1
  101. package/dist/sdk/llm/chat-cache.js +1 -1
  102. package/dist/sdk/llm/index.js +1 -1
  103. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  104. package/dist/sdk/llm/model-aliases.js +1 -1
  105. package/dist/sdk/llm/model-factors.js +1 -1
  106. package/dist/sdk/query/index.js +1 -1
  107. package/dist/sdk/query/sql-parser.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a42_0x368355=a42_0x42ba;(function(_0x713dbc,_0xad0359){const _0x2a7a89=a42_0x42ba,_0x1fdeef=_0x713dbc();while(!![]){try{const _0x558489=parseInt(_0x2a7a89(0x1e0))/0x1*(-parseInt(_0x2a7a89(0x30c))/0x2)+parseInt(_0x2a7a89(0x26b))/0x3+parseInt(_0x2a7a89(0x24f))/0x4*(parseInt(_0x2a7a89(0x1b6))/0x5)+-parseInt(_0x2a7a89(0x29b))/0x6+-parseInt(_0x2a7a89(0x30d))/0x7*(parseInt(_0x2a7a89(0x201))/0x8)+parseInt(_0x2a7a89(0x296))/0x9*(-parseInt(_0x2a7a89(0x2f8))/0xa)+-parseInt(_0x2a7a89(0x1ed))/0xb*(-parseInt(_0x2a7a89(0x1d0))/0xc);if(_0x558489===_0xad0359)break;else _0x1fdeef['push'](_0x1fdeef['shift']());}catch(_0x752224){_0x1fdeef['push'](_0x1fdeef['shift']());}}}(a42_0x59b0,0x64660));import a42_0xddcea5 from'chalk';import{existsSync}from'fs';import a42_0x354f39 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';function a42_0x42ba(_0x329595,_0x385f89){_0x329595=_0x329595-0x18f;const _0x59b046=a42_0x59b0();let _0x42bac2=_0x59b046[_0x329595];return _0x42bac2;}import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x25b42a from'prompts';function getAttemptStatusDisplay(_0x59e8fc){const _0x4116e7=a42_0x42ba;if(!_0x59e8fc)return{'icon':'⏳','text':''};const {done:_0x280d42,success:_0x544d47,cancelRequested:_0x260cb7}=_0x59e8fc;if(!_0x280d42)return _0x260cb7?{'icon':'🛑','text':a42_0xddcea5[_0x4116e7(0x2a1)](_0x4116e7(0x2d7))}:{'icon':'🔄','text':a42_0xddcea5[_0x4116e7(0x305)](_0x4116e7(0x21c))};if(_0x544d47)return{'icon':'✅','text':a42_0xddcea5[_0x4116e7(0x282)](_0x4116e7(0x2fc))};return{'icon':'❌','text':a42_0xddcea5[_0x4116e7(0x1e5)](_0x4116e7(0x31b))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x368355(0x2c4)](_0x4ff708,_0x2e97c3,_0x592577=0x0){return _0x4ff708[_0x592577]||_0x2e97c3['workflowProject'];}[a42_0x368355(0x2c3)](_0x2c788c,_0x3f77dc,_0x11c514=0x0){const _0x29cf60=a42_0x368355,_0x56d205=this[_0x29cf60(0x2c4)](_0x2c788c,_0x3f77dc,_0x11c514);if(!_0x56d205)return console[_0x29cf60(0x31b)](a42_0xddcea5[_0x29cf60(0x1e5)](_0x29cf60(0x2ba)),_0x29cf60(0x306)),console[_0x29cf60(0x31b)](a42_0xddcea5[_0x29cf60(0x28d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x56d205;}['parseProjectWorkflowPattern'](_0x526388,_0x665738){const _0x304869=a42_0x368355;if(_0x526388[0x0]){const _0x1ab9bc=_0x526388[0x0][_0x304869(0x1f9)]('.');if(_0x1ab9bc['length']===0x1)return{'projectName':_0x1ab9bc[0x0],'workflowName':undefined};else return _0x1ab9bc[_0x304869(0x1c0)]===0x2?{'projectName':_0x1ab9bc[0x0],'workflowName':_0x1ab9bc[0x1]}:(console['error'](a42_0xddcea5['red'](_0x304869(0x2ba)),_0x304869(0x24a)),null);}return{'projectName':_0x665738['workflowProject'],'workflowName':undefined};}[a42_0x368355(0x1b1)](_0x58f32b,_0x528359,_0x40250b=0x0){const _0x4b8ead=a42_0x368355;if(_0x58f32b[_0x40250b])return _0x58f32b[_0x40250b];if(_0x528359['workflowProject']){const _0x49c3f3=a42_0x354f39[_0x4b8ead(0x22f)](process[_0x4b8ead(0x2ef)](),_0x4b8ead(0x221),_0x528359[_0x4b8ead(0x1e7)]);if(existsSync(a42_0x354f39[_0x4b8ead(0x22f)](_0x49c3f3,_0x4b8ead(0x2ad))))return _0x49c3f3;}return undefined;}async[a42_0x368355(0x307)](_0x4f9a08,_0x4ec9f1,_0x4575ff){const _0x28bdfc=a42_0x368355;try{const _0x52de4f=await _0x4f9a08['workflow'][_0x28bdfc(0x221)](_0x4ec9f1,{'limit':0x1});if(_0x52de4f[_0x28bdfc(0x1c0)]>0x0){const _0x25b8b5=_0x52de4f[0x0]['id'],_0x216032=getWorkflowUrl(_0x4575ff,_0x25b8b5);console['error']('\x20\x20Console:\x20'+a42_0xddcea5[_0x28bdfc(0x332)](_0x216032));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x2a4);[a42_0x368355(0x2eb)]=a42_0x368355(0x2c8);async['execute'](_0x3fe3a1){const _0x159f0f=a42_0x368355,{options:_0x269937,args:_0x1b84a2,tdx:_0x2183bc}=_0x3fe3a1,_0x436f74=_0x1b84a2[0x0],_0x283faf=_0x269937[_0x159f0f(0x265)];if(_0x283faf)return saveSessionContext({'workflow_project':undefined},_0x269937[_0x159f0f(0x23b)]),console['log'](a42_0xddcea5['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x436f74)return console[_0x159f0f(0x31b)](a42_0xddcea5[_0x159f0f(0x1e5)](_0x159f0f(0x2ba)),_0x159f0f(0x306)),console[_0x159f0f(0x31b)](a42_0xddcea5[_0x159f0f(0x28d)](_0x159f0f(0x30f))),console[_0x159f0f(0x31b)](a42_0xddcea5[_0x159f0f(0x28d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x21336d=await withSpinner(_0x159f0f(0x2b4)+_0x436f74+_0x159f0f(0x2ed),()=>_0x2183bc[_0x159f0f(0x1e3)][_0x159f0f(0x290)](_0x436f74),{'verbose':_0x269937['verbose']}),{name:_0x4cf9df}=_0x21336d['data'];return saveSessionContext({'workflow_project':_0x4cf9df},_0x269937['session']),console[_0x159f0f(0x2b5)](a42_0xddcea5['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a42_0xddcea5[_0x159f0f(0x332)](_0x4cf9df))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x368355(0x1fb);[a42_0x368355(0x2eb)]=a42_0x368355(0x1ae);async[a42_0x368355(0x1c7)](_0x4d51cc){const _0x5e8cb4=a42_0x368355,{options:_0x15349e,args:_0x95248a,tdx:_0x437a5f}=_0x4d51cc,_0x249ba5=_0x95248a[0x0];_0x15349e[_0x5e8cb4(0x2d5)]&&_0x249ba5&&console[_0x5e8cb4(0x31b)](_0x5e8cb4(0x194)+_0x249ba5);const _0x3008ac=await withSpinner(_0x5e8cb4(0x271),()=>_0x437a5f[_0x5e8cb4(0x1e3)][_0x5e8cb4(0x22c)](_0x249ba5,{'limit':_0x15349e[_0x5e8cb4(0x292)]}),{'verbose':_0x15349e[_0x5e8cb4(0x2d5)]});let _0x215c48=_0x3008ac[_0x5e8cb4(0x298)];_0x215c48[_0x5e8cb4(0x1bb)]((_0xe6ad77,_0x3ca778)=>_0xe6ad77['name'][_0x5e8cb4(0x1c8)](_0x3ca778[_0x5e8cb4(0x2c7)]));const _0x46b443=_0x15349e[_0x5e8cb4(0x292)]||0x64,_0x130017=_0x215c48[_0x5e8cb4(0x1c0)]>=_0x46b443?a42_0xddcea5[_0x5e8cb4(0x28d)](_0x5e8cb4(0x1d8)):'';console[_0x5e8cb4(0x31b)](_0x5e8cb4(0x1dc)+_0x215c48[_0x5e8cb4(0x1c0)]+'\x20project'+(_0x215c48[_0x5e8cb4(0x1c0)]!==0x1?'s':'')+_0x130017);if(_0x15349e[_0x5e8cb4(0x2ac)]===_0x5e8cb4(0x252)||_0x15349e[_0x5e8cb4(0x2ac)]==='jsonl'||_0x15349e[_0x5e8cb4(0x2ac)]===_0x5e8cb4(0x21f))await handleSDKOutput(_0x215c48,_0x15349e);else{if(_0x215c48[_0x5e8cb4(0x1c0)]===0x0)_0x249ba5?console[_0x5e8cb4(0x2b5)]('No\x20projects\x20match\x20pattern:\x20'+_0x249ba5):console[_0x5e8cb4(0x2b5)](_0x5e8cb4(0x256));else{const _0x4dac0c=_0x215c48[_0x5e8cb4(0x1b7)](_0x3d34f9=>{const _0x48d619=_0x5e8cb4,_0x1826fc=_0x3d34f9['metadata']?.['some'](_0x283b05=>_0x283b05[_0x48d619(0x198)]===_0x48d619(0x28e)),_0x49985e=_0x1826fc?a42_0xddcea5[_0x48d619(0x28d)](_0x48d619(0x18f)):'';return _0x48d619(0x254)+_0x3d34f9[_0x48d619(0x2c7)]+_0x49985e;});await writeOutput(_0x4dac0c[_0x5e8cb4(0x22f)]('\x0a'),_0x15349e[_0x5e8cb4(0x325)],_0x5e8cb4(0x1c5));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]='workflow:workflows';[a42_0x368355(0x2eb)]=a42_0x368355(0x2ec);async['execute'](_0x4a9d52){const _0x1f6ab3=a42_0x368355,{options:_0x18c8c9,args:_0x290a06,tdx:_0x4fa003}=_0x4a9d52,_0x516a74=this[_0x1f6ab3(0x2c4)](_0x290a06,_0x18c8c9);_0x18c8c9[_0x1f6ab3(0x2d5)]&&_0x516a74&&console[_0x1f6ab3(0x31b)]('Project\x20filter:\x20'+_0x516a74);const _0x34963e=await withSpinner(_0x1f6ab3(0x204),()=>_0x4fa003['workflow']['workflows'](_0x516a74,{'limit':_0x18c8c9[_0x1f6ab3(0x292)]}),{'verbose':_0x18c8c9[_0x1f6ab3(0x2d5)]});let _0x575802=_0x34963e['data'];_0x575802[_0x1f6ab3(0x1bb)]((_0x5292d1,_0x3fdc11)=>{const _0x2fb1c8=_0x1f6ab3,_0x5c084f=_0x5292d1[_0x2fb1c8(0x2c7)]['localeCompare'](_0x3fdc11[_0x2fb1c8(0x2c7)]);if(_0x5c084f!==0x0)return _0x5c084f;return(_0x5292d1[_0x2fb1c8(0x1b4)]?.['name']||'')[_0x2fb1c8(0x1c8)](_0x3fdc11[_0x2fb1c8(0x1b4)]?.[_0x2fb1c8(0x2c7)]||'');});const _0x41b633=_0x18c8c9[_0x1f6ab3(0x292)]||0x64,_0x3d13d9=_0x575802['length']>=_0x41b633?a42_0xddcea5['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1f6ab3(0x31b)](_0x1f6ab3(0x1dc)+_0x575802[_0x1f6ab3(0x1c0)]+_0x1f6ab3(0x2b0)+(_0x575802[_0x1f6ab3(0x1c0)]!==0x1?'s':'')+_0x3d13d9);if(_0x18c8c9[_0x1f6ab3(0x2ac)]==='json'||_0x18c8c9[_0x1f6ab3(0x2ac)]===_0x1f6ab3(0x2c0)||_0x18c8c9[_0x1f6ab3(0x2ac)]===_0x1f6ab3(0x21f))await handleSDKOutput(_0x575802,_0x18c8c9);else{if(_0x575802[_0x1f6ab3(0x1c0)]===0x0)_0x516a74?console[_0x1f6ab3(0x2b5)](_0x1f6ab3(0x25b)+_0x516a74):console[_0x1f6ab3(0x2b5)]('No\x20workflows\x20found');else{const _0x112484=_0x18c8c9[_0x1f6ab3(0x2fe)],_0x2e118b=_0x575802['map'](_0x33053f=>{const _0x5eb61d=_0x1f6ab3,_0x2819c6=a42_0xddcea5['dim']('#'+_0x33053f['id']),_0x54d962=hyperlink(_0x2819c6,getWorkflowUrl(_0x112484,_0x33053f['id'])),_0x6797f=_0x33053f[_0x5eb61d(0x1b4)]?.[_0x5eb61d(0x2c7)]?a42_0xddcea5[_0x5eb61d(0x28d)]('\x20('+_0x33053f[_0x5eb61d(0x1b4)][_0x5eb61d(0x2c7)]+')'):'';return'📋\x20'+_0x54d962+'\x20'+_0x33053f[_0x5eb61d(0x2c7)]+_0x6797f;});await writeOutput(_0x2e118b['join']('\x0a'),_0x18c8c9[_0x1f6ab3(0x325)],_0x1f6ab3(0x1c5));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]='workflow:sessions';['description']='List\x20workflow\x20execution\x20sessions';async['execute'](_0x2842b0){const _0xf1365b=a42_0x368355,{options:_0x353160,args:_0x1f29dd,tdx:_0xba00f3}=_0x2842b0,_0x266919=this['parseProjectWorkflowPattern'](_0x1f29dd,_0x353160);if(!_0x266919)return 0x1;const {projectName:_0x1e6eef,workflowName:_0xd77638}=_0x266919;if(_0x353160[_0xf1365b(0x2d5)]){if(_0x1e6eef&&_0xd77638)console[_0xf1365b(0x31b)](_0xf1365b(0x25c)+_0x1e6eef+'.'+_0xd77638);else _0x1e6eef&&console[_0xf1365b(0x31b)](_0xf1365b(0x20b)+_0x1e6eef);const _0x4b7d1e=_0x353160[_0xf1365b(0x1af)];_0x4b7d1e&&console[_0xf1365b(0x31b)]('Status:\x20'+_0x4b7d1e);}let _0x5a1e2c=0x28;if(process[_0xf1365b(0x1ac)][_0xf1365b(0x1b2)]&&!_0x353160[_0xf1365b(0x325)]&&!_0x353160[_0xf1365b(0x2ac)]){const _0x1bc482=process[_0xf1365b(0x1ac)][_0xf1365b(0x1b0)]||0x28;_0x5a1e2c=Math['max'](0x14,Math['floor'](_0x1bc482*0x2/0x3));}const _0x563f38=_0x353160[_0xf1365b(0x292)]||_0x5a1e2c,_0x144d59=await withSpinner(_0xf1365b(0x2ae),()=>_0xba00f3[_0xf1365b(0x1e3)][_0xf1365b(0x1f6)]({'projectName':_0x1e6eef,'workflowName':_0xd77638,'status':_0x353160[_0xf1365b(0x1af)],'fromTime':_0x353160['from'],'toTime':_0x353160['to'],'limit':_0x563f38}),{'verbose':_0x353160[_0xf1365b(0x2d5)]}),_0x1a57d9=_0x144d59[_0xf1365b(0x298)];_0x1a57d9['sort']((_0x2e4dbd,_0x3b674c)=>{const _0x3f5739=_0xf1365b,_0x419823=_0x2e4dbd[_0x3f5739(0x269)]||'',_0x17235a=_0x3b674c[_0x3f5739(0x269)]||'';return _0x17235a['localeCompare'](_0x419823);});_0x1a57d9[_0xf1365b(0x1c0)]>=_0x563f38?console[_0xf1365b(0x31b)](_0xf1365b(0x31c)+_0x1a57d9[_0xf1365b(0x1c0)]+_0xf1365b(0x1a6)+a42_0xddcea5[_0xf1365b(0x28d)](_0xf1365b(0x1a0))):console[_0xf1365b(0x31b)](_0xf1365b(0x1dc)+_0x1a57d9[_0xf1365b(0x1c0)]+_0xf1365b(0x209)+(_0x1a57d9[_0xf1365b(0x1c0)]!==0x1?'s':''));if(_0x353160[_0xf1365b(0x2ac)]===_0xf1365b(0x252)||_0x353160[_0xf1365b(0x2ac)]==='jsonl'||_0x353160[_0xf1365b(0x2ac)]===_0xf1365b(0x21f))await handleSDKOutput(_0x1a57d9,_0x353160);else{if(!process['stdout'][_0xf1365b(0x1b2)]||_0x353160[_0xf1365b(0x325)]){if(_0x1a57d9[_0xf1365b(0x1c0)]===0x0){if(_0x1e6eef&&_0xd77638)console[_0xf1365b(0x2b5)](_0xf1365b(0x29a)+_0x1e6eef+'.'+_0xd77638);else _0x1e6eef?console[_0xf1365b(0x2b5)](_0xf1365b(0x22e)+_0x1e6eef):console[_0xf1365b(0x2b5)](_0xf1365b(0x310));}else{const _0x4cdda4=_0x353160[_0xf1365b(0x2fe)],_0x3cf09d=this[_0xf1365b(0x2f0)](_0x1a57d9,_0x4cdda4);_0x353160[_0xf1365b(0x325)]?await writeOutput(_0x3cf09d,_0x353160[_0xf1365b(0x325)],_0xf1365b(0x1c5)):console[_0xf1365b(0x2b5)](_0x3cf09d);}!_0x1e6eef&&(console[_0xf1365b(0x31b)](''),console[_0xf1365b(0x31b)](a42_0xddcea5[_0xf1365b(0x28d)](_0xf1365b(0x1d9))),console['error'](a42_0xddcea5[_0xf1365b(0x28d)](_0xf1365b(0x20e))+'or'+a42_0xddcea5[_0xf1365b(0x28d)](_0xf1365b(0x1ff))));}else{if(_0x1a57d9[_0xf1365b(0x1c0)]===0x0){if(_0x1e6eef&&_0xd77638)console[_0xf1365b(0x2b5)]('No\x20sessions\x20found\x20for:\x20'+_0x1e6eef+'.'+_0xd77638);else _0x1e6eef?console[_0xf1365b(0x2b5)](_0xf1365b(0x22e)+_0x1e6eef):console[_0xf1365b(0x2b5)](_0xf1365b(0x310));}else await this[_0xf1365b(0x200)](_0x1a57d9,_0x2842b0,_0x1e6eef);}}return 0x0;}['renderSessionsTimeline'](_0x449c66,_0x215c56){const _0x294eae=a42_0x368355,_0x3362b1=[],_0x2bfc22=new Map();let _0x322956=Infinity,_0x1f84af=-Infinity;for(const _0x31d568 of _0x449c66){if(_0x31d568[_0x294eae(0x2a9)]?.[_0x294eae(0x2b7)]){const _0x227efe=new Date(_0x31d568[_0x294eae(0x2a9)]['createdAt'])[_0x294eae(0x1be)](),_0x751f4b=_0x31d568[_0x294eae(0x2a9)][_0x294eae(0x19e)]?new Date(_0x31d568[_0x294eae(0x2a9)][_0x294eae(0x19e)])['getTime']():Date[_0x294eae(0x263)](),_0x13fd12=_0x31d568[_0x294eae(0x1b4)]?.[_0x294eae(0x2c7)]||'(unknown)';!_0x2bfc22[_0x294eae(0x202)](_0x13fd12)&&_0x2bfc22['set'](_0x13fd12,[]),_0x2bfc22[_0x294eae(0x206)](_0x13fd12)[_0x294eae(0x1c3)]({'session':_0x31d568,'startTime':_0x227efe,'endTime':_0x751f4b,'duration':_0x751f4b-_0x227efe}),_0x322956=Math[_0x294eae(0x2ea)](_0x322956,_0x227efe),_0x1f84af=Math[_0x294eae(0x1d7)](_0x1f84af,_0x751f4b);}}if(_0x2bfc22['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x261ac1=process[_0x294eae(0x1ac)][_0x294eae(0x235)]||0x78,_0x57cad1=0x1e,_0x21cd84=0x32,_0x4df93e=0x4,_0x333f7a=Math[_0x294eae(0x2ea)](_0x21cd84,Math['max'](_0x57cad1,Math['floor'](_0x261ac1*0.3))),_0x424532=_0x261ac1-_0x333f7a-TIMELINE_CONFIG[_0x294eae(0x1bf)]-0x3-_0x4df93e,_0x3ce6a1=_0x1f84af-_0x322956,_0x295104=_0x3ce6a1/_0x333f7a,_0x317272=renderTimeAxis({'startTime':_0x322956,'endTime':_0x1f84af,'durationMs':_0x3ce6a1,'msPerChar':_0x295104},_0x333f7a),_0xeba2e0=[];for(const _0x1136d2 of _0x2bfc22[_0x294eae(0x315)]()){_0xeba2e0[_0x294eae(0x1c3)](..._0x1136d2);}_0xeba2e0['sort']((_0x496fe5,_0xdebc4b)=>_0xdebc4b[_0x294eae(0x19c)]-_0x496fe5[_0x294eae(0x19c)]);const _0x5454fa=new Date(_0x322956),_0x4a2434=formatDate(_0x5454fa),_0x77aace=_0x4df93e+TIMELINE_CONFIG[_0x294eae(0x27b)]+TIMELINE_CONFIG[_0x294eae(0x2a5)]+_0x424532,_0x499db3='\x20'['repeat'](_0x77aace-_0x4a2434[_0x294eae(0x1c0)]),_0x401238=_0x499db3+a42_0xddcea5[_0x294eae(0x28d)](_0x4a2434)+'\x20'+_0x317272;_0x3362b1[_0x294eae(0x1c3)](_0x401238);const _0x514256=0x16;let _0x5bea61=0x0;for(const _0x558005 of _0xeba2e0){const _0x2ba88e=_0x558005[_0x294eae(0x23b)][_0x294eae(0x1b4)]?.[_0x294eae(0x2c7)]||'?',_0x7e5a8=Math[_0x294eae(0x2ea)](stringWidth(_0x2ba88e),_0x514256);_0x5bea61=Math[_0x294eae(0x1d7)](_0x5bea61,_0x7e5a8);}for(const _0x20d8c2 of _0xeba2e0){const {session:_0x1bdaf3,startTime:_0xc42574,endTime:_0x3c4a59,duration:_0x3fcef2}=_0x20d8c2,_0x43b78b=_0x1bdaf3['project']?.['id'],_0x56d915=_0x1bdaf3['id'],_0x41ccb7=_0x1bdaf3[_0x294eae(0x1b4)]?.[_0x294eae(0x2c7)]||'?',_0x104825=_0x1bdaf3['workflow']?.[_0x294eae(0x2c7)]||'?';let _0x318b61,_0x4c9af1;if(_0x1bdaf3[_0x294eae(0x2a9)]){const _0x5cabae=_0x1bdaf3[_0x294eae(0x2a9)];!_0x5cabae[_0x294eae(0x236)]?(_0x318b61=_0x5cabae[_0x294eae(0x27d)]?'🛑':'🔄',_0x4c9af1=_0x5cabae[_0x294eae(0x27d)]?a42_0xddcea5[_0x294eae(0x2a1)]:a42_0xddcea5['blue']):(_0x318b61=_0x5cabae['success']?'✅':'❌',_0x4c9af1=_0x5cabae[_0x294eae(0x2fc)]?a42_0xddcea5[_0x294eae(0x282)]:a42_0xddcea5[_0x294eae(0x1e5)]);}else _0x318b61='⏳',_0x4c9af1=a42_0xddcea5[_0x294eae(0x28d)];const _0x5bff2e='#'+_0x56d915,_0x9c6f42=_0x43b78b?hyperlink(_0x5bff2e,getWorkflowSessionUrl(_0x215c56,_0x43b78b,_0x56d915)):_0x5bff2e;let _0x360d97=_0x41ccb7;stringWidth(_0x41ccb7)>_0x514256&&(_0x360d97=_0x41ccb7[_0x294eae(0x1cc)](0x0,_0x514256-0x1)+'…');const _0x584026=a42_0xddcea5[_0x294eae(0x28d)](_0x360d97),_0xcd2099=stringWidth(_0x360d97),_0x2fdffc='\x20'[_0x294eae(0x2c2)](_0x5bea61-stringWidth(_0x360d97)+0x2),_0x442e1d='('+formatElapsed(_0x3fcef2)+')',_0x330e94=stringWidth(_0x442e1d),_0x44cb12=stringWidth(_0x5bff2e),_0xa313a9=_0x44cb12+0x1+_0xcd2099+_0x2fdffc[_0x294eae(0x1c0)],_0x35939f=_0x424532-_0xa313a9-_0x330e94-0x1-0x8;let _0xffd524=_0x104825;stringWidth(_0xffd524)>_0x35939f&&(_0xffd524=_0xffd524['slice'](0x0,_0x35939f-0x1)+'…');const _0x5c67b8=_0x9c6f42+'\x20'+_0x584026+_0x2fdffc+_0xffd524,_0x3bff61=stringWidth(_0x5c67b8),_0x4382cc=_0x424532-_0x3bff61-_0x330e94,_0x24d9b9=_0x5c67b8+'\x20'[_0x294eae(0x2c2)](Math['max'](0x1,_0x4382cc))+a42_0xddcea5[_0x294eae(0x28d)](_0x442e1d),_0x4af763=Math['floor']((_0xc42574-_0x322956)/_0x295104),_0x549f6f=Math[_0x294eae(0x2fd)]((_0x3c4a59-_0x322956)/_0x295104),_0x1a3e34=Math[_0x294eae(0x1d7)](_0x4af763+0x1,_0x549f6f),_0x2728f7=new Array(_0x333f7a)['fill']('\x20');for(let _0x3c65dd=_0x4af763;_0x3c65dd<Math[_0x294eae(0x2ea)](_0x1a3e34,_0x333f7a);_0x3c65dd++){_0x2728f7[_0x3c65dd]='─';}const _0x307f62=_0x2728f7[_0x294eae(0x1b7)](_0x1bd153=>_0x1bd153==='\x20'?'\x20':_0x4c9af1(_0x1bd153))[_0x294eae(0x22f)]('');_0x3362b1[_0x294eae(0x1c3)](_0x318b61+'\x20'+_0x24d9b9+'│'+_0x307f62+'│');}return _0x3362b1[_0x294eae(0x22f)]('\x0a');}async['navigateSessionsInteractive'](_0x2c3a2f,_0x50b180,_0x52995a){const _0x27841f=a42_0x368355,{options:_0x1bc077,tdx:_0x240cd3}=_0x50b180,_0x17f6b6=_0x1bc077['site'],{timelineRows:_0x324d50,timeAxisHeader:_0x3fc5f2}=this[_0x27841f(0x320)](_0x2c3a2f,_0x17f6b6),_0xaae62=_0x324d50[_0x27841f(0x2fb)](_0x40df53=>_0x40df53[_0x27841f(0x1c1)]);if(_0xaae62['length']===0x0){const _0x4b0f2e=this[_0x27841f(0x2f0)](_0x2c3a2f,_0x17f6b6);console[_0x27841f(0x2b5)](_0x4b0f2e);!_0x52995a&&(console[_0x27841f(0x31b)](''),console[_0x27841f(0x31b)](a42_0xddcea5[_0x27841f(0x28d)](_0x27841f(0x1d9))),console['error'](a42_0xddcea5[_0x27841f(0x28d)](_0x27841f(0x20e))+'or'+a42_0xddcea5[_0x27841f(0x28d)](_0x27841f(0x1ff))));return;}_0x3fc5f2&&console['log'](_0x3fc5f2);const _0x54016c=_0x324d50[_0x27841f(0x2fb)](_0x373f25=>_0x373f25[_0x27841f(0x1c1)])[_0x27841f(0x1b7)](_0x2ee39d=>({'title':_0x2ee39d[_0x27841f(0x326)],'value':_0x2ee39d['attemptId']})),_0x1ec635=process[_0x27841f(0x1ac)][_0x27841f(0x1b0)]||0x3c,_0x19b87c=Math[_0x27841f(0x1d7)](0x28,Math['floor'](_0x1ec635*0x2/0x3)),_0x469f14=await a42_0x25b42a({'type':'autocomplete','name':'attemptId','message':_0x27841f(0x217),'choices':_0x54016c,'initial':-0x1,'limit':_0x19b87c,'clearFirst':!![],'fallback':{'title':_0x27841f(0x31d),'value':null},'suggest':(_0x52ae41,_0x345d61)=>{if(!_0x52ae41)return Promise['resolve'](_0x345d61);const _0x3b68c0=_0x345d61['filter'](_0x2567ac=>{const _0x4c1a47=a42_0x42ba,_0xd7a59=_0x2567ac;return _0xd7a59[_0x4c1a47(0x27e)]['toLowerCase']()['includes'](_0x52ae41[_0x4c1a47(0x319)]());});return Promise['resolve'](_0x3b68c0);}}),_0x434b23=()=>{const _0x1acbec=_0x27841f;process[_0x1acbec(0x1ac)][_0x1acbec(0x24b)](_0x1acbec(0x222)),process[_0x1acbec(0x1ac)][_0x1acbec(0x24b)](_0x1acbec(0x222)),process[_0x1acbec(0x1ac)][_0x1acbec(0x24b)](_0x1acbec(0x222));},_0x46414d=_0x469f14&&_0x469f14[_0x27841f(0x1c1)]&&_0x469f14[_0x27841f(0x1c1)]!==null&&_0x469f14[_0x27841f(0x1c1)]['trim']()!=='';if(!_0x46414d){_0x434b23(),console[_0x27841f(0x2b5)](a42_0xddcea5[_0x27841f(0x28d)](_0x27841f(0x2f6)));return;}_0x434b23();const _0x39fe2f=_0x2c3a2f[_0x27841f(0x336)](_0x8e53a5=>_0x8e53a5[_0x27841f(0x2a9)]?.['id']===_0x469f14['attemptId']);if(_0x39fe2f){const _0x1c7eb8=_0x39fe2f[_0x27841f(0x1b4)]?.['name']||'?',_0x1b9132=_0x39fe2f[_0x27841f(0x1e3)]?.[_0x27841f(0x2c7)]||'?';console['log'](_0x27841f(0x327)+a42_0xddcea5['dim'](_0x1c7eb8)+_0x27841f(0x20c)+a42_0xddcea5['dim'](_0x1b9132));}const _0x177440=new WorkflowTimelineCommand();await _0x177440[_0x27841f(0x1c7)]({'args':[],'options':{..._0x1bc077,'attemptId':_0x469f14[_0x27841f(0x1c1)]},'tdx':_0x240cd3});}[a42_0x368355(0x320)](_0x3c7d52,_0x30c8b0){const _0x1ff895=a42_0x368355,_0x1ccdea=new Map();for(const _0x493292 of _0x3c7d52){_0x493292['id']&&_0x493292[_0x1ff895(0x2a9)]?.['id']&&_0x1ccdea[_0x1ff895(0x2bd)](_0x493292['id'],_0x493292[_0x1ff895(0x2a9)]['id']);}const _0x2876f1=[];let _0x4d2409='';const _0x322616=this[_0x1ff895(0x2f0)](_0x3c7d52,_0x30c8b0),_0x2438f5=_0x322616[_0x1ff895(0x1f9)]('\x0a');for(const _0x306641 of _0x2438f5){if(_0x306641['startsWith'](_0x1ff895(0x208))||_0x306641[_0x1ff895(0x215)](/^\s+\d{4}-\d{2}-\d{2}/))_0x4d2409=_0x306641;else{if(_0x306641[_0x1ff895(0x215)](/^[✅❌🔄🛑⏳]/)){const _0x264cf8=_0x306641[_0x1ff895(0x215)](/#(\d+)/),_0x2fb557=_0x264cf8?_0x264cf8[0x1]:null,_0x5733e=_0x2fb557?_0x1ccdea['get'](_0x2fb557)||null:null,_0x1796b5=_0x3c7d52['find'](_0x1932d4=>_0x1932d4['id']===_0x2fb557),_0x3848cd=_0x1796b5?.[_0x1ff895(0x1b4)]?.['name']||'';_0x2876f1[_0x1ff895(0x1c3)]({'displayLine':_0x306641,'attemptId':_0x5733e,'projectName':_0x3848cd});}}}return{'timelineRows':_0x2876f1,'timeAxisHeader':_0x4d2409};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]='workflow:attempts';['description']=a42_0x368355(0x266);async[a42_0x368355(0x1c7)](_0x252373){const _0x33d15a=a42_0x368355,{options:_0x4a1007,args:_0x2c7612,tdx:_0x45f65b}=_0x252373,_0x59b2a0=this[_0x33d15a(0x2da)](_0x2c7612,_0x4a1007);if(!_0x59b2a0)return 0x1;const {projectName:_0x4d4814,workflowName:_0x38cca5}=_0x59b2a0,_0x2bfe65=_0x4a1007[_0x33d15a(0x2f9)];if(_0x4a1007[_0x33d15a(0x2d5)]){if(_0x4d4814&&_0x38cca5)console[_0x33d15a(0x31b)](_0x33d15a(0x25c)+_0x4d4814+'.'+_0x38cca5);else _0x4d4814&&console[_0x33d15a(0x31b)]('Filter:\x20project='+_0x4d4814);_0x2bfe65&&console[_0x33d15a(0x31b)](_0x33d15a(0x311));}const _0x1bcd08=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x45f65b[_0x33d15a(0x1e3)][_0x33d15a(0x231)]({'projectName':_0x4d4814,'workflowName':_0x38cca5,'includeRetried':_0x2bfe65,'limit':_0x4a1007[_0x33d15a(0x292)]}),{'verbose':_0x4a1007[_0x33d15a(0x2d5)]}),_0x294577=_0x1bcd08[_0x33d15a(0x298)],_0x39defc=_0x4a1007[_0x33d15a(0x292)]||0x64,_0x2d682a=_0x294577[_0x33d15a(0x1c0)]>=_0x39defc?a42_0xddcea5[_0x33d15a(0x28d)](_0x33d15a(0x1d8)):'';console[_0x33d15a(0x31b)]('✔\x20Found\x20'+_0x294577['length']+_0x33d15a(0x1ce)+(_0x294577[_0x33d15a(0x1c0)]!==0x1?'s':'')+_0x2d682a);if(_0x4a1007[_0x33d15a(0x2ac)]==='json'||_0x4a1007['format']===_0x33d15a(0x2c0)||_0x4a1007[_0x33d15a(0x2ac)]==='table')await handleSDKOutput(_0x294577,_0x4a1007);else{if(_0x294577[_0x33d15a(0x1c0)]===0x0){if(_0x4d4814&&_0x38cca5)console[_0x33d15a(0x2b5)](_0x33d15a(0x30b)+_0x4d4814+'.'+_0x38cca5);else _0x4d4814?console[_0x33d15a(0x2b5)](_0x33d15a(0x286)+_0x4d4814):console[_0x33d15a(0x2b5)](_0x33d15a(0x230));}else{const _0x532388=_0x4a1007['site'],_0x34861b=_0x294577['map'](_0x4f3846=>{const _0x1d9927=_0x33d15a,_0x45fb0a=a42_0xddcea5['dim']('#'+_0x4f3846['id']),_0x2a27a0=_0x4f3846[_0x1d9927(0x1b4)]?.['id'],_0x27af2e=_0x4f3846['session_id']||_0x4f3846['sessionId'],_0x544353=_0x2a27a0&&_0x27af2e?hyperlink(_0x45fb0a,getWorkflowAttemptUrl(_0x532388,_0x2a27a0,_0x27af2e,_0x4f3846['id'])):_0x45fb0a,{icon:_0x19cff7,text:_0x5794cf}=getAttemptStatusDisplay(_0x4f3846),_0x3eb92d=(_0x4f3846['project']?.[_0x1d9927(0x2c7)]||'?')+'.'+(_0x4f3846['workflow']?.[_0x1d9927(0x2c7)]||'?'),_0x2fe16b=_0x4f3846[_0x1d9927(0x269)]?a42_0xddcea5[_0x1d9927(0x28d)](_0x4f3846[_0x1d9927(0x269)]):'';return(_0x544353+'\x20'+_0x19cff7+(_0x5794cf?'\x20'+_0x5794cf:'')+'\x20'+_0x3eb92d+'\x20'+_0x2fe16b)[_0x1d9927(0x2d3)]();});await writeOutput(_0x34861b[_0x33d15a(0x22f)]('\x0a'),_0x4a1007['output'],_0x33d15a(0x1c5));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x227);[a42_0x368355(0x2eb)]=a42_0x368355(0x213);async[a42_0x368355(0x1c7)](_0x41a249){const _0x31087f=a42_0x368355,{options:_0x3f73ff,args:_0x181919,tdx:_0x4e566f}=_0x41a249,_0x2a6b84=_0x181919[0x0];if(!_0x2a6b84)return console['error'](_0x31087f(0x195)),0x1;_0x3f73ff[_0x31087f(0x2d5)]&&console[_0x31087f(0x31b)](_0x31087f(0x324)+_0x2a6b84);const _0x572b08=await withSpinner(_0x31087f(0x1aa),()=>_0x4e566f['workflow']['attempt'](_0x2a6b84),{'verbose':_0x3f73ff[_0x31087f(0x2d5)]}),_0x1c2548=_0x572b08['data'];let _0x2da201;!_0x1c2548['done']?_0x2da201=_0x1c2548[_0x31087f(0x27d)]?_0x31087f(0x2d7):_0x31087f(0x21c):_0x2da201=_0x1c2548['success']?'success':_0x31087f(0x31b);let _0x391bf3;if(_0x1c2548['createdAt']&&_0x1c2548[_0x31087f(0x19e)]){const _0x301ccc=new Date(_0x1c2548[_0x31087f(0x2b7)])[_0x31087f(0x1be)](),_0x374da3=new Date(_0x1c2548[_0x31087f(0x19e)])['getTime']();_0x391bf3=Math[_0x31087f(0x229)]((_0x374da3-_0x301ccc)/0x3e8);}const _0x1a971f={'attempt_id':_0x1c2548['id'],'status':_0x2da201,..._0x1c2548[_0x31087f(0x255)]!==undefined&&{'index':_0x1c2548[_0x31087f(0x255)]},..._0x1c2548[_0x31087f(0x1b4)]&&{'project':_0x1c2548['project'][_0x31087f(0x2c7)]},..._0x1c2548['workflow']&&{'workflow':_0x1c2548[_0x31087f(0x1e3)]['name']},..._0x1c2548[_0x31087f(0x2bf)]&&{'session_id':_0x1c2548[_0x31087f(0x2bf)]},..._0x1c2548['sessionTime']&&{'session_time':_0x1c2548[_0x31087f(0x269)]},..._0x1c2548[_0x31087f(0x1db)]&&{'retry_attempt':_0x1c2548[_0x31087f(0x1db)]},..._0x391bf3!==undefined&&{'duration_sec':_0x391bf3},..._0x1c2548[_0x31087f(0x2b7)]&&{'created_at':_0x1c2548['createdAt']},..._0x1c2548[_0x31087f(0x19e)]&&{'finished_at':_0x1c2548[_0x31087f(0x19e)]},...Object[_0x31087f(0x216)](_0x1c2548[_0x31087f(0x32f)])[_0x31087f(0x1c0)]>0x0&&{'params':_0x1c2548[_0x31087f(0x32f)]}};return await handleSingleObjectOutput(_0x1a971f,_0x3f73ff),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a42_0x368355(0x27f);[a42_0x368355(0x2eb)]=a42_0x368355(0x30e);async[a42_0x368355(0x1c7)](_0x12543b){const _0x3852fa=a42_0x368355,{options:_0x51f6ad,args:_0x39f40e,tdx:_0x39816f}=_0x12543b,_0x52b663=_0x39f40e[0x0];if(!_0x52b663)return console[_0x3852fa(0x31b)](_0x3852fa(0x195)),0x1;const _0x3c9b49=_0x51f6ad[_0x3852fa(0x1b8)];_0x51f6ad[_0x3852fa(0x2d5)]&&(console['error'](_0x3852fa(0x324)+_0x52b663),_0x3c9b49&&console[_0x3852fa(0x31b)](_0x3852fa(0x30a)));const _0x28f38f=await withSpinner(_0x3852fa(0x2c9),()=>_0x39816f[_0x3852fa(0x1e3)]['tasks'](_0x52b663,_0x3c9b49||![]),{'verbose':_0x51f6ad[_0x3852fa(0x2d5)]}),_0x95e5e0=_0x28f38f['data'];return console['error'](_0x3852fa(0x1dc)+_0x95e5e0[_0x3852fa(0x1c0)]+_0x3852fa(0x277)+(_0x95e5e0['length']!==0x1?'s':'')),await handleSDKOutput(_0x95e5e0,_0x51f6ad),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x22d);[a42_0x368355(0x2eb)]=a42_0x368355(0x25e);async[a42_0x368355(0x1c7)](_0x5024bf){const _0x146e3c=a42_0x368355,{options:_0x479b2b,args:_0x30e12d,tdx:_0x5138ca}=_0x5024bf,_0x23a136=_0x30e12d[0x0];let _0x244a2f=_0x30e12d[0x1];if(!_0x23a136)return console[_0x146e3c(0x31b)](_0x146e3c(0x195)),0x1;_0x479b2b[_0x146e3c(0x2d5)]&&(console[_0x146e3c(0x31b)](_0x146e3c(0x324)+_0x23a136),_0x244a2f&&console[_0x146e3c(0x31b)]('Task\x20name:\x20'+_0x244a2f));const _0x2702ae=await withSpinner(_0x146e3c(0x196),()=>_0x5138ca[_0x146e3c(0x1e3)][_0x146e3c(0x1e2)](_0x23a136,_0x244a2f),{'verbose':_0x479b2b[_0x146e3c(0x2d5)]}),_0x434eea=_0x2702ae[_0x146e3c(0x298)];if(_0x434eea[_0x146e3c(0x1c0)]===0x0)return console['error'](_0x146e3c(0x2e8)),0x0;if(!_0x244a2f&&(_0x479b2b[_0x146e3c(0x252)]||_0x479b2b[_0x146e3c(0x2ac)]))return await handleSDKOutput(_0x434eea,_0x479b2b),0x0;if(!_0x244a2f){const _0x59a330=_0x434eea[_0x146e3c(0x1b7)](_0xbd2dc0=>({'title':_0xbd2dc0[_0x146e3c(0x1ba)]+'\x20('+formatBytes(_0xbd2dc0['fileSize'])+')','value':_0xbd2dc0[_0x146e3c(0x1ba)]})),_0x5d5fe4=await a42_0x25b42a({'type':_0x146e3c(0x2e4),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x59a330});if(!_0x5d5fe4['task'])return console[_0x146e3c(0x31b)]('Cancelled'),0x0;_0x244a2f=_0x5d5fe4[_0x146e3c(0x283)];}const _0x598912=await withSpinner(_0x146e3c(0x247),()=>_0x5138ca[_0x146e3c(0x1e3)][_0x146e3c(0x1df)](_0x23a136,_0x244a2f),{'verbose':_0x479b2b[_0x146e3c(0x2d5)]}),_0x1b0ac6=_0x598912[_0x146e3c(0x298)];return _0x1b0ac6?console[_0x146e3c(0x2b5)](_0x1b0ac6):console['error'](_0x146e3c(0x250)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';[a42_0x368355(0x2eb)]='Kill\x20a\x20running\x20attempt';async[a42_0x368355(0x1c7)](_0x1ca6fa){const _0x465497=a42_0x368355,{options:_0x247508,args:_0x58d4f9,tdx:_0x3722db}=_0x1ca6fa,_0x51310d=_0x58d4f9[0x0];if(!_0x51310d)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x373949=_0x247508[_0x465497(0x1ec)];_0x247508[_0x465497(0x2d5)]&&(console[_0x465497(0x31b)](_0x465497(0x324)+_0x51310d),_0x373949&&console[_0x465497(0x31b)](_0x465497(0x23a)+_0x373949));if(!_0x247508[_0x465497(0x2db)]){const _0x24c8d8=await confirmKey(_0x465497(0x2af)+_0x51310d+'?');if(!_0x24c8d8)return console['error'](_0x465497(0x2f6)),0x0;}const _0x5c1fbb=await withSpinner(_0x465497(0x1a7),()=>_0x3722db[_0x465497(0x1e3)][_0x465497(0x20d)](_0x51310d,_0x373949),{'verbose':_0x247508[_0x465497(0x2d5)]}),_0x53ca7f=_0x5c1fbb[_0x465497(0x298)];return console[_0x465497(0x31b)]('✔\x20'+_0x53ca7f),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x1f7);[a42_0x368355(0x2eb)]=a42_0x368355(0x288);async[a42_0x368355(0x1c7)](_0x2e992b){const _0x579aa8=a42_0x368355,{options:_0xf12cca,args:_0xb318b6,tdx:_0x561a5f}=_0x2e992b,_0x2ba7fa=_0xb318b6[0x0];if(!_0x2ba7fa)return console[_0x579aa8(0x31b)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x579aa8(0x31b)](_0x579aa8(0x262)),0x1;let _0x300bbf=![],_0x4a5b9c=_0x2ba7fa;if(_0x2ba7fa[_0x579aa8(0x331)]('session:'))_0x300bbf=!![],_0x4a5b9c=_0x2ba7fa[_0x579aa8(0x303)](0x8);else{if(_0x2ba7fa[_0x579aa8(0x331)](_0x579aa8(0x232)))_0x300bbf=![],_0x4a5b9c=_0x2ba7fa['substring'](0x8);else return console[_0x579aa8(0x31b)](_0x579aa8(0x1cf)),console[_0x579aa8(0x31b)](_0x579aa8(0x262)),0x1;}const _0x4e2a94=_0xf12cca['fromTask'],_0x13ba79=_0xf12cca[_0x579aa8(0x2e0)],_0x4cea88=_0xf12cca['params'],_0x25a87d=_0xf12cca[_0x579aa8(0x2cf)];_0xf12cca['verbose']&&(console[_0x579aa8(0x31b)](_0x579aa8(0x19d)+(_0x300bbf?_0x579aa8(0x23b):_0x579aa8(0x1f1))+'\x20'+_0x4a5b9c),_0x4e2a94&&console[_0x579aa8(0x31b)](_0x579aa8(0x280)+_0x4e2a94),_0x13ba79&&console[_0x579aa8(0x31b)]('Resume\x20from:\x20'+_0x13ba79),_0x4cea88&&console[_0x579aa8(0x31b)]('Params:\x20'+_0x4cea88),_0x25a87d&&console['error']('Force:\x20yes'));let _0x5d7b7e;if(_0x4cea88)try{if(_0x4cea88[_0x579aa8(0x331)]('@')){const _0x487465=await import(_0x579aa8(0x21d)),_0x35ae41=_0x4cea88['substring'](0x1),_0x4ffe29=await _0x487465[_0x579aa8(0x2f1)](_0x35ae41,_0x579aa8(0x289));_0x5d7b7e=JSON['parse'](_0x4ffe29);}else _0x5d7b7e=JSON[_0x579aa8(0x205)](_0x4cea88);}catch{return console['error'](_0x579aa8(0x220)),0x1;}if(!_0xf12cca['yes']){const _0x2b5bac=await confirmKey(_0x579aa8(0x2c5)+(_0x300bbf?'session':_0x579aa8(0x1f1))+'\x20'+_0x4a5b9c+'?');if(!_0x2b5bac)return console[_0x579aa8(0x31b)](_0x579aa8(0x2f6)),0x0;}let _0x385582;_0x300bbf?_0x385582=await withSpinner(_0x579aa8(0x1a1),()=>_0x561a5f['workflow'][_0x579aa8(0x1cb)](_0x4a5b9c,{'fromTask':_0x4e2a94,'retryParams':_0x5d7b7e}),{'verbose':_0xf12cca[_0x579aa8(0x2d5)]}):_0x385582=await withSpinner(_0x579aa8(0x1d6),()=>_0x561a5f[_0x579aa8(0x1e3)][_0x579aa8(0x2d2)](_0x4a5b9c,{'resumeFrom':_0x13ba79,'retryParams':_0x5d7b7e,'force':_0x25a87d}),{'verbose':_0xf12cca[_0x579aa8(0x2d5)]});const _0x2246cd=_0x385582[_0x579aa8(0x298)];return console[_0x579aa8(0x31b)](_0x579aa8(0x23c)),console[_0x579aa8(0x31b)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x2246cd[_0x579aa8(0x1c1)]),console[_0x579aa8(0x31b)](_0x579aa8(0x278)+_0x2246cd[_0x579aa8(0x2bf)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a42_0x368355(0x28b);[a42_0x368355(0x2eb)]=a42_0x368355(0x1e6);async[a42_0x368355(0x1c7)](_0xbb89b1){const _0x543c57=a42_0x368355,{options:_0x50816b,args:_0x43896d,tdx:_0x3b6eb6}=_0xbb89b1;let _0x49e799=_0x43896d[0x0];if(!_0x49e799){const _0x5ab913=this[_0x543c57(0x2c4)]([],_0x50816b),_0x529c4b=await withSpinner(_0x543c57(0x2e5),()=>_0x3b6eb6[_0x543c57(0x1e3)][_0x543c57(0x221)](_0x5ab913,{'limit':_0x50816b[_0x543c57(0x292)]}),{'verbose':_0x50816b['verbose']}),_0x208f9f=_0x529c4b[_0x543c57(0x298)];if(_0x208f9f[_0x543c57(0x1c0)]===0x0)return console[_0x543c57(0x31b)](_0x543c57(0x1ea)),!_0x5ab913&&console[_0x543c57(0x31b)](a42_0xddcea5[_0x543c57(0x28d)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x3be04c=_0x208f9f['map'](_0x3556f9=>({'title':_0x3556f9[_0x543c57(0x1b4)]?.['name']+'.'+_0x3556f9[_0x543c57(0x2c7)],'value':_0x3556f9[_0x543c57(0x1b4)]?.[_0x543c57(0x2c7)]+'.'+_0x3556f9[_0x543c57(0x2c7)],'description':_0x3556f9['revision']?'revision:\x20'+_0x3556f9[_0x543c57(0x233)]:undefined})),_0x35cde9=await a42_0x25b42a({'type':_0x543c57(0x2e4),'name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x3be04c});if(!_0x35cde9[_0x543c57(0x1e3)])return 0x1;_0x49e799=_0x35cde9[_0x543c57(0x1e3)];}if(!_0x49e799[_0x543c57(0x2f7)]('.')){const _0x42d1b3=this[_0x543c57(0x2c4)]([],_0x50816b);if(_0x42d1b3)_0x49e799=_0x42d1b3+'.'+_0x49e799;else return console[_0x543c57(0x31b)](a42_0xddcea5['red']('Error:'),_0x543c57(0x2dd)),console[_0x543c57(0x31b)](a42_0xddcea5[_0x543c57(0x28d)](_0x543c57(0x268))),0x1;}const _0x4e9110=_0x50816b['param'],_0x5c581b=_0x50816b[_0x543c57(0x269)],_0x1f7e9a={};if(_0x4e9110&&Array['isArray'](_0x4e9110))for(const _0x1ffa3b of _0x4e9110){const _0x41befe=_0x1ffa3b['indexOf']('=');if(_0x41befe===-0x1)return console[_0x543c57(0x31b)](_0x543c57(0x259)+_0x1ffa3b),console[_0x543c57(0x31b)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x248052=_0x1ffa3b[_0x543c57(0x303)](0x0,_0x41befe),_0x2db347=_0x1ffa3b[_0x543c57(0x303)](_0x41befe+0x1);try{_0x1f7e9a[_0x248052]=JSON[_0x543c57(0x205)](_0x2db347);}catch{_0x1f7e9a[_0x248052]=_0x2db347;}}_0x50816b[_0x543c57(0x2d5)]&&(console[_0x543c57(0x31b)](_0x543c57(0x2ee)+_0x49e799),Object['keys'](_0x1f7e9a)[_0x543c57(0x1c0)]>0x0&&console[_0x543c57(0x31b)](_0x543c57(0x2b6)+JSON['stringify'](_0x1f7e9a)),_0x5c581b&&console[_0x543c57(0x31b)](_0x543c57(0x1bd)+_0x5c581b));const _0x4ca7a3=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3b6eb6[_0x543c57(0x1e3)][_0x543c57(0x338)](_0x49e799,_0x1f7e9a,{'sessionTime':_0x5c581b}),{'verbose':_0x50816b['verbose']}),_0x485249=_0x4ca7a3[_0x543c57(0x298)];console[_0x543c57(0x31b)](_0x543c57(0x190)),console[_0x543c57(0x31b)]('\x20\x20Attempt\x20ID:\x20'+_0x485249['id']),console[_0x543c57(0x31b)]('\x20\x20Session\x20ID:\x20'+_0x485249['sessionId']),console[_0x543c57(0x31b)](_0x543c57(0x334)+_0x485249[_0x543c57(0x1b4)]?.[_0x543c57(0x2c7)]),console[_0x543c57(0x31b)](_0x543c57(0x28a)+_0x485249[_0x543c57(0x1e3)]?.['name']);if(_0x485249[_0x543c57(0x1b4)]?.['id']&&_0x485249['sessionId']&&_0x485249['id']){const _0x1f0763=_0x50816b[_0x543c57(0x2fe)],_0x29603a=getConsoleUrl(_0x1f0763,_0x543c57(0x21a)+_0x485249[_0x543c57(0x1b4)]['id']+_0x543c57(0x2d9)+_0x485249['sessionId']+_0x543c57(0x199)+_0x485249['id']);console[_0x543c57(0x31b)](_0x543c57(0x25d)+a42_0xddcea5[_0x543c57(0x332)](_0x29603a));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x32d);[a42_0x368355(0x2eb)]=a42_0x368355(0x1a2);async[a42_0x368355(0x1c7)](_0x3beefd){const _0x25b050=a42_0x368355,{options:_0x136c19,args:_0xe44538,tdx:_0x4ce2f8}=_0x3beefd,_0x3ab538=_0xe44538[0x0],_0x46e8b4=_0xe44538[0x1]||'.';if(!_0x3ab538)return console['error'](_0x25b050(0x211)),console[_0x25b050(0x31b)](_0x25b050(0x258)),0x1;const _0x37f968=_0x136c19[_0x25b050(0x233)];_0x136c19[_0x25b050(0x2d5)]&&(console[_0x25b050(0x31b)](_0x25b050(0x327)+_0x3ab538),console[_0x25b050(0x31b)](_0x25b050(0x224)+_0x46e8b4),_0x37f968&&console[_0x25b050(0x31b)](_0x25b050(0x329)+_0x37f968));const _0x357b17=await withSpinner('Downloading\x20project\x20'+_0x3ab538+_0x25b050(0x2e6),()=>_0x4ce2f8[_0x25b050(0x1e3)][_0x25b050(0x2a0)](_0x3ab538,_0x46e8b4,{'revision':_0x37f968}),{'verbose':_0x136c19[_0x25b050(0x2d5)]}),_0x3347a5=_0x357b17[_0x25b050(0x298)];return console[_0x25b050(0x31b)](_0x25b050(0x24e)+_0x3347a5[_0x25b050(0x2f3)]),console[_0x25b050(0x31b)]('\x20\x20Revision:\x20'+_0x3347a5['revision']),console[_0x25b050(0x31b)](_0x25b050(0x31a)+_0x3347a5[_0x25b050(0x1f5)]),console[_0x25b050(0x31b)](_0x25b050(0x19f)+_0x46e8b4+'/'+_0x3347a5[_0x25b050(0x2f3)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x26c);['description']=a42_0x368355(0x1b9);async[a42_0x368355(0x1c7)](_0x112301){const _0x56387a=a42_0x368355,{options:_0x533b07,args:_0x363063,tdx:_0x1d4898}=_0x112301;let _0x43083c='.',_0x5dc8c6=_0x533b07[_0x56387a(0x2c7)];if(_0x363063[0x0]){const {promises:_0x129e5b}=await import('fs');try{const _0x12df88=await _0x129e5b['stat'](_0x363063[0x0]);if(_0x12df88['isDirectory']())_0x43083c=_0x363063[0x0];else return console[_0x56387a(0x31b)](_0x56387a(0x318)+_0x363063[0x0]+_0x56387a(0x2cb)),0x1;}catch{_0x5dc8c6=_0x363063[0x0],_0x43083c='.';}}const _0x3256fc=_0x533b07[_0x56387a(0x233)],_0x523acd=_0x533b07[_0x56387a(0x19b)];_0x533b07[_0x56387a(0x2d5)]&&(console[_0x56387a(0x31b)](_0x56387a(0x302)+_0x43083c),_0x5dc8c6&&console[_0x56387a(0x31b)](_0x56387a(0x239)+_0x5dc8c6),_0x3256fc&&console[_0x56387a(0x31b)](_0x56387a(0x329)+_0x3256fc),_0x523acd&&console[_0x56387a(0x31b)](_0x56387a(0x1fa)));const _0x2fec4c=await withSpinner(_0x56387a(0x337),()=>_0x1d4898[_0x56387a(0x1e3)][_0x56387a(0x1c3)](_0x43083c,{'projectName':_0x5dc8c6,'revision':_0x3256fc,'skipValidation':_0x523acd}),{'verbose':_0x533b07[_0x56387a(0x2d5)]}),_0x569221=_0x2fec4c[_0x56387a(0x298)];return console[_0x56387a(0x31b)](_0x56387a(0x31e)+_0x569221[_0x56387a(0x2f3)]),console[_0x56387a(0x31b)](_0x56387a(0x24d)+_0x569221['projectId']),console[_0x56387a(0x31b)]('\x20\x20Revision:\x20'+_0x569221['revision']),await this[_0x56387a(0x307)](_0x1d4898,_0x569221[_0x56387a(0x2f3)],_0x533b07[_0x56387a(0x2fe)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a42_0x368355(0x2cd);[a42_0x368355(0x2eb)]=a42_0x368355(0x2d0);async[a42_0x368355(0x1c7)](_0x5c638e){const _0x4ce107=a42_0x368355,{options:_0x3c073a,args:_0x1f396c,tdx:_0x53866b}=_0x5c638e,_0x31d70d=_0x1f396c[0x0],_0x3ae29c=_0x1f396c[0x1];if(!_0x31d70d)return console['error'](a42_0xddcea5[_0x4ce107(0x1e5)]('Error:'),_0x4ce107(0x306)),console[_0x4ce107(0x31b)](a42_0xddcea5[_0x4ce107(0x28d)](_0x4ce107(0x287))),0x1;const _0x45969c=_0x3c073a[_0x4ce107(0x233)];_0x3c073a['verbose']&&(console['error'](_0x4ce107(0x327)+_0x31d70d),_0x3ae29c&&console[_0x4ce107(0x31b)](_0x4ce107(0x242)+_0x3ae29c),_0x45969c&&console[_0x4ce107(0x31b)](_0x4ce107(0x329)+_0x45969c),_0x3c073a[_0x4ce107(0x207)]&&console['error'](_0x4ce107(0x275)));const _0x2d5992=await withSpinner(_0x4ce107(0x1ad)+_0x31d70d+_0x4ce107(0x2e6),()=>_0x53866b[_0x4ce107(0x1e3)][_0x4ce107(0x2bb)](_0x31d70d,{'targetDir':_0x3ae29c,'revision':_0x45969c}),{'verbose':_0x3c073a[_0x4ce107(0x2d5)]}),_0x3d0458=_0x2d5992[_0x4ce107(0x298)];_0x3d0458[_0x4ce107(0x285)]?console[_0x4ce107(0x31b)](_0x4ce107(0x314)+_0x3d0458[_0x4ce107(0x2f3)]):console['error']('✔\x20Project:\x20'+_0x3d0458[_0x4ce107(0x2f3)]);console['error'](_0x4ce107(0x1dd)+_0x3d0458[_0x4ce107(0x233)]),console[_0x4ce107(0x31b)](_0x4ce107(0x27c)+(a42_0x354f39[_0x4ce107(0x313)](process[_0x4ce107(0x2ef)](),_0x3d0458['targetDir'])||'.')),console[_0x4ce107(0x31b)](_0x4ce107(0x257)+a42_0xddcea5[_0x4ce107(0x282)]('+'+_0x3d0458[_0x4ce107(0x2b9)][_0x4ce107(0x2a7)]+_0x4ce107(0x2aa))+',\x20'+(a42_0xddcea5['yellow']('~'+_0x3d0458[_0x4ce107(0x2b9)]['modified']+_0x4ce107(0x1b5))+',\x20')+(a42_0xddcea5[_0x4ce107(0x1e5)]('-'+_0x3d0458[_0x4ce107(0x2b9)][_0x4ce107(0x2b1)]+_0x4ce107(0x26f))+',\x20')+(''+a42_0xddcea5[_0x4ce107(0x28d)](_0x3d0458[_0x4ce107(0x2b9)][_0x4ce107(0x2df)]+_0x4ce107(0x1fe))));for(const _0x4fec55 of _0x3d0458['changes']){_0x4fec55['type']===_0x4ce107(0x23e)&&_0x4fec55['diff']&&(console[_0x4ce107(0x31b)]('\x0a'+a42_0xddcea5[_0x4ce107(0x332)](_0x4ce107(0x1e8)+_0x4fec55[_0x4ce107(0x1d5)])),console[_0x4ce107(0x31b)](_0x4fec55[_0x4ce107(0x330)]));}if(!_0x3d0458['hasChanges'])return saveSessionContext({'workflow_project':_0x3d0458[_0x4ce107(0x2f3)]},_0x3c073a[_0x4ce107(0x23b)]),console[_0x4ce107(0x31b)](a42_0xddcea5[_0x4ce107(0x282)](_0x4ce107(0x304))),console[_0x4ce107(0x31b)](a42_0xddcea5[_0x4ce107(0x28d)](_0x4ce107(0x260)+_0x3d0458[_0x4ce107(0x2f3)])),0x0;if(_0x3c073a[_0x4ce107(0x207)])return console[_0x4ce107(0x31b)](a42_0xddcea5[_0x4ce107(0x2a1)](_0x4ce107(0x2e2))),0x0;if(!_0x3c073a[_0x4ce107(0x2db)]){const _0x31143b=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x31143b)return console[_0x4ce107(0x31b)](_0x4ce107(0x2f6)),0x0;}await withSpinner(_0x4ce107(0x321),()=>_0x53866b['workflow'][_0x4ce107(0x264)](_0x3d0458,{'revision':_0x45969c}),{'verbose':_0x3c073a['verbose']}),saveSessionContext({'workflow_project':_0x3d0458[_0x4ce107(0x2f3)]},_0x3c073a['session']),console[_0x4ce107(0x31b)](a42_0xddcea5[_0x4ce107(0x282)](_0x4ce107(0x1c6)));const _0x3306d8=a42_0x354f39[_0x4ce107(0x313)](process[_0x4ce107(0x2ef)](),_0x3d0458[_0x4ce107(0x1d4)])||'.';return console['error'](a42_0xddcea5[_0x4ce107(0x28d)](_0x4ce107(0x19f)+_0x3306d8)),console['error'](a42_0xddcea5[_0x4ce107(0x28d)](_0x4ce107(0x260)+_0x3d0458[_0x4ce107(0x2f3)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x261);[a42_0x368355(0x2eb)]=a42_0x368355(0x2e9);async[a42_0x368355(0x1c7)](_0x5ca87a){const _0x157885=a42_0x368355,{options:_0x28c439,args:_0x1f1655,tdx:_0x203a5a}=_0x5ca87a,_0x31a691=this[_0x157885(0x1b1)](_0x1f1655,_0x28c439),_0x30fdf6=_0x28c439['revision'],_0x36c20a=_0x28c439['skipValidation'];_0x28c439[_0x157885(0x2d5)]&&(_0x31a691&&console[_0x157885(0x31b)](_0x157885(0x339)+_0x31a691),_0x30fdf6&&console[_0x157885(0x31b)](_0x157885(0x329)+_0x30fdf6),_0x28c439['dryRun']&&console['error'](_0x157885(0x275)),_0x36c20a&&console[_0x157885(0x31b)](_0x157885(0x1fa)));let _0x33eda0;try{_0x33eda0=await withSpinner(_0x157885(0x1a8),()=>_0x203a5a[_0x157885(0x1e3)]['preparePushProject']({'sourceDir':_0x31a691,'revision':_0x30fdf6,'skipValidation':_0x36c20a}),{'verbose':_0x28c439[_0x157885(0x2d5)]});}catch(_0x367460){if(_0x367460 instanceof Error&&_0x367460[_0x157885(0x228)][_0x157885(0x2f7)](_0x157885(0x295)))return console[_0x157885(0x31b)](a42_0xddcea5[_0x157885(0x1e5)](_0x157885(0x2ba)),_0x157885(0x203)),_0x28c439[_0x157885(0x1e7)]?console[_0x157885(0x31b)](a42_0xddcea5[_0x157885(0x28d)](_0x157885(0x2b2)+_0x28c439[_0x157885(0x1e7)]+_0x157885(0x1fc)+_0x28c439[_0x157885(0x1e7)]+'\x27')):console[_0x157885(0x31b)](a42_0xddcea5[_0x157885(0x28d)](_0x157885(0x1e4))),0x1;throw _0x367460;}const _0x1034bb=_0x33eda0[_0x157885(0x298)];console['error']('✔\x20Project:\x20'+_0x1034bb['projectName']),console[_0x157885(0x31b)](_0x157885(0x1a9)+_0x1034bb[_0x157885(0x29c)]),console[_0x157885(0x31b)](_0x157885(0x1dd)+_0x1034bb[_0x157885(0x233)]),console[_0x157885(0x31b)](_0x157885(0x257)+a42_0xddcea5[_0x157885(0x282)]('+'+_0x1034bb[_0x157885(0x2b9)]['new']+_0x157885(0x2aa))+',\x20'+(a42_0xddcea5[_0x157885(0x2a1)]('~'+_0x1034bb[_0x157885(0x2b9)]['modified']+_0x157885(0x1b5))+',\x20')+(a42_0xddcea5[_0x157885(0x1e5)]('-'+_0x1034bb[_0x157885(0x2b9)]['deleted']+_0x157885(0x26f))+',\x20')+(''+a42_0xddcea5['dim'](_0x1034bb[_0x157885(0x2b9)]['unchanged']+_0x157885(0x1fe))));for(const _0x30ad36 of _0x1034bb[_0x157885(0x1d2)]){_0x30ad36[_0x157885(0x1ef)]==='modified'&&_0x30ad36['diff']&&(console[_0x157885(0x31b)]('\x0a'+a42_0xddcea5[_0x157885(0x332)](_0x157885(0x1e8)+_0x30ad36[_0x157885(0x1d5)])),console['error'](_0x30ad36['diff']));}if(!_0x1034bb[_0x157885(0x2d6)])return console['error'](a42_0xddcea5[_0x157885(0x282)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x157885(0x307)](_0x203a5a,_0x1034bb[_0x157885(0x2f3)],_0x28c439['site']),0x0;if(_0x28c439[_0x157885(0x207)])return console[_0x157885(0x31b)](a42_0xddcea5[_0x157885(0x2a1)](_0x157885(0x237))),0x0;if(!_0x28c439[_0x157885(0x2db)]){const _0xeab582=await confirmKey(_0x157885(0x248));if(!_0xeab582)return console[_0x157885(0x31b)]('Cancelled'),0x0;}const _0x17f37a=await withSpinner('Pushing\x20project...',()=>_0x203a5a[_0x157885(0x1e3)][_0x157885(0x197)](_0x1034bb),{'verbose':_0x28c439['verbose']}),_0x500cd6=_0x17f37a['data'];return console[_0x157885(0x31b)](a42_0xddcea5[_0x157885(0x282)](_0x157885(0x245))),console[_0x157885(0x31b)](_0x157885(0x24d)+_0x500cd6['projectId']),console[_0x157885(0x31b)]('\x20\x20Revision:\x20'+_0x500cd6[_0x157885(0x233)]),await this[_0x157885(0x307)](_0x203a5a,_0x500cd6['projectName'],_0x28c439[_0x157885(0x2fe)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x2fa);[a42_0x368355(0x2eb)]=a42_0x368355(0x2a6);async[a42_0x368355(0x1c7)](_0x5b0617){const _0x5ec0ac=a42_0x368355,{options:_0x32e780,args:_0x19741f,tdx:_0x4d297d}=_0x5b0617,_0xf395c=this[_0x5ec0ac(0x1b1)](_0x19741f,_0x32e780),_0x11b75d=_0x32e780[_0x5ec0ac(0x2c7)],_0x3a0c75=_0x32e780[_0x5ec0ac(0x233)],_0x357b7b=_0x32e780['skipValidation'];if(!_0xf395c)return console[_0x5ec0ac(0x31b)](a42_0xddcea5[_0x5ec0ac(0x1e5)](_0x5ec0ac(0x2ba)),_0x5ec0ac(0x1eb)),console['error'](a42_0xddcea5[_0x5ec0ac(0x28d)](_0x5ec0ac(0x1a3))),console['error'](a42_0xddcea5['dim'](_0x5ec0ac(0x1a4))),0x1;if(!_0x11b75d)return console[_0x5ec0ac(0x31b)](a42_0xddcea5[_0x5ec0ac(0x1e5)](_0x5ec0ac(0x2ba)),_0x5ec0ac(0x2ce)),console[_0x5ec0ac(0x31b)](a42_0xddcea5[_0x5ec0ac(0x28d)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x32e780[_0x5ec0ac(0x2d5)]&&(console['error'](_0x5ec0ac(0x339)+_0xf395c),console['error']('New\x20project\x20name:\x20'+_0x11b75d),_0x3a0c75&&console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x329)+_0x3a0c75),_0x32e780[_0x5ec0ac(0x207)]&&console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x275)),_0x357b7b&&console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x1fa)));const _0x36eb19=await withSpinner(_0x5ec0ac(0x226),()=>_0x4d297d[_0x5ec0ac(0x1e3)][_0x5ec0ac(0x2c6)](_0xf395c,_0x11b75d,{'revision':_0x3a0c75,'skipValidation':_0x357b7b}),{'verbose':_0x32e780['verbose']}),_0x540416=_0x36eb19[_0x5ec0ac(0x298)];console['error']('Source:\x20'+_0x540416[_0x5ec0ac(0x29c)]);_0x540416['sourceProjectName']&&console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x23d)+_0x540416[_0x5ec0ac(0x22a)]);console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x23f)+_0x540416[_0x5ec0ac(0x1d1)]),console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x329)+_0x540416['revision']),console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x2f2)+_0x540416[_0x5ec0ac(0x1ab)]);_0x540416['targetExists']&&(console[_0x5ec0ac(0x31b)](a42_0xddcea5['yellow'](_0x5ec0ac(0x20f)+_0x540416[_0x5ec0ac(0x1d1)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x540416['existingProjectId']+')')),console['error'](a42_0xddcea5[_0x5ec0ac(0x2a1)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x32e780['dryRun'])return console[_0x5ec0ac(0x31b)](a42_0xddcea5[_0x5ec0ac(0x2a1)](_0x5ec0ac(0x1e1))),0x0;if(!_0x32e780[_0x5ec0ac(0x2db)]){const _0x3f77fe=_0x540416[_0x5ec0ac(0x22a)]||a42_0x354f39[_0x5ec0ac(0x2a2)](_0xf395c),_0x4ee4b5=_0x540416[_0x5ec0ac(0x309)]?_0x5ec0ac(0x29d)+_0x11b75d+'\x22\x20with\x20new\x20revision?':_0x5ec0ac(0x1f3)+_0x3f77fe+_0x5ec0ac(0x241)+_0x11b75d+'\x22?',_0x1ed16c=await confirmKey(_0x4ee4b5);if(!_0x1ed16c)return console['error']('Cancelled'),0x0;}const _0x5cab03=await withSpinner(_0x540416[_0x5ec0ac(0x309)]?_0x5ec0ac(0x1da)+_0x11b75d+_0x5ec0ac(0x2e6):_0x5ec0ac(0x1f0)+_0x11b75d+_0x5ec0ac(0x2e6),()=>_0x4d297d['workflow'][_0x5ec0ac(0x2ab)](_0x540416),{'verbose':_0x32e780['verbose']}),_0x57d64e=_0x5cab03[_0x5ec0ac(0x298)];return console[_0x5ec0ac(0x31b)](a42_0xddcea5[_0x5ec0ac(0x282)](_0x540416['targetExists']?'✔\x20Project\x20updated':_0x5ec0ac(0x273))),console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x334)+_0x57d64e[_0x5ec0ac(0x1d1)]),console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x24d)+_0x57d64e[_0x5ec0ac(0x218)]),console[_0x5ec0ac(0x31b)](_0x5ec0ac(0x1dd)+_0x57d64e['revision']),await this[_0x5ec0ac(0x307)](_0x4d297d,_0x57d64e['newProjectName'],_0x32e780[_0x5ec0ac(0x2fe)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x368355(0x2c7)]='workflow:delete';[a42_0x368355(0x2eb)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x494e68){const _0x1d9ad6=a42_0x368355,{options:_0x4a5788,args:_0xbd5bca,tdx:_0x3d0e13}=_0x494e68,_0x2d944b=_0xbd5bca[0x0];if(!_0x2d944b)return console[_0x1d9ad6(0x31b)](_0x1d9ad6(0x291)),console[_0x1d9ad6(0x31b)](_0x1d9ad6(0x2be)),0x1;_0x4a5788[_0x1d9ad6(0x2d5)]&&console[_0x1d9ad6(0x31b)](_0x1d9ad6(0x327)+_0x2d944b);if(!_0x4a5788[_0x1d9ad6(0x2db)]){const _0x21927d=await confirmKey(_0x1d9ad6(0x19a)+_0x2d944b+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x21927d)return console[_0x1d9ad6(0x31b)]('Cancelled'),0x0;}const _0x57615f=await withSpinner(_0x1d9ad6(0x270)+_0x2d944b+_0x1d9ad6(0x2e6),()=>_0x3d0e13[_0x1d9ad6(0x1e3)][_0x1d9ad6(0x328)](_0x2d944b),{'verbose':_0x4a5788[_0x1d9ad6(0x2d5)]}),_0x233436=_0x57615f[_0x1d9ad6(0x298)];return console[_0x1d9ad6(0x31b)](_0x1d9ad6(0x32b)+_0x233436[_0x1d9ad6(0x2f3)]),console[_0x1d9ad6(0x31b)]('\x20\x20Project\x20ID:\x20'+_0x233436[_0x1d9ad6(0x210)]),0x0;}}export function parseKeyValue(_0x20c33a){const _0x292361=a42_0x368355,_0x13db63=_0x20c33a[_0x292361(0x246)]('=');if(_0x13db63===-0x1)throw new Error(_0x292361(0x276)+_0x20c33a+_0x292361(0x2ff));const _0x229346=_0x20c33a[_0x292361(0x303)](0x0,_0x13db63),_0x7753b5=_0x20c33a[_0x292361(0x303)](_0x13db63+0x1);if(!_0x229346)throw new Error(_0x292361(0x1c9));return{'key':_0x229346,'value':_0x7753b5};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]='workflow:secrets:list';[a42_0x368355(0x2eb)]=a42_0x368355(0x300);async['execute'](_0x31ad9b){const _0x28696c=a42_0x368355,{options:_0x2def0c,args:_0x2a8456,tdx:_0x5c7f4c}=_0x31ad9b,_0xf835a=this[_0x28696c(0x2c3)](_0x2a8456,_0x2def0c);if(!_0xf835a)return 0x1;_0x2def0c[_0x28696c(0x2d5)]&&console['error'](_0x28696c(0x327)+_0xf835a);const _0xa72723=await withSpinner(_0x28696c(0x29e),()=>_0x5c7f4c[_0x28696c(0x1e3)][_0x28696c(0x2de)](_0xf835a),{'verbose':_0x2def0c[_0x28696c(0x2d5)]}),{secrets:_0x8725e4}=_0xa72723[_0x28696c(0x298)];return console['error']('✔\x20Found\x20'+_0x8725e4[_0x28696c(0x1c0)]+_0x28696c(0x253)+(_0x8725e4[_0x28696c(0x1c0)]!==0x1?'s':'')),await handleSDKOutput(_0x8725e4,_0x2def0c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x219);[a42_0x368355(0x2eb)]=a42_0x368355(0x1a5);async[a42_0x368355(0x1c7)](_0x5893c2){const _0x5339b6=a42_0x368355,{options:_0x2a3883,args:_0x4f043f,tdx:_0x29ebd1}=_0x5893c2;let _0x3680b1,_0x3fbe16;if(_0x4f043f['length']>=0x2)_0x3680b1=_0x4f043f[0x0],_0x3fbe16=_0x4f043f[0x1];else{if(_0x4f043f[_0x5339b6(0x1c0)]===0x1&&_0x2a3883[_0x5339b6(0x1e7)])_0x3680b1=_0x2a3883[_0x5339b6(0x1e7)],_0x3fbe16=_0x4f043f[0x0];else return _0x4f043f[_0x5339b6(0x1c0)]===0x1?(console[_0x5339b6(0x31b)](_0x5339b6(0x211)),console[_0x5339b6(0x31b)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x5339b6(0x31b)](_0x5339b6(0x22b)),console[_0x5339b6(0x31b)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0xa78f3a,_0x462fbd;try{({key:_0xa78f3a,value:_0x462fbd}=parseKeyValue(_0x3fbe16));}catch(_0x5bec78){return _0x5bec78 instanceof Error&&console[_0x5339b6(0x31b)](a42_0xddcea5[_0x5339b6(0x1e5)](_0x5339b6(0x2ba)),_0x5bec78[_0x5339b6(0x228)]),0x1;}_0x2a3883[_0x5339b6(0x2d5)]&&(console[_0x5339b6(0x31b)](_0x5339b6(0x327)+_0x3680b1),console[_0x5339b6(0x31b)](_0x5339b6(0x26e)+_0xa78f3a));const _0x14658c=await withSpinner(_0x5339b6(0x299),()=>_0x29ebd1['workflow'][_0x5339b6(0x333)](_0x3680b1,_0xa78f3a,_0x462fbd),{'verbose':_0x2a3883['verbose']}),_0x4221c2=_0x14658c[_0x5339b6(0x298)];return console['error'](_0x5339b6(0x251)+_0x4221c2[_0x5339b6(0x198)]+_0x5339b6(0x1f4)+_0x4221c2[_0x5339b6(0x2f3)]+'\x27'),(_0x2a3883[_0x5339b6(0x252)]||_0x2a3883[_0x5339b6(0x2c0)])&&await handleSingleObjectOutput(_0x4221c2,_0x2a3883),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x368355(0x2c7)]=a42_0x368355(0x281);[a42_0x368355(0x2eb)]=a42_0x368355(0x28f);async[a42_0x368355(0x1c7)](_0x307282){const _0x95a8ea=a42_0x368355,{options:_0x41120d,args:_0x356fc6,tdx:_0x2fa8b7}=_0x307282;let _0x4c04c2,_0x3646c9;if(_0x356fc6[_0x95a8ea(0x1c0)]>=0x2)_0x4c04c2=_0x356fc6[0x0],_0x3646c9=_0x356fc6[0x1];else{if(_0x356fc6[_0x95a8ea(0x1c0)]===0x1&&_0x41120d['workflowProject'])_0x4c04c2=_0x41120d['workflowProject'],_0x3646c9=_0x356fc6[0x0];else return _0x356fc6[_0x95a8ea(0x1c0)]===0x1?(console['error'](_0x95a8ea(0x211)),console['error'](_0x95a8ea(0x268)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x95a8ea(0x31b)](_0x95a8ea(0x2a8)),0x1);}_0x41120d['verbose']&&(console['error'](_0x95a8ea(0x327)+_0x4c04c2),console[_0x95a8ea(0x31b)](_0x95a8ea(0x26e)+_0x3646c9));if(!_0x41120d[_0x95a8ea(0x2db)]){const _0x1e58ca=await confirmKey(_0x95a8ea(0x2ca)+_0x3646c9+'\x27\x20from\x20project\x20\x27'+_0x4c04c2+'\x27?');if(!_0x1e58ca)return console['error'](_0x95a8ea(0x2f6)),0x0;}const _0xab28fb=await withSpinner(_0x95a8ea(0x21e),()=>_0x2fa8b7[_0x95a8ea(0x1e3)][_0x95a8ea(0x1b3)](_0x4c04c2,_0x3646c9),{'verbose':_0x41120d[_0x95a8ea(0x2d5)]}),_0x27e137=_0xab28fb['data'];return console[_0x95a8ea(0x31b)](_0x95a8ea(0x251)+_0x27e137['key']+_0x95a8ea(0x1bc)+_0x27e137['projectName']+'\x27'),(_0x41120d['json']||_0x41120d[_0x95a8ea(0x2c0)])&&await handleSingleObjectOutput(_0x27e137,_0x41120d),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(_0x477cdb){const _0x5ef860=a42_0x368355,_0xa5ddcb=Math['floor'](_0x477cdb/0x3e8),_0x3b798c=Math['floor'](_0xa5ddcb/0x3c),_0x1620e3=Math[_0x5ef860(0x2fd)](_0x3b798c/0x3c),_0xf2f956=Math[_0x5ef860(0x2fd)](_0x1620e3/0x18);if(_0xf2f956>0x0){const _0x40a5c7=_0x1620e3%0x18;return _0x40a5c7>0x0?_0xf2f956+'d\x20'+_0x40a5c7+'h':_0xf2f956+'d';}else{if(_0x1620e3>0x0){const _0x5da98c=_0x3b798c%0x3c;return _0x5da98c>0x0?_0x1620e3+'h\x20'+_0x5da98c+'m':_0x1620e3+'h';}else{if(_0x3b798c>0x0){const _0x58b37d=_0xa5ddcb%0x3c;return _0x58b37d>0x0?_0x3b798c+'m\x20'+_0x58b37d+'s':_0x3b798c+'m';}else return _0xa5ddcb+'s';}}}function formatTimestamp(_0x2d6536,_0x30e647){const _0x3c94f7=a42_0x368355,_0x3fda05=new Date(_0x2d6536),_0x429564=String(_0x3fda05[_0x3c94f7(0x1c4)]())[_0x3c94f7(0x294)](0x2,'0'),_0x52a8b4=String(_0x3fda05[_0x3c94f7(0x234)]())['padStart'](0x2,'0'),_0x16527c=_0x429564+':'+_0x52a8b4,_0x3f9a7b=_0x3fda05[_0x3c94f7(0x1ee)]()===_0x30e647[_0x3c94f7(0x1ee)]()&&_0x3fda05['getMonth']()===_0x30e647['getMonth']()&&_0x3fda05[_0x3c94f7(0x193)]()===_0x30e647[_0x3c94f7(0x193)]();if(_0x3f9a7b)return _0x16527c;else{const _0x1e33f1=String(_0x3fda05[_0x3c94f7(0x2c1)]()+0x1)[_0x3c94f7(0x294)](0x2,'0'),_0x26a205=String(_0x3fda05[_0x3c94f7(0x193)]())['padStart'](0x2,'0');return _0x1e33f1+'-'+_0x26a205+'\x20'+_0x16527c;}}function formatDate(_0x5ed4e2){const _0x4aa1c7=a42_0x368355,_0x24e97d=_0x5ed4e2[_0x4aa1c7(0x1ee)](),_0xe4dfb9=String(_0x5ed4e2[_0x4aa1c7(0x2c1)]()+0x1)['padStart'](0x2,'0'),_0x372846=String(_0x5ed4e2[_0x4aa1c7(0x193)]())[_0x4aa1c7(0x294)](0x2,'0');return _0x24e97d+'-'+_0xe4dfb9+'-'+_0x372846;}function getTaskStateIcon(_0x53539f){const _0x382713={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x382713[_0x53539f]||'⚪';}function getBarChar(_0x12621f){const _0x10b5af=a42_0x368355;return _0x12621f===_0x10b5af(0x31b)||_0x12621f===_0x10b5af(0x2f5)?'×':'─';}function getBarColor(_0x200502){const _0x17c8bb=a42_0x368355,_0x3feca1={'success':a42_0xddcea5[_0x17c8bb(0x282)],'error':a42_0xddcea5[_0x17c8bb(0x1e5)],'group_error':a42_0xddcea5[_0x17c8bb(0x1e5)],'running':a42_0xddcea5[_0x17c8bb(0x305)],'blocked':a42_0xddcea5[_0x17c8bb(0x2a1)],'planned':a42_0xddcea5[_0x17c8bb(0x28d)],'canceling':a42_0xddcea5['yellow']};return _0x3feca1[_0x200502]||a42_0xddcea5[_0x17c8bb(0x274)];}function parseTaskName(_0x550547){const _0x33551e=a42_0x368355;let _0x415d22=_0x550547['replace'](/^\++/,'');const _0x37d457=_0x415d22[_0x33551e(0x1f9)]('+'),_0x16888f=_0x37d457[_0x33551e(0x1c0)]>0x1?_0x37d457[_0x33551e(0x1c0)]-0x2:0x0,_0x2384cd=_0x37d457[_0x37d457[_0x33551e(0x1c0)]-0x1]||_0x415d22;return{'level':_0x16888f,'name':'+'+_0x2384cd};}function truncateTaskName(_0x18e403,_0x47b68d){const _0x2d70e4=a42_0x368355,_0x1b3ade=stringWidth(_0x18e403);if(_0x1b3ade<=_0x47b68d)return _0x18e403;let _0x1f3514=_0x18e403;while(stringWidth(_0x1f3514+'…')>_0x47b68d&&_0x1f3514[_0x2d70e4(0x1c0)]>0x0){_0x1f3514=_0x1f3514['slice'](0x0,-0x1);}return _0x1f3514+'…';}function calculateTimeScale(_0x22ee3b,_0x3862f1){const _0x1e76fd=a42_0x368355;return{'startTime':_0x22ee3b['start'],'endTime':_0x22ee3b[_0x1e76fd(0x2e3)],'durationMs':_0x22ee3b[_0x1e76fd(0x1e9)],'msPerChar':_0x22ee3b['duration']/_0x3862f1};}function timeToPosition(_0x3097ba,_0x138777,_0x19a116){const _0xf10bf1=a42_0x368355,_0x4902d3=_0x3097ba-_0x138777['startTime'],_0x45453d=Math[_0xf10bf1(0x2fd)](_0x4902d3/_0x138777[_0xf10bf1(0x2b8)]);return Math['max'](0x0,Math[_0xf10bf1(0x2ea)](_0x45453d,_0x19a116));}function renderTimeAxis(_0x18551d,_0xf74f4b){const _0x28311c=a42_0x368355,_0x8859e2=Math[_0x28311c(0x2ea)](TIMELINE_CONFIG[_0x28311c(0x2a3)],Math[_0x28311c(0x1d7)](TIMELINE_CONFIG[_0x28311c(0x2e7)],Math[_0x28311c(0x2fd)](_0xf74f4b/TIMELINE_CONFIG[_0x28311c(0x238)]))),_0x571af2=_0x18551d[_0x28311c(0x301)]/(_0x8859e2-0x1),_0x3ca7b8=new Date(_0x18551d[_0x28311c(0x19c)]),_0x11aae8=[];for(let _0x57a9e6=0x0;_0x57a9e6<_0x8859e2;_0x57a9e6++){const _0x238f84=_0x18551d['startTime']+_0x57a9e6*_0x571af2,_0x7f1418=timeToPosition(_0x238f84,_0x18551d,_0xf74f4b),_0x31e00b=formatTimestamp(_0x238f84,_0x3ca7b8);_0x11aae8[_0x28311c(0x1c3)]({'pos':_0x7f1418,'text':_0x31e00b});}const _0x1aa59b=new Array(_0xf74f4b)[_0x28311c(0x243)]('\x20');let _0x3d9cf6=-0x1;for(const {pos:_0x3e7e3a,text:_0xc02772}of _0x11aae8){let _0x582537=Math[_0x28311c(0x1d7)](0x0,_0x3e7e3a-Math[_0x28311c(0x2fd)](_0xc02772['length']/0x2));_0x582537<=_0x3d9cf6+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x582537=_0x3d9cf6+TIMELINE_CONFIG[_0x28311c(0x2d8)]+0x1);_0x582537+_0xc02772[_0x28311c(0x1c0)]>_0xf74f4b&&(_0x582537=_0xf74f4b-_0xc02772[_0x28311c(0x1c0)]);if(_0x582537>=0x0&&_0x582537+_0xc02772[_0x28311c(0x1c0)]<=_0xf74f4b&&_0x582537>_0x3d9cf6){for(let _0x58458d=0x0;_0x58458d<_0xc02772[_0x28311c(0x1c0)];_0x58458d++){_0x1aa59b[_0x582537+_0x58458d]=_0xc02772[_0x58458d];}_0x3d9cf6=_0x582537+_0xc02772[_0x28311c(0x1c0)]-0x1;}}return _0x1aa59b['join']('');}function renderTaskRow(_0x1f5468,_0x191144,_0x433173,_0x6d8f09){const _0x493d0e=a42_0x368355,{level:_0x3430c9,name:_0x161cc4}=parseTaskName(_0x1f5468[_0x493d0e(0x2c7)]),_0x58de80='\x20'['repeat'](_0x3430c9),_0x30ce54=_0x1f5468['window']?'('+formatElapsed(_0x1f5468[_0x493d0e(0x214)][_0x493d0e(0x1e9)])+')':'',_0x22c08f=stringWidth(_0x30ce54),_0x28b4d5=_0x3430c9*0x1,_0x51e834=_0x6d8f09-_0x28b4d5-_0x22c08f-0x1,_0xc027a8=truncateTaskName(_0x161cc4,_0x51e834),_0x2d4456=_0x58de80+_0xc027a8,_0x3df03c=stringWidth(_0x2d4456),_0x58ee1e=_0x6d8f09-_0x3df03c-_0x22c08f,_0x447da9=_0x2d4456+'\x20'[_0x493d0e(0x2c2)](Math['max'](0x1,_0x58ee1e))+a42_0xddcea5[_0x493d0e(0x28d)](_0x30ce54),_0x282a17=getTaskStateIcon(_0x1f5468[_0x493d0e(0x323)]),_0x331176=new Array(_0x433173)[_0x493d0e(0x243)]('\x20');if(_0x1f5468['window']){const _0x327c3a=timeToPosition(_0x1f5468[_0x493d0e(0x214)][_0x493d0e(0x335)],_0x191144,_0x433173),_0x123e8f=timeToPosition(_0x1f5468[_0x493d0e(0x214)][_0x493d0e(0x2e3)],_0x191144,_0x433173),_0x1d90b6=getBarChar(_0x1f5468[_0x493d0e(0x323)]),_0x5c268f=Math['max'](_0x327c3a+0x1,_0x123e8f);for(let _0xfdafdb=_0x327c3a;_0xfdafdb<Math['min'](_0x5c268f,_0x433173);_0xfdafdb++){_0x331176[_0xfdafdb]=_0x1d90b6;}}const _0x1dba10=getBarColor(_0x1f5468[_0x493d0e(0x323)]),_0x3bb194=_0x331176['map'](_0xc6988e=>_0xc6988e==='\x20'?'\x20':_0x1dba10(_0xc6988e))['join']('');return _0x282a17+'\x20'+_0x447da9+'│'+_0x3bb194+'│';}function calculateStats(_0x1c7c44){const _0x524176=a42_0x368355,_0x333ee7={'total':_0x1c7c44['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x30be01 of _0x1c7c44){if(_0x30be01[_0x524176(0x323)]===_0x524176(0x2fc))_0x333ee7[_0x524176(0x2fc)]++;else{if(_0x30be01[_0x524176(0x323)]===_0x524176(0x31b)||_0x30be01[_0x524176(0x323)]===_0x524176(0x2f5))_0x333ee7[_0x524176(0x31b)]++;else _0x30be01['state']===_0x524176(0x21c)?_0x333ee7[_0x524176(0x21c)]++:_0x333ee7[_0x524176(0x1ca)]++;}}return _0x333ee7;}function formatStats(_0x1a51d9){const _0x40124f=a42_0x368355;return['Total:\x20'+_0x1a51d9['total'],'✅\x20'+_0x1a51d9[_0x40124f(0x2fc)],'❌\x20'+_0x1a51d9[_0x40124f(0x31b)],_0x40124f(0x249)+_0x1a51d9[_0x40124f(0x21c)],'⏳\x20'+_0x1a51d9['pending']][_0x40124f(0x22f)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a42_0x368355(0x32c);['description']=a42_0x368355(0x1fd);async['execute'](_0x3917b2){const _0x2f412d=a42_0x368355,{options:_0x2d7098,args:_0x52d398,tdx:_0x1cf5f4}=_0x3917b2;let _0x51c3e4,_0x3f415f,_0x1feaa3=![];if(_0x52d398[0x0]){if(_0x52d398[0x0][_0x2f412d(0x2f7)]('.')){const _0x22a5c1=this[_0x2f412d(0x2da)](_0x52d398,_0x2d7098);if(!_0x22a5c1)return 0x1;_0x51c3e4=_0x22a5c1[_0x2f412d(0x2f3)],_0x3f415f=_0x22a5c1[_0x2f412d(0x1de)];}else{_0x3f415f=_0x52d398[0x0],_0x51c3e4=_0x2d7098['workflowProject'];if(!_0x51c3e4)return console['error'](a42_0xddcea5[_0x2f412d(0x1e5)](_0x2f412d(0x2ba)),_0x2f412d(0x2b3)),0x1;_0x1feaa3=!![];}}else{const _0x62b3b9=this[_0x2f412d(0x2da)](_0x52d398,_0x2d7098);if(!_0x62b3b9)return 0x1;_0x51c3e4=_0x62b3b9[_0x2f412d(0x2f3)],_0x3f415f=_0x62b3b9[_0x2f412d(0x1de)];}if(_0x2d7098[_0x2f412d(0x2d5)]){if(_0x51c3e4&&_0x3f415f)console['error'](_0x2f412d(0x25c)+_0x51c3e4+'.'+_0x3f415f);else _0x51c3e4&&console[_0x2f412d(0x31b)](_0x2f412d(0x20b)+_0x51c3e4);}const _0xcfe0b5=_0x2d7098[_0x2f412d(0x1c1)],_0x167d8a=_0x2d7098['sessionId'];if(_0xcfe0b5){_0x167d8a&&console[_0x2f412d(0x31b)](a42_0xddcea5['yellow'](_0x2f412d(0x26d)),_0x2f412d(0x25f));const _0x56d9d4=_0x2d7098[_0x2f412d(0x2d1)];return _0x56d9d4?await this[_0x2f412d(0x1f2)](_0x3917b2,_0xcfe0b5):await this[_0x2f412d(0x225)](_0x3917b2,_0xcfe0b5,_0x2d7098),0x0;}if(_0x167d8a){const _0x1c70e8=await withSpinner(_0x2f412d(0x317),()=>_0x1cf5f4[_0x2f412d(0x1e3)]['sessions']({'projectName':_0x51c3e4,'workflowName':_0x3f415f,'limit':0x64}),{'verbose':_0x2d7098[_0x2f412d(0x2d5)]}),_0x1735d5=_0x1c70e8[_0x2f412d(0x298)]['find'](_0x15355b=>_0x15355b['id']===_0x167d8a);if(!_0x1735d5)return console[_0x2f412d(0x31b)](a42_0xddcea5[_0x2f412d(0x1e5)](_0x2f412d(0x2ba)),_0x2f412d(0x293)+_0x167d8a),0x1;if(!_0x1735d5['lastAttempt']?.['id'])return console[_0x2f412d(0x31b)](a42_0xddcea5[_0x2f412d(0x1e5)](_0x2f412d(0x2ba)),_0x2f412d(0x21b)+_0x167d8a+'\x20has\x20no\x20attempts'),0x1;const _0xf77765=_0x1735d5[_0x2f412d(0x2a9)]['id'];_0x2d7098[_0x2f412d(0x2d5)]&&console[_0x2f412d(0x31b)]('Using\x20attempt\x20'+_0xf77765+_0x2f412d(0x27a)+_0x167d8a);const _0x1e04c4=_0x2d7098['follow'];return _0x1e04c4?await this[_0x2f412d(0x1f2)](_0x3917b2,_0xf77765):await this['renderSingleTimeline'](_0x3917b2,_0xf77765,_0x2d7098),0x0;}const _0x3c1a04=await withSpinner(_0x2f412d(0x2d4),()=>_0x1cf5f4[_0x2f412d(0x1e3)][_0x2f412d(0x1f6)]({'projectName':_0x51c3e4,'workflowName':_0x3f415f,'limit':_0x2d7098[_0x2f412d(0x292)]||0x32}),{'verbose':_0x2d7098[_0x2f412d(0x2d5)]}),_0x194bbd=_0x3c1a04[_0x2f412d(0x298)];if(_0x194bbd[_0x2f412d(0x1c0)]===0x0){if(_0x51c3e4&&_0x3f415f)console['error'](_0x2f412d(0x29a)+_0x51c3e4+'.'+_0x3f415f);else _0x51c3e4?console[_0x2f412d(0x31b)](_0x2f412d(0x22e)+_0x51c3e4):(console[_0x2f412d(0x31b)](_0x2f412d(0x32e)),console['error'](a42_0xddcea5[_0x2f412d(0x28d)](_0x2f412d(0x244))));return 0x0;}_0x194bbd['sort']((_0x3c93c6,_0x592d9f)=>{const _0x435f4e=_0x2f412d,_0xb97bc4=_0x3c93c6[_0x435f4e(0x269)]||'',_0x39ecb1=_0x592d9f['sessionTime']||'';return _0x39ecb1['localeCompare'](_0xb97bc4);});if(_0x2d7098[_0x2f412d(0x252)]||_0x2d7098[_0x2f412d(0x2c0)])return await handleSDKOutput(_0x194bbd,_0x2d7098),0x0;let _0x45dda1;if(_0x1feaa3){const _0x256a4b=_0x194bbd[0x0];if(!_0x256a4b[_0x2f412d(0x2a9)]?.['id'])return console[_0x2f412d(0x31b)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x45dda1=_0x256a4b[_0x2f412d(0x2a9)]['id'],_0x2d7098['verbose']&&console['error'](_0x2f412d(0x20a)+_0x256a4b[_0x2f412d(0x269)]);}else{const _0x49f0db=_0x194bbd[_0x2f412d(0x1b7)](_0x13e648=>{const _0x12a87c=_0x2f412d,_0x145193=getAttemptStatusDisplay(_0x13e648[_0x12a87c(0x2a9)]);return{'title':_0x13e648[_0x12a87c(0x1b4)]?.[_0x12a87c(0x2c7)]+'.'+_0x13e648[_0x12a87c(0x1e3)]?.['name']+'\x20-\x20'+_0x13e648[_0x12a87c(0x269)]+'\x20'+_0x145193['icon'],'value':_0x13e648[_0x12a87c(0x2a9)]?.['id']||'','description':_0x145193[_0x12a87c(0x29f)]};}),_0x34d142=await a42_0x25b42a({'type':_0x2f412d(0x2e4),'name':_0x2f412d(0x1c1),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x49f0db['filter'](_0x803eb9=>_0x803eb9[_0x2f412d(0x191)]!=='')});if(!_0x34d142['attemptId'])return 0x0;_0x45dda1=_0x34d142[_0x2f412d(0x1c1)];}const _0x5d7a29=_0x2d7098[_0x2f412d(0x2d1)];return _0x5d7a29?await this['pollTimeline'](_0x3917b2,_0x45dda1):await this[_0x2f412d(0x225)](_0x3917b2,_0x45dda1,_0x2d7098),0x0;}async[a42_0x368355(0x225)](_0xb26e8e,_0x3665e1,_0x318ae0){const _0x3e9eb1=a42_0x368355,{tdx:_0x12ed1d}=_0xb26e8e;let _0x25b1f6,_0x51fe3;try{[_0x25b1f6,_0x51fe3]=await Promise[_0x3e9eb1(0x297)]([_0x12ed1d['workflow'][_0x3e9eb1(0x1f1)](_0x3665e1),_0x12ed1d[_0x3e9eb1(0x1e3)][_0x3e9eb1(0x1f8)](_0x3665e1,![])]);}catch(_0x2ebad3){console[_0x3e9eb1(0x31b)](a42_0xddcea5[_0x3e9eb1(0x1e5)](_0x3e9eb1(0x267)));_0x318ae0['verbose']&&console[_0x3e9eb1(0x31b)](_0x2ebad3);throw _0x2ebad3;}if(_0x318ae0['json']||_0x318ae0[_0x3e9eb1(0x2c0)]){const _0x338ced=this['buildTimelineData'](_0x25b1f6,_0x51fe3);await handleSDKOutput([_0x338ced],_0x318ae0);return;}const _0x143582=_0x12ed1d[_0x3e9eb1(0x223)]['site'],_0x6289bd=this[_0x3e9eb1(0x212)](_0x25b1f6,_0x51fe3,_0x143582);console[_0x3e9eb1(0x2b5)](_0x6289bd);}async['pollTimeline'](_0x36df3a,_0x305e3a){const _0xdbcdf9=a42_0x368355,{tdx:_0x10e90a}=_0x36df3a,_0x12d877=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x549fb3=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x4e8542=0x0;while(_0x4e8542<_0x549fb3){process[_0xdbcdf9(0x1ac)][_0xdbcdf9(0x1b2)]&&process['stdout']['write']('\x1bc');let _0x386771,_0xe86b56;try{[_0x386771,_0xe86b56]=await Promise[_0xdbcdf9(0x297)]([_0x10e90a[_0xdbcdf9(0x1e3)][_0xdbcdf9(0x1f1)](_0x305e3a),_0x10e90a['workflow']['tasks'](_0x305e3a,![])]);}catch(_0x388ada){console[_0xdbcdf9(0x31b)](a42_0xddcea5[_0xdbcdf9(0x1e5)](_0xdbcdf9(0x2f4)));_0x4e8542>0x0&&console['error'](a42_0xddcea5[_0xdbcdf9(0x28d)](_0xdbcdf9(0x2cc)+_0x4e8542));throw _0x388ada;}const _0x48d5f4=_0x10e90a[_0xdbcdf9(0x223)][_0xdbcdf9(0x2fe)],_0x4ed1b7=this[_0xdbcdf9(0x212)](_0x386771,_0xe86b56,_0x48d5f4);console[_0xdbcdf9(0x2b5)](_0x4ed1b7);const _0x10a0c7=_0x386771[_0xdbcdf9(0x236)]&&_0xe86b56[_0xdbcdf9(0x1c2)](_0x4ba08f=>_0x4ba08f[_0xdbcdf9(0x323)]!=='running'&&_0x4ba08f[_0xdbcdf9(0x323)]!=='planned');if(_0x10a0c7){console[_0xdbcdf9(0x31b)](a42_0xddcea5['green']('\x0a✔\x20Attempt\x20complete'));break;}console[_0xdbcdf9(0x31b)](a42_0xddcea5[_0xdbcdf9(0x28d)](_0xdbcdf9(0x279)+_0x4e8542*0x2+_0xdbcdf9(0x1cd))),await new Promise(_0x29d5d1=>setTimeout(_0x29d5d1,_0x12d877)),_0x4e8542++;}_0x4e8542>=_0x549fb3&&console[_0xdbcdf9(0x31b)](a42_0xddcea5['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x368355(0x212)](_0x3980a9,_0x17c805,_0xcd748){const _0x1ad28b=a42_0x368355,_0x45a592=[],_0x384a60=TIMELINE_CONFIG[_0x1ad28b(0x240)],_0x2299cc=0x5,_0x913a18=process[_0x1ad28b(0x1ac)][_0x1ad28b(0x235)]||0x78,_0x2083d4=_0x913a18-_0x384a60-_0x2299cc,_0x2b8058=Math['max'](TIMELINE_CONFIG[_0x1ad28b(0x1d3)],Math['min'](_0x2083d4,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0xe40a99=new Date(_0x3980a9[_0x1ad28b(0x2b7)])[_0x1ad28b(0x1be)](),_0x26a362=_0x3980a9[_0x1ad28b(0x19e)]?new Date(_0x3980a9[_0x1ad28b(0x19e)])['getTime']():Date[_0x1ad28b(0x263)](),_0x2bf6f8={'start':_0xe40a99,'end':_0x26a362,'duration':_0x26a362-_0xe40a99},_0x5abb74=new Map(),_0x31752f=[];for(const _0x44e8a1 of _0x17c805){if(_0x44e8a1[_0x1ad28b(0x25a)]){const _0x21df54=new Date(_0x44e8a1[_0x1ad28b(0x25a)])[_0x1ad28b(0x1be)](),_0x26ea7c=_0x44e8a1[_0x1ad28b(0x26a)]?new Date(_0x44e8a1[_0x1ad28b(0x26a)])[_0x1ad28b(0x1be)]():Date[_0x1ad28b(0x263)](),_0x5dfd66={'start':_0x21df54,'end':_0x26ea7c,'duration':_0x26ea7c-_0x21df54};_0x5abb74[_0x1ad28b(0x2bd)](_0x44e8a1['id'],_0x5dfd66),_0x31752f[_0x1ad28b(0x1c3)]({'name':_0x44e8a1[_0x1ad28b(0x284)],'state':_0x44e8a1[_0x1ad28b(0x323)]||'unknown','window':_0x5dfd66});}else _0x31752f[_0x1ad28b(0x1c3)]({'name':_0x44e8a1['fullName'],'state':_0x44e8a1[_0x1ad28b(0x323)]||_0x1ad28b(0x316),'window':undefined});}_0x31752f[_0x1ad28b(0x1bb)]((_0x44dc2c,_0x5d158f)=>{const _0x554f85=_0x1ad28b;if(!_0x44dc2c[_0x554f85(0x214)])return 0x1;if(!_0x5d158f[_0x554f85(0x214)])return-0x1;return _0x44dc2c[_0x554f85(0x214)][_0x554f85(0x335)]-_0x5d158f[_0x554f85(0x214)][_0x554f85(0x335)];});const _0x4ccf66=_0x31752f[_0x1ad28b(0x1c0)],_0x1ba38e=_0x4ccf66>TIMELINE_CONFIG[_0x1ad28b(0x322)];_0x1ba38e&&_0x31752f['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x35f869=calculateTimeScale(_0x2bf6f8,_0x2b8058),_0x4332c7=_0x3980a9['done']?_0x3980a9[_0x1ad28b(0x2fc)]?a42_0xddcea5[_0x1ad28b(0x282)](_0x1ad28b(0x2fc)):a42_0xddcea5[_0x1ad28b(0x1e5)](_0x1ad28b(0x31b)):a42_0xddcea5[_0x1ad28b(0x305)]('running'),_0x543457=_0x3980a9['project']?.['id'],_0xf5267d=_0x3980a9[_0x1ad28b(0x2bf)];let _0x43538b;if(_0x543457&&_0xf5267d){const _0xf730bf=getWorkflowAttemptUrl(_0xcd748,_0x543457,_0xf5267d,_0x3980a9['id']);_0x43538b=hyperlink(a42_0xddcea5[_0x1ad28b(0x28d)](_0x3980a9['id']),_0xf730bf);}else _0x43538b=a42_0xddcea5['dim'](_0x3980a9['id']);_0x45a592[_0x1ad28b(0x1c3)](_0x1ad28b(0x308)+_0x43538b+_0x1ad28b(0x28c)+_0x4332c7+_0x1ad28b(0x28c)+formatElapsed(_0x2bf6f8[_0x1ad28b(0x1e9)]));if(_0x31752f[_0x1ad28b(0x1c0)]>0x0){const _0x43bf25=renderTimeAxis(_0x35f869,_0x2b8058),_0x186976=new Date(_0x2bf6f8[_0x1ad28b(0x335)]),_0x219af0=formatDate(_0x186976),_0x2bec63=TIMELINE_CONFIG[_0x1ad28b(0x27b)]+TIMELINE_CONFIG[_0x1ad28b(0x2a5)]+_0x384a60,_0x157a92=_0x219af0[_0x1ad28b(0x294)](_0x2bec63),_0x38a448=a42_0xddcea5[_0x1ad28b(0x28d)](_0x157a92);_0x45a592[_0x1ad28b(0x1c3)](_0x38a448+'\x20'+_0x43bf25);for(const _0x36fe00 of _0x31752f){_0x45a592[_0x1ad28b(0x1c3)](renderTaskRow(_0x36fe00,_0x35f869,_0x2b8058,_0x384a60));}const _0x2ab5f0=calculateStats(_0x31752f);_0x45a592[_0x1ad28b(0x1c3)](formatStats(_0x2ab5f0)),_0x1ba38e&&_0x45a592['push'](a42_0xddcea5[_0x1ad28b(0x2a1)](_0x1ad28b(0x2dc)+TIMELINE_CONFIG[_0x1ad28b(0x322)]+_0x1ad28b(0x272)+_0x4ccf66+'\x20tasks')),_0x45a592[_0x1ad28b(0x1c3)](''),_0x45a592[_0x1ad28b(0x1c3)](a42_0xddcea5[_0x1ad28b(0x28d)](_0x1ad28b(0x2bc))+(_0x1ad28b(0x312)+_0x3980a9['id']+'\x20logs')+a42_0xddcea5[_0x1ad28b(0x28d)](_0x1ad28b(0x2e1)));}else _0x45a592[_0x1ad28b(0x1c3)](_0x1ad28b(0x32a));return _0x45a592[_0x1ad28b(0x22f)]('\x0a');}[a42_0x368355(0x192)](_0x2ca0b7,_0x1e1516){const _0x5b102c=a42_0x368355,_0x1ea165=new Date(_0x2ca0b7[_0x5b102c(0x2b7)])[_0x5b102c(0x1be)](),_0x501573=_0x2ca0b7[_0x5b102c(0x19e)]?new Date(_0x2ca0b7[_0x5b102c(0x19e)])[_0x5b102c(0x1be)]():Date[_0x5b102c(0x263)](),_0x13b8fa=_0x501573-_0x1ea165,_0x119234=[];for(const _0x3b30c3 of _0x1e1516){if(_0x3b30c3['startedAt']){const _0x298013=new Date(_0x3b30c3[_0x5b102c(0x25a)])[_0x5b102c(0x1be)](),_0x1cfc44=_0x3b30c3[_0x5b102c(0x26a)]?new Date(_0x3b30c3[_0x5b102c(0x26a)])[_0x5b102c(0x1be)]():Date[_0x5b102c(0x263)]();_0x119234[_0x5b102c(0x1c3)]({'name':_0x3b30c3[_0x5b102c(0x284)],'state':_0x3b30c3[_0x5b102c(0x323)]||_0x5b102c(0x24c),'window':{'start':_0x298013,'end':_0x1cfc44,'duration':_0x1cfc44-_0x298013}});}else _0x119234[_0x5b102c(0x1c3)]({'name':_0x3b30c3[_0x5b102c(0x284)],'state':_0x3b30c3[_0x5b102c(0x323)]||_0x5b102c(0x316),'window':undefined});}const _0x242d1f=calculateStats(_0x119234);return{'attempt':{'id':_0x2ca0b7['id'],'status':_0x2ca0b7[_0x5b102c(0x236)]?_0x2ca0b7['success']?_0x5b102c(0x2fc):_0x5b102c(0x31b):'running','createdAt':_0x2ca0b7['createdAt'],'finishedAt':_0x2ca0b7['finishedAt'],'duration_ms':_0x13b8fa},'tasks':_0x119234['map'](_0x37ee85=>({'name':_0x37ee85[_0x5b102c(0x2c7)],'state':_0x37ee85[_0x5b102c(0x323)],'startedAt':_0x37ee85[_0x5b102c(0x214)]?new Date(_0x37ee85[_0x5b102c(0x214)]['start'])[_0x5b102c(0x31f)]():null,'updatedAt':_0x37ee85[_0x5b102c(0x214)]?new Date(_0x37ee85[_0x5b102c(0x214)][_0x5b102c(0x2e3)])[_0x5b102c(0x31f)]():null,'duration_ms':_0x37ee85['window']?.[_0x5b102c(0x1e9)]||null})),'stats':_0x242d1f};}}function a42_0x59b0(){const _0x3cdf4a=['attempts','attempt:','revision','getMinutes','columns','done','\x0aDry\x20run\x20-\x20nothing\x20pushed','LABEL_WIDTH_DIVISOR','Project\x20name:\x20','Reason:\x20','session','✔\x20Retry\x20started','Source\x20project:\x20','modified','New\x20project\x20name:\x20','TASK_NAME_WIDTH','\x22\x20to\x20new\x20project\x20\x22','Target\x20directory:\x20','fill','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','✔\x20Push\x20complete','indexOf','Downloading\x20logs...','\x0aPush\x20these\x20changes?','🔄\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','write','unknown','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','2187148ScEbGm','No\x20log\x20content\x20found','✔\x20Secret\x20\x27','json','\x20secret','📁\x20','index','No\x20workflow\x20projects\x20found','\x20\x20Changes:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20Invalid\x20parameter\x20format:\x20','startedAt','No\x20workflows\x20found\x20in\x20project:\x20','Filter:\x20','\x20\x20Console:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:push','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','now','applyPullProject','clear','List\x20workflow\x20attempts','Failed\x20to\x20fetch\x20attempt\x20data','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','sessionTime','updatedAt','427008rtOdva','workflow:upload','Warning:','Key:\x20','\x20deleted','Deleting\x20project\x20','Listing\x20workflow\x20projects...','\x20of\x20','✔\x20Clone\x20complete','white','Dry\x20run:\x20yes','Invalid\x20format:\x20','\x20task','\x20\x20Session\x20ID:\x20','\x0aPolling...\x20(','\x20from\x20session\x20','ICON_WIDTH','\x20\x20Target:\x20','cancelRequested','title','workflow:tasks','From\x20task:\x20','workflow:secrets:delete','green','task','fullName','isNewProject','No\x20attempts\x20found\x20in\x20project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Retry\x20a\x20session\x20or\x20attempt','utf-8','\x20\x20Workflow:\x20','workflow:run','\x20-\x20','dim','sys','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','resolveProjectId','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','limit','Session\x20not\x20found:\x20','padStart','No\x20workflow\x20tdx.json\x20found','18PMmext','all','data','Setting\x20secret...','No\x20sessions\x20found\x20for:\x20','2540790vLasko','sourceDir','\x0aUpdate\x20existing\x20project\x20\x22','Listing\x20secrets...','text','download','yellow','basename','MAX_LABEL_COUNT','workflow:use','ICON_SPACING','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','new','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','lastAttempt','\x20new','executeCloneProject','format','tdx.json','Listing\x20workflow\x20sessions...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20workflow','deleted','Tip:\x20cd\x20to\x20workflows/','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Resolving\x20project\x20\x27','log','Parameters:\x20','createdAt','msPerChar','summary','Error:','pullProject','💡\x20Tip:\x20Use\x20','set','Usage:\x20workflow:delete\x20<project-name-or-id>','sessionId','jsonl','getMonth','repeat','requireProject','resolveProject','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','prepareCloneProject','name','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Getting\x20attempt\x20tasks...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20is\x20not\x20a\x20directory','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','workflow:pull','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','force','Pull\x20workflow\x20project\x20to\x20local\x20folder','follow','retryAttempt','trimEnd','Loading\x20sessions...','verbose','hasChanges','canceling','LABEL_MIN_SPACING','/sessions/','parseProjectWorkflowPattern','yes','⚠\x20Showing\x20first\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','listSecrets','unchanged','resumeFrom','\x20to\x20see\x20detailed\x20logs','\x0aDry\x20run\x20-\x20no\x20files\x20written','end','select','Loading\x20workflows...','...','MIN_LABEL_COUNT','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','min','description','List\x20workflows','\x27...','Workflow:\x20','cwd','renderSessionsTimeline','readFile','Files\x20to\x20upload:\x20','projectName','\x0aFailed\x20to\x20fetch\x20attempt\x20data','group_error','Cancelled','includes','2722780YAtUOW','includeRetried','workflow:clone','filter','success','floor','site','.\x20Expected\x20format:\x20KEY=VALUE','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','durationMs','Project\x20directory:\x20','substring','\x0a✔\x20Already\x20up\x20to\x20date','blue','Project\x20name\x20is\x20required','showWorkflowConsoleUrl','Attempt:\x20','targetExists','Including\x20subtasks:\x20yes','No\x20attempts\x20found\x20for:\x20','1099052BwTTEK','616QTUFhW','Show\x20tasks\x20for\x20an\x20attempt','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found','Include\x20retried:\x20yes','tdx\x20wf\x20attempt\x20','relative','✔\x20New\x20project:\x20','values','planned','Loading\x20session...','Error:\x20','toLowerCase','\x20\x20Files\x20extracted:\x20','error','✔\x20Showing\x20','No\x20matching\x20sessions\x20found','✔\x20Pushed\x20','toISOString','generateSessionTimelineRows','Writing\x20files...','MAX_TASKS_DISPLAY','state','Attempt\x20ID:\x20','output','displayLine','Project:\x20','delete','Revision:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','✔\x20Deleted\x20project\x20','workflow:timeline','workflow:download','No\x20workflow\x20sessions\x20found','params','diff','startsWith','cyan','setSecret','\x20\x20Project:\x20','start','find','Pushing\x20workflow\x20project...','run','Source\x20directory:\x20','\x20(system)','✔\x20Workflow\x20run\x20started','value','buildTimelineData','getDate','Pattern:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Fetching\x20log\x20files...','executePushProject','key','/attempt/','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','skipValidation','startTime','Target:\x20','finishedAt','\x20\x20Location:\x20','(use\x20--limit\x20to\x20see\x20more)','Retrying\x20session...','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20sessions\x20','Killing\x20attempt...','Analyzing\x20changes...','\x20\x20Source:\x20','Getting\x20attempt\x20details...','fileCount','stdout','Pulling\x20project\x20','List\x20all\x20workflow\x20projects','status','rows','resolveProjectDir','isTTY','deleteSecret','project','\x20modified','5IFeAbN','map','includeSubtasks','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','taskName','sort','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Session\x20time:\x20','getTime','GUTTER','length','attemptId','every','push','getHours','list','✔\x20Pull\x20complete','execute','localeCompare','Key\x20cannot\x20be\x20empty','pending','retrySession','slice','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x20attempt','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','132gIaNaF','newProjectName','changes','MIN_TIMELINE_WIDTH','targetDir','path','Retrying\x20attempt...','max','\x20(use\x20--limit\x20to\x20show\x20more)','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Updating\x20','retryAttemptName','✔\x20Found\x20','\x20\x20Revision:\x20','workflowName','logs','1QXPRQj','\x0aDry\x20run\x20-\x20no\x20project\x20created','logFiles','workflow','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','red','Start\x20a\x20workflow\x20run','workflowProject','---\x20','duration','No\x20workflows\x20found','Source\x20directory\x20is\x20required','reason','1338920LnSEBN','getFullYear','type','Cloning\x20to\x20','attempt','pollTimeline','\x0aClone\x20\x22','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','filesExtracted','sessions','workflow:retry','tasks','split','Validation:\x20skipped','workflow:projects','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20unchanged','\x20\x20tdx\x20wf\x20use\x20<project>','navigateSessionsInteractive','9024GUjrUr','has','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Listing\x20workflows...','parse','get','dryRun','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20session','Auto-selected\x20latest\x20session:\x20','Filter:\x20project=',',\x20Workflow:\x20','kill','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x0a⚠\x20Project\x20\x22','projectId','Error:\x20Project\x20name\x20is\x20required','renderTimeline','Show\x20specific\x20attempt\x20details','window','match','keys','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','newProjectId','workflow:secrets:set','/app/workflows/','Session\x20','running','fs/promises','Deleting\x20secret...','table','Error:\x20Invalid\x20JSON\x20in\x20--params','workflows','\x1b[1A\x1b[2K','context','Output\x20directory:\x20','renderSingleTimeline','Analyzing\x20project...','workflow:attempt','message','round','sourceProjectName','Error:\x20KEY=VALUE\x20is\x20required','projects','workflow:logs','No\x20sessions\x20found\x20in\x20project:\x20','join','No\x20attempts\x20found'];a42_0x59b0=function(){return _0x3cdf4a;};return a42_0x59b0();}
1
+ const a42_0x7b4056=a42_0x21b4;(function(_0x550e66,_0x1681b0){const _0x185111=a42_0x21b4,_0x26b22b=_0x550e66();while(!![]){try{const _0x1b470f=parseInt(_0x185111(0x231))/0x1*(-parseInt(_0x185111(0x246))/0x2)+parseInt(_0x185111(0x147))/0x3+-parseInt(_0x185111(0x12d))/0x4+parseInt(_0x185111(0x247))/0x5+parseInt(_0x185111(0x276))/0x6*(-parseInt(_0x185111(0x1c0))/0x7)+-parseInt(_0x185111(0x171))/0x8*(-parseInt(_0x185111(0x12b))/0x9)+parseInt(_0x185111(0x196))/0xa;if(_0x1b470f===_0x1681b0)break;else _0x26b22b['push'](_0x26b22b['shift']());}catch(_0x58ce6a){_0x26b22b['push'](_0x26b22b['shift']());}}}(a42_0x40d4,0xb82e1));import a42_0x1a984c from'chalk';import{existsSync}from'fs';import a42_0x18f685 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 a42_0x335375 from'prompts';function getAttemptStatusDisplay(_0x4d35aa){const _0x2701ba=a42_0x21b4;if(!_0x4d35aa)return{'icon':'⏳','text':''};const {done:_0x35440c,success:_0x27bbf5,cancelRequested:_0x33f3a0}=_0x4d35aa;if(!_0x35440c)return _0x33f3a0?{'icon':'🛑','text':a42_0x1a984c['yellow'](_0x2701ba(0x13a))}:{'icon':'🔄','text':a42_0x1a984c[_0x2701ba(0x220)](_0x2701ba(0x22d))};if(_0x27bbf5)return{'icon':'✅','text':a42_0x1a984c['green']('success')};return{'icon':'❌','text':a42_0x1a984c[_0x2701ba(0x13b)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x7b4056(0x255)](_0x1325fd,_0x56ac7d,_0x511565=0x0){const _0x297b6d=a42_0x7b4056;return _0x1325fd[_0x511565]||_0x56ac7d[_0x297b6d(0x1d0)];}[a42_0x7b4056(0x16f)](_0xdfd931,_0x246be3,_0x387312=0x0){const _0x33d699=a42_0x7b4056,_0x5f57bc=this[_0x33d699(0x255)](_0xdfd931,_0x246be3,_0x387312);if(!_0x5f57bc)return console['error'](a42_0x1a984c[_0x33d699(0x13b)]('Error:'),_0x33d699(0x14c)),console[_0x33d699(0x138)](a42_0x1a984c[_0x33d699(0x190)](_0x33d699(0x12a))),null;return _0x5f57bc;}[a42_0x7b4056(0x22c)](_0x141b6c,_0x5dbc69){const _0x5e0faf=a42_0x7b4056;if(_0x141b6c[0x0]){const _0x5d6691=_0x141b6c[0x0][_0x5e0faf(0x1fa)]('.');if(_0x5d6691[_0x5e0faf(0x2ba)]===0x1)return{'projectName':_0x5d6691[0x0],'workflowName':undefined};else return _0x5d6691[_0x5e0faf(0x2ba)]===0x2?{'projectName':_0x5d6691[0x0],'workflowName':_0x5d6691[0x1]}:(console[_0x5e0faf(0x138)](a42_0x1a984c['red'](_0x5e0faf(0x16a)),_0x5e0faf(0x1d8)),null);}return{'projectName':_0x5dbc69[_0x5e0faf(0x1d0)],'workflowName':undefined};}['resolveProjectDir'](_0x394f42,_0x4b25a2,_0x583503=0x0){const _0x18767b=a42_0x7b4056;if(_0x394f42[_0x583503])return _0x394f42[_0x583503];if(_0x4b25a2['workflowProject']){const _0x337cdc=a42_0x18f685[_0x18767b(0x18a)](process[_0x18767b(0x162)](),'workflows',_0x4b25a2['workflowProject']);if(existsSync(a42_0x18f685[_0x18767b(0x18a)](_0x337cdc,_0x18767b(0x1cf))))return _0x337cdc;}return undefined;}async[a42_0x7b4056(0x2a0)](_0x381c5c,_0x5d21b4,_0x103b63){const _0x5ee03c=a42_0x7b4056;try{const _0xec1a70=await _0x381c5c[_0x5ee03c(0x16e)][_0x5ee03c(0x1ca)](_0x5d21b4,{'limit':0x1});if(_0xec1a70[_0x5ee03c(0x2ba)]>0x0){const _0xe0551f=_0xec1a70[0x0]['id'],_0x3f66f8=getWorkflowUrl(_0x103b63,_0xe0551f);console[_0x5ee03c(0x138)](_0x5ee03c(0x1cb)+a42_0x1a984c[_0x5ee03c(0x232)](_0x3f66f8));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x1e6);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x20f);async['execute'](_0x2cbac8){const _0x3bf236=a42_0x7b4056,{options:_0x3506b9,args:_0x49ba90,tdx:_0x41f8bd}=_0x2cbac8,_0x257206=_0x49ba90[0x0],_0xd71723=_0x3506b9[_0x3bf236(0x1b2)];if(_0xd71723)return saveSessionContext({'workflow_project':undefined},_0x3506b9[_0x3bf236(0x27a)]),console[_0x3bf236(0x280)](a42_0x1a984c['green'](_0x3bf236(0x2ae))),0x0;if(!_0x257206)return console[_0x3bf236(0x138)](a42_0x1a984c[_0x3bf236(0x13b)](_0x3bf236(0x16a)),'Project\x20name\x20is\x20required'),console[_0x3bf236(0x138)](a42_0x1a984c[_0x3bf236(0x190)](_0x3bf236(0x258))),console[_0x3bf236(0x138)](a42_0x1a984c['dim'](_0x3bf236(0x187))),0x1;const _0xccdaf4=await withSpinner(_0x3bf236(0x1f4)+_0x257206+_0x3bf236(0x1c6),()=>_0x41f8bd['workflow'][_0x3bf236(0x192)](_0x257206),{'verbose':_0x3506b9[_0x3bf236(0x1e4)]}),{name:_0x5d437d}=_0xccdaf4[_0x3bf236(0x1b5)];return saveSessionContext({'workflow_project':_0x5d437d},_0x3506b9[_0x3bf236(0x27a)]),console['log'](a42_0x1a984c[_0x3bf236(0x24c)](_0x3bf236(0x1d4)+a42_0x1a984c['cyan'](_0x5d437d))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a42_0x7b4056(0x265)]='workflow:projects';[a42_0x7b4056(0x172)]='List\x20all\x20workflow\x20projects';async[a42_0x7b4056(0x20a)](_0x53e7d0){const _0x3683fd=a42_0x7b4056,{options:_0x2f0dce,args:_0x3e677c,tdx:_0x299b84}=_0x53e7d0,_0x22789c=_0x3e677c[0x0];_0x2f0dce[_0x3683fd(0x1e4)]&&_0x22789c&&console['error'](_0x3683fd(0x26b)+_0x22789c);const _0x5cc66b=await withSpinner(_0x3683fd(0x1d5),()=>_0x299b84['workflow'][_0x3683fd(0x16c)](_0x22789c,{'limit':_0x2f0dce[_0x3683fd(0x2ad)]}),{'verbose':_0x2f0dce[_0x3683fd(0x1e4)]});let _0xf49d7a=_0x5cc66b['data'];_0xf49d7a['sort']((_0xdd36f5,_0x35fcaf)=>_0xdd36f5['name'][_0x3683fd(0x215)](_0x35fcaf['name']));const _0x18ec88=_0x2f0dce[_0x3683fd(0x2ad)]||0x64,_0x3c39bc=_0xf49d7a[_0x3683fd(0x2ba)]>=_0x18ec88?a42_0x1a984c[_0x3683fd(0x190)](_0x3683fd(0x140)):'';console['error'](_0x3683fd(0x20b)+_0xf49d7a[_0x3683fd(0x2ba)]+_0x3683fd(0x289)+(_0xf49d7a[_0x3683fd(0x2ba)]!==0x1?'s':'')+_0x3c39bc);if(_0x2f0dce[_0x3683fd(0x269)]===_0x3683fd(0x28f)||_0x2f0dce['format']===_0x3683fd(0x129)||_0x2f0dce[_0x3683fd(0x269)]==='table')await handleSDKOutput(_0xf49d7a,_0x2f0dce);else{if(_0xf49d7a[_0x3683fd(0x2ba)]===0x0)_0x22789c?console[_0x3683fd(0x280)](_0x3683fd(0x1a2)+_0x22789c):console['log']('No\x20workflow\x20projects\x20found');else{const _0x57e8f3=_0xf49d7a[_0x3683fd(0x176)](_0x1c8b9b=>{const _0x3d9f09=_0x3683fd,_0x49efe1=_0x1c8b9b[_0x3d9f09(0x1da)]?.['some'](_0x315f31=>_0x315f31[_0x3d9f09(0x2a6)]===_0x3d9f09(0x123)),_0x2fd6ff=_0x49efe1?a42_0x1a984c['dim'](_0x3d9f09(0x117)):'';return _0x3d9f09(0x15f)+_0x1c8b9b[_0x3d9f09(0x265)]+_0x2fd6ff;});await writeOutput(_0x57e8f3[_0x3683fd(0x18a)]('\x0a'),_0x2f0dce[_0x3683fd(0x27f)],_0x3683fd(0x135));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a42_0x7b4056(0x277);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x124);async[a42_0x7b4056(0x20a)](_0x354a18){const _0x36df91=a42_0x7b4056,{options:_0x1314f0,args:_0x1cbc77,tdx:_0x549cc4}=_0x354a18,_0x49a7b0=this[_0x36df91(0x255)](_0x1cbc77,_0x1314f0);_0x1314f0[_0x36df91(0x1e4)]&&_0x49a7b0&&console[_0x36df91(0x138)]('Project\x20filter:\x20'+_0x49a7b0);const _0x277d82=await withSpinner(_0x36df91(0x174),()=>_0x549cc4[_0x36df91(0x16e)][_0x36df91(0x1ca)](_0x49a7b0,{'limit':_0x1314f0[_0x36df91(0x2ad)]}),{'verbose':_0x1314f0['verbose']});let _0x27886a=_0x277d82[_0x36df91(0x1b5)];_0x27886a['sort']((_0x1ff7c1,_0x9032b8)=>{const _0x570554=_0x36df91,_0x19db2b=_0x1ff7c1[_0x570554(0x265)][_0x570554(0x215)](_0x9032b8[_0x570554(0x265)]);if(_0x19db2b!==0x0)return _0x19db2b;return(_0x1ff7c1['project']?.[_0x570554(0x265)]||'')[_0x570554(0x215)](_0x9032b8[_0x570554(0x244)]?.[_0x570554(0x265)]||'');});const _0x156b93=_0x1314f0[_0x36df91(0x2ad)]||0x64,_0x4afc2b=_0x27886a[_0x36df91(0x2ba)]>=_0x156b93?a42_0x1a984c[_0x36df91(0x190)](_0x36df91(0x140)):'';console['error']('✔\x20Found\x20'+_0x27886a['length']+'\x20workflow'+(_0x27886a['length']!==0x1?'s':'')+_0x4afc2b);if(_0x1314f0[_0x36df91(0x269)]===_0x36df91(0x28f)||_0x1314f0[_0x36df91(0x269)]===_0x36df91(0x129)||_0x1314f0[_0x36df91(0x269)]===_0x36df91(0x193))await handleSDKOutput(_0x27886a,_0x1314f0);else{if(_0x27886a[_0x36df91(0x2ba)]===0x0)_0x49a7b0?console[_0x36df91(0x280)](_0x36df91(0x133)+_0x49a7b0):console[_0x36df91(0x280)](_0x36df91(0x1e5));else{const _0x58718e=_0x1314f0[_0x36df91(0x1fe)],_0x179994=_0x27886a[_0x36df91(0x176)](_0x542ed3=>{const _0x262ffd=_0x36df91,_0x3aee40=a42_0x1a984c['dim']('#'+_0x542ed3['id']),_0x36fcd3=hyperlink(_0x3aee40,getWorkflowUrl(_0x58718e,_0x542ed3['id'])),_0x10f893=_0x542ed3[_0x262ffd(0x244)]?.['name']?a42_0x1a984c[_0x262ffd(0x190)]('\x20('+_0x542ed3['project'][_0x262ffd(0x265)]+')'):'';return _0x262ffd(0x248)+_0x36fcd3+'\x20'+_0x542ed3['name']+_0x10f893;});await writeOutput(_0x179994[_0x36df91(0x18a)]('\x0a'),_0x1314f0[_0x36df91(0x27f)],_0x36df91(0x135));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x126);['description']='List\x20workflow\x20execution\x20sessions';async[a42_0x7b4056(0x20a)](_0x55cb64){const _0x14d675=a42_0x7b4056,{options:_0x3409d7,args:_0x52f8ad,tdx:_0x10659b}=_0x55cb64,_0x46dce5=this['parseProjectWorkflowPattern'](_0x52f8ad,_0x3409d7);if(!_0x46dce5)return 0x1;const {projectName:_0x1cf4f6,workflowName:_0x446336}=_0x46dce5;if(_0x3409d7[_0x14d675(0x1e4)]){if(_0x1cf4f6&&_0x446336)console[_0x14d675(0x138)]('Filter:\x20'+_0x1cf4f6+'.'+_0x446336);else _0x1cf4f6&&console[_0x14d675(0x138)](_0x14d675(0x1aa)+_0x1cf4f6);const _0x4064a6=_0x3409d7[_0x14d675(0x139)];_0x4064a6&&console[_0x14d675(0x138)](_0x14d675(0x267)+_0x4064a6);}let _0x18b21f=0x28;if(process[_0x14d675(0x18e)][_0x14d675(0x29b)]&&!_0x3409d7[_0x14d675(0x27f)]&&!_0x3409d7['format']){const _0x5f1834=process['stdout'][_0x14d675(0x19f)]||0x28;_0x18b21f=Math[_0x14d675(0x122)](0x14,Math['floor'](_0x5f1834*0x2/0x3));}const _0x17f482=_0x3409d7[_0x14d675(0x2ad)]||_0x18b21f,_0x3f4cda=await withSpinner(_0x14d675(0x1b4),()=>_0x10659b[_0x14d675(0x16e)][_0x14d675(0x14b)]({'projectName':_0x1cf4f6,'workflowName':_0x446336,'status':_0x3409d7[_0x14d675(0x139)],'fromTime':_0x3409d7[_0x14d675(0x143)],'toTime':_0x3409d7['to'],'limit':_0x17f482}),{'verbose':_0x3409d7['verbose']}),_0x46c46f=_0x3f4cda[_0x14d675(0x1b5)];_0x46c46f[_0x14d675(0x1c9)]((_0x1be2de,_0xb301e5)=>{const _0x3138f3=_0x14d675,_0x35c66a=_0x1be2de[_0x3138f3(0x291)]||'',_0x5578b5=_0xb301e5[_0x3138f3(0x291)]||'';return _0x5578b5[_0x3138f3(0x215)](_0x35c66a);});_0x46c46f[_0x14d675(0x2ba)]>=_0x17f482?console[_0x14d675(0x138)](_0x14d675(0x2bb)+_0x46c46f['length']+_0x14d675(0x2ac)+a42_0x1a984c[_0x14d675(0x190)](_0x14d675(0x1ef))):console[_0x14d675(0x138)](_0x14d675(0x20b)+_0x46c46f[_0x14d675(0x2ba)]+'\x20session'+(_0x46c46f[_0x14d675(0x2ba)]!==0x1?'s':''));if(_0x3409d7[_0x14d675(0x269)]==='json'||_0x3409d7[_0x14d675(0x269)]==='jsonl'||_0x3409d7['format']===_0x14d675(0x193))await handleSDKOutput(_0x46c46f,_0x3409d7);else{if(!process[_0x14d675(0x18e)]['isTTY']||_0x3409d7['output']){if(_0x46c46f[_0x14d675(0x2ba)]===0x0){if(_0x1cf4f6&&_0x446336)console[_0x14d675(0x280)](_0x14d675(0x262)+_0x1cf4f6+'.'+_0x446336);else _0x1cf4f6?console[_0x14d675(0x280)](_0x14d675(0x167)+_0x1cf4f6):console[_0x14d675(0x280)]('No\x20sessions\x20found');}else{const _0x5ad3ec=_0x3409d7['site'],_0x21976b=this[_0x14d675(0x18f)](_0x46c46f,_0x5ad3ec);_0x3409d7[_0x14d675(0x27f)]?await writeOutput(_0x21976b,_0x3409d7[_0x14d675(0x27f)],_0x14d675(0x135)):console[_0x14d675(0x280)](_0x21976b);}!_0x1cf4f6&&(console[_0x14d675(0x138)](''),console[_0x14d675(0x138)](a42_0x1a984c[_0x14d675(0x190)](_0x14d675(0x25f))),console['error'](a42_0x1a984c[_0x14d675(0x190)](_0x14d675(0x1c8))+'or'+a42_0x1a984c['dim'](_0x14d675(0x2b2))));}else{if(_0x46c46f[_0x14d675(0x2ba)]===0x0){if(_0x1cf4f6&&_0x446336)console[_0x14d675(0x280)](_0x14d675(0x262)+_0x1cf4f6+'.'+_0x446336);else _0x1cf4f6?console[_0x14d675(0x280)](_0x14d675(0x167)+_0x1cf4f6):console[_0x14d675(0x280)](_0x14d675(0x152));}else await this[_0x14d675(0x1db)](_0x46c46f,_0x55cb64,_0x1cf4f6);}}return 0x0;}['renderSessionsTimeline'](_0x4ce3ca,_0x7abeb2){const _0x1a9bbd=a42_0x7b4056,_0x5db5a3=[],_0x2b5c97=new Map();let _0x309330=Infinity,_0x12219e=-Infinity;for(const _0x146b91 of _0x4ce3ca){if(_0x146b91[_0x1a9bbd(0x209)]?.[_0x1a9bbd(0x1ff)]){const _0x27fb9f=new Date(_0x146b91[_0x1a9bbd(0x209)][_0x1a9bbd(0x1ff)])[_0x1a9bbd(0x284)](),_0x17211d=_0x146b91[_0x1a9bbd(0x209)]['finishedAt']?new Date(_0x146b91[_0x1a9bbd(0x209)][_0x1a9bbd(0x299)])['getTime']():Date['now'](),_0x7058ee=_0x146b91[_0x1a9bbd(0x244)]?.[_0x1a9bbd(0x265)]||_0x1a9bbd(0x19e);!_0x2b5c97['has'](_0x7058ee)&&_0x2b5c97[_0x1a9bbd(0x27d)](_0x7058ee,[]),_0x2b5c97[_0x1a9bbd(0x153)](_0x7058ee)[_0x1a9bbd(0x1b3)]({'session':_0x146b91,'startTime':_0x27fb9f,'endTime':_0x17211d,'duration':_0x17211d-_0x27fb9f}),_0x309330=Math[_0x1a9bbd(0x254)](_0x309330,_0x27fb9f),_0x12219e=Math[_0x1a9bbd(0x122)](_0x12219e,_0x17211d);}}if(_0x2b5c97[_0x1a9bbd(0x26a)]===0x0)return _0x1a9bbd(0x14d);const _0x3bdf26=process[_0x1a9bbd(0x18e)][_0x1a9bbd(0x1c4)]||0x78,_0x895dd9=0x1e,_0xa9cdc0=0x32,_0x449b47=0x4,_0x2fbef3=Math[_0x1a9bbd(0x254)](_0xa9cdc0,Math['max'](_0x895dd9,Math['floor'](_0x3bdf26*0.3))),_0x1f2b47=_0x3bdf26-_0x2fbef3-TIMELINE_CONFIG[_0x1a9bbd(0x1ad)]-0x3-_0x449b47,_0xe3742f=_0x12219e-_0x309330,_0x9aba56=_0xe3742f/_0x2fbef3,_0x5f3002=renderTimeAxis({'startTime':_0x309330,'endTime':_0x12219e,'durationMs':_0xe3742f,'msPerChar':_0x9aba56},_0x2fbef3),_0x23ffc7=[];for(const _0x43d423 of _0x2b5c97[_0x1a9bbd(0x1e3)]()){_0x23ffc7[_0x1a9bbd(0x1b3)](..._0x43d423);}_0x23ffc7[_0x1a9bbd(0x1c9)]((_0x11b60f,_0x26dd55)=>_0x26dd55[_0x1a9bbd(0x2af)]-_0x11b60f['startTime']);const _0x5cb3b9=new Date(_0x309330),_0x12d188=formatDate(_0x5cb3b9),_0x251ec5=_0x449b47+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x1a9bbd(0x194)]+_0x1f2b47,_0x2dd3a0='\x20'['repeat'](_0x251ec5-_0x12d188['length']),_0x4d879b=_0x2dd3a0+a42_0x1a984c[_0x1a9bbd(0x190)](_0x12d188)+'\x20'+_0x5f3002;_0x5db5a3[_0x1a9bbd(0x1b3)](_0x4d879b);const _0x4e0092=0x16;let _0x1009df=0x0;for(const _0x26fd2f of _0x23ffc7){const _0x1bf05d=_0x26fd2f[_0x1a9bbd(0x27a)][_0x1a9bbd(0x244)]?.[_0x1a9bbd(0x265)]||'?',_0x28347c=Math[_0x1a9bbd(0x254)](stringWidth(_0x1bf05d),_0x4e0092);_0x1009df=Math[_0x1a9bbd(0x122)](_0x1009df,_0x28347c);}for(const _0x1b7013 of _0x23ffc7){const {session:_0x423575,startTime:_0x319a1b,endTime:_0x4687d0,duration:_0x557fc1}=_0x1b7013,_0x1c539c=_0x423575['project']?.['id'],_0x50f045=_0x423575['id'],_0x511b04=_0x423575['project']?.['name']||'?',_0xe63f74=_0x423575[_0x1a9bbd(0x16e)]?.['name']||'?';let _0x1a96b6,_0x4c68ab;if(_0x423575['lastAttempt']){const _0x1b1aba=_0x423575[_0x1a9bbd(0x209)];!_0x1b1aba[_0x1a9bbd(0x281)]?(_0x1a96b6=_0x1b1aba[_0x1a9bbd(0x11f)]?'🛑':'🔄',_0x4c68ab=_0x1b1aba[_0x1a9bbd(0x11f)]?a42_0x1a984c['yellow']:a42_0x1a984c[_0x1a9bbd(0x220)]):(_0x1a96b6=_0x1b1aba[_0x1a9bbd(0x1ee)]?'✅':'❌',_0x4c68ab=_0x1b1aba[_0x1a9bbd(0x1ee)]?a42_0x1a984c[_0x1a9bbd(0x24c)]:a42_0x1a984c[_0x1a9bbd(0x13b)]);}else _0x1a96b6='⏳',_0x4c68ab=a42_0x1a984c[_0x1a9bbd(0x190)];const _0x51415b='#'+_0x50f045,_0x520dc2=_0x1c539c?hyperlink(_0x51415b,getWorkflowSessionUrl(_0x7abeb2,_0x1c539c,_0x50f045)):_0x51415b;let _0x5784f2=_0x511b04;stringWidth(_0x511b04)>_0x4e0092&&(_0x5784f2=_0x511b04[_0x1a9bbd(0x148)](0x0,_0x4e0092-0x1)+'…');const _0x1142fb=a42_0x1a984c[_0x1a9bbd(0x190)](_0x5784f2),_0x66f427=stringWidth(_0x5784f2),_0x3fab0a='\x20'[_0x1a9bbd(0x156)](_0x1009df-stringWidth(_0x5784f2)+0x2),_0x5e5fcf='('+formatElapsed(_0x557fc1)+')',_0x553122=stringWidth(_0x5e5fcf),_0xa79ab1=stringWidth(_0x51415b),_0x3449fd=_0xa79ab1+0x1+_0x66f427+_0x3fab0a[_0x1a9bbd(0x2ba)],_0x460b42=_0x1f2b47-_0x3449fd-_0x553122-0x1-0x8;let _0x11cf28=_0xe63f74;stringWidth(_0x11cf28)>_0x460b42&&(_0x11cf28=_0x11cf28['slice'](0x0,_0x460b42-0x1)+'…');const _0x43ead5=_0x520dc2+'\x20'+_0x1142fb+_0x3fab0a+_0x11cf28,_0x368456=stringWidth(_0x43ead5),_0x443df2=_0x1f2b47-_0x368456-_0x553122,_0x3c790c=_0x43ead5+'\x20'['repeat'](Math[_0x1a9bbd(0x122)](0x1,_0x443df2))+a42_0x1a984c[_0x1a9bbd(0x190)](_0x5e5fcf),_0x56ccb6=Math[_0x1a9bbd(0x178)]((_0x319a1b-_0x309330)/_0x9aba56),_0x69a46a=Math[_0x1a9bbd(0x178)]((_0x4687d0-_0x309330)/_0x9aba56),_0x481521=Math['max'](_0x56ccb6+0x1,_0x69a46a),_0x2c90fa=new Array(_0x2fbef3)[_0x1a9bbd(0x1d1)]('\x20');for(let _0x40fcb1=_0x56ccb6;_0x40fcb1<Math[_0x1a9bbd(0x254)](_0x481521,_0x2fbef3);_0x40fcb1++){_0x2c90fa[_0x40fcb1]='─';}const _0x118bdb=_0x2c90fa[_0x1a9bbd(0x176)](_0xec9a36=>_0xec9a36==='\x20'?'\x20':_0x4c68ab(_0xec9a36))[_0x1a9bbd(0x18a)]('');_0x5db5a3[_0x1a9bbd(0x1b3)](_0x1a96b6+'\x20'+_0x3c790c+'│'+_0x118bdb+'│');}return _0x5db5a3[_0x1a9bbd(0x18a)]('\x0a');}async[a42_0x7b4056(0x1db)](_0x52ca67,_0x4adbc1,_0x520879){const _0x45b98e=a42_0x7b4056,{options:_0x110fe5,tdx:_0x4f3d43}=_0x4adbc1,_0x425334=_0x110fe5['site'],{timelineRows:_0x51ebdc,timeAxisHeader:_0x538d0a}=this[_0x45b98e(0x16b)](_0x52ca67,_0x425334),_0x4d61f6=_0x51ebdc['filter'](_0x93e353=>_0x93e353[_0x45b98e(0x266)]);if(_0x4d61f6[_0x45b98e(0x2ba)]===0x0){const _0x187557=this[_0x45b98e(0x18f)](_0x52ca67,_0x425334);console[_0x45b98e(0x280)](_0x187557);!_0x520879&&(console[_0x45b98e(0x138)](''),console[_0x45b98e(0x138)](a42_0x1a984c[_0x45b98e(0x190)](_0x45b98e(0x25f))),console['error'](a42_0x1a984c[_0x45b98e(0x190)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x1a984c[_0x45b98e(0x190)](_0x45b98e(0x2b2))));return;}_0x538d0a&&console['log'](_0x538d0a);const _0x52fcb8=_0x51ebdc[_0x45b98e(0x159)](_0x351c92=>_0x351c92['attemptId'])[_0x45b98e(0x176)](_0x5c2213=>({'title':_0x5c2213[_0x45b98e(0x1cd)],'value':_0x5c2213[_0x45b98e(0x266)]})),_0x130479=process[_0x45b98e(0x18e)]['rows']||0x3c,_0x355a1a=Math[_0x45b98e(0x122)](0x28,Math[_0x45b98e(0x178)](_0x130479*0x2/0x3)),_0x3cc122=await a42_0x335375({'type':_0x45b98e(0x1ce),'name':_0x45b98e(0x266),'message':_0x45b98e(0x233),'choices':_0x52fcb8,'initial':-0x1,'limit':_0x355a1a,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x125040,_0x1c5598)=>{const _0x12165e=_0x45b98e;if(!_0x125040)return Promise['resolve'](_0x1c5598);const _0x33f2b9=_0x1c5598[_0x12165e(0x159)](_0x3d18e8=>{const _0x32366a=_0x12165e,_0x4257e0=_0x3d18e8;return _0x4257e0[_0x32366a(0x1b8)]['toLowerCase']()[_0x32366a(0x1a6)](_0x125040[_0x32366a(0x1a0)]());});return Promise['resolve'](_0x33f2b9);}}),_0x3042a8=()=>{const _0x4eb069=_0x45b98e;process[_0x4eb069(0x18e)]['write'](_0x4eb069(0x1b7)),process[_0x4eb069(0x18e)]['write'](_0x4eb069(0x1b7)),process[_0x4eb069(0x18e)]['write'](_0x4eb069(0x1b7));},_0x28b89d=_0x3cc122&&_0x3cc122[_0x45b98e(0x266)]&&_0x3cc122[_0x45b98e(0x266)]!==null&&_0x3cc122[_0x45b98e(0x266)][_0x45b98e(0x134)]()!=='';if(!_0x28b89d){_0x3042a8(),console[_0x45b98e(0x280)](a42_0x1a984c['dim']('Cancelled'));return;}_0x3042a8();const _0x254000=_0x52ca67['find'](_0xf544bb=>_0xf544bb[_0x45b98e(0x209)]?.['id']===_0x3cc122[_0x45b98e(0x266)]);if(_0x254000){const _0x34a6f2=_0x254000[_0x45b98e(0x244)]?.[_0x45b98e(0x265)]||'?',_0x2fe8bd=_0x254000[_0x45b98e(0x16e)]?.[_0x45b98e(0x265)]||'?';console[_0x45b98e(0x280)](_0x45b98e(0x2a3)+a42_0x1a984c[_0x45b98e(0x190)](_0x34a6f2)+_0x45b98e(0x29a)+a42_0x1a984c[_0x45b98e(0x190)](_0x2fe8bd));}const _0x5dfc74=new WorkflowTimelineCommand();await _0x5dfc74[_0x45b98e(0x20a)]({'args':[],'options':{..._0x110fe5,'attemptId':_0x3cc122['attemptId']},'tdx':_0x4f3d43});}[a42_0x7b4056(0x16b)](_0x116504,_0x3f2ab3){const _0x2717a8=a42_0x7b4056,_0x4a1bc8=new Map();for(const _0x2bbe80 of _0x116504){_0x2bbe80['id']&&_0x2bbe80['lastAttempt']?.['id']&&_0x4a1bc8['set'](_0x2bbe80['id'],_0x2bbe80[_0x2717a8(0x209)]['id']);}const _0x474bc9=[];let _0x37e56d='';const _0x50bb27=this[_0x2717a8(0x18f)](_0x116504,_0x3f2ab3),_0x366f60=_0x50bb27[_0x2717a8(0x1fa)]('\x0a');for(const _0x44ca2f of _0x366f60){if(_0x44ca2f[_0x2717a8(0x1c2)](_0x2717a8(0x1af))||_0x44ca2f[_0x2717a8(0x12e)](/^\s+\d{4}-\d{2}-\d{2}/))_0x37e56d=_0x44ca2f;else{if(_0x44ca2f[_0x2717a8(0x12e)](/^[✅❌🔄🛑⏳]/)){const _0x47241e=_0x44ca2f['match'](/#(\d+)/),_0x7dc400=_0x47241e?_0x47241e[0x1]:null,_0x5d12aa=_0x7dc400?_0x4a1bc8['get'](_0x7dc400)||null:null,_0xfd303=_0x116504[_0x2717a8(0x239)](_0x381634=>_0x381634['id']===_0x7dc400),_0x36357e=_0xfd303?.['project']?.['name']||'';_0x474bc9[_0x2717a8(0x1b3)]({'displayLine':_0x44ca2f,'attemptId':_0x5d12aa,'projectName':_0x36357e});}}}return{'timelineRows':_0x474bc9,'timeAxisHeader':_0x37e56d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x278);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x25a);async[a42_0x7b4056(0x20a)](_0xeb866d){const _0x50e390=a42_0x7b4056,{options:_0x3974ed,args:_0x221c9d,tdx:_0xc0a888}=_0xeb866d,_0x390325=this['parseProjectWorkflowPattern'](_0x221c9d,_0x3974ed);if(!_0x390325)return 0x1;const {projectName:_0x519128,workflowName:_0x37f0e5}=_0x390325,_0x5d2080=_0x3974ed[_0x50e390(0x1be)];if(_0x3974ed['verbose']){if(_0x519128&&_0x37f0e5)console[_0x50e390(0x138)](_0x50e390(0x12c)+_0x519128+'.'+_0x37f0e5);else _0x519128&&console['error'](_0x50e390(0x1aa)+_0x519128);_0x5d2080&&console[_0x50e390(0x138)]('Include\x20retried:\x20yes');}const _0x4eb8f4=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0xc0a888[_0x50e390(0x16e)][_0x50e390(0x27c)]({'projectName':_0x519128,'workflowName':_0x37f0e5,'includeRetried':_0x5d2080,'limit':_0x3974ed[_0x50e390(0x2ad)]}),{'verbose':_0x3974ed[_0x50e390(0x1e4)]}),_0x4b6e8c=_0x4eb8f4['data'],_0x480175=_0x3974ed[_0x50e390(0x2ad)]||0x64,_0x5c12fb=_0x4b6e8c['length']>=_0x480175?a42_0x1a984c['dim'](_0x50e390(0x140)):'';console[_0x50e390(0x138)](_0x50e390(0x20b)+_0x4b6e8c[_0x50e390(0x2ba)]+_0x50e390(0x229)+(_0x4b6e8c[_0x50e390(0x2ba)]!==0x1?'s':'')+_0x5c12fb);if(_0x3974ed[_0x50e390(0x269)]==='json'||_0x3974ed[_0x50e390(0x269)]===_0x50e390(0x129)||_0x3974ed[_0x50e390(0x269)]===_0x50e390(0x193))await handleSDKOutput(_0x4b6e8c,_0x3974ed);else{if(_0x4b6e8c[_0x50e390(0x2ba)]===0x0){if(_0x519128&&_0x37f0e5)console['log'](_0x50e390(0x2b9)+_0x519128+'.'+_0x37f0e5);else _0x519128?console['log'](_0x50e390(0x195)+_0x519128):console['log']('No\x20attempts\x20found');}else{const _0x10d247=_0x3974ed[_0x50e390(0x1fe)],_0x4efd4f=_0x4b6e8c[_0x50e390(0x176)](_0x23196e=>{const _0x59f5df=_0x50e390,_0x38b0fc=a42_0x1a984c[_0x59f5df(0x190)]('#'+_0x23196e['id']),_0x42195e=_0x23196e['project']?.['id'],_0x5caee9=_0x23196e['session_id']||_0x23196e[_0x59f5df(0x296)],_0x53c6d8=_0x42195e&&_0x5caee9?hyperlink(_0x38b0fc,getWorkflowAttemptUrl(_0x10d247,_0x42195e,_0x5caee9,_0x23196e['id'])):_0x38b0fc,{icon:_0x655a04,text:_0x35b563}=getAttemptStatusDisplay(_0x23196e),_0x1cc262=(_0x23196e[_0x59f5df(0x244)]?.[_0x59f5df(0x265)]||'?')+'.'+(_0x23196e['workflow']?.['name']||'?'),_0x89b66b=_0x23196e[_0x59f5df(0x291)]?a42_0x1a984c['dim'](_0x23196e[_0x59f5df(0x291)]):'';return(_0x53c6d8+'\x20'+_0x655a04+(_0x35b563?'\x20'+_0x35b563:'')+'\x20'+_0x1cc262+'\x20'+_0x89b66b)[_0x59f5df(0x286)]();});await writeOutput(_0x4efd4f[_0x50e390(0x18a)]('\x0a'),_0x3974ed['output'],_0x50e390(0x135));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a42_0x7b4056(0x23c);['description']=a42_0x7b4056(0x1f6);async[a42_0x7b4056(0x20a)](_0x477388){const _0x471fd6=a42_0x7b4056,{options:_0x1ae394,args:_0x26d0af,tdx:_0x4ad022}=_0x477388,_0x53b7a4=_0x26d0af[0x0];if(!_0x53b7a4)return console[_0x471fd6(0x138)](_0x471fd6(0x13e)),0x1;_0x1ae394[_0x471fd6(0x1e4)]&&console['error']('Attempt\x20ID:\x20'+_0x53b7a4);const _0x555efb=await withSpinner(_0x471fd6(0x292),()=>_0x4ad022[_0x471fd6(0x16e)][_0x471fd6(0x179)](_0x53b7a4),{'verbose':_0x1ae394['verbose']}),_0x4b7042=_0x555efb[_0x471fd6(0x1b5)];let _0x5a87b5;!_0x4b7042['done']?_0x5a87b5=_0x4b7042[_0x471fd6(0x11f)]?_0x471fd6(0x13a):_0x471fd6(0x22d):_0x5a87b5=_0x4b7042[_0x471fd6(0x1ee)]?_0x471fd6(0x1ee):_0x471fd6(0x138);let _0x322717;if(_0x4b7042[_0x471fd6(0x1ff)]&&_0x4b7042['finishedAt']){const _0x1e6147=new Date(_0x4b7042[_0x471fd6(0x1ff)])[_0x471fd6(0x284)](),_0x3cfd8f=new Date(_0x4b7042[_0x471fd6(0x299)])[_0x471fd6(0x284)]();_0x322717=Math[_0x471fd6(0x1f7)]((_0x3cfd8f-_0x1e6147)/0x3e8);}const _0x4ee900={'attempt_id':_0x4b7042['id'],'status':_0x5a87b5,..._0x4b7042['index']!==undefined&&{'index':_0x4b7042[_0x471fd6(0x22a)]},..._0x4b7042[_0x471fd6(0x244)]&&{'project':_0x4b7042[_0x471fd6(0x244)][_0x471fd6(0x265)]},..._0x4b7042['workflow']&&{'workflow':_0x4b7042[_0x471fd6(0x16e)][_0x471fd6(0x265)]},..._0x4b7042[_0x471fd6(0x296)]&&{'session_id':_0x4b7042['sessionId']},..._0x4b7042['sessionTime']&&{'session_time':_0x4b7042[_0x471fd6(0x291)]},..._0x4b7042[_0x471fd6(0x28c)]&&{'retry_attempt':_0x4b7042[_0x471fd6(0x28c)]},..._0x322717!==undefined&&{'duration_sec':_0x322717},..._0x4b7042[_0x471fd6(0x1ff)]&&{'created_at':_0x4b7042[_0x471fd6(0x1ff)]},..._0x4b7042[_0x471fd6(0x299)]&&{'finished_at':_0x4b7042['finishedAt']},...Object[_0x471fd6(0x263)](_0x4b7042[_0x471fd6(0x228)])[_0x471fd6(0x2ba)]>0x0&&{'params':_0x4b7042['params']}};return await handleSingleObjectOutput(_0x4ee900,_0x1ae394),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x1f1);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x128);async[a42_0x7b4056(0x20a)](_0x17714b){const _0x3e37ec=a42_0x7b4056,{options:_0x325e33,args:_0x2f2c5c,tdx:_0x4ab929}=_0x17714b,_0x5e452d=_0x2f2c5c[0x0];if(!_0x5e452d)return console[_0x3e37ec(0x138)](_0x3e37ec(0x13e)),0x1;const _0x4277b6=_0x325e33['includeSubtasks'];_0x325e33['verbose']&&(console[_0x3e37ec(0x138)](_0x3e37ec(0x293)+_0x5e452d),_0x4277b6&&console['error']('Including\x20subtasks:\x20yes'));const _0x50928f=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4ab929['workflow'][_0x3e37ec(0x15a)](_0x5e452d,_0x4277b6||![]),{'verbose':_0x325e33['verbose']}),_0x26e654=_0x50928f[_0x3e37ec(0x1b5)];return console[_0x3e37ec(0x138)](_0x3e37ec(0x20b)+_0x26e654[_0x3e37ec(0x2ba)]+_0x3e37ec(0x130)+(_0x26e654[_0x3e37ec(0x2ba)]!==0x1?'s':'')),await handleSDKOutput(_0x26e654,_0x325e33),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a42_0x7b4056(0x197);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x189);async[a42_0x7b4056(0x20a)](_0x3b8dd2){const _0x366eaa=a42_0x7b4056,{options:_0x103c39,args:_0x2d21f5,tdx:_0x5d48e1}=_0x3b8dd2,_0x2e1235=_0x2d21f5[0x0];let _0x569cd3=_0x2d21f5[0x1];if(!_0x2e1235)return console[_0x366eaa(0x138)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x103c39[_0x366eaa(0x1e4)]&&(console[_0x366eaa(0x138)](_0x366eaa(0x293)+_0x2e1235),_0x569cd3&&console['error'](_0x366eaa(0x142)+_0x569cd3));const _0x358ca9=await withSpinner('Fetching\x20log\x20files...',()=>_0x5d48e1[_0x366eaa(0x16e)]['logFiles'](_0x2e1235,_0x569cd3),{'verbose':_0x103c39[_0x366eaa(0x1e4)]}),_0x42d575=_0x358ca9[_0x366eaa(0x1b5)];if(_0x42d575['length']===0x0)return console[_0x366eaa(0x138)](_0x366eaa(0x1c7)),0x0;if(!_0x569cd3&&(_0x103c39[_0x366eaa(0x28f)]||_0x103c39[_0x366eaa(0x269)]))return await handleSDKOutput(_0x42d575,_0x103c39),0x0;if(!_0x569cd3){const _0x11e12f=_0x42d575[_0x366eaa(0x176)](_0x43920b=>({'title':_0x43920b[_0x366eaa(0x212)]+'\x20('+formatBytes(_0x43920b[_0x366eaa(0x21b)])+')','value':_0x43920b[_0x366eaa(0x212)]})),_0x11ca4e=await a42_0x335375({'type':'select','name':_0x366eaa(0x234),'message':_0x366eaa(0x146),'choices':_0x11e12f});if(!_0x11ca4e[_0x366eaa(0x234)])return console[_0x366eaa(0x138)](_0x366eaa(0x1ac)),0x0;_0x569cd3=_0x11ca4e[_0x366eaa(0x234)];}const _0x1c552a=await withSpinner('Downloading\x20logs...',()=>_0x5d48e1['workflow']['logs'](_0x2e1235,_0x569cd3),{'verbose':_0x103c39['verbose']}),_0x568695=_0x1c552a[_0x366eaa(0x1b5)];return _0x568695?console[_0x366eaa(0x280)](_0x568695):console[_0x366eaa(0x138)](_0x366eaa(0x1b6)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x223);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x1cc);async['execute'](_0xeb9f05){const _0x3510d2=a42_0x7b4056,{options:_0x1387d8,args:_0x2ecbf1,tdx:_0x327a09}=_0xeb9f05,_0x197a95=_0x2ecbf1[0x0];if(!_0x197a95)return console[_0x3510d2(0x138)](_0x3510d2(0x13e)),0x1;const _0x37a441=_0x1387d8['reason'];_0x1387d8['verbose']&&(console[_0x3510d2(0x138)](_0x3510d2(0x293)+_0x197a95),_0x37a441&&console[_0x3510d2(0x138)](_0x3510d2(0x188)+_0x37a441));if(!_0x1387d8[_0x3510d2(0x1a1)]){const _0x8e58d=await confirmKey(_0x3510d2(0x14a)+_0x197a95+'?');if(!_0x8e58d)return console[_0x3510d2(0x138)](_0x3510d2(0x1ac)),0x0;}const _0x146c42=await withSpinner(_0x3510d2(0x204),()=>_0x327a09[_0x3510d2(0x16e)][_0x3510d2(0x150)](_0x197a95,_0x37a441),{'verbose':_0x1387d8['verbose']}),_0x5eb8dd=_0x146c42['data'];return console[_0x3510d2(0x138)]('✔\x20'+_0x5eb8dd),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x7b4056(0x214);['description']='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x2cd01d){const _0xbf89a5=a42_0x7b4056,{options:_0x1adec3,args:_0x4fc94d,tdx:_0x38f0d7}=_0x2cd01d,_0x23fde4=_0x4fc94d[0x0];if(!_0x23fde4)return console[_0xbf89a5(0x138)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error'](_0xbf89a5(0x177)),0x1;let _0x2a210a=![],_0x58e6bd=_0x23fde4;if(_0x23fde4[_0xbf89a5(0x1c2)](_0xbf89a5(0x205)))_0x2a210a=!![],_0x58e6bd=_0x23fde4['substring'](0x8);else{if(_0x23fde4[_0xbf89a5(0x1c2)](_0xbf89a5(0x141)))_0x2a210a=![],_0x58e6bd=_0x23fde4['substring'](0x8);else return console[_0xbf89a5(0x138)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0xbf89a5(0x138)](_0xbf89a5(0x177)),0x1;}const _0x38111b=_0x1adec3[_0xbf89a5(0x181)],_0x21f978=_0x1adec3[_0xbf89a5(0x29d)],_0x25b880=_0x1adec3[_0xbf89a5(0x228)],_0x2f8df1=_0x1adec3[_0xbf89a5(0x186)];_0x1adec3[_0xbf89a5(0x1e4)]&&(console['error']('Target:\x20'+(_0x2a210a?'session':_0xbf89a5(0x179))+'\x20'+_0x58e6bd),_0x38111b&&console[_0xbf89a5(0x138)]('From\x20task:\x20'+_0x38111b),_0x21f978&&console[_0xbf89a5(0x138)]('Resume\x20from:\x20'+_0x21f978),_0x25b880&&console[_0xbf89a5(0x138)]('Params:\x20'+_0x25b880),_0x2f8df1&&console['error'](_0xbf89a5(0x149)));let _0x5e1675;if(_0x25b880)try{if(_0x25b880[_0xbf89a5(0x1c2)]('@')){const _0x50ce84=await import('fs/promises'),_0x3cdfb3=_0x25b880['substring'](0x1),_0x1ffc5a=await _0x50ce84[_0xbf89a5(0x1fb)](_0x3cdfb3,_0xbf89a5(0x1c1));_0x5e1675=JSON[_0xbf89a5(0x21d)](_0x1ffc5a);}else _0x5e1675=JSON[_0xbf89a5(0x21d)](_0x25b880);}catch{return console[_0xbf89a5(0x138)](_0xbf89a5(0x1dd)),0x1;}if(!_0x1adec3[_0xbf89a5(0x1a1)]){const _0xc4b912=await confirmKey(_0xbf89a5(0x17c)+(_0x2a210a?_0xbf89a5(0x27a):_0xbf89a5(0x179))+'\x20'+_0x58e6bd+'?');if(!_0xc4b912)return console[_0xbf89a5(0x138)](_0xbf89a5(0x1ac)),0x0;}let _0x882200;_0x2a210a?_0x882200=await withSpinner('Retrying\x20session...',()=>_0x38f0d7['workflow'][_0xbf89a5(0x251)](_0x58e6bd,{'fromTask':_0x38111b,'retryParams':_0x5e1675}),{'verbose':_0x1adec3[_0xbf89a5(0x1e4)]}):_0x882200=await withSpinner('Retrying\x20attempt...',()=>_0x38f0d7[_0xbf89a5(0x16e)][_0xbf89a5(0x24b)](_0x58e6bd,{'resumeFrom':_0x21f978,'retryParams':_0x5e1675,'force':_0x2f8df1}),{'verbose':_0x1adec3['verbose']});const _0x40a014=_0x882200[_0xbf89a5(0x1b5)];return console[_0xbf89a5(0x138)](_0xbf89a5(0x2b3)),console['error'](_0xbf89a5(0x151)+_0x40a014['attemptId']),console[_0xbf89a5(0x138)]('\x20\x20Session\x20ID:\x20'+_0x40a014['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]='workflow:run';[a42_0x7b4056(0x172)]=a42_0x7b4056(0x182);async['execute'](_0x12b8dc){const _0x1b999a=a42_0x7b4056,{options:_0x2f9f9e,args:_0x24c981,tdx:_0x2d0890}=_0x12b8dc;let _0x45f34b=_0x24c981[0x0];if(!_0x45f34b){const _0x60325=this[_0x1b999a(0x255)]([],_0x2f9f9e),_0x4b2eb3=await withSpinner(_0x1b999a(0x219),()=>_0x2d0890[_0x1b999a(0x16e)][_0x1b999a(0x1ca)](_0x60325,{'limit':_0x2f9f9e[_0x1b999a(0x2ad)]}),{'verbose':_0x2f9f9e['verbose']}),_0x321ca2=_0x4b2eb3[_0x1b999a(0x1b5)];if(_0x321ca2[_0x1b999a(0x2ba)]===0x0)return console[_0x1b999a(0x138)](_0x1b999a(0x1e5)),!_0x60325&&console[_0x1b999a(0x138)](a42_0x1a984c['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x5e202b=_0x321ca2[_0x1b999a(0x176)](_0x4273a6=>({'title':_0x4273a6['project']?.['name']+'.'+_0x4273a6[_0x1b999a(0x265)],'value':_0x4273a6[_0x1b999a(0x244)]?.[_0x1b999a(0x265)]+'.'+_0x4273a6[_0x1b999a(0x265)],'description':_0x4273a6[_0x1b999a(0x207)]?_0x1b999a(0x1ea)+_0x4273a6['revision']:undefined})),_0x4d17f2=await a42_0x335375({'type':_0x1b999a(0x144),'name':_0x1b999a(0x16e),'message':_0x1b999a(0x168),'choices':_0x5e202b});if(!_0x4d17f2['workflow'])return 0x1;_0x45f34b=_0x4d17f2[_0x1b999a(0x16e)];}if(!_0x45f34b['includes']('.')){const _0x348c76=this[_0x1b999a(0x255)]([],_0x2f9f9e);if(_0x348c76)_0x45f34b=_0x348c76+'.'+_0x45f34b;else return console['error'](a42_0x1a984c[_0x1b999a(0x13b)]('Error:'),_0x1b999a(0x1fd)),console[_0x1b999a(0x138)](a42_0x1a984c[_0x1b999a(0x190)](_0x1b999a(0x12a))),0x1;}const _0x4c8546=_0x2f9f9e['param'],_0x46fe5f=_0x2f9f9e[_0x1b999a(0x291)],_0x400a42={};if(_0x4c8546&&Array[_0x1b999a(0x298)](_0x4c8546))for(const _0x39cd95 of _0x4c8546){const _0x326090=_0x39cd95['indexOf']('=');if(_0x326090===-0x1)return console['error']('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x39cd95),console['error'](_0x1b999a(0x2b1)),0x1;const _0xb637f1=_0x39cd95[_0x1b999a(0x1c5)](0x0,_0x326090),_0x59e28c=_0x39cd95['substring'](_0x326090+0x1);try{_0x400a42[_0xb637f1]=JSON[_0x1b999a(0x21d)](_0x59e28c);}catch{_0x400a42[_0xb637f1]=_0x59e28c;}}_0x2f9f9e[_0x1b999a(0x1e4)]&&(console[_0x1b999a(0x138)](_0x1b999a(0x118)+_0x45f34b),Object[_0x1b999a(0x263)](_0x400a42)[_0x1b999a(0x2ba)]>0x0&&console[_0x1b999a(0x138)](_0x1b999a(0x225)+JSON[_0x1b999a(0x125)](_0x400a42)),_0x46fe5f&&console[_0x1b999a(0x138)](_0x1b999a(0x210)+_0x46fe5f));const _0xdfcb84=await withSpinner(_0x1b999a(0x208),()=>_0x2d0890[_0x1b999a(0x16e)][_0x1b999a(0x1df)](_0x45f34b,_0x400a42,{'sessionTime':_0x46fe5f}),{'verbose':_0x2f9f9e[_0x1b999a(0x1e4)]}),_0x5e44b5=_0xdfcb84[_0x1b999a(0x1b5)];console[_0x1b999a(0x138)](_0x1b999a(0x237)),console[_0x1b999a(0x138)](_0x1b999a(0x256)+_0x5e44b5['id']),console['error'](_0x1b999a(0x241)+_0x5e44b5['sessionId']),console['error'](_0x1b999a(0x21c)+_0x5e44b5[_0x1b999a(0x244)]?.[_0x1b999a(0x265)]),console[_0x1b999a(0x138)]('\x20\x20Workflow:\x20'+_0x5e44b5[_0x1b999a(0x16e)]?.['name']);if(_0x5e44b5[_0x1b999a(0x244)]?.['id']&&_0x5e44b5['sessionId']&&_0x5e44b5['id']){const _0x14c263=_0x2f9f9e['site'],_0xa3aa99=getConsoleUrl(_0x14c263,_0x1b999a(0x180)+_0x5e44b5['project']['id']+_0x1b999a(0x19d)+_0x5e44b5[_0x1b999a(0x296)]+'/attempt/'+_0x5e44b5['id']);console[_0x1b999a(0x138)](_0x1b999a(0x1cb)+a42_0x1a984c[_0x1b999a(0x232)](_0xa3aa99));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x160);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x15d);async[a42_0x7b4056(0x20a)](_0x3cbdbb){const _0x3628da=a42_0x7b4056,{options:_0x593ada,args:_0x1bf12,tdx:_0x251df3}=_0x3cbdbb,_0x4a6fd4=_0x1bf12[0x0],_0x5a65cb=_0x1bf12[0x1]||'.';if(!_0x4a6fd4)return console[_0x3628da(0x138)](_0x3628da(0x252)),console[_0x3628da(0x138)](_0x3628da(0x175)),0x1;const _0x1aa759=_0x593ada[_0x3628da(0x207)];_0x593ada[_0x3628da(0x1e4)]&&(console[_0x3628da(0x138)](_0x3628da(0x2a3)+_0x4a6fd4),console[_0x3628da(0x138)](_0x3628da(0x21a)+_0x5a65cb),_0x1aa759&&console[_0x3628da(0x138)]('Revision:\x20'+_0x1aa759));const _0x2d681a=await withSpinner(_0x3628da(0x260)+_0x4a6fd4+_0x3628da(0x22e),()=>_0x251df3[_0x3628da(0x16e)]['download'](_0x4a6fd4,_0x5a65cb,{'revision':_0x1aa759}),{'verbose':_0x593ada['verbose']}),_0x368c42=_0x2d681a['data'];return console[_0x3628da(0x138)](_0x3628da(0x184)+_0x368c42[_0x3628da(0x157)]),console[_0x3628da(0x138)](_0x3628da(0x242)+_0x368c42['revision']),console[_0x3628da(0x138)]('\x20\x20Files\x20extracted:\x20'+_0x368c42[_0x3628da(0x15c)]),console['error'](_0x3628da(0x1f9)+_0x5a65cb+'/'+_0x368c42[_0x3628da(0x157)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x1e9);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x2b6);async[a42_0x7b4056(0x20a)](_0x4b14f6){const _0x6493ea=a42_0x7b4056,{options:_0x5cae4e,args:_0x3bd62a,tdx:_0xa273e6}=_0x4b14f6;let _0x24a14c='.',_0x250a63=_0x5cae4e['name'];if(_0x3bd62a[0x0]){const {promises:_0x403561}=await import('fs');try{const _0x457f66=await _0x403561[_0x6493ea(0x226)](_0x3bd62a[0x0]);if(_0x457f66[_0x6493ea(0x1e2)]())_0x24a14c=_0x3bd62a[0x0];else return console['error'](_0x6493ea(0x120)+_0x3bd62a[0x0]+_0x6493ea(0x145)),0x1;}catch{_0x250a63=_0x3bd62a[0x0],_0x24a14c='.';}}const _0x509b22=_0x5cae4e[_0x6493ea(0x207)],_0x2e898a=_0x5cae4e[_0x6493ea(0x11b)];_0x5cae4e[_0x6493ea(0x1e4)]&&(console[_0x6493ea(0x138)](_0x6493ea(0x1a7)+_0x24a14c),_0x250a63&&console[_0x6493ea(0x138)](_0x6493ea(0x2b7)+_0x250a63),_0x509b22&&console[_0x6493ea(0x138)](_0x6493ea(0x271)+_0x509b22),_0x2e898a&&console[_0x6493ea(0x138)](_0x6493ea(0x272)));const _0x1ae330=await withSpinner(_0x6493ea(0x2a1),()=>_0xa273e6[_0x6493ea(0x16e)][_0x6493ea(0x1b3)](_0x24a14c,{'projectName':_0x250a63,'revision':_0x509b22,'skipValidation':_0x2e898a}),{'verbose':_0x5cae4e['verbose']}),_0x20f3c6=_0x1ae330['data'];return console[_0x6493ea(0x138)](_0x6493ea(0x202)+_0x20f3c6[_0x6493ea(0x157)]),console[_0x6493ea(0x138)](_0x6493ea(0x23f)+_0x20f3c6['projectId']),console[_0x6493ea(0x138)](_0x6493ea(0x242)+_0x20f3c6[_0x6493ea(0x207)]),await this[_0x6493ea(0x2a0)](_0xa273e6,_0x20f3c6['projectName'],_0x5cae4e[_0x6493ea(0x1fe)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x253);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x2bc);async[a42_0x7b4056(0x20a)](_0x55dcd4){const _0x10abd9=a42_0x7b4056,{options:_0x27182e,args:_0x1cc95a,tdx:_0x43b081}=_0x55dcd4,_0x2228c=_0x1cc95a[0x0],_0x3b064f=_0x1cc95a[0x1];if(!_0x2228c)return console[_0x10abd9(0x138)](a42_0x1a984c[_0x10abd9(0x13b)](_0x10abd9(0x16a)),_0x10abd9(0x14c)),console[_0x10abd9(0x138)](a42_0x1a984c[_0x10abd9(0x190)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x2ea646=_0x27182e['revision'];_0x27182e[_0x10abd9(0x1e4)]&&(console['error']('Project:\x20'+_0x2228c),_0x3b064f&&console['error'](_0x10abd9(0x206)+_0x3b064f),_0x2ea646&&console[_0x10abd9(0x138)]('Revision:\x20'+_0x2ea646),_0x27182e[_0x10abd9(0x285)]&&console[_0x10abd9(0x138)](_0x10abd9(0x1bb)));const _0x45ef73=await withSpinner(_0x10abd9(0x29e)+_0x2228c+_0x10abd9(0x22e),()=>_0x43b081[_0x10abd9(0x16e)][_0x10abd9(0x23d)](_0x2228c,{'targetDir':_0x3b064f,'revision':_0x2ea646}),{'verbose':_0x27182e['verbose']}),_0xc73acd=_0x45ef73[_0x10abd9(0x1b5)];_0xc73acd[_0x10abd9(0x25b)]?console[_0x10abd9(0x138)](_0x10abd9(0x1ec)+_0xc73acd[_0x10abd9(0x157)]):console['error'](_0x10abd9(0x17a)+_0xc73acd[_0x10abd9(0x157)]);console[_0x10abd9(0x138)]('\x20\x20Revision:\x20'+_0xc73acd['revision']),console['error']('\x20\x20Target:\x20'+(a42_0x18f685[_0x10abd9(0x283)](process[_0x10abd9(0x162)](),_0xc73acd[_0x10abd9(0x1e1)])||'.')),console[_0x10abd9(0x138)](_0x10abd9(0x217)+a42_0x1a984c[_0x10abd9(0x24c)]('+'+_0xc73acd[_0x10abd9(0x268)][_0x10abd9(0x1dc)]+_0x10abd9(0x2b4))+',\x20'+(a42_0x1a984c['yellow']('~'+_0xc73acd[_0x10abd9(0x268)][_0x10abd9(0x20e)]+_0x10abd9(0x288))+',\x20')+(a42_0x1a984c[_0x10abd9(0x13b)]('-'+_0xc73acd[_0x10abd9(0x268)][_0x10abd9(0x24e)]+'\x20deleted')+',\x20')+(''+a42_0x1a984c['dim'](_0xc73acd[_0x10abd9(0x268)]['unchanged']+_0x10abd9(0x1f0))));for(const _0x519544 of _0xc73acd[_0x10abd9(0x1bf)]){_0x519544[_0x10abd9(0x27b)]===_0x10abd9(0x20e)&&_0x519544[_0x10abd9(0x173)]&&(console[_0x10abd9(0x138)]('\x0a'+a42_0x1a984c[_0x10abd9(0x232)](_0x10abd9(0x28d)+_0x519544['path'])),console[_0x10abd9(0x138)](_0x519544[_0x10abd9(0x173)]));}if(!_0xc73acd[_0x10abd9(0x183)])return saveSessionContext({'workflow_project':_0xc73acd[_0x10abd9(0x157)]},_0x27182e[_0x10abd9(0x27a)]),console[_0x10abd9(0x138)](a42_0x1a984c['green']('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x10abd9(0x138)](a42_0x1a984c['dim'](_0x10abd9(0x121)+_0xc73acd[_0x10abd9(0x157)])),0x0;if(_0x27182e['dryRun'])return console[_0x10abd9(0x138)](a42_0x1a984c[_0x10abd9(0x216)](_0x10abd9(0x131))),0x0;if(!_0x27182e['yes']){const _0x5254cb=await confirmKey(_0x10abd9(0x224));if(!_0x5254cb)return console[_0x10abd9(0x138)](_0x10abd9(0x1ac)),0x0;}await withSpinner(_0x10abd9(0x273),()=>_0x43b081['workflow'][_0x10abd9(0x11d)](_0xc73acd,{'revision':_0x2ea646}),{'verbose':_0x27182e[_0x10abd9(0x1e4)]}),saveSessionContext({'workflow_project':_0xc73acd[_0x10abd9(0x157)]},_0x27182e[_0x10abd9(0x27a)]),console[_0x10abd9(0x138)](a42_0x1a984c['green'](_0x10abd9(0x1e7)));const _0x269f17=a42_0x18f685[_0x10abd9(0x283)](process['cwd'](),_0xc73acd[_0x10abd9(0x1e1)])||'.';return console['error'](a42_0x1a984c[_0x10abd9(0x190)](_0x10abd9(0x1f9)+_0x269f17)),console[_0x10abd9(0x138)](a42_0x1a984c[_0x10abd9(0x190)](_0x10abd9(0x121)+_0xc73acd[_0x10abd9(0x157)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]='workflow:push';[a42_0x7b4056(0x172)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0x29e5ed){const _0x492d59=a42_0x7b4056,{options:_0x50eb96,args:_0x5d7f7b,tdx:_0x3e71f2}=_0x29e5ed,_0x134642=this['resolveProjectDir'](_0x5d7f7b,_0x50eb96),_0x13df39=_0x50eb96[_0x492d59(0x207)],_0xb20c57=_0x50eb96[_0x492d59(0x11b)];_0x50eb96[_0x492d59(0x1e4)]&&(_0x134642&&console[_0x492d59(0x138)]('Source\x20directory:\x20'+_0x134642),_0x13df39&&console[_0x492d59(0x138)](_0x492d59(0x271)+_0x13df39),_0x50eb96['dryRun']&&console['error'](_0x492d59(0x1bb)),_0xb20c57&&console[_0x492d59(0x138)](_0x492d59(0x272)));let _0x34fc07;try{_0x34fc07=await withSpinner(_0x492d59(0x1c3),()=>_0x3e71f2[_0x492d59(0x16e)][_0x492d59(0x222)]({'sourceDir':_0x134642,'revision':_0x13df39,'skipValidation':_0xb20c57}),{'verbose':_0x50eb96[_0x492d59(0x1e4)]});}catch(_0x5bc9e6){if(_0x5bc9e6 instanceof Error&&_0x5bc9e6[_0x492d59(0x20d)][_0x492d59(0x1a6)](_0x492d59(0x16d)))return console[_0x492d59(0x138)](a42_0x1a984c[_0x492d59(0x13b)](_0x492d59(0x16a)),_0x492d59(0x211)),_0x50eb96['workflowProject']?console[_0x492d59(0x138)](a42_0x1a984c[_0x492d59(0x190)](_0x492d59(0x23a)+_0x50eb96[_0x492d59(0x1d0)]+_0x492d59(0x294)+_0x50eb96['workflowProject']+'\x27')):console[_0x492d59(0x138)](a42_0x1a984c[_0x492d59(0x190)](_0x492d59(0x15b))),0x1;throw _0x5bc9e6;}const _0x580485=_0x34fc07[_0x492d59(0x1b5)];console['error'](_0x492d59(0x17a)+_0x580485[_0x492d59(0x157)]),console['error'](_0x492d59(0x14f)+_0x580485['sourceDir']),console[_0x492d59(0x138)]('\x20\x20Revision:\x20'+_0x580485[_0x492d59(0x207)]),console[_0x492d59(0x138)]('\x20\x20Changes:\x20'+a42_0x1a984c[_0x492d59(0x24c)]('+'+_0x580485[_0x492d59(0x268)][_0x492d59(0x1dc)]+_0x492d59(0x2b4))+',\x20'+(a42_0x1a984c[_0x492d59(0x216)]('~'+_0x580485[_0x492d59(0x268)][_0x492d59(0x20e)]+_0x492d59(0x288))+',\x20')+(a42_0x1a984c[_0x492d59(0x13b)]('-'+_0x580485[_0x492d59(0x268)][_0x492d59(0x24e)]+_0x492d59(0x28b))+',\x20')+(''+a42_0x1a984c[_0x492d59(0x190)](_0x580485[_0x492d59(0x268)]['unchanged']+_0x492d59(0x1f0))));for(const _0x5f2e6d of _0x580485[_0x492d59(0x1bf)]){_0x5f2e6d[_0x492d59(0x27b)]==='modified'&&_0x5f2e6d[_0x492d59(0x173)]&&(console['error']('\x0a'+a42_0x1a984c[_0x492d59(0x232)](_0x492d59(0x28d)+_0x5f2e6d['path'])),console['error'](_0x5f2e6d[_0x492d59(0x173)]));}if(!_0x580485[_0x492d59(0x183)])return console[_0x492d59(0x138)](a42_0x1a984c[_0x492d59(0x24c)](_0x492d59(0x1f5))),await this['showWorkflowConsoleUrl'](_0x3e71f2,_0x580485['projectName'],_0x50eb96[_0x492d59(0x1fe)]),0x0;if(_0x50eb96[_0x492d59(0x285)])return console[_0x492d59(0x138)](a42_0x1a984c[_0x492d59(0x216)](_0x492d59(0x161))),0x0;if(!_0x50eb96[_0x492d59(0x1a1)]){const _0x33d58b=await confirmKey(_0x492d59(0x28a));if(!_0x33d58b)return console[_0x492d59(0x138)](_0x492d59(0x1ac)),0x0;}const _0x53632f=await withSpinner('Pushing\x20project...',()=>_0x3e71f2[_0x492d59(0x16e)][_0x492d59(0x230)](_0x580485),{'verbose':_0x50eb96[_0x492d59(0x1e4)]}),_0x26dd6a=_0x53632f[_0x492d59(0x1b5)];return console[_0x492d59(0x138)](a42_0x1a984c['green'](_0x492d59(0x154))),console[_0x492d59(0x138)](_0x492d59(0x23f)+_0x26dd6a[_0x492d59(0x17d)]),console[_0x492d59(0x138)]('\x20\x20Revision:\x20'+_0x26dd6a[_0x492d59(0x207)]),await this['showWorkflowConsoleUrl'](_0x3e71f2,_0x26dd6a[_0x492d59(0x157)],_0x50eb96['site']),0x0;}}function a42_0x21b4(_0x4ba436,_0x58d15f){_0x4ba436=_0x4ba436-0x117;const _0x40d476=a42_0x40d4();let _0x21b4d3=_0x40d476[_0x4ba436];return _0x21b4d3;}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x12f);[a42_0x7b4056(0x172)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a42_0x7b4056(0x20a)](_0x2522b4){const _0x2c5055=a42_0x7b4056,{options:_0x5515f1,args:_0x36b7d9,tdx:_0x5ae055}=_0x2522b4,_0x2c8290=this[_0x2c5055(0x1fc)](_0x36b7d9,_0x5515f1),_0x2d7dac=_0x5515f1[_0x2c5055(0x265)],_0x1c0b70=_0x5515f1[_0x2c5055(0x207)],_0x39e396=_0x5515f1['skipValidation'];if(!_0x2c8290)return console[_0x2c5055(0x138)](a42_0x1a984c[_0x2c5055(0x13b)]('Error:'),'Source\x20directory\x20is\x20required'),console[_0x2c5055(0x138)](a42_0x1a984c[_0x2c5055(0x190)](_0x2c5055(0x275))),console[_0x2c5055(0x138)](a42_0x1a984c['dim'](_0x2c5055(0x1f2))),0x1;if(!_0x2d7dac)return console[_0x2c5055(0x138)](a42_0x1a984c[_0x2c5055(0x13b)](_0x2c5055(0x16a)),_0x2c5055(0x1f8)),console[_0x2c5055(0x138)](a42_0x1a984c[_0x2c5055(0x190)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5515f1['verbose']&&(console[_0x2c5055(0x138)]('Source\x20directory:\x20'+_0x2c8290),console['error'](_0x2c5055(0x270)+_0x2d7dac),_0x1c0b70&&console[_0x2c5055(0x138)](_0x2c5055(0x271)+_0x1c0b70),_0x5515f1[_0x2c5055(0x285)]&&console[_0x2c5055(0x138)](_0x2c5055(0x1bb)),_0x39e396&&console[_0x2c5055(0x138)](_0x2c5055(0x272)));const _0x120df7=await withSpinner('Analyzing\x20project...',()=>_0x5ae055[_0x2c5055(0x16e)]['prepareCloneProject'](_0x2c8290,_0x2d7dac,{'revision':_0x1c0b70,'skipValidation':_0x39e396}),{'verbose':_0x5515f1[_0x2c5055(0x1e4)]}),_0x5ec7f6=_0x120df7['data'];console[_0x2c5055(0x138)](_0x2c5055(0x22f)+_0x5ec7f6[_0x2c5055(0x1bc)]);_0x5ec7f6['sourceProjectName']&&console['error']('Source\x20project:\x20'+_0x5ec7f6['sourceProjectName']);console[_0x2c5055(0x138)](_0x2c5055(0x270)+_0x5ec7f6[_0x2c5055(0x25c)]),console[_0x2c5055(0x138)]('Revision:\x20'+_0x5ec7f6['revision']),console[_0x2c5055(0x138)](_0x2c5055(0x297)+_0x5ec7f6[_0x2c5055(0x185)]);_0x5ec7f6['targetExists']&&(console[_0x2c5055(0x138)](a42_0x1a984c[_0x2c5055(0x216)](_0x2c5055(0x1f3)+_0x5ec7f6['newProjectName']+_0x2c5055(0x17b)+_0x5ec7f6['existingProjectId']+')')),console[_0x2c5055(0x138)](a42_0x1a984c['yellow'](_0x2c5055(0x1e0))));if(_0x5515f1['dryRun'])return console[_0x2c5055(0x138)](a42_0x1a984c['yellow'](_0x2c5055(0x295))),0x0;if(!_0x5515f1[_0x2c5055(0x1a1)]){const _0x5e28a2=_0x5ec7f6[_0x2c5055(0x23b)]||a42_0x18f685[_0x2c5055(0x170)](_0x2c8290),_0x21b4b2=_0x5ec7f6[_0x2c5055(0x25e)]?_0x2c5055(0x26f)+_0x2d7dac+_0x2c5055(0x201):_0x2c5055(0x191)+_0x5e28a2+'\x22\x20to\x20new\x20project\x20\x22'+_0x2d7dac+'\x22?',_0x39a81c=await confirmKey(_0x21b4b2);if(!_0x39a81c)return console[_0x2c5055(0x138)](_0x2c5055(0x1ac)),0x0;}const _0x3e9c41=await withSpinner(_0x5ec7f6[_0x2c5055(0x25e)]?'Updating\x20'+_0x2d7dac+_0x2c5055(0x22e):'Cloning\x20to\x20'+_0x2d7dac+_0x2c5055(0x22e),()=>_0x5ae055['workflow']['executeCloneProject'](_0x5ec7f6),{'verbose':_0x5515f1[_0x2c5055(0x1e4)]}),_0x2d6e43=_0x3e9c41['data'];return console[_0x2c5055(0x138)](a42_0x1a984c['green'](_0x5ec7f6[_0x2c5055(0x25e)]?_0x2c5055(0x2a2):_0x2c5055(0x1d2))),console['error'](_0x2c5055(0x21c)+_0x2d6e43['newProjectName']),console[_0x2c5055(0x138)](_0x2c5055(0x23f)+_0x2d6e43[_0x2c5055(0x1ba)]),console[_0x2c5055(0x138)](_0x2c5055(0x242)+_0x2d6e43[_0x2c5055(0x207)]),await this['showWorkflowConsoleUrl'](_0x5ae055,_0x2d6e43[_0x2c5055(0x25c)],_0x5515f1[_0x2c5055(0x1fe)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x243);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x1d6);async[a42_0x7b4056(0x20a)](_0x278993){const _0x440fe1=a42_0x7b4056,{options:_0x45eaa8,args:_0x4b63aa,tdx:_0x500795}=_0x278993,_0x367e5c=_0x4b63aa[0x0];if(!_0x367e5c)return console[_0x440fe1(0x138)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x440fe1(0x138)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x45eaa8[_0x440fe1(0x1e4)]&&console[_0x440fe1(0x138)]('Project:\x20'+_0x367e5c);if(!_0x45eaa8[_0x440fe1(0x1a1)]){const _0x27d032=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x367e5c+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x27d032)return console[_0x440fe1(0x138)](_0x440fe1(0x1ac)),0x0;}const _0x2e315d=await withSpinner(_0x440fe1(0x18b)+_0x367e5c+'...',()=>_0x500795[_0x440fe1(0x16e)][_0x440fe1(0x1a4)](_0x367e5c),{'verbose':_0x45eaa8[_0x440fe1(0x1e4)]}),_0x5748bb=_0x2e315d[_0x440fe1(0x1b5)];return console[_0x440fe1(0x138)](_0x440fe1(0x2a7)+_0x5748bb['projectName']),console[_0x440fe1(0x138)](_0x440fe1(0x23f)+_0x5748bb[_0x440fe1(0x17d)]),0x0;}}function a42_0x40d4(){const _0x11f597=['\x22\x20with\x20new\x20revision?','✔\x20Pushed\x20','Key:\x20','Killing\x20attempt...','session:','Target\x20directory:\x20','revision','Starting\x20workflow\x20run...','lastAttempt','execute','✔\x20Found\x20','renderTimeline','message','modified','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Session\x20time:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','taskName','group_error','workflow:retry','localeCompare','yellow','\x20\x20Changes:\x20','\x20of\x20','Loading\x20workflows...','Output\x20directory:\x20','fileSize','\x20\x20Project:\x20','parse','icon','Failed\x20to\x20fetch\x20attempt\x20data','blue','POLL_INTERVAL_MS','preparePushProject','workflow:kill','\x0aApply\x20these\x20changes?','Parameters:\x20','stat','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','params','\x20attempt','index','\x20secret','parseProjectWorkflowPattern','running','...','Source:\x20','executePushProject','1qurpqH','cyan','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','task','getMinutes','Latest\x20session\x20has\x20no\x20attempt','✔\x20Workflow\x20run\x20started','MAX_POLL_ITERATIONS','find','Tip:\x20cd\x20to\x20workflows/','sourceProjectName','workflow:attempt','pullProject','window','\x20\x20Project\x20ID:\x20','\x20from\x20session\x20','\x20\x20Session\x20ID:\x20','\x20\x20Revision:\x20','workflow:delete','project','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','2612654didXfB','2659830aarjsl','📋\x20','durationMs','tdx\x20wf\x20attempt\x20','retryAttempt','green','No\x20workflow\x20sessions\x20found','deleted','text','state','retrySession','Error:\x20Project\x20name\x20is\x20required','workflow:pull','min','resolveProject','\x20\x20Attempt\x20ID:\x20','value','Usage:\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','List\x20workflow\x20attempts','isNewProject','newProjectName','duration','targetExists','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Downloading\x20project\x20','replace','No\x20sessions\x20found\x20for:\x20','keys','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','name','attemptId','Status:\x20','summary','format','size','Pattern:\x20','Deleting\x20secret...','Listing\x20secrets...','total','\x0aUpdate\x20existing\x20project\x20\x22','New\x20project\x20name:\x20','Revision:\x20','Validation:\x20skipped','Writing\x20files...','workflow:secrets:list','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','842598ekORJU','workflow:workflows','workflow:attempts','Total:\x20','session','type','attempts','set','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','output','log','done','toISOString','relative','getTime','dryRun','trimEnd','.\x20Expected\x20format:\x20KEY=VALUE','\x20modified','\x20project','\x0aPush\x20these\x20changes?','\x20deleted','retryAttemptName','---\x20','white','json','\x20-\x20','sessionTime','Getting\x20attempt\x20details...','Attempt\x20ID:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','sessionId','Files\x20to\x20upload:\x20','isArray','finishedAt',',\x20Workflow:\x20','isTTY','Warning:','resumeFrom','Pulling\x20project\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','showWorkflowConsoleUrl','Pushing\x20workflow\x20project...','✔\x20Project\x20updated','Project:\x20','🔄\x20','follow','key','✔\x20Deleted\x20project\x20','MAX_TASKS_DISPLAY','Loading\x20session...','\x20has\x20no\x20attempts','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20sessions\x20','limit','✔\x20Workflow\x20project\x20context\x20cleared.','startTime','now','Expected\x20format:\x20--param\x20key=value','\x20\x20tdx\x20wf\x20use\x20<project>','✔\x20Retry\x20started','\x20new','fullName','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Project\x20name:\x20','⚠\x20Showing\x20first\x20','No\x20attempts\x20found\x20for:\x20','length','✔\x20Showing\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20(system)','Workflow:\x20','MAX_LABEL_COUNT','getFullYear','skipValidation','Invalid\x20format:\x20','applyPullProject','LABEL_WIDTH_DIVISOR','cancelRequested','Error:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','max','sys','List\x20workflows','stringify','workflow:sessions','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Show\x20tasks\x20for\x20an\x20attempt','jsonl','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','129222HMvEkU','Filter:\x20','4661808IdegEF','match','workflow:clone','\x20task','\x0aDry\x20run\x20-\x20no\x20files\x20written','deleteSecret','No\x20workflows\x20found\x20in\x20project:\x20','trim','list','workflow:timeline','\x27\x20from\x20project\x20\x27','error','status','canceling','red','Using\x20attempt\x20','listSecrets','Error:\x20Attempt\x20ID\x20is\x20required','TASK_NAME_WIDTH','\x20(use\x20--limit\x20to\x20show\x20more)','attempt:','Task\x20name:\x20','from','select','\x20is\x20not\x20a\x20directory','Select\x20a\x20task\x20to\x20view\x20logs:','3682614tZcQfE','slice','Force:\x20yes','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','sessions','Project\x20name\x20is\x20required','No\x20sessions\x20with\x20timing\x20information','every','\x20\x20Source:\x20','kill','\x20\x20New\x20attempt\x20ID:\x20','No\x20sessions\x20found','get','✔\x20Push\x20complete','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','repeat','projectName','buildTimelineData','filter','tasks','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','filesExtracted','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','pending','📁\x20','workflow:download','\x0aDry\x20run\x20-\x20nothing\x20pushed','cwd','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','padStart','MIN_TIMELINE_WIDTH','updatedAt','No\x20sessions\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','\x0aPolling...\x20(','Error:','generateSessionTimelineRows','projects','No\x20workflow\x20tdx.json\x20found','workflow','requireProject','basename','584vxxMLt','description','diff','Listing\x20workflows...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','map','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','floor','attempt','✔\x20Project:\x20','\x22\x20already\x20exists\x20(ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','projectId','startedAt','\x0a✔\x20Attempt\x20complete','/app/workflows/','fromTask','Start\x20a\x20workflow\x20run','hasChanges','✔\x20Downloaded\x20','fileCount','force','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Reason:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','join','Deleting\x20project\x20','✔\x20Secret\x20\x27','unknown','stdout','renderSessionsTimeline','dim','\x0aClone\x20\x22','resolveProjectId','table','ICON_SPACING','No\x20attempts\x20found\x20in\x20project:\x20','8398410FGyAYI','workflow:logs','start','Attempt:\x20','MIN_LABEL_COUNT','workflowName','msPerChar','/sessions/','(unknown)','rows','toLowerCase','yes','No\x20projects\x20match\x20pattern:\x20','pollTimeline','delete','end','includes','Project\x20directory:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','LABEL_MIN_SPACING','Filter:\x20project=','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Cancelled','GUTTER','Error:\x20Secret\x20key\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','splice','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','clear','push','Listing\x20workflow\x20sessions...','data','No\x20log\x20content\x20found','\x1b[1A\x1b[2K','title','💡\x20Tip:\x20Use\x20','newProjectId','Dry\x20run:\x20yes','sourceDir','planned','includeRetried','changes','21HpQAnp','utf-8','startsWith','Analyzing\x20changes...','columns','substring','\x27...','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','sort','workflows','\x20\x20Console:\x20','Kill\x20a\x20running\x20attempt','displayLine','autocomplete','tdx.json','workflowProject','fill','✔\x20Clone\x20complete','getDate','✔\x20Workflow\x20project\x20set\x20to:\x20','Listing\x20workflow\x20projects...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','renderSingleTimeline','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','metadata','navigateSessionsInteractive','new','Error:\x20Invalid\x20JSON\x20in\x20--params','Setting\x20secret...','run','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','targetDir','isDirectory','values','verbose','No\x20workflows\x20found','workflow:use','✔\x20Pull\x20complete','getMonth','workflow:upload','revision:\x20','all','✔\x20New\x20project:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','success','(use\x20--limit\x20to\x20see\x20more)','\x20unchanged','workflow:tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x0a⚠\x20Project\x20\x22','Resolving\x20project\x20\x27','\x0a✔\x20No\x20changes\x20to\x20push','Show\x20specific\x20attempt\x20details','round','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20Location:\x20','split','readFile','resolveProjectDir','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','site','createdAt','Session\x20not\x20found:\x20'];a42_0x40d4=function(){return _0x11f597;};return a42_0x40d4();}export function parseKeyValue(_0x3a77cc){const _0x145b59=a42_0x7b4056,_0x3558ab=_0x3a77cc['indexOf']('=');if(_0x3558ab===-0x1)throw new Error(_0x145b59(0x11c)+_0x3a77cc+_0x145b59(0x287));const _0xcaeb38=_0x3a77cc[_0x145b59(0x1c5)](0x0,_0x3558ab),_0x4bbdda=_0x3a77cc['substring'](_0x3558ab+0x1);if(!_0xcaeb38)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xcaeb38,'value':_0x4bbdda};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]=a42_0x7b4056(0x274);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x27e);async[a42_0x7b4056(0x20a)](_0x534169){const _0x1ef1f1=a42_0x7b4056,{options:_0x514874,args:_0x824512,tdx:_0x859d97}=_0x534169,_0x55d6ed=this[_0x1ef1f1(0x16f)](_0x824512,_0x514874);if(!_0x55d6ed)return 0x1;_0x514874['verbose']&&console[_0x1ef1f1(0x138)](_0x1ef1f1(0x2a3)+_0x55d6ed);const _0x457b5d=await withSpinner(_0x1ef1f1(0x26d),()=>_0x859d97[_0x1ef1f1(0x16e)][_0x1ef1f1(0x13d)](_0x55d6ed),{'verbose':_0x514874[_0x1ef1f1(0x1e4)]}),{secrets:_0x349c6e}=_0x457b5d[_0x1ef1f1(0x1b5)];return console[_0x1ef1f1(0x138)]('✔\x20Found\x20'+_0x349c6e['length']+_0x1ef1f1(0x22b)+(_0x349c6e['length']!==0x1?'s':'')),await handleSDKOutput(_0x349c6e,_0x514874),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x7b4056(0x265)]='workflow:secrets:set';[a42_0x7b4056(0x172)]=a42_0x7b4056(0x163);async[a42_0x7b4056(0x20a)](_0x2959ac){const _0x3228fa=a42_0x7b4056,{options:_0x204894,args:_0x5a8f17,tdx:_0x23b1e0}=_0x2959ac;let _0x3bf482,_0x35bd32;if(_0x5a8f17[_0x3228fa(0x2ba)]>=0x2)_0x3bf482=_0x5a8f17[0x0],_0x35bd32=_0x5a8f17[0x1];else{if(_0x5a8f17[_0x3228fa(0x2ba)]===0x1&&_0x204894['workflowProject'])_0x3bf482=_0x204894[_0x3228fa(0x1d0)],_0x35bd32=_0x5a8f17[0x0];else return _0x5a8f17['length']===0x1?(console[_0x3228fa(0x138)](_0x3228fa(0x252)),console[_0x3228fa(0x138)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3228fa(0x138)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x3228fa(0x138)](_0x3228fa(0x127)),0x1);}let _0x27feeb,_0x4fb7e4;try{({key:_0x27feeb,value:_0x4fb7e4}=parseKeyValue(_0x35bd32));}catch(_0x24df5c){return _0x24df5c instanceof Error&&console['error'](a42_0x1a984c[_0x3228fa(0x13b)](_0x3228fa(0x16a)),_0x24df5c[_0x3228fa(0x20d)]),0x1;}_0x204894['verbose']&&(console[_0x3228fa(0x138)](_0x3228fa(0x2a3)+_0x3bf482),console[_0x3228fa(0x138)](_0x3228fa(0x203)+_0x27feeb));const _0x29b773=await withSpinner(_0x3228fa(0x1de),()=>_0x23b1e0[_0x3228fa(0x16e)]['setSecret'](_0x3bf482,_0x27feeb,_0x4fb7e4),{'verbose':_0x204894[_0x3228fa(0x1e4)]}),_0x53c39c=_0x29b773[_0x3228fa(0x1b5)];return console[_0x3228fa(0x138)](_0x3228fa(0x18c)+_0x53c39c['key']+_0x3228fa(0x155)+_0x53c39c[_0x3228fa(0x157)]+'\x27'),(_0x204894['json']||_0x204894[_0x3228fa(0x129)])&&await handleSingleObjectOutput(_0x53c39c,_0x204894),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']='workflow:secrets:delete';[a42_0x7b4056(0x172)]=a42_0x7b4056(0x1ab);async[a42_0x7b4056(0x20a)](_0x468a2a){const _0x24818e=a42_0x7b4056,{options:_0x39819c,args:_0x99ad9,tdx:_0x142d75}=_0x468a2a;let _0x355b01,_0x35df4c;if(_0x99ad9['length']>=0x2)_0x355b01=_0x99ad9[0x0],_0x35df4c=_0x99ad9[0x1];else{if(_0x99ad9['length']===0x1&&_0x39819c[_0x24818e(0x1d0)])_0x355b01=_0x39819c['workflowProject'],_0x35df4c=_0x99ad9[0x0];else return _0x99ad9[_0x24818e(0x2ba)]===0x1?(console['error'](_0x24818e(0x252)),console[_0x24818e(0x138)](_0x24818e(0x12a)),0x1):(console[_0x24818e(0x138)](_0x24818e(0x1ae)),console[_0x24818e(0x138)](_0x24818e(0x2ab)),0x1);}_0x39819c['verbose']&&(console[_0x24818e(0x138)]('Project:\x20'+_0x355b01),console[_0x24818e(0x138)](_0x24818e(0x203)+_0x35df4c));if(!_0x39819c[_0x24818e(0x1a1)]){const _0x3997e9=await confirmKey(_0x24818e(0x29f)+_0x35df4c+_0x24818e(0x137)+_0x355b01+'\x27?');if(!_0x3997e9)return console[_0x24818e(0x138)]('Cancelled'),0x0;}const _0x29cf8e=await withSpinner(_0x24818e(0x26c),()=>_0x142d75[_0x24818e(0x16e)][_0x24818e(0x132)](_0x355b01,_0x35df4c),{'verbose':_0x39819c[_0x24818e(0x1e4)]}),_0x2a80bf=_0x29cf8e[_0x24818e(0x1b5)];return console[_0x24818e(0x138)](_0x24818e(0x18c)+_0x2a80bf['key']+_0x24818e(0x227)+_0x2a80bf[_0x24818e(0x157)]+'\x27'),(_0x39819c['json']||_0x39819c[_0x24818e(0x129)])&&await handleSingleObjectOutput(_0x2a80bf,_0x39819c),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(_0x539234){const _0x267993=a42_0x7b4056,_0x3b65f=Math[_0x267993(0x178)](_0x539234/0x3e8),_0x30533a=Math['floor'](_0x3b65f/0x3c),_0x172814=Math['floor'](_0x30533a/0x3c),_0x2a9233=Math[_0x267993(0x178)](_0x172814/0x18);if(_0x2a9233>0x0){const _0x27186b=_0x172814%0x18;return _0x27186b>0x0?_0x2a9233+'d\x20'+_0x27186b+'h':_0x2a9233+'d';}else{if(_0x172814>0x0){const _0x2841a5=_0x30533a%0x3c;return _0x2841a5>0x0?_0x172814+'h\x20'+_0x2841a5+'m':_0x172814+'h';}else{if(_0x30533a>0x0){const _0x12ecf0=_0x3b65f%0x3c;return _0x12ecf0>0x0?_0x30533a+'m\x20'+_0x12ecf0+'s':_0x30533a+'m';}else return _0x3b65f+'s';}}}function formatTimestamp(_0x449aa9,_0x2335a1){const _0x5907d9=a42_0x7b4056,_0x30ae30=new Date(_0x449aa9),_0x1102ba=String(_0x30ae30['getHours']())[_0x5907d9(0x164)](0x2,'0'),_0x2e152c=String(_0x30ae30[_0x5907d9(0x235)]())['padStart'](0x2,'0'),_0x3d0271=_0x1102ba+':'+_0x2e152c,_0x1fd094=_0x30ae30[_0x5907d9(0x11a)]()===_0x2335a1[_0x5907d9(0x11a)]()&&_0x30ae30[_0x5907d9(0x1e8)]()===_0x2335a1[_0x5907d9(0x1e8)]()&&_0x30ae30[_0x5907d9(0x1d3)]()===_0x2335a1[_0x5907d9(0x1d3)]();if(_0x1fd094)return _0x3d0271;else{const _0x3c1007=String(_0x30ae30[_0x5907d9(0x1e8)]()+0x1)[_0x5907d9(0x164)](0x2,'0'),_0x17852c=String(_0x30ae30['getDate']())['padStart'](0x2,'0');return _0x3c1007+'-'+_0x17852c+'\x20'+_0x3d0271;}}function formatDate(_0x2cbbfd){const _0x1a5d15=a42_0x7b4056,_0x56aca3=_0x2cbbfd['getFullYear'](),_0x2a4271=String(_0x2cbbfd[_0x1a5d15(0x1e8)]()+0x1)['padStart'](0x2,'0'),_0x32e095=String(_0x2cbbfd[_0x1a5d15(0x1d3)]())[_0x1a5d15(0x164)](0x2,'0');return _0x56aca3+'-'+_0x2a4271+'-'+_0x32e095;}function getTaskStateIcon(_0x4ed5b5){const _0x4b1df1={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4b1df1[_0x4ed5b5]||'⚪';}function getBarChar(_0x4ee1c4){const _0x12652e=a42_0x7b4056;return _0x4ee1c4===_0x12652e(0x138)||_0x4ee1c4===_0x12652e(0x213)?'×':'─';}function getBarColor(_0x333508){const _0x320296=a42_0x7b4056,_0x16a2c5={'success':a42_0x1a984c[_0x320296(0x24c)],'error':a42_0x1a984c[_0x320296(0x13b)],'group_error':a42_0x1a984c[_0x320296(0x13b)],'running':a42_0x1a984c[_0x320296(0x220)],'blocked':a42_0x1a984c[_0x320296(0x216)],'planned':a42_0x1a984c[_0x320296(0x190)],'canceling':a42_0x1a984c['yellow']};return _0x16a2c5[_0x333508]||a42_0x1a984c[_0x320296(0x28e)];}function parseTaskName(_0x30a587){const _0x3e1b3c=a42_0x7b4056;let _0x1514b3=_0x30a587[_0x3e1b3c(0x261)](/^\++/,'');const _0x43a26a=_0x1514b3['split']('+'),_0x4191fa=_0x43a26a[_0x3e1b3c(0x2ba)]>0x1?_0x43a26a['length']-0x2:0x0,_0x92470b=_0x43a26a[_0x43a26a[_0x3e1b3c(0x2ba)]-0x1]||_0x1514b3;return{'level':_0x4191fa,'name':'+'+_0x92470b};}function truncateTaskName(_0x87a55a,_0x5796ab){const _0x4daa5a=stringWidth(_0x87a55a);if(_0x4daa5a<=_0x5796ab)return _0x87a55a;let _0x1fd141=_0x87a55a;while(stringWidth(_0x1fd141+'…')>_0x5796ab&&_0x1fd141['length']>0x0){_0x1fd141=_0x1fd141['slice'](0x0,-0x1);}return _0x1fd141+'…';}function calculateTimeScale(_0x1ebf7a,_0x2efd35){const _0x4a9bc4=a42_0x7b4056;return{'startTime':_0x1ebf7a[_0x4a9bc4(0x198)],'endTime':_0x1ebf7a[_0x4a9bc4(0x1a5)],'durationMs':_0x1ebf7a[_0x4a9bc4(0x25d)],'msPerChar':_0x1ebf7a['duration']/_0x2efd35};}function timeToPosition(_0x23d8c8,_0x26c0e8,_0x4106e2){const _0x4d36d0=a42_0x7b4056,_0x209d80=_0x23d8c8-_0x26c0e8[_0x4d36d0(0x2af)],_0x21c3fa=Math[_0x4d36d0(0x178)](_0x209d80/_0x26c0e8[_0x4d36d0(0x19c)]);return Math['max'](0x0,Math[_0x4d36d0(0x254)](_0x21c3fa,_0x4106e2));}function renderTimeAxis(_0xeffa1f,_0x3e175b){const _0x5acde8=a42_0x7b4056,_0x110c7c=Math[_0x5acde8(0x254)](TIMELINE_CONFIG[_0x5acde8(0x119)],Math[_0x5acde8(0x122)](TIMELINE_CONFIG[_0x5acde8(0x19a)],Math['floor'](_0x3e175b/TIMELINE_CONFIG[_0x5acde8(0x11e)]))),_0x3e64b0=_0xeffa1f[_0x5acde8(0x249)]/(_0x110c7c-0x1),_0x5a70b6=new Date(_0xeffa1f[_0x5acde8(0x2af)]),_0x481297=[];for(let _0x22dbbd=0x0;_0x22dbbd<_0x110c7c;_0x22dbbd++){const _0x433b25=_0xeffa1f['startTime']+_0x22dbbd*_0x3e64b0,_0x46f61e=timeToPosition(_0x433b25,_0xeffa1f,_0x3e175b),_0x33f656=formatTimestamp(_0x433b25,_0x5a70b6);_0x481297[_0x5acde8(0x1b3)]({'pos':_0x46f61e,'text':_0x33f656});}const _0xbcb9fd=new Array(_0x3e175b)[_0x5acde8(0x1d1)]('\x20');let _0x4ee399=-0x1;for(const {pos:_0x372b05,text:_0x5d09e8}of _0x481297){let _0x5abd7e=Math['max'](0x0,_0x372b05-Math[_0x5acde8(0x178)](_0x5d09e8[_0x5acde8(0x2ba)]/0x2));_0x5abd7e<=_0x4ee399+TIMELINE_CONFIG[_0x5acde8(0x1a9)]&&(_0x5abd7e=_0x4ee399+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x5abd7e+_0x5d09e8['length']>_0x3e175b&&(_0x5abd7e=_0x3e175b-_0x5d09e8[_0x5acde8(0x2ba)]);if(_0x5abd7e>=0x0&&_0x5abd7e+_0x5d09e8[_0x5acde8(0x2ba)]<=_0x3e175b&&_0x5abd7e>_0x4ee399){for(let _0x21469f=0x0;_0x21469f<_0x5d09e8[_0x5acde8(0x2ba)];_0x21469f++){_0xbcb9fd[_0x5abd7e+_0x21469f]=_0x5d09e8[_0x21469f];}_0x4ee399=_0x5abd7e+_0x5d09e8[_0x5acde8(0x2ba)]-0x1;}}return _0xbcb9fd[_0x5acde8(0x18a)]('');}function renderTaskRow(_0x1caf22,_0x535e14,_0x3a6dcc,_0x543c4f){const _0xc9a85=a42_0x7b4056,{level:_0xf0bea3,name:_0x1b8a2d}=parseTaskName(_0x1caf22[_0xc9a85(0x265)]),_0x43d6dc='\x20'[_0xc9a85(0x156)](_0xf0bea3),_0x3bb810=_0x1caf22[_0xc9a85(0x23e)]?'('+formatElapsed(_0x1caf22['window'][_0xc9a85(0x25d)])+')':'',_0x36d69a=stringWidth(_0x3bb810),_0x1f3f8d=_0xf0bea3*0x1,_0x5825b3=_0x543c4f-_0x1f3f8d-_0x36d69a-0x1,_0x2f23ea=truncateTaskName(_0x1b8a2d,_0x5825b3),_0x4d8c34=_0x43d6dc+_0x2f23ea,_0x5ccb0a=stringWidth(_0x4d8c34),_0x160e69=_0x543c4f-_0x5ccb0a-_0x36d69a,_0x1bb7c3=_0x4d8c34+'\x20'[_0xc9a85(0x156)](Math[_0xc9a85(0x122)](0x1,_0x160e69))+a42_0x1a984c[_0xc9a85(0x190)](_0x3bb810),_0x1d08c4=getTaskStateIcon(_0x1caf22[_0xc9a85(0x250)]),_0x3513d4=new Array(_0x3a6dcc)[_0xc9a85(0x1d1)]('\x20');if(_0x1caf22[_0xc9a85(0x23e)]){const _0x397058=timeToPosition(_0x1caf22['window'][_0xc9a85(0x198)],_0x535e14,_0x3a6dcc),_0x3669c5=timeToPosition(_0x1caf22[_0xc9a85(0x23e)]['end'],_0x535e14,_0x3a6dcc),_0x133b99=getBarChar(_0x1caf22[_0xc9a85(0x250)]),_0x4e9467=Math[_0xc9a85(0x122)](_0x397058+0x1,_0x3669c5);for(let _0xf2ff71=_0x397058;_0xf2ff71<Math[_0xc9a85(0x254)](_0x4e9467,_0x3a6dcc);_0xf2ff71++){_0x3513d4[_0xf2ff71]=_0x133b99;}}const _0x312fcf=getBarColor(_0x1caf22[_0xc9a85(0x250)]),_0x4358d5=_0x3513d4['map'](_0x3c3fc6=>_0x3c3fc6==='\x20'?'\x20':_0x312fcf(_0x3c3fc6))['join']('');return _0x1d08c4+'\x20'+_0x1bb7c3+'│'+_0x4358d5+'│';}function calculateStats(_0x372079){const _0x560a12=a42_0x7b4056,_0x4c14c9={'total':_0x372079['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x283939 of _0x372079){if(_0x283939['state']==='success')_0x4c14c9[_0x560a12(0x1ee)]++;else{if(_0x283939[_0x560a12(0x250)]===_0x560a12(0x138)||_0x283939[_0x560a12(0x250)]==='group_error')_0x4c14c9[_0x560a12(0x138)]++;else _0x283939[_0x560a12(0x250)]===_0x560a12(0x22d)?_0x4c14c9['running']++:_0x4c14c9[_0x560a12(0x15e)]++;}}return _0x4c14c9;}function formatStats(_0x504c0e){const _0x5cf8fb=a42_0x7b4056;return[_0x5cf8fb(0x279)+_0x504c0e[_0x5cf8fb(0x26e)],'✅\x20'+_0x504c0e[_0x5cf8fb(0x1ee)],'❌\x20'+_0x504c0e[_0x5cf8fb(0x138)],_0x5cf8fb(0x2a4)+_0x504c0e[_0x5cf8fb(0x22d)],'⏳\x20'+_0x504c0e[_0x5cf8fb(0x15e)]][_0x5cf8fb(0x18a)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a42_0x7b4056(0x136);[a42_0x7b4056(0x172)]=a42_0x7b4056(0x1d9);async['execute'](_0x9799df){const _0x1553c5=a42_0x7b4056,{options:_0x972929,args:_0x4613b6,tdx:_0x5140da}=_0x9799df;let _0x1ca582,_0x39d62a,_0x818f7c=![];if(_0x4613b6[0x0]){if(_0x4613b6[0x0][_0x1553c5(0x1a6)]('.')){const _0x21f87e=this[_0x1553c5(0x22c)](_0x4613b6,_0x972929);if(!_0x21f87e)return 0x1;_0x1ca582=_0x21f87e['projectName'],_0x39d62a=_0x21f87e[_0x1553c5(0x19b)];}else{_0x39d62a=_0x4613b6[0x0],_0x1ca582=_0x972929[_0x1553c5(0x1d0)];if(!_0x1ca582)return console[_0x1553c5(0x138)](a42_0x1a984c[_0x1553c5(0x13b)](_0x1553c5(0x16a)),_0x1553c5(0x264)),0x1;_0x818f7c=!![];}}else{const _0x2ffded=this[_0x1553c5(0x22c)](_0x4613b6,_0x972929);if(!_0x2ffded)return 0x1;_0x1ca582=_0x2ffded[_0x1553c5(0x157)],_0x39d62a=_0x2ffded[_0x1553c5(0x19b)];}if(_0x972929['verbose']){if(_0x1ca582&&_0x39d62a)console[_0x1553c5(0x138)](_0x1553c5(0x12c)+_0x1ca582+'.'+_0x39d62a);else _0x1ca582&&console[_0x1553c5(0x138)](_0x1553c5(0x1aa)+_0x1ca582);}const _0x17fdaa=_0x972929[_0x1553c5(0x266)],_0x2308fd=_0x972929['sessionId'];if(_0x17fdaa){_0x2308fd&&console['error'](a42_0x1a984c[_0x1553c5(0x216)](_0x1553c5(0x29c)),_0x1553c5(0x1ed));const _0x294813=_0x972929['follow'];return _0x294813?await this[_0x1553c5(0x1a3)](_0x9799df,_0x17fdaa):await this[_0x1553c5(0x1d7)](_0x9799df,_0x17fdaa,_0x972929),0x0;}if(_0x2308fd){const _0x1f1fbb=await withSpinner(_0x1553c5(0x2a9),()=>_0x5140da[_0x1553c5(0x16e)][_0x1553c5(0x14b)]({'projectName':_0x1ca582,'workflowName':_0x39d62a,'limit':0x64}),{'verbose':_0x972929[_0x1553c5(0x1e4)]}),_0x5cabc0=_0x1f1fbb[_0x1553c5(0x1b5)]['find'](_0x212769=>_0x212769['id']===_0x2308fd);if(!_0x5cabc0)return console[_0x1553c5(0x138)](a42_0x1a984c[_0x1553c5(0x13b)](_0x1553c5(0x16a)),_0x1553c5(0x200)+_0x2308fd),0x1;if(!_0x5cabc0[_0x1553c5(0x209)]?.['id'])return console['error'](a42_0x1a984c[_0x1553c5(0x13b)](_0x1553c5(0x16a)),'Session\x20'+_0x2308fd+_0x1553c5(0x2aa)),0x1;const _0x5669d4=_0x5cabc0[_0x1553c5(0x209)]['id'];_0x972929[_0x1553c5(0x1e4)]&&console[_0x1553c5(0x138)](_0x1553c5(0x13c)+_0x5669d4+_0x1553c5(0x240)+_0x2308fd);const _0x3505eb=_0x972929[_0x1553c5(0x2a5)];return _0x3505eb?await this[_0x1553c5(0x1a3)](_0x9799df,_0x5669d4):await this[_0x1553c5(0x1d7)](_0x9799df,_0x5669d4,_0x972929),0x0;}const _0x4967c4=await withSpinner('Loading\x20sessions...',()=>_0x5140da['workflow'][_0x1553c5(0x14b)]({'projectName':_0x1ca582,'workflowName':_0x39d62a,'limit':_0x972929[_0x1553c5(0x2ad)]||0x32}),{'verbose':_0x972929[_0x1553c5(0x1e4)]}),_0x2441f6=_0x4967c4[_0x1553c5(0x1b5)];if(_0x2441f6[_0x1553c5(0x2ba)]===0x0){if(_0x1ca582&&_0x39d62a)console[_0x1553c5(0x138)](_0x1553c5(0x262)+_0x1ca582+'.'+_0x39d62a);else _0x1ca582?console[_0x1553c5(0x138)](_0x1553c5(0x167)+_0x1ca582):(console[_0x1553c5(0x138)](_0x1553c5(0x24d)),console[_0x1553c5(0x138)](a42_0x1a984c['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2441f6['sort']((_0x28c4c8,_0x2d6451)=>{const _0x5864c8=_0x1553c5,_0x56696f=_0x28c4c8['sessionTime']||'',_0x39e931=_0x2d6451['sessionTime']||'';return _0x39e931[_0x5864c8(0x215)](_0x56696f);});if(_0x972929[_0x1553c5(0x28f)]||_0x972929['jsonl'])return await handleSDKOutput(_0x2441f6,_0x972929),0x0;let _0x1cc630;if(_0x818f7c){const _0x200682=_0x2441f6[0x0];if(!_0x200682['lastAttempt']?.['id'])return console[_0x1553c5(0x138)](_0x1553c5(0x236)),0x0;_0x1cc630=_0x200682[_0x1553c5(0x209)]['id'],_0x972929[_0x1553c5(0x1e4)]&&console['error']('Auto-selected\x20latest\x20session:\x20'+_0x200682[_0x1553c5(0x291)]);}else{const _0x46500d=_0x2441f6[_0x1553c5(0x176)](_0x14e033=>{const _0x3f0011=_0x1553c5,_0x5ca846=getAttemptStatusDisplay(_0x14e033['lastAttempt']);return{'title':_0x14e033[_0x3f0011(0x244)]?.[_0x3f0011(0x265)]+'.'+_0x14e033[_0x3f0011(0x16e)]?.[_0x3f0011(0x265)]+'\x20-\x20'+_0x14e033[_0x3f0011(0x291)]+'\x20'+_0x5ca846[_0x3f0011(0x21e)],'value':_0x14e033[_0x3f0011(0x209)]?.['id']||'','description':_0x5ca846[_0x3f0011(0x24f)]};}),_0x4b8f07=await a42_0x335375({'type':_0x1553c5(0x144),'name':_0x1553c5(0x266),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x46500d['filter'](_0x497d0f=>_0x497d0f[_0x1553c5(0x257)]!=='')});if(!_0x4b8f07['attemptId'])return 0x0;_0x1cc630=_0x4b8f07['attemptId'];}const _0x1af9fd=_0x972929[_0x1553c5(0x2a5)];return _0x1af9fd?await this[_0x1553c5(0x1a3)](_0x9799df,_0x1cc630):await this[_0x1553c5(0x1d7)](_0x9799df,_0x1cc630,_0x972929),0x0;}async[a42_0x7b4056(0x1d7)](_0x205628,_0x310fe6,_0x1e1543){const _0x4cc478=a42_0x7b4056,{tdx:_0x2e3b70}=_0x205628;let _0x544f21,_0x598d37;try{[_0x544f21,_0x598d37]=await Promise[_0x4cc478(0x1eb)]([_0x2e3b70[_0x4cc478(0x16e)][_0x4cc478(0x179)](_0x310fe6),_0x2e3b70[_0x4cc478(0x16e)][_0x4cc478(0x15a)](_0x310fe6,![])]);}catch(_0x70779c){console[_0x4cc478(0x138)](a42_0x1a984c[_0x4cc478(0x13b)](_0x4cc478(0x21f)));_0x1e1543[_0x4cc478(0x1e4)]&&console[_0x4cc478(0x138)](_0x70779c);throw _0x70779c;}if(_0x1e1543[_0x4cc478(0x28f)]||_0x1e1543['jsonl']){const _0x385c94=this[_0x4cc478(0x158)](_0x544f21,_0x598d37);await handleSDKOutput([_0x385c94],_0x1e1543);return;}const _0x11665e=_0x2e3b70['context'][_0x4cc478(0x1fe)],_0x51e352=this[_0x4cc478(0x20c)](_0x544f21,_0x598d37,_0x11665e);console[_0x4cc478(0x280)](_0x51e352);}async[a42_0x7b4056(0x1a3)](_0x3cf721,_0x536f6f){const _0x48c2bf=a42_0x7b4056,{tdx:_0x42ddc3}=_0x3cf721,_0x12ef7c=TIMELINE_CONFIG[_0x48c2bf(0x221)],_0x42d901=TIMELINE_CONFIG[_0x48c2bf(0x238)];let _0x2343bc=0x0;while(_0x2343bc<_0x42d901){process['stdout'][_0x48c2bf(0x29b)]&&process[_0x48c2bf(0x18e)]['write']('\x1bc');let _0x323181,_0x4bd506;try{[_0x323181,_0x4bd506]=await Promise[_0x48c2bf(0x1eb)]([_0x42ddc3[_0x48c2bf(0x16e)][_0x48c2bf(0x179)](_0x536f6f),_0x42ddc3[_0x48c2bf(0x16e)]['tasks'](_0x536f6f,![])]);}catch(_0xdeaefa){console['error'](a42_0x1a984c[_0x48c2bf(0x13b)](_0x48c2bf(0x1a8)));_0x2343bc>0x0&&console[_0x48c2bf(0x138)](a42_0x1a984c[_0x48c2bf(0x190)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x2343bc));throw _0xdeaefa;}const _0x3385a6=_0x42ddc3['context']['site'],_0x1fdc25=this['renderTimeline'](_0x323181,_0x4bd506,_0x3385a6);console[_0x48c2bf(0x280)](_0x1fdc25);const _0x271ee2=_0x323181['done']&&_0x4bd506[_0x48c2bf(0x14e)](_0x2698eb=>_0x2698eb[_0x48c2bf(0x250)]!==_0x48c2bf(0x22d)&&_0x2698eb[_0x48c2bf(0x250)]!==_0x48c2bf(0x1bd));if(_0x271ee2){console[_0x48c2bf(0x138)](a42_0x1a984c[_0x48c2bf(0x24c)](_0x48c2bf(0x17f)));break;}console[_0x48c2bf(0x138)](a42_0x1a984c[_0x48c2bf(0x190)](_0x48c2bf(0x169)+_0x2343bc*0x2+_0x48c2bf(0x1b1))),await new Promise(_0x16174c=>setTimeout(_0x16174c,_0x12ef7c)),_0x2343bc++;}_0x2343bc>=_0x42d901&&console[_0x48c2bf(0x138)](a42_0x1a984c[_0x48c2bf(0x216)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x7b4056(0x20c)](_0x5dc961,_0x4973b9,_0x346a06){const _0xf04cac=a42_0x7b4056,_0x4a2186=[],_0x200cb7=TIMELINE_CONFIG[_0xf04cac(0x13f)],_0x2a61d7=0x5,_0x5bbf60=process[_0xf04cac(0x18e)][_0xf04cac(0x1c4)]||0x78,_0x33dc23=_0x5bbf60-_0x200cb7-_0x2a61d7,_0x1390a3=Math[_0xf04cac(0x122)](TIMELINE_CONFIG[_0xf04cac(0x165)],Math[_0xf04cac(0x254)](_0x33dc23,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4c9be8=new Date(_0x5dc961[_0xf04cac(0x1ff)])['getTime'](),_0x21e66c=_0x5dc961['finishedAt']?new Date(_0x5dc961[_0xf04cac(0x299)])[_0xf04cac(0x284)]():Date[_0xf04cac(0x2b0)](),_0x14a4d9={'start':_0x4c9be8,'end':_0x21e66c,'duration':_0x21e66c-_0x4c9be8},_0x8d53ab=new Map(),_0x15d27e=[];for(const _0x4e4a25 of _0x4973b9){if(_0x4e4a25['startedAt']){const _0x565aec=new Date(_0x4e4a25['startedAt'])[_0xf04cac(0x284)](),_0x100323=_0x4e4a25[_0xf04cac(0x166)]?new Date(_0x4e4a25[_0xf04cac(0x166)])['getTime']():Date[_0xf04cac(0x2b0)](),_0x46d8a8={'start':_0x565aec,'end':_0x100323,'duration':_0x100323-_0x565aec};_0x8d53ab['set'](_0x4e4a25['id'],_0x46d8a8),_0x15d27e[_0xf04cac(0x1b3)]({'name':_0x4e4a25[_0xf04cac(0x2b5)],'state':_0x4e4a25[_0xf04cac(0x250)]||_0xf04cac(0x18d),'window':_0x46d8a8});}else _0x15d27e['push']({'name':_0x4e4a25['fullName'],'state':_0x4e4a25['state']||_0xf04cac(0x1bd),'window':undefined});}_0x15d27e[_0xf04cac(0x1c9)]((_0x155772,_0x2d6c73)=>{const _0x1adba0=_0xf04cac;if(!_0x155772[_0x1adba0(0x23e)])return 0x1;if(!_0x2d6c73[_0x1adba0(0x23e)])return-0x1;return _0x155772[_0x1adba0(0x23e)][_0x1adba0(0x198)]-_0x2d6c73[_0x1adba0(0x23e)]['start'];});const _0x27a198=_0x15d27e[_0xf04cac(0x2ba)],_0xde366a=_0x27a198>TIMELINE_CONFIG[_0xf04cac(0x2a8)];_0xde366a&&_0x15d27e[_0xf04cac(0x1b0)](TIMELINE_CONFIG[_0xf04cac(0x2a8)]);const _0x2d75b1=calculateTimeScale(_0x14a4d9,_0x1390a3),_0x2a0521=_0x5dc961['done']?_0x5dc961[_0xf04cac(0x1ee)]?a42_0x1a984c[_0xf04cac(0x24c)](_0xf04cac(0x1ee)):a42_0x1a984c[_0xf04cac(0x13b)](_0xf04cac(0x138)):a42_0x1a984c[_0xf04cac(0x220)](_0xf04cac(0x22d)),_0x5b435d=_0x5dc961[_0xf04cac(0x244)]?.['id'],_0x3ce20b=_0x5dc961[_0xf04cac(0x296)];let _0x49b425;if(_0x5b435d&&_0x3ce20b){const _0x323eff=getWorkflowAttemptUrl(_0x346a06,_0x5b435d,_0x3ce20b,_0x5dc961['id']);_0x49b425=hyperlink(a42_0x1a984c[_0xf04cac(0x190)](_0x5dc961['id']),_0x323eff);}else _0x49b425=a42_0x1a984c['dim'](_0x5dc961['id']);_0x4a2186[_0xf04cac(0x1b3)](_0xf04cac(0x199)+_0x49b425+_0xf04cac(0x290)+_0x2a0521+_0xf04cac(0x290)+formatElapsed(_0x14a4d9[_0xf04cac(0x25d)]));if(_0x15d27e[_0xf04cac(0x2ba)]>0x0){const _0x284c46=renderTimeAxis(_0x2d75b1,_0x1390a3),_0x532c3f=new Date(_0x14a4d9[_0xf04cac(0x198)]),_0x1f7921=formatDate(_0x532c3f),_0x4737f7=TIMELINE_CONFIG[_0xf04cac(0x259)]+TIMELINE_CONFIG[_0xf04cac(0x194)]+_0x200cb7,_0x272c2b=_0x1f7921[_0xf04cac(0x164)](_0x4737f7),_0x999534=a42_0x1a984c['dim'](_0x272c2b);_0x4a2186['push'](_0x999534+'\x20'+_0x284c46);for(const _0x2e9a30 of _0x15d27e){_0x4a2186['push'](renderTaskRow(_0x2e9a30,_0x2d75b1,_0x1390a3,_0x200cb7));}const _0x18d6a0=calculateStats(_0x15d27e);_0x4a2186[_0xf04cac(0x1b3)](formatStats(_0x18d6a0)),_0xde366a&&_0x4a2186[_0xf04cac(0x1b3)](a42_0x1a984c[_0xf04cac(0x216)](_0xf04cac(0x2b8)+TIMELINE_CONFIG[_0xf04cac(0x2a8)]+_0xf04cac(0x218)+_0x27a198+'\x20tasks')),_0x4a2186[_0xf04cac(0x1b3)](''),_0x4a2186[_0xf04cac(0x1b3)](a42_0x1a984c['dim'](_0xf04cac(0x1b9))+(_0xf04cac(0x24a)+_0x5dc961['id']+'\x20logs')+a42_0x1a984c[_0xf04cac(0x190)]('\x20to\x20see\x20detailed\x20logs'));}else _0x4a2186[_0xf04cac(0x1b3)](_0xf04cac(0x245));return _0x4a2186['join']('\x0a');}[a42_0x7b4056(0x158)](_0x18f57c,_0x40cb80){const _0x440c18=a42_0x7b4056,_0x2f826e=new Date(_0x18f57c[_0x440c18(0x1ff)])[_0x440c18(0x284)](),_0x376f1e=_0x18f57c['finishedAt']?new Date(_0x18f57c[_0x440c18(0x299)])[_0x440c18(0x284)]():Date[_0x440c18(0x2b0)](),_0x48d598=_0x376f1e-_0x2f826e,_0x12d404=[];for(const _0x166fee of _0x40cb80){if(_0x166fee[_0x440c18(0x17e)]){const _0xb3ea56=new Date(_0x166fee[_0x440c18(0x17e)])[_0x440c18(0x284)](),_0x2e9526=_0x166fee[_0x440c18(0x166)]?new Date(_0x166fee['updatedAt'])[_0x440c18(0x284)]():Date[_0x440c18(0x2b0)]();_0x12d404[_0x440c18(0x1b3)]({'name':_0x166fee[_0x440c18(0x2b5)],'state':_0x166fee[_0x440c18(0x250)]||_0x440c18(0x18d),'window':{'start':_0xb3ea56,'end':_0x2e9526,'duration':_0x2e9526-_0xb3ea56}});}else _0x12d404[_0x440c18(0x1b3)]({'name':_0x166fee[_0x440c18(0x2b5)],'state':_0x166fee[_0x440c18(0x250)]||_0x440c18(0x1bd),'window':undefined});}const _0x566fa7=calculateStats(_0x12d404);return{'attempt':{'id':_0x18f57c['id'],'status':_0x18f57c[_0x440c18(0x281)]?_0x18f57c['success']?_0x440c18(0x1ee):_0x440c18(0x138):'running','createdAt':_0x18f57c[_0x440c18(0x1ff)],'finishedAt':_0x18f57c['finishedAt'],'duration_ms':_0x48d598},'tasks':_0x12d404['map'](_0x18f544=>({'name':_0x18f544[_0x440c18(0x265)],'state':_0x18f544[_0x440c18(0x250)],'startedAt':_0x18f544[_0x440c18(0x23e)]?new Date(_0x18f544[_0x440c18(0x23e)][_0x440c18(0x198)])[_0x440c18(0x282)]():null,'updatedAt':_0x18f544['window']?new Date(_0x18f544[_0x440c18(0x23e)]['end'])['toISOString']():null,'duration_ms':_0x18f544[_0x440c18(0x23e)]?.[_0x440c18(0x25d)]||null})),'stats':_0x566fa7};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x114b07,_0x4868eb){const _0x2c77f6=a43_0x2184,_0x1f5f16=_0x114b07();while(!![]){try{const _0x13cc06=-parseInt(_0x2c77f6(0xa5))/0x1+parseInt(_0x2c77f6(0xa0))/0x2*(-parseInt(_0x2c77f6(0xaa))/0x3)+parseInt(_0x2c77f6(0xa4))/0x4*(parseInt(_0x2c77f6(0x9f))/0x5)+-parseInt(_0x2c77f6(0xa6))/0x6+-parseInt(_0x2c77f6(0xa8))/0x7+-parseInt(_0x2c77f6(0xa1))/0x8+parseInt(_0x2c77f6(0xa9))/0x9;if(_0x13cc06===_0x4868eb)break;else _0x1f5f16['push'](_0x1f5f16['shift']());}catch(_0x58b277){_0x1f5f16['push'](_0x1f5f16['shift']());}}}(a43_0x686b,0xa620f));import{platform}from'os';import{getAPIKey}from'./config.js';function a43_0x2184(_0x190da9,_0x5ca5d3){_0x190da9=_0x190da9-0x9d;const _0x686bd2=a43_0x686b();let _0x218476=_0x686bd2[_0x190da9];return _0x218476;}import{getVersion}from'./version.js';function a43_0x686b(){const _0x27f82e=['1070718yXhMmb','6472800OWclZE','tdx/','4065082bLfCZs','44976780Cvbklh','10671AyYCzC','X-Trino-User','Authorization','length','14565NrnDEl','626mnXiHK','9706192LFkHpo','replace','version','1016ICrUpR'];a43_0x686b=function(){return _0x27f82e;};return a43_0x686b();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0xc58995=a43_0x2184,_0x3cd90a=getVersion(),_0x147665=platform(),_0xec84f4=process[_0xc58995(0xa3)][_0xc58995(0xa2)]('v','');return _0xc58995(0xa7)+_0x3cd90a+'\x20('+_0x147665+';\x20node/'+_0xec84f4+')';}export function getAuthHeaders(_0x45ea74,_0x589725){const _0x8a6902=a43_0x2184,_0x3b525e=getVersion(),_0x2179c5={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x3b525e};return _0x589725&&(_0x2179c5[_0x8a6902(0x9d)]='TD1\x20'+_0x589725),_0x2179c5;}export function toHeaderRecord(_0xb5f0a6){const _0x22aae9={};for(const [_0x2735e5,_0x5c681b]of Object['entries'](_0xb5f0a6)){_0x5c681b!==undefined&&(_0x22aae9[_0x2735e5]=_0x5c681b);}return _0x22aae9;}export function getTrinoHeaders(_0x35b466,_0x550b79){const _0x51f7ec=a43_0x2184,_0x563d09=getAuthHeaders(_0x35b466,_0x550b79),_0x274cdf=toHeaderRecord(_0x563d09);return delete _0x274cdf[_0x51f7ec(0x9d)],_0x550b79&&(_0x274cdf[_0x51f7ec(0xab)]=_0x550b79),_0x274cdf;}export function hasAPIKey(_0x39c283){const _0x260a7e=a43_0x2184,_0x4989bf=getAPIKey(_0x39c283);return _0x4989bf!==undefined&&_0x4989bf[_0x260a7e(0x9e)]>0x0;}
1
+ (function(_0x2ed0f8,_0x3b3ce8){const _0x583b16=a43_0x33d5,_0x6c617b=_0x2ed0f8();while(!![]){try{const _0x56e9da=-parseInt(_0x583b16(0xc7))/0x1+-parseInt(_0x583b16(0xc5))/0x2*(-parseInt(_0x583b16(0xc2))/0x3)+-parseInt(_0x583b16(0xcb))/0x4+-parseInt(_0x583b16(0xc4))/0x5+-parseInt(_0x583b16(0xc1))/0x6*(-parseInt(_0x583b16(0xc6))/0x7)+parseInt(_0x583b16(0xca))/0x8*(-parseInt(_0x583b16(0xc8))/0x9)+parseInt(_0x583b16(0xc9))/0xa;if(_0x56e9da===_0x3b3ce8)break;else _0x6c617b['push'](_0x6c617b['shift']());}catch(_0x2e6521){_0x6c617b['push'](_0x6c617b['shift']());}}}(a43_0x3ddf,0xa1d82));function a43_0x3ddf(){const _0xf8a150=['14388660icpsTz','14096xVSqdr','1768272poAjYh','entries','X-Trino-User','length','tdx','Authorization','version','TD1\x20','36oPWVmT','723Agddil',';\x20node/','5641525ITLeYv','9718JqeOtj','1448531LNKYTf','906348UnjEmz','3636Syqiib'];a43_0x3ddf=function(){return _0xf8a150;};return a43_0x3ddf();}function a43_0x33d5(_0x4bf8de,_0x14248b){_0x4bf8de=_0x4bf8de-0xc1;const _0x3ddf7a=a43_0x3ddf();let _0x33d5d0=_0x3ddf7a[_0x4bf8de];return _0x33d5d0;}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 _0x5e000e=a43_0x33d5,_0x2bd8f1=getVersion(),_0x2acb04=platform(),_0x55d82a=process[_0x5e000e(0xd1)]['replace']('v','');return'tdx/'+_0x2bd8f1+'\x20('+_0x2acb04+_0x5e000e(0xc3)+_0x55d82a+')';}export function getAuthHeaders(_0x371660,_0x19eff6){const _0x95554f=a43_0x33d5,_0x5e1fa5=getVersion(),_0x2603f0={'User-Agent':getUserAgent(),'X-TD-Client':_0x95554f(0xcf),'X-TD-Client-Version':_0x5e1fa5};return _0x19eff6&&(_0x2603f0[_0x95554f(0xd0)]=_0x95554f(0xd2)+_0x19eff6),_0x2603f0;}export function toHeaderRecord(_0x1caa77){const _0x254ceb=a43_0x33d5,_0xce6619={};for(const [_0x360539,_0x46e5b5]of Object[_0x254ceb(0xcc)](_0x1caa77)){_0x46e5b5!==undefined&&(_0xce6619[_0x360539]=_0x46e5b5);}return _0xce6619;}export function getTrinoHeaders(_0x31fe0e,_0x452302){const _0x119f57=a43_0x33d5,_0x40fef1=getAuthHeaders(_0x31fe0e,_0x452302),_0x6f3d44=toHeaderRecord(_0x40fef1);return delete _0x6f3d44[_0x119f57(0xd0)],_0x452302&&(_0x6f3d44[_0x119f57(0xcd)]=_0x452302),_0x6f3d44;}export function hasAPIKey(_0x241d77){const _0x33962b=a43_0x33d5,_0x4e8b75=getAPIKey(_0x241d77);return _0x4e8b75!==undefined&&_0x4e8b75[_0x33962b(0xce)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x2b3445,_0x495d18){const _0x58781=a44_0xc01d,_0x1a3e4d=_0x2b3445();while(!![]){try{const _0x18b051=-parseInt(_0x58781(0x22d))/0x1*(-parseInt(_0x58781(0x21b))/0x2)+-parseInt(_0x58781(0x229))/0x3+parseInt(_0x58781(0x1f4))/0x4*(parseInt(_0x58781(0x22a))/0x5)+parseInt(_0x58781(0x214))/0x6+parseInt(_0x58781(0x1f0))/0x7+parseInt(_0x58781(0x213))/0x8+parseInt(_0x58781(0x225))/0x9*(-parseInt(_0x58781(0x216))/0xa);if(_0x18b051===_0x495d18)break;else _0x1a3e4d['push'](_0x1a3e4d['shift']());}catch(_0x29d3ee){_0x1a3e4d['push'](_0x1a3e4d['shift']());}}}(a44_0x365b,0x89a27));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_0x2e36b0 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a44_0x365b(){const _0x245f9d=['query','split','varchar','red','write','4808482NZpvmq','color','bold','repeat','1772fiIWev','max','keys','tsv','[params]','debug','less','rule','join','double','jsonl','boolean','table','─┴─','stdin','trim','limit','[logs]','object','pipe','magenta','yellow','length','-FXRSn','cmdout','noColor','stdout','stderr','push','forEach','spawn','4047136pDnKDy','1205490UpnvXi','cyan','4018310CZoIkR','inherit','[error]','error','isTTY','2QFJOsL','number','padEnd','output','FINISHED','end','─┬─','map','[Object]','log','54aLIJgU','format','list','params','834162zSIwzE','10865nwzQiK','No\x20data','stringify','896419pJjNga','bigint','Results\x20saved\x20to\x20','json','sdk-result','entries'];a44_0x365b=function(){return _0x245f9d;};return a44_0x365b();}export function isStructuredFormat(_0x9bf480){const _0x15fc53=a44_0xc01d;return _0x9bf480['format']==='json'||_0x9bf480['format']===_0x15fc53(0x1fe)||_0x9bf480[_0x15fc53(0x226)]==='tsv'||_0x9bf480[_0x15fc53(0x226)]===_0x15fc53(0x200)||_0x9bf480[_0x15fc53(0x230)]===!![]||_0x9bf480[_0x15fc53(0x1fe)]===!![]||_0x9bf480[_0x15fc53(0x1f7)]===!![]||_0x9bf480[_0x15fc53(0x200)]===!![];}export function parseOutputOptions(_0x529f24){const _0x1e39fe=a44_0xc01d;return{'format':_0x529f24['format']||'table','output':_0x529f24[_0x1e39fe(0x21e)]||'','limit':_0x529f24[_0x1e39fe(0x204)],'color':_0x529f24[_0x1e39fe(0x1f1)],'noColor':_0x529f24[_0x1e39fe(0x20d)]};}function convertSDKResultToQueryResult(_0x206092){const _0x9c7323=a44_0xc01d,_0x196d12=[];if(_0x206092[_0x9c7323(0x20a)]>0x0){const _0x38d283=_0x206092[0x0];for(const [_0x1cc561,_0x144f56]of Object['entries'](_0x38d283)){let _0x306349=_0x9c7323(0x235);if(typeof _0x144f56===_0x9c7323(0x21c))_0x306349=Number['isInteger'](_0x144f56)?_0x9c7323(0x22e):_0x9c7323(0x1fd);else{if(typeof _0x144f56===_0x9c7323(0x1ff))_0x306349=_0x9c7323(0x1ff);else _0x144f56===null&&(_0x306349='varchar');}_0x196d12[_0x9c7323(0x210)]({'name':_0x1cc561,'type':_0x306349});}}return{'queryId':_0x9c7323(0x231),'columns':_0x196d12,'data':_0x206092,'stats':{'state':_0x9c7323(0x21f),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x206092['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x49ef62,_0x48ba61){const _0x440745=convertSDKResultToQueryResult(_0x49ef62);return formatQueryOutput(_0x440745,_0x48ba61);}export async function formatQueryOutput(_0x285d37,_0x30a821){const _0x1f22ba=a44_0xc01d,{format:_0xba7af4,limit:_0x177520,output:_0x28ff37,color:_0x35db27,noColor:_0x47ce33}=_0x30a821,_0x55847d=Boolean(_0x28ff37)&&!_0x35db27,_0x275d35={'color':_0x35db27,'noColor':_0x47ce33||_0x55847d};if(_0xba7af4===_0x1f22ba(0x200)){const _0x3b417e=shouldUseLess(_0xba7af4,_0x28ff37);return formatAsTable(_0x285d37,_0x177520,_0x3b417e,_0x275d35);}else{if(_0xba7af4==='json')return formatAsJSON(_0x285d37,_0x275d35);else return _0xba7af4===_0x1f22ba(0x1fe)?formatAsJSONL(_0x285d37,_0x275d35):formatQueryResult(_0x285d37,_0xba7af4);}}function a44_0xc01d(_0x44e33c,_0x189310){_0x44e33c=_0x44e33c-0x1f0;const _0x365ba5=a44_0x365b();let _0xc01d7e=_0x365ba5[_0x44e33c];return _0xc01d7e;}function shouldUseLess(_0x17f4a8,_0x45ec6a){const _0x4365dd=a44_0xc01d;return(_0x17f4a8===_0x4365dd(0x200)||_0x17f4a8===_0x4365dd(0x227))&&process[_0x4365dd(0x20e)][_0x4365dd(0x21a)]&&!_0x45ec6a;}export function resolveOutputOptions(_0x5c35ce){const _0x2d00da=a44_0xc01d,_0x4bc468=resolveOutputFormat(_0x5c35ce[_0x2d00da(0x226)],_0x5c35ce[_0x2d00da(0x21e)],_0x2d00da(0x200));let _0x283657=typeof _0x5c35ce['limit']==='number'?_0x5c35ce['limit']:parseInt(_0x5c35ce[_0x2d00da(0x204)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2ad389=_0x5c35ce[_0x2d00da(0x21e)]||'';return shouldUseLess(_0x4bc468,_0x2ad389)&&(_0x283657=Infinity),{'format':_0x4bc468,'output':_0x2ad389,'limit':_0x283657,'color':_0x5c35ce[_0x2d00da(0x1f1)],'noColor':_0x5c35ce[_0x2d00da(0x20d)]};}export function writeOutput(_0x5417d4,_0x2edbab,_0x2ae73f){const _0x3e5a4d=a44_0xc01d;return _0x2edbab?(writeFileSync(_0x2edbab,_0x5417d4),console[_0x3e5a4d(0x219)](_0x3e5a4d(0x22f)+_0x2edbab),Promise['resolve']()):shouldUseLess(_0x2ae73f||'','')?new Promise(_0x102616=>{const _0x5759fb=_0x3e5a4d,_0xdceb66=spawn(_0x5759fb(0x1fa),[_0x5759fb(0x20b)],{'stdio':[_0x5759fb(0x207),_0x5759fb(0x217),_0x5759fb(0x217)]});let _0x3c8f42=![];_0xdceb66['on'](_0x5759fb(0x219),()=>{const _0x63a486=_0x5759fb;!_0x3c8f42&&(_0x3c8f42=!![],console[_0x63a486(0x224)](_0x5417d4),_0x102616());}),_0xdceb66['on']('close',()=>{!_0x3c8f42&&(_0x3c8f42=!![],_0x102616());}),_0xdceb66['on'](_0x5759fb(0x212),()=>{const _0x1e597c=_0x5759fb;!_0x3c8f42&&_0xdceb66[_0x1e597c(0x202)]&&(_0xdceb66[_0x1e597c(0x202)]['on'](_0x1e597c(0x219),()=>{}),_0xdceb66[_0x1e597c(0x202)][_0x1e597c(0x237)](_0x5417d4),_0xdceb66['stdin'][_0x1e597c(0x220)]());}),!_0xdceb66[_0x5759fb(0x202)]&&(!_0x3c8f42&&(_0x3c8f42=!![],console[_0x5759fb(0x224)](_0x5417d4),_0x102616()));}):(console[_0x3e5a4d(0x224)](_0x5417d4),Promise['resolve']());}export async function handleSDKOutput(_0x367f76,_0x3a6802){const _0x1e546e=a44_0xc01d,_0x439b26=resolveOutputOptions(_0x3a6802),_0x277da3=await formatSDKOutput(_0x367f76,_0x439b26);await writeOutput(_0x277da3,_0x439b26[_0x1e546e(0x21e)]||undefined,_0x439b26[_0x1e546e(0x226)]);}export async function handleQueryOutput(_0xb80982,_0x55fbf6){const _0x311dcb=a44_0xc01d,_0x5d605a=resolveOutputOptions(_0x55fbf6),_0x47d3d9=await formatQueryOutput(_0xb80982,_0x5d605a);await writeOutput(_0x47d3d9,_0x5d605a[_0x311dcb(0x21e)]||undefined,_0x5d605a[_0x311dcb(0x226)]);}async function formatSingleObject(_0x38138e,_0x1188fa){const _0x367ec0=a44_0xc01d,{format:_0x4e207d,color:_0x2ceaf7,noColor:_0x6470aa}=_0x1188fa,_0x1443ea={'color':_0x2ceaf7,'noColor':_0x6470aa};if(_0x4e207d==='json'){if(shouldUseColor(_0x1443ea))return colorizeJSON(_0x38138e,_0x1443ea);return JSON[_0x367ec0(0x22c)](_0x38138e,null,0x2);}else{if(_0x4e207d===_0x367ec0(0x1fe)){if(shouldUseColor(_0x1443ea))return colorizeJSONCompact(_0x38138e,_0x1443ea);return JSON[_0x367ec0(0x22c)](_0x38138e);}else{if(_0x4e207d===_0x367ec0(0x1f7))return Object[_0x367ec0(0x232)](_0x38138e)[_0x367ec0(0x222)](([_0x9cf61b,_0x4db393])=>_0x9cf61b+'\x09'+_0x4db393)['join']('\x0a');else{const _0x4393ff=Object[_0x367ec0(0x232)](_0x38138e);if(_0x4393ff['length']===0x0)return _0x367ec0(0x22b);const _0x3cbce3=_0x38138e[_0x367ec0(0x1f9)],_0x13ebab=_0x38138e[_0x367ec0(0x233)],_0x5b5a30=_0x38138e['params'],_0xd5d819=_0x38138e[_0x367ec0(0x1fb)],_0x364c8e=_0x13ebab?typeof _0x13ebab==='string'?_0x13ebab:JSON[_0x367ec0(0x22c)](_0x13ebab,null,0x2):undefined,_0x50a2e1=_0x5b5a30&&Object[_0x367ec0(0x1f6)](_0x5b5a30)[_0x367ec0(0x20a)]>0x0?JSON[_0x367ec0(0x22c)](_0x5b5a30,null,0x2):undefined,_0x451f73=_0xd5d819&&Object[_0x367ec0(0x1f6)](_0xd5d819)[_0x367ec0(0x20a)]>0x0?JSON[_0x367ec0(0x22c)](_0xd5d819,null,0x2):undefined,_0x13f074=_0x4393ff['filter'](([_0x3b7aa2])=>_0x3b7aa2!=='debug'&&_0x3b7aa2!==_0x367ec0(0x233)&&_0x3b7aa2!==_0x367ec0(0x228)&&_0x3b7aa2!==_0x367ec0(0x1fb)),_0x4374a9=Math[_0x367ec0(0x1f5)](..._0x13f074[_0x367ec0(0x222)](([_0x4f08d1])=>_0x4f08d1[_0x367ec0(0x20a)])),_0x4d9c93=Math['max'](..._0x13f074[_0x367ec0(0x222)](([,_0x5ecc9f])=>{const _0x3e4c1a=_0x367ec0;try{const _0x3ab913=_0x5ecc9f===null||_0x5ecc9f===undefined?'':typeof _0x5ecc9f===_0x3e4c1a(0x206)?JSON[_0x3e4c1a(0x22c)](_0x5ecc9f):String(_0x5ecc9f),_0x59ebef=_0x3ab913[_0x3e4c1a(0x234)]('\x0a');return Math['max'](..._0x59ebef[_0x3e4c1a(0x222)](_0x342767=>_0x342767[_0x3e4c1a(0x20a)]),0x0);}catch{return 0x0;}}),0x14),_0x3cc675=[];_0x3cc675[_0x367ec0(0x210)](colorBorder('┌─'+'─'['repeat'](_0x4374a9)+_0x367ec0(0x221)+'─'[_0x367ec0(0x1f3)](_0x4d9c93)+'─┐',_0x1443ea)),_0x13f074['forEach'](([_0x39cedd,_0x51bc04])=>{const _0x265c86=_0x367ec0;let _0x18129c;try{_0x18129c=_0x51bc04===null||_0x51bc04===undefined?'':typeof _0x51bc04===_0x265c86(0x206)?JSON[_0x265c86(0x22c)](_0x51bc04):String(_0x51bc04);}catch{_0x18129c=_0x265c86(0x223);}const _0x5f5343=_0x39cedd['padEnd'](_0x4374a9),_0xcac6ca=_0x18129c[_0x265c86(0x234)]('\x0a');_0xcac6ca[_0x265c86(0x211)]((_0x117750,_0x19db57)=>{const _0x1b1504=_0x265c86,_0x1ca1bf=colorBorder('│',_0x1443ea);_0x19db57===0x0?_0x3cc675['push'](_0x1ca1bf+'\x20'+_0x5f5343+'\x20'+_0x1ca1bf+'\x20'+_0x117750['padEnd'](_0x4d9c93)+'\x20'+_0x1ca1bf):_0x3cc675[_0x1b1504(0x210)](_0x1ca1bf+'\x20'+'\x20'[_0x1b1504(0x1f3)](_0x4374a9)+'\x20'+_0x1ca1bf+'\x20'+_0x117750[_0x1b1504(0x21d)](_0x4d9c93)+'\x20'+_0x1ca1bf);});}),_0x3cc675['push'](colorBorder('└─'+'─'[_0x367ec0(0x1f3)](_0x4374a9)+_0x367ec0(0x201)+'─'[_0x367ec0(0x1f3)](_0x4d9c93)+'─┘',_0x1443ea));_0x364c8e&&(_0x3cc675['push'](''),_0x3cc675[_0x367ec0(0x210)](String(a44_0x2e36b0[_0x367ec0(0x209)][_0x367ec0(0x1f2)]('[query]'))),_0x3cc675[_0x367ec0(0x210)](_0x364c8e));_0x50a2e1&&(_0x3cc675[_0x367ec0(0x210)](''),_0x3cc675[_0x367ec0(0x210)](String(a44_0x2e36b0['blue'][_0x367ec0(0x1f2)](_0x367ec0(0x1f8)))),_0x3cc675[_0x367ec0(0x210)](_0x50a2e1));_0x451f73&&(_0x3cc675['push'](''),_0x3cc675[_0x367ec0(0x210)](String(a44_0x2e36b0[_0x367ec0(0x208)]['bold']('[rule]'))),_0x3cc675[_0x367ec0(0x210)](_0x451f73));if(_0x3cbce3){if(_0x3cbce3[_0x367ec0(0x20f)]){_0x3cc675['push'](''),_0x3cc675['push'](String(a44_0x2e36b0[_0x367ec0(0x236)][_0x367ec0(0x1f2)](_0x367ec0(0x218))));const _0x54d7aa=_0x3cbce3[_0x367ec0(0x20f)][_0x367ec0(0x234)]('\x0a');_0x54d7aa[_0x367ec0(0x211)](_0x18f70f=>{const _0x3622ed=_0x367ec0;_0x18f70f['trim']()&&_0x3cc675[_0x3622ed(0x210)](_0x18f70f);});}if(_0x3cbce3[_0x367ec0(0x20c)]){_0x3cc675['push'](''),_0x3cc675[_0x367ec0(0x210)](String(a44_0x2e36b0[_0x367ec0(0x215)][_0x367ec0(0x1f2)](_0x367ec0(0x205))));const _0x4f700d=_0x3cbce3[_0x367ec0(0x20c)]['split']('\x0a');_0x4f700d[_0x367ec0(0x211)](_0x2c9735=>{const _0x53d4d5=_0x367ec0;_0x2c9735[_0x53d4d5(0x203)]()&&_0x3cc675[_0x53d4d5(0x210)](_0x2c9735);});}}return _0x3cc675[_0x367ec0(0x1fc)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x6da312,_0x2dd134){const _0x274c9a=a44_0xc01d;if(_0x2dd134[_0x274c9a(0x226)]===_0x274c9a(0x200)){await handleSDKOutput([_0x6da312],_0x2dd134);return;}const _0x5dfa7f=resolveOutputOptions(_0x2dd134),_0x529053=await formatSingleObject(_0x6da312,_0x5dfa7f);await writeOutput(_0x529053,_0x5dfa7f['output']||undefined,_0x5dfa7f[_0x274c9a(0x226)]);}
1
+ (function(_0x46e931,_0x47971c){const _0x5a13a4=a44_0x4350,_0x229189=_0x46e931();while(!![]){try{const _0xa266d0=-parseInt(_0x5a13a4(0x183))/0x1+parseInt(_0x5a13a4(0x14d))/0x2+parseInt(_0x5a13a4(0x157))/0x3+parseInt(_0x5a13a4(0x18c))/0x4*(-parseInt(_0x5a13a4(0x14f))/0x5)+-parseInt(_0x5a13a4(0x18d))/0x6*(-parseInt(_0x5a13a4(0x187))/0x7)+-parseInt(_0x5a13a4(0x153))/0x8+parseInt(_0x5a13a4(0x163))/0x9;if(_0xa266d0===_0x47971c)break;else _0x229189['push'](_0x229189['shift']());}catch(_0x26d1ce){_0x229189['push'](_0x229189['shift']());}}}(a44_0x5818,0xa8660));import{writeFileSync}from'fs';function a44_0x5818(){const _0x28dbfc=['push','pipe','-FXRSn','cmdout','filter','length','noColor','stringify','[error]','511187OOPfFQ','magenta','split','debug','1186297WOLmqf','join','─┬─','repeat','number','45964wiSfPD','18QdJKBz','stdin','map','1617786JAddXj','[logs]','415KhCYmi','end','log','red','1045288vMlSnB','entries','resolve','less','1551756kGuJuF','No\x20data','max','inherit','isInteger','params','varchar','yellow','query','trim','rule','json','4057227InFkcS','boolean','─┴─','isTTY','output','format','FINISHED','list','sdk-result','Results\x20saved\x20to\x20','padEnd','string','forEach','jsonl','[rule]','table','[params]','error','[Object]','keys','limit','tsv','bold'];a44_0x5818=function(){return _0x28dbfc;};return a44_0x5818();}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x493689 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3f14b6){const _0x24d66b=a44_0x4350;return _0x3f14b6['format']===_0x24d66b(0x162)||_0x3f14b6[_0x24d66b(0x168)]===_0x24d66b(0x170)||_0x3f14b6[_0x24d66b(0x168)]===_0x24d66b(0x178)||_0x3f14b6[_0x24d66b(0x168)]===_0x24d66b(0x172)||_0x3f14b6['json']===!![]||_0x3f14b6['jsonl']===!![]||_0x3f14b6[_0x24d66b(0x178)]===!![]||_0x3f14b6['table']===!![];}export function parseOutputOptions(_0x149547){const _0x5bc813=a44_0x4350;return{'format':_0x149547[_0x5bc813(0x168)]||_0x5bc813(0x172),'output':_0x149547['output']||'','limit':_0x149547['limit'],'color':_0x149547['color'],'noColor':_0x149547[_0x5bc813(0x180)]};}function convertSDKResultToQueryResult(_0x2a9bde){const _0x33ed31=a44_0x4350,_0x435b22=[];if(_0x2a9bde[_0x33ed31(0x17f)]>0x0){const _0x20c09c=_0x2a9bde[0x0];for(const [_0x1cbe08,_0x4e3c50]of Object[_0x33ed31(0x154)](_0x20c09c)){let _0x196c39=_0x33ed31(0x15d);if(typeof _0x4e3c50===_0x33ed31(0x18b))_0x196c39=Number[_0x33ed31(0x15b)](_0x4e3c50)?'bigint':'double';else{if(typeof _0x4e3c50===_0x33ed31(0x164))_0x196c39=_0x33ed31(0x164);else _0x4e3c50===null&&(_0x196c39=_0x33ed31(0x15d));}_0x435b22['push']({'name':_0x1cbe08,'type':_0x196c39});}}return{'queryId':_0x33ed31(0x16b),'columns':_0x435b22,'data':_0x2a9bde,'stats':{'state':_0x33ed31(0x169),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2a9bde[_0x33ed31(0x17f)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x19f618,_0x4333f5){const _0x248804=convertSDKResultToQueryResult(_0x19f618);return formatQueryOutput(_0x248804,_0x4333f5);}export async function formatQueryOutput(_0x3d1848,_0x214fe4){const _0x577373=a44_0x4350,{format:_0x26ec86,limit:_0x161157,output:_0x44305f,color:_0x103040,noColor:_0xe8aeb6}=_0x214fe4,_0x4abd67=Boolean(_0x44305f)&&!_0x103040,_0x4c9a5c={'color':_0x103040,'noColor':_0xe8aeb6||_0x4abd67};if(_0x26ec86==='table'){const _0x5f12ef=shouldUseLess(_0x26ec86,_0x44305f);return formatAsTable(_0x3d1848,_0x161157,_0x5f12ef,_0x4c9a5c);}else{if(_0x26ec86===_0x577373(0x162))return formatAsJSON(_0x3d1848,_0x4c9a5c);else return _0x26ec86===_0x577373(0x170)?formatAsJSONL(_0x3d1848,_0x4c9a5c):formatQueryResult(_0x3d1848,_0x26ec86);}}function shouldUseLess(_0x19bd81,_0x241516){const _0xa7b0d9=a44_0x4350;return(_0x19bd81===_0xa7b0d9(0x172)||_0x19bd81===_0xa7b0d9(0x16a))&&process['stdout'][_0xa7b0d9(0x166)]&&!_0x241516;}export function resolveOutputOptions(_0x4b18f9){const _0x2df739=a44_0x4350,_0x2c281a=resolveOutputFormat(_0x4b18f9[_0x2df739(0x168)],_0x4b18f9[_0x2df739(0x167)],_0x2df739(0x172));let _0x572984=typeof _0x4b18f9['limit']===_0x2df739(0x18b)?_0x4b18f9[_0x2df739(0x177)]:parseInt(_0x4b18f9[_0x2df739(0x177)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x498c72=_0x4b18f9['output']||'';return shouldUseLess(_0x2c281a,_0x498c72)&&(_0x572984=Infinity),{'format':_0x2c281a,'output':_0x498c72,'limit':_0x572984,'color':_0x4b18f9['color'],'noColor':_0x4b18f9[_0x2df739(0x180)]};}export function writeOutput(_0xad699e,_0xdcf9a9,_0x156653){const _0x31b600=a44_0x4350;return _0xdcf9a9?(writeFileSync(_0xdcf9a9,_0xad699e),console[_0x31b600(0x174)](_0x31b600(0x16c)+_0xdcf9a9),Promise['resolve']()):shouldUseLess(_0x156653||'','')?new Promise(_0x1c2019=>{const _0xc0efac=_0x31b600,_0x4cb2cd=spawn(_0xc0efac(0x156),[_0xc0efac(0x17c)],{'stdio':[_0xc0efac(0x17b),_0xc0efac(0x15a),_0xc0efac(0x15a)]});let _0x1dfe00=![];_0x4cb2cd['on'](_0xc0efac(0x174),()=>{!_0x1dfe00&&(_0x1dfe00=!![],console['log'](_0xad699e),_0x1c2019());}),_0x4cb2cd['on']('close',()=>{!_0x1dfe00&&(_0x1dfe00=!![],_0x1c2019());}),_0x4cb2cd['on']('spawn',()=>{const _0x2fe03f=_0xc0efac;!_0x1dfe00&&_0x4cb2cd['stdin']&&(_0x4cb2cd['stdin']['on'](_0x2fe03f(0x174),()=>{}),_0x4cb2cd['stdin']['write'](_0xad699e),_0x4cb2cd[_0x2fe03f(0x18e)][_0x2fe03f(0x150)]());}),!_0x4cb2cd[_0xc0efac(0x18e)]&&(!_0x1dfe00&&(_0x1dfe00=!![],console[_0xc0efac(0x151)](_0xad699e),_0x1c2019()));}):(console['log'](_0xad699e),Promise[_0x31b600(0x155)]());}export async function handleSDKOutput(_0x22c444,_0x34aa64){const _0x21b14f=a44_0x4350,_0x364b77=resolveOutputOptions(_0x34aa64),_0x49d20c=await formatSDKOutput(_0x22c444,_0x364b77);await writeOutput(_0x49d20c,_0x364b77[_0x21b14f(0x167)]||undefined,_0x364b77[_0x21b14f(0x168)]);}function a44_0x4350(_0x34f0db,_0x4dfd61){_0x34f0db=_0x34f0db-0x14c;const _0x5818cb=a44_0x5818();let _0x43507d=_0x5818cb[_0x34f0db];return _0x43507d;}export async function handleQueryOutput(_0x50de77,_0x4370a7){const _0x4e1a4f=a44_0x4350,_0x4e7a76=resolveOutputOptions(_0x4370a7),_0x51e5a6=await formatQueryOutput(_0x50de77,_0x4e7a76);await writeOutput(_0x51e5a6,_0x4e7a76[_0x4e1a4f(0x167)]||undefined,_0x4e7a76[_0x4e1a4f(0x168)]);}async function formatSingleObject(_0x55459b,_0x2fd5c8){const _0x1ca8fd=a44_0x4350,{format:_0x8ac99c,color:_0x303508,noColor:_0x12f08c}=_0x2fd5c8,_0x191385={'color':_0x303508,'noColor':_0x12f08c};if(_0x8ac99c===_0x1ca8fd(0x162)){if(shouldUseColor(_0x191385))return colorizeJSON(_0x55459b,_0x191385);return JSON[_0x1ca8fd(0x181)](_0x55459b,null,0x2);}else{if(_0x8ac99c==='jsonl'){if(shouldUseColor(_0x191385))return colorizeJSONCompact(_0x55459b,_0x191385);return JSON[_0x1ca8fd(0x181)](_0x55459b);}else{if(_0x8ac99c===_0x1ca8fd(0x178))return Object['entries'](_0x55459b)[_0x1ca8fd(0x14c)](([_0x481fc9,_0x4ce109])=>_0x481fc9+'\x09'+_0x4ce109)['join']('\x0a');else{const _0x435f1b=Object[_0x1ca8fd(0x154)](_0x55459b);if(_0x435f1b[_0x1ca8fd(0x17f)]===0x0)return _0x1ca8fd(0x158);const _0x54a568=_0x55459b['debug'],_0x2178a4=_0x55459b[_0x1ca8fd(0x15f)],_0xb32bac=_0x55459b[_0x1ca8fd(0x15c)],_0x41434e=_0x55459b['rule'],_0x514a2e=_0x2178a4?typeof _0x2178a4===_0x1ca8fd(0x16e)?_0x2178a4:JSON['stringify'](_0x2178a4,null,0x2):undefined,_0x399f02=_0xb32bac&&Object['keys'](_0xb32bac)[_0x1ca8fd(0x17f)]>0x0?JSON[_0x1ca8fd(0x181)](_0xb32bac,null,0x2):undefined,_0x2045e8=_0x41434e&&Object[_0x1ca8fd(0x176)](_0x41434e)[_0x1ca8fd(0x17f)]>0x0?JSON[_0x1ca8fd(0x181)](_0x41434e,null,0x2):undefined,_0x2ca260=_0x435f1b[_0x1ca8fd(0x17e)](([_0x42e124])=>_0x42e124!==_0x1ca8fd(0x186)&&_0x42e124!==_0x1ca8fd(0x15f)&&_0x42e124!==_0x1ca8fd(0x15c)&&_0x42e124!==_0x1ca8fd(0x161)),_0x13effb=Math[_0x1ca8fd(0x159)](..._0x2ca260['map'](([_0x11715d])=>_0x11715d['length'])),_0x7a7942=Math['max'](..._0x2ca260[_0x1ca8fd(0x14c)](([,_0x8bb54f])=>{const _0x462790=_0x1ca8fd;try{const _0x5d937d=_0x8bb54f===null||_0x8bb54f===undefined?'':typeof _0x8bb54f==='object'?JSON[_0x462790(0x181)](_0x8bb54f):String(_0x8bb54f),_0x3b7e33=_0x5d937d[_0x462790(0x185)]('\x0a');return Math['max'](..._0x3b7e33[_0x462790(0x14c)](_0x586cc3=>_0x586cc3[_0x462790(0x17f)]),0x0);}catch{return 0x0;}}),0x14),_0x3468c8=[];_0x3468c8['push'](colorBorder('┌─'+'─'[_0x1ca8fd(0x18a)](_0x13effb)+_0x1ca8fd(0x189)+'─'[_0x1ca8fd(0x18a)](_0x7a7942)+'─┐',_0x191385)),_0x2ca260[_0x1ca8fd(0x16f)](([_0x4fa59f,_0x20e2bb])=>{const _0x5c0531=_0x1ca8fd;let _0xaafc82;try{_0xaafc82=_0x20e2bb===null||_0x20e2bb===undefined?'':typeof _0x20e2bb==='object'?JSON['stringify'](_0x20e2bb):String(_0x20e2bb);}catch{_0xaafc82=_0x5c0531(0x175);}const _0x40b113=_0x4fa59f[_0x5c0531(0x16d)](_0x13effb),_0x9d7c67=_0xaafc82[_0x5c0531(0x185)]('\x0a');_0x9d7c67[_0x5c0531(0x16f)]((_0x3fc423,_0x47e48b)=>{const _0x4eb1a1=_0x5c0531,_0x4d01b8=colorBorder('│',_0x191385);_0x47e48b===0x0?_0x3468c8[_0x4eb1a1(0x17a)](_0x4d01b8+'\x20'+_0x40b113+'\x20'+_0x4d01b8+'\x20'+_0x3fc423[_0x4eb1a1(0x16d)](_0x7a7942)+'\x20'+_0x4d01b8):_0x3468c8[_0x4eb1a1(0x17a)](_0x4d01b8+'\x20'+'\x20'[_0x4eb1a1(0x18a)](_0x13effb)+'\x20'+_0x4d01b8+'\x20'+_0x3fc423['padEnd'](_0x7a7942)+'\x20'+_0x4d01b8);});}),_0x3468c8['push'](colorBorder('└─'+'─'[_0x1ca8fd(0x18a)](_0x13effb)+_0x1ca8fd(0x165)+'─'[_0x1ca8fd(0x18a)](_0x7a7942)+'─┘',_0x191385));_0x514a2e&&(_0x3468c8[_0x1ca8fd(0x17a)](''),_0x3468c8[_0x1ca8fd(0x17a)](String(a44_0x493689[_0x1ca8fd(0x15e)]['bold']('[query]'))),_0x3468c8['push'](_0x514a2e));_0x399f02&&(_0x3468c8[_0x1ca8fd(0x17a)](''),_0x3468c8[_0x1ca8fd(0x17a)](String(a44_0x493689['blue'][_0x1ca8fd(0x179)](_0x1ca8fd(0x173)))),_0x3468c8[_0x1ca8fd(0x17a)](_0x399f02));_0x2045e8&&(_0x3468c8[_0x1ca8fd(0x17a)](''),_0x3468c8['push'](String(a44_0x493689[_0x1ca8fd(0x184)]['bold'](_0x1ca8fd(0x171)))),_0x3468c8[_0x1ca8fd(0x17a)](_0x2045e8));if(_0x54a568){if(_0x54a568['stderr']){_0x3468c8[_0x1ca8fd(0x17a)](''),_0x3468c8['push'](String(a44_0x493689[_0x1ca8fd(0x152)]['bold'](_0x1ca8fd(0x182))));const _0x1ffed7=_0x54a568['stderr'][_0x1ca8fd(0x185)]('\x0a');_0x1ffed7[_0x1ca8fd(0x16f)](_0x328209=>{const _0x113775=_0x1ca8fd;_0x328209[_0x113775(0x160)]()&&_0x3468c8['push'](_0x328209);});}if(_0x54a568[_0x1ca8fd(0x17d)]){_0x3468c8['push'](''),_0x3468c8['push'](String(a44_0x493689['cyan'][_0x1ca8fd(0x179)](_0x1ca8fd(0x14e))));const _0x582ac4=_0x54a568[_0x1ca8fd(0x17d)][_0x1ca8fd(0x185)]('\x0a');_0x582ac4[_0x1ca8fd(0x16f)](_0x1d8efa=>{const _0x4734ac=_0x1ca8fd;_0x1d8efa[_0x4734ac(0x160)]()&&_0x3468c8[_0x4734ac(0x17a)](_0x1d8efa);});}}return _0x3468c8[_0x1ca8fd(0x188)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3cf58e,_0x163b1e){const _0x1765cf=a44_0x4350;if(_0x163b1e[_0x1765cf(0x168)]===_0x1765cf(0x172)){await handleSDKOutput([_0x3cf58e],_0x163b1e);return;}const _0x4e5333=resolveOutputOptions(_0x163b1e),_0x678df=await formatSingleObject(_0x3cf58e,_0x4e5333);await writeOutput(_0x678df,_0x4e5333[_0x1765cf(0x167)]||undefined,_0x4e5333[_0x1765cf(0x168)]);}