@treasuredata/tdx 0.15.0 → 0.16.0

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 (172) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.d.ts.map +1 -1
  7. package/dist/commands/agent-command.js +1 -1
  8. package/dist/commands/agent-command.js.map +1 -1
  9. package/dist/commands/agent-test-command.d.ts.map +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/agent-test-command.js.map +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/llm-proxy.js +1 -1
  28. package/dist/commands/mcp-command.js +1 -1
  29. package/dist/commands/parent-segment-command.js +1 -1
  30. package/dist/commands/profile-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/unset-command.js +1 -1
  45. package/dist/commands/use-command.js +1 -1
  46. package/dist/commands/user-command.js +1 -1
  47. package/dist/commands/workflow-command.js +1 -1
  48. package/dist/core/auth.js +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.js +1 -1
  55. package/dist/core/keychain.js +1 -1
  56. package/dist/core/profile.js +1 -1
  57. package/dist/core/project-config.js +1 -1
  58. package/dist/core/session.js +1 -1
  59. package/dist/core/user-cache.js +1 -1
  60. package/dist/core/version.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/mcp/server.js +1 -1
  63. package/dist/mcp/tools/index.js +1 -1
  64. package/dist/mcp/tools/tdx-run.js +1 -1
  65. package/dist/mcp/tools/tdx-search.js +1 -1
  66. package/dist/mcp/utils.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/passthrough-server.js +1 -1
  72. package/dist/proxy/server.js +1 -1
  73. package/dist/proxy/session-cache.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  76. package/dist/sdk/agent/agent-config.js +1 -1
  77. package/dist/sdk/agent/agent-config.js.map +1 -1
  78. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  79. package/dist/sdk/agent/agent-yaml.d.ts +44 -0
  80. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  83. package/dist/sdk/agent/test/evaluator.js +1 -1
  84. package/dist/sdk/agent/test/executor.js +1 -1
  85. package/dist/sdk/agent/test/index.js +1 -1
  86. package/dist/sdk/agent/test/output.js +1 -1
  87. package/dist/sdk/agent/test/parser.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  90. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  91. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  92. package/dist/sdk/claude-agent/environment.js +1 -1
  93. package/dist/sdk/claude-agent/index.d.ts +2 -1
  94. package/dist/sdk/claude-agent/index.d.ts.map +1 -1
  95. package/dist/sdk/claude-agent/index.js +1 -1
  96. package/dist/sdk/claude-agent/index.js.map +1 -1
  97. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  98. package/dist/sdk/claude-agent/types.d.ts +4 -1
  99. package/dist/sdk/claude-agent/types.d.ts.map +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/endpoints.js +1 -1
  102. package/dist/sdk/client/engage-api-client.js +1 -1
  103. package/dist/sdk/client/http-client.js +1 -1
  104. package/dist/sdk/client/llm-api-client.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/engage.js +1 -1
  112. package/dist/sdk/errors.js +1 -1
  113. package/dist/sdk/index.js +1 -1
  114. package/dist/sdk/io/index.js +1 -1
  115. package/dist/sdk/io/node-filesystem.js +1 -1
  116. package/dist/sdk/job.js +1 -1
  117. package/dist/sdk/journey.js +1 -1
  118. package/dist/sdk/llm/chat-cache.js +1 -1
  119. package/dist/sdk/llm/index.d.ts.map +1 -1
  120. package/dist/sdk/llm/index.js +1 -1
  121. package/dist/sdk/llm/index.js.map +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-aliases.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  128. package/dist/sdk/segment/fields-display.js +1 -1
  129. package/dist/sdk/segment/file-discovery.js +1 -1
  130. package/dist/sdk/segment/journey-utils.js +1 -1
  131. package/dist/sdk/segment/journey-yaml.js +1 -1
  132. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  133. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/pull-workflow.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/target-resolution.js +1 -1
  140. package/dist/sdk/segment/tdx-config.js +1 -1
  141. package/dist/sdk/segment/validate-files.js +1 -1
  142. package/dist/sdk/segment/yaml-validator.js +1 -1
  143. package/dist/sdk/segment.js +1 -1
  144. package/dist/sdk/types/index.js +1 -1
  145. package/dist/sdk/types/progress.js +1 -1
  146. package/dist/sdk/user.js +1 -1
  147. package/dist/sdk/util/format-detector.js +1 -1
  148. package/dist/sdk/util/formatters.js +1 -1
  149. package/dist/sdk/util/index.js +1 -1
  150. package/dist/sdk/util/tree-formatter.js +1 -1
  151. package/dist/sdk/workflow/clone-workflow.js +1 -1
  152. package/dist/sdk/workflow/index.js +1 -1
  153. package/dist/sdk/workflow/pull-workflow.js +1 -1
  154. package/dist/sdk/workflow/push-workflow.js +1 -1
  155. package/dist/sdk/workflow/tdx-config.js +1 -1
  156. package/dist/sdk/workflow/workflow-utils.js +1 -1
  157. package/dist/utils/async.js +1 -1
  158. package/dist/utils/colors.js +1 -1
  159. package/dist/utils/diff.js +1 -1
  160. package/dist/utils/file-permissions.js +1 -1
  161. package/dist/utils/json-loader.js +1 -1
  162. package/dist/utils/option-validation.js +1 -1
  163. package/dist/utils/port.js +1 -1
  164. package/dist/utils/process.js +1 -1
  165. package/dist/utils/prompt.js +1 -1
  166. package/dist/utils/spinner.js +1 -1
  167. package/dist/utils/sse-parser.js +1 -1
  168. package/dist/utils/string-utils.js +1 -1
  169. package/dist/utils/table-ref-parser.js +1 -1
  170. package/dist/utils/tdx-logger.js +1 -1
  171. package/dist/utils/version-check.js +1 -1
  172. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x79250c=a39_0x16fc;function a39_0x16fc(_0x166d15,_0x39c205){_0x166d15=_0x166d15-0x1a4;const _0x53297b=a39_0x5329();let _0x16fc87=_0x53297b[_0x166d15];return _0x16fc87;}(function(_0x14a372,_0x53051f){const _0xb55935=a39_0x16fc,_0x38953e=_0x14a372();while(!![]){try{const _0x55f4dc=parseInt(_0xb55935(0x1b1))/0x1+parseInt(_0xb55935(0x1aa))/0x2+parseInt(_0xb55935(0x1d9))/0x3*(parseInt(_0xb55935(0x1cf))/0x4)+parseInt(_0xb55935(0x1a7))/0x5+parseInt(_0xb55935(0x1b6))/0x6*(-parseInt(_0xb55935(0x1de))/0x7)+-parseInt(_0xb55935(0x1a5))/0x8+-parseInt(_0xb55935(0x1d4))/0x9;if(_0x55f4dc===_0x53051f)break;else _0x38953e['push'](_0x38953e['shift']());}catch(_0x43df91){_0x38953e['push'](_0x38953e['shift']());}}}(a39_0x5329,0xdb2e3));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';function a39_0x5329(){const _0x5aca0e=['\x27\x20does\x20not\x20exist','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','profile','Session\x20profile\x20set\x20to:\x20','291ApZeIN','description','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','log','includes','147091Mdiyyx','database','cleared','parent_segment','Session\x20llm_project\x20set\x20to:\x20','Session\x20site\x20set\x20to:\x20','display','11713176WCPdKr','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','6922795NAZdYf','\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','llm_project','2542484RDGKdi','tdx.json','site','Error:\x20Profile\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','Default\x20profile\x20set\x20to:\x20','Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace','825982kKmdvi','displayWithSources','toString','Session\x20database\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','402UJDgaJ','name','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','dim','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','default','join','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','session','validate','Session\x20engage_workspace\x20set\x20to:\x20','Session\x20context\x20','(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20','\x0aSaved\x20to:\x20','engage_workspace','Use\x20--default\x20with\x20site\x20or\x20profile\x20to\x20save\x20permanently','.\x20Must\x20be\x20one\x20of:\x20','green','agent','error','\x27\x20to\x20save\x20permanently','Session\x20parent_segment\x20set\x20to:\x20','25408NYBKYB','use','Set\x20session-level\x20context','llm_agent','Default\x20site\x20set\x20to:\x20','2953314YzEVde'];a39_0x5329=function(){return _0x5aca0e;};return a39_0x5329();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir}from'../core/config.js';import a39_0x49e3b3 from'chalk';import*as a39_0x2cbb6b from'node:path';export class UseCommand extends BaseCommand{[a39_0x79250c(0x1b7)]=a39_0x79250c(0x1d0);[a39_0x79250c(0x1da)]=a39_0x79250c(0x1d1);[a39_0x79250c(0x1c0)](_0x20afc3){const _0x57763f=a39_0x79250c,{args:_0x47c9e4,options:_0x5c8fc1}=_0x20afc3,_0x1e4f05=_0x5c8fc1[_0x57763f(0x1bc)];if(_0x47c9e4['length']===0x0)return undefined;if(_0x47c9e4[_0x57763f(0x1b8)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x57763f(0x1a8)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x57763f(0x1b9)+_0x57763f(0x1ae)+_0x57763f(0x1d6)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x1f58b4=_0x47c9e4[0x0],_0xa53f01=[_0x57763f(0x1ac),_0x57763f(0x1df),_0x57763f(0x1e1),'llm_project',_0x57763f(0x1cb),_0x57763f(0x1d7),'engage_workspace'];if(!_0xa53f01[_0x57763f(0x1dd)](_0x1f58b4))return'Invalid\x20resource:\x20'+_0x1f58b4+_0x57763f(0x1c9)+_0xa53f01[_0x57763f(0x1bd)](',\x20');if(_0x1e4f05&&_0x1f58b4!==_0x57763f(0x1ac)&&_0x1f58b4!==_0x57763f(0x1d7))return _0x57763f(0x1a6);return undefined;}async['execute'](_0x4428a8){const _0x23ad75=a39_0x79250c,{args:_0x3ad07b,options:_0x3c75d9}=_0x4428a8,_0x38e01e=_0x3c75d9['debug'],_0x5a0e8b=_0x3c75d9['clear'],_0x86bd0b=_0x3c75d9[_0x23ad75(0x1bc)];cleanExpiredSessions();try{if(_0x5a0e8b){clearSessionContext(_0x3c75d9[_0x23ad75(0x1bf)]);const _0x2e7bc5=_0x3c75d9[_0x23ad75(0x1bf)]||getCurrentSessionPID()[_0x23ad75(0x1b3)]();return console['log'](_0x23ad75(0x1c2)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0x23ad75(0x1e0))+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)]('(session:\x20'+_0x2e7bc5+')')),0x0;}if(_0x3ad07b[_0x23ad75(0x1b8)]===0x0){const _0x4435b8=new GlobalContext(_0x3c75d9);return _0x38e01e?_0x4435b8[_0x23ad75(0x1b2)]():_0x4435b8[_0x23ad75(0x1a4)](),console['log'](a39_0x49e3b3['dim'](_0x23ad75(0x1bb))),console['log'](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1b0))),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c8))),0x0;}const _0x1d9b59=_0x3ad07b[0x0],_0xaf4714=_0x3ad07b[0x1],_0x30eec2=a39_0x2cbb6b[_0x23ad75(0x1bd)](getConfigDir(),_0x23ad75(0x1ab));if(_0x86bd0b){if(_0x1d9b59===_0x23ad75(0x1ac))return saveDefaultSiteToUserConfig(_0xaf4714),console[_0x23ad75(0x1dc)](_0x23ad75(0x1d3)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c6)+_0x30eec2)),0x0;if(_0x1d9b59===_0x23ad75(0x1d7)){if(!profileExists(_0xaf4714))return console[_0x23ad75(0x1cc)]('Error:\x20Profile\x20\x27'+_0xaf4714+'\x27\x20does\x20not\x20exist'),console[_0x23ad75(0x1cc)](_0x23ad75(0x1db)),0x1;return saveActiveProfileToUserConfig(_0xaf4714),console[_0x23ad75(0x1dc)](_0x23ad75(0x1af)+a39_0x49e3b3['green'](_0xaf4714)),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c6)+_0x30eec2)),0x0;}}if(_0x1d9b59==='site'){const _0xe532fb=_0x3c75d9[_0x23ad75(0x1bf)]||getCurrentSessionPID()[_0x23ad75(0x1b3)]();return saveSessionContext({'site':_0xaf4714},_0x3c75d9['session']),console['log'](_0x23ad75(0x1e3)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0xe532fb+')')),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c5)+_0xaf4714+_0x23ad75(0x1cd))),0x0;}if(_0x1d9b59==='profile'){if(!profileExists(_0xaf4714))return console[_0x23ad75(0x1cc)](_0x23ad75(0x1ad)+_0xaf4714+_0x23ad75(0x1d5)),console[_0x23ad75(0x1cc)](_0x23ad75(0x1db)),0x1;const _0x50542c=_0x3c75d9[_0x23ad75(0x1bf)]||getCurrentSessionPID()['toString']();return saveSessionContext({'profile':_0xaf4714},_0x3c75d9['session']),console[_0x23ad75(0x1dc)](_0x23ad75(0x1d8)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x50542c+')')),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1be)+_0xaf4714+_0x23ad75(0x1cd))),0x0;}const _0x507cfb={},_0x2886f7=_0x3c75d9[_0x23ad75(0x1bf)]||getCurrentSessionPID()[_0x23ad75(0x1b3)]();switch(_0x1d9b59){case _0x23ad75(0x1df):_0x507cfb[_0x23ad75(0x1df)]=_0xaf4714,console[_0x23ad75(0x1dc)](_0x23ad75(0x1b4)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)]('(session:\x20'+_0x2886f7+')'));break;case _0x23ad75(0x1e1):_0x507cfb[_0x23ad75(0x1e1)]=_0xaf4714,console[_0x23ad75(0x1dc)](_0x23ad75(0x1ce)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x2886f7+')'));break;case _0x23ad75(0x1a9):_0x507cfb['llm_project']=_0xaf4714,console['log'](_0x23ad75(0x1e2)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)]('(session:\x20'+_0x2886f7+')'));break;case'agent':{const {projectName:_0x3a98a5,agentName:_0x2c17c6}=parseAgentRef(_0xaf4714);_0x2c17c6?(_0x507cfb[_0x23ad75(0x1a9)]=_0x3a98a5,_0x507cfb['llm_agent']=_0x2c17c6,console[_0x23ad75(0x1dc)](_0x23ad75(0x1e2)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0x3a98a5)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x2886f7+')')),console[_0x23ad75(0x1dc)](_0x23ad75(0x1b5)+a39_0x49e3b3['green'](_0x2c17c6)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x2886f7+')'))):(_0x507cfb[_0x23ad75(0x1d2)]=_0xaf4714,console[_0x23ad75(0x1dc)](_0x23ad75(0x1b5)+a39_0x49e3b3[_0x23ad75(0x1ca)](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x2886f7+')')));break;}case _0x23ad75(0x1c7):_0x507cfb[_0x23ad75(0x1c7)]=_0xaf4714,console['log'](_0x23ad75(0x1c1)+a39_0x49e3b3['green'](_0xaf4714)+'\x20'+a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c3)+_0x2886f7+')'));break;}return saveSessionContext(_0x507cfb,_0x3c75d9[_0x23ad75(0x1bf)]),console[_0x23ad75(0x1dc)](a39_0x49e3b3[_0x23ad75(0x1ba)](_0x23ad75(0x1c4))),0x0;}catch(_0x386593){return _0x386593 instanceof Error&&console['error']('Error:\x20'+_0x386593['message']),0x1;}}}
1
+ const a39_0x45dd2c=a39_0x4ea2;(function(_0x285aa7,_0x3911de){const _0x5c0b6f=a39_0x4ea2,_0x4033c4=_0x285aa7();while(!![]){try{const _0x42df7e=-parseInt(_0x5c0b6f(0x14b))/0x1*(parseInt(_0x5c0b6f(0x175))/0x2)+parseInt(_0x5c0b6f(0x14c))/0x3+-parseInt(_0x5c0b6f(0x156))/0x4*(parseInt(_0x5c0b6f(0x16c))/0x5)+parseInt(_0x5c0b6f(0x148))/0x6*(-parseInt(_0x5c0b6f(0x152))/0x7)+parseInt(_0x5c0b6f(0x15b))/0x8*(parseInt(_0x5c0b6f(0x143))/0x9)+-parseInt(_0x5c0b6f(0x168))/0xa*(parseInt(_0x5c0b6f(0x163))/0xb)+-parseInt(_0x5c0b6f(0x139))/0xc*(-parseInt(_0x5c0b6f(0x158))/0xd);if(_0x42df7e===_0x3911de)break;else _0x4033c4['push'](_0x4033c4['shift']());}catch(_0x365fba){_0x4033c4['push'](_0x4033c4['shift']());}}}(a39_0x2848,0x6215e));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists,saveActiveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a39_0x2848(){const _0x36484e=['.\x20Must\x20be\x20one\x20of:\x20','Default\x20site\x20set\x20to:\x20','Session\x20agent\x20set\x20to:\x20','llm_agent','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20profile\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20profile\x20<value>\x20\x20#\x20Save\x20default\x20profile\x20to\x20config\x0a','381986NpMHHD','Error:\x20Profile\x20\x27','Session\x20llm_project\x20set\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','profile','210RtfnTo','(session:\x20','engage_workspace','parent_segment','5EVwMcG','database','includes','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','displayWithSources','toString','\x0aSaved\x20to:\x20','agent','Default\x20profile\x20set\x20to:\x20','100778gwhLVo','message','12TNuHwD','session','dim','Session\x20database\x20set\x20to:\x20','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','llm_project','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','length','use','log','99qKZCoA','join','\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','cleared','site','133368xAJgKt','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--default\x20site\x20<value>\x20\x20\x20\x20\x20#\x20Save\x20default\x20site\x20to\x20config\x0a','clear','10URUFBX','2002422CdUAme','\x27\x20does\x20not\x20exist','green','description','Session\x20parent_segment\x20set\x20to:\x20','display','175KBSlrf','validate','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','Session\x20profile\x20set\x20to:\x20','2381376ErcLGY','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','24509433fJBAKJ','error','\x27\x20to\x20save\x20permanently','169544IUlMzG','default'];a39_0x2848=function(){return _0x36484e;};return a39_0x2848();}import{GlobalContext}from'../core/global-context.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{getConfigDir}from'../core/config.js';function a39_0x4ea2(_0x1f5597,_0xa28915){_0x1f5597=_0x1f5597-0x139;const _0x284872=a39_0x2848();let _0x4ea2a3=_0x284872[_0x1f5597];return _0x4ea2a3;}import a39_0x34c47d from'chalk';import*as a39_0x1adcb1 from'node:path';export class UseCommand extends BaseCommand{['name']=a39_0x45dd2c(0x141);[a39_0x45dd2c(0x14f)]='Set\x20session-level\x20context';[a39_0x45dd2c(0x153)](_0x189193){const _0x4f2e6b=a39_0x45dd2c,{args:_0x8412df,options:_0x50262a}=_0x189193,_0x5086fd=_0x50262a[_0x4f2e6b(0x15c)];if(_0x8412df[_0x4f2e6b(0x140)]===0x0)return undefined;if(_0x8412df[_0x4f2e6b(0x140)]===0x1)return _0x4f2e6b(0x16f)+_0x4f2e6b(0x145)+_0x4f2e6b(0x166)+_0x4f2e6b(0x149)+_0x4f2e6b(0x162)+_0x4f2e6b(0x13f)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x42ad4b=_0x8412df[0x0],_0x4031a8=[_0x4f2e6b(0x147),'database',_0x4f2e6b(0x16b),_0x4f2e6b(0x13e),_0x4f2e6b(0x173),_0x4f2e6b(0x167),_0x4f2e6b(0x16a)];if(!_0x4031a8[_0x4f2e6b(0x16e)](_0x42ad4b))return'Invalid\x20resource:\x20'+_0x42ad4b+_0x4f2e6b(0x15d)+_0x4031a8['join'](',\x20');if(_0x5086fd&&_0x42ad4b!==_0x4f2e6b(0x147)&&_0x42ad4b!==_0x4f2e6b(0x167))return'--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.';return undefined;}async['execute'](_0x1a13d3){const _0x306562=a39_0x45dd2c,{args:_0x337818,options:_0x14ce96}=_0x1a13d3,_0x3dda99=_0x14ce96['debug'],_0x3a2ba2=_0x14ce96[_0x306562(0x14a)],_0x47d86c=_0x14ce96[_0x306562(0x15c)];cleanExpiredSessions();try{if(_0x3a2ba2){clearSessionContext(_0x14ce96[_0x306562(0x13a)]);const _0x547c90=_0x14ce96[_0x306562(0x13a)]||getCurrentSessionPID()[_0x306562(0x171)]();return console[_0x306562(0x142)]('Session\x20context\x20'+a39_0x34c47d[_0x306562(0x14e)](_0x306562(0x146))+'\x20'+a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x169)+_0x547c90+')')),0x0;}if(_0x337818[_0x306562(0x140)]===0x0){const _0xda796=new GlobalContext(_0x14ce96);return _0x3dda99?_0xda796[_0x306562(0x170)]():_0xda796[_0x306562(0x151)](),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x154))),console['log'](a39_0x34c47d[_0x306562(0x13b)]('Resources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace')),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)]('Use\x20--default\x20with\x20site\x20or\x20profile\x20to\x20save\x20permanently')),0x0;}const _0x18aef1=_0x337818[0x0],_0x4f217b=_0x337818[0x1],_0x39f542=a39_0x1adcb1[_0x306562(0x144)](getConfigDir(),'tdx.json');if(_0x47d86c){if(_0x18aef1===_0x306562(0x147))return saveDefaultSiteToUserConfig(_0x4f217b),console['log'](_0x306562(0x15e)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x172)+_0x39f542)),0x0;if(_0x18aef1===_0x306562(0x167)){if(!profileExists(_0x4f217b))return console['error'](_0x306562(0x164)+_0x4f217b+_0x306562(0x14d)),console[_0x306562(0x159)](_0x306562(0x13d)),0x1;return saveActiveProfileToUserConfig(_0x4f217b),console[_0x306562(0x142)](_0x306562(0x174)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x172)+_0x39f542)),0x0;}}if(_0x18aef1===_0x306562(0x147)){const _0xcb1ac6=_0x14ce96[_0x306562(0x13a)]||getCurrentSessionPID()['toString']();return saveSessionContext({'site':_0x4f217b},_0x14ce96[_0x306562(0x13a)]),console['log']('Session\x20site\x20set\x20to:\x20'+a39_0x34c47d['green'](_0x4f217b)+'\x20'+a39_0x34c47d['dim'](_0x306562(0x169)+_0xcb1ac6+')')),console['log'](a39_0x34c47d['dim']('\x0aTip:\x20Use\x20\x27tdx\x20use\x20--default\x20site\x20'+_0x4f217b+_0x306562(0x15a))),0x0;}if(_0x18aef1===_0x306562(0x167)){if(!profileExists(_0x4f217b))return console['error'](_0x306562(0x164)+_0x4f217b+_0x306562(0x14d)),console[_0x306562(0x159)](_0x306562(0x13d)),0x1;const _0x58bdf0=_0x14ce96[_0x306562(0x13a)]||getCurrentSessionPID()[_0x306562(0x171)]();return saveSessionContext({'profile':_0x4f217b},_0x14ce96[_0x306562(0x13a)]),console[_0x306562(0x142)](_0x306562(0x155)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x169)+_0x58bdf0+')')),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x161)+_0x4f217b+_0x306562(0x15a))),0x0;}const _0x1d98e7={},_0x506b48=_0x14ce96['session']||getCurrentSessionPID()[_0x306562(0x171)]();switch(_0x18aef1){case _0x306562(0x16d):_0x1d98e7[_0x306562(0x16d)]=_0x4f217b,console['log'](_0x306562(0x13c)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d[_0x306562(0x13b)]('(session:\x20'+_0x506b48+')'));break;case'parent_segment':_0x1d98e7[_0x306562(0x16b)]=_0x4f217b,console['log'](_0x306562(0x150)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d[_0x306562(0x13b)]('(session:\x20'+_0x506b48+')'));break;case _0x306562(0x13e):_0x1d98e7['llm_project']=_0x4f217b,console[_0x306562(0x142)](_0x306562(0x165)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x169)+_0x506b48+')'));break;case _0x306562(0x173):{const {projectName:_0x275eca,agentName:_0x153fd9}=parseAgentRef(_0x4f217b);_0x153fd9?(_0x1d98e7[_0x306562(0x13e)]=_0x275eca,_0x1d98e7[_0x306562(0x160)]=_0x153fd9,console[_0x306562(0x142)](_0x306562(0x165)+a39_0x34c47d['green'](_0x275eca)+'\x20'+a39_0x34c47d['dim'](_0x306562(0x169)+_0x506b48+')')),console[_0x306562(0x142)](_0x306562(0x15f)+a39_0x34c47d[_0x306562(0x14e)](_0x153fd9)+'\x20'+a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x169)+_0x506b48+')'))):(_0x1d98e7[_0x306562(0x160)]=_0x4f217b,console[_0x306562(0x142)](_0x306562(0x15f)+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d['dim'](_0x306562(0x169)+_0x506b48+')')));break;}case _0x306562(0x16a):_0x1d98e7['engage_workspace']=_0x4f217b,console['log']('Session\x20engage_workspace\x20set\x20to:\x20'+a39_0x34c47d[_0x306562(0x14e)](_0x4f217b)+'\x20'+a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x169)+_0x506b48+')'));break;}return saveSessionContext(_0x1d98e7,_0x14ce96[_0x306562(0x13a)]),console[_0x306562(0x142)](a39_0x34c47d[_0x306562(0x13b)](_0x306562(0x157))),0x0;}catch(_0x3c1048){return _0x3c1048 instanceof Error&&console[_0x306562(0x159)]('Error:\x20'+_0x3c1048[_0x306562(0x176)]),0x1;}}}
@@ -1 +1 @@
1
- function a40_0x128c(_0x226113,_0x422f4d){_0x226113=_0x226113-0x1cd;const _0x2da64d=a40_0x2da6();let _0x128c20=_0x2da64d[_0x226113];return _0x128c20;}const a40_0x109ab6=a40_0x128c;(function(_0x492811,_0xf08a7d){const _0x40ec9d=a40_0x128c,_0x3d7f9f=_0x492811();while(!![]){try{const _0x53ad18=-parseInt(_0x40ec9d(0x1d6))/0x1*(-parseInt(_0x40ec9d(0x1d2))/0x2)+parseInt(_0x40ec9d(0x1ce))/0x3*(-parseInt(_0x40ec9d(0x1cf))/0x4)+-parseInt(_0x40ec9d(0x1e8))/0x5*(parseInt(_0x40ec9d(0x1df))/0x6)+parseInt(_0x40ec9d(0x1cd))/0x7+-parseInt(_0x40ec9d(0x1e7))/0x8+-parseInt(_0x40ec9d(0x1e3))/0x9+parseInt(_0x40ec9d(0x1d8))/0xa*(parseInt(_0x40ec9d(0x1e1))/0xb);if(_0x53ad18===_0xf08a7d)break;else _0x3d7f9f['push'](_0x3d7f9f['shift']());}catch(_0x47636d){_0x3d7f9f['push'](_0x3d7f9f['shift']());}}}(a40_0x2da6,0xb7a90));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_0x109ab6(0x1d1)]='user';[a40_0x109ab6(0x1e5)]=a40_0x109ab6(0x1e9);async[a40_0x109ab6(0x1e4)](_0x4b5c8c){const _0x1835db=a40_0x109ab6,{options:_0x1b8c28,tdx:_0x48ce32}=_0x4b5c8c;try{const _0x5e9e6b=await withSpinner(_0x1835db(0x1de),()=>_0x48ce32[_0x1835db(0x1d9)][_0x1835db(0x1d4)](),{'verbose':_0x1b8c28['verbose']}),_0xd74b63=_0x5e9e6b[_0x1835db(0x1d0)];return await handleSingleObjectOutput(_0xd74b63,_0x1b8c28),0x0;}catch(_0x41eaef){if(_0x41eaef instanceof SDKError)return console['error'](_0x1835db(0x1e6)+_0x41eaef[_0x1835db(0x1e2)]),_0x41eaef['cause']&&console[_0x1835db(0x1dc)](_0x1835db(0x1e0)+_0x41eaef[_0x1835db(0x1dd)]),0x1;throw _0x41eaef;}}}export class UserListCommand extends BaseCommand{[a40_0x109ab6(0x1d1)]='user\x20list';[a40_0x109ab6(0x1e5)]=a40_0x109ab6(0x1d5);async[a40_0x109ab6(0x1e4)](_0x382827){const _0x247e27=a40_0x109ab6,{options:_0x4a4759,tdx:_0x62ccf8}=_0x382827;try{const _0x55728a=await withSpinner(_0x247e27(0x1d3),()=>_0x62ccf8[_0x247e27(0x1d9)][_0x247e27(0x1d7)](),{'verbose':_0x4a4759[_0x247e27(0x1db)]}),_0x517dbb=_0x55728a[_0x247e27(0x1d0)];return console['error']('✔\x20Found\x20'+_0x517dbb[_0x247e27(0x1da)]+_0x247e27(0x1ea)+(_0x517dbb[_0x247e27(0x1da)]!==0x1?'s':'')),await handleSDKOutput(_0x517dbb,_0x4a4759),0x0;}catch(_0x2e18f9){if(_0x2e18f9 instanceof SDKError)return console['error']('Error:\x20'+_0x2e18f9[_0x247e27(0x1e2)]),_0x2e18f9[_0x247e27(0x1dd)]&&console[_0x247e27(0x1dc)]('\x20\x20Cause:\x20'+_0x2e18f9['cause']),0x1;throw _0x2e18f9;}}}function a40_0x2da6(){const _0x4723bc=['error','cause','Fetching\x20user\x20info...','851802itbFvj','\x20\x20Cause:\x20','11oWMebM','message','2484081ybHqKH','execute','description','Error:\x20','10980752chlMzS','35uqnyte','Show\x20current\x20user\x20information','\x20user','5742541wUteUC','3322032ygwHSe','4ToIUUV','data','name','2rlbIqi','Listing\x20users...','getCurrent','List\x20all\x20users\x20in\x20the\x20account','1371742RkTAZi','list','23098830mNUoeV','user','length','verbose'];a40_0x2da6=function(){return _0x4723bc;};return a40_0x2da6();}
1
+ const a40_0x26bf33=a40_0x2c8c;(function(_0x3ea11d,_0x4be961){const _0x3d5c04=a40_0x2c8c,_0xd0105a=_0x3ea11d();while(!![]){try{const _0x1e4241=-parseInt(_0x3d5c04(0x1e7))/0x1+parseInt(_0x3d5c04(0x1e8))/0x2*(parseInt(_0x3d5c04(0x1d8))/0x3)+parseInt(_0x3d5c04(0x1dc))/0x4+-parseInt(_0x3d5c04(0x1ec))/0x5*(parseInt(_0x3d5c04(0x1f1))/0x6)+parseInt(_0x3d5c04(0x1df))/0x7+-parseInt(_0x3d5c04(0x1db))/0x8+-parseInt(_0x3d5c04(0x1da))/0x9;if(_0x1e4241===_0x4be961)break;else _0xd0105a['push'](_0xd0105a['shift']());}catch(_0x44077d){_0xd0105a['push'](_0xd0105a['shift']());}}}(a40_0x26d8,0xb9087));function a40_0x2c8c(_0x1b3888,_0x45a837){_0x1b3888=_0x1b3888-0x1d7;const _0x26d8d2=a40_0x26d8();let _0x2c8c8a=_0x26d8d2[_0x1b3888];return _0x2c8c8a;}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';function a40_0x26d8(){const _0x49a241=['6709766OdNWWW','user\x20list','length','cause','List\x20all\x20users\x20in\x20the\x20account','description','\x20user','user','640274NleBzS','733406VvBFEO','\x20\x20Cause:\x20','✔\x20Found\x20','name','6635BIfkZa','message','error','Error:\x20','Fetching\x20user\x20info...','234zGjzFZ','execute','verbose','9fcBjub','data','12076560SayHGd','4699760GzshUq','5282340ANliwW','Show\x20current\x20user\x20information','Listing\x20users...'];a40_0x26d8=function(){return _0x49a241;};return a40_0x26d8();}export class UserCommand extends BaseCommand{[a40_0x26bf33(0x1eb)]=a40_0x26bf33(0x1e6);[a40_0x26bf33(0x1e4)]=a40_0x26bf33(0x1dd);async[a40_0x26bf33(0x1f2)](_0x16aa8b){const _0x1ba70e=a40_0x26bf33,{options:_0x2ebc78,tdx:_0x70048f}=_0x16aa8b;try{const _0x3b9716=await withSpinner(_0x1ba70e(0x1f0),()=>_0x70048f['user']['getCurrent'](),{'verbose':_0x2ebc78[_0x1ba70e(0x1d7)]}),_0x1f194f=_0x3b9716[_0x1ba70e(0x1d9)];return await handleSingleObjectOutput(_0x1f194f,_0x2ebc78),0x0;}catch(_0x1ac1d8){if(_0x1ac1d8 instanceof SDKError)return console['error'](_0x1ba70e(0x1ef)+_0x1ac1d8['message']),_0x1ac1d8['cause']&&console[_0x1ba70e(0x1ee)](_0x1ba70e(0x1e9)+_0x1ac1d8[_0x1ba70e(0x1e2)]),0x1;throw _0x1ac1d8;}}}export class UserListCommand extends BaseCommand{[a40_0x26bf33(0x1eb)]=a40_0x26bf33(0x1e0);[a40_0x26bf33(0x1e4)]=a40_0x26bf33(0x1e3);async[a40_0x26bf33(0x1f2)](_0xf11db7){const _0x34c934=a40_0x26bf33,{options:_0x7d03c1,tdx:_0x34925e}=_0xf11db7;try{const _0x148c21=await withSpinner(_0x34c934(0x1de),()=>_0x34925e[_0x34c934(0x1e6)]['list'](),{'verbose':_0x7d03c1[_0x34c934(0x1d7)]}),_0x4c18bf=_0x148c21[_0x34c934(0x1d9)];return console[_0x34c934(0x1ee)](_0x34c934(0x1ea)+_0x4c18bf[_0x34c934(0x1e1)]+_0x34c934(0x1e5)+(_0x4c18bf[_0x34c934(0x1e1)]!==0x1?'s':'')),await handleSDKOutput(_0x4c18bf,_0x7d03c1),0x0;}catch(_0x536a62){if(_0x536a62 instanceof SDKError)return console['error'](_0x34c934(0x1ef)+_0x536a62[_0x34c934(0x1ed)]),_0x536a62[_0x34c934(0x1e2)]&&console[_0x34c934(0x1ee)](_0x34c934(0x1e9)+_0x536a62['cause']),0x1;throw _0x536a62;}}}
@@ -1 +1 @@
1
- const a41_0x50f62=a41_0x5857;(function(_0x51964c,_0x1eba99){const _0x5c237d=a41_0x5857,_0x1722f9=_0x51964c();while(!![]){try{const _0x4e6a8d=-parseInt(_0x5c237d(0x159))/0x1*(parseInt(_0x5c237d(0x2b0))/0x2)+-parseInt(_0x5c237d(0x24a))/0x3+-parseInt(_0x5c237d(0x203))/0x4+-parseInt(_0x5c237d(0x208))/0x5+-parseInt(_0x5c237d(0x1a6))/0x6+-parseInt(_0x5c237d(0x21b))/0x7+parseInt(_0x5c237d(0x2a0))/0x8;if(_0x4e6a8d===_0x1eba99)break;else _0x1722f9['push'](_0x1722f9['shift']());}catch(_0x568dcf){_0x1722f9['push'](_0x1722f9['shift']());}}}(a41_0x138c,0x64417));import a41_0x536097 from'chalk';import{existsSync}from'fs';import a41_0x149b54 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_0x3c8366 from'prompts';function getAttemptStatusDisplay(_0x41021d){const _0x29ea64=a41_0x5857;if(!_0x41021d)return{'icon':'⏳','text':''};const {done:_0x458bff,success:_0x3d02ee,cancelRequested:_0x3888af}=_0x41021d;if(!_0x458bff)return _0x3888af?{'icon':'🛑','text':a41_0x536097[_0x29ea64(0x13f)](_0x29ea64(0x2b3))}:{'icon':'🔄','text':a41_0x536097[_0x29ea64(0x222)](_0x29ea64(0x16b))};if(_0x3d02ee)return{'icon':'✅','text':a41_0x536097['green'](_0x29ea64(0x285))};return{'icon':'❌','text':a41_0x536097[_0x29ea64(0x1bc)](_0x29ea64(0x1f1))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x55e58b,_0x13dc55,_0x293db8=0x0){const _0x7d2131=a41_0x5857;return _0x55e58b[_0x293db8]||_0x13dc55[_0x7d2131(0x247)];}[a41_0x50f62(0x1e9)](_0x129b8f,_0x37c56a,_0x2f6a18=0x0){const _0x4fe650=a41_0x50f62,_0x2e027d=this[_0x4fe650(0x19d)](_0x129b8f,_0x37c56a,_0x2f6a18);if(!_0x2e027d)return console[_0x4fe650(0x1f1)](a41_0x536097[_0x4fe650(0x1bc)](_0x4fe650(0x15c)),_0x4fe650(0x2be)),console[_0x4fe650(0x1f1)](a41_0x536097['dim'](_0x4fe650(0x18e))),null;return _0x2e027d;}['parseProjectWorkflowPattern'](_0x28fbd7,_0xaac454){const _0x3e5747=a41_0x50f62;if(_0x28fbd7[0x0]){const _0x51dca7=_0x28fbd7[0x0][_0x3e5747(0x281)]('.');if(_0x51dca7[_0x3e5747(0x21c)]===0x1)return{'projectName':_0x51dca7[0x0],'workflowName':undefined};else return _0x51dca7[_0x3e5747(0x21c)]===0x2?{'projectName':_0x51dca7[0x0],'workflowName':_0x51dca7[0x1]}:(console['error'](a41_0x536097[_0x3e5747(0x1bc)](_0x3e5747(0x15c)),_0x3e5747(0x1bb)),null);}return{'projectName':_0xaac454[_0x3e5747(0x247)],'workflowName':undefined};}[a41_0x50f62(0x1ca)](_0x55e156,_0x22e9d2,_0x14b41f=0x0){const _0x51ea29=a41_0x50f62;if(_0x55e156[_0x14b41f])return _0x55e156[_0x14b41f];if(_0x22e9d2[_0x51ea29(0x247)]){const _0x5ce295=a41_0x149b54[_0x51ea29(0x1f5)](process[_0x51ea29(0x15f)](),_0x51ea29(0x27a),_0x22e9d2[_0x51ea29(0x247)]);if(existsSync(a41_0x149b54[_0x51ea29(0x1f5)](_0x5ce295,_0x51ea29(0x167))))return _0x5ce295;}return undefined;}async[a41_0x50f62(0x2a6)](_0x4227ea,_0x375a90,_0x3ed17f){const _0x5d3ac9=a41_0x50f62;try{const _0x44e63b=await _0x4227ea['workflow'][_0x5d3ac9(0x27a)](_0x375a90,{'limit':0x1});if(_0x44e63b[_0x5d3ac9(0x21c)]>0x0){const _0x99df1f=_0x44e63b[0x0]['id'],_0xd3d808=getWorkflowUrl(_0x3ed17f,_0x99df1f);console[_0x5d3ac9(0x1f1)](_0x5d3ac9(0x126)+a41_0x536097[_0x5d3ac9(0x21f)](_0xd3d808));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x177);[a41_0x50f62(0x19c)]=a41_0x50f62(0x22f);async['execute'](_0x34976f){const _0x4986e6=a41_0x50f62,{options:_0xa6c86b,args:_0x1767fb,tdx:_0x337ba4}=_0x34976f,_0x3a66fb=_0x1767fb[0x0],_0x507d30=_0xa6c86b[_0x4986e6(0x143)];if(_0x507d30)return saveSessionContext({'workflow_project':undefined},_0xa6c86b['session']),console[_0x4986e6(0x197)](a41_0x536097[_0x4986e6(0x26c)](_0x4986e6(0x161))),0x0;if(!_0x3a66fb)return console[_0x4986e6(0x1f1)](a41_0x536097[_0x4986e6(0x1bc)](_0x4986e6(0x15c)),_0x4986e6(0x2be)),console['error'](a41_0x536097[_0x4986e6(0x1be)](_0x4986e6(0x26b))),console[_0x4986e6(0x1f1)](a41_0x536097[_0x4986e6(0x1be)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5f306f=await withSpinner('Resolving\x20project\x20\x27'+_0x3a66fb+_0x4986e6(0x123),()=>_0x337ba4[_0x4986e6(0x278)]['resolveProjectId'](_0x3a66fb),{'verbose':_0xa6c86b[_0x4986e6(0x146)]}),{name:_0x392ea6}=_0x5f306f['data'];return saveSessionContext({'workflow_project':_0x392ea6},_0xa6c86b[_0x4986e6(0x1ab)]),console['log'](a41_0x536097['green'](_0x4986e6(0x2c2)+a41_0x536097[_0x4986e6(0x21f)](_0x392ea6))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x174);[a41_0x50f62(0x19c)]=a41_0x50f62(0x277);async[a41_0x50f62(0x22e)](_0x1fc9e5){const _0x3761d7=a41_0x50f62,{options:_0x1feb15,args:_0x393859,tdx:_0x5e9f78}=_0x1fc9e5,_0x10ee48=_0x393859[0x0];_0x1feb15[_0x3761d7(0x146)]&&_0x10ee48&&console[_0x3761d7(0x1f1)]('Pattern:\x20'+_0x10ee48);const _0xcb5ed9=await withSpinner(_0x3761d7(0x11d),()=>_0x5e9f78[_0x3761d7(0x278)]['projects'](_0x10ee48,{'limit':_0x1feb15['limit']}),{'verbose':_0x1feb15[_0x3761d7(0x146)]});let _0x50f8f6=_0xcb5ed9[_0x3761d7(0x217)];_0x50f8f6['sort']((_0x523bdc,_0x29f526)=>_0x523bdc[_0x3761d7(0x1ea)][_0x3761d7(0x1c5)](_0x29f526[_0x3761d7(0x1ea)]));const _0x58dcba=_0x1feb15[_0x3761d7(0x1a9)]||0x64,_0x455223=_0x50f8f6['length']>=_0x58dcba?a41_0x536097['dim'](_0x3761d7(0x241)):'';console[_0x3761d7(0x1f1)](_0x3761d7(0x1ee)+_0x50f8f6[_0x3761d7(0x21c)]+_0x3761d7(0x14b)+(_0x50f8f6['length']!==0x1?'s':'')+_0x455223);if(_0x1feb15['format']===_0x3761d7(0x23c)||_0x1feb15[_0x3761d7(0x125)]===_0x3761d7(0x13c)||_0x1feb15[_0x3761d7(0x125)]===_0x3761d7(0x19b))await handleSDKOutput(_0x50f8f6,_0x1feb15);else{if(_0x50f8f6[_0x3761d7(0x21c)]===0x0)_0x10ee48?console[_0x3761d7(0x197)](_0x3761d7(0x215)+_0x10ee48):console[_0x3761d7(0x197)](_0x3761d7(0x120));else{const _0x5bfa2f=_0x50f8f6[_0x3761d7(0x249)](_0x4e9a1c=>{const _0x1483d6=_0x3761d7,_0x29c258=_0x4e9a1c[_0x1483d6(0x1ed)]?.[_0x1483d6(0x22d)](_0xcc3211=>_0xcc3211[_0x1483d6(0x13d)]===_0x1483d6(0x25a)),_0x4f163e=_0x29c258?a41_0x536097[_0x1483d6(0x1be)](_0x1483d6(0x27b)):'';return _0x1483d6(0x122)+_0x4e9a1c['name']+_0x4f163e;});await writeOutput(_0x5bfa2f[_0x3761d7(0x1f5)]('\x0a'),_0x1feb15[_0x3761d7(0x1d1)],_0x3761d7(0x1a7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]='workflow:workflows';['description']=a41_0x50f62(0x133);async[a41_0x50f62(0x22e)](_0x14dc44){const _0x3445cd=a41_0x50f62,{options:_0x21e28b,args:_0x1af475,tdx:_0x148089}=_0x14dc44,_0x2099af=this['resolveProject'](_0x1af475,_0x21e28b);_0x21e28b[_0x3445cd(0x146)]&&_0x2099af&&console[_0x3445cd(0x1f1)](_0x3445cd(0x13a)+_0x2099af);const _0x164582=await withSpinner(_0x3445cd(0x1db),()=>_0x148089[_0x3445cd(0x278)][_0x3445cd(0x27a)](_0x2099af,{'limit':_0x21e28b['limit']}),{'verbose':_0x21e28b[_0x3445cd(0x146)]});let _0x2afc82=_0x164582[_0x3445cd(0x217)];_0x2afc82['sort']((_0x245025,_0x27bb53)=>{const _0x476a1c=_0x3445cd,_0x4dc89b=_0x245025[_0x476a1c(0x1ea)][_0x476a1c(0x1c5)](_0x27bb53[_0x476a1c(0x1ea)]);if(_0x4dc89b!==0x0)return _0x4dc89b;return(_0x245025[_0x476a1c(0x14f)]?.[_0x476a1c(0x1ea)]||'')[_0x476a1c(0x1c5)](_0x27bb53[_0x476a1c(0x14f)]?.[_0x476a1c(0x1ea)]||'');});const _0x35b514=_0x21e28b[_0x3445cd(0x1a9)]||0x64,_0x49aaef=_0x2afc82[_0x3445cd(0x21c)]>=_0x35b514?a41_0x536097[_0x3445cd(0x1be)](_0x3445cd(0x241)):'';console[_0x3445cd(0x1f1)](_0x3445cd(0x1ee)+_0x2afc82[_0x3445cd(0x21c)]+_0x3445cd(0x156)+(_0x2afc82[_0x3445cd(0x21c)]!==0x1?'s':'')+_0x49aaef);if(_0x21e28b[_0x3445cd(0x125)]==='json'||_0x21e28b[_0x3445cd(0x125)]===_0x3445cd(0x13c)||_0x21e28b[_0x3445cd(0x125)]===_0x3445cd(0x19b))await handleSDKOutput(_0x2afc82,_0x21e28b);else{if(_0x2afc82[_0x3445cd(0x21c)]===0x0)_0x2099af?console[_0x3445cd(0x197)](_0x3445cd(0x248)+_0x2099af):console[_0x3445cd(0x197)](_0x3445cd(0x24e));else{const _0x3d654f=_0x21e28b[_0x3445cd(0x17b)],_0x444fed=_0x2afc82[_0x3445cd(0x249)](_0x5399ca=>{const _0x1297c6=_0x3445cd,_0x4b84ff=a41_0x536097[_0x1297c6(0x1be)]('#'+_0x5399ca['id']),_0x5da45d=hyperlink(_0x4b84ff,getWorkflowUrl(_0x3d654f,_0x5399ca['id'])),_0x5a5380=_0x5399ca[_0x1297c6(0x14f)]?.[_0x1297c6(0x1ea)]?a41_0x536097['dim']('\x20('+_0x5399ca[_0x1297c6(0x14f)][_0x1297c6(0x1ea)]+')'):'';return _0x1297c6(0x2b2)+_0x5da45d+'\x20'+_0x5399ca[_0x1297c6(0x1ea)]+_0x5a5380;});await writeOutput(_0x444fed[_0x3445cd(0x1f5)]('\x0a'),_0x21e28b['output'],_0x3445cd(0x1a7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x163);[a41_0x50f62(0x19c)]=a41_0x50f62(0x227);async[a41_0x50f62(0x22e)](_0x4f4cb3){const _0x522b32=a41_0x50f62,{options:_0x1f1c57,args:_0x279642,tdx:_0x5e2951}=_0x4f4cb3,_0x499bc8=this['parseProjectWorkflowPattern'](_0x279642,_0x1f1c57);if(!_0x499bc8)return 0x1;const {projectName:_0x5ce16a,workflowName:_0x52dbf3}=_0x499bc8;if(_0x1f1c57[_0x522b32(0x146)]){if(_0x5ce16a&&_0x52dbf3)console[_0x522b32(0x1f1)](_0x522b32(0x205)+_0x5ce16a+'.'+_0x52dbf3);else _0x5ce16a&&console['error']('Filter:\x20project='+_0x5ce16a);const _0x118332=_0x1f1c57[_0x522b32(0x1e3)];_0x118332&&console[_0x522b32(0x1f1)](_0x522b32(0x1de)+_0x118332);}let _0x125e70=0x28;if(process[_0x522b32(0x24f)][_0x522b32(0x28f)]&&!_0x1f1c57[_0x522b32(0x1d1)]&&!_0x1f1c57['format']){const _0x41ea4f=process[_0x522b32(0x24f)][_0x522b32(0x1c1)]||0x28;_0x125e70=Math[_0x522b32(0x1f3)](0x14,Math[_0x522b32(0x1a8)](_0x41ea4f*0x2/0x3));}const _0x4bcbb7=_0x1f1c57[_0x522b32(0x1a9)]||_0x125e70,_0x546d06=await withSpinner(_0x522b32(0x257),()=>_0x5e2951[_0x522b32(0x278)][_0x522b32(0x29d)]({'projectName':_0x5ce16a,'workflowName':_0x52dbf3,'status':_0x1f1c57[_0x522b32(0x1e3)],'fromTime':_0x1f1c57[_0x522b32(0x1ac)],'toTime':_0x1f1c57['to'],'limit':_0x4bcbb7}),{'verbose':_0x1f1c57[_0x522b32(0x146)]}),_0x44abcc=_0x546d06[_0x522b32(0x217)];_0x44abcc[_0x522b32(0x1d9)]((_0x43e535,_0x198442)=>{const _0xe0c38a=_0x522b32,_0x2f2068=_0x43e535[_0xe0c38a(0x1c4)]||'',_0x3c4862=_0x198442[_0xe0c38a(0x1c4)]||'';return _0x3c4862['localeCompare'](_0x2f2068);});_0x44abcc[_0x522b32(0x21c)]>=_0x4bcbb7?console['error']('✔\x20Showing\x20'+_0x44abcc[_0x522b32(0x21c)]+'\x20sessions\x20'+a41_0x536097[_0x522b32(0x1be)](_0x522b32(0x148))):console[_0x522b32(0x1f1)](_0x522b32(0x1ee)+_0x44abcc[_0x522b32(0x21c)]+_0x522b32(0x2b1)+(_0x44abcc[_0x522b32(0x21c)]!==0x1?'s':''));if(_0x1f1c57[_0x522b32(0x125)]==='json'||_0x1f1c57['format']===_0x522b32(0x13c)||_0x1f1c57[_0x522b32(0x125)]===_0x522b32(0x19b))await handleSDKOutput(_0x44abcc,_0x1f1c57);else{if(!process['stdout'][_0x522b32(0x28f)]||_0x1f1c57[_0x522b32(0x1d1)]){if(_0x44abcc[_0x522b32(0x21c)]===0x0){if(_0x5ce16a&&_0x52dbf3)console[_0x522b32(0x197)](_0x522b32(0x216)+_0x5ce16a+'.'+_0x52dbf3);else _0x5ce16a?console['log'](_0x522b32(0x14d)+_0x5ce16a):console[_0x522b32(0x197)](_0x522b32(0x28e));}else{const _0xfdd57b=_0x1f1c57[_0x522b32(0x17b)],_0x4a07de=this[_0x522b32(0x28c)](_0x44abcc,_0xfdd57b);_0x1f1c57[_0x522b32(0x1d1)]?await writeOutput(_0x4a07de,_0x1f1c57[_0x522b32(0x1d1)],'list'):console[_0x522b32(0x197)](_0x4a07de);}!_0x5ce16a&&(console['error'](''),console['error'](a41_0x536097[_0x522b32(0x1be)](_0x522b32(0x266))),console[_0x522b32(0x1f1)](a41_0x536097[_0x522b32(0x1be)](_0x522b32(0x1b9))+'or'+a41_0x536097[_0x522b32(0x1be)](_0x522b32(0x231))));}else{if(_0x44abcc[_0x522b32(0x21c)]===0x0){if(_0x5ce16a&&_0x52dbf3)console['log'](_0x522b32(0x216)+_0x5ce16a+'.'+_0x52dbf3);else _0x5ce16a?console[_0x522b32(0x197)](_0x522b32(0x14d)+_0x5ce16a):console['log']('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0x44abcc,_0x4f4cb3,_0x5ce16a);}}return 0x0;}[a41_0x50f62(0x28c)](_0x2d79e8,_0x1cb5f4){const _0x5a774a=a41_0x50f62,_0x21c119=[],_0x69b9e3=new Map();let _0x377c11=Infinity,_0x1483a3=-Infinity;for(const _0x2519ab of _0x2d79e8){if(_0x2519ab['lastAttempt']?.[_0x5a774a(0x271)]){const _0x11ea93=new Date(_0x2519ab[_0x5a774a(0x130)]['createdAt'])[_0x5a774a(0x18b)](),_0x463c71=_0x2519ab['lastAttempt'][_0x5a774a(0x265)]?new Date(_0x2519ab['lastAttempt']['finishedAt'])[_0x5a774a(0x18b)]():Date[_0x5a774a(0x1ba)](),_0x429449=_0x2519ab['project']?.['name']||_0x5a774a(0x191);!_0x69b9e3['has'](_0x429449)&&_0x69b9e3['set'](_0x429449,[]),_0x69b9e3[_0x5a774a(0x184)](_0x429449)['push']({'session':_0x2519ab,'startTime':_0x11ea93,'endTime':_0x463c71,'duration':_0x463c71-_0x11ea93}),_0x377c11=Math[_0x5a774a(0x21a)](_0x377c11,_0x11ea93),_0x1483a3=Math['max'](_0x1483a3,_0x463c71);}}if(_0x69b9e3[_0x5a774a(0x139)]===0x0)return _0x5a774a(0x233);const _0x41ccbf=process[_0x5a774a(0x24f)][_0x5a774a(0x2a3)]||0x78,_0x3908a8=0x1e,_0x4f93e9=0x32,_0x11c887=0x4,_0x116bef=Math['min'](_0x4f93e9,Math['max'](_0x3908a8,Math[_0x5a774a(0x1a8)](_0x41ccbf*0.3))),_0x7e44b3=_0x41ccbf-_0x116bef-TIMELINE_CONFIG[_0x5a774a(0x1e1)]-0x3-_0x11c887,_0x37f072=_0x1483a3-_0x377c11,_0x42eb8f=_0x37f072/_0x116bef,_0x574dbb=renderTimeAxis({'startTime':_0x377c11,'endTime':_0x1483a3,'durationMs':_0x37f072,'msPerChar':_0x42eb8f},_0x116bef),_0x1beb4d=[];for(const _0x10bcb1 of _0x69b9e3[_0x5a774a(0x251)]()){_0x1beb4d[_0x5a774a(0x228)](..._0x10bcb1);}_0x1beb4d['sort']((_0xa5eeb9,_0x1a462e)=>_0x1a462e[_0x5a774a(0x200)]-_0xa5eeb9[_0x5a774a(0x200)]);const _0x1aff79=new Date(_0x377c11),_0x3fef85=formatDate(_0x1aff79),_0x1cd11f=_0x11c887+TIMELINE_CONFIG[_0x5a774a(0x189)]+TIMELINE_CONFIG[_0x5a774a(0x261)]+_0x7e44b3,_0xb43c49='\x20'[_0x5a774a(0x2b5)](_0x1cd11f-_0x3fef85[_0x5a774a(0x21c)]),_0x602b1f=_0xb43c49+a41_0x536097[_0x5a774a(0x1be)](_0x3fef85)+'\x20'+_0x574dbb;_0x21c119[_0x5a774a(0x228)](_0x602b1f);const _0x461694=0x16;let _0x2fe425=0x0;for(const _0x342d49 of _0x1beb4d){const _0x758f5a=_0x342d49[_0x5a774a(0x1ab)][_0x5a774a(0x14f)]?.[_0x5a774a(0x1ea)]||'?',_0x1ac0e8=Math[_0x5a774a(0x21a)](stringWidth(_0x758f5a),_0x461694);_0x2fe425=Math[_0x5a774a(0x1f3)](_0x2fe425,_0x1ac0e8);}for(const _0x3829d5 of _0x1beb4d){const {session:_0x5a55f7,startTime:_0x4fac0d,endTime:_0x578cda,duration:_0x46fe0b}=_0x3829d5,_0x3f8951=_0x5a55f7['project']?.['id'],_0x499cdd=_0x5a55f7['id'],_0x2fc9c9=_0x5a55f7[_0x5a774a(0x14f)]?.[_0x5a774a(0x1ea)]||'?',_0xb45b38=_0x5a55f7[_0x5a774a(0x278)]?.[_0x5a774a(0x1ea)]||'?';let _0x4580a1,_0xeec84d;if(_0x5a55f7[_0x5a774a(0x130)]){const _0x19f517=_0x5a55f7[_0x5a774a(0x130)];!_0x19f517[_0x5a774a(0x27d)]?(_0x4580a1=_0x19f517[_0x5a774a(0x239)]?'🛑':'🔄',_0xeec84d=_0x19f517[_0x5a774a(0x239)]?a41_0x536097['yellow']:a41_0x536097[_0x5a774a(0x222)]):(_0x4580a1=_0x19f517[_0x5a774a(0x285)]?'✅':'❌',_0xeec84d=_0x19f517[_0x5a774a(0x285)]?a41_0x536097[_0x5a774a(0x26c)]:a41_0x536097[_0x5a774a(0x1bc)]);}else _0x4580a1='⏳',_0xeec84d=a41_0x536097[_0x5a774a(0x1be)];const _0x40e014='#'+_0x499cdd,_0x30a2c4=_0x3f8951?hyperlink(_0x40e014,getWorkflowSessionUrl(_0x1cb5f4,_0x3f8951,_0x499cdd)):_0x40e014;let _0x125cac=_0x2fc9c9;stringWidth(_0x2fc9c9)>_0x461694&&(_0x125cac=_0x2fc9c9[_0x5a774a(0x1c3)](0x0,_0x461694-0x1)+'…');const _0x3d03ae=a41_0x536097[_0x5a774a(0x1be)](_0x125cac),_0x227407=stringWidth(_0x125cac),_0x27f06b='\x20'[_0x5a774a(0x2b5)](_0x2fe425-stringWidth(_0x125cac)+0x2),_0x2c85f9='('+formatElapsed(_0x46fe0b)+')',_0x5a277f=stringWidth(_0x2c85f9),_0x216f26=stringWidth(_0x40e014),_0x31d699=_0x216f26+0x1+_0x227407+_0x27f06b['length'],_0x32f490=_0x7e44b3-_0x31d699-_0x5a277f-0x1-0x8;let _0x1b6fd6=_0xb45b38;stringWidth(_0x1b6fd6)>_0x32f490&&(_0x1b6fd6=_0x1b6fd6['slice'](0x0,_0x32f490-0x1)+'…');const _0x24f4a2=_0x30a2c4+'\x20'+_0x3d03ae+_0x27f06b+_0x1b6fd6,_0x10ea38=stringWidth(_0x24f4a2),_0x2c9f3c=_0x7e44b3-_0x10ea38-_0x5a277f,_0x45480b=_0x24f4a2+'\x20'['repeat'](Math['max'](0x1,_0x2c9f3c))+a41_0x536097[_0x5a774a(0x1be)](_0x2c85f9),_0x591c29=Math[_0x5a774a(0x1a8)]((_0x4fac0d-_0x377c11)/_0x42eb8f),_0x808cc7=Math[_0x5a774a(0x1a8)]((_0x578cda-_0x377c11)/_0x42eb8f),_0x2f066b=Math[_0x5a774a(0x1f3)](_0x591c29+0x1,_0x808cc7),_0x5ca245=new Array(_0x116bef)[_0x5a774a(0x2b4)]('\x20');for(let _0x115abb=_0x591c29;_0x115abb<Math[_0x5a774a(0x21a)](_0x2f066b,_0x116bef);_0x115abb++){_0x5ca245[_0x115abb]='─';}const _0x3f0544=_0x5ca245[_0x5a774a(0x249)](_0x2261ed=>_0x2261ed==='\x20'?'\x20':_0xeec84d(_0x2261ed))[_0x5a774a(0x1f5)]('');_0x21c119['push'](_0x4580a1+'\x20'+_0x45480b+'│'+_0x3f0544+'│');}return _0x21c119[_0x5a774a(0x1f5)]('\x0a');}async[a41_0x50f62(0x20e)](_0x429f59,_0x1e84e7,_0x2be95a){const _0x2f40cc=a41_0x50f62,{options:_0x5103ef,tdx:_0x567c66}=_0x1e84e7,_0x28fd11=_0x5103ef[_0x2f40cc(0x17b)],{timelineRows:_0x1d7666,timeAxisHeader:_0x8615d3}=this[_0x2f40cc(0x273)](_0x429f59,_0x28fd11),_0x3d19c7=_0x1d7666['filter'](_0x24655c=>_0x24655c['attemptId']);if(_0x3d19c7[_0x2f40cc(0x21c)]===0x0){const _0x193051=this['renderSessionsTimeline'](_0x429f59,_0x28fd11);console[_0x2f40cc(0x197)](_0x193051);!_0x2be95a&&(console[_0x2f40cc(0x1f1)](''),console[_0x2f40cc(0x1f1)](a41_0x536097['dim'](_0x2f40cc(0x266))),console[_0x2f40cc(0x1f1)](a41_0x536097['dim'](_0x2f40cc(0x1b9))+'or'+a41_0x536097[_0x2f40cc(0x1be)](_0x2f40cc(0x231))));return;}_0x8615d3&&console[_0x2f40cc(0x197)](_0x8615d3);const _0x153e5e=_0x1d7666[_0x2f40cc(0x1c8)](_0x11e4f3=>_0x11e4f3[_0x2f40cc(0x1f2)])[_0x2f40cc(0x249)](_0x51ab62=>({'title':_0x51ab62[_0x2f40cc(0x1ec)],'value':_0x51ab62['attemptId']})),_0x72d5ed=process[_0x2f40cc(0x24f)][_0x2f40cc(0x1c1)]||0x3c,_0x561644=Math[_0x2f40cc(0x1f3)](0x28,Math[_0x2f40cc(0x1a8)](_0x72d5ed*0x2/0x3)),_0x37ba06=await a41_0x3c8366({'type':_0x2f40cc(0x202),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x153e5e,'initial':-0x1,'limit':_0x561644,'clearFirst':!![],'fallback':{'title':_0x2f40cc(0x279),'value':null},'suggest':(_0x319e81,_0x1e2a86)=>{const _0x646bc1=_0x2f40cc;if(!_0x319e81)return Promise[_0x646bc1(0x226)](_0x1e2a86);const _0x56c402=_0x1e2a86[_0x646bc1(0x1c8)](_0xf1da2c=>{const _0xb3d9d0=_0x646bc1,_0x587c04=_0xf1da2c;return _0x587c04[_0xb3d9d0(0x173)][_0xb3d9d0(0x1a2)]()[_0xb3d9d0(0x268)](_0x319e81[_0xb3d9d0(0x1a2)]());});return Promise[_0x646bc1(0x226)](_0x56c402);}}),_0xfa891c=()=>{const _0x47a463=_0x2f40cc;process[_0x47a463(0x24f)][_0x47a463(0x218)](_0x47a463(0x288)),process[_0x47a463(0x24f)][_0x47a463(0x218)](_0x47a463(0x288)),process[_0x47a463(0x24f)][_0x47a463(0x218)](_0x47a463(0x288));},_0x2d0d3c=_0x37ba06&&_0x37ba06[_0x2f40cc(0x1f2)]&&_0x37ba06['attemptId']!==null&&_0x37ba06[_0x2f40cc(0x1f2)][_0x2f40cc(0x2b8)]()!=='';if(!_0x2d0d3c){_0xfa891c(),console[_0x2f40cc(0x197)](a41_0x536097[_0x2f40cc(0x1be)]('Cancelled'));return;}_0xfa891c();const _0x1c72a0=_0x429f59[_0x2f40cc(0x23e)](_0x2e832a=>_0x2e832a[_0x2f40cc(0x130)]?.['id']===_0x37ba06['attemptId']);if(_0x1c72a0){const _0x10c4c9=_0x1c72a0[_0x2f40cc(0x14f)]?.[_0x2f40cc(0x1ea)]||'?',_0x1e7304=_0x1c72a0['workflow']?.[_0x2f40cc(0x1ea)]||'?';console[_0x2f40cc(0x197)](_0x2f40cc(0x199)+a41_0x536097['dim'](_0x10c4c9)+_0x2f40cc(0x1a0)+a41_0x536097[_0x2f40cc(0x1be)](_0x1e7304));}const _0x18ac59=new WorkflowTimelineCommand();await _0x18ac59[_0x2f40cc(0x22e)]({'args':[],'options':{..._0x5103ef,'attemptId':_0x37ba06[_0x2f40cc(0x1f2)]},'tdx':_0x567c66});}[a41_0x50f62(0x273)](_0x561169,_0x42213b){const _0x5b58ac=a41_0x50f62,_0x4e00d6=new Map();for(const _0x654fe4 of _0x561169){_0x654fe4['id']&&_0x654fe4[_0x5b58ac(0x130)]?.['id']&&_0x4e00d6[_0x5b58ac(0x17f)](_0x654fe4['id'],_0x654fe4[_0x5b58ac(0x130)]['id']);}const _0x47d932=[];let _0x8a7dfb='';const _0x599662=this['renderSessionsTimeline'](_0x561169,_0x42213b),_0x2ade24=_0x599662[_0x5b58ac(0x281)]('\x0a');for(const _0x55d19d of _0x2ade24){if(_0x55d19d[_0x5b58ac(0x26f)](_0x5b58ac(0x127))||_0x55d19d[_0x5b58ac(0x255)](/^\s+\d{4}-\d{2}-\d{2}/))_0x8a7dfb=_0x55d19d;else{if(_0x55d19d['match'](/^[✅❌🔄🛑⏳]/)){const _0xbd185b=_0x55d19d['match'](/#(\d+)/),_0x447278=_0xbd185b?_0xbd185b[0x1]:null,_0x1ae040=_0x447278?_0x4e00d6[_0x5b58ac(0x184)](_0x447278)||null:null,_0x17cbbc=_0x561169['find'](_0x9b64a9=>_0x9b64a9['id']===_0x447278),_0x3067e7=_0x17cbbc?.[_0x5b58ac(0x14f)]?.['name']||'';_0x47d932[_0x5b58ac(0x228)]({'displayLine':_0x55d19d,'attemptId':_0x1ae040,'projectName':_0x3067e7});}}}return{'timelineRows':_0x47d932,'timeAxisHeader':_0x8a7dfb};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a41_0x50f62(0x12d);[a41_0x50f62(0x19c)]=a41_0x50f62(0x256);async[a41_0x50f62(0x22e)](_0x50535e){const _0x5a7afa=a41_0x50f62,{options:_0x4df11a,args:_0x37a7fa,tdx:_0x1b57d6}=_0x50535e,_0x507c90=this['parseProjectWorkflowPattern'](_0x37a7fa,_0x4df11a);if(!_0x507c90)return 0x1;const {projectName:_0x31b211,workflowName:_0x4f085b}=_0x507c90,_0x35f13b=_0x4df11a[_0x5a7afa(0x2c5)];if(_0x4df11a[_0x5a7afa(0x146)]){if(_0x31b211&&_0x4f085b)console[_0x5a7afa(0x1f1)]('Filter:\x20'+_0x31b211+'.'+_0x4f085b);else _0x31b211&&console[_0x5a7afa(0x1f1)](_0x5a7afa(0x2bd)+_0x31b211);_0x35f13b&&console[_0x5a7afa(0x1f1)]('Include\x20retried:\x20yes');}const _0x3d5dd2=await withSpinner(_0x5a7afa(0x195),()=>_0x1b57d6[_0x5a7afa(0x278)][_0x5a7afa(0x26e)]({'projectName':_0x31b211,'workflowName':_0x4f085b,'includeRetried':_0x35f13b,'limit':_0x4df11a[_0x5a7afa(0x1a9)]}),{'verbose':_0x4df11a[_0x5a7afa(0x146)]}),_0x51fa2b=_0x3d5dd2['data'],_0x513360=_0x4df11a[_0x5a7afa(0x1a9)]||0x64,_0x2f36b6=_0x51fa2b[_0x5a7afa(0x21c)]>=_0x513360?a41_0x536097[_0x5a7afa(0x1be)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x5a7afa(0x1ee)+_0x51fa2b['length']+_0x5a7afa(0x2bc)+(_0x51fa2b[_0x5a7afa(0x21c)]!==0x1?'s':'')+_0x2f36b6);if(_0x4df11a[_0x5a7afa(0x125)]===_0x5a7afa(0x23c)||_0x4df11a[_0x5a7afa(0x125)]===_0x5a7afa(0x13c)||_0x4df11a['format']===_0x5a7afa(0x19b))await handleSDKOutput(_0x51fa2b,_0x4df11a);else{if(_0x51fa2b[_0x5a7afa(0x21c)]===0x0){if(_0x31b211&&_0x4f085b)console['log'](_0x5a7afa(0x1b2)+_0x31b211+'.'+_0x4f085b);else _0x31b211?console[_0x5a7afa(0x197)]('No\x20attempts\x20found\x20in\x20project:\x20'+_0x31b211):console['log'](_0x5a7afa(0x164));}else{const _0x44e961=_0x4df11a[_0x5a7afa(0x17b)],_0x16ebae=_0x51fa2b[_0x5a7afa(0x249)](_0x3d9a77=>{const _0x11189b=_0x5a7afa,_0x4126c1=a41_0x536097['dim']('#'+_0x3d9a77['id']),_0x435e39=_0x3d9a77[_0x11189b(0x14f)]?.['id'],_0x4eac2c=_0x3d9a77[_0x11189b(0x1e6)]||_0x3d9a77[_0x11189b(0x162)],_0xedbb17=_0x435e39&&_0x4eac2c?hyperlink(_0x4126c1,getWorkflowAttemptUrl(_0x44e961,_0x435e39,_0x4eac2c,_0x3d9a77['id'])):_0x4126c1,{icon:_0x5929c1,text:_0x5be6c1}=getAttemptStatusDisplay(_0x3d9a77),_0xd0962f=(_0x3d9a77[_0x11189b(0x14f)]?.[_0x11189b(0x1ea)]||'?')+'.'+(_0x3d9a77['workflow']?.[_0x11189b(0x1ea)]||'?'),_0xb5e517=_0x3d9a77['sessionTime']?a41_0x536097[_0x11189b(0x1be)](_0x3d9a77[_0x11189b(0x1c4)]):'';return(_0xedbb17+'\x20'+_0x5929c1+(_0x5be6c1?'\x20'+_0x5be6c1:'')+'\x20'+_0xd0962f+'\x20'+_0xb5e517)[_0x11189b(0x2a2)]();});await writeOutput(_0x16ebae[_0x5a7afa(0x1f5)]('\x0a'),_0x4df11a['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a41_0x50f62(0x1ea)]='workflow:attempt';[a41_0x50f62(0x19c)]='Show\x20specific\x20attempt\x20details';async[a41_0x50f62(0x22e)](_0x54548a){const _0x46bfce=a41_0x50f62,{options:_0x4f1af3,args:_0x3b014a,tdx:_0x1557bf}=_0x54548a,_0x159e48=_0x3b014a[0x0];if(!_0x159e48)return console[_0x46bfce(0x1f1)](_0x46bfce(0x141)),0x1;_0x4f1af3[_0x46bfce(0x146)]&&console[_0x46bfce(0x1f1)](_0x46bfce(0x124)+_0x159e48);const _0x2ec538=await withSpinner(_0x46bfce(0x290),()=>_0x1557bf['workflow'][_0x46bfce(0x1d3)](_0x159e48),{'verbose':_0x4f1af3[_0x46bfce(0x146)]}),_0x3c1e77=_0x2ec538[_0x46bfce(0x217)];let _0x2a78b9;!_0x3c1e77[_0x46bfce(0x27d)]?_0x2a78b9=_0x3c1e77[_0x46bfce(0x239)]?_0x46bfce(0x2b3):'running':_0x2a78b9=_0x3c1e77[_0x46bfce(0x285)]?_0x46bfce(0x285):_0x46bfce(0x1f1);let _0x5a0f1d;if(_0x3c1e77[_0x46bfce(0x271)]&&_0x3c1e77[_0x46bfce(0x265)]){const _0x28ecce=new Date(_0x3c1e77['createdAt'])['getTime'](),_0x2f28d1=new Date(_0x3c1e77[_0x46bfce(0x265)])[_0x46bfce(0x18b)]();_0x5a0f1d=Math[_0x46bfce(0x234)]((_0x2f28d1-_0x28ecce)/0x3e8);}const _0x1c28d0={'attempt_id':_0x3c1e77['id'],'status':_0x2a78b9,..._0x3c1e77[_0x46bfce(0x145)]!==undefined&&{'index':_0x3c1e77['index']},..._0x3c1e77[_0x46bfce(0x14f)]&&{'project':_0x3c1e77[_0x46bfce(0x14f)][_0x46bfce(0x1ea)]},..._0x3c1e77[_0x46bfce(0x278)]&&{'workflow':_0x3c1e77[_0x46bfce(0x278)][_0x46bfce(0x1ea)]},..._0x3c1e77['sessionId']&&{'session_id':_0x3c1e77[_0x46bfce(0x162)]},..._0x3c1e77[_0x46bfce(0x1c4)]&&{'session_time':_0x3c1e77[_0x46bfce(0x1c4)]},..._0x3c1e77[_0x46bfce(0x150)]&&{'retry_attempt':_0x3c1e77[_0x46bfce(0x150)]},..._0x5a0f1d!==undefined&&{'duration_sec':_0x5a0f1d},..._0x3c1e77[_0x46bfce(0x271)]&&{'created_at':_0x3c1e77[_0x46bfce(0x271)]},..._0x3c1e77[_0x46bfce(0x265)]&&{'finished_at':_0x3c1e77['finishedAt']},...Object[_0x46bfce(0x132)](_0x3c1e77[_0x46bfce(0x293)])[_0x46bfce(0x21c)]>0x0&&{'params':_0x3c1e77['params']}};return await handleSingleObjectOutput(_0x1c28d0,_0x4f1af3),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x1fb);[a41_0x50f62(0x19c)]='Show\x20tasks\x20for\x20an\x20attempt';async[a41_0x50f62(0x22e)](_0x3ac44d){const _0x4b5711=a41_0x50f62,{options:_0x2254c1,args:_0x5a6232,tdx:_0x1fdd67}=_0x3ac44d,_0x153204=_0x5a6232[0x0];if(!_0x153204)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x547a81=_0x2254c1[_0x4b5711(0x2a1)];_0x2254c1[_0x4b5711(0x146)]&&(console['error'](_0x4b5711(0x124)+_0x153204),_0x547a81&&console[_0x4b5711(0x1f1)](_0x4b5711(0x23d)));const _0x3c0b9d=await withSpinner(_0x4b5711(0x25e),()=>_0x1fdd67[_0x4b5711(0x278)][_0x4b5711(0x1b5)](_0x153204,_0x547a81||![]),{'verbose':_0x2254c1[_0x4b5711(0x146)]}),_0x2c7ac6=_0x3c0b9d[_0x4b5711(0x217)];return console[_0x4b5711(0x1f1)](_0x4b5711(0x1ee)+_0x2c7ac6[_0x4b5711(0x21c)]+'\x20task'+(_0x2c7ac6[_0x4b5711(0x21c)]!==0x1?'s':'')),await handleSDKOutput(_0x2c7ac6,_0x2254c1),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a41_0x50f62(0x198);[a41_0x50f62(0x19c)]=a41_0x50f62(0x17c);async[a41_0x50f62(0x22e)](_0x4c4dbb){const _0x9954ef=a41_0x50f62,{options:_0x760203,args:_0x23462e,tdx:_0x39e277}=_0x4c4dbb,_0x330034=_0x23462e[0x0];let _0x34ec4e=_0x23462e[0x1];if(!_0x330034)return console[_0x9954ef(0x1f1)](_0x9954ef(0x141)),0x1;_0x760203[_0x9954ef(0x146)]&&(console[_0x9954ef(0x1f1)](_0x9954ef(0x124)+_0x330034),_0x34ec4e&&console[_0x9954ef(0x1f1)](_0x9954ef(0x204)+_0x34ec4e));const _0x46bd87=await withSpinner(_0x9954ef(0x262),()=>_0x39e277[_0x9954ef(0x278)][_0x9954ef(0x212)](_0x330034,_0x34ec4e),{'verbose':_0x760203[_0x9954ef(0x146)]}),_0x2988b8=_0x46bd87['data'];if(_0x2988b8[_0x9954ef(0x21c)]===0x0)return console[_0x9954ef(0x1f1)](_0x9954ef(0x214)),0x0;if(!_0x34ec4e&&(_0x760203['json']||_0x760203['format']))return await handleSDKOutput(_0x2988b8,_0x760203),0x0;if(!_0x34ec4e){const _0x1f7392=_0x2988b8[_0x9954ef(0x249)](_0x35091f=>({'title':_0x35091f['taskName']+'\x20('+formatBytes(_0x35091f[_0x9954ef(0x28a)])+')','value':_0x35091f['taskName']})),_0x64e221=await a41_0x3c8366({'type':'select','name':'task','message':_0x9954ef(0x15a),'choices':_0x1f7392});if(!_0x64e221[_0x9954ef(0x128)])return console['error'](_0x9954ef(0x240)),0x0;_0x34ec4e=_0x64e221[_0x9954ef(0x128)];}const _0x3700bd=await withSpinner(_0x9954ef(0x26d),()=>_0x39e277[_0x9954ef(0x278)][_0x9954ef(0x221)](_0x330034,_0x34ec4e),{'verbose':_0x760203[_0x9954ef(0x146)]}),_0x427696=_0x3700bd[_0x9954ef(0x217)];return _0x427696?console[_0x9954ef(0x197)](_0x427696):console[_0x9954ef(0x1f1)](_0x9954ef(0x17e)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x50f62(0x1ea)]='workflow:kill';['description']='Kill\x20a\x20running\x20attempt';async['execute'](_0x1a15d9){const _0x145c24=a41_0x50f62,{options:_0x2fa942,args:_0x179262,tdx:_0x4b5ac6}=_0x1a15d9,_0x7ea9c9=_0x179262[0x0];if(!_0x7ea9c9)return console[_0x145c24(0x1f1)](_0x145c24(0x141)),0x1;const _0x29e59c=_0x2fa942['reason'];_0x2fa942[_0x145c24(0x146)]&&(console[_0x145c24(0x1f1)]('Attempt\x20ID:\x20'+_0x7ea9c9),_0x29e59c&&console[_0x145c24(0x1f1)](_0x145c24(0x284)+_0x29e59c));if(!_0x2fa942[_0x145c24(0x1dc)]){const _0x371b48=await confirmKey(_0x145c24(0x20c)+_0x7ea9c9+'?');if(!_0x371b48)return console[_0x145c24(0x1f1)](_0x145c24(0x240)),0x0;}const _0xffe865=await withSpinner('Killing\x20attempt...',()=>_0x4b5ac6[_0x145c24(0x278)][_0x145c24(0x1ce)](_0x7ea9c9,_0x29e59c),{'verbose':_0x2fa942[_0x145c24(0x146)]}),_0x2dfb1d=_0xffe865[_0x145c24(0x217)];return console[_0x145c24(0x1f1)]('✔\x20'+_0x2dfb1d),0x0;}}function a41_0x138c(){const _0x493891=['sort','replace','Listing\x20workflows...','yes','Revision:\x20','Status:\x20','revision:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','GUTTER','\x20of\x20','status','workflow:secrets:list','force','session_id','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','toISOString','requireProject','name','dryRun','displayLine','metadata','✔\x20Found\x20','MAX_TASKS_DISPLAY','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','error','attemptId','max','stringify','join','Key:\x20','\x20\x20Project\x20ID:\x20','\x20-\x20','executeCloneProject','duration','workflow:tasks','/sessions/','white','✔\x20Pushed\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','startTime','Error:\x20Secret\x20key\x20is\x20required','autocomplete','608404fKMHGs','Task\x20name:\x20','Filter:\x20','/app/workflows/','listSecrets','424035orEuti','workflowName','workflow:run','unknown','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Session\x20not\x20found:\x20','navigateSessionsInteractive','\x27\x20from\x20project\x20\x27','param','Error:\x20Invalid\x20JSON\x20in\x20--params','logFiles','projectName','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20projects\x20match\x20pattern:\x20','No\x20sessions\x20found\x20for:\x20','data','write','Validation:\x20skipped','min','4088896wPhXRt','length','unchanged','projectId','cyan','context','logs','blue','Parameters:\x20','workflow:pull','newProjectName','resolve','List\x20workflow\x20execution\x20sessions','push','workflow:timeline','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','hasChanges','MAX_POLL_ITERATIONS','some','execute','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Downloading\x20project\x20','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20Location:\x20','No\x20sessions\x20with\x20timing\x20information','round','New\x20project\x20name:\x20','pending','every','isArray','cancelRequested','getMinutes','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','json','Including\x20subtasks:\x20yes','find','✔\x20Deleted\x20project\x20','Cancelled','\x20(use\x20--limit\x20to\x20show\x20more)','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','MAX_TIMELINE_WIDTH','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Failed\x20to\x20fetch\x20attempt\x20data','workflowProject','No\x20workflows\x20found\x20in\x20project:\x20','map','1706049YqdlDj','Force:\x20yes','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','run','No\x20workflows\x20found','stdout','message','values','select','Tip:\x20cd\x20to\x20workflows/','\x0aDry\x20run\x20-\x20no\x20project\x20created','match','List\x20workflow\x20attempts','Listing\x20workflow\x20sessions...','✔\x20Clone\x20complete','workflow:download','sys','renderSingleTimeline','sourceDir','padStart','Getting\x20attempt\x20tasks...','\x0aDry\x20run\x20-\x20nothing\x20pushed','preparePushProject','ICON_SPACING','Fetching\x20log\x20files...','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Auto-selected\x20latest\x20session:\x20','finishedAt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','TASK_NAME_WIDTH','includes','Latest\x20session\x20has\x20no\x20attempt','skipValidation','Usage:\x20tdx\x20wf\x20use\x20<project>','green','Downloading\x20logs...','attempts','startsWith','deleteSecret','createdAt','\x0aClone\x20\x22','generateSessionTimelineRows','type','✔\x20Downloaded\x20','renderTimeline','List\x20all\x20workflow\x20projects','workflow','No\x20matching\x20sessions\x20found','workflows','\x20(system)','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','done','tdx\x20wf\x20attempt\x20','sourceProjectName','all','split','revision','deleted','Reason:\x20','success','isNewProject','Select\x20a\x20session\x20to\x20view\x20timeline:','\x1b[1A\x1b[2K','substring','fileSize','Source\x20directory:\x20','renderSessionsTimeline','path','No\x20sessions\x20found','isTTY','Getting\x20attempt\x20details...','No\x20workflow\x20tdx.json\x20found','From\x20task:\x20','params','Project\x20directory:\x20','\x0a⚠\x20Project\x20\x22','\x20\x20New\x20attempt\x20ID:\x20','\x20secret','Output\x20directory:\x20','Workflow:\x20','Deleting\x20project\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x20\x20Session\x20ID:\x20','sessions','\x0aDry\x20run\x20-\x20no\x20files\x20written','workflow:delete','20645288kNmoKN','includeSubtasks','trimEnd','columns','basename','attempt:','showWorkflowConsoleUrl','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','start','Loading\x20workflows...','workflow:upload','Select\x20a\x20workflow\x20to\x20run','Session\x20','delete','new','pullProject','10502VwLUHg','\x20session','📋\x20','canceling','fill','repeat','startedAt','\x20\x20Session\x20context\x20set\x20to:\x20','trim','targetExists','\x22?\x20This\x20cannot\x20be\x20undone.','stat','\x20attempt','Filter:\x20project=','Project\x20name\x20is\x20required','\x0a✔\x20No\x20changes\x20to\x20push','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','getMonth','✔\x20Workflow\x20project\x20set\x20to:\x20','---\x20','download','includeRetried','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Listing\x20workflow\x20projects...','fullName','⚠\x20Showing\x20first\x20','No\x20workflow\x20projects\x20found','No\x20workflow\x20sessions\x20found','📁\x20','\x27...','Attempt\x20ID:\x20','format','\x20\x20Console:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','task','Project\x20name:\x20','follow','\x20deleted','POLL_INTERVAL_MS','workflow:attempts','✔\x20Project:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','lastAttempt','filesExtracted','keys','List\x20workflows','\x0aPush\x20these\x20changes?','\x20logs','Error:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','Attempt:\x20','size','Project\x20filter:\x20','summary','jsonl','key','Error:\x20Invalid\x20parameter\x20format:\x20','yellow','\x20\x20Target:\x20','Error:\x20Attempt\x20ID\x20is\x20required','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','clear','value','index','verbose','\x20\x20Changes:\x20','(use\x20--limit\x20to\x20see\x20more)','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20project','end','No\x20sessions\x20found\x20in\x20project:\x20','msPerChar','project','retryAttemptName','getDate','diff','Loading\x20sessions...','Listing\x20secrets...','workflow:push','\x20workflow','Expected\x20format:\x20--param\x20key=value','Target:\x20','131IYTLSQ','Select\x20a\x20task\x20to\x20view\x20logs:','total','Error:','splice','✔\x20Workflow\x20run\x20started','cwd','session:','✔\x20Workflow\x20project\x20context\x20cleared.','sessionId','workflow:sessions','No\x20attempts\x20found','Writing\x20files...','window','tdx.json','\x20tasks','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','running','planned','\x20\x20Workflow:\x20','Starting\x20workflow\x20run...','parseProjectWorkflowPattern','LABEL_WIDTH_DIVISOR','Analyzing\x20changes...','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','title','workflow:projects','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','state','workflow:use','workflow:secrets:delete','Pushing\x20project...','\x20\x20Revision:\x20','site','Show\x20logs\x20for\x20a\x20workflow\x20attempt','fileCount','No\x20log\x20content\x20found','set','\x20\x20Source:\x20','...','\x20has\x20no\x20attempts','indexOf','get','applyPullProject','Loading\x20session...','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','ICON_WIDTH','Usage:\x20workflow:delete\x20<project-name-or-id>','getTime','Dry\x20run:\x20yes','\x20unchanged','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','prepareCloneProject','\x20\x20Project:\x20','(unknown)','newProjectId','parse','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Listing\x20workflow\x20attempts...','updatedAt','log','workflow:logs','Project:\x20','\x20is\x20not\x20a\x20directory','table','description','resolveProject','Setting\x20secret...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22',',\x20Workflow:\x20','targetDir','toLowerCase','retrySession','Files\x20to\x20upload:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','554484sxHDVt','list','floor','limit','.\x20Expected\x20format:\x20KEY=VALUE','session','from','Error:\x20KEY=VALUE\x20is\x20required','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','relative','Source:\x20','workflow:retry','No\x20attempts\x20found\x20for:\x20','Warning:','\x20to\x20see\x20detailed\x20logs','tasks','Error:\x20Project\x20name\x20is\x20required','MIN_TIMELINE_WIDTH','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','now','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','red','Retrying\x20session...','dim','Invalid\x20format:\x20','existingProjectId','rows','Cloning\x20to\x20','slice','sessionTime','localeCompare','modified','🔄\x20','filter','Retry\x20a\x20session\x20or\x20attempt','resolveProjectDir','\x20modified','pollTimeline','executePushProject','kill','Resume\x20from:\x20','MIN_LABEL_COUNT','output','getHours','attempt','fs/promises','Source\x20directory\x20is\x20required','/attempt/','\x0aFailed\x20to\x20fetch\x20attempt\x20data','LABEL_MIN_SPACING'];a41_0x138c=function(){return _0x493891;};return a41_0x138c();}export class WorkflowRetryCommand extends BaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x1b1);[a41_0x50f62(0x19c)]=a41_0x50f62(0x1c9);async['execute'](_0x5ea305){const _0x58b3ec=a41_0x50f62,{options:_0x2ca53f,args:_0x3409bf,tdx:_0x5c9bf5}=_0x5ea305,_0x324bca=_0x3409bf[0x0];if(!_0x324bca)return console[_0x58b3ec(0x1f1)](_0x58b3ec(0x137)),console['error'](_0x58b3ec(0x2c0)),0x1;let _0x3cbf03=![],_0x342baa=_0x324bca;if(_0x324bca[_0x58b3ec(0x26f)](_0x58b3ec(0x160)))_0x3cbf03=!![],_0x342baa=_0x324bca[_0x58b3ec(0x289)](0x8);else{if(_0x324bca['startsWith'](_0x58b3ec(0x2a5)))_0x3cbf03=![],_0x342baa=_0x324bca[_0x58b3ec(0x289)](0x8);else return console['error'](_0x58b3ec(0x1ff)),console['error'](_0x58b3ec(0x2c0)),0x1;}const _0x916d77=_0x2ca53f['fromTask'],_0x585eb9=_0x2ca53f['resumeFrom'],_0xb66123=_0x2ca53f['params'],_0x408ae5=_0x2ca53f[_0x58b3ec(0x1e5)];_0x2ca53f['verbose']&&(console[_0x58b3ec(0x1f1)](_0x58b3ec(0x158)+(_0x3cbf03?'session':_0x58b3ec(0x1d3))+'\x20'+_0x342baa),_0x916d77&&console[_0x58b3ec(0x1f1)](_0x58b3ec(0x292)+_0x916d77),_0x585eb9&&console[_0x58b3ec(0x1f1)](_0x58b3ec(0x1cf)+_0x585eb9),_0xb66123&&console[_0x58b3ec(0x1f1)]('Params:\x20'+_0xb66123),_0x408ae5&&console['error'](_0x58b3ec(0x24b)));let _0x566e8b;if(_0xb66123)try{if(_0xb66123[_0x58b3ec(0x26f)]('@')){const _0x47cfa9=await import(_0x58b3ec(0x1d4)),_0x395a01=_0xb66123[_0x58b3ec(0x289)](0x1),_0x8a7f04=await _0x47cfa9['readFile'](_0x395a01,'utf-8');_0x566e8b=JSON[_0x58b3ec(0x193)](_0x8a7f04);}else _0x566e8b=JSON[_0x58b3ec(0x193)](_0xb66123);}catch{return console[_0x58b3ec(0x1f1)](_0x58b3ec(0x211)),0x1;}if(!_0x2ca53f[_0x58b3ec(0x1dc)]){const _0x248848=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x3cbf03?'session':_0x58b3ec(0x1d3))+'\x20'+_0x342baa+'?');if(!_0x248848)return console[_0x58b3ec(0x1f1)](_0x58b3ec(0x240)),0x0;}let _0x2529e2;_0x3cbf03?_0x2529e2=await withSpinner(_0x58b3ec(0x1bd),()=>_0x5c9bf5[_0x58b3ec(0x278)][_0x58b3ec(0x1a3)](_0x342baa,{'fromTask':_0x916d77,'retryParams':_0x566e8b}),{'verbose':_0x2ca53f[_0x58b3ec(0x146)]}):_0x2529e2=await withSpinner('Retrying\x20attempt...',()=>_0x5c9bf5['workflow']['retryAttempt'](_0x342baa,{'resumeFrom':_0x585eb9,'retryParams':_0x566e8b,'force':_0x408ae5}),{'verbose':_0x2ca53f[_0x58b3ec(0x146)]});const _0x1f8c0e=_0x2529e2['data'];return console['error']('✔\x20Retry\x20started'),console[_0x58b3ec(0x1f1)](_0x58b3ec(0x296)+_0x1f8c0e[_0x58b3ec(0x1f2)]),console['error'](_0x58b3ec(0x29c)+_0x1f8c0e[_0x58b3ec(0x162)]),0x0;}}function a41_0x5857(_0x338ce0,_0x1b69c9){_0x338ce0=_0x338ce0-0x11d;const _0x138cbf=a41_0x138c();let _0x585720=_0x138cbf[_0x338ce0];return _0x585720;}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a41_0x50f62(0x20a);[a41_0x50f62(0x19c)]='Start\x20a\x20workflow\x20run';async[a41_0x50f62(0x22e)](_0x5760e6){const _0x4f6310=a41_0x50f62,{options:_0x4dfd6a,args:_0x1bf49a,tdx:_0x1151ed}=_0x5760e6;let _0x5ab962=_0x1bf49a[0x0];if(!_0x5ab962){const _0x332d77=this['resolveProject']([],_0x4dfd6a),_0x8ee7f8=await withSpinner(_0x4f6310(0x2a9),()=>_0x1151ed[_0x4f6310(0x278)][_0x4f6310(0x27a)](_0x332d77,{'limit':_0x4dfd6a[_0x4f6310(0x1a9)]}),{'verbose':_0x4dfd6a[_0x4f6310(0x146)]}),_0xfa834b=_0x8ee7f8[_0x4f6310(0x217)];if(_0xfa834b[_0x4f6310(0x21c)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x332d77&&console[_0x4f6310(0x1f1)](a41_0x536097[_0x4f6310(0x1be)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x410225=_0xfa834b[_0x4f6310(0x249)](_0x41565e=>({'title':_0x41565e[_0x4f6310(0x14f)]?.[_0x4f6310(0x1ea)]+'.'+_0x41565e['name'],'value':_0x41565e[_0x4f6310(0x14f)]?.['name']+'.'+_0x41565e[_0x4f6310(0x1ea)],'description':_0x41565e['revision']?_0x4f6310(0x1df)+_0x41565e['revision']:undefined})),_0x4985af=await a41_0x3c8366({'type':_0x4f6310(0x252),'name':_0x4f6310(0x278),'message':_0x4f6310(0x2ab),'choices':_0x410225});if(!_0x4985af[_0x4f6310(0x278)])return 0x1;_0x5ab962=_0x4985af[_0x4f6310(0x278)];}if(!_0x5ab962[_0x4f6310(0x268)]('.')){const _0x1b97c1=this['resolveProject']([],_0x4dfd6a);if(_0x1b97c1)_0x5ab962=_0x1b97c1+'.'+_0x5ab962;else return console[_0x4f6310(0x1f1)](a41_0x536097[_0x4f6310(0x1bc)]('Error:'),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x4f6310(0x1f1)](a41_0x536097['dim'](_0x4f6310(0x18e))),0x1;}const _0x37b644=_0x4dfd6a[_0x4f6310(0x210)],_0x43ae3c=_0x4dfd6a[_0x4f6310(0x1c4)],_0xaf162b={};if(_0x37b644&&Array[_0x4f6310(0x238)](_0x37b644))for(const _0x43af71 of _0x37b644){const _0x243c22=_0x43af71[_0x4f6310(0x183)]('=');if(_0x243c22===-0x1)return console[_0x4f6310(0x1f1)](_0x4f6310(0x13e)+_0x43af71),console['error'](_0x4f6310(0x157)),0x1;const _0x906cb3=_0x43af71[_0x4f6310(0x289)](0x0,_0x243c22),_0x4926ce=_0x43af71[_0x4f6310(0x289)](_0x243c22+0x1);try{_0xaf162b[_0x906cb3]=JSON['parse'](_0x4926ce);}catch{_0xaf162b[_0x906cb3]=_0x4926ce;}}_0x4dfd6a[_0x4f6310(0x146)]&&(console[_0x4f6310(0x1f1)](_0x4f6310(0x299)+_0x5ab962),Object[_0x4f6310(0x132)](_0xaf162b)['length']>0x0&&console[_0x4f6310(0x1f1)](_0x4f6310(0x223)+JSON[_0x4f6310(0x1f4)](_0xaf162b)),_0x43ae3c&&console[_0x4f6310(0x1f1)]('Session\x20time:\x20'+_0x43ae3c));const _0x5efa38=await withSpinner(_0x4f6310(0x16e),()=>_0x1151ed[_0x4f6310(0x278)][_0x4f6310(0x24d)](_0x5ab962,_0xaf162b,{'sessionTime':_0x43ae3c}),{'verbose':_0x4dfd6a[_0x4f6310(0x146)]}),_0x3e8c0b=_0x5efa38[_0x4f6310(0x217)];console['error'](_0x4f6310(0x15e)),console[_0x4f6310(0x1f1)]('\x20\x20Attempt\x20ID:\x20'+_0x3e8c0b['id']),console[_0x4f6310(0x1f1)]('\x20\x20Session\x20ID:\x20'+_0x3e8c0b['sessionId']),console[_0x4f6310(0x1f1)](_0x4f6310(0x190)+_0x3e8c0b[_0x4f6310(0x14f)]?.[_0x4f6310(0x1ea)]),console[_0x4f6310(0x1f1)](_0x4f6310(0x16d)+_0x3e8c0b[_0x4f6310(0x278)]?.[_0x4f6310(0x1ea)]);if(_0x3e8c0b[_0x4f6310(0x14f)]?.['id']&&_0x3e8c0b[_0x4f6310(0x162)]&&_0x3e8c0b['id']){const _0x21feba=_0x4dfd6a[_0x4f6310(0x17b)],_0x18225e=getConsoleUrl(_0x21feba,_0x4f6310(0x206)+_0x3e8c0b['project']['id']+_0x4f6310(0x1fc)+_0x3e8c0b[_0x4f6310(0x162)]+_0x4f6310(0x1d6)+_0x3e8c0b['id']);console[_0x4f6310(0x1f1)]('\x20\x20Console:\x20'+a41_0x536097['cyan'](_0x18225e));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x259);[a41_0x50f62(0x19c)]=a41_0x50f62(0x1a5);async[a41_0x50f62(0x22e)](_0x27c8cb){const _0x243d16=a41_0x50f62,{options:_0x4e5103,args:_0x27f04d,tdx:_0x18e367}=_0x27c8cb,_0x48bf9a=_0x27f04d[0x0],_0x182a4d=_0x27f04d[0x1]||'.';if(!_0x48bf9a)return console[_0x243d16(0x1f1)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x243d16(0x1f1)](_0x243d16(0x243)),0x1;const _0x37fb0b=_0x4e5103['revision'];_0x4e5103['verbose']&&(console[_0x243d16(0x1f1)](_0x243d16(0x199)+_0x48bf9a),console[_0x243d16(0x1f1)](_0x243d16(0x298)+_0x182a4d),_0x37fb0b&&console['error'](_0x243d16(0x1dd)+_0x37fb0b));const _0x1239a2=await withSpinner(_0x243d16(0x230)+_0x48bf9a+_0x243d16(0x181),()=>_0x18e367['workflow'][_0x243d16(0x2c4)](_0x48bf9a,_0x182a4d,{'revision':_0x37fb0b}),{'verbose':_0x4e5103[_0x243d16(0x146)]}),_0x1b4249=_0x1239a2[_0x243d16(0x217)];return console[_0x243d16(0x1f1)](_0x243d16(0x275)+_0x1b4249['projectName']),console[_0x243d16(0x1f1)](_0x243d16(0x17a)+_0x1b4249[_0x243d16(0x282)]),console[_0x243d16(0x1f1)]('\x20\x20Files\x20extracted:\x20'+_0x1b4249[_0x243d16(0x131)]),console['error'](_0x243d16(0x232)+_0x182a4d+'/'+_0x1b4249[_0x243d16(0x213)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x2aa);[a41_0x50f62(0x19c)]=a41_0x50f62(0x1e7);async['execute'](_0x1acc82){const _0x2885bb=a41_0x50f62,{options:_0x396d04,args:_0x35c068,tdx:_0xde735c}=_0x1acc82;let _0x4f4d3a='.',_0x376a6e=_0x396d04[_0x2885bb(0x1ea)];if(_0x35c068[0x0]){const {promises:_0x81ca54}=await import('fs');try{const _0x5a0bda=await _0x81ca54[_0x2885bb(0x2bb)](_0x35c068[0x0]);if(_0x5a0bda['isDirectory']())_0x4f4d3a=_0x35c068[0x0];else return console[_0x2885bb(0x1f1)](_0x2885bb(0x136)+_0x35c068[0x0]+_0x2885bb(0x19a)),0x1;}catch{_0x376a6e=_0x35c068[0x0],_0x4f4d3a='.';}}const _0x49dc84=_0x396d04[_0x2885bb(0x282)],_0x1addee=_0x396d04[_0x2885bb(0x26a)];_0x396d04['verbose']&&(console[_0x2885bb(0x1f1)](_0x2885bb(0x294)+_0x4f4d3a),_0x376a6e&&console[_0x2885bb(0x1f1)](_0x2885bb(0x129)+_0x376a6e),_0x49dc84&&console[_0x2885bb(0x1f1)](_0x2885bb(0x1dd)+_0x49dc84),_0x1addee&&console['error']('Validation:\x20skipped'));const _0x2ce49c=await withSpinner('Pushing\x20workflow\x20project...',()=>_0xde735c[_0x2885bb(0x278)][_0x2885bb(0x228)](_0x4f4d3a,{'projectName':_0x376a6e,'revision':_0x49dc84,'skipValidation':_0x1addee}),{'verbose':_0x396d04['verbose']}),_0x595446=_0x2ce49c['data'];return console[_0x2885bb(0x1f1)](_0x2885bb(0x1fe)+_0x595446['projectName']),console[_0x2885bb(0x1f1)](_0x2885bb(0x1f7)+_0x595446[_0x2885bb(0x21e)]),console[_0x2885bb(0x1f1)](_0x2885bb(0x17a)+_0x595446['revision']),await this[_0x2885bb(0x2a6)](_0xde735c,_0x595446[_0x2885bb(0x213)],_0x396d04['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a41_0x50f62(0x224);['description']=a41_0x50f62(0x12f);async[a41_0x50f62(0x22e)](_0x46b8a5){const _0x57879f=a41_0x50f62,{options:_0x3c9f52,args:_0x2c11f1,tdx:_0x443ef8}=_0x46b8a5,_0x33dce8=_0x2c11f1[0x0],_0x1b8ca7=_0x2c11f1[0x1];if(!_0x33dce8)return console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x1bc)](_0x57879f(0x15c)),_0x57879f(0x2be)),console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x1be)](_0x57879f(0x1b8))),0x1;const _0x53c05f=_0x3c9f52[_0x57879f(0x282)];_0x3c9f52['verbose']&&(console[_0x57879f(0x1f1)](_0x57879f(0x199)+_0x33dce8),_0x1b8ca7&&console[_0x57879f(0x1f1)]('Target\x20directory:\x20'+_0x1b8ca7),_0x53c05f&&console['error'](_0x57879f(0x1dd)+_0x53c05f),_0x3c9f52[_0x57879f(0x1eb)]&&console[_0x57879f(0x1f1)]('Dry\x20run:\x20yes'));const _0x3b0396=await withSpinner('Pulling\x20project\x20'+_0x33dce8+'...',()=>_0x443ef8[_0x57879f(0x278)][_0x57879f(0x2af)](_0x33dce8,{'targetDir':_0x1b8ca7,'revision':_0x53c05f}),{'verbose':_0x3c9f52[_0x57879f(0x146)]}),_0x82cf71=_0x3b0396['data'];_0x82cf71[_0x57879f(0x286)]?console[_0x57879f(0x1f1)]('✔\x20New\x20project:\x20'+_0x82cf71[_0x57879f(0x213)]):console[_0x57879f(0x1f1)](_0x57879f(0x12e)+_0x82cf71['projectName']);console['error'](_0x57879f(0x17a)+_0x82cf71[_0x57879f(0x282)]),console['error'](_0x57879f(0x140)+(a41_0x149b54[_0x57879f(0x1af)](process[_0x57879f(0x15f)](),_0x82cf71['targetDir'])||'.')),console[_0x57879f(0x1f1)](_0x57879f(0x147)+a41_0x536097[_0x57879f(0x26c)]('+'+_0x82cf71[_0x57879f(0x13b)][_0x57879f(0x2ae)]+'\x20new')+',\x20'+(a41_0x536097[_0x57879f(0x13f)]('~'+_0x82cf71['summary'][_0x57879f(0x1c6)]+_0x57879f(0x1cb))+',\x20')+(a41_0x536097[_0x57879f(0x1bc)]('-'+_0x82cf71[_0x57879f(0x13b)][_0x57879f(0x283)]+_0x57879f(0x12b))+',\x20')+(''+a41_0x536097[_0x57879f(0x1be)](_0x82cf71['summary'][_0x57879f(0x21d)]+_0x57879f(0x18d))));for(const _0x31e57 of _0x82cf71['changes']){_0x31e57[_0x57879f(0x274)]==='modified'&&_0x31e57[_0x57879f(0x152)]&&(console[_0x57879f(0x1f1)]('\x0a'+a41_0x536097[_0x57879f(0x21f)](_0x57879f(0x2c3)+_0x31e57[_0x57879f(0x28d)])),console[_0x57879f(0x1f1)](_0x31e57[_0x57879f(0x152)]));}if(!_0x82cf71[_0x57879f(0x22b)])return saveSessionContext({'workflow_project':_0x82cf71[_0x57879f(0x213)]},_0x3c9f52['session']),console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x26c)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x1be)](_0x57879f(0x2b7)+_0x82cf71[_0x57879f(0x213)])),0x0;if(_0x3c9f52[_0x57879f(0x1eb)])return console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x13f)](_0x57879f(0x29e))),0x0;if(!_0x3c9f52['yes']){const _0x4719ff=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x4719ff)return console[_0x57879f(0x1f1)](_0x57879f(0x240)),0x0;}await withSpinner(_0x57879f(0x165),()=>_0x443ef8['workflow'][_0x57879f(0x185)](_0x82cf71,{'revision':_0x53c05f}),{'verbose':_0x3c9f52[_0x57879f(0x146)]}),saveSessionContext({'workflow_project':_0x82cf71[_0x57879f(0x213)]},_0x3c9f52[_0x57879f(0x1ab)]),console['error'](a41_0x536097['green']('✔\x20Pull\x20complete'));const _0x39d435=a41_0x149b54[_0x57879f(0x1af)](process[_0x57879f(0x15f)](),_0x82cf71[_0x57879f(0x1a1)])||'.';return console[_0x57879f(0x1f1)](a41_0x536097[_0x57879f(0x1be)](_0x57879f(0x232)+_0x39d435)),console['error'](a41_0x536097[_0x57879f(0x1be)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x82cf71[_0x57879f(0x213)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x155);[a41_0x50f62(0x19c)]=a41_0x50f62(0x23b);async[a41_0x50f62(0x22e)](_0x313509){const _0x4aa578=a41_0x50f62,{options:_0x3b6d0d,args:_0x1ea53d,tdx:_0x5b2391}=_0x313509,_0x1e0619=this['resolveProjectDir'](_0x1ea53d,_0x3b6d0d),_0x3acd4b=_0x3b6d0d[_0x4aa578(0x282)],_0x1e09a2=_0x3b6d0d['skipValidation'];_0x3b6d0d[_0x4aa578(0x146)]&&(_0x1e0619&&console[_0x4aa578(0x1f1)](_0x4aa578(0x28b)+_0x1e0619),_0x3acd4b&&console[_0x4aa578(0x1f1)](_0x4aa578(0x1dd)+_0x3acd4b),_0x3b6d0d[_0x4aa578(0x1eb)]&&console[_0x4aa578(0x1f1)]('Dry\x20run:\x20yes'),_0x1e09a2&&console[_0x4aa578(0x1f1)](_0x4aa578(0x219)));let _0xa69c61;try{_0xa69c61=await withSpinner(_0x4aa578(0x171),()=>_0x5b2391[_0x4aa578(0x278)][_0x4aa578(0x260)]({'sourceDir':_0x1e0619,'revision':_0x3acd4b,'skipValidation':_0x1e09a2}),{'verbose':_0x3b6d0d[_0x4aa578(0x146)]});}catch(_0x13bf0f){if(_0x13bf0f instanceof Error&&_0x13bf0f[_0x4aa578(0x250)][_0x4aa578(0x268)](_0x4aa578(0x291)))return console[_0x4aa578(0x1f1)](a41_0x536097[_0x4aa578(0x1bc)](_0x4aa578(0x15c)),_0x4aa578(0x24c)),_0x3b6d0d[_0x4aa578(0x247)]?console[_0x4aa578(0x1f1)](a41_0x536097[_0x4aa578(0x1be)](_0x4aa578(0x253)+_0x3b6d0d[_0x4aa578(0x247)]+_0x4aa578(0x22a)+_0x3b6d0d['workflowProject']+'\x27')):console[_0x4aa578(0x1f1)](a41_0x536097[_0x4aa578(0x1be)](_0x4aa578(0x149))),0x1;throw _0x13bf0f;}const _0x41e2cc=_0xa69c61[_0x4aa578(0x217)];console[_0x4aa578(0x1f1)]('✔\x20Project:\x20'+_0x41e2cc[_0x4aa578(0x213)]),console[_0x4aa578(0x1f1)](_0x4aa578(0x180)+_0x41e2cc[_0x4aa578(0x25c)]),console[_0x4aa578(0x1f1)](_0x4aa578(0x17a)+_0x41e2cc[_0x4aa578(0x282)]),console[_0x4aa578(0x1f1)]('\x20\x20Changes:\x20'+a41_0x536097[_0x4aa578(0x26c)]('+'+_0x41e2cc['summary'][_0x4aa578(0x2ae)]+'\x20new')+',\x20'+(a41_0x536097[_0x4aa578(0x13f)]('~'+_0x41e2cc[_0x4aa578(0x13b)]['modified']+'\x20modified')+',\x20')+(a41_0x536097[_0x4aa578(0x1bc)]('-'+_0x41e2cc['summary']['deleted']+_0x4aa578(0x12b))+',\x20')+(''+a41_0x536097[_0x4aa578(0x1be)](_0x41e2cc['summary'][_0x4aa578(0x21d)]+_0x4aa578(0x18d))));for(const _0x234412 of _0x41e2cc['changes']){_0x234412[_0x4aa578(0x274)]===_0x4aa578(0x1c6)&&_0x234412[_0x4aa578(0x152)]&&(console['error']('\x0a'+a41_0x536097[_0x4aa578(0x21f)]('---\x20'+_0x234412[_0x4aa578(0x28d)])),console['error'](_0x234412[_0x4aa578(0x152)]));}if(!_0x41e2cc[_0x4aa578(0x22b)])return console['error'](a41_0x536097[_0x4aa578(0x26c)](_0x4aa578(0x2bf))),await this['showWorkflowConsoleUrl'](_0x5b2391,_0x41e2cc[_0x4aa578(0x213)],_0x3b6d0d['site']),0x0;if(_0x3b6d0d[_0x4aa578(0x1eb)])return console[_0x4aa578(0x1f1)](a41_0x536097[_0x4aa578(0x13f)](_0x4aa578(0x25f))),0x0;if(!_0x3b6d0d['yes']){const _0x412823=await confirmKey(_0x4aa578(0x134));if(!_0x412823)return console[_0x4aa578(0x1f1)](_0x4aa578(0x240)),0x0;}const _0x1ee115=await withSpinner(_0x4aa578(0x179),()=>_0x5b2391['workflow'][_0x4aa578(0x1cd)](_0x41e2cc),{'verbose':_0x3b6d0d['verbose']}),_0x5ab17f=_0x1ee115['data'];return console['error'](a41_0x536097[_0x4aa578(0x26c)]('✔\x20Push\x20complete')),console[_0x4aa578(0x1f1)](_0x4aa578(0x1f7)+_0x5ab17f['projectId']),console[_0x4aa578(0x1f1)](_0x4aa578(0x17a)+_0x5ab17f[_0x4aa578(0x282)]),await this[_0x4aa578(0x2a6)](_0x5b2391,_0x5ab17f['projectName'],_0x3b6d0d[_0x4aa578(0x17b)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']='workflow:clone';[a41_0x50f62(0x19c)]=a41_0x50f62(0x194);async['execute'](_0x185f16){const _0x218cf5=a41_0x50f62,{options:_0x5b64d9,args:_0x16e095,tdx:_0x328fb8}=_0x185f16,_0x490143=this[_0x218cf5(0x1ca)](_0x16e095,_0x5b64d9),_0x217d4b=_0x5b64d9[_0x218cf5(0x1ea)],_0x49fe36=_0x5b64d9[_0x218cf5(0x282)],_0x3456f6=_0x5b64d9[_0x218cf5(0x26a)];if(!_0x490143)return console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x1bc)]('Error:'),_0x218cf5(0x1d5)),console['error'](a41_0x536097[_0x218cf5(0x1be)](_0x218cf5(0x175))),console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x1be)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x217d4b)return console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x1bc)](_0x218cf5(0x15c)),_0x218cf5(0x172)),console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x1be)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x5b64d9['verbose']&&(console[_0x218cf5(0x1f1)]('Source\x20directory:\x20'+_0x490143),console[_0x218cf5(0x1f1)](_0x218cf5(0x235)+_0x217d4b),_0x49fe36&&console[_0x218cf5(0x1f1)](_0x218cf5(0x1dd)+_0x49fe36),_0x5b64d9[_0x218cf5(0x1eb)]&&console[_0x218cf5(0x1f1)](_0x218cf5(0x18c)),_0x3456f6&&console[_0x218cf5(0x1f1)](_0x218cf5(0x219)));const _0x2bff4e=await withSpinner('Analyzing\x20project...',()=>_0x328fb8[_0x218cf5(0x278)][_0x218cf5(0x18f)](_0x490143,_0x217d4b,{'revision':_0x49fe36,'skipValidation':_0x3456f6}),{'verbose':_0x5b64d9['verbose']}),_0x25ecf1=_0x2bff4e[_0x218cf5(0x217)];console[_0x218cf5(0x1f1)](_0x218cf5(0x1b0)+_0x25ecf1[_0x218cf5(0x25c)]);_0x25ecf1[_0x218cf5(0x27f)]&&console[_0x218cf5(0x1f1)]('Source\x20project:\x20'+_0x25ecf1['sourceProjectName']);console[_0x218cf5(0x1f1)](_0x218cf5(0x235)+_0x25ecf1[_0x218cf5(0x225)]),console['error'](_0x218cf5(0x1dd)+_0x25ecf1['revision']),console[_0x218cf5(0x1f1)](_0x218cf5(0x1a4)+_0x25ecf1[_0x218cf5(0x17d)]);_0x25ecf1[_0x218cf5(0x2b9)]&&(console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x13f)](_0x218cf5(0x295)+_0x25ecf1[_0x218cf5(0x225)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x25ecf1[_0x218cf5(0x1c0)]+')')),console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x13f)](_0x218cf5(0x188))));if(_0x5b64d9[_0x218cf5(0x1eb)])return console[_0x218cf5(0x1f1)](a41_0x536097[_0x218cf5(0x13f)](_0x218cf5(0x254))),0x0;if(!_0x5b64d9[_0x218cf5(0x1dc)]){const _0x73b491=_0x25ecf1[_0x218cf5(0x27f)]||a41_0x149b54[_0x218cf5(0x2a4)](_0x490143),_0x2c89d5=_0x25ecf1['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x217d4b+'\x22\x20with\x20new\x20revision?':_0x218cf5(0x272)+_0x73b491+'\x22\x20to\x20new\x20project\x20\x22'+_0x217d4b+'\x22?',_0x41eae6=await confirmKey(_0x2c89d5);if(!_0x41eae6)return console['error']('Cancelled'),0x0;}const _0x4eb429=await withSpinner(_0x25ecf1[_0x218cf5(0x2b9)]?'Updating\x20'+_0x217d4b+_0x218cf5(0x181):_0x218cf5(0x1c2)+_0x217d4b+_0x218cf5(0x181),()=>_0x328fb8[_0x218cf5(0x278)][_0x218cf5(0x1f9)](_0x25ecf1),{'verbose':_0x5b64d9[_0x218cf5(0x146)]}),_0x19e4a1=_0x4eb429['data'];return console[_0x218cf5(0x1f1)](a41_0x536097['green'](_0x25ecf1[_0x218cf5(0x2b9)]?'✔\x20Project\x20updated':_0x218cf5(0x258))),console[_0x218cf5(0x1f1)](_0x218cf5(0x190)+_0x19e4a1[_0x218cf5(0x225)]),console[_0x218cf5(0x1f1)]('\x20\x20Project\x20ID:\x20'+_0x19e4a1[_0x218cf5(0x192)]),console[_0x218cf5(0x1f1)](_0x218cf5(0x17a)+_0x19e4a1[_0x218cf5(0x282)]),await this['showWorkflowConsoleUrl'](_0x328fb8,_0x19e4a1[_0x218cf5(0x225)],_0x5b64d9[_0x218cf5(0x17b)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a41_0x50f62(0x29f);[a41_0x50f62(0x19c)]=a41_0x50f62(0x187);async[a41_0x50f62(0x22e)](_0x518651){const _0x3ee817=a41_0x50f62,{options:_0x263c9a,args:_0x5d3e23,tdx:_0xc7405e}=_0x518651,_0x264853=_0x5d3e23[0x0];if(!_0x264853)return console[_0x3ee817(0x1f1)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x3ee817(0x1f1)](_0x3ee817(0x18a)),0x1;_0x263c9a['verbose']&&console['error'](_0x3ee817(0x199)+_0x264853);if(!_0x263c9a['yes']){const _0x257735=await confirmKey(_0x3ee817(0x19f)+_0x264853+_0x3ee817(0x2ba));if(!_0x257735)return console['error'](_0x3ee817(0x240)),0x0;}const _0x231571=await withSpinner(_0x3ee817(0x29a)+_0x264853+_0x3ee817(0x181),()=>_0xc7405e[_0x3ee817(0x278)][_0x3ee817(0x2ad)](_0x264853),{'verbose':_0x263c9a[_0x3ee817(0x146)]}),_0x2cbf18=_0x231571['data'];return console[_0x3ee817(0x1f1)](_0x3ee817(0x23f)+_0x2cbf18[_0x3ee817(0x213)]),console[_0x3ee817(0x1f1)]('\x20\x20Project\x20ID:\x20'+_0x2cbf18[_0x3ee817(0x21e)]),0x0;}}export function parseKeyValue(_0x49dc8f){const _0x54708a=a41_0x50f62,_0x465d75=_0x49dc8f[_0x54708a(0x183)]('=');if(_0x465d75===-0x1)throw new Error(_0x54708a(0x1bf)+_0x49dc8f+_0x54708a(0x1aa));const _0x3705fb=_0x49dc8f[_0x54708a(0x289)](0x0,_0x465d75),_0x14c6db=_0x49dc8f[_0x54708a(0x289)](_0x465d75+0x1);if(!_0x3705fb)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x3705fb,'value':_0x14c6db};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x1e4);[a41_0x50f62(0x19c)]=a41_0x50f62(0x14a);async[a41_0x50f62(0x22e)](_0x14e48c){const _0x128c04=a41_0x50f62,{options:_0x558234,args:_0x1dad95,tdx:_0x5bc66f}=_0x14e48c,_0x5a3fda=this['requireProject'](_0x1dad95,_0x558234);if(!_0x5a3fda)return 0x1;_0x558234['verbose']&&console[_0x128c04(0x1f1)](_0x128c04(0x199)+_0x5a3fda);const _0x2bdc01=await withSpinner(_0x128c04(0x154),()=>_0x5bc66f[_0x128c04(0x278)][_0x128c04(0x207)](_0x5a3fda),{'verbose':_0x558234[_0x128c04(0x146)]}),{secrets:_0x14a75d}=_0x2bdc01[_0x128c04(0x217)];return console[_0x128c04(0x1f1)](_0x128c04(0x1ee)+_0x14a75d[_0x128c04(0x21c)]+_0x128c04(0x297)+(_0x14a75d[_0x128c04(0x21c)]!==0x1?'s':'')),await handleSDKOutput(_0x14a75d,_0x558234),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]='workflow:secrets:set';[a41_0x50f62(0x19c)]=a41_0x50f62(0x169);async[a41_0x50f62(0x22e)](_0x40dbdb){const _0xd7da09=a41_0x50f62,{options:_0x545a5a,args:_0x198085,tdx:_0x117161}=_0x40dbdb;let _0x2e570a,_0x1eab69;if(_0x198085['length']>=0x2)_0x2e570a=_0x198085[0x0],_0x1eab69=_0x198085[0x1];else{if(_0x198085['length']===0x1&&_0x545a5a[_0xd7da09(0x247)])_0x2e570a=_0x545a5a['workflowProject'],_0x1eab69=_0x198085[0x0];else return _0x198085[_0xd7da09(0x21c)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0xd7da09(0x1f1)](_0xd7da09(0x18e)),0x1):(console[_0xd7da09(0x1f1)](_0xd7da09(0x1ad)),console[_0xd7da09(0x1f1)](_0xd7da09(0x1f0)),0x1);}let _0x4cfc4e,_0x4fe0d3;try{({key:_0x4cfc4e,value:_0x4fe0d3}=parseKeyValue(_0x1eab69));}catch(_0x29ba50){return _0x29ba50 instanceof Error&&console[_0xd7da09(0x1f1)](a41_0x536097['red'](_0xd7da09(0x15c)),_0x29ba50[_0xd7da09(0x250)]),0x1;}_0x545a5a['verbose']&&(console[_0xd7da09(0x1f1)](_0xd7da09(0x199)+_0x2e570a),console[_0xd7da09(0x1f1)](_0xd7da09(0x1f6)+_0x4cfc4e));const _0x4d93b1=await withSpinner(_0xd7da09(0x19e),()=>_0x117161['workflow']['setSecret'](_0x2e570a,_0x4cfc4e,_0x4fe0d3),{'verbose':_0x545a5a['verbose']}),_0x511511=_0x4d93b1[_0xd7da09(0x217)];return console[_0xd7da09(0x1f1)]('✔\x20Secret\x20\x27'+_0x511511['key']+_0xd7da09(0x142)+_0x511511[_0xd7da09(0x213)]+'\x27'),(_0x545a5a[_0xd7da09(0x23c)]||_0x545a5a[_0xd7da09(0x13c)])&&await handleSingleObjectOutput(_0x511511,_0x545a5a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x50f62(0x1ea)]=a41_0x50f62(0x178);[a41_0x50f62(0x19c)]=a41_0x50f62(0x16a);async[a41_0x50f62(0x22e)](_0x15f7d6){const _0x1d5e2c=a41_0x50f62,{options:_0x4b40fa,args:_0x199147,tdx:_0x4c01d7}=_0x15f7d6;let _0x450fd4,_0x5e4eec;if(_0x199147['length']>=0x2)_0x450fd4=_0x199147[0x0],_0x5e4eec=_0x199147[0x1];else{if(_0x199147[_0x1d5e2c(0x21c)]===0x1&&_0x4b40fa[_0x1d5e2c(0x247)])_0x450fd4=_0x4b40fa[_0x1d5e2c(0x247)],_0x5e4eec=_0x199147[0x0];else return _0x199147[_0x1d5e2c(0x21c)]===0x1?(console['error'](_0x1d5e2c(0x1b6)),console[_0x1d5e2c(0x1f1)](_0x1d5e2c(0x18e)),0x1):(console['error'](_0x1d5e2c(0x201)),console[_0x1d5e2c(0x1f1)](_0x1d5e2c(0x1e0)),0x1);}_0x4b40fa[_0x1d5e2c(0x146)]&&(console['error'](_0x1d5e2c(0x199)+_0x450fd4),console[_0x1d5e2c(0x1f1)](_0x1d5e2c(0x1f6)+_0x5e4eec));if(!_0x4b40fa[_0x1d5e2c(0x1dc)]){const _0x336de2=await confirmKey(_0x1d5e2c(0x2c6)+_0x5e4eec+_0x1d5e2c(0x20f)+_0x450fd4+'\x27?');if(!_0x336de2)return console[_0x1d5e2c(0x1f1)](_0x1d5e2c(0x240)),0x0;}const _0x5c7c27=await withSpinner('Deleting\x20secret...',()=>_0x4c01d7[_0x1d5e2c(0x278)][_0x1d5e2c(0x270)](_0x450fd4,_0x5e4eec),{'verbose':_0x4b40fa[_0x1d5e2c(0x146)]}),_0x490078=_0x5c7c27['data'];return console[_0x1d5e2c(0x1f1)]('✔\x20Secret\x20\x27'+_0x490078[_0x1d5e2c(0x13d)]+_0x1d5e2c(0x263)+_0x490078[_0x1d5e2c(0x213)]+'\x27'),(_0x4b40fa['json']||_0x4b40fa['jsonl'])&&await handleSingleObjectOutput(_0x490078,_0x4b40fa),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(_0x382eb3){const _0x53f156=a41_0x50f62,_0xb26082=Math[_0x53f156(0x1a8)](_0x382eb3/0x3e8),_0x294828=Math[_0x53f156(0x1a8)](_0xb26082/0x3c),_0x5e2f24=Math['floor'](_0x294828/0x3c),_0x2a405a=Math[_0x53f156(0x1a8)](_0x5e2f24/0x18);if(_0x2a405a>0x0){const _0x1198a0=_0x5e2f24%0x18;return _0x1198a0>0x0?_0x2a405a+'d\x20'+_0x1198a0+'h':_0x2a405a+'d';}else{if(_0x5e2f24>0x0){const _0x3aa537=_0x294828%0x3c;return _0x3aa537>0x0?_0x5e2f24+'h\x20'+_0x3aa537+'m':_0x5e2f24+'h';}else{if(_0x294828>0x0){const _0xc9fa16=_0xb26082%0x3c;return _0xc9fa16>0x0?_0x294828+'m\x20'+_0xc9fa16+'s':_0x294828+'m';}else return _0xb26082+'s';}}}function formatTimestamp(_0x479390,_0x299ae9){const _0x5013e7=a41_0x50f62,_0x5d9053=new Date(_0x479390),_0x288009=String(_0x5d9053[_0x5013e7(0x1d2)]())[_0x5013e7(0x25d)](0x2,'0'),_0x1d290e=String(_0x5d9053[_0x5013e7(0x23a)]())[_0x5013e7(0x25d)](0x2,'0'),_0x33e1ba=_0x288009+':'+_0x1d290e,_0x421800=_0x5d9053['getFullYear']()===_0x299ae9['getFullYear']()&&_0x5d9053[_0x5013e7(0x2c1)]()===_0x299ae9['getMonth']()&&_0x5d9053[_0x5013e7(0x151)]()===_0x299ae9[_0x5013e7(0x151)]();if(_0x421800)return _0x33e1ba;else{const _0x15d253=String(_0x5d9053['getMonth']()+0x1)[_0x5013e7(0x25d)](0x2,'0'),_0x5197fa=String(_0x5d9053[_0x5013e7(0x151)]())['padStart'](0x2,'0');return _0x15d253+'-'+_0x5197fa+'\x20'+_0x33e1ba;}}function formatDate(_0x2b885c){const _0x1b8c65=a41_0x50f62,_0x154f31=_0x2b885c['getFullYear'](),_0x695f9a=String(_0x2b885c[_0x1b8c65(0x2c1)]()+0x1)['padStart'](0x2,'0'),_0x523c45=String(_0x2b885c['getDate']())['padStart'](0x2,'0');return _0x154f31+'-'+_0x695f9a+'-'+_0x523c45;}function getTaskStateIcon(_0x5477b5){const _0x3e28d1={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3e28d1[_0x5477b5]||'⚪';}function getBarChar(_0x4b8cd1){return _0x4b8cd1==='error'||_0x4b8cd1==='group_error'?'×':'─';}function getBarColor(_0x3c2c49){const _0x338331=a41_0x50f62,_0x32c5ac={'success':a41_0x536097['green'],'error':a41_0x536097[_0x338331(0x1bc)],'group_error':a41_0x536097['red'],'running':a41_0x536097[_0x338331(0x222)],'blocked':a41_0x536097[_0x338331(0x13f)],'planned':a41_0x536097[_0x338331(0x1be)],'canceling':a41_0x536097[_0x338331(0x13f)]};return _0x32c5ac[_0x3c2c49]||a41_0x536097[_0x338331(0x1fd)];}function parseTaskName(_0x4bc154){const _0x53d221=a41_0x50f62;let _0xca75ab=_0x4bc154[_0x53d221(0x1da)](/^\++/,'');const _0x5e2b73=_0xca75ab[_0x53d221(0x281)]('+'),_0x1e9154=_0x5e2b73[_0x53d221(0x21c)]>0x1?_0x5e2b73[_0x53d221(0x21c)]-0x2:0x0,_0x50e9ec=_0x5e2b73[_0x5e2b73[_0x53d221(0x21c)]-0x1]||_0xca75ab;return{'level':_0x1e9154,'name':'+'+_0x50e9ec};}function truncateTaskName(_0x1baf2a,_0x4cc4b7){const _0x50b6e9=a41_0x50f62,_0x311e9b=stringWidth(_0x1baf2a);if(_0x311e9b<=_0x4cc4b7)return _0x1baf2a;let _0x10df49=_0x1baf2a;while(stringWidth(_0x10df49+'…')>_0x4cc4b7&&_0x10df49[_0x50b6e9(0x21c)]>0x0){_0x10df49=_0x10df49[_0x50b6e9(0x1c3)](0x0,-0x1);}return _0x10df49+'…';}function calculateTimeScale(_0x5c7dd9,_0x54026c){const _0x557ec2=a41_0x50f62;return{'startTime':_0x5c7dd9[_0x557ec2(0x2a8)],'endTime':_0x5c7dd9['end'],'durationMs':_0x5c7dd9['duration'],'msPerChar':_0x5c7dd9['duration']/_0x54026c};}function timeToPosition(_0x1cb95f,_0x30636d,_0x350ad1){const _0x37f745=a41_0x50f62,_0x4a70e5=_0x1cb95f-_0x30636d['startTime'],_0x372c65=Math[_0x37f745(0x1a8)](_0x4a70e5/_0x30636d[_0x37f745(0x14e)]);return Math['max'](0x0,Math[_0x37f745(0x21a)](_0x372c65,_0x350ad1));}function renderTimeAxis(_0x1cf2b9,_0x815b9e){const _0x13c444=a41_0x50f62,_0x50faf8=Math[_0x13c444(0x21a)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x13c444(0x1f3)](TIMELINE_CONFIG[_0x13c444(0x1d0)],Math[_0x13c444(0x1a8)](_0x815b9e/TIMELINE_CONFIG[_0x13c444(0x170)]))),_0x292a46=_0x1cf2b9['durationMs']/(_0x50faf8-0x1),_0x3bfa5d=new Date(_0x1cf2b9['startTime']),_0x1edb76=[];for(let _0x4d2a43=0x0;_0x4d2a43<_0x50faf8;_0x4d2a43++){const _0x19e4c4=_0x1cf2b9['startTime']+_0x4d2a43*_0x292a46,_0x27d7e0=timeToPosition(_0x19e4c4,_0x1cf2b9,_0x815b9e),_0x419a8c=formatTimestamp(_0x19e4c4,_0x3bfa5d);_0x1edb76[_0x13c444(0x228)]({'pos':_0x27d7e0,'text':_0x419a8c});}const _0x1e6c30=new Array(_0x815b9e)[_0x13c444(0x2b4)]('\x20');let _0x55599c=-0x1;for(const {pos:_0x201be4,text:_0x18eaaa}of _0x1edb76){let _0x53ac4c=Math[_0x13c444(0x1f3)](0x0,_0x201be4-Math['floor'](_0x18eaaa[_0x13c444(0x21c)]/0x2));_0x53ac4c<=_0x55599c+TIMELINE_CONFIG[_0x13c444(0x1d8)]&&(_0x53ac4c=_0x55599c+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x53ac4c+_0x18eaaa[_0x13c444(0x21c)]>_0x815b9e&&(_0x53ac4c=_0x815b9e-_0x18eaaa[_0x13c444(0x21c)]);if(_0x53ac4c>=0x0&&_0x53ac4c+_0x18eaaa[_0x13c444(0x21c)]<=_0x815b9e&&_0x53ac4c>_0x55599c){for(let _0x4da7a1=0x0;_0x4da7a1<_0x18eaaa[_0x13c444(0x21c)];_0x4da7a1++){_0x1e6c30[_0x53ac4c+_0x4da7a1]=_0x18eaaa[_0x4da7a1];}_0x55599c=_0x53ac4c+_0x18eaaa[_0x13c444(0x21c)]-0x1;}}return _0x1e6c30[_0x13c444(0x1f5)]('');}function renderTaskRow(_0x4f06dd,_0x3e4484,_0x1d0158,_0x11d003){const _0x1dd0b3=a41_0x50f62,{level:_0x5ab914,name:_0x16a69f}=parseTaskName(_0x4f06dd[_0x1dd0b3(0x1ea)]),_0xdac420='\x20'['repeat'](_0x5ab914),_0x376b15=_0x4f06dd[_0x1dd0b3(0x166)]?'('+formatElapsed(_0x4f06dd['window'][_0x1dd0b3(0x1fa)])+')':'',_0x1510e8=stringWidth(_0x376b15),_0x1e89dd=_0x5ab914*0x1,_0x2b2fdd=_0x11d003-_0x1e89dd-_0x1510e8-0x1,_0x17beb3=truncateTaskName(_0x16a69f,_0x2b2fdd),_0x27ba5f=_0xdac420+_0x17beb3,_0x491246=stringWidth(_0x27ba5f),_0x2a6bfe=_0x11d003-_0x491246-_0x1510e8,_0x4072a1=_0x27ba5f+'\x20'[_0x1dd0b3(0x2b5)](Math[_0x1dd0b3(0x1f3)](0x1,_0x2a6bfe))+a41_0x536097['dim'](_0x376b15),_0x5030a3=getTaskStateIcon(_0x4f06dd[_0x1dd0b3(0x176)]),_0x25f2ca=new Array(_0x1d0158)[_0x1dd0b3(0x2b4)]('\x20');if(_0x4f06dd[_0x1dd0b3(0x166)]){const _0x668895=timeToPosition(_0x4f06dd['window'][_0x1dd0b3(0x2a8)],_0x3e4484,_0x1d0158),_0x2f732b=timeToPosition(_0x4f06dd[_0x1dd0b3(0x166)][_0x1dd0b3(0x14c)],_0x3e4484,_0x1d0158),_0x5f5058=getBarChar(_0x4f06dd[_0x1dd0b3(0x176)]),_0x2292c2=Math['max'](_0x668895+0x1,_0x2f732b);for(let _0x4ce540=_0x668895;_0x4ce540<Math['min'](_0x2292c2,_0x1d0158);_0x4ce540++){_0x25f2ca[_0x4ce540]=_0x5f5058;}}const _0x2cf26f=getBarColor(_0x4f06dd['state']),_0x30180b=_0x25f2ca[_0x1dd0b3(0x249)](_0xb50aa7=>_0xb50aa7==='\x20'?'\x20':_0x2cf26f(_0xb50aa7))[_0x1dd0b3(0x1f5)]('');return _0x5030a3+'\x20'+_0x4072a1+'│'+_0x30180b+'│';}function calculateStats(_0x3d1cce){const _0x4720d1=a41_0x50f62,_0x1bd63c={'total':_0x3d1cce[_0x4720d1(0x21c)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3eefc7 of _0x3d1cce){if(_0x3eefc7['state']==='success')_0x1bd63c[_0x4720d1(0x285)]++;else{if(_0x3eefc7['state']===_0x4720d1(0x1f1)||_0x3eefc7['state']==='group_error')_0x1bd63c[_0x4720d1(0x1f1)]++;else _0x3eefc7['state']===_0x4720d1(0x16b)?_0x1bd63c[_0x4720d1(0x16b)]++:_0x1bd63c[_0x4720d1(0x236)]++;}}return _0x1bd63c;}function formatStats(_0x20ba22){const _0x1fe722=a41_0x50f62;return['Total:\x20'+_0x20ba22[_0x1fe722(0x15b)],'✅\x20'+_0x20ba22[_0x1fe722(0x285)],'❌\x20'+_0x20ba22[_0x1fe722(0x1f1)],_0x1fe722(0x1c7)+_0x20ba22[_0x1fe722(0x16b)],'⏳\x20'+_0x20ba22[_0x1fe722(0x236)]][_0x1fe722(0x1f5)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a41_0x50f62(0x229);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a41_0x50f62(0x22e)](_0x101b38){const _0x4a5aa5=a41_0x50f62,{options:_0x4bba03,args:_0x276eb0,tdx:_0x254be5}=_0x101b38;let _0x18596b,_0x442a00,_0xd2912e=![];if(_0x276eb0[0x0]){if(_0x276eb0[0x0][_0x4a5aa5(0x268)]('.')){const _0x3c618a=this[_0x4a5aa5(0x16f)](_0x276eb0,_0x4bba03);if(!_0x3c618a)return 0x1;_0x18596b=_0x3c618a[_0x4a5aa5(0x213)],_0x442a00=_0x3c618a[_0x4a5aa5(0x209)];}else{_0x442a00=_0x276eb0[0x0],_0x18596b=_0x4bba03[_0x4a5aa5(0x247)];if(!_0x18596b)return console[_0x4a5aa5(0x1f1)](a41_0x536097[_0x4a5aa5(0x1bc)](_0x4a5aa5(0x15c)),_0x4a5aa5(0x27c)),0x1;_0xd2912e=!![];}}else{const _0x183370=this[_0x4a5aa5(0x16f)](_0x276eb0,_0x4bba03);if(!_0x183370)return 0x1;_0x18596b=_0x183370[_0x4a5aa5(0x213)],_0x442a00=_0x183370[_0x4a5aa5(0x209)];}if(_0x4bba03[_0x4a5aa5(0x146)]){if(_0x18596b&&_0x442a00)console[_0x4a5aa5(0x1f1)]('Filter:\x20'+_0x18596b+'.'+_0x442a00);else _0x18596b&&console[_0x4a5aa5(0x1f1)](_0x4a5aa5(0x2bd)+_0x18596b);}const _0x6115d0=_0x4bba03[_0x4a5aa5(0x1f2)],_0x8ef34a=_0x4bba03['sessionId'];if(_0x6115d0){_0x8ef34a&&console[_0x4a5aa5(0x1f1)](a41_0x536097[_0x4a5aa5(0x13f)](_0x4a5aa5(0x1b3)),_0x4a5aa5(0x2a7));const _0x34c13b=_0x4bba03['follow'];return _0x34c13b?await this['pollTimeline'](_0x101b38,_0x6115d0):await this[_0x4a5aa5(0x25b)](_0x101b38,_0x6115d0,_0x4bba03),0x0;}if(_0x8ef34a){const _0x32976e=await withSpinner(_0x4a5aa5(0x186),()=>_0x254be5[_0x4a5aa5(0x278)]['sessions']({'projectName':_0x18596b,'workflowName':_0x442a00,'limit':0x64}),{'verbose':_0x4bba03[_0x4a5aa5(0x146)]}),_0xba4b79=_0x32976e[_0x4a5aa5(0x217)][_0x4a5aa5(0x23e)](_0x179c5e=>_0x179c5e['id']===_0x8ef34a);if(!_0xba4b79)return console[_0x4a5aa5(0x1f1)](a41_0x536097[_0x4a5aa5(0x1bc)](_0x4a5aa5(0x15c)),_0x4a5aa5(0x20d)+_0x8ef34a),0x1;if(!_0xba4b79[_0x4a5aa5(0x130)]?.['id'])return console[_0x4a5aa5(0x1f1)](a41_0x536097[_0x4a5aa5(0x1bc)]('Error:'),_0x4a5aa5(0x2ac)+_0x8ef34a+_0x4a5aa5(0x182)),0x1;const _0x1ac95f=_0xba4b79['lastAttempt']['id'];_0x4bba03[_0x4a5aa5(0x146)]&&console[_0x4a5aa5(0x1f1)]('Using\x20attempt\x20'+_0x1ac95f+'\x20from\x20session\x20'+_0x8ef34a);const _0x20574b=_0x4bba03[_0x4a5aa5(0x12a)];return _0x20574b?await this[_0x4a5aa5(0x1cc)](_0x101b38,_0x1ac95f):await this[_0x4a5aa5(0x25b)](_0x101b38,_0x1ac95f,_0x4bba03),0x0;}const _0x221d38=await withSpinner(_0x4a5aa5(0x153),()=>_0x254be5[_0x4a5aa5(0x278)][_0x4a5aa5(0x29d)]({'projectName':_0x18596b,'workflowName':_0x442a00,'limit':_0x4bba03[_0x4a5aa5(0x1a9)]||0x32}),{'verbose':_0x4bba03[_0x4a5aa5(0x146)]}),_0xab960a=_0x221d38[_0x4a5aa5(0x217)];if(_0xab960a[_0x4a5aa5(0x21c)]===0x0){if(_0x18596b&&_0x442a00)console[_0x4a5aa5(0x1f1)]('No\x20sessions\x20found\x20for:\x20'+_0x18596b+'.'+_0x442a00);else _0x18596b?console[_0x4a5aa5(0x1f1)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x18596b):(console['error'](_0x4a5aa5(0x121)),console['error'](a41_0x536097['dim'](_0x4a5aa5(0x245))));return 0x0;}_0xab960a[_0x4a5aa5(0x1d9)]((_0x5a1556,_0x534291)=>{const _0x1ae27f=_0x4a5aa5,_0x2221b0=_0x5a1556[_0x1ae27f(0x1c4)]||'',_0x3a8efa=_0x534291['sessionTime']||'';return _0x3a8efa[_0x1ae27f(0x1c5)](_0x2221b0);});if(_0x4bba03['json']||_0x4bba03[_0x4a5aa5(0x13c)])return await handleSDKOutput(_0xab960a,_0x4bba03),0x0;let _0x65c8b;if(_0xd2912e){const _0x14c140=_0xab960a[0x0];if(!_0x14c140['lastAttempt']?.['id'])return console['error'](_0x4a5aa5(0x269)),0x0;_0x65c8b=_0x14c140[_0x4a5aa5(0x130)]['id'],_0x4bba03[_0x4a5aa5(0x146)]&&console[_0x4a5aa5(0x1f1)](_0x4a5aa5(0x264)+_0x14c140[_0x4a5aa5(0x1c4)]);}else{const _0x56ac71=_0xab960a[_0x4a5aa5(0x249)](_0x11071e=>{const _0x388105=_0x4a5aa5,_0x95bac3=getAttemptStatusDisplay(_0x11071e[_0x388105(0x130)]);return{'title':_0x11071e[_0x388105(0x14f)]?.[_0x388105(0x1ea)]+'.'+_0x11071e['workflow']?.[_0x388105(0x1ea)]+_0x388105(0x1f8)+_0x11071e[_0x388105(0x1c4)]+'\x20'+_0x95bac3['icon'],'value':_0x11071e[_0x388105(0x130)]?.['id']||'','description':_0x95bac3['text']};}),_0x516be2=await a41_0x3c8366({'type':_0x4a5aa5(0x252),'name':_0x4a5aa5(0x1f2),'message':_0x4a5aa5(0x287),'choices':_0x56ac71['filter'](_0xc69743=>_0xc69743[_0x4a5aa5(0x144)]!=='')});if(!_0x516be2['attemptId'])return 0x0;_0x65c8b=_0x516be2[_0x4a5aa5(0x1f2)];}const _0x350043=_0x4bba03[_0x4a5aa5(0x12a)];return _0x350043?await this['pollTimeline'](_0x101b38,_0x65c8b):await this[_0x4a5aa5(0x25b)](_0x101b38,_0x65c8b,_0x4bba03),0x0;}async[a41_0x50f62(0x25b)](_0x2155ad,_0x5b331c,_0x5142d0){const _0x3f8f40=a41_0x50f62,{tdx:_0x45a8f0}=_0x2155ad;let _0x2ed01c,_0x2fc7cf;try{[_0x2ed01c,_0x2fc7cf]=await Promise[_0x3f8f40(0x280)]([_0x45a8f0[_0x3f8f40(0x278)][_0x3f8f40(0x1d3)](_0x5b331c),_0x45a8f0['workflow'][_0x3f8f40(0x1b5)](_0x5b331c,![])]);}catch(_0xd143f9){console[_0x3f8f40(0x1f1)](a41_0x536097[_0x3f8f40(0x1bc)](_0x3f8f40(0x246)));_0x5142d0[_0x3f8f40(0x146)]&&console[_0x3f8f40(0x1f1)](_0xd143f9);throw _0xd143f9;}if(_0x5142d0[_0x3f8f40(0x23c)]||_0x5142d0[_0x3f8f40(0x13c)]){const _0x288327=this['buildTimelineData'](_0x2ed01c,_0x2fc7cf);await handleSDKOutput([_0x288327],_0x5142d0);return;}const _0x3a2aa5=_0x45a8f0[_0x3f8f40(0x220)]['site'],_0x3436fa=this[_0x3f8f40(0x276)](_0x2ed01c,_0x2fc7cf,_0x3a2aa5);console[_0x3f8f40(0x197)](_0x3436fa);}async['pollTimeline'](_0x5edbf4,_0x2cef){const _0x5a649b=a41_0x50f62,{tdx:_0x1c057f}=_0x5edbf4,_0x7c57a9=TIMELINE_CONFIG[_0x5a649b(0x12c)],_0x19030f=TIMELINE_CONFIG[_0x5a649b(0x22c)];let _0x4917af=0x0;while(_0x4917af<_0x19030f){process[_0x5a649b(0x24f)]['isTTY']&&process[_0x5a649b(0x24f)][_0x5a649b(0x218)]('\x1bc');let _0x2ec3d4,_0x38e13c;try{[_0x2ec3d4,_0x38e13c]=await Promise[_0x5a649b(0x280)]([_0x1c057f[_0x5a649b(0x278)][_0x5a649b(0x1d3)](_0x2cef),_0x1c057f[_0x5a649b(0x278)]['tasks'](_0x2cef,![])]);}catch(_0x13b33a){console[_0x5a649b(0x1f1)](a41_0x536097[_0x5a649b(0x1bc)](_0x5a649b(0x1d7)));_0x4917af>0x0&&console[_0x5a649b(0x1f1)](a41_0x536097[_0x5a649b(0x1be)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x4917af));throw _0x13b33a;}const _0x2a8a8b=_0x1c057f[_0x5a649b(0x220)][_0x5a649b(0x17b)],_0x4957a8=this[_0x5a649b(0x276)](_0x2ec3d4,_0x38e13c,_0x2a8a8b);console['log'](_0x4957a8);const _0x1286ae=_0x2ec3d4[_0x5a649b(0x27d)]&&_0x38e13c[_0x5a649b(0x237)](_0x4a53eb=>_0x4a53eb[_0x5a649b(0x176)]!==_0x5a649b(0x16b)&&_0x4a53eb[_0x5a649b(0x176)]!==_0x5a649b(0x16c));if(_0x1286ae){console[_0x5a649b(0x1f1)](a41_0x536097[_0x5a649b(0x26c)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x5a649b(0x1f1)](a41_0x536097['dim']('\x0aPolling...\x20('+_0x4917af*0x2+_0x5a649b(0x242))),await new Promise(_0x52fda8=>setTimeout(_0x52fda8,_0x7c57a9)),_0x4917af++;}_0x4917af>=_0x19030f&&console[_0x5a649b(0x1f1)](a41_0x536097[_0x5a649b(0x13f)](_0x5a649b(0x29b)));}[a41_0x50f62(0x276)](_0x383538,_0x288f8c,_0xa88bd){const _0x2af0d6=a41_0x50f62,_0x16a5fd=[],_0x384c3f=TIMELINE_CONFIG[_0x2af0d6(0x267)],_0x31b32d=0x5,_0x5daa4e=process[_0x2af0d6(0x24f)]['columns']||0x78,_0x27e040=_0x5daa4e-_0x384c3f-_0x31b32d,_0x511e0b=Math[_0x2af0d6(0x1f3)](TIMELINE_CONFIG[_0x2af0d6(0x1b7)],Math[_0x2af0d6(0x21a)](_0x27e040,TIMELINE_CONFIG[_0x2af0d6(0x244)])),_0x571850=new Date(_0x383538[_0x2af0d6(0x271)])['getTime'](),_0xb5955=_0x383538[_0x2af0d6(0x265)]?new Date(_0x383538[_0x2af0d6(0x265)])[_0x2af0d6(0x18b)]():Date[_0x2af0d6(0x1ba)](),_0x388e4e={'start':_0x571850,'end':_0xb5955,'duration':_0xb5955-_0x571850},_0x188e51=new Map(),_0x7f2a00=[];for(const _0x2c9629 of _0x288f8c){if(_0x2c9629[_0x2af0d6(0x2b6)]){const _0x8edffd=new Date(_0x2c9629[_0x2af0d6(0x2b6)])[_0x2af0d6(0x18b)](),_0x489a7c=_0x2c9629['updatedAt']?new Date(_0x2c9629[_0x2af0d6(0x196)])[_0x2af0d6(0x18b)]():Date[_0x2af0d6(0x1ba)](),_0x32f9ac={'start':_0x8edffd,'end':_0x489a7c,'duration':_0x489a7c-_0x8edffd};_0x188e51[_0x2af0d6(0x17f)](_0x2c9629['id'],_0x32f9ac),_0x7f2a00['push']({'name':_0x2c9629[_0x2af0d6(0x11e)],'state':_0x2c9629[_0x2af0d6(0x176)]||_0x2af0d6(0x20b),'window':_0x32f9ac});}else _0x7f2a00[_0x2af0d6(0x228)]({'name':_0x2c9629[_0x2af0d6(0x11e)],'state':_0x2c9629[_0x2af0d6(0x176)]||_0x2af0d6(0x16c),'window':undefined});}_0x7f2a00[_0x2af0d6(0x1d9)]((_0x28e58c,_0x5aa39d)=>{const _0x5c97c=_0x2af0d6;if(!_0x28e58c[_0x5c97c(0x166)])return 0x1;if(!_0x5aa39d[_0x5c97c(0x166)])return-0x1;return _0x28e58c[_0x5c97c(0x166)]['start']-_0x5aa39d[_0x5c97c(0x166)][_0x5c97c(0x2a8)];});const _0x3a5772=_0x7f2a00[_0x2af0d6(0x21c)],_0xf875c0=_0x3a5772>TIMELINE_CONFIG[_0x2af0d6(0x1ef)];_0xf875c0&&_0x7f2a00[_0x2af0d6(0x15d)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x9f8858=calculateTimeScale(_0x388e4e,_0x511e0b),_0x432b89=_0x383538[_0x2af0d6(0x27d)]?_0x383538['success']?a41_0x536097[_0x2af0d6(0x26c)](_0x2af0d6(0x285)):a41_0x536097['red'](_0x2af0d6(0x1f1)):a41_0x536097[_0x2af0d6(0x222)]('running'),_0x14ae8c=_0x383538[_0x2af0d6(0x14f)]?.['id'],_0x6ea170=_0x383538[_0x2af0d6(0x162)];let _0x4fbb6d;if(_0x14ae8c&&_0x6ea170){const _0x295cc2=getWorkflowAttemptUrl(_0xa88bd,_0x14ae8c,_0x6ea170,_0x383538['id']);_0x4fbb6d=hyperlink(a41_0x536097[_0x2af0d6(0x1be)](_0x383538['id']),_0x295cc2);}else _0x4fbb6d=a41_0x536097[_0x2af0d6(0x1be)](_0x383538['id']);_0x16a5fd[_0x2af0d6(0x228)](_0x2af0d6(0x138)+_0x4fbb6d+_0x2af0d6(0x1f8)+_0x432b89+_0x2af0d6(0x1f8)+formatElapsed(_0x388e4e[_0x2af0d6(0x1fa)]));if(_0x7f2a00['length']>0x0){const _0x24de40=renderTimeAxis(_0x9f8858,_0x511e0b),_0x4318f9=new Date(_0x388e4e[_0x2af0d6(0x2a8)]),_0x3d8c54=formatDate(_0x4318f9),_0x15f1dc=TIMELINE_CONFIG[_0x2af0d6(0x189)]+TIMELINE_CONFIG[_0x2af0d6(0x261)]+_0x384c3f,_0x2f4cda=_0x3d8c54['padStart'](_0x15f1dc),_0x4a589b=a41_0x536097[_0x2af0d6(0x1be)](_0x2f4cda);_0x16a5fd[_0x2af0d6(0x228)](_0x4a589b+'\x20'+_0x24de40);for(const _0x418dac of _0x7f2a00){_0x16a5fd[_0x2af0d6(0x228)](renderTaskRow(_0x418dac,_0x9f8858,_0x511e0b,_0x384c3f));}const _0x43b049=calculateStats(_0x7f2a00);_0x16a5fd['push'](formatStats(_0x43b049)),_0xf875c0&&_0x16a5fd['push'](a41_0x536097['yellow'](_0x2af0d6(0x11f)+TIMELINE_CONFIG[_0x2af0d6(0x1ef)]+_0x2af0d6(0x1e2)+_0x3a5772+_0x2af0d6(0x168))),_0x16a5fd[_0x2af0d6(0x228)](''),_0x16a5fd[_0x2af0d6(0x228)](a41_0x536097['dim']('💡\x20Tip:\x20Use\x20')+(_0x2af0d6(0x27e)+_0x383538['id']+_0x2af0d6(0x135))+a41_0x536097[_0x2af0d6(0x1be)](_0x2af0d6(0x1b4)));}else _0x16a5fd['push'](_0x2af0d6(0x1ae));return _0x16a5fd[_0x2af0d6(0x1f5)]('\x0a');}['buildTimelineData'](_0x305f90,_0x3f9f52){const _0x36f2fb=a41_0x50f62,_0x25ad92=new Date(_0x305f90[_0x36f2fb(0x271)])[_0x36f2fb(0x18b)](),_0x100728=_0x305f90[_0x36f2fb(0x265)]?new Date(_0x305f90[_0x36f2fb(0x265)])[_0x36f2fb(0x18b)]():Date['now'](),_0x50c6a7=_0x100728-_0x25ad92,_0x54127f=[];for(const _0x1fdf36 of _0x3f9f52){if(_0x1fdf36[_0x36f2fb(0x2b6)]){const _0x4eab45=new Date(_0x1fdf36[_0x36f2fb(0x2b6)])[_0x36f2fb(0x18b)](),_0x5c2914=_0x1fdf36[_0x36f2fb(0x196)]?new Date(_0x1fdf36[_0x36f2fb(0x196)])[_0x36f2fb(0x18b)]():Date[_0x36f2fb(0x1ba)]();_0x54127f[_0x36f2fb(0x228)]({'name':_0x1fdf36[_0x36f2fb(0x11e)],'state':_0x1fdf36['state']||_0x36f2fb(0x20b),'window':{'start':_0x4eab45,'end':_0x5c2914,'duration':_0x5c2914-_0x4eab45}});}else _0x54127f['push']({'name':_0x1fdf36[_0x36f2fb(0x11e)],'state':_0x1fdf36[_0x36f2fb(0x176)]||_0x36f2fb(0x16c),'window':undefined});}const _0x164c6d=calculateStats(_0x54127f);return{'attempt':{'id':_0x305f90['id'],'status':_0x305f90[_0x36f2fb(0x27d)]?_0x305f90[_0x36f2fb(0x285)]?_0x36f2fb(0x285):_0x36f2fb(0x1f1):_0x36f2fb(0x16b),'createdAt':_0x305f90[_0x36f2fb(0x271)],'finishedAt':_0x305f90[_0x36f2fb(0x265)],'duration_ms':_0x50c6a7},'tasks':_0x54127f[_0x36f2fb(0x249)](_0x753e97=>({'name':_0x753e97[_0x36f2fb(0x1ea)],'state':_0x753e97[_0x36f2fb(0x176)],'startedAt':_0x753e97[_0x36f2fb(0x166)]?new Date(_0x753e97[_0x36f2fb(0x166)][_0x36f2fb(0x2a8)])[_0x36f2fb(0x1e8)]():null,'updatedAt':_0x753e97[_0x36f2fb(0x166)]?new Date(_0x753e97[_0x36f2fb(0x166)][_0x36f2fb(0x14c)])[_0x36f2fb(0x1e8)]():null,'duration_ms':_0x753e97[_0x36f2fb(0x166)]?.[_0x36f2fb(0x1fa)]||null})),'stats':_0x164c6d};}}
1
+ const a41_0x43423c=a41_0x581e;(function(_0x596159,_0x33e8c0){const _0x50da2b=a41_0x581e,_0xde2b70=_0x596159();while(!![]){try{const _0x17314e=-parseInt(_0x50da2b(0x206))/0x1*(-parseInt(_0x50da2b(0xc5))/0x2)+parseInt(_0x50da2b(0x1eb))/0x3*(parseInt(_0x50da2b(0x248))/0x4)+parseInt(_0x50da2b(0x1db))/0x5+parseInt(_0x50da2b(0x209))/0x6+-parseInt(_0x50da2b(0x15c))/0x7*(parseInt(_0x50da2b(0x13e))/0x8)+-parseInt(_0x50da2b(0x1c3))/0x9+-parseInt(_0x50da2b(0x138))/0xa*(-parseInt(_0x50da2b(0x244))/0xb);if(_0x17314e===_0x33e8c0)break;else _0xde2b70['push'](_0xde2b70['shift']());}catch(_0x121ccf){_0xde2b70['push'](_0xde2b70['shift']());}}}(a41_0x1783,0x6cf7a));import a41_0x16ed5b from'chalk';import{existsSync}from'fs';import a41_0xd8e1c9 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_0x4935b9 from'prompts';function getAttemptStatusDisplay(_0x485d17){const _0x49083e=a41_0x581e;if(!_0x485d17)return{'icon':'⏳','text':''};const {done:_0x2746de,success:_0x194b71,cancelRequested:_0x3c1c4f}=_0x485d17;if(!_0x2746de)return _0x3c1c4f?{'icon':'🛑','text':a41_0x16ed5b[_0x49083e(0xb1)](_0x49083e(0xe4))}:{'icon':'🔄','text':a41_0x16ed5b[_0x49083e(0x109)](_0x49083e(0x213))};if(_0x194b71)return{'icon':'✅','text':a41_0x16ed5b[_0x49083e(0x126)](_0x49083e(0xac))};return{'icon':'❌','text':a41_0x16ed5b[_0x49083e(0x1f5)](_0x49083e(0x1bb))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x52396f,_0x4179d5,_0x5a4d8c=0x0){const _0x227e2b=a41_0x581e;return _0x52396f[_0x5a4d8c]||_0x4179d5[_0x227e2b(0x218)];}['requireProject'](_0x1b364a,_0x96e752,_0x4f0098=0x0){const _0x5d7bd2=a41_0x581e,_0x2f3f6d=this['resolveProject'](_0x1b364a,_0x96e752,_0x4f0098);if(!_0x2f3f6d)return console[_0x5d7bd2(0x1bb)](a41_0x16ed5b[_0x5d7bd2(0x1f5)](_0x5d7bd2(0x156)),_0x5d7bd2(0xb0)),console[_0x5d7bd2(0x1bb)](a41_0x16ed5b[_0x5d7bd2(0x201)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x2f3f6d;}[a41_0x43423c(0x1df)](_0x1fb571,_0x2b4593){const _0x1123f1=a41_0x43423c;if(_0x1fb571[0x0]){const _0x3e6082=_0x1fb571[0x0][_0x1123f1(0xd0)]('.');if(_0x3e6082['length']===0x1)return{'projectName':_0x3e6082[0x0],'workflowName':undefined};else return _0x3e6082['length']===0x2?{'projectName':_0x3e6082[0x0],'workflowName':_0x3e6082[0x1]}:(console['error'](a41_0x16ed5b[_0x1123f1(0x1f5)](_0x1123f1(0x156)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2b4593['workflowProject'],'workflowName':undefined};}[a41_0x43423c(0xfc)](_0x1534ff,_0x41890f,_0x2a38a7=0x0){const _0x23477e=a41_0x43423c;if(_0x1534ff[_0x2a38a7])return _0x1534ff[_0x2a38a7];if(_0x41890f[_0x23477e(0x218)]){const _0x3009da=a41_0xd8e1c9[_0x23477e(0x222)](process[_0x23477e(0x1f0)](),_0x23477e(0x232),_0x41890f[_0x23477e(0x218)]);if(existsSync(a41_0xd8e1c9[_0x23477e(0x222)](_0x3009da,'tdx.json')))return _0x3009da;}return undefined;}async[a41_0x43423c(0x1c6)](_0x5d344e,_0x5c6835,_0x363a9b){const _0x561463=a41_0x43423c;try{const _0x2392a5=await _0x5d344e[_0x561463(0x1ab)][_0x561463(0x232)](_0x5c6835,{'limit':0x1});if(_0x2392a5['length']>0x0){const _0x40740b=_0x2392a5[0x0]['id'],_0x4feae0=getWorkflowUrl(_0x363a9b,_0x40740b);console[_0x561463(0x1bb)](_0x561463(0x133)+a41_0x16ed5b[_0x561463(0x15e)](_0x4feae0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a41_0x43423c(0x1a6);['description']=a41_0x43423c(0x149);async[a41_0x43423c(0xd8)](_0x54619c){const _0x3a9607=a41_0x43423c,{options:_0x391324,args:_0x20bd7d,tdx:_0x4426e2}=_0x54619c,_0x211619=_0x20bd7d[0x0],_0x2c56c1=_0x391324[_0x3a9607(0xc8)];if(_0x2c56c1)return saveSessionContext({'workflow_project':undefined},_0x391324[_0x3a9607(0xdc)]),console[_0x3a9607(0x24a)](a41_0x16ed5b[_0x3a9607(0x126)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x211619)return console['error'](a41_0x16ed5b[_0x3a9607(0x1f5)](_0x3a9607(0x156)),_0x3a9607(0xb0)),console['error'](a41_0x16ed5b['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x3a9607(0x1bb)](a41_0x16ed5b[_0x3a9607(0x201)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x4091e4=await withSpinner('Resolving\x20project\x20\x27'+_0x211619+_0x3a9607(0x14f),()=>_0x4426e2[_0x3a9607(0x1ab)][_0x3a9607(0x1f8)](_0x211619),{'verbose':_0x391324[_0x3a9607(0xd5)]}),{name:_0x55d041}=_0x4091e4['data'];return saveSessionContext({'workflow_project':_0x55d041},_0x391324['session']),console[_0x3a9607(0x24a)](a41_0x16ed5b[_0x3a9607(0x126)](_0x3a9607(0xba)+a41_0x16ed5b[_0x3a9607(0x15e)](_0x55d041))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:projects';[a41_0x43423c(0x105)]='List\x20all\x20workflow\x20projects';async[a41_0x43423c(0xd8)](_0x3171b9){const _0x4ccf58=a41_0x43423c,{options:_0x395061,args:_0x2b0cc9,tdx:_0x449e4f}=_0x3171b9,_0xa17371=_0x2b0cc9[0x0];_0x395061[_0x4ccf58(0xd5)]&&_0xa17371&&console[_0x4ccf58(0x1bb)](_0x4ccf58(0x182)+_0xa17371);const _0x112d1e=await withSpinner(_0x4ccf58(0x1a2),()=>_0x449e4f[_0x4ccf58(0x1ab)][_0x4ccf58(0x104)](_0xa17371,{'limit':_0x395061['limit']}),{'verbose':_0x395061[_0x4ccf58(0xd5)]});let _0x444a1d=_0x112d1e[_0x4ccf58(0x225)];_0x444a1d[_0x4ccf58(0xe2)]((_0x488c29,_0x47cdbd)=>_0x488c29[_0x4ccf58(0x103)][_0x4ccf58(0x186)](_0x47cdbd[_0x4ccf58(0x103)]));const _0x5a92f9=_0x395061[_0x4ccf58(0x11e)]||0x64,_0xb5f2f3=_0x444a1d[_0x4ccf58(0xc4)]>=_0x5a92f9?a41_0x16ed5b[_0x4ccf58(0x201)](_0x4ccf58(0xf9)):'';console[_0x4ccf58(0x1bb)]('✔\x20Found\x20'+_0x444a1d[_0x4ccf58(0xc4)]+_0x4ccf58(0xd6)+(_0x444a1d['length']!==0x1?'s':'')+_0xb5f2f3);if(_0x395061[_0x4ccf58(0xe3)]==='json'||_0x395061[_0x4ccf58(0xe3)]===_0x4ccf58(0xcb)||_0x395061[_0x4ccf58(0xe3)]===_0x4ccf58(0x101))await handleSDKOutput(_0x444a1d,_0x395061);else{if(_0x444a1d[_0x4ccf58(0xc4)]===0x0)_0xa17371?console[_0x4ccf58(0x24a)]('No\x20projects\x20match\x20pattern:\x20'+_0xa17371):console['log'](_0x4ccf58(0x108));else{const _0x12bdd8=_0x444a1d['map'](_0x49a69d=>{const _0x40cbe0=_0x4ccf58,_0x59398f=_0x49a69d['metadata']?.[_0x40cbe0(0xf6)](_0x33ce4e=>_0x33ce4e[_0x40cbe0(0x158)]===_0x40cbe0(0x117)),_0x355fb3=_0x59398f?a41_0x16ed5b['dim'](_0x40cbe0(0xe8)):'';return _0x40cbe0(0x204)+_0x49a69d[_0x40cbe0(0x103)]+_0x355fb3;});await writeOutput(_0x12bdd8[_0x4ccf58(0x222)]('\x0a'),_0x395061[_0x4ccf58(0x1b6)],_0x4ccf58(0x1e9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x115);[a41_0x43423c(0x105)]=a41_0x43423c(0xcc);async[a41_0x43423c(0xd8)](_0x5f15b4){const _0x3cf6d5=a41_0x43423c,{options:_0x591aec,args:_0x30e418,tdx:_0x360b3b}=_0x5f15b4,_0x4d35e6=this[_0x3cf6d5(0x22e)](_0x30e418,_0x591aec);_0x591aec[_0x3cf6d5(0xd5)]&&_0x4d35e6&&console[_0x3cf6d5(0x1bb)](_0x3cf6d5(0x205)+_0x4d35e6);const _0x415b03=await withSpinner(_0x3cf6d5(0x110),()=>_0x360b3b[_0x3cf6d5(0x1ab)][_0x3cf6d5(0x232)](_0x4d35e6,{'limit':_0x591aec[_0x3cf6d5(0x11e)]}),{'verbose':_0x591aec[_0x3cf6d5(0xd5)]});let _0x49b4d7=_0x415b03[_0x3cf6d5(0x225)];_0x49b4d7[_0x3cf6d5(0xe2)]((_0x3c76c0,_0x304c0f)=>{const _0x5f51bf=_0x3cf6d5,_0x547bb6=_0x3c76c0[_0x5f51bf(0x103)]['localeCompare'](_0x304c0f[_0x5f51bf(0x103)]);if(_0x547bb6!==0x0)return _0x547bb6;return(_0x3c76c0[_0x5f51bf(0x1b4)]?.['name']||'')[_0x5f51bf(0x186)](_0x304c0f['project']?.[_0x5f51bf(0x103)]||'');});const _0x92b77f=_0x591aec[_0x3cf6d5(0x11e)]||0x64,_0x6eb9ca=_0x49b4d7['length']>=_0x92b77f?a41_0x16ed5b[_0x3cf6d5(0x201)](_0x3cf6d5(0xf9)):'';console[_0x3cf6d5(0x1bb)](_0x3cf6d5(0x21a)+_0x49b4d7[_0x3cf6d5(0xc4)]+'\x20workflow'+(_0x49b4d7[_0x3cf6d5(0xc4)]!==0x1?'s':'')+_0x6eb9ca);if(_0x591aec[_0x3cf6d5(0xe3)]===_0x3cf6d5(0x239)||_0x591aec[_0x3cf6d5(0xe3)]==='jsonl'||_0x591aec[_0x3cf6d5(0xe3)]===_0x3cf6d5(0x101))await handleSDKOutput(_0x49b4d7,_0x591aec);else{if(_0x49b4d7['length']===0x0)_0x4d35e6?console[_0x3cf6d5(0x24a)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x4d35e6):console[_0x3cf6d5(0x24a)](_0x3cf6d5(0x191));else{const _0x1a9109=_0x591aec['site'],_0x191d4a=_0x49b4d7[_0x3cf6d5(0x163)](_0x3e9d13=>{const _0x1138f8=_0x3cf6d5,_0x125e19=a41_0x16ed5b[_0x1138f8(0x201)]('#'+_0x3e9d13['id']),_0x184c20=hyperlink(_0x125e19,getWorkflowUrl(_0x1a9109,_0x3e9d13['id'])),_0x443c8d=_0x3e9d13[_0x1138f8(0x1b4)]?.['name']?a41_0x16ed5b['dim']('\x20('+_0x3e9d13[_0x1138f8(0x1b4)][_0x1138f8(0x103)]+')'):'';return _0x1138f8(0x130)+_0x184c20+'\x20'+_0x3e9d13[_0x1138f8(0x103)]+_0x443c8d;});await writeOutput(_0x191d4a[_0x3cf6d5(0x222)]('\x0a'),_0x591aec['output'],_0x3cf6d5(0x1e9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1dc);[a41_0x43423c(0x105)]=a41_0x43423c(0x249);async[a41_0x43423c(0xd8)](_0xa7a782){const _0x264959=a41_0x43423c,{options:_0x27d707,args:_0x463224,tdx:_0x231e04}=_0xa7a782,_0x327dfc=this[_0x264959(0x1df)](_0x463224,_0x27d707);if(!_0x327dfc)return 0x1;const {projectName:_0x46a6fb,workflowName:_0x19c156}=_0x327dfc;if(_0x27d707[_0x264959(0xd5)]){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x1bb)](_0x264959(0x10b)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb&&console['error']('Filter:\x20project='+_0x46a6fb);const _0x49d9f9=_0x27d707[_0x264959(0x1ac)];_0x49d9f9&&console[_0x264959(0x1bb)](_0x264959(0x12a)+_0x49d9f9);}let _0x16dc65=0x28;if(process[_0x264959(0x154)][_0x264959(0x1ce)]&&!_0x27d707['output']&&!_0x27d707[_0x264959(0xe3)]){const _0x4ad96=process[_0x264959(0x154)]['rows']||0x28;_0x16dc65=Math[_0x264959(0x187)](0x14,Math['floor'](_0x4ad96*0x2/0x3));}const _0x2a42e6=_0x27d707[_0x264959(0x11e)]||_0x16dc65,_0x365234=await withSpinner(_0x264959(0x1fc),()=>_0x231e04[_0x264959(0x1ab)][_0x264959(0xb2)]({'projectName':_0x46a6fb,'workflowName':_0x19c156,'status':_0x27d707[_0x264959(0x1ac)],'fromTime':_0x27d707[_0x264959(0x11f)],'toTime':_0x27d707['to'],'limit':_0x2a42e6}),{'verbose':_0x27d707[_0x264959(0xd5)]}),_0x945fed=_0x365234[_0x264959(0x225)];_0x945fed[_0x264959(0xe2)]((_0x1ddd88,_0x27687a)=>{const _0x41358=_0x264959,_0x142721=_0x1ddd88[_0x41358(0x1c2)]||'',_0x431efd=_0x27687a['sessionTime']||'';return _0x431efd['localeCompare'](_0x142721);});_0x945fed[_0x264959(0xc4)]>=_0x2a42e6?console[_0x264959(0x1bb)](_0x264959(0x11a)+_0x945fed['length']+_0x264959(0x19f)+a41_0x16ed5b[_0x264959(0x201)](_0x264959(0xdf))):console[_0x264959(0x1bb)](_0x264959(0x21a)+_0x945fed[_0x264959(0xc4)]+'\x20session'+(_0x945fed[_0x264959(0xc4)]!==0x1?'s':''));if(_0x27d707[_0x264959(0xe3)]===_0x264959(0x239)||_0x27d707[_0x264959(0xe3)]===_0x264959(0xcb)||_0x27d707[_0x264959(0xe3)]===_0x264959(0x101))await handleSDKOutput(_0x945fed,_0x27d707);else{if(!process[_0x264959(0x154)][_0x264959(0x1ce)]||_0x27d707[_0x264959(0x1b6)]){if(_0x945fed[_0x264959(0xc4)]===0x0){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x24a)](_0x264959(0x198)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb?console[_0x264959(0x24a)](_0x264959(0x1b0)+_0x46a6fb):console[_0x264959(0x24a)](_0x264959(0x136));}else{const _0x551029=_0x27d707[_0x264959(0x24c)],_0x534772=this[_0x264959(0x13f)](_0x945fed,_0x551029);_0x27d707[_0x264959(0x1b6)]?await writeOutput(_0x534772,_0x27d707['output'],'list'):console[_0x264959(0x24a)](_0x534772);}!_0x46a6fb&&(console[_0x264959(0x1bb)](''),console[_0x264959(0x1bb)](a41_0x16ed5b['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x264959(0x1bb)](a41_0x16ed5b[_0x264959(0x201)](_0x264959(0xe0))+'or'+a41_0x16ed5b['dim'](_0x264959(0x183))));}else{if(_0x945fed[_0x264959(0xc4)]===0x0){if(_0x46a6fb&&_0x19c156)console[_0x264959(0x24a)](_0x264959(0x198)+_0x46a6fb+'.'+_0x19c156);else _0x46a6fb?console[_0x264959(0x24a)](_0x264959(0x1b0)+_0x46a6fb):console[_0x264959(0x24a)](_0x264959(0x136));}else await this[_0x264959(0xdb)](_0x945fed,_0xa7a782,_0x46a6fb);}}return 0x0;}[a41_0x43423c(0x13f)](_0x551957,_0x273cb0){const _0x365d90=a41_0x43423c,_0x38de0b=[],_0x12ea3d=new Map();let _0x95e857=Infinity,_0x5ca677=-Infinity;for(const _0x2898a7 of _0x551957){if(_0x2898a7[_0x365d90(0x16d)]?.[_0x365d90(0x12f)]){const _0x4ccb3a=new Date(_0x2898a7[_0x365d90(0x16d)][_0x365d90(0x12f)])[_0x365d90(0xad)](),_0x40a044=_0x2898a7['lastAttempt'][_0x365d90(0x1fe)]?new Date(_0x2898a7[_0x365d90(0x16d)][_0x365d90(0x1fe)])[_0x365d90(0xad)]():Date[_0x365d90(0x22a)](),_0x7e4752=_0x2898a7[_0x365d90(0x1b4)]?.['name']||'(unknown)';!_0x12ea3d[_0x365d90(0x21b)](_0x7e4752)&&_0x12ea3d[_0x365d90(0xb8)](_0x7e4752,[]),_0x12ea3d[_0x365d90(0x1d1)](_0x7e4752)['push']({'session':_0x2898a7,'startTime':_0x4ccb3a,'endTime':_0x40a044,'duration':_0x40a044-_0x4ccb3a}),_0x95e857=Math['min'](_0x95e857,_0x4ccb3a),_0x5ca677=Math['max'](_0x5ca677,_0x40a044);}}if(_0x12ea3d[_0x365d90(0xc0)]===0x0)return _0x365d90(0x131);const _0x564829=process[_0x365d90(0x154)][_0x365d90(0x19e)]||0x78,_0x38acdc=0x1e,_0x529693=0x32,_0x22f7af=0x4,_0x193766=Math[_0x365d90(0xec)](_0x529693,Math['max'](_0x38acdc,Math[_0x365d90(0x174)](_0x564829*0.3))),_0x532213=_0x564829-_0x193766-TIMELINE_CONFIG[_0x365d90(0x241)]-0x3-_0x22f7af,_0x4f70e5=_0x5ca677-_0x95e857,_0x524e84=_0x4f70e5/_0x193766,_0x3cdc00=renderTimeAxis({'startTime':_0x95e857,'endTime':_0x5ca677,'durationMs':_0x4f70e5,'msPerChar':_0x524e84},_0x193766),_0x10afd9=[];for(const _0x3f3288 of _0x12ea3d[_0x365d90(0x215)]()){_0x10afd9[_0x365d90(0x179)](..._0x3f3288);}_0x10afd9[_0x365d90(0xe2)]((_0x420a3f,_0x506066)=>_0x506066['startTime']-_0x420a3f['startTime']);const _0x4d6a6e=new Date(_0x95e857),_0x206d67=formatDate(_0x4d6a6e),_0x188f24=_0x22f7af+TIMELINE_CONFIG[_0x365d90(0x220)]+TIMELINE_CONFIG['ICON_SPACING']+_0x532213,_0x34dc6d='\x20'[_0x365d90(0x11d)](_0x188f24-_0x206d67[_0x365d90(0xc4)]),_0x58aa0b=_0x34dc6d+a41_0x16ed5b[_0x365d90(0x201)](_0x206d67)+'\x20'+_0x3cdc00;_0x38de0b[_0x365d90(0x179)](_0x58aa0b);const _0x2289fc=0x16;let _0x6c357c=0x0;for(const _0x5c1865 of _0x10afd9){const _0x8325e6=_0x5c1865['session']['project']?.[_0x365d90(0x103)]||'?',_0x54b069=Math[_0x365d90(0xec)](stringWidth(_0x8325e6),_0x2289fc);_0x6c357c=Math[_0x365d90(0x187)](_0x6c357c,_0x54b069);}for(const _0xd56f72 of _0x10afd9){const {session:_0x1e9d53,startTime:_0x1d2739,endTime:_0x4dd5ba,duration:_0xc4ea92}=_0xd56f72,_0x502c32=_0x1e9d53[_0x365d90(0x1b4)]?.['id'],_0x1a6521=_0x1e9d53['id'],_0x308d82=_0x1e9d53[_0x365d90(0x1b4)]?.[_0x365d90(0x103)]||'?',_0x4f4000=_0x1e9d53[_0x365d90(0x1ab)]?.[_0x365d90(0x103)]||'?';let _0x58d845,_0xc2ee85;if(_0x1e9d53[_0x365d90(0x16d)]){const _0x5b6ad6=_0x1e9d53[_0x365d90(0x16d)];!_0x5b6ad6[_0x365d90(0xed)]?(_0x58d845=_0x5b6ad6['cancelRequested']?'🛑':'🔄',_0xc2ee85=_0x5b6ad6['cancelRequested']?a41_0x16ed5b[_0x365d90(0xb1)]:a41_0x16ed5b[_0x365d90(0x109)]):(_0x58d845=_0x5b6ad6[_0x365d90(0xac)]?'✅':'❌',_0xc2ee85=_0x5b6ad6[_0x365d90(0xac)]?a41_0x16ed5b[_0x365d90(0x126)]:a41_0x16ed5b[_0x365d90(0x1f5)]);}else _0x58d845='⏳',_0xc2ee85=a41_0x16ed5b[_0x365d90(0x201)];const _0x12ab5e='#'+_0x1a6521,_0x21a5b6=_0x502c32?hyperlink(_0x12ab5e,getWorkflowSessionUrl(_0x273cb0,_0x502c32,_0x1a6521)):_0x12ab5e;let _0x5301ff=_0x308d82;stringWidth(_0x308d82)>_0x2289fc&&(_0x5301ff=_0x308d82['slice'](0x0,_0x2289fc-0x1)+'…');const _0x395876=a41_0x16ed5b['dim'](_0x5301ff),_0x238199=stringWidth(_0x5301ff),_0x5edc3d='\x20'[_0x365d90(0x11d)](_0x6c357c-stringWidth(_0x5301ff)+0x2),_0x34f0dc='('+formatElapsed(_0xc4ea92)+')',_0x551e15=stringWidth(_0x34f0dc),_0x40dcfa=stringWidth(_0x12ab5e),_0x2dbc5c=_0x40dcfa+0x1+_0x238199+_0x5edc3d[_0x365d90(0xc4)],_0x7f2043=_0x532213-_0x2dbc5c-_0x551e15-0x1-0x8;let _0x26134a=_0x4f4000;stringWidth(_0x26134a)>_0x7f2043&&(_0x26134a=_0x26134a[_0x365d90(0x14b)](0x0,_0x7f2043-0x1)+'…');const _0x96e920=_0x21a5b6+'\x20'+_0x395876+_0x5edc3d+_0x26134a,_0x26feed=stringWidth(_0x96e920),_0x51bb8a=_0x532213-_0x26feed-_0x551e15,_0x12d31d=_0x96e920+'\x20'[_0x365d90(0x11d)](Math[_0x365d90(0x187)](0x1,_0x51bb8a))+a41_0x16ed5b[_0x365d90(0x201)](_0x34f0dc),_0x262c69=Math[_0x365d90(0x174)]((_0x1d2739-_0x95e857)/_0x524e84),_0x3ae2cd=Math[_0x365d90(0x174)]((_0x4dd5ba-_0x95e857)/_0x524e84),_0x3424c=Math['max'](_0x262c69+0x1,_0x3ae2cd),_0x5e8145=new Array(_0x193766)[_0x365d90(0xbc)]('\x20');for(let _0x1f769d=_0x262c69;_0x1f769d<Math[_0x365d90(0xec)](_0x3424c,_0x193766);_0x1f769d++){_0x5e8145[_0x1f769d]='─';}const _0x2f07d8=_0x5e8145[_0x365d90(0x163)](_0x586bb4=>_0x586bb4==='\x20'?'\x20':_0xc2ee85(_0x586bb4))[_0x365d90(0x222)]('');_0x38de0b[_0x365d90(0x179)](_0x58d845+'\x20'+_0x12d31d+'│'+_0x2f07d8+'│');}return _0x38de0b[_0x365d90(0x222)]('\x0a');}async[a41_0x43423c(0xdb)](_0x4589f6,_0x500e7c,_0x201387){const _0xc9e80b=a41_0x43423c,{options:_0x2c5c6c,tdx:_0x982eb3}=_0x500e7c,_0x5ef5cb=_0x2c5c6c[_0xc9e80b(0x24c)],{timelineRows:_0x2a8d1b,timeAxisHeader:_0x18266e}=this[_0xc9e80b(0x116)](_0x4589f6,_0x5ef5cb),_0x44af1d=_0x2a8d1b['filter'](_0x50a202=>_0x50a202['attemptId']);if(_0x44af1d['length']===0x0){const _0x30e8e6=this[_0xc9e80b(0x13f)](_0x4589f6,_0x5ef5cb);console[_0xc9e80b(0x24a)](_0x30e8e6);!_0x201387&&(console[_0xc9e80b(0x1bb)](''),console[_0xc9e80b(0x1bb)](a41_0x16ed5b[_0xc9e80b(0x201)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0xc9e80b(0x1bb)](a41_0x16ed5b['dim'](_0xc9e80b(0xe0))+'or'+a41_0x16ed5b['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x18266e&&console[_0xc9e80b(0x24a)](_0x18266e);const _0x33eefe=_0x2a8d1b['filter'](_0x592636=>_0x592636[_0xc9e80b(0x224)])[_0xc9e80b(0x163)](_0x21d187=>({'title':_0x21d187[_0xc9e80b(0x129)],'value':_0x21d187[_0xc9e80b(0x224)]})),_0x8e165=process[_0xc9e80b(0x154)][_0xc9e80b(0x11c)]||0x3c,_0x32c4b4=Math[_0xc9e80b(0x187)](0x28,Math['floor'](_0x8e165*0x2/0x3)),_0x5e2d1f=await a41_0x4935b9({'type':_0xc9e80b(0xf3),'name':_0xc9e80b(0x224),'message':_0xc9e80b(0x10e),'choices':_0x33eefe,'initial':-0x1,'limit':_0x32c4b4,'clearFirst':!![],'fallback':{'title':_0xc9e80b(0xcf),'value':null},'suggest':(_0x594281,_0x4373df)=>{const _0x2de9ad=_0xc9e80b;if(!_0x594281)return Promise[_0x2de9ad(0x13a)](_0x4373df);const _0x4cf8d3=_0x4373df['filter'](_0x303a2f=>{const _0x30caf3=_0x2de9ad,_0x41e184=_0x303a2f;return _0x41e184[_0x30caf3(0xa6)]['toLowerCase']()[_0x30caf3(0x159)](_0x594281['toLowerCase']());});return Promise[_0x2de9ad(0x13a)](_0x4cf8d3);}}),_0x4028ed=()=>{const _0x1aee86=_0xc9e80b;process['stdout'][_0x1aee86(0x181)](_0x1aee86(0x1ba)),process['stdout'][_0x1aee86(0x181)](_0x1aee86(0x1ba)),process[_0x1aee86(0x154)][_0x1aee86(0x181)](_0x1aee86(0x1ba));},_0x4b9e3f=_0x5e2d1f&&_0x5e2d1f[_0xc9e80b(0x224)]&&_0x5e2d1f[_0xc9e80b(0x224)]!==null&&_0x5e2d1f[_0xc9e80b(0x224)]['trim']()!=='';if(!_0x4b9e3f){_0x4028ed(),console['log'](a41_0x16ed5b[_0xc9e80b(0x201)]('Cancelled'));return;}_0x4028ed();const _0xd8948b=_0x4589f6[_0xc9e80b(0xeb)](_0x133854=>_0x133854[_0xc9e80b(0x16d)]?.['id']===_0x5e2d1f[_0xc9e80b(0x224)]);if(_0xd8948b){const _0x673739=_0xd8948b[_0xc9e80b(0x1b4)]?.[_0xc9e80b(0x103)]||'?',_0x50e750=_0xd8948b[_0xc9e80b(0x1ab)]?.[_0xc9e80b(0x103)]||'?';console[_0xc9e80b(0x24a)]('Project:\x20'+a41_0x16ed5b[_0xc9e80b(0x201)](_0x673739)+_0xc9e80b(0x175)+a41_0x16ed5b[_0xc9e80b(0x201)](_0x50e750));}const _0x39f179=new WorkflowTimelineCommand();await _0x39f179[_0xc9e80b(0xd8)]({'args':[],'options':{..._0x2c5c6c,'attemptId':_0x5e2d1f[_0xc9e80b(0x224)]},'tdx':_0x982eb3});}[a41_0x43423c(0x116)](_0x450753,_0x49ae01){const _0x3b1299=a41_0x43423c,_0x36102b=new Map();for(const _0x23fd71 of _0x450753){_0x23fd71['id']&&_0x23fd71[_0x3b1299(0x16d)]?.['id']&&_0x36102b[_0x3b1299(0xb8)](_0x23fd71['id'],_0x23fd71[_0x3b1299(0x16d)]['id']);}const _0x34bf7b=[];let _0x1061fc='';const _0x1b1021=this['renderSessionsTimeline'](_0x450753,_0x49ae01),_0x6e556a=_0x1b1021[_0x3b1299(0xd0)]('\x0a');for(const _0x411ffb of _0x6e556a){if(_0x411ffb[_0x3b1299(0xee)](_0x3b1299(0x1d9))||_0x411ffb[_0x3b1299(0x223)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1061fc=_0x411ffb;else{if(_0x411ffb[_0x3b1299(0x223)](/^[✅❌🔄🛑⏳]/)){const _0x46107c=_0x411ffb['match'](/#(\d+)/),_0x4e9199=_0x46107c?_0x46107c[0x1]:null,_0x3c8dd7=_0x4e9199?_0x36102b['get'](_0x4e9199)||null:null,_0x29e75d=_0x450753[_0x3b1299(0xeb)](_0x3511fb=>_0x3511fb['id']===_0x4e9199),_0x256ab2=_0x29e75d?.[_0x3b1299(0x1b4)]?.['name']||'';_0x34bf7b[_0x3b1299(0x179)]({'displayLine':_0x411ffb,'attemptId':_0x3c8dd7,'projectName':_0x256ab2});}}}return{'timelineRows':_0x34bf7b,'timeAxisHeader':_0x1061fc};}}function a41_0x1783(){const _0x562e69=['slice','planned','workflow:upload','state','\x27...','context','targetDir','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Writing\x20files...','stdout','white','Error:','Revision:\x20','key','includes','workflow:retry','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','1753717NZFvaf','No\x20workflow\x20tdx.json\x20found','cyan','\x20from\x20session\x20','follow','Session\x20','💡\x20Tip:\x20Use\x20','map','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','LABEL_MIN_SPACING','message','/attempt/','window','workflow:delete','Dry\x20run:\x20yes','startedAt','Deleting\x20secret...','lastAttempt','workflow:clone','Pushing\x20workflow\x20project...','\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Attempt\x20ID:\x20','basename','floor',',\x20Workflow:\x20','\x20task','\x22\x20already\x20exists\x20(ID:\x20','Using\x20attempt\x20','push','workflow:tasks','fromTask','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','tasks','Loading\x20sessions...','text','stringify','write','Pattern:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','...','✔\x20Retry\x20started','localeCompare','max','\x20\x20Target:\x20','total','Loading\x20workflows...','padStart','Warning:','new','projectName','\x0aClone\x20\x22','changes','No\x20workflows\x20found','✔\x20Project:\x20','Project:\x20','workflow:timeline','🔄\x20','Source\x20directory:\x20','/sessions/','No\x20sessions\x20found\x20for:\x20','\x20\x20Project\x20ID:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Tip:\x20cd\x20to\x20workflows/','isNewProject','\x22\x20with\x20new\x20revision?','columns','\x20sessions\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','revision','Listing\x20workflow\x20projects...','icon','Fetching\x20log\x20files...','---\x20','workflow:use','Project\x20name:\x20','select','\x20tasks','sessionId','workflow','status','Error:\x20Invalid\x20parameter\x20format:\x20','Getting\x20attempt\x20tasks...','Starting\x20workflow\x20run...','No\x20sessions\x20found\x20in\x20project:\x20','pollTimeline','revision:\x20','\x27\x20from\x20project\x20\x27','project','No\x20attempts\x20found','output','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','toISOString','start','\x1b[1A\x1b[2K','error','Filter:\x20project=','TASK_NAME_WIDTH','tdx\x20wf\x20attempt\x20','keys','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','sessionTime','4169421uzaSbT','sourceProjectName','deleteSecret','showWorkflowConsoleUrl','renderSingleTimeline','✔\x20Deleted\x20project\x20','unchanged','MIN_TIMELINE_WIDTH','unknown','workflow:secrets:list','value','isTTY','Force:\x20yes','diff','get','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','getDate','From\x20task:\x20','end','download','Error:\x20Project\x20name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','yes','2066100uACeiC','workflow:sessions','\x22\x20to\x20new\x20project\x20\x22','Include\x20retried:\x20yes','parseProjectWorkflowPattern','Workflow:\x20','session:','LABEL_WIDTH_DIVISOR','\x20deleted','projectId','Usage:\x20workflow:delete\x20<project-name-or-id>','fullName','\x0aPolling...\x20(','\x20has\x20no\x20attempts','list','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','3675noFFUh','getMonth','workflow:secrets:set','delete','Auto-selected\x20latest\x20session:\x20','cwd','renderTimeline','retrySession','fileSize','requireProject','red','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','MAX_TASKS_DISPLAY','resolveProjectId','buildTimelineData','fileCount','Latest\x20session\x20has\x20no\x20attempt','Listing\x20workflow\x20sessions...','durationMs','finishedAt','params','updatedAt','dim','MIN_LABEL_COUNT','readFile','📁\x20','Project\x20filter:\x20','16253OFKTIB','setSecret','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','1245750IVMlKp','Pull\x20workflow\x20project\x20to\x20local\x20folder','Select\x20a\x20workflow\x20to\x20run','Project\x20directory:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','hasChanges','List\x20workflow\x20attempts','taskName','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','running','\x20\x20Changes:\x20','values','parse','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflowProject','\x20logs','✔\x20Found\x20','has','\x20\x20Files\x20extracted:\x20','Loading\x20session...','Downloading\x20project\x20','Key\x20cannot\x20be\x20empty','ICON_WIDTH','stat','join','match','attemptId','data','skipValidation','executePushProject','retryAttemptName','\x20\x20Revision:\x20','now','MAX_POLL_ITERATIONS','path','workflow:attempt','resolveProject','Target\x20directory:\x20','Downloading\x20logs...','Pulling\x20project\x20','workflows','isArray','run','includeRetried','⚠\x20Showing\x20first\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Analyzing\x20project...','json','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Reason:\x20','newProjectName','\x0aDry\x20run\x20-\x20nothing\x20pushed','pullProject','workflow:push','relative','GUTTER','Show\x20specific\x20attempt\x20details','cancelRequested','77TPXSmT','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Parameters:\x20','Target:\x20','472yJjnGq','List\x20workflow\x20execution\x20sessions','log','✔\x20Pushed\x20','site','\x20to\x20see\x20detailed\x20logs','Params:\x20','No\x20workflow\x20sessions\x20found','startTime','getMinutes','\x20\x20Attempt\x20ID:\x20','Total:\x20','title','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Select\x20a\x20task\x20to\x20view\x20logs:','isDirectory','\x0aFailed\x20to\x20fetch\x20attempt\x20data','filesExtracted','success','getTime','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','workflow:attempts','Project\x20name\x20is\x20required','yellow','sessions','workflow:pull','summary','Key:\x20','Cancelled','\x20modified','set','includeSubtasks','✔\x20Workflow\x20project\x20set\x20to:\x20','✔\x20Project\x20updated','fill','Deleting\x20project\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','round','size','Session\x20time:\x20','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20\x20Project:\x20','length','58VVSpTj','\x0a✔\x20Attempt\x20complete','group_error','clear','fs/promises','Updating\x20','jsonl','List\x20workflows','duration','newProjectId','No\x20matching\x20sessions\x20found','split','deleted','task','New\x20project\x20name:\x20','✔\x20New\x20project:\x20','verbose','\x20project','MAX_LABEL_COUNT','execute','utf-8','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','navigateSessionsInteractive','session','workflow:secrets:delete','param','(use\x20--limit\x20to\x20see\x20more)','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20Session\x20context\x20set\x20to:\x20','sort','format','canceling','✔\x20Pull\x20complete','executeCloneProject','dryRun','\x20(system)','Setting\x20secret...','Attempt:\x20','find','min','done','startsWith','filter','\x20-\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','applyPullProject','autocomplete','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','✔\x20Secret\x20\x27','some','\x20\x20Source:\x20','force','\x20(use\x20--limit\x20to\x20show\x20more)','\x20of\x20','Session\x20not\x20found:\x20','resolveProjectDir','trimEnd','all','\x20secret','Output\x20directory:\x20','table','retryAttempt','name','projects','description','substring','reason','No\x20workflow\x20projects\x20found','blue','Listing\x20workflow\x20attempts...','Filter:\x20','pending','Expected\x20format:\x20--param\x20key=value','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20workflows...','\x0aApply\x20these\x20changes?','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','✔\x20Push\x20complete','Retrying\x20session...','workflow:workflows','generateSessionTimelineRows','sys','type','Show\x20logs\x20for\x20a\x20workflow\x20attempt','✔\x20Showing\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','rows','repeat','limit','from','\x20\x20Session\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','index','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','No\x20attempts\x20found\x20for:\x20','targetExists','green','splice','replace','displayLine','Status:\x20','prepareCloneProject','✔\x20Workflow\x20run\x20started','Error:\x20Attempt\x20ID\x20is\x20required','modified','createdAt','📋\x20','No\x20sessions\x20with\x20timing\x20information','.\x20Expected\x20format:\x20KEY=VALUE','\x20\x20Console:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','No\x20sessions\x20found','Source\x20directory\x20is\x20required','248470ZgMgpr','Retry\x20a\x20session\x20or\x20attempt','resolve','attempt','sourceDir','✔\x20Downloaded\x20','16LtvwhA','renderSessionsTimeline','workflowName','Failed\x20to\x20fetch\x20attempt\x20data','\x20\x20Location:\x20','\x20unchanged','POLL_INTERVAL_MS','Error:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x0a⚠\x20Project\x20\x22','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Validation:\x20skipped'];a41_0x1783=function(){return _0x562e69;};return a41_0x1783();}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xaf);[a41_0x43423c(0x105)]=a41_0x43423c(0x20f);async[a41_0x43423c(0xd8)](_0x525329){const _0x51659c=a41_0x43423c,{options:_0x23f907,args:_0x56f369,tdx:_0x447f1e}=_0x525329,_0x42860a=this[_0x51659c(0x1df)](_0x56f369,_0x23f907);if(!_0x42860a)return 0x1;const {projectName:_0x1bb415,workflowName:_0x1529e1}=_0x42860a,_0x29e049=_0x23f907[_0x51659c(0x235)];if(_0x23f907[_0x51659c(0xd5)]){if(_0x1bb415&&_0x1529e1)console[_0x51659c(0x1bb)](_0x51659c(0x10b)+_0x1bb415+'.'+_0x1529e1);else _0x1bb415&&console['error'](_0x51659c(0x1bc)+_0x1bb415);_0x29e049&&console[_0x51659c(0x1bb)](_0x51659c(0x1de));}const _0xec2236=await withSpinner(_0x51659c(0x10a),()=>_0x447f1e[_0x51659c(0x1ab)]['attempts']({'projectName':_0x1bb415,'workflowName':_0x1529e1,'includeRetried':_0x29e049,'limit':_0x23f907[_0x51659c(0x11e)]}),{'verbose':_0x23f907['verbose']}),_0x5edef3=_0xec2236[_0x51659c(0x225)],_0x49e1bd=_0x23f907['limit']||0x64,_0x57d664=_0x5edef3[_0x51659c(0xc4)]>=_0x49e1bd?a41_0x16ed5b[_0x51659c(0x201)](_0x51659c(0xf9)):'';console[_0x51659c(0x1bb)](_0x51659c(0x21a)+_0x5edef3[_0x51659c(0xc4)]+_0x51659c(0x170)+(_0x5edef3[_0x51659c(0xc4)]!==0x1?'s':'')+_0x57d664);if(_0x23f907['format']==='json'||_0x23f907['format']==='jsonl'||_0x23f907['format']===_0x51659c(0x101))await handleSDKOutput(_0x5edef3,_0x23f907);else{if(_0x5edef3['length']===0x0){if(_0x1bb415&&_0x1529e1)console[_0x51659c(0x24a)](_0x51659c(0x124)+_0x1bb415+'.'+_0x1529e1);else _0x1bb415?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x1bb415):console['log'](_0x51659c(0x1b5));}else{const _0x500e7f=_0x23f907['site'],_0x44fc4f=_0x5edef3[_0x51659c(0x163)](_0x3f3f07=>{const _0x556ada=_0x51659c,_0xd2ee8=a41_0x16ed5b[_0x556ada(0x201)]('#'+_0x3f3f07['id']),_0x405419=_0x3f3f07[_0x556ada(0x1b4)]?.['id'],_0x3cdab7=_0x3f3f07['session_id']||_0x3f3f07[_0x556ada(0x1aa)],_0x432637=_0x405419&&_0x3cdab7?hyperlink(_0xd2ee8,getWorkflowAttemptUrl(_0x500e7f,_0x405419,_0x3cdab7,_0x3f3f07['id'])):_0xd2ee8,{icon:_0x5eddd8,text:_0x99a6af}=getAttemptStatusDisplay(_0x3f3f07),_0x30562a=(_0x3f3f07[_0x556ada(0x1b4)]?.[_0x556ada(0x103)]||'?')+'.'+(_0x3f3f07['workflow']?.[_0x556ada(0x103)]||'?'),_0x22a2ad=_0x3f3f07['sessionTime']?a41_0x16ed5b[_0x556ada(0x201)](_0x3f3f07[_0x556ada(0x1c2)]):'';return(_0x432637+'\x20'+_0x5eddd8+(_0x99a6af?'\x20'+_0x99a6af:'')+'\x20'+_0x30562a+'\x20'+_0x22a2ad)[_0x556ada(0xfd)]();});await writeOutput(_0x44fc4f['join']('\x0a'),_0x23f907[_0x51659c(0x1b6)],_0x51659c(0x1e9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a41_0x43423c(0x22d);['description']=a41_0x43423c(0x242);async[a41_0x43423c(0xd8)](_0x11050f){const _0x3a2302=a41_0x43423c,{options:_0x941e53,args:_0x4e31e5,tdx:_0xe45934}=_0x11050f,_0x29ba96=_0x4e31e5[0x0];if(!_0x29ba96)return console[_0x3a2302(0x1bb)](_0x3a2302(0x12d)),0x1;_0x941e53[_0x3a2302(0xd5)]&&console[_0x3a2302(0x1bb)](_0x3a2302(0x172)+_0x29ba96);const _0x56a73a=await withSpinner('Getting\x20attempt\x20details...',()=>_0xe45934[_0x3a2302(0x1ab)][_0x3a2302(0x13b)](_0x29ba96),{'verbose':_0x941e53[_0x3a2302(0xd5)]}),_0x3d3a01=_0x56a73a[_0x3a2302(0x225)];let _0x4a5f24;!_0x3d3a01['done']?_0x4a5f24=_0x3d3a01[_0x3a2302(0x243)]?_0x3a2302(0xe4):'running':_0x4a5f24=_0x3d3a01[_0x3a2302(0xac)]?_0x3a2302(0xac):_0x3a2302(0x1bb);let _0x1f3501;if(_0x3d3a01['createdAt']&&_0x3d3a01['finishedAt']){const _0x414a7b=new Date(_0x3d3a01[_0x3a2302(0x12f)])[_0x3a2302(0xad)](),_0x199a01=new Date(_0x3d3a01[_0x3a2302(0x1fe)])[_0x3a2302(0xad)]();_0x1f3501=Math[_0x3a2302(0xbf)]((_0x199a01-_0x414a7b)/0x3e8);}const _0x31c982={'attempt_id':_0x3d3a01['id'],'status':_0x4a5f24,..._0x3d3a01['index']!==undefined&&{'index':_0x3d3a01[_0x3a2302(0x122)]},..._0x3d3a01[_0x3a2302(0x1b4)]&&{'project':_0x3d3a01[_0x3a2302(0x1b4)][_0x3a2302(0x103)]},..._0x3d3a01[_0x3a2302(0x1ab)]&&{'workflow':_0x3d3a01[_0x3a2302(0x1ab)]['name']},..._0x3d3a01[_0x3a2302(0x1aa)]&&{'session_id':_0x3d3a01[_0x3a2302(0x1aa)]},..._0x3d3a01[_0x3a2302(0x1c2)]&&{'session_time':_0x3d3a01[_0x3a2302(0x1c2)]},..._0x3d3a01[_0x3a2302(0x228)]&&{'retry_attempt':_0x3d3a01[_0x3a2302(0x228)]},..._0x1f3501!==undefined&&{'duration_sec':_0x1f3501},..._0x3d3a01[_0x3a2302(0x12f)]&&{'created_at':_0x3d3a01['createdAt']},..._0x3d3a01['finishedAt']&&{'finished_at':_0x3d3a01['finishedAt']},...Object[_0x3a2302(0x1bf)](_0x3d3a01['params'])[_0x3a2302(0xc4)]>0x0&&{'params':_0x3d3a01[_0x3a2302(0x1ff)]}};return await handleSingleObjectOutput(_0x31c982,_0x941e53),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x17a);[a41_0x43423c(0x105)]='Show\x20tasks\x20for\x20an\x20attempt';async[a41_0x43423c(0xd8)](_0x112910){const _0x14f751=a41_0x43423c,{options:_0x4ecb47,args:_0x141fc5,tdx:_0x13f178}=_0x112910,_0x495610=_0x141fc5[0x0];if(!_0x495610)return console[_0x14f751(0x1bb)](_0x14f751(0x12d)),0x1;const _0x4741d2=_0x4ecb47[_0x14f751(0xb9)];_0x4ecb47[_0x14f751(0xd5)]&&(console[_0x14f751(0x1bb)](_0x14f751(0x172)+_0x495610),_0x4741d2&&console[_0x14f751(0x1bb)]('Including\x20subtasks:\x20yes'));const _0x2bcc46=await withSpinner(_0x14f751(0x1ae),()=>_0x13f178[_0x14f751(0x1ab)][_0x14f751(0x17d)](_0x495610,_0x4741d2||![]),{'verbose':_0x4ecb47[_0x14f751(0xd5)]}),_0x25df4f=_0x2bcc46['data'];return console[_0x14f751(0x1bb)](_0x14f751(0x21a)+_0x25df4f['length']+_0x14f751(0x176)+(_0x25df4f[_0x14f751(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x25df4f,_0x4ecb47),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:logs';[a41_0x43423c(0x105)]=a41_0x43423c(0x119);async[a41_0x43423c(0xd8)](_0x14067f){const _0x2a8f46=a41_0x43423c,{options:_0x55fc78,args:_0x220774,tdx:_0x548cc5}=_0x14067f,_0x599597=_0x220774[0x0];let _0x6b663a=_0x220774[0x1];if(!_0x599597)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x55fc78[_0x2a8f46(0xd5)]&&(console[_0x2a8f46(0x1bb)](_0x2a8f46(0x172)+_0x599597),_0x6b663a&&console[_0x2a8f46(0x1bb)]('Task\x20name:\x20'+_0x6b663a));const _0x1b46ae=await withSpinner(_0x2a8f46(0x1a4),()=>_0x548cc5[_0x2a8f46(0x1ab)]['logFiles'](_0x599597,_0x6b663a),{'verbose':_0x55fc78['verbose']}),_0x4932b9=_0x1b46ae[_0x2a8f46(0x225)];if(_0x4932b9[_0x2a8f46(0xc4)]===0x0)return console[_0x2a8f46(0x1bb)](_0x2a8f46(0x134)),0x0;if(!_0x6b663a&&(_0x55fc78[_0x2a8f46(0x239)]||_0x55fc78[_0x2a8f46(0xe3)]))return await handleSDKOutput(_0x4932b9,_0x55fc78),0x0;if(!_0x6b663a){const _0x1eb57e=_0x4932b9[_0x2a8f46(0x163)](_0x5be0d6=>({'title':_0x5be0d6[_0x2a8f46(0x210)]+'\x20('+formatBytes(_0x5be0d6[_0x2a8f46(0x1f3)])+')','value':_0x5be0d6[_0x2a8f46(0x210)]})),_0x38bd5d=await a41_0x4935b9({'type':'select','name':_0x2a8f46(0xd2),'message':_0x2a8f46(0xa8),'choices':_0x1eb57e});if(!_0x38bd5d[_0x2a8f46(0xd2)])return console[_0x2a8f46(0x1bb)](_0x2a8f46(0xb6)),0x0;_0x6b663a=_0x38bd5d[_0x2a8f46(0xd2)];}const _0x533c50=await withSpinner(_0x2a8f46(0x230),()=>_0x548cc5[_0x2a8f46(0x1ab)]['logs'](_0x599597,_0x6b663a),{'verbose':_0x55fc78[_0x2a8f46(0xd5)]}),_0x47b859=_0x533c50[_0x2a8f46(0x225)];return _0x47b859?console['log'](_0x47b859):console[_0x2a8f46(0x1bb)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:kill';[a41_0x43423c(0x105)]='Kill\x20a\x20running\x20attempt';async['execute'](_0x8ab74f){const _0x2b6ddc=a41_0x43423c,{options:_0x5adf8a,args:_0x14af80,tdx:_0x407214}=_0x8ab74f,_0x4e2e7d=_0x14af80[0x0];if(!_0x4e2e7d)return console[_0x2b6ddc(0x1bb)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x153c70=_0x5adf8a[_0x2b6ddc(0x107)];_0x5adf8a[_0x2b6ddc(0xd5)]&&(console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0x172)+_0x4e2e7d),_0x153c70&&console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0x23b)+_0x153c70));if(!_0x5adf8a[_0x2b6ddc(0x1da)]){const _0x47024b=await confirmKey(_0x2b6ddc(0x171)+_0x4e2e7d+'?');if(!_0x47024b)return console[_0x2b6ddc(0x1bb)](_0x2b6ddc(0xb6)),0x0;}const _0x7f9552=await withSpinner('Killing\x20attempt...',()=>_0x407214[_0x2b6ddc(0x1ab)]['kill'](_0x4e2e7d,_0x153c70),{'verbose':_0x5adf8a['verbose']}),_0xe8416a=_0x7f9552[_0x2b6ddc(0x225)];return console[_0x2b6ddc(0x1bb)]('✔\x20'+_0xe8416a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a41_0x43423c(0x15a);[a41_0x43423c(0x105)]=a41_0x43423c(0x139);async[a41_0x43423c(0xd8)](_0x14377f){const _0x1f1aca=a41_0x43423c,{options:_0x45ac63,args:_0x9d7877,tdx:_0x416d12}=_0x14377f,_0x212bb8=_0x9d7877[0x0];if(!_0x212bb8)return console['error'](_0x1f1aca(0x147)),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x17c)),0x1;let _0x5d0425=![],_0x22191e=_0x212bb8;if(_0x212bb8[_0x1f1aca(0xee)](_0x1f1aca(0x1e1)))_0x5d0425=!![],_0x22191e=_0x212bb8[_0x1f1aca(0x106)](0x8);else{if(_0x212bb8['startsWith']('attempt:'))_0x5d0425=![],_0x22191e=_0x212bb8[_0x1f1aca(0x106)](0x8);else return console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1c1)),console[_0x1f1aca(0x1bb)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x313bed=_0x45ac63[_0x1f1aca(0x17b)],_0x1b6966=_0x45ac63['resumeFrom'],_0x33c8cd=_0x45ac63[_0x1f1aca(0x1ff)],_0x4e5914=_0x45ac63[_0x1f1aca(0xf8)];_0x45ac63[_0x1f1aca(0xd5)]&&(console[_0x1f1aca(0x1bb)](_0x1f1aca(0x247)+(_0x5d0425?_0x1f1aca(0xdc):_0x1f1aca(0x13b))+'\x20'+_0x22191e),_0x313bed&&console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1d5)+_0x313bed),_0x1b6966&&console[_0x1f1aca(0x1bb)]('Resume\x20from:\x20'+_0x1b6966),_0x33c8cd&&console['error'](_0x1f1aca(0x24e)+_0x33c8cd),_0x4e5914&&console[_0x1f1aca(0x1bb)](_0x1f1aca(0x1cf)));let _0x1a1556;if(_0x33c8cd)try{if(_0x33c8cd[_0x1f1aca(0xee)]('@')){const _0x164765=await import(_0x1f1aca(0xc9)),_0x206035=_0x33c8cd[_0x1f1aca(0x106)](0x1),_0x3d9fc3=await _0x164765[_0x1f1aca(0x203)](_0x206035,_0x1f1aca(0xd9));_0x1a1556=JSON['parse'](_0x3d9fc3);}else _0x1a1556=JSON[_0x1f1aca(0x216)](_0x33c8cd);}catch{return console[_0x1f1aca(0x1bb)](_0x1f1aca(0xc2)),0x1;}if(!_0x45ac63[_0x1f1aca(0x1da)]){const _0xabc982=await confirmKey(_0x1f1aca(0x1ea)+(_0x5d0425?_0x1f1aca(0xdc):'attempt')+'\x20'+_0x22191e+'?');if(!_0xabc982)return console[_0x1f1aca(0x1bb)](_0x1f1aca(0xb6)),0x0;}let _0x4412ab;_0x5d0425?_0x4412ab=await withSpinner(_0x1f1aca(0x114),()=>_0x416d12[_0x1f1aca(0x1ab)][_0x1f1aca(0x1f2)](_0x22191e,{'fromTask':_0x313bed,'retryParams':_0x1a1556}),{'verbose':_0x45ac63[_0x1f1aca(0xd5)]}):_0x4412ab=await withSpinner('Retrying\x20attempt...',()=>_0x416d12[_0x1f1aca(0x1ab)][_0x1f1aca(0x102)](_0x22191e,{'resumeFrom':_0x1b6966,'retryParams':_0x1a1556,'force':_0x4e5914}),{'verbose':_0x45ac63[_0x1f1aca(0xd5)]});const _0x132d04=_0x4412ab[_0x1f1aca(0x225)];return console[_0x1f1aca(0x1bb)](_0x1f1aca(0x185)),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x10f)+_0x132d04[_0x1f1aca(0x224)]),console[_0x1f1aca(0x1bb)](_0x1f1aca(0x120)+_0x132d04[_0x1f1aca(0x1aa)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]='workflow:run';[a41_0x43423c(0x105)]='Start\x20a\x20workflow\x20run';async['execute'](_0x2d70dc){const _0x304b3f=a41_0x43423c,{options:_0x214d27,args:_0x3c55c1,tdx:_0x27bda0}=_0x2d70dc;let _0x31a53a=_0x3c55c1[0x0];if(!_0x31a53a){const _0x46d31a=this[_0x304b3f(0x22e)]([],_0x214d27),_0x32fda3=await withSpinner(_0x304b3f(0x18a),()=>_0x27bda0[_0x304b3f(0x1ab)][_0x304b3f(0x232)](_0x46d31a,{'limit':_0x214d27['limit']}),{'verbose':_0x214d27['verbose']}),_0x168ba4=_0x32fda3[_0x304b3f(0x225)];if(_0x168ba4[_0x304b3f(0xc4)]===0x0)return console['error'](_0x304b3f(0x191)),!_0x46d31a&&console[_0x304b3f(0x1bb)](a41_0x16ed5b[_0x304b3f(0x201)](_0x304b3f(0x164))),0x1;const _0xe6c7d4=_0x168ba4[_0x304b3f(0x163)](_0x236a3b=>({'title':_0x236a3b[_0x304b3f(0x1b4)]?.[_0x304b3f(0x103)]+'.'+_0x236a3b[_0x304b3f(0x103)],'value':_0x236a3b[_0x304b3f(0x1b4)]?.['name']+'.'+_0x236a3b[_0x304b3f(0x103)],'description':_0x236a3b['revision']?_0x304b3f(0x1b2)+_0x236a3b[_0x304b3f(0x1a1)]:undefined})),_0x54db25=await a41_0x4935b9({'type':'select','name':_0x304b3f(0x1ab),'message':_0x304b3f(0x20b),'choices':_0xe6c7d4});if(!_0x54db25[_0x304b3f(0x1ab)])return 0x1;_0x31a53a=_0x54db25['workflow'];}if(!_0x31a53a[_0x304b3f(0x159)]('.')){const _0x4ba1c9=this['resolveProject']([],_0x214d27);if(_0x4ba1c9)_0x31a53a=_0x4ba1c9+'.'+_0x31a53a;else return console[_0x304b3f(0x1bb)](a41_0x16ed5b[_0x304b3f(0x1f5)](_0x304b3f(0x156)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a41_0x16ed5b[_0x304b3f(0x201)](_0x304b3f(0x164))),0x1;}const _0x565bbb=_0x214d27[_0x304b3f(0xde)],_0x3f4971=_0x214d27['sessionTime'],_0x537c85={};if(_0x565bbb&&Array[_0x304b3f(0x233)](_0x565bbb))for(const _0x9f5acd of _0x565bbb){const _0x687620=_0x9f5acd['indexOf']('=');if(_0x687620===-0x1)return console[_0x304b3f(0x1bb)](_0x304b3f(0x1ad)+_0x9f5acd),console[_0x304b3f(0x1bb)](_0x304b3f(0x10d)),0x1;const _0x590260=_0x9f5acd[_0x304b3f(0x106)](0x0,_0x687620),_0x558037=_0x9f5acd['substring'](_0x687620+0x1);try{_0x537c85[_0x590260]=JSON['parse'](_0x558037);}catch{_0x537c85[_0x590260]=_0x558037;}}_0x214d27[_0x304b3f(0xd5)]&&(console['error'](_0x304b3f(0x1e0)+_0x31a53a),Object[_0x304b3f(0x1bf)](_0x537c85)['length']>0x0&&console[_0x304b3f(0x1bb)](_0x304b3f(0x246)+JSON[_0x304b3f(0x180)](_0x537c85)),_0x3f4971&&console[_0x304b3f(0x1bb)](_0x304b3f(0xc1)+_0x3f4971));const _0x452778=await withSpinner(_0x304b3f(0x1af),()=>_0x27bda0['workflow'][_0x304b3f(0x234)](_0x31a53a,_0x537c85,{'sessionTime':_0x3f4971}),{'verbose':_0x214d27['verbose']}),_0x454a2c=_0x452778[_0x304b3f(0x225)];console[_0x304b3f(0x1bb)](_0x304b3f(0x12c)),console[_0x304b3f(0x1bb)](_0x304b3f(0x252)+_0x454a2c['id']),console['error'](_0x304b3f(0x120)+_0x454a2c[_0x304b3f(0x1aa)]),console[_0x304b3f(0x1bb)](_0x304b3f(0xc3)+_0x454a2c[_0x304b3f(0x1b4)]?.[_0x304b3f(0x103)]),console['error']('\x20\x20Workflow:\x20'+_0x454a2c[_0x304b3f(0x1ab)]?.['name']);if(_0x454a2c[_0x304b3f(0x1b4)]?.['id']&&_0x454a2c['sessionId']&&_0x454a2c['id']){const _0x9c5609=_0x214d27[_0x304b3f(0x24c)],_0x348792=getConsoleUrl(_0x9c5609,'/app/workflows/'+_0x454a2c['project']['id']+_0x304b3f(0x197)+_0x454a2c[_0x304b3f(0x1aa)]+_0x304b3f(0x167)+_0x454a2c['id']);console[_0x304b3f(0x1bb)](_0x304b3f(0x133)+a41_0x16ed5b[_0x304b3f(0x15e)](_0x348792));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a41_0x43423c(0x103)]='workflow:download';[a41_0x43423c(0x105)]=a41_0x43423c(0x146);async[a41_0x43423c(0xd8)](_0x2a1771){const _0x53f970=a41_0x43423c,{options:_0xf471ed,args:_0x45880b,tdx:_0x51c450}=_0x2a1771,_0x10740c=_0x45880b[0x0],_0x3bbec5=_0x45880b[0x1]||'.';if(!_0x10740c)return console[_0x53f970(0x1bb)](_0x53f970(0x1d8)),console[_0x53f970(0x1bb)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x14a9ee=_0xf471ed[_0x53f970(0x1a1)];_0xf471ed[_0x53f970(0xd5)]&&(console[_0x53f970(0x1bb)](_0x53f970(0x193)+_0x10740c),console['error'](_0x53f970(0x100)+_0x3bbec5),_0x14a9ee&&console[_0x53f970(0x1bb)](_0x53f970(0x157)+_0x14a9ee));const _0x37e6c1=await withSpinner(_0x53f970(0x21e)+_0x10740c+_0x53f970(0x184),()=>_0x51c450[_0x53f970(0x1ab)][_0x53f970(0x1d7)](_0x10740c,_0x3bbec5,{'revision':_0x14a9ee}),{'verbose':_0xf471ed['verbose']}),_0x589567=_0x37e6c1[_0x53f970(0x225)];return console[_0x53f970(0x1bb)](_0x53f970(0x13d)+_0x589567['projectName']),console[_0x53f970(0x1bb)](_0x53f970(0x229)+_0x589567[_0x53f970(0x1a1)]),console[_0x53f970(0x1bb)](_0x53f970(0x21c)+_0x589567[_0x53f970(0xab)]),console[_0x53f970(0x1bb)](_0x53f970(0x142)+_0x3bbec5+'/'+_0x589567[_0x53f970(0x18e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x14d);[a41_0x43423c(0x105)]=a41_0x43423c(0x1d2);async[a41_0x43423c(0xd8)](_0x3da3d0){const _0x8b475e=a41_0x43423c,{options:_0x569c1c,args:_0xe0a16a,tdx:_0x1059b4}=_0x3da3d0;let _0x4c9256='.',_0x5f2fc3=_0x569c1c[_0x8b475e(0x103)];if(_0xe0a16a[0x0]){const {promises:_0x2271bb}=await import('fs');try{const _0x232589=await _0x2271bb[_0x8b475e(0x221)](_0xe0a16a[0x0]);if(_0x232589[_0x8b475e(0xa9)]())_0x4c9256=_0xe0a16a[0x0];else return console['error'](_0x8b475e(0x145)+_0xe0a16a[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x5f2fc3=_0xe0a16a[0x0],_0x4c9256='.';}}const _0x3f0cdf=_0x569c1c['revision'],_0x10d56b=_0x569c1c[_0x8b475e(0x226)];_0x569c1c['verbose']&&(console[_0x8b475e(0x1bb)](_0x8b475e(0x20c)+_0x4c9256),_0x5f2fc3&&console[_0x8b475e(0x1bb)](_0x8b475e(0x1a7)+_0x5f2fc3),_0x3f0cdf&&console[_0x8b475e(0x1bb)](_0x8b475e(0x157)+_0x3f0cdf),_0x10d56b&&console[_0x8b475e(0x1bb)](_0x8b475e(0x14a)));const _0x25970c=await withSpinner(_0x8b475e(0x16f),()=>_0x1059b4[_0x8b475e(0x1ab)]['push'](_0x4c9256,{'projectName':_0x5f2fc3,'revision':_0x3f0cdf,'skipValidation':_0x10d56b}),{'verbose':_0x569c1c[_0x8b475e(0xd5)]}),_0x5377e8=_0x25970c[_0x8b475e(0x225)];return console['error'](_0x8b475e(0x24b)+_0x5377e8['projectName']),console['error']('\x20\x20Project\x20ID:\x20'+_0x5377e8[_0x8b475e(0x1e4)]),console['error'](_0x8b475e(0x229)+_0x5377e8[_0x8b475e(0x1a1)]),await this['showWorkflowConsoleUrl'](_0x1059b4,_0x5377e8[_0x8b475e(0x18e)],_0x569c1c[_0x8b475e(0x24c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xb3);[a41_0x43423c(0x105)]=a41_0x43423c(0x20a);async[a41_0x43423c(0xd8)](_0x46fd17){const _0x2fde4d=a41_0x43423c,{options:_0x12bcd9,args:_0x4936a5,tdx:_0x36d885}=_0x46fd17,_0x5b1501=_0x4936a5[0x0],_0x52a416=_0x4936a5[0x1];if(!_0x5b1501)return console['error'](a41_0x16ed5b[_0x2fde4d(0x1f5)](_0x2fde4d(0x156)),_0x2fde4d(0xb0)),console['error'](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0xda))),0x1;const _0x267377=_0x12bcd9[_0x2fde4d(0x1a1)];_0x12bcd9[_0x2fde4d(0xd5)]&&(console['error'](_0x2fde4d(0x193)+_0x5b1501),_0x52a416&&console['error'](_0x2fde4d(0x22f)+_0x52a416),_0x267377&&console[_0x2fde4d(0x1bb)](_0x2fde4d(0x157)+_0x267377),_0x12bcd9[_0x2fde4d(0xe7)]&&console[_0x2fde4d(0x1bb)](_0x2fde4d(0x16a)));const _0x38fccf=await withSpinner(_0x2fde4d(0x231)+_0x5b1501+_0x2fde4d(0x184),()=>_0x36d885[_0x2fde4d(0x1ab)][_0x2fde4d(0x23e)](_0x5b1501,{'targetDir':_0x52a416,'revision':_0x267377}),{'verbose':_0x12bcd9[_0x2fde4d(0xd5)]}),_0x5de46f=_0x38fccf[_0x2fde4d(0x225)];_0x5de46f[_0x2fde4d(0x19c)]?console[_0x2fde4d(0x1bb)](_0x2fde4d(0xd4)+_0x5de46f[_0x2fde4d(0x18e)]):console[_0x2fde4d(0x1bb)](_0x2fde4d(0x192)+_0x5de46f[_0x2fde4d(0x18e)]);console[_0x2fde4d(0x1bb)](_0x2fde4d(0x229)+_0x5de46f[_0x2fde4d(0x1a1)]),console[_0x2fde4d(0x1bb)](_0x2fde4d(0x188)+(a41_0xd8e1c9[_0x2fde4d(0x240)](process['cwd'](),_0x5de46f[_0x2fde4d(0x151)])||'.')),console[_0x2fde4d(0x1bb)](_0x2fde4d(0x214)+a41_0x16ed5b[_0x2fde4d(0x126)]('+'+_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0x18d)]+'\x20new')+',\x20'+(a41_0x16ed5b[_0x2fde4d(0xb1)]('~'+_0x5de46f['summary'][_0x2fde4d(0x12e)]+_0x2fde4d(0xb7))+',\x20')+(a41_0x16ed5b[_0x2fde4d(0x1f5)]('-'+_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0xd1)]+_0x2fde4d(0x1e3))+',\x20')+(''+a41_0x16ed5b[_0x2fde4d(0x201)](_0x5de46f[_0x2fde4d(0xb4)][_0x2fde4d(0x1c9)]+'\x20unchanged')));for(const _0x575617 of _0x5de46f['changes']){_0x575617[_0x2fde4d(0x118)]==='modified'&&_0x575617['diff']&&(console[_0x2fde4d(0x1bb)]('\x0a'+a41_0x16ed5b[_0x2fde4d(0x15e)]('---\x20'+_0x575617[_0x2fde4d(0x22c)])),console[_0x2fde4d(0x1bb)](_0x575617[_0x2fde4d(0x1d0)]));}if(!_0x5de46f['hasChanges'])return saveSessionContext({'workflow_project':_0x5de46f[_0x2fde4d(0x18e)]},_0x12bcd9[_0x2fde4d(0xdc)]),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x126)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0xe1)+_0x5de46f[_0x2fde4d(0x18e)])),0x0;if(_0x12bcd9['dryRun'])return console['error'](a41_0x16ed5b[_0x2fde4d(0xb1)](_0x2fde4d(0x20d))),0x0;if(!_0x12bcd9[_0x2fde4d(0x1da)]){const _0x193e59=await confirmKey(_0x2fde4d(0x111));if(!_0x193e59)return console[_0x2fde4d(0x1bb)](_0x2fde4d(0xb6)),0x0;}await withSpinner(_0x2fde4d(0x153),()=>_0x36d885['workflow'][_0x2fde4d(0xf2)](_0x5de46f,{'revision':_0x267377}),{'verbose':_0x12bcd9[_0x2fde4d(0xd5)]}),saveSessionContext({'workflow_project':_0x5de46f[_0x2fde4d(0x18e)]},_0x12bcd9['session']),console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x126)](_0x2fde4d(0xe5)));const _0x262137=a41_0xd8e1c9['relative'](process['cwd'](),_0x5de46f[_0x2fde4d(0x151)])||'.';return console[_0x2fde4d(0x1bb)](a41_0x16ed5b[_0x2fde4d(0x201)](_0x2fde4d(0x142)+_0x262137)),console[_0x2fde4d(0x1bb)](a41_0x16ed5b['dim'](_0x2fde4d(0xe1)+_0x5de46f[_0x2fde4d(0x18e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x23f);[a41_0x43423c(0x105)]=a41_0x43423c(0xbe);async[a41_0x43423c(0xd8)](_0x1a3561){const _0x3ecc11=a41_0x43423c,{options:_0x108ee0,args:_0x222faf,tdx:_0x2a2157}=_0x1a3561,_0x24f3ae=this['resolveProjectDir'](_0x222faf,_0x108ee0),_0x2c54d9=_0x108ee0[_0x3ecc11(0x1a1)],_0x2efcd0=_0x108ee0[_0x3ecc11(0x226)];_0x108ee0['verbose']&&(_0x24f3ae&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x196)+_0x24f3ae),_0x2c54d9&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x157)+_0x2c54d9),_0x108ee0[_0x3ecc11(0xe7)]&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x16a)),_0x2efcd0&&console[_0x3ecc11(0x1bb)](_0x3ecc11(0x14a)));let _0x18b89d;try{_0x18b89d=await withSpinner('Analyzing\x20changes...',()=>_0x2a2157[_0x3ecc11(0x1ab)]['preparePushProject']({'sourceDir':_0x24f3ae,'revision':_0x2c54d9,'skipValidation':_0x2efcd0}),{'verbose':_0x108ee0['verbose']});}catch(_0x3435be){if(_0x3435be instanceof Error&&_0x3435be[_0x3ecc11(0x166)][_0x3ecc11(0x159)](_0x3ecc11(0x15d)))return console[_0x3ecc11(0x1bb)](a41_0x16ed5b['red'](_0x3ecc11(0x156)),_0x3ecc11(0x1b7)),_0x108ee0[_0x3ecc11(0x218)]?console[_0x3ecc11(0x1bb)](a41_0x16ed5b[_0x3ecc11(0x201)](_0x3ecc11(0x19b)+_0x108ee0[_0x3ecc11(0x218)]+_0x3ecc11(0x152)+_0x108ee0[_0x3ecc11(0x218)]+'\x27')):console['error'](a41_0x16ed5b['dim'](_0x3ecc11(0xf1))),0x1;throw _0x3435be;}const _0x5762d6=_0x18b89d['data'];console[_0x3ecc11(0x1bb)]('✔\x20Project:\x20'+_0x5762d6['projectName']),console['error'](_0x3ecc11(0xf7)+_0x5762d6[_0x3ecc11(0x13c)]),console['error'](_0x3ecc11(0x229)+_0x5762d6[_0x3ecc11(0x1a1)]),console['error'](_0x3ecc11(0x214)+a41_0x16ed5b[_0x3ecc11(0x126)]('+'+_0x5762d6['summary'][_0x3ecc11(0x18d)]+'\x20new')+',\x20'+(a41_0x16ed5b[_0x3ecc11(0xb1)]('~'+_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0x12e)]+_0x3ecc11(0xb7))+',\x20')+(a41_0x16ed5b[_0x3ecc11(0x1f5)]('-'+_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0xd1)]+_0x3ecc11(0x1e3))+',\x20')+(''+a41_0x16ed5b[_0x3ecc11(0x201)](_0x5762d6[_0x3ecc11(0xb4)][_0x3ecc11(0x1c9)]+_0x3ecc11(0x143))));for(const _0x55fe3c of _0x5762d6[_0x3ecc11(0x190)]){_0x55fe3c[_0x3ecc11(0x118)]==='modified'&&_0x55fe3c[_0x3ecc11(0x1d0)]&&(console[_0x3ecc11(0x1bb)]('\x0a'+a41_0x16ed5b['cyan'](_0x3ecc11(0x1a5)+_0x55fe3c[_0x3ecc11(0x22c)])),console[_0x3ecc11(0x1bb)](_0x55fe3c[_0x3ecc11(0x1d0)]));}if(!_0x5762d6[_0x3ecc11(0x20e)])return console[_0x3ecc11(0x1bb)](a41_0x16ed5b[_0x3ecc11(0x126)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x3ecc11(0x1c6)](_0x2a2157,_0x5762d6[_0x3ecc11(0x18e)],_0x108ee0['site']),0x0;if(_0x108ee0['dryRun'])return console[_0x3ecc11(0x1bb)](a41_0x16ed5b['yellow'](_0x3ecc11(0x23d))),0x0;if(!_0x108ee0[_0x3ecc11(0x1da)]){const _0xf63c9e=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0xf63c9e)return console[_0x3ecc11(0x1bb)](_0x3ecc11(0xb6)),0x0;}const _0x1eb176=await withSpinner('Pushing\x20project...',()=>_0x2a2157[_0x3ecc11(0x1ab)][_0x3ecc11(0x227)](_0x5762d6),{'verbose':_0x108ee0[_0x3ecc11(0xd5)]}),_0x2d8428=_0x1eb176[_0x3ecc11(0x225)];return console['error'](a41_0x16ed5b[_0x3ecc11(0x126)](_0x3ecc11(0x113))),console[_0x3ecc11(0x1bb)]('\x20\x20Project\x20ID:\x20'+_0x2d8428[_0x3ecc11(0x1e4)]),console[_0x3ecc11(0x1bb)]('\x20\x20Revision:\x20'+_0x2d8428[_0x3ecc11(0x1a1)]),await this[_0x3ecc11(0x1c6)](_0x2a2157,_0x2d8428[_0x3ecc11(0x18e)],_0x108ee0[_0x3ecc11(0x24c)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a41_0x43423c(0x16e);[a41_0x43423c(0x105)]=a41_0x43423c(0x15b);async[a41_0x43423c(0xd8)](_0x95dbd0){const _0x4f6b55=a41_0x43423c,{options:_0x4605ca,args:_0x49438b,tdx:_0xd57c88}=_0x95dbd0,_0x280358=this[_0x4f6b55(0xfc)](_0x49438b,_0x4605ca),_0x60c7f6=_0x4605ca[_0x4f6b55(0x103)],_0x2c3665=_0x4605ca['revision'],_0x358c71=_0x4605ca['skipValidation'];if(!_0x280358)return console['error'](a41_0x16ed5b[_0x4f6b55(0x1f5)](_0x4f6b55(0x156)),_0x4f6b55(0x137)),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)](_0x4f6b55(0x1f6))),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x60c7f6)return console['error'](a41_0x16ed5b[_0x4f6b55(0x1f5)]('Error:'),_0x4f6b55(0xae)),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x201)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4605ca[_0x4f6b55(0xd5)]&&(console[_0x4f6b55(0x1bb)](_0x4f6b55(0x196)+_0x280358),console[_0x4f6b55(0x1bb)](_0x4f6b55(0xd3)+_0x60c7f6),_0x2c3665&&console[_0x4f6b55(0x1bb)]('Revision:\x20'+_0x2c3665),_0x4605ca[_0x4f6b55(0xe7)]&&console['error']('Dry\x20run:\x20yes'),_0x358c71&&console[_0x4f6b55(0x1bb)](_0x4f6b55(0x14a)));const _0xecf573=await withSpinner(_0x4f6b55(0x238),()=>_0xd57c88['workflow'][_0x4f6b55(0x12b)](_0x280358,_0x60c7f6,{'revision':_0x2c3665,'skipValidation':_0x358c71}),{'verbose':_0x4605ca[_0x4f6b55(0xd5)]}),_0xfe44b0=_0xecf573[_0x4f6b55(0x225)];console['error']('Source:\x20'+_0xfe44b0['sourceDir']);_0xfe44b0[_0x4f6b55(0x1c4)]&&console[_0x4f6b55(0x1bb)]('Source\x20project:\x20'+_0xfe44b0[_0x4f6b55(0x1c4)]);console['error'](_0x4f6b55(0xd3)+_0xfe44b0[_0x4f6b55(0x23c)]),console['error'](_0x4f6b55(0x157)+_0xfe44b0[_0x4f6b55(0x1a1)]),console[_0x4f6b55(0x1bb)]('Files\x20to\x20upload:\x20'+_0xfe44b0[_0x4f6b55(0x1fa)]);_0xfe44b0[_0x4f6b55(0x125)]&&(console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x148)+_0xfe44b0['newProjectName']+_0x4f6b55(0x177)+_0xfe44b0['existingProjectId']+')')),console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x208))));if(_0x4605ca[_0x4f6b55(0xe7)])return console['error'](a41_0x16ed5b[_0x4f6b55(0xb1)](_0x4f6b55(0x1a0))),0x0;if(!_0x4605ca[_0x4f6b55(0x1da)]){const _0x37f816=_0xfe44b0[_0x4f6b55(0x1c4)]||a41_0xd8e1c9[_0x4f6b55(0x173)](_0x280358),_0x45b664=_0xfe44b0[_0x4f6b55(0x125)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x60c7f6+_0x4f6b55(0x19d):_0x4f6b55(0x18f)+_0x37f816+_0x4f6b55(0x1dd)+_0x60c7f6+'\x22?',_0x3618bb=await confirmKey(_0x45b664);if(!_0x3618bb)return console[_0x4f6b55(0x1bb)](_0x4f6b55(0xb6)),0x0;}const _0xad0cd1=await withSpinner(_0xfe44b0['targetExists']?_0x4f6b55(0xca)+_0x60c7f6+_0x4f6b55(0x184):'Cloning\x20to\x20'+_0x60c7f6+'...',()=>_0xd57c88[_0x4f6b55(0x1ab)][_0x4f6b55(0xe6)](_0xfe44b0),{'verbose':_0x4605ca[_0x4f6b55(0xd5)]}),_0x1b1d4c=_0xad0cd1[_0x4f6b55(0x225)];return console[_0x4f6b55(0x1bb)](a41_0x16ed5b[_0x4f6b55(0x126)](_0xfe44b0[_0x4f6b55(0x125)]?_0x4f6b55(0xbb):'✔\x20Clone\x20complete')),console[_0x4f6b55(0x1bb)](_0x4f6b55(0xc3)+_0x1b1d4c[_0x4f6b55(0x23c)]),console['error'](_0x4f6b55(0x199)+_0x1b1d4c[_0x4f6b55(0xce)]),console[_0x4f6b55(0x1bb)](_0x4f6b55(0x229)+_0x1b1d4c['revision']),await this[_0x4f6b55(0x1c6)](_0xd57c88,_0x1b1d4c[_0x4f6b55(0x23c)],_0x4605ca[_0x4f6b55(0x24c)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x169);[a41_0x43423c(0x105)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x25ff6c){const _0x178e80=a41_0x43423c,{options:_0x22a103,args:_0x2beed4,tdx:_0x30b6db}=_0x25ff6c,_0xac5866=_0x2beed4[0x0];if(!_0xac5866)return console[_0x178e80(0x1bb)](_0x178e80(0xf4)),console[_0x178e80(0x1bb)](_0x178e80(0x1e5)),0x1;_0x22a103[_0x178e80(0xd5)]&&console[_0x178e80(0x1bb)]('Project:\x20'+_0xac5866);if(!_0x22a103[_0x178e80(0x1da)]){const _0x1bf85f=await confirmKey(_0x178e80(0x237)+_0xac5866+_0x178e80(0x212));if(!_0x1bf85f)return console[_0x178e80(0x1bb)](_0x178e80(0xb6)),0x0;}const _0x3ece0c=await withSpinner(_0x178e80(0xbd)+_0xac5866+_0x178e80(0x184),()=>_0x30b6db[_0x178e80(0x1ab)][_0x178e80(0x1ee)](_0xac5866),{'verbose':_0x22a103[_0x178e80(0xd5)]}),_0x34c9b6=_0x3ece0c[_0x178e80(0x225)];return console[_0x178e80(0x1bb)](_0x178e80(0x1c8)+_0x34c9b6[_0x178e80(0x18e)]),console[_0x178e80(0x1bb)]('\x20\x20Project\x20ID:\x20'+_0x34c9b6[_0x178e80(0x1e4)]),0x0;}}export function parseKeyValue(_0x354f45){const _0x1137ca=a41_0x43423c,_0xf4caea=_0x354f45['indexOf']('=');if(_0xf4caea===-0x1)throw new Error('Invalid\x20format:\x20'+_0x354f45+_0x1137ca(0x132));const _0x59be87=_0x354f45[_0x1137ca(0x106)](0x0,_0xf4caea),_0x3a6272=_0x354f45[_0x1137ca(0x106)](_0xf4caea+0x1);if(!_0x59be87)throw new Error(_0x1137ca(0x21f));return{'key':_0x59be87,'value':_0x3a6272};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1cc);[a41_0x43423c(0x105)]=a41_0x43423c(0x123);async[a41_0x43423c(0xd8)](_0xd566c1){const _0x4d05cf=a41_0x43423c,{options:_0x11fb88,args:_0x1fcf78,tdx:_0x2be465}=_0xd566c1,_0x52b221=this[_0x4d05cf(0x1f4)](_0x1fcf78,_0x11fb88);if(!_0x52b221)return 0x1;_0x11fb88[_0x4d05cf(0xd5)]&&console[_0x4d05cf(0x1bb)](_0x4d05cf(0x193)+_0x52b221);const _0x4cb6e7=await withSpinner('Listing\x20secrets...',()=>_0x2be465[_0x4d05cf(0x1ab)]['listSecrets'](_0x52b221),{'verbose':_0x11fb88[_0x4d05cf(0xd5)]}),{secrets:_0x3cd644}=_0x4cb6e7[_0x4d05cf(0x225)];return console[_0x4d05cf(0x1bb)](_0x4d05cf(0x21a)+_0x3cd644[_0x4d05cf(0xc4)]+_0x4d05cf(0xff)+(_0x3cd644[_0x4d05cf(0xc4)]!==0x1?'s':'')),await handleSDKOutput(_0x3cd644,_0x11fb88),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x1ed);[a41_0x43423c(0x105)]=a41_0x43423c(0x217);async[a41_0x43423c(0xd8)](_0xf3508f){const _0x7c01f7=a41_0x43423c,{options:_0x595bc7,args:_0x234375,tdx:_0x4efdd6}=_0xf3508f;let _0x5676e3,_0xa8f5b3;if(_0x234375['length']>=0x2)_0x5676e3=_0x234375[0x0],_0xa8f5b3=_0x234375[0x1];else{if(_0x234375[_0x7c01f7(0xc4)]===0x1&&_0x595bc7['workflowProject'])_0x5676e3=_0x595bc7['workflowProject'],_0xa8f5b3=_0x234375[0x0];else return _0x234375[_0x7c01f7(0xc4)]===0x1?(console[_0x7c01f7(0x1bb)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x7c01f7(0x1bb)](_0x7c01f7(0x164)),0x1):(console[_0x7c01f7(0x1bb)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x7c01f7(0x1bb)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE'),0x1);}let _0x42f4f8,_0x4dc7e7;try{({key:_0x42f4f8,value:_0x4dc7e7}=parseKeyValue(_0xa8f5b3));}catch(_0x375eaa){return _0x375eaa instanceof Error&&console['error'](a41_0x16ed5b[_0x7c01f7(0x1f5)](_0x7c01f7(0x156)),_0x375eaa[_0x7c01f7(0x166)]),0x1;}_0x595bc7[_0x7c01f7(0xd5)]&&(console[_0x7c01f7(0x1bb)](_0x7c01f7(0x193)+_0x5676e3),console['error'](_0x7c01f7(0xb5)+_0x42f4f8));const _0x45f7b6=await withSpinner(_0x7c01f7(0xe9),()=>_0x4efdd6[_0x7c01f7(0x1ab)][_0x7c01f7(0x207)](_0x5676e3,_0x42f4f8,_0x4dc7e7),{'verbose':_0x595bc7['verbose']}),_0x23eeb6=_0x45f7b6[_0x7c01f7(0x225)];return console[_0x7c01f7(0x1bb)](_0x7c01f7(0xf5)+_0x23eeb6['key']+_0x7c01f7(0x19a)+_0x23eeb6[_0x7c01f7(0x18e)]+'\x27'),(_0x595bc7[_0x7c01f7(0x239)]||_0x595bc7[_0x7c01f7(0xcb)])&&await handleSingleObjectOutput(_0x23eeb6,_0x595bc7),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0xdd);[a41_0x43423c(0x105)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async[a41_0x43423c(0xd8)](_0x1acccc){const _0x300f95=a41_0x43423c,{options:_0x54a9ad,args:_0x1ed192,tdx:_0x5df73c}=_0x1acccc;let _0x559fce,_0x4bb92d;if(_0x1ed192[_0x300f95(0xc4)]>=0x2)_0x559fce=_0x1ed192[0x0],_0x4bb92d=_0x1ed192[0x1];else{if(_0x1ed192[_0x300f95(0xc4)]===0x1&&_0x54a9ad['workflowProject'])_0x559fce=_0x54a9ad['workflowProject'],_0x4bb92d=_0x1ed192[0x0];else return _0x1ed192['length']===0x1?(console[_0x300f95(0x1bb)](_0x300f95(0x1d8)),console[_0x300f95(0x1bb)](_0x300f95(0x164)),0x1):(console[_0x300f95(0x1bb)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x300f95(0xa7)),0x1);}_0x54a9ad[_0x300f95(0xd5)]&&(console[_0x300f95(0x1bb)](_0x300f95(0x193)+_0x559fce),console[_0x300f95(0x1bb)]('Key:\x20'+_0x4bb92d));if(!_0x54a9ad['yes']){const _0x27888e=await confirmKey(_0x300f95(0x135)+_0x4bb92d+_0x300f95(0x1b3)+_0x559fce+'\x27?');if(!_0x27888e)return console[_0x300f95(0x1bb)](_0x300f95(0xb6)),0x0;}const _0x58b1e0=await withSpinner(_0x300f95(0x16c),()=>_0x5df73c['workflow'][_0x300f95(0x1c5)](_0x559fce,_0x4bb92d),{'verbose':_0x54a9ad[_0x300f95(0xd5)]}),_0x5623a3=_0x58b1e0[_0x300f95(0x225)];return console[_0x300f95(0x1bb)]('✔\x20Secret\x20\x27'+_0x5623a3[_0x300f95(0x158)]+_0x300f95(0x23a)+_0x5623a3[_0x300f95(0x18e)]+'\x27'),(_0x54a9ad['json']||_0x54a9ad[_0x300f95(0xcb)])&&await handleSingleObjectOutput(_0x5623a3,_0x54a9ad),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(_0x2ddda8){const _0x24e0e7=a41_0x43423c,_0x1e94a8=Math[_0x24e0e7(0x174)](_0x2ddda8/0x3e8),_0xa5734f=Math['floor'](_0x1e94a8/0x3c),_0x51f28b=Math[_0x24e0e7(0x174)](_0xa5734f/0x3c),_0x86384d=Math[_0x24e0e7(0x174)](_0x51f28b/0x18);if(_0x86384d>0x0){const _0x42c848=_0x51f28b%0x18;return _0x42c848>0x0?_0x86384d+'d\x20'+_0x42c848+'h':_0x86384d+'d';}else{if(_0x51f28b>0x0){const _0x13f740=_0xa5734f%0x3c;return _0x13f740>0x0?_0x51f28b+'h\x20'+_0x13f740+'m':_0x51f28b+'h';}else{if(_0xa5734f>0x0){const _0x39ebf4=_0x1e94a8%0x3c;return _0x39ebf4>0x0?_0xa5734f+'m\x20'+_0x39ebf4+'s':_0xa5734f+'m';}else return _0x1e94a8+'s';}}}function formatTimestamp(_0x3d0e21,_0x16d029){const _0x290067=a41_0x43423c,_0x1aa441=new Date(_0x3d0e21),_0x3acf77=String(_0x1aa441['getHours']())[_0x290067(0x18b)](0x2,'0'),_0x3a5b87=String(_0x1aa441[_0x290067(0x251)]())[_0x290067(0x18b)](0x2,'0'),_0x49bca2=_0x3acf77+':'+_0x3a5b87,_0xf8b6ac=_0x1aa441['getFullYear']()===_0x16d029['getFullYear']()&&_0x1aa441['getMonth']()===_0x16d029[_0x290067(0x1ec)]()&&_0x1aa441[_0x290067(0x1d4)]()===_0x16d029['getDate']();if(_0xf8b6ac)return _0x49bca2;else{const _0x552eb4=String(_0x1aa441[_0x290067(0x1ec)]()+0x1)[_0x290067(0x18b)](0x2,'0'),_0x261c60=String(_0x1aa441[_0x290067(0x1d4)]())[_0x290067(0x18b)](0x2,'0');return _0x552eb4+'-'+_0x261c60+'\x20'+_0x49bca2;}}function formatDate(_0x1929ea){const _0xafbdde=a41_0x43423c,_0x366205=_0x1929ea['getFullYear'](),_0x5a67c2=String(_0x1929ea[_0xafbdde(0x1ec)]()+0x1)[_0xafbdde(0x18b)](0x2,'0'),_0x21ec59=String(_0x1929ea[_0xafbdde(0x1d4)]())[_0xafbdde(0x18b)](0x2,'0');return _0x366205+'-'+_0x5a67c2+'-'+_0x21ec59;}function getTaskStateIcon(_0x5620ae){const _0x4680e6={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x4680e6[_0x5620ae]||'⚪';}function getBarChar(_0xee1d90){const _0x4349f3=a41_0x43423c;return _0xee1d90===_0x4349f3(0x1bb)||_0xee1d90===_0x4349f3(0xc7)?'×':'─';}function getBarColor(_0x3f88e2){const _0xc831a6=a41_0x43423c,_0x29fdc1={'success':a41_0x16ed5b[_0xc831a6(0x126)],'error':a41_0x16ed5b[_0xc831a6(0x1f5)],'group_error':a41_0x16ed5b[_0xc831a6(0x1f5)],'running':a41_0x16ed5b[_0xc831a6(0x109)],'blocked':a41_0x16ed5b[_0xc831a6(0xb1)],'planned':a41_0x16ed5b[_0xc831a6(0x201)],'canceling':a41_0x16ed5b['yellow']};return _0x29fdc1[_0x3f88e2]||a41_0x16ed5b[_0xc831a6(0x155)];}function parseTaskName(_0x265e92){const _0x26a462=a41_0x43423c;let _0x4ad55d=_0x265e92[_0x26a462(0x128)](/^\++/,'');const _0x317c16=_0x4ad55d[_0x26a462(0xd0)]('+'),_0x5556c9=_0x317c16['length']>0x1?_0x317c16['length']-0x2:0x0,_0x5d5bc9=_0x317c16[_0x317c16[_0x26a462(0xc4)]-0x1]||_0x4ad55d;return{'level':_0x5556c9,'name':'+'+_0x5d5bc9};}function truncateTaskName(_0x5a83b9,_0x5224bf){const _0x533220=a41_0x43423c,_0x548bcd=stringWidth(_0x5a83b9);if(_0x548bcd<=_0x5224bf)return _0x5a83b9;let _0xeaecc6=_0x5a83b9;while(stringWidth(_0xeaecc6+'…')>_0x5224bf&&_0xeaecc6[_0x533220(0xc4)]>0x0){_0xeaecc6=_0xeaecc6[_0x533220(0x14b)](0x0,-0x1);}return _0xeaecc6+'…';}function calculateTimeScale(_0x94512,_0x3a6183){const _0x2a8d82=a41_0x43423c;return{'startTime':_0x94512[_0x2a8d82(0x1b9)],'endTime':_0x94512[_0x2a8d82(0x1d6)],'durationMs':_0x94512['duration'],'msPerChar':_0x94512[_0x2a8d82(0xcd)]/_0x3a6183};}function timeToPosition(_0x3170c0,_0x3c232e,_0x3456b7){const _0x26bd99=a41_0x43423c,_0x5d9d0d=_0x3170c0-_0x3c232e[_0x26bd99(0x250)],_0x39ca36=Math['floor'](_0x5d9d0d/_0x3c232e['msPerChar']);return Math[_0x26bd99(0x187)](0x0,Math[_0x26bd99(0xec)](_0x39ca36,_0x3456b7));}function a41_0x581e(_0x6b8bb7,_0x531261){_0x6b8bb7=_0x6b8bb7-0xa5;const _0x17837f=a41_0x1783();let _0x581ef8=_0x17837f[_0x6b8bb7];return _0x581ef8;}function renderTimeAxis(_0x101025,_0x2f8d7a){const _0x295694=a41_0x43423c,_0x11b886=Math[_0x295694(0xec)](TIMELINE_CONFIG[_0x295694(0xd7)],Math[_0x295694(0x187)](TIMELINE_CONFIG[_0x295694(0x202)],Math['floor'](_0x2f8d7a/TIMELINE_CONFIG[_0x295694(0x1e2)]))),_0xdbcc3f=_0x101025[_0x295694(0x1fd)]/(_0x11b886-0x1),_0x199304=new Date(_0x101025[_0x295694(0x250)]),_0x406790=[];for(let _0x9186e=0x0;_0x9186e<_0x11b886;_0x9186e++){const _0x1a21e3=_0x101025[_0x295694(0x250)]+_0x9186e*_0xdbcc3f,_0x29dba9=timeToPosition(_0x1a21e3,_0x101025,_0x2f8d7a),_0x2fcd78=formatTimestamp(_0x1a21e3,_0x199304);_0x406790['push']({'pos':_0x29dba9,'text':_0x2fcd78});}const _0x26330c=new Array(_0x2f8d7a)[_0x295694(0xbc)]('\x20');let _0x5da35e=-0x1;for(const {pos:_0x3e8da0,text:_0xb5c5e7}of _0x406790){let _0x15a309=Math[_0x295694(0x187)](0x0,_0x3e8da0-Math[_0x295694(0x174)](_0xb5c5e7[_0x295694(0xc4)]/0x2));_0x15a309<=_0x5da35e+TIMELINE_CONFIG[_0x295694(0x165)]&&(_0x15a309=_0x5da35e+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x15a309+_0xb5c5e7[_0x295694(0xc4)]>_0x2f8d7a&&(_0x15a309=_0x2f8d7a-_0xb5c5e7['length']);if(_0x15a309>=0x0&&_0x15a309+_0xb5c5e7['length']<=_0x2f8d7a&&_0x15a309>_0x5da35e){for(let _0x3c7e57=0x0;_0x3c7e57<_0xb5c5e7[_0x295694(0xc4)];_0x3c7e57++){_0x26330c[_0x15a309+_0x3c7e57]=_0xb5c5e7[_0x3c7e57];}_0x5da35e=_0x15a309+_0xb5c5e7[_0x295694(0xc4)]-0x1;}}return _0x26330c['join']('');}function renderTaskRow(_0x5490d2,_0x1e3b24,_0x26112d,_0x53de2b){const _0x145526=a41_0x43423c,{level:_0x1e488e,name:_0x317d79}=parseTaskName(_0x5490d2['name']),_0x154b8a='\x20'[_0x145526(0x11d)](_0x1e488e),_0x2ba27d=_0x5490d2[_0x145526(0x168)]?'('+formatElapsed(_0x5490d2[_0x145526(0x168)][_0x145526(0xcd)])+')':'',_0x281c32=stringWidth(_0x2ba27d),_0x3e1839=_0x1e488e*0x1,_0x26783c=_0x53de2b-_0x3e1839-_0x281c32-0x1,_0x2c1eab=truncateTaskName(_0x317d79,_0x26783c),_0x354028=_0x154b8a+_0x2c1eab,_0x351b5c=stringWidth(_0x354028),_0x4bb01b=_0x53de2b-_0x351b5c-_0x281c32,_0x245447=_0x354028+'\x20'[_0x145526(0x11d)](Math[_0x145526(0x187)](0x1,_0x4bb01b))+a41_0x16ed5b[_0x145526(0x201)](_0x2ba27d),_0x35097e=getTaskStateIcon(_0x5490d2[_0x145526(0x14e)]),_0x788e3d=new Array(_0x26112d)['fill']('\x20');if(_0x5490d2['window']){const _0x59e078=timeToPosition(_0x5490d2['window'][_0x145526(0x1b9)],_0x1e3b24,_0x26112d),_0x5f4ca8=timeToPosition(_0x5490d2['window']['end'],_0x1e3b24,_0x26112d),_0x1b0481=getBarChar(_0x5490d2['state']),_0x56c3c7=Math[_0x145526(0x187)](_0x59e078+0x1,_0x5f4ca8);for(let _0x2f7f50=_0x59e078;_0x2f7f50<Math[_0x145526(0xec)](_0x56c3c7,_0x26112d);_0x2f7f50++){_0x788e3d[_0x2f7f50]=_0x1b0481;}}const _0x5969ce=getBarColor(_0x5490d2[_0x145526(0x14e)]),_0x8880ed=_0x788e3d['map'](_0x384d20=>_0x384d20==='\x20'?'\x20':_0x5969ce(_0x384d20))['join']('');return _0x35097e+'\x20'+_0x245447+'│'+_0x8880ed+'│';}function calculateStats(_0x152cf3){const _0x9e27dc=a41_0x43423c,_0x580914={'total':_0x152cf3[_0x9e27dc(0xc4)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x549210 of _0x152cf3){if(_0x549210[_0x9e27dc(0x14e)]===_0x9e27dc(0xac))_0x580914[_0x9e27dc(0xac)]++;else{if(_0x549210[_0x9e27dc(0x14e)]==='error'||_0x549210[_0x9e27dc(0x14e)]===_0x9e27dc(0xc7))_0x580914['error']++;else _0x549210[_0x9e27dc(0x14e)]==='running'?_0x580914[_0x9e27dc(0x213)]++:_0x580914['pending']++;}}return _0x580914;}function formatStats(_0x42c8eb){const _0x462319=a41_0x43423c;return[_0x462319(0xa5)+_0x42c8eb[_0x462319(0x189)],'✅\x20'+_0x42c8eb['success'],'❌\x20'+_0x42c8eb[_0x462319(0x1bb)],_0x462319(0x195)+_0x42c8eb['running'],'⏳\x20'+_0x42c8eb[_0x462319(0x10c)]][_0x462319(0x222)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a41_0x43423c(0x103)]=a41_0x43423c(0x194);[a41_0x43423c(0x105)]=a41_0x43423c(0x211);async[a41_0x43423c(0xd8)](_0x1749dc){const _0x29c5ab=a41_0x43423c,{options:_0x5bb306,args:_0x5537cf,tdx:_0x50c357}=_0x1749dc;let _0x1cb54d,_0x12bf41,_0x59f348=![];if(_0x5537cf[0x0]){if(_0x5537cf[0x0][_0x29c5ab(0x159)]('.')){const _0x285941=this[_0x29c5ab(0x1df)](_0x5537cf,_0x5bb306);if(!_0x285941)return 0x1;_0x1cb54d=_0x285941[_0x29c5ab(0x18e)],_0x12bf41=_0x285941[_0x29c5ab(0x140)];}else{_0x12bf41=_0x5537cf[0x0],_0x1cb54d=_0x5bb306['workflowProject'];if(!_0x1cb54d)return console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0x1f5)](_0x29c5ab(0x156)),_0x29c5ab(0x1c0)),0x1;_0x59f348=!![];}}else{const _0x5e589b=this[_0x29c5ab(0x1df)](_0x5537cf,_0x5bb306);if(!_0x5e589b)return 0x1;_0x1cb54d=_0x5e589b[_0x29c5ab(0x18e)],_0x12bf41=_0x5e589b[_0x29c5ab(0x140)];}if(_0x5bb306[_0x29c5ab(0xd5)]){if(_0x1cb54d&&_0x12bf41)console[_0x29c5ab(0x1bb)]('Filter:\x20'+_0x1cb54d+'.'+_0x12bf41);else _0x1cb54d&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x1bc)+_0x1cb54d);}const _0x42e572=_0x5bb306[_0x29c5ab(0x224)],_0x488f71=_0x5bb306[_0x29c5ab(0x1aa)];if(_0x42e572){_0x488f71&&console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0xb1)](_0x29c5ab(0x18c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x1adc07=_0x5bb306[_0x29c5ab(0x160)];return _0x1adc07?await this['pollTimeline'](_0x1749dc,_0x42e572):await this[_0x29c5ab(0x1c7)](_0x1749dc,_0x42e572,_0x5bb306),0x0;}if(_0x488f71){const _0x3da45c=await withSpinner(_0x29c5ab(0x21d),()=>_0x50c357[_0x29c5ab(0x1ab)]['sessions']({'projectName':_0x1cb54d,'workflowName':_0x12bf41,'limit':0x64}),{'verbose':_0x5bb306['verbose']}),_0x344c83=_0x3da45c[_0x29c5ab(0x225)][_0x29c5ab(0xeb)](_0x2ef562=>_0x2ef562['id']===_0x488f71);if(!_0x344c83)return console[_0x29c5ab(0x1bb)](a41_0x16ed5b[_0x29c5ab(0x1f5)](_0x29c5ab(0x156)),_0x29c5ab(0xfb)+_0x488f71),0x1;if(!_0x344c83[_0x29c5ab(0x16d)]?.['id'])return console['error'](a41_0x16ed5b[_0x29c5ab(0x1f5)]('Error:'),_0x29c5ab(0x161)+_0x488f71+_0x29c5ab(0x1e8)),0x1;const _0x35bc97=_0x344c83[_0x29c5ab(0x16d)]['id'];_0x5bb306[_0x29c5ab(0xd5)]&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x178)+_0x35bc97+_0x29c5ab(0x15f)+_0x488f71);const _0x3808c4=_0x5bb306['follow'];return _0x3808c4?await this[_0x29c5ab(0x1b1)](_0x1749dc,_0x35bc97):await this['renderSingleTimeline'](_0x1749dc,_0x35bc97,_0x5bb306),0x0;}const _0xc543b2=await withSpinner(_0x29c5ab(0x17e),()=>_0x50c357[_0x29c5ab(0x1ab)][_0x29c5ab(0xb2)]({'projectName':_0x1cb54d,'workflowName':_0x12bf41,'limit':_0x5bb306[_0x29c5ab(0x11e)]||0x32}),{'verbose':_0x5bb306[_0x29c5ab(0xd5)]}),_0x866a47=_0xc543b2[_0x29c5ab(0x225)];if(_0x866a47[_0x29c5ab(0xc4)]===0x0){if(_0x1cb54d&&_0x12bf41)console[_0x29c5ab(0x1bb)](_0x29c5ab(0x198)+_0x1cb54d+'.'+_0x12bf41);else _0x1cb54d?console[_0x29c5ab(0x1bb)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x1cb54d):(console[_0x29c5ab(0x1bb)](_0x29c5ab(0x24f)),console['error'](a41_0x16ed5b[_0x29c5ab(0x201)](_0x29c5ab(0x11b))));return 0x0;}_0x866a47[_0x29c5ab(0xe2)]((_0x572ea1,_0x511420)=>{const _0x42cdde=_0x29c5ab,_0x3c5d4c=_0x572ea1[_0x42cdde(0x1c2)]||'',_0x491e19=_0x511420['sessionTime']||'';return _0x491e19[_0x42cdde(0x186)](_0x3c5d4c);});if(_0x5bb306[_0x29c5ab(0x239)]||_0x5bb306[_0x29c5ab(0xcb)])return await handleSDKOutput(_0x866a47,_0x5bb306),0x0;let _0x305a45;if(_0x59f348){const _0x37c917=_0x866a47[0x0];if(!_0x37c917[_0x29c5ab(0x16d)]?.['id'])return console['error'](_0x29c5ab(0x1fb)),0x0;_0x305a45=_0x37c917[_0x29c5ab(0x16d)]['id'],_0x5bb306[_0x29c5ab(0xd5)]&&console[_0x29c5ab(0x1bb)](_0x29c5ab(0x1ef)+_0x37c917[_0x29c5ab(0x1c2)]);}else{const _0x2f3b20=_0x866a47[_0x29c5ab(0x163)](_0x21db71=>{const _0xf746d5=_0x29c5ab,_0x1cf9ab=getAttemptStatusDisplay(_0x21db71['lastAttempt']);return{'title':_0x21db71[_0xf746d5(0x1b4)]?.['name']+'.'+_0x21db71[_0xf746d5(0x1ab)]?.[_0xf746d5(0x103)]+'\x20-\x20'+_0x21db71[_0xf746d5(0x1c2)]+'\x20'+_0x1cf9ab[_0xf746d5(0x1a3)],'value':_0x21db71[_0xf746d5(0x16d)]?.['id']||'','description':_0x1cf9ab[_0xf746d5(0x17f)]};}),_0x3ded65=await a41_0x4935b9({'type':_0x29c5ab(0x1a8),'name':'attemptId','message':_0x29c5ab(0x121),'choices':_0x2f3b20[_0x29c5ab(0xef)](_0x597110=>_0x597110[_0x29c5ab(0x1cd)]!=='')});if(!_0x3ded65[_0x29c5ab(0x224)])return 0x0;_0x305a45=_0x3ded65[_0x29c5ab(0x224)];}const _0x4c2b67=_0x5bb306['follow'];return _0x4c2b67?await this[_0x29c5ab(0x1b1)](_0x1749dc,_0x305a45):await this[_0x29c5ab(0x1c7)](_0x1749dc,_0x305a45,_0x5bb306),0x0;}async['renderSingleTimeline'](_0x25df65,_0x523265,_0x4172ef){const _0xe5309c=a41_0x43423c,{tdx:_0x59f9a7}=_0x25df65;let _0xd8a60b,_0x517404;try{[_0xd8a60b,_0x517404]=await Promise[_0xe5309c(0xfe)]([_0x59f9a7[_0xe5309c(0x1ab)]['attempt'](_0x523265),_0x59f9a7['workflow'][_0xe5309c(0x17d)](_0x523265,![])]);}catch(_0x4eaf8f){console[_0xe5309c(0x1bb)](a41_0x16ed5b[_0xe5309c(0x1f5)](_0xe5309c(0x141)));_0x4172ef[_0xe5309c(0xd5)]&&console[_0xe5309c(0x1bb)](_0x4eaf8f);throw _0x4eaf8f;}if(_0x4172ef['json']||_0x4172ef[_0xe5309c(0xcb)]){const _0x12a482=this[_0xe5309c(0x1f9)](_0xd8a60b,_0x517404);await handleSDKOutput([_0x12a482],_0x4172ef);return;}const _0x22f1cc=_0x59f9a7['context'][_0xe5309c(0x24c)],_0x3fa423=this[_0xe5309c(0x1f1)](_0xd8a60b,_0x517404,_0x22f1cc);console[_0xe5309c(0x24a)](_0x3fa423);}async[a41_0x43423c(0x1b1)](_0x55b5ad,_0x31feee){const _0x2b5f26=a41_0x43423c,{tdx:_0x53cbdc}=_0x55b5ad,_0x3f332b=TIMELINE_CONFIG[_0x2b5f26(0x144)],_0x5bc5a7=TIMELINE_CONFIG[_0x2b5f26(0x22b)];let _0x11d8fa=0x0;while(_0x11d8fa<_0x5bc5a7){process['stdout']['isTTY']&&process[_0x2b5f26(0x154)][_0x2b5f26(0x181)]('\x1bc');let _0x3b1651,_0x182e24;try{[_0x3b1651,_0x182e24]=await Promise['all']([_0x53cbdc[_0x2b5f26(0x1ab)][_0x2b5f26(0x13b)](_0x31feee),_0x53cbdc[_0x2b5f26(0x1ab)][_0x2b5f26(0x17d)](_0x31feee,![])]);}catch(_0x38234f){console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0x1f5)](_0x2b5f26(0xaa)));_0x11d8fa>0x0&&console[_0x2b5f26(0x1bb)](a41_0x16ed5b['dim'](_0x2b5f26(0x1d3)+_0x11d8fa));throw _0x38234f;}const _0x5086e3=_0x53cbdc[_0x2b5f26(0x150)][_0x2b5f26(0x24c)],_0x5eeb1b=this[_0x2b5f26(0x1f1)](_0x3b1651,_0x182e24,_0x5086e3);console['log'](_0x5eeb1b);const _0x10c741=_0x3b1651['done']&&_0x182e24['every'](_0x566e8e=>_0x566e8e[_0x2b5f26(0x14e)]!==_0x2b5f26(0x213)&&_0x566e8e[_0x2b5f26(0x14e)]!==_0x2b5f26(0x14c));if(_0x10c741){console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0x126)](_0x2b5f26(0xc6)));break;}console['error'](a41_0x16ed5b[_0x2b5f26(0x201)](_0x2b5f26(0x1e7)+_0x11d8fa*0x2+_0x2b5f26(0x112))),await new Promise(_0x4dac20=>setTimeout(_0x4dac20,_0x3f332b)),_0x11d8fa++;}_0x11d8fa>=_0x5bc5a7&&console[_0x2b5f26(0x1bb)](a41_0x16ed5b[_0x2b5f26(0xb1)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0x52346d,_0x59f043,_0x1495c8){const _0x41af1f=a41_0x43423c,_0xcd80c8=[],_0x104fa8=TIMELINE_CONFIG[_0x41af1f(0x1bd)],_0x382298=0x5,_0x1a4ae1=process['stdout'][_0x41af1f(0x19e)]||0x78,_0x4343ad=_0x1a4ae1-_0x104fa8-_0x382298,_0x316db9=Math[_0x41af1f(0x187)](TIMELINE_CONFIG[_0x41af1f(0x1ca)],Math['min'](_0x4343ad,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x4e24eb=new Date(_0x52346d[_0x41af1f(0x12f)])[_0x41af1f(0xad)](),_0x55ff46=_0x52346d[_0x41af1f(0x1fe)]?new Date(_0x52346d[_0x41af1f(0x1fe)])[_0x41af1f(0xad)]():Date[_0x41af1f(0x22a)](),_0x10c63f={'start':_0x4e24eb,'end':_0x55ff46,'duration':_0x55ff46-_0x4e24eb},_0x4b60c4=new Map(),_0x567401=[];for(const _0xf6bc2c of _0x59f043){if(_0xf6bc2c[_0x41af1f(0x16b)]){const _0x563b24=new Date(_0xf6bc2c['startedAt'])[_0x41af1f(0xad)](),_0x1fea30=_0xf6bc2c[_0x41af1f(0x200)]?new Date(_0xf6bc2c['updatedAt'])[_0x41af1f(0xad)]():Date[_0x41af1f(0x22a)](),_0x5260e7={'start':_0x563b24,'end':_0x1fea30,'duration':_0x1fea30-_0x563b24};_0x4b60c4[_0x41af1f(0xb8)](_0xf6bc2c['id'],_0x5260e7),_0x567401['push']({'name':_0xf6bc2c['fullName'],'state':_0xf6bc2c['state']||_0x41af1f(0x1cb),'window':_0x5260e7});}else _0x567401['push']({'name':_0xf6bc2c['fullName'],'state':_0xf6bc2c['state']||'planned','window':undefined});}_0x567401[_0x41af1f(0xe2)]((_0x4b7f30,_0x3c2cbc)=>{const _0x58ae09=_0x41af1f;if(!_0x4b7f30[_0x58ae09(0x168)])return 0x1;if(!_0x3c2cbc[_0x58ae09(0x168)])return-0x1;return _0x4b7f30[_0x58ae09(0x168)]['start']-_0x3c2cbc[_0x58ae09(0x168)][_0x58ae09(0x1b9)];});const _0x29a916=_0x567401[_0x41af1f(0xc4)],_0x5f5567=_0x29a916>TIMELINE_CONFIG[_0x41af1f(0x1f7)];_0x5f5567&&_0x567401[_0x41af1f(0x127)](TIMELINE_CONFIG[_0x41af1f(0x1f7)]);const _0xb4cfec=calculateTimeScale(_0x10c63f,_0x316db9),_0x1628ed=_0x52346d['done']?_0x52346d[_0x41af1f(0xac)]?a41_0x16ed5b[_0x41af1f(0x126)](_0x41af1f(0xac)):a41_0x16ed5b[_0x41af1f(0x1f5)](_0x41af1f(0x1bb)):a41_0x16ed5b[_0x41af1f(0x109)]('running'),_0x499d03=_0x52346d[_0x41af1f(0x1b4)]?.['id'],_0x3efdf8=_0x52346d['sessionId'];let _0x4b2a81;if(_0x499d03&&_0x3efdf8){const _0x4e048f=getWorkflowAttemptUrl(_0x1495c8,_0x499d03,_0x3efdf8,_0x52346d['id']);_0x4b2a81=hyperlink(a41_0x16ed5b['dim'](_0x52346d['id']),_0x4e048f);}else _0x4b2a81=a41_0x16ed5b[_0x41af1f(0x201)](_0x52346d['id']);_0xcd80c8[_0x41af1f(0x179)](_0x41af1f(0xea)+_0x4b2a81+_0x41af1f(0xf0)+_0x1628ed+_0x41af1f(0xf0)+formatElapsed(_0x10c63f[_0x41af1f(0xcd)]));if(_0x567401[_0x41af1f(0xc4)]>0x0){const _0x11ad4d=renderTimeAxis(_0xb4cfec,_0x316db9),_0x358c09=new Date(_0x10c63f[_0x41af1f(0x1b9)]),_0xdad71e=formatDate(_0x358c09),_0x38877d=TIMELINE_CONFIG[_0x41af1f(0x220)]+TIMELINE_CONFIG['ICON_SPACING']+_0x104fa8,_0x3e5efd=_0xdad71e[_0x41af1f(0x18b)](_0x38877d),_0x125354=a41_0x16ed5b['dim'](_0x3e5efd);_0xcd80c8[_0x41af1f(0x179)](_0x125354+'\x20'+_0x11ad4d);for(const _0x4c787e of _0x567401){_0xcd80c8['push'](renderTaskRow(_0x4c787e,_0xb4cfec,_0x316db9,_0x104fa8));}const _0x55e4ed=calculateStats(_0x567401);_0xcd80c8[_0x41af1f(0x179)](formatStats(_0x55e4ed)),_0x5f5567&&_0xcd80c8['push'](a41_0x16ed5b[_0x41af1f(0xb1)](_0x41af1f(0x236)+TIMELINE_CONFIG[_0x41af1f(0x1f7)]+_0x41af1f(0xfa)+_0x29a916+_0x41af1f(0x1a9))),_0xcd80c8[_0x41af1f(0x179)](''),_0xcd80c8[_0x41af1f(0x179)](a41_0x16ed5b[_0x41af1f(0x201)](_0x41af1f(0x162))+(_0x41af1f(0x1be)+_0x52346d['id']+_0x41af1f(0x219))+a41_0x16ed5b['dim'](_0x41af1f(0x24d)));}else _0xcd80c8[_0x41af1f(0x179)](_0x41af1f(0x245));return _0xcd80c8['join']('\x0a');}[a41_0x43423c(0x1f9)](_0x25cbb8,_0x4127f3){const _0x401513=a41_0x43423c,_0x555a54=new Date(_0x25cbb8[_0x401513(0x12f)])[_0x401513(0xad)](),_0x59711f=_0x25cbb8['finishedAt']?new Date(_0x25cbb8[_0x401513(0x1fe)])['getTime']():Date['now'](),_0xa7be9b=_0x59711f-_0x555a54,_0x348bb6=[];for(const _0x857770 of _0x4127f3){if(_0x857770['startedAt']){const _0x5e60b7=new Date(_0x857770[_0x401513(0x16b)])[_0x401513(0xad)](),_0x28d939=_0x857770[_0x401513(0x200)]?new Date(_0x857770[_0x401513(0x200)])['getTime']():Date[_0x401513(0x22a)]();_0x348bb6[_0x401513(0x179)]({'name':_0x857770[_0x401513(0x1e6)],'state':_0x857770[_0x401513(0x14e)]||_0x401513(0x1cb),'window':{'start':_0x5e60b7,'end':_0x28d939,'duration':_0x28d939-_0x5e60b7}});}else _0x348bb6[_0x401513(0x179)]({'name':_0x857770[_0x401513(0x1e6)],'state':_0x857770[_0x401513(0x14e)]||_0x401513(0x14c),'window':undefined});}const _0x2ce680=calculateStats(_0x348bb6);return{'attempt':{'id':_0x25cbb8['id'],'status':_0x25cbb8['done']?_0x25cbb8[_0x401513(0xac)]?'success':_0x401513(0x1bb):_0x401513(0x213),'createdAt':_0x25cbb8[_0x401513(0x12f)],'finishedAt':_0x25cbb8['finishedAt'],'duration_ms':_0xa7be9b},'tasks':_0x348bb6['map'](_0x2d32bc=>({'name':_0x2d32bc[_0x401513(0x103)],'state':_0x2d32bc['state'],'startedAt':_0x2d32bc[_0x401513(0x168)]?new Date(_0x2d32bc[_0x401513(0x168)][_0x401513(0x1b9)])[_0x401513(0x1b8)]():null,'updatedAt':_0x2d32bc['window']?new Date(_0x2d32bc['window'][_0x401513(0x1d6)])['toISOString']():null,'duration_ms':_0x2d32bc['window']?.['duration']||null})),'stats':_0x2ce680};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a42_0x1eb7(){const _0x344f4a=['809577nDNZCX','123590EUJlta','tdx/','24fePRdn',';\x20node/','77BrwHOt','length','33ldLMme','replace','TD1\x20','tdx','4UrIwbx','entries','Authorization','63978uLIrxV','92215UeaZOA','100176nITjjj','99hVWTHS','75286uoOhMU','389016ToURja'];a42_0x1eb7=function(){return _0x344f4a;};return a42_0x1eb7();}(function(_0x138053,_0x495891){const _0x1d3aa9=a42_0x2841,_0x5cef54=_0x138053();while(!![]){try{const _0x39f91d=parseInt(_0x1d3aa9(0x98))/0x1*(-parseInt(_0x1d3aa9(0x9f))/0x2)+parseInt(_0x1d3aa9(0xa1))/0x3+-parseInt(_0x1d3aa9(0xa4))/0x4*(-parseInt(_0x1d3aa9(0x9c))/0x5)+-parseInt(_0x1d3aa9(0x9b))/0x6*(-parseInt(_0x1d3aa9(0xa6))/0x7)+-parseInt(_0x1d3aa9(0x9d))/0x8*(parseInt(_0x1d3aa9(0x9e))/0x9)+parseInt(_0x1d3aa9(0xa2))/0xa*(-parseInt(_0x1d3aa9(0x94))/0xb)+parseInt(_0x1d3aa9(0xa0))/0xc;if(_0x39f91d===_0x495891)break;else _0x5cef54['push'](_0x5cef54['shift']());}catch(_0x4758b0){_0x5cef54['push'](_0x5cef54['shift']());}}}(a42_0x1eb7,0x32025));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a42_0x2841(_0x269e8d,_0x26a37f){_0x269e8d=_0x269e8d-0x93;const _0x1eb7ac=a42_0x1eb7();let _0x28414d=_0x1eb7ac[_0x269e8d];return _0x28414d;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2a1f0c=a42_0x2841,_0x2ab420=getVersion(),_0x4c037e=platform(),_0x2649b4=process['version'][_0x2a1f0c(0x95)]('v','');return _0x2a1f0c(0xa3)+_0x2ab420+'\x20('+_0x4c037e+_0x2a1f0c(0xa5)+_0x2649b4+')';}export function getAuthHeaders(_0x39824b,_0x2c0ae8){const _0x48dea2=a42_0x2841,_0x118c94=getVersion(),_0x4d96f6={'User-Agent':getUserAgent(),'X-TD-Client':_0x48dea2(0x97),'X-TD-Client-Version':_0x118c94};return _0x2c0ae8&&(_0x4d96f6[_0x48dea2(0x9a)]=_0x48dea2(0x96)+_0x2c0ae8),_0x4d96f6;}export function toHeaderRecord(_0x3e35fb){const _0x337e48=a42_0x2841,_0x2a8a83={};for(const [_0x20213c,_0x2cf860]of Object[_0x337e48(0x99)](_0x3e35fb)){_0x2cf860!==undefined&&(_0x2a8a83[_0x20213c]=_0x2cf860);}return _0x2a8a83;}export function getTrinoHeaders(_0x2f2a5c,_0x15df78){const _0x4851fc=a42_0x2841,_0x21fe99=getAuthHeaders(_0x2f2a5c,_0x15df78),_0x40587b=toHeaderRecord(_0x21fe99);return delete _0x40587b[_0x4851fc(0x9a)],_0x15df78&&(_0x40587b['X-Trino-User']=_0x15df78),_0x40587b;}export function hasAPIKey(_0x557379){const _0x345b02=a42_0x2841,_0x9bb38=getAPIKey(_0x557379);return _0x9bb38!==undefined&&_0x9bb38[_0x345b02(0x93)]>0x0;}
1
+ (function(_0x3708af,_0x1ca15d){const _0x1877ce=a42_0x5241,_0x392d47=_0x3708af();while(!![]){try{const _0x9b3d61=-parseInt(_0x1877ce(0x123))/0x1+-parseInt(_0x1877ce(0x12e))/0x2*(-parseInt(_0x1877ce(0x12c))/0x3)+parseInt(_0x1877ce(0x134))/0x4*(-parseInt(_0x1877ce(0x128))/0x5)+parseInt(_0x1877ce(0x129))/0x6*(parseInt(_0x1877ce(0x122))/0x7)+parseInt(_0x1877ce(0x127))/0x8*(parseInt(_0x1877ce(0x12d))/0x9)+parseInt(_0x1877ce(0x12f))/0xa*(-parseInt(_0x1877ce(0x135))/0xb)+parseInt(_0x1877ce(0x12b))/0xc*(parseInt(_0x1877ce(0x133))/0xd);if(_0x9b3d61===_0x1ca15d)break;else _0x392d47['push'](_0x392d47['shift']());}catch(_0x226994){_0x392d47['push'](_0x392d47['shift']());}}}(a42_0x4902,0xad294));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a42_0x4902(){const _0x155260=['261842AiewWr','TD1\x20','tdx','Authorization','612368sqRQsO','8510nvFUED','210ahQOPQ','replace','12jsqkPP','324MqjBak','81bsbGCS','1974IdYWKJ','23960sjUtGh','X-Trino-User','version','length','8565869YdoVhi','1864uuxWyf','891xQjtKv',';\x20node/','100779zXWDfP'];a42_0x4902=function(){return _0x155260;};return a42_0x4902();}export function getUserAgent(){const _0x470179=a42_0x5241,_0x3e8500=getVersion(),_0x1f2854=platform(),_0x11a4ec=process[_0x470179(0x131)][_0x470179(0x12a)]('v','');return'tdx/'+_0x3e8500+'\x20('+_0x1f2854+_0x470179(0x121)+_0x11a4ec+')';}export function getAuthHeaders(_0x136cbf,_0x31535f){const _0x438b19=a42_0x5241,_0x47ad3f=getVersion(),_0x1dd13a={'User-Agent':getUserAgent(),'X-TD-Client':_0x438b19(0x125),'X-TD-Client-Version':_0x47ad3f};return _0x31535f&&(_0x1dd13a[_0x438b19(0x126)]=_0x438b19(0x124)+_0x31535f),_0x1dd13a;}export function toHeaderRecord(_0x338686){const _0x1e3b19={};for(const [_0x5dac83,_0x1e43b2]of Object['entries'](_0x338686)){_0x1e43b2!==undefined&&(_0x1e3b19[_0x5dac83]=_0x1e43b2);}return _0x1e3b19;}export function getTrinoHeaders(_0x511d6a,_0x3f0147){const _0x419d36=a42_0x5241,_0x1b5155=getAuthHeaders(_0x511d6a,_0x3f0147),_0x2da98d=toHeaderRecord(_0x1b5155);return delete _0x2da98d[_0x419d36(0x126)],_0x3f0147&&(_0x2da98d[_0x419d36(0x130)]=_0x3f0147),_0x2da98d;}function a42_0x5241(_0x548646,_0x473d35){_0x548646=_0x548646-0x121;const _0x4902ec=a42_0x4902();let _0x5241d7=_0x4902ec[_0x548646];return _0x5241d7;}export function hasAPIKey(_0xeb54ea){const _0x14554=a42_0x5241,_0x1843a9=getAPIKey(_0xeb54ea);return _0x1843a9!==undefined&&_0x1843a9[_0x14554(0x132)]>0x0;}