@treasuredata/tdx 2026.3.12 → 2026.3.14

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 (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a51_0x329efe=a51_0x5192;(function(_0x47321b,_0x4750dd){const _0x81d334=a51_0x5192,_0x8bc3fb=_0x47321b();while(!![]){try{const _0x42b415=-parseInt(_0x81d334(0x22c))/0x1+-parseInt(_0x81d334(0x23e))/0x2*(-parseInt(_0x81d334(0x203))/0x3)+-parseInt(_0x81d334(0x202))/0x4+parseInt(_0x81d334(0x1e8))/0x5+parseInt(_0x81d334(0x218))/0x6*(-parseInt(_0x81d334(0x24f))/0x7)+-parseInt(_0x81d334(0x1a9))/0x8+-parseInt(_0x81d334(0xe8))/0x9*(-parseInt(_0x81d334(0x24d))/0xa);if(_0x42b415===_0x4750dd)break;else _0x8bc3fb['push'](_0x8bc3fb['shift']());}catch(_0x3c01d4){_0x8bc3fb['push'](_0x8bc3fb['shift']());}}}(a51_0x192a,0xcf306));import a51_0x5a26d5 from'chalk';import{existsSync}from'fs';import a51_0x447410 from'path';import{BaseCommand}from'./command.js';function a51_0x5192(_0xe24929,_0x25b9b0){_0xe24929=_0xe24929-0xd6;const _0x192a7f=a51_0x192a();let _0x519268=_0x192a7f[_0xe24929];return _0x519268;}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x17395a from'prompts';function getAttemptStatusDisplay(_0x3c4c3e){const _0x4ba174=a51_0x5192;if(!_0x3c4c3e)return{'icon':'⏳','text':''};const {done:_0xbe90ca,success:_0x287306,cancelRequested:_0x49603a}=_0x3c4c3e;if(!_0xbe90ca)return _0x49603a?{'icon':'🛑','text':a51_0x5a26d5[_0x4ba174(0x1a4)]('canceling')}:{'icon':'🔄','text':a51_0x5a26d5[_0x4ba174(0x13e)](_0x4ba174(0x22b))};if(_0x287306)return{'icon':'✅','text':a51_0x5a26d5[_0x4ba174(0xd9)]('success')};return{'icon':'❌','text':a51_0x5a26d5['red'](_0x4ba174(0x112))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x250c84,_0x254c75,_0x5dd039=0x0){const _0x5a2d56=a51_0x5192;return _0x250c84[_0x5dd039]||_0x254c75[_0x5a2d56(0x206)];}[a51_0x329efe(0x15e)](_0x22d3d4,_0x1a8a59,_0x13de0b=0x0){const _0x24ded3=a51_0x329efe,_0x4493e4=this[_0x24ded3(0x137)](_0x22d3d4,_0x1a8a59,_0x13de0b);if(!_0x4493e4)return console[_0x24ded3(0x112)](a51_0x5a26d5['red'](_0x24ded3(0x24e)),'Project\x20name\x20is\x20required'),console['error'](a51_0x5a26d5[_0x24ded3(0x26d)](_0x24ded3(0x1b1))),null;return _0x4493e4;}['parseProjectWorkflowPattern'](_0x3b9854,_0x437105){const _0x43f2ae=a51_0x329efe;if(_0x3b9854[0x0]){const _0x5c821a=_0x3b9854[0x0]['split']('.');if(_0x5c821a[_0x43f2ae(0x1ee)]===0x1)return{'projectName':_0x5c821a[0x0],'workflowName':undefined};else return _0x5c821a[_0x43f2ae(0x1ee)]===0x2?{'projectName':_0x5c821a[0x0],'workflowName':_0x5c821a[0x1]}:(console[_0x43f2ae(0x112)](a51_0x5a26d5[_0x43f2ae(0x181)](_0x43f2ae(0x24e)),_0x43f2ae(0x237)),null);}return{'projectName':_0x437105[_0x43f2ae(0x206)],'workflowName':undefined};}[a51_0x329efe(0x21a)](_0x415234,_0x29158f,_0x3f611f=0x0){const _0x2d8f4d=a51_0x329efe;if(_0x415234[_0x3f611f])return _0x415234[_0x3f611f];if(_0x29158f['workflowProject']){const _0x17910f=a51_0x447410[_0x2d8f4d(0x221)](process[_0x2d8f4d(0xde)](),_0x2d8f4d(0x170),_0x29158f[_0x2d8f4d(0x206)]);if(existsSync(a51_0x447410[_0x2d8f4d(0x221)](_0x17910f,'tdx.json')))return _0x17910f;}return undefined;}async[a51_0x329efe(0x233)](_0x39136b,_0x592ac7,_0x2f7557){const _0xf506d6=a51_0x329efe;try{const _0x483988=await _0x39136b[_0xf506d6(0x229)][_0xf506d6(0x170)](_0x592ac7,{'limit':0x1});if(_0x483988[_0xf506d6(0x1ee)]>0x0){const _0x4a10e2=_0x483988[0x0]['id'],_0x16c446=getWorkflowUrl(_0x2f7557,_0x4a10e2);console[_0xf506d6(0x112)](_0xf506d6(0x20e)+a51_0x5a26d5[_0xf506d6(0x127)](_0x16c446));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x16f);[a51_0x329efe(0x269)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a51_0x329efe(0x242)](_0x22066b){const _0x344efb=a51_0x329efe,{options:_0x2da177,args:_0x575ddb,tdx:_0x2bddc3}=_0x22066b,_0x8a6a36=_0x575ddb[0x0],_0x15d5dc=_0x2da177['clear'];if(_0x15d5dc)return saveSessionContext({'workflow_project':undefined},_0x2da177[_0x344efb(0x104)]),console[_0x344efb(0x1d1)](a51_0x5a26d5[_0x344efb(0xd9)](_0x344efb(0x177))),0x0;if(!_0x8a6a36)return console[_0x344efb(0x112)](a51_0x5a26d5[_0x344efb(0x181)](_0x344efb(0x24e)),_0x344efb(0x133)),console[_0x344efb(0x112)](a51_0x5a26d5[_0x344efb(0x26d)](_0x344efb(0x11d))),console[_0x344efb(0x112)](a51_0x5a26d5['dim'](_0x344efb(0x1dd))),0x1;const _0x4d5907=await withSpinner(_0x344efb(0x1d0)+_0x8a6a36+_0x344efb(0x213),()=>_0x2bddc3['workflow'][_0x344efb(0x169)](_0x8a6a36),{'verbose':_0x2da177['verbose']}),{name:_0x11b240}=_0x4d5907['data'];return saveSessionContext({'workflow_project':_0x11b240},_0x2da177[_0x344efb(0x104)]),console[_0x344efb(0x1d1)](a51_0x5a26d5['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a51_0x5a26d5[_0x344efb(0x127)](_0x11b240))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0xfb);['description']=a51_0x329efe(0x19a);async['execute'](_0x25c4f5){const _0x3cc0e9=a51_0x329efe,{options:_0x5cf5ae,args:_0x45fff9,tdx:_0x16732e}=_0x25c4f5,_0xaf31dc=_0x45fff9[0x0];_0x5cf5ae[_0x3cc0e9(0x21b)]&&_0xaf31dc&&console[_0x3cc0e9(0x112)](_0x3cc0e9(0x1e1)+_0xaf31dc);const _0x386bc9=await withSpinner(_0x3cc0e9(0x190),()=>_0x16732e['workflow'][_0x3cc0e9(0xf6)](_0xaf31dc,{'limit':_0x5cf5ae['limit']}),{'verbose':_0x5cf5ae['verbose']});let _0x15b338=_0x386bc9[_0x3cc0e9(0x103)];_0x15b338[_0x3cc0e9(0x108)]((_0xc08763,_0x117151)=>_0xc08763[_0x3cc0e9(0x161)]['localeCompare'](_0x117151[_0x3cc0e9(0x161)]));const _0x7120bb=_0x5cf5ae[_0x3cc0e9(0x173)]||0x64,_0xfa0e24=_0x15b338[_0x3cc0e9(0x1ee)]>=_0x7120bb?a51_0x5a26d5['dim'](_0x3cc0e9(0x1e7)):'';console[_0x3cc0e9(0x112)](_0x3cc0e9(0x139)+_0x15b338[_0x3cc0e9(0x1ee)]+_0x3cc0e9(0x1f4)+(_0x15b338[_0x3cc0e9(0x1ee)]!==0x1?'s':'')+_0xfa0e24);if(_0x5cf5ae[_0x3cc0e9(0x214)]===_0x3cc0e9(0x17d)||_0x5cf5ae[_0x3cc0e9(0x214)]===_0x3cc0e9(0x1e2)||_0x5cf5ae[_0x3cc0e9(0x214)]==='table')await handleSDKOutput(_0x15b338,_0x5cf5ae);else{if(_0x15b338[_0x3cc0e9(0x1ee)]===0x0)_0xaf31dc?console['log'](_0x3cc0e9(0x11b)+_0xaf31dc):console[_0x3cc0e9(0x1d1)](_0x3cc0e9(0x22f));else{const _0x30a51e=_0x15b338['map'](_0xa09087=>{const _0x3ac90b=_0x3cc0e9,_0x278ce3=_0xa09087[_0x3ac90b(0x167)]?.[_0x3ac90b(0xff)](_0x285ee9=>_0x285ee9['key']==='sys'),_0x442401=_0x278ce3?a51_0x5a26d5[_0x3ac90b(0x26d)](_0x3ac90b(0x199)):'';return'📁\x20'+_0xa09087[_0x3ac90b(0x161)]+_0x442401;});await writeOutput(_0x30a51e['join']('\x0a'),_0x5cf5ae[_0x3cc0e9(0x1fe)],_0x3cc0e9(0x1bd));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]='workflow:workflows';[a51_0x329efe(0x269)]='List\x20workflows';async[a51_0x329efe(0x242)](_0x3a0245){const _0x42268c=a51_0x329efe,{options:_0xb00efb,args:_0x2b6f9d,tdx:_0x48496b}=_0x3a0245,_0x551b78=this[_0x42268c(0x137)](_0x2b6f9d,_0xb00efb);_0xb00efb['verbose']&&_0x551b78&&console['error'](_0x42268c(0x18a)+_0x551b78);const _0x414525=await withSpinner(_0x42268c(0x1d7),()=>_0x48496b[_0x42268c(0x229)][_0x42268c(0x170)](_0x551b78,{'limit':_0xb00efb[_0x42268c(0x173)]}),{'verbose':_0xb00efb['verbose']});let _0x32c84e=_0x414525[_0x42268c(0x103)];_0x32c84e[_0x42268c(0x108)]((_0xcb86ab,_0x573c59)=>{const _0x2db251=_0x42268c,_0x43fa7d=_0xcb86ab[_0x2db251(0x161)][_0x2db251(0x1ef)](_0x573c59[_0x2db251(0x161)]);if(_0x43fa7d!==0x0)return _0x43fa7d;return(_0xcb86ab['project']?.[_0x2db251(0x161)]||'')[_0x2db251(0x1ef)](_0x573c59[_0x2db251(0x156)]?.[_0x2db251(0x161)]||'');});const _0x2b4632=_0xb00efb['limit']||0x64,_0x125df1=_0x32c84e['length']>=_0x2b4632?a51_0x5a26d5[_0x42268c(0x26d)](_0x42268c(0x1e7)):'';console[_0x42268c(0x112)](_0x42268c(0x139)+_0x32c84e['length']+_0x42268c(0x236)+(_0x32c84e['length']!==0x1?'s':'')+_0x125df1);if(_0xb00efb[_0x42268c(0x214)]==='json'||_0xb00efb[_0x42268c(0x214)]==='jsonl'||_0xb00efb[_0x42268c(0x214)]==='table')await handleSDKOutput(_0x32c84e,_0xb00efb);else{if(_0x32c84e['length']===0x0)_0x551b78?console['log']('No\x20workflows\x20found\x20in\x20project:\x20'+_0x551b78):console[_0x42268c(0x1d1)](_0x42268c(0xe4));else{const _0xa66396=_0xb00efb[_0x42268c(0x258)],_0x57090b=_0x32c84e[_0x42268c(0x1c4)](_0x3a3855=>{const _0x56ea2c=_0x42268c,_0x2e029a=a51_0x5a26d5['dim']('#'+_0x3a3855['id']),_0x49dc5c=hyperlink(_0x2e029a,getWorkflowUrl(_0xa66396,_0x3a3855['id'])),_0x983282=_0x3a3855[_0x56ea2c(0x156)]?.[_0x56ea2c(0x161)]?a51_0x5a26d5[_0x56ea2c(0x26d)]('\x20('+_0x3a3855[_0x56ea2c(0x156)][_0x56ea2c(0x161)]+')'):'';return _0x56ea2c(0xf0)+_0x49dc5c+'\x20'+_0x3a3855[_0x56ea2c(0x161)]+_0x983282;});await writeOutput(_0x57090b[_0x42268c(0x221)]('\x0a'),_0xb00efb[_0x42268c(0x1fe)],_0x42268c(0x1bd));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x105);[a51_0x329efe(0x269)]=a51_0x329efe(0xd6);async['execute'](_0x4821a1){const _0x1f34ff=a51_0x329efe,{options:_0x2fe994,args:_0x128f25,tdx:_0x27a473}=_0x4821a1,_0x5329b1=this[_0x1f34ff(0x1e5)](_0x128f25,_0x2fe994);if(!_0x5329b1)return 0x1;const {projectName:_0x49e5ef,workflowName:_0x16433f}=_0x5329b1;if(_0x2fe994['verbose']){if(_0x49e5ef&&_0x16433f)console[_0x1f34ff(0x112)]('Filter:\x20'+_0x49e5ef+'.'+_0x16433f);else _0x49e5ef&&console[_0x1f34ff(0x112)](_0x1f34ff(0x26a)+_0x49e5ef);const _0x407714=_0x2fe994[_0x1f34ff(0xfa)];_0x407714&&console[_0x1f34ff(0x112)](_0x1f34ff(0x135)+_0x407714);}let _0x32b511=0x28;if(process['stdout'][_0x1f34ff(0xdb)]&&!_0x2fe994[_0x1f34ff(0x1fe)]&&!_0x2fe994[_0x1f34ff(0x214)]){const _0x8b7e7=process[_0x1f34ff(0x22a)][_0x1f34ff(0x17b)]||0x28;_0x32b511=Math['max'](0x14,Math['floor'](_0x8b7e7*0x2/0x3));}const _0x24d6bb=_0x2fe994['limit']||_0x32b511,_0x5364f4=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x27a473[_0x1f34ff(0x229)][_0x1f34ff(0x1a2)]({'projectName':_0x49e5ef,'workflowName':_0x16433f,'status':_0x2fe994['status'],'fromTime':_0x2fe994['from'],'toTime':_0x2fe994['to'],'limit':_0x24d6bb}),{'verbose':_0x2fe994['verbose']}),_0x33b38c=_0x5364f4[_0x1f34ff(0x103)];_0x33b38c[_0x1f34ff(0x108)]((_0x58fda1,_0x1f978d)=>{const _0x4df4cd=_0x1f34ff,_0x4cc2ca=_0x58fda1['sessionTime']||'',_0x23b49f=_0x1f978d[_0x4df4cd(0x1c2)]||'';return _0x23b49f[_0x4df4cd(0x1ef)](_0x4cc2ca);});_0x33b38c[_0x1f34ff(0x1ee)]>=_0x24d6bb?console[_0x1f34ff(0x112)](_0x1f34ff(0x15f)+_0x33b38c[_0x1f34ff(0x1ee)]+'\x20sessions\x20'+a51_0x5a26d5[_0x1f34ff(0x26d)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x1f34ff(0x112)]('✔\x20Found\x20'+_0x33b38c['length']+_0x1f34ff(0x273)+(_0x33b38c[_0x1f34ff(0x1ee)]!==0x1?'s':''));if(_0x2fe994[_0x1f34ff(0x214)]===_0x1f34ff(0x17d)||_0x2fe994[_0x1f34ff(0x214)]==='jsonl'||_0x2fe994[_0x1f34ff(0x214)]===_0x1f34ff(0x17c))await handleSDKOutput(_0x33b38c,_0x2fe994);else{if(!process[_0x1f34ff(0x22a)]['isTTY']||_0x2fe994[_0x1f34ff(0x1fe)]){if(_0x33b38c['length']===0x0){if(_0x49e5ef&&_0x16433f)console[_0x1f34ff(0x1d1)]('No\x20sessions\x20found\x20for:\x20'+_0x49e5ef+'.'+_0x16433f);else _0x49e5ef?console[_0x1f34ff(0x1d1)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x49e5ef):console[_0x1f34ff(0x1d1)](_0x1f34ff(0x13d));}else{const _0x1bf640=_0x2fe994[_0x1f34ff(0x258)],_0x47011a=this[_0x1f34ff(0xf9)](_0x33b38c,_0x1bf640);_0x2fe994[_0x1f34ff(0x1fe)]?await writeOutput(_0x47011a,_0x2fe994[_0x1f34ff(0x1fe)],_0x1f34ff(0x1bd)):console[_0x1f34ff(0x1d1)](_0x47011a);}!_0x49e5ef&&(console[_0x1f34ff(0x112)](''),console[_0x1f34ff(0x112)](a51_0x5a26d5[_0x1f34ff(0x26d)](_0x1f34ff(0xf4))),console['error'](a51_0x5a26d5[_0x1f34ff(0x26d)](_0x1f34ff(0x180))+'or'+a51_0x5a26d5[_0x1f34ff(0x26d)](_0x1f34ff(0x151))));}else{if(_0x33b38c['length']===0x0){if(_0x49e5ef&&_0x16433f)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x49e5ef+'.'+_0x16433f);else _0x49e5ef?console['log'](_0x1f34ff(0x12a)+_0x49e5ef):console[_0x1f34ff(0x1d1)](_0x1f34ff(0x13d));}else await this[_0x1f34ff(0x123)](_0x33b38c,_0x4821a1,_0x49e5ef);}}return 0x0;}['renderSessionsTimeline'](_0x34593d,_0xae3555){const _0x1aa756=a51_0x329efe,_0x535118=[],_0x133e57=new Map();let _0x4d418c=Infinity,_0x5e220d=-Infinity;for(const _0xd48a9a of _0x34593d){if(_0xd48a9a[_0x1aa756(0x249)]?.[_0x1aa756(0x1a0)]){const _0x44dd18=new Date(_0xd48a9a[_0x1aa756(0x249)]['createdAt'])[_0x1aa756(0x118)](),_0x45d60a=_0xd48a9a[_0x1aa756(0x249)][_0x1aa756(0x254)]?new Date(_0xd48a9a[_0x1aa756(0x249)]['finishedAt'])[_0x1aa756(0x118)]():Date[_0x1aa756(0xda)](),_0x2b3083=_0xd48a9a['project']?.['name']||'(unknown)';!_0x133e57[_0x1aa756(0x270)](_0x2b3083)&&_0x133e57[_0x1aa756(0x1da)](_0x2b3083,[]),_0x133e57[_0x1aa756(0x1aa)](_0x2b3083)[_0x1aa756(0x193)]({'session':_0xd48a9a,'startTime':_0x44dd18,'endTime':_0x45d60a,'duration':_0x45d60a-_0x44dd18}),_0x4d418c=Math[_0x1aa756(0x1ec)](_0x4d418c,_0x44dd18),_0x5e220d=Math[_0x1aa756(0x188)](_0x5e220d,_0x45d60a);}}if(_0x133e57[_0x1aa756(0x205)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4724f4=process['stdout'][_0x1aa756(0x235)]||0x78,_0x25b357=0x1e,_0x3fdf21=0x32,_0x18def9=0x4,_0x1ff72a=Math[_0x1aa756(0x1ec)](_0x3fdf21,Math['max'](_0x25b357,Math[_0x1aa756(0x268)](_0x4724f4*0.3))),_0x48eed1=_0x4724f4-_0x1ff72a-TIMELINE_CONFIG['GUTTER']-0x3-_0x18def9,_0x40214e=_0x5e220d-_0x4d418c,_0x49292d=_0x40214e/_0x1ff72a,_0x112f64=renderTimeAxis({'startTime':_0x4d418c,'endTime':_0x5e220d,'durationMs':_0x40214e,'msPerChar':_0x49292d},_0x1ff72a),_0x44d98f=[];for(const _0x25f492 of _0x133e57[_0x1aa756(0x239)]()){_0x44d98f[_0x1aa756(0x193)](..._0x25f492);}_0x44d98f[_0x1aa756(0x108)]((_0x402a14,_0x26daa3)=>_0x26daa3[_0x1aa756(0xf1)]-_0x402a14[_0x1aa756(0xf1)]);const _0x13f0bc=new Date(_0x4d418c),_0x53141f=formatDate(_0x13f0bc),_0xc4ed58=_0x18def9+TIMELINE_CONFIG[_0x1aa756(0xed)]+TIMELINE_CONFIG[_0x1aa756(0x172)]+_0x48eed1,_0x1d3251='\x20'[_0x1aa756(0x166)](_0xc4ed58-_0x53141f[_0x1aa756(0x1ee)]),_0x56d0b2=_0x1d3251+a51_0x5a26d5[_0x1aa756(0x26d)](_0x53141f)+'\x20'+_0x112f64;_0x535118['push'](_0x56d0b2);const _0x5078db=0x16;let _0x367faf=0x0;for(const _0x5651c5 of _0x44d98f){const _0x2e7b9e=_0x5651c5[_0x1aa756(0x104)][_0x1aa756(0x156)]?.['name']||'?',_0x5926fe=Math[_0x1aa756(0x1ec)](stringWidth(_0x2e7b9e),_0x5078db);_0x367faf=Math[_0x1aa756(0x188)](_0x367faf,_0x5926fe);}for(const _0x1d0a61 of _0x44d98f){const {session:_0x580207,startTime:_0x3df6de,endTime:_0x6679b3,duration:_0x2030ed}=_0x1d0a61,_0x32ab3d=_0x580207[_0x1aa756(0x156)]?.['id'],_0x1ba341=_0x580207['id'],_0x502507=_0x580207[_0x1aa756(0x156)]?.[_0x1aa756(0x161)]||'?',_0x5a15c3=_0x580207['workflow']?.['name']||'?';let _0x28c5cf,_0xee373c;if(_0x580207['lastAttempt']){const _0x471784=_0x580207['lastAttempt'];!_0x471784[_0x1aa756(0x27e)]?(_0x28c5cf=_0x471784[_0x1aa756(0x1b7)]?'🛑':'🔄',_0xee373c=_0x471784[_0x1aa756(0x1b7)]?a51_0x5a26d5[_0x1aa756(0x1a4)]:a51_0x5a26d5[_0x1aa756(0x13e)]):(_0x28c5cf=_0x471784['success']?'✅':'❌',_0xee373c=_0x471784['success']?a51_0x5a26d5['green']:a51_0x5a26d5[_0x1aa756(0x181)]);}else _0x28c5cf='⏳',_0xee373c=a51_0x5a26d5[_0x1aa756(0x26d)];const _0x18b1b5='#'+_0x1ba341,_0x276bd1=_0x32ab3d?hyperlink(_0x18b1b5,getWorkflowSessionUrl(_0xae3555,_0x32ab3d,_0x1ba341)):_0x18b1b5;let _0x20260a=_0x502507;stringWidth(_0x502507)>_0x5078db&&(_0x20260a=_0x502507['slice'](0x0,_0x5078db-0x1)+'…');const _0x3898aa=a51_0x5a26d5[_0x1aa756(0x26d)](_0x20260a),_0x501f27=stringWidth(_0x20260a),_0x2beccc='\x20'[_0x1aa756(0x166)](_0x367faf-stringWidth(_0x20260a)+0x2),_0x932a57='('+formatElapsed(_0x2030ed)+')',_0x1245bf=stringWidth(_0x932a57),_0x2df88d=stringWidth(_0x18b1b5),_0x4c822d=_0x2df88d+0x1+_0x501f27+_0x2beccc['length'],_0x45c815=_0x48eed1-_0x4c822d-_0x1245bf-0x1-0x8;let _0x54760e=_0x5a15c3;stringWidth(_0x54760e)>_0x45c815&&(_0x54760e=_0x54760e['slice'](0x0,_0x45c815-0x1)+'…');const _0x4d7f6d=_0x276bd1+'\x20'+_0x3898aa+_0x2beccc+_0x54760e,_0x3afac1=stringWidth(_0x4d7f6d),_0x1e80c3=_0x48eed1-_0x3afac1-_0x1245bf,_0x321c3c=_0x4d7f6d+'\x20'['repeat'](Math[_0x1aa756(0x188)](0x1,_0x1e80c3))+a51_0x5a26d5['dim'](_0x932a57),_0x37c9e8=Math[_0x1aa756(0x268)]((_0x3df6de-_0x4d418c)/_0x49292d),_0x4492bf=Math['floor']((_0x6679b3-_0x4d418c)/_0x49292d),_0x404804=Math[_0x1aa756(0x188)](_0x37c9e8+0x1,_0x4492bf),_0x5b722f=new Array(_0x1ff72a)[_0x1aa756(0x1ba)]('\x20');for(let _0x1da164=_0x37c9e8;_0x1da164<Math['min'](_0x404804,_0x1ff72a);_0x1da164++){_0x5b722f[_0x1da164]='─';}const _0xe5addf=_0x5b722f[_0x1aa756(0x1c4)](_0x738f3=>_0x738f3==='\x20'?'\x20':_0xee373c(_0x738f3))[_0x1aa756(0x221)]('');_0x535118[_0x1aa756(0x193)](_0x28c5cf+'\x20'+_0x321c3c+'│'+_0xe5addf+'│');}return _0x535118[_0x1aa756(0x221)]('\x0a');}async['navigateSessionsInteractive'](_0x25227a,_0xd1e16a,_0x5d44b5){const _0x25623e=a51_0x329efe,{options:_0x1aba5d,tdx:_0xb8501f}=_0xd1e16a,_0x1a0d3f=_0x1aba5d[_0x25623e(0x258)],{timelineRows:_0x224af3,timeAxisHeader:_0x506d85}=this[_0x25623e(0x220)](_0x25227a,_0x1a0d3f),_0x21bd02=_0x224af3[_0x25623e(0x228)](_0x4e6bc6=>_0x4e6bc6[_0x25623e(0x196)]);if(_0x21bd02[_0x25623e(0x1ee)]===0x0){const _0x223571=this[_0x25623e(0xf9)](_0x25227a,_0x1a0d3f);console['log'](_0x223571);!_0x5d44b5&&(console[_0x25623e(0x112)](''),console['error'](a51_0x5a26d5[_0x25623e(0x26d)](_0x25623e(0xf4))),console['error'](a51_0x5a26d5[_0x25623e(0x26d)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5a26d5['dim'](_0x25623e(0x151))));return;}_0x506d85&&console[_0x25623e(0x1d1)](_0x506d85);const _0x352ca1=_0x224af3[_0x25623e(0x228)](_0x2f5dbc=>_0x2f5dbc[_0x25623e(0x196)])[_0x25623e(0x1c4)](_0x5cd025=>({'title':_0x5cd025['displayLine'],'value':_0x5cd025['attemptId']})),_0x202895=process[_0x25623e(0x22a)][_0x25623e(0x17b)]||0x3c,_0x1896f1=Math[_0x25623e(0x188)](0x28,Math[_0x25623e(0x268)](_0x202895*0x2/0x3)),_0x5ad963=await a51_0x17395a({'type':_0x25623e(0x23d),'name':_0x25623e(0x196),'message':_0x25623e(0x11f),'choices':_0x352ca1,'initial':-0x1,'limit':_0x1896f1,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x129046,_0x4a9f7e)=>{const _0x5d6fd0=_0x25623e;if(!_0x129046)return Promise[_0x5d6fd0(0x192)](_0x4a9f7e);const _0x2b503e=_0x4a9f7e[_0x5d6fd0(0x228)](_0x3e9e99=>{const _0x34044a=_0x5d6fd0,_0x433afa=_0x3e9e99;return _0x433afa['title'][_0x34044a(0x25a)]()[_0x34044a(0x22e)](_0x129046[_0x34044a(0x25a)]());});return Promise[_0x5d6fd0(0x192)](_0x2b503e);}}),_0x1ddea4=()=>{const _0x3216d0=_0x25623e;process[_0x3216d0(0x22a)][_0x3216d0(0x12e)]('\x1b[1A\x1b[2K'),process[_0x3216d0(0x22a)][_0x3216d0(0x12e)](_0x3216d0(0x1de)),process[_0x3216d0(0x22a)][_0x3216d0(0x12e)](_0x3216d0(0x1de));},_0x7dc899=_0x5ad963&&_0x5ad963[_0x25623e(0x196)]&&_0x5ad963[_0x25623e(0x196)]!==null&&_0x5ad963[_0x25623e(0x196)][_0x25623e(0x21c)]()!=='';if(!_0x7dc899){_0x1ddea4(),console[_0x25623e(0x1d1)](a51_0x5a26d5[_0x25623e(0x26d)]('Cancelled'));return;}_0x1ddea4();const _0x4538b7=_0x25227a['find'](_0x5bd4d4=>_0x5bd4d4[_0x25623e(0x249)]?.['id']===_0x5ad963[_0x25623e(0x196)]);if(_0x4538b7){const _0x441340=_0x4538b7[_0x25623e(0x156)]?.[_0x25623e(0x161)]||'?',_0x1c73ca=_0x4538b7['workflow']?.[_0x25623e(0x161)]||'?';console[_0x25623e(0x1d1)](_0x25623e(0x1ae)+a51_0x5a26d5['dim'](_0x441340)+',\x20Workflow:\x20'+a51_0x5a26d5['dim'](_0x1c73ca));}const _0x53cbcc=new WorkflowTimelineCommand();await _0x53cbcc[_0x25623e(0x242)]({'args':[],'options':{..._0x1aba5d,'attemptId':_0x5ad963[_0x25623e(0x196)]},'tdx':_0xb8501f});}[a51_0x329efe(0x220)](_0x55f56b,_0x56f568){const _0x33910f=a51_0x329efe,_0xd7dc0a=new Map();for(const _0x49df75 of _0x55f56b){_0x49df75['id']&&_0x49df75[_0x33910f(0x249)]?.['id']&&_0xd7dc0a[_0x33910f(0x1da)](_0x49df75['id'],_0x49df75[_0x33910f(0x249)]['id']);}const _0x583874=[];let _0x4faa81='';const _0x1b02fc=this[_0x33910f(0xf9)](_0x55f56b,_0x56f568),_0x3ddf12=_0x1b02fc[_0x33910f(0x1f7)]('\x0a');for(const _0x101497 of _0x3ddf12){if(_0x101497[_0x33910f(0x25f)](_0x33910f(0x234))||_0x101497[_0x33910f(0x238)](/^\s+\d{4}-\d{2}-\d{2}/))_0x4faa81=_0x101497;else{if(_0x101497[_0x33910f(0x238)](/^[✅❌🔄🛑⏳]/)){const _0x3af43b=_0x101497[_0x33910f(0x238)](/#(\d+)/),_0x457570=_0x3af43b?_0x3af43b[0x1]:null,_0x48b222=_0x457570?_0xd7dc0a[_0x33910f(0x1aa)](_0x457570)||null:null,_0x58b30d=_0x55f56b[_0x33910f(0x27b)](_0x23c8b2=>_0x23c8b2['id']===_0x457570),_0x3dd71=_0x58b30d?.[_0x33910f(0x156)]?.[_0x33910f(0x161)]||'';_0x583874['push']({'displayLine':_0x101497,'attemptId':_0x48b222,'projectName':_0x3dd71});}}}return{'timelineRows':_0x583874,'timeAxisHeader':_0x4faa81};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x115);['description']=a51_0x329efe(0x27d);async[a51_0x329efe(0x242)](_0x28d46a){const _0x191940=a51_0x329efe,{options:_0x48aafc,args:_0x591552,tdx:_0x1e98cd}=_0x28d46a,_0x2521e9=this[_0x191940(0x1e5)](_0x591552,_0x48aafc);if(!_0x2521e9)return 0x1;const {projectName:_0x6325ce,workflowName:_0x233ec7}=_0x2521e9,_0x14de23=_0x48aafc['includeRetried'];if(_0x48aafc[_0x191940(0x21b)]){if(_0x6325ce&&_0x233ec7)console[_0x191940(0x112)](_0x191940(0x1b4)+_0x6325ce+'.'+_0x233ec7);else _0x6325ce&&console[_0x191940(0x112)](_0x191940(0x26a)+_0x6325ce);_0x14de23&&console[_0x191940(0x112)](_0x191940(0x125));}const _0x8fd1c1=await withSpinner(_0x191940(0x109),()=>_0x1e98cd['workflow']['attempts']({'projectName':_0x6325ce,'workflowName':_0x233ec7,'includeRetried':_0x14de23,'limit':_0x48aafc[_0x191940(0x173)]}),{'verbose':_0x48aafc[_0x191940(0x21b)]}),_0x32111a=_0x8fd1c1[_0x191940(0x103)],_0x76a8c4=_0x48aafc[_0x191940(0x173)]||0x64,_0x2f70f0=_0x32111a[_0x191940(0x1ee)]>=_0x76a8c4?a51_0x5a26d5[_0x191940(0x26d)](_0x191940(0x1e7)):'';console[_0x191940(0x112)](_0x191940(0x139)+_0x32111a[_0x191940(0x1ee)]+_0x191940(0x10c)+(_0x32111a['length']!==0x1?'s':'')+_0x2f70f0);if(_0x48aafc[_0x191940(0x214)]===_0x191940(0x17d)||_0x48aafc[_0x191940(0x214)]===_0x191940(0x1e2)||_0x48aafc[_0x191940(0x214)]===_0x191940(0x17c))await handleSDKOutput(_0x32111a,_0x48aafc);else{if(_0x32111a[_0x191940(0x1ee)]===0x0){if(_0x6325ce&&_0x233ec7)console[_0x191940(0x1d1)](_0x191940(0x247)+_0x6325ce+'.'+_0x233ec7);else _0x6325ce?console[_0x191940(0x1d1)](_0x191940(0x1b0)+_0x6325ce):console[_0x191940(0x1d1)](_0x191940(0x259));}else{const _0x131790=_0x48aafc[_0x191940(0x258)],_0x2446f2=_0x32111a['map'](_0x398e2c=>{const _0x32de22=_0x191940,_0x273d45=a51_0x5a26d5[_0x32de22(0x26d)]('#'+_0x398e2c['id']),_0x2e3e2b=_0x398e2c['project']?.['id'],_0x39085f=_0x398e2c['session_id']||_0x398e2c[_0x32de22(0x1d8)],_0x5865d3=_0x2e3e2b&&_0x39085f?hyperlink(_0x273d45,getWorkflowAttemptUrl(_0x131790,_0x2e3e2b,_0x39085f,_0x398e2c['id'])):_0x273d45,{icon:_0x20d9b2,text:_0x465170}=getAttemptStatusDisplay(_0x398e2c),_0x48681f=(_0x398e2c[_0x32de22(0x156)]?.['name']||'?')+'.'+(_0x398e2c[_0x32de22(0x229)]?.[_0x32de22(0x161)]||'?'),_0x25f17e=_0x398e2c[_0x32de22(0x1c2)]?a51_0x5a26d5[_0x32de22(0x26d)](_0x398e2c[_0x32de22(0x1c2)]):'';return(_0x5865d3+'\x20'+_0x20d9b2+(_0x465170?'\x20'+_0x465170:'')+'\x20'+_0x48681f+'\x20'+_0x25f17e)[_0x32de22(0x24b)]();});await writeOutput(_0x2446f2[_0x191940(0x221)]('\x0a'),_0x48aafc[_0x191940(0x1fe)],_0x191940(0x1bd));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a51_0x329efe(0x24a);[a51_0x329efe(0x269)]=a51_0x329efe(0x18c);async[a51_0x329efe(0x242)](_0x15f356){const _0x2362c0=a51_0x329efe,{options:_0x5a0f03,args:_0x1cd96c,tdx:_0x24c4bd}=_0x15f356,_0x3af5c9=_0x1cd96c[0x0];if(!_0x3af5c9)return console[_0x2362c0(0x112)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5a0f03['verbose']&&console[_0x2362c0(0x112)](_0x2362c0(0x262)+_0x3af5c9);const _0x1880a0=await withSpinner(_0x2362c0(0x155),()=>_0x24c4bd[_0x2362c0(0x229)][_0x2362c0(0x1ad)](_0x3af5c9),{'verbose':_0x5a0f03[_0x2362c0(0x21b)]}),_0x4e9f01=_0x1880a0[_0x2362c0(0x103)];let _0x4ca531;!_0x4e9f01[_0x2362c0(0x27e)]?_0x4ca531=_0x4e9f01[_0x2362c0(0x1b7)]?'canceling':_0x2362c0(0x22b):_0x4ca531=_0x4e9f01[_0x2362c0(0x1a7)]?_0x2362c0(0x1a7):_0x2362c0(0x112);let _0x5d6f46;if(_0x4e9f01[_0x2362c0(0x1a0)]&&_0x4e9f01[_0x2362c0(0x254)]){const _0x40dfcc=new Date(_0x4e9f01[_0x2362c0(0x1a0)])[_0x2362c0(0x118)](),_0x57ba11=new Date(_0x4e9f01[_0x2362c0(0x254)])[_0x2362c0(0x118)]();_0x5d6f46=Math[_0x2362c0(0x25b)]((_0x57ba11-_0x40dfcc)/0x3e8);}const _0x2652e2={'attempt_id':_0x4e9f01['id'],'status':_0x4ca531,..._0x4e9f01['index']!==undefined&&{'index':_0x4e9f01['index']},..._0x4e9f01['project']&&{'project':_0x4e9f01[_0x2362c0(0x156)][_0x2362c0(0x161)]},..._0x4e9f01[_0x2362c0(0x229)]&&{'workflow':_0x4e9f01[_0x2362c0(0x229)][_0x2362c0(0x161)]},..._0x4e9f01[_0x2362c0(0x1d8)]&&{'session_id':_0x4e9f01[_0x2362c0(0x1d8)]},..._0x4e9f01[_0x2362c0(0x1c2)]&&{'session_time':_0x4e9f01[_0x2362c0(0x1c2)]},..._0x4e9f01[_0x2362c0(0x157)]&&{'retry_attempt':_0x4e9f01[_0x2362c0(0x157)]},..._0x5d6f46!==undefined&&{'duration_sec':_0x5d6f46},..._0x4e9f01[_0x2362c0(0x1a0)]&&{'created_at':_0x4e9f01[_0x2362c0(0x1a0)]},..._0x4e9f01['finishedAt']&&{'finished_at':_0x4e9f01['finishedAt']},...Object[_0x2362c0(0x1f3)](_0x4e9f01[_0x2362c0(0x179)])['length']>0x0&&{'params':_0x4e9f01['params']}};return await handleSingleObjectOutput(_0x2652e2,_0x5a0f03),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x1df);[a51_0x329efe(0x269)]=a51_0x329efe(0x1c7);async[a51_0x329efe(0x242)](_0x35c8e8){const _0x222a4e=a51_0x329efe,{options:_0x155eea,args:_0x18f39b,tdx:_0x2df173}=_0x35c8e8,_0x1c9d02=_0x18f39b[0x0];if(!_0x1c9d02)return console[_0x222a4e(0x112)](_0x222a4e(0x257)),0x1;const _0x78f84f=_0x155eea[_0x222a4e(0x25d)];_0x155eea[_0x222a4e(0x21b)]&&(console[_0x222a4e(0x112)](_0x222a4e(0x262)+_0x1c9d02),_0x78f84f&&console[_0x222a4e(0x112)](_0x222a4e(0x132)));const _0x60d033=await withSpinner(_0x222a4e(0x122),()=>_0x2df173[_0x222a4e(0x229)][_0x222a4e(0x20f)](_0x1c9d02,_0x78f84f||![]),{'verbose':_0x155eea[_0x222a4e(0x21b)]}),_0xd07d38=_0x60d033[_0x222a4e(0x103)];return console['error'](_0x222a4e(0x139)+_0xd07d38[_0x222a4e(0x1ee)]+'\x20task'+(_0xd07d38['length']!==0x1?'s':'')),await handleSDKOutput(_0xd07d38,_0x155eea),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a51_0x329efe(0x269)]=a51_0x329efe(0x1bb);async[a51_0x329efe(0x242)](_0x3e4597){const _0x140dcc=a51_0x329efe,{options:_0x6af7e8,args:_0x5f285d,tdx:_0x5b4159}=_0x3e4597,_0x14c53a=_0x5f285d[0x0];let _0xdf3365=_0x5f285d[0x1];if(!_0x14c53a)return console[_0x140dcc(0x112)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x6af7e8[_0x140dcc(0x21b)]&&(console[_0x140dcc(0x112)](_0x140dcc(0x262)+_0x14c53a),_0xdf3365&&console[_0x140dcc(0x112)]('Task\x20name:\x20'+_0xdf3365));const _0x45ac2c=await withSpinner(_0x140dcc(0x1f8),()=>_0x5b4159['workflow'][_0x140dcc(0xdf)](_0x14c53a,_0xdf3365),{'verbose':_0x6af7e8[_0x140dcc(0x21b)]}),_0x510ec4=_0x45ac2c[_0x140dcc(0x103)];if(_0x510ec4['length']===0x0)return console[_0x140dcc(0x112)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0xdf3365&&(_0x6af7e8[_0x140dcc(0x17d)]||_0x6af7e8[_0x140dcc(0x214)]))return await handleSDKOutput(_0x510ec4,_0x6af7e8),0x0;if(!_0xdf3365){const _0x6c25b3=_0x510ec4[_0x140dcc(0x1c4)](_0x193ad6=>({'title':_0x193ad6[_0x140dcc(0x18f)]+'\x20('+formatBytes(_0x193ad6['fileSize'])+')','value':_0x193ad6[_0x140dcc(0x18f)]})),_0x460653=await a51_0x17395a({'type':'select','name':_0x140dcc(0x1e3),'message':_0x140dcc(0x248),'choices':_0x6c25b3});if(!_0x460653[_0x140dcc(0x1e3)])return console['error'](_0x140dcc(0x1d3)),0x0;_0xdf3365=_0x460653['task'];}const _0x3e4f69=await withSpinner(_0x140dcc(0x1c1),()=>_0x5b4159['workflow'][_0x140dcc(0x113)](_0x14c53a,_0xdf3365),{'verbose':_0x6af7e8[_0x140dcc(0x21b)]}),_0x2af144=_0x3e4f69[_0x140dcc(0x103)];return _0x2af144?console[_0x140dcc(0x1d1)](_0x2af144):console[_0x140dcc(0x112)](_0x140dcc(0x22d)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a51_0x329efe(0x253);[a51_0x329efe(0x269)]=a51_0x329efe(0x1cb);async[a51_0x329efe(0x242)](_0x1b7575){const _0x9fd329=a51_0x329efe,{options:_0x1a92bc,args:_0x2b4aa1,tdx:_0x1497ba}=_0x1b7575,_0x4c7259=_0x2b4aa1[0x0];if(!_0x4c7259)return console[_0x9fd329(0x112)](_0x9fd329(0x257)),0x1;const _0xbb6d27=_0x1a92bc[_0x9fd329(0x117)];_0x1a92bc[_0x9fd329(0x21b)]&&(console['error'](_0x9fd329(0x262)+_0x4c7259),_0xbb6d27&&console[_0x9fd329(0x112)]('Reason:\x20'+_0xbb6d27));if(!_0x1a92bc[_0x9fd329(0x23a)]){if(!isInteractive())return console[_0x9fd329(0x112)](a51_0x5a26d5[_0x9fd329(0x181)](_0x9fd329(0x183)),_0x9fd329(0x191)),console[_0x9fd329(0x112)](a51_0x5a26d5[_0x9fd329(0x26d)](_0x9fd329(0x130))),0x1;const _0x11e552=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x4c7259+'?');if(!_0x11e552)return console[_0x9fd329(0x112)](a51_0x5a26d5[_0x9fd329(0x1a4)](_0x9fd329(0x1d3))),0x1;}const _0xd3c57c=await withSpinner(_0x9fd329(0x275),()=>_0x1497ba[_0x9fd329(0x229)][_0x9fd329(0x184)](_0x4c7259,_0xbb6d27),{'verbose':_0x1a92bc[_0x9fd329(0x21b)]}),_0x5978ef=_0xd3c57c['data'];return console['error']('✔\x20'+_0x5978ef),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a51_0x329efe(0x194);[a51_0x329efe(0x269)]=a51_0x329efe(0x278);async[a51_0x329efe(0x242)](_0x268830){const _0x1c60a7=a51_0x329efe,{options:_0x4bbd3c,args:_0x2eaa9b,tdx:_0x17db16}=_0x268830,_0x348798=_0x2eaa9b[0x0];if(!_0x348798)return console[_0x1c60a7(0x112)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x1c60a7(0x112)](_0x1c60a7(0x1ff)),0x1;let _0x1f2a11=![],_0xe5cb59=_0x348798;if(_0x348798[_0x1c60a7(0x25f)]('session:'))_0x1f2a11=!![],_0xe5cb59=_0x348798[_0x1c60a7(0x1b5)](0x8);else{if(_0x348798[_0x1c60a7(0x25f)]('attempt:'))_0x1f2a11=![],_0xe5cb59=_0x348798[_0x1c60a7(0x1b5)](0x8);else return console['error'](_0x1c60a7(0x158)),console[_0x1c60a7(0x112)](_0x1c60a7(0x1ff)),0x1;}const _0x5a4999=_0x4bbd3c['fromTask'],_0x664545=_0x4bbd3c[_0x1c60a7(0x20a)],_0x42492e=_0x4bbd3c[_0x1c60a7(0x179)],_0x375158=_0x4bbd3c[_0x1c60a7(0x201)];_0x4bbd3c[_0x1c60a7(0x21b)]&&(console[_0x1c60a7(0x112)](_0x1c60a7(0x10a)+(_0x1f2a11?'session':'attempt')+'\x20'+_0xe5cb59),_0x5a4999&&console[_0x1c60a7(0x112)](_0x1c60a7(0x174)+_0x5a4999),_0x664545&&console['error'](_0x1c60a7(0x18e)+_0x664545),_0x42492e&&console['error'](_0x1c60a7(0x14e)+_0x42492e),_0x375158&&console[_0x1c60a7(0x112)](_0x1c60a7(0x1f5)));let _0xba1443;if(_0x42492e)try{if(_0x42492e[_0x1c60a7(0x25f)]('@')){const _0x3e07da=await import(_0x1c60a7(0x11e)),_0x3e3b77=_0x42492e[_0x1c60a7(0x1b5)](0x1),_0x34268b=await _0x3e07da[_0x1c60a7(0x19c)](_0x3e3b77,_0x1c60a7(0xf2));_0xba1443=JSON[_0x1c60a7(0x1cc)](_0x34268b);}else _0xba1443=JSON[_0x1c60a7(0x1cc)](_0x42492e);}catch{return console['error']('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4bbd3c[_0x1c60a7(0x23a)]){if(!isInteractive())return console['error'](a51_0x5a26d5[_0x1c60a7(0x181)](_0x1c60a7(0x183)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1c60a7(0x112)](a51_0x5a26d5[_0x1c60a7(0x26d)](_0x1c60a7(0x130))),0x1;const _0xca8c56=await confirmKey(_0x1c60a7(0x12f)+(_0x1f2a11?_0x1c60a7(0x104):_0x1c60a7(0x1ad))+'\x20'+_0xe5cb59+'?');if(!_0xca8c56)return console[_0x1c60a7(0x112)](a51_0x5a26d5[_0x1c60a7(0x1a4)](_0x1c60a7(0x1d3))),0x1;}let _0x1817d8;_0x1f2a11?_0x1817d8=await withSpinner(_0x1c60a7(0x14d),()=>_0x17db16['workflow']['retrySession'](_0xe5cb59,{'fromTask':_0x5a4999,'retryParams':_0xba1443}),{'verbose':_0x4bbd3c[_0x1c60a7(0x21b)]}):_0x1817d8=await withSpinner(_0x1c60a7(0x21f),()=>_0x17db16[_0x1c60a7(0x229)][_0x1c60a7(0x246)](_0xe5cb59,{'resumeFrom':_0x664545,'retryParams':_0xba1443,'force':_0x375158}),{'verbose':_0x4bbd3c[_0x1c60a7(0x21b)]});const _0x5dd1a7=_0x1817d8[_0x1c60a7(0x103)];return console[_0x1c60a7(0x112)](_0x1c60a7(0x265)),console[_0x1c60a7(0x112)](_0x1c60a7(0xdc)+_0x5dd1a7[_0x1c60a7(0x196)]),console[_0x1c60a7(0x112)]('\x20\x20Session\x20ID:\x20'+_0x5dd1a7[_0x1c60a7(0x1d8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x219);['description']=a51_0x329efe(0x1b8);async[a51_0x329efe(0x242)](_0x269205){const _0x4911bf=a51_0x329efe,{options:_0x58d3a0,args:_0x1cbce4,tdx:_0x3f4013}=_0x269205;let _0x126bee=_0x1cbce4[0x0];if(!_0x126bee){const _0x1b39c=this[_0x4911bf(0x137)]([],_0x58d3a0),_0x3831c8=await withSpinner(_0x4911bf(0x141),()=>_0x3f4013['workflow'][_0x4911bf(0x170)](_0x1b39c,{'limit':_0x58d3a0[_0x4911bf(0x173)]}),{'verbose':_0x58d3a0[_0x4911bf(0x21b)]}),_0xbf9e0e=_0x3831c8[_0x4911bf(0x103)];if(_0xbf9e0e['length']===0x0)return console['error'](_0x4911bf(0xe4)),!_0x1b39c&&console[_0x4911bf(0x112)](a51_0x5a26d5['dim'](_0x4911bf(0x1b1))),0x1;const _0x54bfcc=_0xbf9e0e[_0x4911bf(0x1c4)](_0xee81d4=>({'title':_0xee81d4[_0x4911bf(0x156)]?.[_0x4911bf(0x161)]+'.'+_0xee81d4[_0x4911bf(0x161)],'value':_0xee81d4['project']?.[_0x4911bf(0x161)]+'.'+_0xee81d4['name'],'description':_0xee81d4['revision']?'revision:\x20'+_0xee81d4['revision']:undefined})),_0x39c0eb=await a51_0x17395a({'type':_0x4911bf(0x162),'name':'workflow','message':_0x4911bf(0x134),'choices':_0x54bfcc});if(!_0x39c0eb[_0x4911bf(0x229)])return 0x1;_0x126bee=_0x39c0eb[_0x4911bf(0x229)];}if(!_0x126bee[_0x4911bf(0x22e)]('.')){const _0x1d7af0=this[_0x4911bf(0x137)]([],_0x58d3a0);if(_0x1d7af0)_0x126bee=_0x1d7af0+'.'+_0x126bee;else return console[_0x4911bf(0x112)](a51_0x5a26d5[_0x4911bf(0x181)](_0x4911bf(0x24e)),_0x4911bf(0x176)),console['error'](a51_0x5a26d5[_0x4911bf(0x26d)](_0x4911bf(0x1b1))),0x1;}const _0x5bd652=_0x58d3a0['param'],_0x35a4c5=_0x58d3a0[_0x4911bf(0x1c2)],_0x230662={};if(_0x5bd652&&Array[_0x4911bf(0x1f1)](_0x5bd652))for(const _0x2bbf13 of _0x5bd652){const _0x4aeac4=_0x2bbf13[_0x4911bf(0x276)]('=');if(_0x4aeac4===-0x1)return console[_0x4911bf(0x112)](_0x4911bf(0x1be)+_0x2bbf13),console['error'](_0x4911bf(0x16b)),0x1;const _0x82a381=_0x2bbf13[_0x4911bf(0x1b5)](0x0,_0x4aeac4),_0x52697a=_0x2bbf13[_0x4911bf(0x1b5)](_0x4aeac4+0x1);try{_0x230662[_0x82a381]=JSON[_0x4911bf(0x1cc)](_0x52697a);}catch{_0x230662[_0x82a381]=_0x52697a;}}_0x58d3a0[_0x4911bf(0x21b)]&&(console[_0x4911bf(0x112)]('Workflow:\x20'+_0x126bee),Object[_0x4911bf(0x1f3)](_0x230662)['length']>0x0&&console[_0x4911bf(0x112)](_0x4911bf(0x11c)+JSON[_0x4911bf(0x27f)](_0x230662)),_0x35a4c5&&console[_0x4911bf(0x112)](_0x4911bf(0xfd)+_0x35a4c5));const _0x2aca5f=await withSpinner(_0x4911bf(0x182),()=>_0x3f4013[_0x4911bf(0x229)]['run'](_0x126bee,_0x230662,{'sessionTime':_0x35a4c5}),{'verbose':_0x58d3a0['verbose']}),_0x4d1293=_0x2aca5f['data'];console[_0x4911bf(0x112)]('✔\x20Workflow\x20run\x20started'),console[_0x4911bf(0x112)](_0x4911bf(0x14a)+_0x4d1293['id']),console['error'](_0x4911bf(0xdd)+_0x4d1293[_0x4911bf(0x1d8)]),console[_0x4911bf(0x112)](_0x4911bf(0x126)+_0x4d1293[_0x4911bf(0x156)]?.['name']),console[_0x4911bf(0x112)](_0x4911bf(0x256)+_0x4d1293[_0x4911bf(0x229)]?.[_0x4911bf(0x161)]);if(_0x4d1293[_0x4911bf(0x156)]?.['id']&&_0x4d1293[_0x4911bf(0x1d8)]&&_0x4d1293['id']){const _0x3820f8=_0x58d3a0[_0x4911bf(0x258)],_0xec93cb=getConsoleUrl(_0x3820f8,_0x4911bf(0x23f)+_0x4d1293['project']['id']+_0x4911bf(0x149)+_0x4d1293[_0x4911bf(0x1d8)]+'/attempt/'+_0x4d1293['id']);console[_0x4911bf(0x112)](_0x4911bf(0x20e)+a51_0x5a26d5['cyan'](_0xec93cb));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']='workflow:download';[a51_0x329efe(0x269)]=a51_0x329efe(0xfc);async[a51_0x329efe(0x242)](_0x2a9c99){const _0x4cdedc=a51_0x329efe,{options:_0x463534,args:_0x1626f0,tdx:_0x25f3b0}=_0x2a9c99,_0x35aeb4=_0x1626f0[0x0],_0x48396c=_0x1626f0[0x1]||'.';if(!_0x35aeb4)return console[_0x4cdedc(0x112)](_0x4cdedc(0x160)),console[_0x4cdedc(0x112)](_0x4cdedc(0x150)),0x1;const _0x1df90c=_0x463534[_0x4cdedc(0x20d)];_0x463534['verbose']&&(console[_0x4cdedc(0x112)]('Project:\x20'+_0x35aeb4),console[_0x4cdedc(0x112)](_0x4cdedc(0x1ce)+_0x48396c),_0x1df90c&&console[_0x4cdedc(0x112)](_0x4cdedc(0x195)+_0x1df90c));const _0x3e43f2=await withSpinner(_0x4cdedc(0x116)+_0x35aeb4+_0x4cdedc(0x1ca),()=>_0x25f3b0[_0x4cdedc(0x229)]['download'](_0x35aeb4,_0x48396c,{'revision':_0x1df90c}),{'verbose':_0x463534[_0x4cdedc(0x21b)]}),_0x5079e7=_0x3e43f2[_0x4cdedc(0x103)];return console[_0x4cdedc(0x112)](_0x4cdedc(0x211)+_0x5079e7[_0x4cdedc(0xe7)]),console[_0x4cdedc(0x112)](_0x4cdedc(0x10e)+_0x5079e7[_0x4cdedc(0x20d)]),console[_0x4cdedc(0x112)](_0x4cdedc(0x197)+_0x5079e7[_0x4cdedc(0x1fd)]),console['error'](_0x4cdedc(0x1c3)+_0x48396c+'/'+_0x5079e7[_0x4cdedc(0xe7)]),0x0;}}function a51_0x192a(){const _0x34eab5=['Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','\x22\x20already\x20exists\x20(ID:\x20','autocomplete','960662GncoSy','/app/workflows/','\x0a✔\x20Already\x20up\x20to\x20date','\x22\x20to\x20new\x20project\x20\x22','execute','getMinutes','Updating\x20','Analyzing\x20project...','retryAttempt','No\x20attempts\x20found\x20for:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','lastAttempt','workflow:attempt','trimEnd','toISOString','34759290zNgYgt','Error:','7JHwhSu','diff','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','type','workflow:kill','finishedAt','\x20\x20Changes:\x20','\x20\x20Workflow:\x20','Error:\x20Attempt\x20ID\x20is\x20required','site','No\x20attempts\x20found','toLowerCase','round','sourceDir','includeSubtasks','deleteSecret','startsWith','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','existingProjectId','Attempt\x20ID:\x20','modified','Pushing\x20project...','✔\x20Retry\x20started','workflow:secrets:delete','LABEL_WIDTH_DIVISOR','floor','description','Filter:\x20project=','\x20secrets...','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','dim','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','dryRun','has','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20session','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Killing\x20attempt...','indexOf','MAX_LABEL_COUNT','Retry\x20a\x20session\x20or\x20attempt','workflow:upload','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','find','→\x20New\x20project:\x20','List\x20workflow\x20attempts','done','stringify','List\x20workflow\x20execution\x20sessions','\x0aClone\x20\x22','Using\x20attempt\x20','green','now','isTTY','\x20\x20New\x20attempt\x20ID:\x20','\x20\x20Session\x20ID:\x20','cwd','logFiles','setSecrets','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','message','Invalid\x20format:\x20','No\x20workflows\x20found','Project\x20directory:\x20','\x20modified','projectName','9bAqWiv','executePushProject','summary','Loading\x20sessions...','workflow:pull','ICON_WIDTH','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','workflow:delete','📋\x20','startTime','utf-8','LABEL_MIN_SPACING','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Session\x20not\x20found:\x20','projects','Pushing\x20workflow\x20project...','Deleting\x20secret...','renderSessionsTimeline','status','workflow:projects','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Session\x20time:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','some','\x22\x20with\x20new\x20revision?','\x0a✔\x20Attempt\x20complete','projectId','data','session','workflow:sessions','unknown','Error:\x20','sort','Listing\x20workflow\x20attempts...','Target:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20attempt','path','\x20\x20Revision:\x20','Source\x20project:\x20','Key:\x20','relative','error','logs','Latest\x20session\x20has\x20no\x20attempt','workflow:attempts','Downloading\x20project\x20','reason','getTime','getMonth','MIN_TIMELINE_WIDTH','No\x20projects\x20match\x20pattern:\x20','Parameters:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','fs/promises','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x0aDry\x20run\x20-\x20no\x20project\x20created','startedAt','Getting\x20attempt\x20tasks...','navigateSessionsInteractive','✔\x20Project:\x20','Include\x20retried:\x20yes','\x20\x20Project:\x20','cyan','No\x20sessions\x20found\x20for:\x20','start','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:set','\x20logs','MAX_POLL_ITERATIONS','write','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Including\x20subtasks:\x20yes','Project\x20name\x20is\x20required','Select\x20a\x20workflow\x20to\x20run','Status:\x20','pullProject','resolveProject','\x20to\x20see\x20detailed\x20logs','✔\x20Found\x20','listSecrets','Key\x20cannot\x20be\x20empty','\x0a⚠\x20Project\x20\x22','No\x20sessions\x20found','blue','✔\x20Pull\x20complete','durationMs','Loading\x20workflows...','.\x20Expected\x20format:\x20KEY=VALUE','planned','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x0aDry\x20run\x20-\x20no\x20files\x20written','Dry\x20run:\x20yes','targetDir','\x20secret','/sessions/','\x20\x20Attempt\x20ID:\x20','white','executeCloneProject','Retrying\x20session...','Params:\x20','✔\x20Deleted\x20project\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20tdx\x20wf\x20use\x20<project>','buildTimelineData','\x20secrets\x20set\x20for\x20project\x20\x27','targetExists','Getting\x20attempt\x20details...','project','retryAttemptName','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20is\x20not\x20a\x20directory','all','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','⚠\x20Showing\x20first\x20','getDate','requireProject','✔\x20Showing\x20','Error:\x20Project\x20name\x20is\x20required','name','select','icon','-\x20nothing\x20pushed','Files\x20to\x20upload:\x20','repeat','metadata','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','resolveProjectId','\x27\x20from\x20project\x20\x27','Expected\x20format:\x20--param\x20key=value','replace','workflowName','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:use','workflows','New\x20project\x20name:\x20','ICON_SPACING','limit','From\x20task:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','✔\x20Workflow\x20project\x20context\x20cleared.','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','params','Select\x20a\x20session\x20to\x20view\x20timeline:','rows','table','json','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','changes','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','red','Starting\x20workflow\x20run...','\x0aError:','kill','text','newProjectName','Validation:\x20skipped','max','Session\x20','Project\x20filter:\x20','newProjectId','Show\x20specific\x20attempt\x20details','\x20\x20Source:\x20','Resume\x20from:\x20','taskName','Listing\x20workflow\x20projects...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','resolve','push','workflow:retry','Revision:\x20','attemptId','\x20\x20Files\x20extracted:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20(system)','List\x20all\x20workflow\x20projects','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','readFile','\x20has\x20no\x20attempts','follow','total','createdAt','skipValidation','sessions','Tip:\x20cd\x20to\x20workflows/','yellow','💡\x20Tip:\x20Use\x20','\x20new','success','state','1153592IFGptS','get','\x0aApply\x20these\x20changes?','No\x20workflow\x20tdx.json\x20found','attempt','Project:\x20','MIN_LABEL_COUNT','No\x20attempts\x20found\x20in\x20project:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','sourceProjectName','fullName','Filter:\x20','substring','getHours','cancelRequested','Start\x20a\x20workflow\x20run','preparePushProject','fill','Show\x20logs\x20for\x20a\x20workflow\x20attempt','updatedAt','list','Error:\x20Invalid\x20parameter\x20format:\x20','\x20-\x20','\x20deleted','Downloading\x20logs...','sessionTime','\x20\x20Location:\x20','map','basename','\x20\x20Target:\x20','Show\x20tasks\x20for\x20an\x20attempt','pending','pollTimeline','...','Kill\x20a\x20running\x20attempt','parse','deleted','Output\x20directory:\x20','\x0a✔\x20No\x20changes\x20to\x20push','Resolving\x20project\x20\x27','log','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Cancelled','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','renderTimeline','Pull\x20workflow\x20project\x20to\x20local\x20folder','Listing\x20workflows...','sessionId','padStart','set','-\x20no\x20files\x20written','Analyzing\x20changes...','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x1b[1A\x1b[2K','workflow:tasks','Setting\x20','Pattern:\x20','jsonl','task','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','parseProjectWorkflowPattern','workflow:push','\x20(use\x20--limit\x20to\x20show\x20more)','4566395bcOnaP','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','renderSingleTimeline','every','min','workflow:secrets:list','length','localeCompare','→\x20Project:\x20','isArray','end','keys','\x20project','Force:\x20yes','\x0aPolling...\x20(','split','Fetching\x20log\x20files...','POLL_INTERVAL_MS','window','new','Writing\x20files...','filesExtracted','output','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Source\x20directory:\x20','force','3698704WVmVwI','3TGyswS','delete','size','workflowProject','---\x20','Source\x20directory\x20is\x20required','slice','resumeFrom','msPerChar','MAX_TASKS_DISPLAY','revision','\x20\x20Console:\x20','tasks','Pulling\x20project\x20','✔\x20Downloaded\x20','\x20unchanged','\x27...','format','unchanged','\x0aPush\x20these\x20changes?','✔\x20Push\x20complete','8862456TTNhlp','workflow:run','resolveProjectDir','verbose','trim','Attempt:\x20','getFullYear','Retrying\x20attempt...','generateSessionTimelineRows','join','duration','Usage:\x20workflow:delete\x20<project-name-or-id>','context','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Listing\x20secrets...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','filter','workflow','stdout','running','1474942UPbUih','No\x20log\x20content\x20found','includes','No\x20workflow\x20projects\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Auto-selected\x20latest\x20session:\x20','\x20\x20Project\x20ID:\x20','showWorkflowConsoleUrl','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','columns','\x20workflow','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','match','values','yes'];a51_0x192a=function(){return _0x34eab5;};return a51_0x192a();}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x279);[a51_0x329efe(0x269)]=a51_0x329efe(0x1e9);async[a51_0x329efe(0x242)](_0x136046){const _0x35a710=a51_0x329efe,{options:_0x4c5c00,args:_0x58e60d,tdx:_0x1907a5}=_0x136046;let _0xc32bd0='.',_0x1f11cc=_0x4c5c00[_0x35a710(0x161)];if(_0x58e60d[0x0]){const {promises:_0x4810fb}=await import('fs');try{const _0x57736e=await _0x4810fb['stat'](_0x58e60d[0x0]);if(_0x57736e['isDirectory']())_0xc32bd0=_0x58e60d[0x0];else return console[_0x35a710(0x112)](_0x35a710(0x107)+_0x58e60d[0x0]+_0x35a710(0x159)),0x1;}catch{_0x1f11cc=_0x58e60d[0x0],_0xc32bd0='.';}}const _0x59a2a7=_0x4c5c00['revision'],_0x14be1c=_0x4c5c00[_0x35a710(0x1a1)];_0x4c5c00[_0x35a710(0x21b)]&&(console['error'](_0x35a710(0xe5)+_0xc32bd0),_0x1f11cc&&console[_0x35a710(0x112)]('Project\x20name:\x20'+_0x1f11cc),_0x59a2a7&&console[_0x35a710(0x112)](_0x35a710(0x195)+_0x59a2a7),_0x14be1c&&console[_0x35a710(0x112)](_0x35a710(0x187)));const _0x1966ec=await withSpinner(_0x35a710(0xf7),()=>_0x1907a5[_0x35a710(0x229)][_0x35a710(0x193)](_0xc32bd0,{'projectName':_0x1f11cc,'revision':_0x59a2a7,'skipValidation':_0x14be1c}),{'verbose':_0x4c5c00[_0x35a710(0x21b)]}),_0x420e3c=_0x1966ec[_0x35a710(0x103)];return console[_0x35a710(0x112)]('✔\x20Pushed\x20'+_0x420e3c[_0x35a710(0xe7)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x420e3c[_0x35a710(0x102)]),console[_0x35a710(0x112)](_0x35a710(0x10e)+_0x420e3c[_0x35a710(0x20d)]),await this[_0x35a710(0x233)](_0x1907a5,_0x420e3c[_0x35a710(0xe7)],_0x4c5c00[_0x35a710(0x258)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0xec);[a51_0x329efe(0x269)]=a51_0x329efe(0x1d6);async[a51_0x329efe(0x242)](_0x6a17a9){const _0x2d93b9=a51_0x329efe,{options:_0x51705b,args:_0xaff2c2,tdx:_0x9b3a2a}=_0x6a17a9,_0x12642d=_0xaff2c2[0x0],_0x1ed767=_0xaff2c2[0x1];if(!_0x12642d)return console[_0x2d93b9(0x112)](a51_0x5a26d5['red'](_0x2d93b9(0x24e)),'Project\x20name\x20is\x20required'),console[_0x2d93b9(0x112)](a51_0x5a26d5[_0x2d93b9(0x26d)](_0x2d93b9(0x144))),0x1;const _0x1fa74c=_0x51705b['revision'];_0x51705b[_0x2d93b9(0x21b)]&&(console[_0x2d93b9(0x112)](_0x2d93b9(0x1ae)+_0x12642d),_0x1ed767&&console[_0x2d93b9(0x112)]('Target\x20directory:\x20'+_0x1ed767),_0x1fa74c&&console['error'](_0x2d93b9(0x195)+_0x1fa74c),_0x51705b[_0x2d93b9(0x26f)]&&console['error'](_0x2d93b9(0x146)));const _0x2c6e3a=await withSpinner(_0x2d93b9(0x210)+_0x12642d+_0x2d93b9(0x1ca),()=>_0x9b3a2a[_0x2d93b9(0x229)][_0x2d93b9(0x136)](_0x12642d,{'targetDir':_0x1ed767,'revision':_0x1fa74c}),{'verbose':_0x51705b[_0x2d93b9(0x21b)]}),_0x1aee51=_0x2c6e3a[_0x2d93b9(0x103)];_0x1aee51['isNewProject']?console[_0x2d93b9(0x112)](_0x2d93b9(0x27c)+_0x1aee51['projectName']):console[_0x2d93b9(0x112)](_0x2d93b9(0x1f0)+_0x1aee51['projectName']);console[_0x2d93b9(0x112)](_0x2d93b9(0x10e)+_0x1aee51[_0x2d93b9(0x20d)]),console[_0x2d93b9(0x112)](_0x2d93b9(0x1c6)+(a51_0x447410[_0x2d93b9(0x111)](process[_0x2d93b9(0xde)](),_0x1aee51[_0x2d93b9(0x147)])||'.')),console[_0x2d93b9(0x112)]('\x20\x20Changes:\x20'+a51_0x5a26d5[_0x2d93b9(0xd9)]('+'+_0x1aee51['summary'][_0x2d93b9(0x1fb)]+'\x20new')+',\x20'+(a51_0x5a26d5[_0x2d93b9(0x1a4)]('~'+_0x1aee51[_0x2d93b9(0xea)][_0x2d93b9(0x263)]+_0x2d93b9(0xe6))+',\x20')+(a51_0x5a26d5[_0x2d93b9(0x181)]('-'+_0x1aee51[_0x2d93b9(0xea)][_0x2d93b9(0x1cd)]+'\x20deleted')+',\x20')+(''+a51_0x5a26d5[_0x2d93b9(0x26d)](_0x1aee51[_0x2d93b9(0xea)][_0x2d93b9(0x215)]+_0x2d93b9(0x212))));for(const _0x5ba0a0 of _0x1aee51[_0x2d93b9(0x17f)]){_0x5ba0a0[_0x2d93b9(0x252)]===_0x2d93b9(0x263)&&_0x5ba0a0[_0x2d93b9(0x250)]&&(console[_0x2d93b9(0x112)]('\x0a'+a51_0x5a26d5[_0x2d93b9(0x127)](_0x2d93b9(0x207)+_0x5ba0a0[_0x2d93b9(0x10d)])),console[_0x2d93b9(0x112)](_0x5ba0a0['diff']));}if(!_0x1aee51['hasChanges'])return saveSessionContext({'workflow_project':_0x1aee51[_0x2d93b9(0xe7)]},_0x51705b[_0x2d93b9(0x104)]),console[_0x2d93b9(0x112)](a51_0x5a26d5['green'](_0x2d93b9(0x240))),console[_0x2d93b9(0x112)](a51_0x5a26d5[_0x2d93b9(0x26d)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aee51[_0x2d93b9(0xe7)])),0x0;if(_0x51705b['dryRun'])return console[_0x2d93b9(0x112)](a51_0x5a26d5[_0x2d93b9(0x1a4)](_0x2d93b9(0x145))),0x0;if(!_0x51705b[_0x2d93b9(0x23a)]){if(!isInteractive())return console['error'](a51_0x5a26d5[_0x2d93b9(0x181)](_0x2d93b9(0x183)),_0x2d93b9(0x191)),console[_0x2d93b9(0x112)](a51_0x5a26d5['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x420810=await confirmKey(_0x2d93b9(0x1ab));if(!_0x420810)return console[_0x2d93b9(0x112)](a51_0x5a26d5[_0x2d93b9(0x1a4)](_0x2d93b9(0x1d3)),_0x2d93b9(0x1db)),0x1;}await withSpinner(_0x2d93b9(0x1fc),()=>_0x9b3a2a['workflow']['applyPullProject'](_0x1aee51,{'revision':_0x1fa74c}),{'verbose':_0x51705b[_0x2d93b9(0x21b)]}),saveSessionContext({'workflow_project':_0x1aee51[_0x2d93b9(0xe7)]},_0x51705b[_0x2d93b9(0x104)]),console[_0x2d93b9(0x112)](a51_0x5a26d5[_0x2d93b9(0xd9)](_0x2d93b9(0x13f)));const _0x5967ea=a51_0x447410['relative'](process[_0x2d93b9(0xde)](),_0x1aee51['targetDir'])||'.';return console['error'](a51_0x5a26d5[_0x2d93b9(0x26d)](_0x2d93b9(0x1c3)+_0x5967ea)),console['error'](a51_0x5a26d5[_0x2d93b9(0x26d)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x1aee51[_0x2d93b9(0xe7)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x1e6);[a51_0x329efe(0x269)]=a51_0x329efe(0x1d2);async[a51_0x329efe(0x242)](_0x51d1ef){const _0x31d915=a51_0x329efe,{options:_0x43d09e,args:_0x23b0f7,tdx:_0x515d51}=_0x51d1ef,_0x3c4262=this[_0x31d915(0x21a)](_0x23b0f7,_0x43d09e),_0x3a86a3=_0x43d09e['revision'],_0x281267=_0x43d09e[_0x31d915(0x1a1)];_0x43d09e[_0x31d915(0x21b)]&&(_0x3c4262&&console[_0x31d915(0x112)](_0x31d915(0x200)+_0x3c4262),_0x3a86a3&&console[_0x31d915(0x112)](_0x31d915(0x195)+_0x3a86a3),_0x43d09e[_0x31d915(0x26f)]&&console[_0x31d915(0x112)](_0x31d915(0x146)),_0x281267&&console[_0x31d915(0x112)](_0x31d915(0x187)));let _0x4f8002;try{_0x4f8002=await withSpinner(_0x31d915(0x1dc),()=>_0x515d51[_0x31d915(0x229)][_0x31d915(0x1b9)]({'sourceDir':_0x3c4262,'revision':_0x3a86a3,'skipValidation':_0x281267}),{'verbose':_0x43d09e[_0x31d915(0x21b)]});}catch(_0x3c326a){if(_0x3c326a instanceof Error&&_0x3c326a[_0x31d915(0xe2)][_0x31d915(0x22e)](_0x31d915(0x1ac)))return console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0x181)](_0x31d915(0x24e)),_0x31d915(0x227)),_0x43d09e[_0x31d915(0x206)]?console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0x26d)](_0x31d915(0x1a3)+_0x43d09e[_0x31d915(0x206)]+_0x31d915(0xfe)+_0x43d09e[_0x31d915(0x206)]+'\x27')):console[_0x31d915(0x112)](a51_0x5a26d5['dim'](_0x31d915(0x19b))),0x1;throw _0x3c326a;}const _0x46a41=_0x4f8002['data'];console[_0x31d915(0x112)](_0x31d915(0x124)+_0x46a41['projectName']),console[_0x31d915(0x112)](_0x31d915(0x18d)+_0x46a41[_0x31d915(0x25c)]),console[_0x31d915(0x112)](_0x31d915(0x10e)+_0x46a41[_0x31d915(0x20d)]),console[_0x31d915(0x112)](_0x31d915(0x255)+a51_0x5a26d5[_0x31d915(0xd9)]('+'+_0x46a41['summary'][_0x31d915(0x1fb)]+_0x31d915(0x1a6))+',\x20'+(a51_0x5a26d5[_0x31d915(0x1a4)]('~'+_0x46a41[_0x31d915(0xea)][_0x31d915(0x263)]+'\x20modified')+',\x20')+(a51_0x5a26d5['red']('-'+_0x46a41[_0x31d915(0xea)]['deleted']+_0x31d915(0x1c0))+',\x20')+(''+a51_0x5a26d5[_0x31d915(0x26d)](_0x46a41[_0x31d915(0xea)][_0x31d915(0x215)]+_0x31d915(0x212))));for(const _0x15b352 of _0x46a41[_0x31d915(0x17f)]){_0x15b352[_0x31d915(0x252)]===_0x31d915(0x263)&&_0x15b352['diff']&&(console['error']('\x0a'+a51_0x5a26d5['cyan']('---\x20'+_0x15b352[_0x31d915(0x10d)])),console[_0x31d915(0x112)](_0x15b352['diff']));}if(!_0x46a41['hasChanges'])return console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0xd9)](_0x31d915(0x1cf))),await this[_0x31d915(0x233)](_0x515d51,_0x46a41[_0x31d915(0xe7)],_0x43d09e['site']),0x0;if(_0x43d09e[_0x31d915(0x26f)])return console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0x1a4)](_0x31d915(0x272))),0x0;if(!_0x43d09e[_0x31d915(0x23a)]){if(!isInteractive())return console[_0x31d915(0x112)](a51_0x5a26d5['red'](_0x31d915(0x183)),_0x31d915(0x191)),console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0x26d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x682d5f=await confirmKey(_0x31d915(0x216));if(!_0x682d5f)return console[_0x31d915(0x112)](a51_0x5a26d5[_0x31d915(0x1a4)](_0x31d915(0x1d3)),_0x31d915(0x164)),0x1;}const _0x261a02=await withSpinner(_0x31d915(0x264),()=>_0x515d51['workflow'][_0x31d915(0xe9)](_0x46a41),{'verbose':_0x43d09e[_0x31d915(0x21b)]}),_0x17fa20=_0x261a02[_0x31d915(0x103)];return console['error'](a51_0x5a26d5['green'](_0x31d915(0x217))),console['error'](_0x31d915(0x232)+_0x17fa20[_0x31d915(0x102)]),console[_0x31d915(0x112)](_0x31d915(0x10e)+_0x17fa20['revision']),await this[_0x31d915(0x233)](_0x515d51,_0x17fa20[_0x31d915(0xe7)],_0x43d09e[_0x31d915(0x258)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]='workflow:clone';[a51_0x329efe(0x269)]=a51_0x329efe(0xee);async[a51_0x329efe(0x242)](_0x77ecfb){const _0x4a0b5e=a51_0x329efe,{options:_0x2727db,args:_0xea48c,tdx:_0x404f50}=_0x77ecfb,_0x497fb2=this[_0x4a0b5e(0x21a)](_0xea48c,_0x2727db),_0x2b63be=_0x2727db[_0x4a0b5e(0x161)],_0x520a41=_0x2727db[_0x4a0b5e(0x20d)],_0x474786=_0x2727db[_0x4a0b5e(0x1a1)];if(!_0x497fb2)return console[_0x4a0b5e(0x112)](a51_0x5a26d5['red']('Error:'),_0x4a0b5e(0x208)),console['error'](a51_0x5a26d5[_0x4a0b5e(0x26d)](_0x4a0b5e(0x27a))),console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x26d)](_0x4a0b5e(0x168))),0x1;if(!_0x2b63be)return console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x181)](_0x4a0b5e(0x24e)),_0x4a0b5e(0x274)),console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x26d)](_0x4a0b5e(0x27a))),0x1;_0x2727db[_0x4a0b5e(0x21b)]&&(console[_0x4a0b5e(0x112)]('Source\x20directory:\x20'+_0x497fb2),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x171)+_0x2b63be),_0x520a41&&console[_0x4a0b5e(0x112)]('Revision:\x20'+_0x520a41),_0x2727db[_0x4a0b5e(0x26f)]&&console['error'](_0x4a0b5e(0x146)),_0x474786&&console[_0x4a0b5e(0x112)](_0x4a0b5e(0x187)));const _0x3c7612=await withSpinner(_0x4a0b5e(0x245),()=>_0x404f50[_0x4a0b5e(0x229)]['prepareCloneProject'](_0x497fb2,_0x2b63be,{'revision':_0x520a41,'skipValidation':_0x474786}),{'verbose':_0x2727db['verbose']}),_0xf048c2=_0x3c7612[_0x4a0b5e(0x103)];console[_0x4a0b5e(0x112)]('Source:\x20'+_0xf048c2['sourceDir']);_0xf048c2[_0x4a0b5e(0x1b2)]&&console[_0x4a0b5e(0x112)](_0x4a0b5e(0x10f)+_0xf048c2[_0x4a0b5e(0x1b2)]);console['error'](_0x4a0b5e(0x171)+_0xf048c2[_0x4a0b5e(0x186)]),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x195)+_0xf048c2[_0x4a0b5e(0x20d)]),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x165)+_0xf048c2['fileCount']);_0xf048c2['targetExists']&&(console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x1a4)](_0x4a0b5e(0x13c)+_0xf048c2[_0x4a0b5e(0x186)]+_0x4a0b5e(0x23c)+_0xf048c2[_0x4a0b5e(0x261)]+')')),console[_0x4a0b5e(0x112)](a51_0x5a26d5['yellow'](_0x4a0b5e(0x175))));if(_0x2727db[_0x4a0b5e(0x26f)])return console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x1a4)](_0x4a0b5e(0x120))),0x0;if(!_0x2727db[_0x4a0b5e(0x23a)]){if(!isInteractive())return console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0x181)](_0x4a0b5e(0x183)),_0x4a0b5e(0x191)),console['error'](a51_0x5a26d5['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x220358=_0xf048c2[_0x4a0b5e(0x1b2)]||a51_0x447410[_0x4a0b5e(0x1c5)](_0x497fb2),_0x122edc=_0xf048c2[_0x4a0b5e(0x154)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x2b63be+_0x4a0b5e(0x100):_0x4a0b5e(0xd7)+_0x220358+_0x4a0b5e(0x241)+_0x2b63be+'\x22?',_0x28b082=await confirmKey(_0x122edc);if(!_0x28b082)return console['error'](a51_0x5a26d5[_0x4a0b5e(0x1a4)](_0x4a0b5e(0x1d3))),0x1;}const _0x48ac23=await withSpinner(_0xf048c2[_0x4a0b5e(0x154)]?_0x4a0b5e(0x244)+_0x2b63be+'...':'Cloning\x20to\x20'+_0x2b63be+_0x4a0b5e(0x1ca),()=>_0x404f50[_0x4a0b5e(0x229)][_0x4a0b5e(0x14c)](_0xf048c2),{'verbose':_0x2727db[_0x4a0b5e(0x21b)]}),_0x2387de=_0x48ac23[_0x4a0b5e(0x103)];return console[_0x4a0b5e(0x112)](a51_0x5a26d5[_0x4a0b5e(0xd9)](_0xf048c2[_0x4a0b5e(0x154)]?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x126)+_0x2387de[_0x4a0b5e(0x186)]),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x232)+_0x2387de[_0x4a0b5e(0x18b)]),console[_0x4a0b5e(0x112)](_0x4a0b5e(0x10e)+_0x2387de[_0x4a0b5e(0x20d)]),await this[_0x4a0b5e(0x233)](_0x404f50,_0x2387de[_0x4a0b5e(0x186)],_0x2727db[_0x4a0b5e(0x258)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0xef);[a51_0x329efe(0x269)]=a51_0x329efe(0x260);async[a51_0x329efe(0x242)](_0xd2fd47){const _0x5a16ac=a51_0x329efe,{options:_0xd4446d,args:_0x3f6994,tdx:_0x1caf98}=_0xd2fd47,_0x5923bb=_0x3f6994[0x0];if(!_0x5923bb)return console[_0x5a16ac(0x112)](_0x5a16ac(0x1e4)),console[_0x5a16ac(0x112)](_0x5a16ac(0x223)),0x1;_0xd4446d[_0x5a16ac(0x21b)]&&console[_0x5a16ac(0x112)](_0x5a16ac(0x1ae)+_0x5923bb);if(!_0xd4446d['yes']){if(!isInteractive())return console['error'](a51_0x5a26d5[_0x5a16ac(0x181)](_0x5a16ac(0x183)),_0x5a16ac(0x191)),console['error'](a51_0x5a26d5['dim'](_0x5a16ac(0x130))),0x1;const _0x32ba78=await confirmKey(_0x5a16ac(0x230)+_0x5923bb+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x32ba78)return console[_0x5a16ac(0x112)](a51_0x5a26d5[_0x5a16ac(0x1a4)]('Cancelled')),0x1;}const _0x448f70=await withSpinner('Deleting\x20project\x20'+_0x5923bb+_0x5a16ac(0x1ca),()=>_0x1caf98[_0x5a16ac(0x229)][_0x5a16ac(0x204)](_0x5923bb),{'verbose':_0xd4446d['verbose']}),_0x173a36=_0x448f70[_0x5a16ac(0x103)];return console[_0x5a16ac(0x112)](_0x5a16ac(0x14f)+_0x173a36[_0x5a16ac(0xe7)]),console[_0x5a16ac(0x112)]('\x20\x20Project\x20ID:\x20'+_0x173a36[_0x5a16ac(0x102)]),0x0;}}export function parseKeyValue(_0x5e9806){const _0x1eab34=a51_0x329efe,_0x4d7ec3=_0x5e9806[_0x1eab34(0x276)]('=');if(_0x4d7ec3===-0x1)throw new Error(_0x1eab34(0xe3)+_0x5e9806+_0x1eab34(0x142));const _0x2128ac=_0x5e9806['substring'](0x0,_0x4d7ec3),_0x1803b0=_0x5e9806[_0x1eab34(0x1b5)](_0x4d7ec3+0x1);if(!_0x2128ac)throw new Error(_0x1eab34(0x13b));return{'key':_0x2128ac,'value':_0x1803b0};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x1ed);[a51_0x329efe(0x269)]=a51_0x329efe(0x26e);async[a51_0x329efe(0x242)](_0x5ab885){const _0x358b37=a51_0x329efe,{options:_0x4028a2,args:_0x2bf957,tdx:_0x592ca0}=_0x5ab885,_0x47ac24=this[_0x358b37(0x15e)](_0x2bf957,_0x4028a2);if(!_0x47ac24)return 0x1;_0x4028a2['verbose']&&console['error'](_0x358b37(0x1ae)+_0x47ac24);const _0x3b3c63=await withSpinner(_0x358b37(0x226),()=>_0x592ca0[_0x358b37(0x229)][_0x358b37(0x13a)](_0x47ac24),{'verbose':_0x4028a2[_0x358b37(0x21b)]}),{secrets:_0x5d5c14}=_0x3b3c63[_0x358b37(0x103)];return console[_0x358b37(0x112)](_0x358b37(0x139)+_0x5d5c14[_0x358b37(0x1ee)]+_0x358b37(0x148)+(_0x5d5c14[_0x358b37(0x1ee)]!==0x1?'s':'')),await handleSDKOutput(_0x5d5c14,_0x4028a2),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x12b);[a51_0x329efe(0x269)]=a51_0x329efe(0x198);async[a51_0x329efe(0x242)](_0x5310af){const _0x760a6=a51_0x329efe,{options:_0x12a3d3,args:_0x348cd3,tdx:_0x13bcba}=_0x5310af;let _0x22ef0b,_0x1bf20e;if(_0x348cd3[_0x760a6(0x1ee)]>=0x1&&!_0x348cd3[0x0]['includes']('='))_0x22ef0b=_0x348cd3[0x0],_0x1bf20e=_0x348cd3[_0x760a6(0x209)](0x1);else{if(_0x348cd3[_0x760a6(0x1ee)]>=0x1&&_0x12a3d3['workflowProject'])_0x22ef0b=_0x12a3d3[_0x760a6(0x206)],_0x1bf20e=_0x348cd3;else return _0x348cd3[_0x760a6(0x1ee)]>=0x1?(console['error'](_0x760a6(0x160)),console[_0x760a6(0x112)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x760a6(0x112)](_0x760a6(0x251)),console[_0x760a6(0x112)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x1bf20e[_0x760a6(0x1ee)]===0x0)return console[_0x760a6(0x112)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x760a6(0x112)](_0x760a6(0x1d4)),0x1;const _0x5880bb={};try{for(const _0x3280fe of _0x1bf20e){const {key:_0x40b795,value:_0x5696af}=parseKeyValue(_0x3280fe);_0x5880bb[_0x40b795]=_0x5696af;}}catch(_0x2a3ed0){return _0x2a3ed0 instanceof Error&&console[_0x760a6(0x112)](a51_0x5a26d5[_0x760a6(0x181)](_0x760a6(0x24e)),_0x2a3ed0[_0x760a6(0xe2)]),0x1;}const _0x54d37e=Object[_0x760a6(0x1f3)](_0x5880bb);_0x12a3d3[_0x760a6(0x21b)]&&(console[_0x760a6(0x112)](_0x760a6(0x1ae)+_0x22ef0b),console[_0x760a6(0x112)]('Secrets\x20to\x20set:\x20'+_0x54d37e[_0x760a6(0x221)](',\x20')));const _0x384f56=await withSpinner(_0x54d37e[_0x760a6(0x1ee)]===0x1?'Setting\x20secret...':_0x760a6(0x1e0)+_0x54d37e[_0x760a6(0x1ee)]+_0x760a6(0x26b),()=>_0x13bcba[_0x760a6(0x229)][_0x760a6(0xe0)](_0x22ef0b,_0x5880bb),{'verbose':_0x12a3d3[_0x760a6(0x21b)]}),_0x3ff188=_0x384f56['data'];return console[_0x760a6(0x112)](_0x54d37e['length']===0x1?'✔\x20Secret\x20\x27'+_0x3ff188[_0x760a6(0x1f3)][0x0]+_0x760a6(0x10b)+_0x3ff188[_0x760a6(0xe7)]+'\x27':'✔\x20'+_0x3ff188[_0x760a6(0x1f3)]['length']+_0x760a6(0x153)+_0x3ff188[_0x760a6(0xe7)]+'\x27'),(_0x12a3d3[_0x760a6(0x17d)]||_0x12a3d3[_0x760a6(0x1e2)])&&await handleSingleObjectOutput(_0x3ff188,_0x12a3d3),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x329efe(0x161)]=a51_0x329efe(0x266);[a51_0x329efe(0x269)]=a51_0x329efe(0x178);async['execute'](_0x2b6437){const _0x270152=a51_0x329efe,{options:_0x1c6447,args:_0x161e64,tdx:_0x548a8e}=_0x2b6437;let _0x310c93,_0x4cbdee;if(_0x161e64[_0x270152(0x1ee)]>=0x2)_0x310c93=_0x161e64[0x0],_0x4cbdee=_0x161e64[0x1];else{if(_0x161e64[_0x270152(0x1ee)]===0x1&&_0x1c6447['workflowProject'])_0x310c93=_0x1c6447[_0x270152(0x206)],_0x4cbdee=_0x161e64[0x0];else return _0x161e64[_0x270152(0x1ee)]===0x1?(console[_0x270152(0x112)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x270152(0x1b1)),0x1):(console[_0x270152(0x112)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x270152(0x225)),0x1);}_0x1c6447['verbose']&&(console['error']('Project:\x20'+_0x310c93),console[_0x270152(0x112)](_0x270152(0x110)+_0x4cbdee));if(!_0x1c6447[_0x270152(0x23a)]){if(!isInteractive())return console[_0x270152(0x112)](a51_0x5a26d5[_0x270152(0x181)](_0x270152(0x183)),_0x270152(0x191)),console['error'](a51_0x5a26d5[_0x270152(0x26d)](_0x270152(0x130))),0x1;const _0x4333cc=await confirmKey(_0x270152(0x23b)+_0x4cbdee+_0x270152(0x16a)+_0x310c93+'\x27?');if(!_0x4333cc)return console['error'](a51_0x5a26d5['yellow'](_0x270152(0x1d3))),0x1;}const _0x4ba275=await withSpinner(_0x270152(0xf8),()=>_0x548a8e['workflow'][_0x270152(0x25e)](_0x310c93,_0x4cbdee),{'verbose':_0x1c6447['verbose']}),_0x154851=_0x4ba275[_0x270152(0x103)];return console[_0x270152(0x112)]('✔\x20Secret\x20\x27'+_0x154851['key']+_0x270152(0x26c)+_0x154851[_0x270152(0xe7)]+'\x27'),(_0x1c6447[_0x270152(0x17d)]||_0x1c6447[_0x270152(0x1e2)])&&await handleSingleObjectOutput(_0x154851,_0x1c6447),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(_0x1ae55e){const _0x4d229e=a51_0x329efe,_0x5387ef=Math[_0x4d229e(0x268)](_0x1ae55e/0x3e8),_0x48be4c=Math[_0x4d229e(0x268)](_0x5387ef/0x3c),_0x1aa99f=Math[_0x4d229e(0x268)](_0x48be4c/0x3c),_0x465585=Math[_0x4d229e(0x268)](_0x1aa99f/0x18);if(_0x465585>0x0){const _0x3ac91d=_0x1aa99f%0x18;return _0x3ac91d>0x0?_0x465585+'d\x20'+_0x3ac91d+'h':_0x465585+'d';}else{if(_0x1aa99f>0x0){const _0x1c0fba=_0x48be4c%0x3c;return _0x1c0fba>0x0?_0x1aa99f+'h\x20'+_0x1c0fba+'m':_0x1aa99f+'h';}else{if(_0x48be4c>0x0){const _0xa11c12=_0x5387ef%0x3c;return _0xa11c12>0x0?_0x48be4c+'m\x20'+_0xa11c12+'s':_0x48be4c+'m';}else return _0x5387ef+'s';}}}function formatTimestamp(_0x2b4a08,_0x545c8f){const _0x981dbf=a51_0x329efe,_0x3d6e51=new Date(_0x2b4a08),_0x5478ea=String(_0x3d6e51[_0x981dbf(0x1b6)]())[_0x981dbf(0x1d9)](0x2,'0'),_0x143b5c=String(_0x3d6e51[_0x981dbf(0x243)]())['padStart'](0x2,'0'),_0x2687b6=_0x5478ea+':'+_0x143b5c,_0xba8b02=_0x3d6e51[_0x981dbf(0x21e)]()===_0x545c8f['getFullYear']()&&_0x3d6e51[_0x981dbf(0x119)]()===_0x545c8f[_0x981dbf(0x119)]()&&_0x3d6e51[_0x981dbf(0x15d)]()===_0x545c8f[_0x981dbf(0x15d)]();if(_0xba8b02)return _0x2687b6;else{const _0x4f96f5=String(_0x3d6e51['getMonth']()+0x1)[_0x981dbf(0x1d9)](0x2,'0'),_0x418d6e=String(_0x3d6e51[_0x981dbf(0x15d)]())['padStart'](0x2,'0');return _0x4f96f5+'-'+_0x418d6e+'\x20'+_0x2687b6;}}function formatDate(_0x2be13f){const _0x9fdbfd=a51_0x329efe,_0xb8d0cb=_0x2be13f['getFullYear'](),_0x55a03a=String(_0x2be13f[_0x9fdbfd(0x119)]()+0x1)['padStart'](0x2,'0'),_0x1e9490=String(_0x2be13f[_0x9fdbfd(0x15d)]())[_0x9fdbfd(0x1d9)](0x2,'0');return _0xb8d0cb+'-'+_0x55a03a+'-'+_0x1e9490;}function getTaskStateIcon(_0x169366){const _0x58ea09={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x58ea09[_0x169366]||'⚪';}function getBarChar(_0x31214b){const _0x1533de=a51_0x329efe;return _0x31214b===_0x1533de(0x112)||_0x31214b==='group_error'?'×':'─';}function getBarColor(_0xd8e127){const _0x447174=a51_0x329efe,_0xed4c00={'success':a51_0x5a26d5[_0x447174(0xd9)],'error':a51_0x5a26d5['red'],'group_error':a51_0x5a26d5[_0x447174(0x181)],'running':a51_0x5a26d5[_0x447174(0x13e)],'blocked':a51_0x5a26d5[_0x447174(0x1a4)],'planned':a51_0x5a26d5[_0x447174(0x26d)],'canceling':a51_0x5a26d5['yellow']};return _0xed4c00[_0xd8e127]||a51_0x5a26d5[_0x447174(0x14b)];}function parseTaskName(_0x406cf3){const _0x32c158=a51_0x329efe;let _0x5dd623=_0x406cf3[_0x32c158(0x16c)](/^\++/,'');const _0x358ad3=_0x5dd623[_0x32c158(0x1f7)]('+'),_0x40465d=_0x358ad3[_0x32c158(0x1ee)]>0x1?_0x358ad3['length']-0x2:0x0,_0xba2a92=_0x358ad3[_0x358ad3['length']-0x1]||_0x5dd623;return{'level':_0x40465d,'name':'+'+_0xba2a92};}function truncateTaskName(_0x3cbff9,_0x120cbe){const _0x2738cd=a51_0x329efe,_0x5382e2=stringWidth(_0x3cbff9);if(_0x5382e2<=_0x120cbe)return _0x3cbff9;let _0x108881=_0x3cbff9;while(stringWidth(_0x108881+'…')>_0x120cbe&&_0x108881['length']>0x0){_0x108881=_0x108881[_0x2738cd(0x209)](0x0,-0x1);}return _0x108881+'…';}function calculateTimeScale(_0x5663b0,_0x29a039){const _0x1d6b5c=a51_0x329efe;return{'startTime':_0x5663b0[_0x1d6b5c(0x129)],'endTime':_0x5663b0['end'],'durationMs':_0x5663b0[_0x1d6b5c(0x222)],'msPerChar':_0x5663b0[_0x1d6b5c(0x222)]/_0x29a039};}function timeToPosition(_0x1d1e99,_0x24038b,_0x302dbd){const _0x24b899=a51_0x329efe,_0x91f166=_0x1d1e99-_0x24038b[_0x24b899(0xf1)],_0x53f3ef=Math['floor'](_0x91f166/_0x24038b[_0x24b899(0x20b)]);return Math['max'](0x0,Math['min'](_0x53f3ef,_0x302dbd));}function renderTimeAxis(_0x1fe7d1,_0x1e87db){const _0x1aac34=a51_0x329efe,_0x1cef9d=Math[_0x1aac34(0x1ec)](TIMELINE_CONFIG[_0x1aac34(0x277)],Math[_0x1aac34(0x188)](TIMELINE_CONFIG[_0x1aac34(0x1af)],Math['floor'](_0x1e87db/TIMELINE_CONFIG[_0x1aac34(0x267)]))),_0x1363a7=_0x1fe7d1[_0x1aac34(0x140)]/(_0x1cef9d-0x1),_0x42c8e8=new Date(_0x1fe7d1[_0x1aac34(0xf1)]),_0x3fd7e3=[];for(let _0x5987b7=0x0;_0x5987b7<_0x1cef9d;_0x5987b7++){const _0x409d4f=_0x1fe7d1['startTime']+_0x5987b7*_0x1363a7,_0x550895=timeToPosition(_0x409d4f,_0x1fe7d1,_0x1e87db),_0x5bce0c=formatTimestamp(_0x409d4f,_0x42c8e8);_0x3fd7e3[_0x1aac34(0x193)]({'pos':_0x550895,'text':_0x5bce0c});}const _0x24600e=new Array(_0x1e87db)[_0x1aac34(0x1ba)]('\x20');let _0x3de84e=-0x1;for(const {pos:_0xa13cd,text:_0x24ae57}of _0x3fd7e3){let _0x7d79db=Math[_0x1aac34(0x188)](0x0,_0xa13cd-Math[_0x1aac34(0x268)](_0x24ae57[_0x1aac34(0x1ee)]/0x2));_0x7d79db<=_0x3de84e+TIMELINE_CONFIG[_0x1aac34(0xf3)]&&(_0x7d79db=_0x3de84e+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x7d79db+_0x24ae57['length']>_0x1e87db&&(_0x7d79db=_0x1e87db-_0x24ae57[_0x1aac34(0x1ee)]);if(_0x7d79db>=0x0&&_0x7d79db+_0x24ae57[_0x1aac34(0x1ee)]<=_0x1e87db&&_0x7d79db>_0x3de84e){for(let _0x470a97=0x0;_0x470a97<_0x24ae57['length'];_0x470a97++){_0x24600e[_0x7d79db+_0x470a97]=_0x24ae57[_0x470a97];}_0x3de84e=_0x7d79db+_0x24ae57[_0x1aac34(0x1ee)]-0x1;}}return _0x24600e[_0x1aac34(0x221)]('');}function renderTaskRow(_0x6a2af3,_0x5e1183,_0x3b5503,_0x44becf){const _0x380301=a51_0x329efe,{level:_0xa100f1,name:_0x2ff356}=parseTaskName(_0x6a2af3[_0x380301(0x161)]),_0xbf885='\x20'[_0x380301(0x166)](_0xa100f1),_0x131307=_0x6a2af3[_0x380301(0x1fa)]?'('+formatElapsed(_0x6a2af3[_0x380301(0x1fa)][_0x380301(0x222)])+')':'',_0x377d56=stringWidth(_0x131307),_0x32e4a7=_0xa100f1*0x1,_0x116196=_0x44becf-_0x32e4a7-_0x377d56-0x1,_0x302aa9=truncateTaskName(_0x2ff356,_0x116196),_0x1829d5=_0xbf885+_0x302aa9,_0x7a01aa=stringWidth(_0x1829d5),_0x250f75=_0x44becf-_0x7a01aa-_0x377d56,_0x416eba=_0x1829d5+'\x20'['repeat'](Math['max'](0x1,_0x250f75))+a51_0x5a26d5['dim'](_0x131307),_0x544936=getTaskStateIcon(_0x6a2af3['state']),_0x444237=new Array(_0x3b5503)[_0x380301(0x1ba)]('\x20');if(_0x6a2af3['window']){const _0xd82294=timeToPosition(_0x6a2af3[_0x380301(0x1fa)][_0x380301(0x129)],_0x5e1183,_0x3b5503),_0x2704dc=timeToPosition(_0x6a2af3[_0x380301(0x1fa)][_0x380301(0x1f2)],_0x5e1183,_0x3b5503),_0x28b490=getBarChar(_0x6a2af3[_0x380301(0x1a8)]),_0x27ce2e=Math[_0x380301(0x188)](_0xd82294+0x1,_0x2704dc);for(let _0x2d1a7e=_0xd82294;_0x2d1a7e<Math[_0x380301(0x1ec)](_0x27ce2e,_0x3b5503);_0x2d1a7e++){_0x444237[_0x2d1a7e]=_0x28b490;}}const _0x5ebad8=getBarColor(_0x6a2af3[_0x380301(0x1a8)]),_0x39b4fa=_0x444237[_0x380301(0x1c4)](_0x4cf4fe=>_0x4cf4fe==='\x20'?'\x20':_0x5ebad8(_0x4cf4fe))[_0x380301(0x221)]('');return _0x544936+'\x20'+_0x416eba+'│'+_0x39b4fa+'│';}function calculateStats(_0xf27b0e){const _0x4abc1b=a51_0x329efe,_0x3e29e3={'total':_0xf27b0e['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2fe120 of _0xf27b0e){if(_0x2fe120[_0x4abc1b(0x1a8)]===_0x4abc1b(0x1a7))_0x3e29e3[_0x4abc1b(0x1a7)]++;else{if(_0x2fe120[_0x4abc1b(0x1a8)]===_0x4abc1b(0x112)||_0x2fe120[_0x4abc1b(0x1a8)]==='group_error')_0x3e29e3[_0x4abc1b(0x112)]++;else _0x2fe120['state']==='running'?_0x3e29e3[_0x4abc1b(0x22b)]++:_0x3e29e3['pending']++;}}return _0x3e29e3;}function formatStats(_0x1962f1){const _0x1c2dfc=a51_0x329efe;return['Total:\x20'+_0x1962f1[_0x1c2dfc(0x19f)],'✅\x20'+_0x1962f1[_0x1c2dfc(0x1a7)],'❌\x20'+_0x1962f1['error'],'🔄\x20'+_0x1962f1[_0x1c2dfc(0x22b)],'⏳\x20'+_0x1962f1[_0x1c2dfc(0x1c8)]][_0x1c2dfc(0x221)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a51_0x329efe(0x269)]=a51_0x329efe(0xe1);async[a51_0x329efe(0x242)](_0x462ce7){const _0x127bdd=a51_0x329efe,{options:_0x55b107,args:_0x1106ca,tdx:_0x2ebf0e}=_0x462ce7;let _0x94b919,_0x37025d,_0x1bb34b=![];if(_0x1106ca[0x0]){if(_0x1106ca[0x0][_0x127bdd(0x22e)]('.')){const _0x5c9821=this['parseProjectWorkflowPattern'](_0x1106ca,_0x55b107);if(!_0x5c9821)return 0x1;_0x94b919=_0x5c9821[_0x127bdd(0xe7)],_0x37025d=_0x5c9821[_0x127bdd(0x16d)];}else{_0x37025d=_0x1106ca[0x0],_0x94b919=_0x55b107[_0x127bdd(0x206)];if(!_0x94b919)return console[_0x127bdd(0x112)](a51_0x5a26d5[_0x127bdd(0x181)](_0x127bdd(0x24e)),_0x127bdd(0x16e)),0x1;_0x1bb34b=!![];}}else{const _0x5ae7ea=this[_0x127bdd(0x1e5)](_0x1106ca,_0x55b107);if(!_0x5ae7ea)return 0x1;_0x94b919=_0x5ae7ea[_0x127bdd(0xe7)],_0x37025d=_0x5ae7ea[_0x127bdd(0x16d)];}if(_0x55b107['verbose']){if(_0x94b919&&_0x37025d)console[_0x127bdd(0x112)](_0x127bdd(0x1b4)+_0x94b919+'.'+_0x37025d);else _0x94b919&&console[_0x127bdd(0x112)]('Filter:\x20project='+_0x94b919);}const _0x15bfb9=_0x55b107[_0x127bdd(0x196)],_0x2d38c8=_0x55b107[_0x127bdd(0x1d8)];if(_0x15bfb9){_0x2d38c8&&console[_0x127bdd(0x112)](a51_0x5a26d5['yellow']('Warning:'),_0x127bdd(0x131));const _0x4c0af9=_0x55b107['follow'];return _0x4c0af9?await this[_0x127bdd(0x1c9)](_0x462ce7,_0x15bfb9):await this['renderSingleTimeline'](_0x462ce7,_0x15bfb9,_0x55b107),0x0;}if(_0x2d38c8){const _0xd493ec=await withSpinner('Loading\x20session...',()=>_0x2ebf0e[_0x127bdd(0x229)]['sessions']({'projectName':_0x94b919,'workflowName':_0x37025d,'limit':0x64}),{'verbose':_0x55b107[_0x127bdd(0x21b)]}),_0x446b97=_0xd493ec[_0x127bdd(0x103)][_0x127bdd(0x27b)](_0x449054=>_0x449054['id']===_0x2d38c8);if(!_0x446b97)return console['error'](a51_0x5a26d5[_0x127bdd(0x181)](_0x127bdd(0x24e)),_0x127bdd(0xf5)+_0x2d38c8),0x1;if(!_0x446b97[_0x127bdd(0x249)]?.['id'])return console[_0x127bdd(0x112)](a51_0x5a26d5[_0x127bdd(0x181)]('Error:'),_0x127bdd(0x189)+_0x2d38c8+_0x127bdd(0x19d)),0x1;const _0x1ca190=_0x446b97['lastAttempt']['id'];_0x55b107[_0x127bdd(0x21b)]&&console[_0x127bdd(0x112)](_0x127bdd(0xd8)+_0x1ca190+'\x20from\x20session\x20'+_0x2d38c8);const _0x1360ba=_0x55b107[_0x127bdd(0x19e)];return _0x1360ba?await this['pollTimeline'](_0x462ce7,_0x1ca190):await this[_0x127bdd(0x1ea)](_0x462ce7,_0x1ca190,_0x55b107),0x0;}const _0x12f898=await withSpinner(_0x127bdd(0xeb),()=>_0x2ebf0e[_0x127bdd(0x229)][_0x127bdd(0x1a2)]({'projectName':_0x94b919,'workflowName':_0x37025d,'limit':_0x55b107[_0x127bdd(0x173)]||0x32}),{'verbose':_0x55b107[_0x127bdd(0x21b)]}),_0x29e48b=_0x12f898[_0x127bdd(0x103)];if(_0x29e48b[_0x127bdd(0x1ee)]===0x0){if(_0x94b919&&_0x37025d)console[_0x127bdd(0x112)](_0x127bdd(0x128)+_0x94b919+'.'+_0x37025d);else _0x94b919?console['error'](_0x127bdd(0x12a)+_0x94b919):(console[_0x127bdd(0x112)]('No\x20workflow\x20sessions\x20found'),console['error'](a51_0x5a26d5[_0x127bdd(0x26d)](_0x127bdd(0x271))));return 0x0;}_0x29e48b[_0x127bdd(0x108)]((_0x317bf1,_0x18c724)=>{const _0x3504f5=_0x127bdd,_0x1b95a9=_0x317bf1[_0x3504f5(0x1c2)]||'',_0x3b086e=_0x18c724[_0x3504f5(0x1c2)]||'';return _0x3b086e[_0x3504f5(0x1ef)](_0x1b95a9);});if(_0x55b107['json']||_0x55b107[_0x127bdd(0x1e2)])return await handleSDKOutput(_0x29e48b,_0x55b107),0x0;let _0x158cf8;if(_0x1bb34b){const _0x16b8d9=_0x29e48b[0x0];if(!_0x16b8d9[_0x127bdd(0x249)]?.['id'])return console['error'](_0x127bdd(0x114)),0x0;_0x158cf8=_0x16b8d9[_0x127bdd(0x249)]['id'],_0x55b107['verbose']&&console[_0x127bdd(0x112)](_0x127bdd(0x231)+_0x16b8d9['sessionTime']);}else{const _0x253fb=_0x29e48b[_0x127bdd(0x1c4)](_0x54cc8a=>{const _0x398dfe=_0x127bdd,_0x2517d6=getAttemptStatusDisplay(_0x54cc8a[_0x398dfe(0x249)]);return{'title':_0x54cc8a[_0x398dfe(0x156)]?.[_0x398dfe(0x161)]+'.'+_0x54cc8a[_0x398dfe(0x229)]?.['name']+'\x20-\x20'+_0x54cc8a[_0x398dfe(0x1c2)]+'\x20'+_0x2517d6[_0x398dfe(0x163)],'value':_0x54cc8a['lastAttempt']?.['id']||'','description':_0x2517d6[_0x398dfe(0x185)]};}),_0x12ac2d=await a51_0x17395a({'type':_0x127bdd(0x162),'name':_0x127bdd(0x196),'message':_0x127bdd(0x17a),'choices':_0x253fb[_0x127bdd(0x228)](_0x312c4c=>_0x312c4c['value']!=='')});if(!_0x12ac2d[_0x127bdd(0x196)])return 0x0;_0x158cf8=_0x12ac2d[_0x127bdd(0x196)];}const _0x12cc99=_0x55b107[_0x127bdd(0x19e)];return _0x12cc99?await this[_0x127bdd(0x1c9)](_0x462ce7,_0x158cf8):await this[_0x127bdd(0x1ea)](_0x462ce7,_0x158cf8,_0x55b107),0x0;}async['renderSingleTimeline'](_0x1d1c6a,_0x5b5da2,_0xb05a37){const _0x2b8e3b=a51_0x329efe,{tdx:_0x54d302}=_0x1d1c6a;let _0x48012e,_0x209dae;try{[_0x48012e,_0x209dae]=await Promise[_0x2b8e3b(0x15a)]([_0x54d302[_0x2b8e3b(0x229)][_0x2b8e3b(0x1ad)](_0x5b5da2),_0x54d302[_0x2b8e3b(0x229)][_0x2b8e3b(0x20f)](_0x5b5da2,![])]);}catch(_0x27c1aa){console['error'](a51_0x5a26d5[_0x2b8e3b(0x181)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0xb05a37[_0x2b8e3b(0x21b)]&&console['error'](_0x27c1aa);throw _0x27c1aa;}if(_0xb05a37['json']||_0xb05a37[_0x2b8e3b(0x1e2)]){const _0x40f436=this[_0x2b8e3b(0x152)](_0x48012e,_0x209dae);await handleSDKOutput([_0x40f436],_0xb05a37);return;}const _0x18dbff=_0x54d302[_0x2b8e3b(0x224)]['site'],_0xef6a57=this[_0x2b8e3b(0x1d5)](_0x48012e,_0x209dae,_0x18dbff);console[_0x2b8e3b(0x1d1)](_0xef6a57);}async[a51_0x329efe(0x1c9)](_0x21360d,_0x3d7c3a){const _0x3531a2=a51_0x329efe,{tdx:_0x462c3e}=_0x21360d,_0x37ea6e=TIMELINE_CONFIG[_0x3531a2(0x1f9)],_0x103978=TIMELINE_CONFIG[_0x3531a2(0x12d)];let _0x305ee6=0x0;while(_0x305ee6<_0x103978){process[_0x3531a2(0x22a)][_0x3531a2(0xdb)]&&process[_0x3531a2(0x22a)]['write']('\x1bc');let _0x4eb559,_0x4c2cb9;try{[_0x4eb559,_0x4c2cb9]=await Promise[_0x3531a2(0x15a)]([_0x462c3e[_0x3531a2(0x229)][_0x3531a2(0x1ad)](_0x3d7c3a),_0x462c3e[_0x3531a2(0x229)]['tasks'](_0x3d7c3a,![])]);}catch(_0x4c85dd){console[_0x3531a2(0x112)](a51_0x5a26d5['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x305ee6>0x0&&console[_0x3531a2(0x112)](a51_0x5a26d5[_0x3531a2(0x26d)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x305ee6));throw _0x4c85dd;}const _0x595cc4=_0x462c3e[_0x3531a2(0x224)]['site'],_0x4bd6d6=this[_0x3531a2(0x1d5)](_0x4eb559,_0x4c2cb9,_0x595cc4);console['log'](_0x4bd6d6);const _0x13866b=_0x4eb559[_0x3531a2(0x27e)]&&_0x4c2cb9[_0x3531a2(0x1eb)](_0x7d8609=>_0x7d8609['state']!==_0x3531a2(0x22b)&&_0x7d8609['state']!=='planned');if(_0x13866b){console[_0x3531a2(0x112)](a51_0x5a26d5[_0x3531a2(0xd9)](_0x3531a2(0x101)));break;}console['error'](a51_0x5a26d5[_0x3531a2(0x26d)](_0x3531a2(0x1f6)+_0x305ee6*0x2+_0x3531a2(0x15b))),await new Promise(_0x5f5934=>setTimeout(_0x5f5934,_0x37ea6e)),_0x305ee6++;}_0x305ee6>=_0x103978&&console[_0x3531a2(0x112)](a51_0x5a26d5['yellow'](_0x3531a2(0x17e)));}[a51_0x329efe(0x1d5)](_0x24ca15,_0x1a1127,_0x58d7a6){const _0x4eaadd=a51_0x329efe,_0x25985d=[],_0x1dfd4f=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x14c394=0x5,_0x4b2210=process[_0x4eaadd(0x22a)][_0x4eaadd(0x235)]||0x78,_0x4e236a=_0x4b2210-_0x1dfd4f-_0x14c394,_0x7aa1d0=Math[_0x4eaadd(0x188)](TIMELINE_CONFIG[_0x4eaadd(0x11a)],Math['min'](_0x4e236a,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x12de1d=new Date(_0x24ca15[_0x4eaadd(0x1a0)])[_0x4eaadd(0x118)](),_0x41725e=_0x24ca15[_0x4eaadd(0x254)]?new Date(_0x24ca15[_0x4eaadd(0x254)])[_0x4eaadd(0x118)]():Date[_0x4eaadd(0xda)](),_0x1d744e={'start':_0x12de1d,'end':_0x41725e,'duration':_0x41725e-_0x12de1d},_0x3727f1=new Map(),_0xb37ca5=[];for(const _0x4ab273 of _0x1a1127){if(_0x4ab273['startedAt']){const _0x1a3d77=new Date(_0x4ab273[_0x4eaadd(0x121)])[_0x4eaadd(0x118)](),_0x4b4e8f=_0x4ab273[_0x4eaadd(0x1bc)]?new Date(_0x4ab273[_0x4eaadd(0x1bc)])['getTime']():Date['now'](),_0x5746ad={'start':_0x1a3d77,'end':_0x4b4e8f,'duration':_0x4b4e8f-_0x1a3d77};_0x3727f1[_0x4eaadd(0x1da)](_0x4ab273['id'],_0x5746ad),_0xb37ca5[_0x4eaadd(0x193)]({'name':_0x4ab273[_0x4eaadd(0x1b3)],'state':_0x4ab273['state']||_0x4eaadd(0x106),'window':_0x5746ad});}else _0xb37ca5[_0x4eaadd(0x193)]({'name':_0x4ab273[_0x4eaadd(0x1b3)],'state':_0x4ab273[_0x4eaadd(0x1a8)]||'planned','window':undefined});}_0xb37ca5[_0x4eaadd(0x108)]((_0x5f508e,_0x305ff9)=>{const _0x46cf37=_0x4eaadd;if(!_0x5f508e[_0x46cf37(0x1fa)])return 0x1;if(!_0x305ff9[_0x46cf37(0x1fa)])return-0x1;return _0x5f508e['window']['start']-_0x305ff9[_0x46cf37(0x1fa)][_0x46cf37(0x129)];});const _0x250da0=_0xb37ca5[_0x4eaadd(0x1ee)],_0x52d657=_0x250da0>TIMELINE_CONFIG[_0x4eaadd(0x20c)];_0x52d657&&_0xb37ca5['splice'](TIMELINE_CONFIG[_0x4eaadd(0x20c)]);const _0x54df16=calculateTimeScale(_0x1d744e,_0x7aa1d0),_0x5c91a3=_0x24ca15[_0x4eaadd(0x27e)]?_0x24ca15[_0x4eaadd(0x1a7)]?a51_0x5a26d5['green']('success'):a51_0x5a26d5['red']('error'):a51_0x5a26d5[_0x4eaadd(0x13e)](_0x4eaadd(0x22b)),_0x2458b7=_0x24ca15[_0x4eaadd(0x156)]?.['id'],_0x70fc90=_0x24ca15[_0x4eaadd(0x1d8)];let _0x1cf7ca;if(_0x2458b7&&_0x70fc90){const _0x571dae=getWorkflowAttemptUrl(_0x58d7a6,_0x2458b7,_0x70fc90,_0x24ca15['id']);_0x1cf7ca=hyperlink(a51_0x5a26d5[_0x4eaadd(0x26d)](_0x24ca15['id']),_0x571dae);}else _0x1cf7ca=a51_0x5a26d5['dim'](_0x24ca15['id']);_0x25985d[_0x4eaadd(0x193)](_0x4eaadd(0x21d)+_0x1cf7ca+'\x20-\x20'+_0x5c91a3+_0x4eaadd(0x1bf)+formatElapsed(_0x1d744e[_0x4eaadd(0x222)]));if(_0xb37ca5[_0x4eaadd(0x1ee)]>0x0){const _0xd17766=renderTimeAxis(_0x54df16,_0x7aa1d0),_0x1fec01=new Date(_0x1d744e[_0x4eaadd(0x129)]),_0x1e49c1=formatDate(_0x1fec01),_0x40cce1=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4eaadd(0x172)]+_0x1dfd4f,_0x1b88fb=_0x1e49c1[_0x4eaadd(0x1d9)](_0x40cce1),_0x493a4c=a51_0x5a26d5['dim'](_0x1b88fb);_0x25985d[_0x4eaadd(0x193)](_0x493a4c+'\x20'+_0xd17766);for(const _0x192fb6 of _0xb37ca5){_0x25985d[_0x4eaadd(0x193)](renderTaskRow(_0x192fb6,_0x54df16,_0x7aa1d0,_0x1dfd4f));}const _0x1d01a9=calculateStats(_0xb37ca5);_0x25985d['push'](formatStats(_0x1d01a9)),_0x52d657&&_0x25985d[_0x4eaadd(0x193)](a51_0x5a26d5['yellow'](_0x4eaadd(0x15c)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x250da0+'\x20tasks')),_0x25985d['push'](''),_0x25985d[_0x4eaadd(0x193)](a51_0x5a26d5[_0x4eaadd(0x26d)](_0x4eaadd(0x1a5))+('tdx\x20wf\x20attempt\x20'+_0x24ca15['id']+_0x4eaadd(0x12c))+a51_0x5a26d5[_0x4eaadd(0x26d)](_0x4eaadd(0x138)));}else _0x25985d[_0x4eaadd(0x193)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x25985d[_0x4eaadd(0x221)]('\x0a');}[a51_0x329efe(0x152)](_0x3ed872,_0x50fc44){const _0x25568f=a51_0x329efe,_0x9bb491=new Date(_0x3ed872[_0x25568f(0x1a0)])['getTime'](),_0xdb13b7=_0x3ed872['finishedAt']?new Date(_0x3ed872[_0x25568f(0x254)])[_0x25568f(0x118)]():Date[_0x25568f(0xda)](),_0x1b4a86=_0xdb13b7-_0x9bb491,_0x29f171=[];for(const _0x8399c8 of _0x50fc44){if(_0x8399c8[_0x25568f(0x121)]){const _0x593092=new Date(_0x8399c8['startedAt'])[_0x25568f(0x118)](),_0x356f4b=_0x8399c8[_0x25568f(0x1bc)]?new Date(_0x8399c8[_0x25568f(0x1bc)])[_0x25568f(0x118)]():Date[_0x25568f(0xda)]();_0x29f171['push']({'name':_0x8399c8['fullName'],'state':_0x8399c8[_0x25568f(0x1a8)]||_0x25568f(0x106),'window':{'start':_0x593092,'end':_0x356f4b,'duration':_0x356f4b-_0x593092}});}else _0x29f171[_0x25568f(0x193)]({'name':_0x8399c8[_0x25568f(0x1b3)],'state':_0x8399c8[_0x25568f(0x1a8)]||_0x25568f(0x143),'window':undefined});}const _0x6762f0=calculateStats(_0x29f171);return{'attempt':{'id':_0x3ed872['id'],'status':_0x3ed872[_0x25568f(0x27e)]?_0x3ed872[_0x25568f(0x1a7)]?_0x25568f(0x1a7):_0x25568f(0x112):'running','createdAt':_0x3ed872[_0x25568f(0x1a0)],'finishedAt':_0x3ed872[_0x25568f(0x254)],'duration_ms':_0x1b4a86},'tasks':_0x29f171[_0x25568f(0x1c4)](_0x50172e=>({'name':_0x50172e['name'],'state':_0x50172e['state'],'startedAt':_0x50172e[_0x25568f(0x1fa)]?new Date(_0x50172e[_0x25568f(0x1fa)][_0x25568f(0x129)])[_0x25568f(0x24c)]():null,'updatedAt':_0x50172e[_0x25568f(0x1fa)]?new Date(_0x50172e['window'][_0x25568f(0x1f2)])[_0x25568f(0x24c)]():null,'duration_ms':_0x50172e[_0x25568f(0x1fa)]?.['duration']||null})),'stats':_0x6762f0};}}
1
+ const a51_0x64d48f=a51_0x483a;(function(_0x40e429,_0xaa7b4f){const _0x2464d3=a51_0x483a,_0x10ec11=_0x40e429();while(!![]){try{const _0x3bbc89=parseInt(_0x2464d3(0x18e))/0x1+-parseInt(_0x2464d3(0x195))/0x2*(-parseInt(_0x2464d3(0x221))/0x3)+parseInt(_0x2464d3(0x2e4))/0x4*(-parseInt(_0x2464d3(0x1c7))/0x5)+parseInt(_0x2464d3(0x1be))/0x6+-parseInt(_0x2464d3(0x2f9))/0x7+parseInt(_0x2464d3(0x26f))/0x8+parseInt(_0x2464d3(0x2b5))/0x9*(-parseInt(_0x2464d3(0x1ec))/0xa);if(_0x3bbc89===_0xaa7b4f)break;else _0x10ec11['push'](_0x10ec11['shift']());}catch(_0x33ae17){_0x10ec11['push'](_0x10ec11['shift']());}}}(a51_0x5dbb,0xe2666));import a51_0x5af198 from'chalk';import{existsSync}from'fs';import a51_0x2409f9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a51_0x396bfc from'prompts';function a51_0x483a(_0x5afd5c,_0x397b0c){_0x5afd5c=_0x5afd5c-0x16e;const _0x5dbbd0=a51_0x5dbb();let _0x483a04=_0x5dbbd0[_0x5afd5c];return _0x483a04;}function getAttemptStatusDisplay(_0x2fab74){const _0x439378=a51_0x483a;if(!_0x2fab74)return{'icon':'⏳','text':''};const {done:_0x2f67f1,success:_0x2d96f7,cancelRequested:_0x223918}=_0x2fab74;if(!_0x2f67f1)return _0x223918?{'icon':'🛑','text':a51_0x5af198[_0x439378(0x1f4)]('canceling')}:{'icon':'🔄','text':a51_0x5af198[_0x439378(0x1ef)](_0x439378(0x25a))};if(_0x2d96f7)return{'icon':'✅','text':a51_0x5af198[_0x439378(0x2ef)](_0x439378(0x27f))};return{'icon':'❌','text':a51_0x5af198['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x48cf63,_0x1a6e9c,_0x27ff26=0x0){const _0x48f588=a51_0x483a;return _0x48cf63[_0x27ff26]||_0x1a6e9c[_0x48f588(0x307)];}['requireProject'](_0x1b028d,_0x26ae5f,_0x31592a=0x0){const _0x121fa4=a51_0x483a,_0x23e845=this[_0x121fa4(0x1e6)](_0x1b028d,_0x26ae5f,_0x31592a);if(!_0x23e845)return console[_0x121fa4(0x2a9)](a51_0x5af198['red'](_0x121fa4(0x18c)),'Project\x20name\x20is\x20required'),console[_0x121fa4(0x2a9)](a51_0x5af198[_0x121fa4(0x278)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x23e845;}[a51_0x64d48f(0x2b6)](_0x74cecd,_0x174abc){const _0x50f272=a51_0x64d48f;if(_0x74cecd[0x0]){const _0x2b97c8=_0x74cecd[0x0][_0x50f272(0x283)]('.');if(_0x2b97c8[_0x50f272(0x1d8)]===0x1)return{'projectName':_0x2b97c8[0x0],'workflowName':undefined};else return _0x2b97c8['length']===0x2?{'projectName':_0x2b97c8[0x0],'workflowName':_0x2b97c8[0x1]}:(console['error'](a51_0x5af198[_0x50f272(0x23d)]('Error:'),_0x50f272(0x1c8)),null);}return{'projectName':_0x174abc['workflowProject'],'workflowName':undefined};}[a51_0x64d48f(0x17e)](_0x343ccf,_0x23b66d,_0x1e8ff5=0x0){const _0x58001e=a51_0x64d48f;if(_0x343ccf[_0x1e8ff5])return _0x343ccf[_0x1e8ff5];if(_0x23b66d['workflowProject']){const _0x51844e=a51_0x2409f9[_0x58001e(0x1eb)](process[_0x58001e(0x1ab)](),_0x58001e(0x173),_0x23b66d[_0x58001e(0x307)]);if(existsSync(a51_0x2409f9[_0x58001e(0x1eb)](_0x51844e,_0x58001e(0x2a5))))return _0x51844e;}return undefined;}async[a51_0x64d48f(0x284)](_0x3ed677,_0x983ea8,_0x155bbe){const _0x234b0b=a51_0x64d48f;try{const _0xfebef1=await _0x3ed677[_0x234b0b(0x237)][_0x234b0b(0x173)](_0x983ea8,{'limit':0x1});if(_0xfebef1[_0x234b0b(0x1d8)]>0x0){const _0x410960=_0xfebef1[0x0]['id'],_0x208c76=getWorkflowUrl(_0x155bbe,_0x410960);console[_0x234b0b(0x2a9)](_0x234b0b(0x26d)+a51_0x5af198[_0x234b0b(0x1fe)](_0x208c76));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a51_0x64d48f(0x2f2);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1ce);async[a51_0x64d48f(0x1fb)](_0x457131){const _0x45a1e7=a51_0x64d48f,{options:_0x18f0d7,args:_0x454a3d,tdx:_0x2478be}=_0x457131,_0x4a8c52=_0x454a3d[0x0],_0x53519f=_0x18f0d7[_0x45a1e7(0x21c)];if(_0x53519f)return saveSessionContext({'workflow_project':undefined},_0x18f0d7[_0x45a1e7(0x201)]),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x294))),0x0;if(!_0x4a8c52)return console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x23d)](_0x45a1e7(0x18c)),_0x45a1e7(0x182)),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)](_0x45a1e7(0x2ff))),console[_0x45a1e7(0x2a9)](a51_0x5af198[_0x45a1e7(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5de74d=await withSpinner('Resolving\x20project\x20\x27'+_0x4a8c52+_0x45a1e7(0x301),()=>_0x2478be[_0x45a1e7(0x237)][_0x45a1e7(0x25f)](_0x4a8c52),{'verbose':_0x18f0d7[_0x45a1e7(0x210)]}),{name:_0x35b1e0}=_0x5de74d[_0x45a1e7(0x1aa)];return saveSessionContext({'workflow_project':_0x35b1e0},_0x18f0d7['session']),console[_0x45a1e7(0x2a7)](a51_0x5af198[_0x45a1e7(0x2ef)](_0x45a1e7(0x1c3)+a51_0x5af198['cyan'](_0x35b1e0))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1a7);[a51_0x64d48f(0x252)]='List\x20all\x20workflow\x20projects';async[a51_0x64d48f(0x1fb)](_0x18a70f){const _0x4145c6=a51_0x64d48f,{options:_0x525db5,args:_0x1e9971,tdx:_0x5d443f}=_0x18a70f,_0x243534=_0x1e9971[0x0];_0x525db5[_0x4145c6(0x210)]&&_0x243534&&console[_0x4145c6(0x2a9)](_0x4145c6(0x26e)+_0x243534);const _0xea5fe4=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x5d443f['workflow'][_0x4145c6(0x22a)](_0x243534,{'limit':_0x525db5[_0x4145c6(0x1c4)]}),{'verbose':_0x525db5[_0x4145c6(0x210)]});let _0x2bf4a1=_0xea5fe4[_0x4145c6(0x1aa)];_0x2bf4a1[_0x4145c6(0x19c)]((_0x2078e3,_0x5657ca)=>_0x2078e3[_0x4145c6(0x246)][_0x4145c6(0x2fa)](_0x5657ca[_0x4145c6(0x246)]));const _0x387c4e=_0x525db5['limit']||0x64,_0x3b21f2=_0x2bf4a1[_0x4145c6(0x1d8)]>=_0x387c4e?a51_0x5af198['dim'](_0x4145c6(0x2e7)):'';console[_0x4145c6(0x2a9)](_0x4145c6(0x28d)+_0x2bf4a1[_0x4145c6(0x1d8)]+'\x20project'+(_0x2bf4a1[_0x4145c6(0x1d8)]!==0x1?'s':'')+_0x3b21f2);if(_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x1c1)||_0x525db5[_0x4145c6(0x227)]==='jsonl'||_0x525db5[_0x4145c6(0x227)]===_0x4145c6(0x236))await handleSDKOutput(_0x2bf4a1,_0x525db5);else{if(_0x2bf4a1[_0x4145c6(0x1d8)]===0x0)_0x243534?console['log'](_0x4145c6(0x1e5)+_0x243534):console[_0x4145c6(0x2a7)]('No\x20workflow\x20projects\x20found');else{const _0x468d1c=_0x2bf4a1['map'](_0x1ce6ab=>{const _0xbf4276=_0x4145c6,_0xccf6bf=_0x1ce6ab[_0xbf4276(0x25d)]?.[_0xbf4276(0x1d2)](_0x48de33=>_0x48de33[_0xbf4276(0x2be)]===_0xbf4276(0x2c1)),_0x8baa6=_0xccf6bf?a51_0x5af198[_0xbf4276(0x278)]('\x20(system)'):'';return _0xbf4276(0x230)+_0x1ce6ab['name']+_0x8baa6;});await writeOutput(_0x468d1c[_0x4145c6(0x1eb)]('\x0a'),_0x525db5['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x22e);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x18b);async[a51_0x64d48f(0x1fb)](_0x5634e7){const _0x227db1=a51_0x64d48f,{options:_0x145451,args:_0x35a9e5,tdx:_0x53b8c1}=_0x5634e7,_0x46070b=this[_0x227db1(0x1e6)](_0x35a9e5,_0x145451);_0x145451[_0x227db1(0x210)]&&_0x46070b&&console[_0x227db1(0x2a9)](_0x227db1(0x2a1)+_0x46070b);const _0x16b56d=await withSpinner(_0x227db1(0x21e),()=>_0x53b8c1[_0x227db1(0x237)][_0x227db1(0x173)](_0x46070b,{'limit':_0x145451[_0x227db1(0x1c4)]}),{'verbose':_0x145451['verbose']});let _0x5596dc=_0x16b56d['data'];_0x5596dc[_0x227db1(0x19c)]((_0x290635,_0x176a7c)=>{const _0x53696e=_0x227db1,_0x1b9909=_0x290635[_0x53696e(0x246)][_0x53696e(0x2fa)](_0x176a7c[_0x53696e(0x246)]);if(_0x1b9909!==0x0)return _0x1b9909;return(_0x290635[_0x53696e(0x29e)]?.[_0x53696e(0x246)]||'')[_0x53696e(0x2fa)](_0x176a7c['project']?.[_0x53696e(0x246)]||'');});const _0xe7bbb3=_0x145451[_0x227db1(0x1c4)]||0x64,_0x5da02b=_0x5596dc['length']>=_0xe7bbb3?a51_0x5af198[_0x227db1(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x227db1(0x2a9)](_0x227db1(0x28d)+_0x5596dc['length']+_0x227db1(0x1bc)+(_0x5596dc[_0x227db1(0x1d8)]!==0x1?'s':'')+_0x5da02b);if(_0x145451['format']==='json'||_0x145451[_0x227db1(0x227)]==='jsonl'||_0x145451[_0x227db1(0x227)]===_0x227db1(0x236))await handleSDKOutput(_0x5596dc,_0x145451);else{if(_0x5596dc[_0x227db1(0x1d8)]===0x0)_0x46070b?console[_0x227db1(0x2a7)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x46070b):console['log'](_0x227db1(0x285));else{const _0x14d5f7=_0x145451[_0x227db1(0x1a4)],_0x316b70=_0x5596dc['map'](_0x5ca997=>{const _0x5b97e3=_0x227db1,_0x4df686=a51_0x5af198['dim']('#'+_0x5ca997['id']),_0x263325=hyperlink(_0x4df686,getWorkflowUrl(_0x14d5f7,_0x5ca997['id'])),_0x4f4251=_0x5ca997[_0x5b97e3(0x29e)]?.[_0x5b97e3(0x246)]?a51_0x5af198[_0x5b97e3(0x278)]('\x20('+_0x5ca997['project']['name']+')'):'';return'📋\x20'+_0x263325+'\x20'+_0x5ca997['name']+_0x4f4251;});await writeOutput(_0x316b70[_0x227db1(0x1eb)]('\x0a'),_0x145451['output'],_0x227db1(0x209));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:sessions';['description']=a51_0x64d48f(0x22f);async['execute'](_0x549501){const _0x41d8da=a51_0x64d48f,{options:_0x2a2167,args:_0x567ff9,tdx:_0x16608b}=_0x549501,_0x54b634=this[_0x41d8da(0x2b6)](_0x567ff9,_0x2a2167);if(!_0x54b634)return 0x1;const {projectName:_0x3d8246,workflowName:_0x131e07}=_0x54b634;if(_0x2a2167['verbose']){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a9)]('Filter:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246&&console[_0x41d8da(0x2a9)](_0x41d8da(0x2d6)+_0x3d8246);const _0x968ee=_0x2a2167[_0x41d8da(0x2f1)];_0x968ee&&console[_0x41d8da(0x2a9)](_0x41d8da(0x17d)+_0x968ee);}let _0x29e87b=0x28;if(process[_0x41d8da(0x289)]['isTTY']&&!_0x2a2167[_0x41d8da(0x172)]&&!_0x2a2167[_0x41d8da(0x227)]){const _0x4bd7db=process['stdout']['rows']||0x28;_0x29e87b=Math[_0x41d8da(0x2d8)](0x14,Math['floor'](_0x4bd7db*0x2/0x3));}const _0x543d78=_0x2a2167[_0x41d8da(0x1c4)]||_0x29e87b,_0x206d03=await withSpinner(_0x41d8da(0x240),()=>_0x16608b['workflow'][_0x41d8da(0x2d0)]({'projectName':_0x3d8246,'workflowName':_0x131e07,'status':_0x2a2167[_0x41d8da(0x2f1)],'fromTime':_0x2a2167[_0x41d8da(0x197)],'toTime':_0x2a2167['to'],'limit':_0x543d78}),{'verbose':_0x2a2167[_0x41d8da(0x210)]}),_0xf4c024=_0x206d03[_0x41d8da(0x1aa)];_0xf4c024[_0x41d8da(0x19c)]((_0x58d909,_0x593b0)=>{const _0x2aa61a=_0x41d8da,_0x530152=_0x58d909[_0x2aa61a(0x200)]||'',_0x3874ce=_0x593b0[_0x2aa61a(0x200)]||'';return _0x3874ce['localeCompare'](_0x530152);});_0xf4c024[_0x41d8da(0x1d8)]>=_0x543d78?console[_0x41d8da(0x2a9)](_0x41d8da(0x1b9)+_0xf4c024[_0x41d8da(0x1d8)]+'\x20sessions\x20'+a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1b1))):console['error'](_0x41d8da(0x28d)+_0xf4c024['length']+_0x41d8da(0x203)+(_0xf4c024[_0x41d8da(0x1d8)]!==0x1?'s':''));if(_0x2a2167[_0x41d8da(0x227)]==='json'||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x18f)||_0x2a2167[_0x41d8da(0x227)]===_0x41d8da(0x236))await handleSDKOutput(_0xf4c024,_0x2a2167);else{if(!process[_0x41d8da(0x289)][_0x41d8da(0x295)]||_0x2a2167[_0x41d8da(0x172)]){if(_0xf4c024[_0x41d8da(0x1d8)]===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)]('No\x20sessions\x20found\x20for:\x20'+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console['log'](_0x41d8da(0x261));}else{const _0x14475c=_0x2a2167['site'],_0x2a36ee=this[_0x41d8da(0x1b0)](_0xf4c024,_0x14475c);_0x2a2167[_0x41d8da(0x172)]?await writeOutput(_0x2a36ee,_0x2a2167[_0x41d8da(0x172)],'list'):console[_0x41d8da(0x2a7)](_0x2a36ee);}!_0x3d8246&&(console[_0x41d8da(0x2a9)](''),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)](_0x41d8da(0x1a3))),console[_0x41d8da(0x2a9)](a51_0x5af198[_0x41d8da(0x278)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x5af198['dim'](_0x41d8da(0x175))));}else{if(_0xf4c024['length']===0x0){if(_0x3d8246&&_0x131e07)console[_0x41d8da(0x2a7)](_0x41d8da(0x300)+_0x3d8246+'.'+_0x131e07);else _0x3d8246?console[_0x41d8da(0x2a7)](_0x41d8da(0x315)+_0x3d8246):console[_0x41d8da(0x2a7)](_0x41d8da(0x261));}else await this['navigateSessionsInteractive'](_0xf4c024,_0x549501,_0x3d8246);}}return 0x0;}[a51_0x64d48f(0x1b0)](_0x4e70c6,_0x319666){const _0x2a8a79=a51_0x64d48f,_0x592721=[],_0x587ff2=new Map();let _0x36ef4=Infinity,_0x43d89b=-Infinity;for(const _0x509e92 of _0x4e70c6){if(_0x509e92[_0x2a8a79(0x296)]?.[_0x2a8a79(0x2e3)]){const _0x1d21c0=new Date(_0x509e92[_0x2a8a79(0x296)]['createdAt'])['getTime'](),_0x1fe9b0=_0x509e92[_0x2a8a79(0x296)][_0x2a8a79(0x2d5)]?new Date(_0x509e92['lastAttempt'][_0x2a8a79(0x2d5)])['getTime']():Date['now'](),_0xaa5e11=_0x509e92[_0x2a8a79(0x29e)]?.['name']||_0x2a8a79(0x299);!_0x587ff2[_0x2a8a79(0x286)](_0xaa5e11)&&_0x587ff2['set'](_0xaa5e11,[]),_0x587ff2['get'](_0xaa5e11)[_0x2a8a79(0x235)]({'session':_0x509e92,'startTime':_0x1d21c0,'endTime':_0x1fe9b0,'duration':_0x1fe9b0-_0x1d21c0}),_0x36ef4=Math[_0x2a8a79(0x254)](_0x36ef4,_0x1d21c0),_0x43d89b=Math['max'](_0x43d89b,_0x1fe9b0);}}if(_0x587ff2['size']===0x0)return _0x2a8a79(0x1a2);const _0x4b04be=process[_0x2a8a79(0x289)][_0x2a8a79(0x29a)]||0x78,_0x5b4407=0x1e,_0x573c0b=0x32,_0x53cb75=0x4,_0x47d4da=Math['min'](_0x573c0b,Math[_0x2a8a79(0x2d8)](_0x5b4407,Math[_0x2a8a79(0x23b)](_0x4b04be*0.3))),_0x2273fc=_0x4b04be-_0x47d4da-TIMELINE_CONFIG[_0x2a8a79(0x267)]-0x3-_0x53cb75,_0x56e229=_0x43d89b-_0x36ef4,_0x37dd66=_0x56e229/_0x47d4da,_0x308b11=renderTimeAxis({'startTime':_0x36ef4,'endTime':_0x43d89b,'durationMs':_0x56e229,'msPerChar':_0x37dd66},_0x47d4da),_0xd7836a=[];for(const _0x218fe3 of _0x587ff2[_0x2a8a79(0x2fc)]()){_0xd7836a[_0x2a8a79(0x235)](..._0x218fe3);}_0xd7836a[_0x2a8a79(0x19c)]((_0x460b51,_0x1a91ba)=>_0x1a91ba['startTime']-_0x460b51[_0x2a8a79(0x180)]);const _0x16036c=new Date(_0x36ef4),_0x5dd253=formatDate(_0x16036c),_0x5c63c1=_0x53cb75+TIMELINE_CONFIG[_0x2a8a79(0x23c)]+TIMELINE_CONFIG[_0x2a8a79(0x274)]+_0x2273fc,_0x372cb2='\x20'['repeat'](_0x5c63c1-_0x5dd253['length']),_0x3b960f=_0x372cb2+a51_0x5af198[_0x2a8a79(0x278)](_0x5dd253)+'\x20'+_0x308b11;_0x592721[_0x2a8a79(0x235)](_0x3b960f);const _0x13e4a9=0x16;let _0x3cd4de=0x0;for(const _0x39477b of _0xd7836a){const _0x167974=_0x39477b[_0x2a8a79(0x201)][_0x2a8a79(0x29e)]?.[_0x2a8a79(0x246)]||'?',_0x36a4e7=Math[_0x2a8a79(0x254)](stringWidth(_0x167974),_0x13e4a9);_0x3cd4de=Math[_0x2a8a79(0x2d8)](_0x3cd4de,_0x36a4e7);}for(const _0xebf499 of _0xd7836a){const {session:_0xd1ae4,startTime:_0x17db7a,endTime:_0x2f1444,duration:_0x53296a}=_0xebf499,_0x5c5202=_0xd1ae4[_0x2a8a79(0x29e)]?.['id'],_0x55af63=_0xd1ae4['id'],_0x17090e=_0xd1ae4['project']?.[_0x2a8a79(0x246)]||'?',_0x5a6aad=_0xd1ae4[_0x2a8a79(0x237)]?.[_0x2a8a79(0x246)]||'?';let _0x2d1c0b,_0x1b099d;if(_0xd1ae4[_0x2a8a79(0x296)]){const _0xbf6a9a=_0xd1ae4[_0x2a8a79(0x296)];!_0xbf6a9a[_0x2a8a79(0x2bf)]?(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x30b)]?'🛑':'🔄',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x30b)]?a51_0x5af198[_0x2a8a79(0x1f4)]:a51_0x5af198[_0x2a8a79(0x1ef)]):(_0x2d1c0b=_0xbf6a9a[_0x2a8a79(0x27f)]?'✅':'❌',_0x1b099d=_0xbf6a9a[_0x2a8a79(0x27f)]?a51_0x5af198['green']:a51_0x5af198[_0x2a8a79(0x23d)]);}else _0x2d1c0b='⏳',_0x1b099d=a51_0x5af198[_0x2a8a79(0x278)];const _0x364e28='#'+_0x55af63,_0x56db5d=_0x5c5202?hyperlink(_0x364e28,getWorkflowSessionUrl(_0x319666,_0x5c5202,_0x55af63)):_0x364e28;let _0x40ab7d=_0x17090e;stringWidth(_0x17090e)>_0x13e4a9&&(_0x40ab7d=_0x17090e[_0x2a8a79(0x22b)](0x0,_0x13e4a9-0x1)+'…');const _0x1167ac=a51_0x5af198[_0x2a8a79(0x278)](_0x40ab7d),_0x2f285c=stringWidth(_0x40ab7d),_0x3f47f8='\x20'[_0x2a8a79(0x2dc)](_0x3cd4de-stringWidth(_0x40ab7d)+0x2),_0x28127e='('+formatElapsed(_0x53296a)+')',_0x52f0f8=stringWidth(_0x28127e),_0x3b4691=stringWidth(_0x364e28),_0x3d5781=_0x3b4691+0x1+_0x2f285c+_0x3f47f8['length'],_0x3a8d0a=_0x2273fc-_0x3d5781-_0x52f0f8-0x1-0x8;let _0x4f86fa=_0x5a6aad;stringWidth(_0x4f86fa)>_0x3a8d0a&&(_0x4f86fa=_0x4f86fa['slice'](0x0,_0x3a8d0a-0x1)+'…');const _0x578315=_0x56db5d+'\x20'+_0x1167ac+_0x3f47f8+_0x4f86fa,_0x1922b3=stringWidth(_0x578315),_0x36fabb=_0x2273fc-_0x1922b3-_0x52f0f8,_0x1cc456=_0x578315+'\x20'[_0x2a8a79(0x2dc)](Math[_0x2a8a79(0x2d8)](0x1,_0x36fabb))+a51_0x5af198['dim'](_0x28127e),_0x3b865f=Math[_0x2a8a79(0x23b)]((_0x17db7a-_0x36ef4)/_0x37dd66),_0xdbd6a=Math[_0x2a8a79(0x23b)]((_0x2f1444-_0x36ef4)/_0x37dd66),_0x3f5d81=Math['max'](_0x3b865f+0x1,_0xdbd6a),_0xf514ea=new Array(_0x47d4da)[_0x2a8a79(0x184)]('\x20');for(let _0x45ef27=_0x3b865f;_0x45ef27<Math['min'](_0x3f5d81,_0x47d4da);_0x45ef27++){_0xf514ea[_0x45ef27]='─';}const _0x3706e1=_0xf514ea[_0x2a8a79(0x2b9)](_0x238c3b=>_0x238c3b==='\x20'?'\x20':_0x1b099d(_0x238c3b))[_0x2a8a79(0x1eb)]('');_0x592721[_0x2a8a79(0x235)](_0x2d1c0b+'\x20'+_0x1cc456+'│'+_0x3706e1+'│');}return _0x592721[_0x2a8a79(0x1eb)]('\x0a');}async[a51_0x64d48f(0x21a)](_0x273890,_0x8bd827,_0x32b070){const _0x558d72=a51_0x64d48f,{options:_0x4c908e,tdx:_0x409aa}=_0x8bd827,_0x20db77=_0x4c908e[_0x558d72(0x1a4)],{timelineRows:_0x34d10f,timeAxisHeader:_0x2769f3}=this[_0x558d72(0x1ac)](_0x273890,_0x20db77),_0x1aabcc=_0x34d10f[_0x558d72(0x1f7)](_0x563666=>_0x563666[_0x558d72(0x2b1)]);if(_0x1aabcc[_0x558d72(0x1d8)]===0x0){const _0x24bd6b=this[_0x558d72(0x1b0)](_0x273890,_0x20db77);console[_0x558d72(0x2a7)](_0x24bd6b);!_0x32b070&&(console[_0x558d72(0x2a9)](''),console[_0x558d72(0x2a9)](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x1a3))),console['error'](a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x293))+'or'+a51_0x5af198[_0x558d72(0x278)](_0x558d72(0x175))));return;}_0x2769f3&&console['log'](_0x2769f3);const _0x38af77=_0x34d10f[_0x558d72(0x1f7)](_0x38021c=>_0x38021c[_0x558d72(0x2b1)])['map'](_0x51b780=>({'title':_0x51b780[_0x558d72(0x2bb)],'value':_0x51b780['attemptId']})),_0x1a2d9d=process[_0x558d72(0x289)][_0x558d72(0x26b)]||0x3c,_0x360c82=Math[_0x558d72(0x2d8)](0x28,Math[_0x558d72(0x23b)](_0x1a2d9d*0x2/0x3)),_0x45d272=await a51_0x396bfc({'type':'autocomplete','name':'attemptId','message':_0x558d72(0x1d6),'choices':_0x38af77,'initial':-0x1,'limit':_0x360c82,'clearFirst':!![],'fallback':{'title':_0x558d72(0x2df),'value':null},'suggest':(_0x2fafee,_0x31b083)=>{const _0x1d0012=_0x558d72;if(!_0x2fafee)return Promise[_0x1d0012(0x2ac)](_0x31b083);const _0xfad743=_0x31b083['filter'](_0x19dec7=>{const _0x4300a8=_0x1d0012,_0x8357cd=_0x19dec7;return _0x8357cd[_0x4300a8(0x1bf)][_0x4300a8(0x1af)]()[_0x4300a8(0x248)](_0x2fafee[_0x4300a8(0x1af)]());});return Promise[_0x1d0012(0x2ac)](_0xfad743);}}),_0x5f111d=()=>{const _0x5340ef=_0x558d72;process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e)),process[_0x5340ef(0x289)]['write'](_0x5340ef(0x27e));},_0x45a584=_0x45d272&&_0x45d272[_0x558d72(0x2b1)]&&_0x45d272[_0x558d72(0x2b1)]!==null&&_0x45d272[_0x558d72(0x2b1)][_0x558d72(0x26c)]()!=='';if(!_0x45a584){_0x5f111d(),console[_0x558d72(0x2a7)](a51_0x5af198['dim']('Cancelled'));return;}_0x5f111d();const _0x163929=_0x273890[_0x558d72(0x305)](_0x1245bd=>_0x1245bd['lastAttempt']?.['id']===_0x45d272['attemptId']);if(_0x163929){const _0x321e8=_0x163929[_0x558d72(0x29e)]?.[_0x558d72(0x246)]||'?',_0x35d4a7=_0x163929['workflow']?.[_0x558d72(0x246)]||'?';console['log'](_0x558d72(0x198)+a51_0x5af198[_0x558d72(0x278)](_0x321e8)+_0x558d72(0x24a)+a51_0x5af198[_0x558d72(0x278)](_0x35d4a7));}const _0x28eecf=new WorkflowTimelineCommand();await _0x28eecf['execute']({'args':[],'options':{..._0x4c908e,'attemptId':_0x45d272[_0x558d72(0x2b1)]},'tdx':_0x409aa});}[a51_0x64d48f(0x1ac)](_0x46dcc9,_0x343f3f){const _0x5730c5=a51_0x64d48f,_0x3598d7=new Map();for(const _0x3e2806 of _0x46dcc9){_0x3e2806['id']&&_0x3e2806['lastAttempt']?.['id']&&_0x3598d7[_0x5730c5(0x2a0)](_0x3e2806['id'],_0x3e2806[_0x5730c5(0x296)]['id']);}const _0x49be2e=[];let _0x11c06e='';const _0x58ea23=this[_0x5730c5(0x1b0)](_0x46dcc9,_0x343f3f),_0x4ff878=_0x58ea23['split']('\x0a');for(const _0xd7b3e0 of _0x4ff878){if(_0xd7b3e0['startsWith'](_0x5730c5(0x276))||_0xd7b3e0[_0x5730c5(0x20c)](/^\s+\d{4}-\d{2}-\d{2}/))_0x11c06e=_0xd7b3e0;else{if(_0xd7b3e0[_0x5730c5(0x20c)](/^[✅❌🔄🛑⏳]/)){const _0x1409fa=_0xd7b3e0[_0x5730c5(0x20c)](/#(\d+)/),_0x49077d=_0x1409fa?_0x1409fa[0x1]:null,_0x48e31e=_0x49077d?_0x3598d7[_0x5730c5(0x247)](_0x49077d)||null:null,_0x4239bf=_0x46dcc9['find'](_0x8bf2c5=>_0x8bf2c5['id']===_0x49077d),_0x123432=_0x4239bf?.['project']?.['name']||'';_0x49be2e[_0x5730c5(0x235)]({'displayLine':_0xd7b3e0,'attemptId':_0x48e31e,'projectName':_0x123432});}}}return{'timelineRows':_0x49be2e,'timeAxisHeader':_0x11c06e};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1b4);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2fe);async[a51_0x64d48f(0x1fb)](_0x560329){const _0x1b5410=a51_0x64d48f,{options:_0x2acdf0,args:_0x276d49,tdx:_0x26e401}=_0x560329,_0x58cea7=this[_0x1b5410(0x2b6)](_0x276d49,_0x2acdf0);if(!_0x58cea7)return 0x1;const {projectName:_0x4c3407,workflowName:_0x1faa0b}=_0x58cea7,_0x591d67=_0x2acdf0[_0x1b5410(0x1f2)];if(_0x2acdf0[_0x1b5410(0x210)]){if(_0x4c3407&&_0x1faa0b)console[_0x1b5410(0x2a9)](_0x1b5410(0x242)+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407&&console[_0x1b5410(0x2a9)]('Filter:\x20project='+_0x4c3407);_0x591d67&&console[_0x1b5410(0x2a9)](_0x1b5410(0x232));}const _0x3ab4d8=await withSpinner(_0x1b5410(0x268),()=>_0x26e401[_0x1b5410(0x237)][_0x1b5410(0x204)]({'projectName':_0x4c3407,'workflowName':_0x1faa0b,'includeRetried':_0x591d67,'limit':_0x2acdf0[_0x1b5410(0x1c4)]}),{'verbose':_0x2acdf0[_0x1b5410(0x210)]}),_0x3d4618=_0x3ab4d8[_0x1b5410(0x1aa)],_0x1e6c8f=_0x2acdf0[_0x1b5410(0x1c4)]||0x64,_0x44dd26=_0x3d4618[_0x1b5410(0x1d8)]>=_0x1e6c8f?a51_0x5af198[_0x1b5410(0x278)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b5410(0x2a9)]('✔\x20Found\x20'+_0x3d4618['length']+'\x20attempt'+(_0x3d4618['length']!==0x1?'s':'')+_0x44dd26);if(_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x1c1)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x18f)||_0x2acdf0[_0x1b5410(0x227)]===_0x1b5410(0x236))await handleSDKOutput(_0x3d4618,_0x2acdf0);else{if(_0x3d4618[_0x1b5410(0x1d8)]===0x0){if(_0x4c3407&&_0x1faa0b)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x4c3407+'.'+_0x1faa0b);else _0x4c3407?console[_0x1b5410(0x2a7)](_0x1b5410(0x253)+_0x4c3407):console[_0x1b5410(0x2a7)]('No\x20attempts\x20found');}else{const _0x55e19a=_0x2acdf0[_0x1b5410(0x1a4)],_0x3f8cbe=_0x3d4618[_0x1b5410(0x2b9)](_0x4745c9=>{const _0x370607=_0x1b5410,_0x40a357=a51_0x5af198['dim']('#'+_0x4745c9['id']),_0x476f34=_0x4745c9[_0x370607(0x29e)]?.['id'],_0x424517=_0x4745c9['session_id']||_0x4745c9[_0x370607(0x17c)],_0x6301c9=_0x476f34&&_0x424517?hyperlink(_0x40a357,getWorkflowAttemptUrl(_0x55e19a,_0x476f34,_0x424517,_0x4745c9['id'])):_0x40a357,{icon:_0x593ecb,text:_0x5d7c83}=getAttemptStatusDisplay(_0x4745c9),_0x1ce929=(_0x4745c9[_0x370607(0x29e)]?.[_0x370607(0x246)]||'?')+'.'+(_0x4745c9['workflow']?.[_0x370607(0x246)]||'?'),_0x82c5a6=_0x4745c9[_0x370607(0x200)]?a51_0x5af198[_0x370607(0x278)](_0x4745c9[_0x370607(0x200)]):'';return(_0x6301c9+'\x20'+_0x593ecb+(_0x5d7c83?'\x20'+_0x5d7c83:'')+'\x20'+_0x1ce929+'\x20'+_0x82c5a6)[_0x370607(0x24e)]();});await writeOutput(_0x3f8cbe[_0x1b5410(0x1eb)]('\x0a'),_0x2acdf0['output'],_0x1b5410(0x209));}}return 0x0;}}function a51_0x5dbb(){const _0x101345=['fileSize','Error:\x20Invalid\x20parameter\x20format:\x20','\x20has\x20no\x20attempts','join','611930zFBeqx','\x20\x20Changes:\x20','existingProjectId','blue','Key\x20cannot\x20be\x20empty','path','includeRetried','utf-8','yellow','diff','\x20\x20Files\x20extracted:\x20','filter','Listing\x20secrets...','changes','state','execute','getMonth','group_error','cyan','Failed\x20to\x20fetch\x20attempt\x20data','sessionTime','session','fs/promises','\x20session','attempts','isArray','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','MAX_POLL_ITERATIONS','executeCloneProject','list','LABEL_WIDTH_DIVISOR','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','match','fromTask','end','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','verbose','projectName','✔\x20Clone\x20complete','newProjectId','Loading\x20session...','Warning:','yes','\x20\x20Revision:\x20','unknown','workflow:download','navigateSessionsInteractive','Pushing\x20workflow\x20project...','clear','Total:\x20','Listing\x20workflows...','No\x20workflow\x20sessions\x20found','\x0aClone\x20\x22','3Yatgtf','workflow:tasks','run','→\x20New\x20project:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Usage:\x20workflow:delete\x20<project-name-or-id>','format','requireProject','\x20\x20Workflow:\x20','projects','slice','delete','indexOf','workflow:workflows','List\x20workflow\x20execution\x20sessions','📁\x20','...','Include\x20retried:\x20yes','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','push','table','workflow','Attempt:\x20','Downloading\x20project\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','floor','ICON_WIDTH','red','index','revision','Listing\x20workflow\x20sessions...','planned','Filter:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x0aPolling...\x20(','workflow:attempt','name','get','includes','\x20\x20Attempt\x20ID:\x20',',\x20Workflow:\x20','listSecrets','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resume\x20from:\x20','trimEnd','MAX_LABEL_COUNT','\x20\x20Session\x20ID:\x20','Fetching\x20log\x20files...','description','No\x20attempts\x20found\x20in\x20project:\x20','min','isDirectory','applyPullProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','attempt:','logs','running','🔄\x20','\x20\x20Source:\x20','metadata','Source\x20directory:\x20','resolveProjectId','\x20new','No\x20sessions\x20found','context','basename','workflow:kill','Task\x20name:\x20','projectId','GUTTER','Listing\x20workflow\x20attempts...','Updating\x20','\x20modified','rows','trim','\x20\x20Console:\x20','Pattern:\x20','7623816pFAUmO','splice','targetDir','\x0aApply\x20these\x20changes?','\x20to\x20see\x20detailed\x20logs','ICON_SPACING','Including\x20subtasks:\x20yes','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','renderSingleTimeline','dim','\x0aError:','modified','-\x20no\x20files\x20written','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x1b[1A\x1b[2K','success','tdx\x20wf\x20attempt\x20','MAX_TIMELINE_WIDTH','download','split','showWorkflowConsoleUrl','No\x20workflows\x20found','has','preparePushProject','text','stdout','pullProject','Using\x20attempt\x20','Files\x20to\x20upload:\x20','✔\x20Found\x20','Session\x20','Revision:\x20','dryRun','keys','\x0aUpdate\x20existing\x20project\x20\x22','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Workflow\x20project\x20context\x20cleared.','isTTY','lastAttempt','MIN_LABEL_COUNT','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','(unknown)','columns','fileCount','Kill\x20a\x20running\x20attempt','Setting\x20secret...','project','Output\x20directory:\x20','set','Project\x20filter:\x20','parse','Show\x20tasks\x20for\x20an\x20attempt','\x22\x20already\x20exists\x20(ID:\x20','tdx.json','\x20\x20New\x20attempt\x20ID:\x20','log','msPerChar','error','follow','\x20\x20Project\x20ID:\x20','resolve','renderTimeline','\x20\x20Session\x20context\x20set\x20to:\x20','readFile','\x20from\x20session\x20','attemptId','Retrying\x20attempt...','MAX_TASKS_DISPLAY','pollTimeline','198bPhDPo','parseProjectWorkflowPattern','workflow:secrets:set','MIN_TIMELINE_WIDTH','map','\x22\x20with\x20new\x20revision?','displayLine','substring','getTime','key','done','workflow:pull','sys','\x0a✔\x20Attempt\x20complete','resumeFrom','select','POLL_INTERVAL_MS','toISOString','now','Dry\x20run:\x20yes','Cloning\x20to\x20','Params:\x20','workflow:logs','sourceProjectName','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','buildTimelineData','sessions','✔\x20Downloaded\x20','Expected\x20format:\x20--param\x20key=value','Deleting\x20secret...','Source:\x20','finishedAt','Filter:\x20project=','param','max','✔\x20Project\x20updated','skipValidation','session:','repeat','Show\x20specific\x20attempt\x20details','startsWith','No\x20matching\x20sessions\x20found','\x20deleted','retryAttemptName','\x0a✔\x20Already\x20up\x20to\x20date','createdAt','12268DKjqmk','✔\x20Pull\x20complete','Error:\x20Project\x20name\x20is\x20required','\x20(use\x20--limit\x20to\x20show\x20more)','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','value','\x0aDry\x20run\x20-\x20no\x20project\x20created','/attempt/','pending','Analyzing\x20changes...','every','green','setSecrets','status','workflow:use','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getDate','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','✔\x20Deleted\x20project\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','TASK_NAME_WIDTH','3021333cNYKEm','localeCompare','Loading\x20workflows...','values','taskName','List\x20workflow\x20attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20sessions\x20found\x20for:\x20','\x27...','hasChanges','Killing\x20attempt...','Select\x20a\x20task\x20to\x20view\x20logs:','find','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','workflowProject','Source\x20directory\x20is\x20required','Setting\x20','workflow:secrets:delete','cancelRequested','sourceDir','task','\x20logs','LABEL_MIN_SPACING','\x27\x20from\x20project\x20\x27','getMinutes','\x20unchanged','⚠\x20Showing\x20first\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20sessions\x20found\x20in\x20project:\x20','padStart','Latest\x20session\x20has\x20no\x20attempt','params','Attempt\x20ID:\x20','output','workflows','kill','\x20\x20tdx\x20wf\x20use\x20<project>','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','summary','start','\x0aDry\x20run\x20-\x20nothing\x20pushed','Analyzing\x20project...','\x20\x20Project:\x20','sessionId','Status:\x20','resolveProjectDir','Error:\x20Attempt\x20ID\x20is\x20required','startTime','new','Project\x20name\x20is\x20required','Target\x20directory:\x20','fill','✔\x20Workflow\x20run\x20started','duration','✔\x20Pushed\x20','canceling','revision:\x20','Error:\x20Secret\x20key\x20is\x20required','List\x20workflows','Error:','\x20secrets...','815218ExEaeu','jsonl','getHours','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','getFullYear','\x20-\x20','fullName','2296064SXheJM','prepareCloneProject','from','Project:\x20','Project\x20name:\x20','newProjectName','deleted','sort','✔\x20Project:\x20','relative','Auto-selected\x20latest\x20session:\x20','window','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','No\x20sessions\x20with\x20timing\x20information','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','site','Workflow:\x20','message','workflow:projects','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Getting\x20attempt\x20tasks...','data','cwd','generateSessionTimelineRows','workflow:run','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','toLowerCase','renderSessionsTimeline','(use\x20--limit\x20to\x20see\x20more)','retrySession','Source\x20project:\x20','workflow:attempts','No\x20log\x20content\x20found','✔\x20Secret\x20\x27','Key:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Showing\x20','attempt','workflow:retry','\x20workflow','Tip:\x20cd\x20to\x20workflows/','2616654gyMawE','title','startedAt','json','\x0a⚠\x20Project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','limit','includeSubtasks','Validation:\x20skipped','1055xkYDOJ','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','targetExists','updatedAt','Getting\x20attempt\x20details...','Error:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Cancelled','all','\x20\x20Location:\x20','some','\x0a✔\x20No\x20changes\x20to\x20push','executePushProject','New\x20project\x20name:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','force','length','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','round','/app/workflows/','Session\x20not\x20found:\x20','No\x20workflow\x20tdx.json\x20found','💡\x20Tip:\x20Use\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Retrying\x20session...','\x22\x20to\x20new\x20project\x20\x22','Target:\x20','Start\x20a\x20workflow\x20run','No\x20projects\x20match\x20pattern:\x20','resolveProject','---\x20'];a51_0x5dbb=function(){return _0x101345;};return a51_0x5dbb();}export class WorkflowAttemptCommand extends BaseCommand{['name']=a51_0x64d48f(0x245);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2dd);async[a51_0x64d48f(0x1fb)](_0x3c4f91){const _0x49be43=a51_0x64d48f,{options:_0x23db0f,args:_0x11a0bb,tdx:_0x116106}=_0x3c4f91,_0x45abf2=_0x11a0bb[0x0];if(!_0x45abf2)return console[_0x49be43(0x2a9)](_0x49be43(0x17f)),0x1;_0x23db0f['verbose']&&console[_0x49be43(0x2a9)](_0x49be43(0x171)+_0x45abf2);const _0xcd5df2=await withSpinner(_0x49be43(0x1cb),()=>_0x116106[_0x49be43(0x237)][_0x49be43(0x1ba)](_0x45abf2),{'verbose':_0x23db0f[_0x49be43(0x210)]}),_0x333d00=_0xcd5df2[_0x49be43(0x1aa)];let _0x1d282c;!_0x333d00[_0x49be43(0x2bf)]?_0x1d282c=_0x333d00['cancelRequested']?_0x49be43(0x188):_0x49be43(0x25a):_0x1d282c=_0x333d00['success']?_0x49be43(0x27f):_0x49be43(0x2a9);let _0x124514;if(_0x333d00[_0x49be43(0x2e3)]&&_0x333d00[_0x49be43(0x2d5)]){const _0x1b3e24=new Date(_0x333d00[_0x49be43(0x2e3)])[_0x49be43(0x2bd)](),_0x2e99b5=new Date(_0x333d00[_0x49be43(0x2d5)])[_0x49be43(0x2bd)]();_0x124514=Math[_0x49be43(0x1db)]((_0x2e99b5-_0x1b3e24)/0x3e8);}const _0x139656={'attempt_id':_0x333d00['id'],'status':_0x1d282c,..._0x333d00[_0x49be43(0x23e)]!==undefined&&{'index':_0x333d00[_0x49be43(0x23e)]},..._0x333d00[_0x49be43(0x29e)]&&{'project':_0x333d00['project'][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x237)]&&{'workflow':_0x333d00[_0x49be43(0x237)][_0x49be43(0x246)]},..._0x333d00[_0x49be43(0x17c)]&&{'session_id':_0x333d00[_0x49be43(0x17c)]},..._0x333d00[_0x49be43(0x200)]&&{'session_time':_0x333d00['sessionTime']},..._0x333d00[_0x49be43(0x2e1)]&&{'retry_attempt':_0x333d00['retryAttemptName']},..._0x124514!==undefined&&{'duration_sec':_0x124514},..._0x333d00[_0x49be43(0x2e3)]&&{'created_at':_0x333d00['createdAt']},..._0x333d00[_0x49be43(0x2d5)]&&{'finished_at':_0x333d00[_0x49be43(0x2d5)]},...Object[_0x49be43(0x291)](_0x333d00[_0x49be43(0x170)])['length']>0x0&&{'params':_0x333d00[_0x49be43(0x170)]}};return await handleSingleObjectOutput(_0x139656,_0x23db0f),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x222);['description']=a51_0x64d48f(0x2a3);async[a51_0x64d48f(0x1fb)](_0x5039c1){const _0x1dc2cb=a51_0x64d48f,{options:_0x3db338,args:_0x374e79,tdx:_0x5bd11f}=_0x5039c1,_0xe924d8=_0x374e79[0x0];if(!_0xe924d8)return console['error'](_0x1dc2cb(0x17f)),0x1;const _0x5a866f=_0x3db338[_0x1dc2cb(0x1c5)];_0x3db338['verbose']&&(console[_0x1dc2cb(0x2a9)]('Attempt\x20ID:\x20'+_0xe924d8),_0x5a866f&&console[_0x1dc2cb(0x2a9)](_0x1dc2cb(0x275)));const _0x42723d=await withSpinner(_0x1dc2cb(0x1a9),()=>_0x5bd11f[_0x1dc2cb(0x237)]['tasks'](_0xe924d8,_0x5a866f||![]),{'verbose':_0x3db338[_0x1dc2cb(0x210)]}),_0xa7bba=_0x42723d['data'];return console['error'](_0x1dc2cb(0x28d)+_0xa7bba[_0x1dc2cb(0x1d8)]+'\x20task'+(_0xa7bba[_0x1dc2cb(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0xa7bba,_0x3db338),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a51_0x64d48f(0x2cb);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2cd);async[a51_0x64d48f(0x1fb)](_0x18fa4f){const _0x585928=a51_0x64d48f,{options:_0x338854,args:_0x4213b8,tdx:_0x951695}=_0x18fa4f,_0x5a3143=_0x4213b8[0x0];let _0xccc752=_0x4213b8[0x1];if(!_0x5a3143)return console['error'](_0x585928(0x17f)),0x1;_0x338854[_0x585928(0x210)]&&(console[_0x585928(0x2a9)](_0x585928(0x171)+_0x5a3143),_0xccc752&&console[_0x585928(0x2a9)](_0x585928(0x265)+_0xccc752));const _0x557141=await withSpinner(_0x585928(0x251),()=>_0x951695[_0x585928(0x237)]['logFiles'](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x37c937=_0x557141[_0x585928(0x1aa)];if(_0x37c937[_0x585928(0x1d8)]===0x0)return console[_0x585928(0x2a9)](_0x585928(0x24c)),0x0;if(!_0xccc752&&(_0x338854[_0x585928(0x1c1)]||_0x338854[_0x585928(0x227)]))return await handleSDKOutput(_0x37c937,_0x338854),0x0;if(!_0xccc752){const _0x12577b=_0x37c937['map'](_0x27e44d=>({'title':_0x27e44d['taskName']+'\x20('+formatBytes(_0x27e44d[_0x585928(0x1e8)])+')','value':_0x27e44d[_0x585928(0x2fd)]})),_0x31cb3c=await a51_0x396bfc({'type':_0x585928(0x2c4),'name':'task','message':_0x585928(0x304),'choices':_0x12577b});if(!_0x31cb3c[_0x585928(0x30d)])return console[_0x585928(0x2a9)](_0x585928(0x1cf)),0x0;_0xccc752=_0x31cb3c[_0x585928(0x30d)];}const _0x47bb7b=await withSpinner('Downloading\x20logs...',()=>_0x951695['workflow'][_0x585928(0x259)](_0x5a3143,_0xccc752),{'verbose':_0x338854[_0x585928(0x210)]}),_0x4d6dbb=_0x47bb7b[_0x585928(0x1aa)];return _0x4d6dbb?console[_0x585928(0x2a7)](_0x4d6dbb):console['error'](_0x585928(0x1b5)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x264);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x29c);async[a51_0x64d48f(0x1fb)](_0x442731){const _0x264cec=a51_0x64d48f,{options:_0x1ed680,args:_0x489cf6,tdx:_0x4fb182}=_0x442731,_0x3e8a43=_0x489cf6[0x0];if(!_0x3e8a43)return console[_0x264cec(0x2a9)](_0x264cec(0x17f)),0x1;const _0x359c62=_0x1ed680['reason'];_0x1ed680[_0x264cec(0x210)]&&(console['error']('Attempt\x20ID:\x20'+_0x3e8a43),_0x359c62&&console[_0x264cec(0x2a9)]('Reason:\x20'+_0x359c62));if(!_0x1ed680[_0x264cec(0x216)]){if(!isInteractive())return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x23d)](_0x264cec(0x279)),_0x264cec(0x257)),console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x278)](_0x264cec(0x2f3))),0x1;const _0x659c2c=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3e8a43+'?');if(!_0x659c2c)return console[_0x264cec(0x2a9)](a51_0x5af198[_0x264cec(0x1f4)](_0x264cec(0x1cf))),0x1;}const _0x5af2e2=await withSpinner(_0x264cec(0x303),()=>_0x4fb182['workflow'][_0x264cec(0x174)](_0x3e8a43,_0x359c62),{'verbose':_0x1ed680[_0x264cec(0x210)]}),_0x1fd97e=_0x5af2e2['data'];return console[_0x264cec(0x2a9)]('✔\x20'+_0x1fd97e),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x1bb);[a51_0x64d48f(0x252)]='Retry\x20a\x20session\x20or\x20attempt';async[a51_0x64d48f(0x1fb)](_0x132ad1){const _0x175c81=a51_0x64d48f,{options:_0x165d3a,args:_0x296050,tdx:_0x5eae28}=_0x132ad1,_0x4059d4=_0x296050[0x0];if(!_0x4059d4)return console[_0x175c81(0x2a9)](_0x175c81(0x2f7)),console[_0x175c81(0x2a9)](_0x175c81(0x191)),0x1;let _0x2d4d95=![],_0x451f2b=_0x4059d4;if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x2db)))_0x2d4d95=!![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else{if(_0x4059d4[_0x175c81(0x2de)](_0x175c81(0x258)))_0x2d4d95=![],_0x451f2b=_0x4059d4[_0x175c81(0x2bc)](0x8);else return console[_0x175c81(0x2a9)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x175c81(0x191)),0x1;}const _0x443e13=_0x165d3a[_0x175c81(0x20d)],_0x45e859=_0x165d3a[_0x175c81(0x2c3)],_0x480d4b=_0x165d3a['params'],_0x377e56=_0x165d3a[_0x175c81(0x1d7)];_0x165d3a['verbose']&&(console[_0x175c81(0x2a9)](_0x175c81(0x1e3)+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b),_0x443e13&&console[_0x175c81(0x2a9)]('From\x20task:\x20'+_0x443e13),_0x45e859&&console[_0x175c81(0x2a9)](_0x175c81(0x24d)+_0x45e859),_0x480d4b&&console[_0x175c81(0x2a9)](_0x175c81(0x2ca)+_0x480d4b),_0x377e56&&console[_0x175c81(0x2a9)]('Force:\x20yes'));let _0x2e7503;if(_0x480d4b)try{if(_0x480d4b[_0x175c81(0x2de)]('@')){const _0x188fc4=await import(_0x175c81(0x202)),_0x277ef7=_0x480d4b[_0x175c81(0x2bc)](0x1),_0x165918=await _0x188fc4[_0x175c81(0x2af)](_0x277ef7,_0x175c81(0x1f3));_0x2e7503=JSON[_0x175c81(0x2a2)](_0x165918);}else _0x2e7503=JSON['parse'](_0x480d4b);}catch{return console[_0x175c81(0x2a9)](_0x175c81(0x314)),0x1;}if(!_0x165d3a[_0x175c81(0x216)]){if(!isInteractive())return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x23d)](_0x175c81(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x175c81(0x2a9)](a51_0x5af198['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3c4e96=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x2d4d95?_0x175c81(0x201):_0x175c81(0x1ba))+'\x20'+_0x451f2b+'?');if(!_0x3c4e96)return console[_0x175c81(0x2a9)](a51_0x5af198[_0x175c81(0x1f4)](_0x175c81(0x1cf))),0x1;}let _0x5624c3;_0x2d4d95?_0x5624c3=await withSpinner(_0x175c81(0x1e1),()=>_0x5eae28[_0x175c81(0x237)][_0x175c81(0x1b2)](_0x451f2b,{'fromTask':_0x443e13,'retryParams':_0x2e7503}),{'verbose':_0x165d3a['verbose']}):_0x5624c3=await withSpinner(_0x175c81(0x2b2),()=>_0x5eae28[_0x175c81(0x237)]['retryAttempt'](_0x451f2b,{'resumeFrom':_0x45e859,'retryParams':_0x2e7503,'force':_0x377e56}),{'verbose':_0x165d3a[_0x175c81(0x210)]});const _0x185255=_0x5624c3[_0x175c81(0x1aa)];return console[_0x175c81(0x2a9)]('✔\x20Retry\x20started'),console[_0x175c81(0x2a9)](_0x175c81(0x2a6)+_0x185255[_0x175c81(0x2b1)]),console[_0x175c81(0x2a9)](_0x175c81(0x250)+_0x185255[_0x175c81(0x17c)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a51_0x64d48f(0x1ad);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1e4);async['execute'](_0xbb1981){const _0x3b0f77=a51_0x64d48f,{options:_0x21477e,args:_0x2534d0,tdx:_0x1a6219}=_0xbb1981;let _0x551019=_0x2534d0[0x0];if(!_0x551019){const _0x1bde3d=this[_0x3b0f77(0x1e6)]([],_0x21477e),_0x536ec6=await withSpinner(_0x3b0f77(0x2fb),()=>_0x1a6219[_0x3b0f77(0x237)][_0x3b0f77(0x173)](_0x1bde3d,{'limit':_0x21477e[_0x3b0f77(0x1c4)]}),{'verbose':_0x21477e['verbose']}),_0x24e585=_0x536ec6[_0x3b0f77(0x1aa)];if(_0x24e585[_0x3b0f77(0x1d8)]===0x0)return console[_0x3b0f77(0x2a9)]('No\x20workflows\x20found'),!_0x1bde3d&&console[_0x3b0f77(0x2a9)](a51_0x5af198['dim'](_0x3b0f77(0x206))),0x1;const _0x5eab6b=_0x24e585[_0x3b0f77(0x2b9)](_0x17d350=>({'title':_0x17d350[_0x3b0f77(0x29e)]?.[_0x3b0f77(0x246)]+'.'+_0x17d350[_0x3b0f77(0x246)],'value':_0x17d350[_0x3b0f77(0x29e)]?.['name']+'.'+_0x17d350[_0x3b0f77(0x246)],'description':_0x17d350[_0x3b0f77(0x23f)]?_0x3b0f77(0x189)+_0x17d350['revision']:undefined})),_0x149cc4=await a51_0x396bfc({'type':'select','name':'workflow','message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x5eab6b});if(!_0x149cc4[_0x3b0f77(0x237)])return 0x1;_0x551019=_0x149cc4[_0x3b0f77(0x237)];}if(!_0x551019[_0x3b0f77(0x248)]('.')){const _0x1d0b86=this[_0x3b0f77(0x1e6)]([],_0x21477e);if(_0x1d0b86)_0x551019=_0x1d0b86+'.'+_0x551019;else return console['error'](a51_0x5af198[_0x3b0f77(0x23d)](_0x3b0f77(0x18c)),_0x3b0f77(0x23a)),console['error'](a51_0x5af198[_0x3b0f77(0x278)](_0x3b0f77(0x206))),0x1;}const _0x3a3e2c=_0x21477e[_0x3b0f77(0x2d7)],_0x53970d=_0x21477e[_0x3b0f77(0x200)],_0x58b46d={};if(_0x3a3e2c&&Array[_0x3b0f77(0x205)](_0x3a3e2c))for(const _0x42ad72 of _0x3a3e2c){const _0x2377c1=_0x42ad72[_0x3b0f77(0x22d)]('=');if(_0x2377c1===-0x1)return console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1e9)+_0x42ad72),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x2d2)),0x1;const _0x43bd8e=_0x42ad72[_0x3b0f77(0x2bc)](0x0,_0x2377c1),_0x5c7d7b=_0x42ad72[_0x3b0f77(0x2bc)](_0x2377c1+0x1);try{_0x58b46d[_0x43bd8e]=JSON[_0x3b0f77(0x2a2)](_0x5c7d7b);}catch{_0x58b46d[_0x43bd8e]=_0x5c7d7b;}}_0x21477e[_0x3b0f77(0x210)]&&(console[_0x3b0f77(0x2a9)](_0x3b0f77(0x1a5)+_0x551019),Object[_0x3b0f77(0x291)](_0x58b46d)[_0x3b0f77(0x1d8)]>0x0&&console['error']('Parameters:\x20'+JSON['stringify'](_0x58b46d)),_0x53970d&&console[_0x3b0f77(0x2a9)]('Session\x20time:\x20'+_0x53970d));const _0x377bb9=await withSpinner('Starting\x20workflow\x20run...',()=>_0x1a6219['workflow'][_0x3b0f77(0x223)](_0x551019,_0x58b46d,{'sessionTime':_0x53970d}),{'verbose':_0x21477e[_0x3b0f77(0x210)]}),_0x197834=_0x377bb9[_0x3b0f77(0x1aa)];console['error'](_0x3b0f77(0x185)),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x249)+_0x197834['id']),console[_0x3b0f77(0x2a9)]('\x20\x20Session\x20ID:\x20'+_0x197834[_0x3b0f77(0x17c)]),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x17b)+_0x197834[_0x3b0f77(0x29e)]?.['name']),console[_0x3b0f77(0x2a9)](_0x3b0f77(0x229)+_0x197834[_0x3b0f77(0x237)]?.[_0x3b0f77(0x246)]);if(_0x197834[_0x3b0f77(0x29e)]?.['id']&&_0x197834[_0x3b0f77(0x17c)]&&_0x197834['id']){const _0x205cf3=_0x21477e[_0x3b0f77(0x1a4)],_0x4e54ce=getConsoleUrl(_0x205cf3,_0x3b0f77(0x1dc)+_0x197834[_0x3b0f77(0x29e)]['id']+'/sessions/'+_0x197834['sessionId']+_0x3b0f77(0x2eb)+_0x197834['id']);console[_0x3b0f77(0x2a9)](_0x3b0f77(0x26d)+a51_0x5af198[_0x3b0f77(0x1fe)](_0x4e54ce));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x219);['description']=a51_0x64d48f(0x1da);async[a51_0x64d48f(0x1fb)](_0x510bd9){const _0x25cda1=a51_0x64d48f,{options:_0x33ffdc,args:_0x5935ab,tdx:_0x3927af}=_0x510bd9,_0x3ce454=_0x5935ab[0x0],_0x3539ae=_0x5935ab[0x1]||'.';if(!_0x3ce454)return console['error'](_0x25cda1(0x2e6)),console[_0x25cda1(0x2a9)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x119f61=_0x33ffdc[_0x25cda1(0x23f)];_0x33ffdc[_0x25cda1(0x210)]&&(console[_0x25cda1(0x2a9)]('Project:\x20'+_0x3ce454),console[_0x25cda1(0x2a9)](_0x25cda1(0x29f)+_0x3539ae),_0x119f61&&console[_0x25cda1(0x2a9)](_0x25cda1(0x28f)+_0x119f61));const _0x44d46d=await withSpinner(_0x25cda1(0x239)+_0x3ce454+_0x25cda1(0x231),()=>_0x3927af[_0x25cda1(0x237)][_0x25cda1(0x282)](_0x3ce454,_0x3539ae,{'revision':_0x119f61}),{'verbose':_0x33ffdc['verbose']}),_0xc0e6ec=_0x44d46d[_0x25cda1(0x1aa)];return console[_0x25cda1(0x2a9)](_0x25cda1(0x2d1)+_0xc0e6ec[_0x25cda1(0x211)]),console['error'](_0x25cda1(0x217)+_0xc0e6ec[_0x25cda1(0x23f)]),console['error'](_0x25cda1(0x1f6)+_0xc0e6ec['filesExtracted']),console['error'](_0x25cda1(0x1d1)+_0x3539ae+'/'+_0xc0e6ec[_0x25cda1(0x211)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:upload';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1cd);async['execute'](_0x5cd949){const _0x22922f=a51_0x64d48f,{options:_0xe359c1,args:_0x215db2,tdx:_0x383d10}=_0x5cd949;let _0x14ba1d='.',_0x6c2e13=_0xe359c1[_0x22922f(0x246)];if(_0x215db2[0x0]){const {promises:_0x2e78bd}=await import('fs');try{const _0x373aaf=await _0x2e78bd['stat'](_0x215db2[0x0]);if(_0x373aaf[_0x22922f(0x255)]())_0x14ba1d=_0x215db2[0x0];else return console[_0x22922f(0x2a9)](_0x22922f(0x1cc)+_0x215db2[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x6c2e13=_0x215db2[0x0],_0x14ba1d='.';}}const _0x8d9743=_0xe359c1[_0x22922f(0x23f)],_0x1cb16e=_0xe359c1[_0x22922f(0x2da)];_0xe359c1['verbose']&&(console[_0x22922f(0x2a9)]('Project\x20directory:\x20'+_0x14ba1d),_0x6c2e13&&console[_0x22922f(0x2a9)](_0x22922f(0x199)+_0x6c2e13),_0x8d9743&&console['error']('Revision:\x20'+_0x8d9743),_0x1cb16e&&console[_0x22922f(0x2a9)](_0x22922f(0x1c6)));const _0x5f0a12=await withSpinner(_0x22922f(0x21b),()=>_0x383d10[_0x22922f(0x237)]['push'](_0x14ba1d,{'projectName':_0x6c2e13,'revision':_0x8d9743,'skipValidation':_0x1cb16e}),{'verbose':_0xe359c1['verbose']}),_0xbacc73=_0x5f0a12[_0x22922f(0x1aa)];return console[_0x22922f(0x2a9)](_0x22922f(0x187)+_0xbacc73[_0x22922f(0x211)]),console[_0x22922f(0x2a9)](_0x22922f(0x2ab)+_0xbacc73[_0x22922f(0x266)]),console['error'](_0x22922f(0x217)+_0xbacc73[_0x22922f(0x23f)]),await this[_0x22922f(0x284)](_0x383d10,_0xbacc73[_0x22922f(0x211)],_0xe359c1[_0x22922f(0x1a4)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2c0);[a51_0x64d48f(0x252)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x4833a7){const _0x4dbc06=a51_0x64d48f,{options:_0x4e070b,args:_0x3412fe,tdx:_0x47c6da}=_0x4833a7,_0x1f6f58=_0x3412fe[0x0],_0x35f535=_0x3412fe[0x1];if(!_0x1f6f58)return console['error'](a51_0x5af198[_0x4dbc06(0x23d)](_0x4dbc06(0x18c)),'Project\x20name\x20is\x20required'),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x298))),0x1;const _0x2fc5a8=_0x4e070b[_0x4dbc06(0x23f)];_0x4e070b[_0x4dbc06(0x210)]&&(console[_0x4dbc06(0x2a9)](_0x4dbc06(0x198)+_0x1f6f58),_0x35f535&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x183)+_0x35f535),_0x2fc5a8&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x28f)+_0x2fc5a8),_0x4e070b[_0x4dbc06(0x290)]&&console[_0x4dbc06(0x2a9)](_0x4dbc06(0x2c8)));const _0x5e0f2a=await withSpinner('Pulling\x20project\x20'+_0x1f6f58+_0x4dbc06(0x231),()=>_0x47c6da['workflow'][_0x4dbc06(0x28a)](_0x1f6f58,{'targetDir':_0x35f535,'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),_0x2d5382=_0x5e0f2a[_0x4dbc06(0x1aa)];_0x2d5382['isNewProject']?console['error'](_0x4dbc06(0x224)+_0x2d5382[_0x4dbc06(0x211)]):console[_0x4dbc06(0x2a9)]('→\x20Project:\x20'+_0x2d5382[_0x4dbc06(0x211)]);console[_0x4dbc06(0x2a9)](_0x4dbc06(0x217)+_0x2d5382[_0x4dbc06(0x23f)]),console[_0x4dbc06(0x2a9)]('\x20\x20Target:\x20'+(a51_0x2409f9[_0x4dbc06(0x19e)](process[_0x4dbc06(0x1ab)](),_0x2d5382[_0x4dbc06(0x271)])||'.')),console[_0x4dbc06(0x2a9)]('\x20\x20Changes:\x20'+a51_0x5af198['green']('+'+_0x2d5382[_0x4dbc06(0x177)][_0x4dbc06(0x181)]+_0x4dbc06(0x260))+',\x20'+(a51_0x5af198['yellow']('~'+_0x2d5382['summary']['modified']+_0x4dbc06(0x26a))+',\x20')+(a51_0x5af198[_0x4dbc06(0x23d)]('-'+_0x2d5382['summary'][_0x4dbc06(0x19b)]+_0x4dbc06(0x2e0))+',\x20')+(''+a51_0x5af198['dim'](_0x2d5382[_0x4dbc06(0x177)]['unchanged']+_0x4dbc06(0x312))));for(const _0x2f10f5 of _0x2d5382['changes']){_0x2f10f5['type']===_0x4dbc06(0x27a)&&_0x2f10f5[_0x4dbc06(0x1f5)]&&(console['error']('\x0a'+a51_0x5af198[_0x4dbc06(0x1fe)](_0x4dbc06(0x1e7)+_0x2f10f5[_0x4dbc06(0x1f1)])),console[_0x4dbc06(0x2a9)](_0x2f10f5[_0x4dbc06(0x1f5)]));}if(!_0x2d5382['hasChanges'])return saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console['error'](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e2))),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x2d5382[_0x4dbc06(0x211)])),0x0;if(_0x4e070b[_0x4dbc06(0x290)])return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x4e070b['yes']){if(!isInteractive())return console[_0x4dbc06(0x2a9)](a51_0x5af198['red'](_0x4dbc06(0x279)),_0x4dbc06(0x257)),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x2f3))),0x1;const _0x499aca=await confirmKey(_0x4dbc06(0x272));if(!_0x499aca)return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x1f4)](_0x4dbc06(0x1cf)),_0x4dbc06(0x27b)),0x1;}await withSpinner('Writing\x20files...',()=>_0x47c6da[_0x4dbc06(0x237)][_0x4dbc06(0x256)](_0x2d5382,{'revision':_0x2fc5a8}),{'verbose':_0x4e070b[_0x4dbc06(0x210)]}),saveSessionContext({'workflow_project':_0x2d5382[_0x4dbc06(0x211)]},_0x4e070b[_0x4dbc06(0x201)]),console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x2ef)](_0x4dbc06(0x2e5)));const _0x37e743=a51_0x2409f9['relative'](process['cwd'](),_0x2d5382['targetDir'])||'.';return console[_0x4dbc06(0x2a9)](a51_0x5af198[_0x4dbc06(0x278)](_0x4dbc06(0x1d1)+_0x37e743)),console[_0x4dbc06(0x2a9)](a51_0x5af198['dim'](_0x4dbc06(0x2ae)+_0x2d5382[_0x4dbc06(0x211)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:push';[a51_0x64d48f(0x252)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0x1c2af7){const _0x28fe7=a51_0x64d48f,{options:_0x1617be,args:_0x136267,tdx:_0x554aeb}=_0x1c2af7,_0x53a914=this[_0x28fe7(0x17e)](_0x136267,_0x1617be),_0x56e871=_0x1617be[_0x28fe7(0x23f)],_0x5b8247=_0x1617be[_0x28fe7(0x2da)];_0x1617be['verbose']&&(_0x53a914&&console[_0x28fe7(0x2a9)]('Source\x20directory:\x20'+_0x53a914),_0x56e871&&console[_0x28fe7(0x2a9)](_0x28fe7(0x28f)+_0x56e871),_0x1617be[_0x28fe7(0x290)]&&console['error'](_0x28fe7(0x2c8)),_0x5b8247&&console['error'](_0x28fe7(0x1c6)));let _0x5c3626;try{_0x5c3626=await withSpinner(_0x28fe7(0x2ed),()=>_0x554aeb['workflow'][_0x28fe7(0x287)]({'sourceDir':_0x53a914,'revision':_0x56e871,'skipValidation':_0x5b8247}),{'verbose':_0x1617be[_0x28fe7(0x210)]});}catch(_0x1acdcd){if(_0x1acdcd instanceof Error&&_0x1acdcd[_0x28fe7(0x1a6)][_0x28fe7(0x248)](_0x28fe7(0x1de)))return console['error'](a51_0x5af198['red'](_0x28fe7(0x18c)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x1617be[_0x28fe7(0x307)]?console['error'](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1bd)+_0x1617be[_0x28fe7(0x307)]+_0x28fe7(0x20b)+_0x1617be[_0x28fe7(0x307)]+'\x27')):console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x1a8))),0x1;throw _0x1acdcd;}const _0x3917c1=_0x5c3626[_0x28fe7(0x1aa)];console['error'](_0x28fe7(0x19d)+_0x3917c1['projectName']),console[_0x28fe7(0x2a9)](_0x28fe7(0x25c)+_0x3917c1[_0x28fe7(0x30c)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3917c1[_0x28fe7(0x23f)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x1ed)+a51_0x5af198['green']('+'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x181)]+_0x28fe7(0x260))+',\x20'+(a51_0x5af198[_0x28fe7(0x1f4)]('~'+_0x3917c1['summary'][_0x28fe7(0x27a)]+_0x28fe7(0x26a))+',\x20')+(a51_0x5af198[_0x28fe7(0x23d)]('-'+_0x3917c1[_0x28fe7(0x177)][_0x28fe7(0x19b)]+_0x28fe7(0x2e0))+',\x20')+(''+a51_0x5af198[_0x28fe7(0x278)](_0x3917c1[_0x28fe7(0x177)]['unchanged']+_0x28fe7(0x312))));for(const _0x2fd1a8 of _0x3917c1[_0x28fe7(0x1f9)]){_0x2fd1a8['type']===_0x28fe7(0x27a)&&_0x2fd1a8[_0x28fe7(0x1f5)]&&(console[_0x28fe7(0x2a9)]('\x0a'+a51_0x5af198[_0x28fe7(0x1fe)](_0x28fe7(0x1e7)+_0x2fd1a8[_0x28fe7(0x1f1)])),console['error'](_0x2fd1a8[_0x28fe7(0x1f5)]));}if(!_0x3917c1[_0x28fe7(0x302)])return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)](_0x28fe7(0x1d3))),await this[_0x28fe7(0x284)](_0x554aeb,_0x3917c1['projectName'],_0x1617be['site']),0x0;if(_0x1617be[_0x28fe7(0x290)])return console[_0x28fe7(0x2a9)](a51_0x5af198['yellow'](_0x28fe7(0x179))),0x0;if(!_0x1617be[_0x28fe7(0x216)]){if(!isInteractive())return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x23d)](_0x28fe7(0x279)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x278)](_0x28fe7(0x2f3))),0x1;const _0x2a66f0=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2a66f0)return console['error'](a51_0x5af198[_0x28fe7(0x1f4)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const _0x2001b2=await withSpinner('Pushing\x20project...',()=>_0x554aeb[_0x28fe7(0x237)][_0x28fe7(0x1d4)](_0x3917c1),{'verbose':_0x1617be[_0x28fe7(0x210)]}),_0x3667e1=_0x2001b2[_0x28fe7(0x1aa)];return console[_0x28fe7(0x2a9)](a51_0x5af198[_0x28fe7(0x2ef)]('✔\x20Push\x20complete')),console['error'](_0x28fe7(0x2ab)+_0x3667e1[_0x28fe7(0x266)]),console[_0x28fe7(0x2a9)](_0x28fe7(0x217)+_0x3667e1['revision']),await this[_0x28fe7(0x284)](_0x554aeb,_0x3667e1[_0x28fe7(0x211)],_0x1617be[_0x28fe7(0x1a4)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:clone';['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x64d48f(0x1fb)](_0x5e936c){const _0x187cc6=a51_0x64d48f,{options:_0x2455e1,args:_0x4ef1c8,tdx:_0x3905c5}=_0x5e936c,_0x4b5d68=this['resolveProjectDir'](_0x4ef1c8,_0x2455e1),_0x53a374=_0x2455e1[_0x187cc6(0x246)],_0x2b22aa=_0x2455e1[_0x187cc6(0x23f)],_0x5cdbf3=_0x2455e1[_0x187cc6(0x2da)];if(!_0x4b5d68)return console['error'](a51_0x5af198['red'](_0x187cc6(0x18c)),_0x187cc6(0x308)),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x278)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x53a374)return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)]('Error:'),_0x187cc6(0x1a1)),console['error'](a51_0x5af198[_0x187cc6(0x278)](_0x187cc6(0x27c))),0x1;_0x2455e1['verbose']&&(console[_0x187cc6(0x2a9)](_0x187cc6(0x25e)+_0x4b5d68),console['error'](_0x187cc6(0x1d5)+_0x53a374),_0x2b22aa&&console['error']('Revision:\x20'+_0x2b22aa),_0x2455e1[_0x187cc6(0x290)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x2c8)),_0x5cdbf3&&console[_0x187cc6(0x2a9)]('Validation:\x20skipped'));const _0x5579d0=await withSpinner(_0x187cc6(0x17a),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x196)](_0x4b5d68,_0x53a374,{'revision':_0x2b22aa,'skipValidation':_0x5cdbf3}),{'verbose':_0x2455e1[_0x187cc6(0x210)]}),_0x5d8f11=_0x5579d0[_0x187cc6(0x1aa)];console[_0x187cc6(0x2a9)](_0x187cc6(0x2d4)+_0x5d8f11[_0x187cc6(0x30c)]);_0x5d8f11[_0x187cc6(0x2cc)]&&console[_0x187cc6(0x2a9)](_0x187cc6(0x1b3)+_0x5d8f11['sourceProjectName']);console[_0x187cc6(0x2a9)](_0x187cc6(0x1d5)+_0x5d8f11[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28f)+_0x5d8f11[_0x187cc6(0x23f)]),console[_0x187cc6(0x2a9)](_0x187cc6(0x28c)+_0x5d8f11[_0x187cc6(0x29b)]);_0x5d8f11[_0x187cc6(0x1c9)]&&(console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1c2)+_0x5d8f11['newProjectName']+_0x187cc6(0x2a4)+_0x5d8f11[_0x187cc6(0x1ee)]+')')),console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x20f))));if(_0x2455e1[_0x187cc6(0x290)])return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x2ea))),0x0;if(!_0x2455e1[_0x187cc6(0x216)]){if(!isInteractive())return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x23d)](_0x187cc6(0x279)),_0x187cc6(0x257)),console[_0x187cc6(0x2a9)](a51_0x5af198['dim'](_0x187cc6(0x2f3))),0x1;const _0x3693c7=_0x5d8f11[_0x187cc6(0x2cc)]||a51_0x2409f9[_0x187cc6(0x263)](_0x4b5d68),_0x30ce20=_0x5d8f11[_0x187cc6(0x1c9)]?_0x187cc6(0x292)+_0x53a374+_0x187cc6(0x2ba):_0x187cc6(0x220)+_0x3693c7+_0x187cc6(0x1e2)+_0x53a374+'\x22?',_0x52cd9a=await confirmKey(_0x30ce20);if(!_0x52cd9a)return console['error'](a51_0x5af198[_0x187cc6(0x1f4)](_0x187cc6(0x1cf))),0x1;}const _0x3011b2=await withSpinner(_0x5d8f11['targetExists']?_0x187cc6(0x269)+_0x53a374+_0x187cc6(0x231):_0x187cc6(0x2c9)+_0x53a374+_0x187cc6(0x231),()=>_0x3905c5[_0x187cc6(0x237)][_0x187cc6(0x208)](_0x5d8f11),{'verbose':_0x2455e1['verbose']}),_0x2d72b9=_0x3011b2[_0x187cc6(0x1aa)];return console[_0x187cc6(0x2a9)](a51_0x5af198[_0x187cc6(0x2ef)](_0x5d8f11['targetExists']?_0x187cc6(0x2d9):_0x187cc6(0x212))),console['error'](_0x187cc6(0x17b)+_0x2d72b9[_0x187cc6(0x19a)]),console[_0x187cc6(0x2a9)]('\x20\x20Project\x20ID:\x20'+_0x2d72b9[_0x187cc6(0x213)]),console[_0x187cc6(0x2a9)]('\x20\x20Revision:\x20'+_0x2d72b9[_0x187cc6(0x23f)]),await this[_0x187cc6(0x284)](_0x3905c5,_0x2d72b9[_0x187cc6(0x19a)],_0x2455e1[_0x187cc6(0x1a4)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x64d48f(0x246)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x64d48f(0x1fb)](_0x4a0771){const _0x5170d5=a51_0x64d48f,{options:_0x43ac44,args:_0x5c225a,tdx:_0x45f59c}=_0x4a0771,_0x8ac369=_0x5c225a[0x0];if(!_0x8ac369)return console[_0x5170d5(0x2a9)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x5170d5(0x2a9)](_0x5170d5(0x226)),0x1;_0x43ac44['verbose']&&console['error'](_0x5170d5(0x198)+_0x8ac369);if(!_0x43ac44[_0x5170d5(0x216)]){if(!isInteractive())return console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5170d5(0x2a9)](a51_0x5af198[_0x5170d5(0x278)](_0x5170d5(0x2f3))),0x1;const _0x3bd5fc=await confirmKey(_0x5170d5(0x243)+_0x8ac369+_0x5170d5(0x1b8));if(!_0x3bd5fc)return console['error'](a51_0x5af198['yellow'](_0x5170d5(0x1cf))),0x1;}const _0x1d20af=await withSpinner('Deleting\x20project\x20'+_0x8ac369+_0x5170d5(0x231),()=>_0x45f59c[_0x5170d5(0x237)][_0x5170d5(0x22c)](_0x8ac369),{'verbose':_0x43ac44[_0x5170d5(0x210)]}),_0xc2215e=_0x1d20af[_0x5170d5(0x1aa)];return console['error'](_0x5170d5(0x2f6)+_0xc2215e[_0x5170d5(0x211)]),console[_0x5170d5(0x2a9)](_0x5170d5(0x2ab)+_0xc2215e['projectId']),0x0;}}export function parseKeyValue(_0x244ce1){const _0x5b4d10=a51_0x64d48f,_0x57d6e9=_0x244ce1[_0x5b4d10(0x22d)]('=');if(_0x57d6e9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x244ce1+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x571aa7=_0x244ce1[_0x5b4d10(0x2bc)](0x0,_0x57d6e9),_0x952640=_0x244ce1[_0x5b4d10(0x2bc)](_0x57d6e9+0x1);if(!_0x571aa7)throw new Error(_0x5b4d10(0x1f0));return{'key':_0x571aa7,'value':_0x952640};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';[a51_0x64d48f(0x252)]=a51_0x64d48f(0x1d9);async['execute'](_0x23d7d2){const _0x1128e6=a51_0x64d48f,{options:_0x83358,args:_0x3192b0,tdx:_0x54e4d7}=_0x23d7d2,_0x3be976=this[_0x1128e6(0x228)](_0x3192b0,_0x83358);if(!_0x3be976)return 0x1;_0x83358[_0x1128e6(0x210)]&&console[_0x1128e6(0x2a9)](_0x1128e6(0x198)+_0x3be976);const _0xa16a46=await withSpinner(_0x1128e6(0x1f8),()=>_0x54e4d7[_0x1128e6(0x237)][_0x1128e6(0x24b)](_0x3be976),{'verbose':_0x83358[_0x1128e6(0x210)]}),{secrets:_0x11e015}=_0xa16a46['data'];return console[_0x1128e6(0x2a9)]('✔\x20Found\x20'+_0x11e015[_0x1128e6(0x1d8)]+'\x20secret'+(_0x11e015[_0x1128e6(0x1d8)]!==0x1?'s':'')),await handleSDKOutput(_0x11e015,_0x83358),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x2b7);['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x64d48f(0x1fb)](_0x4b58dc){const _0x27f3ac=a51_0x64d48f,{options:_0x1da62c,args:_0x174493,tdx:_0x4d7142}=_0x4b58dc;let _0x54641a,_0x554198;if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&!_0x174493[0x0][_0x27f3ac(0x248)]('='))_0x54641a=_0x174493[0x0],_0x554198=_0x174493['slice'](0x1);else{if(_0x174493[_0x27f3ac(0x1d8)]>=0x1&&_0x1da62c[_0x27f3ac(0x307)])_0x54641a=_0x1da62c[_0x27f3ac(0x307)],_0x554198=_0x174493;else return _0x174493['length']>=0x1?(console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2e6)),console['error']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x27f3ac(0x176)),0x1);}if(_0x554198[_0x27f3ac(0x1d8)]===0x0)return console[_0x27f3ac(0x2a9)](_0x27f3ac(0x2f5)),console['error'](_0x27f3ac(0x176)),0x1;const _0x5f3330={};try{for(const _0x366781 of _0x554198){const {key:_0x555fe8,value:_0x43d777}=parseKeyValue(_0x366781);_0x5f3330[_0x555fe8]=_0x43d777;}}catch(_0x292582){return _0x292582 instanceof Error&&console[_0x27f3ac(0x2a9)](a51_0x5af198[_0x27f3ac(0x23d)]('Error:'),_0x292582[_0x27f3ac(0x1a6)]),0x1;}const _0x52f7c5=Object[_0x27f3ac(0x291)](_0x5f3330);_0x1da62c[_0x27f3ac(0x210)]&&(console['error'](_0x27f3ac(0x198)+_0x54641a),console[_0x27f3ac(0x2a9)]('Secrets\x20to\x20set:\x20'+_0x52f7c5['join'](',\x20')));const _0xb1be3=await withSpinner(_0x52f7c5['length']===0x1?_0x27f3ac(0x29d):_0x27f3ac(0x309)+_0x52f7c5[_0x27f3ac(0x1d8)]+_0x27f3ac(0x18d),()=>_0x4d7142[_0x27f3ac(0x237)][_0x27f3ac(0x2f0)](_0x54641a,_0x5f3330),{'verbose':_0x1da62c[_0x27f3ac(0x210)]}),_0x33b22b=_0xb1be3['data'];return console[_0x27f3ac(0x2a9)](_0x52f7c5[_0x27f3ac(0x1d8)]===0x1?_0x27f3ac(0x1b6)+_0x33b22b[_0x27f3ac(0x291)][0x0]+_0x27f3ac(0x233)+_0x33b22b[_0x27f3ac(0x211)]+'\x27':'✔\x20'+_0x33b22b[_0x27f3ac(0x291)][_0x27f3ac(0x1d8)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x33b22b[_0x27f3ac(0x211)]+'\x27'),(_0x1da62c[_0x27f3ac(0x1c1)]||_0x1da62c['jsonl'])&&await handleSingleObjectOutput(_0x33b22b,_0x1da62c),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]=a51_0x64d48f(0x30a);[a51_0x64d48f(0x252)]=a51_0x64d48f(0x2e8);async['execute'](_0x21212d){const _0x12bed4=a51_0x64d48f,{options:_0x438896,args:_0x3bbc53,tdx:_0x5bae1a}=_0x21212d;let _0x45b62f,_0x2349c4;if(_0x3bbc53[_0x12bed4(0x1d8)]>=0x2)_0x45b62f=_0x3bbc53[0x0],_0x2349c4=_0x3bbc53[0x1];else{if(_0x3bbc53[_0x12bed4(0x1d8)]===0x1&&_0x438896[_0x12bed4(0x307)])_0x45b62f=_0x438896[_0x12bed4(0x307)],_0x2349c4=_0x3bbc53[0x0];else return _0x3bbc53[_0x12bed4(0x1d8)]===0x1?(console[_0x12bed4(0x2a9)](_0x12bed4(0x2e6)),console[_0x12bed4(0x2a9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x12bed4(0x2a9)](_0x12bed4(0x18a)),console[_0x12bed4(0x2a9)](_0x12bed4(0x2ce)),0x1);}_0x438896[_0x12bed4(0x210)]&&(console['error'](_0x12bed4(0x198)+_0x45b62f),console[_0x12bed4(0x2a9)](_0x12bed4(0x1b7)+_0x2349c4));if(!_0x438896['yes']){if(!isInteractive())return console['error'](a51_0x5af198['red']('\x0aError:'),_0x12bed4(0x257)),console['error'](a51_0x5af198[_0x12bed4(0x278)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x53c2b9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x2349c4+_0x12bed4(0x310)+_0x45b62f+'\x27?');if(!_0x53c2b9)return console[_0x12bed4(0x2a9)](a51_0x5af198[_0x12bed4(0x1f4)](_0x12bed4(0x1cf))),0x1;}const _0x42dc21=await withSpinner(_0x12bed4(0x2d3),()=>_0x5bae1a[_0x12bed4(0x237)]['deleteSecret'](_0x45b62f,_0x2349c4),{'verbose':_0x438896[_0x12bed4(0x210)]}),_0x4432fb=_0x42dc21['data'];return console[_0x12bed4(0x2a9)](_0x12bed4(0x1b6)+_0x4432fb[_0x12bed4(0x2be)]+_0x12bed4(0x306)+_0x4432fb[_0x12bed4(0x211)]+'\x27'),(_0x438896[_0x12bed4(0x1c1)]||_0x438896[_0x12bed4(0x18f)])&&await handleSingleObjectOutput(_0x4432fb,_0x438896),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(_0x14bde3){const _0x288a27=a51_0x64d48f,_0x3b2c2d=Math['floor'](_0x14bde3/0x3e8),_0x114451=Math[_0x288a27(0x23b)](_0x3b2c2d/0x3c),_0x588779=Math['floor'](_0x114451/0x3c),_0x285155=Math[_0x288a27(0x23b)](_0x588779/0x18);if(_0x285155>0x0){const _0x2a2a5e=_0x588779%0x18;return _0x2a2a5e>0x0?_0x285155+'d\x20'+_0x2a2a5e+'h':_0x285155+'d';}else{if(_0x588779>0x0){const _0x360ded=_0x114451%0x3c;return _0x360ded>0x0?_0x588779+'h\x20'+_0x360ded+'m':_0x588779+'h';}else{if(_0x114451>0x0){const _0x21569c=_0x3b2c2d%0x3c;return _0x21569c>0x0?_0x114451+'m\x20'+_0x21569c+'s':_0x114451+'m';}else return _0x3b2c2d+'s';}}}function formatTimestamp(_0x3fe6cd,_0xe9e72d){const _0x2ac3a6=a51_0x64d48f,_0x4000b0=new Date(_0x3fe6cd),_0x17bfd5=String(_0x4000b0[_0x2ac3a6(0x190)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x4be3f8=String(_0x4000b0[_0x2ac3a6(0x311)]())[_0x2ac3a6(0x16e)](0x2,'0'),_0x3bb1a5=_0x17bfd5+':'+_0x4be3f8,_0x214b1f=_0x4000b0[_0x2ac3a6(0x192)]()===_0xe9e72d[_0x2ac3a6(0x192)]()&&_0x4000b0[_0x2ac3a6(0x1fc)]()===_0xe9e72d[_0x2ac3a6(0x1fc)]()&&_0x4000b0[_0x2ac3a6(0x2f4)]()===_0xe9e72d[_0x2ac3a6(0x2f4)]();if(_0x214b1f)return _0x3bb1a5;else{const _0x113fc4=String(_0x4000b0['getMonth']()+0x1)[_0x2ac3a6(0x16e)](0x2,'0'),_0x2c53fc=String(_0x4000b0['getDate']())[_0x2ac3a6(0x16e)](0x2,'0');return _0x113fc4+'-'+_0x2c53fc+'\x20'+_0x3bb1a5;}}function formatDate(_0x72a56b){const _0x5ca462=a51_0x64d48f,_0x3deaf7=_0x72a56b['getFullYear'](),_0x5b7d7b=String(_0x72a56b[_0x5ca462(0x1fc)]()+0x1)[_0x5ca462(0x16e)](0x2,'0'),_0x1e1606=String(_0x72a56b['getDate']())[_0x5ca462(0x16e)](0x2,'0');return _0x3deaf7+'-'+_0x5b7d7b+'-'+_0x1e1606;}function getTaskStateIcon(_0x1e12ff){const _0x255ecf={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x255ecf[_0x1e12ff]||'⚪';}function getBarChar(_0xfe5fe6){const _0x5a42d9=a51_0x64d48f;return _0xfe5fe6===_0x5a42d9(0x2a9)||_0xfe5fe6===_0x5a42d9(0x1fd)?'×':'─';}function getBarColor(_0xf8207a){const _0x25f035=a51_0x64d48f,_0x42e487={'success':a51_0x5af198[_0x25f035(0x2ef)],'error':a51_0x5af198['red'],'group_error':a51_0x5af198[_0x25f035(0x23d)],'running':a51_0x5af198[_0x25f035(0x1ef)],'blocked':a51_0x5af198['yellow'],'planned':a51_0x5af198[_0x25f035(0x278)],'canceling':a51_0x5af198[_0x25f035(0x1f4)]};return _0x42e487[_0xf8207a]||a51_0x5af198['white'];}function parseTaskName(_0x24fa9e){const _0x875782=a51_0x64d48f;let _0x447c65=_0x24fa9e['replace'](/^\++/,'');const _0x40827d=_0x447c65[_0x875782(0x283)]('+'),_0x81c518=_0x40827d[_0x875782(0x1d8)]>0x1?_0x40827d['length']-0x2:0x0,_0x251c09=_0x40827d[_0x40827d['length']-0x1]||_0x447c65;return{'level':_0x81c518,'name':'+'+_0x251c09};}function truncateTaskName(_0x35aba9,_0x1b02ba){const _0x29b8c3=a51_0x64d48f,_0x49b297=stringWidth(_0x35aba9);if(_0x49b297<=_0x1b02ba)return _0x35aba9;let _0x68a90c=_0x35aba9;while(stringWidth(_0x68a90c+'…')>_0x1b02ba&&_0x68a90c['length']>0x0){_0x68a90c=_0x68a90c[_0x29b8c3(0x22b)](0x0,-0x1);}return _0x68a90c+'…';}function calculateTimeScale(_0x4728e9,_0x2d46a3){const _0x2d71c7=a51_0x64d48f;return{'startTime':_0x4728e9[_0x2d71c7(0x178)],'endTime':_0x4728e9[_0x2d71c7(0x20e)],'durationMs':_0x4728e9[_0x2d71c7(0x186)],'msPerChar':_0x4728e9[_0x2d71c7(0x186)]/_0x2d46a3};}function timeToPosition(_0x46455c,_0x53b1b1,_0x1b1c05){const _0x845e79=a51_0x64d48f,_0x525330=_0x46455c-_0x53b1b1[_0x845e79(0x180)],_0x54ced6=Math[_0x845e79(0x23b)](_0x525330/_0x53b1b1[_0x845e79(0x2a8)]);return Math[_0x845e79(0x2d8)](0x0,Math[_0x845e79(0x254)](_0x54ced6,_0x1b1c05));}function renderTimeAxis(_0x15a8ee,_0x75cbca){const _0x792a12=a51_0x64d48f,_0x2d9466=Math['min'](TIMELINE_CONFIG[_0x792a12(0x24f)],Math[_0x792a12(0x2d8)](TIMELINE_CONFIG[_0x792a12(0x297)],Math[_0x792a12(0x23b)](_0x75cbca/TIMELINE_CONFIG[_0x792a12(0x20a)]))),_0x283229=_0x15a8ee['durationMs']/(_0x2d9466-0x1),_0x17737c=new Date(_0x15a8ee['startTime']),_0x45db2e=[];for(let _0x22b41c=0x0;_0x22b41c<_0x2d9466;_0x22b41c++){const _0x59bfc6=_0x15a8ee[_0x792a12(0x180)]+_0x22b41c*_0x283229,_0x5181a3=timeToPosition(_0x59bfc6,_0x15a8ee,_0x75cbca),_0x47451a=formatTimestamp(_0x59bfc6,_0x17737c);_0x45db2e[_0x792a12(0x235)]({'pos':_0x5181a3,'text':_0x47451a});}const _0x27d4cf=new Array(_0x75cbca)[_0x792a12(0x184)]('\x20');let _0x3e8dd9=-0x1;for(const {pos:_0x144ccc,text:_0x43a867}of _0x45db2e){let _0xde1386=Math[_0x792a12(0x2d8)](0x0,_0x144ccc-Math[_0x792a12(0x23b)](_0x43a867[_0x792a12(0x1d8)]/0x2));_0xde1386<=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]&&(_0xde1386=_0x3e8dd9+TIMELINE_CONFIG[_0x792a12(0x30f)]+0x1);_0xde1386+_0x43a867[_0x792a12(0x1d8)]>_0x75cbca&&(_0xde1386=_0x75cbca-_0x43a867[_0x792a12(0x1d8)]);if(_0xde1386>=0x0&&_0xde1386+_0x43a867[_0x792a12(0x1d8)]<=_0x75cbca&&_0xde1386>_0x3e8dd9){for(let _0x5f7e8a=0x0;_0x5f7e8a<_0x43a867[_0x792a12(0x1d8)];_0x5f7e8a++){_0x27d4cf[_0xde1386+_0x5f7e8a]=_0x43a867[_0x5f7e8a];}_0x3e8dd9=_0xde1386+_0x43a867[_0x792a12(0x1d8)]-0x1;}}return _0x27d4cf[_0x792a12(0x1eb)]('');}function renderTaskRow(_0x39d84,_0x39de20,_0x3719bf,_0x396a5f){const _0x26dc19=a51_0x64d48f,{level:_0x5007dc,name:_0x48337f}=parseTaskName(_0x39d84[_0x26dc19(0x246)]),_0x570f7c='\x20'[_0x26dc19(0x2dc)](_0x5007dc),_0x4c215a=_0x39d84[_0x26dc19(0x1a0)]?'('+formatElapsed(_0x39d84[_0x26dc19(0x1a0)][_0x26dc19(0x186)])+')':'',_0x337edf=stringWidth(_0x4c215a),_0x354787=_0x5007dc*0x1,_0x26c4ff=_0x396a5f-_0x354787-_0x337edf-0x1,_0x3f2d9f=truncateTaskName(_0x48337f,_0x26c4ff),_0x332f75=_0x570f7c+_0x3f2d9f,_0x586178=stringWidth(_0x332f75),_0x322101=_0x396a5f-_0x586178-_0x337edf,_0x5c4f04=_0x332f75+'\x20'['repeat'](Math[_0x26dc19(0x2d8)](0x1,_0x322101))+a51_0x5af198['dim'](_0x4c215a),_0x1a88d4=getTaskStateIcon(_0x39d84[_0x26dc19(0x1fa)]),_0x56870f=new Array(_0x3719bf)[_0x26dc19(0x184)]('\x20');if(_0x39d84[_0x26dc19(0x1a0)]){const _0x4a5ef4=timeToPosition(_0x39d84[_0x26dc19(0x1a0)]['start'],_0x39de20,_0x3719bf),_0x9a6a52=timeToPosition(_0x39d84['window'][_0x26dc19(0x20e)],_0x39de20,_0x3719bf),_0xa47de6=getBarChar(_0x39d84[_0x26dc19(0x1fa)]),_0x3e3cb3=Math['max'](_0x4a5ef4+0x1,_0x9a6a52);for(let _0x3d8b4d=_0x4a5ef4;_0x3d8b4d<Math[_0x26dc19(0x254)](_0x3e3cb3,_0x3719bf);_0x3d8b4d++){_0x56870f[_0x3d8b4d]=_0xa47de6;}}const _0x3751c4=getBarColor(_0x39d84[_0x26dc19(0x1fa)]),_0xba2f3=_0x56870f[_0x26dc19(0x2b9)](_0x16db3f=>_0x16db3f==='\x20'?'\x20':_0x3751c4(_0x16db3f))[_0x26dc19(0x1eb)]('');return _0x1a88d4+'\x20'+_0x5c4f04+'│'+_0xba2f3+'│';}function calculateStats(_0xbd01c2){const _0x2a2862=a51_0x64d48f,_0x5154af={'total':_0xbd01c2[_0x2a2862(0x1d8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1940ce of _0xbd01c2){if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x27f))_0x5154af[_0x2a2862(0x27f)]++;else{if(_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x2a9)||_0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x1fd))_0x5154af['error']++;else _0x1940ce[_0x2a2862(0x1fa)]===_0x2a2862(0x25a)?_0x5154af['running']++:_0x5154af[_0x2a2862(0x2ec)]++;}}return _0x5154af;}function formatStats(_0x1d7794){const _0x237b36=a51_0x64d48f;return[_0x237b36(0x21d)+_0x1d7794['total'],'✅\x20'+_0x1d7794['success'],'❌\x20'+_0x1d7794[_0x237b36(0x2a9)],_0x237b36(0x25b)+_0x1d7794[_0x237b36(0x25a)],'⏳\x20'+_0x1d7794[_0x237b36(0x2ec)]][_0x237b36(0x1eb)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x64d48f(0x246)]='workflow:timeline';[a51_0x64d48f(0x252)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x3f7d25){const _0x5af7c1=a51_0x64d48f,{options:_0x281e6b,args:_0x23b939,tdx:_0x295cfd}=_0x3f7d25;let _0x45583e,_0x1b1f35,_0x487520=![];if(_0x23b939[0x0]){if(_0x23b939[0x0][_0x5af7c1(0x248)]('.')){const _0x4e5799=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x4e5799)return 0x1;_0x45583e=_0x4e5799[_0x5af7c1(0x211)],_0x1b1f35=_0x4e5799['workflowName'];}else{_0x1b1f35=_0x23b939[0x0],_0x45583e=_0x281e6b[_0x5af7c1(0x307)];if(!_0x45583e)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x27d)),0x1;_0x487520=!![];}}else{const _0x7fc736=this[_0x5af7c1(0x2b6)](_0x23b939,_0x281e6b);if(!_0x7fc736)return 0x1;_0x45583e=_0x7fc736[_0x5af7c1(0x211)],_0x1b1f35=_0x7fc736['workflowName'];}if(_0x281e6b[_0x5af7c1(0x210)]){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x242)+_0x45583e+'.'+_0x1b1f35);else _0x45583e&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x2d6)+_0x45583e);}const _0x2552db=_0x281e6b[_0x5af7c1(0x2b1)],_0x3f4418=_0x281e6b[_0x5af7c1(0x17c)];if(_0x2552db){_0x3f4418&&console['error'](a51_0x5af198[_0x5af7c1(0x1f4)](_0x5af7c1(0x215)),_0x5af7c1(0x234));const _0x5133c0=_0x281e6b[_0x5af7c1(0x2aa)];return _0x5133c0?await this['pollTimeline'](_0x3f7d25,_0x2552db):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x2552db,_0x281e6b),0x0;}if(_0x3f4418){const _0x57f14d=await withSpinner(_0x5af7c1(0x214),()=>_0x295cfd['workflow'][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':0x64}),{'verbose':_0x281e6b[_0x5af7c1(0x210)]}),_0x337afd=_0x57f14d[_0x5af7c1(0x1aa)][_0x5af7c1(0x305)](_0x4d1f42=>_0x4d1f42['id']===_0x3f4418);if(!_0x337afd)return console[_0x5af7c1(0x2a9)](a51_0x5af198[_0x5af7c1(0x23d)](_0x5af7c1(0x18c)),_0x5af7c1(0x1dd)+_0x3f4418),0x1;if(!_0x337afd[_0x5af7c1(0x296)]?.['id'])return console['error'](a51_0x5af198['red'](_0x5af7c1(0x18c)),_0x5af7c1(0x28e)+_0x3f4418+_0x5af7c1(0x1ea)),0x1;const _0x145d2d=_0x337afd[_0x5af7c1(0x296)]['id'];_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x28b)+_0x145d2d+_0x5af7c1(0x2b0)+_0x3f4418);const _0x59b68b=_0x281e6b[_0x5af7c1(0x2aa)];return _0x59b68b?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x145d2d):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x145d2d,_0x281e6b),0x0;}const _0x10d243=await withSpinner('Loading\x20sessions...',()=>_0x295cfd[_0x5af7c1(0x237)][_0x5af7c1(0x2d0)]({'projectName':_0x45583e,'workflowName':_0x1b1f35,'limit':_0x281e6b['limit']||0x32}),{'verbose':_0x281e6b['verbose']}),_0x2b8029=_0x10d243[_0x5af7c1(0x1aa)];if(_0x2b8029[_0x5af7c1(0x1d8)]===0x0){if(_0x45583e&&_0x1b1f35)console[_0x5af7c1(0x2a9)](_0x5af7c1(0x300)+_0x45583e+'.'+_0x1b1f35);else _0x45583e?console[_0x5af7c1(0x2a9)](_0x5af7c1(0x315)+_0x45583e):(console[_0x5af7c1(0x2a9)](_0x5af7c1(0x21f)),console['error'](a51_0x5af198[_0x5af7c1(0x278)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x2b8029['sort']((_0x361d07,_0x56fc8e)=>{const _0x3e1cbd=_0x5af7c1,_0x1c8cb5=_0x361d07['sessionTime']||'',_0x165d71=_0x56fc8e['sessionTime']||'';return _0x165d71[_0x3e1cbd(0x2fa)](_0x1c8cb5);});if(_0x281e6b[_0x5af7c1(0x1c1)]||_0x281e6b[_0x5af7c1(0x18f)])return await handleSDKOutput(_0x2b8029,_0x281e6b),0x0;let _0x3b91bb;if(_0x487520){const _0x3eaa3e=_0x2b8029[0x0];if(!_0x3eaa3e[_0x5af7c1(0x296)]?.['id'])return console[_0x5af7c1(0x2a9)](_0x5af7c1(0x16f)),0x0;_0x3b91bb=_0x3eaa3e[_0x5af7c1(0x296)]['id'],_0x281e6b[_0x5af7c1(0x210)]&&console[_0x5af7c1(0x2a9)](_0x5af7c1(0x19f)+_0x3eaa3e[_0x5af7c1(0x200)]);}else{const _0x11dac2=_0x2b8029[_0x5af7c1(0x2b9)](_0x16749b=>{const _0x380388=_0x5af7c1,_0x2a3b5b=getAttemptStatusDisplay(_0x16749b[_0x380388(0x296)]);return{'title':_0x16749b[_0x380388(0x29e)]?.['name']+'.'+_0x16749b[_0x380388(0x237)]?.[_0x380388(0x246)]+_0x380388(0x193)+_0x16749b[_0x380388(0x200)]+'\x20'+_0x2a3b5b['icon'],'value':_0x16749b[_0x380388(0x296)]?.['id']||'','description':_0x2a3b5b[_0x380388(0x288)]};}),_0x56ae9c=await a51_0x396bfc({'type':_0x5af7c1(0x2c4),'name':_0x5af7c1(0x2b1),'message':_0x5af7c1(0x225),'choices':_0x11dac2[_0x5af7c1(0x1f7)](_0xb9ef8b=>_0xb9ef8b[_0x5af7c1(0x2e9)]!=='')});if(!_0x56ae9c['attemptId'])return 0x0;_0x3b91bb=_0x56ae9c['attemptId'];}const _0xee9f0f=_0x281e6b[_0x5af7c1(0x2aa)];return _0xee9f0f?await this[_0x5af7c1(0x2b4)](_0x3f7d25,_0x3b91bb):await this[_0x5af7c1(0x277)](_0x3f7d25,_0x3b91bb,_0x281e6b),0x0;}async[a51_0x64d48f(0x277)](_0x5a99c3,_0x13d6bc,_0x393340){const _0x448933=a51_0x64d48f,{tdx:_0x17d839}=_0x5a99c3;let _0x3664d8,_0xe5d3a5;try{[_0x3664d8,_0xe5d3a5]=await Promise[_0x448933(0x1d0)]([_0x17d839[_0x448933(0x237)][_0x448933(0x1ba)](_0x13d6bc),_0x17d839[_0x448933(0x237)]['tasks'](_0x13d6bc,![])]);}catch(_0x2d5b82){console[_0x448933(0x2a9)](a51_0x5af198[_0x448933(0x23d)](_0x448933(0x1ff)));_0x393340[_0x448933(0x210)]&&console[_0x448933(0x2a9)](_0x2d5b82);throw _0x2d5b82;}if(_0x393340[_0x448933(0x1c1)]||_0x393340[_0x448933(0x18f)]){const _0x8a6538=this['buildTimelineData'](_0x3664d8,_0xe5d3a5);await handleSDKOutput([_0x8a6538],_0x393340);return;}const _0x46d9e5=_0x17d839[_0x448933(0x262)][_0x448933(0x1a4)],_0x302ea3=this[_0x448933(0x2ad)](_0x3664d8,_0xe5d3a5,_0x46d9e5);console[_0x448933(0x2a7)](_0x302ea3);}async[a51_0x64d48f(0x2b4)](_0xe1177a,_0x2c94d0){const _0x5710da=a51_0x64d48f,{tdx:_0x5c934e}=_0xe1177a,_0x27d3aa=TIMELINE_CONFIG[_0x5710da(0x2c5)],_0x31e348=TIMELINE_CONFIG[_0x5710da(0x207)];let _0x35edd9=0x0;while(_0x35edd9<_0x31e348){process[_0x5710da(0x289)][_0x5710da(0x295)]&&process['stdout']['write']('\x1bc');let _0x330de3,_0x344b45;try{[_0x330de3,_0x344b45]=await Promise[_0x5710da(0x1d0)]([_0x5c934e['workflow'][_0x5710da(0x1ba)](_0x2c94d0),_0x5c934e['workflow']['tasks'](_0x2c94d0,![])]);}catch(_0x45797b){console['error'](a51_0x5af198[_0x5710da(0x23d)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x35edd9>0x0&&console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x35edd9));throw _0x45797b;}const _0x2fce94=_0x5c934e[_0x5710da(0x262)][_0x5710da(0x1a4)],_0x2df819=this[_0x5710da(0x2ad)](_0x330de3,_0x344b45,_0x2fce94);console[_0x5710da(0x2a7)](_0x2df819);const _0x332589=_0x330de3[_0x5710da(0x2bf)]&&_0x344b45[_0x5710da(0x2ee)](_0x4acd1b=>_0x4acd1b[_0x5710da(0x1fa)]!=='running'&&_0x4acd1b[_0x5710da(0x1fa)]!==_0x5710da(0x241));if(_0x332589){console[_0x5710da(0x2a9)](a51_0x5af198['green'](_0x5710da(0x2c2)));break;}console[_0x5710da(0x2a9)](a51_0x5af198[_0x5710da(0x278)](_0x5710da(0x244)+_0x35edd9*0x2+_0x5710da(0x1e0))),await new Promise(_0x5f2186=>setTimeout(_0x5f2186,_0x27d3aa)),_0x35edd9++;}_0x35edd9>=_0x31e348&&console['error'](a51_0x5af198['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a51_0x64d48f(0x2ad)](_0x243b9c,_0xcc462,_0x3bd040){const _0x325451=a51_0x64d48f,_0x1fb76b=[],_0x174ade=TIMELINE_CONFIG[_0x325451(0x2f8)],_0x36c056=0x5,_0x2099c1=process['stdout']['columns']||0x78,_0x2b601a=_0x2099c1-_0x174ade-_0x36c056,_0x4aa5a9=Math[_0x325451(0x2d8)](TIMELINE_CONFIG[_0x325451(0x2b8)],Math[_0x325451(0x254)](_0x2b601a,TIMELINE_CONFIG[_0x325451(0x281)])),_0x56178a=new Date(_0x243b9c[_0x325451(0x2e3)])['getTime'](),_0x44370c=_0x243b9c[_0x325451(0x2d5)]?new Date(_0x243b9c[_0x325451(0x2d5)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x1a64fe={'start':_0x56178a,'end':_0x44370c,'duration':_0x44370c-_0x56178a},_0x7a47e1=new Map(),_0x20ab59=[];for(const _0x203a07 of _0xcc462){if(_0x203a07[_0x325451(0x1c0)]){const _0x1473ff=new Date(_0x203a07[_0x325451(0x1c0)])[_0x325451(0x2bd)](),_0x1ea258=_0x203a07[_0x325451(0x1ca)]?new Date(_0x203a07[_0x325451(0x1ca)])[_0x325451(0x2bd)]():Date[_0x325451(0x2c7)](),_0x2bbb92={'start':_0x1473ff,'end':_0x1ea258,'duration':_0x1ea258-_0x1473ff};_0x7a47e1[_0x325451(0x2a0)](_0x203a07['id'],_0x2bbb92),_0x20ab59['push']({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07['state']||_0x325451(0x218),'window':_0x2bbb92});}else _0x20ab59[_0x325451(0x235)]({'name':_0x203a07[_0x325451(0x194)],'state':_0x203a07[_0x325451(0x1fa)]||'planned','window':undefined});}_0x20ab59[_0x325451(0x19c)]((_0x34b5fb,_0x4b6f82)=>{const _0xc1d132=_0x325451;if(!_0x34b5fb[_0xc1d132(0x1a0)])return 0x1;if(!_0x4b6f82[_0xc1d132(0x1a0)])return-0x1;return _0x34b5fb[_0xc1d132(0x1a0)][_0xc1d132(0x178)]-_0x4b6f82['window'][_0xc1d132(0x178)];});const _0x27ab7f=_0x20ab59[_0x325451(0x1d8)],_0x417961=_0x27ab7f>TIMELINE_CONFIG[_0x325451(0x2b3)];_0x417961&&_0x20ab59[_0x325451(0x270)](TIMELINE_CONFIG[_0x325451(0x2b3)]);const _0x3e5756=calculateTimeScale(_0x1a64fe,_0x4aa5a9),_0x3ff71b=_0x243b9c[_0x325451(0x2bf)]?_0x243b9c['success']?a51_0x5af198['green'](_0x325451(0x27f)):a51_0x5af198['red'](_0x325451(0x2a9)):a51_0x5af198['blue'](_0x325451(0x25a)),_0xca535d=_0x243b9c['project']?.['id'],_0x20fe2d=_0x243b9c[_0x325451(0x17c)];let _0x3ec420;if(_0xca535d&&_0x20fe2d){const _0x5bac42=getWorkflowAttemptUrl(_0x3bd040,_0xca535d,_0x20fe2d,_0x243b9c['id']);_0x3ec420=hyperlink(a51_0x5af198[_0x325451(0x278)](_0x243b9c['id']),_0x5bac42);}else _0x3ec420=a51_0x5af198['dim'](_0x243b9c['id']);_0x1fb76b['push'](_0x325451(0x238)+_0x3ec420+_0x325451(0x193)+_0x3ff71b+_0x325451(0x193)+formatElapsed(_0x1a64fe[_0x325451(0x186)]));if(_0x20ab59[_0x325451(0x1d8)]>0x0){const _0x236adb=renderTimeAxis(_0x3e5756,_0x4aa5a9),_0x619643=new Date(_0x1a64fe[_0x325451(0x178)]),_0x13e8d7=formatDate(_0x619643),_0x6940d0=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x325451(0x274)]+_0x174ade,_0x4156d2=_0x13e8d7[_0x325451(0x16e)](_0x6940d0),_0x198e49=a51_0x5af198['dim'](_0x4156d2);_0x1fb76b[_0x325451(0x235)](_0x198e49+'\x20'+_0x236adb);for(const _0x4a01cc of _0x20ab59){_0x1fb76b[_0x325451(0x235)](renderTaskRow(_0x4a01cc,_0x3e5756,_0x4aa5a9,_0x174ade));}const _0x4f5f5c=calculateStats(_0x20ab59);_0x1fb76b['push'](formatStats(_0x4f5f5c)),_0x417961&&_0x1fb76b[_0x325451(0x235)](a51_0x5af198[_0x325451(0x1f4)](_0x325451(0x313)+TIMELINE_CONFIG[_0x325451(0x2b3)]+'\x20of\x20'+_0x27ab7f+'\x20tasks')),_0x1fb76b[_0x325451(0x235)](''),_0x1fb76b['push'](a51_0x5af198['dim'](_0x325451(0x1df))+(_0x325451(0x280)+_0x243b9c['id']+_0x325451(0x30e))+a51_0x5af198[_0x325451(0x278)](_0x325451(0x273)));}else _0x1fb76b[_0x325451(0x235)](_0x325451(0x1ae));return _0x1fb76b[_0x325451(0x1eb)]('\x0a');}[a51_0x64d48f(0x2cf)](_0x2b3114,_0x28b315){const _0x5eb8ce=a51_0x64d48f,_0x20b7c6=new Date(_0x2b3114['createdAt'])[_0x5eb8ce(0x2bd)](),_0x4b9d93=_0x2b3114[_0x5eb8ce(0x2d5)]?new Date(_0x2b3114[_0x5eb8ce(0x2d5)])[_0x5eb8ce(0x2bd)]():Date[_0x5eb8ce(0x2c7)](),_0x50ad21=_0x4b9d93-_0x20b7c6,_0x53d8b3=[];for(const _0x9c6c2b of _0x28b315){if(_0x9c6c2b[_0x5eb8ce(0x1c0)]){const _0x5a8fd8=new Date(_0x9c6c2b['startedAt'])[_0x5eb8ce(0x2bd)](),_0x206d1c=_0x9c6c2b['updatedAt']?new Date(_0x9c6c2b[_0x5eb8ce(0x1ca)])[_0x5eb8ce(0x2bd)]():Date['now']();_0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b['state']||_0x5eb8ce(0x218),'window':{'start':_0x5a8fd8,'end':_0x206d1c,'duration':_0x206d1c-_0x5a8fd8}});}else _0x53d8b3[_0x5eb8ce(0x235)]({'name':_0x9c6c2b[_0x5eb8ce(0x194)],'state':_0x9c6c2b[_0x5eb8ce(0x1fa)]||'planned','window':undefined});}const _0x47da7e=calculateStats(_0x53d8b3);return{'attempt':{'id':_0x2b3114['id'],'status':_0x2b3114[_0x5eb8ce(0x2bf)]?_0x2b3114['success']?'success':_0x5eb8ce(0x2a9):_0x5eb8ce(0x25a),'createdAt':_0x2b3114[_0x5eb8ce(0x2e3)],'finishedAt':_0x2b3114['finishedAt'],'duration_ms':_0x50ad21},'tasks':_0x53d8b3[_0x5eb8ce(0x2b9)](_0x37296e=>({'name':_0x37296e[_0x5eb8ce(0x246)],'state':_0x37296e[_0x5eb8ce(0x1fa)],'startedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)][_0x5eb8ce(0x178)])['toISOString']():null,'updatedAt':_0x37296e[_0x5eb8ce(0x1a0)]?new Date(_0x37296e[_0x5eb8ce(0x1a0)]['end'])[_0x5eb8ce(0x2c6)]():null,'duration_ms':_0x37296e[_0x5eb8ce(0x1a0)]?.['duration']||null})),'stats':_0x47da7e};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x4f0652,_0x57163e){const _0x495727=a52_0x5a4c,_0x59d114=_0x4f0652();while(!![]){try{const _0x951ae6=-parseInt(_0x495727(0x188))/0x1+-parseInt(_0x495727(0x18a))/0x2+parseInt(_0x495727(0x185))/0x3+parseInt(_0x495727(0x186))/0x4*(-parseInt(_0x495727(0x183))/0x5)+parseInt(_0x495727(0x18b))/0x6+parseInt(_0x495727(0x189))/0x7+parseInt(_0x495727(0x190))/0x8;if(_0x951ae6===_0x57163e)break;else _0x59d114['push'](_0x59d114['shift']());}catch(_0x3fda53){_0x59d114['push'](_0x59d114['shift']());}}}(a52_0x3741,0x4a2f7));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a52_0x5a4c(_0x1d675d,_0x5c4c6b){_0x1d675d=_0x1d675d-0x181;const _0x374178=a52_0x3741();let _0x5a4cdf=_0x374178[_0x1d675d];return _0x5a4cdf;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0x3741(){const _0xf66b88=['12KFfjEr','Authorization','172614oBUgCr','417921YkyVzZ','1022938LuLMot','538770CXxsFX','Bearer\x20',';\x20node/','tdx/','X-Trino-User','4634136evAejb','replace','entries','3730QUzcbj','TD1\x20','784257FTVRjo'];a52_0x3741=function(){return _0xf66b88;};return a52_0x3741();}export function getUserAgent(){const _0x40554f=a52_0x5a4c,_0x33624e=getVersion(),_0x30e81e=platform(),_0x31acd4=process['version'][_0x40554f(0x181)]('v','');return _0x40554f(0x18e)+_0x33624e+'\x20('+_0x30e81e+_0x40554f(0x18d)+_0x31acd4+')';}export function getAuthHeaders(_0x56f799,_0x37283d,_0x3267be){const _0x3d9cee=a52_0x5a4c,_0x45572c=getVersion(),_0x543a4e={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x45572c};if(_0x3267be)_0x543a4e[_0x3d9cee(0x187)]=_0x3d9cee(0x18c)+_0x3267be;else _0x37283d&&(_0x543a4e[_0x3d9cee(0x187)]=_0x3d9cee(0x184)+_0x37283d);return _0x543a4e;}export function toHeaderRecord(_0x513c12){const _0x2c001b=a52_0x5a4c,_0x58bd07={};for(const [_0x490144,_0x4d05ab]of Object[_0x2c001b(0x182)](_0x513c12)){_0x4d05ab!==undefined&&(_0x58bd07[_0x490144]=_0x4d05ab);}return _0x58bd07;}export function getTrinoHeaders(_0x3876e7,_0x30dbf3,_0x493a43){const _0x243a7b=a52_0x5a4c,_0x4679fe=getAuthHeaders(_0x3876e7),_0x1c3863=toHeaderRecord(_0x4679fe);if(_0x493a43)_0x1c3863[_0x243a7b(0x187)]=_0x243a7b(0x18c)+_0x493a43;else _0x30dbf3&&(_0x1c3863[_0x243a7b(0x18f)]=_0x30dbf3);return _0x1c3863;}export function hasAPIKey(_0x314465){const _0x4f9d10=getAPIKey();return _0x4f9d10!==undefined&&_0x4f9d10['length']>0x0;}
1
+ (function(_0x41dbf4,_0x59b773){const _0x4d9e69=a52_0x5651,_0x5dcf8f=_0x41dbf4();while(!![]){try{const _0x1f7654=parseInt(_0x4d9e69(0xa4))/0x1+parseInt(_0x4d9e69(0xa5))/0x2+-parseInt(_0x4d9e69(0xaf))/0x3*(-parseInt(_0x4d9e69(0xac))/0x4)+-parseInt(_0x4d9e69(0xa8))/0x5+-parseInt(_0x4d9e69(0xae))/0x6*(-parseInt(_0x4d9e69(0xb2))/0x7)+-parseInt(_0x4d9e69(0xad))/0x8*(parseInt(_0x4d9e69(0xb0))/0x9)+-parseInt(_0x4d9e69(0xaa))/0xa*(parseInt(_0x4d9e69(0xa7))/0xb);if(_0x1f7654===_0x59b773)break;else _0x5dcf8f['push'](_0x5dcf8f['shift']());}catch(_0x3fa953){_0x5dcf8f['push'](_0x5dcf8f['shift']());}}}(a52_0xcbbe,0x1c593));import{platform}from'os';function a52_0x5651(_0x56c410,_0x3dc67d){_0x56c410=_0x56c410-0xa1;const _0xcbbebe=a52_0xcbbe();let _0x5651a8=_0xcbbebe[_0x56c410];return _0x5651a8;}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0xcbbe(){const _0x38a7bd=[';\x20node/','186161szfUyU','198880nHqArY','tdx/','429PYzhEz','535515yZFLeq','Authorization','11150RaBmWo','Bearer\x20','8bdubWR','462656vuaxyt','42rEVqjU','62025oTsPAA','36yXcKDH','TD1\x20','171080hjqXcW','length','version'];a52_0xcbbe=function(){return _0x38a7bd;};return a52_0xcbbe();}export function getUserAgent(){const _0x4ae000=a52_0x5651,_0xb3320a=getVersion(),_0x1b8ba0=platform(),_0x1a3d39=process[_0x4ae000(0xa2)]['replace']('v','');return _0x4ae000(0xa6)+_0xb3320a+'\x20('+_0x1b8ba0+_0x4ae000(0xa3)+_0x1a3d39+')';}export function getAuthHeaders(_0x380477,_0x47b0d4,_0x580739){const _0x10c9c3=a52_0x5651,_0x565950=getVersion(),_0x20cbb6={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x565950};if(_0x580739)_0x20cbb6['Authorization']=_0x10c9c3(0xab)+_0x580739;else _0x47b0d4&&(_0x20cbb6[_0x10c9c3(0xa9)]=_0x10c9c3(0xb1)+_0x47b0d4);return _0x20cbb6;}export function toHeaderRecord(_0x27184e){const _0xa37b20={};for(const [_0x3bfa11,_0x25989f]of Object['entries'](_0x27184e)){_0x25989f!==undefined&&(_0xa37b20[_0x3bfa11]=_0x25989f);}return _0xa37b20;}export function getTrinoHeaders(_0x125a2b,_0x3756f6,_0xb32806){const _0x4404f6=a52_0x5651,_0x40663f=getAuthHeaders(_0x125a2b),_0x9de953=toHeaderRecord(_0x40663f);if(_0xb32806)_0x9de953[_0x4404f6(0xa9)]=_0x4404f6(0xab)+_0xb32806;else _0x3756f6&&(_0x9de953['X-Trino-User']=_0x3756f6);return _0x9de953;}export function hasAPIKey(_0x219b4e){const _0x22278=a52_0x5651,_0x3fdcc2=getAPIKey();return _0x3fdcc2!==undefined&&_0x3fdcc2[_0x22278(0xa1)]>0x0;}
@@ -1 +1 @@
1
- (function(_0xc0f724,_0x2bf929){const _0x3ac218=a53_0x3251,_0x462e10=_0xc0f724();while(!![]){try{const _0x28a45b=-parseInt(_0x3ac218(0x1f0))/0x1+parseInt(_0x3ac218(0x208))/0x2*(-parseInt(_0x3ac218(0x210))/0x3)+parseInt(_0x3ac218(0x20f))/0x4+-parseInt(_0x3ac218(0x200))/0x5*(parseInt(_0x3ac218(0x206))/0x6)+-parseInt(_0x3ac218(0x1e0))/0x7*(-parseInt(_0x3ac218(0x209))/0x8)+-parseInt(_0x3ac218(0x1d5))/0x9+parseInt(_0x3ac218(0x21e))/0xa*(parseInt(_0x3ac218(0x219))/0xb);if(_0x28a45b===_0x2bf929)break;else _0x462e10['push'](_0x462e10['shift']());}catch(_0x276fb0){_0x462e10['push'](_0x462e10['shift']());}}}(a53_0x6ae3,0x1bfa4));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x2094aa from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x436c69){const _0x9f61b2=a53_0x3251;return _0x436c69[_0x9f61b2(0x1ef)]===_0x9f61b2(0x1e2)||_0x436c69['format']===_0x9f61b2(0x20d)||_0x436c69[_0x9f61b2(0x1ef)]===_0x9f61b2(0x1f3)||_0x436c69[_0x9f61b2(0x1ef)]===_0x9f61b2(0x20e)||_0x436c69[_0x9f61b2(0x1e2)]===!![]||_0x436c69[_0x9f61b2(0x20d)]===!![]||_0x436c69[_0x9f61b2(0x1f3)]===!![]||_0x436c69[_0x9f61b2(0x20e)]===!![];}export function parseOutputOptions(_0x14e8e3){const _0x412e62=a53_0x3251;return{'format':_0x14e8e3[_0x412e62(0x1ef)]||'table','output':_0x14e8e3[_0x412e62(0x1ed)]||'','limit':_0x14e8e3[_0x412e62(0x214)],'limitStructuredFormats':_0x14e8e3[_0x412e62(0x1fa)],'color':_0x14e8e3[_0x412e62(0x1e9)],'noColor':_0x14e8e3[_0x412e62(0x218)]};}function convertSDKResultToQueryResult(_0xd7cbe3){const _0xca7b17=a53_0x3251,_0x9c803=[];if(_0xd7cbe3[_0xca7b17(0x204)]>0x0){const _0x4dd4a1=_0xd7cbe3[0x0];for(const [_0x50fadc,_0x105d56]of Object['entries'](_0x4dd4a1)){let _0x34c2b3=_0xca7b17(0x1e3);if(typeof _0x105d56===_0xca7b17(0x1da))_0x34c2b3=Number[_0xca7b17(0x1f1)](_0x105d56)?_0xca7b17(0x205):_0xca7b17(0x215);else{if(typeof _0x105d56===_0xca7b17(0x1fb))_0x34c2b3='boolean';else _0x105d56===null&&(_0x34c2b3=_0xca7b17(0x1e3));}_0x9c803['push']({'name':_0x50fadc,'type':_0x34c2b3});}}return{'queryId':_0xca7b17(0x216),'columns':_0x9c803,'data':_0xd7cbe3,'stats':{'state':_0xca7b17(0x1dc),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xd7cbe3[_0xca7b17(0x204)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x52292a,_0x2f49d8){const _0x1066c6=convertSDKResultToQueryResult(_0x52292a);return formatQueryOutput(_0x1066c6,_0x2f49d8);}function a53_0x6ae3(){const _0x4e19e6=['270483GnRCvY','cyan','close','[error]','limit','double','sdk-result','debug','noColor','4642891sKmzsv','map','params','trim','split','10OZFaJU','max','[Object]','magenta','1640124lPnAoM','object','[logs]','spawn','push','number','blue','FINISHED','stringify','padEnd','less','364iMYFMh','No\x20data','json','varchar','log','write','bold','stderr','entries','color','list','forEach','─┬─','output','yellow','format','26874VNmQVK','isInteger','red','tsv','join','error','Results\x20saved\x20to\x20','resolve','cmdout','isFinite','limitStructuredFormats','boolean','end','repeat','stdout','inherit','219345dxYRwI','pipe','isTTY','rule','length','bigint','24RVUjQD','keys','4ActzwB','10408VZbfAN','data','stdin','query','jsonl','table','759084ZAjkFu'];a53_0x6ae3=function(){return _0x4e19e6;};return a53_0x6ae3();}export async function formatQueryOutput(_0x21929a,_0x5e5903){const _0x196212=a53_0x3251,{format:_0x4f4ab1,limit:_0x4676fd,output:_0x315eb6,color:_0x2c04ae,noColor:_0x366571,limitStructuredFormats:_0x5a19e4}=_0x5e5903,_0x4404b7=Boolean(_0x315eb6)&&!_0x2c04ae,_0xc67e80={'color':_0x2c04ae,'noColor':_0x366571||_0x4404b7};if(_0x4f4ab1===_0x196212(0x20e)){const _0x313112=shouldUseLess(_0x4f4ab1,_0x315eb6);return formatAsTable(_0x21929a,_0x4676fd,_0x313112,_0xc67e80);}const _0x22c501=_0x5a19e4&&Number[_0x196212(0x1f9)](_0x4676fd)&&_0x21929a[_0x196212(0x20a)][_0x196212(0x204)]>_0x4676fd?{..._0x21929a,'data':_0x21929a[_0x196212(0x20a)]['slice'](0x0,_0x4676fd)}:_0x21929a;if(_0x4f4ab1===_0x196212(0x1e2))return formatAsJSON(_0x22c501,_0xc67e80);else return _0x4f4ab1===_0x196212(0x20d)?formatAsJSONL(_0x22c501,_0xc67e80):formatQueryResult(_0x22c501,_0x4f4ab1);}function shouldUseLess(_0x39188b,_0x420269){const _0xc9e94c=a53_0x3251;return(_0x39188b===_0xc9e94c(0x20e)||_0x39188b===_0xc9e94c(0x1ea))&&process[_0xc9e94c(0x1fe)][_0xc9e94c(0x202)]&&!_0x420269;}function a53_0x3251(_0x228c86,_0x1ee462){_0x228c86=_0x228c86-0x1d4;const _0x6ae388=a53_0x6ae3();let _0x3251b8=_0x6ae388[_0x228c86];return _0x3251b8;}export function resolveOutputOptions(_0x1a4750){const _0x4a41be=a53_0x3251,_0x5ec557=_0x1a4750['output']||'',_0x3b5985=resolveOutputFormat(_0x1a4750['format'],_0x5ec557,'table');let _0x2027e5=typeof _0x1a4750['limit']===_0x4a41be(0x1da)?_0x1a4750[_0x4a41be(0x214)]:parseInt(_0x1a4750[_0x4a41be(0x214)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1a4750[_0x4a41be(0x214)]===undefined&&shouldUseLess(_0x3b5985,_0x5ec557)&&(_0x2027e5=Infinity),{'format':_0x3b5985,'output':_0x5ec557,'limit':_0x2027e5,'limitStructuredFormats':_0x1a4750[_0x4a41be(0x1fa)],'color':_0x1a4750[_0x4a41be(0x1e9)],'noColor':_0x1a4750[_0x4a41be(0x218)]};}export function writeOutput(_0x3e129f,_0x1a8a5c,_0x50cf81){const _0x2efc38=a53_0x3251;return _0x1a8a5c?(writeFileSync(_0x1a8a5c,_0x3e129f),console[_0x2efc38(0x1f5)](_0x2efc38(0x1f6)+_0x1a8a5c),Promise[_0x2efc38(0x1f7)]()):shouldUseLess(_0x50cf81||'','')?new Promise(_0x52e4e0=>{const _0x381533=_0x2efc38,_0x343628=spawn(_0x381533(0x1df),['-FXRSn'],{'stdio':[_0x381533(0x201),_0x381533(0x1ff),_0x381533(0x1ff)]});let _0x3ee984=![];_0x343628['on'](_0x381533(0x1f5),()=>{const _0x53fb32=_0x381533;!_0x3ee984&&(_0x3ee984=!![],console[_0x53fb32(0x1e4)](_0x3e129f),_0x52e4e0());}),_0x343628['on'](_0x381533(0x212),()=>{!_0x3ee984&&(_0x3ee984=!![],_0x52e4e0());}),_0x343628['on'](_0x381533(0x1d8),()=>{const _0xe94164=_0x381533;!_0x3ee984&&_0x343628[_0xe94164(0x20b)]&&(_0x343628[_0xe94164(0x20b)]['on'](_0xe94164(0x1f5),()=>{}),_0x343628[_0xe94164(0x20b)][_0xe94164(0x1e5)](_0x3e129f),_0x343628[_0xe94164(0x20b)][_0xe94164(0x1fc)]());}),!_0x343628[_0x381533(0x20b)]&&(!_0x3ee984&&(_0x3ee984=!![],console[_0x381533(0x1e4)](_0x3e129f),_0x52e4e0()));}):(console['log'](_0x3e129f),Promise[_0x2efc38(0x1f7)]());}export async function handleSDKOutput(_0x58981d,_0x46e7aa){const _0x3848f1=a53_0x3251,_0x1f4071=resolveOutputOptions(_0x46e7aa),_0xfc7914=await formatSDKOutput(_0x58981d,_0x1f4071);await writeOutput(_0xfc7914,_0x1f4071[_0x3848f1(0x1ed)]||undefined,_0x1f4071[_0x3848f1(0x1ef)]);}export async function handleQueryOutput(_0x277a4b,_0x2c1d5f){const _0x33e162=a53_0x3251,_0xd9e495=resolveOutputOptions(_0x2c1d5f),_0x70bb5b=await formatQueryOutput(_0x277a4b,_0xd9e495);await writeOutput(_0x70bb5b,_0xd9e495[_0x33e162(0x1ed)]||undefined,_0xd9e495[_0x33e162(0x1ef)]);}async function formatSingleObject(_0x4cc94e,_0x17ba3){const _0x1e849d=a53_0x3251,{format:_0x4ada02,color:_0x301139,noColor:_0xd38cae}=_0x17ba3,_0x5006d3={'color':_0x301139,'noColor':_0xd38cae};if(_0x4ada02==='json'){if(shouldUseColor(_0x5006d3))return colorizeJSON(_0x4cc94e,_0x5006d3);return JSON['stringify'](_0x4cc94e,null,0x2);}else{if(_0x4ada02===_0x1e849d(0x20d)){if(shouldUseColor(_0x5006d3))return colorizeJSONCompact(_0x4cc94e,_0x5006d3);return JSON[_0x1e849d(0x1dd)](_0x4cc94e);}else{if(_0x4ada02==='tsv')return Object[_0x1e849d(0x1e8)](_0x4cc94e)[_0x1e849d(0x21a)](([_0x198971,_0x4abd2c])=>_0x198971+'\x09'+_0x4abd2c)[_0x1e849d(0x1f4)]('\x0a');else{const _0x3f97b1=Object[_0x1e849d(0x1e8)](_0x4cc94e);if(_0x3f97b1[_0x1e849d(0x204)]===0x0)return _0x1e849d(0x1e1);const _0x5aeeca=_0x4cc94e[_0x1e849d(0x217)],_0x510199=_0x4cc94e[_0x1e849d(0x20c)],_0x251e3c=_0x4cc94e[_0x1e849d(0x21b)],_0x897c91=_0x4cc94e[_0x1e849d(0x203)],_0x2c5586=_0x510199?typeof _0x510199==='string'?_0x510199:JSON[_0x1e849d(0x1dd)](_0x510199,null,0x2):undefined,_0x36b688=_0x251e3c&&Object['keys'](_0x251e3c)[_0x1e849d(0x204)]>0x0?JSON[_0x1e849d(0x1dd)](_0x251e3c,null,0x2):undefined,_0x4d507e=_0x897c91&&Object[_0x1e849d(0x207)](_0x897c91)[_0x1e849d(0x204)]>0x0?JSON['stringify'](_0x897c91,null,0x2):undefined,_0x3d46df=_0x3f97b1['filter'](([_0x58f9de])=>_0x58f9de!==_0x1e849d(0x217)&&_0x58f9de!=='query'&&_0x58f9de!=='params'&&_0x58f9de!==_0x1e849d(0x203)),_0x10d52f=Math['max'](..._0x3d46df['map'](([_0x17fe3c])=>_0x17fe3c['length'])),_0xa7378f=Math['max'](..._0x3d46df[_0x1e849d(0x21a)](([,_0x38c9f7])=>{const _0x3c7a93=_0x1e849d;try{const _0x39a01a=_0x38c9f7===null||_0x38c9f7===undefined?'':typeof _0x38c9f7===_0x3c7a93(0x1d6)?JSON[_0x3c7a93(0x1dd)](_0x38c9f7):String(_0x38c9f7),_0x4bd5a4=_0x39a01a[_0x3c7a93(0x21d)]('\x0a');return Math[_0x3c7a93(0x21f)](..._0x4bd5a4['map'](_0x4cfa5f=>_0x4cfa5f[_0x3c7a93(0x204)]),0x0);}catch{return 0x0;}}),0x14),_0x2126f3=[];_0x2126f3['push'](colorBorder('┌─'+'─'[_0x1e849d(0x1fd)](_0x10d52f)+_0x1e849d(0x1ec)+'─'[_0x1e849d(0x1fd)](_0xa7378f)+'─┐',_0x5006d3)),_0x3d46df['forEach'](([_0xe60c43,_0x905c6f])=>{const _0x264487=_0x1e849d;let _0x200058;try{_0x200058=_0x905c6f===null||_0x905c6f===undefined?'':typeof _0x905c6f===_0x264487(0x1d6)?JSON[_0x264487(0x1dd)](_0x905c6f):String(_0x905c6f);}catch{_0x200058=_0x264487(0x220);}const _0x19aeae=_0xe60c43[_0x264487(0x1de)](_0x10d52f),_0x1a28bd=_0x200058[_0x264487(0x21d)]('\x0a');_0x1a28bd[_0x264487(0x1eb)]((_0x5ad86f,_0xef1584)=>{const _0x23e5c6=_0x264487,_0x64b9dd=colorBorder('│',_0x5006d3);_0xef1584===0x0?_0x2126f3['push'](_0x64b9dd+'\x20'+_0x19aeae+'\x20'+_0x64b9dd+'\x20'+_0x5ad86f['padEnd'](_0xa7378f)+'\x20'+_0x64b9dd):_0x2126f3[_0x23e5c6(0x1d9)](_0x64b9dd+'\x20'+'\x20'[_0x23e5c6(0x1fd)](_0x10d52f)+'\x20'+_0x64b9dd+'\x20'+_0x5ad86f[_0x23e5c6(0x1de)](_0xa7378f)+'\x20'+_0x64b9dd);});}),_0x2126f3[_0x1e849d(0x1d9)](colorBorder('└─'+'─'[_0x1e849d(0x1fd)](_0x10d52f)+'─┴─'+'─'['repeat'](_0xa7378f)+'─┘',_0x5006d3));_0x2c5586&&(_0x2126f3[_0x1e849d(0x1d9)](''),_0x2126f3[_0x1e849d(0x1d9)](String(a53_0x2094aa[_0x1e849d(0x1ee)][_0x1e849d(0x1e6)]('[query]'))),_0x2126f3[_0x1e849d(0x1d9)](_0x2c5586));_0x36b688&&(_0x2126f3[_0x1e849d(0x1d9)](''),_0x2126f3[_0x1e849d(0x1d9)](String(a53_0x2094aa[_0x1e849d(0x1db)][_0x1e849d(0x1e6)]('[params]'))),_0x2126f3[_0x1e849d(0x1d9)](_0x36b688));_0x4d507e&&(_0x2126f3['push'](''),_0x2126f3[_0x1e849d(0x1d9)](String(a53_0x2094aa[_0x1e849d(0x1d4)]['bold']('[rule]'))),_0x2126f3[_0x1e849d(0x1d9)](_0x4d507e));if(_0x5aeeca){if(_0x5aeeca[_0x1e849d(0x1e7)]){_0x2126f3['push'](''),_0x2126f3[_0x1e849d(0x1d9)](String(a53_0x2094aa[_0x1e849d(0x1f2)]['bold'](_0x1e849d(0x213))));const _0x18f907=_0x5aeeca['stderr']['split']('\x0a');_0x18f907[_0x1e849d(0x1eb)](_0x14ea29=>{const _0x33191f=_0x1e849d;_0x14ea29[_0x33191f(0x21c)]()&&_0x2126f3[_0x33191f(0x1d9)](_0x14ea29);});}if(_0x5aeeca[_0x1e849d(0x1f8)]){_0x2126f3['push'](''),_0x2126f3[_0x1e849d(0x1d9)](String(a53_0x2094aa[_0x1e849d(0x211)][_0x1e849d(0x1e6)](_0x1e849d(0x1d7))));const _0x1bac63=_0x5aeeca[_0x1e849d(0x1f8)][_0x1e849d(0x21d)]('\x0a');_0x1bac63[_0x1e849d(0x1eb)](_0x30ebce=>{const _0x5bc0a4=_0x1e849d;_0x30ebce['trim']()&&_0x2126f3[_0x5bc0a4(0x1d9)](_0x30ebce);});}}return _0x2126f3['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x4af996,_0x3bea90){const _0x28f040=a53_0x3251;if(_0x3bea90[_0x28f040(0x1ef)]===_0x28f040(0x20e)){await handleSDKOutput([_0x4af996],_0x3bea90);return;}const _0x5b5d0c=resolveOutputOptions(_0x3bea90),_0xf73dfa=await formatSingleObject(_0x4af996,_0x5b5d0c);await writeOutput(_0xf73dfa,_0x5b5d0c[_0x28f040(0x1ed)]||undefined,_0x5b5d0c[_0x28f040(0x1ef)]);}
1
+ (function(_0x15defb,_0x142ee3){const _0x2eb4e3=a53_0xba0a,_0x26bfba=_0x15defb();while(!![]){try{const _0x521888=-parseInt(_0x2eb4e3(0x196))/0x1+-parseInt(_0x2eb4e3(0x1b9))/0x2+parseInt(_0x2eb4e3(0x1c6))/0x3*(-parseInt(_0x2eb4e3(0x19b))/0x4)+-parseInt(_0x2eb4e3(0x1bf))/0x5+parseInt(_0x2eb4e3(0x1c1))/0x6*(parseInt(_0x2eb4e3(0x1d3))/0x7)+-parseInt(_0x2eb4e3(0x1d4))/0x8*(-parseInt(_0x2eb4e3(0x192))/0x9)+-parseInt(_0x2eb4e3(0x1ab))/0xa*(-parseInt(_0x2eb4e3(0x1b0))/0xb);if(_0x521888===_0x142ee3)break;else _0x26bfba['push'](_0x26bfba['shift']());}catch(_0x27ae75){_0x26bfba['push'](_0x26bfba['shift']());}}}(a53_0x22e0,0x61412));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a53_0x9b76a7 from'chalk';function a53_0x22e0(){const _0x46fa95=['filter','stringify','write','output','tsv','yellow','189050IkwRHd','data','stdin','repeat','spawn','506PAzaMo','end','string','number','inherit','table','object','length','slice','142814XLoJAL','varchar','query','stdout','debug','keys','2578375bqmieX','padEnd','259110wzWLuO','map','entries','forEach','resolve','814653eMyqoN','magenta','limitStructuredFormats','stderr','list','push','cyan','[logs]','─┬─','rule','isFinite','─┴─','FINISHED','98exClxG','75832HckdZC','boolean','join','limit','isInteger','close','error','max','format','params','81oFgxoT','[rule]','No\x20data','[Object]','302544coPIRD','pipe','trim','log','json','4GnKSbl','isTTY','jsonl','sdk-result','noColor','bold','split','color','less','bigint'];a53_0x22e0=function(){return _0x46fa95;};return a53_0x22e0();}function a53_0xba0a(_0x2d3484,_0x3a2cfb){_0x2d3484=_0x2d3484-0x192;const _0x22e0d8=a53_0x22e0();let _0xba0af6=_0x22e0d8[_0x2d3484];return _0xba0af6;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xc11c4){const _0x35d363=a53_0xba0a;return _0xc11c4['format']===_0x35d363(0x19a)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x19d)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1a9)||_0xc11c4[_0x35d363(0x1dc)]===_0x35d363(0x1b5)||_0xc11c4['json']===!![]||_0xc11c4['jsonl']===!![]||_0xc11c4[_0x35d363(0x1a9)]===!![]||_0xc11c4['table']===!![];}export function parseOutputOptions(_0x169e5e){const _0x1baa01=a53_0xba0a;return{'format':_0x169e5e['format']||_0x1baa01(0x1b5),'output':_0x169e5e[_0x1baa01(0x1a8)]||'','limit':_0x169e5e['limit'],'limitStructuredFormats':_0x169e5e[_0x1baa01(0x1c8)],'color':_0x169e5e[_0x1baa01(0x1a2)],'noColor':_0x169e5e[_0x1baa01(0x19f)]};}function convertSDKResultToQueryResult(_0x19ca06){const _0x253fca=a53_0xba0a,_0x232bcb=[];if(_0x19ca06[_0x253fca(0x1b7)]>0x0){const _0x4aeba2=_0x19ca06[0x0];for(const [_0x241ee2,_0x354fed]of Object['entries'](_0x4aeba2)){let _0x2ffc23=_0x253fca(0x1ba);if(typeof _0x354fed==='number')_0x2ffc23=Number[_0x253fca(0x1d8)](_0x354fed)?_0x253fca(0x1a4):'double';else{if(typeof _0x354fed===_0x253fca(0x1d5))_0x2ffc23=_0x253fca(0x1d5);else _0x354fed===null&&(_0x2ffc23=_0x253fca(0x1ba));}_0x232bcb['push']({'name':_0x241ee2,'type':_0x2ffc23});}}return{'queryId':_0x253fca(0x19e),'columns':_0x232bcb,'data':_0x19ca06,'stats':{'state':_0x253fca(0x1d2),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x19ca06[_0x253fca(0x1b7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x7b8866,_0x5d8fe2){const _0x5f540c=convertSDKResultToQueryResult(_0x7b8866);return formatQueryOutput(_0x5f540c,_0x5d8fe2);}export async function formatQueryOutput(_0x940c6a,_0x21d00f){const _0x58ea0b=a53_0xba0a,{format:_0x3155d6,limit:_0x5be50d,output:_0x4f9c7d,color:_0x5df2ca,noColor:_0x5339a4,limitStructuredFormats:_0x218bec}=_0x21d00f,_0x1b956d=Boolean(_0x4f9c7d)&&!_0x5df2ca,_0x84fb49={'color':_0x5df2ca,'noColor':_0x5339a4||_0x1b956d};if(_0x3155d6===_0x58ea0b(0x1b5)){const _0x518047=shouldUseLess(_0x3155d6,_0x4f9c7d);return formatAsTable(_0x940c6a,_0x5be50d,_0x518047,_0x84fb49);}const _0x418e57=_0x218bec&&Number[_0x58ea0b(0x1d0)](_0x5be50d)&&_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b7)]>_0x5be50d?{..._0x940c6a,'data':_0x940c6a[_0x58ea0b(0x1ac)][_0x58ea0b(0x1b8)](0x0,_0x5be50d)}:_0x940c6a;if(_0x3155d6===_0x58ea0b(0x19a))return formatAsJSON(_0x418e57,_0x84fb49);else return _0x3155d6===_0x58ea0b(0x19d)?formatAsJSONL(_0x418e57,_0x84fb49):formatQueryResult(_0x418e57,_0x3155d6);}function shouldUseLess(_0x18cdbd,_0x551824){const _0x5de25e=a53_0xba0a;return(_0x18cdbd===_0x5de25e(0x1b5)||_0x18cdbd===_0x5de25e(0x1ca))&&process[_0x5de25e(0x1bc)][_0x5de25e(0x19c)]&&!_0x551824;}export function resolveOutputOptions(_0x25ec71){const _0x270886=a53_0xba0a,_0x3bd9ee=_0x25ec71['output']||'',_0x39681a=resolveOutputFormat(_0x25ec71['format'],_0x3bd9ee,_0x270886(0x1b5));let _0xcd99b7=typeof _0x25ec71[_0x270886(0x1d7)]===_0x270886(0x1b3)?_0x25ec71[_0x270886(0x1d7)]:parseInt(_0x25ec71[_0x270886(0x1d7)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x25ec71['limit']===undefined&&shouldUseLess(_0x39681a,_0x3bd9ee)&&(_0xcd99b7=Infinity),{'format':_0x39681a,'output':_0x3bd9ee,'limit':_0xcd99b7,'limitStructuredFormats':_0x25ec71[_0x270886(0x1c8)],'color':_0x25ec71[_0x270886(0x1a2)],'noColor':_0x25ec71[_0x270886(0x19f)]};}export function writeOutput(_0x34a486,_0x207f1d,_0x24397f){const _0x91b530=a53_0xba0a;return _0x207f1d?(writeFileSync(_0x207f1d,_0x34a486),console[_0x91b530(0x1da)]('Results\x20saved\x20to\x20'+_0x207f1d),Promise[_0x91b530(0x1c5)]()):shouldUseLess(_0x24397f||'','')?new Promise(_0x111513=>{const _0x358fde=_0x91b530,_0x5ab744=spawn(_0x358fde(0x1a3),['-FXRSn'],{'stdio':[_0x358fde(0x197),'inherit',_0x358fde(0x1b4)]});let _0x4af442=![];_0x5ab744['on'](_0x358fde(0x1da),()=>{!_0x4af442&&(_0x4af442=!![],console['log'](_0x34a486),_0x111513());}),_0x5ab744['on'](_0x358fde(0x1d9),()=>{!_0x4af442&&(_0x4af442=!![],_0x111513());}),_0x5ab744['on'](_0x358fde(0x1af),()=>{const _0x193843=_0x358fde;!_0x4af442&&_0x5ab744[_0x193843(0x1ad)]&&(_0x5ab744['stdin']['on'](_0x193843(0x1da),()=>{}),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1a7)](_0x34a486),_0x5ab744[_0x193843(0x1ad)][_0x193843(0x1b1)]());}),!_0x5ab744['stdin']&&(!_0x4af442&&(_0x4af442=!![],console[_0x358fde(0x199)](_0x34a486),_0x111513()));}):(console[_0x91b530(0x199)](_0x34a486),Promise[_0x91b530(0x1c5)]());}export async function handleSDKOutput(_0x5c03b2,_0x20ed62){const _0x420e46=a53_0xba0a,_0x30bf80=resolveOutputOptions(_0x20ed62),_0x1fcf40=await formatSDKOutput(_0x5c03b2,_0x30bf80);await writeOutput(_0x1fcf40,_0x30bf80[_0x420e46(0x1a8)]||undefined,_0x30bf80[_0x420e46(0x1dc)]);}export async function handleQueryOutput(_0x5350e2,_0x197656){const _0x1963d9=resolveOutputOptions(_0x197656),_0x302fe3=await formatQueryOutput(_0x5350e2,_0x1963d9);await writeOutput(_0x302fe3,_0x1963d9['output']||undefined,_0x1963d9['format']);}async function formatSingleObject(_0x1d11da,_0x487ea){const _0x26cdda=a53_0xba0a,{format:_0x31e2dd,color:_0x492b97,noColor:_0xfc2e3d}=_0x487ea,_0x973eed={'color':_0x492b97,'noColor':_0xfc2e3d};if(_0x31e2dd===_0x26cdda(0x19a)){if(shouldUseColor(_0x973eed))return colorizeJSON(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da,null,0x2);}else{if(_0x31e2dd===_0x26cdda(0x19d)){if(shouldUseColor(_0x973eed))return colorizeJSONCompact(_0x1d11da,_0x973eed);return JSON[_0x26cdda(0x1a6)](_0x1d11da);}else{if(_0x31e2dd===_0x26cdda(0x1a9))return Object[_0x26cdda(0x1c3)](_0x1d11da)[_0x26cdda(0x1c2)](([_0x4a874e,_0x15b2cd])=>_0x4a874e+'\x09'+_0x15b2cd)[_0x26cdda(0x1d6)]('\x0a');else{const _0x119f6c=Object[_0x26cdda(0x1c3)](_0x1d11da);if(_0x119f6c['length']===0x0)return _0x26cdda(0x194);const _0x1a9d24=_0x1d11da[_0x26cdda(0x1bd)],_0x44c78c=_0x1d11da[_0x26cdda(0x1bb)],_0xec360f=_0x1d11da[_0x26cdda(0x1dd)],_0x58b278=_0x1d11da[_0x26cdda(0x1cf)],_0x479c58=_0x44c78c?typeof _0x44c78c===_0x26cdda(0x1b2)?_0x44c78c:JSON[_0x26cdda(0x1a6)](_0x44c78c,null,0x2):undefined,_0x521dcc=_0xec360f&&Object[_0x26cdda(0x1be)](_0xec360f)['length']>0x0?JSON[_0x26cdda(0x1a6)](_0xec360f,null,0x2):undefined,_0x1c50c5=_0x58b278&&Object[_0x26cdda(0x1be)](_0x58b278)[_0x26cdda(0x1b7)]>0x0?JSON['stringify'](_0x58b278,null,0x2):undefined,_0x1b4197=_0x119f6c[_0x26cdda(0x1a5)](([_0x2f25fd])=>_0x2f25fd!==_0x26cdda(0x1bd)&&_0x2f25fd!==_0x26cdda(0x1bb)&&_0x2f25fd!==_0x26cdda(0x1dd)&&_0x2f25fd!==_0x26cdda(0x1cf)),_0x39af61=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([_0x31a301])=>_0x31a301[_0x26cdda(0x1b7)])),_0x4fab91=Math[_0x26cdda(0x1db)](..._0x1b4197[_0x26cdda(0x1c2)](([,_0x3a49ee])=>{const _0x357676=_0x26cdda;try{const _0x15c039=_0x3a49ee===null||_0x3a49ee===undefined?'':typeof _0x3a49ee===_0x357676(0x1b6)?JSON['stringify'](_0x3a49ee):String(_0x3a49ee),_0x470f29=_0x15c039[_0x357676(0x1a1)]('\x0a');return Math['max'](..._0x470f29[_0x357676(0x1c2)](_0x51db4e=>_0x51db4e[_0x357676(0x1b7)]),0x0);}catch{return 0x0;}}),0x14),_0x8e1748=[];_0x8e1748[_0x26cdda(0x1cb)](colorBorder('┌─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1ce)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┐',_0x973eed)),_0x1b4197[_0x26cdda(0x1c4)](([_0x3f0934,_0x450c34])=>{const _0x276a4b=_0x26cdda;let _0x24be2f;try{_0x24be2f=_0x450c34===null||_0x450c34===undefined?'':typeof _0x450c34==='object'?JSON[_0x276a4b(0x1a6)](_0x450c34):String(_0x450c34);}catch{_0x24be2f=_0x276a4b(0x195);}const _0x2d00b1=_0x3f0934['padEnd'](_0x39af61),_0xa189fa=_0x24be2f[_0x276a4b(0x1a1)]('\x0a');_0xa189fa[_0x276a4b(0x1c4)]((_0x164b16,_0x6a569)=>{const _0x485f14=_0x276a4b,_0x16becd=colorBorder('│',_0x973eed);_0x6a569===0x0?_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+_0x2d00b1+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd):_0x8e1748[_0x485f14(0x1cb)](_0x16becd+'\x20'+'\x20'[_0x485f14(0x1ae)](_0x39af61)+'\x20'+_0x16becd+'\x20'+_0x164b16[_0x485f14(0x1c0)](_0x4fab91)+'\x20'+_0x16becd);});}),_0x8e1748[_0x26cdda(0x1cb)](colorBorder('└─'+'─'[_0x26cdda(0x1ae)](_0x39af61)+_0x26cdda(0x1d1)+'─'[_0x26cdda(0x1ae)](_0x4fab91)+'─┘',_0x973eed));_0x479c58&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1aa)][_0x26cdda(0x1a0)]('[query]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x479c58));_0x521dcc&&(_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7['blue'][_0x26cdda(0x1a0)]('[params]'))),_0x8e1748[_0x26cdda(0x1cb)](_0x521dcc));_0x1c50c5&&(_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7[_0x26cdda(0x1c7)][_0x26cdda(0x1a0)](_0x26cdda(0x193)))),_0x8e1748[_0x26cdda(0x1cb)](_0x1c50c5));if(_0x1a9d24){if(_0x1a9d24[_0x26cdda(0x1c9)]){_0x8e1748['push'](''),_0x8e1748['push'](String(a53_0x9b76a7['red'][_0x26cdda(0x1a0)]('[error]')));const _0x3b043e=_0x1a9d24[_0x26cdda(0x1c9)][_0x26cdda(0x1a1)]('\x0a');_0x3b043e['forEach'](_0x19477b=>{const _0x1219f0=_0x26cdda;_0x19477b[_0x1219f0(0x198)]()&&_0x8e1748[_0x1219f0(0x1cb)](_0x19477b);});}if(_0x1a9d24['cmdout']){_0x8e1748[_0x26cdda(0x1cb)](''),_0x8e1748[_0x26cdda(0x1cb)](String(a53_0x9b76a7[_0x26cdda(0x1cc)][_0x26cdda(0x1a0)](_0x26cdda(0x1cd))));const _0x3a4c10=_0x1a9d24['cmdout'][_0x26cdda(0x1a1)]('\x0a');_0x3a4c10[_0x26cdda(0x1c4)](_0x27903b=>{const _0x12dca3=_0x26cdda;_0x27903b['trim']()&&_0x8e1748[_0x12dca3(0x1cb)](_0x27903b);});}}return _0x8e1748[_0x26cdda(0x1d6)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x139137,_0x22541f){const _0x5477ea=a53_0xba0a;if(_0x22541f[_0x5477ea(0x1dc)]==='table'){await handleSDKOutput([_0x139137],_0x22541f);return;}const _0x195b11=resolveOutputOptions(_0x22541f),_0x41d90d=await formatSingleObject(_0x139137,_0x195b11);await writeOutput(_0x41d90d,_0x195b11[_0x5477ea(0x1a8)]||undefined,_0x195b11[_0x5477ea(0x1dc)]);}