@treasuredata/tdx 0.16.4 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.d.ts +4 -0
  12. package/dist/commands/agent-test-command.d.ts.map +1 -1
  13. package/dist/commands/agent-test-command.js +1 -1
  14. package/dist/commands/agent-test-command.js.map +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.d.ts.map +1 -1
  17. package/dist/commands/auth-command.js +1 -1
  18. package/dist/commands/auth-command.js.map +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/llm-proxy.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/profile-command.d.ts.map +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profile-command.js.map +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.d.ts +7 -5
  58. package/dist/core/config.d.ts.map +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/config.js.map +1 -1
  61. package/dist/core/connection-cache.d.ts.map +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/connection-cache.js.map +1 -1
  64. package/dist/core/constants.d.ts +22 -0
  65. package/dist/core/constants.d.ts.map +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/constants.js.map +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.d.ts.map +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/keychain.js.map +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.d.ts.map +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/user-cache.js.map +1 -1
  79. package/dist/core/version.d.ts +2 -2
  80. package/dist/core/version.js +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/mcp/server.js +1 -1
  83. package/dist/mcp/tools/index.js +1 -1
  84. package/dist/mcp/tools/tdx-run.js +1 -1
  85. package/dist/mcp/tools/tdx-search.js +1 -1
  86. package/dist/mcp/utils.js +1 -1
  87. package/dist/proxy/anthropic-adapter.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  90. package/dist/proxy/context-signature.js +1 -1
  91. package/dist/proxy/conversation-utils.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/server.js +1 -1
  94. package/dist/proxy/session-cache.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.d.ts +2 -0
  99. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  100. package/dist/sdk/agent/agent-yaml.js +1 -1
  101. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  102. package/dist/sdk/agent/test/evaluator.d.ts +3 -6
  103. package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
  104. package/dist/sdk/agent/test/evaluator.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js.map +1 -1
  106. package/dist/sdk/agent/test/executor.d.ts +57 -1
  107. package/dist/sdk/agent/test/executor.d.ts.map +1 -1
  108. package/dist/sdk/agent/test/executor.js +1 -1
  109. package/dist/sdk/agent/test/executor.js.map +1 -1
  110. package/dist/sdk/agent/test/index.d.ts +2 -2
  111. package/dist/sdk/agent/test/index.d.ts.map +1 -1
  112. package/dist/sdk/agent/test/index.js +1 -1
  113. package/dist/sdk/agent/test/index.js.map +1 -1
  114. package/dist/sdk/agent/test/output.js +1 -1
  115. package/dist/sdk/agent/test/parser.d.ts.map +1 -1
  116. package/dist/sdk/agent/test/parser.js +1 -1
  117. package/dist/sdk/agent/test/parser.js.map +1 -1
  118. package/dist/sdk/agent/test/types.d.ts +44 -0
  119. package/dist/sdk/agent/test/types.d.ts.map +1 -1
  120. package/dist/sdk/api.js +1 -1
  121. package/dist/sdk/claude-agent/claude-agent-client.d.ts +13 -0
  122. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  123. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  124. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  125. package/dist/sdk/claude-agent/environment.js +1 -1
  126. package/dist/sdk/claude-agent/index.js +1 -1
  127. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  128. package/dist/sdk/client/cdp-api-client.js +1 -1
  129. package/dist/sdk/client/endpoints.js +1 -1
  130. package/dist/sdk/client/endpoints.js.map +1 -1
  131. package/dist/sdk/client/engage-api-client.js +1 -1
  132. package/dist/sdk/client/http-client.js +1 -1
  133. package/dist/sdk/client/llm-api-client.d.ts +6 -0
  134. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  135. package/dist/sdk/client/llm-api-client.js +1 -1
  136. package/dist/sdk/client/llm-api-client.js.map +1 -1
  137. package/dist/sdk/client/rate-limiter.js +1 -1
  138. package/dist/sdk/client/td-api-client.js +1 -1
  139. package/dist/sdk/client/trino-api-client.js +1 -1
  140. package/dist/sdk/client/workflow-client.js +1 -1
  141. package/dist/sdk/connection-validator.js +1 -1
  142. package/dist/sdk/connection.js +1 -1
  143. package/dist/sdk/engage.js +1 -1
  144. package/dist/sdk/errors.js +1 -1
  145. package/dist/sdk/index.js +1 -1
  146. package/dist/sdk/io/index.js +1 -1
  147. package/dist/sdk/io/node-filesystem.js +1 -1
  148. package/dist/sdk/job.js +1 -1
  149. package/dist/sdk/journey.js +1 -1
  150. package/dist/sdk/llm/chat-cache.d.ts.map +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/chat-cache.js.map +1 -1
  153. package/dist/sdk/llm/index.d.ts +11 -3
  154. package/dist/sdk/llm/index.d.ts.map +1 -1
  155. package/dist/sdk/llm/index.js +1 -1
  156. package/dist/sdk/llm/index.js.map +1 -1
  157. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  158. package/dist/sdk/llm/model-aliases.js +1 -1
  159. package/dist/sdk/llm/model-factors.js +1 -1
  160. package/dist/sdk/query/index.js +1 -1
  161. package/dist/sdk/query/sql-parser.js +1 -1
  162. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  163. package/dist/sdk/segment/fields-display.js +1 -1
  164. package/dist/sdk/segment/file-discovery.js +1 -1
  165. package/dist/sdk/segment/journey-utils.js +1 -1
  166. package/dist/sdk/segment/journey-yaml.js +1 -1
  167. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  168. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  169. package/dist/sdk/segment/pull-workflow.js +1 -1
  170. package/dist/sdk/segment/push-workflow.js +1 -1
  171. package/dist/sdk/segment/resolution-context.js +1 -1
  172. package/dist/sdk/segment/segment-path-parser.js +1 -1
  173. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  174. package/dist/sdk/segment/target-resolution.js +1 -1
  175. package/dist/sdk/segment/tdx-config.js +1 -1
  176. package/dist/sdk/segment/validate-files.js +1 -1
  177. package/dist/sdk/segment/yaml-validator.js +1 -1
  178. package/dist/sdk/segment.js +1 -1
  179. package/dist/sdk/types/index.js +1 -1
  180. package/dist/sdk/types/llm.d.ts +39 -0
  181. package/dist/sdk/types/llm.d.ts.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/user.js +1 -1
  184. package/dist/sdk/util/format-detector.js +1 -1
  185. package/dist/sdk/util/formatters.js +1 -1
  186. package/dist/sdk/util/index.js +1 -1
  187. package/dist/sdk/util/tree-formatter.js +1 -1
  188. package/dist/sdk/workflow/clone-workflow.js +1 -1
  189. package/dist/sdk/workflow/index.js +1 -1
  190. package/dist/sdk/workflow/pull-workflow.js +1 -1
  191. package/dist/sdk/workflow/push-workflow.js +1 -1
  192. package/dist/sdk/workflow/tdx-config.js +1 -1
  193. package/dist/sdk/workflow/workflow-utils.js +1 -1
  194. package/dist/utils/async.js +1 -1
  195. package/dist/utils/colors.js +1 -1
  196. package/dist/utils/diff.js +1 -1
  197. package/dist/utils/file-permissions.js +1 -1
  198. package/dist/utils/global-cache.d.ts +88 -0
  199. package/dist/utils/global-cache.d.ts.map +1 -0
  200. package/dist/utils/global-cache.js +1 -0
  201. package/dist/utils/global-cache.js.map +1 -0
  202. package/dist/utils/json-loader.js +1 -1
  203. package/dist/utils/local-cache.d.ts +48 -0
  204. package/dist/utils/local-cache.d.ts.map +1 -0
  205. package/dist/utils/local-cache.js +1 -0
  206. package/dist/utils/local-cache.js.map +1 -0
  207. package/dist/utils/option-validation.js +1 -1
  208. package/dist/utils/port.js +1 -1
  209. package/dist/utils/process.d.ts +10 -0
  210. package/dist/utils/process.d.ts.map +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/process.js.map +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/tdx-logger.js.map +1 -1
  220. package/dist/utils/version-check.d.ts.map +1 -1
  221. package/dist/utils/version-check.js +1 -1
  222. package/dist/utils/version-check.js.map +1 -1
  223. package/package.json +2 -2
@@ -1 +1 @@
1
- const a39_0x368670=a39_0x511f;function a39_0x511f(_0x5c5f10,_0x1d88b6){_0x5c5f10=_0x5c5f10-0xd9;const _0x50c25d=a39_0x50c2();let _0x511fc9=_0x50c25d[_0x5c5f10];return _0x511fc9;}function a39_0x50c2(){const _0x56ce66=['agent','Default\x20profile\x20set\x20to:\x20','Set\x20session-level\x20context','profile','(session:\x20','Session\x20llm_project\x20set\x20to:\x20','6525342wMBcrn','debug','displayWithSources','toString','llm_project','validate','487089hCLiVJ','default','Session\x20database\x20set\x20to:\x20','8IFDYDG','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','description','engage_workspace','22279800cMKLfj','310563ZoCkfR','\x27\x20does\x20not\x20exist','site','includes','Session\x20agent\x20set\x20to:\x20','3983605ffRnek','Error:\x20','parent_segment','70EZjEpC','15393bvLhSk','database','7IjEIyd','4068AneIbp','dim','Session\x20profile\x20set\x20to:\x20','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','315CVnTYy','green','clear','session','join','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','cleared','Session\x20engage_workspace\x20set\x20to:\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','Error:\x20Profile\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','log','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','error','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','execute','Session\x20site\x20set\x20to:\x20','\x0aSaved\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','message','86yQOdQF','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','Default\x20site\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'];a39_0x50c2=function(){return _0x56ce66;};return a39_0x50c2();}(function(_0x5438f6,_0x165383){const _0x456d96=a39_0x511f,_0x477f73=_0x5438f6();while(!![]){try{const _0x443e85=-parseInt(_0x456d96(0xd9))/0x1*(-parseInt(_0x456d96(0xf9))/0x2)+parseInt(_0x456d96(0xe1))/0x3*(parseInt(_0x456d96(0xdc))/0x4)+parseInt(_0x456d96(0x116))/0x5+-parseInt(_0x456d96(0x103))/0x6*(-parseInt(_0x456d96(0xdb))/0x7)+-parseInt(_0x456d96(0x10c))/0x8*(parseInt(_0x456d96(0x109))/0x9)+parseInt(_0x456d96(0x119))/0xa*(parseInt(_0x456d96(0x111))/0xb)+-parseInt(_0x456d96(0x110))/0xc;if(_0x443e85===_0x165383)break;else _0x477f73['push'](_0x477f73['shift']());}catch(_0x51c274){_0x477f73['push'](_0x477f73['shift']());}}}(a39_0x50c2,0xe572e));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir}from'../core/config.js';import a39_0x3a92f6 from'chalk';import*as a39_0x5480f6 from'node:path';export class UseCommand extends BaseCommand{['name']='use';[a39_0x368670(0x10e)]=a39_0x368670(0xff);[a39_0x368670(0x108)](_0x4b417e){const _0xa1c910=a39_0x368670,{args:_0x462cb1,options:_0x35fcf1}=_0x4b417e,_0x5e82fd=_0x35fcf1[_0xa1c910(0x10a)];if(_0x462cb1[_0xa1c910(0xed)]===0x0)return undefined;if(_0x462cb1['length']===0x1)return _0xa1c910(0xf0)+_0xa1c910(0xf7)+_0xa1c910(0xee)+_0xa1c910(0xec)+_0xa1c910(0xfa)+_0xa1c910(0xf1)+_0xa1c910(0xe6);const _0x5c46c9=_0x462cb1[0x0],_0x4f3cef=[_0xa1c910(0x113),_0xa1c910(0xda),'parent_segment',_0xa1c910(0x107),_0xa1c910(0xfd),_0xa1c910(0x100),_0xa1c910(0x10f)];if(!_0x4f3cef[_0xa1c910(0x114)](_0x5c46c9))return'Invalid\x20resource:\x20'+_0x5c46c9+'.\x20Must\x20be\x20one\x20of:\x20'+_0x4f3cef[_0xa1c910(0xe5)](',\x20');if(_0x5e82fd&&_0x5c46c9!=='site'&&_0x5c46c9!==_0xa1c910(0x100))return _0xa1c910(0xea);return undefined;}async[a39_0x368670(0xf4)](_0x261c20){const _0x11e9e3=a39_0x368670,{args:_0x414f3a,options:_0x50fe74}=_0x261c20,_0x58bd60=_0x50fe74[_0x11e9e3(0x104)],_0x126e17=_0x50fe74[_0x11e9e3(0xe3)],_0x5c48c7=_0x50fe74['default'];cleanExpiredSessions();try{if(_0x126e17){clearSessionContext(_0x50fe74[_0x11e9e3(0xe4)]);const _0x1b9d6d=_0x50fe74[_0x11e9e3(0xe4)]||getCurrentSessionPID()[_0x11e9e3(0x106)]();return console[_0x11e9e3(0xef)]('Session\x20context\x20'+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x11e9e3(0xe8))+'\x20'+a39_0x3a92f6['dim'](_0x11e9e3(0x101)+_0x1b9d6d+')')),0x0;}if(_0x414f3a[_0x11e9e3(0xed)]===0x0){const _0x4fadc2=new GlobalContext(_0x50fe74);return _0x58bd60?_0x4fadc2[_0x11e9e3(0x105)]():_0x4fadc2['display'](),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xe0))),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xdf))),console['log'](a39_0x3a92f6[_0x11e9e3(0xdd)]('Use\x20--default\x20with\x20site\x20or\x20profile\x20to\x20save\x20permanently')),0x0;}const _0x4778a7=_0x414f3a[0x0],_0x26add9=_0x414f3a[0x1],_0x256cbf=a39_0x5480f6['join'](getConfigDir(),'tdx.json');if(_0x5c48c7){if(_0x4778a7===_0x11e9e3(0x113))return saveDefaultSiteToUserConfig(_0x26add9),console[_0x11e9e3(0xef)](_0x11e9e3(0xfb)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xf6)+_0x256cbf)),0x0;if(_0x4778a7==='profile'){if(!profileExists(_0x26add9))return console[_0x11e9e3(0xf2)](_0x11e9e3(0xeb)+_0x26add9+_0x11e9e3(0x112)),console[_0x11e9e3(0xf2)](_0x11e9e3(0xf3)),0x1;return saveActiveProfileToUserConfig(_0x26add9),console[_0x11e9e3(0xef)](_0x11e9e3(0xfe)+a39_0x3a92f6['green'](_0x26add9)),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xf6)+_0x256cbf)),0x0;}}if(_0x4778a7===_0x11e9e3(0x113)){const _0x2d7a00=_0x50fe74[_0x11e9e3(0xe4)]||getCurrentSessionPID()['toString']();return saveSessionContext({'site':_0x26add9},_0x50fe74[_0x11e9e3(0xe4)]),console[_0x11e9e3(0xef)](_0x11e9e3(0xf5)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x101)+_0x2d7a00+')')),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xfc)+_0x26add9+'\x27\x20to\x20save\x20permanently')),0x0;}if(_0x4778a7===_0x11e9e3(0x100)){if(!profileExists(_0x26add9))return console[_0x11e9e3(0xf2)](_0x11e9e3(0xeb)+_0x26add9+'\x27\x20does\x20not\x20exist'),console['error'](_0x11e9e3(0xf3)),0x1;const _0x5ed3e0=_0x50fe74[_0x11e9e3(0xe4)]||getCurrentSessionPID()[_0x11e9e3(0x106)]();return saveSessionContext({'profile':_0x26add9},_0x50fe74['session']),console[_0x11e9e3(0xef)](_0x11e9e3(0xde)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)]('(session:\x20'+_0x5ed3e0+')')),console[_0x11e9e3(0xef)](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0xe7)+_0x26add9+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x3c02cb={},_0xc3c4f5=_0x50fe74['session']||getCurrentSessionPID()[_0x11e9e3(0x106)]();switch(_0x4778a7){case _0x11e9e3(0xda):_0x3c02cb[_0x11e9e3(0xda)]=_0x26add9,console[_0x11e9e3(0xef)](_0x11e9e3(0x10b)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x101)+_0xc3c4f5+')'));break;case _0x11e9e3(0x118):_0x3c02cb['parent_segment']=_0x26add9,console['log']('Session\x20parent_segment\x20set\x20to:\x20'+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x101)+_0xc3c4f5+')'));break;case _0x11e9e3(0x107):_0x3c02cb[_0x11e9e3(0x107)]=_0x26add9,console[_0x11e9e3(0xef)]('Session\x20llm_project\x20set\x20to:\x20'+a39_0x3a92f6['green'](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x101)+_0xc3c4f5+')'));break;case _0x11e9e3(0xfd):{const {projectName:_0x1c3b85,agentName:_0x144f85}=parseAgentRef(_0x26add9);_0x144f85?(_0x3c02cb[_0x11e9e3(0x107)]=_0x1c3b85,_0x3c02cb['llm_agent']=_0x144f85,console[_0x11e9e3(0xef)](_0x11e9e3(0x102)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x1c3b85)+'\x20'+a39_0x3a92f6['dim']('(session:\x20'+_0xc3c4f5+')')),console['log'](_0x11e9e3(0x115)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x144f85)+'\x20'+a39_0x3a92f6['dim'](_0x11e9e3(0x101)+_0xc3c4f5+')'))):(_0x3c02cb['llm_agent']=_0x26add9,console['log'](_0x11e9e3(0x115)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x101)+_0xc3c4f5+')')));break;}case _0x11e9e3(0x10f):_0x3c02cb[_0x11e9e3(0x10f)]=_0x26add9,console[_0x11e9e3(0xef)](_0x11e9e3(0xe9)+a39_0x3a92f6[_0x11e9e3(0xe2)](_0x26add9)+'\x20'+a39_0x3a92f6['dim'](_0x11e9e3(0x101)+_0xc3c4f5+')'));break;}return saveSessionContext(_0x3c02cb,_0x50fe74[_0x11e9e3(0xe4)]),console['log'](a39_0x3a92f6[_0x11e9e3(0xdd)](_0x11e9e3(0x10d))),0x0;}catch(_0x11c0db){return _0x11c0db instanceof Error&&console[_0x11e9e3(0xf2)](_0x11e9e3(0x117)+_0x11c0db[_0x11e9e3(0xf8)]),0x1;}}}
1
+ const a39_0x6db7c=a39_0x5dc5;(function(_0xef5b1b,_0x3e8d38){const _0x14121e=a39_0x5dc5,_0x547d07=_0xef5b1b();while(!![]){try{const _0xc2e27d=parseInt(_0x14121e(0x179))/0x1+-parseInt(_0x14121e(0x187))/0x2+-parseInt(_0x14121e(0x14e))/0x3*(-parseInt(_0x14121e(0x169))/0x4)+-parseInt(_0x14121e(0x161))/0x5*(parseInt(_0x14121e(0x15c))/0x6)+-parseInt(_0x14121e(0x17e))/0x7*(parseInt(_0x14121e(0x16e))/0x8)+-parseInt(_0x14121e(0x17d))/0x9+parseInt(_0x14121e(0x152))/0xa;if(_0xc2e27d===_0x3e8d38)break;else _0x547d07['push'](_0x547d07['shift']());}catch(_0x1082cf){_0x547d07['push'](_0x547d07['shift']());}}}(a39_0x1e2b,0x5df15));function a39_0x1e2b(){const _0x37c41f=['Session\x20agent\x20set\x20to:\x20','length','Error:\x20Profile\x20\x27','Use\x20--default\x20with\x20site\x20or\x20profile\x20to\x20save\x20permanently','dim','toString','Default\x20profile\x20set\x20to:\x20','description','709048WWyzyA','\x27\x20does\x20not\x20exist','parent_segment','Error:\x20','4889574Qijijd','1022IuNOco','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','Session\x20engage_workspace\x20set\x20to:\x20','database','green','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','llm_project','370304knZjHj','clear','Invalid\x20resource:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x27\x20to\x20save\x20permanently','use','Session\x20context\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','4905LoPaPe','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','site','execute','13525090tfepWq','validate','agent','(session:\x20','cleared','\x0aSaved\x20to:\x20','Session\x20site\x20set\x20to:\x20','profile','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','tdx.json','4458XldqZB','debug','session','log','message','4135FJoRYK','display','Session\x20profile\x20set\x20to:\x20','Session\x20parent_segment\x20set\x20to:\x20','error','llm_agent','Default\x20site\x20set\x20to:\x20','includes','508AWeUBI','Session\x20database\x20set\x20to:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage_workspace','Session\x20llm_project\x20set\x20to:\x20','29672itMlNl','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','default'];a39_0x1e2b=function(){return _0x37c41f;};return a39_0x1e2b();}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir}from'../core/config.js';function a39_0x5dc5(_0x3bea10,_0x3d0874){_0x3bea10=_0x3bea10-0x14a;const _0x1e2bfd=a39_0x1e2b();let _0x5dc56b=_0x1e2bfd[_0x3bea10];return _0x5dc56b;}import a39_0x109606 from'chalk';import*as a39_0x49c4d1 from'node:path';export class UseCommand extends BaseCommand{['name']=a39_0x6db7c(0x14b);[a39_0x6db7c(0x178)]='Set\x20session-level\x20context';[a39_0x6db7c(0x153)](_0x139708){const _0x43b139=a39_0x6db7c,{args:_0x5c09ce,options:_0x53a000}=_0x139708,_0x3a1c90=_0x53a000[_0x43b139(0x170)];if(_0x5c09ce[_0x43b139(0x172)]===0x0)return undefined;if(_0x5c09ce[_0x43b139(0x172)]===0x1)return _0x43b139(0x17f)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a'+_0x43b139(0x185)+_0x43b139(0x15a)+_0x43b139(0x183);const _0x1a372f=_0x5c09ce[0x0],_0x474bf5=['site',_0x43b139(0x181),_0x43b139(0x17b),_0x43b139(0x186),_0x43b139(0x154),_0x43b139(0x159),_0x43b139(0x16c)];if(!_0x474bf5[_0x43b139(0x168)](_0x1a372f))return _0x43b139(0x189)+_0x1a372f+'.\x20Must\x20be\x20one\x20of:\x20'+_0x474bf5[_0x43b139(0x184)](',\x20');if(_0x3a1c90&&_0x1a372f!==_0x43b139(0x150)&&_0x1a372f!=='profile')return _0x43b139(0x18b);return undefined;}async[a39_0x6db7c(0x151)](_0x1d16c9){const _0x3dd7cd=a39_0x6db7c,{args:_0x42ebc6,options:_0x549549}=_0x1d16c9,_0x9bbd46=_0x549549[_0x3dd7cd(0x15d)],_0x270d24=_0x549549[_0x3dd7cd(0x188)],_0x1b738b=_0x549549[_0x3dd7cd(0x170)];cleanExpiredSessions();try{if(_0x270d24){clearSessionContext(_0x549549[_0x3dd7cd(0x15e)]);const _0x6fa558=_0x549549[_0x3dd7cd(0x15e)]||getCurrentSessionPID()[_0x3dd7cd(0x176)]();return console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x14c)+a39_0x109606[_0x3dd7cd(0x182)](_0x3dd7cd(0x156))+'\x20'+a39_0x109606['dim']('(session:\x20'+_0x6fa558+')')),0x0;}if(_0x42ebc6['length']===0x0){const _0x3e1ff6=new GlobalContext(_0x549549);return _0x9bbd46?_0x3e1ff6['displayWithSources']():_0x3e1ff6[_0x3dd7cd(0x162)](),console[_0x3dd7cd(0x15f)](a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x14d))),console[_0x3dd7cd(0x15f)](a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x16f))),console[_0x3dd7cd(0x15f)](a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x174))),0x0;}const _0x2b8c64=_0x42ebc6[0x0],_0x1fecc0=_0x42ebc6[0x1],_0x111527=a39_0x49c4d1[_0x3dd7cd(0x184)](getConfigDir(),_0x3dd7cd(0x15b));if(_0x1b738b){if(_0x2b8c64==='site')return saveDefaultSiteToUserConfig(_0x1fecc0),console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x167)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)),console[_0x3dd7cd(0x15f)](a39_0x109606[_0x3dd7cd(0x175)]('\x0aSaved\x20to:\x20'+_0x111527)),0x0;if(_0x2b8c64===_0x3dd7cd(0x159)){if(!profileExists(_0x1fecc0))return console['error'](_0x3dd7cd(0x173)+_0x1fecc0+_0x3dd7cd(0x17a)),console[_0x3dd7cd(0x165)](_0x3dd7cd(0x14f)),0x1;return saveActiveProfileToUserConfig(_0x1fecc0),console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x177)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)),console['log'](a39_0x109606['dim'](_0x3dd7cd(0x157)+_0x111527)),0x0;}}if(_0x2b8c64===_0x3dd7cd(0x150)){const _0x11585c=_0x549549['session']||getCurrentSessionPID()['toString']();return saveSessionContext({'site':_0x1fecc0},_0x549549[_0x3dd7cd(0x15e)]),console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x158)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)]('(session:\x20'+_0x11585c+')')),console['log'](a39_0x109606[_0x3dd7cd(0x175)]('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x1fecc0+_0x3dd7cd(0x14a))),0x0;}if(_0x2b8c64===_0x3dd7cd(0x159)){if(!profileExists(_0x1fecc0))return console[_0x3dd7cd(0x165)](_0x3dd7cd(0x173)+_0x1fecc0+_0x3dd7cd(0x17a)),console[_0x3dd7cd(0x165)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0xbaa01e=_0x549549[_0x3dd7cd(0x15e)]||getCurrentSessionPID()[_0x3dd7cd(0x176)]();return saveSessionContext({'profile':_0x1fecc0},_0x549549[_0x3dd7cd(0x15e)]),console['log'](_0x3dd7cd(0x163)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0xbaa01e+')')),console[_0x3dd7cd(0x15f)](a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x18a)+_0x1fecc0+'\x27\x20to\x20save\x20permanently')),0x0;}const _0x5c2985={},_0x457547=_0x549549[_0x3dd7cd(0x15e)]||getCurrentSessionPID()[_0x3dd7cd(0x176)]();switch(_0x2b8c64){case'database':_0x5c2985['database']=_0x1fecc0,console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x16a)+a39_0x109606['green'](_0x1fecc0)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0x457547+')'));break;case _0x3dd7cd(0x17b):_0x5c2985['parent_segment']=_0x1fecc0,console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x164)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0x457547+')'));break;case _0x3dd7cd(0x186):_0x5c2985[_0x3dd7cd(0x186)]=_0x1fecc0,console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x16d)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0x457547+')'));break;case _0x3dd7cd(0x154):{const {projectName:_0x30a6f5,agentName:_0xe7fe15}=parseAgentRef(_0x1fecc0);_0xe7fe15?(_0x5c2985[_0x3dd7cd(0x186)]=_0x30a6f5,_0x5c2985[_0x3dd7cd(0x166)]=_0xe7fe15,console['log'](_0x3dd7cd(0x16d)+a39_0x109606[_0x3dd7cd(0x182)](_0x30a6f5)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0x457547+')')),console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x171)+a39_0x109606[_0x3dd7cd(0x182)](_0xe7fe15)+'\x20'+a39_0x109606[_0x3dd7cd(0x175)](_0x3dd7cd(0x155)+_0x457547+')'))):(_0x5c2985[_0x3dd7cd(0x166)]=_0x1fecc0,console['log']('Session\x20agent\x20set\x20to:\x20'+a39_0x109606['green'](_0x1fecc0)+'\x20'+a39_0x109606['dim'](_0x3dd7cd(0x155)+_0x457547+')')));break;}case _0x3dd7cd(0x16c):_0x5c2985[_0x3dd7cd(0x16c)]=_0x1fecc0,console[_0x3dd7cd(0x15f)](_0x3dd7cd(0x180)+a39_0x109606[_0x3dd7cd(0x182)](_0x1fecc0)+'\x20'+a39_0x109606['dim']('(session:\x20'+_0x457547+')'));break;}return saveSessionContext(_0x5c2985,_0x549549[_0x3dd7cd(0x15e)]),console[_0x3dd7cd(0x15f)](a39_0x109606['dim'](_0x3dd7cd(0x16b))),0x0;}catch(_0x3f6ff0){return _0x3f6ff0 instanceof Error&&console['error'](_0x3dd7cd(0x17c)+_0x3f6ff0[_0x3dd7cd(0x160)]),0x1;}}}
@@ -1 +1 @@
1
- const a40_0x209e54=a40_0x20da;(function(_0x5f4166,_0x58a226){const _0x457240=a40_0x20da,_0x35847d=_0x5f4166();while(!![]){try{const _0x149ab5=parseInt(_0x457240(0xae))/0x1*(-parseInt(_0x457240(0xb5))/0x2)+parseInt(_0x457240(0xa8))/0x3*(-parseInt(_0x457240(0xab))/0x4)+-parseInt(_0x457240(0xa7))/0x5*(parseInt(_0x457240(0xb3))/0x6)+-parseInt(_0x457240(0xb8))/0x7*(parseInt(_0x457240(0x9e))/0x8)+parseInt(_0x457240(0xb9))/0x9*(-parseInt(_0x457240(0xb6))/0xa)+parseInt(_0x457240(0xb2))/0xb+-parseInt(_0x457240(0xad))/0xc*(-parseInt(_0x457240(0xac))/0xd);if(_0x149ab5===_0x58a226)break;else _0x35847d['push'](_0x35847d['shift']());}catch(_0x42991c){_0x35847d['push'](_0x35847d['shift']());}}}(a40_0x2406,0x7160b));function a40_0x20da(_0x1ca864,_0x5b4867){_0x1ca864=_0x1ca864-0x9d;const _0x240668=a40_0x2406();let _0x20dafd=_0x240668[_0x1ca864];return _0x20dafd;}function a40_0x2406(){const _0x4e8f9c=['error','Show\x20current\x20user\x20information','\x20\x20Cause:\x20','cause','user\x20list','getCurrent','3614945OFvMVW','33771eJjLYF','name','message','176GMZDDw','13favtJw','33543888iXdbKr','654559KHPHTu','execute','\x20user','length','8358394ITIWDX','6ChbRAS','data','2YHRcnB','20MEpzuv','✔\x20Found\x20','3189151smmSGA','3430503UXGkbU','Listing\x20users...','list','Fetching\x20user\x20info...','user','8JpjFVn','description','verbose'];a40_0x2406=function(){return _0x4e8f9c;};return a40_0x2406();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a40_0x209e54(0xa9)]='user';[a40_0x209e54(0x9f)]=a40_0x209e54(0xa2);async[a40_0x209e54(0xaf)](_0x5d68fc){const _0x31770b=a40_0x209e54,{options:_0x164ac4,tdx:_0x3bf874}=_0x5d68fc;try{const _0x2ffd1f=await withSpinner(_0x31770b(0xbc),()=>_0x3bf874[_0x31770b(0x9d)][_0x31770b(0xa6)](),{'verbose':_0x164ac4[_0x31770b(0xa0)]}),_0x2ee328=_0x2ffd1f[_0x31770b(0xb4)];return await handleSingleObjectOutput(_0x2ee328,_0x164ac4),0x0;}catch(_0x3b3455){if(_0x3b3455 instanceof SDKError)return console[_0x31770b(0xa1)]('Error:\x20'+_0x3b3455[_0x31770b(0xaa)]),_0x3b3455[_0x31770b(0xa4)]&&console[_0x31770b(0xa1)](_0x31770b(0xa3)+_0x3b3455[_0x31770b(0xa4)]),0x1;throw _0x3b3455;}}}export class UserListCommand extends BaseCommand{[a40_0x209e54(0xa9)]=a40_0x209e54(0xa5);[a40_0x209e54(0x9f)]='List\x20all\x20users\x20in\x20the\x20account';async['execute'](_0x3b9cd8){const _0x16afdb=a40_0x209e54,{options:_0x13e72d,tdx:_0x2b1978}=_0x3b9cd8;try{const _0x118367=await withSpinner(_0x16afdb(0xba),()=>_0x2b1978[_0x16afdb(0x9d)][_0x16afdb(0xbb)](),{'verbose':_0x13e72d[_0x16afdb(0xa0)]}),_0x2bd397=_0x118367[_0x16afdb(0xb4)];return console[_0x16afdb(0xa1)](_0x16afdb(0xb7)+_0x2bd397[_0x16afdb(0xb1)]+_0x16afdb(0xb0)+(_0x2bd397[_0x16afdb(0xb1)]!==0x1?'s':'')),await handleSDKOutput(_0x2bd397,_0x13e72d),0x0;}catch(_0x53617b){if(_0x53617b instanceof SDKError)return console[_0x16afdb(0xa1)]('Error:\x20'+_0x53617b[_0x16afdb(0xaa)]),_0x53617b[_0x16afdb(0xa4)]&&console[_0x16afdb(0xa1)](_0x16afdb(0xa3)+_0x53617b['cause']),0x1;throw _0x53617b;}}}
1
+ const a40_0x2ea683=a40_0x5f2d;(function(_0x190208,_0x25bc18){const _0x15677b=a40_0x5f2d,_0x324b05=_0x190208();while(!![]){try{const _0x560732=parseInt(_0x15677b(0x145))/0x1+parseInt(_0x15677b(0x13c))/0x2*(-parseInt(_0x15677b(0x133))/0x3)+-parseInt(_0x15677b(0x144))/0x4*(parseInt(_0x15677b(0x146))/0x5)+parseInt(_0x15677b(0x142))/0x6+-parseInt(_0x15677b(0x13f))/0x7*(parseInt(_0x15677b(0x13e))/0x8)+parseInt(_0x15677b(0x135))/0x9+parseInt(_0x15677b(0x13a))/0xa;if(_0x560732===_0x25bc18)break;else _0x324b05['push'](_0x324b05['shift']());}catch(_0x2ea3e4){_0x324b05['push'](_0x324b05['shift']());}}}(a40_0x4dd0,0x831a1));function a40_0x5f2d(_0x3f0d0e,_0x5d4e37){_0x3f0d0e=_0x3f0d0e-0x133;const _0x4dd049=a40_0x4dd0();let _0x5f2deb=_0x4dd049[_0x3f0d0e];return _0x5f2deb;}function a40_0x4dd0(){const _0x19ce8=['length','\x20\x20Cause:\x20','getCurrent','4247960TgqGrL','cause','32DXIMjB','Show\x20current\x20user\x20information','3637784qolngU','7RKSJbs','description','name','2072826UuhoCF','data','196bnjRCy','1036224DWafnm','48225BvzaBu','✔\x20Found\x20','verbose','Error:\x20','Listing\x20users...','message','user','user\x20list','101238QLuWKr','error','1779894KbmsDQ','list'];a40_0x4dd0=function(){return _0x19ce8;};return a40_0x4dd0();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';export class UserCommand extends BaseCommand{[a40_0x2ea683(0x141)]='user';[a40_0x2ea683(0x140)]=a40_0x2ea683(0x13d);async['execute'](_0x4e5c35){const _0x32dc78=a40_0x2ea683,{options:_0xdc7d2,tdx:_0x496d3c}=_0x4e5c35;try{const _0x445f65=await withSpinner('Fetching\x20user\x20info...',()=>_0x496d3c[_0x32dc78(0x14c)][_0x32dc78(0x139)](),{'verbose':_0xdc7d2[_0x32dc78(0x148)]}),_0x4ba388=_0x445f65[_0x32dc78(0x143)];return await handleSingleObjectOutput(_0x4ba388,_0xdc7d2),0x0;}catch(_0x522885){if(_0x522885 instanceof SDKError)return console[_0x32dc78(0x134)](_0x32dc78(0x149)+_0x522885[_0x32dc78(0x14b)]),_0x522885[_0x32dc78(0x13b)]&&console[_0x32dc78(0x134)](_0x32dc78(0x138)+_0x522885[_0x32dc78(0x13b)]),0x1;throw _0x522885;}}}export class UserListCommand extends BaseCommand{[a40_0x2ea683(0x141)]=a40_0x2ea683(0x14d);['description']='List\x20all\x20users\x20in\x20the\x20account';async['execute'](_0x2e37d3){const _0x49b66a=a40_0x2ea683,{options:_0x5b4008,tdx:_0x1dc197}=_0x2e37d3;try{const _0x304a8f=await withSpinner(_0x49b66a(0x14a),()=>_0x1dc197[_0x49b66a(0x14c)][_0x49b66a(0x136)](),{'verbose':_0x5b4008['verbose']}),_0x31975e=_0x304a8f[_0x49b66a(0x143)];return console[_0x49b66a(0x134)](_0x49b66a(0x147)+_0x31975e[_0x49b66a(0x137)]+'\x20user'+(_0x31975e[_0x49b66a(0x137)]!==0x1?'s':'')),await handleSDKOutput(_0x31975e,_0x5b4008),0x0;}catch(_0x41c0c5){if(_0x41c0c5 instanceof SDKError)return console[_0x49b66a(0x134)](_0x49b66a(0x149)+_0x41c0c5[_0x49b66a(0x14b)]),_0x41c0c5[_0x49b66a(0x13b)]&&console[_0x49b66a(0x134)](_0x49b66a(0x138)+_0x41c0c5[_0x49b66a(0x13b)]),0x1;throw _0x41c0c5;}}}
@@ -1 +1 @@
1
- const a41_0x30db68=a41_0x1a0d;(function(_0x3e3e8d,_0x31a48c){const _0xd8c27a=a41_0x1a0d,_0x545a27=_0x3e3e8d();while(!![]){try{const _0x23929b=-parseInt(_0xd8c27a(0xd1))/0x1+parseInt(_0xd8c27a(0xbe))/0x2+parseInt(_0xd8c27a(0xe9))/0x3*(parseInt(_0xd8c27a(0xeb))/0x4)+-parseInt(_0xd8c27a(0xa3))/0x5*(parseInt(_0xd8c27a(0x75))/0x6)+-parseInt(_0xd8c27a(0x19b))/0x7*(-parseInt(_0xd8c27a(0x1f0))/0x8)+parseInt(_0xd8c27a(0x72))/0x9*(parseInt(_0xd8c27a(0x156))/0xa)+-parseInt(_0xd8c27a(0x119))/0xb;if(_0x23929b===_0x31a48c)break;else _0x545a27['push'](_0x545a27['shift']());}catch(_0x51b452){_0x545a27['push'](_0x545a27['shift']());}}}(a41_0x1195,0xd6af0));import a41_0x2a3f8b from'chalk';import{existsSync}from'fs';import a41_0x3fb9ea from'path';import{BaseCommand}from'./command.js';function a41_0x1195(){const _0x430938=['toISOString','Project:\x20','resolveProject','No\x20attempts\x20found\x20for:\x20','Getting\x20attempt\x20tasks...','Attempt\x20ID:\x20','Filter:\x20project=','split','Validation:\x20skipped','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','workflow','\x20\x20Location:\x20','Listing\x20workflow\x20projects...','changes','No\x20workflow\x20tdx.json\x20found','tdx\x20wf\x20attempt\x20','\x20\x20tdx\x20wf\x20use\x20<project>','workflowProject','getDate','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Attempt:\x20','workflow:delete','\x0aDry\x20run\x20-\x20nothing\x20pushed','Retrying\x20attempt...','includeSubtasks','Starting\x20workflow\x20run...','setSecret','\x27\x20from\x20project\x20\x27',',\x20Workflow:\x20','Retry\x20a\x20session\x20or\x20attempt','table','sort','Show\x20logs\x20for\x20a\x20workflow\x20attempt','message','retrySession','Source\x20directory\x20is\x20required','\x22\x20with\x20new\x20revision?','pullProject','2325717ymRddd','buildTimelineData','GUTTER','6TfaURI','workflow:sessions','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Auto-selected\x20latest\x20session:\x20','projects','Dry\x20run:\x20yes','Error:\x20','map','Tip:\x20cd\x20to\x20workflows/','/sessions/','requireProject','Project\x20name\x20is\x20required','MAX_TIMELINE_WIDTH','Session\x20','stringify','Killing\x20attempt...','💡\x20Tip:\x20Use\x20','length','\x0a✔\x20No\x20changes\x20to\x20push','\x20tasks','sessions','project','fullName','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','task','\x27...','\x20\x20Revision:\x20','repeat','🔄\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','No\x20matching\x20sessions\x20found','targetExists','\x20(use\x20--limit\x20to\x20show\x20more)','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','replace','attemptId','padStart','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20session','No\x20workflow\x20projects\x20found','attempt:','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Pushing\x20workflow\x20project...','\x20modified','1181255jQtRwI','modified','durationMs','displayLine','data','Filter:\x20','MIN_LABEL_COUNT','\x20from\x20session\x20','Force:\x20yes','index','values','title','Select\x20a\x20task\x20to\x20view\x20logs:','workflow:projects','\x20\x20Attempt\x20ID:\x20','max','Start\x20a\x20workflow\x20run','readFile','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','✔\x20Push\x20complete','\x0aClone\x20\x22','text','\x20sessions\x20','\x20\x20Session\x20ID:\x20','Source\x20project:\x20','stat','workflow:timeline','3446708aTfodH','floor','output','some','Pushing\x20project...','✔\x20Secret\x20\x27','✔\x20Pull\x20complete','Project\x20filter:\x20','✔\x20Deleted\x20project\x20','List\x20workflow\x20attempts','Cloning\x20to\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','clear','json','autocomplete','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','resolve','getMinutes','startsWith','929090gLbQpM','Resolving\x20project\x20\x27','Downloading\x20project\x20','yellow','parseProjectWorkflowPattern','projectId','hasChanges','end','\x20\x20Files\x20extracted:\x20','Invalid\x20format:\x20','sessionTime','follow','\x20\x20Session\x20context\x20set\x20to:\x20','✔\x20New\x20project:\x20','param','MAX_TASKS_DISPLAY','\x20workflow','Params:\x20','\x20\x20Project:\x20','\x20is\x20not\x20a\x20directory','No\x20sessions\x20with\x20timing\x20information','description','window','green','41508BtfxkC','\x20new','436ZAADQu','resolveProjectId','white','all','\x22\x20already\x20exists\x20(ID:\x20','\x22\x20to\x20new\x20project\x20\x22','finishedAt','renderSingleTimeline','resolveProjectDir','jsonl','write','ICON_WIDTH','pending','sessionId','⚠\x20Showing\x20first\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','List\x20workflows','run','cancelRequested','value','download','summary','limit','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','has','success','generateSessionTimelineRows','slice','push','match','\x20to\x20see\x20detailed\x20logs','join','now','✔\x20Retry\x20started','log','Include\x20retried:\x20yes','Workflow:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','parse','---\x20','reason','sourceDir','Usage:\x20workflow:delete\x20<project-name-or-id>','includeRetried','isDirectory','Error:\x20Invalid\x20parameter\x20format:\x20','39267063BEBkAS','Usage:\x20tdx\x20wf\x20use\x20<project>','filesExtracted','No\x20attempts\x20found','✔\x20Workflow\x20project\x20set\x20to:\x20','Listing\x20workflow\x20sessions...','\x20unchanged','attempt','set','list','MAX_POLL_ITERATIONS','site','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','trim','Latest\x20session\x20has\x20no\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','workflow:secrets:list','kill','running','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','logFiles','isNewProject','workflow:kill','includes','toLowerCase','\x20deleted','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','blue','relative','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Pull\x20workflow\x20project\x20to\x20local\x20folder','Target:\x20','.\x20Expected\x20format:\x20KEY=VALUE','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aPolling...\x20(','Error:\x20Project\x20name\x20is\x20required','taskName','✔\x20Downloaded\x20','unchanged','done','metadata','ICON_SPACING','utf-8','execute','Pattern:\x20','verbose','group_error','total','keys','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','retryAttempt','unknown','List\x20workflow\x20execution\x20sessions','New\x20project\x20name:\x20','\x0aUpdate\x20existing\x20project\x20\x22','Writing\x20files...','✔\x20Project:\x20','✔\x20Workflow\x20run\x20started','Deleting\x20secret...','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','preparePushProject','30HzqGAx','Loading\x20session...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','type','startedAt','✔\x20Clone\x20complete','\x0a⚠\x20Project\x20\x22','No\x20workflows\x20found','📁\x20','state','icon','dim','isArray','No\x20sessions\x20found\x20in\x20project:\x20','planned','Task\x20name:\x20','No\x20sessions\x20found','Parameters:\x20','existingProjectId','workflow:secrets:delete','stdout','yes','filter','delete','sourceProjectName','Listing\x20secrets...','workflowName','POLL_INTERVAL_MS','Project\x20directory:\x20','getFullYear','Total:\x20','workflow:upload','revision','revision:\x20','No\x20workflows\x20found\x20in\x20project:\x20','...','\x20logs','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Error:\x20Secret\x20key\x20is\x20required','\x20\x20Project\x20ID:\x20','Including\x20subtasks:\x20yes','getHours','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Listing\x20workflows...','updatedAt','get','getTime','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','error','trimEnd','status','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20-\x20','workflow:workflows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','workflow:secrets:set','fromTask','projectName','No\x20attempts\x20found\x20in\x20project:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','canceling','No\x20projects\x20match\x20pattern:\x20','isTTY','renderTimeline','rows','select','Key\x20cannot\x20be\x20empty','columns','renderSessionsTimeline','7LPKWwG','fileCount','session','Setting\x20secret...','size','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Pulling\x20project\x20','format','\x20of\x20','indexOf','substring','lastAttempt','dryRun','\x20has\x20no\x20attempts','workflow:pull','From\x20task:\x20','Error:','Session\x20time:\x20','key','name','Analyzing\x20changes...','\x20\x20Console:\x20','workflow:logs','tasks','workflows','params','\x0aApply\x20these\x20changes?','workflow:attempt','Cancelled','showWorkflowConsoleUrl','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','navigateSessionsInteractive','Revision:\x20','new','Source\x20directory:\x20','cyan','createdAt','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','workflow:tasks','\x0a✔\x20Already\x20up\x20to\x20date','Status:\x20','Downloading\x20logs...','red','No\x20sessions\x20found\x20for:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Deleting\x20project\x20','context','MAX_LABEL_COUNT','executeCloneProject','/app/workflows/','List\x20all\x20workflow\x20projects','newProjectId','LABEL_MIN_SPACING','Resume\x20from:\x20','Updating\x20','skipValidation','duration','find','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','\x0a✔\x20Attempt\x20complete','Show\x20specific\x20attempt\x20details','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','from','workflow:run','\x1b[1A\x1b[2K','/attempt/','targetDir','✔\x20Found\x20','localeCompare','pollTimeline','No\x20workflow\x20sessions\x20found','path','getMonth','Key:\x20','Project\x20name:\x20','\x20attempt','min','Target\x20directory:\x20','\x20secret','Expected\x20format:\x20--param\x20key=value','executePushProject','start','workflow:retry','12861608aDZXJL','fill','Warning:','force','attempts','Error:\x20Attempt\x20ID\x20is\x20required','newProjectName','retryAttemptName','diff','Reason:\x20','\x20\x20Changes:\x20','startTime','Kill\x20a\x20running\x20attempt'];a41_0x1195=function(){return _0x430938;};return a41_0x1195();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a41_0x5d4edd from'prompts';function getAttemptStatusDisplay(_0x146ca0){const _0x2c1c3e=a41_0x1a0d;if(!_0x146ca0)return{'icon':'⏳','text':''};const {done:_0x249d04,success:_0x4b9afe,cancelRequested:_0x5af7ed}=_0x146ca0;if(!_0x249d04)return _0x5af7ed?{'icon':'🛑','text':a41_0x2a3f8b[_0x2c1c3e(0xd4)](_0x2c1c3e(0x192))}:{'icon':'🔄','text':a41_0x2a3f8b['blue'](_0x2c1c3e(0x12b))};if(_0x4b9afe)return{'icon':'✅','text':a41_0x2a3f8b[_0x2c1c3e(0xe8)](_0x2c1c3e(0x104))};return{'icon':'❌','text':a41_0x2a3f8b[_0x2c1c3e(0x1c6)](_0x2c1c3e(0x186))};}export class WorkflowBaseCommand extends BaseCommand{[a41_0x30db68(0x1ff)](_0x37c6ea,_0x3354e2,_0x325b16=0x0){const _0x3b2001=a41_0x30db68;return _0x37c6ea[_0x325b16]||_0x3354e2[_0x3b2001(0x20e)];}[a41_0x30db68(0x7f)](_0x5b43e9,_0x33bde1,_0x1637ae=0x0){const _0x289d81=a41_0x30db68,_0x587954=this[_0x289d81(0x1ff)](_0x5b43e9,_0x33bde1,_0x1637ae);if(!_0x587954)return console['error'](a41_0x2a3f8b[_0x289d81(0x1c6)]('Error:'),_0x289d81(0x80)),console[_0x289d81(0x186)](a41_0x2a3f8b[_0x289d81(0x161)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x587954;}[a41_0x30db68(0xd5)](_0x2f9a73,_0x979786){const _0x32056f=a41_0x30db68;if(_0x2f9a73[0x0]){const _0xa8e0c5=_0x2f9a73[0x0][_0x32056f(0x204)]('.');if(_0xa8e0c5[_0x32056f(0x86)]===0x1)return{'projectName':_0xa8e0c5[0x0],'workflowName':undefined};else return _0xa8e0c5[_0x32056f(0x86)]===0x2?{'projectName':_0xa8e0c5[0x0],'workflowName':_0xa8e0c5[0x1]}:(console['error'](a41_0x2a3f8b['red'](_0x32056f(0x1ab)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x979786[_0x32056f(0x20e)],'workflowName':undefined};}['resolveProjectDir'](_0x46b1b,_0x41da0a,_0x3280af=0x0){const _0x2a8804=a41_0x30db68;if(_0x46b1b[_0x3280af])return _0x46b1b[_0x3280af];if(_0x41da0a['workflowProject']){const _0x588d74=a41_0x3fb9ea['join'](process['cwd'](),_0x2a8804(0x1b3),_0x41da0a['workflowProject']);if(existsSync(a41_0x3fb9ea['join'](_0x588d74,'tdx.json')))return _0x588d74;}return undefined;}async[a41_0x30db68(0x1b8)](_0x5e460a,_0x5112e2,_0x439585){const _0x190972=a41_0x30db68;try{const _0x12bbad=await _0x5e460a['workflow'][_0x190972(0x1b3)](_0x5112e2,{'limit':0x1});if(_0x12bbad['length']>0x0){const _0x397d27=_0x12bbad[0x0]['id'],_0x118981=getWorkflowUrl(_0x439585,_0x397d27);console[_0x190972(0x186)](_0x190972(0x1b0)+a41_0x2a3f8b[_0x190972(0x1be)](_0x118981));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a41_0x30db68(0x1ae)]='workflow:use';[a41_0x30db68(0xe6)]=a41_0x30db68(0x1c0);async['execute'](_0x54fd70){const _0x880ab3=a41_0x30db68,{options:_0x58589a,args:_0x37a8e6,tdx:_0x5a9fe7}=_0x54fd70,_0x584e80=_0x37a8e6[0x0],_0x18da13=_0x58589a[_0x880ab3(0xca)];if(_0x18da13)return saveSessionContext({'workflow_project':undefined},_0x58589a[_0x880ab3(0x19d)]),console[_0x880ab3(0x10d)](a41_0x2a3f8b[_0x880ab3(0xe8)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x584e80)return console[_0x880ab3(0x186)](a41_0x2a3f8b[_0x880ab3(0x1c6)]('Error:'),_0x880ab3(0x80)),console[_0x880ab3(0x186)](a41_0x2a3f8b['dim'](_0x880ab3(0x11a))),console['error'](a41_0x2a3f8b['dim'](_0x880ab3(0x18c))),0x1;const _0xccad55=await withSpinner(_0x880ab3(0xd2)+_0x584e80+_0x880ab3(0x8e),()=>_0x5a9fe7['workflow'][_0x880ab3(0xec)](_0x584e80),{'verbose':_0x58589a[_0x880ab3(0x146)]}),{name:_0x32e3f7}=_0xccad55[_0x880ab3(0xa7)];return saveSessionContext({'workflow_project':_0x32e3f7},_0x58589a[_0x880ab3(0x19d)]),console[_0x880ab3(0x10d)](a41_0x2a3f8b[_0x880ab3(0xe8)](_0x880ab3(0x11d)+a41_0x2a3f8b[_0x880ab3(0x1be)](_0x32e3f7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0xb0);[a41_0x30db68(0xe6)]=a41_0x30db68(0x1cf);async[a41_0x30db68(0x144)](_0x5b25c6){const _0x40a5bd=a41_0x30db68,{options:_0x30cf7e,args:_0x24f9c2,tdx:_0x59f900}=_0x5b25c6,_0x34d4ae=_0x24f9c2[0x0];_0x30cf7e['verbose']&&_0x34d4ae&&console[_0x40a5bd(0x186)](_0x40a5bd(0x145)+_0x34d4ae);const _0x2764b2=await withSpinner(_0x40a5bd(0x209),()=>_0x59f900[_0x40a5bd(0x207)][_0x40a5bd(0x79)](_0x34d4ae,{'limit':_0x30cf7e[_0x40a5bd(0x101)]}),{'verbose':_0x30cf7e[_0x40a5bd(0x146)]});let _0x2938d4=_0x2764b2[_0x40a5bd(0xa7)];_0x2938d4[_0x40a5bd(0x6b)]((_0x2f2111,_0x7a72e6)=>_0x2f2111[_0x40a5bd(0x1ae)]['localeCompare'](_0x7a72e6['name']));const _0x1ecd9c=_0x30cf7e[_0x40a5bd(0x101)]||0x64,_0x312a73=_0x2938d4[_0x40a5bd(0x86)]>=_0x1ecd9c?a41_0x2a3f8b[_0x40a5bd(0x161)](_0x40a5bd(0x97)):'';console[_0x40a5bd(0x186)](_0x40a5bd(0x1e0)+_0x2938d4['length']+'\x20project'+(_0x2938d4['length']!==0x1?'s':'')+_0x312a73);if(_0x30cf7e[_0x40a5bd(0x1a2)]===_0x40a5bd(0xcb)||_0x30cf7e[_0x40a5bd(0x1a2)]==='jsonl'||_0x30cf7e[_0x40a5bd(0x1a2)]===_0x40a5bd(0x6a))await handleSDKOutput(_0x2938d4,_0x30cf7e);else{if(_0x2938d4[_0x40a5bd(0x86)]===0x0)_0x34d4ae?console[_0x40a5bd(0x10d)](_0x40a5bd(0x193)+_0x34d4ae):console[_0x40a5bd(0x10d)](_0x40a5bd(0x9e));else{const _0xd159f3=_0x2938d4[_0x40a5bd(0x7c)](_0x1b2e22=>{const _0x317769=_0x40a5bd,_0xb35090=_0x1b2e22[_0x317769(0x141)]?.[_0x317769(0xc1)](_0x5f8170=>_0x5f8170[_0x317769(0x1ad)]==='sys'),_0x2803b9=_0xb35090?a41_0x2a3f8b['dim']('\x20(system)'):'';return _0x317769(0x15e)+_0x1b2e22[_0x317769(0x1ae)]+_0x2803b9;});await writeOutput(_0xd159f3[_0x40a5bd(0x10a)]('\x0a'),_0x30cf7e[_0x40a5bd(0xc0)],_0x40a5bd(0x122));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x18b);['description']=a41_0x30db68(0xfb);async[a41_0x30db68(0x144)](_0x3e61c7){const _0x1495cd=a41_0x30db68,{options:_0x1ac3e9,args:_0x4c50ae,tdx:_0x362e40}=_0x3e61c7,_0x1394d2=this['resolveProject'](_0x4c50ae,_0x1ac3e9);_0x1ac3e9[_0x1495cd(0x146)]&&_0x1394d2&&console[_0x1495cd(0x186)](_0x1495cd(0xc5)+_0x1394d2);const _0x3a274f=await withSpinner(_0x1495cd(0x181),()=>_0x362e40[_0x1495cd(0x207)][_0x1495cd(0x1b3)](_0x1394d2,{'limit':_0x1ac3e9['limit']}),{'verbose':_0x1ac3e9['verbose']});let _0xec4bc6=_0x3a274f[_0x1495cd(0xa7)];_0xec4bc6['sort']((_0x38e6bf,_0x510ef3)=>{const _0xe42d14=_0x1495cd,_0x310710=_0x38e6bf[_0xe42d14(0x1ae)][_0xe42d14(0x1e1)](_0x510ef3['name']);if(_0x310710!==0x0)return _0x310710;return(_0x38e6bf['project']?.[_0xe42d14(0x1ae)]||'')['localeCompare'](_0x510ef3[_0xe42d14(0x8a)]?.['name']||'');});const _0x478297=_0x1ac3e9['limit']||0x64,_0x27c847=_0xec4bc6['length']>=_0x478297?a41_0x2a3f8b[_0x1495cd(0x161)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1495cd(0x186)](_0x1495cd(0x1e0)+_0xec4bc6[_0x1495cd(0x86)]+_0x1495cd(0xe1)+(_0xec4bc6[_0x1495cd(0x86)]!==0x1?'s':'')+_0x27c847);if(_0x1ac3e9[_0x1495cd(0x1a2)]==='json'||_0x1ac3e9['format']===_0x1495cd(0xf4)||_0x1ac3e9[_0x1495cd(0x1a2)]===_0x1495cd(0x6a))await handleSDKOutput(_0xec4bc6,_0x1ac3e9);else{if(_0xec4bc6[_0x1495cd(0x86)]===0x0)_0x1394d2?console[_0x1495cd(0x10d)](_0x1495cd(0x178)+_0x1394d2):console['log'](_0x1495cd(0x15d));else{const _0x28b764=_0x1ac3e9[_0x1495cd(0x124)],_0x3eab1a=_0xec4bc6[_0x1495cd(0x7c)](_0x48d7bf=>{const _0x15e912=_0x1495cd,_0x67baf8=a41_0x2a3f8b[_0x15e912(0x161)]('#'+_0x48d7bf['id']),_0x554668=hyperlink(_0x67baf8,getWorkflowUrl(_0x28b764,_0x48d7bf['id'])),_0x4d17b3=_0x48d7bf[_0x15e912(0x8a)]?.['name']?a41_0x2a3f8b[_0x15e912(0x161)]('\x20('+_0x48d7bf[_0x15e912(0x8a)][_0x15e912(0x1ae)]+')'):'';return'📋\x20'+_0x554668+'\x20'+_0x48d7bf[_0x15e912(0x1ae)]+_0x4d17b3;});await writeOutput(_0x3eab1a[_0x1495cd(0x10a)]('\x0a'),_0x1ac3e9[_0x1495cd(0xc0)],_0x1495cd(0x122));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x76);[a41_0x30db68(0xe6)]=a41_0x30db68(0x14d);async[a41_0x30db68(0x144)](_0x129629){const _0x4de29b=a41_0x30db68,{options:_0x403f35,args:_0x435f9c,tdx:_0x2c33b1}=_0x129629,_0x1b1220=this[_0x4de29b(0xd5)](_0x435f9c,_0x403f35);if(!_0x1b1220)return 0x1;const {projectName:_0x322a4d,workflowName:_0x2be012}=_0x1b1220;if(_0x403f35['verbose']){if(_0x322a4d&&_0x2be012)console[_0x4de29b(0x186)](_0x4de29b(0xa8)+_0x322a4d+'.'+_0x2be012);else _0x322a4d&&console['error'](_0x4de29b(0x203)+_0x322a4d);const _0xdc97fb=_0x403f35[_0x4de29b(0x188)];_0xdc97fb&&console[_0x4de29b(0x186)](_0x4de29b(0x1c4)+_0xdc97fb);}let _0x27722e=0x28;if(process['stdout'][_0x4de29b(0x194)]&&!_0x403f35[_0x4de29b(0xc0)]&&!_0x403f35[_0x4de29b(0x1a2)]){const _0x4e3528=process[_0x4de29b(0x16a)][_0x4de29b(0x196)]||0x28;_0x27722e=Math[_0x4de29b(0xb2)](0x14,Math[_0x4de29b(0xbf)](_0x4e3528*0x2/0x3));}const _0x4ffa7c=_0x403f35[_0x4de29b(0x101)]||_0x27722e,_0x4adff7=await withSpinner(_0x4de29b(0x11e),()=>_0x2c33b1[_0x4de29b(0x207)][_0x4de29b(0x89)]({'projectName':_0x322a4d,'workflowName':_0x2be012,'status':_0x403f35[_0x4de29b(0x188)],'fromTime':_0x403f35[_0x4de29b(0x1db)],'toTime':_0x403f35['to'],'limit':_0x4ffa7c}),{'verbose':_0x403f35['verbose']}),_0x52fc79=_0x4adff7[_0x4de29b(0xa7)];_0x52fc79[_0x4de29b(0x6b)]((_0x4db4a4,_0x5d15df)=>{const _0x48083c=_0x4de29b,_0xa31aca=_0x4db4a4[_0x48083c(0xdb)]||'',_0x226390=_0x5d15df[_0x48083c(0xdb)]||'';return _0x226390[_0x48083c(0x1e1)](_0xa31aca);});_0x52fc79[_0x4de29b(0x86)]>=_0x4ffa7c?console[_0x4de29b(0x186)]('✔\x20Showing\x20'+_0x52fc79[_0x4de29b(0x86)]+_0x4de29b(0xb9)+a41_0x2a3f8b[_0x4de29b(0x161)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x4de29b(0x186)](_0x4de29b(0x1e0)+_0x52fc79[_0x4de29b(0x86)]+_0x4de29b(0x9d)+(_0x52fc79[_0x4de29b(0x86)]!==0x1?'s':''));if(_0x403f35[_0x4de29b(0x1a2)]==='json'||_0x403f35[_0x4de29b(0x1a2)]===_0x4de29b(0xf4)||_0x403f35['format']===_0x4de29b(0x6a))await handleSDKOutput(_0x52fc79,_0x403f35);else{if(!process[_0x4de29b(0x16a)][_0x4de29b(0x194)]||_0x403f35[_0x4de29b(0xc0)]){if(_0x52fc79['length']===0x0){if(_0x322a4d&&_0x2be012)console['log'](_0x4de29b(0x1c7)+_0x322a4d+'.'+_0x2be012);else _0x322a4d?console['log'](_0x4de29b(0x163)+_0x322a4d):console[_0x4de29b(0x10d)](_0x4de29b(0x166));}else{const _0x4fc3dd=_0x403f35['site'],_0x48878d=this[_0x4de29b(0x19a)](_0x52fc79,_0x4fc3dd);_0x403f35[_0x4de29b(0xc0)]?await writeOutput(_0x48878d,_0x403f35[_0x4de29b(0xc0)],_0x4de29b(0x122)):console[_0x4de29b(0x10d)](_0x48878d);}!_0x322a4d&&(console['error'](''),console[_0x4de29b(0x186)](a41_0x2a3f8b[_0x4de29b(0x161)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4de29b(0x186)](a41_0x2a3f8b[_0x4de29b(0x161)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x2a3f8b['dim'](_0x4de29b(0x20d))));}else{if(_0x52fc79[_0x4de29b(0x86)]===0x0){if(_0x322a4d&&_0x2be012)console[_0x4de29b(0x10d)](_0x4de29b(0x1c7)+_0x322a4d+'.'+_0x2be012);else _0x322a4d?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x322a4d):console[_0x4de29b(0x10d)](_0x4de29b(0x166));}else await this[_0x4de29b(0x1ba)](_0x52fc79,_0x129629,_0x322a4d);}}return 0x0;}[a41_0x30db68(0x19a)](_0x204a1e,_0xddb817){const _0x4e581=a41_0x30db68,_0x33ebd0=[],_0x7c828e=new Map();let _0x5844ec=Infinity,_0x467bc5=-Infinity;for(const _0xcc077f of _0x204a1e){if(_0xcc077f['lastAttempt']?.[_0x4e581(0x1bf)]){const _0x54ecf1=new Date(_0xcc077f[_0x4e581(0x1a6)]['createdAt'])['getTime'](),_0xcb8e26=_0xcc077f[_0x4e581(0x1a6)][_0x4e581(0xf1)]?new Date(_0xcc077f['lastAttempt'][_0x4e581(0xf1)])['getTime']():Date[_0x4e581(0x10b)](),_0x47cc8f=_0xcc077f[_0x4e581(0x8a)]?.['name']||'(unknown)';!_0x7c828e[_0x4e581(0x103)](_0x47cc8f)&&_0x7c828e['set'](_0x47cc8f,[]),_0x7c828e['get'](_0x47cc8f)[_0x4e581(0x107)]({'session':_0xcc077f,'startTime':_0x54ecf1,'endTime':_0xcb8e26,'duration':_0xcb8e26-_0x54ecf1}),_0x5844ec=Math[_0x4e581(0x1e9)](_0x5844ec,_0x54ecf1),_0x467bc5=Math[_0x4e581(0xb2)](_0x467bc5,_0xcb8e26);}}if(_0x7c828e[_0x4e581(0x19f)]===0x0)return _0x4e581(0xe5);const _0xe85632=process['stdout'][_0x4e581(0x199)]||0x78,_0x94d3a9=0x1e,_0x2e4ca5=0x32,_0x2263ec=0x4,_0x86d699=Math[_0x4e581(0x1e9)](_0x2e4ca5,Math[_0x4e581(0xb2)](_0x94d3a9,Math[_0x4e581(0xbf)](_0xe85632*0.3))),_0x478bbc=_0xe85632-_0x86d699-TIMELINE_CONFIG[_0x4e581(0x74)]-0x3-_0x2263ec,_0xc2573a=_0x467bc5-_0x5844ec,_0x5308ec=_0xc2573a/_0x86d699,_0xdaa7a5=renderTimeAxis({'startTime':_0x5844ec,'endTime':_0x467bc5,'durationMs':_0xc2573a,'msPerChar':_0x5308ec},_0x86d699),_0x54ef3d=[];for(const _0x109191 of _0x7c828e[_0x4e581(0xad)]()){_0x54ef3d[_0x4e581(0x107)](..._0x109191);}_0x54ef3d[_0x4e581(0x6b)]((_0x5c5fdc,_0x42a2c5)=>_0x42a2c5[_0x4e581(0x1fb)]-_0x5c5fdc['startTime']);const _0x5d2900=new Date(_0x5844ec),_0x910fea=formatDate(_0x5d2900),_0x4f1b66=_0x2263ec+TIMELINE_CONFIG[_0x4e581(0xf6)]+TIMELINE_CONFIG[_0x4e581(0x142)]+_0x478bbc,_0x1099a3='\x20'['repeat'](_0x4f1b66-_0x910fea[_0x4e581(0x86)]),_0x113085=_0x1099a3+a41_0x2a3f8b[_0x4e581(0x161)](_0x910fea)+'\x20'+_0xdaa7a5;_0x33ebd0[_0x4e581(0x107)](_0x113085);const _0x2a08f7=0x16;let _0x255e3e=0x0;for(const _0x7e4ccf of _0x54ef3d){const _0xa2fd46=_0x7e4ccf[_0x4e581(0x19d)][_0x4e581(0x8a)]?.['name']||'?',_0xc4d12e=Math[_0x4e581(0x1e9)](stringWidth(_0xa2fd46),_0x2a08f7);_0x255e3e=Math[_0x4e581(0xb2)](_0x255e3e,_0xc4d12e);}for(const _0xa6a792 of _0x54ef3d){const {session:_0x388151,startTime:_0x362ae9,endTime:_0x1a4875,duration:_0x40d781}=_0xa6a792,_0x3d76ee=_0x388151[_0x4e581(0x8a)]?.['id'],_0x20ab53=_0x388151['id'],_0x5d8490=_0x388151[_0x4e581(0x8a)]?.['name']||'?',_0x10e244=_0x388151[_0x4e581(0x207)]?.[_0x4e581(0x1ae)]||'?';let _0x582016,_0x3aa39a;if(_0x388151[_0x4e581(0x1a6)]){const _0x37588f=_0x388151['lastAttempt'];!_0x37588f[_0x4e581(0x140)]?(_0x582016=_0x37588f['cancelRequested']?'🛑':'🔄',_0x3aa39a=_0x37588f[_0x4e581(0xfd)]?a41_0x2a3f8b[_0x4e581(0xd4)]:a41_0x2a3f8b[_0x4e581(0x134)]):(_0x582016=_0x37588f['success']?'✅':'❌',_0x3aa39a=_0x37588f[_0x4e581(0x104)]?a41_0x2a3f8b[_0x4e581(0xe8)]:a41_0x2a3f8b[_0x4e581(0x1c6)]);}else _0x582016='⏳',_0x3aa39a=a41_0x2a3f8b['dim'];const _0x613415='#'+_0x20ab53,_0x260f53=_0x3d76ee?hyperlink(_0x613415,getWorkflowSessionUrl(_0xddb817,_0x3d76ee,_0x20ab53)):_0x613415;let _0x2c6f72=_0x5d8490;stringWidth(_0x5d8490)>_0x2a08f7&&(_0x2c6f72=_0x5d8490[_0x4e581(0x106)](0x0,_0x2a08f7-0x1)+'…');const _0x42d343=a41_0x2a3f8b[_0x4e581(0x161)](_0x2c6f72),_0x2e044f=stringWidth(_0x2c6f72),_0x3367bb='\x20'['repeat'](_0x255e3e-stringWidth(_0x2c6f72)+0x2),_0x3d58db='('+formatElapsed(_0x40d781)+')',_0x6a8534=stringWidth(_0x3d58db),_0x474aac=stringWidth(_0x613415),_0xe740fc=_0x474aac+0x1+_0x2e044f+_0x3367bb[_0x4e581(0x86)],_0x5f4806=_0x478bbc-_0xe740fc-_0x6a8534-0x1-0x8;let _0x21fcbc=_0x10e244;stringWidth(_0x21fcbc)>_0x5f4806&&(_0x21fcbc=_0x21fcbc['slice'](0x0,_0x5f4806-0x1)+'…');const _0x517a11=_0x260f53+'\x20'+_0x42d343+_0x3367bb+_0x21fcbc,_0x592778=stringWidth(_0x517a11),_0x42decc=_0x478bbc-_0x592778-_0x6a8534,_0x24f44f=_0x517a11+'\x20'[_0x4e581(0x90)](Math['max'](0x1,_0x42decc))+a41_0x2a3f8b[_0x4e581(0x161)](_0x3d58db),_0x1aaf2d=Math[_0x4e581(0xbf)]((_0x362ae9-_0x5844ec)/_0x5308ec),_0x14acbe=Math[_0x4e581(0xbf)]((_0x1a4875-_0x5844ec)/_0x5308ec),_0x13a2a1=Math[_0x4e581(0xb2)](_0x1aaf2d+0x1,_0x14acbe),_0x304344=new Array(_0x86d699)['fill']('\x20');for(let _0x2cea0a=_0x1aaf2d;_0x2cea0a<Math[_0x4e581(0x1e9)](_0x13a2a1,_0x86d699);_0x2cea0a++){_0x304344[_0x2cea0a]='─';}const _0x1f7ea8=_0x304344[_0x4e581(0x7c)](_0x50f484=>_0x50f484==='\x20'?'\x20':_0x3aa39a(_0x50f484))['join']('');_0x33ebd0[_0x4e581(0x107)](_0x582016+'\x20'+_0x24f44f+'│'+_0x1f7ea8+'│');}return _0x33ebd0['join']('\x0a');}async[a41_0x30db68(0x1ba)](_0x4cb863,_0x542f1c,_0x52bb1d){const _0x244cd3=a41_0x30db68,{options:_0x10cc3e,tdx:_0x19c099}=_0x542f1c,_0x2ab1d1=_0x10cc3e[_0x244cd3(0x124)],{timelineRows:_0x405cde,timeAxisHeader:_0x4132b8}=this[_0x244cd3(0x105)](_0x4cb863,_0x2ab1d1),_0x21f063=_0x405cde[_0x244cd3(0x16c)](_0x21daed=>_0x21daed['attemptId']);if(_0x21f063[_0x244cd3(0x86)]===0x0){const _0xb9ca52=this['renderSessionsTimeline'](_0x4cb863,_0x2ab1d1);console[_0x244cd3(0x10d)](_0xb9ca52);!_0x52bb1d&&(console[_0x244cd3(0x186)](''),console[_0x244cd3(0x186)](a41_0x2a3f8b['dim'](_0x244cd3(0x210))),console[_0x244cd3(0x186)](a41_0x2a3f8b[_0x244cd3(0x161)](_0x244cd3(0x1b9))+'or'+a41_0x2a3f8b['dim'](_0x244cd3(0x20d))));return;}_0x4132b8&&console['log'](_0x4132b8);const _0x22b147=_0x405cde[_0x244cd3(0x16c)](_0x3b4451=>_0x3b4451[_0x244cd3(0x9a)])[_0x244cd3(0x7c)](_0x57d7ba=>({'title':_0x57d7ba[_0x244cd3(0xa6)],'value':_0x57d7ba[_0x244cd3(0x9a)]})),_0x4b12e9=process[_0x244cd3(0x16a)][_0x244cd3(0x196)]||0x3c,_0x4ba41c=Math['max'](0x28,Math[_0x244cd3(0xbf)](_0x4b12e9*0x2/0x3)),_0x4e85be=await a41_0x5d4edd({'type':_0x244cd3(0xcc),'name':'attemptId','message':_0x244cd3(0xb5),'choices':_0x22b147,'initial':-0x1,'limit':_0x4ba41c,'clearFirst':!![],'fallback':{'title':_0x244cd3(0x95),'value':null},'suggest':(_0xf2a7b6,_0x42b837)=>{const _0xa64c9=_0x244cd3;if(!_0xf2a7b6)return Promise[_0xa64c9(0xce)](_0x42b837);const _0x264f46=_0x42b837[_0xa64c9(0x16c)](_0x16e56c=>{const _0x317ae9=_0xa64c9,_0x171d03=_0x16e56c;return _0x171d03[_0x317ae9(0xae)][_0x317ae9(0x131)]()[_0x317ae9(0x130)](_0xf2a7b6[_0x317ae9(0x131)]());});return Promise[_0xa64c9(0xce)](_0x264f46);}}),_0x3296e7=()=>{const _0x44dd59=_0x244cd3;process[_0x44dd59(0x16a)][_0x44dd59(0xf5)]('\x1b[1A\x1b[2K'),process[_0x44dd59(0x16a)][_0x44dd59(0xf5)](_0x44dd59(0x1dd)),process[_0x44dd59(0x16a)][_0x44dd59(0xf5)]('\x1b[1A\x1b[2K');},_0x43d5f0=_0x4e85be&&_0x4e85be[_0x244cd3(0x9a)]&&_0x4e85be[_0x244cd3(0x9a)]!==null&&_0x4e85be['attemptId'][_0x244cd3(0x126)]()!=='';if(!_0x43d5f0){_0x3296e7(),console[_0x244cd3(0x10d)](a41_0x2a3f8b[_0x244cd3(0x161)](_0x244cd3(0x1b7)));return;}_0x3296e7();const _0x2e8e62=_0x4cb863['find'](_0x2f65ae=>_0x2f65ae[_0x244cd3(0x1a6)]?.['id']===_0x4e85be[_0x244cd3(0x9a)]);if(_0x2e8e62){const _0x452dec=_0x2e8e62['project']?.['name']||'?',_0x3ff994=_0x2e8e62[_0x244cd3(0x207)]?.[_0x244cd3(0x1ae)]||'?';console['log'](_0x244cd3(0x1fe)+a41_0x2a3f8b[_0x244cd3(0x161)](_0x452dec)+_0x244cd3(0x68)+a41_0x2a3f8b['dim'](_0x3ff994));}const _0xb3e604=new WorkflowTimelineCommand();await _0xb3e604[_0x244cd3(0x144)]({'args':[],'options':{..._0x10cc3e,'attemptId':_0x4e85be[_0x244cd3(0x9a)]},'tdx':_0x19c099});}[a41_0x30db68(0x105)](_0x1c9c15,_0x26ea64){const _0x3303a9=a41_0x30db68,_0xfee8f5=new Map();for(const _0x54cfc7 of _0x1c9c15){_0x54cfc7['id']&&_0x54cfc7[_0x3303a9(0x1a6)]?.['id']&&_0xfee8f5[_0x3303a9(0x121)](_0x54cfc7['id'],_0x54cfc7[_0x3303a9(0x1a6)]['id']);}const _0x1f6428=[];let _0x30a83b='';const _0x51a5a0=this[_0x3303a9(0x19a)](_0x1c9c15,_0x26ea64),_0x1e8a75=_0x51a5a0['split']('\x0a');for(const _0xf8e85c of _0x1e8a75){if(_0xf8e85c[_0x3303a9(0xd0)](_0x3303a9(0x17b))||_0xf8e85c['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x30a83b=_0xf8e85c;else{if(_0xf8e85c[_0x3303a9(0x108)](/^[✅❌🔄🛑⏳]/)){const _0x1a86fe=_0xf8e85c[_0x3303a9(0x108)](/#(\d+)/),_0x480ac0=_0x1a86fe?_0x1a86fe[0x1]:null,_0x3f8e1c=_0x480ac0?_0xfee8f5[_0x3303a9(0x183)](_0x480ac0)||null:null,_0x291d11=_0x1c9c15[_0x3303a9(0x1d6)](_0x30408f=>_0x30408f['id']===_0x480ac0),_0x42fb71=_0x291d11?.['project']?.[_0x3303a9(0x1ae)]||'';_0x1f6428[_0x3303a9(0x107)]({'displayLine':_0xf8e85c,'attemptId':_0x3f8e1c,'projectName':_0x42fb71});}}}return{'timelineRows':_0x1f6428,'timeAxisHeader':_0x30a83b};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]='workflow:attempts';[a41_0x30db68(0xe6)]=a41_0x30db68(0xc7);async['execute'](_0x48da17){const _0x226bd5=a41_0x30db68,{options:_0x68a37b,args:_0x2a1870,tdx:_0x16972a}=_0x48da17,_0x589797=this[_0x226bd5(0xd5)](_0x2a1870,_0x68a37b);if(!_0x589797)return 0x1;const {projectName:_0xebecc7,workflowName:_0x2d1a0b}=_0x589797,_0x2dc4a8=_0x68a37b[_0x226bd5(0x116)];if(_0x68a37b[_0x226bd5(0x146)]){if(_0xebecc7&&_0x2d1a0b)console[_0x226bd5(0x186)](_0x226bd5(0xa8)+_0xebecc7+'.'+_0x2d1a0b);else _0xebecc7&&console['error'](_0x226bd5(0x203)+_0xebecc7);_0x2dc4a8&&console[_0x226bd5(0x186)](_0x226bd5(0x10e));}const _0xddbc00=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x16972a[_0x226bd5(0x207)][_0x226bd5(0x1f4)]({'projectName':_0xebecc7,'workflowName':_0x2d1a0b,'includeRetried':_0x2dc4a8,'limit':_0x68a37b['limit']}),{'verbose':_0x68a37b[_0x226bd5(0x146)]}),_0x21ba9d=_0xddbc00[_0x226bd5(0xa7)],_0x405a9a=_0x68a37b['limit']||0x64,_0x3f8788=_0x21ba9d['length']>=_0x405a9a?a41_0x2a3f8b[_0x226bd5(0x161)](_0x226bd5(0x97)):'';console[_0x226bd5(0x186)](_0x226bd5(0x1e0)+_0x21ba9d[_0x226bd5(0x86)]+_0x226bd5(0x1e8)+(_0x21ba9d[_0x226bd5(0x86)]!==0x1?'s':'')+_0x3f8788);if(_0x68a37b[_0x226bd5(0x1a2)]===_0x226bd5(0xcb)||_0x68a37b['format']===_0x226bd5(0xf4)||_0x68a37b[_0x226bd5(0x1a2)]==='table')await handleSDKOutput(_0x21ba9d,_0x68a37b);else{if(_0x21ba9d['length']===0x0){if(_0xebecc7&&_0x2d1a0b)console['log'](_0x226bd5(0x200)+_0xebecc7+'.'+_0x2d1a0b);else _0xebecc7?console[_0x226bd5(0x10d)](_0x226bd5(0x190)+_0xebecc7):console[_0x226bd5(0x10d)](_0x226bd5(0x11c));}else{const _0x26be96=_0x68a37b[_0x226bd5(0x124)],_0x27897b=_0x21ba9d['map'](_0x2f429d=>{const _0x285c2e=_0x226bd5,_0xd5840f=a41_0x2a3f8b[_0x285c2e(0x161)]('#'+_0x2f429d['id']),_0xd5a8d7=_0x2f429d[_0x285c2e(0x8a)]?.['id'],_0x3c0acd=_0x2f429d['session_id']||_0x2f429d[_0x285c2e(0xf8)],_0x1e9eed=_0xd5a8d7&&_0x3c0acd?hyperlink(_0xd5840f,getWorkflowAttemptUrl(_0x26be96,_0xd5a8d7,_0x3c0acd,_0x2f429d['id'])):_0xd5840f,{icon:_0x55eccc,text:_0x5c0c60}=getAttemptStatusDisplay(_0x2f429d),_0x56d1a7=(_0x2f429d[_0x285c2e(0x8a)]?.[_0x285c2e(0x1ae)]||'?')+'.'+(_0x2f429d['workflow']?.['name']||'?'),_0x21e821=_0x2f429d[_0x285c2e(0xdb)]?a41_0x2a3f8b['dim'](_0x2f429d[_0x285c2e(0xdb)]):'';return(_0x1e9eed+'\x20'+_0x55eccc+(_0x5c0c60?'\x20'+_0x5c0c60:'')+'\x20'+_0x56d1a7+'\x20'+_0x21e821)[_0x285c2e(0x187)]();});await writeOutput(_0x27897b[_0x226bd5(0x10a)]('\x0a'),_0x68a37b[_0x226bd5(0xc0)],_0x226bd5(0x122));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1b6);['description']=a41_0x30db68(0x1d9);async[a41_0x30db68(0x144)](_0x277555){const _0x4f2bf6=a41_0x30db68,{options:_0x55e6e6,args:_0x7f3bf4,tdx:_0x469d94}=_0x277555,_0x302432=_0x7f3bf4[0x0];if(!_0x302432)return console[_0x4f2bf6(0x186)](_0x4f2bf6(0x1f5)),0x1;_0x55e6e6[_0x4f2bf6(0x146)]&&console['error'](_0x4f2bf6(0x202)+_0x302432);const _0x3e2cdb=await withSpinner('Getting\x20attempt\x20details...',()=>_0x469d94[_0x4f2bf6(0x207)][_0x4f2bf6(0x120)](_0x302432),{'verbose':_0x55e6e6['verbose']}),_0x1812ba=_0x3e2cdb[_0x4f2bf6(0xa7)];let _0xa839f6;!_0x1812ba['done']?_0xa839f6=_0x1812ba[_0x4f2bf6(0xfd)]?_0x4f2bf6(0x192):'running':_0xa839f6=_0x1812ba[_0x4f2bf6(0x104)]?_0x4f2bf6(0x104):_0x4f2bf6(0x186);let _0x4146a2;if(_0x1812ba[_0x4f2bf6(0x1bf)]&&_0x1812ba[_0x4f2bf6(0xf1)]){const _0x2a2f48=new Date(_0x1812ba['createdAt'])['getTime'](),_0x561013=new Date(_0x1812ba['finishedAt'])['getTime']();_0x4146a2=Math['round']((_0x561013-_0x2a2f48)/0x3e8);}const _0x5cb81c={'attempt_id':_0x1812ba['id'],'status':_0xa839f6,..._0x1812ba[_0x4f2bf6(0xac)]!==undefined&&{'index':_0x1812ba[_0x4f2bf6(0xac)]},..._0x1812ba[_0x4f2bf6(0x8a)]&&{'project':_0x1812ba[_0x4f2bf6(0x8a)][_0x4f2bf6(0x1ae)]},..._0x1812ba[_0x4f2bf6(0x207)]&&{'workflow':_0x1812ba[_0x4f2bf6(0x207)][_0x4f2bf6(0x1ae)]},..._0x1812ba['sessionId']&&{'session_id':_0x1812ba[_0x4f2bf6(0xf8)]},..._0x1812ba[_0x4f2bf6(0xdb)]&&{'session_time':_0x1812ba[_0x4f2bf6(0xdb)]},..._0x1812ba[_0x4f2bf6(0x1f7)]&&{'retry_attempt':_0x1812ba['retryAttemptName']},..._0x4146a2!==undefined&&{'duration_sec':_0x4146a2},..._0x1812ba[_0x4f2bf6(0x1bf)]&&{'created_at':_0x1812ba[_0x4f2bf6(0x1bf)]},..._0x1812ba[_0x4f2bf6(0xf1)]&&{'finished_at':_0x1812ba[_0x4f2bf6(0xf1)]},...Object[_0x4f2bf6(0x149)](_0x1812ba[_0x4f2bf6(0x1b4)])[_0x4f2bf6(0x86)]>0x0&&{'params':_0x1812ba['params']}};return await handleSingleObjectOutput(_0x5cb81c,_0x55e6e6),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1c2);[a41_0x30db68(0xe6)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x28eb4b){const _0x4b1d10=a41_0x30db68,{options:_0x4534ba,args:_0x1dea9c,tdx:_0x4c2401}=_0x28eb4b,_0x1b16a2=_0x1dea9c[0x0];if(!_0x1b16a2)return console[_0x4b1d10(0x186)](_0x4b1d10(0x1f5)),0x1;const _0x2426a8=_0x4534ba[_0x4b1d10(0x215)];_0x4534ba[_0x4b1d10(0x146)]&&(console[_0x4b1d10(0x186)]('Attempt\x20ID:\x20'+_0x1b16a2),_0x2426a8&&console['error'](_0x4b1d10(0x17e)));const _0x40cfbd=await withSpinner(_0x4b1d10(0x201),()=>_0x4c2401[_0x4b1d10(0x207)]['tasks'](_0x1b16a2,_0x2426a8||![]),{'verbose':_0x4534ba[_0x4b1d10(0x146)]}),_0x12d7a0=_0x40cfbd['data'];return console[_0x4b1d10(0x186)]('✔\x20Found\x20'+_0x12d7a0[_0x4b1d10(0x86)]+'\x20task'+(_0x12d7a0['length']!==0x1?'s':'')),await handleSDKOutput(_0x12d7a0,_0x4534ba),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1b1);[a41_0x30db68(0xe6)]=a41_0x30db68(0x6c);async[a41_0x30db68(0x144)](_0x17aa2c){const _0x23e842=a41_0x30db68,{options:_0x3863f3,args:_0x1636fb,tdx:_0x596208}=_0x17aa2c,_0x2760e4=_0x1636fb[0x0];let _0x3d170=_0x1636fb[0x1];if(!_0x2760e4)return console[_0x23e842(0x186)](_0x23e842(0x1f5)),0x1;_0x3863f3[_0x23e842(0x146)]&&(console['error'](_0x23e842(0x202)+_0x2760e4),_0x3d170&&console[_0x23e842(0x186)](_0x23e842(0x165)+_0x3d170));const _0x2efce8=await withSpinner('Fetching\x20log\x20files...',()=>_0x596208[_0x23e842(0x207)][_0x23e842(0x12d)](_0x2760e4,_0x3d170),{'verbose':_0x3863f3['verbose']}),_0x4ef2a6=_0x2efce8[_0x23e842(0xa7)];if(_0x4ef2a6[_0x23e842(0x86)]===0x0)return console[_0x23e842(0x186)](_0x23e842(0xfa)),0x0;if(!_0x3d170&&(_0x3863f3[_0x23e842(0xcb)]||_0x3863f3[_0x23e842(0x1a2)]))return await handleSDKOutput(_0x4ef2a6,_0x3863f3),0x0;if(!_0x3d170){const _0x3e8cb6=_0x4ef2a6[_0x23e842(0x7c)](_0x41b34a=>({'title':_0x41b34a[_0x23e842(0x13d)]+'\x20('+formatBytes(_0x41b34a['fileSize'])+')','value':_0x41b34a[_0x23e842(0x13d)]})),_0x1a3f9b=await a41_0x5d4edd({'type':_0x23e842(0x197),'name':_0x23e842(0x8d),'message':_0x23e842(0xaf),'choices':_0x3e8cb6});if(!_0x1a3f9b[_0x23e842(0x8d)])return console[_0x23e842(0x186)](_0x23e842(0x1b7)),0x0;_0x3d170=_0x1a3f9b[_0x23e842(0x8d)];}const _0x5c9a9f=await withSpinner(_0x23e842(0x1c5),()=>_0x596208[_0x23e842(0x207)]['logs'](_0x2760e4,_0x3d170),{'verbose':_0x3863f3[_0x23e842(0x146)]}),_0xcf548=_0x5c9a9f[_0x23e842(0xa7)];return _0xcf548?console['log'](_0xcf548):console[_0x23e842(0x186)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x12f);[a41_0x30db68(0xe6)]=a41_0x30db68(0x1fc);async[a41_0x30db68(0x144)](_0x839f14){const _0x56fbc7=a41_0x30db68,{options:_0x19f96f,args:_0x98804,tdx:_0x589421}=_0x839f14,_0x4a433d=_0x98804[0x0];if(!_0x4a433d)return console[_0x56fbc7(0x186)](_0x56fbc7(0x1f5)),0x1;const _0x1f869f=_0x19f96f[_0x56fbc7(0x113)];_0x19f96f[_0x56fbc7(0x146)]&&(console['error'](_0x56fbc7(0x202)+_0x4a433d),_0x1f869f&&console[_0x56fbc7(0x186)](_0x56fbc7(0x1f9)+_0x1f869f));if(!_0x19f96f[_0x56fbc7(0x16b)]){const _0x32a5ba=await confirmKey(_0x56fbc7(0x98)+_0x4a433d+'?');if(!_0x32a5ba)return console['error'](_0x56fbc7(0x1b7)),0x0;}const _0x418e2b=await withSpinner(_0x56fbc7(0x84),()=>_0x589421[_0x56fbc7(0x207)][_0x56fbc7(0x12a)](_0x4a433d,_0x1f869f),{'verbose':_0x19f96f[_0x56fbc7(0x146)]}),_0x258611=_0x418e2b[_0x56fbc7(0xa7)];return console[_0x56fbc7(0x186)]('✔\x20'+_0x258611),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1ef);[a41_0x30db68(0xe6)]=a41_0x30db68(0x69);async[a41_0x30db68(0x144)](_0x7337d7){const _0x43a495=a41_0x30db68,{options:_0x49df82,args:_0x5f0042,tdx:_0x3e807d}=_0x7337d7,_0x18f667=_0x5f0042[0x0];if(!_0x18f667)return console[_0x43a495(0x186)](_0x43a495(0x185)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2ab853=![],_0x454577=_0x18f667;if(_0x18f667[_0x43a495(0xd0)]('session:'))_0x2ab853=!![],_0x454577=_0x18f667[_0x43a495(0x1a5)](0x8);else{if(_0x18f667[_0x43a495(0xd0)](_0x43a495(0x9f)))_0x2ab853=![],_0x454577=_0x18f667[_0x43a495(0x1a5)](0x8);else return console[_0x43a495(0x186)](_0x43a495(0xcd)),console[_0x43a495(0x186)](_0x43a495(0x189)),0x1;}const _0x508126=_0x49df82[_0x43a495(0x18e)],_0x24fdda=_0x49df82['resumeFrom'],_0x3dbb9c=_0x49df82[_0x43a495(0x1b4)],_0xb67090=_0x49df82[_0x43a495(0x1f3)];_0x49df82[_0x43a495(0x146)]&&(console[_0x43a495(0x186)](_0x43a495(0x138)+(_0x2ab853?_0x43a495(0x19d):'attempt')+'\x20'+_0x454577),_0x508126&&console[_0x43a495(0x186)](_0x43a495(0x1aa)+_0x508126),_0x24fdda&&console[_0x43a495(0x186)](_0x43a495(0x1d2)+_0x24fdda),_0x3dbb9c&&console[_0x43a495(0x186)](_0x43a495(0xe2)+_0x3dbb9c),_0xb67090&&console[_0x43a495(0x186)](_0x43a495(0xab)));let _0x31c32d;if(_0x3dbb9c)try{if(_0x3dbb9c[_0x43a495(0xd0)]('@')){const _0x3271d0=await import('fs/promises'),_0x34af57=_0x3dbb9c['substring'](0x1),_0x136b3b=await _0x3271d0[_0x43a495(0xb4)](_0x34af57,_0x43a495(0x143));_0x31c32d=JSON['parse'](_0x136b3b);}else _0x31c32d=JSON[_0x43a495(0x111)](_0x3dbb9c);}catch{return console[_0x43a495(0x186)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x49df82[_0x43a495(0x16b)]){const _0x60f621=await confirmKey(_0x43a495(0x102)+(_0x2ab853?_0x43a495(0x19d):'attempt')+'\x20'+_0x454577+'?');if(!_0x60f621)return console[_0x43a495(0x186)]('Cancelled'),0x0;}let _0x1b4b25;_0x2ab853?_0x1b4b25=await withSpinner('Retrying\x20session...',()=>_0x3e807d[_0x43a495(0x207)][_0x43a495(0x6e)](_0x454577,{'fromTask':_0x508126,'retryParams':_0x31c32d}),{'verbose':_0x49df82[_0x43a495(0x146)]}):_0x1b4b25=await withSpinner(_0x43a495(0x214),()=>_0x3e807d[_0x43a495(0x207)][_0x43a495(0x14b)](_0x454577,{'resumeFrom':_0x24fdda,'retryParams':_0x31c32d,'force':_0xb67090}),{'verbose':_0x49df82[_0x43a495(0x146)]});const _0x5bd74d=_0x1b4b25[_0x43a495(0xa7)];return console[_0x43a495(0x186)](_0x43a495(0x10c)),console[_0x43a495(0x186)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x5bd74d[_0x43a495(0x9a)]),console[_0x43a495(0x186)]('\x20\x20Session\x20ID:\x20'+_0x5bd74d[_0x43a495(0xf8)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1dc);[a41_0x30db68(0xe6)]=a41_0x30db68(0xb3);async[a41_0x30db68(0x144)](_0x5cd316){const _0x2b7570=a41_0x30db68,{options:_0x3baa5d,args:_0x4aa3f8,tdx:_0x4c1602}=_0x5cd316;let _0x16be21=_0x4aa3f8[0x0];if(!_0x16be21){const _0x7a7c9f=this[_0x2b7570(0x1ff)]([],_0x3baa5d),_0x4f1e18=await withSpinner('Loading\x20workflows...',()=>_0x4c1602['workflow'][_0x2b7570(0x1b3)](_0x7a7c9f,{'limit':_0x3baa5d[_0x2b7570(0x101)]}),{'verbose':_0x3baa5d[_0x2b7570(0x146)]}),_0x2cdff9=_0x4f1e18[_0x2b7570(0xa7)];if(_0x2cdff9[_0x2b7570(0x86)]===0x0)return console[_0x2b7570(0x186)]('No\x20workflows\x20found'),!_0x7a7c9f&&console[_0x2b7570(0x186)](a41_0x2a3f8b['dim'](_0x2b7570(0x125))),0x1;const _0x5ce40e=_0x2cdff9[_0x2b7570(0x7c)](_0xb42dd9=>({'title':_0xb42dd9[_0x2b7570(0x8a)]?.['name']+'.'+_0xb42dd9[_0x2b7570(0x1ae)],'value':_0xb42dd9[_0x2b7570(0x8a)]?.['name']+'.'+_0xb42dd9[_0x2b7570(0x1ae)],'description':_0xb42dd9['revision']?_0x2b7570(0x177)+_0xb42dd9['revision']:undefined})),_0x428d20=await a41_0x5d4edd({'type':_0x2b7570(0x197),'name':_0x2b7570(0x207),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x5ce40e});if(!_0x428d20[_0x2b7570(0x207)])return 0x1;_0x16be21=_0x428d20[_0x2b7570(0x207)];}if(!_0x16be21[_0x2b7570(0x130)]('.')){const _0x2b4773=this['resolveProject']([],_0x3baa5d);if(_0x2b4773)_0x16be21=_0x2b4773+'.'+_0x16be21;else return console[_0x2b7570(0x186)](a41_0x2a3f8b[_0x2b7570(0x1c6)](_0x2b7570(0x1ab)),_0x2b7570(0x158)),console[_0x2b7570(0x186)](a41_0x2a3f8b[_0x2b7570(0x161)](_0x2b7570(0x125))),0x1;}const _0x50d232=_0x3baa5d[_0x2b7570(0xdf)],_0x542ab5=_0x3baa5d[_0x2b7570(0xdb)],_0x32cf8c={};if(_0x50d232&&Array[_0x2b7570(0x162)](_0x50d232))for(const _0x190691 of _0x50d232){const _0x3ece0d=_0x190691[_0x2b7570(0x1a4)]('=');if(_0x3ece0d===-0x1)return console[_0x2b7570(0x186)](_0x2b7570(0x118)+_0x190691),console['error'](_0x2b7570(0x1ec)),0x1;const _0x36a168=_0x190691[_0x2b7570(0x1a5)](0x0,_0x3ece0d),_0x4822c3=_0x190691[_0x2b7570(0x1a5)](_0x3ece0d+0x1);try{_0x32cf8c[_0x36a168]=JSON[_0x2b7570(0x111)](_0x4822c3);}catch{_0x32cf8c[_0x36a168]=_0x4822c3;}}_0x3baa5d['verbose']&&(console[_0x2b7570(0x186)](_0x2b7570(0x10f)+_0x16be21),Object[_0x2b7570(0x149)](_0x32cf8c)[_0x2b7570(0x86)]>0x0&&console['error'](_0x2b7570(0x167)+JSON[_0x2b7570(0x83)](_0x32cf8c)),_0x542ab5&&console[_0x2b7570(0x186)](_0x2b7570(0x1ac)+_0x542ab5));const _0x577276=await withSpinner(_0x2b7570(0x216),()=>_0x4c1602[_0x2b7570(0x207)][_0x2b7570(0xfc)](_0x16be21,_0x32cf8c,{'sessionTime':_0x542ab5}),{'verbose':_0x3baa5d['verbose']}),_0xb43f9=_0x577276[_0x2b7570(0xa7)];console[_0x2b7570(0x186)](_0x2b7570(0x152)),console[_0x2b7570(0x186)](_0x2b7570(0xb1)+_0xb43f9['id']),console[_0x2b7570(0x186)](_0x2b7570(0xba)+_0xb43f9[_0x2b7570(0xf8)]),console['error']('\x20\x20Project:\x20'+_0xb43f9[_0x2b7570(0x8a)]?.['name']),console[_0x2b7570(0x186)]('\x20\x20Workflow:\x20'+_0xb43f9[_0x2b7570(0x207)]?.['name']);if(_0xb43f9[_0x2b7570(0x8a)]?.['id']&&_0xb43f9[_0x2b7570(0xf8)]&&_0xb43f9['id']){const _0x3e4df0=_0x3baa5d['site'],_0x104bca=getConsoleUrl(_0x3e4df0,_0x2b7570(0x1ce)+_0xb43f9['project']['id']+_0x2b7570(0x7e)+_0xb43f9[_0x2b7570(0xf8)]+_0x2b7570(0x1de)+_0xb43f9['id']);console[_0x2b7570(0x186)](_0x2b7570(0x1b0)+a41_0x2a3f8b[_0x2b7570(0x1be)](_0x104bca));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x30db68(0x1ae)]='workflow:download';[a41_0x30db68(0xe6)]=a41_0x30db68(0x92);async['execute'](_0x144890){const _0x58c21b=a41_0x30db68,{options:_0x22cb54,args:_0x1db279,tdx:_0x1d0694}=_0x144890,_0x5556f0=_0x1db279[0x0],_0xca7d3e=_0x1db279[0x1]||'.';if(!_0x5556f0)return console['error'](_0x58c21b(0x13c)),console[_0x58c21b(0x186)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x59a4a0=_0x22cb54['revision'];_0x22cb54[_0x58c21b(0x146)]&&(console[_0x58c21b(0x186)](_0x58c21b(0x1fe)+_0x5556f0),console[_0x58c21b(0x186)]('Output\x20directory:\x20'+_0xca7d3e),_0x59a4a0&&console[_0x58c21b(0x186)](_0x58c21b(0x1bb)+_0x59a4a0));const _0x3bb33c=await withSpinner(_0x58c21b(0xd3)+_0x5556f0+_0x58c21b(0x179),()=>_0x1d0694[_0x58c21b(0x207)][_0x58c21b(0xff)](_0x5556f0,_0xca7d3e,{'revision':_0x59a4a0}),{'verbose':_0x22cb54[_0x58c21b(0x146)]}),_0x259c70=_0x3bb33c[_0x58c21b(0xa7)];return console[_0x58c21b(0x186)](_0x58c21b(0x13e)+_0x259c70[_0x58c21b(0x18f)]),console[_0x58c21b(0x186)](_0x58c21b(0x8f)+_0x259c70[_0x58c21b(0x176)]),console['error'](_0x58c21b(0xd9)+_0x259c70[_0x58c21b(0x11b)]),console[_0x58c21b(0x186)](_0x58c21b(0x208)+_0xca7d3e+'/'+_0x259c70['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x175);['description']='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async['execute'](_0x246a36){const _0x5cc38a=a41_0x30db68,{options:_0x4d0c10,args:_0x3fee4e,tdx:_0xc2faa}=_0x246a36;let _0x180232='.',_0x34559c=_0x4d0c10['name'];if(_0x3fee4e[0x0]){const {promises:_0x2e3411}=await import('fs');try{const _0x55a3d4=await _0x2e3411[_0x5cc38a(0xbc)](_0x3fee4e[0x0]);if(_0x55a3d4[_0x5cc38a(0x117)]())_0x180232=_0x3fee4e[0x0];else return console['error'](_0x5cc38a(0x7b)+_0x3fee4e[0x0]+_0x5cc38a(0xe4)),0x1;}catch{_0x34559c=_0x3fee4e[0x0],_0x180232='.';}}const _0x53e9ea=_0x4d0c10[_0x5cc38a(0x176)],_0xfa32ab=_0x4d0c10[_0x5cc38a(0x1d4)];_0x4d0c10[_0x5cc38a(0x146)]&&(console['error'](_0x5cc38a(0x172)+_0x180232),_0x34559c&&console['error'](_0x5cc38a(0x1e7)+_0x34559c),_0x53e9ea&&console[_0x5cc38a(0x186)](_0x5cc38a(0x1bb)+_0x53e9ea),_0xfa32ab&&console[_0x5cc38a(0x186)]('Validation:\x20skipped'));const _0x315861=await withSpinner(_0x5cc38a(0xa1),()=>_0xc2faa[_0x5cc38a(0x207)][_0x5cc38a(0x107)](_0x180232,{'projectName':_0x34559c,'revision':_0x53e9ea,'skipValidation':_0xfa32ab}),{'verbose':_0x4d0c10[_0x5cc38a(0x146)]}),_0xaa60bb=_0x315861[_0x5cc38a(0xa7)];return console[_0x5cc38a(0x186)]('✔\x20Pushed\x20'+_0xaa60bb[_0x5cc38a(0x18f)]),console[_0x5cc38a(0x186)](_0x5cc38a(0x17d)+_0xaa60bb[_0x5cc38a(0xd6)]),console[_0x5cc38a(0x186)](_0x5cc38a(0x8f)+_0xaa60bb['revision']),await this[_0x5cc38a(0x1b8)](_0xc2faa,_0xaa60bb[_0x5cc38a(0x18f)],_0x4d0c10[_0x5cc38a(0x124)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x1a9);[a41_0x30db68(0xe6)]=a41_0x30db68(0x137);async[a41_0x30db68(0x144)](_0x1e7af6){const _0x73f0ce=a41_0x30db68,{options:_0x17f959,args:_0x3f5d01,tdx:_0x316c54}=_0x1e7af6,_0x40ace0=_0x3f5d01[0x0],_0x4aeeb3=_0x3f5d01[0x1];if(!_0x40ace0)return console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0x1c6)](_0x73f0ce(0x1ab)),_0x73f0ce(0x80)),console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0x161)](_0x73f0ce(0x110))),0x1;const _0x5b6e2e=_0x17f959[_0x73f0ce(0x176)];_0x17f959[_0x73f0ce(0x146)]&&(console[_0x73f0ce(0x186)](_0x73f0ce(0x1fe)+_0x40ace0),_0x4aeeb3&&console['error'](_0x73f0ce(0x1ea)+_0x4aeeb3),_0x5b6e2e&&console['error'](_0x73f0ce(0x1bb)+_0x5b6e2e),_0x17f959[_0x73f0ce(0x1a7)]&&console[_0x73f0ce(0x186)](_0x73f0ce(0x7a)));const _0x1d0889=await withSpinner(_0x73f0ce(0x1a1)+_0x40ace0+_0x73f0ce(0x179),()=>_0x316c54[_0x73f0ce(0x207)][_0x73f0ce(0x71)](_0x40ace0,{'targetDir':_0x4aeeb3,'revision':_0x5b6e2e}),{'verbose':_0x17f959[_0x73f0ce(0x146)]}),_0x2398e3=_0x1d0889[_0x73f0ce(0xa7)];_0x2398e3[_0x73f0ce(0x12e)]?console[_0x73f0ce(0x186)](_0x73f0ce(0xde)+_0x2398e3[_0x73f0ce(0x18f)]):console[_0x73f0ce(0x186)]('✔\x20Project:\x20'+_0x2398e3[_0x73f0ce(0x18f)]);console[_0x73f0ce(0x186)]('\x20\x20Revision:\x20'+_0x2398e3['revision']),console[_0x73f0ce(0x186)]('\x20\x20Target:\x20'+(a41_0x3fb9ea['relative'](process['cwd'](),_0x2398e3[_0x73f0ce(0x1df)])||'.')),console[_0x73f0ce(0x186)](_0x73f0ce(0x1fa)+a41_0x2a3f8b[_0x73f0ce(0xe8)]('+'+_0x2398e3[_0x73f0ce(0x100)]['new']+_0x73f0ce(0xea))+',\x20'+(a41_0x2a3f8b[_0x73f0ce(0xd4)]('~'+_0x2398e3[_0x73f0ce(0x100)][_0x73f0ce(0xa4)]+_0x73f0ce(0xa2))+',\x20')+(a41_0x2a3f8b['red']('-'+_0x2398e3[_0x73f0ce(0x100)]['deleted']+_0x73f0ce(0x132))+',\x20')+(''+a41_0x2a3f8b[_0x73f0ce(0x161)](_0x2398e3['summary']['unchanged']+_0x73f0ce(0x11f))));for(const _0x3d085e of _0x2398e3[_0x73f0ce(0x20a)]){_0x3d085e['type']===_0x73f0ce(0xa4)&&_0x3d085e['diff']&&(console[_0x73f0ce(0x186)]('\x0a'+a41_0x2a3f8b[_0x73f0ce(0x1be)](_0x73f0ce(0x112)+_0x3d085e[_0x73f0ce(0x1e4)])),console[_0x73f0ce(0x186)](_0x3d085e[_0x73f0ce(0x1f8)]));}if(!_0x2398e3[_0x73f0ce(0xd7)])return saveSessionContext({'workflow_project':_0x2398e3[_0x73f0ce(0x18f)]},_0x17f959['session']),console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0xe8)](_0x73f0ce(0x1c3))),console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0x161)](_0x73f0ce(0xdd)+_0x2398e3[_0x73f0ce(0x18f)])),0x0;if(_0x17f959[_0x73f0ce(0x1a7)])return console['error'](a41_0x2a3f8b['yellow'](_0x73f0ce(0x191))),0x0;if(!_0x17f959[_0x73f0ce(0x16b)]){const _0x2209a3=await confirmKey(_0x73f0ce(0x1b5));if(!_0x2209a3)return console[_0x73f0ce(0x186)](_0x73f0ce(0x1b7)),0x0;}await withSpinner(_0x73f0ce(0x150),()=>_0x316c54[_0x73f0ce(0x207)]['applyPullProject'](_0x2398e3,{'revision':_0x5b6e2e}),{'verbose':_0x17f959['verbose']}),saveSessionContext({'workflow_project':_0x2398e3[_0x73f0ce(0x18f)]},_0x17f959[_0x73f0ce(0x19d)]),console[_0x73f0ce(0x186)](a41_0x2a3f8b['green'](_0x73f0ce(0xc4)));const _0x1527e5=a41_0x3fb9ea[_0x73f0ce(0x135)](process['cwd'](),_0x2398e3[_0x73f0ce(0x1df)])||'.';return console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0x161)]('\x20\x20Location:\x20'+_0x1527e5)),console[_0x73f0ce(0x186)](a41_0x2a3f8b[_0x73f0ce(0x161)](_0x73f0ce(0xdd)+_0x2398e3['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']=a41_0x30db68(0x14a);async[a41_0x30db68(0x144)](_0x1083ae){const _0x3198c1=a41_0x30db68,{options:_0x2e4833,args:_0x47bfc3,tdx:_0x2fb37b}=_0x1083ae,_0x1155d7=this[_0x3198c1(0xf3)](_0x47bfc3,_0x2e4833),_0x16a36a=_0x2e4833[_0x3198c1(0x176)],_0x6dcd3d=_0x2e4833[_0x3198c1(0x1d4)];_0x2e4833[_0x3198c1(0x146)]&&(_0x1155d7&&console[_0x3198c1(0x186)](_0x3198c1(0x1bd)+_0x1155d7),_0x16a36a&&console[_0x3198c1(0x186)]('Revision:\x20'+_0x16a36a),_0x2e4833['dryRun']&&console['error'](_0x3198c1(0x7a)),_0x6dcd3d&&console['error'](_0x3198c1(0x205)));let _0x929dd5;try{_0x929dd5=await withSpinner(_0x3198c1(0x1af),()=>_0x2fb37b[_0x3198c1(0x207)][_0x3198c1(0x155)]({'sourceDir':_0x1155d7,'revision':_0x16a36a,'skipValidation':_0x6dcd3d}),{'verbose':_0x2e4833[_0x3198c1(0x146)]});}catch(_0x2798c0){if(_0x2798c0 instanceof Error&&_0x2798c0[_0x3198c1(0x6d)][_0x3198c1(0x130)](_0x3198c1(0x20b)))return console[_0x3198c1(0x186)](a41_0x2a3f8b[_0x3198c1(0x1c6)](_0x3198c1(0x1ab)),_0x3198c1(0x8c)),_0x2e4833[_0x3198c1(0x20e)]?console[_0x3198c1(0x186)](a41_0x2a3f8b[_0x3198c1(0x161)](_0x3198c1(0x7d)+_0x2e4833[_0x3198c1(0x20e)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x2e4833[_0x3198c1(0x20e)]+'\x27')):console[_0x3198c1(0x186)](a41_0x2a3f8b[_0x3198c1(0x161)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x2798c0;}const _0x24417a=_0x929dd5['data'];console[_0x3198c1(0x186)](_0x3198c1(0x151)+_0x24417a[_0x3198c1(0x18f)]),console[_0x3198c1(0x186)]('\x20\x20Source:\x20'+_0x24417a[_0x3198c1(0x114)]),console['error'](_0x3198c1(0x8f)+_0x24417a[_0x3198c1(0x176)]),console[_0x3198c1(0x186)](_0x3198c1(0x1fa)+a41_0x2a3f8b[_0x3198c1(0xe8)]('+'+_0x24417a['summary'][_0x3198c1(0x1bc)]+_0x3198c1(0xea))+',\x20'+(a41_0x2a3f8b[_0x3198c1(0xd4)]('~'+_0x24417a[_0x3198c1(0x100)][_0x3198c1(0xa4)]+_0x3198c1(0xa2))+',\x20')+(a41_0x2a3f8b[_0x3198c1(0x1c6)]('-'+_0x24417a[_0x3198c1(0x100)]['deleted']+_0x3198c1(0x132))+',\x20')+(''+a41_0x2a3f8b[_0x3198c1(0x161)](_0x24417a[_0x3198c1(0x100)][_0x3198c1(0x13f)]+_0x3198c1(0x11f))));for(const _0x36b622 of _0x24417a[_0x3198c1(0x20a)]){_0x36b622[_0x3198c1(0x159)]==='modified'&&_0x36b622['diff']&&(console['error']('\x0a'+a41_0x2a3f8b[_0x3198c1(0x1be)](_0x3198c1(0x112)+_0x36b622[_0x3198c1(0x1e4)])),console[_0x3198c1(0x186)](_0x36b622[_0x3198c1(0x1f8)]));}if(!_0x24417a[_0x3198c1(0xd7)])return console['error'](a41_0x2a3f8b[_0x3198c1(0xe8)](_0x3198c1(0x87))),await this['showWorkflowConsoleUrl'](_0x2fb37b,_0x24417a['projectName'],_0x2e4833[_0x3198c1(0x124)]),0x0;if(_0x2e4833[_0x3198c1(0x1a7)])return console['error'](a41_0x2a3f8b[_0x3198c1(0xd4)](_0x3198c1(0x213))),0x0;if(!_0x2e4833[_0x3198c1(0x16b)]){const _0x279634=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x279634)return console['error'](_0x3198c1(0x1b7)),0x0;}const _0x539160=await withSpinner(_0x3198c1(0xc2),()=>_0x2fb37b[_0x3198c1(0x207)][_0x3198c1(0x1ed)](_0x24417a),{'verbose':_0x2e4833['verbose']}),_0x33a05=_0x539160[_0x3198c1(0xa7)];return console[_0x3198c1(0x186)](a41_0x2a3f8b['green'](_0x3198c1(0xb6))),console['error'](_0x3198c1(0x17d)+_0x33a05[_0x3198c1(0xd6)]),console[_0x3198c1(0x186)](_0x3198c1(0x8f)+_0x33a05[_0x3198c1(0x176)]),await this['showWorkflowConsoleUrl'](_0x2fb37b,_0x33a05[_0x3198c1(0x18f)],_0x2e4833[_0x3198c1(0x124)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]='workflow:clone';[a41_0x30db68(0xe6)]=a41_0x30db68(0x9c);async[a41_0x30db68(0x144)](_0xbcd1c){const _0x3c21bb=a41_0x30db68,{options:_0x1909e8,args:_0x29e9e2,tdx:_0x3e8eb0}=_0xbcd1c,_0x1f9c7=this[_0x3c21bb(0xf3)](_0x29e9e2,_0x1909e8),_0x5b09b3=_0x1909e8[_0x3c21bb(0x1ae)],_0x391617=_0x1909e8[_0x3c21bb(0x176)],_0xef095e=_0x1909e8[_0x3c21bb(0x1d4)];if(!_0x1f9c7)return console['error'](a41_0x2a3f8b[_0x3c21bb(0x1c6)](_0x3c21bb(0x1ab)),_0x3c21bb(0x6f)),console['error'](a41_0x2a3f8b[_0x3c21bb(0x161)](_0x3c21bb(0xa0))),console[_0x3c21bb(0x186)](a41_0x2a3f8b[_0x3c21bb(0x161)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5b09b3)return console[_0x3c21bb(0x186)](a41_0x2a3f8b[_0x3c21bb(0x1c6)]('Error:'),_0x3c21bb(0x136)),console[_0x3c21bb(0x186)](a41_0x2a3f8b[_0x3c21bb(0x161)](_0x3c21bb(0xa0))),0x1;_0x1909e8['verbose']&&(console['error'](_0x3c21bb(0x1bd)+_0x1f9c7),console['error'](_0x3c21bb(0x14e)+_0x5b09b3),_0x391617&&console[_0x3c21bb(0x186)](_0x3c21bb(0x1bb)+_0x391617),_0x1909e8['dryRun']&&console['error'](_0x3c21bb(0x7a)),_0xef095e&&console['error'](_0x3c21bb(0x205)));const _0x3ebbf5=await withSpinner('Analyzing\x20project...',()=>_0x3e8eb0[_0x3c21bb(0x207)]['prepareCloneProject'](_0x1f9c7,_0x5b09b3,{'revision':_0x391617,'skipValidation':_0xef095e}),{'verbose':_0x1909e8['verbose']}),_0x4e7e01=_0x3ebbf5[_0x3c21bb(0xa7)];console[_0x3c21bb(0x186)]('Source:\x20'+_0x4e7e01[_0x3c21bb(0x114)]);_0x4e7e01[_0x3c21bb(0x16e)]&&console[_0x3c21bb(0x186)](_0x3c21bb(0xbb)+_0x4e7e01[_0x3c21bb(0x16e)]);console['error'](_0x3c21bb(0x14e)+_0x4e7e01['newProjectName']),console[_0x3c21bb(0x186)]('Revision:\x20'+_0x4e7e01[_0x3c21bb(0x176)]),console[_0x3c21bb(0x186)]('Files\x20to\x20upload:\x20'+_0x4e7e01[_0x3c21bb(0x19c)]);_0x4e7e01[_0x3c21bb(0x96)]&&(console['error'](a41_0x2a3f8b[_0x3c21bb(0xd4)](_0x3c21bb(0x15c)+_0x4e7e01[_0x3c21bb(0x1f6)]+_0x3c21bb(0xef)+_0x4e7e01[_0x3c21bb(0x168)]+')')),console[_0x3c21bb(0x186)](a41_0x2a3f8b['yellow'](_0x3c21bb(0x154))));if(_0x1909e8[_0x3c21bb(0x1a7)])return console[_0x3c21bb(0x186)](a41_0x2a3f8b[_0x3c21bb(0xd4)](_0x3c21bb(0x13a))),0x0;if(!_0x1909e8[_0x3c21bb(0x16b)]){const _0x28d8f6=_0x4e7e01['sourceProjectName']||a41_0x3fb9ea['basename'](_0x1f9c7),_0x5e7655=_0x4e7e01[_0x3c21bb(0x96)]?_0x3c21bb(0x14f)+_0x5b09b3+_0x3c21bb(0x70):_0x3c21bb(0xb7)+_0x28d8f6+_0x3c21bb(0xf0)+_0x5b09b3+'\x22?',_0x34a6aa=await confirmKey(_0x5e7655);if(!_0x34a6aa)return console[_0x3c21bb(0x186)](_0x3c21bb(0x1b7)),0x0;}const _0x5639c6=await withSpinner(_0x4e7e01['targetExists']?_0x3c21bb(0x1d3)+_0x5b09b3+_0x3c21bb(0x179):_0x3c21bb(0xc8)+_0x5b09b3+_0x3c21bb(0x179),()=>_0x3e8eb0[_0x3c21bb(0x207)][_0x3c21bb(0x1cd)](_0x4e7e01),{'verbose':_0x1909e8[_0x3c21bb(0x146)]}),_0x2c7308=_0x5639c6[_0x3c21bb(0xa7)];return console[_0x3c21bb(0x186)](a41_0x2a3f8b['green'](_0x4e7e01[_0x3c21bb(0x96)]?'✔\x20Project\x20updated':_0x3c21bb(0x15b))),console[_0x3c21bb(0x186)](_0x3c21bb(0xe3)+_0x2c7308['newProjectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x2c7308[_0x3c21bb(0x1d0)]),console['error']('\x20\x20Revision:\x20'+_0x2c7308[_0x3c21bb(0x176)]),await this[_0x3c21bb(0x1b8)](_0x3e8eb0,_0x2c7308['newProjectName'],_0x1909e8[_0x3c21bb(0x124)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a41_0x30db68(0x212);[a41_0x30db68(0xe6)]=a41_0x30db68(0x133);async['execute'](_0x2f11ab){const _0x5bf056=a41_0x30db68,{options:_0x411f8f,args:_0x46d509,tdx:_0xff74a7}=_0x2f11ab,_0x4c5593=_0x46d509[0x0];if(!_0x4c5593)return console[_0x5bf056(0x186)](_0x5bf056(0x1c1)),console['error'](_0x5bf056(0x115)),0x1;_0x411f8f['verbose']&&console[_0x5bf056(0x186)](_0x5bf056(0x1fe)+_0x4c5593);if(!_0x411f8f[_0x5bf056(0x16b)]){const _0x3c5829=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x4c5593+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3c5829)return console[_0x5bf056(0x186)](_0x5bf056(0x1b7)),0x0;}const _0x455317=await withSpinner(_0x5bf056(0x1ca)+_0x4c5593+_0x5bf056(0x179),()=>_0xff74a7['workflow'][_0x5bf056(0x16d)](_0x4c5593),{'verbose':_0x411f8f[_0x5bf056(0x146)]}),_0x29ed08=_0x455317[_0x5bf056(0xa7)];return console[_0x5bf056(0x186)](_0x5bf056(0xc6)+_0x29ed08[_0x5bf056(0x18f)]),console[_0x5bf056(0x186)](_0x5bf056(0x17d)+_0x29ed08[_0x5bf056(0xd6)]),0x0;}}export function parseKeyValue(_0x23e793){const _0x38154b=a41_0x30db68,_0x365259=_0x23e793[_0x38154b(0x1a4)]('=');if(_0x365259===-0x1)throw new Error(_0x38154b(0xda)+_0x23e793+_0x38154b(0x139));const _0xa446a0=_0x23e793['substring'](0x0,_0x365259),_0x4bff20=_0x23e793[_0x38154b(0x1a5)](_0x365259+0x1);if(!_0xa446a0)throw new Error(_0x38154b(0x198));return{'key':_0xa446a0,'value':_0x4bff20};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a41_0x30db68(0x129);[a41_0x30db68(0xe6)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a41_0x30db68(0x144)](_0x150247){const _0x3c1f83=a41_0x30db68,{options:_0x2acfb7,args:_0x299bc9,tdx:_0x475ec5}=_0x150247,_0x127ac0=this['requireProject'](_0x299bc9,_0x2acfb7);if(!_0x127ac0)return 0x1;_0x2acfb7[_0x3c1f83(0x146)]&&console[_0x3c1f83(0x186)](_0x3c1f83(0x1fe)+_0x127ac0);const _0x388e91=await withSpinner(_0x3c1f83(0x16f),()=>_0x475ec5[_0x3c1f83(0x207)]['listSecrets'](_0x127ac0),{'verbose':_0x2acfb7[_0x3c1f83(0x146)]}),{secrets:_0x3f4a41}=_0x388e91[_0x3c1f83(0xa7)];return console['error'](_0x3c1f83(0x1e0)+_0x3f4a41[_0x3c1f83(0x86)]+_0x3c1f83(0x1eb)+(_0x3f4a41[_0x3c1f83(0x86)]!==0x1?'s':'')),await handleSDKOutput(_0x3f4a41,_0x2acfb7),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0x18d);[a41_0x30db68(0xe6)]=a41_0x30db68(0xc9);async[a41_0x30db68(0x144)](_0x28133c){const _0x4ddea3=a41_0x30db68,{options:_0x375fcd,args:_0x509aac,tdx:_0x1a26e3}=_0x28133c;let _0x22114c,_0x58521b;if(_0x509aac[_0x4ddea3(0x86)]>=0x2)_0x22114c=_0x509aac[0x0],_0x58521b=_0x509aac[0x1];else{if(_0x509aac[_0x4ddea3(0x86)]===0x1&&_0x375fcd[_0x4ddea3(0x20e)])_0x22114c=_0x375fcd['workflowProject'],_0x58521b=_0x509aac[0x0];else return _0x509aac[_0x4ddea3(0x86)]===0x1?(console['error'](_0x4ddea3(0x13c)),console[_0x4ddea3(0x186)](_0x4ddea3(0x125)),0x1):(console['error']('Error:\x20KEY=VALUE\x20is\x20required'),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0xc2f8bc,_0x38c860;try{({key:_0xc2f8bc,value:_0x38c860}=parseKeyValue(_0x58521b));}catch(_0x34c8e8){return _0x34c8e8 instanceof Error&&console[_0x4ddea3(0x186)](a41_0x2a3f8b[_0x4ddea3(0x1c6)](_0x4ddea3(0x1ab)),_0x34c8e8[_0x4ddea3(0x6d)]),0x1;}_0x375fcd[_0x4ddea3(0x146)]&&(console['error']('Project:\x20'+_0x22114c),console['error'](_0x4ddea3(0x1e6)+_0xc2f8bc));const _0x4c93f7=await withSpinner(_0x4ddea3(0x19e),()=>_0x1a26e3[_0x4ddea3(0x207)][_0x4ddea3(0x217)](_0x22114c,_0xc2f8bc,_0x38c860),{'verbose':_0x375fcd[_0x4ddea3(0x146)]}),_0x2945ef=_0x4c93f7[_0x4ddea3(0xa7)];return console[_0x4ddea3(0x186)](_0x4ddea3(0xc3)+_0x2945ef['key']+_0x4ddea3(0x1a0)+_0x2945ef[_0x4ddea3(0x18f)]+'\x27'),(_0x375fcd[_0x4ddea3(0xcb)]||_0x375fcd[_0x4ddea3(0xf4)])&&await handleSingleObjectOutput(_0x2945ef,_0x375fcd),0x0;}}function a41_0x1a0d(_0x5286fa,_0x2fa831){_0x5286fa=_0x5286fa-0x68;const _0x11951a=a41_0x1195();let _0x1a0db5=_0x11951a[_0x5286fa];return _0x1a0db5;}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a41_0x30db68(0x169);[a41_0x30db68(0xe6)]=a41_0x30db68(0x1c9);async[a41_0x30db68(0x144)](_0x2b9312){const _0x58e58e=a41_0x30db68,{options:_0x5ad01c,args:_0x4722eb,tdx:_0x3df6f8}=_0x2b9312;let _0x5260d4,_0x125288;if(_0x4722eb['length']>=0x2)_0x5260d4=_0x4722eb[0x0],_0x125288=_0x4722eb[0x1];else{if(_0x4722eb[_0x58e58e(0x86)]===0x1&&_0x5ad01c['workflowProject'])_0x5260d4=_0x5ad01c[_0x58e58e(0x20e)],_0x125288=_0x4722eb[0x0];else return _0x4722eb['length']===0x1?(console[_0x58e58e(0x186)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x58e58e(0x186)](_0x58e58e(0x125)),0x1):(console[_0x58e58e(0x186)](_0x58e58e(0x17c)),console[_0x58e58e(0x186)](_0x58e58e(0x206)),0x1);}_0x5ad01c['verbose']&&(console[_0x58e58e(0x186)](_0x58e58e(0x1fe)+_0x5260d4),console[_0x58e58e(0x186)](_0x58e58e(0x1e6)+_0x125288));if(!_0x5ad01c['yes']){const _0x3ffa95=await confirmKey(_0x58e58e(0x128)+_0x125288+_0x58e58e(0x218)+_0x5260d4+'\x27?');if(!_0x3ffa95)return console[_0x58e58e(0x186)](_0x58e58e(0x1b7)),0x0;}const _0x4a839c=await withSpinner(_0x58e58e(0x153),()=>_0x3df6f8[_0x58e58e(0x207)]['deleteSecret'](_0x5260d4,_0x125288),{'verbose':_0x5ad01c[_0x58e58e(0x146)]}),_0x9d6c08=_0x4a839c[_0x58e58e(0xa7)];return console[_0x58e58e(0x186)]('✔\x20Secret\x20\x27'+_0x9d6c08[_0x58e58e(0x1ad)]+_0x58e58e(0x1da)+_0x9d6c08['projectName']+'\x27'),(_0x5ad01c[_0x58e58e(0xcb)]||_0x5ad01c['jsonl'])&&await handleSingleObjectOutput(_0x9d6c08,_0x5ad01c),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(_0x397c8d){const _0x523335=a41_0x30db68,_0x418367=Math[_0x523335(0xbf)](_0x397c8d/0x3e8),_0x163ef8=Math['floor'](_0x418367/0x3c),_0x576cb9=Math[_0x523335(0xbf)](_0x163ef8/0x3c),_0xec515f=Math[_0x523335(0xbf)](_0x576cb9/0x18);if(_0xec515f>0x0){const _0x209a6a=_0x576cb9%0x18;return _0x209a6a>0x0?_0xec515f+'d\x20'+_0x209a6a+'h':_0xec515f+'d';}else{if(_0x576cb9>0x0){const _0x4fb331=_0x163ef8%0x3c;return _0x4fb331>0x0?_0x576cb9+'h\x20'+_0x4fb331+'m':_0x576cb9+'h';}else{if(_0x163ef8>0x0){const _0x13c03f=_0x418367%0x3c;return _0x13c03f>0x0?_0x163ef8+'m\x20'+_0x13c03f+'s':_0x163ef8+'m';}else return _0x418367+'s';}}}function formatTimestamp(_0x252a35,_0xcb90d8){const _0x7e5358=a41_0x30db68,_0x5f3fa8=new Date(_0x252a35),_0x3a14d4=String(_0x5f3fa8[_0x7e5358(0x17f)]())[_0x7e5358(0x9b)](0x2,'0'),_0x5bd079=String(_0x5f3fa8[_0x7e5358(0xcf)]())['padStart'](0x2,'0'),_0x301e68=_0x3a14d4+':'+_0x5bd079,_0x12c9e3=_0x5f3fa8[_0x7e5358(0x173)]()===_0xcb90d8[_0x7e5358(0x173)]()&&_0x5f3fa8[_0x7e5358(0x1e5)]()===_0xcb90d8['getMonth']()&&_0x5f3fa8[_0x7e5358(0x20f)]()===_0xcb90d8[_0x7e5358(0x20f)]();if(_0x12c9e3)return _0x301e68;else{const _0x41871e=String(_0x5f3fa8[_0x7e5358(0x1e5)]()+0x1)[_0x7e5358(0x9b)](0x2,'0'),_0x35d0e5=String(_0x5f3fa8[_0x7e5358(0x20f)]())[_0x7e5358(0x9b)](0x2,'0');return _0x41871e+'-'+_0x35d0e5+'\x20'+_0x301e68;}}function formatDate(_0x747c1a){const _0x1a69ce=a41_0x30db68,_0x3fddfb=_0x747c1a['getFullYear'](),_0x3228f2=String(_0x747c1a[_0x1a69ce(0x1e5)]()+0x1)[_0x1a69ce(0x9b)](0x2,'0'),_0x2000f1=String(_0x747c1a['getDate']())[_0x1a69ce(0x9b)](0x2,'0');return _0x3fddfb+'-'+_0x3228f2+'-'+_0x2000f1;}function getTaskStateIcon(_0x5eb654){const _0x341037={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x341037[_0x5eb654]||'⚪';}function getBarChar(_0x214107){const _0x1bfede=a41_0x30db68;return _0x214107===_0x1bfede(0x186)||_0x214107===_0x1bfede(0x147)?'×':'─';}function getBarColor(_0x2f029a){const _0x62182d=a41_0x30db68,_0x1879bd={'success':a41_0x2a3f8b[_0x62182d(0xe8)],'error':a41_0x2a3f8b[_0x62182d(0x1c6)],'group_error':a41_0x2a3f8b['red'],'running':a41_0x2a3f8b[_0x62182d(0x134)],'blocked':a41_0x2a3f8b['yellow'],'planned':a41_0x2a3f8b[_0x62182d(0x161)],'canceling':a41_0x2a3f8b[_0x62182d(0xd4)]};return _0x1879bd[_0x2f029a]||a41_0x2a3f8b[_0x62182d(0xed)];}function parseTaskName(_0x2cb9a5){const _0x49b0b6=a41_0x30db68;let _0x13fbbb=_0x2cb9a5[_0x49b0b6(0x99)](/^\++/,'');const _0x20fd27=_0x13fbbb[_0x49b0b6(0x204)]('+'),_0x6a9b41=_0x20fd27[_0x49b0b6(0x86)]>0x1?_0x20fd27[_0x49b0b6(0x86)]-0x2:0x0,_0x522614=_0x20fd27[_0x20fd27[_0x49b0b6(0x86)]-0x1]||_0x13fbbb;return{'level':_0x6a9b41,'name':'+'+_0x522614};}function truncateTaskName(_0x158787,_0x1a2658){const _0x69df05=a41_0x30db68,_0x2f9083=stringWidth(_0x158787);if(_0x2f9083<=_0x1a2658)return _0x158787;let _0x3c5fdb=_0x158787;while(stringWidth(_0x3c5fdb+'…')>_0x1a2658&&_0x3c5fdb[_0x69df05(0x86)]>0x0){_0x3c5fdb=_0x3c5fdb[_0x69df05(0x106)](0x0,-0x1);}return _0x3c5fdb+'…';}function calculateTimeScale(_0x213efd,_0xd83990){const _0x5c81f=a41_0x30db68;return{'startTime':_0x213efd[_0x5c81f(0x1ee)],'endTime':_0x213efd[_0x5c81f(0xd8)],'durationMs':_0x213efd[_0x5c81f(0x1d5)],'msPerChar':_0x213efd[_0x5c81f(0x1d5)]/_0xd83990};}function timeToPosition(_0x5bcf41,_0x278d0b,_0xc0834b){const _0x33828c=a41_0x30db68,_0xcd249d=_0x5bcf41-_0x278d0b[_0x33828c(0x1fb)],_0x2ebc18=Math[_0x33828c(0xbf)](_0xcd249d/_0x278d0b['msPerChar']);return Math[_0x33828c(0xb2)](0x0,Math[_0x33828c(0x1e9)](_0x2ebc18,_0xc0834b));}function renderTimeAxis(_0x30e2a4,_0x569dfb){const _0x3d7c8d=a41_0x30db68,_0x20f648=Math[_0x3d7c8d(0x1e9)](TIMELINE_CONFIG[_0x3d7c8d(0x1cc)],Math[_0x3d7c8d(0xb2)](TIMELINE_CONFIG[_0x3d7c8d(0xa9)],Math[_0x3d7c8d(0xbf)](_0x569dfb/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x44e320=_0x30e2a4[_0x3d7c8d(0xa5)]/(_0x20f648-0x1),_0x57e960=new Date(_0x30e2a4[_0x3d7c8d(0x1fb)]),_0x5e9fe3=[];for(let _0x5d50e7=0x0;_0x5d50e7<_0x20f648;_0x5d50e7++){const _0x401607=_0x30e2a4[_0x3d7c8d(0x1fb)]+_0x5d50e7*_0x44e320,_0x3e1b3f=timeToPosition(_0x401607,_0x30e2a4,_0x569dfb),_0x130309=formatTimestamp(_0x401607,_0x57e960);_0x5e9fe3[_0x3d7c8d(0x107)]({'pos':_0x3e1b3f,'text':_0x130309});}const _0x2e9a6c=new Array(_0x569dfb)[_0x3d7c8d(0x1f1)]('\x20');let _0x91acce=-0x1;for(const {pos:_0x34a344,text:_0xaaa12a}of _0x5e9fe3){let _0x54df95=Math['max'](0x0,_0x34a344-Math[_0x3d7c8d(0xbf)](_0xaaa12a[_0x3d7c8d(0x86)]/0x2));_0x54df95<=_0x91acce+TIMELINE_CONFIG[_0x3d7c8d(0x1d1)]&&(_0x54df95=_0x91acce+TIMELINE_CONFIG[_0x3d7c8d(0x1d1)]+0x1);_0x54df95+_0xaaa12a[_0x3d7c8d(0x86)]>_0x569dfb&&(_0x54df95=_0x569dfb-_0xaaa12a['length']);if(_0x54df95>=0x0&&_0x54df95+_0xaaa12a[_0x3d7c8d(0x86)]<=_0x569dfb&&_0x54df95>_0x91acce){for(let _0xf82f85=0x0;_0xf82f85<_0xaaa12a[_0x3d7c8d(0x86)];_0xf82f85++){_0x2e9a6c[_0x54df95+_0xf82f85]=_0xaaa12a[_0xf82f85];}_0x91acce=_0x54df95+_0xaaa12a['length']-0x1;}}return _0x2e9a6c[_0x3d7c8d(0x10a)]('');}function renderTaskRow(_0x5c7878,_0x59e7af,_0x4f2c04,_0x7974e6){const _0x25be62=a41_0x30db68,{level:_0x288133,name:_0x2bd03d}=parseTaskName(_0x5c7878['name']),_0x4dd14d='\x20'[_0x25be62(0x90)](_0x288133),_0x1b5bee=_0x5c7878[_0x25be62(0xe7)]?'('+formatElapsed(_0x5c7878['window'][_0x25be62(0x1d5)])+')':'',_0x291f1b=stringWidth(_0x1b5bee),_0x1d5436=_0x288133*0x1,_0x205ad6=_0x7974e6-_0x1d5436-_0x291f1b-0x1,_0x56e64f=truncateTaskName(_0x2bd03d,_0x205ad6),_0x1d27fe=_0x4dd14d+_0x56e64f,_0xdcad6f=stringWidth(_0x1d27fe),_0x122dd9=_0x7974e6-_0xdcad6f-_0x291f1b,_0x471183=_0x1d27fe+'\x20'[_0x25be62(0x90)](Math[_0x25be62(0xb2)](0x1,_0x122dd9))+a41_0x2a3f8b[_0x25be62(0x161)](_0x1b5bee),_0x1d0bad=getTaskStateIcon(_0x5c7878[_0x25be62(0x15f)]),_0x11ec5f=new Array(_0x4f2c04)[_0x25be62(0x1f1)]('\x20');if(_0x5c7878[_0x25be62(0xe7)]){const _0x7ba2e=timeToPosition(_0x5c7878[_0x25be62(0xe7)][_0x25be62(0x1ee)],_0x59e7af,_0x4f2c04),_0x38f2aa=timeToPosition(_0x5c7878[_0x25be62(0xe7)]['end'],_0x59e7af,_0x4f2c04),_0x45908c=getBarChar(_0x5c7878[_0x25be62(0x15f)]),_0xbf501d=Math['max'](_0x7ba2e+0x1,_0x38f2aa);for(let _0x3c4370=_0x7ba2e;_0x3c4370<Math[_0x25be62(0x1e9)](_0xbf501d,_0x4f2c04);_0x3c4370++){_0x11ec5f[_0x3c4370]=_0x45908c;}}const _0x5a799f=getBarColor(_0x5c7878[_0x25be62(0x15f)]),_0x5aea79=_0x11ec5f['map'](_0x2da307=>_0x2da307==='\x20'?'\x20':_0x5a799f(_0x2da307))[_0x25be62(0x10a)]('');return _0x1d0bad+'\x20'+_0x471183+'│'+_0x5aea79+'│';}function calculateStats(_0x40da56){const _0x35465c=a41_0x30db68,_0x1ed8ce={'total':_0x40da56[_0x35465c(0x86)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x1d61ed of _0x40da56){if(_0x1d61ed[_0x35465c(0x15f)]===_0x35465c(0x104))_0x1ed8ce[_0x35465c(0x104)]++;else{if(_0x1d61ed[_0x35465c(0x15f)]===_0x35465c(0x186)||_0x1d61ed[_0x35465c(0x15f)]===_0x35465c(0x147))_0x1ed8ce[_0x35465c(0x186)]++;else _0x1d61ed[_0x35465c(0x15f)]==='running'?_0x1ed8ce[_0x35465c(0x12b)]++:_0x1ed8ce[_0x35465c(0xf7)]++;}}return _0x1ed8ce;}function formatStats(_0x4387a0){const _0x3e219f=a41_0x30db68;return[_0x3e219f(0x174)+_0x4387a0[_0x3e219f(0x148)],'✅\x20'+_0x4387a0[_0x3e219f(0x104)],'❌\x20'+_0x4387a0[_0x3e219f(0x186)],_0x3e219f(0x91)+_0x4387a0[_0x3e219f(0x12b)],'⏳\x20'+_0x4387a0[_0x3e219f(0xf7)]][_0x3e219f(0x10a)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x30db68(0x1ae)]=a41_0x30db68(0xbd);[a41_0x30db68(0xe6)]=a41_0x30db68(0x93);async[a41_0x30db68(0x144)](_0x49ae6f){const _0x51b931=a41_0x30db68,{options:_0x3c9603,args:_0x17585a,tdx:_0xb5dd0a}=_0x49ae6f;let _0x3bc8c9,_0x48e2ff,_0x56049e=![];if(_0x17585a[0x0]){if(_0x17585a[0x0][_0x51b931(0x130)]('.')){const _0x3d3ff4=this[_0x51b931(0xd5)](_0x17585a,_0x3c9603);if(!_0x3d3ff4)return 0x1;_0x3bc8c9=_0x3d3ff4[_0x51b931(0x18f)],_0x48e2ff=_0x3d3ff4[_0x51b931(0x170)];}else{_0x48e2ff=_0x17585a[0x0],_0x3bc8c9=_0x3c9603[_0x51b931(0x20e)];if(!_0x3bc8c9)return console[_0x51b931(0x186)](a41_0x2a3f8b[_0x51b931(0x1c6)](_0x51b931(0x1ab)),_0x51b931(0x77)),0x1;_0x56049e=!![];}}else{const _0xc78695=this['parseProjectWorkflowPattern'](_0x17585a,_0x3c9603);if(!_0xc78695)return 0x1;_0x3bc8c9=_0xc78695['projectName'],_0x48e2ff=_0xc78695['workflowName'];}if(_0x3c9603[_0x51b931(0x146)]){if(_0x3bc8c9&&_0x48e2ff)console[_0x51b931(0x186)](_0x51b931(0xa8)+_0x3bc8c9+'.'+_0x48e2ff);else _0x3bc8c9&&console[_0x51b931(0x186)](_0x51b931(0x203)+_0x3bc8c9);}const _0xde8a36=_0x3c9603[_0x51b931(0x9a)],_0x446be3=_0x3c9603[_0x51b931(0xf8)];if(_0xde8a36){_0x446be3&&console['error'](a41_0x2a3f8b['yellow'](_0x51b931(0x1f2)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x1b42c4=_0x3c9603['follow'];return _0x1b42c4?await this[_0x51b931(0x1e2)](_0x49ae6f,_0xde8a36):await this[_0x51b931(0xf2)](_0x49ae6f,_0xde8a36,_0x3c9603),0x0;}if(_0x446be3){const _0x4fac5d=await withSpinner(_0x51b931(0x157),()=>_0xb5dd0a[_0x51b931(0x207)][_0x51b931(0x89)]({'projectName':_0x3bc8c9,'workflowName':_0x48e2ff,'limit':0x64}),{'verbose':_0x3c9603[_0x51b931(0x146)]}),_0x1d4f68=_0x4fac5d['data'][_0x51b931(0x1d6)](_0x587a98=>_0x587a98['id']===_0x446be3);if(!_0x1d4f68)return console[_0x51b931(0x186)](a41_0x2a3f8b['red'](_0x51b931(0x1ab)),'Session\x20not\x20found:\x20'+_0x446be3),0x1;if(!_0x1d4f68[_0x51b931(0x1a6)]?.['id'])return console['error'](a41_0x2a3f8b[_0x51b931(0x1c6)]('Error:'),_0x51b931(0x82)+_0x446be3+_0x51b931(0x1a8)),0x1;const _0x1fc2cb=_0x1d4f68[_0x51b931(0x1a6)]['id'];_0x3c9603['verbose']&&console[_0x51b931(0x186)]('Using\x20attempt\x20'+_0x1fc2cb+_0x51b931(0xaa)+_0x446be3);const _0x19d571=_0x3c9603[_0x51b931(0xdc)];return _0x19d571?await this[_0x51b931(0x1e2)](_0x49ae6f,_0x1fc2cb):await this[_0x51b931(0xf2)](_0x49ae6f,_0x1fc2cb,_0x3c9603),0x0;}const _0x41c652=await withSpinner('Loading\x20sessions...',()=>_0xb5dd0a[_0x51b931(0x207)][_0x51b931(0x89)]({'projectName':_0x3bc8c9,'workflowName':_0x48e2ff,'limit':_0x3c9603[_0x51b931(0x101)]||0x32}),{'verbose':_0x3c9603[_0x51b931(0x146)]}),_0x200e48=_0x41c652[_0x51b931(0xa7)];if(_0x200e48['length']===0x0){if(_0x3bc8c9&&_0x48e2ff)console[_0x51b931(0x186)](_0x51b931(0x1c7)+_0x3bc8c9+'.'+_0x48e2ff);else _0x3bc8c9?console['error'](_0x51b931(0x163)+_0x3bc8c9):(console[_0x51b931(0x186)](_0x51b931(0x1e3)),console[_0x51b931(0x186)](a41_0x2a3f8b[_0x51b931(0x161)](_0x51b931(0x1c8))));return 0x0;}_0x200e48[_0x51b931(0x6b)]((_0x1179fc,_0x333749)=>{const _0x52d21c=_0x51b931,_0x2d335f=_0x1179fc[_0x52d21c(0xdb)]||'',_0x3c04e9=_0x333749[_0x52d21c(0xdb)]||'';return _0x3c04e9[_0x52d21c(0x1e1)](_0x2d335f);});if(_0x3c9603[_0x51b931(0xcb)]||_0x3c9603[_0x51b931(0xf4)])return await handleSDKOutput(_0x200e48,_0x3c9603),0x0;let _0x4a553f;if(_0x56049e){const _0x2549a5=_0x200e48[0x0];if(!_0x2549a5[_0x51b931(0x1a6)]?.['id'])return console['error'](_0x51b931(0x127)),0x0;_0x4a553f=_0x2549a5['lastAttempt']['id'],_0x3c9603[_0x51b931(0x146)]&&console[_0x51b931(0x186)](_0x51b931(0x78)+_0x2549a5[_0x51b931(0xdb)]);}else{const _0x1527de=_0x200e48[_0x51b931(0x7c)](_0x203b7f=>{const _0xe85aec=_0x51b931,_0xed1f90=getAttemptStatusDisplay(_0x203b7f[_0xe85aec(0x1a6)]);return{'title':_0x203b7f[_0xe85aec(0x8a)]?.[_0xe85aec(0x1ae)]+'.'+_0x203b7f[_0xe85aec(0x207)]?.['name']+_0xe85aec(0x18a)+_0x203b7f['sessionTime']+'\x20'+_0xed1f90[_0xe85aec(0x160)],'value':_0x203b7f[_0xe85aec(0x1a6)]?.['id']||'','description':_0xed1f90[_0xe85aec(0xb8)]};}),_0x11aa07=await a41_0x5d4edd({'type':_0x51b931(0x197),'name':_0x51b931(0x9a),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x1527de[_0x51b931(0x16c)](_0x3fa8ad=>_0x3fa8ad[_0x51b931(0xfe)]!=='')});if(!_0x11aa07[_0x51b931(0x9a)])return 0x0;_0x4a553f=_0x11aa07[_0x51b931(0x9a)];}const _0x488e6f=_0x3c9603[_0x51b931(0xdc)];return _0x488e6f?await this[_0x51b931(0x1e2)](_0x49ae6f,_0x4a553f):await this[_0x51b931(0xf2)](_0x49ae6f,_0x4a553f,_0x3c9603),0x0;}async[a41_0x30db68(0xf2)](_0x3baf27,_0xa5f41a,_0x53207f){const _0x505c6b=a41_0x30db68,{tdx:_0x9300e0}=_0x3baf27;let _0x49bc1a,_0x45ab3e;try{[_0x49bc1a,_0x45ab3e]=await Promise[_0x505c6b(0xee)]([_0x9300e0[_0x505c6b(0x207)][_0x505c6b(0x120)](_0xa5f41a),_0x9300e0[_0x505c6b(0x207)][_0x505c6b(0x1b2)](_0xa5f41a,![])]);}catch(_0x3da6b3){console['error'](a41_0x2a3f8b[_0x505c6b(0x1c6)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x53207f['verbose']&&console[_0x505c6b(0x186)](_0x3da6b3);throw _0x3da6b3;}if(_0x53207f[_0x505c6b(0xcb)]||_0x53207f[_0x505c6b(0xf4)]){const _0x3222ea=this[_0x505c6b(0x73)](_0x49bc1a,_0x45ab3e);await handleSDKOutput([_0x3222ea],_0x53207f);return;}const _0x135d0b=_0x9300e0['context']['site'],_0xa40c65=this[_0x505c6b(0x195)](_0x49bc1a,_0x45ab3e,_0x135d0b);console[_0x505c6b(0x10d)](_0xa40c65);}async['pollTimeline'](_0xba0a16,_0x46581a){const _0x574f3b=a41_0x30db68,{tdx:_0x45fe21}=_0xba0a16,_0x3d3114=TIMELINE_CONFIG[_0x574f3b(0x171)],_0x141f01=TIMELINE_CONFIG[_0x574f3b(0x123)];let _0x4d9ea2=0x0;while(_0x4d9ea2<_0x141f01){process[_0x574f3b(0x16a)]['isTTY']&&process[_0x574f3b(0x16a)]['write']('\x1bc');let _0x1447b3,_0x5c757c;try{[_0x1447b3,_0x5c757c]=await Promise['all']([_0x45fe21['workflow']['attempt'](_0x46581a),_0x45fe21[_0x574f3b(0x207)]['tasks'](_0x46581a,![])]);}catch(_0x308d24){console[_0x574f3b(0x186)](a41_0x2a3f8b[_0x574f3b(0x1c6)](_0x574f3b(0x180)));_0x4d9ea2>0x0&&console['error'](a41_0x2a3f8b[_0x574f3b(0x161)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x4d9ea2));throw _0x308d24;}const _0x4589c2=_0x45fe21[_0x574f3b(0x1cb)][_0x574f3b(0x124)],_0x41699b=this[_0x574f3b(0x195)](_0x1447b3,_0x5c757c,_0x4589c2);console['log'](_0x41699b);const _0x1e4580=_0x1447b3[_0x574f3b(0x140)]&&_0x5c757c['every'](_0x16b488=>_0x16b488['state']!==_0x574f3b(0x12b)&&_0x16b488[_0x574f3b(0x15f)]!==_0x574f3b(0x164));if(_0x1e4580){console['error'](a41_0x2a3f8b[_0x574f3b(0xe8)](_0x574f3b(0x1d8)));break;}console[_0x574f3b(0x186)](a41_0x2a3f8b[_0x574f3b(0x161)](_0x574f3b(0x13b)+_0x4d9ea2*0x2+_0x574f3b(0x12c))),await new Promise(_0xd3828f=>setTimeout(_0xd3828f,_0x3d3114)),_0x4d9ea2++;}_0x4d9ea2>=_0x141f01&&console['error'](a41_0x2a3f8b[_0x574f3b(0xd4)](_0x574f3b(0x94)));}[a41_0x30db68(0x195)](_0x32ae7f,_0x53cd3a,_0x50ebd8){const _0x863ab6=a41_0x30db68,_0xeb619e=[],_0x2a9487=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x4bb43b=0x5,_0x1c76d5=process[_0x863ab6(0x16a)][_0x863ab6(0x199)]||0x78,_0x28ab5b=_0x1c76d5-_0x2a9487-_0x4bb43b,_0x1cea9c=Math[_0x863ab6(0xb2)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x863ab6(0x1e9)](_0x28ab5b,TIMELINE_CONFIG[_0x863ab6(0x81)])),_0x2ba94f=new Date(_0x32ae7f['createdAt'])[_0x863ab6(0x184)](),_0x45f1c1=_0x32ae7f['finishedAt']?new Date(_0x32ae7f[_0x863ab6(0xf1)])[_0x863ab6(0x184)]():Date[_0x863ab6(0x10b)](),_0x2da715={'start':_0x2ba94f,'end':_0x45f1c1,'duration':_0x45f1c1-_0x2ba94f},_0x5c0c21=new Map(),_0x55c283=[];for(const _0x2e2940 of _0x53cd3a){if(_0x2e2940[_0x863ab6(0x15a)]){const _0x180678=new Date(_0x2e2940[_0x863ab6(0x15a)])[_0x863ab6(0x184)](),_0x45f726=_0x2e2940[_0x863ab6(0x182)]?new Date(_0x2e2940[_0x863ab6(0x182)])['getTime']():Date[_0x863ab6(0x10b)](),_0xb246b4={'start':_0x180678,'end':_0x45f726,'duration':_0x45f726-_0x180678};_0x5c0c21[_0x863ab6(0x121)](_0x2e2940['id'],_0xb246b4),_0x55c283[_0x863ab6(0x107)]({'name':_0x2e2940[_0x863ab6(0x8b)],'state':_0x2e2940[_0x863ab6(0x15f)]||_0x863ab6(0x14c),'window':_0xb246b4});}else _0x55c283[_0x863ab6(0x107)]({'name':_0x2e2940[_0x863ab6(0x8b)],'state':_0x2e2940[_0x863ab6(0x15f)]||_0x863ab6(0x164),'window':undefined});}_0x55c283[_0x863ab6(0x6b)]((_0x46cf41,_0x330fa4)=>{const _0x2dc465=_0x863ab6;if(!_0x46cf41[_0x2dc465(0xe7)])return 0x1;if(!_0x330fa4[_0x2dc465(0xe7)])return-0x1;return _0x46cf41[_0x2dc465(0xe7)][_0x2dc465(0x1ee)]-_0x330fa4['window'][_0x2dc465(0x1ee)];});const _0x80d49e=_0x55c283[_0x863ab6(0x86)],_0x2a6376=_0x80d49e>TIMELINE_CONFIG[_0x863ab6(0xe0)];_0x2a6376&&_0x55c283['splice'](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x17103a=calculateTimeScale(_0x2da715,_0x1cea9c),_0x1554c0=_0x32ae7f[_0x863ab6(0x140)]?_0x32ae7f[_0x863ab6(0x104)]?a41_0x2a3f8b[_0x863ab6(0xe8)](_0x863ab6(0x104)):a41_0x2a3f8b[_0x863ab6(0x1c6)](_0x863ab6(0x186)):a41_0x2a3f8b[_0x863ab6(0x134)]('running'),_0x22ed9f=_0x32ae7f[_0x863ab6(0x8a)]?.['id'],_0x4d2773=_0x32ae7f[_0x863ab6(0xf8)];let _0x573fbf;if(_0x22ed9f&&_0x4d2773){const _0x1fa302=getWorkflowAttemptUrl(_0x50ebd8,_0x22ed9f,_0x4d2773,_0x32ae7f['id']);_0x573fbf=hyperlink(a41_0x2a3f8b['dim'](_0x32ae7f['id']),_0x1fa302);}else _0x573fbf=a41_0x2a3f8b['dim'](_0x32ae7f['id']);_0xeb619e['push'](_0x863ab6(0x211)+_0x573fbf+_0x863ab6(0x18a)+_0x1554c0+'\x20-\x20'+formatElapsed(_0x2da715['duration']));if(_0x55c283[_0x863ab6(0x86)]>0x0){const _0x1907fd=renderTimeAxis(_0x17103a,_0x1cea9c),_0x2ccf4c=new Date(_0x2da715[_0x863ab6(0x1ee)]),_0x2e29fe=formatDate(_0x2ccf4c),_0x154608=TIMELINE_CONFIG[_0x863ab6(0xf6)]+TIMELINE_CONFIG[_0x863ab6(0x142)]+_0x2a9487,_0x5d2cd8=_0x2e29fe[_0x863ab6(0x9b)](_0x154608),_0x343825=a41_0x2a3f8b['dim'](_0x5d2cd8);_0xeb619e['push'](_0x343825+'\x20'+_0x1907fd);for(const _0x439118 of _0x55c283){_0xeb619e[_0x863ab6(0x107)](renderTaskRow(_0x439118,_0x17103a,_0x1cea9c,_0x2a9487));}const _0x439f09=calculateStats(_0x55c283);_0xeb619e[_0x863ab6(0x107)](formatStats(_0x439f09)),_0x2a6376&&_0xeb619e[_0x863ab6(0x107)](a41_0x2a3f8b[_0x863ab6(0xd4)](_0x863ab6(0xf9)+TIMELINE_CONFIG[_0x863ab6(0xe0)]+_0x863ab6(0x1a3)+_0x80d49e+_0x863ab6(0x88))),_0xeb619e['push'](''),_0xeb619e[_0x863ab6(0x107)](a41_0x2a3f8b[_0x863ab6(0x161)](_0x863ab6(0x85))+(_0x863ab6(0x20c)+_0x32ae7f['id']+_0x863ab6(0x17a))+a41_0x2a3f8b['dim'](_0x863ab6(0x109)));}else _0xeb619e['push'](_0x863ab6(0x1d7));return _0xeb619e[_0x863ab6(0x10a)]('\x0a');}[a41_0x30db68(0x73)](_0x12ed51,_0x21362a){const _0x532d81=a41_0x30db68,_0x1ec43b=new Date(_0x12ed51[_0x532d81(0x1bf)])['getTime'](),_0x1d9d1f=_0x12ed51[_0x532d81(0xf1)]?new Date(_0x12ed51['finishedAt'])[_0x532d81(0x184)]():Date[_0x532d81(0x10b)](),_0x5afc10=_0x1d9d1f-_0x1ec43b,_0x53f0d7=[];for(const _0x4bfd60 of _0x21362a){if(_0x4bfd60[_0x532d81(0x15a)]){const _0x58eb46=new Date(_0x4bfd60[_0x532d81(0x15a)])[_0x532d81(0x184)](),_0x37d4cb=_0x4bfd60[_0x532d81(0x182)]?new Date(_0x4bfd60[_0x532d81(0x182)])[_0x532d81(0x184)]():Date[_0x532d81(0x10b)]();_0x53f0d7['push']({'name':_0x4bfd60['fullName'],'state':_0x4bfd60[_0x532d81(0x15f)]||'unknown','window':{'start':_0x58eb46,'end':_0x37d4cb,'duration':_0x37d4cb-_0x58eb46}});}else _0x53f0d7[_0x532d81(0x107)]({'name':_0x4bfd60[_0x532d81(0x8b)],'state':_0x4bfd60[_0x532d81(0x15f)]||_0x532d81(0x164),'window':undefined});}const _0x48d9f3=calculateStats(_0x53f0d7);return{'attempt':{'id':_0x12ed51['id'],'status':_0x12ed51[_0x532d81(0x140)]?_0x12ed51[_0x532d81(0x104)]?_0x532d81(0x104):_0x532d81(0x186):_0x532d81(0x12b),'createdAt':_0x12ed51[_0x532d81(0x1bf)],'finishedAt':_0x12ed51[_0x532d81(0xf1)],'duration_ms':_0x5afc10},'tasks':_0x53f0d7['map'](_0x3ae2f3=>({'name':_0x3ae2f3[_0x532d81(0x1ae)],'state':_0x3ae2f3[_0x532d81(0x15f)],'startedAt':_0x3ae2f3['window']?new Date(_0x3ae2f3['window'][_0x532d81(0x1ee)])[_0x532d81(0x1fd)]():null,'updatedAt':_0x3ae2f3['window']?new Date(_0x3ae2f3[_0x532d81(0xe7)][_0x532d81(0xd8)])['toISOString']():null,'duration_ms':_0x3ae2f3['window']?.[_0x532d81(0x1d5)]||null})),'stats':_0x48d9f3};}}
1
+ const a41_0x5bd115=a41_0x20a5;(function(_0x34e908,_0x4811d7){const _0x4914cf=a41_0x20a5,_0x38c78a=_0x34e908();while(!![]){try{const _0x248c08=-parseInt(_0x4914cf(0x110))/0x1+-parseInt(_0x4914cf(0x120))/0x2+parseInt(_0x4914cf(0x125))/0x3*(parseInt(_0x4914cf(0x1dd))/0x4)+-parseInt(_0x4914cf(0x23b))/0x5+parseInt(_0x4914cf(0x1bd))/0x6+parseInt(_0x4914cf(0xda))/0x7+parseInt(_0x4914cf(0x132))/0x8;if(_0x248c08===_0x4811d7)break;else _0x38c78a['push'](_0x38c78a['shift']());}catch(_0xf347fa){_0x38c78a['push'](_0x38c78a['shift']());}}}(a41_0x1fc3,0x30cd0));import a41_0x542931 from'chalk';import{existsSync}from'fs';import a41_0x584037 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a41_0x2444a6 from'prompts';function getAttemptStatusDisplay(_0x2451c0){const _0xfc1376=a41_0x20a5;if(!_0x2451c0)return{'icon':'⏳','text':''};const {done:_0x5b7a53,success:_0x5c9c5f,cancelRequested:_0x170318}=_0x2451c0;if(!_0x5b7a53)return _0x170318?{'icon':'🛑','text':a41_0x542931[_0xfc1376(0x241)](_0xfc1376(0xdc))}:{'icon':'🔄','text':a41_0x542931['blue'](_0xfc1376(0x1a2))};if(_0x5c9c5f)return{'icon':'✅','text':a41_0x542931['green'](_0xfc1376(0x177))};return{'icon':'❌','text':a41_0x542931[_0xfc1376(0x1e7)](_0xfc1376(0x211))};}export class WorkflowBaseCommand extends BaseCommand{[a41_0x5bd115(0x232)](_0x59a864,_0x383491,_0x57c309=0x0){const _0x5bac10=a41_0x5bd115;return _0x59a864[_0x57c309]||_0x383491[_0x5bac10(0x24b)];}['requireProject'](_0x52c357,_0x331222,_0x1ed07f=0x0){const _0x4e85d7=a41_0x5bd115,_0x217fe7=this[_0x4e85d7(0x232)](_0x52c357,_0x331222,_0x1ed07f);if(!_0x217fe7)return console[_0x4e85d7(0x211)](a41_0x542931['red']('Error:'),_0x4e85d7(0x10f)),console['error'](a41_0x542931['dim'](_0x4e85d7(0x1b0))),null;return _0x217fe7;}[a41_0x5bd115(0x157)](_0x76ea2d,_0xb60119){const _0x832f48=a41_0x5bd115;if(_0x76ea2d[0x0]){const _0x320b99=_0x76ea2d[0x0][_0x832f48(0x14c)]('.');if(_0x320b99[_0x832f48(0xc8)]===0x1)return{'projectName':_0x320b99[0x0],'workflowName':undefined};else return _0x320b99[_0x832f48(0xc8)]===0x2?{'projectName':_0x320b99[0x0],'workflowName':_0x320b99[0x1]}:(console[_0x832f48(0x211)](a41_0x542931[_0x832f48(0x1e7)]('Error:'),_0x832f48(0x144)),null);}return{'projectName':_0xb60119[_0x832f48(0x24b)],'workflowName':undefined};}[a41_0x5bd115(0x207)](_0x1bd9ad,_0xfc97e7,_0x3bb1b7=0x0){const _0x41a493=a41_0x5bd115;if(_0x1bd9ad[_0x3bb1b7])return _0x1bd9ad[_0x3bb1b7];if(_0xfc97e7[_0x41a493(0x24b)]){const _0x596224=a41_0x584037[_0x41a493(0x11c)](process[_0x41a493(0xf9)](),'workflows',_0xfc97e7[_0x41a493(0x24b)]);if(existsSync(a41_0x584037[_0x41a493(0x11c)](_0x596224,_0x41a493(0x14d))))return _0x596224;}return undefined;}async['showWorkflowConsoleUrl'](_0xd47d4d,_0x50555b,_0x47e5b0){const _0x5182aa=a41_0x5bd115;try{const _0x1cc2e7=await _0xd47d4d[_0x5182aa(0x20b)][_0x5182aa(0x116)](_0x50555b,{'limit':0x1});if(_0x1cc2e7[_0x5182aa(0xc8)]>0x0){const _0x3fd320=_0x1cc2e7[0x0]['id'],_0x29c0bc=getWorkflowUrl(_0x47e5b0,_0x3fd320);console[_0x5182aa(0x211)](_0x5182aa(0x17a)+a41_0x542931['cyan'](_0x29c0bc));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x5bd115(0x190);[a41_0x5bd115(0x22f)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x48f1f0){const _0x53f1d1=a41_0x5bd115,{options:_0x16a4a4,args:_0x564efe,tdx:_0x2fc466}=_0x48f1f0,_0x159d99=_0x564efe[0x0],_0x5cc9e3=_0x16a4a4[_0x53f1d1(0x106)];if(_0x5cc9e3)return saveSessionContext({'workflow_project':undefined},_0x16a4a4[_0x53f1d1(0x17e)]),console[_0x53f1d1(0xcc)](a41_0x542931[_0x53f1d1(0x1c8)](_0x53f1d1(0xd4))),0x0;if(!_0x159d99)return console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x1e7)](_0x53f1d1(0x15a)),'Project\x20name\x20is\x20required'),console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x145)](_0x53f1d1(0x149))),console[_0x53f1d1(0x211)](a41_0x542931[_0x53f1d1(0x145)](_0x53f1d1(0x12a))),0x1;const _0x5235a4=await withSpinner(_0x53f1d1(0x11f)+_0x159d99+_0x53f1d1(0x19b),()=>_0x2fc466[_0x53f1d1(0x20b)][_0x53f1d1(0x19a)](_0x159d99),{'verbose':_0x16a4a4[_0x53f1d1(0x1c7)]}),{name:_0x5aeeab}=_0x5235a4['data'];return saveSessionContext({'workflow_project':_0x5aeeab},_0x16a4a4[_0x53f1d1(0x17e)]),console[_0x53f1d1(0xcc)](a41_0x542931[_0x53f1d1(0x1c8)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a41_0x542931[_0x53f1d1(0xc9)](_0x5aeeab))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a41_0x5bd115(0x220);['description']='List\x20all\x20workflow\x20projects';async[a41_0x5bd115(0x237)](_0x2bffd5){const _0x4be448=a41_0x5bd115,{options:_0x492f1f,args:_0x259794,tdx:_0x398885}=_0x2bffd5,_0x292c4b=_0x259794[0x0];_0x492f1f[_0x4be448(0x1c7)]&&_0x292c4b&&console['error'](_0x4be448(0x1b3)+_0x292c4b);const _0x44d297=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x398885[_0x4be448(0x20b)][_0x4be448(0x197)](_0x292c4b,{'limit':_0x492f1f[_0x4be448(0xfd)]}),{'verbose':_0x492f1f[_0x4be448(0x1c7)]});let _0x25a125=_0x44d297['data'];_0x25a125[_0x4be448(0x139)]((_0x54961b,_0xe3f5e7)=>_0x54961b[_0x4be448(0x23f)][_0x4be448(0x191)](_0xe3f5e7[_0x4be448(0x23f)]));const _0x4aab6b=_0x492f1f['limit']||0x64,_0x201677=_0x25a125[_0x4be448(0xc8)]>=_0x4aab6b?a41_0x542931[_0x4be448(0x145)](_0x4be448(0x244)):'';console[_0x4be448(0x211)](_0x4be448(0x1bc)+_0x25a125[_0x4be448(0xc8)]+'\x20project'+(_0x25a125[_0x4be448(0xc8)]!==0x1?'s':'')+_0x201677);if(_0x492f1f['format']==='json'||_0x492f1f[_0x4be448(0xd6)]===_0x4be448(0x1a9)||_0x492f1f[_0x4be448(0xd6)]==='table')await handleSDKOutput(_0x25a125,_0x492f1f);else{if(_0x25a125[_0x4be448(0xc8)]===0x0)_0x292c4b?console[_0x4be448(0xcc)](_0x4be448(0x101)+_0x292c4b):console['log'](_0x4be448(0x155));else{const _0x2bbc33=_0x25a125['map'](_0x3a30f4=>{const _0x2a1339=_0x4be448,_0xd6f713=_0x3a30f4[_0x2a1339(0x224)]?.[_0x2a1339(0xe8)](_0x4c2f9f=>_0x4c2f9f[_0x2a1339(0x1db)]===_0x2a1339(0x108)),_0x1397de=_0xd6f713?a41_0x542931[_0x2a1339(0x145)]('\x20(system)'):'';return _0x2a1339(0x1b1)+_0x3a30f4['name']+_0x1397de;});await writeOutput(_0x2bbc33[_0x4be448(0x11c)]('\x0a'),_0x492f1f[_0x4be448(0x1b6)],_0x4be448(0x202));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x183);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x161);async['execute'](_0x2948d4){const _0x5854ae=a41_0x5bd115,{options:_0x5c8b79,args:_0x2ca42a,tdx:_0x3ad3d6}=_0x2948d4,_0x567efe=this[_0x5854ae(0x232)](_0x2ca42a,_0x5c8b79);_0x5c8b79[_0x5854ae(0x1c7)]&&_0x567efe&&console[_0x5854ae(0x211)]('Project\x20filter:\x20'+_0x567efe);const _0xb096d5=await withSpinner(_0x5854ae(0xbf),()=>_0x3ad3d6[_0x5854ae(0x20b)][_0x5854ae(0x116)](_0x567efe,{'limit':_0x5c8b79[_0x5854ae(0xfd)]}),{'verbose':_0x5c8b79['verbose']});let _0x42d737=_0xb096d5[_0x5854ae(0x102)];_0x42d737[_0x5854ae(0x139)]((_0x488d57,_0x11624f)=>{const _0x2709ff=_0x5854ae,_0x36655c=_0x488d57['name'][_0x2709ff(0x191)](_0x11624f[_0x2709ff(0x23f)]);if(_0x36655c!==0x0)return _0x36655c;return(_0x488d57[_0x2709ff(0x18f)]?.[_0x2709ff(0x23f)]||'')['localeCompare'](_0x11624f[_0x2709ff(0x18f)]?.['name']||'');});const _0x2a31ab=_0x5c8b79[_0x5854ae(0xfd)]||0x64,_0x19aa4c=_0x42d737[_0x5854ae(0xc8)]>=_0x2a31ab?a41_0x542931[_0x5854ae(0x145)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x5854ae(0x211)](_0x5854ae(0x1bc)+_0x42d737[_0x5854ae(0xc8)]+'\x20workflow'+(_0x42d737[_0x5854ae(0xc8)]!==0x1?'s':'')+_0x19aa4c);if(_0x5c8b79['format']===_0x5854ae(0x184)||_0x5c8b79[_0x5854ae(0xd6)]==='jsonl'||_0x5c8b79[_0x5854ae(0xd6)]===_0x5854ae(0x141))await handleSDKOutput(_0x42d737,_0x5c8b79);else{if(_0x42d737[_0x5854ae(0xc8)]===0x0)_0x567efe?console[_0x5854ae(0xcc)](_0x5854ae(0x1b8)+_0x567efe):console[_0x5854ae(0xcc)](_0x5854ae(0x1a8));else{const _0x196aac=_0x5c8b79[_0x5854ae(0x16a)],_0x2d880e=_0x42d737[_0x5854ae(0x233)](_0x2b8a22=>{const _0x2c916d=_0x5854ae,_0x385132=a41_0x542931[_0x2c916d(0x145)]('#'+_0x2b8a22['id']),_0x2d7c50=hyperlink(_0x385132,getWorkflowUrl(_0x196aac,_0x2b8a22['id'])),_0x1c092b=_0x2b8a22[_0x2c916d(0x18f)]?.[_0x2c916d(0x23f)]?a41_0x542931[_0x2c916d(0x145)]('\x20('+_0x2b8a22[_0x2c916d(0x18f)][_0x2c916d(0x23f)]+')'):'';return _0x2c916d(0x20f)+_0x2d7c50+'\x20'+_0x2b8a22[_0x2c916d(0x23f)]+_0x1c092b;});await writeOutput(_0x2d880e[_0x5854ae(0x11c)]('\x0a'),_0x5c8b79[_0x5854ae(0x1b6)],_0x5854ae(0x202));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x20e);['description']=a41_0x5bd115(0xdf);async['execute'](_0x589cb1){const _0x327ecc=a41_0x5bd115,{options:_0x41ce4c,args:_0xef7ae2,tdx:_0x417e48}=_0x589cb1,_0x3d9d4b=this['parseProjectWorkflowPattern'](_0xef7ae2,_0x41ce4c);if(!_0x3d9d4b)return 0x1;const {projectName:_0x2ea1e1,workflowName:_0x5dbca7}=_0x3d9d4b;if(_0x41ce4c[_0x327ecc(0x1c7)]){if(_0x2ea1e1&&_0x5dbca7)console['error'](_0x327ecc(0x1f5)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1&&console[_0x327ecc(0x211)]('Filter:\x20project='+_0x2ea1e1);const _0x309f03=_0x41ce4c['status'];_0x309f03&&console[_0x327ecc(0x211)](_0x327ecc(0xfa)+_0x309f03);}let _0x16c627=0x28;if(process[_0x327ecc(0x128)][_0x327ecc(0x250)]&&!_0x41ce4c[_0x327ecc(0x1b6)]&&!_0x41ce4c[_0x327ecc(0xd6)]){const _0x99c3ad=process[_0x327ecc(0x128)]['rows']||0x28;_0x16c627=Math[_0x327ecc(0x185)](0x14,Math[_0x327ecc(0x180)](_0x99c3ad*0x2/0x3));}const _0x1e6249=_0x41ce4c[_0x327ecc(0xfd)]||_0x16c627,_0x1f3f3e=await withSpinner(_0x327ecc(0x121),()=>_0x417e48[_0x327ecc(0x20b)][_0x327ecc(0x235)]({'projectName':_0x2ea1e1,'workflowName':_0x5dbca7,'status':_0x41ce4c['status'],'fromTime':_0x41ce4c[_0x327ecc(0xc3)],'toTime':_0x41ce4c['to'],'limit':_0x1e6249}),{'verbose':_0x41ce4c[_0x327ecc(0x1c7)]}),_0x2082b1=_0x1f3f3e[_0x327ecc(0x102)];_0x2082b1['sort']((_0x498456,_0x3ea5bd)=>{const _0x17aca3=_0x327ecc,_0xa34d86=_0x498456[_0x17aca3(0x1d3)]||'',_0x471f40=_0x3ea5bd[_0x17aca3(0x1d3)]||'';return _0x471f40[_0x17aca3(0x191)](_0xa34d86);});_0x2082b1[_0x327ecc(0xc8)]>=_0x1e6249?console[_0x327ecc(0x211)](_0x327ecc(0x1b5)+_0x2082b1['length']+'\x20sessions\x20'+a41_0x542931[_0x327ecc(0x145)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x327ecc(0x211)]('✔\x20Found\x20'+_0x2082b1[_0x327ecc(0xc8)]+_0x327ecc(0x100)+(_0x2082b1[_0x327ecc(0xc8)]!==0x1?'s':''));if(_0x41ce4c[_0x327ecc(0xd6)]==='json'||_0x41ce4c['format']===_0x327ecc(0x1a9)||_0x41ce4c[_0x327ecc(0xd6)]===_0x327ecc(0x141))await handleSDKOutput(_0x2082b1,_0x41ce4c);else{if(!process[_0x327ecc(0x128)][_0x327ecc(0x250)]||_0x41ce4c[_0x327ecc(0x1b6)]){if(_0x2082b1[_0x327ecc(0xc8)]===0x0){if(_0x2ea1e1&&_0x5dbca7)console[_0x327ecc(0xcc)](_0x327ecc(0xcb)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1?console[_0x327ecc(0xcc)](_0x327ecc(0xf7)+_0x2ea1e1):console[_0x327ecc(0xcc)](_0x327ecc(0x229));}else{const _0x4c0e26=_0x41ce4c[_0x327ecc(0x16a)],_0x31658c=this[_0x327ecc(0x21d)](_0x2082b1,_0x4c0e26);_0x41ce4c[_0x327ecc(0x1b6)]?await writeOutput(_0x31658c,_0x41ce4c[_0x327ecc(0x1b6)],_0x327ecc(0x202)):console['log'](_0x31658c);}!_0x2ea1e1&&(console[_0x327ecc(0x211)](''),console[_0x327ecc(0x211)](a41_0x542931[_0x327ecc(0x145)](_0x327ecc(0x134))),console[_0x327ecc(0x211)](a41_0x542931[_0x327ecc(0x145)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x542931['dim'](_0x327ecc(0x14f))));}else{if(_0x2082b1['length']===0x0){if(_0x2ea1e1&&_0x5dbca7)console[_0x327ecc(0xcc)](_0x327ecc(0xcb)+_0x2ea1e1+'.'+_0x5dbca7);else _0x2ea1e1?console[_0x327ecc(0xcc)](_0x327ecc(0xf7)+_0x2ea1e1):console[_0x327ecc(0xcc)](_0x327ecc(0x229));}else await this[_0x327ecc(0x1cb)](_0x2082b1,_0x589cb1,_0x2ea1e1);}}return 0x0;}[a41_0x5bd115(0x21d)](_0x4bda0b,_0x38e9b8){const _0x35e602=a41_0x5bd115,_0x7c41d7=[],_0x5927d2=new Map();let _0x63003c=Infinity,_0x43d96e=-Infinity;for(const _0xd95611 of _0x4bda0b){if(_0xd95611[_0x35e602(0x1df)]?.[_0x35e602(0x12c)]){const _0x34f596=new Date(_0xd95611[_0x35e602(0x1df)]['createdAt'])[_0x35e602(0x137)](),_0x43a766=_0xd95611[_0x35e602(0x1df)][_0x35e602(0x1e2)]?new Date(_0xd95611[_0x35e602(0x1df)][_0x35e602(0x1e2)])[_0x35e602(0x137)]():Date[_0x35e602(0x1c9)](),_0x163635=_0xd95611[_0x35e602(0x18f)]?.[_0x35e602(0x23f)]||_0x35e602(0xc4);!_0x5927d2[_0x35e602(0xef)](_0x163635)&&_0x5927d2['set'](_0x163635,[]),_0x5927d2[_0x35e602(0x210)](_0x163635)[_0x35e602(0x249)]({'session':_0xd95611,'startTime':_0x34f596,'endTime':_0x43a766,'duration':_0x43a766-_0x34f596}),_0x63003c=Math[_0x35e602(0x219)](_0x63003c,_0x34f596),_0x43d96e=Math[_0x35e602(0x185)](_0x43d96e,_0x43a766);}}if(_0x5927d2['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x543971=process['stdout']['columns']||0x78,_0x4a68a3=0x1e,_0x436b12=0x32,_0x2e239b=0x4,_0x29a746=Math[_0x35e602(0x219)](_0x436b12,Math[_0x35e602(0x185)](_0x4a68a3,Math['floor'](_0x543971*0.3))),_0x1c071b=_0x543971-_0x29a746-TIMELINE_CONFIG[_0x35e602(0x236)]-0x3-_0x2e239b,_0x3ec801=_0x43d96e-_0x63003c,_0x137462=_0x3ec801/_0x29a746,_0x488cc9=renderTimeAxis({'startTime':_0x63003c,'endTime':_0x43d96e,'durationMs':_0x3ec801,'msPerChar':_0x137462},_0x29a746),_0x35036a=[];for(const _0x594847 of _0x5927d2['values']()){_0x35036a['push'](..._0x594847);}_0x35036a[_0x35e602(0x139)]((_0x3c0cd1,_0x55dacf)=>_0x55dacf['startTime']-_0x3c0cd1[_0x35e602(0x1e9)]);const _0x13b3d2=new Date(_0x63003c),_0x34830c=formatDate(_0x13b3d2),_0x239bb0=_0x2e239b+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x35e602(0x142)]+_0x1c071b,_0x4fabe7='\x20'['repeat'](_0x239bb0-_0x34830c[_0x35e602(0xc8)]),_0x2f467e=_0x4fabe7+a41_0x542931[_0x35e602(0x145)](_0x34830c)+'\x20'+_0x488cc9;_0x7c41d7[_0x35e602(0x249)](_0x2f467e);const _0x2bfc3b=0x16;let _0x1d3869=0x0;for(const _0x510afd of _0x35036a){const _0x341b6c=_0x510afd[_0x35e602(0x17e)][_0x35e602(0x18f)]?.['name']||'?',_0x4b6ba9=Math[_0x35e602(0x219)](stringWidth(_0x341b6c),_0x2bfc3b);_0x1d3869=Math[_0x35e602(0x185)](_0x1d3869,_0x4b6ba9);}for(const _0x4467e6 of _0x35036a){const {session:_0x12959c,startTime:_0x304688,endTime:_0x4b87b0,duration:_0x333a1c}=_0x4467e6,_0x494358=_0x12959c[_0x35e602(0x18f)]?.['id'],_0xa6426e=_0x12959c['id'],_0x5e9428=_0x12959c[_0x35e602(0x18f)]?.[_0x35e602(0x23f)]||'?',_0x4e306e=_0x12959c[_0x35e602(0x20b)]?.[_0x35e602(0x23f)]||'?';let _0x1194d7,_0x4fc9c6;if(_0x12959c[_0x35e602(0x1df)]){const _0x3be885=_0x12959c[_0x35e602(0x1df)];!_0x3be885[_0x35e602(0x174)]?(_0x1194d7=_0x3be885[_0x35e602(0x187)]?'🛑':'🔄',_0x4fc9c6=_0x3be885[_0x35e602(0x187)]?a41_0x542931['yellow']:a41_0x542931[_0x35e602(0x1ef)]):(_0x1194d7=_0x3be885[_0x35e602(0x177)]?'✅':'❌',_0x4fc9c6=_0x3be885[_0x35e602(0x177)]?a41_0x542931[_0x35e602(0x1c8)]:a41_0x542931['red']);}else _0x1194d7='⏳',_0x4fc9c6=a41_0x542931['dim'];const _0x12403e='#'+_0xa6426e,_0x4f594a=_0x494358?hyperlink(_0x12403e,getWorkflowSessionUrl(_0x38e9b8,_0x494358,_0xa6426e)):_0x12403e;let _0x556604=_0x5e9428;stringWidth(_0x5e9428)>_0x2bfc3b&&(_0x556604=_0x5e9428['slice'](0x0,_0x2bfc3b-0x1)+'…');const _0x466bb3=a41_0x542931[_0x35e602(0x145)](_0x556604),_0x24b4a2=stringWidth(_0x556604),_0x4edd07='\x20'['repeat'](_0x1d3869-stringWidth(_0x556604)+0x2),_0x41f267='('+formatElapsed(_0x333a1c)+')',_0x56e558=stringWidth(_0x41f267),_0x18ad61=stringWidth(_0x12403e),_0x524651=_0x18ad61+0x1+_0x24b4a2+_0x4edd07[_0x35e602(0xc8)],_0x4afe5e=_0x1c071b-_0x524651-_0x56e558-0x1-0x8;let _0x1937b7=_0x4e306e;stringWidth(_0x1937b7)>_0x4afe5e&&(_0x1937b7=_0x1937b7[_0x35e602(0x1f9)](0x0,_0x4afe5e-0x1)+'…');const _0x57a288=_0x4f594a+'\x20'+_0x466bb3+_0x4edd07+_0x1937b7,_0x223c64=stringWidth(_0x57a288),_0x3ae006=_0x1c071b-_0x223c64-_0x56e558,_0x13905b=_0x57a288+'\x20'[_0x35e602(0x1f1)](Math[_0x35e602(0x185)](0x1,_0x3ae006))+a41_0x542931[_0x35e602(0x145)](_0x41f267),_0x21f868=Math[_0x35e602(0x180)]((_0x304688-_0x63003c)/_0x137462),_0x265956=Math['floor']((_0x4b87b0-_0x63003c)/_0x137462),_0x349fd2=Math[_0x35e602(0x185)](_0x21f868+0x1,_0x265956),_0x59a5c1=new Array(_0x29a746)['fill']('\x20');for(let _0x3d7a2b=_0x21f868;_0x3d7a2b<Math[_0x35e602(0x219)](_0x349fd2,_0x29a746);_0x3d7a2b++){_0x59a5c1[_0x3d7a2b]='─';}const _0x26750e=_0x59a5c1[_0x35e602(0x233)](_0x1198b6=>_0x1198b6==='\x20'?'\x20':_0x4fc9c6(_0x1198b6))[_0x35e602(0x11c)]('');_0x7c41d7['push'](_0x1194d7+'\x20'+_0x13905b+'│'+_0x26750e+'│');}return _0x7c41d7[_0x35e602(0x11c)]('\x0a');}async[a41_0x5bd115(0x1cb)](_0x31e574,_0x1812eb,_0x3c684){const _0x29c948=a41_0x5bd115,{options:_0x1f4455,tdx:_0x56776b}=_0x1812eb,_0x572a9e=_0x1f4455['site'],{timelineRows:_0x585706,timeAxisHeader:_0x2cad88}=this[_0x29c948(0x24c)](_0x31e574,_0x572a9e),_0x317c24=_0x585706[_0x29c948(0x1d0)](_0x1d47c3=>_0x1d47c3['attemptId']);if(_0x317c24[_0x29c948(0xc8)]===0x0){const _0x2cec4a=this['renderSessionsTimeline'](_0x31e574,_0x572a9e);console[_0x29c948(0xcc)](_0x2cec4a);!_0x3c684&&(console['error'](''),console[_0x29c948(0x211)](a41_0x542931['dim'](_0x29c948(0x134))),console[_0x29c948(0x211)](a41_0x542931[_0x29c948(0x145)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a41_0x542931[_0x29c948(0x145)](_0x29c948(0x14f))));return;}_0x2cad88&&console[_0x29c948(0xcc)](_0x2cad88);const _0x17a05e=_0x585706[_0x29c948(0x1d0)](_0x57214b=>_0x57214b[_0x29c948(0x1a0)])['map'](_0x142b90=>({'title':_0x142b90[_0x29c948(0x181)],'value':_0x142b90[_0x29c948(0x1a0)]})),_0x583c5e=process[_0x29c948(0x128)][_0x29c948(0x1f8)]||0x3c,_0x4dfbe7=Math[_0x29c948(0x185)](0x28,Math[_0x29c948(0x180)](_0x583c5e*0x2/0x3)),_0x19533d=await a41_0x2444a6({'type':'autocomplete','name':_0x29c948(0x1a0),'message':_0x29c948(0x23e),'choices':_0x17a05e,'initial':-0x1,'limit':_0x4dfbe7,'clearFirst':!![],'fallback':{'title':_0x29c948(0x138),'value':null},'suggest':(_0x2ccf29,_0x4a2015)=>{const _0x12eed1=_0x29c948;if(!_0x2ccf29)return Promise[_0x12eed1(0x152)](_0x4a2015);const _0x423136=_0x4a2015['filter'](_0x4967a4=>{const _0x7c4a21=_0x12eed1,_0x4a62e9=_0x4967a4;return _0x4a62e9['title'][_0x7c4a21(0x10b)]()['includes'](_0x2ccf29['toLowerCase']());});return Promise['resolve'](_0x423136);}}),_0x31a139=()=>{const _0x13c809=_0x29c948;process[_0x13c809(0x128)][_0x13c809(0x16c)]('\x1b[1A\x1b[2K'),process[_0x13c809(0x128)][_0x13c809(0x16c)](_0x13c809(0xf2)),process['stdout'][_0x13c809(0x16c)](_0x13c809(0xf2));},_0x3d566=_0x19533d&&_0x19533d[_0x29c948(0x1a0)]&&_0x19533d[_0x29c948(0x1a0)]!==null&&_0x19533d['attemptId'][_0x29c948(0x11e)]()!=='';if(!_0x3d566){_0x31a139(),console[_0x29c948(0xcc)](a41_0x542931[_0x29c948(0x145)](_0x29c948(0x13e)));return;}_0x31a139();const _0x26a22c=_0x31e574['find'](_0x16901c=>_0x16901c[_0x29c948(0x1df)]?.['id']===_0x19533d[_0x29c948(0x1a0)]);if(_0x26a22c){const _0x420da2=_0x26a22c['project']?.['name']||'?',_0x231b8c=_0x26a22c[_0x29c948(0x20b)]?.[_0x29c948(0x23f)]||'?';console[_0x29c948(0xcc)](_0x29c948(0x179)+a41_0x542931[_0x29c948(0x145)](_0x420da2)+_0x29c948(0x136)+a41_0x542931[_0x29c948(0x145)](_0x231b8c));}const _0x5a7763=new WorkflowTimelineCommand();await _0x5a7763[_0x29c948(0x237)]({'args':[],'options':{..._0x1f4455,'attemptId':_0x19533d['attemptId']},'tdx':_0x56776b});}['generateSessionTimelineRows'](_0x50ae39,_0x526ec7){const _0x1c0c9f=a41_0x5bd115,_0x5d6e49=new Map();for(const _0x1c56e4 of _0x50ae39){_0x1c56e4['id']&&_0x1c56e4[_0x1c0c9f(0x1df)]?.['id']&&_0x5d6e49[_0x1c0c9f(0x1c2)](_0x1c56e4['id'],_0x1c56e4[_0x1c0c9f(0x1df)]['id']);}const _0x710b36=[];let _0x43c917='';const _0x38e6c1=this[_0x1c0c9f(0x21d)](_0x50ae39,_0x526ec7),_0x4e3290=_0x38e6c1['split']('\x0a');for(const _0x2380e5 of _0x4e3290){if(_0x2380e5[_0x1c0c9f(0x15b)](_0x1c0c9f(0x1ca))||_0x2380e5[_0x1c0c9f(0x14a)](/^\s+\d{4}-\d{2}-\d{2}/))_0x43c917=_0x2380e5;else{if(_0x2380e5[_0x1c0c9f(0x14a)](/^[✅❌🔄🛑⏳]/)){const _0x44c813=_0x2380e5['match'](/#(\d+)/),_0xc2ed83=_0x44c813?_0x44c813[0x1]:null,_0x59ee6b=_0xc2ed83?_0x5d6e49['get'](_0xc2ed83)||null:null,_0x496a91=_0x50ae39['find'](_0x4635ae=>_0x4635ae['id']===_0xc2ed83),_0x297f16=_0x496a91?.[_0x1c0c9f(0x18f)]?.[_0x1c0c9f(0x23f)]||'';_0x710b36['push']({'displayLine':_0x2380e5,'attemptId':_0x59ee6b,'projectName':_0x297f16});}}}return{'timelineRows':_0x710b36,'timeAxisHeader':_0x43c917};}}function a41_0x20a5(_0x1d49b5,_0x15c86e){_0x1d49b5=_0x1d49b5-0xb6;const _0x1fc37b=a41_0x1fc3();let _0x20a55a=_0x1fc37b[_0x1d49b5];return _0x20a55a;}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x239);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x126);async[a41_0x5bd115(0x237)](_0x4180fa){const _0x453fb4=a41_0x5bd115,{options:_0x58e590,args:_0x16375b,tdx:_0x3e3c04}=_0x4180fa,_0x17c6d5=this['parseProjectWorkflowPattern'](_0x16375b,_0x58e590);if(!_0x17c6d5)return 0x1;const {projectName:_0x1fbfd3,workflowName:_0x37cc37}=_0x17c6d5,_0x1bb1f5=_0x58e590[_0x453fb4(0x18b)];if(_0x58e590['verbose']){if(_0x1fbfd3&&_0x37cc37)console[_0x453fb4(0x211)](_0x453fb4(0x1f5)+_0x1fbfd3+'.'+_0x37cc37);else _0x1fbfd3&&console[_0x453fb4(0x211)](_0x453fb4(0x135)+_0x1fbfd3);_0x1bb1f5&&console['error'](_0x453fb4(0x213));}const _0x4dc0e8=await withSpinner(_0x453fb4(0x104),()=>_0x3e3c04[_0x453fb4(0x20b)][_0x453fb4(0xe9)]({'projectName':_0x1fbfd3,'workflowName':_0x37cc37,'includeRetried':_0x1bb1f5,'limit':_0x58e590[_0x453fb4(0xfd)]}),{'verbose':_0x58e590[_0x453fb4(0x1c7)]}),_0xaceef5=_0x4dc0e8[_0x453fb4(0x102)],_0x459974=_0x58e590[_0x453fb4(0xfd)]||0x64,_0x285d7e=_0xaceef5[_0x453fb4(0xc8)]>=_0x459974?a41_0x542931[_0x453fb4(0x145)](_0x453fb4(0x244)):'';console['error'](_0x453fb4(0x1bc)+_0xaceef5[_0x453fb4(0xc8)]+_0x453fb4(0x1fa)+(_0xaceef5[_0x453fb4(0xc8)]!==0x1?'s':'')+_0x285d7e);if(_0x58e590[_0x453fb4(0xd6)]===_0x453fb4(0x184)||_0x58e590[_0x453fb4(0xd6)]==='jsonl'||_0x58e590['format']==='table')await handleSDKOutput(_0xaceef5,_0x58e590);else{if(_0xaceef5[_0x453fb4(0xc8)]===0x0){if(_0x1fbfd3&&_0x37cc37)console['log'](_0x453fb4(0x23a)+_0x1fbfd3+'.'+_0x37cc37);else _0x1fbfd3?console[_0x453fb4(0xcc)](_0x453fb4(0x13d)+_0x1fbfd3):console['log']('No\x20attempts\x20found');}else{const _0x28c6f5=_0x58e590[_0x453fb4(0x16a)],_0x51b8f9=_0xaceef5[_0x453fb4(0x233)](_0x47d7ea=>{const _0x5087d1=_0x453fb4,_0x599087=a41_0x542931[_0x5087d1(0x145)]('#'+_0x47d7ea['id']),_0x4a760a=_0x47d7ea[_0x5087d1(0x18f)]?.['id'],_0x9d065b=_0x47d7ea[_0x5087d1(0xd9)]||_0x47d7ea[_0x5087d1(0x204)],_0x85c086=_0x4a760a&&_0x9d065b?hyperlink(_0x599087,getWorkflowAttemptUrl(_0x28c6f5,_0x4a760a,_0x9d065b,_0x47d7ea['id'])):_0x599087,{icon:_0x39450d,text:_0x226300}=getAttemptStatusDisplay(_0x47d7ea),_0x192303=(_0x47d7ea[_0x5087d1(0x18f)]?.[_0x5087d1(0x23f)]||'?')+'.'+(_0x47d7ea[_0x5087d1(0x20b)]?.[_0x5087d1(0x23f)]||'?'),_0x57596e=_0x47d7ea[_0x5087d1(0x1d3)]?a41_0x542931[_0x5087d1(0x145)](_0x47d7ea[_0x5087d1(0x1d3)]):'';return(_0x85c086+'\x20'+_0x39450d+(_0x226300?'\x20'+_0x226300:'')+'\x20'+_0x192303+'\x20'+_0x57596e)[_0x5087d1(0x215)]();});await writeOutput(_0x51b8f9[_0x453fb4(0x11c)]('\x0a'),_0x58e590['output'],_0x453fb4(0x202));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x251);[a41_0x5bd115(0x22f)]='Show\x20specific\x20attempt\x20details';async[a41_0x5bd115(0x237)](_0xbefd95){const _0x3f5102=a41_0x5bd115,{options:_0x4f54a5,args:_0x3e2992,tdx:_0x44dc2c}=_0xbefd95,_0x5edad2=_0x3e2992[0x0];if(!_0x5edad2)return console['error'](_0x3f5102(0x18c)),0x1;_0x4f54a5[_0x3f5102(0x1c7)]&&console[_0x3f5102(0x211)](_0x3f5102(0x1af)+_0x5edad2);const _0xf6448e=await withSpinner('Getting\x20attempt\x20details...',()=>_0x44dc2c[_0x3f5102(0x20b)][_0x3f5102(0xfb)](_0x5edad2),{'verbose':_0x4f54a5[_0x3f5102(0x1c7)]}),_0x2d08ef=_0xf6448e['data'];let _0x54bfe3;!_0x2d08ef[_0x3f5102(0x174)]?_0x54bfe3=_0x2d08ef[_0x3f5102(0x187)]?'canceling':_0x3f5102(0x1a2):_0x54bfe3=_0x2d08ef[_0x3f5102(0x177)]?_0x3f5102(0x177):'error';let _0x83196f;if(_0x2d08ef[_0x3f5102(0x12c)]&&_0x2d08ef['finishedAt']){const _0x5acb3d=new Date(_0x2d08ef[_0x3f5102(0x12c)])['getTime'](),_0x345562=new Date(_0x2d08ef['finishedAt'])[_0x3f5102(0x137)]();_0x83196f=Math[_0x3f5102(0x175)]((_0x345562-_0x5acb3d)/0x3e8);}const _0x36eb7a={'attempt_id':_0x2d08ef['id'],'status':_0x54bfe3,..._0x2d08ef[_0x3f5102(0x17f)]!==undefined&&{'index':_0x2d08ef[_0x3f5102(0x17f)]},..._0x2d08ef[_0x3f5102(0x18f)]&&{'project':_0x2d08ef[_0x3f5102(0x18f)][_0x3f5102(0x23f)]},..._0x2d08ef[_0x3f5102(0x20b)]&&{'workflow':_0x2d08ef[_0x3f5102(0x20b)][_0x3f5102(0x23f)]},..._0x2d08ef[_0x3f5102(0x204)]&&{'session_id':_0x2d08ef[_0x3f5102(0x204)]},..._0x2d08ef[_0x3f5102(0x1d3)]&&{'session_time':_0x2d08ef[_0x3f5102(0x1d3)]},..._0x2d08ef[_0x3f5102(0x1c5)]&&{'retry_attempt':_0x2d08ef[_0x3f5102(0x1c5)]},..._0x83196f!==undefined&&{'duration_sec':_0x83196f},..._0x2d08ef[_0x3f5102(0x12c)]&&{'created_at':_0x2d08ef['createdAt']},..._0x2d08ef[_0x3f5102(0x1e2)]&&{'finished_at':_0x2d08ef[_0x3f5102(0x1e2)]},...Object[_0x3f5102(0x1dc)](_0x2d08ef[_0x3f5102(0xd7)])[_0x3f5102(0xc8)]>0x0&&{'params':_0x2d08ef[_0x3f5102(0xd7)]}};return await handleSingleObjectOutput(_0x36eb7a,_0x4f54a5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:tasks';['description']=a41_0x5bd115(0xde);async['execute'](_0x285fcd){const _0x188b2a=a41_0x5bd115,{options:_0x582d05,args:_0x35a53e,tdx:_0x400130}=_0x285fcd,_0x115a7c=_0x35a53e[0x0];if(!_0x115a7c)return console[_0x188b2a(0x211)](_0x188b2a(0x18c)),0x1;const _0x2832b9=_0x582d05[_0x188b2a(0x1aa)];_0x582d05['verbose']&&(console[_0x188b2a(0x211)]('Attempt\x20ID:\x20'+_0x115a7c),_0x2832b9&&console[_0x188b2a(0x211)](_0x188b2a(0x1f7)));const _0x4c8061=await withSpinner(_0x188b2a(0x13f),()=>_0x400130[_0x188b2a(0x20b)][_0x188b2a(0x129)](_0x115a7c,_0x2832b9||![]),{'verbose':_0x582d05['verbose']}),_0x4cb4cc=_0x4c8061[_0x188b2a(0x102)];return console[_0x188b2a(0x211)](_0x188b2a(0x1bc)+_0x4cb4cc[_0x188b2a(0xc8)]+_0x188b2a(0xba)+(_0x4cb4cc['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cb4cc,_0x582d05),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:logs';[a41_0x5bd115(0x22f)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xffa00){const _0x249542=a41_0x5bd115,{options:_0x38e9c9,args:_0x596e07,tdx:_0x506f78}=_0xffa00,_0x14bc11=_0x596e07[0x0];let _0x4bbe48=_0x596e07[0x1];if(!_0x14bc11)return console[_0x249542(0x211)](_0x249542(0x18c)),0x1;_0x38e9c9[_0x249542(0x1c7)]&&(console[_0x249542(0x211)](_0x249542(0x1af)+_0x14bc11),_0x4bbe48&&console[_0x249542(0x211)]('Task\x20name:\x20'+_0x4bbe48));const _0x362b0e=await withSpinner(_0x249542(0xf8),()=>_0x506f78['workflow'][_0x249542(0x192)](_0x14bc11,_0x4bbe48),{'verbose':_0x38e9c9[_0x249542(0x1c7)]}),_0x234005=_0x362b0e[_0x249542(0x102)];if(_0x234005[_0x249542(0xc8)]===0x0)return console[_0x249542(0x211)](_0x249542(0x1eb)),0x0;if(!_0x4bbe48&&(_0x38e9c9[_0x249542(0x184)]||_0x38e9c9[_0x249542(0xd6)]))return await handleSDKOutput(_0x234005,_0x38e9c9),0x0;if(!_0x4bbe48){const _0x48169d=_0x234005[_0x249542(0x233)](_0x11ec37=>({'title':_0x11ec37['taskName']+'\x20('+formatBytes(_0x11ec37[_0x249542(0x21c)])+')','value':_0x11ec37[_0x249542(0x195)]})),_0x35f6ee=await a41_0x2444a6({'type':'select','name':'task','message':_0x249542(0x1a1),'choices':_0x48169d});if(!_0x35f6ee['task'])return console[_0x249542(0x211)](_0x249542(0x13e)),0x0;_0x4bbe48=_0x35f6ee['task'];}const _0x4c666b=await withSpinner(_0x249542(0x223),()=>_0x506f78[_0x249542(0x20b)]['logs'](_0x14bc11,_0x4bbe48),{'verbose':_0x38e9c9[_0x249542(0x1c7)]}),_0x2e3597=_0x4c666b[_0x249542(0x102)];return _0x2e3597?console[_0x249542(0xcc)](_0x2e3597):console[_0x249542(0x211)](_0x249542(0x22b)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0xb6);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x1ae);async[a41_0x5bd115(0x237)](_0x2cac72){const _0x455649=a41_0x5bd115,{options:_0x38cf33,args:_0x4c1034,tdx:_0x7b9a34}=_0x2cac72,_0x39c17e=_0x4c1034[0x0];if(!_0x39c17e)return console['error'](_0x455649(0x18c)),0x1;const _0x18a644=_0x38cf33['reason'];_0x38cf33[_0x455649(0x1c7)]&&(console['error'](_0x455649(0x1af)+_0x39c17e),_0x18a644&&console[_0x455649(0x211)](_0x455649(0x240)+_0x18a644));if(!_0x38cf33[_0x455649(0x24d)]){const _0x23a80a=await confirmKey(_0x455649(0x105)+_0x39c17e+'?');if(!_0x23a80a)return console[_0x455649(0x211)](_0x455649(0x13e)),0x0;}const _0x5e7a1c=await withSpinner(_0x455649(0x217),()=>_0x7b9a34[_0x455649(0x20b)]['kill'](_0x39c17e,_0x18a644),{'verbose':_0x38cf33[_0x455649(0x1c7)]}),_0x4f234c=_0x5e7a1c['data'];return console[_0x455649(0x211)]('✔\x20'+_0x4f234c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:retry';[a41_0x5bd115(0x22f)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x27ea7b){const _0x1da6bb=a41_0x5bd115,{options:_0x4d7ddd,args:_0xc782ca,tdx:_0x3d2d1d}=_0x27ea7b,_0x4bee87=_0xc782ca[0x0];if(!_0x4bee87)return console[_0x1da6bb(0x211)](_0x1da6bb(0x1fb)),console['error'](_0x1da6bb(0x13c)),0x1;let _0x1019cb=![],_0x3b6caa=_0x4bee87;if(_0x4bee87['startsWith'](_0x1da6bb(0x1b4)))_0x1019cb=!![],_0x3b6caa=_0x4bee87[_0x1da6bb(0x18a)](0x8);else{if(_0x4bee87[_0x1da6bb(0x15b)](_0x1da6bb(0x10a)))_0x1019cb=![],_0x3b6caa=_0x4bee87[_0x1da6bb(0x18a)](0x8);else return console['error'](_0x1da6bb(0x17b)),console['error'](_0x1da6bb(0x13c)),0x1;}const _0x44aa9b=_0x4d7ddd[_0x1da6bb(0x1d5)],_0x3e65ff=_0x4d7ddd[_0x1da6bb(0x198)],_0x56d1e1=_0x4d7ddd[_0x1da6bb(0xd7)],_0x1d1213=_0x4d7ddd[_0x1da6bb(0x1bf)];_0x4d7ddd['verbose']&&(console['error'](_0x1da6bb(0x1d6)+(_0x1019cb?_0x1da6bb(0x17e):'attempt')+'\x20'+_0x3b6caa),_0x44aa9b&&console['error'](_0x1da6bb(0xdd)+_0x44aa9b),_0x3e65ff&&console[_0x1da6bb(0x211)](_0x1da6bb(0xe5)+_0x3e65ff),_0x56d1e1&&console['error'](_0x1da6bb(0x21a)+_0x56d1e1),_0x1d1213&&console[_0x1da6bb(0x211)](_0x1da6bb(0x150)));let _0x230ce5;if(_0x56d1e1)try{if(_0x56d1e1['startsWith']('@')){const _0x30c0c6=await import(_0x1da6bb(0x156)),_0x7759a0=_0x56d1e1[_0x1da6bb(0x18a)](0x1),_0x24b48d=await _0x30c0c6[_0x1da6bb(0xe6)](_0x7759a0,'utf-8');_0x230ce5=JSON[_0x1da6bb(0x151)](_0x24b48d);}else _0x230ce5=JSON[_0x1da6bb(0x151)](_0x56d1e1);}catch{return console[_0x1da6bb(0x211)](_0x1da6bb(0xf4)),0x1;}if(!_0x4d7ddd[_0x1da6bb(0x24d)]){const _0x2480c0=await confirmKey(_0x1da6bb(0x21b)+(_0x1019cb?_0x1da6bb(0x17e):_0x1da6bb(0xfb))+'\x20'+_0x3b6caa+'?');if(!_0x2480c0)return console[_0x1da6bb(0x211)](_0x1da6bb(0x13e)),0x0;}let _0x31559e;_0x1019cb?_0x31559e=await withSpinner(_0x1da6bb(0x193),()=>_0x3d2d1d['workflow'][_0x1da6bb(0x245)](_0x3b6caa,{'fromTask':_0x44aa9b,'retryParams':_0x230ce5}),{'verbose':_0x4d7ddd[_0x1da6bb(0x1c7)]}):_0x31559e=await withSpinner('Retrying\x20attempt...',()=>_0x3d2d1d['workflow']['retryAttempt'](_0x3b6caa,{'resumeFrom':_0x3e65ff,'retryParams':_0x230ce5,'force':_0x1d1213}),{'verbose':_0x4d7ddd[_0x1da6bb(0x1c7)]});const _0xce18a5=_0x31559e[_0x1da6bb(0x102)];return console[_0x1da6bb(0x211)](_0x1da6bb(0x172)),console[_0x1da6bb(0x211)]('\x20\x20New\x20attempt\x20ID:\x20'+_0xce18a5[_0x1da6bb(0x1a0)]),console[_0x1da6bb(0x211)](_0x1da6bb(0x19e)+_0xce18a5[_0x1da6bb(0x204)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x14e);[a41_0x5bd115(0x22f)]='Start\x20a\x20workflow\x20run';async[a41_0x5bd115(0x237)](_0x4f65b0){const _0x1af40e=a41_0x5bd115,{options:_0x1bfe6d,args:_0x1983a8,tdx:_0x1e2583}=_0x4f65b0;let _0x4549c8=_0x1983a8[0x0];if(!_0x4549c8){const _0x19fe50=this['resolveProject']([],_0x1bfe6d),_0x50fa7d=await withSpinner('Loading\x20workflows...',()=>_0x1e2583[_0x1af40e(0x20b)][_0x1af40e(0x116)](_0x19fe50,{'limit':_0x1bfe6d[_0x1af40e(0xfd)]}),{'verbose':_0x1bfe6d[_0x1af40e(0x1c7)]}),_0x350ada=_0x50fa7d[_0x1af40e(0x102)];if(_0x350ada[_0x1af40e(0xc8)]===0x0)return console['error'](_0x1af40e(0x1a8)),!_0x19fe50&&console[_0x1af40e(0x211)](a41_0x542931[_0x1af40e(0x145)](_0x1af40e(0x1b0))),0x1;const _0xecb53e=_0x350ada[_0x1af40e(0x233)](_0x274ad8=>({'title':_0x274ad8[_0x1af40e(0x18f)]?.[_0x1af40e(0x23f)]+'.'+_0x274ad8['name'],'value':_0x274ad8[_0x1af40e(0x18f)]?.['name']+'.'+_0x274ad8['name'],'description':_0x274ad8['revision']?'revision:\x20'+_0x274ad8[_0x1af40e(0x159)]:undefined})),_0x555cf3=await a41_0x2444a6({'type':_0x1af40e(0x1b9),'name':_0x1af40e(0x20b),'message':_0x1af40e(0x1d9),'choices':_0xecb53e});if(!_0x555cf3[_0x1af40e(0x20b)])return 0x1;_0x4549c8=_0x555cf3['workflow'];}if(!_0x4549c8['includes']('.')){const _0x1c204a=this['resolveProject']([],_0x1bfe6d);if(_0x1c204a)_0x4549c8=_0x1c204a+'.'+_0x4549c8;else return console[_0x1af40e(0x211)](a41_0x542931[_0x1af40e(0x1e7)](_0x1af40e(0x15a)),_0x1af40e(0xbd)),console['error'](a41_0x542931['dim'](_0x1af40e(0x1b0))),0x1;}const _0x1d0b01=_0x1bfe6d['param'],_0x37a332=_0x1bfe6d[_0x1af40e(0x1d3)],_0x1ba1b4={};if(_0x1d0b01&&Array[_0x1af40e(0xd1)](_0x1d0b01))for(const _0x2ff51b of _0x1d0b01){const _0x27dba7=_0x2ff51b[_0x1af40e(0x246)]('=');if(_0x27dba7===-0x1)return console[_0x1af40e(0x211)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x2ff51b),console['error'](_0x1af40e(0x1d8)),0x1;const _0x20624f=_0x2ff51b[_0x1af40e(0x18a)](0x0,_0x27dba7),_0x3937dd=_0x2ff51b['substring'](_0x27dba7+0x1);try{_0x1ba1b4[_0x20624f]=JSON[_0x1af40e(0x151)](_0x3937dd);}catch{_0x1ba1b4[_0x20624f]=_0x3937dd;}}_0x1bfe6d[_0x1af40e(0x1c7)]&&(console[_0x1af40e(0x211)](_0x1af40e(0x154)+_0x4549c8),Object['keys'](_0x1ba1b4)[_0x1af40e(0xc8)]>0x0&&console[_0x1af40e(0x211)](_0x1af40e(0x1ab)+JSON['stringify'](_0x1ba1b4)),_0x37a332&&console[_0x1af40e(0x211)](_0x1af40e(0x122)+_0x37a332));const _0x9c0217=await withSpinner(_0x1af40e(0x146),()=>_0x1e2583[_0x1af40e(0x20b)][_0x1af40e(0x127)](_0x4549c8,_0x1ba1b4,{'sessionTime':_0x37a332}),{'verbose':_0x1bfe6d['verbose']}),_0x2fd073=_0x9c0217[_0x1af40e(0x102)];console[_0x1af40e(0x211)](_0x1af40e(0x10e)),console[_0x1af40e(0x211)](_0x1af40e(0x206)+_0x2fd073['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x2fd073[_0x1af40e(0x204)]),console[_0x1af40e(0x211)](_0x1af40e(0x173)+_0x2fd073['project']?.[_0x1af40e(0x23f)]),console['error'](_0x1af40e(0x165)+_0x2fd073['workflow']?.['name']);if(_0x2fd073[_0x1af40e(0x18f)]?.['id']&&_0x2fd073['sessionId']&&_0x2fd073['id']){const _0x29a610=_0x1bfe6d[_0x1af40e(0x16a)],_0x3ce165=getConsoleUrl(_0x29a610,_0x1af40e(0xc5)+_0x2fd073['project']['id']+_0x1af40e(0x163)+_0x2fd073['sessionId']+_0x1af40e(0x1f4)+_0x2fd073['id']);console[_0x1af40e(0x211)](_0x1af40e(0x17a)+a41_0x542931[_0x1af40e(0xc9)](_0x3ce165));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a41_0x5bd115(0x114);['description']=a41_0x5bd115(0xdb);async[a41_0x5bd115(0x237)](_0x5cebeb){const _0x1a4d0d=a41_0x5bd115,{options:_0x49b851,args:_0x24a780,tdx:_0x146c4e}=_0x5cebeb,_0x42be7d=_0x24a780[0x0],_0x4a6272=_0x24a780[0x1]||'.';if(!_0x42be7d)return console[_0x1a4d0d(0x211)](_0x1a4d0d(0xd0)),console['error'](_0x1a4d0d(0x1cf)),0x1;const _0x21d3b5=_0x49b851[_0x1a4d0d(0x159)];_0x49b851[_0x1a4d0d(0x1c7)]&&(console[_0x1a4d0d(0x211)]('Project:\x20'+_0x42be7d),console[_0x1a4d0d(0x211)]('Output\x20directory:\x20'+_0x4a6272),_0x21d3b5&&console['error'](_0x1a4d0d(0xfc)+_0x21d3b5));const _0x1219bb=await withSpinner(_0x1a4d0d(0x188)+_0x42be7d+'...',()=>_0x146c4e['workflow']['download'](_0x42be7d,_0x4a6272,{'revision':_0x21d3b5}),{'verbose':_0x49b851[_0x1a4d0d(0x1c7)]}),_0x5eb0b4=_0x1219bb[_0x1a4d0d(0x102)];return console[_0x1a4d0d(0x211)]('✔\x20Downloaded\x20'+_0x5eb0b4[_0x1a4d0d(0x169)]),console['error'](_0x1a4d0d(0x117)+_0x5eb0b4['revision']),console[_0x1a4d0d(0x211)](_0x1a4d0d(0x12b)+_0x5eb0b4['filesExtracted']),console[_0x1a4d0d(0x211)](_0x1a4d0d(0x221)+_0x4a6272+'/'+_0x5eb0b4[_0x1a4d0d(0x169)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x1f6);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xcd);async[a41_0x5bd115(0x237)](_0x4cd28e){const _0x1b17d1=a41_0x5bd115,{options:_0x56f324,args:_0x58b75b,tdx:_0x108c93}=_0x4cd28e;let _0x13360f='.',_0x3681d4=_0x56f324[_0x1b17d1(0x23f)];if(_0x58b75b[0x0]){const {promises:_0x9fbe59}=await import('fs');try{const _0x47e2e2=await _0x9fbe59[_0x1b17d1(0x1d7)](_0x58b75b[0x0]);if(_0x47e2e2[_0x1b17d1(0x20d)]())_0x13360f=_0x58b75b[0x0];else return console[_0x1b17d1(0x211)](_0x1b17d1(0x160)+_0x58b75b[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x3681d4=_0x58b75b[0x0],_0x13360f='.';}}const _0x3a69ec=_0x56f324['revision'],_0x4cef43=_0x56f324[_0x1b17d1(0xd2)];_0x56f324['verbose']&&(console[_0x1b17d1(0x211)](_0x1b17d1(0x1e1)+_0x13360f),_0x3681d4&&console[_0x1b17d1(0x211)]('Project\x20name:\x20'+_0x3681d4),_0x3a69ec&&console[_0x1b17d1(0x211)](_0x1b17d1(0xfc)+_0x3a69ec),_0x4cef43&&console['error']('Validation:\x20skipped'));const _0x3f6557=await withSpinner(_0x1b17d1(0x1da),()=>_0x108c93['workflow'][_0x1b17d1(0x249)](_0x13360f,{'projectName':_0x3681d4,'revision':_0x3a69ec,'skipValidation':_0x4cef43}),{'verbose':_0x56f324[_0x1b17d1(0x1c7)]}),_0x1799f5=_0x3f6557[_0x1b17d1(0x102)];return console[_0x1b17d1(0x211)]('✔\x20Pushed\x20'+_0x1799f5[_0x1b17d1(0x169)]),console[_0x1b17d1(0x211)](_0x1b17d1(0x218)+_0x1799f5['projectId']),console[_0x1b17d1(0x211)](_0x1b17d1(0x117)+_0x1799f5[_0x1b17d1(0x159)]),await this[_0x1b17d1(0x19d)](_0x108c93,_0x1799f5[_0x1b17d1(0x169)],_0x56f324[_0x1b17d1(0x16a)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x5bd115(0x23f)]='workflow:pull';[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xe4);async[a41_0x5bd115(0x237)](_0x117ecf){const _0xd40ddb=a41_0x5bd115,{options:_0x4b082e,args:_0x43336e,tdx:_0x2b5aec}=_0x117ecf,_0x356a05=_0x43336e[0x0],_0x5e424a=_0x43336e[0x1];if(!_0x356a05)return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1e7)]('Error:'),_0xd40ddb(0x10f)),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x13b))),0x1;const _0x13be04=_0x4b082e['revision'];_0x4b082e[_0xd40ddb(0x1c7)]&&(console[_0xd40ddb(0x211)](_0xd40ddb(0x179)+_0x356a05),_0x5e424a&&console['error'](_0xd40ddb(0x216)+_0x5e424a),_0x13be04&&console['error'](_0xd40ddb(0xfc)+_0x13be04),_0x4b082e[_0xd40ddb(0x1c3)]&&console['error'](_0xd40ddb(0x124)));const _0x5c8176=await withSpinner(_0xd40ddb(0x19f)+_0x356a05+'...',()=>_0x2b5aec[_0xd40ddb(0x20b)][_0xd40ddb(0x22d)](_0x356a05,{'targetDir':_0x5e424a,'revision':_0x13be04}),{'verbose':_0x4b082e[_0xd40ddb(0x1c7)]}),_0x3d7eb4=_0x5c8176['data'];_0x3d7eb4[_0xd40ddb(0x166)]?console[_0xd40ddb(0x211)](_0xd40ddb(0x131)+_0x3d7eb4[_0xd40ddb(0x169)]):console[_0xd40ddb(0x211)]('✔\x20Project:\x20'+_0x3d7eb4[_0xd40ddb(0x169)]);console['error'](_0xd40ddb(0x117)+_0x3d7eb4['revision']),console[_0xd40ddb(0x211)](_0xd40ddb(0x113)+(a41_0x584037[_0xd40ddb(0x231)](process[_0xd40ddb(0xf9)](),_0x3d7eb4[_0xd40ddb(0x14b)])||'.')),console['error'](_0xd40ddb(0xed)+a41_0x542931[_0xd40ddb(0x1c8)]('+'+_0x3d7eb4['summary']['new']+_0xd40ddb(0xec))+',\x20'+(a41_0x542931[_0xd40ddb(0x241)]('~'+_0x3d7eb4[_0xd40ddb(0x1de)][_0xd40ddb(0x199)]+_0xd40ddb(0x203))+',\x20')+(a41_0x542931[_0xd40ddb(0x1e7)]('-'+_0x3d7eb4[_0xd40ddb(0x1de)][_0xd40ddb(0xe0)]+'\x20deleted')+',\x20')+(''+a41_0x542931[_0xd40ddb(0x145)](_0x3d7eb4[_0xd40ddb(0x1de)]['unchanged']+_0xd40ddb(0x186))));for(const _0x193f58 of _0x3d7eb4[_0xd40ddb(0xd3)]){_0x193f58[_0xd40ddb(0x147)]===_0xd40ddb(0x199)&&_0x193f58[_0xd40ddb(0x11d)]&&(console[_0xd40ddb(0x211)]('\x0a'+a41_0x542931[_0xd40ddb(0xc9)](_0xd40ddb(0x24a)+_0x193f58[_0xd40ddb(0x21e)])),console[_0xd40ddb(0x211)](_0x193f58[_0xd40ddb(0x11d)]));}if(!_0x3d7eb4[_0xd40ddb(0x22c)])return saveSessionContext({'workflow_project':_0x3d7eb4['projectName']},_0x4b082e['session']),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1c8)](_0xd40ddb(0x18d))),console[_0xd40ddb(0x211)](a41_0x542931['dim'](_0xd40ddb(0x243)+_0x3d7eb4[_0xd40ddb(0x169)])),0x0;if(_0x4b082e[_0xd40ddb(0x1c3)])return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x241)](_0xd40ddb(0x23c))),0x0;if(!_0x4b082e['yes']){const _0x4358a7=await confirmKey(_0xd40ddb(0x1ea));if(!_0x4358a7)return console['error'](_0xd40ddb(0x13e)),0x0;}await withSpinner('Writing\x20files...',()=>_0x2b5aec[_0xd40ddb(0x20b)][_0xd40ddb(0x1f2)](_0x3d7eb4,{'revision':_0x13be04}),{'verbose':_0x4b082e['verbose']}),saveSessionContext({'workflow_project':_0x3d7eb4[_0xd40ddb(0x169)]},_0x4b082e[_0xd40ddb(0x17e)]),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x1c8)](_0xd40ddb(0x1fe)));const _0x5e6ae8=a41_0x584037['relative'](process[_0xd40ddb(0xf9)](),_0x3d7eb4['targetDir'])||'.';return console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x221)+_0x5e6ae8)),console[_0xd40ddb(0x211)](a41_0x542931[_0xd40ddb(0x145)](_0xd40ddb(0x243)+_0x3d7eb4[_0xd40ddb(0x169)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]='workflow:push';[a41_0x5bd115(0x22f)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a41_0x5bd115(0x237)](_0xbd08f6){const _0x17624a=a41_0x5bd115,{options:_0x239ffe,args:_0x1e9934,tdx:_0x12420b}=_0xbd08f6,_0x91e15f=this[_0x17624a(0x207)](_0x1e9934,_0x239ffe),_0x2b36e7=_0x239ffe[_0x17624a(0x159)],_0x25cd2f=_0x239ffe[_0x17624a(0xd2)];_0x239ffe[_0x17624a(0x1c7)]&&(_0x91e15f&&console[_0x17624a(0x211)](_0x17624a(0xe1)+_0x91e15f),_0x2b36e7&&console[_0x17624a(0x211)](_0x17624a(0xfc)+_0x2b36e7),_0x239ffe[_0x17624a(0x1c3)]&&console[_0x17624a(0x211)](_0x17624a(0x124)),_0x25cd2f&&console['error'](_0x17624a(0x19c)));let _0x2de04c;try{_0x2de04c=await withSpinner(_0x17624a(0xf5),()=>_0x12420b['workflow']['preparePushProject']({'sourceDir':_0x91e15f,'revision':_0x2b36e7,'skipValidation':_0x25cd2f}),{'verbose':_0x239ffe[_0x17624a(0x1c7)]});}catch(_0x5f4e63){if(_0x5f4e63 instanceof Error&&_0x5f4e63[_0x17624a(0x1f3)][_0x17624a(0xbc)](_0x17624a(0x222)))return console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x1e7)](_0x17624a(0x15a)),_0x17624a(0x1fd)),_0x239ffe[_0x17624a(0x24b)]?console['error'](a41_0x542931[_0x17624a(0x145)]('Tip:\x20cd\x20to\x20workflows/'+_0x239ffe[_0x17624a(0x24b)]+_0x17624a(0x168)+_0x239ffe[_0x17624a(0x24b)]+'\x27')):console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x145)](_0x17624a(0x1e8))),0x1;throw _0x5f4e63;}const _0x7e102b=_0x2de04c['data'];console[_0x17624a(0x211)]('✔\x20Project:\x20'+_0x7e102b[_0x17624a(0x169)]),console[_0x17624a(0x211)](_0x17624a(0x148)+_0x7e102b[_0x17624a(0xe7)]),console[_0x17624a(0x211)]('\x20\x20Revision:\x20'+_0x7e102b[_0x17624a(0x159)]),console[_0x17624a(0x211)](_0x17624a(0xed)+a41_0x542931[_0x17624a(0x1c8)]('+'+_0x7e102b[_0x17624a(0x1de)]['new']+_0x17624a(0xec))+',\x20'+(a41_0x542931[_0x17624a(0x241)]('~'+_0x7e102b[_0x17624a(0x1de)][_0x17624a(0x199)]+_0x17624a(0x203))+',\x20')+(a41_0x542931[_0x17624a(0x1e7)]('-'+_0x7e102b[_0x17624a(0x1de)]['deleted']+_0x17624a(0x20a))+',\x20')+(''+a41_0x542931['dim'](_0x7e102b[_0x17624a(0x1de)]['unchanged']+_0x17624a(0x186))));for(const _0x889220 of _0x7e102b[_0x17624a(0xd3)]){_0x889220[_0x17624a(0x147)]===_0x17624a(0x199)&&_0x889220['diff']&&(console[_0x17624a(0x211)]('\x0a'+a41_0x542931[_0x17624a(0xc9)](_0x17624a(0x24a)+_0x889220[_0x17624a(0x21e)])),console[_0x17624a(0x211)](_0x889220[_0x17624a(0x11d)]));}if(!_0x7e102b[_0x17624a(0x22c)])return console[_0x17624a(0x211)](a41_0x542931[_0x17624a(0x1c8)](_0x17624a(0xf3))),await this['showWorkflowConsoleUrl'](_0x12420b,_0x7e102b['projectName'],_0x239ffe['site']),0x0;if(_0x239ffe[_0x17624a(0x1c3)])return console[_0x17624a(0x211)](a41_0x542931['yellow'](_0x17624a(0x15f))),0x0;if(!_0x239ffe[_0x17624a(0x24d)]){const _0x57ce42=await confirmKey(_0x17624a(0x194));if(!_0x57ce42)return console[_0x17624a(0x211)](_0x17624a(0x13e)),0x0;}const _0x586263=await withSpinner(_0x17624a(0xc6),()=>_0x12420b[_0x17624a(0x20b)][_0x17624a(0x118)](_0x7e102b),{'verbose':_0x239ffe[_0x17624a(0x1c7)]}),_0x5e8137=_0x586263[_0x17624a(0x102)];return console['error'](a41_0x542931[_0x17624a(0x1c8)](_0x17624a(0x18e))),console[_0x17624a(0x211)](_0x17624a(0x218)+_0x5e8137[_0x17624a(0xfe)]),console[_0x17624a(0x211)](_0x17624a(0x117)+_0x5e8137[_0x17624a(0x159)]),await this[_0x17624a(0x19d)](_0x12420b,_0x5e8137['projectName'],_0x239ffe[_0x17624a(0x16a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a41_0x5bd115(0x123);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x234);async[a41_0x5bd115(0x237)](_0x460b6){const _0x3b11ff=a41_0x5bd115,{options:_0x54d4fc,args:_0x29c06a,tdx:_0x17e03a}=_0x460b6,_0x150528=this[_0x3b11ff(0x207)](_0x29c06a,_0x54d4fc),_0x17bf55=_0x54d4fc[_0x3b11ff(0x23f)],_0x1452b1=_0x54d4fc[_0x3b11ff(0x159)],_0x44b657=_0x54d4fc[_0x3b11ff(0xd2)];if(!_0x150528)return console['error'](a41_0x542931[_0x3b11ff(0x1e7)](_0x3b11ff(0x15a)),'Source\x20directory\x20is\x20required'),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0x176))),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0xe3))),0x1;if(!_0x17bf55)return console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x1e7)](_0x3b11ff(0x15a)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x3b11ff(0x211)](a41_0x542931[_0x3b11ff(0x145)](_0x3b11ff(0x176))),0x1;_0x54d4fc[_0x3b11ff(0x1c7)]&&(console[_0x3b11ff(0x211)]('Source\x20directory:\x20'+_0x150528),console[_0x3b11ff(0x211)]('New\x20project\x20name:\x20'+_0x17bf55),_0x1452b1&&console['error'](_0x3b11ff(0xfc)+_0x1452b1),_0x54d4fc[_0x3b11ff(0x1c3)]&&console['error'](_0x3b11ff(0x124)),_0x44b657&&console[_0x3b11ff(0x211)](_0x3b11ff(0x19c)));const _0x32d2c0=await withSpinner(_0x3b11ff(0x201),()=>_0x17e03a['workflow'][_0x3b11ff(0x119)](_0x150528,_0x17bf55,{'revision':_0x1452b1,'skipValidation':_0x44b657}),{'verbose':_0x54d4fc[_0x3b11ff(0x1c7)]}),_0x30590b=_0x32d2c0[_0x3b11ff(0x102)];console[_0x3b11ff(0x211)](_0x3b11ff(0x143)+_0x30590b['sourceDir']);_0x30590b[_0x3b11ff(0x13a)]&&console[_0x3b11ff(0x211)]('Source\x20project:\x20'+_0x30590b['sourceProjectName']);console[_0x3b11ff(0x211)](_0x3b11ff(0xc0)+_0x30590b[_0x3b11ff(0x238)]),console['error']('Revision:\x20'+_0x30590b[_0x3b11ff(0x159)]),console[_0x3b11ff(0x211)]('Files\x20to\x20upload:\x20'+_0x30590b['fileCount']);_0x30590b[_0x3b11ff(0x1ec)]&&(console['error'](a41_0x542931[_0x3b11ff(0x241)](_0x3b11ff(0x1ad)+_0x30590b['newProjectName']+_0x3b11ff(0xc7)+_0x30590b[_0x3b11ff(0x1a3)]+')')),console['error'](a41_0x542931[_0x3b11ff(0x241)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x54d4fc[_0x3b11ff(0x1c3)])return console[_0x3b11ff(0x211)](a41_0x542931['yellow'](_0x3b11ff(0x247))),0x0;if(!_0x54d4fc[_0x3b11ff(0x24d)]){const _0xa23e2b=_0x30590b[_0x3b11ff(0x13a)]||a41_0x584037[_0x3b11ff(0x228)](_0x150528),_0x4039d0=_0x30590b[_0x3b11ff(0x1ec)]?_0x3b11ff(0x1be)+_0x17bf55+_0x3b11ff(0xb8):_0x3b11ff(0x200)+_0xa23e2b+_0x3b11ff(0xc2)+_0x17bf55+'\x22?',_0x4279f0=await confirmKey(_0x4039d0);if(!_0x4279f0)return console[_0x3b11ff(0x211)]('Cancelled'),0x0;}const _0x421975=await withSpinner(_0x30590b[_0x3b11ff(0x1ec)]?'Updating\x20'+_0x17bf55+_0x3b11ff(0x16f):'Cloning\x20to\x20'+_0x17bf55+_0x3b11ff(0x16f),()=>_0x17e03a[_0x3b11ff(0x20b)]['executeCloneProject'](_0x30590b),{'verbose':_0x54d4fc[_0x3b11ff(0x1c7)]}),_0x13d51f=_0x421975[_0x3b11ff(0x102)];return console['error'](a41_0x542931['green'](_0x30590b[_0x3b11ff(0x1ec)]?_0x3b11ff(0xea):_0x3b11ff(0x109))),console['error'](_0x3b11ff(0x173)+_0x13d51f[_0x3b11ff(0x238)]),console[_0x3b11ff(0x211)](_0x3b11ff(0x218)+_0x13d51f[_0x3b11ff(0x212)]),console[_0x3b11ff(0x211)](_0x3b11ff(0x117)+_0x13d51f['revision']),await this[_0x3b11ff(0x19d)](_0x17e03a,_0x13d51f[_0x3b11ff(0x238)],_0x54d4fc[_0x3b11ff(0x16a)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a41_0x5bd115(0x24e);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x1b7);async[a41_0x5bd115(0x237)](_0x1efbad){const _0x4710c6=a41_0x5bd115,{options:_0x58b222,args:_0x33ce3,tdx:_0x2fa0fd}=_0x1efbad,_0x1d1a81=_0x33ce3[0x0];if(!_0x1d1a81)return console[_0x4710c6(0x211)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x4710c6(0xf6)),0x1;_0x58b222[_0x4710c6(0x1c7)]&&console[_0x4710c6(0x211)](_0x4710c6(0x179)+_0x1d1a81);if(!_0x58b222[_0x4710c6(0x24d)]){const _0x5a1cab=await confirmKey(_0x4710c6(0x1a7)+_0x1d1a81+_0x4710c6(0xbb));if(!_0x5a1cab)return console[_0x4710c6(0x211)](_0x4710c6(0x13e)),0x0;}const _0x14232f=await withSpinner('Deleting\x20project\x20'+_0x1d1a81+_0x4710c6(0x16f),()=>_0x2fa0fd[_0x4710c6(0x20b)][_0x4710c6(0x153)](_0x1d1a81),{'verbose':_0x58b222[_0x4710c6(0x1c7)]}),_0x619d1d=_0x14232f[_0x4710c6(0x102)];return console[_0x4710c6(0x211)](_0x4710c6(0x1cd)+_0x619d1d[_0x4710c6(0x169)]),console['error'](_0x4710c6(0x218)+_0x619d1d[_0x4710c6(0xfe)]),0x0;}}export function parseKeyValue(_0x598625){const _0x2f816c=a41_0x5bd115,_0x55160e=_0x598625[_0x2f816c(0x246)]('=');if(_0x55160e===-0x1)throw new Error('Invalid\x20format:\x20'+_0x598625+_0x2f816c(0x16e));const _0x20f3b9=_0x598625[_0x2f816c(0x18a)](0x0,_0x55160e),_0x295801=_0x598625['substring'](_0x55160e+0x1);if(!_0x20f3b9)throw new Error(_0x2f816c(0x214));return{'key':_0x20f3b9,'value':_0x295801};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';['description']=a41_0x5bd115(0x158);async[a41_0x5bd115(0x237)](_0x4350f9){const _0x565b60=a41_0x5bd115,{options:_0x4cc5a4,args:_0x4980c9,tdx:_0x1092d4}=_0x4350f9,_0x21d97a=this[_0x565b60(0x112)](_0x4980c9,_0x4cc5a4);if(!_0x21d97a)return 0x1;_0x4cc5a4[_0x565b60(0x1c7)]&&console['error'](_0x565b60(0x179)+_0x21d97a);const _0x55c984=await withSpinner('Listing\x20secrets...',()=>_0x1092d4[_0x565b60(0x20b)]['listSecrets'](_0x21d97a),{'verbose':_0x4cc5a4[_0x565b60(0x1c7)]}),{secrets:_0x227022}=_0x55c984[_0x565b60(0x102)];return console[_0x565b60(0x211)](_0x565b60(0x1bc)+_0x227022[_0x565b60(0xc8)]+_0x565b60(0x1c4)+(_0x227022['length']!==0x1?'s':'')),await handleSDKOutput(_0x227022,_0x4cc5a4),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]='workflow:secrets:set';[a41_0x5bd115(0x22f)]=a41_0x5bd115(0xff);async['execute'](_0x47023b){const _0x529ea2=a41_0x5bd115,{options:_0x3488bf,args:_0x3a4f4d,tdx:_0x2867b1}=_0x47023b;let _0x50e889,_0x7ac016;if(_0x3a4f4d[_0x529ea2(0xc8)]>=0x2)_0x50e889=_0x3a4f4d[0x0],_0x7ac016=_0x3a4f4d[0x1];else{if(_0x3a4f4d['length']===0x1&&_0x3488bf[_0x529ea2(0x24b)])_0x50e889=_0x3488bf[_0x529ea2(0x24b)],_0x7ac016=_0x3a4f4d[0x0];else return _0x3a4f4d['length']===0x1?(console[_0x529ea2(0x211)](_0x529ea2(0xd0)),console[_0x529ea2(0x211)](_0x529ea2(0x1b0)),0x1):(console['error'](_0x529ea2(0x17c)),console['error'](_0x529ea2(0xeb)),0x1);}let _0x2d8597,_0xc855b4;try{({key:_0x2d8597,value:_0xc855b4}=parseKeyValue(_0x7ac016));}catch(_0x2ad947){return _0x2ad947 instanceof Error&&console[_0x529ea2(0x211)](a41_0x542931['red'](_0x529ea2(0x15a)),_0x2ad947[_0x529ea2(0x1f3)]),0x1;}_0x3488bf[_0x529ea2(0x1c7)]&&(console[_0x529ea2(0x211)]('Project:\x20'+_0x50e889),console[_0x529ea2(0x211)](_0x529ea2(0x15c)+_0x2d8597));const _0x6c3aea=await withSpinner('Setting\x20secret...',()=>_0x2867b1['workflow']['setSecret'](_0x50e889,_0x2d8597,_0xc855b4),{'verbose':_0x3488bf['verbose']}),_0x552941=_0x6c3aea[_0x529ea2(0x102)];return console[_0x529ea2(0x211)](_0x529ea2(0x189)+_0x552941[_0x529ea2(0x1db)]+_0x529ea2(0x230)+_0x552941[_0x529ea2(0x169)]+'\x27'),(_0x3488bf['json']||_0x3488bf['jsonl'])&&await handleSingleObjectOutput(_0x552941,_0x3488bf),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a41_0x5bd115(0x208);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x162);async[a41_0x5bd115(0x237)](_0x10c5b2){const _0x4300e5=a41_0x5bd115,{options:_0x5d2275,args:_0x1fb0e2,tdx:_0x4dd481}=_0x10c5b2;let _0x9910ca,_0x1d0d3f;if(_0x1fb0e2[_0x4300e5(0xc8)]>=0x2)_0x9910ca=_0x1fb0e2[0x0],_0x1d0d3f=_0x1fb0e2[0x1];else{if(_0x1fb0e2[_0x4300e5(0xc8)]===0x1&&_0x5d2275[_0x4300e5(0x24b)])_0x9910ca=_0x5d2275[_0x4300e5(0x24b)],_0x1d0d3f=_0x1fb0e2[0x0];else return _0x1fb0e2['length']===0x1?(console[_0x4300e5(0x211)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x4300e5(0x211)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x4300e5(0x211)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x4300e5(0x1ba)),0x1);}_0x5d2275['verbose']&&(console[_0x4300e5(0x211)](_0x4300e5(0x179)+_0x9910ca),console[_0x4300e5(0x211)](_0x4300e5(0x15c)+_0x1d0d3f));if(!_0x5d2275[_0x4300e5(0x24d)]){const _0x45ffb7=await confirmKey(_0x4300e5(0x1d1)+_0x1d0d3f+_0x4300e5(0x12f)+_0x9910ca+'\x27?');if(!_0x45ffb7)return console[_0x4300e5(0x211)]('Cancelled'),0x0;}const _0x6b6b87=await withSpinner('Deleting\x20secret...',()=>_0x4dd481['workflow'][_0x4300e5(0x1b2)](_0x9910ca,_0x1d0d3f),{'verbose':_0x5d2275[_0x4300e5(0x1c7)]}),_0x5808c2=_0x6b6b87[_0x4300e5(0x102)];return console[_0x4300e5(0x211)](_0x4300e5(0x189)+_0x5808c2[_0x4300e5(0x1db)]+_0x4300e5(0x1c6)+_0x5808c2[_0x4300e5(0x169)]+'\x27'),(_0x5d2275[_0x4300e5(0x184)]||_0x5d2275[_0x4300e5(0x1a9)])&&await handleSingleObjectOutput(_0x5808c2,_0x5d2275),0x0;}}const TIMELINE_CONFIG={'TASK_NAME_WIDTH':0x28,'ICON_WIDTH':0x2,'ICON_SPACING':0x1,'GUTTER':0x5,'MIN_TIMELINE_WIDTH':0x28,'MAX_TIMELINE_WIDTH':0x50,'LABEL_MIN_SPACING':0x2,'POLL_INTERVAL_MS':0x7d0,'MAX_POLL_TIME_MS':0x36ee80,'MAX_POLL_ITERATIONS':0x708,'MAX_TASKS_DISPLAY':0x64,'MIN_LABEL_COUNT':0x3,'MAX_LABEL_COUNT':0x6,'LABEL_WIDTH_DIVISOR':0xf};function formatElapsed(_0x2fce3c){const _0x2d239c=a41_0x5bd115,_0x4bec85=Math[_0x2d239c(0x180)](_0x2fce3c/0x3e8),_0x56b78a=Math[_0x2d239c(0x180)](_0x4bec85/0x3c),_0x505ed8=Math['floor'](_0x56b78a/0x3c),_0x5f4a48=Math[_0x2d239c(0x180)](_0x505ed8/0x18);if(_0x5f4a48>0x0){const _0x363a50=_0x505ed8%0x18;return _0x363a50>0x0?_0x5f4a48+'d\x20'+_0x363a50+'h':_0x5f4a48+'d';}else{if(_0x505ed8>0x0){const _0x920e21=_0x56b78a%0x3c;return _0x920e21>0x0?_0x505ed8+'h\x20'+_0x920e21+'m':_0x505ed8+'h';}else{if(_0x56b78a>0x0){const _0x206ecd=_0x4bec85%0x3c;return _0x206ecd>0x0?_0x56b78a+'m\x20'+_0x206ecd+'s':_0x56b78a+'m';}else return _0x4bec85+'s';}}}function formatTimestamp(_0x2947cd,_0x5b1c91){const _0x1409a4=a41_0x5bd115,_0x101686=new Date(_0x2947cd),_0x2e3dfb=String(_0x101686[_0x1409a4(0x1c1)]())['padStart'](0x2,'0'),_0x3debb3=String(_0x101686[_0x1409a4(0x1c0)]())[_0x1409a4(0x12e)](0x2,'0'),_0x169f13=_0x2e3dfb+':'+_0x3debb3,_0x13af7f=_0x101686[_0x1409a4(0x11a)]()===_0x5b1c91[_0x1409a4(0x11a)]()&&_0x101686['getMonth']()===_0x5b1c91[_0x1409a4(0x1a6)]()&&_0x101686[_0x1409a4(0x196)]()===_0x5b1c91[_0x1409a4(0x196)]();if(_0x13af7f)return _0x169f13;else{const _0x3f43a2=String(_0x101686[_0x1409a4(0x1a6)]()+0x1)['padStart'](0x2,'0'),_0x34e79e=String(_0x101686[_0x1409a4(0x196)]())[_0x1409a4(0x12e)](0x2,'0');return _0x3f43a2+'-'+_0x34e79e+'\x20'+_0x169f13;}}function formatDate(_0xdd6f86){const _0x5d6e1d=a41_0x5bd115,_0x400d67=_0xdd6f86['getFullYear'](),_0x3c729a=String(_0xdd6f86[_0x5d6e1d(0x1a6)]()+0x1)[_0x5d6e1d(0x12e)](0x2,'0'),_0x4cc789=String(_0xdd6f86['getDate']())[_0x5d6e1d(0x12e)](0x2,'0');return _0x400d67+'-'+_0x3c729a+'-'+_0x4cc789;}function getTaskStateIcon(_0x131801){const _0x3de723={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3de723[_0x131801]||'⚪';}function a41_0x1fc3(){const _0x5f288e=['Dry\x20run:\x20yes','3rUJWRx','List\x20workflow\x20attempts','run','stdout','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Files\x20extracted:\x20','createdAt','\x20has\x20no\x20attempts','padStart','\x27\x20from\x20project\x20\x27','MAX_TASKS_DISPLAY','✔\x20New\x20project:\x20','2331400NAmxzU','every','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Filter:\x20project=',',\x20Workflow:\x20','getTime','No\x20matching\x20sessions\x20found','sort','sourceProjectName','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','No\x20attempts\x20found\x20in\x20project:\x20','Cancelled','Getting\x20attempt\x20tasks...','MAX_LABEL_COUNT','table','ICON_SPACING','Source:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','dim','Starting\x20workflow\x20run...','type','\x20\x20Source:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','match','targetDir','split','tdx.json','workflow:run','\x20\x20tdx\x20wf\x20use\x20<project>','Force:\x20yes','parse','resolve','delete','Workflow:\x20','No\x20workflow\x20projects\x20found','fs/promises','parseProjectWorkflowPattern','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','revision','Error:','startsWith','Key:\x20','\x20-\x20','MAX_TIMELINE_WIDTH','\x0aDry\x20run\x20-\x20nothing\x20pushed','Error:\x20','List\x20workflows','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','/sessions/','fill','\x20\x20Workflow:\x20','isNewProject','\x20tasks','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','projectName','site','TASK_NAME_WIDTH','write','icon','.\x20Expected\x20format:\x20KEY=VALUE','...','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','value','✔\x20Retry\x20started','\x20\x20Project:\x20','done','round','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','success','\x20from\x20session\x20','Project:\x20','\x20\x20Console:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Error:\x20KEY=VALUE\x20is\x20required','planned','session','index','floor','displayLine','Total:\x20','workflow:workflows','json','max','\x20unchanged','cancelRequested','Downloading\x20project\x20','✔\x20Secret\x20\x27','substring','includeRetried','Error:\x20Attempt\x20ID\x20is\x20required','\x0a✔\x20Already\x20up\x20to\x20date','✔\x20Push\x20complete','project','workflow:use','localeCompare','logFiles','Retrying\x20session...','\x0aPush\x20these\x20changes?','taskName','getDate','projects','resumeFrom','modified','resolveProjectId','\x27...','Validation:\x20skipped','showWorkflowConsoleUrl','\x20\x20Session\x20ID:\x20','Pulling\x20project\x20','attemptId','Select\x20a\x20task\x20to\x20view\x20logs:','running','existingProjectId','tdx\x20wf\x20attempt\x20','all','getMonth','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','No\x20workflows\x20found','jsonl','includeSubtasks','Parameters:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x0a⚠\x20Project\x20\x22','Kill\x20a\x20running\x20attempt','Attempt\x20ID:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','📁\x20','deleteSecret','Pattern:\x20','session:','✔\x20Showing\x20','output','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflows\x20found\x20in\x20project:\x20','select','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x0aPolling...\x20(','✔\x20Found\x20','1677396KHjlLX','\x0aUpdate\x20existing\x20project\x20\x22','force','getMinutes','getHours','set','dryRun','\x20secret','retryAttemptName','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','verbose','green','now','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','navigateSessionsInteractive','text','✔\x20Deleted\x20project\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','filter','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','duration','sessionTime','replace','fromTask','Target:\x20','stat','Expected\x20format:\x20--param\x20key=value','Select\x20a\x20workflow\x20to\x20run','Pushing\x20workflow\x20project...','key','keys','359224ZBjDGJ','summary','lastAttempt','ICON_WIDTH','Project\x20directory:\x20','finishedAt','Session\x20not\x20found:\x20','Loading\x20sessions...','fullName','unknown','red','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','startTime','\x0aApply\x20these\x20changes?','No\x20log\x20files\x20found\x20for\x20this\x20attempt','targetExists','renderTimeline','follow','blue','pending','repeat','applyPullProject','message','/attempt/','Filter:\x20','workflow:upload','Including\x20subtasks:\x20yes','rows','slice','\x20attempt','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Loading\x20session...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Pull\x20complete','POLL_INTERVAL_MS','\x0aClone\x20\x22','Analyzing\x20project...','list','\x20modified','sessionId','LABEL_MIN_SPACING','\x20\x20Attempt\x20ID:\x20','resolveProjectDir','workflow:secrets:delete','start','\x20deleted','workflow','context','isDirectory','workflow:sessions','📋\x20','get','error','newProjectId','Include\x20retried:\x20yes','Key\x20cannot\x20be\x20empty','trimEnd','Target\x20directory:\x20','Killing\x20attempt...','\x20\x20Project\x20ID:\x20','min','Params:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','fileSize','renderSessionsTimeline','path','find','workflow:projects','\x20\x20Location:\x20','No\x20workflow\x20tdx.json\x20found','Downloading\x20logs...','metadata','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','pollTimeline','\x0a✔\x20Attempt\x20complete','basename','No\x20sessions\x20found','MIN_LABEL_COUNT','No\x20log\x20content\x20found','hasChanges','pullProject','updatedAt','description','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','relative','resolveProject','map','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','sessions','GUTTER','execute','newProjectName','workflow:attempts','No\x20attempts\x20found\x20for:\x20','450515WpmBmm','\x0aDry\x20run\x20-\x20no\x20files\x20written','splice','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','name','Reason:\x20','yellow','workflow:timeline','\x20\x20Session\x20context\x20set\x20to:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','retrySession','indexOf','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20of\x20','push','---\x20','workflowProject','generateSessionTimelineRows','yes','workflow:delete','workflowName','isTTY','workflow:attempt','workflow:kill','state','\x22\x20with\x20new\x20revision?','Latest\x20session\x20has\x20no\x20attempt','\x20task','\x22?\x20This\x20cannot\x20be\x20undone.','includes','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','buildTimelineData','Listing\x20workflows...','New\x20project\x20name:\x20','LABEL_WIDTH_DIVISOR','\x22\x20to\x20new\x20project\x20\x22','from','(unknown)','/app/workflows/','Pushing\x20project...','\x22\x20already\x20exists\x20(ID:\x20','length','cyan','renderSingleTimeline','No\x20sessions\x20found\x20for:\x20','log','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Session\x20','group_error','Error:\x20Project\x20name\x20is\x20required','isArray','skipValidation','changes','✔\x20Workflow\x20project\x20context\x20cleared.','MIN_TIMELINE_WIDTH','format','params','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','session_id','1023988ZZKeTa','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','canceling','From\x20task:\x20','Show\x20tasks\x20for\x20an\x20attempt','List\x20workflow\x20execution\x20sessions','deleted','Source\x20directory:\x20','⚠\x20Showing\x20first\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Pull\x20workflow\x20project\x20to\x20local\x20folder','Resume\x20from:\x20','readFile','sourceDir','some','attempts','✔\x20Project\x20updated','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','\x20new','\x20\x20Changes:\x20','window','has','startedAt','\x20logs','\x1b[1A\x1b[2K','\x0a✔\x20No\x20changes\x20to\x20push','Error:\x20Invalid\x20JSON\x20in\x20--params','Analyzing\x20changes...','Usage:\x20workflow:delete\x20<project-name-or-id>','No\x20sessions\x20found\x20in\x20project:\x20','Fetching\x20log\x20files...','cwd','Status:\x20','attempt','Revision:\x20','limit','projectId','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20session','No\x20projects\x20match\x20pattern:\x20','data','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Listing\x20workflow\x20attempts...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','clear','msPerChar','sys','✔\x20Clone\x20complete','attempt:','toLowerCase','toISOString','🔄\x20','✔\x20Workflow\x20run\x20started','Project\x20name\x20is\x20required','285210EpfuWy','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','requireProject','\x20\x20Target:\x20','workflow:download','end','workflows','\x20\x20Revision:\x20','executePushProject','prepareCloneProject','getFullYear','Attempt:\x20','join','diff','trim','Resolving\x20project\x20\x27','463760PkwFAg','Listing\x20workflow\x20sessions...','Session\x20time:\x20','workflow:clone'];a41_0x1fc3=function(){return _0x5f288e;};return a41_0x1fc3();}function getBarChar(_0x285ad1){const _0x4566bf=a41_0x5bd115;return _0x285ad1==='error'||_0x285ad1===_0x4566bf(0xcf)?'×':'─';}function getBarColor(_0xf32be2){const _0x1e18c3=a41_0x5bd115,_0xb9a9c8={'success':a41_0x542931[_0x1e18c3(0x1c8)],'error':a41_0x542931[_0x1e18c3(0x1e7)],'group_error':a41_0x542931[_0x1e18c3(0x1e7)],'running':a41_0x542931[_0x1e18c3(0x1ef)],'blocked':a41_0x542931[_0x1e18c3(0x241)],'planned':a41_0x542931[_0x1e18c3(0x145)],'canceling':a41_0x542931[_0x1e18c3(0x241)]};return _0xb9a9c8[_0xf32be2]||a41_0x542931['white'];}function parseTaskName(_0x5e9ef6){const _0x3e648a=a41_0x5bd115;let _0x4cadf0=_0x5e9ef6[_0x3e648a(0x1d4)](/^\++/,'');const _0x5db20c=_0x4cadf0[_0x3e648a(0x14c)]('+'),_0xbdbcaf=_0x5db20c[_0x3e648a(0xc8)]>0x1?_0x5db20c[_0x3e648a(0xc8)]-0x2:0x0,_0x30fb75=_0x5db20c[_0x5db20c['length']-0x1]||_0x4cadf0;return{'level':_0xbdbcaf,'name':'+'+_0x30fb75};}function truncateTaskName(_0x5ce3aa,_0x35992f){const _0x452762=a41_0x5bd115,_0x59f92f=stringWidth(_0x5ce3aa);if(_0x59f92f<=_0x35992f)return _0x5ce3aa;let _0x1f8ecf=_0x5ce3aa;while(stringWidth(_0x1f8ecf+'…')>_0x35992f&&_0x1f8ecf[_0x452762(0xc8)]>0x0){_0x1f8ecf=_0x1f8ecf[_0x452762(0x1f9)](0x0,-0x1);}return _0x1f8ecf+'…';}function calculateTimeScale(_0x488546,_0x52c025){const _0x2e6b1c=a41_0x5bd115;return{'startTime':_0x488546[_0x2e6b1c(0x209)],'endTime':_0x488546['end'],'durationMs':_0x488546['duration'],'msPerChar':_0x488546['duration']/_0x52c025};}function timeToPosition(_0xa5a1f9,_0x5b1aa6,_0x1dafcb){const _0x2e7b74=a41_0x5bd115,_0x179df7=_0xa5a1f9-_0x5b1aa6[_0x2e7b74(0x1e9)],_0x13e452=Math[_0x2e7b74(0x180)](_0x179df7/_0x5b1aa6[_0x2e7b74(0x107)]);return Math[_0x2e7b74(0x185)](0x0,Math[_0x2e7b74(0x219)](_0x13e452,_0x1dafcb));}function renderTimeAxis(_0x649791,_0x41af3a){const _0x2b4346=a41_0x5bd115,_0x387e37=Math[_0x2b4346(0x219)](TIMELINE_CONFIG[_0x2b4346(0x140)],Math[_0x2b4346(0x185)](TIMELINE_CONFIG[_0x2b4346(0x22a)],Math[_0x2b4346(0x180)](_0x41af3a/TIMELINE_CONFIG[_0x2b4346(0xc1)]))),_0x4b457b=_0x649791['durationMs']/(_0x387e37-0x1),_0x4231d1=new Date(_0x649791[_0x2b4346(0x1e9)]),_0x37c7d1=[];for(let _0xa9113=0x0;_0xa9113<_0x387e37;_0xa9113++){const _0x5b9a6b=_0x649791['startTime']+_0xa9113*_0x4b457b,_0x2d4784=timeToPosition(_0x5b9a6b,_0x649791,_0x41af3a),_0x4aa026=formatTimestamp(_0x5b9a6b,_0x4231d1);_0x37c7d1[_0x2b4346(0x249)]({'pos':_0x2d4784,'text':_0x4aa026});}const _0x2a5283=new Array(_0x41af3a)[_0x2b4346(0x164)]('\x20');let _0xfcf407=-0x1;for(const {pos:_0x36a595,text:_0x44e9f4}of _0x37c7d1){let _0x2136c5=Math[_0x2b4346(0x185)](0x0,_0x36a595-Math[_0x2b4346(0x180)](_0x44e9f4[_0x2b4346(0xc8)]/0x2));_0x2136c5<=_0xfcf407+TIMELINE_CONFIG[_0x2b4346(0x205)]&&(_0x2136c5=_0xfcf407+TIMELINE_CONFIG[_0x2b4346(0x205)]+0x1);_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]>_0x41af3a&&(_0x2136c5=_0x41af3a-_0x44e9f4[_0x2b4346(0xc8)]);if(_0x2136c5>=0x0&&_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]<=_0x41af3a&&_0x2136c5>_0xfcf407){for(let _0xf7af7e=0x0;_0xf7af7e<_0x44e9f4[_0x2b4346(0xc8)];_0xf7af7e++){_0x2a5283[_0x2136c5+_0xf7af7e]=_0x44e9f4[_0xf7af7e];}_0xfcf407=_0x2136c5+_0x44e9f4[_0x2b4346(0xc8)]-0x1;}}return _0x2a5283[_0x2b4346(0x11c)]('');}function renderTaskRow(_0x4edcfb,_0x3fcc7a,_0x4f11d8,_0xa293ca){const _0x5b49b7=a41_0x5bd115,{level:_0x645ff4,name:_0x37efd2}=parseTaskName(_0x4edcfb[_0x5b49b7(0x23f)]),_0x1bb955='\x20'['repeat'](_0x645ff4),_0x32f318=_0x4edcfb['window']?'('+formatElapsed(_0x4edcfb[_0x5b49b7(0xee)]['duration'])+')':'',_0x4b485d=stringWidth(_0x32f318),_0x2fd234=_0x645ff4*0x1,_0x59d788=_0xa293ca-_0x2fd234-_0x4b485d-0x1,_0x13b638=truncateTaskName(_0x37efd2,_0x59d788),_0xc5c86a=_0x1bb955+_0x13b638,_0x51e0d1=stringWidth(_0xc5c86a),_0x16edd0=_0xa293ca-_0x51e0d1-_0x4b485d,_0x2f941e=_0xc5c86a+'\x20'['repeat'](Math['max'](0x1,_0x16edd0))+a41_0x542931[_0x5b49b7(0x145)](_0x32f318),_0x103292=getTaskStateIcon(_0x4edcfb[_0x5b49b7(0xb7)]),_0x948917=new Array(_0x4f11d8)[_0x5b49b7(0x164)]('\x20');if(_0x4edcfb[_0x5b49b7(0xee)]){const _0x403679=timeToPosition(_0x4edcfb[_0x5b49b7(0xee)][_0x5b49b7(0x209)],_0x3fcc7a,_0x4f11d8),_0x450696=timeToPosition(_0x4edcfb[_0x5b49b7(0xee)][_0x5b49b7(0x115)],_0x3fcc7a,_0x4f11d8),_0x50a546=getBarChar(_0x4edcfb[_0x5b49b7(0xb7)]),_0x203b1e=Math[_0x5b49b7(0x185)](_0x403679+0x1,_0x450696);for(let _0x3a71de=_0x403679;_0x3a71de<Math[_0x5b49b7(0x219)](_0x203b1e,_0x4f11d8);_0x3a71de++){_0x948917[_0x3a71de]=_0x50a546;}}const _0x584cac=getBarColor(_0x4edcfb[_0x5b49b7(0xb7)]),_0xeaf526=_0x948917['map'](_0x2d9693=>_0x2d9693==='\x20'?'\x20':_0x584cac(_0x2d9693))[_0x5b49b7(0x11c)]('');return _0x103292+'\x20'+_0x2f941e+'│'+_0xeaf526+'│';}function calculateStats(_0x389e27){const _0x195eb6=a41_0x5bd115,_0x252149={'total':_0x389e27[_0x195eb6(0xc8)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x4656c6 of _0x389e27){if(_0x4656c6[_0x195eb6(0xb7)]===_0x195eb6(0x177))_0x252149[_0x195eb6(0x177)]++;else{if(_0x4656c6['state']===_0x195eb6(0x211)||_0x4656c6[_0x195eb6(0xb7)]==='group_error')_0x252149[_0x195eb6(0x211)]++;else _0x4656c6['state']===_0x195eb6(0x1a2)?_0x252149['running']++:_0x252149[_0x195eb6(0x1f0)]++;}}return _0x252149;}function formatStats(_0x578a56){const _0x1d2bfe=a41_0x5bd115;return[_0x1d2bfe(0x182)+_0x578a56['total'],'✅\x20'+_0x578a56[_0x1d2bfe(0x177)],'❌\x20'+_0x578a56[_0x1d2bfe(0x211)],_0x1d2bfe(0x10d)+_0x578a56[_0x1d2bfe(0x1a2)],'⏳\x20'+_0x578a56[_0x1d2bfe(0x1f0)]][_0x1d2bfe(0x11c)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x5bd115(0x23f)]=a41_0x5bd115(0x242);[a41_0x5bd115(0x22f)]=a41_0x5bd115(0x111);async[a41_0x5bd115(0x237)](_0x1a1a01){const _0x44f49e=a41_0x5bd115,{options:_0x59a61f,args:_0x36e610,tdx:_0x1f8da7}=_0x1a1a01;let _0x5ad96b,_0x13717c,_0x4297e2=![];if(_0x36e610[0x0]){if(_0x36e610[0x0][_0x44f49e(0xbc)]('.')){const _0x32cef9=this['parseProjectWorkflowPattern'](_0x36e610,_0x59a61f);if(!_0x32cef9)return 0x1;_0x5ad96b=_0x32cef9[_0x44f49e(0x169)],_0x13717c=_0x32cef9[_0x44f49e(0x24f)];}else{_0x13717c=_0x36e610[0x0],_0x5ad96b=_0x59a61f[_0x44f49e(0x24b)];if(!_0x5ad96b)return console['error'](a41_0x542931[_0x44f49e(0x1e7)]('Error:'),_0x44f49e(0x225)),0x1;_0x4297e2=!![];}}else{const _0x2f8828=this[_0x44f49e(0x157)](_0x36e610,_0x59a61f);if(!_0x2f8828)return 0x1;_0x5ad96b=_0x2f8828[_0x44f49e(0x169)],_0x13717c=_0x2f8828['workflowName'];}if(_0x59a61f[_0x44f49e(0x1c7)]){if(_0x5ad96b&&_0x13717c)console[_0x44f49e(0x211)](_0x44f49e(0x1f5)+_0x5ad96b+'.'+_0x13717c);else _0x5ad96b&&console[_0x44f49e(0x211)](_0x44f49e(0x135)+_0x5ad96b);}const _0x19b8a2=_0x59a61f[_0x44f49e(0x1a0)],_0x586d22=_0x59a61f[_0x44f49e(0x204)];if(_0x19b8a2){_0x586d22&&console['error'](a41_0x542931[_0x44f49e(0x241)]('Warning:'),_0x44f49e(0x170));const _0x52578a=_0x59a61f[_0x44f49e(0x1ee)];return _0x52578a?await this['pollTimeline'](_0x1a1a01,_0x19b8a2):await this['renderSingleTimeline'](_0x1a1a01,_0x19b8a2,_0x59a61f),0x0;}if(_0x586d22){const _0x3e3379=await withSpinner(_0x44f49e(0x1fc),()=>_0x1f8da7[_0x44f49e(0x20b)][_0x44f49e(0x235)]({'projectName':_0x5ad96b,'workflowName':_0x13717c,'limit':0x64}),{'verbose':_0x59a61f[_0x44f49e(0x1c7)]}),_0x307309=_0x3e3379[_0x44f49e(0x102)][_0x44f49e(0x21f)](_0x1ae679=>_0x1ae679['id']===_0x586d22);if(!_0x307309)return console[_0x44f49e(0x211)](a41_0x542931['red'](_0x44f49e(0x15a)),_0x44f49e(0x1e3)+_0x586d22),0x1;if(!_0x307309[_0x44f49e(0x1df)]?.['id'])return console[_0x44f49e(0x211)](a41_0x542931[_0x44f49e(0x1e7)](_0x44f49e(0x15a)),_0x44f49e(0xce)+_0x586d22+_0x44f49e(0x12d)),0x1;const _0x2fb1de=_0x307309[_0x44f49e(0x1df)]['id'];_0x59a61f[_0x44f49e(0x1c7)]&&console[_0x44f49e(0x211)]('Using\x20attempt\x20'+_0x2fb1de+_0x44f49e(0x178)+_0x586d22);const _0x3c3797=_0x59a61f[_0x44f49e(0x1ee)];return _0x3c3797?await this['pollTimeline'](_0x1a1a01,_0x2fb1de):await this[_0x44f49e(0xca)](_0x1a1a01,_0x2fb1de,_0x59a61f),0x0;}const _0xb9d1a0=await withSpinner(_0x44f49e(0x1e4),()=>_0x1f8da7[_0x44f49e(0x20b)][_0x44f49e(0x235)]({'projectName':_0x5ad96b,'workflowName':_0x13717c,'limit':_0x59a61f[_0x44f49e(0xfd)]||0x32}),{'verbose':_0x59a61f['verbose']}),_0x4c6304=_0xb9d1a0['data'];if(_0x4c6304[_0x44f49e(0xc8)]===0x0){if(_0x5ad96b&&_0x13717c)console[_0x44f49e(0x211)](_0x44f49e(0xcb)+_0x5ad96b+'.'+_0x13717c);else _0x5ad96b?console[_0x44f49e(0x211)](_0x44f49e(0xf7)+_0x5ad96b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x44f49e(0x211)](a41_0x542931[_0x44f49e(0x145)](_0x44f49e(0xd8))));return 0x0;}_0x4c6304[_0x44f49e(0x139)]((_0x2882f5,_0x22fc6c)=>{const _0x1afba3=_0x44f49e,_0x4e6e3b=_0x2882f5[_0x1afba3(0x1d3)]||'',_0x906459=_0x22fc6c[_0x1afba3(0x1d3)]||'';return _0x906459[_0x1afba3(0x191)](_0x4e6e3b);});if(_0x59a61f[_0x44f49e(0x184)]||_0x59a61f[_0x44f49e(0x1a9)])return await handleSDKOutput(_0x4c6304,_0x59a61f),0x0;let _0x180644;if(_0x4297e2){const _0x5be066=_0x4c6304[0x0];if(!_0x5be066['lastAttempt']?.['id'])return console[_0x44f49e(0x211)](_0x44f49e(0xb9)),0x0;_0x180644=_0x5be066[_0x44f49e(0x1df)]['id'],_0x59a61f[_0x44f49e(0x1c7)]&&console[_0x44f49e(0x211)]('Auto-selected\x20latest\x20session:\x20'+_0x5be066[_0x44f49e(0x1d3)]);}else{const _0x2493e8=_0x4c6304[_0x44f49e(0x233)](_0x6a4878=>{const _0x1c47b3=_0x44f49e,_0xebfd5f=getAttemptStatusDisplay(_0x6a4878[_0x1c47b3(0x1df)]);return{'title':_0x6a4878['project']?.[_0x1c47b3(0x23f)]+'.'+_0x6a4878['workflow']?.[_0x1c47b3(0x23f)]+_0x1c47b3(0x15d)+_0x6a4878[_0x1c47b3(0x1d3)]+'\x20'+_0xebfd5f[_0x1c47b3(0x16d)],'value':_0x6a4878[_0x1c47b3(0x1df)]?.['id']||'','description':_0xebfd5f[_0x1c47b3(0x1cc)]};}),_0x3bb51f=await a41_0x2444a6({'type':_0x44f49e(0x1b9),'name':_0x44f49e(0x1a0),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x2493e8['filter'](_0x464188=>_0x464188[_0x44f49e(0x171)]!=='')});if(!_0x3bb51f[_0x44f49e(0x1a0)])return 0x0;_0x180644=_0x3bb51f[_0x44f49e(0x1a0)];}const _0x4a8e76=_0x59a61f[_0x44f49e(0x1ee)];return _0x4a8e76?await this[_0x44f49e(0x226)](_0x1a1a01,_0x180644):await this['renderSingleTimeline'](_0x1a1a01,_0x180644,_0x59a61f),0x0;}async[a41_0x5bd115(0xca)](_0x2a5baf,_0x30aeea,_0x308be5){const _0x558a73=a41_0x5bd115,{tdx:_0x30048f}=_0x2a5baf;let _0x16b42f,_0x56e23b;try{[_0x16b42f,_0x56e23b]=await Promise[_0x558a73(0x1a5)]([_0x30048f[_0x558a73(0x20b)][_0x558a73(0xfb)](_0x30aeea),_0x30048f[_0x558a73(0x20b)][_0x558a73(0x129)](_0x30aeea,![])]);}catch(_0x117c5b){console['error'](a41_0x542931[_0x558a73(0x1e7)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x308be5[_0x558a73(0x1c7)]&&console[_0x558a73(0x211)](_0x117c5b);throw _0x117c5b;}if(_0x308be5[_0x558a73(0x184)]||_0x308be5[_0x558a73(0x1a9)]){const _0x342b82=this[_0x558a73(0xbe)](_0x16b42f,_0x56e23b);await handleSDKOutput([_0x342b82],_0x308be5);return;}const _0x644b73=_0x30048f['context']['site'],_0x8b96f6=this[_0x558a73(0x1ed)](_0x16b42f,_0x56e23b,_0x644b73);console['log'](_0x8b96f6);}async[a41_0x5bd115(0x226)](_0x3ade28,_0x3bb892){const _0x406082=a41_0x5bd115,{tdx:_0x5015b4}=_0x3ade28,_0x5746e2=TIMELINE_CONFIG[_0x406082(0x1ff)],_0x44962e=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x134fd1=0x0;while(_0x134fd1<_0x44962e){process[_0x406082(0x128)][_0x406082(0x250)]&&process['stdout'][_0x406082(0x16c)]('\x1bc');let _0x46b331,_0x576811;try{[_0x46b331,_0x576811]=await Promise[_0x406082(0x1a5)]([_0x5015b4[_0x406082(0x20b)][_0x406082(0xfb)](_0x3bb892),_0x5015b4[_0x406082(0x20b)][_0x406082(0x129)](_0x3bb892,![])]);}catch(_0x3cc88f){console[_0x406082(0x211)](a41_0x542931[_0x406082(0x1e7)](_0x406082(0x1ce)));_0x134fd1>0x0&&console[_0x406082(0x211)](a41_0x542931[_0x406082(0x145)](_0x406082(0x1ac)+_0x134fd1));throw _0x3cc88f;}const _0x401d4a=_0x5015b4[_0x406082(0x20c)]['site'],_0xe31f54=this[_0x406082(0x1ed)](_0x46b331,_0x576811,_0x401d4a);console[_0x406082(0xcc)](_0xe31f54);const _0x378815=_0x46b331[_0x406082(0x174)]&&_0x576811[_0x406082(0x133)](_0x352361=>_0x352361[_0x406082(0xb7)]!=='running'&&_0x352361['state']!==_0x406082(0x17d));if(_0x378815){console[_0x406082(0x211)](a41_0x542931['green'](_0x406082(0x227)));break;}console['error'](a41_0x542931[_0x406082(0x145)](_0x406082(0x1bb)+_0x134fd1*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x2171e7=>setTimeout(_0x2171e7,_0x5746e2)),_0x134fd1++;}_0x134fd1>=_0x44962e&&console['error'](a41_0x542931[_0x406082(0x241)](_0x406082(0x103)));}[a41_0x5bd115(0x1ed)](_0x30ac0d,_0x2c9207,_0x1d6e3e){const _0x5c7821=a41_0x5bd115,_0x1dddfd=[],_0x1e2b19=TIMELINE_CONFIG[_0x5c7821(0x16b)],_0x185737=0x5,_0x5a1156=process[_0x5c7821(0x128)]['columns']||0x78,_0x195dff=_0x5a1156-_0x1e2b19-_0x185737,_0xb85281=Math[_0x5c7821(0x185)](TIMELINE_CONFIG[_0x5c7821(0xd5)],Math[_0x5c7821(0x219)](_0x195dff,TIMELINE_CONFIG[_0x5c7821(0x15e)])),_0x133994=new Date(_0x30ac0d[_0x5c7821(0x12c)])[_0x5c7821(0x137)](),_0x360134=_0x30ac0d[_0x5c7821(0x1e2)]?new Date(_0x30ac0d[_0x5c7821(0x1e2)])[_0x5c7821(0x137)]():Date[_0x5c7821(0x1c9)](),_0x3e1183={'start':_0x133994,'end':_0x360134,'duration':_0x360134-_0x133994},_0x51e106=new Map(),_0x3397fd=[];for(const _0x5a2830 of _0x2c9207){if(_0x5a2830[_0x5c7821(0xf0)]){const _0x5dd905=new Date(_0x5a2830[_0x5c7821(0xf0)])[_0x5c7821(0x137)](),_0x696b64=_0x5a2830[_0x5c7821(0x22e)]?new Date(_0x5a2830[_0x5c7821(0x22e)])['getTime']():Date[_0x5c7821(0x1c9)](),_0x5a2ffe={'start':_0x5dd905,'end':_0x696b64,'duration':_0x696b64-_0x5dd905};_0x51e106[_0x5c7821(0x1c2)](_0x5a2830['id'],_0x5a2ffe),_0x3397fd['push']({'name':_0x5a2830[_0x5c7821(0x1e5)],'state':_0x5a2830[_0x5c7821(0xb7)]||'unknown','window':_0x5a2ffe});}else _0x3397fd[_0x5c7821(0x249)]({'name':_0x5a2830[_0x5c7821(0x1e5)],'state':_0x5a2830[_0x5c7821(0xb7)]||_0x5c7821(0x17d),'window':undefined});}_0x3397fd['sort']((_0x229a55,_0x5bbdc5)=>{const _0x4c56bd=_0x5c7821;if(!_0x229a55[_0x4c56bd(0xee)])return 0x1;if(!_0x5bbdc5[_0x4c56bd(0xee)])return-0x1;return _0x229a55[_0x4c56bd(0xee)][_0x4c56bd(0x209)]-_0x5bbdc5[_0x4c56bd(0xee)]['start'];});const _0xf13b5f=_0x3397fd['length'],_0x1172f9=_0xf13b5f>TIMELINE_CONFIG[_0x5c7821(0x130)];_0x1172f9&&_0x3397fd[_0x5c7821(0x23d)](TIMELINE_CONFIG[_0x5c7821(0x130)]);const _0x860d31=calculateTimeScale(_0x3e1183,_0xb85281),_0x14f6f7=_0x30ac0d[_0x5c7821(0x174)]?_0x30ac0d[_0x5c7821(0x177)]?a41_0x542931[_0x5c7821(0x1c8)](_0x5c7821(0x177)):a41_0x542931['red'](_0x5c7821(0x211)):a41_0x542931['blue'](_0x5c7821(0x1a2)),_0x588028=_0x30ac0d[_0x5c7821(0x18f)]?.['id'],_0x35f9dd=_0x30ac0d[_0x5c7821(0x204)];let _0x3e9dd1;if(_0x588028&&_0x35f9dd){const _0x261ede=getWorkflowAttemptUrl(_0x1d6e3e,_0x588028,_0x35f9dd,_0x30ac0d['id']);_0x3e9dd1=hyperlink(a41_0x542931['dim'](_0x30ac0d['id']),_0x261ede);}else _0x3e9dd1=a41_0x542931['dim'](_0x30ac0d['id']);_0x1dddfd[_0x5c7821(0x249)](_0x5c7821(0x11b)+_0x3e9dd1+_0x5c7821(0x15d)+_0x14f6f7+_0x5c7821(0x15d)+formatElapsed(_0x3e1183[_0x5c7821(0x1d2)]));if(_0x3397fd[_0x5c7821(0xc8)]>0x0){const _0x51bcc7=renderTimeAxis(_0x860d31,_0xb85281),_0x4d83c6=new Date(_0x3e1183['start']),_0x392e9b=formatDate(_0x4d83c6),_0x18f55f=TIMELINE_CONFIG[_0x5c7821(0x1e0)]+TIMELINE_CONFIG[_0x5c7821(0x142)]+_0x1e2b19,_0x447ed8=_0x392e9b[_0x5c7821(0x12e)](_0x18f55f),_0x14cf28=a41_0x542931[_0x5c7821(0x145)](_0x447ed8);_0x1dddfd['push'](_0x14cf28+'\x20'+_0x51bcc7);for(const _0x23920e of _0x3397fd){_0x1dddfd[_0x5c7821(0x249)](renderTaskRow(_0x23920e,_0x860d31,_0xb85281,_0x1e2b19));}const _0x409caf=calculateStats(_0x3397fd);_0x1dddfd['push'](formatStats(_0x409caf)),_0x1172f9&&_0x1dddfd[_0x5c7821(0x249)](a41_0x542931[_0x5c7821(0x241)](_0x5c7821(0xe2)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5c7821(0x248)+_0xf13b5f+_0x5c7821(0x167))),_0x1dddfd[_0x5c7821(0x249)](''),_0x1dddfd['push'](a41_0x542931['dim']('💡\x20Tip:\x20Use\x20')+(_0x5c7821(0x1a4)+_0x30ac0d['id']+_0x5c7821(0xf1))+a41_0x542931[_0x5c7821(0x145)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1dddfd['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1dddfd[_0x5c7821(0x11c)]('\x0a');}[a41_0x5bd115(0xbe)](_0x529f6d,_0x370042){const _0x423ec1=a41_0x5bd115,_0x3ed891=new Date(_0x529f6d[_0x423ec1(0x12c)])['getTime'](),_0x4c5f68=_0x529f6d[_0x423ec1(0x1e2)]?new Date(_0x529f6d[_0x423ec1(0x1e2)])[_0x423ec1(0x137)]():Date[_0x423ec1(0x1c9)](),_0x2f5b33=_0x4c5f68-_0x3ed891,_0x22b333=[];for(const _0x3ef3c2 of _0x370042){if(_0x3ef3c2[_0x423ec1(0xf0)]){const _0x335fa8=new Date(_0x3ef3c2[_0x423ec1(0xf0)])['getTime'](),_0x11e692=_0x3ef3c2[_0x423ec1(0x22e)]?new Date(_0x3ef3c2[_0x423ec1(0x22e)])[_0x423ec1(0x137)]():Date['now']();_0x22b333[_0x423ec1(0x249)]({'name':_0x3ef3c2[_0x423ec1(0x1e5)],'state':_0x3ef3c2[_0x423ec1(0xb7)]||_0x423ec1(0x1e6),'window':{'start':_0x335fa8,'end':_0x11e692,'duration':_0x11e692-_0x335fa8}});}else _0x22b333['push']({'name':_0x3ef3c2[_0x423ec1(0x1e5)],'state':_0x3ef3c2[_0x423ec1(0xb7)]||_0x423ec1(0x17d),'window':undefined});}const _0x1b9909=calculateStats(_0x22b333);return{'attempt':{'id':_0x529f6d['id'],'status':_0x529f6d[_0x423ec1(0x174)]?_0x529f6d[_0x423ec1(0x177)]?_0x423ec1(0x177):'error':_0x423ec1(0x1a2),'createdAt':_0x529f6d[_0x423ec1(0x12c)],'finishedAt':_0x529f6d[_0x423ec1(0x1e2)],'duration_ms':_0x2f5b33},'tasks':_0x22b333[_0x423ec1(0x233)](_0x5cd957=>({'name':_0x5cd957[_0x423ec1(0x23f)],'state':_0x5cd957[_0x423ec1(0xb7)],'startedAt':_0x5cd957[_0x423ec1(0xee)]?new Date(_0x5cd957[_0x423ec1(0xee)]['start'])[_0x423ec1(0x10c)]():null,'updatedAt':_0x5cd957['window']?new Date(_0x5cd957[_0x423ec1(0xee)][_0x423ec1(0x115)])[_0x423ec1(0x10c)]():null,'duration_ms':_0x5cd957['window']?.[_0x423ec1(0x1d2)]||null})),'stats':_0x1b9909};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x140d44,_0x4592c3){const _0x270ec0=a42_0x5520,_0x49e473=_0x140d44();while(!![]){try{const _0x37b2b5=-parseInt(_0x270ec0(0x12e))/0x1+parseInt(_0x270ec0(0x138))/0x2*(parseInt(_0x270ec0(0x131))/0x3)+parseInt(_0x270ec0(0x12f))/0x4*(parseInt(_0x270ec0(0x129))/0x5)+parseInt(_0x270ec0(0x136))/0x6+-parseInt(_0x270ec0(0x128))/0x7+parseInt(_0x270ec0(0x12d))/0x8*(parseInt(_0x270ec0(0x12c))/0x9)+-parseInt(_0x270ec0(0x135))/0xa;if(_0x37b2b5===_0x4592c3)break;else _0x49e473['push'](_0x49e473['shift']());}catch(_0x51f3c6){_0x49e473['push'](_0x49e473['shift']());}}}(a42_0x134a,0x8c71c));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x134a(){const _0x197744=['92100ahOsOI','1802706NAsRGR','TD1\x20','116258CBuWqI','Authorization','entries','X-Trino-User','5486271bAFMBb','1565fVwBEm','length',';\x20node/','177003wLMlfs','176HbkfET','719796yhHixD','6172hclgFX','tdx/','45UNTwXx','tdx','replace','version'];a42_0x134a=function(){return _0x197744;};return a42_0x134a();}export function getUserAgent(){const _0x1d5139=a42_0x5520,_0xded4e0=getVersion(),_0x39add9=platform(),_0x46ca39=process[_0x1d5139(0x134)][_0x1d5139(0x133)]('v','');return _0x1d5139(0x130)+_0xded4e0+'\x20('+_0x39add9+_0x1d5139(0x12b)+_0x46ca39+')';}export function getAuthHeaders(_0x212c72,_0x4ed83c){const _0x44d5c3=a42_0x5520,_0x50041d=getVersion(),_0x3553ed={'User-Agent':getUserAgent(),'X-TD-Client':_0x44d5c3(0x132),'X-TD-Client-Version':_0x50041d};return _0x4ed83c&&(_0x3553ed[_0x44d5c3(0x139)]=_0x44d5c3(0x137)+_0x4ed83c),_0x3553ed;}function a42_0x5520(_0x4cfb7c,_0x1849c7){_0x4cfb7c=_0x4cfb7c-0x128;const _0x134a21=a42_0x134a();let _0x552072=_0x134a21[_0x4cfb7c];return _0x552072;}export function toHeaderRecord(_0x44699b){const _0x56708e=a42_0x5520,_0x266249={};for(const [_0x5bcfa2,_0x49237f]of Object[_0x56708e(0x13a)](_0x44699b)){_0x49237f!==undefined&&(_0x266249[_0x5bcfa2]=_0x49237f);}return _0x266249;}export function getTrinoHeaders(_0x3712c6,_0x5da370){const _0x5d865e=a42_0x5520,_0x43f3da=getAuthHeaders(_0x3712c6,_0x5da370),_0x1cd7a7=toHeaderRecord(_0x43f3da);return delete _0x1cd7a7[_0x5d865e(0x139)],_0x5da370&&(_0x1cd7a7[_0x5d865e(0x13b)]=_0x5da370),_0x1cd7a7;}export function hasAPIKey(_0xd16af3){const _0x301c9e=a42_0x5520,_0x197071=getAPIKey(_0xd16af3);return _0x197071!==undefined&&_0x197071[_0x301c9e(0x12a)]>0x0;}
1
+ (function(_0x3a0c21,_0x357941){const _0x583cdf=a42_0x5086,_0x2a7fd0=_0x3a0c21();while(!![]){try{const _0x3f9a17=parseInt(_0x583cdf(0x126))/0x1+-parseInt(_0x583cdf(0x128))/0x2+parseInt(_0x583cdf(0x12d))/0x3+-parseInt(_0x583cdf(0x136))/0x4*(parseInt(_0x583cdf(0x12f))/0x5)+parseInt(_0x583cdf(0x135))/0x6+-parseInt(_0x583cdf(0x12a))/0x7+parseInt(_0x583cdf(0x12e))/0x8*(parseInt(_0x583cdf(0x134))/0x9);if(_0x3f9a17===_0x357941)break;else _0x2a7fd0['push'](_0x2a7fd0['shift']());}catch(_0x5acef7){_0x2a7fd0['push'](_0x2a7fd0['shift']());}}}(a42_0x27e2,0x3b8fe));function a42_0x5086(_0x347ce8,_0x4c1125){_0x347ce8=_0x347ce8-0x126;const _0x27e2d=a42_0x27e2();let _0x50863d=_0x27e2d[_0x347ce8];return _0x50863d;}import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a42_0x27e2(){const _0xc10ba4=['2083256eiKnHW','tdx/',';\x20node/','624075wTaGrY','16KcEdeg','5CeyyzP','Authorization','entries','TD1\x20','version','1645191HFVxGo','539250WjhTum','783024eSdoVW','293875MSKSAV','length','440086eDjfei','tdx'];a42_0x27e2=function(){return _0xc10ba4;};return a42_0x27e2();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2b1b29=a42_0x5086,_0x3a12fc=getVersion(),_0x4d8d09=platform(),_0x39c3e1=process[_0x2b1b29(0x133)]['replace']('v','');return _0x2b1b29(0x12b)+_0x3a12fc+'\x20('+_0x4d8d09+_0x2b1b29(0x12c)+_0x39c3e1+')';}export function getAuthHeaders(_0x5c26f5,_0x131aaa){const _0x11590e=a42_0x5086,_0xa4b585=getVersion(),_0x3082d8={'User-Agent':getUserAgent(),'X-TD-Client':_0x11590e(0x129),'X-TD-Client-Version':_0xa4b585};return _0x131aaa&&(_0x3082d8[_0x11590e(0x130)]=_0x11590e(0x132)+_0x131aaa),_0x3082d8;}export function toHeaderRecord(_0x5bc347){const _0x1cf27f=a42_0x5086,_0x495fdc={};for(const [_0x1dfbe5,_0x344b91]of Object[_0x1cf27f(0x131)](_0x5bc347)){_0x344b91!==undefined&&(_0x495fdc[_0x1dfbe5]=_0x344b91);}return _0x495fdc;}export function getTrinoHeaders(_0x32ac24,_0xe58d04){const _0xc3497e=a42_0x5086,_0x598497=getAuthHeaders(_0x32ac24,_0xe58d04),_0x2bded5=toHeaderRecord(_0x598497);return delete _0x2bded5[_0xc3497e(0x130)],_0xe58d04&&(_0x2bded5['X-Trino-User']=_0xe58d04),_0x2bded5;}export function hasAPIKey(_0x20d9d6){const _0x4b4c3d=a42_0x5086,_0x445471=getAPIKey(_0x20d9d6);return _0x445471!==undefined&&_0x445471[_0x4b4c3d(0x127)]>0x0;}