@treasuredata/tdx 0.14.2 → 0.14.4

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 (149) 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/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.d.ts.map +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-command.js.map +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-command.js +1 -1
  22. package/dist/commands/job-command.js +1 -1
  23. package/dist/commands/journey-command.js +1 -1
  24. package/dist/commands/journey-validate-command.js +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-proxy.js +1 -1
  27. package/dist/commands/parent-segment-command.js +1 -1
  28. package/dist/commands/profile-command.js +1 -1
  29. package/dist/commands/profiles-command.js +1 -1
  30. package/dist/commands/query-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/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.d.ts +15 -0
  54. package/dist/core/profile.d.ts.map +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/profile.js.map +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/proxy/anthropic-adapter.js +1 -1
  63. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  66. package/dist/proxy/context-signature.js +1 -1
  67. package/dist/proxy/conversation-utils.js +1 -1
  68. package/dist/proxy/passthrough-server.d.ts +13 -2
  69. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  70. package/dist/proxy/passthrough-server.js +1 -1
  71. package/dist/proxy/passthrough-server.js.map +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/api.js +1 -1
  79. package/dist/sdk/client/cdp-api-client.js +1 -1
  80. package/dist/sdk/client/endpoints.js +1 -1
  81. package/dist/sdk/client/engage-api-client.js +1 -1
  82. package/dist/sdk/client/http-client.js +1 -1
  83. package/dist/sdk/client/llm-api-client.js +1 -1
  84. package/dist/sdk/client/rate-limiter.js +1 -1
  85. package/dist/sdk/client/td-api-client.js +1 -1
  86. package/dist/sdk/client/trino-api-client.js +1 -1
  87. package/dist/sdk/client/workflow-client.js +1 -1
  88. package/dist/sdk/connection-validator.js +1 -1
  89. package/dist/sdk/connection.js +1 -1
  90. package/dist/sdk/engage.js +1 -1
  91. package/dist/sdk/errors.js +1 -1
  92. package/dist/sdk/index.js +1 -1
  93. package/dist/sdk/io/index.js +1 -1
  94. package/dist/sdk/io/node-filesystem.js +1 -1
  95. package/dist/sdk/job.js +1 -1
  96. package/dist/sdk/journey.js +1 -1
  97. package/dist/sdk/llm/chat-cache.js +1 -1
  98. package/dist/sdk/llm/index.js +1 -1
  99. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  100. package/dist/sdk/llm/model-aliases.js +1 -1
  101. package/dist/sdk/llm/model-factors.js +1 -1
  102. package/dist/sdk/query/index.js +1 -1
  103. package/dist/sdk/query/sql-parser.js +1 -1
  104. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  105. package/dist/sdk/segment/fields-display.js +1 -1
  106. package/dist/sdk/segment/file-discovery.js +1 -1
  107. package/dist/sdk/segment/journey-utils.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-workflow.js +1 -1
  113. package/dist/sdk/segment/resolution-context.js +1 -1
  114. package/dist/sdk/segment/segment-path-parser.js +1 -1
  115. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  116. package/dist/sdk/segment/target-resolution.js +1 -1
  117. package/dist/sdk/segment/tdx-config.js +1 -1
  118. package/dist/sdk/segment/validate-files.js +1 -1
  119. package/dist/sdk/segment/yaml-validator.js +1 -1
  120. package/dist/sdk/segment.js +1 -1
  121. package/dist/sdk/types/index.js +1 -1
  122. package/dist/sdk/types/progress.js +1 -1
  123. package/dist/sdk/user.js +1 -1
  124. package/dist/sdk/util/format-detector.js +1 -1
  125. package/dist/sdk/util/formatters.js +1 -1
  126. package/dist/sdk/util/index.js +1 -1
  127. package/dist/sdk/util/tree-formatter.js +1 -1
  128. package/dist/sdk/workflow/clone-workflow.js +1 -1
  129. package/dist/sdk/workflow/index.js +1 -1
  130. package/dist/sdk/workflow/pull-workflow.js +1 -1
  131. package/dist/sdk/workflow/push-workflow.js +1 -1
  132. package/dist/sdk/workflow/tdx-config.js +1 -1
  133. package/dist/sdk/workflow/workflow-utils.js +1 -1
  134. package/dist/utils/async.js +1 -1
  135. package/dist/utils/colors.js +1 -1
  136. package/dist/utils/diff.js +1 -1
  137. package/dist/utils/file-permissions.js +1 -1
  138. package/dist/utils/json-loader.js +1 -1
  139. package/dist/utils/option-validation.js +1 -1
  140. package/dist/utils/port.js +1 -1
  141. package/dist/utils/process.js +1 -1
  142. package/dist/utils/prompt.js +1 -1
  143. package/dist/utils/spinner.js +1 -1
  144. package/dist/utils/sse-parser.js +1 -1
  145. package/dist/utils/string-utils.js +1 -1
  146. package/dist/utils/table-ref-parser.js +1 -1
  147. package/dist/utils/tdx-logger.js +1 -1
  148. package/dist/utils/version-check.js +1 -1
  149. package/package.json +1 -1
@@ -1 +1 @@
1
- const a38_0x11e0cd=a38_0x2afe;(function(_0x58e279,_0xc79215){const _0x4775b5=a38_0x2afe,_0x443456=_0x58e279();while(!![]){try{const _0x39bb9f=parseInt(_0x4775b5(0x302))/0x1+-parseInt(_0x4775b5(0x1fc))/0x2*(parseInt(_0x4775b5(0x2d9))/0x3)+parseInt(_0x4775b5(0x1ec))/0x4+parseInt(_0x4775b5(0x22f))/0x5+parseInt(_0x4775b5(0x303))/0x6*(-parseInt(_0x4775b5(0x2a4))/0x7)+parseInt(_0x4775b5(0x337))/0x8*(parseInt(_0x4775b5(0x21d))/0x9)+-parseInt(_0x4775b5(0x1cc))/0xa;if(_0x39bb9f===_0xc79215)break;else _0x443456['push'](_0x443456['shift']());}catch(_0xf18969){_0x443456['push'](_0x443456['shift']());}}}(a38_0xba68,0xef8fb));import a38_0x123249 from'chalk';import{existsSync}from'fs';import a38_0x1d077e 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';function a38_0x2afe(_0x9c9e8e,_0x5b8f9b){_0x9c9e8e=_0x9c9e8e-0x1b2;const _0xba68ef=a38_0xba68();let _0x2afe05=_0xba68ef[_0x9c9e8e];return _0x2afe05;}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a38_0x396379 from'prompts';function getAttemptStatusDisplay(_0x15bc82){const _0x187f33=a38_0x2afe;if(!_0x15bc82)return{'icon':'⏳','text':''};const {done:_0x1592a8,success:_0x2923fd,cancelRequested:_0x54cf37}=_0x15bc82;if(!_0x1592a8)return _0x54cf37?{'icon':'🛑','text':a38_0x123249[_0x187f33(0x2e2)](_0x187f33(0x1c0))}:{'icon':'🔄','text':a38_0x123249[_0x187f33(0x20e)](_0x187f33(0x2b7))};if(_0x2923fd)return{'icon':'✅','text':a38_0x123249[_0x187f33(0x340)](_0x187f33(0x309))};return{'icon':'❌','text':a38_0x123249[_0x187f33(0x1d1)](_0x187f33(0x290))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x11e0cd(0x350)](_0x414c28,_0x588a95,_0x5b309d=0x0){const _0x383429=a38_0x11e0cd;return _0x414c28[_0x5b309d]||_0x588a95[_0x383429(0x280)];}[a38_0x11e0cd(0x1f5)](_0x5b2503,_0x35035f,_0x579037=0x0){const _0x1bdb60=a38_0x11e0cd,_0x423fcc=this['resolveProject'](_0x5b2503,_0x35035f,_0x579037);if(!_0x423fcc)return console[_0x1bdb60(0x290)](a38_0x123249[_0x1bdb60(0x1d1)](_0x1bdb60(0x26c)),_0x1bdb60(0x330)),console[_0x1bdb60(0x290)](a38_0x123249[_0x1bdb60(0x2ba)](_0x1bdb60(0x208))),null;return _0x423fcc;}[a38_0x11e0cd(0x22e)](_0x4ee6ad,_0x14380f){const _0x4710a8=a38_0x11e0cd;if(_0x4ee6ad[0x0]){const _0x11e83a=_0x4ee6ad[0x0][_0x4710a8(0x30e)]('.');if(_0x11e83a[_0x4710a8(0x279)]===0x1)return{'projectName':_0x11e83a[0x0],'workflowName':undefined};else return _0x11e83a[_0x4710a8(0x279)]===0x2?{'projectName':_0x11e83a[0x0],'workflowName':_0x11e83a[0x1]}:(console[_0x4710a8(0x290)](a38_0x123249['red'](_0x4710a8(0x26c)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x14380f[_0x4710a8(0x280)],'workflowName':undefined};}[a38_0x11e0cd(0x1f6)](_0x5b7a69,_0x1aad02,_0x14141c=0x0){const _0x422746=a38_0x11e0cd;if(_0x5b7a69[_0x14141c])return _0x5b7a69[_0x14141c];if(_0x1aad02['workflowProject']){const _0x5d895e=a38_0x1d077e[_0x422746(0x2dc)](process[_0x422746(0x228)](),'workflows',_0x1aad02[_0x422746(0x280)]);if(existsSync(a38_0x1d077e[_0x422746(0x2dc)](_0x5d895e,_0x422746(0x2fc))))return _0x5d895e;}return undefined;}async[a38_0x11e0cd(0x2f4)](_0x572520,_0xd39bd2,_0x6396af){const _0x4aa16d=a38_0x11e0cd;try{const _0x28ef5e=await _0x572520[_0x4aa16d(0x2a2)][_0x4aa16d(0x2c9)](_0xd39bd2,{'limit':0x1});if(_0x28ef5e[_0x4aa16d(0x279)]>0x0){const _0x42b36c=_0x28ef5e[0x0]['id'],_0x3ff947=getWorkflowUrl(_0x6396af,_0x42b36c);console[_0x4aa16d(0x290)](_0x4aa16d(0x317)+a38_0x123249['cyan'](_0x3ff947));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a38_0x11e0cd(0x2d4);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a38_0x11e0cd(0x35c)](_0x289274){const _0x40f1b9=a38_0x11e0cd,{options:_0x127d59,args:_0x343379,tdx:_0x44a919}=_0x289274,_0x3350ad=_0x343379[0x0],_0x16aeed=_0x127d59[_0x40f1b9(0x323)];if(_0x16aeed)return saveSessionContext({'workflow_project':undefined},_0x127d59[_0x40f1b9(0x1bf)]),console['log'](a38_0x123249['green'](_0x40f1b9(0x2e9))),0x0;if(!_0x3350ad)return console[_0x40f1b9(0x290)](a38_0x123249['red'](_0x40f1b9(0x26c)),_0x40f1b9(0x330)),console[_0x40f1b9(0x290)](a38_0x123249[_0x40f1b9(0x2ba)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x40f1b9(0x290)](a38_0x123249[_0x40f1b9(0x2ba)](_0x40f1b9(0x1b8))),0x1;const _0x242c9e=await withSpinner('Resolving\x20project\x20\x27'+_0x3350ad+_0x40f1b9(0x261),()=>_0x44a919['workflow'][_0x40f1b9(0x1de)](_0x3350ad),{'verbose':_0x127d59['verbose']}),{name:_0xe8b2f9}=_0x242c9e[_0x40f1b9(0x35a)];return saveSessionContext({'workflow_project':_0xe8b2f9},_0x127d59[_0x40f1b9(0x1bf)]),console[_0x40f1b9(0x24c)](a38_0x123249[_0x40f1b9(0x340)](_0x40f1b9(0x1b5)+a38_0x123249[_0x40f1b9(0x1f8)](_0xe8b2f9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x1ff);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2bc);async[a38_0x11e0cd(0x35c)](_0x1aa985){const _0x3c2be2=a38_0x11e0cd,{options:_0x3c700a,args:_0x591bdb,tdx:_0x2ae55b}=_0x1aa985,_0x56daec=_0x591bdb[0x0];_0x3c700a[_0x3c2be2(0x293)]&&_0x56daec&&console['error'](_0x3c2be2(0x311)+_0x56daec);const _0x422af6=await withSpinner(_0x3c2be2(0x331),()=>_0x2ae55b['workflow'][_0x3c2be2(0x1b3)](_0x56daec,{'limit':_0x3c700a[_0x3c2be2(0x1d2)]}),{'verbose':_0x3c700a[_0x3c2be2(0x293)]});let _0x221a80=_0x422af6[_0x3c2be2(0x35a)];_0x221a80[_0x3c2be2(0x2da)]((_0x2097fc,_0x4f2c96)=>_0x2097fc[_0x3c2be2(0x21a)][_0x3c2be2(0x1cd)](_0x4f2c96[_0x3c2be2(0x21a)]));const _0x43b55f=_0x3c700a[_0x3c2be2(0x1d2)]||0x64,_0x126e33=_0x221a80[_0x3c2be2(0x279)]>=_0x43b55f?a38_0x123249['dim'](_0x3c2be2(0x264)):'';console['error'](_0x3c2be2(0x265)+_0x221a80[_0x3c2be2(0x279)]+_0x3c2be2(0x353)+(_0x221a80[_0x3c2be2(0x279)]!==0x1?'s':'')+_0x126e33);if(_0x3c700a[_0x3c2be2(0x220)]==='json'||_0x3c700a[_0x3c2be2(0x220)]===_0x3c2be2(0x200)||_0x3c700a[_0x3c2be2(0x220)]===_0x3c2be2(0x234))await handleSDKOutput(_0x221a80,_0x3c700a);else{if(_0x221a80[_0x3c2be2(0x279)]===0x0)_0x56daec?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x56daec):console[_0x3c2be2(0x24c)]('No\x20workflow\x20projects\x20found');else{const _0x1f943c=_0x221a80[_0x3c2be2(0x2a3)](_0x3e0a74=>{const _0x3c68cf=_0x3c2be2,_0x16b7a4=_0x3e0a74[_0x3c68cf(0x25a)]?.[_0x3c68cf(0x2f3)](_0x2d6e3f=>_0x2d6e3f['key']===_0x3c68cf(0x1c1)),_0x1676aa=_0x16b7a4?a38_0x123249[_0x3c68cf(0x2ba)](_0x3c68cf(0x33d)):'';return _0x3c68cf(0x1ed)+_0x3e0a74[_0x3c68cf(0x21a)]+_0x1676aa;});await writeOutput(_0x1f943c['join']('\x0a'),_0x3c700a[_0x3c2be2(0x232)],_0x3c2be2(0x282));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2ee);async[a38_0x11e0cd(0x35c)](_0x1cb07f){const _0x477dd7=a38_0x11e0cd,{options:_0x2fc50a,args:_0x505e3b,tdx:_0x6aa43c}=_0x1cb07f,_0x560725=this['resolveProject'](_0x505e3b,_0x2fc50a);_0x2fc50a['verbose']&&_0x560725&&console[_0x477dd7(0x290)](_0x477dd7(0x1f0)+_0x560725);const _0xe5266=await withSpinner(_0x477dd7(0x33b),()=>_0x6aa43c[_0x477dd7(0x2a2)][_0x477dd7(0x2c9)](_0x560725,{'limit':_0x2fc50a[_0x477dd7(0x1d2)]}),{'verbose':_0x2fc50a[_0x477dd7(0x293)]});let _0x2cb814=_0xe5266[_0x477dd7(0x35a)];_0x2cb814['sort']((_0x3c6df4,_0x2a2ffc)=>{const _0x4951b2=_0x477dd7,_0x4b500f=_0x3c6df4['name'][_0x4951b2(0x1cd)](_0x2a2ffc[_0x4951b2(0x21a)]);if(_0x4b500f!==0x0)return _0x4b500f;return(_0x3c6df4[_0x4951b2(0x238)]?.[_0x4951b2(0x21a)]||'')[_0x4951b2(0x1cd)](_0x2a2ffc['project']?.[_0x4951b2(0x21a)]||'');});const _0x52c063=_0x2fc50a[_0x477dd7(0x1d2)]||0x64,_0x2b1969=_0x2cb814['length']>=_0x52c063?a38_0x123249[_0x477dd7(0x2ba)](_0x477dd7(0x264)):'';console[_0x477dd7(0x290)](_0x477dd7(0x265)+_0x2cb814[_0x477dd7(0x279)]+_0x477dd7(0x216)+(_0x2cb814[_0x477dd7(0x279)]!==0x1?'s':'')+_0x2b1969);if(_0x2fc50a[_0x477dd7(0x220)]===_0x477dd7(0x344)||_0x2fc50a[_0x477dd7(0x220)]===_0x477dd7(0x200)||_0x2fc50a[_0x477dd7(0x220)]==='table')await handleSDKOutput(_0x2cb814,_0x2fc50a);else{if(_0x2cb814[_0x477dd7(0x279)]===0x0)_0x560725?console[_0x477dd7(0x24c)](_0x477dd7(0x204)+_0x560725):console[_0x477dd7(0x24c)](_0x477dd7(0x308));else{const _0x568675=_0x2fc50a['site'],_0x556732=_0x2cb814['map'](_0x54ecb8=>{const _0x46a454=_0x477dd7,_0x150190=a38_0x123249[_0x46a454(0x2ba)]('#'+_0x54ecb8['id']),_0xb73c7b=hyperlink(_0x150190,getWorkflowUrl(_0x568675,_0x54ecb8['id'])),_0x228389=_0x54ecb8[_0x46a454(0x238)]?.[_0x46a454(0x21a)]?a38_0x123249[_0x46a454(0x2ba)]('\x20('+_0x54ecb8[_0x46a454(0x238)]['name']+')'):'';return'📋\x20'+_0xb73c7b+'\x20'+_0x54ecb8[_0x46a454(0x21a)]+_0x228389;});await writeOutput(_0x556732[_0x477dd7(0x2dc)]('\x0a'),_0x2fc50a['output'],_0x477dd7(0x282));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x230);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x277);async[a38_0x11e0cd(0x35c)](_0x15aa42){const _0x3127cc=a38_0x11e0cd,{options:_0x3b5319,args:_0x4075f1,tdx:_0x54cf08}=_0x15aa42,_0x5831e7=this['parseProjectWorkflowPattern'](_0x4075f1,_0x3b5319);if(!_0x5831e7)return 0x1;const {projectName:_0x43aa71,workflowName:_0x5abad0}=_0x5831e7;if(_0x3b5319[_0x3127cc(0x293)]){if(_0x43aa71&&_0x5abad0)console['error'](_0x3127cc(0x1c2)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71&&console[_0x3127cc(0x290)](_0x3127cc(0x1b6)+_0x43aa71);const _0x5e4dc3=_0x3b5319[_0x3127cc(0x296)];_0x5e4dc3&&console['error'](_0x3127cc(0x2dd)+_0x5e4dc3);}let _0x175698=0x28;if(process[_0x3127cc(0x2ab)][_0x3127cc(0x209)]&&!_0x3b5319['output']&&!_0x3b5319[_0x3127cc(0x220)]){const _0x3a2653=process[_0x3127cc(0x2ab)]['rows']||0x28;_0x175698=Math[_0x3127cc(0x258)](0x14,Math[_0x3127cc(0x1d8)](_0x3a2653*0x2/0x3));}const _0x540870=_0x3b5319[_0x3127cc(0x1d2)]||_0x175698,_0x5aaf20=await withSpinner(_0x3127cc(0x1cf),()=>_0x54cf08[_0x3127cc(0x2a2)][_0x3127cc(0x328)]({'projectName':_0x43aa71,'workflowName':_0x5abad0,'status':_0x3b5319['status'],'fromTime':_0x3b5319[_0x3127cc(0x23c)],'toTime':_0x3b5319['to'],'limit':_0x540870}),{'verbose':_0x3b5319[_0x3127cc(0x293)]}),_0x3afd19=_0x5aaf20[_0x3127cc(0x35a)];_0x3afd19[_0x3127cc(0x2da)]((_0x3d5ec0,_0x411fd7)=>{const _0x22e215=_0x3127cc,_0x4e706c=_0x3d5ec0[_0x22e215(0x271)]||'',_0x2bcd9f=_0x411fd7[_0x22e215(0x271)]||'';return _0x2bcd9f['localeCompare'](_0x4e706c);});_0x3afd19['length']>=_0x540870?console[_0x3127cc(0x290)]('✔\x20Showing\x20'+_0x3afd19[_0x3127cc(0x279)]+_0x3127cc(0x2cc)+a38_0x123249[_0x3127cc(0x2ba)](_0x3127cc(0x1d0))):console[_0x3127cc(0x290)]('✔\x20Found\x20'+_0x3afd19[_0x3127cc(0x279)]+'\x20session'+(_0x3afd19['length']!==0x1?'s':''));if(_0x3b5319[_0x3127cc(0x220)]===_0x3127cc(0x344)||_0x3b5319[_0x3127cc(0x220)]==='jsonl'||_0x3b5319[_0x3127cc(0x220)]===_0x3127cc(0x234))await handleSDKOutput(_0x3afd19,_0x3b5319);else{if(!process[_0x3127cc(0x2ab)][_0x3127cc(0x209)]||_0x3b5319['output']){if(_0x3afd19[_0x3127cc(0x279)]===0x0){if(_0x43aa71&&_0x5abad0)console[_0x3127cc(0x24c)](_0x3127cc(0x2f0)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71?console['log'](_0x3127cc(0x2bf)+_0x43aa71):console[_0x3127cc(0x24c)](_0x3127cc(0x357));}else{const _0x1c3098=_0x3b5319['site'],_0x3fbd61=this[_0x3127cc(0x28f)](_0x3afd19,_0x1c3098);_0x3b5319[_0x3127cc(0x232)]?await writeOutput(_0x3fbd61,_0x3b5319[_0x3127cc(0x232)],_0x3127cc(0x282)):console[_0x3127cc(0x24c)](_0x3fbd61);}!_0x43aa71&&(console[_0x3127cc(0x290)](''),console[_0x3127cc(0x290)](a38_0x123249[_0x3127cc(0x2ba)](_0x3127cc(0x255))),console[_0x3127cc(0x290)](a38_0x123249[_0x3127cc(0x2ba)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a38_0x123249[_0x3127cc(0x2ba)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3afd19[_0x3127cc(0x279)]===0x0){if(_0x43aa71&&_0x5abad0)console[_0x3127cc(0x24c)](_0x3127cc(0x2f0)+_0x43aa71+'.'+_0x5abad0);else _0x43aa71?console[_0x3127cc(0x24c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x43aa71):console['log'](_0x3127cc(0x357));}else await this[_0x3127cc(0x2ef)](_0x3afd19,_0x15aa42,_0x43aa71);}}return 0x0;}[a38_0x11e0cd(0x28f)](_0x73f762,_0x108a76){const _0x5c0baa=a38_0x11e0cd,_0x130a05=[],_0x527bad=new Map();let _0x538121=Infinity,_0x49725f=-Infinity;for(const _0x12cd69 of _0x73f762){if(_0x12cd69[_0x5c0baa(0x329)]?.[_0x5c0baa(0x1e4)]){const _0x4e043e=new Date(_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x1e4)])[_0x5c0baa(0x2d5)](),_0x489dde=_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x23f)]?new Date(_0x12cd69[_0x5c0baa(0x329)][_0x5c0baa(0x23f)])[_0x5c0baa(0x2d5)]():Date[_0x5c0baa(0x30f)](),_0x18931d=_0x12cd69['project']?.[_0x5c0baa(0x21a)]||_0x5c0baa(0x2ce);!_0x527bad[_0x5c0baa(0x2f6)](_0x18931d)&&_0x527bad[_0x5c0baa(0x27f)](_0x18931d,[]),_0x527bad[_0x5c0baa(0x2d3)](_0x18931d)[_0x5c0baa(0x1ba)]({'session':_0x12cd69,'startTime':_0x4e043e,'endTime':_0x489dde,'duration':_0x489dde-_0x4e043e}),_0x538121=Math['min'](_0x538121,_0x4e043e),_0x49725f=Math[_0x5c0baa(0x258)](_0x49725f,_0x489dde);}}if(_0x527bad['size']===0x0)return _0x5c0baa(0x278);const _0x48c7ce=process['stdout'][_0x5c0baa(0x352)]||0x78,_0x4ba57d=0x1e,_0x50b745=0x32,_0x257ef7=0x4,_0x378480=Math[_0x5c0baa(0x342)](_0x50b745,Math[_0x5c0baa(0x258)](_0x4ba57d,Math['floor'](_0x48c7ce*0.3))),_0x45c462=_0x48c7ce-_0x378480-TIMELINE_CONFIG[_0x5c0baa(0x285)]-0x3-_0x257ef7,_0x32da63=_0x49725f-_0x538121,_0x2eb674=_0x32da63/_0x378480,_0x1a5b83=renderTimeAxis({'startTime':_0x538121,'endTime':_0x49725f,'durationMs':_0x32da63,'msPerChar':_0x2eb674},_0x378480),_0x2f6ba2=[];for(const _0x717d03 of _0x527bad[_0x5c0baa(0x222)]()){_0x2f6ba2[_0x5c0baa(0x1ba)](..._0x717d03);}_0x2f6ba2[_0x5c0baa(0x2da)]((_0x5928cb,_0x3d20c5)=>_0x3d20c5[_0x5c0baa(0x240)]-_0x5928cb[_0x5c0baa(0x240)]);const _0xad377b=new Date(_0x538121),_0x107999=formatDate(_0xad377b),_0x324adf=_0x257ef7+TIMELINE_CONFIG[_0x5c0baa(0x267)]+TIMELINE_CONFIG[_0x5c0baa(0x2be)]+_0x45c462,_0x47fce2='\x20'[_0x5c0baa(0x1eb)](_0x324adf-_0x107999[_0x5c0baa(0x279)]),_0x310f93=_0x47fce2+a38_0x123249[_0x5c0baa(0x2ba)](_0x107999)+'\x20'+_0x1a5b83;_0x130a05[_0x5c0baa(0x1ba)](_0x310f93);const _0xfd1dfd=0x16;let _0x4c4d17=0x0;for(const _0x5b12cb of _0x2f6ba2){const _0x4f9845=_0x5b12cb[_0x5c0baa(0x1bf)][_0x5c0baa(0x238)]?.[_0x5c0baa(0x21a)]||'?',_0x369fb4=Math['min'](stringWidth(_0x4f9845),_0xfd1dfd);_0x4c4d17=Math['max'](_0x4c4d17,_0x369fb4);}for(const _0x583c23 of _0x2f6ba2){const {session:_0x1e2d2e,startTime:_0x3f14c4,endTime:_0x5864bb,duration:_0x4873e6}=_0x583c23,_0x59e9f1=_0x1e2d2e['project']?.['id'],_0x25a1ba=_0x1e2d2e['id'],_0x3a928a=_0x1e2d2e[_0x5c0baa(0x238)]?.[_0x5c0baa(0x21a)]||'?',_0x1eead3=_0x1e2d2e['workflow']?.[_0x5c0baa(0x21a)]||'?';let _0x4b1375,_0x25ec82;if(_0x1e2d2e[_0x5c0baa(0x329)]){const _0x4d0ddb=_0x1e2d2e[_0x5c0baa(0x329)];!_0x4d0ddb['done']?(_0x4b1375=_0x4d0ddb[_0x5c0baa(0x1da)]?'🛑':'🔄',_0x25ec82=_0x4d0ddb['cancelRequested']?a38_0x123249['yellow']:a38_0x123249[_0x5c0baa(0x20e)]):(_0x4b1375=_0x4d0ddb[_0x5c0baa(0x309)]?'✅':'❌',_0x25ec82=_0x4d0ddb[_0x5c0baa(0x309)]?a38_0x123249[_0x5c0baa(0x340)]:a38_0x123249['red']);}else _0x4b1375='⏳',_0x25ec82=a38_0x123249[_0x5c0baa(0x2ba)];const _0x59f02e='#'+_0x25a1ba,_0x377638=_0x59e9f1?hyperlink(_0x59f02e,getWorkflowSessionUrl(_0x108a76,_0x59e9f1,_0x25a1ba)):_0x59f02e;let _0x2a4214=_0x3a928a;stringWidth(_0x3a928a)>_0xfd1dfd&&(_0x2a4214=_0x3a928a[_0x5c0baa(0x30a)](0x0,_0xfd1dfd-0x1)+'…');const _0x2bba4e=a38_0x123249[_0x5c0baa(0x2ba)](_0x2a4214),_0xe6fe51=stringWidth(_0x2a4214),_0x406473='\x20'['repeat'](_0x4c4d17-stringWidth(_0x2a4214)+0x2),_0xa7aef7='('+formatElapsed(_0x4873e6)+')',_0x95f36c=stringWidth(_0xa7aef7),_0x13a149=stringWidth(_0x59f02e),_0x1875c8=_0x13a149+0x1+_0xe6fe51+_0x406473[_0x5c0baa(0x279)],_0x4c6e1c=_0x45c462-_0x1875c8-_0x95f36c-0x1-0x8;let _0x5331c0=_0x1eead3;stringWidth(_0x5331c0)>_0x4c6e1c&&(_0x5331c0=_0x5331c0[_0x5c0baa(0x30a)](0x0,_0x4c6e1c-0x1)+'…');const _0x482e77=_0x377638+'\x20'+_0x2bba4e+_0x406473+_0x5331c0,_0x8d7801=stringWidth(_0x482e77),_0x65622a=_0x45c462-_0x8d7801-_0x95f36c,_0x34a6b6=_0x482e77+'\x20'[_0x5c0baa(0x1eb)](Math[_0x5c0baa(0x258)](0x1,_0x65622a))+a38_0x123249[_0x5c0baa(0x2ba)](_0xa7aef7),_0x26123f=Math[_0x5c0baa(0x1d8)]((_0x3f14c4-_0x538121)/_0x2eb674),_0x131adc=Math[_0x5c0baa(0x1d8)]((_0x5864bb-_0x538121)/_0x2eb674),_0x5bb023=Math[_0x5c0baa(0x258)](_0x26123f+0x1,_0x131adc),_0xacb043=new Array(_0x378480)[_0x5c0baa(0x310)]('\x20');for(let _0x59f950=_0x26123f;_0x59f950<Math[_0x5c0baa(0x342)](_0x5bb023,_0x378480);_0x59f950++){_0xacb043[_0x59f950]='─';}const _0xa7ba2b=_0xacb043[_0x5c0baa(0x2a3)](_0x2b2d52=>_0x2b2d52==='\x20'?'\x20':_0x25ec82(_0x2b2d52))[_0x5c0baa(0x2dc)]('');_0x130a05['push'](_0x4b1375+'\x20'+_0x34a6b6+'│'+_0xa7ba2b+'│');}return _0x130a05[_0x5c0baa(0x2dc)]('\x0a');}async[a38_0x11e0cd(0x2ef)](_0x4b482a,_0x4252ad,_0x271cd8){const _0x5a8e3a=a38_0x11e0cd,{options:_0x44b7cd,tdx:_0x41910a}=_0x4252ad,_0x3e6663=_0x44b7cd[_0x5a8e3a(0x1ca)],{timelineRows:_0x5e776b,timeAxisHeader:_0x12e807}=this[_0x5a8e3a(0x2b3)](_0x4b482a,_0x3e6663),_0x44b0cb=_0x5e776b[_0x5a8e3a(0x291)](_0x187e36=>_0x187e36[_0x5a8e3a(0x354)]);if(_0x44b0cb[_0x5a8e3a(0x279)]===0x0){const _0x24ce1f=this[_0x5a8e3a(0x28f)](_0x4b482a,_0x3e6663);console[_0x5a8e3a(0x24c)](_0x24ce1f);!_0x271cd8&&(console[_0x5a8e3a(0x290)](''),console[_0x5a8e3a(0x290)](a38_0x123249[_0x5a8e3a(0x2ba)](_0x5a8e3a(0x255))),console['error'](a38_0x123249[_0x5a8e3a(0x2ba)](_0x5a8e3a(0x236))+'or'+a38_0x123249[_0x5a8e3a(0x2ba)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x12e807&&console[_0x5a8e3a(0x24c)](_0x12e807);const _0x114c80=_0x5e776b[_0x5a8e3a(0x291)](_0x57294c=>_0x57294c['attemptId'])[_0x5a8e3a(0x2a3)](_0x585b28=>({'title':_0x585b28[_0x5a8e3a(0x2c8)],'value':_0x585b28['attemptId']})),_0x418af6=process[_0x5a8e3a(0x2ab)][_0x5a8e3a(0x283)]||0x3c,_0x2c5549=Math[_0x5a8e3a(0x258)](0x28,Math[_0x5a8e3a(0x1d8)](_0x418af6*0x2/0x3)),_0x491632=await a38_0x396379({'type':_0x5a8e3a(0x316),'name':'attemptId','message':_0x5a8e3a(0x2f1),'choices':_0x114c80,'initial':-0x1,'limit':_0x2c5549,'clearFirst':!![],'fallback':{'title':_0x5a8e3a(0x22d),'value':null},'suggest':(_0x474b82,_0x2944ae)=>{const _0x14b663=_0x5a8e3a;if(!_0x474b82)return Promise[_0x14b663(0x1ee)](_0x2944ae);const _0x382b51=_0x2944ae[_0x14b663(0x291)](_0x1972cd=>{const _0x21ff96=_0x14b663,_0x174ef7=_0x1972cd;return _0x174ef7['title'][_0x21ff96(0x28a)]()[_0x21ff96(0x205)](_0x474b82[_0x21ff96(0x28a)]());});return Promise['resolve'](_0x382b51);}}),_0x3f2758=()=>{const _0x3ae39b=_0x5a8e3a;process[_0x3ae39b(0x2ab)][_0x3ae39b(0x1f4)]('\x1b[1A\x1b[2K'),process[_0x3ae39b(0x2ab)][_0x3ae39b(0x1f4)](_0x3ae39b(0x1e7)),process[_0x3ae39b(0x2ab)]['write'](_0x3ae39b(0x1e7));},_0x4c35ee=_0x491632&&_0x491632[_0x5a8e3a(0x354)]&&_0x491632[_0x5a8e3a(0x354)]!==null&&_0x491632[_0x5a8e3a(0x354)][_0x5a8e3a(0x1d9)]()!=='';if(!_0x4c35ee){_0x3f2758(),console[_0x5a8e3a(0x24c)](a38_0x123249[_0x5a8e3a(0x2ba)]('Cancelled'));return;}_0x3f2758();const _0x4dc1f7=_0x4b482a[_0x5a8e3a(0x1f7)](_0x1a8754=>_0x1a8754[_0x5a8e3a(0x329)]?.['id']===_0x491632[_0x5a8e3a(0x354)]);if(_0x4dc1f7){const _0x448cdd=_0x4dc1f7[_0x5a8e3a(0x238)]?.[_0x5a8e3a(0x21a)]||'?',_0x73f245=_0x4dc1f7[_0x5a8e3a(0x2a2)]?.[_0x5a8e3a(0x21a)]||'?';console[_0x5a8e3a(0x24c)]('Project:\x20'+a38_0x123249['dim'](_0x448cdd)+',\x20Workflow:\x20'+a38_0x123249[_0x5a8e3a(0x2ba)](_0x73f245));}const _0x3db629=new WorkflowTimelineCommand();await _0x3db629[_0x5a8e3a(0x35c)]({'args':[],'options':{..._0x44b7cd,'attemptId':_0x491632[_0x5a8e3a(0x354)]},'tdx':_0x41910a});}[a38_0x11e0cd(0x2b3)](_0xce7a21,_0x4a2c0a){const _0x44e3f7=a38_0x11e0cd,_0x3b22b1=new Map();for(const _0x4e7243 of _0xce7a21){_0x4e7243['id']&&_0x4e7243[_0x44e3f7(0x329)]?.['id']&&_0x3b22b1[_0x44e3f7(0x27f)](_0x4e7243['id'],_0x4e7243[_0x44e3f7(0x329)]['id']);}const _0x482381=[];let _0x154742='';const _0x1e4452=this[_0x44e3f7(0x28f)](_0xce7a21,_0x4a2c0a),_0x204145=_0x1e4452[_0x44e3f7(0x30e)]('\x0a');for(const _0x8b29c of _0x204145){if(_0x8b29c[_0x44e3f7(0x26a)](_0x44e3f7(0x262))||_0x8b29c[_0x44e3f7(0x281)](/^\s+\d{4}-\d{2}-\d{2}/))_0x154742=_0x8b29c;else{if(_0x8b29c[_0x44e3f7(0x281)](/^[✅❌🔄🛑⏳]/)){const _0x5022de=_0x8b29c['match'](/#(\d+)/),_0x599a4d=_0x5022de?_0x5022de[0x1]:null,_0x5ebfc3=_0x599a4d?_0x3b22b1['get'](_0x599a4d)||null:null,_0x2e8c74=_0xce7a21['find'](_0x3c912e=>_0x3c912e['id']===_0x599a4d),_0xfcd7e0=_0x2e8c74?.['project']?.[_0x44e3f7(0x21a)]||'';_0x482381[_0x44e3f7(0x1ba)]({'displayLine':_0x8b29c,'attemptId':_0x5ebfc3,'projectName':_0xfcd7e0});}}}return{'timelineRows':_0x482381,'timeAxisHeader':_0x154742};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x202);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x284);async[a38_0x11e0cd(0x35c)](_0x4f5cf0){const _0x3a7733=a38_0x11e0cd,{options:_0x43fa56,args:_0x3d62e2,tdx:_0x315ec3}=_0x4f5cf0,_0x3c1ca1=this['parseProjectWorkflowPattern'](_0x3d62e2,_0x43fa56);if(!_0x3c1ca1)return 0x1;const {projectName:_0x9e5965,workflowName:_0x48fd63}=_0x3c1ca1,_0x275f4e=_0x43fa56[_0x3a7733(0x2aa)];if(_0x43fa56[_0x3a7733(0x293)]){if(_0x9e5965&&_0x48fd63)console[_0x3a7733(0x290)]('Filter:\x20'+_0x9e5965+'.'+_0x48fd63);else _0x9e5965&&console['error']('Filter:\x20project='+_0x9e5965);_0x275f4e&&console[_0x3a7733(0x290)](_0x3a7733(0x346));}const _0x17641c=await withSpinner(_0x3a7733(0x1bb),()=>_0x315ec3[_0x3a7733(0x2a2)]['attempts']({'projectName':_0x9e5965,'workflowName':_0x48fd63,'includeRetried':_0x275f4e,'limit':_0x43fa56[_0x3a7733(0x1d2)]}),{'verbose':_0x43fa56[_0x3a7733(0x293)]}),_0x169970=_0x17641c['data'],_0x4ca5e2=_0x43fa56[_0x3a7733(0x1d2)]||0x64,_0x56f36f=_0x169970['length']>=_0x4ca5e2?a38_0x123249[_0x3a7733(0x2ba)](_0x3a7733(0x264)):'';console[_0x3a7733(0x290)](_0x3a7733(0x265)+_0x169970[_0x3a7733(0x279)]+_0x3a7733(0x29b)+(_0x169970['length']!==0x1?'s':'')+_0x56f36f);if(_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x344)||_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x200)||_0x43fa56[_0x3a7733(0x220)]===_0x3a7733(0x234))await handleSDKOutput(_0x169970,_0x43fa56);else{if(_0x169970[_0x3a7733(0x279)]===0x0){if(_0x9e5965&&_0x48fd63)console[_0x3a7733(0x24c)](_0x3a7733(0x213)+_0x9e5965+'.'+_0x48fd63);else _0x9e5965?console[_0x3a7733(0x24c)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x9e5965):console[_0x3a7733(0x24c)](_0x3a7733(0x322));}else{const _0x15bf93=_0x43fa56[_0x3a7733(0x1ca)],_0x726239=_0x169970[_0x3a7733(0x2a3)](_0x10facd=>{const _0x89d4ab=_0x3a7733,_0x19909c=a38_0x123249[_0x89d4ab(0x2ba)]('#'+_0x10facd['id']),_0x18ede2=_0x10facd[_0x89d4ab(0x238)]?.['id'],_0x48e8bf=_0x10facd[_0x89d4ab(0x2cb)]||_0x10facd[_0x89d4ab(0x259)],_0x1ce731=_0x18ede2&&_0x48e8bf?hyperlink(_0x19909c,getWorkflowAttemptUrl(_0x15bf93,_0x18ede2,_0x48e8bf,_0x10facd['id'])):_0x19909c,{icon:_0x2769fd,text:_0x59040c}=getAttemptStatusDisplay(_0x10facd),_0x26ea9f=(_0x10facd['project']?.['name']||'?')+'.'+(_0x10facd[_0x89d4ab(0x2a2)]?.[_0x89d4ab(0x21a)]||'?'),_0x47cf9f=_0x10facd['sessionTime']?a38_0x123249[_0x89d4ab(0x2ba)](_0x10facd['sessionTime']):'';return(_0x1ce731+'\x20'+_0x2769fd+(_0x59040c?'\x20'+_0x59040c:'')+'\x20'+_0x26ea9f+'\x20'+_0x47cf9f)['trimEnd']();});await writeOutput(_0x726239[_0x3a7733(0x2dc)]('\x0a'),_0x43fa56[_0x3a7733(0x232)],_0x3a7733(0x282));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:attempt';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2f2);async[a38_0x11e0cd(0x35c)](_0x11b11e){const _0x5b01e1=a38_0x11e0cd,{options:_0x53594e,args:_0x2aa977,tdx:_0x546689}=_0x11b11e,_0x486e96=_0x2aa977[0x0];if(!_0x486e96)return console[_0x5b01e1(0x290)](_0x5b01e1(0x206)),0x1;_0x53594e[_0x5b01e1(0x293)]&&console[_0x5b01e1(0x290)](_0x5b01e1(0x22b)+_0x486e96);const _0x357f9c=await withSpinner(_0x5b01e1(0x2db),()=>_0x546689['workflow']['attempt'](_0x486e96),{'verbose':_0x53594e['verbose']}),_0x3862d8=_0x357f9c['data'];let _0x550020;!_0x3862d8[_0x5b01e1(0x244)]?_0x550020=_0x3862d8['cancelRequested']?'canceling':'running':_0x550020=_0x3862d8[_0x5b01e1(0x309)]?_0x5b01e1(0x309):'error';let _0x24aa84;if(_0x3862d8[_0x5b01e1(0x1e4)]&&_0x3862d8[_0x5b01e1(0x23f)]){const _0xf8b6c=new Date(_0x3862d8[_0x5b01e1(0x1e4)])[_0x5b01e1(0x2d5)](),_0x36bb50=new Date(_0x3862d8[_0x5b01e1(0x23f)])[_0x5b01e1(0x2d5)]();_0x24aa84=Math[_0x5b01e1(0x2d1)]((_0x36bb50-_0xf8b6c)/0x3e8);}const _0x342eee={'attempt_id':_0x3862d8['id'],'status':_0x550020,..._0x3862d8[_0x5b01e1(0x20c)]!==undefined&&{'index':_0x3862d8[_0x5b01e1(0x20c)]},..._0x3862d8[_0x5b01e1(0x238)]&&{'project':_0x3862d8[_0x5b01e1(0x238)]['name']},..._0x3862d8['workflow']&&{'workflow':_0x3862d8[_0x5b01e1(0x2a2)][_0x5b01e1(0x21a)]},..._0x3862d8['sessionId']&&{'session_id':_0x3862d8['sessionId']},..._0x3862d8[_0x5b01e1(0x271)]&&{'session_time':_0x3862d8['sessionTime']},..._0x3862d8[_0x5b01e1(0x2f9)]&&{'retry_attempt':_0x3862d8[_0x5b01e1(0x2f9)]},..._0x24aa84!==undefined&&{'duration_sec':_0x24aa84},..._0x3862d8['createdAt']&&{'created_at':_0x3862d8['createdAt']},..._0x3862d8['finishedAt']&&{'finished_at':_0x3862d8[_0x5b01e1(0x23f)]},...Object[_0x5b01e1(0x294)](_0x3862d8[_0x5b01e1(0x239)])[_0x5b01e1(0x279)]>0x0&&{'params':_0x3862d8['params']}};return await handleSingleObjectOutput(_0x342eee,_0x53594e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a38_0x11e0cd(0x289);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x21c);async[a38_0x11e0cd(0x35c)](_0x205940){const _0x4d2107=a38_0x11e0cd,{options:_0x2f9acc,args:_0x531906,tdx:_0x4729ea}=_0x205940,_0xa9895e=_0x531906[0x0];if(!_0xa9895e)return console['error'](_0x4d2107(0x206)),0x1;const _0x599dbe=_0x2f9acc[_0x4d2107(0x25d)];_0x2f9acc[_0x4d2107(0x293)]&&(console[_0x4d2107(0x290)]('Attempt\x20ID:\x20'+_0xa9895e),_0x599dbe&&console[_0x4d2107(0x290)](_0x4d2107(0x1c8)));const _0xe83e7f=await withSpinner(_0x4d2107(0x272),()=>_0x4729ea[_0x4d2107(0x2a2)][_0x4d2107(0x20f)](_0xa9895e,_0x599dbe||![]),{'verbose':_0x2f9acc['verbose']}),_0x94dc37=_0xe83e7f[_0x4d2107(0x35a)];return console[_0x4d2107(0x290)]('✔\x20Found\x20'+_0x94dc37[_0x4d2107(0x279)]+_0x4d2107(0x237)+(_0x94dc37[_0x4d2107(0x279)]!==0x1?'s':'')),await handleSDKOutput(_0x94dc37,_0x2f9acc),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x2c7);[a38_0x11e0cd(0x218)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x1b11be){const _0x37bb7e=a38_0x11e0cd,{options:_0x54adde,args:_0x3c381a,tdx:_0x180feb}=_0x1b11be,_0x49c33f=_0x3c381a[0x0];let _0x444f18=_0x3c381a[0x1];if(!_0x49c33f)return console[_0x37bb7e(0x290)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x54adde[_0x37bb7e(0x293)]&&(console[_0x37bb7e(0x290)](_0x37bb7e(0x22b)+_0x49c33f),_0x444f18&&console[_0x37bb7e(0x290)](_0x37bb7e(0x27d)+_0x444f18));const _0x3641fa=await withSpinner(_0x37bb7e(0x2bd),()=>_0x180feb[_0x37bb7e(0x2a2)][_0x37bb7e(0x1bc)](_0x49c33f,_0x444f18),{'verbose':_0x54adde['verbose']}),_0x506402=_0x3641fa[_0x37bb7e(0x35a)];if(_0x506402[_0x37bb7e(0x279)]===0x0)return console[_0x37bb7e(0x290)](_0x37bb7e(0x32d)),0x0;if(!_0x444f18&&(_0x54adde[_0x37bb7e(0x344)]||_0x54adde[_0x37bb7e(0x220)]))return await handleSDKOutput(_0x506402,_0x54adde),0x0;if(!_0x444f18){const _0x469b99=_0x506402[_0x37bb7e(0x2a3)](_0x24395b=>({'title':_0x24395b['taskName']+'\x20('+formatBytes(_0x24395b[_0x37bb7e(0x324)])+')','value':_0x24395b[_0x37bb7e(0x1f9)]})),_0x1c8da2=await a38_0x396379({'type':'select','name':_0x37bb7e(0x32f),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x469b99});if(!_0x1c8da2['task'])return console['error'](_0x37bb7e(0x1e3)),0x0;_0x444f18=_0x1c8da2[_0x37bb7e(0x32f)];}const _0x50a24a=await withSpinner(_0x37bb7e(0x27b),()=>_0x180feb['workflow']['logs'](_0x49c33f,_0x444f18),{'verbose':_0x54adde[_0x37bb7e(0x293)]}),_0x2d778e=_0x50a24a['data'];return _0x2d778e?console['log'](_0x2d778e):console[_0x37bb7e(0x290)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:kill';[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1e8);async[a38_0x11e0cd(0x35c)](_0x1d77b0){const _0x2e408a=a38_0x11e0cd,{options:_0x1247d0,args:_0xc6218,tdx:_0x42538c}=_0x1d77b0,_0x3628ed=_0xc6218[0x0];if(!_0x3628ed)return console['error'](_0x2e408a(0x206)),0x1;const _0x3ddfb5=_0x1247d0['reason'];_0x1247d0[_0x2e408a(0x293)]&&(console['error'](_0x2e408a(0x22b)+_0x3628ed),_0x3ddfb5&&console['error']('Reason:\x20'+_0x3ddfb5));if(!_0x1247d0[_0x2e408a(0x31b)]){const _0x486972=await confirmKey(_0x2e408a(0x297)+_0x3628ed+'?');if(!_0x486972)return console['error'](_0x2e408a(0x1e3)),0x0;}const _0x859273=await withSpinner(_0x2e408a(0x25c),()=>_0x42538c[_0x2e408a(0x2a2)][_0x2e408a(0x24d)](_0x3628ed,_0x3ddfb5),{'verbose':_0x1247d0['verbose']}),_0x4c0ca3=_0x859273['data'];return console[_0x2e408a(0x290)]('✔\x20'+_0x4c0ca3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a38_0x11e0cd(0x251);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1e2);async[a38_0x11e0cd(0x35c)](_0x48fbf6){const _0x521fb5=a38_0x11e0cd,{options:_0x130ac5,args:_0x4e2fff,tdx:_0x57e95c}=_0x48fbf6,_0x336b10=_0x4e2fff[0x0];if(!_0x336b10)return console[_0x521fb5(0x290)](_0x521fb5(0x273)),console['error'](_0x521fb5(0x321)),0x1;let _0x5d0e40=![],_0x6269e=_0x336b10;if(_0x336b10[_0x521fb5(0x26a)](_0x521fb5(0x2c0)))_0x5d0e40=!![],_0x6269e=_0x336b10['substring'](0x8);else{if(_0x336b10[_0x521fb5(0x26a)]('attempt:'))_0x5d0e40=![],_0x6269e=_0x336b10[_0x521fb5(0x29a)](0x8);else return console[_0x521fb5(0x290)](_0x521fb5(0x2f5)),console[_0x521fb5(0x290)](_0x521fb5(0x321)),0x1;}const _0x55a167=_0x130ac5['fromTask'],_0x1077d3=_0x130ac5[_0x521fb5(0x1cb)],_0x5c7fe3=_0x130ac5[_0x521fb5(0x239)],_0x15fc14=_0x130ac5[_0x521fb5(0x2a7)];_0x130ac5['verbose']&&(console[_0x521fb5(0x290)]('Target:\x20'+(_0x5d0e40?_0x521fb5(0x1bf):'attempt')+'\x20'+_0x6269e),_0x55a167&&console[_0x521fb5(0x290)](_0x521fb5(0x2a0)+_0x55a167),_0x1077d3&&console[_0x521fb5(0x290)](_0x521fb5(0x219)+_0x1077d3),_0x5c7fe3&&console[_0x521fb5(0x290)](_0x521fb5(0x1f1)+_0x5c7fe3),_0x15fc14&&console['error'](_0x521fb5(0x1e1)));let _0x45ba68;if(_0x5c7fe3)try{if(_0x5c7fe3['startsWith']('@')){const _0x12bf94=await import(_0x521fb5(0x2b1)),_0x5cd6eb=_0x5c7fe3[_0x521fb5(0x29a)](0x1),_0x3a223b=await _0x12bf94['readFile'](_0x5cd6eb,_0x521fb5(0x21b));_0x45ba68=JSON[_0x521fb5(0x246)](_0x3a223b);}else _0x45ba68=JSON['parse'](_0x5c7fe3);}catch{return console[_0x521fb5(0x290)](_0x521fb5(0x2cf)),0x1;}if(!_0x130ac5[_0x521fb5(0x31b)]){const _0x59620c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5d0e40?'session':'attempt')+'\x20'+_0x6269e+'?');if(!_0x59620c)return console[_0x521fb5(0x290)]('Cancelled'),0x0;}let _0xb5b242;_0x5d0e40?_0xb5b242=await withSpinner(_0x521fb5(0x335),()=>_0x57e95c[_0x521fb5(0x2a2)][_0x521fb5(0x2ec)](_0x6269e,{'fromTask':_0x55a167,'retryParams':_0x45ba68}),{'verbose':_0x130ac5['verbose']}):_0xb5b242=await withSpinner(_0x521fb5(0x326),()=>_0x57e95c['workflow'][_0x521fb5(0x1b2)](_0x6269e,{'resumeFrom':_0x1077d3,'retryParams':_0x45ba68,'force':_0x15fc14}),{'verbose':_0x130ac5[_0x521fb5(0x293)]});const _0xb240c5=_0xb5b242[_0x521fb5(0x35a)];return console['error'](_0x521fb5(0x2d2)),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0xb240c5[_0x521fb5(0x354)]),console[_0x521fb5(0x290)](_0x521fb5(0x2e3)+_0xb240c5[_0x521fb5(0x259)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a38_0x11e0cd(0x28c);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x276);async[a38_0x11e0cd(0x35c)](_0x14c104){const _0x9dfcb8=a38_0x11e0cd,{options:_0x6648a,args:_0x473eb8,tdx:_0x3825da}=_0x14c104;let _0x3d957a=_0x473eb8[0x0];if(!_0x3d957a){const _0x2a5d6c=this[_0x9dfcb8(0x350)]([],_0x6648a),_0x1e03f1=await withSpinner(_0x9dfcb8(0x356),()=>_0x3825da[_0x9dfcb8(0x2a2)][_0x9dfcb8(0x2c9)](_0x2a5d6c,{'limit':_0x6648a[_0x9dfcb8(0x1d2)]}),{'verbose':_0x6648a[_0x9dfcb8(0x293)]}),_0x357c87=_0x1e03f1[_0x9dfcb8(0x35a)];if(_0x357c87[_0x9dfcb8(0x279)]===0x0)return console[_0x9dfcb8(0x290)](_0x9dfcb8(0x308)),!_0x2a5d6c&&console[_0x9dfcb8(0x290)](a38_0x123249[_0x9dfcb8(0x2ba)](_0x9dfcb8(0x208))),0x1;const _0x183986=_0x357c87['map'](_0x4ac186=>({'title':_0x4ac186[_0x9dfcb8(0x238)]?.[_0x9dfcb8(0x21a)]+'.'+_0x4ac186['name'],'value':_0x4ac186[_0x9dfcb8(0x238)]?.[_0x9dfcb8(0x21a)]+'.'+_0x4ac186[_0x9dfcb8(0x21a)],'description':_0x4ac186[_0x9dfcb8(0x2b2)]?_0x9dfcb8(0x301)+_0x4ac186['revision']:undefined})),_0x129958=await a38_0x396379({'type':_0x9dfcb8(0x1c9),'name':'workflow','message':_0x9dfcb8(0x1ea),'choices':_0x183986});if(!_0x129958[_0x9dfcb8(0x2a2)])return 0x1;_0x3d957a=_0x129958[_0x9dfcb8(0x2a2)];}if(!_0x3d957a[_0x9dfcb8(0x205)]('.')){const _0x53d60f=this['resolveProject']([],_0x6648a);if(_0x53d60f)_0x3d957a=_0x53d60f+'.'+_0x3d957a;else return console['error'](a38_0x123249['red'](_0x9dfcb8(0x26c)),_0x9dfcb8(0x28e)),console[_0x9dfcb8(0x290)](a38_0x123249[_0x9dfcb8(0x2ba)](_0x9dfcb8(0x208))),0x1;}const _0x381ccc=_0x6648a[_0x9dfcb8(0x2e7)],_0x280fde=_0x6648a[_0x9dfcb8(0x271)],_0x5283d9={};if(_0x381ccc&&Array[_0x9dfcb8(0x318)](_0x381ccc))for(const _0x559c4d of _0x381ccc){const _0x5d32b2=_0x559c4d[_0x9dfcb8(0x2d6)]('=');if(_0x5d32b2===-0x1)return console[_0x9dfcb8(0x290)](_0x9dfcb8(0x2b5)+_0x559c4d),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x263)),0x1;const _0x1fa087=_0x559c4d[_0x9dfcb8(0x29a)](0x0,_0x5d32b2),_0x355627=_0x559c4d[_0x9dfcb8(0x29a)](_0x5d32b2+0x1);try{_0x5283d9[_0x1fa087]=JSON['parse'](_0x355627);}catch{_0x5283d9[_0x1fa087]=_0x355627;}}_0x6648a['verbose']&&(console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1fe)+_0x3d957a),Object[_0x9dfcb8(0x294)](_0x5283d9)[_0x9dfcb8(0x279)]>0x0&&console['error'](_0x9dfcb8(0x25e)+JSON[_0x9dfcb8(0x1e6)](_0x5283d9)),_0x280fde&&console[_0x9dfcb8(0x290)]('Session\x20time:\x20'+_0x280fde));const _0x376123=await withSpinner(_0x9dfcb8(0x300),()=>_0x3825da[_0x9dfcb8(0x2a2)]['run'](_0x3d957a,_0x5283d9,{'sessionTime':_0x280fde}),{'verbose':_0x6648a['verbose']}),_0x44a2bf=_0x376123[_0x9dfcb8(0x35a)];console[_0x9dfcb8(0x290)](_0x9dfcb8(0x233)),console[_0x9dfcb8(0x290)]('\x20\x20Attempt\x20ID:\x20'+_0x44a2bf['id']),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x2e3)+_0x44a2bf[_0x9dfcb8(0x259)]),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1ef)+_0x44a2bf[_0x9dfcb8(0x238)]?.['name']),console[_0x9dfcb8(0x290)](_0x9dfcb8(0x1bd)+_0x44a2bf['workflow']?.[_0x9dfcb8(0x21a)]);if(_0x44a2bf[_0x9dfcb8(0x238)]?.['id']&&_0x44a2bf['sessionId']&&_0x44a2bf['id']){const _0x100d32=_0x6648a[_0x9dfcb8(0x1ca)],_0x15b808=getConsoleUrl(_0x100d32,_0x9dfcb8(0x26b)+_0x44a2bf[_0x9dfcb8(0x238)]['id']+'/sessions/'+_0x44a2bf['sessionId']+'/attempt/'+_0x44a2bf['id']);console['error'](_0x9dfcb8(0x317)+a38_0x123249[_0x9dfcb8(0x1f8)](_0x15b808));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a38_0x11e0cd(0x2e1);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x2de);async[a38_0x11e0cd(0x35c)](_0x51ec63){const _0x1368f4=a38_0x11e0cd,{options:_0x729702,args:_0x14a7a7,tdx:_0xed1a22}=_0x51ec63,_0x4bbe9e=_0x14a7a7[0x0],_0x9fc94c=_0x14a7a7[0x1]||'.';if(!_0x4bbe9e)return console[_0x1368f4(0x290)](_0x1368f4(0x2c4)),console[_0x1368f4(0x290)](_0x1368f4(0x243)),0x1;const _0x2e800c=_0x729702[_0x1368f4(0x2b2)];_0x729702[_0x1368f4(0x293)]&&(console['error'](_0x1368f4(0x2e0)+_0x4bbe9e),console[_0x1368f4(0x290)](_0x1368f4(0x2cd)+_0x9fc94c),_0x2e800c&&console['error']('Revision:\x20'+_0x2e800c));const _0x54cf22=await withSpinner('Downloading\x20project\x20'+_0x4bbe9e+_0x1368f4(0x24b),()=>_0xed1a22[_0x1368f4(0x2a2)]['download'](_0x4bbe9e,_0x9fc94c,{'revision':_0x2e800c}),{'verbose':_0x729702[_0x1368f4(0x293)]}),_0x210617=_0x54cf22[_0x1368f4(0x35a)];return console[_0x1368f4(0x290)](_0x1368f4(0x242)+_0x210617[_0x1368f4(0x1df)]),console[_0x1368f4(0x290)](_0x1368f4(0x2ad)+_0x210617[_0x1368f4(0x2b2)]),console['error'](_0x1368f4(0x275)+_0x210617[_0x1368f4(0x26f)]),console[_0x1368f4(0x290)](_0x1368f4(0x343)+_0x9fc94c+'/'+_0x210617[_0x1368f4(0x1df)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x269);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x30d);async[a38_0x11e0cd(0x35c)](_0x249e34){const _0x3bba2f=a38_0x11e0cd,{options:_0x1946da,args:_0x3c822e,tdx:_0x17543f}=_0x249e34;let _0x5a370e='.',_0x4ce4b0=_0x1946da['name'];if(_0x3c822e[0x0]){const {promises:_0x32c302}=await import('fs');try{const _0x2d3d19=await _0x32c302[_0x3bba2f(0x207)](_0x3c822e[0x0]);if(_0x2d3d19['isDirectory']())_0x5a370e=_0x3c822e[0x0];else return console[_0x3bba2f(0x290)](_0x3bba2f(0x2ca)+_0x3c822e[0x0]+_0x3bba2f(0x29c)),0x1;}catch{_0x4ce4b0=_0x3c822e[0x0],_0x5a370e='.';}}const _0x1a5462=_0x1946da[_0x3bba2f(0x2b2)],_0x2eb908=_0x1946da[_0x3bba2f(0x34d)];_0x1946da[_0x3bba2f(0x293)]&&(console['error'](_0x3bba2f(0x2ea)+_0x5a370e),_0x4ce4b0&&console[_0x3bba2f(0x290)](_0x3bba2f(0x223)+_0x4ce4b0),_0x1a5462&&console[_0x3bba2f(0x290)](_0x3bba2f(0x229)+_0x1a5462),_0x2eb908&&console[_0x3bba2f(0x290)](_0x3bba2f(0x2e5)));const _0x5359a6=await withSpinner(_0x3bba2f(0x254),()=>_0x17543f[_0x3bba2f(0x2a2)]['push'](_0x5a370e,{'projectName':_0x4ce4b0,'revision':_0x1a5462,'skipValidation':_0x2eb908}),{'verbose':_0x1946da[_0x3bba2f(0x293)]}),_0x4f4710=_0x5359a6[_0x3bba2f(0x35a)];return console[_0x3bba2f(0x290)](_0x3bba2f(0x359)+_0x4f4710[_0x3bba2f(0x1df)]),console[_0x3bba2f(0x290)]('\x20\x20Project\x20ID:\x20'+_0x4f4710[_0x3bba2f(0x2df)]),console[_0x3bba2f(0x290)](_0x3bba2f(0x2ad)+_0x4f4710[_0x3bba2f(0x2b2)]),await this[_0x3bba2f(0x2f4)](_0x17543f,_0x4f4710[_0x3bba2f(0x1df)],_0x1946da[_0x3bba2f(0x1ca)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:pull';[a38_0x11e0cd(0x218)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x2ece5c){const _0x320517=a38_0x11e0cd,{options:_0xe256b7,args:_0x3f336c,tdx:_0x102970}=_0x2ece5c,_0x33297b=_0x3f336c[0x0],_0x288e8a=_0x3f336c[0x1];if(!_0x33297b)return console[_0x320517(0x290)](a38_0x123249[_0x320517(0x1d1)]('Error:'),_0x320517(0x330)),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x549f40=_0xe256b7[_0x320517(0x2b2)];_0xe256b7[_0x320517(0x293)]&&(console[_0x320517(0x290)](_0x320517(0x2e0)+_0x33297b),_0x288e8a&&console[_0x320517(0x290)]('Target\x20directory:\x20'+_0x288e8a),_0x549f40&&console[_0x320517(0x290)](_0x320517(0x229)+_0x549f40),_0xe256b7[_0x320517(0x34a)]&&console['error'](_0x320517(0x341)));const _0x26475e=await withSpinner('Pulling\x20project\x20'+_0x33297b+'...',()=>_0x102970['workflow']['pullProject'](_0x33297b,{'targetDir':_0x288e8a,'revision':_0x549f40}),{'verbose':_0xe256b7[_0x320517(0x293)]}),_0x1df9db=_0x26475e[_0x320517(0x35a)];_0x1df9db[_0x320517(0x26d)]?console['error'](_0x320517(0x31e)+_0x1df9db[_0x320517(0x1df)]):console['error']('✔\x20Project:\x20'+_0x1df9db['projectName']);console[_0x320517(0x290)](_0x320517(0x2ad)+_0x1df9db[_0x320517(0x2b2)]),console[_0x320517(0x290)](_0x320517(0x268)+(a38_0x1d077e[_0x320517(0x338)](process['cwd'](),_0x1df9db['targetDir'])||'.')),console['error'](_0x320517(0x1e5)+a38_0x123249[_0x320517(0x340)]('+'+_0x1df9db['summary']['new']+_0x320517(0x1c7))+',\x20'+(a38_0x123249[_0x320517(0x2e2)]('~'+_0x1df9db['summary'][_0x320517(0x2e8)]+'\x20modified')+',\x20')+(a38_0x123249[_0x320517(0x1d1)]('-'+_0x1df9db[_0x320517(0x21f)][_0x320517(0x231)]+'\x20deleted')+',\x20')+(''+a38_0x123249['dim'](_0x1df9db['summary'][_0x320517(0x24e)]+'\x20unchanged')));for(const _0x4a8014 of _0x1df9db['changes']){_0x4a8014[_0x320517(0x34c)]==='modified'&&_0x4a8014[_0x320517(0x2b4)]&&(console[_0x320517(0x290)]('\x0a'+a38_0x123249[_0x320517(0x1f8)]('---\x20'+_0x4a8014['path'])),console[_0x320517(0x290)](_0x4a8014[_0x320517(0x2b4)]));}if(!_0x1df9db[_0x320517(0x225)])return saveSessionContext({'workflow_project':_0x1df9db[_0x320517(0x1df)]},_0xe256b7['session']),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x340)](_0x320517(0x305))),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x30b)+_0x1df9db[_0x320517(0x1df)])),0x0;if(_0xe256b7[_0x320517(0x34a)])return console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2e2)](_0x320517(0x22a))),0x0;if(!_0xe256b7['yes']){const _0xae7930=await confirmKey(_0x320517(0x33a));if(!_0xae7930)return console[_0x320517(0x290)](_0x320517(0x1e3)),0x0;}await withSpinner(_0x320517(0x312),()=>_0x102970['workflow']['applyPullProject'](_0x1df9db,{'revision':_0x549f40}),{'verbose':_0xe256b7[_0x320517(0x293)]}),saveSessionContext({'workflow_project':_0x1df9db[_0x320517(0x1df)]},_0xe256b7['session']),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x340)](_0x320517(0x1d6)));const _0x92a578=a38_0x1d077e['relative'](process['cwd'](),_0x1df9db[_0x320517(0x1d7)])||'.';return console['error'](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x343)+_0x92a578)),console[_0x320517(0x290)](a38_0x123249[_0x320517(0x2ba)](_0x320517(0x30b)+_0x1df9db[_0x320517(0x1df)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x314);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x34f);async[a38_0x11e0cd(0x35c)](_0x264c03){const _0x59fd76=a38_0x11e0cd,{options:_0x2c2dd0,args:_0x5881c3,tdx:_0x16192c}=_0x264c03,_0x51bd98=this['resolveProjectDir'](_0x5881c3,_0x2c2dd0),_0x2a1685=_0x2c2dd0[_0x59fd76(0x2b2)],_0x3aa88a=_0x2c2dd0['skipValidation'];_0x2c2dd0[_0x59fd76(0x293)]&&(_0x51bd98&&console[_0x59fd76(0x290)]('Source\x20directory:\x20'+_0x51bd98),_0x2a1685&&console[_0x59fd76(0x290)](_0x59fd76(0x229)+_0x2a1685),_0x2c2dd0['dryRun']&&console['error']('Dry\x20run:\x20yes'),_0x3aa88a&&console['error'](_0x59fd76(0x2e5)));let _0x31662e;try{_0x31662e=await withSpinner(_0x59fd76(0x210),()=>_0x16192c[_0x59fd76(0x2a2)][_0x59fd76(0x35b)]({'sourceDir':_0x51bd98,'revision':_0x2a1685,'skipValidation':_0x3aa88a}),{'verbose':_0x2c2dd0[_0x59fd76(0x293)]});}catch(_0x5d6b08){if(_0x5d6b08 instanceof Error&&_0x5d6b08[_0x59fd76(0x1b9)]['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x1d1)](_0x59fd76(0x26c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2c2dd0[_0x59fd76(0x280)]?console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x2ba)](_0x59fd76(0x21e)+_0x2c2dd0[_0x59fd76(0x280)]+_0x59fd76(0x20b)+_0x2c2dd0['workflowProject']+'\x27')):console['error'](a38_0x123249['dim'](_0x59fd76(0x1dd))),0x1;throw _0x5d6b08;}const _0x259f31=_0x31662e[_0x59fd76(0x35a)];console[_0x59fd76(0x290)]('✔\x20Project:\x20'+_0x259f31[_0x59fd76(0x1df)]),console[_0x59fd76(0x290)](_0x59fd76(0x31c)+_0x259f31[_0x59fd76(0x327)]),console[_0x59fd76(0x290)](_0x59fd76(0x2ad)+_0x259f31[_0x59fd76(0x2b2)]),console[_0x59fd76(0x290)](_0x59fd76(0x1e5)+a38_0x123249[_0x59fd76(0x340)]('+'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x347)]+_0x59fd76(0x1c7))+',\x20'+(a38_0x123249['yellow']('~'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x2e8)]+'\x20modified')+',\x20')+(a38_0x123249[_0x59fd76(0x1d1)]('-'+_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x231)]+_0x59fd76(0x211))+',\x20')+(''+a38_0x123249[_0x59fd76(0x2ba)](_0x259f31[_0x59fd76(0x21f)][_0x59fd76(0x24e)]+_0x59fd76(0x33c))));for(const _0x46092f of _0x259f31[_0x59fd76(0x315)]){_0x46092f[_0x59fd76(0x34c)]==='modified'&&_0x46092f[_0x59fd76(0x2b4)]&&(console[_0x59fd76(0x290)]('\x0a'+a38_0x123249[_0x59fd76(0x1f8)](_0x59fd76(0x25f)+_0x46092f[_0x59fd76(0x249)])),console[_0x59fd76(0x290)](_0x46092f[_0x59fd76(0x2b4)]));}if(!_0x259f31['hasChanges'])return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x340)](_0x59fd76(0x298))),await this[_0x59fd76(0x2f4)](_0x16192c,_0x259f31[_0x59fd76(0x1df)],_0x2c2dd0[_0x59fd76(0x1ca)]),0x0;if(_0x2c2dd0['dryRun'])return console['error'](a38_0x123249[_0x59fd76(0x2e2)](_0x59fd76(0x215))),0x0;if(!_0x2c2dd0[_0x59fd76(0x31b)]){const _0x448bdb=await confirmKey(_0x59fd76(0x2a8));if(!_0x448bdb)return console['error'](_0x59fd76(0x1e3)),0x0;}const _0x3fea1b=await withSpinner(_0x59fd76(0x307),()=>_0x16192c[_0x59fd76(0x2a2)][_0x59fd76(0x332)](_0x259f31),{'verbose':_0x2c2dd0[_0x59fd76(0x293)]}),_0x42fbd1=_0x3fea1b[_0x59fd76(0x35a)];return console[_0x59fd76(0x290)](a38_0x123249[_0x59fd76(0x340)]('✔\x20Push\x20complete')),console['error'](_0x59fd76(0x201)+_0x42fbd1['projectId']),console['error'](_0x59fd76(0x2ad)+_0x42fbd1['revision']),await this[_0x59fd76(0x2f4)](_0x16192c,_0x42fbd1['projectName'],_0x2c2dd0[_0x59fd76(0x1ca)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x252);['description']=a38_0x11e0cd(0x2fe);async[a38_0x11e0cd(0x35c)](_0x21c913){const _0x668254=a38_0x11e0cd,{options:_0x40147d,args:_0x3ac15f,tdx:_0x15cb4c}=_0x21c913,_0x230a35=this['resolveProjectDir'](_0x3ac15f,_0x40147d),_0x4710d8=_0x40147d[_0x668254(0x21a)],_0x5bc1c1=_0x40147d[_0x668254(0x2b2)],_0x5df733=_0x40147d['skipValidation'];if(!_0x230a35)return console[_0x668254(0x290)](a38_0x123249['red']('Error:'),'Source\x20directory\x20is\x20required'),console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2ba)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x668254(0x290)](a38_0x123249['dim'](_0x668254(0x319))),0x1;if(!_0x4710d8)return console[_0x668254(0x290)](a38_0x123249[_0x668254(0x1d1)](_0x668254(0x26c)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2ba)](_0x668254(0x32c))),0x1;_0x40147d[_0x668254(0x293)]&&(console[_0x668254(0x290)](_0x668254(0x34b)+_0x230a35),console[_0x668254(0x290)](_0x668254(0x2fa)+_0x4710d8),_0x5bc1c1&&console[_0x668254(0x290)](_0x668254(0x229)+_0x5bc1c1),_0x40147d[_0x668254(0x34a)]&&console[_0x668254(0x290)](_0x668254(0x341)),_0x5df733&&console[_0x668254(0x290)](_0x668254(0x2e5)));const _0x1a6bfd=await withSpinner(_0x668254(0x1b7),()=>_0x15cb4c[_0x668254(0x2a2)][_0x668254(0x34e)](_0x230a35,_0x4710d8,{'revision':_0x5bc1c1,'skipValidation':_0x5df733}),{'verbose':_0x40147d[_0x668254(0x293)]}),_0x28595e=_0x1a6bfd[_0x668254(0x35a)];console[_0x668254(0x290)](_0x668254(0x1f2)+_0x28595e[_0x668254(0x327)]);_0x28595e[_0x668254(0x1e0)]&&console[_0x668254(0x290)]('Source\x20project:\x20'+_0x28595e[_0x668254(0x1e0)]);console[_0x668254(0x290)](_0x668254(0x2fa)+_0x28595e['newProjectName']),console[_0x668254(0x290)](_0x668254(0x229)+_0x28595e[_0x668254(0x2b2)]),console[_0x668254(0x290)](_0x668254(0x248)+_0x28595e[_0x668254(0x295)]);_0x28595e['targetExists']&&(console['error'](a38_0x123249[_0x668254(0x2e2)](_0x668254(0x266)+_0x28595e['newProjectName']+_0x668254(0x221)+_0x28595e[_0x668254(0x31d)]+')')),console['error'](a38_0x123249[_0x668254(0x2e2)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x40147d[_0x668254(0x34a)])return console[_0x668254(0x290)](a38_0x123249[_0x668254(0x2e2)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x40147d[_0x668254(0x31b)]){const _0x1630d0=_0x28595e['sourceProjectName']||a38_0x1d077e['basename'](_0x230a35),_0x564412=_0x28595e[_0x668254(0x348)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x4710d8+_0x668254(0x292):_0x668254(0x2c5)+_0x1630d0+_0x668254(0x32a)+_0x4710d8+'\x22?',_0xe548fa=await confirmKey(_0x564412);if(!_0xe548fa)return console[_0x668254(0x290)](_0x668254(0x1e3)),0x0;}const _0x3bf3ec=await withSpinner(_0x28595e[_0x668254(0x348)]?_0x668254(0x325)+_0x4710d8+_0x668254(0x24b):_0x668254(0x349)+_0x4710d8+_0x668254(0x24b),()=>_0x15cb4c[_0x668254(0x2a2)][_0x668254(0x1fa)](_0x28595e),{'verbose':_0x40147d['verbose']}),_0x48c330=_0x3bf3ec[_0x668254(0x35a)];return console[_0x668254(0x290)](a38_0x123249['green'](_0x28595e[_0x668254(0x348)]?_0x668254(0x250):_0x668254(0x23b))),console[_0x668254(0x290)](_0x668254(0x1ef)+_0x48c330[_0x668254(0x1b4)]),console[_0x668254(0x290)](_0x668254(0x201)+_0x48c330[_0x668254(0x203)]),console[_0x668254(0x290)](_0x668254(0x2ad)+_0x48c330['revision']),await this[_0x668254(0x2f4)](_0x15cb4c,_0x48c330['newProjectName'],_0x40147d[_0x668254(0x1ca)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x11e0cd(0x21a)]='workflow:delete';[a38_0x11e0cd(0x218)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x11e0cd(0x35c)](_0x47d1d1){const _0x3d9ccb=a38_0x11e0cd,{options:_0x29769a,args:_0x5e3633,tdx:_0x55f90f}=_0x47d1d1,_0x47fa41=_0x5e3633[0x0];if(!_0x47fa41)return console[_0x3d9ccb(0x290)](_0x3d9ccb(0x235)),console['error'](_0x3d9ccb(0x333)),0x1;_0x29769a[_0x3d9ccb(0x293)]&&console[_0x3d9ccb(0x290)](_0x3d9ccb(0x2e0)+_0x47fa41);if(!_0x29769a[_0x3d9ccb(0x31b)]){const _0x46db45=await confirmKey(_0x3d9ccb(0x227)+_0x47fa41+_0x3d9ccb(0x2ac));if(!_0x46db45)return console[_0x3d9ccb(0x290)]('Cancelled'),0x0;}const _0x46a3d8=await withSpinner(_0x3d9ccb(0x1c4)+_0x47fa41+_0x3d9ccb(0x24b),()=>_0x55f90f[_0x3d9ccb(0x2a2)]['delete'](_0x47fa41),{'verbose':_0x29769a['verbose']}),_0x494338=_0x46a3d8[_0x3d9ccb(0x35a)];return console[_0x3d9ccb(0x290)](_0x3d9ccb(0x1d5)+_0x494338[_0x3d9ccb(0x1df)]),console[_0x3d9ccb(0x290)](_0x3d9ccb(0x201)+_0x494338[_0x3d9ccb(0x2df)]),0x0;}}export function parseKeyValue(_0x240e51){const _0x255dfd=a38_0x11e0cd,_0x3f65df=_0x240e51[_0x255dfd(0x2d6)]('=');if(_0x3f65df===-0x1)throw new Error(_0x255dfd(0x313)+_0x240e51+_0x255dfd(0x1d3));const _0x251574=_0x240e51['substring'](0x0,_0x3f65df),_0x5258c4=_0x240e51[_0x255dfd(0x29a)](_0x3f65df+0x1);if(!_0x251574)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x251574,'value':_0x5258c4};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x30c);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x1be);async[a38_0x11e0cd(0x35c)](_0x229115){const _0x242f45=a38_0x11e0cd,{options:_0x355534,args:_0x348889,tdx:_0x5cdb80}=_0x229115,_0x3446d5=this['requireProject'](_0x348889,_0x355534);if(!_0x3446d5)return 0x1;_0x355534[_0x242f45(0x293)]&&console[_0x242f45(0x290)](_0x242f45(0x2e0)+_0x3446d5);const _0x370eb5=await withSpinner(_0x242f45(0x2c1),()=>_0x5cdb80['workflow'][_0x242f45(0x2ed)](_0x3446d5),{'verbose':_0x355534[_0x242f45(0x293)]}),{secrets:_0x294d5d}=_0x370eb5[_0x242f45(0x35a)];return console[_0x242f45(0x290)](_0x242f45(0x265)+_0x294d5d[_0x242f45(0x279)]+_0x242f45(0x2ff)+(_0x294d5d['length']!==0x1?'s':'')),await handleSDKOutput(_0x294d5d,_0x355534),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x2e6);['description']=a38_0x11e0cd(0x27c);async['execute'](_0x2ba54f){const _0x2462ba=a38_0x11e0cd,{options:_0x283430,args:_0x1cd0d5,tdx:_0x21465b}=_0x2ba54f;let _0x53d074,_0x1ca1c5;if(_0x1cd0d5[_0x2462ba(0x279)]>=0x2)_0x53d074=_0x1cd0d5[0x0],_0x1ca1c5=_0x1cd0d5[0x1];else{if(_0x1cd0d5[_0x2462ba(0x279)]===0x1&&_0x283430[_0x2462ba(0x280)])_0x53d074=_0x283430[_0x2462ba(0x280)],_0x1ca1c5=_0x1cd0d5[0x0];else return _0x1cd0d5[_0x2462ba(0x279)]===0x1?(console[_0x2462ba(0x290)](_0x2462ba(0x2c4)),console[_0x2462ba(0x290)](_0x2462ba(0x208)),0x1):(console[_0x2462ba(0x290)](_0x2462ba(0x2bb)),console[_0x2462ba(0x290)](_0x2462ba(0x351)),0x1);}let _0x173dd2,_0x4fdec7;try{({key:_0x173dd2,value:_0x4fdec7}=parseKeyValue(_0x1ca1c5));}catch(_0x420097){return _0x420097 instanceof Error&&console[_0x2462ba(0x290)](a38_0x123249[_0x2462ba(0x1d1)](_0x2462ba(0x26c)),_0x420097[_0x2462ba(0x1b9)]),0x1;}_0x283430[_0x2462ba(0x293)]&&(console[_0x2462ba(0x290)](_0x2462ba(0x2e0)+_0x53d074),console[_0x2462ba(0x290)](_0x2462ba(0x245)+_0x173dd2));const _0x4b55c6=await withSpinner(_0x2462ba(0x20a),()=>_0x21465b[_0x2462ba(0x2a2)][_0x2462ba(0x257)](_0x53d074,_0x173dd2,_0x4fdec7),{'verbose':_0x283430[_0x2462ba(0x293)]}),_0x3842fd=_0x4b55c6['data'];return console[_0x2462ba(0x290)](_0x2462ba(0x226)+_0x3842fd[_0x2462ba(0x287)]+_0x2462ba(0x26e)+_0x3842fd[_0x2462ba(0x1df)]+'\x27'),(_0x283430[_0x2462ba(0x344)]||_0x283430['jsonl'])&&await handleSingleObjectOutput(_0x3842fd,_0x283430),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a38_0x11e0cd(0x1db);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x217);async[a38_0x11e0cd(0x35c)](_0x4a8a47){const _0x414f28=a38_0x11e0cd,{options:_0x323284,args:_0x5f1604,tdx:_0x37bc2e}=_0x4a8a47;let _0x2d5734,_0x45fe50;if(_0x5f1604[_0x414f28(0x279)]>=0x2)_0x2d5734=_0x5f1604[0x0],_0x45fe50=_0x5f1604[0x1];else{if(_0x5f1604[_0x414f28(0x279)]===0x1&&_0x323284[_0x414f28(0x280)])_0x2d5734=_0x323284[_0x414f28(0x280)],_0x45fe50=_0x5f1604[0x0];else return _0x5f1604['length']===0x1?(console['error'](_0x414f28(0x2c4)),console[_0x414f28(0x290)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x414f28(0x290)](_0x414f28(0x27e)),console['error']('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x323284[_0x414f28(0x293)]&&(console['error']('Project:\x20'+_0x2d5734),console[_0x414f28(0x290)](_0x414f28(0x245)+_0x45fe50));if(!_0x323284[_0x414f28(0x31b)]){const _0xf87fae=await confirmKey(_0x414f28(0x29e)+_0x45fe50+_0x414f28(0x23d)+_0x2d5734+'\x27?');if(!_0xf87fae)return console[_0x414f28(0x290)](_0x414f28(0x1e3)),0x0;}const _0x3d11e4=await withSpinner('Deleting\x20secret...',()=>_0x37bc2e[_0x414f28(0x2a2)][_0x414f28(0x2b0)](_0x2d5734,_0x45fe50),{'verbose':_0x323284[_0x414f28(0x293)]}),_0x16035f=_0x3d11e4[_0x414f28(0x35a)];return console['error'](_0x414f28(0x226)+_0x16035f[_0x414f28(0x287)]+_0x414f28(0x2c6)+_0x16035f[_0x414f28(0x1df)]+'\x27'),(_0x323284[_0x414f28(0x344)]||_0x323284[_0x414f28(0x200)])&&await handleSingleObjectOutput(_0x16035f,_0x323284),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(_0x220230){const _0x5a3db7=a38_0x11e0cd,_0x25fbc7=Math[_0x5a3db7(0x1d8)](_0x220230/0x3e8),_0x180053=Math[_0x5a3db7(0x1d8)](_0x25fbc7/0x3c),_0x18dd56=Math[_0x5a3db7(0x1d8)](_0x180053/0x3c),_0x2d9a33=Math[_0x5a3db7(0x1d8)](_0x18dd56/0x18);if(_0x2d9a33>0x0){const _0x1e40ce=_0x18dd56%0x18;return _0x1e40ce>0x0?_0x2d9a33+'d\x20'+_0x1e40ce+'h':_0x2d9a33+'d';}else{if(_0x18dd56>0x0){const _0x5b83df=_0x180053%0x3c;return _0x5b83df>0x0?_0x18dd56+'h\x20'+_0x5b83df+'m':_0x18dd56+'h';}else{if(_0x180053>0x0){const _0x346015=_0x25fbc7%0x3c;return _0x346015>0x0?_0x180053+'m\x20'+_0x346015+'s':_0x180053+'m';}else return _0x25fbc7+'s';}}}function formatTimestamp(_0x46e1ff,_0x14d787){const _0x29b55b=a38_0x11e0cd,_0x558177=new Date(_0x46e1ff),_0x4daa92=String(_0x558177[_0x29b55b(0x304)]())[_0x29b55b(0x1c3)](0x2,'0'),_0x22507e=String(_0x558177[_0x29b55b(0x1c5)]())['padStart'](0x2,'0'),_0x43fe0a=_0x4daa92+':'+_0x22507e,_0x1fad8f=_0x558177['getFullYear']()===_0x14d787[_0x29b55b(0x2e4)]()&&_0x558177[_0x29b55b(0x2a6)]()===_0x14d787[_0x29b55b(0x2a6)]()&&_0x558177[_0x29b55b(0x2f7)]()===_0x14d787[_0x29b55b(0x2f7)]();if(_0x1fad8f)return _0x43fe0a;else{const _0x245c03=String(_0x558177[_0x29b55b(0x2a6)]()+0x1)['padStart'](0x2,'0'),_0x1723ab=String(_0x558177['getDate']())[_0x29b55b(0x1c3)](0x2,'0');return _0x245c03+'-'+_0x1723ab+'\x20'+_0x43fe0a;}}function formatDate(_0x5cdc85){const _0x2f6202=a38_0x11e0cd,_0x1dd0b1=_0x5cdc85[_0x2f6202(0x2e4)](),_0x5ef2c9=String(_0x5cdc85[_0x2f6202(0x2a6)]()+0x1)['padStart'](0x2,'0'),_0x15e197=String(_0x5cdc85[_0x2f6202(0x2f7)]())[_0x2f6202(0x1c3)](0x2,'0');return _0x1dd0b1+'-'+_0x5ef2c9+'-'+_0x15e197;}function getTaskStateIcon(_0x2709cf){const _0x4dc53e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4dc53e[_0x2709cf]||'⚪';}function getBarChar(_0x33b919){const _0x4574e9=a38_0x11e0cd;return _0x33b919===_0x4574e9(0x290)||_0x33b919===_0x4574e9(0x2d7)?'×':'─';}function getBarColor(_0x3e5b2e){const _0x532119=a38_0x11e0cd,_0x402544={'success':a38_0x123249[_0x532119(0x340)],'error':a38_0x123249[_0x532119(0x1d1)],'group_error':a38_0x123249['red'],'running':a38_0x123249[_0x532119(0x20e)],'blocked':a38_0x123249[_0x532119(0x2e2)],'planned':a38_0x123249[_0x532119(0x2ba)],'canceling':a38_0x123249['yellow']};return _0x402544[_0x3e5b2e]||a38_0x123249[_0x532119(0x27a)];}function parseTaskName(_0xc6ab76){const _0x31a301=a38_0x11e0cd;let _0x2eb1e5=_0xc6ab76[_0x31a301(0x2c3)](/^\++/,'');const _0x50c538=_0x2eb1e5[_0x31a301(0x30e)]('+'),_0x2d2e97=_0x50c538['length']>0x1?_0x50c538[_0x31a301(0x279)]-0x2:0x0,_0x4c28f8=_0x50c538[_0x50c538['length']-0x1]||_0x2eb1e5;return{'level':_0x2d2e97,'name':'+'+_0x4c28f8};}function truncateTaskName(_0x284d48,_0x3f0b88){const _0x1afed6=a38_0x11e0cd,_0x51ac84=stringWidth(_0x284d48);if(_0x51ac84<=_0x3f0b88)return _0x284d48;let _0x161f65=_0x284d48;while(stringWidth(_0x161f65+'…')>_0x3f0b88&&_0x161f65['length']>0x0){_0x161f65=_0x161f65[_0x1afed6(0x30a)](0x0,-0x1);}return _0x161f65+'…';}function calculateTimeScale(_0x393b8d,_0x1a3df7){const _0x5d7308=a38_0x11e0cd;return{'startTime':_0x393b8d[_0x5d7308(0x2a5)],'endTime':_0x393b8d[_0x5d7308(0x2b6)],'durationMs':_0x393b8d[_0x5d7308(0x339)],'msPerChar':_0x393b8d[_0x5d7308(0x339)]/_0x1a3df7};}function timeToPosition(_0x2e20c4,_0x184dc4,_0x43a355){const _0x48cfb9=a38_0x11e0cd,_0x45917d=_0x2e20c4-_0x184dc4[_0x48cfb9(0x240)],_0x54309f=Math[_0x48cfb9(0x1d8)](_0x45917d/_0x184dc4['msPerChar']);return Math[_0x48cfb9(0x258)](0x0,Math[_0x48cfb9(0x342)](_0x54309f,_0x43a355));}function renderTimeAxis(_0x3eafaa,_0x2b1914){const _0x11bd90=a38_0x11e0cd,_0x2699eb=Math['min'](TIMELINE_CONFIG[_0x11bd90(0x334)],Math[_0x11bd90(0x258)](TIMELINE_CONFIG[_0x11bd90(0x1f3)],Math[_0x11bd90(0x1d8)](_0x2b1914/TIMELINE_CONFIG[_0x11bd90(0x256)]))),_0x5eb05f=_0x3eafaa[_0x11bd90(0x2a9)]/(_0x2699eb-0x1),_0x595162=new Date(_0x3eafaa[_0x11bd90(0x240)]),_0x242a45=[];for(let _0x389649=0x0;_0x389649<_0x2699eb;_0x389649++){const _0x2c9bbd=_0x3eafaa['startTime']+_0x389649*_0x5eb05f,_0x194544=timeToPosition(_0x2c9bbd,_0x3eafaa,_0x2b1914),_0x7866e6=formatTimestamp(_0x2c9bbd,_0x595162);_0x242a45[_0x11bd90(0x1ba)]({'pos':_0x194544,'text':_0x7866e6});}const _0x1ed3c5=new Array(_0x2b1914)['fill']('\x20');let _0x743fae=-0x1;for(const {pos:_0x4f1542,text:_0x5cd099}of _0x242a45){let _0x51a0fa=Math['max'](0x0,_0x4f1542-Math[_0x11bd90(0x1d8)](_0x5cd099[_0x11bd90(0x279)]/0x2));_0x51a0fa<=_0x743fae+TIMELINE_CONFIG[_0x11bd90(0x23a)]&&(_0x51a0fa=_0x743fae+TIMELINE_CONFIG[_0x11bd90(0x23a)]+0x1);_0x51a0fa+_0x5cd099[_0x11bd90(0x279)]>_0x2b1914&&(_0x51a0fa=_0x2b1914-_0x5cd099[_0x11bd90(0x279)]);if(_0x51a0fa>=0x0&&_0x51a0fa+_0x5cd099['length']<=_0x2b1914&&_0x51a0fa>_0x743fae){for(let _0x4f2f4e=0x0;_0x4f2f4e<_0x5cd099[_0x11bd90(0x279)];_0x4f2f4e++){_0x1ed3c5[_0x51a0fa+_0x4f2f4e]=_0x5cd099[_0x4f2f4e];}_0x743fae=_0x51a0fa+_0x5cd099[_0x11bd90(0x279)]-0x1;}}return _0x1ed3c5[_0x11bd90(0x2dc)]('');}function renderTaskRow(_0x997586,_0x217661,_0x5ebb1d,_0x121d7c){const _0xfc93cf=a38_0x11e0cd,{level:_0xde1030,name:_0x17d81e}=parseTaskName(_0x997586[_0xfc93cf(0x21a)]),_0xec8b63='\x20'[_0xfc93cf(0x1eb)](_0xde1030),_0x159026=_0x997586[_0xfc93cf(0x23e)]?'('+formatElapsed(_0x997586['window'][_0xfc93cf(0x339)])+')':'',_0x1b32c6=stringWidth(_0x159026),_0x1612af=_0xde1030*0x1,_0x266694=_0x121d7c-_0x1612af-_0x1b32c6-0x1,_0x508c2a=truncateTaskName(_0x17d81e,_0x266694),_0x17e2cb=_0xec8b63+_0x508c2a,_0x49dbf9=stringWidth(_0x17e2cb),_0x3120e0=_0x121d7c-_0x49dbf9-_0x1b32c6,_0x23f468=_0x17e2cb+'\x20'[_0xfc93cf(0x1eb)](Math[_0xfc93cf(0x258)](0x1,_0x3120e0))+a38_0x123249[_0xfc93cf(0x2ba)](_0x159026),_0x373374=getTaskStateIcon(_0x997586[_0xfc93cf(0x320)]),_0x4a3be0=new Array(_0x5ebb1d)[_0xfc93cf(0x310)]('\x20');if(_0x997586['window']){const _0x9d5a45=timeToPosition(_0x997586[_0xfc93cf(0x23e)][_0xfc93cf(0x2a5)],_0x217661,_0x5ebb1d),_0x4ea3ee=timeToPosition(_0x997586[_0xfc93cf(0x23e)][_0xfc93cf(0x2b6)],_0x217661,_0x5ebb1d),_0x4ec6bd=getBarChar(_0x997586[_0xfc93cf(0x320)]),_0x55c766=Math[_0xfc93cf(0x258)](_0x9d5a45+0x1,_0x4ea3ee);for(let _0x4ee34b=_0x9d5a45;_0x4ee34b<Math[_0xfc93cf(0x342)](_0x55c766,_0x5ebb1d);_0x4ee34b++){_0x4a3be0[_0x4ee34b]=_0x4ec6bd;}}const _0x2e3cd5=getBarColor(_0x997586[_0xfc93cf(0x320)]),_0x4510b3=_0x4a3be0[_0xfc93cf(0x2a3)](_0x1201ac=>_0x1201ac==='\x20'?'\x20':_0x2e3cd5(_0x1201ac))[_0xfc93cf(0x2dc)]('');return _0x373374+'\x20'+_0x23f468+'│'+_0x4510b3+'│';}function calculateStats(_0x5ead5d){const _0x3dc1c5=a38_0x11e0cd,_0x50c542={'total':_0x5ead5d[_0x3dc1c5(0x279)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x32f4c5 of _0x5ead5d){if(_0x32f4c5['state']==='success')_0x50c542[_0x3dc1c5(0x309)]++;else{if(_0x32f4c5[_0x3dc1c5(0x320)]==='error'||_0x32f4c5['state']===_0x3dc1c5(0x2d7))_0x50c542[_0x3dc1c5(0x290)]++;else _0x32f4c5['state']===_0x3dc1c5(0x2b7)?_0x50c542[_0x3dc1c5(0x2b7)]++:_0x50c542[_0x3dc1c5(0x2d0)]++;}}return _0x50c542;}function formatStats(_0x1fe4bb){const _0x2be2ad=a38_0x11e0cd;return['Total:\x20'+_0x1fe4bb[_0x2be2ad(0x260)],'✅\x20'+_0x1fe4bb[_0x2be2ad(0x309)],'❌\x20'+_0x1fe4bb[_0x2be2ad(0x290)],_0x2be2ad(0x22c)+_0x1fe4bb[_0x2be2ad(0x2b7)],'⏳\x20'+_0x1fe4bb[_0x2be2ad(0x2d0)]][_0x2be2ad(0x2dc)]('\x20\x20');}function a38_0xba68(){const _0x444b07=['✔\x20Workflow\x20run\x20started','table','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20task','project','params','LABEL_MIN_SPACING','✔\x20Clone\x20complete','from','\x27\x20from\x20project\x20\x27','window','finishedAt','startTime','\x20to\x20see\x20detailed\x20logs','✔\x20Downloaded\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','done','Key:\x20','parse','Warning:','Files\x20to\x20upload:\x20','path','\x20-\x20','...','log','kill','unchanged','workflowName','✔\x20Project\x20updated','workflow:retry','workflow:clone','POLL_INTERVAL_MS','Pushing\x20workflow\x20project...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','LABEL_WIDTH_DIVISOR','setSecret','max','sessionId','metadata','\x20tasks','Killing\x20attempt...','includeSubtasks','Parameters:\x20','---\x20','total','\x27...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Expected\x20format:\x20--param\x20key=value','\x20(use\x20--limit\x20to\x20show\x20more)','✔\x20Found\x20','\x0a⚠\x20Project\x20\x22','ICON_WIDTH','\x20\x20Target:\x20','workflow:upload','startsWith','/app/workflows/','Error:','isNewProject','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','filesExtracted','Select\x20a\x20session\x20to\x20view\x20timeline:','sessionTime','Getting\x20attempt\x20tasks...','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:timeline','\x20\x20Files\x20extracted:\x20','Start\x20a\x20workflow\x20run','List\x20workflow\x20execution\x20sessions','No\x20sessions\x20with\x20timing\x20information','length','white','Downloading\x20logs...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Task\x20name:\x20','Error:\x20Secret\x20key\x20is\x20required','set','workflowProject','match','list','rows','List\x20workflow\x20attempts','GUTTER','\x20of\x20','key','every','workflow:tasks','toLowerCase','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','workflow:run','buildTimelineData','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','renderSessionsTimeline','error','filter','\x22\x20with\x20new\x20revision?','verbose','keys','fileCount','status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x0a✔\x20No\x20changes\x20to\x20push','TASK_NAME_WIDTH','substring','\x20attempt','\x20is\x20not\x20a\x20directory','startedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x20from\x20session\x20','From\x20task:\x20','updatedAt','workflow','map','119flTcIo','start','getMonth','force','\x0aPush\x20these\x20changes?','durationMs','includeRetried','stdout','\x22?\x20This\x20cannot\x20be\x20undone.','\x20\x20Revision:\x20','Latest\x20session\x20has\x20no\x20attempt','splice','deleteSecret','fs/promises','revision','generateSessionTimelineRows','diff','Error:\x20Invalid\x20parameter\x20format:\x20','end','running','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','MIN_TIMELINE_WIDTH','dim','Error:\x20KEY=VALUE\x20is\x20required','List\x20all\x20workflow\x20projects','Fetching\x20log\x20files...','ICON_SPACING','No\x20sessions\x20found\x20in\x20project:\x20','session:','Listing\x20secrets...','unknown','replace','Error:\x20Project\x20name\x20is\x20required','\x0aClone\x20\x22','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflow:logs','displayLine','workflows','Error:\x20','session_id','\x20sessions\x20','Output\x20directory:\x20','(unknown)','Error:\x20Invalid\x20JSON\x20in\x20--params','pending','round','✔\x20Retry\x20started','get','workflow:use','getTime','indexOf','group_error','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','249ypCLyk','sort','Getting\x20attempt\x20details...','join','Status:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','projectId','Project:\x20','workflow:download','yellow','\x20\x20Session\x20ID:\x20','getFullYear','Validation:\x20skipped','workflow:secrets:set','param','modified','✔\x20Workflow\x20project\x20context\x20cleared.','Project\x20directory:\x20','MAX_TASKS_DISPLAY','retrySession','listSecrets','List\x20workflows','navigateSessionsInteractive','No\x20sessions\x20found\x20for:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Show\x20specific\x20attempt\x20details','some','showWorkflowConsoleUrl','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','has','getDate','pollTimeline','retryAttemptName','New\x20project\x20name:\x20','text','tdx.json','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20secret','Starting\x20workflow\x20run...','revision:\x20','1833852EghWwu','341490WJTTvD','getHours','\x0a✔\x20Already\x20up\x20to\x20date','toISOString','Pushing\x20project...','No\x20workflows\x20found','success','slice','\x20\x20Session\x20context\x20set\x20to:\x20','workflow:secrets:list','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','split','now','fill','Pattern:\x20','Writing\x20files...','Invalid\x20format:\x20','workflow:push','changes','autocomplete','\x20\x20Console:\x20','isArray','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','follow','yes','\x20\x20Source:\x20','existingProjectId','✔\x20New\x20project:\x20','💡\x20Tip:\x20Use\x20','state','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20attempts\x20found','clear','fileSize','Updating\x20','Retrying\x20attempt...','sourceDir','sessions','lastAttempt','\x22\x20to\x20new\x20project\x20\x22','MAX_POLL_ITERATIONS','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','all','task','Project\x20name\x20is\x20required','Listing\x20workflow\x20projects...','executePushProject','Usage:\x20workflow:delete\x20<project-name-or-id>','MAX_LABEL_COUNT','Retrying\x20session...','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','8tPbHPf','relative','duration','\x0aApply\x20these\x20changes?','Listing\x20workflows...','\x20unchanged','\x20(system)','tdx\x20wf\x20attempt\x20','Loading\x20sessions...','green','Dry\x20run:\x20yes','min','\x20\x20Location:\x20','json','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Include\x20retried:\x20yes','new','targetExists','Cloning\x20to\x20','dryRun','Source\x20directory:\x20','type','skipValidation','prepareCloneProject','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','resolveProject','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','columns','\x20project','attemptId','Using\x20attempt\x20','Loading\x20workflows...','No\x20sessions\x20found','icon','✔\x20Pushed\x20','data','preparePushProject','execute','retryAttempt','projects','newProjectName','✔\x20Workflow\x20project\x20set\x20to:\x20','Filter:\x20project=','Analyzing\x20project...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','message','push','Listing\x20workflow\x20attempts...','logFiles','\x20\x20Workflow:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','session','canceling','sys','Filter:\x20','padStart','Deleting\x20project\x20','getMinutes','fullName','\x20new','Including\x20subtasks:\x20yes','select','site','resumeFrom','12429740DnKIJG','localeCompare','value','Listing\x20workflow\x20sessions...','(use\x20--limit\x20to\x20see\x20more)','red','limit','.\x20Expected\x20format:\x20KEY=VALUE','attempt','✔\x20Deleted\x20project\x20','✔\x20Pull\x20complete','targetDir','floor','trim','cancelRequested','workflow:secrets:delete','planned','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','resolveProjectId','projectName','sourceProjectName','Force:\x20yes','Retry\x20a\x20session\x20or\x20attempt','Cancelled','createdAt','\x20\x20Changes:\x20','stringify','\x1b[1A\x1b[2K','Kill\x20a\x20running\x20attempt','renderTimeline','Select\x20a\x20workflow\x20to\x20run','repeat','1227048NspMpf','📁\x20','resolve','\x20\x20Project:\x20','Project\x20filter:\x20','Params:\x20','Source:\x20','MIN_LABEL_COUNT','write','requireProject','resolveProjectDir','find','cyan','taskName','executeCloneProject','No\x20workflow\x20sessions\x20found','45718rztSdS','Session\x20','Workflow:\x20','workflow:projects','jsonl','\x20\x20Project\x20ID:\x20','workflow:attempts','newProjectId','No\x20workflows\x20found\x20in\x20project:\x20','includes','Error:\x20Attempt\x20ID\x20is\x20required','stat','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','isTTY','Setting\x20secret...','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','index','Attempt:\x20','blue','tasks','Analyzing\x20changes...','\x20deleted','context','No\x20attempts\x20found\x20for:\x20','renderSingleTimeline','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20workflow','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','description','Resume\x20from:\x20','name','utf-8','Show\x20tasks\x20for\x20an\x20attempt','9223848xfNabG','Tip:\x20cd\x20to\x20workflows/','summary','format','\x22\x20already\x20exists\x20(ID:\x20','values','Project\x20name:\x20','\x20has\x20no\x20attempts','hasChanges','✔\x20Secret\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','cwd','Revision:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','Attempt\x20ID:\x20','🔄\x20','No\x20matching\x20sessions\x20found','parseProjectWorkflowPattern','9617915jDgMUo','workflow:sessions','deleted','output'];a38_0xba68=function(){return _0x444b07;};return a38_0xba68();}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x11e0cd(0x21a)]=a38_0x11e0cd(0x274);[a38_0x11e0cd(0x218)]=a38_0x11e0cd(0x28b);async[a38_0x11e0cd(0x35c)](_0x36fa72){const _0x245673=a38_0x11e0cd,{options:_0xd76e5e,args:_0x12d0ca,tdx:_0x2081ec}=_0x36fa72;let _0x5d45f1,_0x3f64d1,_0x585896=![];if(_0x12d0ca[0x0]){if(_0x12d0ca[0x0][_0x245673(0x205)]('.')){const _0x5647ea=this[_0x245673(0x22e)](_0x12d0ca,_0xd76e5e);if(!_0x5647ea)return 0x1;_0x5d45f1=_0x5647ea['projectName'],_0x3f64d1=_0x5647ea[_0x245673(0x24f)];}else{_0x3f64d1=_0x12d0ca[0x0],_0x5d45f1=_0xd76e5e[_0x245673(0x280)];if(!_0x5d45f1)return console[_0x245673(0x290)](a38_0x123249['red'](_0x245673(0x26c)),_0x245673(0x2d8)),0x1;_0x585896=!![];}}else{const _0x112a85=this[_0x245673(0x22e)](_0x12d0ca,_0xd76e5e);if(!_0x112a85)return 0x1;_0x5d45f1=_0x112a85['projectName'],_0x3f64d1=_0x112a85[_0x245673(0x24f)];}if(_0xd76e5e[_0x245673(0x293)]){if(_0x5d45f1&&_0x3f64d1)console[_0x245673(0x290)]('Filter:\x20'+_0x5d45f1+'.'+_0x3f64d1);else _0x5d45f1&&console[_0x245673(0x290)](_0x245673(0x1b6)+_0x5d45f1);}const _0x4c4693=_0xd76e5e[_0x245673(0x354)],_0x597d8f=_0xd76e5e[_0x245673(0x259)];if(_0x4c4693){_0x597d8f&&console['error'](a38_0x123249[_0x245673(0x2e2)](_0x245673(0x247)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x44bb08=_0xd76e5e[_0x245673(0x31a)];return _0x44bb08?await this[_0x245673(0x2f8)](_0x36fa72,_0x4c4693):await this[_0x245673(0x214)](_0x36fa72,_0x4c4693,_0xd76e5e),0x0;}if(_0x597d8f){const _0x4b4355=await withSpinner('Loading\x20session...',()=>_0x2081ec['workflow'][_0x245673(0x328)]({'projectName':_0x5d45f1,'workflowName':_0x3f64d1,'limit':0x64}),{'verbose':_0xd76e5e[_0x245673(0x293)]}),_0x1db13d=_0x4b4355[_0x245673(0x35a)]['find'](_0x2e4fac=>_0x2e4fac['id']===_0x597d8f);if(!_0x1db13d)return console[_0x245673(0x290)](a38_0x123249[_0x245673(0x1d1)](_0x245673(0x26c)),'Session\x20not\x20found:\x20'+_0x597d8f),0x1;if(!_0x1db13d[_0x245673(0x329)]?.['id'])return console[_0x245673(0x290)](a38_0x123249[_0x245673(0x1d1)]('Error:'),_0x245673(0x1fd)+_0x597d8f+_0x245673(0x224)),0x1;const _0x11a891=_0x1db13d[_0x245673(0x329)]['id'];_0xd76e5e[_0x245673(0x293)]&&console['error'](_0x245673(0x355)+_0x11a891+_0x245673(0x29f)+_0x597d8f);const _0x32fcd2=_0xd76e5e[_0x245673(0x31a)];return _0x32fcd2?await this['pollTimeline'](_0x36fa72,_0x11a891):await this[_0x245673(0x214)](_0x36fa72,_0x11a891,_0xd76e5e),0x0;}const _0x52b795=await withSpinner(_0x245673(0x33f),()=>_0x2081ec[_0x245673(0x2a2)][_0x245673(0x328)]({'projectName':_0x5d45f1,'workflowName':_0x3f64d1,'limit':_0xd76e5e[_0x245673(0x1d2)]||0x32}),{'verbose':_0xd76e5e[_0x245673(0x293)]}),_0x958a6e=_0x52b795[_0x245673(0x35a)];if(_0x958a6e['length']===0x0){if(_0x5d45f1&&_0x3f64d1)console[_0x245673(0x290)](_0x245673(0x2f0)+_0x5d45f1+'.'+_0x3f64d1);else _0x5d45f1?console[_0x245673(0x290)](_0x245673(0x2bf)+_0x5d45f1):(console['error'](_0x245673(0x1fb)),console['error'](a38_0x123249[_0x245673(0x2ba)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x958a6e[_0x245673(0x2da)]((_0x185c68,_0x465532)=>{const _0x330271=_0x245673,_0x9aaf7c=_0x185c68[_0x330271(0x271)]||'',_0x12a328=_0x465532['sessionTime']||'';return _0x12a328['localeCompare'](_0x9aaf7c);});if(_0xd76e5e[_0x245673(0x344)]||_0xd76e5e[_0x245673(0x200)])return await handleSDKOutput(_0x958a6e,_0xd76e5e),0x0;let _0x30a59c;if(_0x585896){const _0x524168=_0x958a6e[0x0];if(!_0x524168['lastAttempt']?.['id'])return console[_0x245673(0x290)](_0x245673(0x2ae)),0x0;_0x30a59c=_0x524168[_0x245673(0x329)]['id'],_0xd76e5e[_0x245673(0x293)]&&console[_0x245673(0x290)]('Auto-selected\x20latest\x20session:\x20'+_0x524168[_0x245673(0x271)]);}else{const _0x20b1c5=_0x958a6e[_0x245673(0x2a3)](_0x3e8e6a=>{const _0x1efc8d=_0x245673,_0x2387e1=getAttemptStatusDisplay(_0x3e8e6a[_0x1efc8d(0x329)]);return{'title':_0x3e8e6a[_0x1efc8d(0x238)]?.[_0x1efc8d(0x21a)]+'.'+_0x3e8e6a[_0x1efc8d(0x2a2)]?.[_0x1efc8d(0x21a)]+_0x1efc8d(0x24a)+_0x3e8e6a[_0x1efc8d(0x271)]+'\x20'+_0x2387e1[_0x1efc8d(0x358)],'value':_0x3e8e6a['lastAttempt']?.['id']||'','description':_0x2387e1[_0x1efc8d(0x2fb)]};}),_0x17c021=await a38_0x396379({'type':_0x245673(0x1c9),'name':_0x245673(0x354),'message':_0x245673(0x270),'choices':_0x20b1c5[_0x245673(0x291)](_0xa2fbbe=>_0xa2fbbe[_0x245673(0x1ce)]!=='')});if(!_0x17c021[_0x245673(0x354)])return 0x0;_0x30a59c=_0x17c021[_0x245673(0x354)];}const _0x3aa1a1=_0xd76e5e['follow'];return _0x3aa1a1?await this[_0x245673(0x2f8)](_0x36fa72,_0x30a59c):await this['renderSingleTimeline'](_0x36fa72,_0x30a59c,_0xd76e5e),0x0;}async['renderSingleTimeline'](_0x13012c,_0x3f6a73,_0x505a3c){const _0x3fb868=a38_0x11e0cd,{tdx:_0x38a4c2}=_0x13012c;let _0x4b074e,_0x92ae1a;try{[_0x4b074e,_0x92ae1a]=await Promise[_0x3fb868(0x32e)]([_0x38a4c2[_0x3fb868(0x2a2)][_0x3fb868(0x1d4)](_0x3f6a73),_0x38a4c2[_0x3fb868(0x2a2)]['tasks'](_0x3f6a73,![])]);}catch(_0x49b8d0){console[_0x3fb868(0x290)](a38_0x123249[_0x3fb868(0x1d1)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x505a3c['verbose']&&console['error'](_0x49b8d0);throw _0x49b8d0;}if(_0x505a3c['json']||_0x505a3c[_0x3fb868(0x200)]){const _0x46740a=this[_0x3fb868(0x28d)](_0x4b074e,_0x92ae1a);await handleSDKOutput([_0x46740a],_0x505a3c);return;}const _0x209f18=_0x38a4c2[_0x3fb868(0x212)][_0x3fb868(0x1ca)],_0x47ae7d=this['renderTimeline'](_0x4b074e,_0x92ae1a,_0x209f18);console[_0x3fb868(0x24c)](_0x47ae7d);}async[a38_0x11e0cd(0x2f8)](_0x501fda,_0x24a4e9){const _0x489ca0=a38_0x11e0cd,{tdx:_0x4b50da}=_0x501fda,_0x3d41ea=TIMELINE_CONFIG[_0x489ca0(0x253)],_0x53691a=TIMELINE_CONFIG[_0x489ca0(0x32b)];let _0x1fadbf=0x0;while(_0x1fadbf<_0x53691a){process[_0x489ca0(0x2ab)][_0x489ca0(0x209)]&&process[_0x489ca0(0x2ab)][_0x489ca0(0x1f4)]('\x1bc');let _0xa93bc9,_0x4e5cc8;try{[_0xa93bc9,_0x4e5cc8]=await Promise['all']([_0x4b50da[_0x489ca0(0x2a2)][_0x489ca0(0x1d4)](_0x24a4e9),_0x4b50da[_0x489ca0(0x2a2)]['tasks'](_0x24a4e9,![])]);}catch(_0x25cca2){console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x1d1)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x1fadbf>0x0&&console[_0x489ca0(0x290)](a38_0x123249['dim'](_0x489ca0(0x336)+_0x1fadbf));throw _0x25cca2;}const _0x2c08df=_0x4b50da[_0x489ca0(0x212)][_0x489ca0(0x1ca)],_0x10591b=this[_0x489ca0(0x1e9)](_0xa93bc9,_0x4e5cc8,_0x2c08df);console[_0x489ca0(0x24c)](_0x10591b);const _0x2e2819=_0xa93bc9['done']&&_0x4e5cc8[_0x489ca0(0x288)](_0x2b4119=>_0x2b4119[_0x489ca0(0x320)]!=='running'&&_0x2b4119[_0x489ca0(0x320)]!==_0x489ca0(0x1dc));if(_0x2e2819){console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x340)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x2ba)]('\x0aPolling...\x20('+_0x1fadbf*0x2+_0x489ca0(0x2b8))),await new Promise(_0x2f4e87=>setTimeout(_0x2f4e87,_0x3d41ea)),_0x1fadbf++;}_0x1fadbf>=_0x53691a&&console[_0x489ca0(0x290)](a38_0x123249[_0x489ca0(0x2e2)](_0x489ca0(0x345)));}[a38_0x11e0cd(0x1e9)](_0x3e8200,_0x5602ba,_0x2306ee){const _0xddb7fa=a38_0x11e0cd,_0xb28ce6=[],_0x578b9c=TIMELINE_CONFIG[_0xddb7fa(0x299)],_0x3a26ae=0x5,_0x2b2e32=process[_0xddb7fa(0x2ab)][_0xddb7fa(0x352)]||0x78,_0x11d852=_0x2b2e32-_0x578b9c-_0x3a26ae,_0x7342b1=Math[_0xddb7fa(0x258)](TIMELINE_CONFIG[_0xddb7fa(0x2b9)],Math['min'](_0x11d852,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x592b01=new Date(_0x3e8200[_0xddb7fa(0x1e4)])[_0xddb7fa(0x2d5)](),_0x4a7607=_0x3e8200[_0xddb7fa(0x23f)]?new Date(_0x3e8200['finishedAt'])['getTime']():Date[_0xddb7fa(0x30f)](),_0x343ebd={'start':_0x592b01,'end':_0x4a7607,'duration':_0x4a7607-_0x592b01},_0x26acef=new Map(),_0x267ddf=[];for(const _0x472c34 of _0x5602ba){if(_0x472c34[_0xddb7fa(0x29d)]){const _0x267a87=new Date(_0x472c34[_0xddb7fa(0x29d)])['getTime'](),_0x5cec46=_0x472c34[_0xddb7fa(0x2a1)]?new Date(_0x472c34[_0xddb7fa(0x2a1)])[_0xddb7fa(0x2d5)]():Date['now'](),_0x21d97a={'start':_0x267a87,'end':_0x5cec46,'duration':_0x5cec46-_0x267a87};_0x26acef[_0xddb7fa(0x27f)](_0x472c34['id'],_0x21d97a),_0x267ddf['push']({'name':_0x472c34[_0xddb7fa(0x1c6)],'state':_0x472c34['state']||'unknown','window':_0x21d97a});}else _0x267ddf[_0xddb7fa(0x1ba)]({'name':_0x472c34['fullName'],'state':_0x472c34['state']||_0xddb7fa(0x1dc),'window':undefined});}_0x267ddf[_0xddb7fa(0x2da)]((_0x1a86dc,_0x50e5ef)=>{const _0x478feb=_0xddb7fa;if(!_0x1a86dc[_0x478feb(0x23e)])return 0x1;if(!_0x50e5ef[_0x478feb(0x23e)])return-0x1;return _0x1a86dc[_0x478feb(0x23e)]['start']-_0x50e5ef['window'][_0x478feb(0x2a5)];});const _0x45cbe5=_0x267ddf[_0xddb7fa(0x279)],_0x20d93d=_0x45cbe5>TIMELINE_CONFIG[_0xddb7fa(0x2eb)];_0x20d93d&&_0x267ddf[_0xddb7fa(0x2af)](TIMELINE_CONFIG[_0xddb7fa(0x2eb)]);const _0x5cc551=calculateTimeScale(_0x343ebd,_0x7342b1),_0x1ea058=_0x3e8200['done']?_0x3e8200[_0xddb7fa(0x309)]?a38_0x123249[_0xddb7fa(0x340)]('success'):a38_0x123249['red'](_0xddb7fa(0x290)):a38_0x123249[_0xddb7fa(0x20e)](_0xddb7fa(0x2b7)),_0x21f7e5=_0x3e8200[_0xddb7fa(0x238)]?.['id'],_0x2094c9=_0x3e8200['sessionId'];let _0x31adee;if(_0x21f7e5&&_0x2094c9){const _0x46738d=getWorkflowAttemptUrl(_0x2306ee,_0x21f7e5,_0x2094c9,_0x3e8200['id']);_0x31adee=hyperlink(a38_0x123249[_0xddb7fa(0x2ba)](_0x3e8200['id']),_0x46738d);}else _0x31adee=a38_0x123249[_0xddb7fa(0x2ba)](_0x3e8200['id']);_0xb28ce6[_0xddb7fa(0x1ba)](_0xddb7fa(0x20d)+_0x31adee+_0xddb7fa(0x24a)+_0x1ea058+_0xddb7fa(0x24a)+formatElapsed(_0x343ebd[_0xddb7fa(0x339)]));if(_0x267ddf['length']>0x0){const _0xd80446=renderTimeAxis(_0x5cc551,_0x7342b1),_0x54615a=new Date(_0x343ebd[_0xddb7fa(0x2a5)]),_0x125fb1=formatDate(_0x54615a),_0x13a661=TIMELINE_CONFIG[_0xddb7fa(0x267)]+TIMELINE_CONFIG[_0xddb7fa(0x2be)]+_0x578b9c,_0x41eb7c=_0x125fb1[_0xddb7fa(0x1c3)](_0x13a661),_0x5dd640=a38_0x123249[_0xddb7fa(0x2ba)](_0x41eb7c);_0xb28ce6[_0xddb7fa(0x1ba)](_0x5dd640+'\x20'+_0xd80446);for(const _0x2b2a4a of _0x267ddf){_0xb28ce6['push'](renderTaskRow(_0x2b2a4a,_0x5cc551,_0x7342b1,_0x578b9c));}const _0x4fd347=calculateStats(_0x267ddf);_0xb28ce6[_0xddb7fa(0x1ba)](formatStats(_0x4fd347)),_0x20d93d&&_0xb28ce6[_0xddb7fa(0x1ba)](a38_0x123249[_0xddb7fa(0x2e2)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0xddb7fa(0x2eb)]+_0xddb7fa(0x286)+_0x45cbe5+_0xddb7fa(0x25b))),_0xb28ce6['push'](''),_0xb28ce6[_0xddb7fa(0x1ba)](a38_0x123249[_0xddb7fa(0x2ba)](_0xddb7fa(0x31f))+(_0xddb7fa(0x33e)+_0x3e8200['id']+'\x20logs')+a38_0x123249[_0xddb7fa(0x2ba)](_0xddb7fa(0x241)));}else _0xb28ce6[_0xddb7fa(0x1ba)](_0xddb7fa(0x2fd));return _0xb28ce6[_0xddb7fa(0x2dc)]('\x0a');}[a38_0x11e0cd(0x28d)](_0x206ed3,_0x1b1ced){const _0x27bce0=a38_0x11e0cd,_0x22f389=new Date(_0x206ed3[_0x27bce0(0x1e4)])[_0x27bce0(0x2d5)](),_0x2f04a4=_0x206ed3['finishedAt']?new Date(_0x206ed3[_0x27bce0(0x23f)])['getTime']():Date[_0x27bce0(0x30f)](),_0x5ddc9d=_0x2f04a4-_0x22f389,_0x1dc459=[];for(const _0x45a14a of _0x1b1ced){if(_0x45a14a[_0x27bce0(0x29d)]){const _0x3ba6d8=new Date(_0x45a14a['startedAt'])[_0x27bce0(0x2d5)](),_0x24bc3b=_0x45a14a[_0x27bce0(0x2a1)]?new Date(_0x45a14a[_0x27bce0(0x2a1)])[_0x27bce0(0x2d5)]():Date[_0x27bce0(0x30f)]();_0x1dc459['push']({'name':_0x45a14a['fullName'],'state':_0x45a14a[_0x27bce0(0x320)]||_0x27bce0(0x2c2),'window':{'start':_0x3ba6d8,'end':_0x24bc3b,'duration':_0x24bc3b-_0x3ba6d8}});}else _0x1dc459['push']({'name':_0x45a14a[_0x27bce0(0x1c6)],'state':_0x45a14a[_0x27bce0(0x320)]||_0x27bce0(0x1dc),'window':undefined});}const _0x598462=calculateStats(_0x1dc459);return{'attempt':{'id':_0x206ed3['id'],'status':_0x206ed3['done']?_0x206ed3[_0x27bce0(0x309)]?_0x27bce0(0x309):_0x27bce0(0x290):_0x27bce0(0x2b7),'createdAt':_0x206ed3[_0x27bce0(0x1e4)],'finishedAt':_0x206ed3['finishedAt'],'duration_ms':_0x5ddc9d},'tasks':_0x1dc459[_0x27bce0(0x2a3)](_0x1fc054=>({'name':_0x1fc054['name'],'state':_0x1fc054[_0x27bce0(0x320)],'startedAt':_0x1fc054[_0x27bce0(0x23e)]?new Date(_0x1fc054[_0x27bce0(0x23e)][_0x27bce0(0x2a5)])[_0x27bce0(0x306)]():null,'updatedAt':_0x1fc054['window']?new Date(_0x1fc054[_0x27bce0(0x23e)][_0x27bce0(0x2b6)])[_0x27bce0(0x306)]():null,'duration_ms':_0x1fc054['window']?.[_0x27bce0(0x339)]||null})),'stats':_0x598462};}}
1
+ const a38_0x5bd661=a38_0x51c6;(function(_0x5eabc9,_0x3a2005){const _0x5037ad=a38_0x51c6,_0x54223b=_0x5eabc9();while(!![]){try{const _0xb96941=-parseInt(_0x5037ad(0x23f))/0x1*(-parseInt(_0x5037ad(0x230))/0x2)+parseInt(_0x5037ad(0x251))/0x3+parseInt(_0x5037ad(0x20a))/0x4+-parseInt(_0x5037ad(0x218))/0x5*(parseInt(_0x5037ad(0x184))/0x6)+parseInt(_0x5037ad(0x173))/0x7*(-parseInt(_0x5037ad(0x27a))/0x8)+parseInt(_0x5037ad(0x2d5))/0x9+-parseInt(_0x5037ad(0x1bd))/0xa*(-parseInt(_0x5037ad(0x22a))/0xb);if(_0xb96941===_0x3a2005)break;else _0x54223b['push'](_0x54223b['shift']());}catch(_0x4089c8){_0x54223b['push'](_0x54223b['shift']());}}}(a38_0x1523,0x8a277));import a38_0x24740f from'chalk';import{existsSync}from'fs';import a38_0x493b10 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 a38_0x1571f3 from'prompts';function getAttemptStatusDisplay(_0x179dc3){const _0x2e3d22=a38_0x51c6;if(!_0x179dc3)return{'icon':'⏳','text':''};const {done:_0xaf28c7,success:_0x3ff66c,cancelRequested:_0x2c4e25}=_0x179dc3;if(!_0xaf28c7)return _0x2c4e25?{'icon':'🛑','text':a38_0x24740f[_0x2e3d22(0x2eb)]('canceling')}:{'icon':'🔄','text':a38_0x24740f['blue'](_0x2e3d22(0x272))};if(_0x3ff66c)return{'icon':'✅','text':a38_0x24740f[_0x2e3d22(0x265)](_0x2e3d22(0x214))};return{'icon':'❌','text':a38_0x24740f[_0x2e3d22(0x1d2)](_0x2e3d22(0x170))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x5bd661(0x1e6)](_0xa72c4a,_0xf23068,_0xf7d1e2=0x0){const _0x15dbc9=a38_0x5bd661;return _0xa72c4a[_0xf7d1e2]||_0xf23068[_0x15dbc9(0x228)];}[a38_0x5bd661(0x186)](_0x2e3c8c,_0x49fd12,_0x445226=0x0){const _0x492bf6=a38_0x5bd661,_0x80202c=this['resolveProject'](_0x2e3c8c,_0x49fd12,_0x445226);if(!_0x80202c)return console[_0x492bf6(0x170)](a38_0x24740f[_0x492bf6(0x1d2)](_0x492bf6(0x199)),_0x492bf6(0x2b1)),console[_0x492bf6(0x170)](a38_0x24740f[_0x492bf6(0x179)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x80202c;}[a38_0x5bd661(0x2f0)](_0x229460,_0x3d42d6){const _0x380256=a38_0x5bd661;if(_0x229460[0x0]){const _0x28d6df=_0x229460[0x0][_0x380256(0x253)]('.');if(_0x28d6df[_0x380256(0x20d)]===0x1)return{'projectName':_0x28d6df[0x0],'workflowName':undefined};else return _0x28d6df[_0x380256(0x20d)]===0x2?{'projectName':_0x28d6df[0x0],'workflowName':_0x28d6df[0x1]}:(console[_0x380256(0x170)](a38_0x24740f[_0x380256(0x1d2)]('Error:'),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x3d42d6[_0x380256(0x228)],'workflowName':undefined};}[a38_0x5bd661(0x2f5)](_0x4d59e,_0x2e4bf1,_0x4d7e85=0x0){const _0x5d6fab=a38_0x5bd661;if(_0x4d59e[_0x4d7e85])return _0x4d59e[_0x4d7e85];if(_0x2e4bf1[_0x5d6fab(0x228)]){const _0x5d5a98=a38_0x493b10[_0x5d6fab(0x204)](process[_0x5d6fab(0x2cf)](),_0x5d6fab(0x225),_0x2e4bf1[_0x5d6fab(0x228)]);if(existsSync(a38_0x493b10[_0x5d6fab(0x204)](_0x5d5a98,_0x5d6fab(0x2b4))))return _0x5d5a98;}return undefined;}async[a38_0x5bd661(0x270)](_0x5dd2a4,_0x39aaee,_0x58fd6c){const _0x129a62=a38_0x5bd661;try{const _0x306a61=await _0x5dd2a4['workflow'][_0x129a62(0x225)](_0x39aaee,{'limit':0x1});if(_0x306a61['length']>0x0){const _0x208f93=_0x306a61[0x0]['id'],_0x1f623b=getWorkflowUrl(_0x58fd6c,_0x208f93);console[_0x129a62(0x170)](_0x129a62(0x15a)+a38_0x24740f[_0x129a62(0x1ba)](_0x1f623b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x1fd);['description']=a38_0x5bd661(0x2ae);async['execute'](_0x2653a2){const _0x423f70=a38_0x5bd661,{options:_0x17cddb,args:_0x43edc3,tdx:_0x9f068a}=_0x2653a2,_0x5a3e6f=_0x43edc3[0x0],_0x151a2a=_0x17cddb[_0x423f70(0x2dc)];if(_0x151a2a)return saveSessionContext({'workflow_project':undefined},_0x17cddb[_0x423f70(0x2a3)]),console[_0x423f70(0x2ce)](a38_0x24740f[_0x423f70(0x265)](_0x423f70(0x226))),0x0;if(!_0x5a3e6f)return console[_0x423f70(0x170)](a38_0x24740f['red'](_0x423f70(0x199)),_0x423f70(0x2b1)),console[_0x423f70(0x170)](a38_0x24740f[_0x423f70(0x179)](_0x423f70(0x18a))),console['error'](a38_0x24740f[_0x423f70(0x179)](_0x423f70(0x26f))),0x1;const _0x5a987e=await withSpinner(_0x423f70(0x243)+_0x5a3e6f+_0x423f70(0x254),()=>_0x9f068a[_0x423f70(0x2e5)][_0x423f70(0x237)](_0x5a3e6f),{'verbose':_0x17cddb[_0x423f70(0x2f3)]}),{name:_0x3b59c2}=_0x5a987e[_0x423f70(0x1b8)];return saveSessionContext({'workflow_project':_0x3b59c2},_0x17cddb[_0x423f70(0x2a3)]),console[_0x423f70(0x2ce)](a38_0x24740f[_0x423f70(0x265)](_0x423f70(0x28a)+a38_0x24740f[_0x423f70(0x1ba)](_0x3b59c2))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x20c);[a38_0x5bd661(0x26e)]='List\x20all\x20workflow\x20projects';async[a38_0x5bd661(0x19a)](_0x5c43b1){const _0x1c7efd=a38_0x5bd661,{options:_0x48f680,args:_0x5c402f,tdx:_0x5e1000}=_0x5c43b1,_0xf5f0ad=_0x5c402f[0x0];_0x48f680['verbose']&&_0xf5f0ad&&console[_0x1c7efd(0x170)](_0x1c7efd(0x2da)+_0xf5f0ad);const _0x228d5d=await withSpinner(_0x1c7efd(0x26b),()=>_0x5e1000['workflow'][_0x1c7efd(0x1e5)](_0xf5f0ad,{'limit':_0x48f680[_0x1c7efd(0x169)]}),{'verbose':_0x48f680[_0x1c7efd(0x2f3)]});let _0x4a75ec=_0x228d5d[_0x1c7efd(0x1b8)];_0x4a75ec[_0x1c7efd(0x18c)]((_0x4ef5d5,_0x24b37b)=>_0x4ef5d5[_0x1c7efd(0x1f7)]['localeCompare'](_0x24b37b[_0x1c7efd(0x1f7)]));const _0x509bbc=_0x48f680[_0x1c7efd(0x169)]||0x64,_0x4cdcf7=_0x4a75ec[_0x1c7efd(0x20d)]>=_0x509bbc?a38_0x24740f['dim'](_0x1c7efd(0x1c7)):'';console['error'](_0x1c7efd(0x1a4)+_0x4a75ec[_0x1c7efd(0x20d)]+'\x20project'+(_0x4a75ec[_0x1c7efd(0x20d)]!==0x1?'s':'')+_0x4cdcf7);if(_0x48f680['format']===_0x1c7efd(0x256)||_0x48f680[_0x1c7efd(0x1e7)]===_0x1c7efd(0x2b5)||_0x48f680[_0x1c7efd(0x1e7)]===_0x1c7efd(0x244))await handleSDKOutput(_0x4a75ec,_0x48f680);else{if(_0x4a75ec['length']===0x0)_0xf5f0ad?console['log'](_0x1c7efd(0x16b)+_0xf5f0ad):console['log'](_0x1c7efd(0x2b2));else{const _0x5373cb=_0x4a75ec[_0x1c7efd(0x2cb)](_0x46ade2=>{const _0x2db0a8=_0x1c7efd,_0x50248a=_0x46ade2[_0x2db0a8(0x263)]?.[_0x2db0a8(0x264)](_0x5a2768=>_0x5a2768[_0x2db0a8(0x202)]===_0x2db0a8(0x2c0)),_0x29e1b7=_0x50248a?a38_0x24740f[_0x2db0a8(0x179)](_0x2db0a8(0x1ce)):'';return _0x2db0a8(0x1a6)+_0x46ade2[_0x2db0a8(0x1f7)]+_0x29e1b7;});await writeOutput(_0x5373cb[_0x1c7efd(0x204)]('\x0a'),_0x48f680['output'],_0x1c7efd(0x269));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x1b3);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x1b4);async['execute'](_0x47a009){const _0x2e0746=a38_0x5bd661,{options:_0x2a5e20,args:_0x202ea1,tdx:_0x2d7d35}=_0x47a009,_0x580069=this[_0x2e0746(0x1e6)](_0x202ea1,_0x2a5e20);_0x2a5e20[_0x2e0746(0x2f3)]&&_0x580069&&console[_0x2e0746(0x170)]('Project\x20filter:\x20'+_0x580069);const _0x3d6fd7=await withSpinner(_0x2e0746(0x2d4),()=>_0x2d7d35[_0x2e0746(0x2e5)][_0x2e0746(0x225)](_0x580069,{'limit':_0x2a5e20[_0x2e0746(0x169)]}),{'verbose':_0x2a5e20['verbose']});let _0x4f08b4=_0x3d6fd7[_0x2e0746(0x1b8)];_0x4f08b4[_0x2e0746(0x18c)]((_0x288104,_0x909a12)=>{const _0x7379fd=_0x2e0746,_0x116225=_0x288104[_0x7379fd(0x1f7)][_0x7379fd(0x211)](_0x909a12[_0x7379fd(0x1f7)]);if(_0x116225!==0x0)return _0x116225;return(_0x288104['project']?.[_0x7379fd(0x1f7)]||'')[_0x7379fd(0x211)](_0x909a12[_0x7379fd(0x2e2)]?.[_0x7379fd(0x1f7)]||'');});const _0x57bcae=_0x2a5e20['limit']||0x64,_0x36b1df=_0x4f08b4[_0x2e0746(0x20d)]>=_0x57bcae?a38_0x24740f['dim'](_0x2e0746(0x1c7)):'';console['error'](_0x2e0746(0x1a4)+_0x4f08b4[_0x2e0746(0x20d)]+_0x2e0746(0x1fe)+(_0x4f08b4[_0x2e0746(0x20d)]!==0x1?'s':'')+_0x36b1df);if(_0x2a5e20['format']===_0x2e0746(0x256)||_0x2a5e20[_0x2e0746(0x1e7)]===_0x2e0746(0x2b5)||_0x2a5e20[_0x2e0746(0x1e7)]==='table')await handleSDKOutput(_0x4f08b4,_0x2a5e20);else{if(_0x4f08b4[_0x2e0746(0x20d)]===0x0)_0x580069?console[_0x2e0746(0x2ce)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x580069):console[_0x2e0746(0x2ce)](_0x2e0746(0x17d));else{const _0xd75d58=_0x2a5e20[_0x2e0746(0x16a)],_0x3b3ccf=_0x4f08b4['map'](_0x2c2cf1=>{const _0x22cc0e=_0x2e0746,_0x23002e=a38_0x24740f[_0x22cc0e(0x179)]('#'+_0x2c2cf1['id']),_0x3c73a2=hyperlink(_0x23002e,getWorkflowUrl(_0xd75d58,_0x2c2cf1['id'])),_0x20929d=_0x2c2cf1[_0x22cc0e(0x2e2)]?.[_0x22cc0e(0x1f7)]?a38_0x24740f['dim']('\x20('+_0x2c2cf1[_0x22cc0e(0x2e2)][_0x22cc0e(0x1f7)]+')'):'';return'📋\x20'+_0x3c73a2+'\x20'+_0x2c2cf1['name']+_0x20929d;});await writeOutput(_0x3b3ccf[_0x2e0746(0x204)]('\x0a'),_0x2a5e20[_0x2e0746(0x252)],_0x2e0746(0x269));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']='workflow:sessions';[a38_0x5bd661(0x26e)]='List\x20workflow\x20execution\x20sessions';async[a38_0x5bd661(0x19a)](_0x3991da){const _0x745200=a38_0x5bd661,{options:_0x5d07f6,args:_0x4c4409,tdx:_0x5752bb}=_0x3991da,_0x5c0154=this[_0x745200(0x2f0)](_0x4c4409,_0x5d07f6);if(!_0x5c0154)return 0x1;const {projectName:_0xbff2c9,workflowName:_0x38eba2}=_0x5c0154;if(_0x5d07f6['verbose']){if(_0xbff2c9&&_0x38eba2)console[_0x745200(0x170)]('Filter:\x20'+_0xbff2c9+'.'+_0x38eba2);else _0xbff2c9&&console[_0x745200(0x170)](_0x745200(0x1f9)+_0xbff2c9);const _0x475189=_0x5d07f6[_0x745200(0x2a0)];_0x475189&&console[_0x745200(0x170)](_0x745200(0x2df)+_0x475189);}let _0x3ebee3=0x28;if(process[_0x745200(0x1ab)][_0x745200(0x174)]&&!_0x5d07f6[_0x745200(0x252)]&&!_0x5d07f6[_0x745200(0x1e7)]){const _0x4ca4ef=process['stdout'][_0x745200(0x1b6)]||0x28;_0x3ebee3=Math[_0x745200(0x2f7)](0x14,Math[_0x745200(0x208)](_0x4ca4ef*0x2/0x3));}const _0x1dc175=_0x5d07f6[_0x745200(0x169)]||_0x3ebee3,_0x23d678=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x5752bb[_0x745200(0x2e5)][_0x745200(0x291)]({'projectName':_0xbff2c9,'workflowName':_0x38eba2,'status':_0x5d07f6[_0x745200(0x2a0)],'fromTime':_0x5d07f6[_0x745200(0x209)],'toTime':_0x5d07f6['to'],'limit':_0x1dc175}),{'verbose':_0x5d07f6[_0x745200(0x2f3)]}),_0xbfb22b=_0x23d678[_0x745200(0x1b8)];_0xbfb22b[_0x745200(0x18c)]((_0x379c6c,_0x43ac1c)=>{const _0xf945cc=_0x745200,_0x136218=_0x379c6c[_0xf945cc(0x2af)]||'',_0xcf0bea=_0x43ac1c[_0xf945cc(0x2af)]||'';return _0xcf0bea[_0xf945cc(0x211)](_0x136218);});_0xbfb22b[_0x745200(0x20d)]>=_0x1dc175?console[_0x745200(0x170)](_0x745200(0x26c)+_0xbfb22b[_0x745200(0x20d)]+'\x20sessions\x20'+a38_0x24740f[_0x745200(0x179)](_0x745200(0x1d6))):console[_0x745200(0x170)](_0x745200(0x1a4)+_0xbfb22b['length']+_0x745200(0x201)+(_0xbfb22b[_0x745200(0x20d)]!==0x1?'s':''));if(_0x5d07f6[_0x745200(0x1e7)]==='json'||_0x5d07f6[_0x745200(0x1e7)]==='jsonl'||_0x5d07f6[_0x745200(0x1e7)]===_0x745200(0x244))await handleSDKOutput(_0xbfb22b,_0x5d07f6);else{if(!process['stdout'][_0x745200(0x174)]||_0x5d07f6[_0x745200(0x252)]){if(_0xbfb22b['length']===0x0){if(_0xbff2c9&&_0x38eba2)console['log']('No\x20sessions\x20found\x20for:\x20'+_0xbff2c9+'.'+_0x38eba2);else _0xbff2c9?console['log'](_0x745200(0x2b3)+_0xbff2c9):console[_0x745200(0x2ce)](_0x745200(0x1be));}else{const _0x124e68=_0x5d07f6[_0x745200(0x16a)],_0x2e4e4c=this['renderSessionsTimeline'](_0xbfb22b,_0x124e68);_0x5d07f6[_0x745200(0x252)]?await writeOutput(_0x2e4e4c,_0x5d07f6['output'],_0x745200(0x269)):console[_0x745200(0x2ce)](_0x2e4e4c);}!_0xbff2c9&&(console['error'](''),console[_0x745200(0x170)](a38_0x24740f['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x745200(0x170)](a38_0x24740f[_0x745200(0x179)](_0x745200(0x2b6))+'or'+a38_0x24740f[_0x745200(0x179)](_0x745200(0x193))));}else{if(_0xbfb22b['length']===0x0){if(_0xbff2c9&&_0x38eba2)console['log']('No\x20sessions\x20found\x20for:\x20'+_0xbff2c9+'.'+_0x38eba2);else _0xbff2c9?console[_0x745200(0x2ce)](_0x745200(0x2b3)+_0xbff2c9):console['log']('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0xbfb22b,_0x3991da,_0xbff2c9);}}return 0x0;}[a38_0x5bd661(0x223)](_0x3def72,_0x27a510){const _0x359507=a38_0x5bd661,_0x169402=[],_0x221641=new Map();let _0xc77064=Infinity,_0x4f972c=-Infinity;for(const _0x20c4b4 of _0x3def72){if(_0x20c4b4['lastAttempt']?.['createdAt']){const _0x53fb92=new Date(_0x20c4b4[_0x359507(0x242)][_0x359507(0x1fb)])['getTime'](),_0x432dcd=_0x20c4b4['lastAttempt']['finishedAt']?new Date(_0x20c4b4['lastAttempt'][_0x359507(0x203)])[_0x359507(0x2e4)]():Date[_0x359507(0x22b)](),_0x56a570=_0x20c4b4[_0x359507(0x2e2)]?.[_0x359507(0x1f7)]||_0x359507(0x182);!_0x221641[_0x359507(0x1d7)](_0x56a570)&&_0x221641[_0x359507(0x276)](_0x56a570,[]),_0x221641[_0x359507(0x2bd)](_0x56a570)['push']({'session':_0x20c4b4,'startTime':_0x53fb92,'endTime':_0x432dcd,'duration':_0x432dcd-_0x53fb92}),_0xc77064=Math['min'](_0xc77064,_0x53fb92),_0x4f972c=Math[_0x359507(0x2f7)](_0x4f972c,_0x432dcd);}}if(_0x221641[_0x359507(0x28d)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x39096e=process['stdout'][_0x359507(0x300)]||0x78,_0xd7e743=0x1e,_0x65dc99=0x32,_0xe1d47f=0x4,_0x2aa660=Math[_0x359507(0x294)](_0x65dc99,Math[_0x359507(0x2f7)](_0xd7e743,Math[_0x359507(0x208)](_0x39096e*0.3))),_0x2f2ee4=_0x39096e-_0x2aa660-TIMELINE_CONFIG[_0x359507(0x2c6)]-0x3-_0xe1d47f,_0x2d8283=_0x4f972c-_0xc77064,_0x1688b5=_0x2d8283/_0x2aa660,_0x9d4713=renderTimeAxis({'startTime':_0xc77064,'endTime':_0x4f972c,'durationMs':_0x2d8283,'msPerChar':_0x1688b5},_0x2aa660),_0x47eeaf=[];for(const _0x5764b0 of _0x221641['values']()){_0x47eeaf[_0x359507(0x2d6)](..._0x5764b0);}_0x47eeaf[_0x359507(0x18c)]((_0x2ebfc8,_0x342d5f)=>_0x342d5f[_0x359507(0x1e1)]-_0x2ebfc8[_0x359507(0x1e1)]);const _0x4b329b=new Date(_0xc77064),_0x2d8c31=formatDate(_0x4b329b),_0x27d9e5=_0xe1d47f+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x359507(0x2a6)]+_0x2f2ee4,_0x3192f3='\x20'[_0x359507(0x2a2)](_0x27d9e5-_0x2d8c31['length']),_0x51a875=_0x3192f3+a38_0x24740f[_0x359507(0x179)](_0x2d8c31)+'\x20'+_0x9d4713;_0x169402[_0x359507(0x2d6)](_0x51a875);const _0x499295=0x16;let _0x260f48=0x0;for(const _0x505fe0 of _0x47eeaf){const _0x24c70a=_0x505fe0[_0x359507(0x2a3)][_0x359507(0x2e2)]?.[_0x359507(0x1f7)]||'?',_0xbd5541=Math[_0x359507(0x294)](stringWidth(_0x24c70a),_0x499295);_0x260f48=Math[_0x359507(0x2f7)](_0x260f48,_0xbd5541);}for(const _0x512db1 of _0x47eeaf){const {session:_0x571a7e,startTime:_0x25fe6b,endTime:_0x1ba433,duration:_0x1a2006}=_0x512db1,_0x1468a5=_0x571a7e[_0x359507(0x2e2)]?.['id'],_0x12c44d=_0x571a7e['id'],_0x1d3bba=_0x571a7e[_0x359507(0x2e2)]?.[_0x359507(0x1f7)]||'?',_0x267a67=_0x571a7e[_0x359507(0x2e5)]?.[_0x359507(0x1f7)]||'?';let _0x2045f6,_0x438d70;if(_0x571a7e['lastAttempt']){const _0x4e723a=_0x571a7e[_0x359507(0x242)];!_0x4e723a['done']?(_0x2045f6=_0x4e723a[_0x359507(0x2c2)]?'🛑':'🔄',_0x438d70=_0x4e723a[_0x359507(0x2c2)]?a38_0x24740f[_0x359507(0x2eb)]:a38_0x24740f['blue']):(_0x2045f6=_0x4e723a['success']?'✅':'❌',_0x438d70=_0x4e723a[_0x359507(0x214)]?a38_0x24740f[_0x359507(0x265)]:a38_0x24740f[_0x359507(0x1d2)]);}else _0x2045f6='⏳',_0x438d70=a38_0x24740f[_0x359507(0x179)];const _0x5412e1='#'+_0x12c44d,_0x453cac=_0x1468a5?hyperlink(_0x5412e1,getWorkflowSessionUrl(_0x27a510,_0x1468a5,_0x12c44d)):_0x5412e1;let _0x1b6c68=_0x1d3bba;stringWidth(_0x1d3bba)>_0x499295&&(_0x1b6c68=_0x1d3bba[_0x359507(0x1cf)](0x0,_0x499295-0x1)+'…');const _0x5a82d1=a38_0x24740f[_0x359507(0x179)](_0x1b6c68),_0x297820=stringWidth(_0x1b6c68),_0x103322='\x20'['repeat'](_0x260f48-stringWidth(_0x1b6c68)+0x2),_0x44d8a4='('+formatElapsed(_0x1a2006)+')',_0x12b8e7=stringWidth(_0x44d8a4),_0x15fa89=stringWidth(_0x5412e1),_0x9d56ef=_0x15fa89+0x1+_0x297820+_0x103322[_0x359507(0x20d)],_0x438521=_0x2f2ee4-_0x9d56ef-_0x12b8e7-0x1-0x8;let _0x47bf26=_0x267a67;stringWidth(_0x47bf26)>_0x438521&&(_0x47bf26=_0x47bf26[_0x359507(0x1cf)](0x0,_0x438521-0x1)+'…');const _0x14e07b=_0x453cac+'\x20'+_0x5a82d1+_0x103322+_0x47bf26,_0x2818aa=stringWidth(_0x14e07b),_0x375f66=_0x2f2ee4-_0x2818aa-_0x12b8e7,_0xb84595=_0x14e07b+'\x20'[_0x359507(0x2a2)](Math[_0x359507(0x2f7)](0x1,_0x375f66))+a38_0x24740f['dim'](_0x44d8a4),_0x19621a=Math['floor']((_0x25fe6b-_0xc77064)/_0x1688b5),_0x2b26df=Math[_0x359507(0x208)]((_0x1ba433-_0xc77064)/_0x1688b5),_0x5d6b09=Math[_0x359507(0x2f7)](_0x19621a+0x1,_0x2b26df),_0xc40422=new Array(_0x2aa660)['fill']('\x20');for(let _0x5b2069=_0x19621a;_0x5b2069<Math['min'](_0x5d6b09,_0x2aa660);_0x5b2069++){_0xc40422[_0x5b2069]='─';}const _0x3ecfa7=_0xc40422[_0x359507(0x2cb)](_0x5d2ca9=>_0x5d2ca9==='\x20'?'\x20':_0x438d70(_0x5d2ca9))[_0x359507(0x204)]('');_0x169402[_0x359507(0x2d6)](_0x2045f6+'\x20'+_0xb84595+'│'+_0x3ecfa7+'│');}return _0x169402['join']('\x0a');}async[a38_0x5bd661(0x1c4)](_0x23a8a2,_0x3ea7e7,_0x34efd5){const _0x3e6f81=a38_0x5bd661,{options:_0x4d8a3a,tdx:_0x3cd614}=_0x3ea7e7,_0x5fd746=_0x4d8a3a[_0x3e6f81(0x16a)],{timelineRows:_0xabc34f,timeAxisHeader:_0x4073eb}=this[_0x3e6f81(0x2a5)](_0x23a8a2,_0x5fd746),_0x5d3a39=_0xabc34f['filter'](_0x5532e4=>_0x5532e4[_0x3e6f81(0x1dc)]);if(_0x5d3a39[_0x3e6f81(0x20d)]===0x0){const _0x2ca0c8=this[_0x3e6f81(0x223)](_0x23a8a2,_0x5fd746);console['log'](_0x2ca0c8);!_0x34efd5&&(console[_0x3e6f81(0x170)](''),console[_0x3e6f81(0x170)](a38_0x24740f[_0x3e6f81(0x179)](_0x3e6f81(0x1cc))),console[_0x3e6f81(0x170)](a38_0x24740f[_0x3e6f81(0x179)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a38_0x24740f[_0x3e6f81(0x179)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x4073eb&&console[_0x3e6f81(0x2ce)](_0x4073eb);const _0x48369b=_0xabc34f[_0x3e6f81(0x2c3)](_0x3e5f5c=>_0x3e5f5c['attemptId'])[_0x3e6f81(0x2cb)](_0x339c3a=>({'title':_0x339c3a['displayLine'],'value':_0x339c3a['attemptId']})),_0x272f49=process[_0x3e6f81(0x1ab)][_0x3e6f81(0x1b6)]||0x3c,_0x2471a4=Math['max'](0x28,Math[_0x3e6f81(0x208)](_0x272f49*0x2/0x3)),_0x5d1fcd=await a38_0x1571f3({'type':'autocomplete','name':'attemptId','message':_0x3e6f81(0x2fa),'choices':_0x48369b,'initial':-0x1,'limit':_0x2471a4,'clearFirst':!![],'fallback':{'title':_0x3e6f81(0x198),'value':null},'suggest':(_0x2fc0c3,_0x30f822)=>{const _0x2fbe19=_0x3e6f81;if(!_0x2fc0c3)return Promise[_0x2fbe19(0x255)](_0x30f822);const _0x59dfdf=_0x30f822[_0x2fbe19(0x2c3)](_0x553e5c=>{const _0x340403=_0x2fbe19,_0x5f0072=_0x553e5c;return _0x5f0072[_0x340403(0x215)]['toLowerCase']()[_0x340403(0x284)](_0x2fc0c3[_0x340403(0x16e)]());});return Promise[_0x2fbe19(0x255)](_0x59dfdf);}}),_0x1b61bf=()=>{const _0x45637f=_0x3e6f81;process[_0x45637f(0x1ab)]['write']('\x1b[1A\x1b[2K'),process['stdout'][_0x45637f(0x21b)](_0x45637f(0x2dd)),process[_0x45637f(0x1ab)][_0x45637f(0x21b)](_0x45637f(0x2dd));},_0x335130=_0x5d1fcd&&_0x5d1fcd[_0x3e6f81(0x1dc)]&&_0x5d1fcd['attemptId']!==null&&_0x5d1fcd['attemptId']['trim']()!=='';if(!_0x335130){_0x1b61bf(),console[_0x3e6f81(0x2ce)](a38_0x24740f[_0x3e6f81(0x179)](_0x3e6f81(0x1cd)));return;}_0x1b61bf();const _0x4c1189=_0x23a8a2[_0x3e6f81(0x1ed)](_0x5cd03c=>_0x5cd03c[_0x3e6f81(0x242)]?.['id']===_0x5d1fcd[_0x3e6f81(0x1dc)]);if(_0x4c1189){const _0x2772d4=_0x4c1189[_0x3e6f81(0x2e2)]?.[_0x3e6f81(0x1f7)]||'?',_0x5805cc=_0x4c1189['workflow']?.[_0x3e6f81(0x1f7)]||'?';console[_0x3e6f81(0x2ce)]('Project:\x20'+a38_0x24740f[_0x3e6f81(0x179)](_0x2772d4)+_0x3e6f81(0x24c)+a38_0x24740f[_0x3e6f81(0x179)](_0x5805cc));}const _0x31cb01=new WorkflowTimelineCommand();await _0x31cb01[_0x3e6f81(0x19a)]({'args':[],'options':{..._0x4d8a3a,'attemptId':_0x5d1fcd['attemptId']},'tdx':_0x3cd614});}['generateSessionTimelineRows'](_0x51b83f,_0x51aaaa){const _0x35a4ba=a38_0x5bd661,_0x40652d=new Map();for(const _0x15f8d8 of _0x51b83f){_0x15f8d8['id']&&_0x15f8d8['lastAttempt']?.['id']&&_0x40652d[_0x35a4ba(0x276)](_0x15f8d8['id'],_0x15f8d8[_0x35a4ba(0x242)]['id']);}const _0x5dd341=[];let _0x4c07f7='';const _0x2e6ef4=this['renderSessionsTimeline'](_0x51b83f,_0x51aaaa),_0x4fd7b8=_0x2e6ef4[_0x35a4ba(0x253)]('\x0a');for(const _0x58c31f of _0x4fd7b8){if(_0x58c31f['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x58c31f[_0x35a4ba(0x21f)](/^\s+\d{4}-\d{2}-\d{2}/))_0x4c07f7=_0x58c31f;else{if(_0x58c31f['match'](/^[✅❌🔄🛑⏳]/)){const _0x5cd15c=_0x58c31f[_0x35a4ba(0x21f)](/#(\d+)/),_0x21c322=_0x5cd15c?_0x5cd15c[0x1]:null,_0x3c1773=_0x21c322?_0x40652d['get'](_0x21c322)||null:null,_0x3fa5e8=_0x51b83f['find'](_0x536959=>_0x536959['id']===_0x21c322),_0x5a03ff=_0x3fa5e8?.[_0x35a4ba(0x2e2)]?.['name']||'';_0x5dd341[_0x35a4ba(0x2d6)]({'displayLine':_0x58c31f,'attemptId':_0x3c1773,'projectName':_0x5a03ff});}}}return{'timelineRows':_0x5dd341,'timeAxisHeader':_0x4c07f7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a38_0x5bd661(0x1c0);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x21c);async[a38_0x5bd661(0x19a)](_0x213af2){const _0x1626f5=a38_0x5bd661,{options:_0x982c03,args:_0x414677,tdx:_0x59749d}=_0x213af2,_0x1b09b4=this[_0x1626f5(0x2f0)](_0x414677,_0x982c03);if(!_0x1b09b4)return 0x1;const {projectName:_0x3c1301,workflowName:_0x7f7fdd}=_0x1b09b4,_0x2f8f17=_0x982c03[_0x1626f5(0x1d8)];if(_0x982c03[_0x1626f5(0x2f3)]){if(_0x3c1301&&_0x7f7fdd)console[_0x1626f5(0x170)](_0x1626f5(0x1e2)+_0x3c1301+'.'+_0x7f7fdd);else _0x3c1301&&console[_0x1626f5(0x170)](_0x1626f5(0x1f9)+_0x3c1301);_0x2f8f17&&console[_0x1626f5(0x170)](_0x1626f5(0x274));}const _0x48bcaf=await withSpinner(_0x1626f5(0x15c),()=>_0x59749d[_0x1626f5(0x2e5)][_0x1626f5(0x2c4)]({'projectName':_0x3c1301,'workflowName':_0x7f7fdd,'includeRetried':_0x2f8f17,'limit':_0x982c03[_0x1626f5(0x169)]}),{'verbose':_0x982c03[_0x1626f5(0x2f3)]}),_0x294fb0=_0x48bcaf[_0x1626f5(0x1b8)],_0x2786f9=_0x982c03[_0x1626f5(0x169)]||0x64,_0x3d08f2=_0x294fb0['length']>=_0x2786f9?a38_0x24740f[_0x1626f5(0x179)](_0x1626f5(0x1c7)):'';console['error'](_0x1626f5(0x1a4)+_0x294fb0[_0x1626f5(0x20d)]+_0x1626f5(0x1db)+(_0x294fb0[_0x1626f5(0x20d)]!==0x1?'s':'')+_0x3d08f2);if(_0x982c03['format']===_0x1626f5(0x256)||_0x982c03[_0x1626f5(0x1e7)]===_0x1626f5(0x2b5)||_0x982c03['format']==='table')await handleSDKOutput(_0x294fb0,_0x982c03);else{if(_0x294fb0[_0x1626f5(0x20d)]===0x0){if(_0x3c1301&&_0x7f7fdd)console[_0x1626f5(0x2ce)](_0x1626f5(0x168)+_0x3c1301+'.'+_0x7f7fdd);else _0x3c1301?console[_0x1626f5(0x2ce)](_0x1626f5(0x2ba)+_0x3c1301):console[_0x1626f5(0x2ce)](_0x1626f5(0x2bf));}else{const _0xb32fa6=_0x982c03[_0x1626f5(0x16a)],_0x367494=_0x294fb0['map'](_0x3f4bc3=>{const _0x20e3a6=_0x1626f5,_0x5e4656=a38_0x24740f[_0x20e3a6(0x179)]('#'+_0x3f4bc3['id']),_0x1a9b6c=_0x3f4bc3[_0x20e3a6(0x2e2)]?.['id'],_0xf148c6=_0x3f4bc3[_0x20e3a6(0x19c)]||_0x3f4bc3[_0x20e3a6(0x25b)],_0x48f73d=_0x1a9b6c&&_0xf148c6?hyperlink(_0x5e4656,getWorkflowAttemptUrl(_0xb32fa6,_0x1a9b6c,_0xf148c6,_0x3f4bc3['id'])):_0x5e4656,{icon:_0x134ebb,text:_0x2f1258}=getAttemptStatusDisplay(_0x3f4bc3),_0x13ec03=(_0x3f4bc3[_0x20e3a6(0x2e2)]?.[_0x20e3a6(0x1f7)]||'?')+'.'+(_0x3f4bc3[_0x20e3a6(0x2e5)]?.['name']||'?'),_0x558174=_0x3f4bc3[_0x20e3a6(0x2af)]?a38_0x24740f[_0x20e3a6(0x179)](_0x3f4bc3[_0x20e3a6(0x2af)]):'';return(_0x48f73d+'\x20'+_0x134ebb+(_0x2f1258?'\x20'+_0x2f1258:'')+'\x20'+_0x13ec03+'\x20'+_0x558174)[_0x20e3a6(0x240)]();});await writeOutput(_0x367494[_0x1626f5(0x204)]('\x0a'),_0x982c03['output'],_0x1626f5(0x269));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x25a);['description']=a38_0x5bd661(0x2b7);async[a38_0x5bd661(0x19a)](_0x15676d){const _0x456bb3=a38_0x5bd661,{options:_0x33c8bc,args:_0x473601,tdx:_0x155777}=_0x15676d,_0x5873dc=_0x473601[0x0];if(!_0x5873dc)return console[_0x456bb3(0x170)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x33c8bc[_0x456bb3(0x2f3)]&&console[_0x456bb3(0x170)]('Attempt\x20ID:\x20'+_0x5873dc);const _0x154955=await withSpinner('Getting\x20attempt\x20details...',()=>_0x155777[_0x456bb3(0x2e5)]['attempt'](_0x5873dc),{'verbose':_0x33c8bc[_0x456bb3(0x2f3)]}),_0x21d040=_0x154955[_0x456bb3(0x1b8)];let _0x2c1b35;!_0x21d040[_0x456bb3(0x200)]?_0x2c1b35=_0x21d040[_0x456bb3(0x2c2)]?'canceling':'running':_0x2c1b35=_0x21d040[_0x456bb3(0x214)]?_0x456bb3(0x214):_0x456bb3(0x170);let _0x51c70f;if(_0x21d040[_0x456bb3(0x1fb)]&&_0x21d040['finishedAt']){const _0x4daf0c=new Date(_0x21d040[_0x456bb3(0x1fb)])['getTime'](),_0x479c1c=new Date(_0x21d040[_0x456bb3(0x203)])[_0x456bb3(0x2e4)]();_0x51c70f=Math[_0x456bb3(0x1ef)]((_0x479c1c-_0x4daf0c)/0x3e8);}const _0x536e92={'attempt_id':_0x21d040['id'],'status':_0x2c1b35,..._0x21d040['index']!==undefined&&{'index':_0x21d040[_0x456bb3(0x2fe)]},..._0x21d040['project']&&{'project':_0x21d040[_0x456bb3(0x2e2)][_0x456bb3(0x1f7)]},..._0x21d040[_0x456bb3(0x2e5)]&&{'workflow':_0x21d040[_0x456bb3(0x2e5)][_0x456bb3(0x1f7)]},..._0x21d040[_0x456bb3(0x25b)]&&{'session_id':_0x21d040[_0x456bb3(0x25b)]},..._0x21d040['sessionTime']&&{'session_time':_0x21d040[_0x456bb3(0x2af)]},..._0x21d040[_0x456bb3(0x16c)]&&{'retry_attempt':_0x21d040[_0x456bb3(0x16c)]},..._0x51c70f!==undefined&&{'duration_sec':_0x51c70f},..._0x21d040['createdAt']&&{'created_at':_0x21d040[_0x456bb3(0x1fb)]},..._0x21d040['finishedAt']&&{'finished_at':_0x21d040[_0x456bb3(0x203)]},...Object[_0x456bb3(0x2f1)](_0x21d040['params'])['length']>0x0&&{'params':_0x21d040['params']}};return await handleSingleObjectOutput(_0x536e92,_0x33c8bc),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x212);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x236);async[a38_0x5bd661(0x19a)](_0x542be8){const _0x21e6df=a38_0x5bd661,{options:_0x23006c,args:_0x3c47c0,tdx:_0x14c4f2}=_0x542be8,_0x3466c9=_0x3c47c0[0x0];if(!_0x3466c9)return console['error'](_0x21e6df(0x28e)),0x1;const _0x42be32=_0x23006c['includeSubtasks'];_0x23006c[_0x21e6df(0x2f3)]&&(console[_0x21e6df(0x170)](_0x21e6df(0x2ee)+_0x3466c9),_0x42be32&&console[_0x21e6df(0x170)](_0x21e6df(0x19f)));const _0x1e2242=await withSpinner(_0x21e6df(0x24d),()=>_0x14c4f2[_0x21e6df(0x2e5)][_0x21e6df(0x25d)](_0x3466c9,_0x42be32||![]),{'verbose':_0x23006c[_0x21e6df(0x2f3)]}),_0x53867b=_0x1e2242[_0x21e6df(0x1b8)];return console[_0x21e6df(0x170)](_0x21e6df(0x1a4)+_0x53867b[_0x21e6df(0x20d)]+'\x20task'+(_0x53867b[_0x21e6df(0x20d)]!==0x1?'s':'')),await handleSDKOutput(_0x53867b,_0x23006c),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x29a);['description']=a38_0x5bd661(0x1ae);async[a38_0x5bd661(0x19a)](_0x4f0cb6){const _0x5e07d9=a38_0x5bd661,{options:_0x313c81,args:_0x18cabf,tdx:_0x20ed7f}=_0x4f0cb6,_0x226155=_0x18cabf[0x0];let _0x223fe8=_0x18cabf[0x1];if(!_0x226155)return console[_0x5e07d9(0x170)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x313c81['verbose']&&(console[_0x5e07d9(0x170)](_0x5e07d9(0x2ee)+_0x226155),_0x223fe8&&console[_0x5e07d9(0x170)]('Task\x20name:\x20'+_0x223fe8));const _0x307859=await withSpinner(_0x5e07d9(0x1bc),()=>_0x20ed7f[_0x5e07d9(0x2e5)][_0x5e07d9(0x192)](_0x226155,_0x223fe8),{'verbose':_0x313c81[_0x5e07d9(0x2f3)]}),_0xc8b13a=_0x307859[_0x5e07d9(0x1b8)];if(_0xc8b13a['length']===0x0)return console[_0x5e07d9(0x170)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x223fe8&&(_0x313c81[_0x5e07d9(0x256)]||_0x313c81[_0x5e07d9(0x1e7)]))return await handleSDKOutput(_0xc8b13a,_0x313c81),0x0;if(!_0x223fe8){const _0xc8abca=_0xc8b13a[_0x5e07d9(0x2cb)](_0x58f18a=>({'title':_0x58f18a[_0x5e07d9(0x1de)]+'\x20('+formatBytes(_0x58f18a[_0x5e07d9(0x290)])+')','value':_0x58f18a[_0x5e07d9(0x1de)]})),_0x4c3d68=await a38_0x1571f3({'type':'select','name':_0x5e07d9(0x26d),'message':_0x5e07d9(0x298),'choices':_0xc8abca});if(!_0x4c3d68[_0x5e07d9(0x26d)])return console[_0x5e07d9(0x170)](_0x5e07d9(0x1cd)),0x0;_0x223fe8=_0x4c3d68[_0x5e07d9(0x26d)];}const _0x319174=await withSpinner('Downloading\x20logs...',()=>_0x20ed7f['workflow']['logs'](_0x226155,_0x223fe8),{'verbose':_0x313c81[_0x5e07d9(0x2f3)]}),_0x1352b1=_0x319174[_0x5e07d9(0x1b8)];return _0x1352b1?console[_0x5e07d9(0x2ce)](_0x1352b1):console[_0x5e07d9(0x170)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]='workflow:kill';[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x2d8);async[a38_0x5bd661(0x19a)](_0x23b2f6){const _0x55c6a7=a38_0x5bd661,{options:_0x355589,args:_0x30bcca,tdx:_0x3e7da2}=_0x23b2f6,_0x4beed5=_0x30bcca[0x0];if(!_0x4beed5)return console[_0x55c6a7(0x170)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x1a608e=_0x355589['reason'];_0x355589['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x4beed5),_0x1a608e&&console['error'](_0x55c6a7(0x167)+_0x1a608e));if(!_0x355589[_0x55c6a7(0x1ee)]){const _0x30cff9=await confirmKey(_0x55c6a7(0x183)+_0x4beed5+'?');if(!_0x30cff9)return console['error'](_0x55c6a7(0x1cd)),0x0;}const _0x908731=await withSpinner(_0x55c6a7(0x2ea),()=>_0x3e7da2[_0x55c6a7(0x2e5)][_0x55c6a7(0x19b)](_0x4beed5,_0x1a608e),{'verbose':_0x355589[_0x55c6a7(0x2f3)]}),_0x1326e7=_0x908731[_0x55c6a7(0x1b8)];return console[_0x55c6a7(0x170)]('✔\x20'+_0x1326e7),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x2db);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x1f0);async['execute'](_0x424604){const _0x52587e=a38_0x5bd661,{options:_0x67dd10,args:_0x52bb73,tdx:_0x338812}=_0x424604,_0x3f8502=_0x52bb73[0x0];if(!_0x3f8502)return console['error'](_0x52587e(0x227)),console[_0x52587e(0x170)](_0x52587e(0x287)),0x1;let _0x28b449=![],_0x20ded8=_0x3f8502;if(_0x3f8502[_0x52587e(0x1b7)](_0x52587e(0x181)))_0x28b449=!![],_0x20ded8=_0x3f8502[_0x52587e(0x24f)](0x8);else{if(_0x3f8502[_0x52587e(0x1b7)](_0x52587e(0x1a8)))_0x28b449=![],_0x20ded8=_0x3f8502[_0x52587e(0x24f)](0x8);else return console[_0x52587e(0x170)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console[_0x52587e(0x170)](_0x52587e(0x287)),0x1;}const _0x338391=_0x67dd10['fromTask'],_0x292e1b=_0x67dd10[_0x52587e(0x29c)],_0x5432ee=_0x67dd10[_0x52587e(0x23a)],_0x15d9f7=_0x67dd10['force'];_0x67dd10['verbose']&&(console['error']('Target:\x20'+(_0x28b449?_0x52587e(0x2a3):_0x52587e(0x22c))+'\x20'+_0x20ded8),_0x338391&&console['error']('From\x20task:\x20'+_0x338391),_0x292e1b&&console['error'](_0x52587e(0x292)+_0x292e1b),_0x5432ee&&console['error'](_0x52587e(0x19d)+_0x5432ee),_0x15d9f7&&console[_0x52587e(0x170)](_0x52587e(0x24b)));let _0x5e2e6b;if(_0x5432ee)try{if(_0x5432ee['startsWith']('@')){const _0x119adc=await import(_0x52587e(0x1ff)),_0x5c25a1=_0x5432ee[_0x52587e(0x24f)](0x1),_0x263cb7=await _0x119adc[_0x52587e(0x247)](_0x5c25a1,_0x52587e(0x1fc));_0x5e2e6b=JSON[_0x52587e(0x262)](_0x263cb7);}else _0x5e2e6b=JSON['parse'](_0x5432ee);}catch{return console[_0x52587e(0x170)](_0x52587e(0x250)),0x1;}if(!_0x67dd10[_0x52587e(0x1ee)]){const _0xb2ba97=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x28b449?_0x52587e(0x2a3):_0x52587e(0x22c))+'\x20'+_0x20ded8+'?');if(!_0xb2ba97)return console[_0x52587e(0x170)]('Cancelled'),0x0;}let _0x5ca0dd;_0x28b449?_0x5ca0dd=await withSpinner(_0x52587e(0x221),()=>_0x338812['workflow'][_0x52587e(0x282)](_0x20ded8,{'fromTask':_0x338391,'retryParams':_0x5e2e6b}),{'verbose':_0x67dd10['verbose']}):_0x5ca0dd=await withSpinner(_0x52587e(0x1c2),()=>_0x338812[_0x52587e(0x2e5)]['retryAttempt'](_0x20ded8,{'resumeFrom':_0x292e1b,'retryParams':_0x5e2e6b,'force':_0x15d9f7}),{'verbose':_0x67dd10[_0x52587e(0x2f3)]});const _0x55a4a3=_0x5ca0dd[_0x52587e(0x1b8)];return console[_0x52587e(0x170)](_0x52587e(0x23d)),console[_0x52587e(0x170)](_0x52587e(0x2d1)+_0x55a4a3['attemptId']),console[_0x52587e(0x170)]('\x20\x20Session\x20ID:\x20'+_0x55a4a3[_0x52587e(0x25b)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x22e);['description']='Start\x20a\x20workflow\x20run';async[a38_0x5bd661(0x19a)](_0xdb001c){const _0xdaea5e=a38_0x5bd661,{options:_0x1d85b6,args:_0x4cb62e,tdx:_0x581e9a}=_0xdb001c;let _0x3f3b80=_0x4cb62e[0x0];if(!_0x3f3b80){const _0x1840d6=this[_0xdaea5e(0x1e6)]([],_0x1d85b6),_0x274630=await withSpinner('Loading\x20workflows...',()=>_0x581e9a[_0xdaea5e(0x2e5)][_0xdaea5e(0x225)](_0x1840d6,{'limit':_0x1d85b6[_0xdaea5e(0x169)]}),{'verbose':_0x1d85b6[_0xdaea5e(0x2f3)]}),_0x696c23=_0x274630[_0xdaea5e(0x1b8)];if(_0x696c23[_0xdaea5e(0x20d)]===0x0)return console['error'](_0xdaea5e(0x17d)),!_0x1840d6&&console[_0xdaea5e(0x170)](a38_0x24740f[_0xdaea5e(0x179)](_0xdaea5e(0x293))),0x1;const _0x3d90de=_0x696c23['map'](_0x4fae6a=>({'title':_0x4fae6a['project']?.[_0xdaea5e(0x1f7)]+'.'+_0x4fae6a['name'],'value':_0x4fae6a['project']?.['name']+'.'+_0x4fae6a[_0xdaea5e(0x1f7)],'description':_0x4fae6a[_0xdaea5e(0x222)]?'revision:\x20'+_0x4fae6a[_0xdaea5e(0x222)]:undefined})),_0x2c7917=await a38_0x1571f3({'type':_0xdaea5e(0x2e0),'name':_0xdaea5e(0x2e5),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x3d90de});if(!_0x2c7917[_0xdaea5e(0x2e5)])return 0x1;_0x3f3b80=_0x2c7917[_0xdaea5e(0x2e5)];}if(!_0x3f3b80[_0xdaea5e(0x284)]('.')){const _0x1268d4=this['resolveProject']([],_0x1d85b6);if(_0x1268d4)_0x3f3b80=_0x1268d4+'.'+_0x3f3b80;else return console['error'](a38_0x24740f[_0xdaea5e(0x1d2)]('Error:'),_0xdaea5e(0x24a)),console['error'](a38_0x24740f['dim'](_0xdaea5e(0x293))),0x1;}const _0x21b658=_0x1d85b6[_0xdaea5e(0x259)],_0x1fb8a8=_0x1d85b6['sessionTime'],_0xc2f575={};if(_0x21b658&&Array[_0xdaea5e(0x258)](_0x21b658))for(const _0x56d4a8 of _0x21b658){const _0x452eea=_0x56d4a8[_0xdaea5e(0x197)]('=');if(_0x452eea===-0x1)return console[_0xdaea5e(0x170)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x56d4a8),console[_0xdaea5e(0x170)](_0xdaea5e(0x220)),0x1;const _0x2a2d9f=_0x56d4a8[_0xdaea5e(0x24f)](0x0,_0x452eea),_0xfd8253=_0x56d4a8[_0xdaea5e(0x24f)](_0x452eea+0x1);try{_0xc2f575[_0x2a2d9f]=JSON[_0xdaea5e(0x262)](_0xfd8253);}catch{_0xc2f575[_0x2a2d9f]=_0xfd8253;}}_0x1d85b6['verbose']&&(console[_0xdaea5e(0x170)](_0xdaea5e(0x2c7)+_0x3f3b80),Object[_0xdaea5e(0x2f1)](_0xc2f575)['length']>0x0&&console['error'](_0xdaea5e(0x28b)+JSON[_0xdaea5e(0x295)](_0xc2f575)),_0x1fb8a8&&console[_0xdaea5e(0x170)]('Session\x20time:\x20'+_0x1fb8a8));const _0x367d49=await withSpinner(_0xdaea5e(0x1f6),()=>_0x581e9a[_0xdaea5e(0x2e5)][_0xdaea5e(0x216)](_0x3f3b80,_0xc2f575,{'sessionTime':_0x1fb8a8}),{'verbose':_0x1d85b6[_0xdaea5e(0x2f3)]}),_0x4e6c8e=_0x367d49[_0xdaea5e(0x1b8)];console['error'](_0xdaea5e(0x2d0)),console[_0xdaea5e(0x170)](_0xdaea5e(0x281)+_0x4e6c8e['id']),console[_0xdaea5e(0x170)](_0xdaea5e(0x27b)+_0x4e6c8e[_0xdaea5e(0x25b)]),console[_0xdaea5e(0x170)](_0xdaea5e(0x1a9)+_0x4e6c8e[_0xdaea5e(0x2e2)]?.[_0xdaea5e(0x1f7)]),console[_0xdaea5e(0x170)](_0xdaea5e(0x15f)+_0x4e6c8e[_0xdaea5e(0x2e5)]?.[_0xdaea5e(0x1f7)]);if(_0x4e6c8e[_0xdaea5e(0x2e2)]?.['id']&&_0x4e6c8e[_0xdaea5e(0x25b)]&&_0x4e6c8e['id']){const _0x5a54ce=_0x1d85b6[_0xdaea5e(0x16a)],_0x5e25bb=getConsoleUrl(_0x5a54ce,_0xdaea5e(0x246)+_0x4e6c8e[_0xdaea5e(0x2e2)]['id']+_0xdaea5e(0x1ac)+_0x4e6c8e[_0xdaea5e(0x25b)]+_0xdaea5e(0x27c)+_0x4e6c8e['id']);console[_0xdaea5e(0x170)]('\x20\x20Console:\x20'+a38_0x24740f[_0xdaea5e(0x1ba)](_0x5e25bb));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x160);[a38_0x5bd661(0x26e)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a38_0x5bd661(0x19a)](_0x1e102c){const _0x486b70=a38_0x5bd661,{options:_0x4a5ad3,args:_0x2c93cd,tdx:_0x40f65b}=_0x1e102c,_0x107737=_0x2c93cd[0x0],_0x2bbb85=_0x2c93cd[0x1]||'.';if(!_0x107737)return console[_0x486b70(0x170)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x486b70(0x170)](_0x486b70(0x2a8)),0x1;const _0x1f082f=_0x4a5ad3['revision'];_0x4a5ad3['verbose']&&(console[_0x486b70(0x170)](_0x486b70(0x219)+_0x107737),console['error']('Output\x20directory:\x20'+_0x2bbb85),_0x1f082f&&console[_0x486b70(0x170)]('Revision:\x20'+_0x1f082f));const _0x3a7d82=await withSpinner('Downloading\x20project\x20'+_0x107737+_0x486b70(0x1f2),()=>_0x40f65b[_0x486b70(0x2e5)][_0x486b70(0x1a0)](_0x107737,_0x2bbb85,{'revision':_0x1f082f}),{'verbose':_0x4a5ad3['verbose']}),_0x19c9b2=_0x3a7d82['data'];return console[_0x486b70(0x170)](_0x486b70(0x2de)+_0x19c9b2[_0x486b70(0x2e3)]),console['error'](_0x486b70(0x163)+_0x19c9b2['revision']),console[_0x486b70(0x170)](_0x486b70(0x25e)+_0x19c9b2[_0x486b70(0x2c9)]),console[_0x486b70(0x170)](_0x486b70(0x1b1)+_0x2bbb85+'/'+_0x19c9b2[_0x486b70(0x2e3)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x1df);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x1d5);async[a38_0x5bd661(0x19a)](_0x2194ae){const _0x2ebe95=a38_0x5bd661,{options:_0xfe3829,args:_0xe65ac6,tdx:_0x5caacc}=_0x2194ae;let _0x11afb0='.',_0x3ba163=_0xfe3829['name'];if(_0xe65ac6[0x0]){const {promises:_0x4bac4c}=await import('fs');try{const _0x418c3b=await _0x4bac4c[_0x2ebe95(0x2ff)](_0xe65ac6[0x0]);if(_0x418c3b['isDirectory']())_0x11afb0=_0xe65ac6[0x0];else return console[_0x2ebe95(0x170)](_0x2ebe95(0x1b9)+_0xe65ac6[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3ba163=_0xe65ac6[0x0],_0x11afb0='.';}}const _0x4da7b9=_0xfe3829['revision'],_0x24e650=_0xfe3829[_0x2ebe95(0x1c5)];_0xfe3829[_0x2ebe95(0x2f3)]&&(console[_0x2ebe95(0x170)](_0x2ebe95(0x1e0)+_0x11afb0),_0x3ba163&&console[_0x2ebe95(0x170)](_0x2ebe95(0x2a7)+_0x3ba163),_0x4da7b9&&console[_0x2ebe95(0x170)](_0x2ebe95(0x286)+_0x4da7b9),_0x24e650&&console[_0x2ebe95(0x170)](_0x2ebe95(0x1c1)));const _0x466e16=await withSpinner(_0x2ebe95(0x165),()=>_0x5caacc[_0x2ebe95(0x2e5)][_0x2ebe95(0x2d6)](_0x11afb0,{'projectName':_0x3ba163,'revision':_0x4da7b9,'skipValidation':_0x24e650}),{'verbose':_0xfe3829[_0x2ebe95(0x2f3)]}),_0x35c8c1=_0x466e16[_0x2ebe95(0x1b8)];return console['error'](_0x2ebe95(0x20e)+_0x35c8c1[_0x2ebe95(0x2e3)]),console[_0x2ebe95(0x170)](_0x2ebe95(0x2f8)+_0x35c8c1[_0x2ebe95(0x176)]),console[_0x2ebe95(0x170)](_0x2ebe95(0x163)+_0x35c8c1[_0x2ebe95(0x222)]),await this[_0x2ebe95(0x270)](_0x5caacc,_0x35c8c1[_0x2ebe95(0x2e3)],_0xfe3829[_0x2ebe95(0x16a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x234);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x1d3);async[a38_0x5bd661(0x19a)](_0x7c501b){const _0x58d5c8=a38_0x5bd661,{options:_0x1a0300,args:_0x4fa333,tdx:_0x534756}=_0x7c501b,_0x1ca24d=_0x4fa333[0x0],_0x330ac4=_0x4fa333[0x1];if(!_0x1ca24d)return console['error'](a38_0x24740f[_0x58d5c8(0x1d2)](_0x58d5c8(0x199)),'Project\x20name\x20is\x20required'),console['error'](a38_0x24740f['dim'](_0x58d5c8(0x299))),0x1;const _0x41fd79=_0x1a0300[_0x58d5c8(0x222)];_0x1a0300[_0x58d5c8(0x2f3)]&&(console[_0x58d5c8(0x170)]('Project:\x20'+_0x1ca24d),_0x330ac4&&console[_0x58d5c8(0x170)]('Target\x20directory:\x20'+_0x330ac4),_0x41fd79&&console['error'](_0x58d5c8(0x286)+_0x41fd79),_0x1a0300[_0x58d5c8(0x23c)]&&console[_0x58d5c8(0x170)](_0x58d5c8(0x1aa)));const _0x10e7f4=await withSpinner(_0x58d5c8(0x171)+_0x1ca24d+_0x58d5c8(0x1f2),()=>_0x534756[_0x58d5c8(0x2e5)][_0x58d5c8(0x1c3)](_0x1ca24d,{'targetDir':_0x330ac4,'revision':_0x41fd79}),{'verbose':_0x1a0300[_0x58d5c8(0x2f3)]}),_0x2831e8=_0x10e7f4[_0x58d5c8(0x1b8)];_0x2831e8[_0x58d5c8(0x235)]?console['error'](_0x58d5c8(0x2fc)+_0x2831e8[_0x58d5c8(0x2e3)]):console[_0x58d5c8(0x170)](_0x58d5c8(0x271)+_0x2831e8[_0x58d5c8(0x2e3)]);console[_0x58d5c8(0x170)]('\x20\x20Revision:\x20'+_0x2831e8[_0x58d5c8(0x222)]),console[_0x58d5c8(0x170)]('\x20\x20Target:\x20'+(a38_0x493b10[_0x58d5c8(0x1a3)](process[_0x58d5c8(0x2cf)](),_0x2831e8[_0x58d5c8(0x2ef)])||'.')),console[_0x58d5c8(0x170)](_0x58d5c8(0x229)+a38_0x24740f[_0x58d5c8(0x265)]('+'+_0x2831e8[_0x58d5c8(0x1c8)][_0x58d5c8(0x25c)]+_0x58d5c8(0x17c))+',\x20'+(a38_0x24740f[_0x58d5c8(0x2eb)]('~'+_0x2831e8[_0x58d5c8(0x1c8)][_0x58d5c8(0x17b)]+'\x20modified')+',\x20')+(a38_0x24740f[_0x58d5c8(0x1d2)]('-'+_0x2831e8['summary'][_0x58d5c8(0x18d)]+_0x58d5c8(0x18e))+',\x20')+(''+a38_0x24740f[_0x58d5c8(0x179)](_0x2831e8[_0x58d5c8(0x1c8)][_0x58d5c8(0x1e8)]+_0x58d5c8(0x2fd))));for(const _0x33727f of _0x2831e8[_0x58d5c8(0x297)]){_0x33727f['type']===_0x58d5c8(0x17b)&&_0x33727f[_0x58d5c8(0x2e7)]&&(console[_0x58d5c8(0x170)]('\x0a'+a38_0x24740f['cyan'](_0x58d5c8(0x23b)+_0x33727f[_0x58d5c8(0x17e)])),console[_0x58d5c8(0x170)](_0x33727f[_0x58d5c8(0x2e7)]));}if(!_0x2831e8['hasChanges'])return saveSessionContext({'workflow_project':_0x2831e8[_0x58d5c8(0x2e3)]},_0x1a0300['session']),console[_0x58d5c8(0x170)](a38_0x24740f[_0x58d5c8(0x265)](_0x58d5c8(0x2ec))),console[_0x58d5c8(0x170)](a38_0x24740f[_0x58d5c8(0x179)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2831e8[_0x58d5c8(0x2e3)])),0x0;if(_0x1a0300[_0x58d5c8(0x23c)])return console[_0x58d5c8(0x170)](a38_0x24740f['yellow'](_0x58d5c8(0x1a2))),0x0;if(!_0x1a0300[_0x58d5c8(0x1ee)]){const _0xc41700=await confirmKey(_0x58d5c8(0x213));if(!_0xc41700)return console[_0x58d5c8(0x170)](_0x58d5c8(0x1cd)),0x0;}await withSpinner(_0x58d5c8(0x289),()=>_0x534756[_0x58d5c8(0x2e5)][_0x58d5c8(0x1f1)](_0x2831e8,{'revision':_0x41fd79}),{'verbose':_0x1a0300[_0x58d5c8(0x2f3)]}),saveSessionContext({'workflow_project':_0x2831e8[_0x58d5c8(0x2e3)]},_0x1a0300['session']),console['error'](a38_0x24740f[_0x58d5c8(0x265)](_0x58d5c8(0x2e1)));const _0x46bee8=a38_0x493b10[_0x58d5c8(0x1a3)](process[_0x58d5c8(0x2cf)](),_0x2831e8[_0x58d5c8(0x2ef)])||'.';return console[_0x58d5c8(0x170)](a38_0x24740f[_0x58d5c8(0x179)](_0x58d5c8(0x1b1)+_0x46bee8)),console[_0x58d5c8(0x170)](a38_0x24740f[_0x58d5c8(0x179)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2831e8[_0x58d5c8(0x2e3)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x1f5);[a38_0x5bd661(0x26e)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a38_0x5bd661(0x19a)](_0x472386){const _0x1ebbd9=a38_0x5bd661,{options:_0x5750b8,args:_0x13a401,tdx:_0x130f4d}=_0x472386,_0x14d83d=this[_0x1ebbd9(0x2f5)](_0x13a401,_0x5750b8),_0x5317eb=_0x5750b8[_0x1ebbd9(0x222)],_0x25485c=_0x5750b8[_0x1ebbd9(0x1c5)];_0x5750b8[_0x1ebbd9(0x2f3)]&&(_0x14d83d&&console['error']('Source\x20directory:\x20'+_0x14d83d),_0x5317eb&&console[_0x1ebbd9(0x170)](_0x1ebbd9(0x286)+_0x5317eb),_0x5750b8[_0x1ebbd9(0x23c)]&&console[_0x1ebbd9(0x170)](_0x1ebbd9(0x1aa)),_0x25485c&&console['error'](_0x1ebbd9(0x1c1)));let _0x595881;try{_0x595881=await withSpinner('Analyzing\x20changes...',()=>_0x130f4d['workflow'][_0x1ebbd9(0x172)]({'sourceDir':_0x14d83d,'revision':_0x5317eb,'skipValidation':_0x25485c}),{'verbose':_0x5750b8[_0x1ebbd9(0x2f3)]});}catch(_0x516a81){if(_0x516a81 instanceof Error&&_0x516a81['message']['includes'](_0x1ebbd9(0x257)))return console[_0x1ebbd9(0x170)](a38_0x24740f['red']('Error:'),_0x1ebbd9(0x296)),_0x5750b8[_0x1ebbd9(0x228)]?console['error'](a38_0x24740f[_0x1ebbd9(0x179)](_0x1ebbd9(0x17a)+_0x5750b8['workflowProject']+_0x1ebbd9(0x21d)+_0x5750b8['workflowProject']+'\x27')):console[_0x1ebbd9(0x170)](a38_0x24740f[_0x1ebbd9(0x179)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x516a81;}const _0x59105a=_0x595881[_0x1ebbd9(0x1b8)];console[_0x1ebbd9(0x170)](_0x1ebbd9(0x271)+_0x59105a['projectName']),console[_0x1ebbd9(0x170)](_0x1ebbd9(0x1b0)+_0x59105a[_0x1ebbd9(0x190)]),console[_0x1ebbd9(0x170)](_0x1ebbd9(0x163)+_0x59105a[_0x1ebbd9(0x222)]),console['error'](_0x1ebbd9(0x229)+a38_0x24740f['green']('+'+_0x59105a[_0x1ebbd9(0x1c8)]['new']+_0x1ebbd9(0x17c))+',\x20'+(a38_0x24740f[_0x1ebbd9(0x2eb)]('~'+_0x59105a[_0x1ebbd9(0x1c8)][_0x1ebbd9(0x17b)]+_0x1ebbd9(0x166))+',\x20')+(a38_0x24740f[_0x1ebbd9(0x1d2)]('-'+_0x59105a[_0x1ebbd9(0x1c8)][_0x1ebbd9(0x18d)]+_0x1ebbd9(0x18e))+',\x20')+(''+a38_0x24740f[_0x1ebbd9(0x179)](_0x59105a[_0x1ebbd9(0x1c8)]['unchanged']+_0x1ebbd9(0x2fd))));for(const _0x516bf2 of _0x59105a[_0x1ebbd9(0x297)]){_0x516bf2[_0x1ebbd9(0x1c9)]===_0x1ebbd9(0x17b)&&_0x516bf2[_0x1ebbd9(0x2e7)]&&(console[_0x1ebbd9(0x170)]('\x0a'+a38_0x24740f[_0x1ebbd9(0x1ba)](_0x1ebbd9(0x23b)+_0x516bf2['path'])),console[_0x1ebbd9(0x170)](_0x516bf2[_0x1ebbd9(0x2e7)]));}if(!_0x59105a['hasChanges'])return console[_0x1ebbd9(0x170)](a38_0x24740f['green'](_0x1ebbd9(0x2cd))),await this[_0x1ebbd9(0x270)](_0x130f4d,_0x59105a[_0x1ebbd9(0x2e3)],_0x5750b8['site']),0x0;if(_0x5750b8[_0x1ebbd9(0x23c)])return console['error'](a38_0x24740f[_0x1ebbd9(0x2eb)](_0x1ebbd9(0x185))),0x0;if(!_0x5750b8[_0x1ebbd9(0x1ee)]){const _0x5df5f0=await confirmKey(_0x1ebbd9(0x283));if(!_0x5df5f0)return console['error'](_0x1ebbd9(0x1cd)),0x0;}const _0x44a8e1=await withSpinner(_0x1ebbd9(0x2d7),()=>_0x130f4d[_0x1ebbd9(0x2e5)][_0x1ebbd9(0x285)](_0x59105a),{'verbose':_0x5750b8[_0x1ebbd9(0x2f3)]}),_0xb72166=_0x44a8e1[_0x1ebbd9(0x1b8)];return console[_0x1ebbd9(0x170)](a38_0x24740f[_0x1ebbd9(0x265)](_0x1ebbd9(0x2be))),console[_0x1ebbd9(0x170)](_0x1ebbd9(0x2f8)+_0xb72166['projectId']),console[_0x1ebbd9(0x170)](_0x1ebbd9(0x163)+_0xb72166[_0x1ebbd9(0x222)]),await this[_0x1ebbd9(0x270)](_0x130f4d,_0xb72166[_0x1ebbd9(0x2e3)],_0x5750b8['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x206);[a38_0x5bd661(0x26e)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a38_0x5bd661(0x19a)](_0x3e2841){const _0xadfd1f=a38_0x5bd661,{options:_0x496b73,args:_0xfefb38,tdx:_0x403cfd}=_0x3e2841,_0x1c339a=this[_0xadfd1f(0x2f5)](_0xfefb38,_0x496b73),_0x443828=_0x496b73[_0xadfd1f(0x1f7)],_0x45e019=_0x496b73[_0xadfd1f(0x222)],_0x15d578=_0x496b73[_0xadfd1f(0x1c5)];if(!_0x1c339a)return console['error'](a38_0x24740f[_0xadfd1f(0x1d2)](_0xadfd1f(0x199)),_0xadfd1f(0x175)),console[_0xadfd1f(0x170)](a38_0x24740f['dim'](_0xadfd1f(0x178))),console[_0xadfd1f(0x170)](a38_0x24740f['dim'](_0xadfd1f(0x21a))),0x1;if(!_0x443828)return console[_0xadfd1f(0x170)](a38_0x24740f['red'](_0xadfd1f(0x199)),_0xadfd1f(0x1dd)),console[_0xadfd1f(0x170)](a38_0x24740f[_0xadfd1f(0x179)](_0xadfd1f(0x178))),0x1;_0x496b73[_0xadfd1f(0x2f3)]&&(console['error']('Source\x20directory:\x20'+_0x1c339a),console[_0xadfd1f(0x170)](_0xadfd1f(0x1b5)+_0x443828),_0x45e019&&console[_0xadfd1f(0x170)](_0xadfd1f(0x286)+_0x45e019),_0x496b73['dryRun']&&console['error'](_0xadfd1f(0x1aa)),_0x15d578&&console['error'](_0xadfd1f(0x1c1)));const _0xf3a377=await withSpinner('Analyzing\x20project...',()=>_0x403cfd[_0xadfd1f(0x2e5)][_0xadfd1f(0x1e9)](_0x1c339a,_0x443828,{'revision':_0x45e019,'skipValidation':_0x15d578}),{'verbose':_0x496b73[_0xadfd1f(0x2f3)]}),_0x1aaa70=_0xf3a377['data'];console['error'](_0xadfd1f(0x239)+_0x1aaa70[_0xadfd1f(0x190)]);_0x1aaa70[_0xadfd1f(0x232)]&&console[_0xadfd1f(0x170)](_0xadfd1f(0x191)+_0x1aaa70['sourceProjectName']);console[_0xadfd1f(0x170)](_0xadfd1f(0x1b5)+_0x1aaa70['newProjectName']),console['error'](_0xadfd1f(0x286)+_0x1aaa70[_0xadfd1f(0x222)]),console[_0xadfd1f(0x170)]('Files\x20to\x20upload:\x20'+_0x1aaa70[_0xadfd1f(0x26a)]);_0x1aaa70['targetExists']&&(console[_0xadfd1f(0x170)](a38_0x24740f['yellow'](_0xadfd1f(0x2b0)+_0x1aaa70[_0xadfd1f(0x2f2)]+_0xadfd1f(0x280)+_0x1aaa70[_0xadfd1f(0x1f8)]+')')),console['error'](a38_0x24740f['yellow'](_0xadfd1f(0x2fb))));if(_0x496b73['dryRun'])return console[_0xadfd1f(0x170)](a38_0x24740f['yellow'](_0xadfd1f(0x22d))),0x0;if(!_0x496b73['yes']){const _0x2ec22f=_0x1aaa70[_0xadfd1f(0x232)]||a38_0x493b10[_0xadfd1f(0x207)](_0x1c339a),_0x562bfe=_0x1aaa70[_0xadfd1f(0x2ca)]?_0xadfd1f(0x20b)+_0x443828+_0xadfd1f(0x224):'\x0aClone\x20\x22'+_0x2ec22f+_0xadfd1f(0x2e6)+_0x443828+'\x22?',_0x3afbfb=await confirmKey(_0x562bfe);if(!_0x3afbfb)return console[_0xadfd1f(0x170)]('Cancelled'),0x0;}const _0x1551c0=await withSpinner(_0x1aaa70['targetExists']?_0xadfd1f(0x164)+_0x443828+_0xadfd1f(0x1f2):'Cloning\x20to\x20'+_0x443828+'...',()=>_0x403cfd[_0xadfd1f(0x2e5)][_0xadfd1f(0x29e)](_0x1aaa70),{'verbose':_0x496b73[_0xadfd1f(0x2f3)]}),_0x4381a8=_0x1551c0[_0xadfd1f(0x1b8)];return console[_0xadfd1f(0x170)](a38_0x24740f[_0xadfd1f(0x265)](_0x1aaa70[_0xadfd1f(0x2ca)]?'✔\x20Project\x20updated':_0xadfd1f(0x2a1))),console[_0xadfd1f(0x170)]('\x20\x20Project:\x20'+_0x4381a8[_0xadfd1f(0x2f2)]),console[_0xadfd1f(0x170)](_0xadfd1f(0x2f8)+_0x4381a8[_0xadfd1f(0x1f4)]),console[_0xadfd1f(0x170)](_0xadfd1f(0x163)+_0x4381a8[_0xadfd1f(0x222)]),await this[_0xadfd1f(0x270)](_0x403cfd,_0x4381a8['newProjectName'],_0x496b73[_0xadfd1f(0x16a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x2d2);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x15b);async[a38_0x5bd661(0x19a)](_0x2205b2){const _0x2063e7=a38_0x5bd661,{options:_0x255621,args:_0x3c755a,tdx:_0x448c90}=_0x2205b2,_0x221430=_0x3c755a[0x0];if(!_0x221430)return console[_0x2063e7(0x170)](_0x2063e7(0x1f3)),console[_0x2063e7(0x170)](_0x2063e7(0x1bb)),0x1;_0x255621[_0x2063e7(0x2f3)]&&console[_0x2063e7(0x170)]('Project:\x20'+_0x221430);if(!_0x255621['yes']){const _0x50d6ac=await confirmKey(_0x2063e7(0x196)+_0x221430+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x50d6ac)return console[_0x2063e7(0x170)]('Cancelled'),0x0;}const _0x3e74db=await withSpinner(_0x2063e7(0x1af)+_0x221430+_0x2063e7(0x1f2),()=>_0x448c90[_0x2063e7(0x2e5)][_0x2063e7(0x180)](_0x221430),{'verbose':_0x255621['verbose']}),_0x18be4e=_0x3e74db[_0x2063e7(0x1b8)];return console[_0x2063e7(0x170)](_0x2063e7(0x238)+_0x18be4e['projectName']),console['error'](_0x2063e7(0x2f8)+_0x18be4e[_0x2063e7(0x176)]),0x0;}}export function parseKeyValue(_0x170f2e){const _0x40a229=a38_0x5bd661,_0x271f50=_0x170f2e[_0x40a229(0x197)]('=');if(_0x271f50===-0x1)throw new Error(_0x40a229(0x266)+_0x170f2e+_0x40a229(0x19e));const _0x1d5fdc=_0x170f2e[_0x40a229(0x24f)](0x0,_0x271f50),_0x53cfb2=_0x170f2e[_0x40a229(0x24f)](_0x271f50+0x1);if(!_0x1d5fdc)throw new Error(_0x40a229(0x27d));return{'key':_0x1d5fdc,'value':_0x53cfb2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x2f6);[a38_0x5bd661(0x26e)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a38_0x5bd661(0x19a)](_0x34114e){const _0x44bc10=a38_0x5bd661,{options:_0x4ab2c7,args:_0x3d0ddc,tdx:_0x145949}=_0x34114e,_0x5ed50f=this[_0x44bc10(0x186)](_0x3d0ddc,_0x4ab2c7);if(!_0x5ed50f)return 0x1;_0x4ab2c7['verbose']&&console['error'](_0x44bc10(0x219)+_0x5ed50f);const _0x5299bd=await withSpinner('Listing\x20secrets...',()=>_0x145949[_0x44bc10(0x2e5)][_0x44bc10(0x233)](_0x5ed50f),{'verbose':_0x4ab2c7['verbose']}),{secrets:_0x3a9a6b}=_0x5299bd[_0x44bc10(0x1b8)];return console['error'](_0x44bc10(0x1a4)+_0x3a9a6b[_0x44bc10(0x20d)]+_0x44bc10(0x278)+(_0x3a9a6b[_0x44bc10(0x20d)]!==0x1?'s':'')),await handleSDKOutput(_0x3a9a6b,_0x4ab2c7),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a38_0x5bd661(0x27e);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x1e3);async[a38_0x5bd661(0x19a)](_0x80134){const _0x2f2139=a38_0x5bd661,{options:_0x4e34d6,args:_0x29f2dc,tdx:_0x2c117a}=_0x80134;let _0x21e54d,_0x3d464c;if(_0x29f2dc[_0x2f2139(0x20d)]>=0x2)_0x21e54d=_0x29f2dc[0x0],_0x3d464c=_0x29f2dc[0x1];else{if(_0x29f2dc['length']===0x1&&_0x4e34d6[_0x2f2139(0x228)])_0x21e54d=_0x4e34d6[_0x2f2139(0x228)],_0x3d464c=_0x29f2dc[0x0];else return _0x29f2dc[_0x2f2139(0x20d)]===0x1?(console['error'](_0x2f2139(0x161)),console[_0x2f2139(0x170)](_0x2f2139(0x293)),0x1):(console['error'](_0x2f2139(0x22f)),console['error'](_0x2f2139(0x1ea)),0x1);}let _0x86eaff,_0x481359;try{({key:_0x86eaff,value:_0x481359}=parseKeyValue(_0x3d464c));}catch(_0x5c87b8){return _0x5c87b8 instanceof Error&&console['error'](a38_0x24740f['red'](_0x2f2139(0x199)),_0x5c87b8[_0x2f2139(0x16d)]),0x1;}_0x4e34d6['verbose']&&(console[_0x2f2139(0x170)](_0x2f2139(0x219)+_0x21e54d),console['error']('Key:\x20'+_0x86eaff));const _0x1b8d87=await withSpinner(_0x2f2139(0x231),()=>_0x2c117a[_0x2f2139(0x2e5)][_0x2f2139(0x187)](_0x21e54d,_0x86eaff,_0x481359),{'verbose':_0x4e34d6[_0x2f2139(0x2f3)]}),_0x45cd0f=_0x1b8d87[_0x2f2139(0x1b8)];return console[_0x2f2139(0x170)](_0x2f2139(0x20f)+_0x45cd0f[_0x2f2139(0x202)]+_0x2f2139(0x16f)+_0x45cd0f[_0x2f2139(0x2e3)]+'\x27'),(_0x4e34d6[_0x2f2139(0x256)]||_0x4e34d6['jsonl'])&&await handleSingleObjectOutput(_0x45cd0f,_0x4e34d6),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a38_0x5bd661(0x2e8);[a38_0x5bd661(0x26e)]=a38_0x5bd661(0x18b);async[a38_0x5bd661(0x19a)](_0x4dd573){const _0x53bcfb=a38_0x5bd661,{options:_0x1ba913,args:_0x333264,tdx:_0x26753a}=_0x4dd573;let _0x4a8373,_0x369aed;if(_0x333264[_0x53bcfb(0x20d)]>=0x2)_0x4a8373=_0x333264[0x0],_0x369aed=_0x333264[0x1];else{if(_0x333264[_0x53bcfb(0x20d)]===0x1&&_0x1ba913[_0x53bcfb(0x228)])_0x4a8373=_0x1ba913[_0x53bcfb(0x228)],_0x369aed=_0x333264[0x0];else return _0x333264[_0x53bcfb(0x20d)]===0x1?(console[_0x53bcfb(0x170)](_0x53bcfb(0x161)),console[_0x53bcfb(0x170)](_0x53bcfb(0x293)),0x1):(console[_0x53bcfb(0x170)](_0x53bcfb(0x28f)),console[_0x53bcfb(0x170)](_0x53bcfb(0x1a5)),0x1);}_0x1ba913['verbose']&&(console[_0x53bcfb(0x170)](_0x53bcfb(0x219)+_0x4a8373),console[_0x53bcfb(0x170)](_0x53bcfb(0x28c)+_0x369aed));if(!_0x1ba913[_0x53bcfb(0x1ee)]){const _0x14ae8f=await confirmKey(_0x53bcfb(0x217)+_0x369aed+'\x27\x20from\x20project\x20\x27'+_0x4a8373+'\x27?');if(!_0x14ae8f)return console[_0x53bcfb(0x170)]('Cancelled'),0x0;}const _0x4fb379=await withSpinner('Deleting\x20secret...',()=>_0x26753a['workflow']['deleteSecret'](_0x4a8373,_0x369aed),{'verbose':_0x1ba913[_0x53bcfb(0x2f3)]}),_0x3ce4ce=_0x4fb379[_0x53bcfb(0x1b8)];return console[_0x53bcfb(0x170)](_0x53bcfb(0x20f)+_0x3ce4ce[_0x53bcfb(0x202)]+_0x53bcfb(0x1ad)+_0x3ce4ce[_0x53bcfb(0x2e3)]+'\x27'),(_0x1ba913[_0x53bcfb(0x256)]||_0x1ba913[_0x53bcfb(0x2b5)])&&await handleSingleObjectOutput(_0x3ce4ce,_0x1ba913),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(_0xa37cf7){const _0x43f817=a38_0x5bd661,_0x2d7379=Math[_0x43f817(0x208)](_0xa37cf7/0x3e8),_0x5eb3da=Math[_0x43f817(0x208)](_0x2d7379/0x3c),_0x31ece4=Math[_0x43f817(0x208)](_0x5eb3da/0x3c),_0x36f263=Math[_0x43f817(0x208)](_0x31ece4/0x18);if(_0x36f263>0x0){const _0x58c096=_0x31ece4%0x18;return _0x58c096>0x0?_0x36f263+'d\x20'+_0x58c096+'h':_0x36f263+'d';}else{if(_0x31ece4>0x0){const _0x3bb156=_0x5eb3da%0x3c;return _0x3bb156>0x0?_0x31ece4+'h\x20'+_0x3bb156+'m':_0x31ece4+'h';}else{if(_0x5eb3da>0x0){const _0x4be316=_0x2d7379%0x3c;return _0x4be316>0x0?_0x5eb3da+'m\x20'+_0x4be316+'s':_0x5eb3da+'m';}else return _0x2d7379+'s';}}}function formatTimestamp(_0x256e76,_0xeb70a5){const _0x251f68=a38_0x5bd661,_0x10e392=new Date(_0x256e76),_0x464b12=String(_0x10e392[_0x251f68(0x273)]())[_0x251f68(0x2f4)](0x2,'0'),_0x4a03ce=String(_0x10e392[_0x251f68(0x2e9)]())[_0x251f68(0x2f4)](0x2,'0'),_0x515828=_0x464b12+':'+_0x4a03ce,_0x1aab79=_0x10e392[_0x251f68(0x2ed)]()===_0xeb70a5[_0x251f68(0x2ed)]()&&_0x10e392[_0x251f68(0x2aa)]()===_0xeb70a5[_0x251f68(0x2aa)]()&&_0x10e392[_0x251f68(0x29f)]()===_0xeb70a5[_0x251f68(0x29f)]();if(_0x1aab79)return _0x515828;else{const _0x570df7=String(_0x10e392[_0x251f68(0x2aa)]()+0x1)[_0x251f68(0x2f4)](0x2,'0'),_0x3ce1cb=String(_0x10e392['getDate']())['padStart'](0x2,'0');return _0x570df7+'-'+_0x3ce1cb+'\x20'+_0x515828;}}function formatDate(_0x9b53ec){const _0x4d66d0=a38_0x5bd661,_0x17295b=_0x9b53ec[_0x4d66d0(0x2ed)](),_0x2ebf65=String(_0x9b53ec[_0x4d66d0(0x2aa)]()+0x1)[_0x4d66d0(0x2f4)](0x2,'0'),_0x34077f=String(_0x9b53ec[_0x4d66d0(0x29f)]())['padStart'](0x2,'0');return _0x17295b+'-'+_0x2ebf65+'-'+_0x34077f;}function a38_0x51c6(_0x582b8a,_0x16d581){_0x582b8a=_0x582b8a-0x15a;const _0x15239c=a38_0x1523();let _0x51c65e=_0x15239c[_0x582b8a];return _0x51c65e;}function getTaskStateIcon(_0x139975){const _0x4dc06b={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4dc06b[_0x139975]||'⚪';}function getBarChar(_0x231ab9){const _0x3b0276=a38_0x5bd661;return _0x231ab9==='error'||_0x231ab9===_0x3b0276(0x205)?'×':'─';}function getBarColor(_0x44de61){const _0x3c0924=a38_0x5bd661,_0x1c5b65={'success':a38_0x24740f[_0x3c0924(0x265)],'error':a38_0x24740f[_0x3c0924(0x1d2)],'group_error':a38_0x24740f[_0x3c0924(0x1d2)],'running':a38_0x24740f[_0x3c0924(0x2bc)],'blocked':a38_0x24740f[_0x3c0924(0x2eb)],'planned':a38_0x24740f[_0x3c0924(0x179)],'canceling':a38_0x24740f['yellow']};return _0x1c5b65[_0x44de61]||a38_0x24740f['white'];}function parseTaskName(_0x45a795){const _0x44569d=a38_0x5bd661;let _0x1dae76=_0x45a795['replace'](/^\++/,'');const _0x4f9756=_0x1dae76[_0x44569d(0x253)]('+'),_0x501e2d=_0x4f9756[_0x44569d(0x20d)]>0x1?_0x4f9756[_0x44569d(0x20d)]-0x2:0x0,_0x3dea15=_0x4f9756[_0x4f9756[_0x44569d(0x20d)]-0x1]||_0x1dae76;return{'level':_0x501e2d,'name':'+'+_0x3dea15};}function truncateTaskName(_0x1daac9,_0x3cdb9c){const _0x22449b=a38_0x5bd661,_0x4b362c=stringWidth(_0x1daac9);if(_0x4b362c<=_0x3cdb9c)return _0x1daac9;let _0x453a70=_0x1daac9;while(stringWidth(_0x453a70+'…')>_0x3cdb9c&&_0x453a70[_0x22449b(0x20d)]>0x0){_0x453a70=_0x453a70[_0x22449b(0x1cf)](0x0,-0x1);}return _0x453a70+'…';}function calculateTimeScale(_0x2f1445,_0x3ce13a){const _0x2e9e95=a38_0x5bd661;return{'startTime':_0x2f1445['start'],'endTime':_0x2f1445[_0x2e9e95(0x1cb)],'durationMs':_0x2f1445[_0x2e9e95(0x1ca)],'msPerChar':_0x2f1445['duration']/_0x3ce13a};}function timeToPosition(_0x41a283,_0x4d8fc0,_0x4fb9c1){const _0x208276=a38_0x5bd661,_0x3f0071=_0x41a283-_0x4d8fc0[_0x208276(0x1e1)],_0x3ae26e=Math[_0x208276(0x208)](_0x3f0071/_0x4d8fc0['msPerChar']);return Math[_0x208276(0x2f7)](0x0,Math[_0x208276(0x294)](_0x3ae26e,_0x4fb9c1));}function renderTimeAxis(_0x4ea627,_0x2a82e0){const _0xe5b36f=a38_0x5bd661,_0x222026=Math[_0xe5b36f(0x294)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0xe5b36f(0x2f7)](TIMELINE_CONFIG[_0xe5b36f(0x15e)],Math['floor'](_0x2a82e0/TIMELINE_CONFIG[_0xe5b36f(0x279)]))),_0x334992=_0x4ea627[_0xe5b36f(0x1e4)]/(_0x222026-0x1),_0x203027=new Date(_0x4ea627[_0xe5b36f(0x1e1)]),_0x50e825=[];for(let _0x4a687b=0x0;_0x4a687b<_0x222026;_0x4a687b++){const _0x16ba01=_0x4ea627['startTime']+_0x4a687b*_0x334992,_0x1e26aa=timeToPosition(_0x16ba01,_0x4ea627,_0x2a82e0),_0x40c6c5=formatTimestamp(_0x16ba01,_0x203027);_0x50e825[_0xe5b36f(0x2d6)]({'pos':_0x1e26aa,'text':_0x40c6c5});}const _0x3306c0=new Array(_0x2a82e0)[_0xe5b36f(0x21e)]('\x20');let _0x47d4ad=-0x1;for(const {pos:_0x48621f,text:_0x56e520}of _0x50e825){let _0x415374=Math[_0xe5b36f(0x2f7)](0x0,_0x48621f-Math[_0xe5b36f(0x208)](_0x56e520['length']/0x2));_0x415374<=_0x47d4ad+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x415374=_0x47d4ad+TIMELINE_CONFIG[_0xe5b36f(0x2a4)]+0x1);_0x415374+_0x56e520[_0xe5b36f(0x20d)]>_0x2a82e0&&(_0x415374=_0x2a82e0-_0x56e520[_0xe5b36f(0x20d)]);if(_0x415374>=0x0&&_0x415374+_0x56e520[_0xe5b36f(0x20d)]<=_0x2a82e0&&_0x415374>_0x47d4ad){for(let _0x3b85c0=0x0;_0x3b85c0<_0x56e520['length'];_0x3b85c0++){_0x3306c0[_0x415374+_0x3b85c0]=_0x56e520[_0x3b85c0];}_0x47d4ad=_0x415374+_0x56e520['length']-0x1;}}return _0x3306c0[_0xe5b36f(0x204)]('');}function renderTaskRow(_0x21b2b2,_0x38816f,_0x2421b1,_0x22a55b){const _0x3eae19=a38_0x5bd661,{level:_0x28fe9b,name:_0x3db517}=parseTaskName(_0x21b2b2[_0x3eae19(0x1f7)]),_0x3a13cd='\x20'[_0x3eae19(0x2a2)](_0x28fe9b),_0x5dcff9=_0x21b2b2[_0x3eae19(0x2d9)]?'('+formatElapsed(_0x21b2b2['window'][_0x3eae19(0x1ca)])+')':'',_0x4ee167=stringWidth(_0x5dcff9),_0x3ac334=_0x28fe9b*0x1,_0x75dcba=_0x22a55b-_0x3ac334-_0x4ee167-0x1,_0x4e730b=truncateTaskName(_0x3db517,_0x75dcba),_0x27b4d4=_0x3a13cd+_0x4e730b,_0x1f7d28=stringWidth(_0x27b4d4),_0x661caf=_0x22a55b-_0x1f7d28-_0x4ee167,_0x2b632=_0x27b4d4+'\x20'[_0x3eae19(0x2a2)](Math[_0x3eae19(0x2f7)](0x1,_0x661caf))+a38_0x24740f[_0x3eae19(0x179)](_0x5dcff9),_0x396c2e=getTaskStateIcon(_0x21b2b2[_0x3eae19(0x277)]),_0x2163e9=new Array(_0x2421b1)['fill']('\x20');if(_0x21b2b2[_0x3eae19(0x2d9)]){const _0x1e73ba=timeToPosition(_0x21b2b2['window']['start'],_0x38816f,_0x2421b1),_0x35ee38=timeToPosition(_0x21b2b2[_0x3eae19(0x2d9)]['end'],_0x38816f,_0x2421b1),_0x1e7a56=getBarChar(_0x21b2b2['state']),_0x3eaf23=Math[_0x3eae19(0x2f7)](_0x1e73ba+0x1,_0x35ee38);for(let _0x19720b=_0x1e73ba;_0x19720b<Math[_0x3eae19(0x294)](_0x3eaf23,_0x2421b1);_0x19720b++){_0x2163e9[_0x19720b]=_0x1e7a56;}}const _0x409016=getBarColor(_0x21b2b2[_0x3eae19(0x277)]),_0x9adbe9=_0x2163e9[_0x3eae19(0x2cb)](_0x5a8a07=>_0x5a8a07==='\x20'?'\x20':_0x409016(_0x5a8a07))[_0x3eae19(0x204)]('');return _0x396c2e+'\x20'+_0x2b632+'│'+_0x9adbe9+'│';}function calculateStats(_0x2a706f){const _0x5543db=a38_0x5bd661,_0x4a0920={'total':_0x2a706f[_0x5543db(0x20d)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x196b77 of _0x2a706f){if(_0x196b77[_0x5543db(0x277)]==='success')_0x4a0920[_0x5543db(0x214)]++;else{if(_0x196b77['state']===_0x5543db(0x170)||_0x196b77[_0x5543db(0x277)]===_0x5543db(0x205))_0x4a0920['error']++;else _0x196b77[_0x5543db(0x277)]==='running'?_0x4a0920[_0x5543db(0x272)]++:_0x4a0920['pending']++;}}return _0x4a0920;}function formatStats(_0x118790){const _0x1e040d=a38_0x5bd661;return[_0x1e040d(0x1b2)+_0x118790[_0x1e040d(0x2bb)],'✅\x20'+_0x118790[_0x1e040d(0x214)],'❌\x20'+_0x118790['error'],_0x1e040d(0x2c8)+_0x118790[_0x1e040d(0x272)],'⏳\x20'+_0x118790['pending']][_0x1e040d(0x204)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x5bd661(0x1f7)]=a38_0x5bd661(0x260);[a38_0x5bd661(0x26e)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a38_0x5bd661(0x19a)](_0x50c280){const _0x1e01c3=a38_0x5bd661,{options:_0x14e539,args:_0x1618a9,tdx:_0x42bc0f}=_0x50c280;let _0x1fc2da,_0x586b1c,_0xdb1c52=![];if(_0x1618a9[0x0]){if(_0x1618a9[0x0][_0x1e01c3(0x284)]('.')){const _0x12868f=this[_0x1e01c3(0x2f0)](_0x1618a9,_0x14e539);if(!_0x12868f)return 0x1;_0x1fc2da=_0x12868f[_0x1e01c3(0x2e3)],_0x586b1c=_0x12868f[_0x1e01c3(0x1a1)];}else{_0x586b1c=_0x1618a9[0x0],_0x1fc2da=_0x14e539[_0x1e01c3(0x228)];if(!_0x1fc2da)return console['error'](a38_0x24740f[_0x1e01c3(0x1d2)](_0x1e01c3(0x199)),_0x1e01c3(0x210)),0x1;_0xdb1c52=!![];}}else{const _0xe199ad=this[_0x1e01c3(0x2f0)](_0x1618a9,_0x14e539);if(!_0xe199ad)return 0x1;_0x1fc2da=_0xe199ad[_0x1e01c3(0x2e3)],_0x586b1c=_0xe199ad[_0x1e01c3(0x1a1)];}if(_0x14e539[_0x1e01c3(0x2f3)]){if(_0x1fc2da&&_0x586b1c)console[_0x1e01c3(0x170)](_0x1e01c3(0x1e2)+_0x1fc2da+'.'+_0x586b1c);else _0x1fc2da&&console[_0x1e01c3(0x170)](_0x1e01c3(0x1f9)+_0x1fc2da);}const _0x9d6d43=_0x14e539[_0x1e01c3(0x1dc)],_0x3d44cb=_0x14e539['sessionId'];if(_0x9d6d43){_0x3d44cb&&console[_0x1e01c3(0x170)](a38_0x24740f[_0x1e01c3(0x2eb)](_0x1e01c3(0x162)),_0x1e01c3(0x18f));const _0x342a1b=_0x14e539[_0x1e01c3(0x2ab)];return _0x342a1b?await this[_0x1e01c3(0x2b8)](_0x50c280,_0x9d6d43):await this[_0x1e01c3(0x177)](_0x50c280,_0x9d6d43,_0x14e539),0x0;}if(_0x3d44cb){const _0x5ade74=await withSpinner('Loading\x20session...',()=>_0x42bc0f[_0x1e01c3(0x2e5)]['sessions']({'projectName':_0x1fc2da,'workflowName':_0x586b1c,'limit':0x64}),{'verbose':_0x14e539['verbose']}),_0x57b3a8=_0x5ade74[_0x1e01c3(0x1b8)][_0x1e01c3(0x1ed)](_0x1231d3=>_0x1231d3['id']===_0x3d44cb);if(!_0x57b3a8)return console[_0x1e01c3(0x170)](a38_0x24740f[_0x1e01c3(0x1d2)](_0x1e01c3(0x199)),_0x1e01c3(0x1a7)+_0x3d44cb),0x1;if(!_0x57b3a8[_0x1e01c3(0x242)]?.['id'])return console[_0x1e01c3(0x170)](a38_0x24740f['red'](_0x1e01c3(0x199)),_0x1e01c3(0x195)+_0x3d44cb+_0x1e01c3(0x1d4)),0x1;const _0x30b7df=_0x57b3a8[_0x1e01c3(0x242)]['id'];_0x14e539[_0x1e01c3(0x2f3)]&&console[_0x1e01c3(0x170)](_0x1e01c3(0x1eb)+_0x30b7df+'\x20from\x20session\x20'+_0x3d44cb);const _0x25f09b=_0x14e539[_0x1e01c3(0x2ab)];return _0x25f09b?await this[_0x1e01c3(0x2b8)](_0x50c280,_0x30b7df):await this[_0x1e01c3(0x177)](_0x50c280,_0x30b7df,_0x14e539),0x0;}const _0x4ad49b=await withSpinner('Loading\x20sessions...',()=>_0x42bc0f[_0x1e01c3(0x2e5)][_0x1e01c3(0x291)]({'projectName':_0x1fc2da,'workflowName':_0x586b1c,'limit':_0x14e539[_0x1e01c3(0x169)]||0x32}),{'verbose':_0x14e539[_0x1e01c3(0x2f3)]}),_0x419013=_0x4ad49b['data'];if(_0x419013[_0x1e01c3(0x20d)]===0x0){if(_0x1fc2da&&_0x586b1c)console[_0x1e01c3(0x170)]('No\x20sessions\x20found\x20for:\x20'+_0x1fc2da+'.'+_0x586b1c);else _0x1fc2da?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1fc2da):(console[_0x1e01c3(0x170)](_0x1e01c3(0x2c5)),console[_0x1e01c3(0x170)](a38_0x24740f[_0x1e01c3(0x179)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x419013[_0x1e01c3(0x18c)]((_0xcc2a2a,_0x5c8230)=>{const _0x38552e=_0x1e01c3,_0x9ac8e=_0xcc2a2a[_0x38552e(0x2af)]||'',_0x2f2f70=_0x5c8230[_0x38552e(0x2af)]||'';return _0x2f2f70[_0x38552e(0x211)](_0x9ac8e);});if(_0x14e539[_0x1e01c3(0x256)]||_0x14e539['jsonl'])return await handleSDKOutput(_0x419013,_0x14e539),0x0;let _0x240ef7;if(_0xdb1c52){const _0x4edbeb=_0x419013[0x0];if(!_0x4edbeb['lastAttempt']?.['id'])return console[_0x1e01c3(0x170)](_0x1e01c3(0x25f)),0x0;_0x240ef7=_0x4edbeb[_0x1e01c3(0x242)]['id'],_0x14e539[_0x1e01c3(0x2f3)]&&console[_0x1e01c3(0x170)]('Auto-selected\x20latest\x20session:\x20'+_0x4edbeb[_0x1e01c3(0x2af)]);}else{const _0x36d3f7=_0x419013[_0x1e01c3(0x2cb)](_0x4e418a=>{const _0x129070=_0x1e01c3,_0x34780b=getAttemptStatusDisplay(_0x4e418a[_0x129070(0x242)]);return{'title':_0x4e418a[_0x129070(0x2e2)]?.[_0x129070(0x1f7)]+'.'+_0x4e418a['workflow']?.[_0x129070(0x1f7)]+_0x129070(0x267)+_0x4e418a[_0x129070(0x2af)]+'\x20'+_0x34780b[_0x129070(0x288)],'value':_0x4e418a['lastAttempt']?.['id']||'','description':_0x34780b[_0x129070(0x261)]};}),_0x2bc097=await a38_0x1571f3({'type':_0x1e01c3(0x2e0),'name':_0x1e01c3(0x1dc),'message':_0x1e01c3(0x29b),'choices':_0x36d3f7[_0x1e01c3(0x2c3)](_0x2fc6de=>_0x2fc6de[_0x1e01c3(0x27f)]!=='')});if(!_0x2bc097[_0x1e01c3(0x1dc)])return 0x0;_0x240ef7=_0x2bc097['attemptId'];}const _0x535d1b=_0x14e539[_0x1e01c3(0x2ab)];return _0x535d1b?await this[_0x1e01c3(0x2b8)](_0x50c280,_0x240ef7):await this['renderSingleTimeline'](_0x50c280,_0x240ef7,_0x14e539),0x0;}async[a38_0x5bd661(0x177)](_0x2dd5bd,_0x544040,_0x5e94cd){const _0x47fcd6=a38_0x5bd661,{tdx:_0x40a5f4}=_0x2dd5bd;let _0x53398d,_0x5abe1e;try{[_0x53398d,_0x5abe1e]=await Promise[_0x47fcd6(0x189)]([_0x40a5f4['workflow'][_0x47fcd6(0x22c)](_0x544040),_0x40a5f4[_0x47fcd6(0x2e5)][_0x47fcd6(0x25d)](_0x544040,![])]);}catch(_0x97f5e9){console[_0x47fcd6(0x170)](a38_0x24740f[_0x47fcd6(0x1d2)](_0x47fcd6(0x194)));_0x5e94cd[_0x47fcd6(0x2f3)]&&console[_0x47fcd6(0x170)](_0x97f5e9);throw _0x97f5e9;}if(_0x5e94cd[_0x47fcd6(0x256)]||_0x5e94cd['jsonl']){const _0x323e27=this['buildTimelineData'](_0x53398d,_0x5abe1e);await handleSDKOutput([_0x323e27],_0x5e94cd);return;}const _0x51ace9=_0x40a5f4[_0x47fcd6(0x241)]['site'],_0x3f21fe=this[_0x47fcd6(0x2d3)](_0x53398d,_0x5abe1e,_0x51ace9);console[_0x47fcd6(0x2ce)](_0x3f21fe);}async[a38_0x5bd661(0x2b8)](_0x55fb01,_0x5a7f56){const _0x5f1477=a38_0x5bd661,{tdx:_0x5f0eb3}=_0x55fb01,_0x2b8b4e=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1ed163=TIMELINE_CONFIG[_0x5f1477(0x188)];let _0x41a5e0=0x0;while(_0x41a5e0<_0x1ed163){process[_0x5f1477(0x1ab)][_0x5f1477(0x174)]&&process[_0x5f1477(0x1ab)][_0x5f1477(0x21b)]('\x1bc');let _0x47c8e8,_0x2cb964;try{[_0x47c8e8,_0x2cb964]=await Promise[_0x5f1477(0x189)]([_0x5f0eb3['workflow'][_0x5f1477(0x22c)](_0x5a7f56),_0x5f0eb3[_0x5f1477(0x2e5)]['tasks'](_0x5a7f56,![])]);}catch(_0x3a644e){console['error'](a38_0x24740f[_0x5f1477(0x1d2)](_0x5f1477(0x2f9)));_0x41a5e0>0x0&&console[_0x5f1477(0x170)](a38_0x24740f['dim'](_0x5f1477(0x2cc)+_0x41a5e0));throw _0x3a644e;}const _0xb4e1c5=_0x5f0eb3['context']['site'],_0x4f5c53=this[_0x5f1477(0x2d3)](_0x47c8e8,_0x2cb964,_0xb4e1c5);console[_0x5f1477(0x2ce)](_0x4f5c53);const _0x531440=_0x47c8e8[_0x5f1477(0x200)]&&_0x2cb964[_0x5f1477(0x245)](_0x59b9d6=>_0x59b9d6[_0x5f1477(0x277)]!==_0x5f1477(0x272)&&_0x59b9d6[_0x5f1477(0x277)]!==_0x5f1477(0x29d));if(_0x531440){console[_0x5f1477(0x170)](a38_0x24740f[_0x5f1477(0x265)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x5f1477(0x170)](a38_0x24740f[_0x5f1477(0x179)](_0x5f1477(0x268)+_0x41a5e0*0x2+_0x5f1477(0x1ec))),await new Promise(_0xf8b446=>setTimeout(_0xf8b446,_0x2b8b4e)),_0x41a5e0++;}_0x41a5e0>=_0x1ed163&&console['error'](a38_0x24740f['yellow'](_0x5f1477(0x23e)));}['renderTimeline'](_0x1bc879,_0x3c6788,_0x1751dc){const _0xfae429=a38_0x5bd661,_0x4b9187=[],_0x3fa198=TIMELINE_CONFIG[_0xfae429(0x24e)],_0x210acd=0x5,_0x170534=process[_0xfae429(0x1ab)][_0xfae429(0x300)]||0x78,_0x146591=_0x170534-_0x3fa198-_0x210acd,_0x9cfafe=Math[_0xfae429(0x2f7)](TIMELINE_CONFIG[_0xfae429(0x301)],Math[_0xfae429(0x294)](_0x146591,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4e3f00=new Date(_0x1bc879[_0xfae429(0x1fb)])['getTime'](),_0x1a5e04=_0x1bc879[_0xfae429(0x203)]?new Date(_0x1bc879[_0xfae429(0x203)])[_0xfae429(0x2e4)]():Date[_0xfae429(0x22b)](),_0x1452e5={'start':_0x4e3f00,'end':_0x1a5e04,'duration':_0x1a5e04-_0x4e3f00},_0xc39cd9=new Map(),_0x24a8dd=[];for(const _0x507744 of _0x3c6788){if(_0x507744[_0xfae429(0x248)]){const _0x573fb0=new Date(_0x507744[_0xfae429(0x248)])[_0xfae429(0x2e4)](),_0x18b08b=_0x507744[_0xfae429(0x275)]?new Date(_0x507744[_0xfae429(0x275)])[_0xfae429(0x2e4)]():Date[_0xfae429(0x22b)](),_0x3e1e12={'start':_0x573fb0,'end':_0x18b08b,'duration':_0x18b08b-_0x573fb0};_0xc39cd9[_0xfae429(0x276)](_0x507744['id'],_0x3e1e12),_0x24a8dd[_0xfae429(0x2d6)]({'name':_0x507744[_0xfae429(0x1c6)],'state':_0x507744['state']||_0xfae429(0x2ad),'window':_0x3e1e12});}else _0x24a8dd[_0xfae429(0x2d6)]({'name':_0x507744[_0xfae429(0x1c6)],'state':_0x507744[_0xfae429(0x277)]||_0xfae429(0x29d),'window':undefined});}_0x24a8dd[_0xfae429(0x18c)]((_0x2e95bd,_0x3dd540)=>{const _0x19fe86=_0xfae429;if(!_0x2e95bd[_0x19fe86(0x2d9)])return 0x1;if(!_0x3dd540[_0x19fe86(0x2d9)])return-0x1;return _0x2e95bd[_0x19fe86(0x2d9)][_0x19fe86(0x2c1)]-_0x3dd540['window']['start'];});const _0x3a63bc=_0x24a8dd[_0xfae429(0x20d)],_0x4a3f5f=_0x3a63bc>TIMELINE_CONFIG[_0xfae429(0x1d1)];_0x4a3f5f&&_0x24a8dd['splice'](TIMELINE_CONFIG[_0xfae429(0x1d1)]);const _0x5bcd0c=calculateTimeScale(_0x1452e5,_0x9cfafe),_0x80068b=_0x1bc879[_0xfae429(0x200)]?_0x1bc879[_0xfae429(0x214)]?a38_0x24740f[_0xfae429(0x265)](_0xfae429(0x214)):a38_0x24740f['red'](_0xfae429(0x170)):a38_0x24740f[_0xfae429(0x2bc)](_0xfae429(0x272)),_0x285c7d=_0x1bc879[_0xfae429(0x2e2)]?.['id'],_0x252ec1=_0x1bc879['sessionId'];let _0xc5541d;if(_0x285c7d&&_0x252ec1){const _0x7ccfdd=getWorkflowAttemptUrl(_0x1751dc,_0x285c7d,_0x252ec1,_0x1bc879['id']);_0xc5541d=hyperlink(a38_0x24740f['dim'](_0x1bc879['id']),_0x7ccfdd);}else _0xc5541d=a38_0x24740f[_0xfae429(0x179)](_0x1bc879['id']);_0x4b9187[_0xfae429(0x2d6)](_0xfae429(0x1bf)+_0xc5541d+_0xfae429(0x267)+_0x80068b+'\x20-\x20'+formatElapsed(_0x1452e5[_0xfae429(0x1ca)]));if(_0x24a8dd[_0xfae429(0x20d)]>0x0){const _0xd2d730=renderTimeAxis(_0x5bcd0c,_0x9cfafe),_0x465595=new Date(_0x1452e5[_0xfae429(0x2c1)]),_0x45ed23=formatDate(_0x465595),_0x2f86f5=TIMELINE_CONFIG[_0xfae429(0x1d0)]+TIMELINE_CONFIG[_0xfae429(0x2a6)]+_0x3fa198,_0x40396a=_0x45ed23[_0xfae429(0x2f4)](_0x2f86f5),_0x1eed84=a38_0x24740f['dim'](_0x40396a);_0x4b9187[_0xfae429(0x2d6)](_0x1eed84+'\x20'+_0xd2d730);for(const _0xd0a24b of _0x24a8dd){_0x4b9187['push'](renderTaskRow(_0xd0a24b,_0x5bcd0c,_0x9cfafe,_0x3fa198));}const _0x60e01c=calculateStats(_0x24a8dd);_0x4b9187['push'](formatStats(_0x60e01c)),_0x4a3f5f&&_0x4b9187['push'](a38_0x24740f['yellow'](_0xfae429(0x249)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0xfae429(0x1da)+_0x3a63bc+_0xfae429(0x2b9))),_0x4b9187['push'](''),_0x4b9187[_0xfae429(0x2d6)](a38_0x24740f['dim'](_0xfae429(0x1d9))+(_0xfae429(0x2a9)+_0x1bc879['id']+_0xfae429(0x15d))+a38_0x24740f[_0xfae429(0x179)](_0xfae429(0x2ac)));}else _0x4b9187['push'](_0xfae429(0x17f));return _0x4b9187['join']('\x0a');}['buildTimelineData'](_0x4f61fc,_0x2c4faf){const _0x342c73=a38_0x5bd661,_0x38974e=new Date(_0x4f61fc['createdAt'])[_0x342c73(0x2e4)](),_0xd0cd99=_0x4f61fc[_0x342c73(0x203)]?new Date(_0x4f61fc['finishedAt'])[_0x342c73(0x2e4)]():Date[_0x342c73(0x22b)](),_0x353441=_0xd0cd99-_0x38974e,_0x14426e=[];for(const _0x199e21 of _0x2c4faf){if(_0x199e21['startedAt']){const _0x293e65=new Date(_0x199e21['startedAt'])[_0x342c73(0x2e4)](),_0x24cf71=_0x199e21[_0x342c73(0x275)]?new Date(_0x199e21[_0x342c73(0x275)])[_0x342c73(0x2e4)]():Date[_0x342c73(0x22b)]();_0x14426e['push']({'name':_0x199e21['fullName'],'state':_0x199e21[_0x342c73(0x277)]||_0x342c73(0x2ad),'window':{'start':_0x293e65,'end':_0x24cf71,'duration':_0x24cf71-_0x293e65}});}else _0x14426e['push']({'name':_0x199e21['fullName'],'state':_0x199e21[_0x342c73(0x277)]||_0x342c73(0x29d),'window':undefined});}const _0x1c5fb9=calculateStats(_0x14426e);return{'attempt':{'id':_0x4f61fc['id'],'status':_0x4f61fc[_0x342c73(0x200)]?_0x4f61fc[_0x342c73(0x214)]?_0x342c73(0x214):'error':_0x342c73(0x272),'createdAt':_0x4f61fc['createdAt'],'finishedAt':_0x4f61fc['finishedAt'],'duration_ms':_0x353441},'tasks':_0x14426e[_0x342c73(0x2cb)](_0x545a4d=>({'name':_0x545a4d[_0x342c73(0x1f7)],'state':_0x545a4d[_0x342c73(0x277)],'startedAt':_0x545a4d[_0x342c73(0x2d9)]?new Date(_0x545a4d[_0x342c73(0x2d9)][_0x342c73(0x2c1)])['toISOString']():null,'updatedAt':_0x545a4d[_0x342c73(0x2d9)]?new Date(_0x545a4d[_0x342c73(0x2d9)]['end'])[_0x342c73(0x1fa)]():null,'duration_ms':_0x545a4d[_0x342c73(0x2d9)]?.['duration']||null})),'stats':_0x1c5fb9};}}function a38_0x1523(){const _0x2b2a3b=['\x20of\x20','\x20attempt','attemptId','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','taskName','workflow:upload','Project\x20directory:\x20','startTime','Filter:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','durationMs','projects','resolveProject','format','unchanged','prepareCloneProject','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Using\x20attempt\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','find','yes','round','Retry\x20a\x20session\x20or\x20attempt','applyPullProject','...','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','newProjectId','workflow:push','Starting\x20workflow\x20run...','name','existingProjectId','Filter:\x20project=','toISOString','createdAt','utf-8','workflow:use','\x20workflow','fs/promises','done','\x20session','key','finishedAt','join','group_error','workflow:clone','basename','floor','from','1693344LfLGAx','\x0aUpdate\x20existing\x20project\x20\x22','workflow:projects','length','✔\x20Pushed\x20','✔\x20Secret\x20\x27','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','localeCompare','workflow:tasks','\x0aApply\x20these\x20changes?','success','title','run','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','5VgXfTL','Project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','write','List\x20workflow\x20attempts','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','fill','match','Expected\x20format:\x20--param\x20key=value','Retrying\x20session...','revision','renderSessionsTimeline','\x22\x20with\x20new\x20revision?','workflows','✔\x20Workflow\x20project\x20context\x20cleared.','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflowProject','\x20\x20Changes:\x20','12387397zTZFWg','now','attempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','workflow:run','Error:\x20KEY=VALUE\x20is\x20required','6984IisxMs','Setting\x20secret...','sourceProjectName','listSecrets','workflow:pull','isNewProject','Show\x20tasks\x20for\x20an\x20attempt','resolveProjectId','✔\x20Deleted\x20project\x20','Source:\x20','params','---\x20','dryRun','✔\x20Retry\x20started','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','52pAxYUL','trimEnd','context','lastAttempt','Resolving\x20project\x20\x27','table','every','/app/workflows/','readFile','startedAt','⚠\x20Showing\x20first\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Force:\x20yes',',\x20Workflow:\x20','Getting\x20attempt\x20tasks...','TASK_NAME_WIDTH','substring','Error:\x20Invalid\x20JSON\x20in\x20--params','625764Zqqhqk','output','split','\x27...','resolve','json','No\x20workflow\x20tdx.json\x20found','isArray','param','workflow:attempt','sessionId','new','tasks','\x20\x20Files\x20extracted:\x20','Latest\x20session\x20has\x20no\x20attempt','workflow:timeline','text','parse','metadata','some','green','Invalid\x20format:\x20','\x20-\x20','\x0aPolling...\x20(','list','fileCount','Listing\x20workflow\x20projects...','✔\x20Showing\x20','task','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','showWorkflowConsoleUrl','✔\x20Project:\x20','running','getHours','Include\x20retried:\x20yes','updatedAt','set','state','\x20secret','LABEL_WIDTH_DIVISOR','8328CGcWCI','\x20\x20Session\x20ID:\x20','/attempt/','Key\x20cannot\x20be\x20empty','workflow:secrets:set','value','\x22\x20already\x20exists\x20(ID:\x20','\x20\x20Attempt\x20ID:\x20','retrySession','\x0aPush\x20these\x20changes?','includes','executePushProject','Revision:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','icon','Writing\x20files...','✔\x20Workflow\x20project\x20set\x20to:\x20','Parameters:\x20','Key:\x20','size','Error:\x20Attempt\x20ID\x20is\x20required','Error:\x20Secret\x20key\x20is\x20required','fileSize','sessions','Resume\x20from:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','min','stringify','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','changes','Select\x20a\x20task\x20to\x20view\x20logs:','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','workflow:logs','Select\x20a\x20session\x20to\x20view\x20timeline:','resumeFrom','planned','executeCloneProject','getDate','status','✔\x20Clone\x20complete','repeat','session','LABEL_MIN_SPACING','generateSessionTimelineRows','ICON_SPACING','Project\x20name:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','tdx\x20wf\x20attempt\x20','getMonth','follow','\x20to\x20see\x20detailed\x20logs','unknown','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','sessionTime','\x0a⚠\x20Project\x20\x22','Project\x20name\x20is\x20required','No\x20workflow\x20projects\x20found','No\x20sessions\x20found\x20in\x20project:\x20','tdx.json','jsonl','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Show\x20specific\x20attempt\x20details','pollTimeline','\x20tasks','No\x20attempts\x20found\x20in\x20project:\x20','total','blue','get','✔\x20Push\x20complete','No\x20attempts\x20found','sys','start','cancelRequested','filter','attempts','No\x20workflow\x20sessions\x20found','GUTTER','Workflow:\x20','🔄\x20','filesExtracted','targetExists','map','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0a✔\x20No\x20changes\x20to\x20push','log','cwd','✔\x20Workflow\x20run\x20started','\x20\x20New\x20attempt\x20ID:\x20','workflow:delete','renderTimeline','Listing\x20workflows...','1334799WbvWjh','push','Pushing\x20project...','Kill\x20a\x20running\x20attempt','window','Pattern:\x20','workflow:retry','clear','\x1b[1A\x1b[2K','✔\x20Downloaded\x20','Status:\x20','select','✔\x20Pull\x20complete','project','projectName','getTime','workflow','\x22\x20to\x20new\x20project\x20\x22','diff','workflow:secrets:delete','getMinutes','Killing\x20attempt...','yellow','\x0a✔\x20Already\x20up\x20to\x20date','getFullYear','Attempt\x20ID:\x20','targetDir','parseProjectWorkflowPattern','keys','newProjectName','verbose','padStart','resolveProjectDir','workflow:secrets:list','max','\x20\x20Project\x20ID:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','✔\x20New\x20project:\x20','\x20unchanged','index','stat','columns','MIN_TIMELINE_WIDTH','\x20\x20Console:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Listing\x20workflow\x20attempts...','\x20logs','MIN_LABEL_COUNT','\x20\x20Workflow:\x20','workflow:download','Error:\x20Project\x20name\x20is\x20required','Warning:','\x20\x20Revision:\x20','Updating\x20','Pushing\x20workflow\x20project...','\x20modified','Reason:\x20','No\x20attempts\x20found\x20for:\x20','limit','site','No\x20projects\x20match\x20pattern:\x20','retryAttemptName','message','toLowerCase','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','error','Pulling\x20project\x20','preparePushProject','6174VSBfrW','isTTY','Source\x20directory\x20is\x20required','projectId','renderSingleTimeline','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','dim','Tip:\x20cd\x20to\x20workflows/','modified','\x20new','No\x20workflows\x20found','path','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','delete','session:','(unknown)','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','3623430XyskcX','\x0aDry\x20run\x20-\x20nothing\x20pushed','requireProject','setSecret','MAX_POLL_ITERATIONS','all','Usage:\x20tdx\x20wf\x20use\x20<project>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','sort','deleted','\x20deleted','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','sourceDir','Source\x20project:\x20','logFiles','\x20\x20tdx\x20wf\x20use\x20<project>','Failed\x20to\x20fetch\x20attempt\x20data','Session\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','indexOf','No\x20matching\x20sessions\x20found','Error:','execute','kill','session_id','Params:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Including\x20subtasks:\x20yes','download','workflowName','\x0aDry\x20run\x20-\x20no\x20files\x20written','relative','✔\x20Found\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','📁\x20','Session\x20not\x20found:\x20','attempt:','\x20\x20Project:\x20','Dry\x20run:\x20yes','stdout','/sessions/','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Deleting\x20project\x20','\x20\x20Source:\x20','\x20\x20Location:\x20','Total:\x20','workflow:workflows','List\x20workflows','New\x20project\x20name:\x20','rows','startsWith','data','Error:\x20','cyan','Usage:\x20workflow:delete\x20<project-name-or-id>','Fetching\x20log\x20files...','10QiyRrn','No\x20sessions\x20found','Attempt:\x20','workflow:attempts','Validation:\x20skipped','Retrying\x20attempt...','pullProject','navigateSessionsInteractive','skipValidation','fullName','\x20(use\x20--limit\x20to\x20show\x20more)','summary','type','duration','end','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Cancelled','\x20(system)','slice','ICON_WIDTH','MAX_TASKS_DISPLAY','red','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20has\x20no\x20attempts','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','(use\x20--limit\x20to\x20see\x20more)','has','includeRetried','💡\x20Tip:\x20Use\x20'];a38_0x1523=function(){return _0x2b2a3b;};return a38_0x1523();}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x13f553,_0x40dbc2){const _0xea3308=a39_0x3ee2,_0x2dd872=_0x13f553();while(!![]){try{const _0x4b6fc5=parseInt(_0xea3308(0x181))/0x1+-parseInt(_0xea3308(0x17d))/0x2+-parseInt(_0xea3308(0x185))/0x3+-parseInt(_0xea3308(0x17e))/0x4*(-parseInt(_0xea3308(0x177))/0x5)+parseInt(_0xea3308(0x179))/0x6*(-parseInt(_0xea3308(0x17c))/0x7)+parseInt(_0xea3308(0x17b))/0x8+-parseInt(_0xea3308(0x186))/0x9*(parseInt(_0xea3308(0x17a))/0xa);if(_0x4b6fc5===_0x40dbc2)break;else _0x2dd872['push'](_0x2dd872['shift']());}catch(_0x5c0776){_0x2dd872['push'](_0x2dd872['shift']());}}}(a39_0xaf1f,0x2320e));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 _0x3d93fd=a39_0x3ee2,_0x4a0689=getVersion(),_0x44af7a=platform(),_0x53a900=process[_0x3d93fd(0x183)]['replace']('v','');return _0x3d93fd(0x17f)+_0x4a0689+'\x20('+_0x44af7a+_0x3d93fd(0x176)+_0x53a900+')';}export function getAuthHeaders(_0x4caac5,_0x14523e){const _0x18644f=a39_0x3ee2,_0x2d3b69=getVersion(),_0x288632={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2d3b69};return _0x14523e&&(_0x288632['Authorization']=_0x18644f(0x184)+_0x14523e),_0x288632;}export function toHeaderRecord(_0x4979b3){const _0x850f91=a39_0x3ee2,_0x38897c={};for(const [_0x1016c8,_0x28db0f]of Object[_0x850f91(0x180)](_0x4979b3)){_0x28db0f!==undefined&&(_0x38897c[_0x1016c8]=_0x28db0f);}return _0x38897c;}function a39_0xaf1f(){const _0x4b96aa=['39486anqmPF','10cqvBJZ','2301808MaDFnP','21HnyxXi','87704LSxeVB','11356uJIhpT','tdx/','entries','197265WIHCNE','length','version','TD1\x20','515469AacHOy','1589958VuyQod',';\x20node/','125DiwlZl','Authorization'];a39_0xaf1f=function(){return _0x4b96aa;};return a39_0xaf1f();}function a39_0x3ee2(_0x3015a6,_0xf937af){_0x3015a6=_0x3015a6-0x176;const _0xaf1fe3=a39_0xaf1f();let _0x3ee24d=_0xaf1fe3[_0x3015a6];return _0x3ee24d;}export function getTrinoHeaders(_0x257803,_0x36344c){const _0x1e03dc=a39_0x3ee2,_0x364ea6=getAuthHeaders(_0x257803,_0x36344c),_0x2cce57=toHeaderRecord(_0x364ea6);return delete _0x2cce57[_0x1e03dc(0x178)],_0x36344c&&(_0x2cce57['X-Trino-User']=_0x36344c),_0x2cce57;}export function hasAPIKey(_0x55e2e6){const _0x24445d=a39_0x3ee2,_0x4c159a=getAPIKey(_0x55e2e6);return _0x4c159a!==undefined&&_0x4c159a[_0x24445d(0x182)]>0x0;}
1
+ (function(_0x4dbde5,_0x55f230){const _0x145f7e=a39_0x291b,_0x5dec0f=_0x4dbde5();while(!![]){try{const _0x2335ff=parseInt(_0x145f7e(0x1fd))/0x1*(parseInt(_0x145f7e(0x1f5))/0x2)+-parseInt(_0x145f7e(0x1eb))/0x3*(-parseInt(_0x145f7e(0x1f4))/0x4)+parseInt(_0x145f7e(0x1f9))/0x5*(-parseInt(_0x145f7e(0x1fc))/0x6)+-parseInt(_0x145f7e(0x1f7))/0x7+parseInt(_0x145f7e(0x1f1))/0x8*(-parseInt(_0x145f7e(0x1fb))/0x9)+parseInt(_0x145f7e(0x1ed))/0xa*(-parseInt(_0x145f7e(0x1f2))/0xb)+-parseInt(_0x145f7e(0x1fa))/0xc*(-parseInt(_0x145f7e(0x1f8))/0xd);if(_0x2335ff===_0x55f230)break;else _0x5dec0f['push'](_0x5dec0f['shift']());}catch(_0x5cd527){_0x5dec0f['push'](_0x5dec0f['shift']());}}}(a39_0x42b5,0xc0b64));import{platform}from'os';function a39_0x291b(_0x55292a,_0x25a5c5){_0x55292a=_0x55292a-0x1ea;const _0x42b586=a39_0x42b5();let _0x291b74=_0x42b586[_0x55292a];return _0x291b74;}import{getAPIKey}from'./config.js';function a39_0x42b5(){const _0x397c0f=['version','848JcYhsy','11OGVuRn',';\x20node/','3980nDlFtM','8sYqSoq','entries','6428051pdTCdM','14010490oohWQQ','83570xLSSFe','48jRmmAG','112851KGNJLF','468aRaPRj','80254zsTDPM','replace','3453VOIvXC','length','14367140hIdmMT','tdx/','Authorization'];a39_0x42b5=function(){return _0x397c0f;};return a39_0x42b5();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x42ca18=a39_0x291b,_0x3cd4b4=getVersion(),_0x146925=platform(),_0x2ffc87=process[_0x42ca18(0x1f0)][_0x42ca18(0x1ea)]('v','');return _0x42ca18(0x1ee)+_0x3cd4b4+'\x20('+_0x146925+_0x42ca18(0x1f3)+_0x2ffc87+')';}export function getAuthHeaders(_0x2de1d2,_0x429ec1){const _0x58d29e=a39_0x291b,_0x2ac236=getVersion(),_0x358261={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2ac236};return _0x429ec1&&(_0x358261[_0x58d29e(0x1ef)]='TD1\x20'+_0x429ec1),_0x358261;}export function toHeaderRecord(_0x201358){const _0x30aa45=a39_0x291b,_0x309ce7={};for(const [_0x201c65,_0x39cc9b]of Object[_0x30aa45(0x1f6)](_0x201358)){_0x39cc9b!==undefined&&(_0x309ce7[_0x201c65]=_0x39cc9b);}return _0x309ce7;}export function getTrinoHeaders(_0x3e19d5,_0x15b1e3){const _0x4a772a=getAuthHeaders(_0x3e19d5,_0x15b1e3),_0xc1fa6f=toHeaderRecord(_0x4a772a);return delete _0xc1fa6f['Authorization'],_0x15b1e3&&(_0xc1fa6f['X-Trino-User']=_0x15b1e3),_0xc1fa6f;}export function hasAPIKey(_0x599aee){const _0x28cfbc=a39_0x291b,_0x1a8523=getAPIKey(_0x599aee);return _0x1a8523!==undefined&&_0x1a8523[_0x28cfbc(0x1ec)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x347dfe,_0x3e41f8){const _0x3ca41d=a40_0x3358,_0x417dc7=_0x347dfe();while(!![]){try{const _0x2fd88e=parseInt(_0x3ca41d(0x1f8))/0x1*(parseInt(_0x3ca41d(0x1c6))/0x2)+parseInt(_0x3ca41d(0x1db))/0x3*(parseInt(_0x3ca41d(0x1fe))/0x4)+parseInt(_0x3ca41d(0x1dd))/0x5*(parseInt(_0x3ca41d(0x1e4))/0x6)+-parseInt(_0x3ca41d(0x1ff))/0x7*(parseInt(_0x3ca41d(0x1e6))/0x8)+-parseInt(_0x3ca41d(0x1cd))/0x9*(parseInt(_0x3ca41d(0x1d1))/0xa)+-parseInt(_0x3ca41d(0x1c1))/0xb+parseInt(_0x3ca41d(0x1f4))/0xc;if(_0x2fd88e===_0x3e41f8)break;else _0x417dc7['push'](_0x417dc7['shift']());}catch(_0x4d0194){_0x417dc7['push'](_0x417dc7['shift']());}}}(a40_0x1433,0xa60fe));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';function a40_0x1433(){const _0x5a390b=['[Object]','tsv','forEach','cyan','2876tfdceU','1362634LGoaPk','max','jsonl','filter','noColor','rule','debug','format','[logs]','log','inherit','6322987DkQAbN','blue','number','end','keys','2404hAmdWG','Results\x20saved\x20to\x20','spawn','map','write','-FXRSn','stdout','846caNgrv','magenta','push','─┬─','109660aXYdHT','entries','error','params','bold','stderr','[error]','object','resolve','isInteger','2940vvoXtV','cmdout','5RXKeLq','padEnd','limit','yellow','stringify','pipe','double','7897380yLyoWd','string','32zDWGbe','list','varchar','[rule]','trim','json','[query]','color','FINISHED','red','output','No\x20data','repeat','split','11499204tqfjHB','length','table','stdin','71VSYdXG','query'];a40_0x1433=function(){return _0x5a390b;};return a40_0x1433();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x964203 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x7b1801){const _0x47eb3b=a40_0x3358;return _0x7b1801[_0x47eb3b(0x206)]===_0x47eb3b(0x1eb)||_0x7b1801[_0x47eb3b(0x206)]===_0x47eb3b(0x201)||_0x7b1801[_0x47eb3b(0x206)]==='tsv'||_0x7b1801['format']===_0x47eb3b(0x1f6)||_0x7b1801[_0x47eb3b(0x1eb)]===!![]||_0x7b1801[_0x47eb3b(0x201)]===!![]||_0x7b1801[_0x47eb3b(0x1fb)]===!![]||_0x7b1801[_0x47eb3b(0x1f6)]===!![];}export function parseOutputOptions(_0x2ca8d4){const _0x1da80a=a40_0x3358;return{'format':_0x2ca8d4[_0x1da80a(0x206)]||_0x1da80a(0x1f6),'output':_0x2ca8d4[_0x1da80a(0x1f0)]||'','limit':_0x2ca8d4[_0x1da80a(0x1df)],'color':_0x2ca8d4[_0x1da80a(0x1ed)],'noColor':_0x2ca8d4[_0x1da80a(0x203)]};}function convertSDKResultToQueryResult(_0x146946){const _0x500a15=a40_0x3358,_0x1ccba1=[];if(_0x146946['length']>0x0){const _0x39c172=_0x146946[0x0];for(const [_0x2153c2,_0x534514]of Object[_0x500a15(0x1d2)](_0x39c172)){let _0x31d31b=_0x500a15(0x1e8);if(typeof _0x534514===_0x500a15(0x1c3))_0x31d31b=Number[_0x500a15(0x1da)](_0x534514)?'bigint':_0x500a15(0x1e3);else{if(typeof _0x534514==='boolean')_0x31d31b='boolean';else _0x534514===null&&(_0x31d31b=_0x500a15(0x1e8));}_0x1ccba1[_0x500a15(0x1cf)]({'name':_0x2153c2,'type':_0x31d31b});}}return{'queryId':'sdk-result','columns':_0x1ccba1,'data':_0x146946,'stats':{'state':_0x500a15(0x1ee),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x146946['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x332daa,_0x4397b3){const _0x45b66a=convertSDKResultToQueryResult(_0x332daa);return formatQueryOutput(_0x45b66a,_0x4397b3);}export async function formatQueryOutput(_0x455073,_0x39fb94){const _0x450068=a40_0x3358,{format:_0x53e623,limit:_0x339c16,output:_0x32a093,color:_0xcce3ab,noColor:_0x442599}=_0x39fb94,_0x55daad=Boolean(_0x32a093)&&!_0xcce3ab,_0x8f5a47={'color':_0xcce3ab,'noColor':_0x442599||_0x55daad};if(_0x53e623==='table'){const _0x1c828a=shouldUseLess(_0x53e623,_0x32a093);return formatAsTable(_0x455073,_0x339c16,_0x1c828a,_0x8f5a47);}else{if(_0x53e623===_0x450068(0x1eb))return formatAsJSON(_0x455073,_0x8f5a47);else return _0x53e623===_0x450068(0x201)?formatAsJSONL(_0x455073,_0x8f5a47):formatQueryResult(_0x455073,_0x53e623);}}function a40_0x3358(_0x5f4e0d,_0x433176){_0x5f4e0d=_0x5f4e0d-0x1bf;const _0x14339b=a40_0x1433();let _0x335860=_0x14339b[_0x5f4e0d];return _0x335860;}function shouldUseLess(_0x52610e,_0x1f8b1a){const _0xe4b420=a40_0x3358;return(_0x52610e===_0xe4b420(0x1f6)||_0x52610e===_0xe4b420(0x1e7))&&process[_0xe4b420(0x1cc)]['isTTY']&&!_0x1f8b1a;}export function resolveOutputOptions(_0x1643df){const _0x129991=a40_0x3358,_0x445431=resolveOutputFormat(_0x1643df[_0x129991(0x206)],_0x1643df['output'],_0x129991(0x1f6));let _0x5b713d=typeof _0x1643df[_0x129991(0x1df)]===_0x129991(0x1c3)?_0x1643df[_0x129991(0x1df)]:parseInt(_0x1643df[_0x129991(0x1df)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x5b6c6f=_0x1643df[_0x129991(0x1f0)]||'';return shouldUseLess(_0x445431,_0x5b6c6f)&&(_0x5b713d=Infinity),{'format':_0x445431,'output':_0x5b6c6f,'limit':_0x5b713d,'color':_0x1643df[_0x129991(0x1ed)],'noColor':_0x1643df[_0x129991(0x203)]};}export function writeOutput(_0x19bc8b,_0x114fc7,_0x2d271f){const _0x13a0be=a40_0x3358;return _0x114fc7?(writeFileSync(_0x114fc7,_0x19bc8b),console[_0x13a0be(0x1d3)](_0x13a0be(0x1c7)+_0x114fc7),Promise[_0x13a0be(0x1d9)]()):shouldUseLess(_0x2d271f||'','')?new Promise(_0x441991=>{const _0x361749=_0x13a0be,_0x1241c5=spawn('less',[_0x361749(0x1cb)],{'stdio':[_0x361749(0x1e2),_0x361749(0x1c0),_0x361749(0x1c0)]});let _0x466953=![];_0x1241c5['on'](_0x361749(0x1d3),()=>{const _0x3e8cdb=_0x361749;!_0x466953&&(_0x466953=!![],console[_0x3e8cdb(0x1bf)](_0x19bc8b),_0x441991());}),_0x1241c5['on']('close',()=>{!_0x466953&&(_0x466953=!![],_0x441991());}),_0x1241c5['on'](_0x361749(0x1c8),()=>{const _0x516161=_0x361749;!_0x466953&&_0x1241c5[_0x516161(0x1f7)]&&(_0x1241c5[_0x516161(0x1f7)]['on'](_0x516161(0x1d3),()=>{}),_0x1241c5[_0x516161(0x1f7)][_0x516161(0x1ca)](_0x19bc8b),_0x1241c5[_0x516161(0x1f7)][_0x516161(0x1c4)]());}),!_0x1241c5[_0x361749(0x1f7)]&&(!_0x466953&&(_0x466953=!![],console[_0x361749(0x1bf)](_0x19bc8b),_0x441991()));}):(console[_0x13a0be(0x1bf)](_0x19bc8b),Promise[_0x13a0be(0x1d9)]());}export async function handleSDKOutput(_0x26a263,_0xdb4523){const _0x4e6a73=a40_0x3358,_0x253c03=resolveOutputOptions(_0xdb4523),_0x30d5a1=await formatSDKOutput(_0x26a263,_0x253c03);await writeOutput(_0x30d5a1,_0x253c03[_0x4e6a73(0x1f0)]||undefined,_0x253c03[_0x4e6a73(0x206)]);}export async function handleQueryOutput(_0x1fa65e,_0x2db3da){const _0x164d6f=a40_0x3358,_0x3d8af1=resolveOutputOptions(_0x2db3da),_0x2c7505=await formatQueryOutput(_0x1fa65e,_0x3d8af1);await writeOutput(_0x2c7505,_0x3d8af1['output']||undefined,_0x3d8af1[_0x164d6f(0x206)]);}async function formatSingleObject(_0x2056ae,_0x154dae){const _0x3fb5f6=a40_0x3358,{format:_0x9d6286,color:_0x29152a,noColor:_0x376fd4}=_0x154dae,_0x58491e={'color':_0x29152a,'noColor':_0x376fd4};if(_0x9d6286==='json'){if(shouldUseColor(_0x58491e))return colorizeJSON(_0x2056ae,_0x58491e);return JSON[_0x3fb5f6(0x1e1)](_0x2056ae,null,0x2);}else{if(_0x9d6286===_0x3fb5f6(0x201)){if(shouldUseColor(_0x58491e))return colorizeJSONCompact(_0x2056ae,_0x58491e);return JSON[_0x3fb5f6(0x1e1)](_0x2056ae);}else{if(_0x9d6286===_0x3fb5f6(0x1fb))return Object[_0x3fb5f6(0x1d2)](_0x2056ae)[_0x3fb5f6(0x1c9)](([_0xe7a6de,_0xd2a17])=>_0xe7a6de+'\x09'+_0xd2a17)['join']('\x0a');else{const _0x414396=Object[_0x3fb5f6(0x1d2)](_0x2056ae);if(_0x414396['length']===0x0)return _0x3fb5f6(0x1f1);const _0x3e72f3=_0x2056ae[_0x3fb5f6(0x205)],_0x8d927a=_0x2056ae[_0x3fb5f6(0x1f9)],_0xcf07a8=_0x2056ae['params'],_0x5a50b6=_0x2056ae[_0x3fb5f6(0x204)],_0x1cfc95=_0x8d927a?typeof _0x8d927a===_0x3fb5f6(0x1e5)?_0x8d927a:JSON[_0x3fb5f6(0x1e1)](_0x8d927a,null,0x2):undefined,_0x4de2a0=_0xcf07a8&&Object[_0x3fb5f6(0x1c5)](_0xcf07a8)[_0x3fb5f6(0x1f5)]>0x0?JSON[_0x3fb5f6(0x1e1)](_0xcf07a8,null,0x2):undefined,_0x2f3aee=_0x5a50b6&&Object[_0x3fb5f6(0x1c5)](_0x5a50b6)[_0x3fb5f6(0x1f5)]>0x0?JSON[_0x3fb5f6(0x1e1)](_0x5a50b6,null,0x2):undefined,_0xddeef7=_0x414396[_0x3fb5f6(0x202)](([_0x573e2b])=>_0x573e2b!==_0x3fb5f6(0x205)&&_0x573e2b!==_0x3fb5f6(0x1f9)&&_0x573e2b!==_0x3fb5f6(0x1d4)&&_0x573e2b!==_0x3fb5f6(0x204)),_0x1db12e=Math['max'](..._0xddeef7[_0x3fb5f6(0x1c9)](([_0x5b781f])=>_0x5b781f[_0x3fb5f6(0x1f5)])),_0x39e9cb=Math[_0x3fb5f6(0x200)](..._0xddeef7[_0x3fb5f6(0x1c9)](([,_0x8811b5])=>{const _0x2e4ae7=_0x3fb5f6;try{const _0xfd5993=_0x8811b5===null||_0x8811b5===undefined?'':typeof _0x8811b5===_0x2e4ae7(0x1d8)?JSON[_0x2e4ae7(0x1e1)](_0x8811b5):String(_0x8811b5),_0x5c2522=_0xfd5993['split']('\x0a');return Math[_0x2e4ae7(0x200)](..._0x5c2522['map'](_0x26fd50=>_0x26fd50['length']),0x0);}catch{return 0x0;}}),0x14),_0x45f95a=[];_0x45f95a[_0x3fb5f6(0x1cf)](colorBorder('┌─'+'─'[_0x3fb5f6(0x1f2)](_0x1db12e)+_0x3fb5f6(0x1d0)+'─'[_0x3fb5f6(0x1f2)](_0x39e9cb)+'─┐',_0x58491e)),_0xddeef7[_0x3fb5f6(0x1fc)](([_0x2a1c3e,_0x5133ef])=>{const _0x15e3ab=_0x3fb5f6;let _0x59c268;try{_0x59c268=_0x5133ef===null||_0x5133ef===undefined?'':typeof _0x5133ef==='object'?JSON[_0x15e3ab(0x1e1)](_0x5133ef):String(_0x5133ef);}catch{_0x59c268=_0x15e3ab(0x1fa);}const _0x4c19e5=_0x2a1c3e[_0x15e3ab(0x1de)](_0x1db12e),_0x5a7e83=_0x59c268[_0x15e3ab(0x1f3)]('\x0a');_0x5a7e83[_0x15e3ab(0x1fc)]((_0x4babca,_0x3d4436)=>{const _0x488faa=_0x15e3ab,_0x5d0855=colorBorder('│',_0x58491e);_0x3d4436===0x0?_0x45f95a['push'](_0x5d0855+'\x20'+_0x4c19e5+'\x20'+_0x5d0855+'\x20'+_0x4babca['padEnd'](_0x39e9cb)+'\x20'+_0x5d0855):_0x45f95a[_0x488faa(0x1cf)](_0x5d0855+'\x20'+'\x20'[_0x488faa(0x1f2)](_0x1db12e)+'\x20'+_0x5d0855+'\x20'+_0x4babca[_0x488faa(0x1de)](_0x39e9cb)+'\x20'+_0x5d0855);});}),_0x45f95a[_0x3fb5f6(0x1cf)](colorBorder('└─'+'─'['repeat'](_0x1db12e)+'─┴─'+'─'['repeat'](_0x39e9cb)+'─┘',_0x58491e));_0x1cfc95&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1e0)][_0x3fb5f6(0x1d5)](_0x3fb5f6(0x1ec)))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x1cfc95));_0x4de2a0&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a['push'](String(a40_0x964203[_0x3fb5f6(0x1c2)][_0x3fb5f6(0x1d5)]('[params]'))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x4de2a0));_0x2f3aee&&(_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1ce)]['bold'](_0x3fb5f6(0x1e9)))),_0x45f95a[_0x3fb5f6(0x1cf)](_0x2f3aee));if(_0x3e72f3){if(_0x3e72f3[_0x3fb5f6(0x1d6)]){_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1ef)]['bold'](_0x3fb5f6(0x1d7))));const _0x38af68=_0x3e72f3[_0x3fb5f6(0x1d6)][_0x3fb5f6(0x1f3)]('\x0a');_0x38af68[_0x3fb5f6(0x1fc)](_0x43729e=>{const _0x2c0812=_0x3fb5f6;_0x43729e[_0x2c0812(0x1ea)]()&&_0x45f95a[_0x2c0812(0x1cf)](_0x43729e);});}if(_0x3e72f3[_0x3fb5f6(0x1dc)]){_0x45f95a[_0x3fb5f6(0x1cf)](''),_0x45f95a[_0x3fb5f6(0x1cf)](String(a40_0x964203[_0x3fb5f6(0x1fd)][_0x3fb5f6(0x1d5)](_0x3fb5f6(0x207))));const _0x11847e=_0x3e72f3[_0x3fb5f6(0x1dc)][_0x3fb5f6(0x1f3)]('\x0a');_0x11847e[_0x3fb5f6(0x1fc)](_0x5d9d32=>{const _0x3369eb=_0x3fb5f6;_0x5d9d32['trim']()&&_0x45f95a[_0x3369eb(0x1cf)](_0x5d9d32);});}}return _0x45f95a['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x11c84b,_0x1c914b){const _0x3029fb=a40_0x3358;if(_0x1c914b['format']===_0x3029fb(0x1f6)){await handleSDKOutput([_0x11c84b],_0x1c914b);return;}const _0x50c28a=resolveOutputOptions(_0x1c914b),_0x2ff088=await formatSingleObject(_0x11c84b,_0x50c28a);await writeOutput(_0x2ff088,_0x50c28a[_0x3029fb(0x1f0)]||undefined,_0x50c28a[_0x3029fb(0x206)]);}
1
+ (function(_0x109d56,_0x13273f){const _0x12892d=a40_0x1476,_0x1b8c20=_0x109d56();while(!![]){try{const _0x5b5f8e=-parseInt(_0x12892d(0x13e))/0x1*(parseInt(_0x12892d(0x168))/0x2)+-parseInt(_0x12892d(0x147))/0x3+parseInt(_0x12892d(0x16c))/0x4*(parseInt(_0x12892d(0x16e))/0x5)+-parseInt(_0x12892d(0x178))/0x6+parseInt(_0x12892d(0x179))/0x7+parseInt(_0x12892d(0x151))/0x8+-parseInt(_0x12892d(0x150))/0x9;if(_0x5b5f8e===_0x13273f)break;else _0x1b8c20['push'](_0x1b8c20['shift']());}catch(_0x3cbb08){_0x1b8c20['push'](_0x1b8c20['shift']());}}}(a40_0x2984,0x30d75));import{writeFileSync}from'fs';function a40_0x1476(_0x2554c5,_0x50a42b){_0x2554c5=_0x2554c5-0x139;const _0x2984aa=a40_0x2984();let _0x147644=_0x2984aa[_0x2554c5];return _0x147644;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';function a40_0x2984(){const _0x5f1e6f=['inherit','spawn','repeat','1rpcsvn','tsv','debug','close','string','isTTY','varchar','sdk-result','padEnd','192444mLzuro','jsonl','keys','object','cmdout','join','-FXRSn','Results\x20saved\x20to\x20','[Object]','1947285Sywfsl','1117920tTdXfY','double','[params]','push','color','output','length','split','bigint','No\x20data','forEach','isInteger','stringify','magenta','trim','error','yellow','resolve','bold','json','pipe','boolean','map','162536bURyPO','red','table','params','137684YhcRUV','stdin','50uoVkRD','stderr','entries','list','rule','query','limit','number','blue','format','1519086UhkLiX','2317455frpucJ','end','─┬─','log','FINISHED','[rule]','noColor','[query]','cyan','max','─┴─'];a40_0x2984=function(){return _0x5f1e6f;};return a40_0x2984();}import a40_0x38ce53 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2112c7){const _0x33c982=a40_0x1476;return _0x2112c7['format']===_0x33c982(0x164)||_0x2112c7['format']==='jsonl'||_0x2112c7[_0x33c982(0x177)]===_0x33c982(0x13f)||_0x2112c7[_0x33c982(0x177)]===_0x33c982(0x16a)||_0x2112c7[_0x33c982(0x164)]===!![]||_0x2112c7['jsonl']===!![]||_0x2112c7[_0x33c982(0x13f)]===!![]||_0x2112c7[_0x33c982(0x16a)]===!![];}export function parseOutputOptions(_0x387b2f){const _0x1c5dc8=a40_0x1476;return{'format':_0x387b2f['format']||'table','output':_0x387b2f['output']||'','limit':_0x387b2f[_0x1c5dc8(0x174)],'color':_0x387b2f['color'],'noColor':_0x387b2f['noColor']};}function convertSDKResultToQueryResult(_0x4e305e){const _0x44b910=a40_0x1476,_0x2ece4d=[];if(_0x4e305e[_0x44b910(0x157)]>0x0){const _0x44dd04=_0x4e305e[0x0];for(const [_0x1a7110,_0x35ed83]of Object['entries'](_0x44dd04)){let _0x5c183d=_0x44b910(0x144);if(typeof _0x35ed83===_0x44b910(0x175))_0x5c183d=Number[_0x44b910(0x15c)](_0x35ed83)?_0x44b910(0x159):_0x44b910(0x152);else{if(typeof _0x35ed83==='boolean')_0x5c183d=_0x44b910(0x166);else _0x35ed83===null&&(_0x5c183d=_0x44b910(0x144));}_0x2ece4d[_0x44b910(0x154)]({'name':_0x1a7110,'type':_0x5c183d});}}return{'queryId':_0x44b910(0x145),'columns':_0x2ece4d,'data':_0x4e305e,'stats':{'state':_0x44b910(0x17d),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x4e305e[_0x44b910(0x157)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x48a869,_0x4cf51c){const _0x63066=convertSDKResultToQueryResult(_0x48a869);return formatQueryOutput(_0x63066,_0x4cf51c);}export async function formatQueryOutput(_0x12f189,_0x10641a){const _0x3ca4ee=a40_0x1476,{format:_0x4267bb,limit:_0x37b1ff,output:_0x40faf0,color:_0xc3c5fe,noColor:_0x4b6537}=_0x10641a,_0xe92661=Boolean(_0x40faf0)&&!_0xc3c5fe,_0x24b939={'color':_0xc3c5fe,'noColor':_0x4b6537||_0xe92661};if(_0x4267bb===_0x3ca4ee(0x16a)){const _0x50c722=shouldUseLess(_0x4267bb,_0x40faf0);return formatAsTable(_0x12f189,_0x37b1ff,_0x50c722,_0x24b939);}else{if(_0x4267bb==='json')return formatAsJSON(_0x12f189,_0x24b939);else return _0x4267bb===_0x3ca4ee(0x148)?formatAsJSONL(_0x12f189,_0x24b939):formatQueryResult(_0x12f189,_0x4267bb);}}function shouldUseLess(_0x90bba1,_0x5b1a97){const _0x89f839=a40_0x1476;return(_0x90bba1===_0x89f839(0x16a)||_0x90bba1===_0x89f839(0x171))&&process['stdout'][_0x89f839(0x143)]&&!_0x5b1a97;}export function resolveOutputOptions(_0xd58277){const _0x63c94f=a40_0x1476,_0x3d1361=resolveOutputFormat(_0xd58277[_0x63c94f(0x177)],_0xd58277[_0x63c94f(0x156)],_0x63c94f(0x16a));let _0x1603f2=typeof _0xd58277['limit']==='number'?_0xd58277['limit']:parseInt(_0xd58277[_0x63c94f(0x174)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x1f1710=_0xd58277['output']||'';return shouldUseLess(_0x3d1361,_0x1f1710)&&(_0x1603f2=Infinity),{'format':_0x3d1361,'output':_0x1f1710,'limit':_0x1603f2,'color':_0xd58277[_0x63c94f(0x155)],'noColor':_0xd58277[_0x63c94f(0x17f)]};}export function writeOutput(_0x2df362,_0x4de8ff,_0xdedce5){const _0x59b11d=a40_0x1476;return _0x4de8ff?(writeFileSync(_0x4de8ff,_0x2df362),console[_0x59b11d(0x160)](_0x59b11d(0x14e)+_0x4de8ff),Promise[_0x59b11d(0x162)]()):shouldUseLess(_0xdedce5||'','')?new Promise(_0x2e4a9f=>{const _0x4bb81b=_0x59b11d,_0x44cf24=spawn('less',[_0x4bb81b(0x14d)],{'stdio':[_0x4bb81b(0x165),'inherit',_0x4bb81b(0x13b)]});let _0x5e0de5=![];_0x44cf24['on'](_0x4bb81b(0x160),()=>{const _0xb6eb3=_0x4bb81b;!_0x5e0de5&&(_0x5e0de5=!![],console[_0xb6eb3(0x17c)](_0x2df362),_0x2e4a9f());}),_0x44cf24['on'](_0x4bb81b(0x141),()=>{!_0x5e0de5&&(_0x5e0de5=!![],_0x2e4a9f());}),_0x44cf24['on'](_0x4bb81b(0x13c),()=>{const _0x22ba63=_0x4bb81b;!_0x5e0de5&&_0x44cf24['stdin']&&(_0x44cf24[_0x22ba63(0x16d)]['on'](_0x22ba63(0x160),()=>{}),_0x44cf24[_0x22ba63(0x16d)]['write'](_0x2df362),_0x44cf24[_0x22ba63(0x16d)][_0x22ba63(0x17a)]());}),!_0x44cf24['stdin']&&(!_0x5e0de5&&(_0x5e0de5=!![],console[_0x4bb81b(0x17c)](_0x2df362),_0x2e4a9f()));}):(console[_0x59b11d(0x17c)](_0x2df362),Promise[_0x59b11d(0x162)]());}export async function handleSDKOutput(_0x595b3e,_0x4dd8a8){const _0x1ed78d=a40_0x1476,_0x409e33=resolveOutputOptions(_0x4dd8a8),_0x2fdc42=await formatSDKOutput(_0x595b3e,_0x409e33);await writeOutput(_0x2fdc42,_0x409e33[_0x1ed78d(0x156)]||undefined,_0x409e33[_0x1ed78d(0x177)]);}export async function handleQueryOutput(_0x42c17f,_0x5874f1){const _0x424f4b=a40_0x1476,_0x1c2e3a=resolveOutputOptions(_0x5874f1),_0x777b73=await formatQueryOutput(_0x42c17f,_0x1c2e3a);await writeOutput(_0x777b73,_0x1c2e3a[_0x424f4b(0x156)]||undefined,_0x1c2e3a['format']);}async function formatSingleObject(_0x395ccf,_0x1eed94){const _0x59d67f=a40_0x1476,{format:_0xe0453a,color:_0x585048,noColor:_0x2e85e0}=_0x1eed94,_0x32342a={'color':_0x585048,'noColor':_0x2e85e0};if(_0xe0453a===_0x59d67f(0x164)){if(shouldUseColor(_0x32342a))return colorizeJSON(_0x395ccf,_0x32342a);return JSON[_0x59d67f(0x15d)](_0x395ccf,null,0x2);}else{if(_0xe0453a==='jsonl'){if(shouldUseColor(_0x32342a))return colorizeJSONCompact(_0x395ccf,_0x32342a);return JSON[_0x59d67f(0x15d)](_0x395ccf);}else{if(_0xe0453a===_0x59d67f(0x13f))return Object[_0x59d67f(0x170)](_0x395ccf)[_0x59d67f(0x167)](([_0x3a7c95,_0x3d5fe4])=>_0x3a7c95+'\x09'+_0x3d5fe4)['join']('\x0a');else{const _0x5d580e=Object[_0x59d67f(0x170)](_0x395ccf);if(_0x5d580e[_0x59d67f(0x157)]===0x0)return _0x59d67f(0x15a);const _0x41811e=_0x395ccf['debug'],_0x17ef8f=_0x395ccf[_0x59d67f(0x173)],_0x37899e=_0x395ccf[_0x59d67f(0x16b)],_0x143bde=_0x395ccf[_0x59d67f(0x172)],_0xe0b745=_0x17ef8f?typeof _0x17ef8f===_0x59d67f(0x142)?_0x17ef8f:JSON['stringify'](_0x17ef8f,null,0x2):undefined,_0xc09f29=_0x37899e&&Object[_0x59d67f(0x149)](_0x37899e)[_0x59d67f(0x157)]>0x0?JSON[_0x59d67f(0x15d)](_0x37899e,null,0x2):undefined,_0x47cae7=_0x143bde&&Object[_0x59d67f(0x149)](_0x143bde)[_0x59d67f(0x157)]>0x0?JSON[_0x59d67f(0x15d)](_0x143bde,null,0x2):undefined,_0x1c6bda=_0x5d580e['filter'](([_0x30c3d7])=>_0x30c3d7!==_0x59d67f(0x140)&&_0x30c3d7!==_0x59d67f(0x173)&&_0x30c3d7!==_0x59d67f(0x16b)&&_0x30c3d7!=='rule'),_0x4d6e57=Math[_0x59d67f(0x139)](..._0x1c6bda[_0x59d67f(0x167)](([_0x25a3bc])=>_0x25a3bc[_0x59d67f(0x157)])),_0x3e3817=Math[_0x59d67f(0x139)](..._0x1c6bda[_0x59d67f(0x167)](([,_0x253fb7])=>{const _0x337563=_0x59d67f;try{const _0x415321=_0x253fb7===null||_0x253fb7===undefined?'':typeof _0x253fb7===_0x337563(0x14a)?JSON['stringify'](_0x253fb7):String(_0x253fb7),_0x3a4eaa=_0x415321[_0x337563(0x158)]('\x0a');return Math['max'](..._0x3a4eaa[_0x337563(0x167)](_0x2b8eaf=>_0x2b8eaf['length']),0x0);}catch{return 0x0;}}),0x14),_0x409e7a=[];_0x409e7a[_0x59d67f(0x154)](colorBorder('┌─'+'─'[_0x59d67f(0x13d)](_0x4d6e57)+_0x59d67f(0x17b)+'─'[_0x59d67f(0x13d)](_0x3e3817)+'─┐',_0x32342a)),_0x1c6bda[_0x59d67f(0x15b)](([_0x13f284,_0x21f9e2])=>{const _0x1b8084=_0x59d67f;let _0x1dcef6;try{_0x1dcef6=_0x21f9e2===null||_0x21f9e2===undefined?'':typeof _0x21f9e2===_0x1b8084(0x14a)?JSON[_0x1b8084(0x15d)](_0x21f9e2):String(_0x21f9e2);}catch{_0x1dcef6=_0x1b8084(0x14f);}const _0x336535=_0x13f284[_0x1b8084(0x146)](_0x4d6e57),_0x556b3c=_0x1dcef6['split']('\x0a');_0x556b3c[_0x1b8084(0x15b)]((_0xb59cfc,_0x4d25ba)=>{const _0x106c67=_0x1b8084,_0x7ee358=colorBorder('│',_0x32342a);_0x4d25ba===0x0?_0x409e7a[_0x106c67(0x154)](_0x7ee358+'\x20'+_0x336535+'\x20'+_0x7ee358+'\x20'+_0xb59cfc['padEnd'](_0x3e3817)+'\x20'+_0x7ee358):_0x409e7a[_0x106c67(0x154)](_0x7ee358+'\x20'+'\x20'[_0x106c67(0x13d)](_0x4d6e57)+'\x20'+_0x7ee358+'\x20'+_0xb59cfc[_0x106c67(0x146)](_0x3e3817)+'\x20'+_0x7ee358);});}),_0x409e7a['push'](colorBorder('└─'+'─'[_0x59d67f(0x13d)](_0x4d6e57)+_0x59d67f(0x13a)+'─'[_0x59d67f(0x13d)](_0x3e3817)+'─┘',_0x32342a));_0xe0b745&&(_0x409e7a[_0x59d67f(0x154)](''),_0x409e7a['push'](String(a40_0x38ce53[_0x59d67f(0x161)]['bold'](_0x59d67f(0x180)))),_0x409e7a[_0x59d67f(0x154)](_0xe0b745));_0xc09f29&&(_0x409e7a['push'](''),_0x409e7a[_0x59d67f(0x154)](String(a40_0x38ce53[_0x59d67f(0x176)][_0x59d67f(0x163)](_0x59d67f(0x153)))),_0x409e7a[_0x59d67f(0x154)](_0xc09f29));_0x47cae7&&(_0x409e7a['push'](''),_0x409e7a['push'](String(a40_0x38ce53[_0x59d67f(0x15e)]['bold'](_0x59d67f(0x17e)))),_0x409e7a[_0x59d67f(0x154)](_0x47cae7));if(_0x41811e){if(_0x41811e[_0x59d67f(0x16f)]){_0x409e7a[_0x59d67f(0x154)](''),_0x409e7a['push'](String(a40_0x38ce53[_0x59d67f(0x169)][_0x59d67f(0x163)]('[error]')));const _0x1456be=_0x41811e[_0x59d67f(0x16f)][_0x59d67f(0x158)]('\x0a');_0x1456be[_0x59d67f(0x15b)](_0x1f6418=>{const _0x4e70eb=_0x59d67f;_0x1f6418[_0x4e70eb(0x15f)]()&&_0x409e7a[_0x4e70eb(0x154)](_0x1f6418);});}if(_0x41811e[_0x59d67f(0x14b)]){_0x409e7a[_0x59d67f(0x154)](''),_0x409e7a[_0x59d67f(0x154)](String(a40_0x38ce53[_0x59d67f(0x181)]['bold']('[logs]')));const _0x35e71b=_0x41811e[_0x59d67f(0x14b)]['split']('\x0a');_0x35e71b[_0x59d67f(0x15b)](_0x7e45b5=>{const _0x42b6e5=_0x59d67f;_0x7e45b5[_0x42b6e5(0x15f)]()&&_0x409e7a[_0x42b6e5(0x154)](_0x7e45b5);});}}return _0x409e7a[_0x59d67f(0x14c)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x381e9f,_0x4caab0){const _0x2f4657=a40_0x1476;if(_0x4caab0[_0x2f4657(0x177)]===_0x2f4657(0x16a)){await handleSDKOutput([_0x381e9f],_0x4caab0);return;}const _0x5883cd=resolveOutputOptions(_0x4caab0),_0xb4090=await formatSingleObject(_0x381e9f,_0x5883cd);await writeOutput(_0xb4090,_0x5883cd['output']||undefined,_0x5883cd[_0x2f4657(0x177)]);}