@treasuredata/tdx 2026.3.54 → 2026.4.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 (260) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
  166. package/dist/sdk/segment/file-discovery.js +1 -1
  167. package/dist/sdk/segment/file-discovery.js.map +1 -1
  168. package/dist/sdk/segment/journey-utils.js +1 -1
  169. package/dist/sdk/segment/journey-validator.js +1 -1
  170. package/dist/sdk/segment/journey-yaml.js +1 -1
  171. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  172. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  173. package/dist/sdk/segment/pull-workflow.js +1 -1
  174. package/dist/sdk/segment/push-recovery.js +1 -1
  175. package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
  176. package/dist/sdk/segment/push-workflow.js +1 -1
  177. package/dist/sdk/segment/push-workflow.js.map +1 -1
  178. package/dist/sdk/segment/resolution-context.js +1 -1
  179. package/dist/sdk/segment/segment-path-parser.js +1 -1
  180. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  181. package/dist/sdk/segment/segment-validator.js +1 -1
  182. package/dist/sdk/segment/target-resolution.js +1 -1
  183. package/dist/sdk/segment/tdx-config.js +1 -1
  184. package/dist/sdk/segment/types/activation-schema.js +1 -1
  185. package/dist/sdk/segment/types/journey-def.js +1 -1
  186. package/dist/sdk/segment/types/journey-schema.js +1 -1
  187. package/dist/sdk/segment/types/segment-def.js +1 -1
  188. package/dist/sdk/segment/types/segment-schema.js +1 -1
  189. package/dist/sdk/segment/validate-files.js +1 -1
  190. package/dist/sdk/segment/yaml-validator.js +1 -1
  191. package/dist/sdk/segment.js +1 -1
  192. package/dist/sdk/types/index.d.ts +2 -2
  193. package/dist/sdk/types/index.d.ts.map +1 -1
  194. package/dist/sdk/types/index.js +1 -1
  195. package/dist/sdk/types/index.js.map +1 -1
  196. package/dist/sdk/types/llm.d.ts +158 -0
  197. package/dist/sdk/types/llm.d.ts.map +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workflow.d.ts +26 -0
  200. package/dist/sdk/types/workflow.d.ts.map +1 -1
  201. package/dist/sdk/types/workspace.js +1 -1
  202. package/dist/sdk/user.js +1 -1
  203. package/dist/sdk/util/format-detector.js +1 -1
  204. package/dist/sdk/util/formatters.js +1 -1
  205. package/dist/sdk/util/index.js +1 -1
  206. package/dist/sdk/util/paginate.js +1 -1
  207. package/dist/sdk/util/tree-formatter.js +1 -1
  208. package/dist/sdk/workflow/archive-validation.js +1 -1
  209. package/dist/sdk/workflow/clone-workflow.js +1 -1
  210. package/dist/sdk/workflow/index.d.ts +22 -0
  211. package/dist/sdk/workflow/index.d.ts.map +1 -1
  212. package/dist/sdk/workflow/index.js +1 -1
  213. package/dist/sdk/workflow/index.js.map +1 -1
  214. package/dist/sdk/workflow/pull-workflow.js +1 -1
  215. package/dist/sdk/workflow/push-workflow.js +1 -1
  216. package/dist/sdk/workflow/tdx-config.js +1 -1
  217. package/dist/sdk/workflow/workflow-utils.js +1 -1
  218. package/dist/sdk/workspace/frontmatter.js +1 -1
  219. package/dist/sdk/workspace/git.js +1 -1
  220. package/dist/sdk/workspace/index.d.ts.map +1 -1
  221. package/dist/sdk/workspace/index.js +1 -1
  222. package/dist/sdk/workspace/index.js.map +1 -1
  223. package/dist/sdk/workspace/templates.js +1 -1
  224. package/dist/sdk/workspace/weekly.js +1 -1
  225. package/dist/sdk/workspace/wikilinks.js +1 -1
  226. package/dist/test-utils/command-runner.js +1 -1
  227. package/dist/test-utils/factories.js +1 -1
  228. package/dist/test-utils/fixtures.js +1 -1
  229. package/dist/test-utils/http-mock.js +1 -1
  230. package/dist/test-utils/index.js +1 -1
  231. package/dist/utils/async.js +1 -1
  232. package/dist/utils/colors.js +1 -1
  233. package/dist/utils/diff.js +1 -1
  234. package/dist/utils/file-permissions.js +1 -1
  235. package/dist/utils/file-reader.js +1 -1
  236. package/dist/utils/github-releases.js +1 -1
  237. package/dist/utils/global-cache.js +1 -1
  238. package/dist/utils/json-loader.js +1 -1
  239. package/dist/utils/local-cache.js +1 -1
  240. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  241. package/dist/utils/logger/formatters/index.js +1 -1
  242. package/dist/utils/logger/handlers/console-handler.js +1 -1
  243. package/dist/utils/logger/handlers/file-handler.js +1 -1
  244. package/dist/utils/logger/handlers/index.js +1 -1
  245. package/dist/utils/logger/handlers/null-handler.js +1 -1
  246. package/dist/utils/logger/index.js +1 -1
  247. package/dist/utils/logger/logger.js +1 -1
  248. package/dist/utils/logger/types.js +1 -1
  249. package/dist/utils/option-validation.js +1 -1
  250. package/dist/utils/process.d.ts.map +1 -1
  251. package/dist/utils/process.js +1 -1
  252. package/dist/utils/process.js.map +1 -1
  253. package/dist/utils/prompt.js +1 -1
  254. package/dist/utils/spinner.js +1 -1
  255. package/dist/utils/sse-parser.js +1 -1
  256. package/dist/utils/string-utils.js +1 -1
  257. package/dist/utils/table-ref-parser.js +1 -1
  258. package/dist/utils/tdx-logger.js +1 -1
  259. package/dist/utils/version-check.js +1 -1
  260. package/package.json +2 -2
@@ -1 +1 @@
1
- const a54_0x54edc0=a54_0xccde;(function(_0x879e37,_0x2ecedf){const _0x3774dd=a54_0xccde,_0x52ee58=_0x879e37();while(!![]){try{const _0xe8d569=parseInt(_0x3774dd(0x149))/0x1*(-parseInt(_0x3774dd(0x19a))/0x2)+parseInt(_0x3774dd(0x27e))/0x3+parseInt(_0x3774dd(0x134))/0x4*(parseInt(_0x3774dd(0x280))/0x5)+-parseInt(_0x3774dd(0x299))/0x6*(parseInt(_0x3774dd(0x2b6))/0x7)+-parseInt(_0x3774dd(0x2bf))/0x8*(parseInt(_0x3774dd(0x2b2))/0x9)+parseInt(_0x3774dd(0x2ae))/0xa*(-parseInt(_0x3774dd(0x197))/0xb)+parseInt(_0x3774dd(0x18e))/0xc*(parseInt(_0x3774dd(0x13f))/0xd);if(_0xe8d569===_0x2ecedf)break;else _0x52ee58['push'](_0x52ee58['shift']());}catch(_0xd22bc){_0x52ee58['push'](_0x52ee58['shift']());}}}(a54_0x11ab,0xdb0f3));import a54_0x26125e from'chalk';function a54_0xccde(_0x5aebd0,_0x5a266d){_0x5aebd0=_0x5aebd0-0x11c;const _0x11ab96=a54_0x11ab();let _0xccded9=_0x11ab96[_0x5aebd0];return _0xccded9;}import{existsSync}from'fs';import a54_0x1db018 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x1aee3d from'prompts';function getAttemptStatusDisplay(_0x16f32b){const _0x300276=a54_0xccde;if(!_0x16f32b)return{'icon':'⏳','text':''};const {done:_0x562d4c,success:_0x1b7f6b,cancelRequested:_0x5ddda5}=_0x16f32b;if(!_0x562d4c)return _0x5ddda5?{'icon':'🛑','text':a54_0x26125e[_0x300276(0x21c)](_0x300276(0x17d))}:{'icon':'🔄','text':a54_0x26125e['blue'](_0x300276(0x187))};if(_0x1b7f6b)return{'icon':'✅','text':a54_0x26125e[_0x300276(0x208)](_0x300276(0x2bb))};return{'icon':'❌','text':a54_0x26125e[_0x300276(0x16f)](_0x300276(0x279))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x54edc0(0x2bd)](_0xba37e5,_0x4b0a8b,_0x109fce=0x0){const _0x963863=a54_0x54edc0;return _0xba37e5[_0x109fce]||_0x4b0a8b[_0x963863(0x198)];}['requireProject'](_0x18aec7,_0x12d0bd,_0x496b72=0x0){const _0x4154c4=a54_0x54edc0,_0x87a9a0=this[_0x4154c4(0x2bd)](_0x18aec7,_0x12d0bd,_0x496b72);if(!_0x87a9a0)return console[_0x4154c4(0x279)](a54_0x26125e['red'](_0x4154c4(0x14e)),'Project\x20name\x20is\x20required'),console['error'](a54_0x26125e['dim'](_0x4154c4(0x1eb))),null;return _0x87a9a0;}[a54_0x54edc0(0x124)](_0x19fb18,_0x1a664f){const _0x3f6029=a54_0x54edc0;if(_0x19fb18[0x0]){const _0x5d5194=_0x19fb18[0x0][_0x3f6029(0x210)]('.');if(_0x5d5194[_0x3f6029(0x274)]===0x1)return{'projectName':_0x5d5194[0x0],'workflowName':undefined};else return _0x5d5194['length']===0x2?{'projectName':_0x5d5194[0x0],'workflowName':_0x5d5194[0x1]}:(console['error'](a54_0x26125e[_0x3f6029(0x16f)](_0x3f6029(0x14e)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x1a664f[_0x3f6029(0x198)],'workflowName':undefined};}[a54_0x54edc0(0x1a1)](_0x249237,_0x585c6d,_0x55da15=0x0){const _0x1df6f8=a54_0x54edc0;if(_0x249237[_0x55da15])return _0x249237[_0x55da15];if(_0x585c6d[_0x1df6f8(0x198)]){const _0x2aab6c=a54_0x1db018['join'](process['cwd'](),_0x1df6f8(0x189),_0x585c6d['workflowProject']);if(existsSync(a54_0x1db018[_0x1df6f8(0x2a6)](_0x2aab6c,'tdx.json')))return _0x2aab6c;}return undefined;}async[a54_0x54edc0(0x140)](_0x43b851,_0x376d6d,_0x891256){const _0x474518=a54_0x54edc0;try{const _0x1f1c68=await _0x43b851['workflow'][_0x474518(0x189)](_0x376d6d,{'limit':0x1});if(_0x1f1c68[_0x474518(0x274)]>0x0){const _0x570d0d=_0x1f1c68[0x0]['id'],_0x44140e=getWorkflowUrl(_0x891256,_0x570d0d);console['error'](_0x474518(0x15e)+a54_0x26125e['cyan'](_0x44140e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:use';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1b7);async[a54_0x54edc0(0x256)](_0x325fa8){const _0x567bdf=a54_0x54edc0,{options:_0x5ba579,args:_0x4b8548,tdx:_0x11dcae}=_0x325fa8,_0x512c72=_0x4b8548[0x0],_0x39f81a=_0x5ba579[_0x567bdf(0x23d)];if(_0x39f81a)return saveSessionContext({'workflow_project':undefined},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x512c72)return console['error'](a54_0x26125e[_0x567bdf(0x16f)](_0x567bdf(0x14e)),_0x567bdf(0x2c0)),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)](_0x567bdf(0x2c8))),console[_0x567bdf(0x279)](a54_0x26125e[_0x567bdf(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x30621b=await withSpinner(_0x567bdf(0x1fd)+_0x512c72+_0x567bdf(0x216),()=>_0x11dcae[_0x567bdf(0x169)][_0x567bdf(0x192)](_0x512c72),{'verbose':_0x5ba579[_0x567bdf(0x1f9)]}),{name:_0x322ae8}=_0x30621b['data'];return saveSessionContext({'workflow_project':_0x322ae8},_0x5ba579[_0x567bdf(0x27d)]),console[_0x567bdf(0x25d)](a54_0x26125e[_0x567bdf(0x208)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x26125e['cyan'](_0x322ae8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:projects';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x25f);async['execute'](_0x5de221){const _0x1460ef=a54_0x54edc0,{options:_0x3d3e54,args:_0x5a72d6,tdx:_0x3f4742}=_0x5de221,_0x569776=_0x5a72d6[0x0];_0x3d3e54[_0x1460ef(0x1f9)]&&_0x569776&&console[_0x1460ef(0x279)](_0x1460ef(0x1ac)+_0x569776);const _0x27fab8=await withSpinner(_0x1460ef(0x138),()=>_0x3f4742[_0x1460ef(0x169)][_0x1460ef(0x262)](_0x569776,{'limit':_0x3d3e54[_0x1460ef(0x21e)]}),{'verbose':_0x3d3e54['verbose']});let _0x3977ea=_0x27fab8[_0x1460ef(0x199)];_0x3977ea[_0x1460ef(0x1f8)]((_0x4d0658,_0x4f7518)=>_0x4d0658['name'][_0x1460ef(0x267)](_0x4f7518['name']));const _0x408c03=_0x3d3e54[_0x1460ef(0x21e)]||0x64,_0x3224c3=_0x3977ea[_0x1460ef(0x274)]>=_0x408c03?a54_0x26125e[_0x1460ef(0x13e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1460ef(0x279)](_0x1460ef(0x272)+_0x3977ea[_0x1460ef(0x274)]+_0x1460ef(0x243)+(_0x3977ea['length']!==0x1?'s':'')+_0x3224c3);if(_0x3d3e54['format']===_0x1460ef(0x11d)||_0x3d3e54[_0x1460ef(0x185)]===_0x1460ef(0x245)||_0x3d3e54[_0x1460ef(0x185)]==='table')await handleSDKOutput(_0x3977ea,_0x3d3e54);else{if(_0x3977ea['length']===0x0)_0x569776?console[_0x1460ef(0x25d)](_0x1460ef(0x273)+_0x569776):console[_0x1460ef(0x25d)]('No\x20workflow\x20projects\x20found');else{const _0x4e7bc3=_0x3977ea[_0x1460ef(0x136)](_0x4ffa30=>{const _0x575aec=_0x1460ef,_0x55c8ec=_0x4ffa30['metadata']?.['some'](_0x2d398d=>_0x2d398d[_0x575aec(0x254)]===_0x575aec(0x23f)),_0x19e6ef=_0x55c8ec?a54_0x26125e[_0x575aec(0x13e)](_0x575aec(0x230)):'';return _0x575aec(0x2b1)+_0x4ffa30[_0x575aec(0x231)]+_0x19e6ef;});await writeOutput(_0x4e7bc3['join']('\x0a'),_0x3d3e54[_0x1460ef(0x2c5)],_0x1460ef(0x222));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:workflows';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x181);async[a54_0x54edc0(0x256)](_0x2855f3){const _0x326b34=a54_0x54edc0,{options:_0x451172,args:_0x5a6fd7,tdx:_0x46edac}=_0x2855f3,_0x26c44d=this['resolveProject'](_0x5a6fd7,_0x451172);_0x451172[_0x326b34(0x1f9)]&&_0x26c44d&&console['error']('Project\x20filter:\x20'+_0x26c44d);const _0x2a756a=await withSpinner(_0x326b34(0x295),()=>_0x46edac[_0x326b34(0x169)]['workflows'](_0x26c44d,{'limit':_0x451172['limit']}),{'verbose':_0x451172['verbose']});let _0x130b00=_0x2a756a[_0x326b34(0x199)];_0x130b00[_0x326b34(0x1f8)]((_0x2332dc,_0x25c143)=>{const _0x228061=_0x326b34,_0xc8176=_0x2332dc[_0x228061(0x231)]['localeCompare'](_0x25c143[_0x228061(0x231)]);if(_0xc8176!==0x0)return _0xc8176;return(_0x2332dc[_0x228061(0x21d)]?.[_0x228061(0x231)]||'')[_0x228061(0x267)](_0x25c143['project']?.[_0x228061(0x231)]||'');});const _0x2b748c=_0x451172[_0x326b34(0x21e)]||0x64,_0x1b5a3f=_0x130b00[_0x326b34(0x274)]>=_0x2b748c?a54_0x26125e[_0x326b34(0x13e)](_0x326b34(0x24b)):'';console[_0x326b34(0x279)](_0x326b34(0x272)+_0x130b00['length']+_0x326b34(0x238)+(_0x130b00['length']!==0x1?'s':'')+_0x1b5a3f);if(_0x451172[_0x326b34(0x185)]==='json'||_0x451172['format']===_0x326b34(0x245)||_0x451172[_0x326b34(0x185)]===_0x326b34(0x1c2))await handleSDKOutput(_0x130b00,_0x451172);else{if(_0x130b00[_0x326b34(0x274)]===0x0)_0x26c44d?console[_0x326b34(0x25d)](_0x326b34(0x294)+_0x26c44d):console[_0x326b34(0x25d)]('No\x20workflows\x20found');else{const _0x2789ba=_0x451172[_0x326b34(0x232)],_0x41f0a1=_0x130b00['map'](_0x47616c=>{const _0x211c2a=_0x326b34,_0x1c7724=a54_0x26125e[_0x211c2a(0x13e)]('#'+_0x47616c['id']),_0x2b237a=hyperlink(_0x1c7724,getWorkflowUrl(_0x2789ba,_0x47616c['id'])),_0x343c0f=_0x47616c['project']?.[_0x211c2a(0x231)]?a54_0x26125e[_0x211c2a(0x13e)]('\x20('+_0x47616c[_0x211c2a(0x21d)][_0x211c2a(0x231)]+')'):'';return _0x211c2a(0x288)+_0x2b237a+'\x20'+_0x47616c[_0x211c2a(0x231)]+_0x343c0f;});await writeOutput(_0x41f0a1[_0x326b34(0x2a6)]('\x0a'),_0x451172['output'],_0x326b34(0x222));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:sessions';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x15b);async[a54_0x54edc0(0x256)](_0x3c65aa){const _0x5e4ba4=a54_0x54edc0,{options:_0x4e4cdb,args:_0x1c00e6,tdx:_0x8f4fde}=_0x3c65aa,_0x4d548a=this[_0x5e4ba4(0x124)](_0x1c00e6,_0x4e4cdb);if(!_0x4d548a)return 0x1;const {projectName:_0x276c11,workflowName:_0x3de4da}=_0x4d548a;if(_0x4e4cdb[_0x5e4ba4(0x1f9)]){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x279)](_0x5e4ba4(0x2a7)+_0x276c11+'.'+_0x3de4da);else _0x276c11&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x22e)+_0x276c11);const _0x31e9a1=_0x4e4cdb[_0x5e4ba4(0x156)];_0x31e9a1&&console[_0x5e4ba4(0x279)](_0x5e4ba4(0x19b)+_0x31e9a1);}let _0x5b569b=0x28;if(process['stdout']['isTTY']&&!_0x4e4cdb[_0x5e4ba4(0x2c5)]&&!_0x4e4cdb[_0x5e4ba4(0x185)]){const _0x4ea3c0=process['stdout'][_0x5e4ba4(0x20b)]||0x28;_0x5b569b=Math[_0x5e4ba4(0x224)](0x14,Math[_0x5e4ba4(0x287)](_0x4ea3c0*0x2/0x3));}const _0x24a9e4=_0x4e4cdb[_0x5e4ba4(0x21e)]||_0x5b569b,_0x49db2b=await withSpinner(_0x5e4ba4(0x2a0),()=>_0x8f4fde[_0x5e4ba4(0x169)][_0x5e4ba4(0x173)]({'projectName':_0x276c11,'workflowName':_0x3de4da,'status':_0x4e4cdb['status'],'fromTime':_0x4e4cdb[_0x5e4ba4(0x213)],'toTime':_0x4e4cdb['to'],'limit':_0x24a9e4}),{'verbose':_0x4e4cdb[_0x5e4ba4(0x1f9)]}),_0x3a5f61=_0x49db2b['data'];_0x3a5f61[_0x5e4ba4(0x1f8)]((_0x1e806e,_0x21a2e6)=>{const _0x158ab3=_0x5e4ba4,_0x2ce1eb=_0x1e806e[_0x158ab3(0x2b9)]||'',_0x6210db=_0x21a2e6['sessionTime']||'';return _0x6210db[_0x158ab3(0x267)](_0x2ce1eb);});_0x3a5f61[_0x5e4ba4(0x274)]>=_0x24a9e4?console[_0x5e4ba4(0x279)]('✔\x20Showing\x20'+_0x3a5f61[_0x5e4ba4(0x274)]+'\x20sessions\x20'+a54_0x26125e[_0x5e4ba4(0x13e)](_0x5e4ba4(0x201))):console[_0x5e4ba4(0x279)](_0x5e4ba4(0x272)+_0x3a5f61[_0x5e4ba4(0x274)]+_0x5e4ba4(0x1ab)+(_0x3a5f61['length']!==0x1?'s':''));if(_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x11d)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x245)||_0x4e4cdb[_0x5e4ba4(0x185)]===_0x5e4ba4(0x1c2))await handleSDKOutput(_0x3a5f61,_0x4e4cdb);else{if(!process[_0x5e4ba4(0x1ce)][_0x5e4ba4(0x170)]||_0x4e4cdb['output']){if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else{const _0x487e7c=_0x4e4cdb[_0x5e4ba4(0x232)],_0xd5845b=this[_0x5e4ba4(0x1d6)](_0x3a5f61,_0x487e7c);_0x4e4cdb[_0x5e4ba4(0x2c5)]?await writeOutput(_0xd5845b,_0x4e4cdb[_0x5e4ba4(0x2c5)],_0x5e4ba4(0x222)):console['log'](_0xd5845b);}!_0x276c11&&(console[_0x5e4ba4(0x279)](''),console[_0x5e4ba4(0x279)](a54_0x26125e['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x5e4ba4(0x279)](a54_0x26125e['dim'](_0x5e4ba4(0x25a))+'or'+a54_0x26125e['dim'](_0x5e4ba4(0x20c))));}else{if(_0x3a5f61['length']===0x0){if(_0x276c11&&_0x3de4da)console['log'](_0x5e4ba4(0x13a)+_0x276c11+'.'+_0x3de4da);else _0x276c11?console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x21a)+_0x276c11):console[_0x5e4ba4(0x25d)](_0x5e4ba4(0x2ca));}else await this[_0x5e4ba4(0x1d5)](_0x3a5f61,_0x3c65aa,_0x276c11);}}return 0x0;}[a54_0x54edc0(0x1d6)](_0x234331,_0x3d59f1){const _0x30797e=a54_0x54edc0,_0x47e623=[],_0x163d7b=new Map();let _0x35d81d=Infinity,_0xaa2251=-Infinity;for(const _0x505d7f of _0x234331){if(_0x505d7f['lastAttempt']?.['createdAt']){const _0x2595e5=new Date(_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x145)])[_0x30797e(0x284)](),_0x41ff5f=_0x505d7f[_0x30797e(0x2b7)][_0x30797e(0x16e)]?new Date(_0x505d7f['lastAttempt'][_0x30797e(0x16e)])['getTime']():Date[_0x30797e(0x2be)](),_0x5eccb8=_0x505d7f[_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'(unknown)';!_0x163d7b[_0x30797e(0x2aa)](_0x5eccb8)&&_0x163d7b['set'](_0x5eccb8,[]),_0x163d7b['get'](_0x5eccb8)[_0x30797e(0x167)]({'session':_0x505d7f,'startTime':_0x2595e5,'endTime':_0x41ff5f,'duration':_0x41ff5f-_0x2595e5}),_0x35d81d=Math[_0x30797e(0x121)](_0x35d81d,_0x2595e5),_0xaa2251=Math[_0x30797e(0x224)](_0xaa2251,_0x41ff5f);}}if(_0x163d7b[_0x30797e(0x1da)]===0x0)return _0x30797e(0x241);const _0x2aedaa=process['stdout'][_0x30797e(0x2c3)]||0x78,_0x18a317=0x1e,_0x593c4d=0x32,_0x6dfdd8=0x4,_0x27a2f4=Math[_0x30797e(0x121)](_0x593c4d,Math['max'](_0x18a317,Math['floor'](_0x2aedaa*0.3))),_0x38f266=_0x2aedaa-_0x27a2f4-TIMELINE_CONFIG['GUTTER']-0x3-_0x6dfdd8,_0x1572af=_0xaa2251-_0x35d81d,_0xf99a2c=_0x1572af/_0x27a2f4,_0x4251af=renderTimeAxis({'startTime':_0x35d81d,'endTime':_0xaa2251,'durationMs':_0x1572af,'msPerChar':_0xf99a2c},_0x27a2f4),_0x23e5bf=[];for(const _0x272302 of _0x163d7b[_0x30797e(0x211)]()){_0x23e5bf[_0x30797e(0x167)](..._0x272302);}_0x23e5bf[_0x30797e(0x1f8)]((_0x32eea1,_0x4c71b8)=>_0x4c71b8[_0x30797e(0x1fa)]-_0x32eea1[_0x30797e(0x1fa)]);const _0x3b87b1=new Date(_0x35d81d),_0x909add=formatDate(_0x3b87b1),_0x2d9b82=_0x6dfdd8+TIMELINE_CONFIG[_0x30797e(0x162)]+TIMELINE_CONFIG[_0x30797e(0x1b1)]+_0x38f266,_0x5b47b0='\x20'[_0x30797e(0x258)](_0x2d9b82-_0x909add[_0x30797e(0x274)]),_0x55a1a4=_0x5b47b0+a54_0x26125e['dim'](_0x909add)+'\x20'+_0x4251af;_0x47e623[_0x30797e(0x167)](_0x55a1a4);const _0x8ab5b3=0x16;let _0x1c6c09=0x0;for(const _0x288176 of _0x23e5bf){const _0x35cdc6=_0x288176[_0x30797e(0x27d)][_0x30797e(0x21d)]?.[_0x30797e(0x231)]||'?',_0x6625d6=Math[_0x30797e(0x121)](stringWidth(_0x35cdc6),_0x8ab5b3);_0x1c6c09=Math[_0x30797e(0x224)](_0x1c6c09,_0x6625d6);}for(const _0x2f48c3 of _0x23e5bf){const {session:_0xcc2ec0,startTime:_0x4fa765,endTime:_0x3c6116,duration:_0x5581c3}=_0x2f48c3,_0x4d6f27=_0xcc2ec0[_0x30797e(0x21d)]?.['id'],_0x2cc2f3=_0xcc2ec0['id'],_0x1be73c=_0xcc2ec0[_0x30797e(0x21d)]?.['name']||'?',_0x4f345c=_0xcc2ec0[_0x30797e(0x169)]?.[_0x30797e(0x231)]||'?';let _0x49f365,_0x3f41b4;if(_0xcc2ec0['lastAttempt']){const _0xf8fb4e=_0xcc2ec0[_0x30797e(0x2b7)];!_0xf8fb4e['done']?(_0x49f365=_0xf8fb4e[_0x30797e(0x1f3)]?'🛑':'🔄',_0x3f41b4=_0xf8fb4e[_0x30797e(0x1f3)]?a54_0x26125e[_0x30797e(0x21c)]:a54_0x26125e[_0x30797e(0x154)]):(_0x49f365=_0xf8fb4e[_0x30797e(0x2bb)]?'✅':'❌',_0x3f41b4=_0xf8fb4e['success']?a54_0x26125e[_0x30797e(0x208)]:a54_0x26125e[_0x30797e(0x16f)]);}else _0x49f365='⏳',_0x3f41b4=a54_0x26125e[_0x30797e(0x13e)];const _0x63860e='#'+_0x2cc2f3,_0x3c5783=_0x4d6f27?hyperlink(_0x63860e,getWorkflowSessionUrl(_0x3d59f1,_0x4d6f27,_0x2cc2f3)):_0x63860e;let _0x15c7da=_0x1be73c;stringWidth(_0x1be73c)>_0x8ab5b3&&(_0x15c7da=_0x1be73c['slice'](0x0,_0x8ab5b3-0x1)+'…');const _0x1cba9f=a54_0x26125e['dim'](_0x15c7da),_0xb84d2b=stringWidth(_0x15c7da),_0x4f89fa='\x20'[_0x30797e(0x258)](_0x1c6c09-stringWidth(_0x15c7da)+0x2),_0x2eb65c='('+formatElapsed(_0x5581c3)+')',_0x1f107f=stringWidth(_0x2eb65c),_0xfaf3f8=stringWidth(_0x63860e),_0x5de900=_0xfaf3f8+0x1+_0xb84d2b+_0x4f89fa['length'],_0x566537=_0x38f266-_0x5de900-_0x1f107f-0x1-0x8;let _0x3be978=_0x4f345c;stringWidth(_0x3be978)>_0x566537&&(_0x3be978=_0x3be978[_0x30797e(0x12d)](0x0,_0x566537-0x1)+'…');const _0x35ff3b=_0x3c5783+'\x20'+_0x1cba9f+_0x4f89fa+_0x3be978,_0x1bb947=stringWidth(_0x35ff3b),_0x1b46ce=_0x38f266-_0x1bb947-_0x1f107f,_0x23585f=_0x35ff3b+'\x20'[_0x30797e(0x258)](Math[_0x30797e(0x224)](0x1,_0x1b46ce))+a54_0x26125e[_0x30797e(0x13e)](_0x2eb65c),_0x16be0e=Math[_0x30797e(0x287)]((_0x4fa765-_0x35d81d)/_0xf99a2c),_0x22e14e=Math[_0x30797e(0x287)]((_0x3c6116-_0x35d81d)/_0xf99a2c),_0x188467=Math[_0x30797e(0x224)](_0x16be0e+0x1,_0x22e14e),_0x4fc81d=new Array(_0x27a2f4)[_0x30797e(0x28b)]('\x20');for(let _0x52245a=_0x16be0e;_0x52245a<Math[_0x30797e(0x121)](_0x188467,_0x27a2f4);_0x52245a++){_0x4fc81d[_0x52245a]='─';}const _0x66e72c=_0x4fc81d[_0x30797e(0x136)](_0x290202=>_0x290202==='\x20'?'\x20':_0x3f41b4(_0x290202))['join']('');_0x47e623[_0x30797e(0x167)](_0x49f365+'\x20'+_0x23585f+'│'+_0x66e72c+'│');}return _0x47e623[_0x30797e(0x2a6)]('\x0a');}async[a54_0x54edc0(0x1d5)](_0x711a8c,_0x12cc86,_0x49326e){const _0x41b9bc=a54_0x54edc0,{options:_0x243956,tdx:_0x5ae6fc}=_0x12cc86,_0x1265fa=_0x243956['site'],{timelineRows:_0x6ce810,timeAxisHeader:_0x3d1ddf}=this[_0x41b9bc(0x195)](_0x711a8c,_0x1265fa),_0x5d0f46=_0x6ce810[_0x41b9bc(0x217)](_0x5e2759=>_0x5e2759['attemptId']);if(_0x5d0f46[_0x41b9bc(0x274)]===0x0){const _0x458f34=this[_0x41b9bc(0x1d6)](_0x711a8c,_0x1265fa);console[_0x41b9bc(0x25d)](_0x458f34);!_0x49326e&&(console[_0x41b9bc(0x279)](''),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x2c1))),console[_0x41b9bc(0x279)](a54_0x26125e['dim'](_0x41b9bc(0x25a))+'or'+a54_0x26125e['dim'](_0x41b9bc(0x20c))));return;}_0x3d1ddf&&console['log'](_0x3d1ddf);const _0x295619=_0x6ce810[_0x41b9bc(0x217)](_0x28674f=>_0x28674f[_0x41b9bc(0x28e)])[_0x41b9bc(0x136)](_0x24a6bd=>({'title':_0x24a6bd[_0x41b9bc(0x1d3)],'value':_0x24a6bd[_0x41b9bc(0x28e)]})),_0x2258bb=process[_0x41b9bc(0x1ce)][_0x41b9bc(0x20b)]||0x3c,_0x44d998=Math[_0x41b9bc(0x224)](0x28,Math[_0x41b9bc(0x287)](_0x2258bb*0x2/0x3)),_0x202088=await a54_0x1aee3d({'type':_0x41b9bc(0x250),'name':_0x41b9bc(0x28e),'message':_0x41b9bc(0x1c4),'choices':_0x295619,'initial':-0x1,'limit':_0x44d998,'clearFirst':!![],'fallback':{'title':_0x41b9bc(0x130),'value':null},'suggest':(_0x333e2d,_0x3ec979)=>{const _0x58cb7a=_0x41b9bc;if(!_0x333e2d)return Promise[_0x58cb7a(0x236)](_0x3ec979);const _0x4e81b4=_0x3ec979['filter'](_0x291a8d=>{const _0x3bdc1e=_0x58cb7a,_0x72439c=_0x291a8d;return _0x72439c[_0x3bdc1e(0x228)]['toLowerCase']()[_0x3bdc1e(0x183)](_0x333e2d[_0x3bdc1e(0x286)]());});return Promise[_0x58cb7a(0x236)](_0x4e81b4);}}),_0x32ed9d=()=>{const _0x2447a9=_0x41b9bc;process[_0x2447a9(0x1ce)]['write'](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2)),process[_0x2447a9(0x1ce)][_0x2447a9(0x15c)](_0x2447a9(0x1d2));},_0x38995a=_0x202088&&_0x202088[_0x41b9bc(0x28e)]&&_0x202088[_0x41b9bc(0x28e)]!==null&&_0x202088[_0x41b9bc(0x28e)][_0x41b9bc(0x234)]()!=='';if(!_0x38995a){_0x32ed9d(),console['log'](a54_0x26125e['dim'](_0x41b9bc(0x1cf)));return;}_0x32ed9d();const _0x18ce0f=_0x711a8c[_0x41b9bc(0x1b0)](_0x231f73=>_0x231f73[_0x41b9bc(0x2b7)]?.['id']===_0x202088['attemptId']);if(_0x18ce0f){const _0x4ca4f1=_0x18ce0f[_0x41b9bc(0x21d)]?.['name']||'?',_0x5b65c5=_0x18ce0f[_0x41b9bc(0x169)]?.[_0x41b9bc(0x231)]||'?';console[_0x41b9bc(0x25d)](_0x41b9bc(0x1e6)+a54_0x26125e['dim'](_0x4ca4f1)+',\x20Workflow:\x20'+a54_0x26125e['dim'](_0x5b65c5));}const _0x76427e=new WorkflowTimelineCommand();await _0x76427e[_0x41b9bc(0x256)]({'args':[],'options':{..._0x243956,'attemptId':_0x202088[_0x41b9bc(0x28e)]},'tdx':_0x5ae6fc});}[a54_0x54edc0(0x195)](_0x37cbe7,_0x495b3a){const _0x44658d=a54_0x54edc0,_0x6d4b2d=new Map();for(const _0x513733 of _0x37cbe7){_0x513733['id']&&_0x513733['lastAttempt']?.['id']&&_0x6d4b2d[_0x44658d(0x11e)](_0x513733['id'],_0x513733['lastAttempt']['id']);}const _0x3930a8=[];let _0x13220f='';const _0x25cf8d=this['renderSessionsTimeline'](_0x37cbe7,_0x495b3a),_0x138877=_0x25cf8d['split']('\x0a');for(const _0x3048c1 of _0x138877){if(_0x3048c1[_0x44658d(0x2b0)](_0x44658d(0x1b5))||_0x3048c1[_0x44658d(0x153)](/^\s+\d{4}-\d{2}-\d{2}/))_0x13220f=_0x3048c1;else{if(_0x3048c1['match'](/^[✅❌🔄🛑⏳]/)){const _0x587f07=_0x3048c1[_0x44658d(0x153)](/#(\d+)/),_0x1eb19b=_0x587f07?_0x587f07[0x1]:null,_0x2791c8=_0x1eb19b?_0x6d4b2d[_0x44658d(0x298)](_0x1eb19b)||null:null,_0x1da8d0=_0x37cbe7[_0x44658d(0x1b0)](_0xd3a951=>_0xd3a951['id']===_0x1eb19b),_0x42baaa=_0x1da8d0?.[_0x44658d(0x21d)]?.['name']||'';_0x3930a8['push']({'displayLine':_0x3048c1,'attemptId':_0x2791c8,'projectName':_0x42baaa});}}}return{'timelineRows':_0x3930a8,'timeAxisHeader':_0x13220f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a54_0x54edc0(0x26a)]='List\x20workflow\x20attempts';async[a54_0x54edc0(0x256)](_0x1bdd1a){const _0x2a773b=a54_0x54edc0,{options:_0x3b9be3,args:_0x3eadf1,tdx:_0x3ff8dc}=_0x1bdd1a,_0x3fa731=this[_0x2a773b(0x124)](_0x3eadf1,_0x3b9be3);if(!_0x3fa731)return 0x1;const {projectName:_0x5d5783,workflowName:_0x265dc5}=_0x3fa731,_0x5aee57=_0x3b9be3[_0x2a773b(0x1d4)];if(_0x3b9be3[_0x2a773b(0x1f9)]){if(_0x5d5783&&_0x265dc5)console[_0x2a773b(0x279)](_0x2a773b(0x2a7)+_0x5d5783+'.'+_0x265dc5);else _0x5d5783&&console[_0x2a773b(0x279)](_0x2a773b(0x22e)+_0x5d5783);_0x5aee57&&console['error'](_0x2a773b(0x158));}const _0x56d522=await withSpinner(_0x2a773b(0x22b),()=>_0x3ff8dc[_0x2a773b(0x169)][_0x2a773b(0x283)]({'projectName':_0x5d5783,'workflowName':_0x265dc5,'includeRetried':_0x5aee57,'limit':_0x3b9be3['limit']}),{'verbose':_0x3b9be3[_0x2a773b(0x1f9)]}),_0x31fb1e=_0x56d522[_0x2a773b(0x199)],_0x192321=_0x3b9be3['limit']||0x64,_0x1aed8f=_0x31fb1e[_0x2a773b(0x274)]>=_0x192321?a54_0x26125e['dim'](_0x2a773b(0x24b)):'';console[_0x2a773b(0x279)](_0x2a773b(0x272)+_0x31fb1e[_0x2a773b(0x274)]+_0x2a773b(0x221)+(_0x31fb1e[_0x2a773b(0x274)]!==0x1?'s':'')+_0x1aed8f);if(_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x11d)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x245)||_0x3b9be3[_0x2a773b(0x185)]===_0x2a773b(0x1c2))await handleSDKOutput(_0x31fb1e,_0x3b9be3);else{if(_0x31fb1e['length']===0x0){if(_0x5d5783&&_0x265dc5)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5d5783+'.'+_0x265dc5);else _0x5d5783?console[_0x2a773b(0x25d)](_0x2a773b(0x126)+_0x5d5783):console[_0x2a773b(0x25d)](_0x2a773b(0x1df));}else{const _0x391173=_0x3b9be3[_0x2a773b(0x232)],_0x42f063=_0x31fb1e['map'](_0x82a4b=>{const _0x5b9e29=_0x2a773b,_0x4e3fe1=a54_0x26125e[_0x5b9e29(0x13e)]('#'+_0x82a4b['id']),_0x305432=_0x82a4b[_0x5b9e29(0x21d)]?.['id'],_0x11c8d7=_0x82a4b[_0x5b9e29(0x1cd)]||_0x82a4b[_0x5b9e29(0x1fe)],_0x460016=_0x305432&&_0x11c8d7?hyperlink(_0x4e3fe1,getWorkflowAttemptUrl(_0x391173,_0x305432,_0x11c8d7,_0x82a4b['id'])):_0x4e3fe1,{icon:_0x23efc9,text:_0x1b3ba6}=getAttemptStatusDisplay(_0x82a4b),_0x144f12=(_0x82a4b[_0x5b9e29(0x21d)]?.[_0x5b9e29(0x231)]||'?')+'.'+(_0x82a4b['workflow']?.[_0x5b9e29(0x231)]||'?'),_0x150ecb=_0x82a4b[_0x5b9e29(0x2b9)]?a54_0x26125e[_0x5b9e29(0x13e)](_0x82a4b[_0x5b9e29(0x2b9)]):'';return(_0x460016+'\x20'+_0x23efc9+(_0x1b3ba6?'\x20'+_0x1b3ba6:'')+'\x20'+_0x144f12+'\x20'+_0x150ecb)[_0x5b9e29(0x14f)]();});await writeOutput(_0x42f063[_0x2a773b(0x2a6)]('\x0a'),_0x3b9be3[_0x2a773b(0x2c5)],_0x2a773b(0x222));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x265);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x28f);async[a54_0x54edc0(0x256)](_0x10c8e5){const _0x1033b5=a54_0x54edc0,{options:_0x5e9ed7,args:_0xc853cf,tdx:_0x87972d}=_0x10c8e5,_0x3d0c46=_0xc853cf[0x0];if(!_0x3d0c46)return console[_0x1033b5(0x279)](_0x1033b5(0x1bd)),0x1;_0x5e9ed7[_0x1033b5(0x1f9)]&&console[_0x1033b5(0x279)]('Attempt\x20ID:\x20'+_0x3d0c46);const _0x56c9e5=await withSpinner(_0x1033b5(0x1b4),()=>_0x87972d[_0x1033b5(0x169)][_0x1033b5(0x164)](_0x3d0c46),{'verbose':_0x5e9ed7[_0x1033b5(0x1f9)]}),_0x2f0931=_0x56c9e5[_0x1033b5(0x199)];let _0x3fc289;!_0x2f0931['done']?_0x3fc289=_0x2f0931[_0x1033b5(0x1f3)]?_0x1033b5(0x17d):_0x1033b5(0x187):_0x3fc289=_0x2f0931[_0x1033b5(0x2bb)]?_0x1033b5(0x2bb):'error';let _0x132d0b;if(_0x2f0931['createdAt']&&_0x2f0931[_0x1033b5(0x16e)]){const _0x11119a=new Date(_0x2f0931[_0x1033b5(0x145)])[_0x1033b5(0x284)](),_0x950d0b=new Date(_0x2f0931['finishedAt'])[_0x1033b5(0x284)]();_0x132d0b=Math['round']((_0x950d0b-_0x11119a)/0x3e8);}const _0x3ddb97={'attempt_id':_0x2f0931['id'],'status':_0x3fc289,..._0x2f0931[_0x1033b5(0x1e5)]!==undefined&&{'index':_0x2f0931[_0x1033b5(0x1e5)]},..._0x2f0931[_0x1033b5(0x21d)]&&{'project':_0x2f0931[_0x1033b5(0x21d)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x169)]&&{'workflow':_0x2f0931[_0x1033b5(0x169)][_0x1033b5(0x231)]},..._0x2f0931[_0x1033b5(0x1fe)]&&{'session_id':_0x2f0931[_0x1033b5(0x1fe)]},..._0x2f0931[_0x1033b5(0x2b9)]&&{'session_time':_0x2f0931[_0x1033b5(0x2b9)]},..._0x2f0931['retryAttemptName']&&{'retry_attempt':_0x2f0931['retryAttemptName']},..._0x132d0b!==undefined&&{'duration_sec':_0x132d0b},..._0x2f0931[_0x1033b5(0x145)]&&{'created_at':_0x2f0931[_0x1033b5(0x145)]},..._0x2f0931[_0x1033b5(0x16e)]&&{'finished_at':_0x2f0931['finishedAt']},...Object[_0x1033b5(0x257)](_0x2f0931[_0x1033b5(0x29a)])[_0x1033b5(0x274)]>0x0&&{'params':_0x2f0931[_0x1033b5(0x29a)]}};return await handleSingleObjectOutput(_0x3ddb97,_0x5e9ed7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1a2);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x2ad);async[a54_0x54edc0(0x256)](_0x1bf582){const _0x24a480=a54_0x54edc0,{options:_0x38fc54,args:_0x27615f,tdx:_0x3dcbe4}=_0x1bf582,_0x33ed06=_0x27615f[0x0];if(!_0x33ed06)return console['error'](_0x24a480(0x1bd)),0x1;const _0x27f08c=_0x38fc54[_0x24a480(0x141)];_0x38fc54[_0x24a480(0x1f9)]&&(console[_0x24a480(0x279)](_0x24a480(0x123)+_0x33ed06),_0x27f08c&&console['error'](_0x24a480(0x251)));const _0x515f64=await withSpinner(_0x24a480(0x1e3),()=>_0x3dcbe4['workflow'][_0x24a480(0x1a3)](_0x33ed06,_0x27f08c||![]),{'verbose':_0x38fc54[_0x24a480(0x1f9)]}),_0x552726=_0x515f64[_0x24a480(0x199)];return console[_0x24a480(0x279)](_0x24a480(0x272)+_0x552726[_0x24a480(0x274)]+_0x24a480(0x1bb)+(_0x552726[_0x24a480(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x552726,_0x38fc54),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:logs';['description']=a54_0x54edc0(0x171);async[a54_0x54edc0(0x256)](_0x37526d){const _0x3cd8b5=a54_0x54edc0,{options:_0x37e9e2,args:_0x336e44,tdx:_0x59d221}=_0x37526d,_0x54a338=_0x336e44[0x0];let _0x4db88e=_0x336e44[0x1];if(!_0x54a338)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x1bd)),0x1;_0x37e9e2[_0x3cd8b5(0x1f9)]&&(console[_0x3cd8b5(0x279)](_0x3cd8b5(0x123)+_0x54a338),_0x4db88e&&console[_0x3cd8b5(0x279)](_0x3cd8b5(0x220)+_0x4db88e));const _0x26037e=await withSpinner(_0x3cd8b5(0x165),()=>_0x59d221[_0x3cd8b5(0x169)][_0x3cd8b5(0x1bf)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x340360=_0x26037e['data'];if(_0x340360[_0x3cd8b5(0x274)]===0x0)return console[_0x3cd8b5(0x279)](_0x3cd8b5(0x26f)),0x0;if(!_0x4db88e&&(_0x37e9e2[_0x3cd8b5(0x11d)]||_0x37e9e2[_0x3cd8b5(0x185)]))return await handleSDKOutput(_0x340360,_0x37e9e2),0x0;if(!_0x4db88e){const _0x38a27d=_0x340360[_0x3cd8b5(0x136)](_0x27a32e=>({'title':_0x27a32e[_0x3cd8b5(0x14a)]+'\x20('+formatBytes(_0x27a32e[_0x3cd8b5(0x28d)])+')','value':_0x27a32e['taskName']})),_0x4a2cdf=await a54_0x1aee3d({'type':_0x3cd8b5(0x1b3),'name':_0x3cd8b5(0x14c),'message':_0x3cd8b5(0x27b),'choices':_0x38a27d});if(!_0x4a2cdf['task'])return console['error']('Cancelled'),0x0;_0x4db88e=_0x4a2cdf[_0x3cd8b5(0x14c)];}const _0x262f64=await withSpinner(_0x3cd8b5(0x268),()=>_0x59d221['workflow'][_0x3cd8b5(0x229)](_0x54a338,_0x4db88e),{'verbose':_0x37e9e2[_0x3cd8b5(0x1f9)]}),_0x220f05=_0x262f64[_0x3cd8b5(0x199)];return _0x220f05?console[_0x3cd8b5(0x25d)](_0x220f05):console['error'](_0x3cd8b5(0x131)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:kill';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1c9);async[a54_0x54edc0(0x256)](_0x124def){const _0x10d25a=a54_0x54edc0,{options:_0x4be135,args:_0x1a1a7f,tdx:_0x3b99df}=_0x124def,_0x23c271=_0x1a1a7f[0x0];if(!_0x23c271)return console[_0x10d25a(0x279)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x359755=_0x4be135[_0x10d25a(0x25b)];_0x4be135['verbose']&&(console['error'](_0x10d25a(0x123)+_0x23c271),_0x359755&&console[_0x10d25a(0x279)]('Reason:\x20'+_0x359755));if(!_0x4be135['yes']){if(!isInteractive())return console[_0x10d25a(0x279)](a54_0x26125e[_0x10d25a(0x16f)](_0x10d25a(0x186)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x26125e[_0x10d25a(0x13e)](_0x10d25a(0x2b3))),0x1;const _0x25d733=await confirmKey(_0x10d25a(0x23e)+_0x23c271+'?');if(!_0x25d733)return console[_0x10d25a(0x279)](a54_0x26125e['yellow'](_0x10d25a(0x1cf))),0x1;}const _0x493e01=await withSpinner('Killing\x20attempt...',()=>_0x3b99df[_0x10d25a(0x169)][_0x10d25a(0x18f)](_0x23c271,_0x359755),{'verbose':_0x4be135[_0x10d25a(0x1f9)]}),_0x2975db=_0x493e01[_0x10d25a(0x199)];return console['error']('✔\x20'+_0x2975db),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x24a);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x24e);async[a54_0x54edc0(0x256)](_0x38acc7){const _0x237497=a54_0x54edc0,{options:_0xdc28dc,args:_0x1172e6,tdx:_0x3a4250}=_0x38acc7,_0x1768a2=_0x1172e6[0x0];if(!_0x1768a2)return console[_0x237497(0x279)](_0x237497(0x176)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x507c0b=![],_0x8fa100=_0x1768a2;if(_0x1768a2[_0x237497(0x2b0)](_0x237497(0x178)))_0x507c0b=!![],_0x8fa100=_0x1768a2[_0x237497(0x1a4)](0x8);else{if(_0x1768a2[_0x237497(0x2b0)]('attempt:'))_0x507c0b=![],_0x8fa100=_0x1768a2['substring'](0x8);else return console[_0x237497(0x279)]('Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22'),console['error'](_0x237497(0x137)),0x1;}const _0x3d8120=_0xdc28dc[_0x237497(0x25c)],_0x21f957=_0xdc28dc[_0x237497(0x135)],_0x14dc03=_0xdc28dc[_0x237497(0x29a)],_0x2b8e2c=_0xdc28dc[_0x237497(0x1c3)];_0xdc28dc[_0x237497(0x1f9)]&&(console[_0x237497(0x279)](_0x237497(0x144)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100),_0x3d8120&&console[_0x237497(0x279)]('From\x20task:\x20'+_0x3d8120),_0x21f957&&console[_0x237497(0x279)](_0x237497(0x260)+_0x21f957),_0x14dc03&&console[_0x237497(0x279)](_0x237497(0x155)+_0x14dc03),_0x2b8e2c&&console[_0x237497(0x279)](_0x237497(0x296)));let _0x43820e;if(_0x14dc03)try{if(_0x14dc03['startsWith']('@')){const _0x549993=await import(_0x237497(0x248)),_0x176fb6=_0x14dc03[_0x237497(0x1a4)](0x1),_0x5d915e=await _0x549993[_0x237497(0x151)](_0x176fb6,_0x237497(0x21f));_0x43820e=JSON[_0x237497(0x26d)](_0x5d915e);}else _0x43820e=JSON[_0x237497(0x26d)](_0x14dc03);}catch{return console[_0x237497(0x279)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0xdc28dc['yes']){if(!isInteractive())return console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x16f)](_0x237497(0x186)),_0x237497(0x269)),console[_0x237497(0x279)](a54_0x26125e[_0x237497(0x13e)](_0x237497(0x2b3))),0x1;const _0x127166=await confirmKey(_0x237497(0x207)+(_0x507c0b?_0x237497(0x27d):_0x237497(0x164))+'\x20'+_0x8fa100+'?');if(!_0x127166)return console['error'](a54_0x26125e[_0x237497(0x21c)]('Cancelled')),0x1;}let _0x4e5923;_0x507c0b?_0x4e5923=await withSpinner(_0x237497(0x2a9),()=>_0x3a4250['workflow']['retrySession'](_0x8fa100,{'fromTask':_0x3d8120,'retryParams':_0x43820e}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]}):_0x4e5923=await withSpinner(_0x237497(0x1ea),()=>_0x3a4250[_0x237497(0x169)]['retryAttempt'](_0x8fa100,{'resumeFrom':_0x21f957,'retryParams':_0x43820e,'force':_0x2b8e2c}),{'verbose':_0xdc28dc[_0x237497(0x1f9)]});const _0x1a708b=_0x4e5923['data'];return console[_0x237497(0x279)](_0x237497(0x247)),console[_0x237497(0x279)](_0x237497(0x29d)+_0x1a708b[_0x237497(0x28e)]),console[_0x237497(0x279)]('\x20\x20Session\x20ID:\x20'+_0x1a708b['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22f);[a54_0x54edc0(0x26a)]='Start\x20a\x20workflow\x20run';async[a54_0x54edc0(0x256)](_0x1e3329){const _0x56627c=a54_0x54edc0,{options:_0x1c502a,args:_0x25a428,tdx:_0x3a85cb}=_0x1e3329;let _0x438196=_0x25a428[0x0];if(!_0x438196){const _0x263f13=this[_0x56627c(0x2bd)]([],_0x1c502a),_0x184e07=await withSpinner(_0x56627c(0x1e4),()=>_0x3a85cb[_0x56627c(0x169)][_0x56627c(0x189)](_0x263f13,{'limit':_0x1c502a[_0x56627c(0x21e)]}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x30e2df=_0x184e07[_0x56627c(0x199)];if(_0x30e2df[_0x56627c(0x274)]===0x0)return console[_0x56627c(0x279)]('No\x20workflows\x20found'),!_0x263f13&&console[_0x56627c(0x279)](a54_0x26125e['dim'](_0x56627c(0x1eb))),0x1;const _0x687d9d=_0x30e2df[_0x56627c(0x136)](_0x13c8c4=>({'title':_0x13c8c4['project']?.[_0x56627c(0x231)]+'.'+_0x13c8c4['name'],'value':_0x13c8c4[_0x56627c(0x21d)]?.[_0x56627c(0x231)]+'.'+_0x13c8c4[_0x56627c(0x231)],'description':_0x13c8c4[_0x56627c(0x235)]?_0x56627c(0x205)+_0x13c8c4[_0x56627c(0x235)]:undefined})),_0x54543b=await a54_0x1aee3d({'type':_0x56627c(0x1b3),'name':_0x56627c(0x169),'message':_0x56627c(0x17e),'choices':_0x687d9d});if(!_0x54543b[_0x56627c(0x169)])return 0x1;_0x438196=_0x54543b[_0x56627c(0x169)];}if(!_0x438196[_0x56627c(0x183)]('.')){const _0x109bb7=this[_0x56627c(0x2bd)]([],_0x1c502a);if(_0x109bb7)_0x438196=_0x109bb7+'.'+_0x438196;else return console['error'](a54_0x26125e[_0x56627c(0x16f)](_0x56627c(0x14e)),_0x56627c(0x275)),console[_0x56627c(0x279)](a54_0x26125e[_0x56627c(0x13e)](_0x56627c(0x1eb))),0x1;}const _0x1e7785=_0x1c502a[_0x56627c(0x271)],_0x44cd83=_0x1c502a[_0x56627c(0x2b9)],_0x1d37b9={};if(_0x1e7785&&Array[_0x56627c(0x16c)](_0x1e7785))for(const _0x1c64dc of _0x1e7785){const _0x5186ce=_0x1c64dc[_0x56627c(0x2b5)]('=');if(_0x5186ce===-0x1)return console[_0x56627c(0x279)](_0x56627c(0x1f4)+_0x1c64dc),console[_0x56627c(0x279)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1d563c=_0x1c64dc[_0x56627c(0x1a4)](0x0,_0x5186ce),_0x398349=_0x1c64dc[_0x56627c(0x1a4)](_0x5186ce+0x1);try{_0x1d37b9[_0x1d563c]=JSON[_0x56627c(0x26d)](_0x398349);}catch{_0x1d37b9[_0x1d563c]=_0x398349;}}_0x1c502a[_0x56627c(0x1f9)]&&(console[_0x56627c(0x279)](_0x56627c(0x12a)+_0x438196),Object[_0x56627c(0x257)](_0x1d37b9)['length']>0x0&&console[_0x56627c(0x279)](_0x56627c(0x1b8)+JSON['stringify'](_0x1d37b9)),_0x44cd83&&console[_0x56627c(0x279)](_0x56627c(0x13c)+_0x44cd83));const _0x52fcac=await withSpinner(_0x56627c(0x297),()=>_0x3a85cb[_0x56627c(0x169)]['run'](_0x438196,_0x1d37b9,{'sessionTime':_0x44cd83}),{'verbose':_0x1c502a[_0x56627c(0x1f9)]}),_0x39ba60=_0x52fcac[_0x56627c(0x199)];console['error'](_0x56627c(0x20a)),console[_0x56627c(0x279)]('\x20\x20Attempt\x20ID:\x20'+_0x39ba60['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x39ba60[_0x56627c(0x1fe)]),console[_0x56627c(0x279)](_0x56627c(0x29b)+_0x39ba60[_0x56627c(0x21d)]?.['name']),console[_0x56627c(0x279)](_0x56627c(0x14b)+_0x39ba60[_0x56627c(0x169)]?.[_0x56627c(0x231)]);if(_0x39ba60[_0x56627c(0x21d)]?.['id']&&_0x39ba60['sessionId']&&_0x39ba60['id']){const _0x504816=_0x1c502a['site'],_0x198b7f=getConsoleUrl(_0x504816,_0x56627c(0x1e0)+_0x39ba60[_0x56627c(0x21d)]['id']+_0x56627c(0x194)+_0x39ba60[_0x56627c(0x1fe)]+_0x56627c(0x179)+_0x39ba60['id']);console[_0x56627c(0x279)](_0x56627c(0x15e)+a54_0x26125e['cyan'](_0x198b7f));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x21b);['description']=a54_0x54edc0(0x19c);async[a54_0x54edc0(0x256)](_0x22a6e4){const _0x4557f5=a54_0x54edc0,{options:_0x4a7912,args:_0x50df57,tdx:_0x46239c}=_0x22a6e4,_0x55f420=_0x50df57[0x0],_0x2f39a6=_0x50df57[0x1]||'.';if(!_0x55f420)return console[_0x4557f5(0x279)](_0x4557f5(0x175)),console['error'](_0x4557f5(0x1ef)),0x1;const _0x34efac=_0x4a7912['revision'];_0x4a7912['verbose']&&(console[_0x4557f5(0x279)](_0x4557f5(0x1e6)+_0x55f420),console[_0x4557f5(0x279)](_0x4557f5(0x219)+_0x2f39a6),_0x34efac&&console['error'](_0x4557f5(0x26b)+_0x34efac));const _0x326726=await withSpinner(_0x4557f5(0x1d0)+_0x55f420+_0x4557f5(0x1aa),()=>_0x46239c[_0x4557f5(0x169)][_0x4557f5(0x1f2)](_0x55f420,_0x2f39a6,{'revision':_0x34efac}),{'verbose':_0x4a7912[_0x4557f5(0x1f9)]}),_0x42a283=_0x326726[_0x4557f5(0x199)];return console[_0x4557f5(0x279)](_0x4557f5(0x1dc)+_0x42a283[_0x4557f5(0x1d7)]),console['error'](_0x4557f5(0x143)+_0x42a283['revision']),console['error']('\x20\x20Files\x20extracted:\x20'+_0x42a283[_0x4557f5(0x17c)]),console['error'](_0x4557f5(0x223)+_0x2f39a6+'/'+_0x42a283['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22c);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x125);async['execute'](_0x5f3070){const _0x3a2b6d=a54_0x54edc0,{options:_0x261b15,args:_0x5edb2d,tdx:_0x3cdfe7}=_0x5f3070;let _0x343ee1='.',_0x5aae34=_0x261b15['name'];if(_0x5edb2d[0x0]){const {promises:_0x17e4b9}=await import('fs');try{const _0xa728fd=await _0x17e4b9[_0x3a2b6d(0x1a7)](_0x5edb2d[0x0]);if(_0xa728fd[_0x3a2b6d(0x23a)]())_0x343ee1=_0x5edb2d[0x0];else return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x12c)+_0x5edb2d[0x0]+_0x3a2b6d(0x290)),0x1;}catch{_0x5aae34=_0x5edb2d[0x0],_0x343ee1='.';}}const _0xdd216=_0x261b15[_0x3a2b6d(0x235)],_0x1655e2=_0x261b15[_0x3a2b6d(0x129)];_0x261b15[_0x3a2b6d(0x1f9)]&&(console['error'](_0x3a2b6d(0x2c4)+_0x343ee1),_0x5aae34&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x27a)+_0x5aae34),_0xdd216&&console['error'](_0x3a2b6d(0x26b)+_0xdd216),_0x1655e2&&console[_0x3a2b6d(0x279)](_0x3a2b6d(0x174)));const _0xc80a4d=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3cdfe7[_0x3a2b6d(0x169)][_0x3a2b6d(0x167)](_0x343ee1,{'projectName':_0x5aae34,'revision':_0xdd216,'skipValidation':_0x1655e2}),{'verbose':_0x261b15['verbose']}),_0x31d758=_0xc80a4d[_0x3a2b6d(0x199)];return console[_0x3a2b6d(0x279)](_0x3a2b6d(0x166)+_0x31d758[_0x3a2b6d(0x1d7)]),console[_0x3a2b6d(0x279)](_0x3a2b6d(0x2b8)+_0x31d758['projectId']),console[_0x3a2b6d(0x279)]('\x20\x20Revision:\x20'+_0x31d758['revision']),await this[_0x3a2b6d(0x140)](_0x3cdfe7,_0x31d758[_0x3a2b6d(0x1d7)],_0x261b15[_0x3a2b6d(0x232)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x54edc0(0x132);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x29f);async[a54_0x54edc0(0x256)](_0x41b0fd){const _0x51a30f=a54_0x54edc0,{options:_0x88a115,args:_0x29ad5b,tdx:_0x5bcf6b}=_0x41b0fd,_0x276015=_0x29ad5b[0x0],_0xec7cb0=_0x29ad5b[0x1];if(!_0x276015)return console[_0x51a30f(0x279)](a54_0x26125e['red'](_0x51a30f(0x14e)),_0x51a30f(0x2c0)),console['error'](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x1c6))),0x1;const _0x3e4755=_0x88a115[_0x51a30f(0x235)];_0x88a115[_0x51a30f(0x1f9)]&&(console[_0x51a30f(0x279)](_0x51a30f(0x1e6)+_0x276015),_0xec7cb0&&console[_0x51a30f(0x279)](_0x51a30f(0x1a5)+_0xec7cb0),_0x3e4755&&console['error'](_0x51a30f(0x26b)+_0x3e4755),_0x88a115[_0x51a30f(0x200)]&&console['error']('Dry\x20run:\x20yes'));const _0x21db55=await withSpinner('Pulling\x20project\x20'+_0x276015+_0x51a30f(0x1aa),()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1fb)](_0x276015,{'targetDir':_0xec7cb0,'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),_0x52265c=_0x21db55[_0x51a30f(0x199)];_0x52265c[_0x51a30f(0x24f)]?console['error'](_0x51a30f(0x1c5)+_0x52265c[_0x51a30f(0x1d7)]):console[_0x51a30f(0x279)]('→\x20Project:\x20'+_0x52265c['projectName']);console[_0x51a30f(0x279)](_0x51a30f(0x143)+_0x52265c[_0x51a30f(0x235)]),console[_0x51a30f(0x279)](_0x51a30f(0x19d)+(a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.')),console[_0x51a30f(0x279)](_0x51a30f(0x2a8)+a54_0x26125e[_0x51a30f(0x208)]('+'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x237)]+_0x51a30f(0x291))+',\x20'+(a54_0x26125e['yellow']('~'+_0x52265c['summary'][_0x51a30f(0x142)]+_0x51a30f(0x1d8))+',\x20')+(a54_0x26125e['red']('-'+_0x52265c[_0x51a30f(0x163)][_0x51a30f(0x277)]+_0x51a30f(0x160))+',\x20')+(''+a54_0x26125e[_0x51a30f(0x13e)](_0x52265c['summary'][_0x51a30f(0x1ed)]+_0x51a30f(0x1a8))));for(const _0x8f73dd of _0x52265c[_0x51a30f(0x2c6)]){_0x8f73dd[_0x51a30f(0x266)]===_0x51a30f(0x142)&&_0x8f73dd[_0x51a30f(0x1e8)]&&(console[_0x51a30f(0x279)]('\x0a'+a54_0x26125e[_0x51a30f(0x1ca)]('---\x20'+_0x8f73dd['path'])),console[_0x51a30f(0x279)](_0x8f73dd[_0x51a30f(0x1e8)]));}if(!_0x52265c[_0x51a30f(0x202)])return saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x208)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x1f7)+_0x52265c[_0x51a30f(0x1d7)])),0x0;if(_0x88a115[_0x51a30f(0x200)])return console['error'](a54_0x26125e[_0x51a30f(0x21c)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x88a115['yes']){if(!isInteractive())return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x16f)](_0x51a30f(0x186)),_0x51a30f(0x269)),console[_0x51a30f(0x279)](a54_0x26125e['dim'](_0x51a30f(0x2b3))),0x1;const _0x212ae2=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x212ae2)return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x21c)](_0x51a30f(0x1cf)),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x5bcf6b[_0x51a30f(0x169)][_0x51a30f(0x1e1)](_0x52265c,{'revision':_0x3e4755}),{'verbose':_0x88a115['verbose']}),saveSessionContext({'workflow_project':_0x52265c['projectName']},_0x88a115[_0x51a30f(0x27d)]),console['error'](a54_0x26125e[_0x51a30f(0x208)]('✔\x20Pull\x20complete'));const _0x94af49=a54_0x1db018[_0x51a30f(0x184)](process[_0x51a30f(0x2a2)](),_0x52265c[_0x51a30f(0x120)])||'.';return console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)](_0x51a30f(0x223)+_0x94af49)),console[_0x51a30f(0x279)](a54_0x26125e[_0x51a30f(0x13e)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x52265c['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x54edc0(0x182);['description']=a54_0x54edc0(0x2c7);async[a54_0x54edc0(0x256)](_0x354964){const _0x2262a3=a54_0x54edc0,{options:_0x4d5eff,args:_0x289ba1,tdx:_0x3ef46b}=_0x354964,_0x1a7cc2=this[_0x2262a3(0x1a1)](_0x289ba1,_0x4d5eff),_0x2aa01a=_0x4d5eff[_0x2262a3(0x235)],_0x56e2c9=_0x4d5eff['skipValidation'];_0x4d5eff[_0x2262a3(0x1f9)]&&(_0x1a7cc2&&console[_0x2262a3(0x279)](_0x2262a3(0x17f)+_0x1a7cc2),_0x2aa01a&&console['error'](_0x2262a3(0x26b)+_0x2aa01a),_0x4d5eff[_0x2262a3(0x200)]&&console[_0x2262a3(0x279)](_0x2262a3(0x15f)),_0x56e2c9&&console[_0x2262a3(0x279)]('Validation:\x20skipped'));let _0x3c5b64;try{_0x3c5b64=await withSpinner(_0x2262a3(0x147),()=>_0x3ef46b['workflow']['preparePushProject']({'sourceDir':_0x1a7cc2,'revision':_0x2aa01a,'skipValidation':_0x56e2c9}),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]});}catch(_0x205496){if(_0x205496 instanceof Error&&_0x205496[_0x2262a3(0x276)][_0x2262a3(0x183)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x16f)](_0x2262a3(0x14e)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4d5eff[_0x2262a3(0x198)]?console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x12e)+_0x4d5eff['workflowProject']+_0x2262a3(0x2ba)+_0x4d5eff[_0x2262a3(0x198)]+'\x27')):console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)](_0x2262a3(0x261))),0x1;throw _0x205496;}const _0x3baf87=_0x3c5b64[_0x2262a3(0x199)];console['error'](_0x2262a3(0x270)+_0x3baf87[_0x2262a3(0x1d7)]),console[_0x2262a3(0x279)](_0x2262a3(0x12b)+_0x3baf87[_0x2262a3(0x206)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x3baf87['revision']),console['error'](_0x2262a3(0x2a8)+a54_0x26125e[_0x2262a3(0x208)]('+'+_0x3baf87['summary'][_0x2262a3(0x237)]+_0x2262a3(0x291))+',\x20'+(a54_0x26125e[_0x2262a3(0x21c)]('~'+_0x3baf87['summary'][_0x2262a3(0x142)]+_0x2262a3(0x1d8))+',\x20')+(a54_0x26125e[_0x2262a3(0x16f)]('-'+_0x3baf87['summary'][_0x2262a3(0x277)]+_0x2262a3(0x160))+',\x20')+(''+a54_0x26125e[_0x2262a3(0x13e)](_0x3baf87[_0x2262a3(0x163)]['unchanged']+_0x2262a3(0x1a8))));for(const _0x3ac2e8 of _0x3baf87[_0x2262a3(0x2c6)]){_0x3ac2e8[_0x2262a3(0x266)]===_0x2262a3(0x142)&&_0x3ac2e8[_0x2262a3(0x1e8)]&&(console[_0x2262a3(0x279)]('\x0a'+a54_0x26125e[_0x2262a3(0x1ca)](_0x2262a3(0x1c7)+_0x3ac2e8['path'])),console[_0x2262a3(0x279)](_0x3ac2e8[_0x2262a3(0x1e8)]));}if(!_0x3baf87['hasChanges'])return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x193))),await this[_0x2262a3(0x140)](_0x3ef46b,_0x3baf87['projectName'],_0x4d5eff[_0x2262a3(0x232)]),0x0;if(_0x4d5eff[_0x2262a3(0x200)])return console[_0x2262a3(0x279)](a54_0x26125e['yellow'](_0x2262a3(0x2a3))),0x0;if(!_0x4d5eff[_0x2262a3(0x13d)]){if(!isInteractive())return console[_0x2262a3(0x279)](a54_0x26125e['red'](_0x2262a3(0x186)),_0x2262a3(0x269)),console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16f02e=await confirmKey(_0x2262a3(0x1dd));if(!_0x16f02e)return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x21c)]('Cancelled'),_0x2262a3(0x13b)),0x1;}const _0x4cc613=await withSpinner('Pushing\x20project...',()=>_0x3ef46b[_0x2262a3(0x169)][_0x2262a3(0x18b)](_0x3baf87),{'verbose':_0x4d5eff[_0x2262a3(0x1f9)]}),_0x27883d=_0x4cc613[_0x2262a3(0x199)];return console[_0x2262a3(0x279)](a54_0x26125e[_0x2262a3(0x208)](_0x2262a3(0x1bc))),console[_0x2262a3(0x279)]('\x20\x20Project\x20ID:\x20'+_0x27883d[_0x2262a3(0x152)]),console[_0x2262a3(0x279)](_0x2262a3(0x143)+_0x27883d[_0x2262a3(0x235)]),await this[_0x2262a3(0x140)](_0x3ef46b,_0x27883d[_0x2262a3(0x1d7)],_0x4d5eff[_0x2262a3(0x232)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x22d);[a54_0x54edc0(0x26a)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x54edc0(0x256)](_0x3b0f75){const _0x38746d=a54_0x54edc0,{options:_0x4e8c58,args:_0x420cba,tdx:_0x46799b}=_0x3b0f75,_0x43742f=this[_0x38746d(0x1a1)](_0x420cba,_0x4e8c58),_0x442f08=_0x4e8c58[_0x38746d(0x231)],_0x3baa72=_0x4e8c58[_0x38746d(0x235)],_0x4dd0c7=_0x4e8c58[_0x38746d(0x129)];if(!_0x43742f)return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x14e)),_0x38746d(0x1f5)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),console['error'](a54_0x26125e[_0x38746d(0x13e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x442f08)return console[_0x38746d(0x279)](a54_0x26125e['red']('Error:'),_0x38746d(0x1f0)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x1c8))),0x1;_0x4e8c58['verbose']&&(console['error'](_0x38746d(0x17f)+_0x43742f),console['error'](_0x38746d(0x1ff)+_0x442f08),_0x3baa72&&console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x3baa72),_0x4e8c58[_0x38746d(0x200)]&&console[_0x38746d(0x279)](_0x38746d(0x15f)),_0x4dd0c7&&console[_0x38746d(0x279)](_0x38746d(0x174)));const _0x50730f=await withSpinner('Analyzing\x20project...',()=>_0x46799b[_0x38746d(0x169)][_0x38746d(0x253)](_0x43742f,_0x442f08,{'revision':_0x3baa72,'skipValidation':_0x4dd0c7}),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x35979e=_0x50730f['data'];console[_0x38746d(0x279)](_0x38746d(0x1af)+_0x35979e['sourceDir']);_0x35979e['sourceProjectName']&&console[_0x38746d(0x279)]('Source\x20project:\x20'+_0x35979e['sourceProjectName']);console[_0x38746d(0x279)](_0x38746d(0x1ff)+_0x35979e['newProjectName']),console[_0x38746d(0x279)](_0x38746d(0x26b)+_0x35979e[_0x38746d(0x235)]),console[_0x38746d(0x279)](_0x38746d(0x2b4)+_0x35979e['fileCount']);_0x35979e['targetExists']&&(console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x21c)]('\x0a⚠\x20Project\x20\x22'+_0x35979e['newProjectName']+_0x38746d(0x1b9)+_0x35979e[_0x38746d(0x2af)]+')')),console[_0x38746d(0x279)](a54_0x26125e['yellow'](_0x38746d(0x259))));if(_0x4e8c58[_0x38746d(0x200)])return console['error'](a54_0x26125e['yellow'](_0x38746d(0x24d))),0x0;if(!_0x4e8c58['yes']){if(!isInteractive())return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x16f)](_0x38746d(0x186)),_0x38746d(0x269)),console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x13e)](_0x38746d(0x2b3))),0x1;const _0x441a15=_0x35979e['sourceProjectName']||a54_0x1db018[_0x38746d(0x289)](_0x43742f),_0x44a106=_0x35979e[_0x38746d(0x177)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x442f08+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x441a15+_0x38746d(0x212)+_0x442f08+'\x22?',_0x578ec1=await confirmKey(_0x44a106);if(!_0x578ec1)return console['error'](a54_0x26125e['yellow']('Cancelled')),0x1;}const _0x1192a9=await withSpinner(_0x35979e[_0x38746d(0x177)]?_0x38746d(0x1c0)+_0x442f08+_0x38746d(0x1aa):_0x38746d(0x1e2)+_0x442f08+'...',()=>_0x46799b[_0x38746d(0x169)]['executeCloneProject'](_0x35979e),{'verbose':_0x4e8c58[_0x38746d(0x1f9)]}),_0x1252e4=_0x1192a9[_0x38746d(0x199)];return console[_0x38746d(0x279)](a54_0x26125e[_0x38746d(0x208)](_0x35979e[_0x38746d(0x177)]?_0x38746d(0x191):_0x38746d(0x11c))),console['error'](_0x38746d(0x29b)+_0x1252e4['newProjectName']),console[_0x38746d(0x279)]('\x20\x20Project\x20ID:\x20'+_0x1252e4[_0x38746d(0x18c)]),console[_0x38746d(0x279)]('\x20\x20Revision:\x20'+_0x1252e4['revision']),await this[_0x38746d(0x140)](_0x46799b,_0x1252e4[_0x38746d(0x1b2)],_0x4e8c58[_0x38746d(0x232)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x54edc0(0x231)]='workflow:delete';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x252);async[a54_0x54edc0(0x256)](_0xe7e749){const _0x5aacc4=a54_0x54edc0,{options:_0x2a126d,args:_0x4c1c4b,tdx:_0xe8cefb}=_0xe7e749,_0xf6ca25=_0x4c1c4b[0x0];if(!_0xf6ca25)return console[_0x5aacc4(0x279)](_0x5aacc4(0x1ec)),console[_0x5aacc4(0x279)](_0x5aacc4(0x1fc)),0x1;_0x2a126d[_0x5aacc4(0x1f9)]&&console[_0x5aacc4(0x279)]('Project:\x20'+_0xf6ca25);if(!_0x2a126d[_0x5aacc4(0x13d)]){if(!isInteractive())return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x16f)]('\x0aError:'),_0x5aacc4(0x269)),console[_0x5aacc4(0x279)](a54_0x26125e['dim'](_0x5aacc4(0x2b3))),0x1;const _0x3b4a50=await confirmKey(_0x5aacc4(0x1f1)+_0xf6ca25+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x3b4a50)return console[_0x5aacc4(0x279)](a54_0x26125e[_0x5aacc4(0x21c)](_0x5aacc4(0x1cf))),0x1;}const _0x425285=await withSpinner(_0x5aacc4(0x1d1)+_0xf6ca25+_0x5aacc4(0x1aa),()=>_0xe8cefb[_0x5aacc4(0x169)][_0x5aacc4(0x1c1)](_0xf6ca25),{'verbose':_0x2a126d[_0x5aacc4(0x1f9)]}),_0x514590=_0x425285[_0x5aacc4(0x199)];return console['error'](_0x5aacc4(0x1de)+_0x514590[_0x5aacc4(0x1d7)]),console[_0x5aacc4(0x279)](_0x5aacc4(0x2b8)+_0x514590['projectId']),0x0;}}export function parseKeyValue(_0xa58a3e){const _0x6d1ae0=a54_0x54edc0,_0x53a1a0=_0xa58a3e[_0x6d1ae0(0x2b5)]('=');if(_0x53a1a0===-0x1)throw new Error(_0x6d1ae0(0x281)+_0xa58a3e+_0x6d1ae0(0x19f));const _0x349085=_0xa58a3e[_0x6d1ae0(0x1a4)](0x0,_0x53a1a0),_0x473d7c=_0xa58a3e[_0x6d1ae0(0x1a4)](_0x53a1a0+0x1);if(!_0x349085)throw new Error(_0x6d1ae0(0x285));return{'key':_0x349085,'value':_0x473d7c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:secrets:list';[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x146);async['execute'](_0x3eb655){const _0x27b9f3=a54_0x54edc0,{options:_0x5c106c,args:_0x37accf,tdx:_0x5f0dbc}=_0x3eb655,_0x2f958c=this[_0x27b9f3(0x1ad)](_0x37accf,_0x5c106c);if(!_0x2f958c)return 0x1;_0x5c106c[_0x27b9f3(0x1f9)]&&console[_0x27b9f3(0x279)]('Project:\x20'+_0x2f958c);const _0x44a014=await withSpinner(_0x27b9f3(0x1ee),()=>_0x5f0dbc[_0x27b9f3(0x169)][_0x27b9f3(0x2ab)](_0x2f958c),{'verbose':_0x5c106c['verbose']}),{secrets:_0x51fa24}=_0x44a014['data'];return console[_0x27b9f3(0x279)]('✔\x20Found\x20'+_0x51fa24['length']+_0x27b9f3(0x1f6)+(_0x51fa24[_0x27b9f3(0x274)]!==0x1?'s':'')),await handleSDKOutput(_0x51fa24,_0x5c106c),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x27f);[a54_0x54edc0(0x26a)]=a54_0x54edc0(0x1ba);async[a54_0x54edc0(0x256)](_0x469658){const _0x55860b=a54_0x54edc0,{options:_0x4928e6,args:_0x5a842d,tdx:_0x1b1a28}=_0x469658;let _0x131394,_0x24b7a0;if(_0x5a842d['length']>=0x1&&!_0x5a842d[0x0][_0x55860b(0x183)]('='))_0x131394=_0x5a842d[0x0],_0x24b7a0=_0x5a842d[_0x55860b(0x12d)](0x1);else{if(_0x5a842d['length']>=0x1&&_0x4928e6[_0x55860b(0x198)])_0x131394=_0x4928e6['workflowProject'],_0x24b7a0=_0x5a842d;else return _0x5a842d[_0x55860b(0x274)]>=0x1?(console[_0x55860b(0x279)](_0x55860b(0x175)),console[_0x55860b(0x279)](_0x55860b(0x1eb)),0x1):(console[_0x55860b(0x279)](_0x55860b(0x159)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x24b7a0[_0x55860b(0x274)]===0x0)return console[_0x55860b(0x279)](_0x55860b(0x159)),console['error'](_0x55860b(0x23c)),0x1;const _0x4e5307={};try{for(const _0x2a2c83 of _0x24b7a0){const {key:_0x43a718,value:_0x14be33}=parseKeyValue(_0x2a2c83);_0x4e5307[_0x43a718]=_0x14be33;}}catch(_0x58fee3){return _0x58fee3 instanceof Error&&console['error'](a54_0x26125e[_0x55860b(0x16f)](_0x55860b(0x14e)),_0x58fee3[_0x55860b(0x276)]),0x1;}const _0x2124c4=Object['keys'](_0x4e5307);_0x4928e6['verbose']&&(console[_0x55860b(0x279)](_0x55860b(0x1e6)+_0x131394),console[_0x55860b(0x279)](_0x55860b(0x204)+_0x2124c4[_0x55860b(0x2a6)](',\x20')));const _0x46cbcf=await withSpinner(_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x17b):_0x55860b(0x255)+_0x2124c4[_0x55860b(0x274)]+_0x55860b(0x28c),()=>_0x1b1a28[_0x55860b(0x169)][_0x55860b(0x172)](_0x131394,_0x4e5307),{'verbose':_0x4928e6[_0x55860b(0x1f9)]}),_0x34fd5a=_0x46cbcf[_0x55860b(0x199)];return console[_0x55860b(0x279)](_0x2124c4[_0x55860b(0x274)]===0x1?_0x55860b(0x22a)+_0x34fd5a['keys'][0x0]+_0x55860b(0x20e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27':'✔\x20'+_0x34fd5a[_0x55860b(0x257)][_0x55860b(0x274)]+_0x55860b(0x29e)+_0x34fd5a[_0x55860b(0x1d7)]+'\x27'),(_0x4928e6[_0x55860b(0x11d)]||_0x4928e6[_0x55860b(0x245)])&&await handleSingleObjectOutput(_0x34fd5a,_0x4928e6),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]=a54_0x54edc0(0x1db);['description']=a54_0x54edc0(0x20d);async[a54_0x54edc0(0x256)](_0x25a6fc){const _0x599d91=a54_0x54edc0,{options:_0x4a0646,args:_0x5dace2,tdx:_0x9903cd}=_0x25a6fc;let _0x26663c,_0x23eb8f;if(_0x5dace2[_0x599d91(0x274)]>=0x2)_0x26663c=_0x5dace2[0x0],_0x23eb8f=_0x5dace2[0x1];else{if(_0x5dace2[_0x599d91(0x274)]===0x1&&_0x4a0646['workflowProject'])_0x26663c=_0x4a0646[_0x599d91(0x198)],_0x23eb8f=_0x5dace2[0x0];else return _0x5dace2[_0x599d91(0x274)]===0x1?(console['error'](_0x599d91(0x175)),console[_0x599d91(0x279)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x599d91(0x279)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x599d91(0x279)](_0x599d91(0x233)),0x1);}_0x4a0646[_0x599d91(0x1f9)]&&(console[_0x599d91(0x279)](_0x599d91(0x1e6)+_0x26663c),console['error'](_0x599d91(0x157)+_0x23eb8f));if(!_0x4a0646[_0x599d91(0x13d)]){if(!isInteractive())return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x16f)](_0x599d91(0x186)),_0x599d91(0x269)),console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x13e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5070cb=await confirmKey(_0x599d91(0x14d)+_0x23eb8f+'\x27\x20from\x20project\x20\x27'+_0x26663c+'\x27?');if(!_0x5070cb)return console[_0x599d91(0x279)](a54_0x26125e[_0x599d91(0x21c)]('Cancelled')),0x1;}const _0x35498a=await withSpinner(_0x599d91(0x127),()=>_0x9903cd[_0x599d91(0x169)][_0x599d91(0x282)](_0x26663c,_0x23eb8f),{'verbose':_0x4a0646['verbose']}),_0x4aa4b2=_0x35498a[_0x599d91(0x199)];return console['error'](_0x599d91(0x22a)+_0x4aa4b2[_0x599d91(0x254)]+_0x599d91(0x24c)+_0x4aa4b2[_0x599d91(0x1d7)]+'\x27'),(_0x4a0646['json']||_0x4a0646[_0x599d91(0x245)])&&await handleSingleObjectOutput(_0x4aa4b2,_0x4a0646),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(_0xf1b246){const _0xa85092=a54_0x54edc0,_0x32571b=Math[_0xa85092(0x287)](_0xf1b246/0x3e8),_0x5eaa31=Math[_0xa85092(0x287)](_0x32571b/0x3c),_0x295777=Math['floor'](_0x5eaa31/0x3c),_0x1e37f9=Math[_0xa85092(0x287)](_0x295777/0x18);if(_0x1e37f9>0x0){const _0xda107e=_0x295777%0x18;return _0xda107e>0x0?_0x1e37f9+'d\x20'+_0xda107e+'h':_0x1e37f9+'d';}else{if(_0x295777>0x0){const _0x5e71f3=_0x5eaa31%0x3c;return _0x5e71f3>0x0?_0x295777+'h\x20'+_0x5e71f3+'m':_0x295777+'h';}else{if(_0x5eaa31>0x0){const _0x5dd69b=_0x32571b%0x3c;return _0x5dd69b>0x0?_0x5eaa31+'m\x20'+_0x5dd69b+'s':_0x5eaa31+'m';}else return _0x32571b+'s';}}}function formatTimestamp(_0x3a9fec,_0x14cb9d){const _0x17c3e1=a54_0x54edc0,_0x223656=new Date(_0x3a9fec),_0xa625c5=String(_0x223656['getHours']())[_0x17c3e1(0x1d9)](0x2,'0'),_0x3ba516=String(_0x223656[_0x17c3e1(0x148)]())[_0x17c3e1(0x1d9)](0x2,'0'),_0x5f36a5=_0xa625c5+':'+_0x3ba516,_0x59d45d=_0x223656[_0x17c3e1(0x1e9)]()===_0x14cb9d[_0x17c3e1(0x1e9)]()&&_0x223656[_0x17c3e1(0x2a5)]()===_0x14cb9d['getMonth']()&&_0x223656['getDate']()===_0x14cb9d['getDate']();if(_0x59d45d)return _0x5f36a5;else{const _0x1245db=String(_0x223656[_0x17c3e1(0x2a5)]()+0x1)[_0x17c3e1(0x1d9)](0x2,'0'),_0x9327b0=String(_0x223656[_0x17c3e1(0x2ac)]())[_0x17c3e1(0x1d9)](0x2,'0');return _0x1245db+'-'+_0x9327b0+'\x20'+_0x5f36a5;}}function formatDate(_0x4da9fb){const _0x5cf475=a54_0x54edc0,_0x4eeceb=_0x4da9fb['getFullYear'](),_0x4a33e7=String(_0x4da9fb[_0x5cf475(0x2a5)]()+0x1)['padStart'](0x2,'0'),_0x2197fd=String(_0x4da9fb[_0x5cf475(0x2ac)]())[_0x5cf475(0x1d9)](0x2,'0');return _0x4eeceb+'-'+_0x4a33e7+'-'+_0x2197fd;}function getTaskStateIcon(_0x155e63){const _0x3cb651={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3cb651[_0x155e63]||'⚪';}function getBarChar(_0x5295fa){const _0x291f48=a54_0x54edc0;return _0x5295fa===_0x291f48(0x279)||_0x5295fa===_0x291f48(0x1cc)?'×':'─';}function getBarColor(_0x3af35b){const _0xaa4b8=a54_0x54edc0,_0x262b93={'success':a54_0x26125e[_0xaa4b8(0x208)],'error':a54_0x26125e[_0xaa4b8(0x16f)],'group_error':a54_0x26125e[_0xaa4b8(0x16f)],'running':a54_0x26125e[_0xaa4b8(0x154)],'blocked':a54_0x26125e[_0xaa4b8(0x21c)],'planned':a54_0x26125e[_0xaa4b8(0x13e)],'canceling':a54_0x26125e[_0xaa4b8(0x21c)]};return _0x262b93[_0x3af35b]||a54_0x26125e['white'];}function parseTaskName(_0x3294db){const _0x1ecc7e=a54_0x54edc0;let _0x170d5e=_0x3294db[_0x1ecc7e(0x249)](/^\++/,'');const _0x49e5d6=_0x170d5e[_0x1ecc7e(0x210)]('+'),_0x3ad7aa=_0x49e5d6[_0x1ecc7e(0x274)]>0x1?_0x49e5d6[_0x1ecc7e(0x274)]-0x2:0x0,_0x1b99c9=_0x49e5d6[_0x49e5d6[_0x1ecc7e(0x274)]-0x1]||_0x170d5e;return{'level':_0x3ad7aa,'name':'+'+_0x1b99c9};}function truncateTaskName(_0x48014a,_0x31ba96){const _0x3ae546=a54_0x54edc0,_0x5867d5=stringWidth(_0x48014a);if(_0x5867d5<=_0x31ba96)return _0x48014a;let _0x25cf80=_0x48014a;while(stringWidth(_0x25cf80+'…')>_0x31ba96&&_0x25cf80['length']>0x0){_0x25cf80=_0x25cf80[_0x3ae546(0x12d)](0x0,-0x1);}return _0x25cf80+'…';}function a54_0x11ab(){const _0x4bc28d=['No\x20sessions\x20with\x20timing\x20information','pollTimeline','\x20project','MAX_TASKS_DISPLAY','jsonl','updatedAt','✔\x20Retry\x20started','fs/promises','replace','workflow:retry','\x20(use\x20--limit\x20to\x20show\x20more)','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x0aDry\x20run\x20-\x20no\x20project\x20created','Retry\x20a\x20session\x20or\x20attempt','isNewProject','autocomplete','Including\x20subtasks:\x20yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','prepareCloneProject','key','Setting\x20','execute','keys','repeat','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','reason','fromTask','log','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','List\x20all\x20workflow\x20projects','Resume\x20from:\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','projects','\x20logs','Auto-selected\x20latest\x20session:\x20','workflow:attempt','type','localeCompare','Downloading\x20logs...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','Revision:\x20','MIN_LABEL_COUNT','parse','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','param','✔\x20Found\x20','No\x20projects\x20match\x20pattern:\x20','length','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','message','deleted','duration','error','Project\x20name:\x20','Select\x20a\x20task\x20to\x20view\x20logs:','Warning:','session','3382008dDMdcx','workflow:secrets:set','120AgmVZC','Invalid\x20format:\x20','deleteSecret','attempts','getTime','Key\x20cannot\x20be\x20empty','toLowerCase','floor','📋\x20','basename','Failed\x20to\x20fetch\x20attempt\x20data','fill','\x20secrets...','fileSize','attemptId','Show\x20specific\x20attempt\x20details','\x20is\x20not\x20a\x20directory','\x20new','MAX_LABEL_COUNT','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflows\x20found\x20in\x20project:\x20','Listing\x20workflows...','Force:\x20yes','Starting\x20workflow\x20run...','get','6211542goQydR','params','\x20\x20Project:\x20','Total:\x20','\x20\x20New\x20attempt\x20ID:\x20','\x20secrets\x20set\x20for\x20project\x20\x27','Pull\x20workflow\x20project\x20to\x20local\x20folder','Listing\x20workflow\x20sessions...','msPerChar','cwd','\x0aDry\x20run\x20-\x20nothing\x20pushed','TASK_NAME_WIDTH','getMonth','join','Filter:\x20','\x20\x20Changes:\x20','Retrying\x20session...','has','listSecrets','getDate','Show\x20tasks\x20for\x20an\x20attempt','27420VJsTkm','existingProjectId','startsWith','📁\x20','260694maaxJv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Files\x20to\x20upload:\x20','indexOf','7qHdGgQ','lastAttempt','\x20\x20Project\x20ID:\x20','sessionTime','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','success','window','resolveProject','now','40WyvFSI','Project\x20name\x20is\x20required','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20-\x20','columns','Project\x20directory:\x20','output','changes','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Usage:\x20tdx\x20wf\x20use\x20<project>','context','No\x20sessions\x20found','✔\x20Clone\x20complete','json','set','\x20from\x20session\x20','targetDir','min','renderSingleTimeline','Attempt\x20ID:\x20','parseProjectWorkflowPattern','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','No\x20attempts\x20found\x20in\x20project:\x20','Deleting\x20secret...','buildTimelineData','skipValidation','Workflow:\x20','\x20\x20Source:\x20','Error:\x20','slice','Tip:\x20cd\x20to\x20workflows/','renderTimeline','No\x20matching\x20sessions\x20found','No\x20log\x20content\x20found','workflow:pull','MIN_TIMELINE_WIDTH','108272UmcDlN','resumeFrom','map','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Listing\x20workflow\x20projects...','toISOString','No\x20sessions\x20found\x20for:\x20','-\x20nothing\x20pushed','Session\x20time:\x20','yes','dim','13OEJKyF','showWorkflowConsoleUrl','includeSubtasks','modified','\x20\x20Revision:\x20','Target:\x20','createdAt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Analyzing\x20changes...','getMinutes','731296xwfCGG','taskName','\x20\x20Workflow:\x20','task','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Error:','trimEnd','Loading\x20session...','readFile','projectId','match','blue','Params:\x20','status','Key:\x20','Include\x20retried:\x20yes','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20of\x20','List\x20workflow\x20execution\x20sessions','write','\x20tasks','\x20\x20Console:\x20','Dry\x20run:\x20yes','\x20deleted','planned','ICON_WIDTH','summary','attempt','Fetching\x20log\x20files...','✔\x20Pushed\x20','push','all','workflow','fullName','follow','isArray','state','finishedAt','red','isTTY','Show\x20logs\x20for\x20a\x20workflow\x20attempt','setSecrets','sessions','Validation:\x20skipped','Error:\x20Project\x20name\x20is\x20required','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','targetExists','session:','/attempt/','No\x20workflow\x20sessions\x20found','Setting\x20secret...','filesExtracted','canceling','Select\x20a\x20workflow\x20to\x20run','Source\x20directory:\x20','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','List\x20workflows','workflow:push','includes','relative','format','\x0aError:','running','done','workflows','💡\x20Tip:\x20Use\x20','executePushProject','newProjectId','MAX_POLL_ITERATIONS','30576096WHWMqy','kill','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Project\x20updated','resolveProjectId','\x0a✔\x20No\x20changes\x20to\x20push','/sessions/','generateSessionTimelineRows','Using\x20attempt\x20','6083lreGkV','workflowProject','data','2uieVZP','Status:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20Target:\x20','end','.\x20Expected\x20format:\x20KEY=VALUE','\x20to\x20see\x20detailed\x20logs','resolveProjectDir','workflow:tasks','tasks','substring','Target\x20directory:\x20','pending','stat','\x20unchanged','\x0aFailed\x20to\x20fetch\x20attempt\x20data','...','\x20session','Pattern:\x20','requireProject','startedAt','Source:\x20','find','ICON_SPACING','newProjectName','select','Getting\x20attempt\x20details...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','icon','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Parameters:\x20','\x22\x20already\x20exists\x20(ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x20task','✔\x20Push\x20complete','Error:\x20Attempt\x20ID\x20is\x20required','workflowName','logFiles','Updating\x20','delete','table','force','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','→\x20New\x20project:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','---\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Kill\x20a\x20running\x20attempt','cyan','Select\x20a\x20session\x20to\x20view\x20timeline:','group_error','session_id','stdout','Cancelled','Downloading\x20project\x20','Deleting\x20project\x20','\x1b[1A\x1b[2K','displayLine','includeRetried','navigateSessionsInteractive','renderSessionsTimeline','projectName','\x20modified','padStart','size','workflow:secrets:delete','✔\x20Downloaded\x20','\x0aPush\x20these\x20changes?','✔\x20Deleted\x20project\x20','No\x20attempts\x20found','/app/workflows/','applyPullProject','Cloning\x20to\x20','Getting\x20attempt\x20tasks...','Loading\x20workflows...','index','Project:\x20','text','diff','getFullYear','Retrying\x20attempt...','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','unchanged','Listing\x20secrets...','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','download','cancelRequested','Error:\x20Invalid\x20parameter\x20format:\x20','Source\x20directory\x20is\x20required','\x20secret','\x20\x20Session\x20context\x20set\x20to:\x20','sort','verbose','startTime','pullProject','Usage:\x20workflow:delete\x20<project-name-or-id>','Resolving\x20project\x20\x27','sessionId','New\x20project\x20name:\x20','dryRun','(use\x20--limit\x20to\x20see\x20more)','hasChanges','\x0aPolling...\x20(','Secrets\x20to\x20set:\x20','revision:\x20','sourceDir','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','green','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','✔\x20Workflow\x20run\x20started','rows','\x20\x20tdx\x20wf\x20use\x20<project>','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','MAX_TIMELINE_WIDTH','split','values','\x22\x20to\x20new\x20project\x20\x22','from','unknown','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','\x27...','filter','start','Output\x20directory:\x20','No\x20sessions\x20found\x20in\x20project:\x20','workflow:download','yellow','project','limit','utf-8','Task\x20name:\x20','\x20attempt','list','\x20\x20Location:\x20','max','durationMs','Latest\x20session\x20has\x20no\x20attempt','every','title','logs','✔\x20Secret\x20\x27','Listing\x20workflow\x20attempts...','workflow:upload','workflow:clone','Filter:\x20project=','workflow:run','\x20(system)','name','site','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','trim','revision','resolve','new','\x20workflow','splice','isDirectory','\x0a✔\x20Attempt\x20complete','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','clear','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','sys','⚠\x20Showing\x20first\x20'];a54_0x11ab=function(){return _0x4bc28d;};return a54_0x11ab();}function calculateTimeScale(_0x2cd2b4,_0x2baed1){const _0x427eb4=a54_0x54edc0;return{'startTime':_0x2cd2b4['start'],'endTime':_0x2cd2b4['end'],'durationMs':_0x2cd2b4['duration'],'msPerChar':_0x2cd2b4[_0x427eb4(0x278)]/_0x2baed1};}function timeToPosition(_0x5e73bb,_0x50e390,_0x24362e){const _0x46cb67=a54_0x54edc0,_0x49ad19=_0x5e73bb-_0x50e390['startTime'],_0x3e63ca=Math[_0x46cb67(0x287)](_0x49ad19/_0x50e390[_0x46cb67(0x2a1)]);return Math[_0x46cb67(0x224)](0x0,Math['min'](_0x3e63ca,_0x24362e));}function renderTimeAxis(_0x537da9,_0x307343){const _0x5c49cd=a54_0x54edc0,_0x53b249=Math[_0x5c49cd(0x121)](TIMELINE_CONFIG[_0x5c49cd(0x292)],Math[_0x5c49cd(0x224)](TIMELINE_CONFIG[_0x5c49cd(0x26c)],Math[_0x5c49cd(0x287)](_0x307343/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x42ca88=_0x537da9[_0x5c49cd(0x225)]/(_0x53b249-0x1),_0x175462=new Date(_0x537da9[_0x5c49cd(0x1fa)]),_0x569ea4=[];for(let _0x10caf4=0x0;_0x10caf4<_0x53b249;_0x10caf4++){const _0x1a8f29=_0x537da9['startTime']+_0x10caf4*_0x42ca88,_0x298204=timeToPosition(_0x1a8f29,_0x537da9,_0x307343),_0x31b4b5=formatTimestamp(_0x1a8f29,_0x175462);_0x569ea4[_0x5c49cd(0x167)]({'pos':_0x298204,'text':_0x31b4b5});}const _0x5b38f9=new Array(_0x307343)[_0x5c49cd(0x28b)]('\x20');let _0x314bdc=-0x1;for(const {pos:_0xbec1e4,text:_0x33b354}of _0x569ea4){let _0x186ae4=Math['max'](0x0,_0xbec1e4-Math[_0x5c49cd(0x287)](_0x33b354[_0x5c49cd(0x274)]/0x2));_0x186ae4<=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x186ae4=_0x314bdc+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x186ae4+_0x33b354['length']>_0x307343&&(_0x186ae4=_0x307343-_0x33b354['length']);if(_0x186ae4>=0x0&&_0x186ae4+_0x33b354[_0x5c49cd(0x274)]<=_0x307343&&_0x186ae4>_0x314bdc){for(let _0x421de3=0x0;_0x421de3<_0x33b354[_0x5c49cd(0x274)];_0x421de3++){_0x5b38f9[_0x186ae4+_0x421de3]=_0x33b354[_0x421de3];}_0x314bdc=_0x186ae4+_0x33b354[_0x5c49cd(0x274)]-0x1;}}return _0x5b38f9[_0x5c49cd(0x2a6)]('');}function renderTaskRow(_0x9c78fd,_0x363876,_0x3a7aa9,_0x547e8f){const _0x2bf97f=a54_0x54edc0,{level:_0x7fb029,name:_0x54ced3}=parseTaskName(_0x9c78fd[_0x2bf97f(0x231)]),_0xa4a1a5='\x20'[_0x2bf97f(0x258)](_0x7fb029),_0x5e6f5e=_0x9c78fd[_0x2bf97f(0x2bc)]?'('+formatElapsed(_0x9c78fd[_0x2bf97f(0x2bc)][_0x2bf97f(0x278)])+')':'',_0x310eac=stringWidth(_0x5e6f5e),_0x33886b=_0x7fb029*0x1,_0x21db54=_0x547e8f-_0x33886b-_0x310eac-0x1,_0x13b399=truncateTaskName(_0x54ced3,_0x21db54),_0x7fcf2a=_0xa4a1a5+_0x13b399,_0xd07a2a=stringWidth(_0x7fcf2a),_0x39ded4=_0x547e8f-_0xd07a2a-_0x310eac,_0x54a427=_0x7fcf2a+'\x20'[_0x2bf97f(0x258)](Math['max'](0x1,_0x39ded4))+a54_0x26125e['dim'](_0x5e6f5e),_0x1f74af=getTaskStateIcon(_0x9c78fd[_0x2bf97f(0x16d)]),_0x21e461=new Array(_0x3a7aa9)[_0x2bf97f(0x28b)]('\x20');if(_0x9c78fd['window']){const _0xb5cfb0=timeToPosition(_0x9c78fd[_0x2bf97f(0x2bc)]['start'],_0x363876,_0x3a7aa9),_0x5cc4e4=timeToPosition(_0x9c78fd['window'][_0x2bf97f(0x19e)],_0x363876,_0x3a7aa9),_0x439a40=getBarChar(_0x9c78fd['state']),_0xcf5dbd=Math[_0x2bf97f(0x224)](_0xb5cfb0+0x1,_0x5cc4e4);for(let _0x3bb19e=_0xb5cfb0;_0x3bb19e<Math[_0x2bf97f(0x121)](_0xcf5dbd,_0x3a7aa9);_0x3bb19e++){_0x21e461[_0x3bb19e]=_0x439a40;}}const _0x17cc1b=getBarColor(_0x9c78fd[_0x2bf97f(0x16d)]),_0x30a268=_0x21e461[_0x2bf97f(0x136)](_0x59b302=>_0x59b302==='\x20'?'\x20':_0x17cc1b(_0x59b302))['join']('');return _0x1f74af+'\x20'+_0x54a427+'│'+_0x30a268+'│';}function calculateStats(_0x58f735){const _0x1e565d=a54_0x54edc0,_0x8eb6ca={'total':_0x58f735[_0x1e565d(0x274)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2bfc67 of _0x58f735){if(_0x2bfc67['state']===_0x1e565d(0x2bb))_0x8eb6ca['success']++;else{if(_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x279)||_0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x1cc))_0x8eb6ca[_0x1e565d(0x279)]++;else _0x2bfc67[_0x1e565d(0x16d)]===_0x1e565d(0x187)?_0x8eb6ca[_0x1e565d(0x187)]++:_0x8eb6ca[_0x1e565d(0x1a6)]++;}}return _0x8eb6ca;}function formatStats(_0x580882){const _0x3b3773=a54_0x54edc0;return[_0x3b3773(0x29c)+_0x580882['total'],'✅\x20'+_0x580882[_0x3b3773(0x2bb)],'❌\x20'+_0x580882[_0x3b3773(0x279)],'🔄\x20'+_0x580882[_0x3b3773(0x187)],'⏳\x20'+_0x580882[_0x3b3773(0x1a6)]][_0x3b3773(0x2a6)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x54edc0(0x231)]='workflow:timeline';['description']=a54_0x54edc0(0x293);async['execute'](_0x20f606){const _0x150fc0=a54_0x54edc0,{options:_0x428b3e,args:_0x266855,tdx:_0x34fc41}=_0x20f606;let _0xd49f4d,_0x1db12,_0x506bc2=![];if(_0x266855[0x0]){if(_0x266855[0x0][_0x150fc0(0x183)]('.')){const _0x3bf6d7=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x3bf6d7)return 0x1;_0xd49f4d=_0x3bf6d7[_0x150fc0(0x1d7)],_0x1db12=_0x3bf6d7[_0x150fc0(0x1be)];}else{_0x1db12=_0x266855[0x0],_0xd49f4d=_0x428b3e[_0x150fc0(0x198)];if(!_0xd49f4d)return console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x16f)]('Error:'),_0x150fc0(0x180)),0x1;_0x506bc2=!![];}}else{const _0x135ece=this[_0x150fc0(0x124)](_0x266855,_0x428b3e);if(!_0x135ece)return 0x1;_0xd49f4d=_0x135ece['projectName'],_0x1db12=_0x135ece['workflowName'];}if(_0x428b3e['verbose']){if(_0xd49f4d&&_0x1db12)console['error']('Filter:\x20'+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d&&console[_0x150fc0(0x279)](_0x150fc0(0x22e)+_0xd49f4d);}const _0x162520=_0x428b3e[_0x150fc0(0x28e)],_0x25cc4d=_0x428b3e[_0x150fc0(0x1fe)];if(_0x162520){_0x25cc4d&&console[_0x150fc0(0x279)](a54_0x26125e[_0x150fc0(0x21c)](_0x150fc0(0x27c)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x5435fa=_0x428b3e[_0x150fc0(0x16b)];return _0x5435fa?await this[_0x150fc0(0x242)](_0x20f606,_0x162520):await this[_0x150fc0(0x122)](_0x20f606,_0x162520,_0x428b3e),0x0;}if(_0x25cc4d){const _0x187707=await withSpinner(_0x150fc0(0x150),()=>_0x34fc41['workflow'][_0x150fc0(0x173)]({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':0x64}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x5b5074=_0x187707[_0x150fc0(0x199)][_0x150fc0(0x1b0)](_0x2082f2=>_0x2082f2['id']===_0x25cc4d);if(!_0x5b5074)return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20not\x20found:\x20'+_0x25cc4d),0x1;if(!_0x5b5074[_0x150fc0(0x2b7)]?.['id'])return console['error'](a54_0x26125e['red'](_0x150fc0(0x14e)),'Session\x20'+_0x25cc4d+'\x20has\x20no\x20attempts'),0x1;const _0x54fc18=_0x5b5074[_0x150fc0(0x2b7)]['id'];_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x196)+_0x54fc18+_0x150fc0(0x11f)+_0x25cc4d);const _0x2b2bd1=_0x428b3e[_0x150fc0(0x16b)];return _0x2b2bd1?await this[_0x150fc0(0x242)](_0x20f606,_0x54fc18):await this['renderSingleTimeline'](_0x20f606,_0x54fc18,_0x428b3e),0x0;}const _0x42ebdc=await withSpinner('Loading\x20sessions...',()=>_0x34fc41['workflow']['sessions']({'projectName':_0xd49f4d,'workflowName':_0x1db12,'limit':_0x428b3e[_0x150fc0(0x21e)]||0x32}),{'verbose':_0x428b3e[_0x150fc0(0x1f9)]}),_0x3885a6=_0x42ebdc[_0x150fc0(0x199)];if(_0x3885a6[_0x150fc0(0x274)]===0x0){if(_0xd49f4d&&_0x1db12)console[_0x150fc0(0x279)](_0x150fc0(0x13a)+_0xd49f4d+'.'+_0x1db12);else _0xd49f4d?console[_0x150fc0(0x279)](_0x150fc0(0x21a)+_0xd49f4d):(console[_0x150fc0(0x279)](_0x150fc0(0x17a)),console[_0x150fc0(0x279)](a54_0x26125e['dim'](_0x150fc0(0x26e))));return 0x0;}_0x3885a6[_0x150fc0(0x1f8)]((_0x3c6153,_0x11f9f2)=>{const _0x1997c0=_0x150fc0,_0x1e8cc3=_0x3c6153[_0x1997c0(0x2b9)]||'',_0x26b20f=_0x11f9f2['sessionTime']||'';return _0x26b20f[_0x1997c0(0x267)](_0x1e8cc3);});if(_0x428b3e[_0x150fc0(0x11d)]||_0x428b3e[_0x150fc0(0x245)])return await handleSDKOutput(_0x3885a6,_0x428b3e),0x0;let _0x85c937;if(_0x506bc2){const _0x31fadb=_0x3885a6[0x0];if(!_0x31fadb[_0x150fc0(0x2b7)]?.['id'])return console[_0x150fc0(0x279)](_0x150fc0(0x226)),0x0;_0x85c937=_0x31fadb['lastAttempt']['id'],_0x428b3e[_0x150fc0(0x1f9)]&&console[_0x150fc0(0x279)](_0x150fc0(0x264)+_0x31fadb[_0x150fc0(0x2b9)]);}else{const _0x123a5b=_0x3885a6[_0x150fc0(0x136)](_0x3ab303=>{const _0x3f30b0=_0x150fc0,_0x2d6049=getAttemptStatusDisplay(_0x3ab303[_0x3f30b0(0x2b7)]);return{'title':_0x3ab303[_0x3f30b0(0x21d)]?.[_0x3f30b0(0x231)]+'.'+_0x3ab303['workflow']?.[_0x3f30b0(0x231)]+_0x3f30b0(0x2c2)+_0x3ab303[_0x3f30b0(0x2b9)]+'\x20'+_0x2d6049[_0x3f30b0(0x1b6)],'value':_0x3ab303[_0x3f30b0(0x2b7)]?.['id']||'','description':_0x2d6049[_0x3f30b0(0x1e7)]};}),_0x3d79d5=await a54_0x1aee3d({'type':_0x150fc0(0x1b3),'name':_0x150fc0(0x28e),'message':_0x150fc0(0x1cb),'choices':_0x123a5b[_0x150fc0(0x217)](_0x493c47=>_0x493c47['value']!=='')});if(!_0x3d79d5[_0x150fc0(0x28e)])return 0x0;_0x85c937=_0x3d79d5['attemptId'];}const _0x376301=_0x428b3e['follow'];return _0x376301?await this[_0x150fc0(0x242)](_0x20f606,_0x85c937):await this[_0x150fc0(0x122)](_0x20f606,_0x85c937,_0x428b3e),0x0;}async[a54_0x54edc0(0x122)](_0x282666,_0x40e88b,_0xdf6253){const _0x44617d=a54_0x54edc0,{tdx:_0x1559ff}=_0x282666;let _0x3cf730,_0xf523c4;try{[_0x3cf730,_0xf523c4]=await Promise[_0x44617d(0x168)]([_0x1559ff['workflow']['attempt'](_0x40e88b),_0x1559ff[_0x44617d(0x169)][_0x44617d(0x1a3)](_0x40e88b,![])]);}catch(_0x11af50){console[_0x44617d(0x279)](a54_0x26125e[_0x44617d(0x16f)](_0x44617d(0x28a)));_0xdf6253[_0x44617d(0x1f9)]&&console[_0x44617d(0x279)](_0x11af50);throw _0x11af50;}if(_0xdf6253[_0x44617d(0x11d)]||_0xdf6253[_0x44617d(0x245)]){const _0x32e177=this[_0x44617d(0x128)](_0x3cf730,_0xf523c4);await handleSDKOutput([_0x32e177],_0xdf6253);return;}const _0x470d91=_0x1559ff[_0x44617d(0x2c9)]['site'],_0x4f62c8=this[_0x44617d(0x12f)](_0x3cf730,_0xf523c4,_0x470d91);console['log'](_0x4f62c8);}async[a54_0x54edc0(0x242)](_0xb08079,_0x190dfc){const _0x1ef838=a54_0x54edc0,{tdx:_0x3f17a1}=_0xb08079,_0x2ee38f=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x1f07ac=TIMELINE_CONFIG[_0x1ef838(0x18d)];let _0x576d5f=0x0;while(_0x576d5f<_0x1f07ac){process[_0x1ef838(0x1ce)]['isTTY']&&process[_0x1ef838(0x1ce)][_0x1ef838(0x15c)]('\x1bc');let _0x4a15f2,_0xf689b4;try{[_0x4a15f2,_0xf689b4]=await Promise[_0x1ef838(0x168)]([_0x3f17a1[_0x1ef838(0x169)][_0x1ef838(0x164)](_0x190dfc),_0x3f17a1['workflow'][_0x1ef838(0x1a3)](_0x190dfc,![])]);}catch(_0x65ef01){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x16f)](_0x1ef838(0x1a9)));_0x576d5f>0x0&&console[_0x1ef838(0x279)](a54_0x26125e['dim'](_0x1ef838(0x190)+_0x576d5f));throw _0x65ef01;}const _0x189557=_0x3f17a1[_0x1ef838(0x2c9)][_0x1ef838(0x232)],_0x5e3621=this[_0x1ef838(0x12f)](_0x4a15f2,_0xf689b4,_0x189557);console[_0x1ef838(0x25d)](_0x5e3621);const _0xd94f6f=_0x4a15f2[_0x1ef838(0x188)]&&_0xf689b4[_0x1ef838(0x227)](_0x167c4f=>_0x167c4f[_0x1ef838(0x16d)]!==_0x1ef838(0x187)&&_0x167c4f[_0x1ef838(0x16d)]!=='planned');if(_0xd94f6f){console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x208)](_0x1ef838(0x23b)));break;}console['error'](a54_0x26125e[_0x1ef838(0x13e)](_0x1ef838(0x203)+_0x576d5f*0x2+_0x1ef838(0x215))),await new Promise(_0x567d6c=>setTimeout(_0x567d6c,_0x2ee38f)),_0x576d5f++;}_0x576d5f>=_0x1f07ac&&console[_0x1ef838(0x279)](a54_0x26125e[_0x1ef838(0x21c)](_0x1ef838(0x209)));}[a54_0x54edc0(0x12f)](_0x1ba4a1,_0x12874f,_0x5655f2){const _0xadec5=a54_0x54edc0,_0x5c7da7=[],_0x4c9f62=TIMELINE_CONFIG[_0xadec5(0x2a4)],_0x2be1d3=0x5,_0x2dff32=process[_0xadec5(0x1ce)][_0xadec5(0x2c3)]||0x78,_0x447349=_0x2dff32-_0x4c9f62-_0x2be1d3,_0x36633e=Math[_0xadec5(0x224)](TIMELINE_CONFIG[_0xadec5(0x133)],Math[_0xadec5(0x121)](_0x447349,TIMELINE_CONFIG[_0xadec5(0x20f)])),_0x444847=new Date(_0x1ba4a1[_0xadec5(0x145)])[_0xadec5(0x284)](),_0x4da4e5=_0x1ba4a1['finishedAt']?new Date(_0x1ba4a1[_0xadec5(0x16e)])[_0xadec5(0x284)]():Date['now'](),_0x57a84f={'start':_0x444847,'end':_0x4da4e5,'duration':_0x4da4e5-_0x444847},_0x5a7f44=new Map(),_0x34bc42=[];for(const _0x4b2eb0 of _0x12874f){if(_0x4b2eb0[_0xadec5(0x1ae)]){const _0x3e83ad=new Date(_0x4b2eb0[_0xadec5(0x1ae)])[_0xadec5(0x284)](),_0x2de10b=_0x4b2eb0['updatedAt']?new Date(_0x4b2eb0[_0xadec5(0x246)])[_0xadec5(0x284)]():Date['now'](),_0x542989={'start':_0x3e83ad,'end':_0x2de10b,'duration':_0x2de10b-_0x3e83ad};_0x5a7f44[_0xadec5(0x11e)](_0x4b2eb0['id'],_0x542989),_0x34bc42[_0xadec5(0x167)]({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x214),'window':_0x542989});}else _0x34bc42['push']({'name':_0x4b2eb0[_0xadec5(0x16a)],'state':_0x4b2eb0['state']||_0xadec5(0x161),'window':undefined});}_0x34bc42['sort']((_0x56e277,_0x183d7e)=>{const _0xa8d7af=_0xadec5;if(!_0x56e277[_0xa8d7af(0x2bc)])return 0x1;if(!_0x183d7e[_0xa8d7af(0x2bc)])return-0x1;return _0x56e277[_0xa8d7af(0x2bc)]['start']-_0x183d7e[_0xa8d7af(0x2bc)][_0xa8d7af(0x218)];});const _0x5cddeb=_0x34bc42[_0xadec5(0x274)],_0x57fe38=_0x5cddeb>TIMELINE_CONFIG[_0xadec5(0x244)];_0x57fe38&&_0x34bc42[_0xadec5(0x239)](TIMELINE_CONFIG[_0xadec5(0x244)]);const _0x13460d=calculateTimeScale(_0x57a84f,_0x36633e),_0x5d3954=_0x1ba4a1[_0xadec5(0x188)]?_0x1ba4a1[_0xadec5(0x2bb)]?a54_0x26125e[_0xadec5(0x208)](_0xadec5(0x2bb)):a54_0x26125e[_0xadec5(0x16f)](_0xadec5(0x279)):a54_0x26125e[_0xadec5(0x154)]('running'),_0x3eaaa1=_0x1ba4a1['project']?.['id'],_0x4236e4=_0x1ba4a1['sessionId'];let _0x5c5eb0;if(_0x3eaaa1&&_0x4236e4){const _0x20fab7=getWorkflowAttemptUrl(_0x5655f2,_0x3eaaa1,_0x4236e4,_0x1ba4a1['id']);_0x5c5eb0=hyperlink(a54_0x26125e['dim'](_0x1ba4a1['id']),_0x20fab7);}else _0x5c5eb0=a54_0x26125e[_0xadec5(0x13e)](_0x1ba4a1['id']);_0x5c7da7[_0xadec5(0x167)]('Attempt:\x20'+_0x5c5eb0+_0xadec5(0x2c2)+_0x5d3954+_0xadec5(0x2c2)+formatElapsed(_0x57a84f['duration']));if(_0x34bc42['length']>0x0){const _0x29bdd4=renderTimeAxis(_0x13460d,_0x36633e),_0xa7a550=new Date(_0x57a84f['start']),_0x3cc83f=formatDate(_0xa7a550),_0x2113ac=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x4c9f62,_0x482c2c=_0x3cc83f[_0xadec5(0x1d9)](_0x2113ac),_0x2e5d22=a54_0x26125e[_0xadec5(0x13e)](_0x482c2c);_0x5c7da7[_0xadec5(0x167)](_0x2e5d22+'\x20'+_0x29bdd4);for(const _0x4739a5 of _0x34bc42){_0x5c7da7['push'](renderTaskRow(_0x4739a5,_0x13460d,_0x36633e,_0x4c9f62));}const _0x18c420=calculateStats(_0x34bc42);_0x5c7da7['push'](formatStats(_0x18c420)),_0x57fe38&&_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['yellow'](_0xadec5(0x240)+TIMELINE_CONFIG[_0xadec5(0x244)]+_0xadec5(0x15a)+_0x5cddeb+_0xadec5(0x15d))),_0x5c7da7[_0xadec5(0x167)](''),_0x5c7da7[_0xadec5(0x167)](a54_0x26125e['dim'](_0xadec5(0x18a))+('tdx\x20wf\x20attempt\x20'+_0x1ba4a1['id']+_0xadec5(0x263))+a54_0x26125e[_0xadec5(0x13e)](_0xadec5(0x1a0)));}else _0x5c7da7['push'](_0xadec5(0x25e));return _0x5c7da7[_0xadec5(0x2a6)]('\x0a');}[a54_0x54edc0(0x128)](_0x3a7a12,_0x3c7ec1){const _0x52f8c0=a54_0x54edc0,_0x5b2ee2=new Date(_0x3a7a12[_0x52f8c0(0x145)])[_0x52f8c0(0x284)](),_0x20e7df=_0x3a7a12[_0x52f8c0(0x16e)]?new Date(_0x3a7a12[_0x52f8c0(0x16e)])['getTime']():Date[_0x52f8c0(0x2be)](),_0xf51666=_0x20e7df-_0x5b2ee2,_0x462639=[];for(const _0x3acb20 of _0x3c7ec1){if(_0x3acb20[_0x52f8c0(0x1ae)]){const _0x645683=new Date(_0x3acb20[_0x52f8c0(0x1ae)])[_0x52f8c0(0x284)](),_0x29e97c=_0x3acb20[_0x52f8c0(0x246)]?new Date(_0x3acb20[_0x52f8c0(0x246)])[_0x52f8c0(0x284)]():Date[_0x52f8c0(0x2be)]();_0x462639['push']({'name':_0x3acb20[_0x52f8c0(0x16a)],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x214),'window':{'start':_0x645683,'end':_0x29e97c,'duration':_0x29e97c-_0x645683}});}else _0x462639[_0x52f8c0(0x167)]({'name':_0x3acb20['fullName'],'state':_0x3acb20[_0x52f8c0(0x16d)]||_0x52f8c0(0x161),'window':undefined});}const _0x20110c=calculateStats(_0x462639);return{'attempt':{'id':_0x3a7a12['id'],'status':_0x3a7a12[_0x52f8c0(0x188)]?_0x3a7a12['success']?'success':_0x52f8c0(0x279):_0x52f8c0(0x187),'createdAt':_0x3a7a12[_0x52f8c0(0x145)],'finishedAt':_0x3a7a12['finishedAt'],'duration_ms':_0xf51666},'tasks':_0x462639[_0x52f8c0(0x136)](_0x12bca8=>({'name':_0x12bca8['name'],'state':_0x12bca8['state'],'startedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)][_0x52f8c0(0x218)])['toISOString']():null,'updatedAt':_0x12bca8[_0x52f8c0(0x2bc)]?new Date(_0x12bca8[_0x52f8c0(0x2bc)]['end'])[_0x52f8c0(0x139)]():null,'duration_ms':_0x12bca8[_0x52f8c0(0x2bc)]?.[_0x52f8c0(0x278)]||null})),'stats':_0x20110c};}}
1
+ const a54_0x130479=a54_0x5811;(function(_0x50f2f1,_0x2f5f55){const _0x39b3c9=a54_0x5811,_0x116800=_0x50f2f1();while(!![]){try{const _0x3ff156=-parseInt(_0x39b3c9(0x342))/0x1*(parseInt(_0x39b3c9(0x1f1))/0x2)+parseInt(_0x39b3c9(0x383))/0x3*(parseInt(_0x39b3c9(0x1f6))/0x4)+-parseInt(_0x39b3c9(0x390))/0x5+-parseInt(_0x39b3c9(0x28e))/0x6+parseInt(_0x39b3c9(0x304))/0x7*(-parseInt(_0x39b3c9(0x265))/0x8)+-parseInt(_0x39b3c9(0x322))/0x9*(-parseInt(_0x39b3c9(0x323))/0xa)+parseInt(_0x39b3c9(0x382))/0xb;if(_0x3ff156===_0x2f5f55)break;else _0x116800['push'](_0x116800['shift']());}catch(_0x556887){_0x116800['push'](_0x116800['shift']());}}}(a54_0x2dfb,0xd5a15));import a54_0x47fe92 from'chalk';import{existsSync}from'fs';import a54_0x5d886b from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';function a54_0x2dfb(){const _0x4cd072=['site','Error:','targetDir','MIN_TIMELINE_WIDTH','state','includeSubtasks','Reason:\x20','map','Downloading\x20project\x20','150088BKhtTg','Deleting\x20project\x20','Revision:\x20','Getting\x20attempt\x20details...','hasChanges','Resume\x20from:\x20','Secrets\x20to\x20set:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Workflow:\x20','Filter:\x20','skipValidation','Filter:\x20project=','from','force','length','No\x20workflows\x20found\x20in\x20project:\x20',',\x20Workflow:\x20','Include\x20retried:\x20yes','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','generateSessionTimelineRows','toLowerCase','name','summary','ICON_SPACING','prepareCloneProject','MIN_LABEL_COUNT','LABEL_WIDTH_DIVISOR','\x20modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x0aClone\x20\x22','pullProject','isDirectory','workflow:retry','workflow:run','Latest\x20session\x20has\x20no\x20attempt','Retrying\x20session...','\x1b[1A\x1b[2K','Project:\x20','filesExtracted','yellow','9487128VtiiRG','getTime','✔\x20Project\x20updated','Workflow:\x20','applyPullProject','No\x20attempts\x20found\x20for:\x20','all','\x20secrets...','fs/promises','No\x20workflow\x20tdx.json\x20found','project','-\x20no\x20files\x20written','isNewProject','\x20workflow','✔\x20Retry\x20started','revision:\x20','some','workflow:pull','\x20(disabled)','Select\x20a\x20session\x20to\x20view\x20timeline:','Using\x20attempt\x20','✔\x20Secret\x20\x27','\x20\x20Next\x20run:\x20','attemptId','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','listSecrets','\x20\x20Session\x20ID:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','start','workflow','\x22\x20already\x20exists\x20(ID:\x20','duration','\x20\x20Source:\x20','.\x20Expected\x20format:\x20KEY=VALUE','List\x20all\x20workflow\x20projects','delete','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','max','durationMs','green','rows','\x0a⚠\x20Project\x20\x22','Error:\x20Secret\x20key\x20is\x20required','No\x20workflows\x20found','\x20(system)','startsWith','getDate','reason','\x22\x20to\x20new\x20project\x20\x22','No\x20workflow\x20projects\x20found','logFiles','renderTimeline','targetExists','type','cyan','sourceDir','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Loading\x20workflows...','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','buildTimelineData','resolveProject','jsonl','\x20\x20Location:\x20','Parameters:\x20','Project\x20directory:\x20','dryRun','\x20session','projectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Auto-selected\x20latest\x20session:\x20','Files\x20to\x20upload:\x20','resolveProjectDir','...','pending','parse','modified','Source\x20directory:\x20','renderSessionsTimeline','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','utf-8','group_error','workflow:push','startedAt','\x0aDry\x20run\x20-\x20no\x20files\x20written','getFullYear','newProjectName','showWorkflowConsoleUrl','Pushing\x20workflow\x20project...','(unknown)','disabledAt','Including\x20subtasks:\x20yes','dim','sessionId','end','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Disable\x20a\x20workflow\x20schedule','preparePushProject','navigateSessionsInteractive','sys','\x20\x20Console:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','path','fullName','projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','select','repeat','No\x20log\x20content\x20found','cwd','workflow:upload','Dry\x20run:\x20yes','relative','workflow:secrets:set','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Project\x20name\x20is\x20required','log','28jJokLT','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Validation:\x20skipped','✔\x20Schedule\x20#','projectId','json','Pattern:\x20','\x20deleted','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:attempt','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x27...','resolve','📅\x20#','Enabling\x20schedule\x20#','planned','isTTY','fill','min','updatedAt','\x20tasks','slice','parseProjectWorkflowPattern','format','\x20\x20Project\x20ID:\x20','Listing\x20secrets...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','trimEnd','From\x20task:\x20','\x20\x20Target:\x20','2547yTyoMY','17370itAQcs','retryAttemptName','TASK_NAME_WIDTH','fileCount','pollTimeline','stdout','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','localeCompare','Error:\x20Attempt\x20ID\x20is\x20required','filter','resumeFrom','Task\x20name:\x20','workflow:delete','attempts','\x20new','Deleting\x20secret...','Attempt\x20ID:\x20','Failed\x20to\x20fetch\x20attempt\x20data','Source\x20directory\x20is\x20required','success','-\x20nothing\x20pushed','Session\x20time:\x20','padStart','splice','Listing\x20schedules...','Error:\x20','Listing\x20workflow\x20attempts...','List\x20workflows','Expected\x20format:\x20--param\x20key=value','limit','12zsXaAB','includeRetried','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/app/workflows/','startTime','✔\x20Downloaded\x20','No\x20sessions\x20found','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','session','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Cloning\x20to\x20','workflow:timeline','index','text','\x20task','New\x20project\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Downloading\x20logs...','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20logs','toLocaleString','attempt','workflow:tasks','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','yes','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','Start\x20a\x20workflow\x20run','\x0aDry\x20run\x20-\x20nothing\x20pushed','params','renderSingleTimeline','tdx.json','createdAt','Loading\x20sessions...','⚠\x20Showing\x20first\x20','window','Source\x20project:\x20','workflow:sessions','📋\x20','Updating\x20','MAX_TASKS_DISPLAY','attempt:','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','data','✔\x20Pull\x20complete','workflow:workflows','new','icon','\x20-\x20','Cancelled','description','set','\x20has\x20no\x20attempts','Source:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflow\x20sessions\x20found','floor','workflowProject','\x20sessions\x20','Session\x20not\x20found:\x20','Params:\x20','workflow:attempts','45402940kRtHOS','3XoQaqJ','deleted','list','unchanged','nextRunTime','\x20\x20Session\x20context\x20set\x20to:\x20','\x20schedule','workflow:logs','done','unknown','Key:\x20','GUTTER','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','6302935kQoMji','\x0aError:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','✔\x20Found\x20','Project\x20name:\x20','\x20\x20Revision:\x20','Killing\x20attempt...','Tip:\x20cd\x20to\x20workflows/','find','verbose','disableSchedule','listSchedules','Setting\x20secret...','diff','Disabling\x20schedule\x20#','follow','🔄\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','No\x20attempts\x20found','\x0aPolling...\x20(','indexOf','No\x20matching\x20sessions\x20found','/sessions/','changes','workflow:clone','session:','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20attempt','push','workflow:use','get','sourceProjectName','\x20unchanged','tasks','substring','267604lbCppT','Enable\x20a\x20workflow\x20schedule','columns','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Project:\x20','3113444hRodjc','total','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','✔\x20Pushed\x20','now','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20from\x20session\x20','running','Writing\x20files...','toISOString','List\x20workflow\x20execution\x20sessions','Error:\x20Invalid\x20parameter\x20format:\x20','run','✔\x20Workflow\x20project\x20set\x20to:\x20','ICON_WIDTH','workflows','write','split','Attempt:\x20','Error:\x20Project\x20name\x20is\x20required','No\x20sessions\x20found\x20for:\x20','title','\x20enabled\x20(','message','workflow:secrets:delete','workflow:download','join','No\x20sessions\x20with\x20timing\x20information','getMonth','clear','blue','Listing\x20workflow\x20sessions...','requireProject','logs','taskName','\x20of\x20','✔\x20Workflow\x20project\x20context\x20cleared.','---\x20','Schedule\x20ID\x20is\x20required','(use\x20--limit\x20to\x20see\x20more)','Total:\x20','replace','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20secret','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','finishedAt','red','keys','context','enableSchedule','executePushProject','execute','LABEL_MIN_SPACING','fileSize','\x0a✔\x20Attempt\x20complete','No\x20projects\x20match\x20pattern:\x20','\x20disabled\x20(','Retry\x20a\x20session\x20or\x20attempt','readFile','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Starting\x20workflow\x20run...','output','error','task','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','includes','✔\x20Push\x20complete','Fetching\x20log\x20files...','workflow:kill','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','cancelRequested','\x20\x20Project:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','values','key','revision','\x20\x20Files\x20extracted:\x20','stringify','\x20next:\x20','size','table','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Kill\x20a\x20running\x20attempt','newProjectId','match','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','value','sort','Warning:','lastAttempt','deleteSecret','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:list','autocomplete','Setting\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','status','setSecrets','white','workflowName','Loading\x20session...'];a54_0x2dfb=function(){return _0x4cd072;};return a54_0x2dfb();}import a54_0x4e32c8 from'prompts';function getAttemptStatusDisplay(_0x1f01c6){const _0x281d68=a54_0x5811;if(!_0x1f01c6)return{'icon':'⏳','text':''};const {done:_0x947378,success:_0x5556ee,cancelRequested:_0x1a20f7}=_0x1f01c6;if(!_0x947378)return _0x1a20f7?{'icon':'🛑','text':a54_0x47fe92[_0x281d68(0x28d)]('canceling')}:{'icon':'🔄','text':a54_0x47fe92[_0x281d68(0x215)](_0x281d68(0x1fe))};if(_0x5556ee)return{'icon':'✅','text':a54_0x47fe92[_0x281d68(0x2b5)](_0x281d68(0x337))};return{'icon':'❌','text':a54_0x47fe92[_0x281d68(0x225)](_0x281d68(0x235))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x130479(0x2ca)](_0x69f709,_0x159b1b,_0x3d8a04=0x0){const _0xe20e0d=a54_0x130479;return _0x69f709[_0x3d8a04]||_0x159b1b[_0xe20e0d(0x37d)];}[a54_0x130479(0x217)](_0x1e777b,_0x2d399a,_0x39fb5c=0x0){const _0x2ac37a=a54_0x130479,_0x134360=this['resolveProject'](_0x1e777b,_0x2d399a,_0x39fb5c);if(!_0x134360)return console[_0x2ac37a(0x235)](a54_0x47fe92[_0x2ac37a(0x225)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x2ac37a(0x235)](a54_0x47fe92['dim'](_0x2ac37a(0x277))),null;return _0x134360;}[a54_0x130479(0x31a)](_0x1954ca,_0xadf850){const _0xb70451=a54_0x130479;if(_0x1954ca[0x0]){const _0x5b7cbf=_0x1954ca[0x0][_0xb70451(0x208)]('.');if(_0x5b7cbf['length']===0x1)return{'projectName':_0x5b7cbf[0x0],'workflowName':undefined};else return _0x5b7cbf[_0xb70451(0x273)]===0x2?{'projectName':_0x5b7cbf[0x0],'workflowName':_0x5b7cbf[0x1]}:(console[_0xb70451(0x235)](a54_0x47fe92['red'](_0xb70451(0x25d)),_0xb70451(0x34c)),null);}return{'projectName':_0xadf850[_0xb70451(0x37d)],'workflowName':undefined};}['resolveProjectDir'](_0x107d4b,_0x2049e5,_0x593c12=0x0){const _0x522864=a54_0x130479;if(_0x107d4b[_0x593c12])return _0x107d4b[_0x593c12];if(_0x2049e5['workflowProject']){const _0x24b794=a54_0x5d886b[_0x522864(0x211)](process['cwd'](),_0x522864(0x206),_0x2049e5[_0x522864(0x37d)]);if(existsSync(a54_0x5d886b[_0x522864(0x211)](_0x24b794,_0x522864(0x363))))return _0x24b794;}return undefined;}async['showWorkflowConsoleUrl'](_0x29879f,_0x16d443,_0x4fe048){const _0x9a9144=a54_0x130479;try{const _0x7806a2=await _0x29879f[_0x9a9144(0x2ab)][_0x9a9144(0x206)](_0x16d443,{'limit':0x1});if(_0x7806a2['length']>0x0){const _0x543fe4=_0x7806a2[0x0]['id'],_0x14687e=getWorkflowUrl(_0x4fe048,_0x543fe4);console[_0x9a9144(0x235)]('\x20\x20Console:\x20'+a54_0x47fe92['cyan'](_0x14687e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x130479(0x1eb);[a54_0x130479(0x376)]=a54_0x130479(0x34d);async[a54_0x130479(0x22a)](_0x53f157){const _0x1037f3=a54_0x130479,{options:_0x22c593,args:_0x41805c,tdx:_0x507990}=_0x53f157,_0x4a44c2=_0x41805c[0x0],_0x30bb1d=_0x22c593[_0x1037f3(0x214)];if(_0x30bb1d)return saveSessionContext({'workflow_project':undefined},_0x22c593['session']),console[_0x1037f3(0x303)](a54_0x47fe92[_0x1037f3(0x2b5)](_0x1037f3(0x21b))),0x0;if(!_0x4a44c2)return console['error'](a54_0x47fe92[_0x1037f3(0x225)](_0x1037f3(0x25d)),_0x1037f3(0x302)),console[_0x1037f3(0x235)](a54_0x47fe92[_0x1037f3(0x2e9)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x1037f3(0x235)](a54_0x47fe92[_0x1037f3(0x2e9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0xd7da30=await withSpinner('Resolving\x20project\x20\x27'+_0x4a44c2+_0x1037f3(0x30f),()=>_0x507990[_0x1037f3(0x2ab)]['resolveProjectId'](_0x4a44c2),{'verbose':_0x22c593['verbose']}),{name:_0x56b407}=_0xd7da30[_0x1037f3(0x36f)];return saveSessionContext({'workflow_project':_0x56b407},_0x22c593['session']),console[_0x1037f3(0x303)](a54_0x47fe92[_0x1037f3(0x2b5)](_0x1037f3(0x204)+a54_0x47fe92[_0x1037f3(0x2c4)](_0x56b407))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:projects';[a54_0x130479(0x376)]=a54_0x130479(0x2b0);async[a54_0x130479(0x22a)](_0x52bc36){const _0x204f22=a54_0x130479,{options:_0x49e551,args:_0x487460,tdx:_0x3bbe5d}=_0x52bc36,_0x4bb061=_0x487460[0x0];_0x49e551[_0x204f22(0x399)]&&_0x4bb061&&console[_0x204f22(0x235)](_0x204f22(0x30a)+_0x4bb061);const _0x53f721=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3bbe5d['workflow'][_0x204f22(0x2f6)](_0x4bb061,{'limit':_0x49e551['limit']}),{'verbose':_0x49e551['verbose']});let _0x612ac1=_0x53f721['data'];_0x612ac1[_0x204f22(0x24e)]((_0x15a466,_0x37c9af)=>_0x15a466[_0x204f22(0x27b)][_0x204f22(0x32b)](_0x37c9af[_0x204f22(0x27b)]));const _0x356128=_0x49e551[_0x204f22(0x341)]||0x64,_0xc78e1d=_0x612ac1[_0x204f22(0x273)]>=_0x356128?a54_0x47fe92[_0x204f22(0x2e9)](_0x204f22(0x2a9)):'';console[_0x204f22(0x235)]('✔\x20Found\x20'+_0x612ac1[_0x204f22(0x273)]+'\x20project'+(_0x612ac1[_0x204f22(0x273)]!==0x1?'s':'')+_0xc78e1d);if(_0x49e551[_0x204f22(0x31b)]===_0x204f22(0x309)||_0x49e551[_0x204f22(0x31b)]==='jsonl'||_0x49e551[_0x204f22(0x31b)]===_0x204f22(0x247))await handleSDKOutput(_0x612ac1,_0x49e551);else{if(_0x612ac1['length']===0x0)_0x4bb061?console[_0x204f22(0x303)](_0x204f22(0x22e)+_0x4bb061):console['log'](_0x204f22(0x2bf));else{const _0x54ab74=_0x612ac1[_0x204f22(0x263)](_0x3b3db0=>{const _0x11c981=_0x204f22,_0x48f815=_0x3b3db0['metadata']?.[_0x11c981(0x29e)](_0x37ed4b=>_0x37ed4b[_0x11c981(0x241)]===_0x11c981(0x2f0)),_0x36f7bb=_0x48f815?a54_0x47fe92[_0x11c981(0x2e9)](_0x11c981(0x2ba)):'';return'📁\x20'+_0x3b3db0['name']+_0x36f7bb;});await writeOutput(_0x54ab74[_0x204f22(0x211)]('\x0a'),_0x49e551['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x371);[a54_0x130479(0x376)]=a54_0x130479(0x33f);async[a54_0x130479(0x22a)](_0x3f3338){const _0x13611c=a54_0x130479,{options:_0x2a8744,args:_0x35e8ca,tdx:_0x2fc422}=_0x3f3338,_0x5367e7=this['resolveProject'](_0x35e8ca,_0x2a8744);_0x2a8744[_0x13611c(0x399)]&&_0x5367e7&&console['error']('Project\x20filter:\x20'+_0x5367e7);const _0x3cd304=await withSpinner('Listing\x20workflows...',()=>_0x2fc422[_0x13611c(0x2ab)][_0x13611c(0x206)](_0x5367e7,{'limit':_0x2a8744[_0x13611c(0x341)]}),{'verbose':_0x2a8744['verbose']});let _0x255f23=_0x3cd304[_0x13611c(0x36f)];_0x255f23[_0x13611c(0x24e)]((_0x2bb7d9,_0x3401eb)=>{const _0x2dee19=_0x13611c,_0x6fcdad=_0x2bb7d9['name'][_0x2dee19(0x32b)](_0x3401eb[_0x2dee19(0x27b)]);if(_0x6fcdad!==0x0)return _0x6fcdad;return(_0x2bb7d9[_0x2dee19(0x298)]?.[_0x2dee19(0x27b)]||'')['localeCompare'](_0x3401eb['project']?.['name']||'');});const _0x1d6447=_0x2a8744[_0x13611c(0x341)]||0x64,_0xe13c94=_0x255f23[_0x13611c(0x273)]>=_0x1d6447?a54_0x47fe92[_0x13611c(0x2e9)](_0x13611c(0x2a9)):'';console['error'](_0x13611c(0x393)+_0x255f23[_0x13611c(0x273)]+_0x13611c(0x29b)+(_0x255f23[_0x13611c(0x273)]!==0x1?'s':'')+_0xe13c94);if(_0x2a8744['format']===_0x13611c(0x309)||_0x2a8744[_0x13611c(0x31b)]===_0x13611c(0x2cb)||_0x2a8744[_0x13611c(0x31b)]===_0x13611c(0x247))await handleSDKOutput(_0x255f23,_0x2a8744);else{if(_0x255f23[_0x13611c(0x273)]===0x0)_0x5367e7?console['log'](_0x13611c(0x274)+_0x5367e7):console[_0x13611c(0x303)](_0x13611c(0x2b9));else{const _0x80b58a=_0x2a8744['site'],_0xc207df=_0x255f23['map'](_0x4c8544=>{const _0x2dbb26=_0x13611c,_0x381607=a54_0x47fe92[_0x2dbb26(0x2e9)]('#'+_0x4c8544['id']),_0x3375e9=hyperlink(_0x381607,getWorkflowUrl(_0x80b58a,_0x4c8544['id'])),_0xff2ed4=_0x4c8544[_0x2dbb26(0x298)]?.['name']?a54_0x47fe92[_0x2dbb26(0x2e9)]('\x20('+_0x4c8544[_0x2dbb26(0x298)][_0x2dbb26(0x27b)]+')'):'';return _0x2dbb26(0x36a)+_0x3375e9+'\x20'+_0x4c8544[_0x2dbb26(0x27b)]+_0xff2ed4;});await writeOutput(_0xc207df[_0x13611c(0x211)]('\x0a'),_0x2a8744[_0x13611c(0x234)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x369);[a54_0x130479(0x376)]=a54_0x130479(0x201);async[a54_0x130479(0x22a)](_0x3b1780){const _0x4c9cd2=a54_0x130479,{options:_0x59acc4,args:_0x574321,tdx:_0x4ff5d8}=_0x3b1780,_0x337de7=this['parseProjectWorkflowPattern'](_0x574321,_0x59acc4);if(!_0x337de7)return 0x1;const {projectName:_0x146fcf,workflowName:_0x42805c}=_0x337de7;if(_0x59acc4[_0x4c9cd2(0x399)]){if(_0x146fcf&&_0x42805c)console[_0x4c9cd2(0x235)](_0x4c9cd2(0x26e)+_0x146fcf+'.'+_0x42805c);else _0x146fcf&&console[_0x4c9cd2(0x235)]('Filter:\x20project='+_0x146fcf);const _0x120a61=_0x59acc4['status'];_0x120a61&&console['error']('Status:\x20'+_0x120a61);}let _0x3cc68a=0x28;if(process['stdout'][_0x4c9cd2(0x314)]&&!_0x59acc4[_0x4c9cd2(0x234)]&&!_0x59acc4[_0x4c9cd2(0x31b)]){const _0x7b87ee=process[_0x4c9cd2(0x328)][_0x4c9cd2(0x2b6)]||0x28;_0x3cc68a=Math['max'](0x14,Math[_0x4c9cd2(0x37c)](_0x7b87ee*0x2/0x3));}const _0x3e1330=_0x59acc4[_0x4c9cd2(0x341)]||_0x3cc68a,_0x4c4417=await withSpinner(_0x4c9cd2(0x216),()=>_0x4ff5d8[_0x4c9cd2(0x2ab)]['sessions']({'projectName':_0x146fcf,'workflowName':_0x42805c,'status':_0x59acc4[_0x4c9cd2(0x257)],'fromTime':_0x59acc4[_0x4c9cd2(0x271)],'toTime':_0x59acc4['to'],'limit':_0x3e1330}),{'verbose':_0x59acc4[_0x4c9cd2(0x399)]}),_0x5959bf=_0x4c4417[_0x4c9cd2(0x36f)];_0x5959bf[_0x4c9cd2(0x24e)]((_0x527b48,_0x1d277a)=>{const _0x28341c=_0x4c9cd2,_0x111289=_0x527b48[_0x28341c(0x35e)]||'',_0x1d80ea=_0x1d277a[_0x28341c(0x35e)]||'';return _0x1d80ea['localeCompare'](_0x111289);});_0x5959bf[_0x4c9cd2(0x273)]>=_0x3e1330?console['error']('✔\x20Showing\x20'+_0x5959bf['length']+_0x4c9cd2(0x37e)+a54_0x47fe92['dim'](_0x4c9cd2(0x21e))):console['error'](_0x4c9cd2(0x393)+_0x5959bf[_0x4c9cd2(0x273)]+_0x4c9cd2(0x2d0)+(_0x5959bf['length']!==0x1?'s':''));if(_0x59acc4['format']===_0x4c9cd2(0x309)||_0x59acc4[_0x4c9cd2(0x31b)]===_0x4c9cd2(0x2cb)||_0x59acc4[_0x4c9cd2(0x31b)]==='table')await handleSDKOutput(_0x5959bf,_0x59acc4);else{if(!process[_0x4c9cd2(0x328)][_0x4c9cd2(0x314)]||_0x59acc4[_0x4c9cd2(0x234)]){if(_0x5959bf[_0x4c9cd2(0x273)]===0x0){if(_0x146fcf&&_0x42805c)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x146fcf+'.'+_0x42805c);else _0x146fcf?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x146fcf):console[_0x4c9cd2(0x303)](_0x4c9cd2(0x348));}else{const _0x542457=_0x59acc4[_0x4c9cd2(0x25c)],_0x2b4d8d=this['renderSessionsTimeline'](_0x5959bf,_0x542457);_0x59acc4[_0x4c9cd2(0x234)]?await writeOutput(_0x2b4d8d,_0x59acc4['output'],_0x4c9cd2(0x385)):console[_0x4c9cd2(0x303)](_0x2b4d8d);}!_0x146fcf&&(console[_0x4c9cd2(0x235)](''),console[_0x4c9cd2(0x235)](a54_0x47fe92[_0x4c9cd2(0x2e9)](_0x4c9cd2(0x26c))),console[_0x4c9cd2(0x235)](a54_0x47fe92['dim'](_0x4c9cd2(0x1f4))+'or'+a54_0x47fe92['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x5959bf['length']===0x0){if(_0x146fcf&&_0x42805c)console[_0x4c9cd2(0x303)](_0x4c9cd2(0x20b)+_0x146fcf+'.'+_0x42805c);else _0x146fcf?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x146fcf):console[_0x4c9cd2(0x303)](_0x4c9cd2(0x348));}else await this['navigateSessionsInteractive'](_0x5959bf,_0x3b1780,_0x146fcf);}}return 0x0;}['renderSessionsTimeline'](_0x2bb48e,_0x36e717){const _0x596e19=a54_0x130479,_0x5e767d=[],_0x80b483=new Map();let _0x111d86=Infinity,_0x3ab7db=-Infinity;for(const _0xe01b8f of _0x2bb48e){if(_0xe01b8f[_0x596e19(0x250)]?.['createdAt']){const _0x1e7c2a=new Date(_0xe01b8f['lastAttempt'][_0x596e19(0x364)])['getTime'](),_0x321c6d=_0xe01b8f[_0x596e19(0x250)][_0x596e19(0x224)]?new Date(_0xe01b8f[_0x596e19(0x250)][_0x596e19(0x224)])[_0x596e19(0x28f)]():Date['now'](),_0x20cbcb=_0xe01b8f[_0x596e19(0x298)]?.[_0x596e19(0x27b)]||_0x596e19(0x2e6);!_0x80b483['has'](_0x20cbcb)&&_0x80b483[_0x596e19(0x377)](_0x20cbcb,[]),_0x80b483[_0x596e19(0x1ec)](_0x20cbcb)[_0x596e19(0x1ea)]({'session':_0xe01b8f,'startTime':_0x1e7c2a,'endTime':_0x321c6d,'duration':_0x321c6d-_0x1e7c2a}),_0x111d86=Math[_0x596e19(0x316)](_0x111d86,_0x1e7c2a),_0x3ab7db=Math[_0x596e19(0x2b3)](_0x3ab7db,_0x321c6d);}}if(_0x80b483[_0x596e19(0x246)]===0x0)return _0x596e19(0x212);const _0x2916bc=process[_0x596e19(0x328)][_0x596e19(0x1f3)]||0x78,_0x29c7f7=0x1e,_0x53abde=0x32,_0x22f335=0x4,_0x48132d=Math[_0x596e19(0x316)](_0x53abde,Math[_0x596e19(0x2b3)](_0x29c7f7,Math[_0x596e19(0x37c)](_0x2916bc*0.3))),_0xb6e7d1=_0x2916bc-_0x48132d-TIMELINE_CONFIG[_0x596e19(0x38e)]-0x3-_0x22f335,_0x1bdf36=_0x3ab7db-_0x111d86,_0x5d2f5a=_0x1bdf36/_0x48132d,_0x422f86=renderTimeAxis({'startTime':_0x111d86,'endTime':_0x3ab7db,'durationMs':_0x1bdf36,'msPerChar':_0x5d2f5a},_0x48132d),_0x969127=[];for(const _0x59eeb7 of _0x80b483[_0x596e19(0x240)]()){_0x969127[_0x596e19(0x1ea)](..._0x59eeb7);}_0x969127[_0x596e19(0x24e)]((_0x1008e6,_0x2be6ee)=>_0x2be6ee[_0x596e19(0x346)]-_0x1008e6[_0x596e19(0x346)]);const _0x16a64e=new Date(_0x111d86),_0x436838=formatDate(_0x16a64e),_0x1c8c82=_0x22f335+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0xb6e7d1,_0x3720e1='\x20'[_0x596e19(0x2fa)](_0x1c8c82-_0x436838[_0x596e19(0x273)]),_0x3fe650=_0x3720e1+a54_0x47fe92[_0x596e19(0x2e9)](_0x436838)+'\x20'+_0x422f86;_0x5e767d['push'](_0x3fe650);const _0x28fe59=0x16;let _0x5ce825=0x0;for(const _0x21a636 of _0x969127){const _0x232627=_0x21a636[_0x596e19(0x34b)][_0x596e19(0x298)]?.['name']||'?',_0x104263=Math[_0x596e19(0x316)](stringWidth(_0x232627),_0x28fe59);_0x5ce825=Math[_0x596e19(0x2b3)](_0x5ce825,_0x104263);}for(const _0x3cc8d3 of _0x969127){const {session:_0x56fd46,startTime:_0x23ff74,endTime:_0x287660,duration:_0x3ed9a7}=_0x3cc8d3,_0x5b2d2b=_0x56fd46['project']?.['id'],_0x11d1de=_0x56fd46['id'],_0x31e52c=_0x56fd46[_0x596e19(0x298)]?.['name']||'?',_0x4ccd3b=_0x56fd46[_0x596e19(0x2ab)]?.[_0x596e19(0x27b)]||'?';let _0x42259f,_0x4ca81e;if(_0x56fd46[_0x596e19(0x250)]){const _0x1fc5fa=_0x56fd46[_0x596e19(0x250)];!_0x1fc5fa[_0x596e19(0x38b)]?(_0x42259f=_0x1fc5fa[_0x596e19(0x23d)]?'🛑':'🔄',_0x4ca81e=_0x1fc5fa[_0x596e19(0x23d)]?a54_0x47fe92['yellow']:a54_0x47fe92['blue']):(_0x42259f=_0x1fc5fa['success']?'✅':'❌',_0x4ca81e=_0x1fc5fa['success']?a54_0x47fe92['green']:a54_0x47fe92['red']);}else _0x42259f='⏳',_0x4ca81e=a54_0x47fe92[_0x596e19(0x2e9)];const _0x2ab17f='#'+_0x11d1de,_0x592683=_0x5b2d2b?hyperlink(_0x2ab17f,getWorkflowSessionUrl(_0x36e717,_0x5b2d2b,_0x11d1de)):_0x2ab17f;let _0x4f4bdc=_0x31e52c;stringWidth(_0x31e52c)>_0x28fe59&&(_0x4f4bdc=_0x31e52c[_0x596e19(0x319)](0x0,_0x28fe59-0x1)+'…');const _0x2e4e60=a54_0x47fe92[_0x596e19(0x2e9)](_0x4f4bdc),_0x5f4974=stringWidth(_0x4f4bdc),_0x42fb36='\x20'['repeat'](_0x5ce825-stringWidth(_0x4f4bdc)+0x2),_0x1b0154='('+formatElapsed(_0x3ed9a7)+')',_0x46dcec=stringWidth(_0x1b0154),_0x81060c=stringWidth(_0x2ab17f),_0x179b94=_0x81060c+0x1+_0x5f4974+_0x42fb36['length'],_0x5b3a49=_0xb6e7d1-_0x179b94-_0x46dcec-0x1-0x8;let _0x3881cb=_0x4ccd3b;stringWidth(_0x3881cb)>_0x5b3a49&&(_0x3881cb=_0x3881cb[_0x596e19(0x319)](0x0,_0x5b3a49-0x1)+'…');const _0x10a1ed=_0x592683+'\x20'+_0x2e4e60+_0x42fb36+_0x3881cb,_0x4cbadf=stringWidth(_0x10a1ed),_0x22d8d9=_0xb6e7d1-_0x4cbadf-_0x46dcec,_0x219702=_0x10a1ed+'\x20'[_0x596e19(0x2fa)](Math[_0x596e19(0x2b3)](0x1,_0x22d8d9))+a54_0x47fe92['dim'](_0x1b0154),_0x4d44aa=Math[_0x596e19(0x37c)]((_0x23ff74-_0x111d86)/_0x5d2f5a),_0x433c94=Math[_0x596e19(0x37c)]((_0x287660-_0x111d86)/_0x5d2f5a),_0x30f626=Math[_0x596e19(0x2b3)](_0x4d44aa+0x1,_0x433c94),_0x5a6b6d=new Array(_0x48132d)[_0x596e19(0x315)]('\x20');for(let _0x4306eb=_0x4d44aa;_0x4306eb<Math[_0x596e19(0x316)](_0x30f626,_0x48132d);_0x4306eb++){_0x5a6b6d[_0x4306eb]='─';}const _0x38b31a=_0x5a6b6d[_0x596e19(0x263)](_0x1da31e=>_0x1da31e==='\x20'?'\x20':_0x4ca81e(_0x1da31e))[_0x596e19(0x211)]('');_0x5e767d['push'](_0x42259f+'\x20'+_0x219702+'│'+_0x38b31a+'│');}return _0x5e767d[_0x596e19(0x211)]('\x0a');}async[a54_0x130479(0x2ef)](_0x4b5835,_0x218710,_0x2eb9fe){const _0x576a07=a54_0x130479,{options:_0x2e842d,tdx:_0x44f62c}=_0x218710,_0x2307ec=_0x2e842d[_0x576a07(0x25c)],{timelineRows:_0x58eda9,timeAxisHeader:_0xe4725c}=this['generateSessionTimelineRows'](_0x4b5835,_0x2307ec),_0x945ee=_0x58eda9[_0x576a07(0x32d)](_0x3b1771=>_0x3b1771[_0x576a07(0x2a5)]);if(_0x945ee[_0x576a07(0x273)]===0x0){const _0x544309=this[_0x576a07(0x2db)](_0x4b5835,_0x2307ec);console[_0x576a07(0x303)](_0x544309);!_0x2eb9fe&&(console[_0x576a07(0x235)](''),console[_0x576a07(0x235)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x26c))),console[_0x576a07(0x235)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x1f4))+'or'+a54_0x47fe92['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xe4725c&&console[_0x576a07(0x303)](_0xe4725c);const _0x2f1f08=_0x58eda9[_0x576a07(0x32d)](_0x46d6df=>_0x46d6df[_0x576a07(0x2a5)])[_0x576a07(0x263)](_0x1d8b3d=>({'title':_0x1d8b3d['displayLine'],'value':_0x1d8b3d['attemptId']})),_0x41f33b=process[_0x576a07(0x328)][_0x576a07(0x2b6)]||0x3c,_0x2f9c4b=Math[_0x576a07(0x2b3)](0x28,Math[_0x576a07(0x37c)](_0x41f33b*0x2/0x3)),_0x1bc293=await a54_0x4e32c8({'type':_0x576a07(0x254),'name':_0x576a07(0x2a5),'message':_0x576a07(0x392),'choices':_0x2f1f08,'initial':-0x1,'limit':_0x2f9c4b,'clearFirst':!![],'fallback':{'title':_0x576a07(0x3a5),'value':null},'suggest':(_0x44d04f,_0x2e44e9)=>{const _0x138771=_0x576a07;if(!_0x44d04f)return Promise[_0x138771(0x310)](_0x2e44e9);const _0x1c979f=_0x2e44e9[_0x138771(0x32d)](_0x51a701=>{const _0x464af6=_0x138771,_0x41da4d=_0x51a701;return _0x41da4d[_0x464af6(0x20c)]['toLowerCase']()[_0x464af6(0x238)](_0x44d04f[_0x464af6(0x27a)]());});return Promise[_0x138771(0x310)](_0x1c979f);}}),_0x3a160a=()=>{const _0x2bd397=_0x576a07;process[_0x2bd397(0x328)][_0x2bd397(0x207)]('\x1b[1A\x1b[2K'),process[_0x2bd397(0x328)][_0x2bd397(0x207)](_0x2bd397(0x28a)),process[_0x2bd397(0x328)]['write'](_0x2bd397(0x28a));},_0x522d3f=_0x1bc293&&_0x1bc293[_0x576a07(0x2a5)]&&_0x1bc293[_0x576a07(0x2a5)]!==null&&_0x1bc293[_0x576a07(0x2a5)]['trim']()!=='';if(!_0x522d3f){_0x3a160a(),console[_0x576a07(0x303)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x375)));return;}_0x3a160a();const _0x1951a9=_0x4b5835[_0x576a07(0x398)](_0x5846ad=>_0x5846ad[_0x576a07(0x250)]?.['id']===_0x1bc293[_0x576a07(0x2a5)]);if(_0x1951a9){const _0x5002fd=_0x1951a9[_0x576a07(0x298)]?.[_0x576a07(0x27b)]||'?',_0x131924=_0x1951a9['workflow']?.[_0x576a07(0x27b)]||'?';console['log'](_0x576a07(0x28b)+a54_0x47fe92['dim'](_0x5002fd)+_0x576a07(0x275)+a54_0x47fe92[_0x576a07(0x2e9)](_0x131924));}const _0x28181f=new WorkflowTimelineCommand();await _0x28181f[_0x576a07(0x22a)]({'args':[],'options':{..._0x2e842d,'attemptId':_0x1bc293[_0x576a07(0x2a5)]},'tdx':_0x44f62c});}[a54_0x130479(0x279)](_0x2de567,_0x1d6a70){const _0x2e3461=a54_0x130479,_0xa644d5=new Map();for(const _0x34d13c of _0x2de567){_0x34d13c['id']&&_0x34d13c[_0x2e3461(0x250)]?.['id']&&_0xa644d5[_0x2e3461(0x377)](_0x34d13c['id'],_0x34d13c[_0x2e3461(0x250)]['id']);}const _0xd7ee9e=[];let _0x39644a='';const _0x25c004=this['renderSessionsTimeline'](_0x2de567,_0x1d6a70),_0x3180c6=_0x25c004[_0x2e3461(0x208)]('\x0a');for(const _0x5e343b of _0x3180c6){if(_0x5e343b[_0x2e3461(0x2bb)](_0x2e3461(0x329))||_0x5e343b[_0x2e3461(0x24b)](/^\s+\d{4}-\d{2}-\d{2}/))_0x39644a=_0x5e343b;else{if(_0x5e343b[_0x2e3461(0x24b)](/^[✅❌🔄🛑⏳]/)){const _0x546e56=_0x5e343b[_0x2e3461(0x24b)](/#(\d+)/),_0x2a2867=_0x546e56?_0x546e56[0x1]:null,_0x532016=_0x2a2867?_0xa644d5[_0x2e3461(0x1ec)](_0x2a2867)||null:null,_0x4a4aef=_0x2de567[_0x2e3461(0x398)](_0x17ded0=>_0x17ded0['id']===_0x2a2867),_0x3d19d4=_0x4a4aef?.[_0x2e3461(0x298)]?.[_0x2e3461(0x27b)]||'';_0xd7ee9e['push']({'displayLine':_0x5e343b,'attemptId':_0x532016,'projectName':_0x3d19d4});}}}return{'timelineRows':_0xd7ee9e,'timeAxisHeader':_0x39644a};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x381);[a54_0x130479(0x376)]='List\x20workflow\x20attempts';async[a54_0x130479(0x22a)](_0x214325){const _0xc2e44c=a54_0x130479,{options:_0x467322,args:_0x3be360,tdx:_0x5271fc}=_0x214325,_0x43343=this[_0xc2e44c(0x31a)](_0x3be360,_0x467322);if(!_0x43343)return 0x1;const {projectName:_0x28497e,workflowName:_0x2f357f}=_0x43343,_0x220fc4=_0x467322[_0xc2e44c(0x343)];if(_0x467322[_0xc2e44c(0x399)]){if(_0x28497e&&_0x2f357f)console[_0xc2e44c(0x235)](_0xc2e44c(0x26e)+_0x28497e+'.'+_0x2f357f);else _0x28497e&&console[_0xc2e44c(0x235)](_0xc2e44c(0x270)+_0x28497e);_0x220fc4&&console['error'](_0xc2e44c(0x276));}const _0x3d36ef=await withSpinner(_0xc2e44c(0x33e),()=>_0x5271fc['workflow'][_0xc2e44c(0x331)]({'projectName':_0x28497e,'workflowName':_0x2f357f,'includeRetried':_0x220fc4,'limit':_0x467322[_0xc2e44c(0x341)]}),{'verbose':_0x467322[_0xc2e44c(0x399)]}),_0x111687=_0x3d36ef[_0xc2e44c(0x36f)],_0x1db272=_0x467322[_0xc2e44c(0x341)]||0x64,_0x4429dd=_0x111687[_0xc2e44c(0x273)]>=_0x1db272?a54_0x47fe92[_0xc2e44c(0x2e9)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x111687['length']+_0xc2e44c(0x1e9)+(_0x111687[_0xc2e44c(0x273)]!==0x1?'s':'')+_0x4429dd);if(_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x309)||_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x2cb)||_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x247))await handleSDKOutput(_0x111687,_0x467322);else{if(_0x111687[_0xc2e44c(0x273)]===0x0){if(_0x28497e&&_0x2f357f)console[_0xc2e44c(0x303)](_0xc2e44c(0x293)+_0x28497e+'.'+_0x2f357f);else _0x28497e?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x28497e):console[_0xc2e44c(0x303)](_0xc2e44c(0x3a2));}else{const _0x23fafb=_0x467322[_0xc2e44c(0x25c)],_0x237d6c=_0x111687['map'](_0x499a9c=>{const _0x549e3c=_0xc2e44c,_0x233404=a54_0x47fe92[_0x549e3c(0x2e9)]('#'+_0x499a9c['id']),_0x25f5f7=_0x499a9c[_0x549e3c(0x298)]?.['id'],_0x20bc4b=_0x499a9c['session_id']||_0x499a9c['sessionId'],_0x546ef2=_0x25f5f7&&_0x20bc4b?hyperlink(_0x233404,getWorkflowAttemptUrl(_0x23fafb,_0x25f5f7,_0x20bc4b,_0x499a9c['id'])):_0x233404,{icon:_0x11a8ff,text:_0x427698}=getAttemptStatusDisplay(_0x499a9c),_0x5aad6a=(_0x499a9c[_0x549e3c(0x298)]?.[_0x549e3c(0x27b)]||'?')+'.'+(_0x499a9c['workflow']?.['name']||'?'),_0x46fae6=_0x499a9c[_0x549e3c(0x35e)]?a54_0x47fe92[_0x549e3c(0x2e9)](_0x499a9c[_0x549e3c(0x35e)]):'';return(_0x546ef2+'\x20'+_0x11a8ff+(_0x427698?'\x20'+_0x427698:'')+'\x20'+_0x5aad6a+'\x20'+_0x46fae6)[_0x549e3c(0x31f)]();});await writeOutput(_0x237d6c['join']('\x0a'),_0x467322[_0xc2e44c(0x234)],_0xc2e44c(0x385));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x30d);[a54_0x130479(0x376)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x2d5641){const _0x41fb11=a54_0x130479,{options:_0x14696c,args:_0x497b82,tdx:_0xa090c7}=_0x2d5641,_0x636c02=_0x497b82[0x0];if(!_0x636c02)return console[_0x41fb11(0x235)](_0x41fb11(0x32c)),0x1;_0x14696c[_0x41fb11(0x399)]&&console[_0x41fb11(0x235)](_0x41fb11(0x334)+_0x636c02);const _0xef8a57=await withSpinner(_0x41fb11(0x268),()=>_0xa090c7['workflow'][_0x41fb11(0x359)](_0x636c02),{'verbose':_0x14696c['verbose']}),_0x5f54c2=_0xef8a57[_0x41fb11(0x36f)];let _0x4f8ed1;!_0x5f54c2['done']?_0x4f8ed1=_0x5f54c2['cancelRequested']?'canceling':'running':_0x4f8ed1=_0x5f54c2['success']?_0x41fb11(0x337):_0x41fb11(0x235);let _0x256a43;if(_0x5f54c2[_0x41fb11(0x364)]&&_0x5f54c2['finishedAt']){const _0x33605c=new Date(_0x5f54c2['createdAt'])[_0x41fb11(0x28f)](),_0xdbf886=new Date(_0x5f54c2['finishedAt'])[_0x41fb11(0x28f)]();_0x256a43=Math['round']((_0xdbf886-_0x33605c)/0x3e8);}const _0xa017={'attempt_id':_0x5f54c2['id'],'status':_0x4f8ed1,..._0x5f54c2[_0x41fb11(0x350)]!==undefined&&{'index':_0x5f54c2['index']},..._0x5f54c2['project']&&{'project':_0x5f54c2['project']['name']},..._0x5f54c2[_0x41fb11(0x2ab)]&&{'workflow':_0x5f54c2[_0x41fb11(0x2ab)][_0x41fb11(0x27b)]},..._0x5f54c2[_0x41fb11(0x2ea)]&&{'session_id':_0x5f54c2['sessionId']},..._0x5f54c2[_0x41fb11(0x35e)]&&{'session_time':_0x5f54c2[_0x41fb11(0x35e)]},..._0x5f54c2[_0x41fb11(0x324)]&&{'retry_attempt':_0x5f54c2[_0x41fb11(0x324)]},..._0x256a43!==undefined&&{'duration_sec':_0x256a43},..._0x5f54c2[_0x41fb11(0x364)]&&{'created_at':_0x5f54c2[_0x41fb11(0x364)]},..._0x5f54c2[_0x41fb11(0x224)]&&{'finished_at':_0x5f54c2['finishedAt']},...Object[_0x41fb11(0x226)](_0x5f54c2[_0x41fb11(0x361)])['length']>0x0&&{'params':_0x5f54c2[_0x41fb11(0x361)]}};return await handleSingleObjectOutput(_0xa017,_0x14696c),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x130479(0x35a);[a54_0x130479(0x376)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x130479(0x22a)](_0x2e0a25){const _0x43ea52=a54_0x130479,{options:_0x4d2cf8,args:_0x22cc86,tdx:_0x4009b5}=_0x2e0a25,_0x4c2448=_0x22cc86[0x0];if(!_0x4c2448)return console[_0x43ea52(0x235)](_0x43ea52(0x32c)),0x1;const _0x5bdc99=_0x4d2cf8[_0x43ea52(0x261)];_0x4d2cf8[_0x43ea52(0x399)]&&(console['error'](_0x43ea52(0x334)+_0x4c2448),_0x5bdc99&&console[_0x43ea52(0x235)](_0x43ea52(0x2e8)));const _0x3e62d2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4009b5[_0x43ea52(0x2ab)][_0x43ea52(0x1ef)](_0x4c2448,_0x5bdc99||![]),{'verbose':_0x4d2cf8[_0x43ea52(0x399)]}),_0x5d13c3=_0x3e62d2[_0x43ea52(0x36f)];return console[_0x43ea52(0x235)](_0x43ea52(0x393)+_0x5d13c3[_0x43ea52(0x273)]+_0x43ea52(0x352)+(_0x5d13c3[_0x43ea52(0x273)]!==0x1?'s':'')),await handleSDKOutput(_0x5d13c3,_0x4d2cf8),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x38a);[a54_0x130479(0x376)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a54_0x130479(0x22a)](_0x58d4a3){const _0x188887=a54_0x130479,{options:_0xb5bc54,args:_0x5f3b0b,tdx:_0x31ae6b}=_0x58d4a3,_0x3f70f7=_0x5f3b0b[0x0];let _0x1eeaf3=_0x5f3b0b[0x1];if(!_0x3f70f7)return console['error'](_0x188887(0x32c)),0x1;_0xb5bc54[_0x188887(0x399)]&&(console['error']('Attempt\x20ID:\x20'+_0x3f70f7),_0x1eeaf3&&console[_0x188887(0x235)](_0x188887(0x32f)+_0x1eeaf3));const _0x501d9d=await withSpinner(_0x188887(0x23a),()=>_0x31ae6b[_0x188887(0x2ab)][_0x188887(0x2c0)](_0x3f70f7,_0x1eeaf3),{'verbose':_0xb5bc54[_0x188887(0x399)]}),_0x21de8c=_0x501d9d[_0x188887(0x36f)];if(_0x21de8c[_0x188887(0x273)]===0x0)return console[_0x188887(0x235)](_0x188887(0x221)),0x0;if(!_0x1eeaf3&&(_0xb5bc54[_0x188887(0x309)]||_0xb5bc54[_0x188887(0x31b)]))return await handleSDKOutput(_0x21de8c,_0xb5bc54),0x0;if(!_0x1eeaf3){const _0x3a9ebb=_0x21de8c['map'](_0x10434b=>({'title':_0x10434b[_0x188887(0x219)]+'\x20('+formatBytes(_0x10434b[_0x188887(0x22c)])+')','value':_0x10434b[_0x188887(0x219)]})),_0x3e4203=await a54_0x4e32c8({'type':'select','name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x3a9ebb});if(!_0x3e4203[_0x188887(0x236)])return console['error'](_0x188887(0x375)),0x0;_0x1eeaf3=_0x3e4203[_0x188887(0x236)];}const _0x3265b8=await withSpinner(_0x188887(0x355),()=>_0x31ae6b[_0x188887(0x2ab)][_0x188887(0x218)](_0x3f70f7,_0x1eeaf3),{'verbose':_0xb5bc54[_0x188887(0x399)]}),_0x1ec31e=_0x3265b8[_0x188887(0x36f)];return _0x1ec31e?console[_0x188887(0x303)](_0x1ec31e):console['error'](_0x188887(0x2fb)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x130479(0x23b);[a54_0x130479(0x376)]=a54_0x130479(0x249);async['execute'](_0x2b3f05){const _0x13c9dd=a54_0x130479,{options:_0x16676a,args:_0x3fbd89,tdx:_0x249b6f}=_0x2b3f05,_0x3980c5=_0x3fbd89[0x0];if(!_0x3980c5)return console[_0x13c9dd(0x235)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2cbd62=_0x16676a[_0x13c9dd(0x2bd)];_0x16676a[_0x13c9dd(0x399)]&&(console[_0x13c9dd(0x235)]('Attempt\x20ID:\x20'+_0x3980c5),_0x2cbd62&&console[_0x13c9dd(0x235)](_0x13c9dd(0x262)+_0x2cbd62));if(!_0x16676a['yes']){if(!isInteractive())return console[_0x13c9dd(0x235)](a54_0x47fe92[_0x13c9dd(0x225)](_0x13c9dd(0x391)),_0x13c9dd(0x2d2)),console[_0x13c9dd(0x235)](a54_0x47fe92['dim'](_0x13c9dd(0x344))),0x1;const _0x2c0fe9=await confirmKey(_0x13c9dd(0x3a1)+_0x3980c5+'?');if(!_0x2c0fe9)return console[_0x13c9dd(0x235)](a54_0x47fe92[_0x13c9dd(0x28d)](_0x13c9dd(0x375))),0x1;}const _0x16a7c2=await withSpinner(_0x13c9dd(0x396),()=>_0x249b6f['workflow']['kill'](_0x3980c5,_0x2cbd62),{'verbose':_0x16676a['verbose']}),_0x5149ee=_0x16a7c2[_0x13c9dd(0x36f)];return console[_0x13c9dd(0x235)]('✔\x20'+_0x5149ee),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x286);[a54_0x130479(0x376)]=a54_0x130479(0x230);async[a54_0x130479(0x22a)](_0x795605){const _0x26d1fb=a54_0x130479,{options:_0x118a8d,args:_0xaa70e,tdx:_0x4c1586}=_0x795605,_0x57541c=_0xaa70e[0x0];if(!_0x57541c)return console[_0x26d1fb(0x235)](_0x26d1fb(0x1f8)),console[_0x26d1fb(0x235)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2ab40a=![],_0xd976d0=_0x57541c;if(_0x57541c[_0x26d1fb(0x2bb)](_0x26d1fb(0x1e7)))_0x2ab40a=!![],_0xd976d0=_0x57541c['substring'](0x8);else{if(_0x57541c[_0x26d1fb(0x2bb)](_0x26d1fb(0x36d)))_0x2ab40a=![],_0xd976d0=_0x57541c[_0x26d1fb(0x1f0)](0x8);else return console[_0x26d1fb(0x235)](_0x26d1fb(0x23f)),console[_0x26d1fb(0x235)](_0x26d1fb(0x30c)),0x1;}const _0x25c8b9=_0x118a8d['fromTask'],_0xe76489=_0x118a8d[_0x26d1fb(0x32e)],_0x43d4ee=_0x118a8d[_0x26d1fb(0x361)],_0x216bf0=_0x118a8d[_0x26d1fb(0x272)];_0x118a8d['verbose']&&(console[_0x26d1fb(0x235)]('Target:\x20'+(_0x2ab40a?_0x26d1fb(0x34b):'attempt')+'\x20'+_0xd976d0),_0x25c8b9&&console[_0x26d1fb(0x235)](_0x26d1fb(0x320)+_0x25c8b9),_0xe76489&&console[_0x26d1fb(0x235)](_0x26d1fb(0x26a)+_0xe76489),_0x43d4ee&&console[_0x26d1fb(0x235)](_0x26d1fb(0x380)+_0x43d4ee),_0x216bf0&&console[_0x26d1fb(0x235)]('Force:\x20yes'));let _0x22fb70;if(_0x43d4ee)try{if(_0x43d4ee[_0x26d1fb(0x2bb)]('@')){const _0x56f518=await import(_0x26d1fb(0x296)),_0x470d5a=_0x43d4ee[_0x26d1fb(0x1f0)](0x1),_0x1dbd83=await _0x56f518[_0x26d1fb(0x231)](_0x470d5a,_0x26d1fb(0x2dd));_0x22fb70=JSON[_0x26d1fb(0x2d8)](_0x1dbd83);}else _0x22fb70=JSON[_0x26d1fb(0x2d8)](_0x43d4ee);}catch{return console[_0x26d1fb(0x235)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x118a8d[_0x26d1fb(0x35c)]){if(!isInteractive())return console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x225)](_0x26d1fb(0x391)),_0x26d1fb(0x2d2)),console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x2e9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2fd649=await confirmKey(_0x26d1fb(0x31e)+(_0x2ab40a?_0x26d1fb(0x34b):_0x26d1fb(0x359))+'\x20'+_0xd976d0+'?');if(!_0x2fd649)return console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x28d)](_0x26d1fb(0x375))),0x1;}let _0x2774a5;_0x2ab40a?_0x2774a5=await withSpinner(_0x26d1fb(0x289),()=>_0x4c1586[_0x26d1fb(0x2ab)]['retrySession'](_0xd976d0,{'fromTask':_0x25c8b9,'retryParams':_0x22fb70}),{'verbose':_0x118a8d[_0x26d1fb(0x399)]}):_0x2774a5=await withSpinner('Retrying\x20attempt...',()=>_0x4c1586['workflow']['retryAttempt'](_0xd976d0,{'resumeFrom':_0xe76489,'retryParams':_0x22fb70,'force':_0x216bf0}),{'verbose':_0x118a8d[_0x26d1fb(0x399)]});const _0xf25ea4=_0x2774a5[_0x26d1fb(0x36f)];return console[_0x26d1fb(0x235)](_0x26d1fb(0x29c)),console[_0x26d1fb(0x235)](_0x26d1fb(0x1f9)+_0xf25ea4['attemptId']),console[_0x26d1fb(0x235)](_0x26d1fb(0x2a8)+_0xf25ea4[_0x26d1fb(0x2ea)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x287);['description']=a54_0x130479(0x35f);async[a54_0x130479(0x22a)](_0x251658){const _0x4a1020=a54_0x130479,{options:_0x15421f,args:_0x2340cb,tdx:_0x1a26ed}=_0x251658;let _0x401d99=_0x2340cb[0x0];if(!_0x401d99){const _0x1b03ff=this[_0x4a1020(0x2ca)]([],_0x15421f),_0x81439a=await withSpinner(_0x4a1020(0x2c7),()=>_0x1a26ed[_0x4a1020(0x2ab)][_0x4a1020(0x206)](_0x1b03ff,{'limit':_0x15421f[_0x4a1020(0x341)]}),{'verbose':_0x15421f[_0x4a1020(0x399)]}),_0x3df4a5=_0x81439a[_0x4a1020(0x36f)];if(_0x3df4a5[_0x4a1020(0x273)]===0x0)return console[_0x4a1020(0x235)](_0x4a1020(0x2b9)),!_0x1b03ff&&console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x2e9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x252617=_0x3df4a5[_0x4a1020(0x263)](_0x27246e=>({'title':_0x27246e['project']?.[_0x4a1020(0x27b)]+'.'+_0x27246e[_0x4a1020(0x27b)],'value':_0x27246e[_0x4a1020(0x298)]?.['name']+'.'+_0x27246e[_0x4a1020(0x27b)],'description':_0x27246e['revision']?_0x4a1020(0x29d)+_0x27246e[_0x4a1020(0x242)]:undefined})),_0x43f5ff=await a54_0x4e32c8({'type':_0x4a1020(0x2f9),'name':_0x4a1020(0x2ab),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x252617});if(!_0x43f5ff[_0x4a1020(0x2ab)])return 0x1;_0x401d99=_0x43f5ff[_0x4a1020(0x2ab)];}if(!_0x401d99[_0x4a1020(0x238)]('.')){const _0x417b25=this[_0x4a1020(0x2ca)]([],_0x15421f);if(_0x417b25)_0x401d99=_0x417b25+'.'+_0x401d99;else return console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x225)]('Error:'),_0x4a1020(0x256)),console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x2e9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x3c528a=_0x15421f['param'],_0x278814=_0x15421f['sessionTime'],_0x2a8e7b={};if(_0x3c528a&&Array['isArray'](_0x3c528a))for(const _0x3af5e2 of _0x3c528a){const _0x598610=_0x3af5e2[_0x4a1020(0x3a4)]('=');if(_0x598610===-0x1)return console[_0x4a1020(0x235)](_0x4a1020(0x202)+_0x3af5e2),console['error'](_0x4a1020(0x340)),0x1;const _0x40e158=_0x3af5e2[_0x4a1020(0x1f0)](0x0,_0x598610),_0x1b70d7=_0x3af5e2['substring'](_0x598610+0x1);try{_0x2a8e7b[_0x40e158]=JSON[_0x4a1020(0x2d8)](_0x1b70d7);}catch{_0x2a8e7b[_0x40e158]=_0x1b70d7;}}_0x15421f[_0x4a1020(0x399)]&&(console[_0x4a1020(0x235)](_0x4a1020(0x291)+_0x401d99),Object['keys'](_0x2a8e7b)[_0x4a1020(0x273)]>0x0&&console[_0x4a1020(0x235)](_0x4a1020(0x2cd)+JSON[_0x4a1020(0x244)](_0x2a8e7b)),_0x278814&&console[_0x4a1020(0x235)](_0x4a1020(0x339)+_0x278814));const _0x17bada=await withSpinner(_0x4a1020(0x233),()=>_0x1a26ed['workflow'][_0x4a1020(0x203)](_0x401d99,_0x2a8e7b,{'sessionTime':_0x278814}),{'verbose':_0x15421f['verbose']}),_0x28b7e9=_0x17bada[_0x4a1020(0x36f)];console[_0x4a1020(0x235)]('✔\x20Workflow\x20run\x20started'),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x28b7e9['id']),console[_0x4a1020(0x235)](_0x4a1020(0x2a8)+_0x28b7e9[_0x4a1020(0x2ea)]),console[_0x4a1020(0x235)](_0x4a1020(0x23e)+_0x28b7e9[_0x4a1020(0x298)]?.['name']),console[_0x4a1020(0x235)](_0x4a1020(0x26d)+_0x28b7e9['workflow']?.['name']);if(_0x28b7e9[_0x4a1020(0x298)]?.['id']&&_0x28b7e9[_0x4a1020(0x2ea)]&&_0x28b7e9['id']){const _0x1156e0=_0x15421f[_0x4a1020(0x25c)],_0x1b8a7e=getConsoleUrl(_0x1156e0,_0x4a1020(0x345)+_0x28b7e9[_0x4a1020(0x298)]['id']+_0x4a1020(0x3a6)+_0x28b7e9['sessionId']+'/attempt/'+_0x28b7e9['id']);console[_0x4a1020(0x235)](_0x4a1020(0x2f1)+a54_0x47fe92['cyan'](_0x1b8a7e));}return 0x0;}}function a54_0x5811(_0x245546,_0x1b4d86){_0x245546=_0x245546-0x1e6;const _0x2dfb40=a54_0x2dfb();let _0x5811c3=_0x2dfb40[_0x245546];return _0x5811c3;}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x210);[a54_0x130479(0x376)]=a54_0x130479(0x2dc);async[a54_0x130479(0x22a)](_0x5d5dc1){const _0x282127=a54_0x130479,{options:_0x1117f0,args:_0x26a919,tdx:_0x16bfa1}=_0x5d5dc1,_0x5d13ea=_0x26a919[0x0],_0x291f0a=_0x26a919[0x1]||'.';if(!_0x5d13ea)return console[_0x282127(0x235)](_0x282127(0x20a)),console[_0x282127(0x235)](_0x282127(0x237)),0x1;const _0x20d077=_0x1117f0['revision'];_0x1117f0[_0x282127(0x399)]&&(console[_0x282127(0x235)]('Project:\x20'+_0x5d13ea),console[_0x282127(0x235)]('Output\x20directory:\x20'+_0x291f0a),_0x20d077&&console[_0x282127(0x235)](_0x282127(0x267)+_0x20d077));const _0x2a854d=await withSpinner(_0x282127(0x264)+_0x5d13ea+'...',()=>_0x16bfa1[_0x282127(0x2ab)]['download'](_0x5d13ea,_0x291f0a,{'revision':_0x20d077}),{'verbose':_0x1117f0[_0x282127(0x399)]}),_0x499d40=_0x2a854d['data'];return console[_0x282127(0x235)](_0x282127(0x347)+_0x499d40['projectName']),console[_0x282127(0x235)](_0x282127(0x395)+_0x499d40['revision']),console[_0x282127(0x235)](_0x282127(0x243)+_0x499d40[_0x282127(0x28c)]),console['error'](_0x282127(0x2cc)+_0x291f0a+'/'+_0x499d40['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x2fd);[a54_0x130479(0x376)]=a54_0x130479(0x24c);async[a54_0x130479(0x22a)](_0x5cc06c){const _0x454bdf=a54_0x130479,{options:_0x5802f2,args:_0x342671,tdx:_0x51fd04}=_0x5cc06c;let _0x444c71='.',_0x10a218=_0x5802f2[_0x454bdf(0x27b)];if(_0x342671[0x0]){const {promises:_0x2a3716}=await import('fs');try{const _0x43f9a7=await _0x2a3716['stat'](_0x342671[0x0]);if(_0x43f9a7[_0x454bdf(0x285)]())_0x444c71=_0x342671[0x0];else return console[_0x454bdf(0x235)](_0x454bdf(0x33d)+_0x342671[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x10a218=_0x342671[0x0],_0x444c71='.';}}const _0x433cc8=_0x5802f2[_0x454bdf(0x242)],_0x27c61b=_0x5802f2[_0x454bdf(0x26f)];_0x5802f2[_0x454bdf(0x399)]&&(console[_0x454bdf(0x235)](_0x454bdf(0x2ce)+_0x444c71),_0x10a218&&console[_0x454bdf(0x235)](_0x454bdf(0x394)+_0x10a218),_0x433cc8&&console[_0x454bdf(0x235)](_0x454bdf(0x267)+_0x433cc8),_0x27c61b&&console[_0x454bdf(0x235)](_0x454bdf(0x306)));const _0x2a4b11=await withSpinner(_0x454bdf(0x2e5),()=>_0x51fd04[_0x454bdf(0x2ab)]['push'](_0x444c71,{'projectName':_0x10a218,'revision':_0x433cc8,'skipValidation':_0x27c61b}),{'verbose':_0x5802f2['verbose']}),_0x104d3d=_0x2a4b11[_0x454bdf(0x36f)];return console[_0x454bdf(0x235)](_0x454bdf(0x1fa)+_0x104d3d[_0x454bdf(0x2d1)]),console[_0x454bdf(0x235)]('\x20\x20Project\x20ID:\x20'+_0x104d3d[_0x454bdf(0x308)]),console['error'](_0x454bdf(0x395)+_0x104d3d[_0x454bdf(0x242)]),await this[_0x454bdf(0x2e4)](_0x51fd04,_0x104d3d[_0x454bdf(0x2d1)],_0x5802f2[_0x454bdf(0x25c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x29f);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x130479(0x22a)](_0x11cc71){const _0xced934=a54_0x130479,{options:_0x12035b,args:_0x89762b,tdx:_0x4a0c08}=_0x11cc71,_0x4165be=_0x89762b[0x0],_0x523d60=_0x89762b[0x1];if(!_0x4165be)return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x225)]('Error:'),_0xced934(0x302)),console[_0xced934(0x235)](a54_0x47fe92['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x1ee7fd=_0x12035b[_0xced934(0x242)];_0x12035b[_0xced934(0x399)]&&(console[_0xced934(0x235)](_0xced934(0x28b)+_0x4165be),_0x523d60&&console[_0xced934(0x235)]('Target\x20directory:\x20'+_0x523d60),_0x1ee7fd&&console[_0xced934(0x235)](_0xced934(0x267)+_0x1ee7fd),_0x12035b[_0xced934(0x2cf)]&&console['error'](_0xced934(0x2fe)));const _0x4ec67d=await withSpinner('Pulling\x20project\x20'+_0x4165be+'...',()=>_0x4a0c08[_0xced934(0x2ab)][_0xced934(0x284)](_0x4165be,{'targetDir':_0x523d60,'revision':_0x1ee7fd}),{'verbose':_0x12035b[_0xced934(0x399)]}),_0x48af75=_0x4ec67d['data'];_0x48af75[_0xced934(0x29a)]?console['error']('→\x20New\x20project:\x20'+_0x48af75[_0xced934(0x2d1)]):console[_0xced934(0x235)]('→\x20Project:\x20'+_0x48af75['projectName']);console[_0xced934(0x235)]('\x20\x20Revision:\x20'+_0x48af75[_0xced934(0x242)]),console[_0xced934(0x235)](_0xced934(0x321)+(a54_0x5d886b['relative'](process[_0xced934(0x2fc)](),_0x48af75[_0xced934(0x25e)])||'.')),console[_0xced934(0x235)]('\x20\x20Changes:\x20'+a54_0x47fe92[_0xced934(0x2b5)]('+'+_0x48af75[_0xced934(0x27c)]['new']+_0xced934(0x332))+',\x20'+(a54_0x47fe92[_0xced934(0x28d)]('~'+_0x48af75[_0xced934(0x27c)][_0xced934(0x2d9)]+_0xced934(0x281))+',\x20')+(a54_0x47fe92['red']('-'+_0x48af75[_0xced934(0x27c)][_0xced934(0x384)]+_0xced934(0x30b))+',\x20')+(''+a54_0x47fe92[_0xced934(0x2e9)](_0x48af75['summary'][_0xced934(0x386)]+_0xced934(0x1ee))));for(const _0x570155 of _0x48af75[_0xced934(0x3a7)]){_0x570155[_0xced934(0x2c3)]===_0xced934(0x2d9)&&_0x570155[_0xced934(0x39d)]&&(console[_0xced934(0x235)]('\x0a'+a54_0x47fe92[_0xced934(0x2c4)]('---\x20'+_0x570155[_0xced934(0x2f4)])),console[_0xced934(0x235)](_0x570155[_0xced934(0x39d)]));}if(!_0x48af75[_0xced934(0x269)])return saveSessionContext({'workflow_project':_0x48af75['projectName']},_0x12035b[_0xced934(0x34b)]),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2b5)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x388)+_0x48af75[_0xced934(0x2d1)])),0x0;if(_0x12035b[_0xced934(0x2cf)])return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x28d)](_0xced934(0x2e1))),0x0;if(!_0x12035b[_0xced934(0x35c)]){if(!isInteractive())return console['error'](a54_0x47fe92[_0xced934(0x225)](_0xced934(0x391)),_0xced934(0x2d2)),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x344))),0x1;const _0x3be46f=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x3be46f)return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x28d)](_0xced934(0x375)),_0xced934(0x299)),0x1;}await withSpinner(_0xced934(0x1ff),()=>_0x4a0c08[_0xced934(0x2ab)][_0xced934(0x292)](_0x48af75,{'revision':_0x1ee7fd}),{'verbose':_0x12035b[_0xced934(0x399)]}),saveSessionContext({'workflow_project':_0x48af75[_0xced934(0x2d1)]},_0x12035b[_0xced934(0x34b)]),console['error'](a54_0x47fe92[_0xced934(0x2b5)](_0xced934(0x370)));const _0x10a4ef=a54_0x5d886b[_0xced934(0x2ff)](process[_0xced934(0x2fc)](),_0x48af75[_0xced934(0x25e)])||'.';return console['error'](a54_0x47fe92['dim'](_0xced934(0x2cc)+_0x10a4ef)),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x388)+_0x48af75[_0xced934(0x2d1)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x2df);['description']=a54_0x130479(0x232);async[a54_0x130479(0x22a)](_0x187481){const _0xa2986c=a54_0x130479,{options:_0x45fb58,args:_0x31d52d,tdx:_0x203beb}=_0x187481,_0x43404b=this[_0xa2986c(0x2d5)](_0x31d52d,_0x45fb58),_0x1941d2=_0x45fb58[_0xa2986c(0x242)],_0x3a894d=_0x45fb58[_0xa2986c(0x26f)];_0x45fb58['verbose']&&(_0x43404b&&console[_0xa2986c(0x235)](_0xa2986c(0x2da)+_0x43404b),_0x1941d2&&console[_0xa2986c(0x235)](_0xa2986c(0x267)+_0x1941d2),_0x45fb58[_0xa2986c(0x2cf)]&&console[_0xa2986c(0x235)](_0xa2986c(0x2fe)),_0x3a894d&&console[_0xa2986c(0x235)](_0xa2986c(0x306)));let _0x377753;try{_0x377753=await withSpinner('Analyzing\x20changes...',()=>_0x203beb[_0xa2986c(0x2ab)][_0xa2986c(0x2ee)]({'sourceDir':_0x43404b,'revision':_0x1941d2,'skipValidation':_0x3a894d}),{'verbose':_0x45fb58[_0xa2986c(0x399)]});}catch(_0x5cadee){if(_0x5cadee instanceof Error&&_0x5cadee[_0xa2986c(0x20e)]['includes'](_0xa2986c(0x297)))return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x225)](_0xa2986c(0x25d)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x45fb58['workflowProject']?console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x397)+_0x45fb58['workflowProject']+_0xa2986c(0x30e)+_0x45fb58[_0xa2986c(0x37d)]+'\x27')):console['error'](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x32a))),0x1;throw _0x5cadee;}const _0x50b8fb=_0x377753[_0xa2986c(0x36f)];console['error'](_0xa2986c(0x1f5)+_0x50b8fb[_0xa2986c(0x2d1)]),console['error'](_0xa2986c(0x2ae)+_0x50b8fb[_0xa2986c(0x2c5)]),console[_0xa2986c(0x235)](_0xa2986c(0x395)+_0x50b8fb[_0xa2986c(0x242)]),console[_0xa2986c(0x235)]('\x20\x20Changes:\x20'+a54_0x47fe92[_0xa2986c(0x2b5)]('+'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x372)]+_0xa2986c(0x332))+',\x20'+(a54_0x47fe92[_0xa2986c(0x28d)]('~'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x2d9)]+_0xa2986c(0x281))+',\x20')+(a54_0x47fe92['red']('-'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x384)]+_0xa2986c(0x30b))+',\x20')+(''+a54_0x47fe92[_0xa2986c(0x2e9)](_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x386)]+'\x20unchanged')));for(const _0x44fdcd of _0x50b8fb[_0xa2986c(0x3a7)]){_0x44fdcd[_0xa2986c(0x2c3)]==='modified'&&_0x44fdcd['diff']&&(console[_0xa2986c(0x235)]('\x0a'+a54_0x47fe92[_0xa2986c(0x2c4)](_0xa2986c(0x21c)+_0x44fdcd[_0xa2986c(0x2f4)])),console[_0xa2986c(0x235)](_0x44fdcd[_0xa2986c(0x39d)]));}if(!_0x50b8fb[_0xa2986c(0x269)])return console[_0xa2986c(0x235)](a54_0x47fe92['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0xa2986c(0x2e4)](_0x203beb,_0x50b8fb['projectName'],_0x45fb58[_0xa2986c(0x25c)]),0x0;if(_0x45fb58['dryRun'])return console[_0xa2986c(0x235)](a54_0x47fe92['yellow'](_0xa2986c(0x360))),0x0;if(!_0x45fb58[_0xa2986c(0x35c)]){if(!isInteractive())return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x225)](_0xa2986c(0x391)),_0xa2986c(0x2d2)),console['error'](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x344))),0x1;const _0x2efeb4=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2efeb4)return console['error'](a54_0x47fe92[_0xa2986c(0x28d)](_0xa2986c(0x375)),_0xa2986c(0x338)),0x1;}const _0x7fd555=await withSpinner('Pushing\x20project...',()=>_0x203beb[_0xa2986c(0x2ab)][_0xa2986c(0x229)](_0x50b8fb),{'verbose':_0x45fb58[_0xa2986c(0x399)]}),_0x1a7f15=_0x7fd555[_0xa2986c(0x36f)];return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x2b5)](_0xa2986c(0x239))),console['error'](_0xa2986c(0x31c)+_0x1a7f15[_0xa2986c(0x308)]),console['error'](_0xa2986c(0x395)+_0x1a7f15[_0xa2986c(0x242)]),await this['showWorkflowConsoleUrl'](_0x203beb,_0x1a7f15['projectName'],_0x45fb58[_0xa2986c(0x25c)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x1e6);[a54_0x130479(0x376)]=a54_0x130479(0x2c6);async[a54_0x130479(0x22a)](_0x3b3575){const _0x5cdc4e=a54_0x130479,{options:_0x4b8e84,args:_0x138b69,tdx:_0xa01939}=_0x3b3575,_0x180ded=this['resolveProjectDir'](_0x138b69,_0x4b8e84),_0x464ce5=_0x4b8e84[_0x5cdc4e(0x27b)],_0x1c2305=_0x4b8e84[_0x5cdc4e(0x242)],_0x57f622=_0x4b8e84[_0x5cdc4e(0x26f)];if(!_0x180ded)return console['error'](a54_0x47fe92[_0x5cdc4e(0x225)](_0x5cdc4e(0x25d)),_0x5cdc4e(0x336)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x305))),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x38f))),0x1;if(!_0x464ce5)return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x225)]('Error:'),_0x5cdc4e(0x35b)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x305))),0x1;_0x4b8e84[_0x5cdc4e(0x399)]&&(console[_0x5cdc4e(0x235)]('Source\x20directory:\x20'+_0x180ded),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x353)+_0x464ce5),_0x1c2305&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x267)+_0x1c2305),_0x4b8e84['dryRun']&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x2fe)),_0x57f622&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x306)));const _0x3033e5=await withSpinner('Analyzing\x20project...',()=>_0xa01939[_0x5cdc4e(0x2ab)][_0x5cdc4e(0x27e)](_0x180ded,_0x464ce5,{'revision':_0x1c2305,'skipValidation':_0x57f622}),{'verbose':_0x4b8e84[_0x5cdc4e(0x399)]}),_0x191305=_0x3033e5[_0x5cdc4e(0x36f)];console[_0x5cdc4e(0x235)](_0x5cdc4e(0x379)+_0x191305[_0x5cdc4e(0x2c5)]);_0x191305[_0x5cdc4e(0x1ed)]&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x368)+_0x191305[_0x5cdc4e(0x1ed)]);console[_0x5cdc4e(0x235)](_0x5cdc4e(0x353)+_0x191305['newProjectName']),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x267)+_0x191305[_0x5cdc4e(0x242)]),console['error'](_0x5cdc4e(0x2d4)+_0x191305[_0x5cdc4e(0x326)]);_0x191305['targetExists']&&(console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x28d)](_0x5cdc4e(0x2b7)+_0x191305[_0x5cdc4e(0x2e3)]+_0x5cdc4e(0x2ac)+_0x191305['existingProjectId']+')')),console[_0x5cdc4e(0x235)](a54_0x47fe92['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x4b8e84[_0x5cdc4e(0x2cf)])return console['error'](a54_0x47fe92['yellow'](_0x5cdc4e(0x1e8))),0x0;if(!_0x4b8e84[_0x5cdc4e(0x35c)]){if(!isInteractive())return console['error'](a54_0x47fe92[_0x5cdc4e(0x225)]('\x0aError:'),_0x5cdc4e(0x2d2)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x344))),0x1;const _0x4bca71=_0x191305[_0x5cdc4e(0x1ed)]||a54_0x5d886b['basename'](_0x180ded),_0x42bf2=_0x191305[_0x5cdc4e(0x2c2)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x464ce5+'\x22\x20with\x20new\x20revision?':_0x5cdc4e(0x283)+_0x4bca71+_0x5cdc4e(0x2be)+_0x464ce5+'\x22?',_0x79e1e2=await confirmKey(_0x42bf2);if(!_0x79e1e2)return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x28d)]('Cancelled')),0x1;}const _0x34fb41=await withSpinner(_0x191305[_0x5cdc4e(0x2c2)]?_0x5cdc4e(0x36b)+_0x464ce5+_0x5cdc4e(0x2d6):_0x5cdc4e(0x34e)+_0x464ce5+'...',()=>_0xa01939['workflow']['executeCloneProject'](_0x191305),{'verbose':_0x4b8e84[_0x5cdc4e(0x399)]}),_0x369197=_0x34fb41['data'];return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2b5)](_0x191305[_0x5cdc4e(0x2c2)]?_0x5cdc4e(0x290):'✔\x20Clone\x20complete')),console[_0x5cdc4e(0x235)]('\x20\x20Project:\x20'+_0x369197['newProjectName']),console['error'](_0x5cdc4e(0x31c)+_0x369197[_0x5cdc4e(0x24a)]),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x395)+_0x369197['revision']),await this['showWorkflowConsoleUrl'](_0xa01939,_0x369197['newProjectName'],_0x4b8e84['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x330);[a54_0x130479(0x376)]=a54_0x130479(0x37a);async[a54_0x130479(0x22a)](_0x3b123f){const _0x390ba8=a54_0x130479,{options:_0x433c99,args:_0x4a68b2,tdx:_0x5380a7}=_0x3b123f,_0x511d46=_0x4a68b2[0x0];if(!_0x511d46)return console['error'](_0x390ba8(0x2f7)),console[_0x390ba8(0x235)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x433c99[_0x390ba8(0x399)]&&console[_0x390ba8(0x235)](_0x390ba8(0x28b)+_0x511d46);if(!_0x433c99['yes']){if(!isInteractive())return console[_0x390ba8(0x235)](a54_0x47fe92['red'](_0x390ba8(0x391)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x390ba8(0x235)](a54_0x47fe92['dim'](_0x390ba8(0x344))),0x1;const _0x19acae=await confirmKey(_0x390ba8(0x354)+_0x511d46+_0x390ba8(0x35d));if(!_0x19acae)return console[_0x390ba8(0x235)](a54_0x47fe92[_0x390ba8(0x28d)](_0x390ba8(0x375))),0x1;}const _0x38be97=await withSpinner(_0x390ba8(0x266)+_0x511d46+'...',()=>_0x5380a7[_0x390ba8(0x2ab)][_0x390ba8(0x2b1)](_0x511d46),{'verbose':_0x433c99[_0x390ba8(0x399)]}),_0xeb233d=_0x38be97[_0x390ba8(0x36f)];return console[_0x390ba8(0x235)]('✔\x20Deleted\x20project\x20'+_0xeb233d[_0x390ba8(0x2d1)]),console[_0x390ba8(0x235)](_0x390ba8(0x31c)+_0xeb233d[_0x390ba8(0x308)]),0x0;}}export function parseKeyValue(_0x4b9463){const _0x17d51d=a54_0x130479,_0x82de9=_0x4b9463[_0x17d51d(0x3a4)]('=');if(_0x82de9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4b9463+_0x17d51d(0x2af));const _0x34fd9c=_0x4b9463[_0x17d51d(0x1f0)](0x0,_0x82de9),_0x66833c=_0x4b9463['substring'](_0x82de9+0x1);if(!_0x34fd9c)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x34fd9c,'value':_0x66833c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x253);[a54_0x130479(0x376)]=a54_0x130479(0x2f2);async[a54_0x130479(0x22a)](_0x256177){const _0x589bba=a54_0x130479,{options:_0x4d8891,args:_0x334331,tdx:_0x56e716}=_0x256177,_0x5e3cce=this['requireProject'](_0x334331,_0x4d8891);if(!_0x5e3cce)return 0x1;_0x4d8891['verbose']&&console[_0x589bba(0x235)]('Project:\x20'+_0x5e3cce);const _0x54ed24=await withSpinner(_0x589bba(0x31d),()=>_0x56e716['workflow'][_0x589bba(0x2a7)](_0x5e3cce),{'verbose':_0x4d8891['verbose']}),{secrets:_0x45b6ba}=_0x54ed24[_0x589bba(0x36f)];return console[_0x589bba(0x235)](_0x589bba(0x393)+_0x45b6ba['length']+_0x589bba(0x222)+(_0x45b6ba['length']!==0x1?'s':'')),await handleSDKOutput(_0x45b6ba,_0x4d8891),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x300);['description']=a54_0x130479(0x2b2);async['execute'](_0x15c505){const _0x37c05f=a54_0x130479,{options:_0x3b35f2,args:_0xddeaa7,tdx:_0x155a02}=_0x15c505;let _0x17ba4c,_0x40a824;if(_0xddeaa7[_0x37c05f(0x273)]>=0x1&&!_0xddeaa7[0x0]['includes']('='))_0x17ba4c=_0xddeaa7[0x0],_0x40a824=_0xddeaa7[_0x37c05f(0x319)](0x1);else{if(_0xddeaa7[_0x37c05f(0x273)]>=0x1&&_0x3b35f2[_0x37c05f(0x37d)])_0x17ba4c=_0x3b35f2[_0x37c05f(0x37d)],_0x40a824=_0xddeaa7;else return _0xddeaa7['length']>=0x1?(console[_0x37c05f(0x235)](_0x37c05f(0x20a)),console[_0x37c05f(0x235)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x37c05f(0x235)](_0x37c05f(0x36e)),console[_0x37c05f(0x235)](_0x37c05f(0x282)),0x1);}if(_0x40a824[_0x37c05f(0x273)]===0x0)return console[_0x37c05f(0x235)](_0x37c05f(0x36e)),console[_0x37c05f(0x235)](_0x37c05f(0x282)),0x1;const _0x33a39f={};try{for(const _0x348b4d of _0x40a824){const {key:_0x23fb3c,value:_0x194d42}=parseKeyValue(_0x348b4d);_0x33a39f[_0x23fb3c]=_0x194d42;}}catch(_0x1faaae){return _0x1faaae instanceof Error&&console[_0x37c05f(0x235)](a54_0x47fe92[_0x37c05f(0x225)](_0x37c05f(0x25d)),_0x1faaae[_0x37c05f(0x20e)]),0x1;}const _0xc8bd37=Object[_0x37c05f(0x226)](_0x33a39f);_0x3b35f2[_0x37c05f(0x399)]&&(console[_0x37c05f(0x235)](_0x37c05f(0x28b)+_0x17ba4c),console[_0x37c05f(0x235)](_0x37c05f(0x26b)+_0xc8bd37[_0x37c05f(0x211)](',\x20')));const _0x6e3f37=await withSpinner(_0xc8bd37[_0x37c05f(0x273)]===0x1?_0x37c05f(0x39c):_0x37c05f(0x255)+_0xc8bd37[_0x37c05f(0x273)]+_0x37c05f(0x295),()=>_0x155a02[_0x37c05f(0x2ab)][_0x37c05f(0x258)](_0x17ba4c,_0x33a39f),{'verbose':_0x3b35f2['verbose']}),_0x3ef8e7=_0x6e3f37[_0x37c05f(0x36f)];return console[_0x37c05f(0x235)](_0xc8bd37['length']===0x1?_0x37c05f(0x2a3)+_0x3ef8e7[_0x37c05f(0x226)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x3ef8e7[_0x37c05f(0x2d1)]+'\x27':'✔\x20'+_0x3ef8e7['keys']['length']+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x3ef8e7[_0x37c05f(0x2d1)]+'\x27'),(_0x3b35f2['json']||_0x3b35f2['jsonl'])&&await handleSingleObjectOutput(_0x3ef8e7,_0x3b35f2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x20f);['description']=a54_0x130479(0x223);async[a54_0x130479(0x22a)](_0x3b63c3){const _0x54a0c5=a54_0x130479,{options:_0x9f643e,args:_0x3b4671,tdx:_0x438bbd}=_0x3b63c3;let _0x2c29e5,_0x5c1cc6;if(_0x3b4671['length']>=0x2)_0x2c29e5=_0x3b4671[0x0],_0x5c1cc6=_0x3b4671[0x1];else{if(_0x3b4671[_0x54a0c5(0x273)]===0x1&&_0x9f643e['workflowProject'])_0x2c29e5=_0x9f643e[_0x54a0c5(0x37d)],_0x5c1cc6=_0x3b4671[0x0];else return _0x3b4671[_0x54a0c5(0x273)]===0x1?(console[_0x54a0c5(0x235)](_0x54a0c5(0x20a)),console[_0x54a0c5(0x235)](_0x54a0c5(0x277)),0x1):(console['error'](_0x54a0c5(0x2b8)),console[_0x54a0c5(0x235)](_0x54a0c5(0x23c)),0x1);}_0x9f643e['verbose']&&(console[_0x54a0c5(0x235)]('Project:\x20'+_0x2c29e5),console[_0x54a0c5(0x235)](_0x54a0c5(0x38d)+_0x5c1cc6));if(!_0x9f643e['yes']){if(!isInteractive())return console[_0x54a0c5(0x235)](a54_0x47fe92[_0x54a0c5(0x225)]('\x0aError:'),_0x54a0c5(0x2d2)),console[_0x54a0c5(0x235)](a54_0x47fe92['dim'](_0x54a0c5(0x344))),0x1;const _0x304639=await confirmKey(_0x54a0c5(0x2f3)+_0x5c1cc6+'\x27\x20from\x20project\x20\x27'+_0x2c29e5+'\x27?');if(!_0x304639)return console[_0x54a0c5(0x235)](a54_0x47fe92[_0x54a0c5(0x28d)]('Cancelled')),0x1;}const _0x5e11c6=await withSpinner(_0x54a0c5(0x333),()=>_0x438bbd[_0x54a0c5(0x2ab)][_0x54a0c5(0x251)](_0x2c29e5,_0x5c1cc6),{'verbose':_0x9f643e['verbose']}),_0x3b83ee=_0x5e11c6[_0x54a0c5(0x36f)];return console[_0x54a0c5(0x235)](_0x54a0c5(0x2a3)+_0x3b83ee[_0x54a0c5(0x241)]+_0x54a0c5(0x1fc)+_0x3b83ee['projectName']+'\x27'),(_0x9f643e[_0x54a0c5(0x309)]||_0x9f643e[_0x54a0c5(0x2cb)])&&await handleSingleObjectOutput(_0x3b83ee,_0x9f643e),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(_0xe40372){const _0x254f05=a54_0x130479,_0xca2393=Math['floor'](_0xe40372/0x3e8),_0x488329=Math[_0x254f05(0x37c)](_0xca2393/0x3c),_0x54ff87=Math['floor'](_0x488329/0x3c),_0x13e762=Math[_0x254f05(0x37c)](_0x54ff87/0x18);if(_0x13e762>0x0){const _0x4dff25=_0x54ff87%0x18;return _0x4dff25>0x0?_0x13e762+'d\x20'+_0x4dff25+'h':_0x13e762+'d';}else{if(_0x54ff87>0x0){const _0x28565d=_0x488329%0x3c;return _0x28565d>0x0?_0x54ff87+'h\x20'+_0x28565d+'m':_0x54ff87+'h';}else{if(_0x488329>0x0){const _0x427b13=_0xca2393%0x3c;return _0x427b13>0x0?_0x488329+'m\x20'+_0x427b13+'s':_0x488329+'m';}else return _0xca2393+'s';}}}function formatTimestamp(_0x497115,_0x472944){const _0x4cbe21=a54_0x130479,_0x14e305=new Date(_0x497115),_0x5dd7ac=String(_0x14e305['getHours']())['padStart'](0x2,'0'),_0x1ef34b=String(_0x14e305['getMinutes']())['padStart'](0x2,'0'),_0x336677=_0x5dd7ac+':'+_0x1ef34b,_0x3ab553=_0x14e305[_0x4cbe21(0x2e2)]()===_0x472944[_0x4cbe21(0x2e2)]()&&_0x14e305[_0x4cbe21(0x213)]()===_0x472944[_0x4cbe21(0x213)]()&&_0x14e305[_0x4cbe21(0x2bc)]()===_0x472944[_0x4cbe21(0x2bc)]();if(_0x3ab553)return _0x336677;else{const _0x7c75d2=String(_0x14e305[_0x4cbe21(0x213)]()+0x1)[_0x4cbe21(0x33a)](0x2,'0'),_0x45e2db=String(_0x14e305[_0x4cbe21(0x2bc)]())['padStart'](0x2,'0');return _0x7c75d2+'-'+_0x45e2db+'\x20'+_0x336677;}}function formatDate(_0xc95c54){const _0x57a5fd=a54_0x130479,_0xeae70=_0xc95c54[_0x57a5fd(0x2e2)](),_0x3fff5b=String(_0xc95c54[_0x57a5fd(0x213)]()+0x1)[_0x57a5fd(0x33a)](0x2,'0'),_0x5b5a6b=String(_0xc95c54['getDate']())[_0x57a5fd(0x33a)](0x2,'0');return _0xeae70+'-'+_0x3fff5b+'-'+_0x5b5a6b;}function getTaskStateIcon(_0x123144){const _0x432ee7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x432ee7[_0x123144]||'⚪';}function getBarChar(_0x2c25d3){const _0x4eaf37=a54_0x130479;return _0x2c25d3==='error'||_0x2c25d3===_0x4eaf37(0x2de)?'×':'─';}function getBarColor(_0x57fb88){const _0x969b9=a54_0x130479,_0x240b89={'success':a54_0x47fe92[_0x969b9(0x2b5)],'error':a54_0x47fe92[_0x969b9(0x225)],'group_error':a54_0x47fe92[_0x969b9(0x225)],'running':a54_0x47fe92[_0x969b9(0x215)],'blocked':a54_0x47fe92[_0x969b9(0x28d)],'planned':a54_0x47fe92[_0x969b9(0x2e9)],'canceling':a54_0x47fe92[_0x969b9(0x28d)]};return _0x240b89[_0x57fb88]||a54_0x47fe92[_0x969b9(0x259)];}function parseTaskName(_0x55ee76){const _0x50f375=a54_0x130479;let _0x403478=_0x55ee76[_0x50f375(0x220)](/^\++/,'');const _0x2681e9=_0x403478['split']('+'),_0x15b985=_0x2681e9[_0x50f375(0x273)]>0x1?_0x2681e9[_0x50f375(0x273)]-0x2:0x0,_0x51dcf8=_0x2681e9[_0x2681e9[_0x50f375(0x273)]-0x1]||_0x403478;return{'level':_0x15b985,'name':'+'+_0x51dcf8};}function truncateTaskName(_0x55ce43,_0x5710e9){const _0x4839c0=a54_0x130479,_0x409db0=stringWidth(_0x55ce43);if(_0x409db0<=_0x5710e9)return _0x55ce43;let _0x22547b=_0x55ce43;while(stringWidth(_0x22547b+'…')>_0x5710e9&&_0x22547b[_0x4839c0(0x273)]>0x0){_0x22547b=_0x22547b['slice'](0x0,-0x1);}return _0x22547b+'…';}function calculateTimeScale(_0x3c753a,_0x2a02bc){const _0x14d473=a54_0x130479;return{'startTime':_0x3c753a[_0x14d473(0x2aa)],'endTime':_0x3c753a[_0x14d473(0x2eb)],'durationMs':_0x3c753a[_0x14d473(0x2ad)],'msPerChar':_0x3c753a[_0x14d473(0x2ad)]/_0x2a02bc};}function timeToPosition(_0x1b411c,_0x152057,_0x2d12e4){const _0x3d7d3f=a54_0x130479,_0x495c90=_0x1b411c-_0x152057['startTime'],_0x1d5a2b=Math[_0x3d7d3f(0x37c)](_0x495c90/_0x152057['msPerChar']);return Math['max'](0x0,Math[_0x3d7d3f(0x316)](_0x1d5a2b,_0x2d12e4));}function renderTimeAxis(_0x24df3e,_0x55a04f){const _0x3a4db0=a54_0x130479,_0x173e31=Math[_0x3a4db0(0x316)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x3a4db0(0x2b3)](TIMELINE_CONFIG[_0x3a4db0(0x27f)],Math['floor'](_0x55a04f/TIMELINE_CONFIG[_0x3a4db0(0x280)]))),_0x4615bc=_0x24df3e[_0x3a4db0(0x2b4)]/(_0x173e31-0x1),_0x3d1a73=new Date(_0x24df3e[_0x3a4db0(0x346)]),_0xa2e59c=[];for(let _0x542501=0x0;_0x542501<_0x173e31;_0x542501++){const _0x477ac8=_0x24df3e[_0x3a4db0(0x346)]+_0x542501*_0x4615bc,_0x5db18c=timeToPosition(_0x477ac8,_0x24df3e,_0x55a04f),_0x1304e5=formatTimestamp(_0x477ac8,_0x3d1a73);_0xa2e59c[_0x3a4db0(0x1ea)]({'pos':_0x5db18c,'text':_0x1304e5});}const _0x419634=new Array(_0x55a04f)[_0x3a4db0(0x315)]('\x20');let _0x33038e=-0x1;for(const {pos:_0x1cfce6,text:_0x32abaf}of _0xa2e59c){let _0x1e7381=Math[_0x3a4db0(0x2b3)](0x0,_0x1cfce6-Math[_0x3a4db0(0x37c)](_0x32abaf[_0x3a4db0(0x273)]/0x2));_0x1e7381<=_0x33038e+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x1e7381=_0x33038e+TIMELINE_CONFIG[_0x3a4db0(0x22b)]+0x1);_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]>_0x55a04f&&(_0x1e7381=_0x55a04f-_0x32abaf[_0x3a4db0(0x273)]);if(_0x1e7381>=0x0&&_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]<=_0x55a04f&&_0x1e7381>_0x33038e){for(let _0x407a04=0x0;_0x407a04<_0x32abaf[_0x3a4db0(0x273)];_0x407a04++){_0x419634[_0x1e7381+_0x407a04]=_0x32abaf[_0x407a04];}_0x33038e=_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]-0x1;}}return _0x419634[_0x3a4db0(0x211)]('');}function renderTaskRow(_0x21e58a,_0x384616,_0x564c46,_0x380558){const _0x2445eb=a54_0x130479,{level:_0x1e31e1,name:_0x376762}=parseTaskName(_0x21e58a[_0x2445eb(0x27b)]),_0x4a8eda='\x20'[_0x2445eb(0x2fa)](_0x1e31e1),_0x5b62cd=_0x21e58a[_0x2445eb(0x367)]?'('+formatElapsed(_0x21e58a[_0x2445eb(0x367)]['duration'])+')':'',_0x579dda=stringWidth(_0x5b62cd),_0x53b7f9=_0x1e31e1*0x1,_0x216128=_0x380558-_0x53b7f9-_0x579dda-0x1,_0x3fcd98=truncateTaskName(_0x376762,_0x216128),_0x229e53=_0x4a8eda+_0x3fcd98,_0x33a8f7=stringWidth(_0x229e53),_0x5f1840=_0x380558-_0x33a8f7-_0x579dda,_0x46480b=_0x229e53+'\x20'[_0x2445eb(0x2fa)](Math[_0x2445eb(0x2b3)](0x1,_0x5f1840))+a54_0x47fe92[_0x2445eb(0x2e9)](_0x5b62cd),_0x504844=getTaskStateIcon(_0x21e58a[_0x2445eb(0x260)]),_0x539c78=new Array(_0x564c46)[_0x2445eb(0x315)]('\x20');if(_0x21e58a['window']){const _0x2201ad=timeToPosition(_0x21e58a['window'][_0x2445eb(0x2aa)],_0x384616,_0x564c46),_0x38b8dc=timeToPosition(_0x21e58a[_0x2445eb(0x367)][_0x2445eb(0x2eb)],_0x384616,_0x564c46),_0x1264f0=getBarChar(_0x21e58a[_0x2445eb(0x260)]),_0x349280=Math[_0x2445eb(0x2b3)](_0x2201ad+0x1,_0x38b8dc);for(let _0x590a9f=_0x2201ad;_0x590a9f<Math[_0x2445eb(0x316)](_0x349280,_0x564c46);_0x590a9f++){_0x539c78[_0x590a9f]=_0x1264f0;}}const _0x5f31b=getBarColor(_0x21e58a[_0x2445eb(0x260)]),_0x4621d4=_0x539c78[_0x2445eb(0x263)](_0x3b6ed6=>_0x3b6ed6==='\x20'?'\x20':_0x5f31b(_0x3b6ed6))[_0x2445eb(0x211)]('');return _0x504844+'\x20'+_0x46480b+'│'+_0x4621d4+'│';}function calculateStats(_0x360883){const _0x55d5e4=a54_0x130479,_0x466907={'total':_0x360883[_0x55d5e4(0x273)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5d5d51 of _0x360883){if(_0x5d5d51[_0x55d5e4(0x260)]===_0x55d5e4(0x337))_0x466907['success']++;else{if(_0x5d5d51[_0x55d5e4(0x260)]===_0x55d5e4(0x235)||_0x5d5d51[_0x55d5e4(0x260)]==='group_error')_0x466907[_0x55d5e4(0x235)]++;else _0x5d5d51['state']===_0x55d5e4(0x1fe)?_0x466907[_0x55d5e4(0x1fe)]++:_0x466907[_0x55d5e4(0x2d7)]++;}}return _0x466907;}function formatStats(_0x33c2a9){const _0x4fc979=a54_0x130479;return[_0x4fc979(0x21f)+_0x33c2a9[_0x4fc979(0x1f7)],'✅\x20'+_0x33c2a9[_0x4fc979(0x337)],'❌\x20'+_0x33c2a9['error'],_0x4fc979(0x3a0)+_0x33c2a9[_0x4fc979(0x1fe)],'⏳\x20'+_0x33c2a9[_0x4fc979(0x2d7)]][_0x4fc979(0x211)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x34f);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x130479(0x22a)](_0x40993b){const _0x8e0a8d=a54_0x130479,{options:_0x2dfd85,args:_0x3b2cd7,tdx:_0x1bd326}=_0x40993b;let _0x6297c7,_0x474173,_0x347308=![];if(_0x3b2cd7[0x0]){if(_0x3b2cd7[0x0][_0x8e0a8d(0x238)]('.')){const _0x3e676c=this[_0x8e0a8d(0x31a)](_0x3b2cd7,_0x2dfd85);if(!_0x3e676c)return 0x1;_0x6297c7=_0x3e676c[_0x8e0a8d(0x2d1)],_0x474173=_0x3e676c['workflowName'];}else{_0x474173=_0x3b2cd7[0x0],_0x6297c7=_0x2dfd85[_0x8e0a8d(0x37d)];if(!_0x6297c7)return console[_0x8e0a8d(0x235)](a54_0x47fe92['red'](_0x8e0a8d(0x25d)),_0x8e0a8d(0x2ec)),0x1;_0x347308=!![];}}else{const _0x477d4a=this['parseProjectWorkflowPattern'](_0x3b2cd7,_0x2dfd85);if(!_0x477d4a)return 0x1;_0x6297c7=_0x477d4a[_0x8e0a8d(0x2d1)],_0x474173=_0x477d4a[_0x8e0a8d(0x25a)];}if(_0x2dfd85[_0x8e0a8d(0x399)]){if(_0x6297c7&&_0x474173)console[_0x8e0a8d(0x235)](_0x8e0a8d(0x26e)+_0x6297c7+'.'+_0x474173);else _0x6297c7&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x270)+_0x6297c7);}const _0x4741cb=_0x2dfd85[_0x8e0a8d(0x2a5)],_0xafe999=_0x2dfd85[_0x8e0a8d(0x2ea)];if(_0x4741cb){_0xafe999&&console['error'](a54_0x47fe92[_0x8e0a8d(0x28d)](_0x8e0a8d(0x24f)),_0x8e0a8d(0x2c8));const _0x2160b9=_0x2dfd85[_0x8e0a8d(0x39f)];return _0x2160b9?await this[_0x8e0a8d(0x327)](_0x40993b,_0x4741cb):await this['renderSingleTimeline'](_0x40993b,_0x4741cb,_0x2dfd85),0x0;}if(_0xafe999){const _0x3eb3fa=await withSpinner(_0x8e0a8d(0x25b),()=>_0x1bd326[_0x8e0a8d(0x2ab)]['sessions']({'projectName':_0x6297c7,'workflowName':_0x474173,'limit':0x64}),{'verbose':_0x2dfd85['verbose']}),_0x3b732b=_0x3eb3fa[_0x8e0a8d(0x36f)][_0x8e0a8d(0x398)](_0x20606b=>_0x20606b['id']===_0xafe999);if(!_0x3b732b)return console['error'](a54_0x47fe92[_0x8e0a8d(0x225)](_0x8e0a8d(0x25d)),_0x8e0a8d(0x37f)+_0xafe999),0x1;if(!_0x3b732b[_0x8e0a8d(0x250)]?.['id'])return console[_0x8e0a8d(0x235)](a54_0x47fe92[_0x8e0a8d(0x225)](_0x8e0a8d(0x25d)),'Session\x20'+_0xafe999+_0x8e0a8d(0x378)),0x1;const _0xebbedf=_0x3b732b[_0x8e0a8d(0x250)]['id'];_0x2dfd85[_0x8e0a8d(0x399)]&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x2a2)+_0xebbedf+_0x8e0a8d(0x1fd)+_0xafe999);const _0x8aa9d=_0x2dfd85['follow'];return _0x8aa9d?await this['pollTimeline'](_0x40993b,_0xebbedf):await this[_0x8e0a8d(0x362)](_0x40993b,_0xebbedf,_0x2dfd85),0x0;}const _0x5705f7=await withSpinner(_0x8e0a8d(0x365),()=>_0x1bd326[_0x8e0a8d(0x2ab)]['sessions']({'projectName':_0x6297c7,'workflowName':_0x474173,'limit':_0x2dfd85[_0x8e0a8d(0x341)]||0x32}),{'verbose':_0x2dfd85['verbose']}),_0x5297ea=_0x5705f7['data'];if(_0x5297ea[_0x8e0a8d(0x273)]===0x0){if(_0x6297c7&&_0x474173)console[_0x8e0a8d(0x235)]('No\x20sessions\x20found\x20for:\x20'+_0x6297c7+'.'+_0x474173);else _0x6297c7?console[_0x8e0a8d(0x235)](_0x8e0a8d(0x252)+_0x6297c7):(console['error'](_0x8e0a8d(0x37b)),console[_0x8e0a8d(0x235)](a54_0x47fe92[_0x8e0a8d(0x2e9)](_0x8e0a8d(0x248))));return 0x0;}_0x5297ea[_0x8e0a8d(0x24e)]((_0x5817be,_0x4ffbd1)=>{const _0x105c8e=_0x8e0a8d,_0x2c20a3=_0x5817be[_0x105c8e(0x35e)]||'',_0x1684d3=_0x4ffbd1[_0x105c8e(0x35e)]||'';return _0x1684d3['localeCompare'](_0x2c20a3);});if(_0x2dfd85[_0x8e0a8d(0x309)]||_0x2dfd85[_0x8e0a8d(0x2cb)])return await handleSDKOutput(_0x5297ea,_0x2dfd85),0x0;let _0x2cce3f;if(_0x347308){const _0x287432=_0x5297ea[0x0];if(!_0x287432[_0x8e0a8d(0x250)]?.['id'])return console[_0x8e0a8d(0x235)](_0x8e0a8d(0x288)),0x0;_0x2cce3f=_0x287432['lastAttempt']['id'],_0x2dfd85[_0x8e0a8d(0x399)]&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x2d3)+_0x287432[_0x8e0a8d(0x35e)]);}else{const _0x37b92a=_0x5297ea[_0x8e0a8d(0x263)](_0x2d6b25=>{const _0x58f7a6=_0x8e0a8d,_0x5d061e=getAttemptStatusDisplay(_0x2d6b25[_0x58f7a6(0x250)]);return{'title':_0x2d6b25[_0x58f7a6(0x298)]?.[_0x58f7a6(0x27b)]+'.'+_0x2d6b25[_0x58f7a6(0x2ab)]?.[_0x58f7a6(0x27b)]+'\x20-\x20'+_0x2d6b25[_0x58f7a6(0x35e)]+'\x20'+_0x5d061e[_0x58f7a6(0x373)],'value':_0x2d6b25[_0x58f7a6(0x250)]?.['id']||'','description':_0x5d061e[_0x58f7a6(0x351)]};}),_0x237fcf=await a54_0x4e32c8({'type':_0x8e0a8d(0x2f9),'name':_0x8e0a8d(0x2a5),'message':_0x8e0a8d(0x2a1),'choices':_0x37b92a['filter'](_0x4285a2=>_0x4285a2[_0x8e0a8d(0x24d)]!=='')});if(!_0x237fcf['attemptId'])return 0x0;_0x2cce3f=_0x237fcf[_0x8e0a8d(0x2a5)];}const _0x2ca336=_0x2dfd85['follow'];return _0x2ca336?await this[_0x8e0a8d(0x327)](_0x40993b,_0x2cce3f):await this['renderSingleTimeline'](_0x40993b,_0x2cce3f,_0x2dfd85),0x0;}async[a54_0x130479(0x362)](_0x162f92,_0x340c78,_0x9cce50){const _0x134178=a54_0x130479,{tdx:_0x473c7c}=_0x162f92;let _0x35d33c,_0x213677;try{[_0x35d33c,_0x213677]=await Promise['all']([_0x473c7c[_0x134178(0x2ab)][_0x134178(0x359)](_0x340c78),_0x473c7c['workflow']['tasks'](_0x340c78,![])]);}catch(_0x243adf){console[_0x134178(0x235)](a54_0x47fe92[_0x134178(0x225)](_0x134178(0x335)));_0x9cce50[_0x134178(0x399)]&&console[_0x134178(0x235)](_0x243adf);throw _0x243adf;}if(_0x9cce50[_0x134178(0x309)]||_0x9cce50['jsonl']){const _0x1cc77f=this[_0x134178(0x2c9)](_0x35d33c,_0x213677);await handleSDKOutput([_0x1cc77f],_0x9cce50);return;}const _0x291795=_0x473c7c[_0x134178(0x227)][_0x134178(0x25c)],_0x37b372=this[_0x134178(0x2c1)](_0x35d33c,_0x213677,_0x291795);console[_0x134178(0x303)](_0x37b372);}async[a54_0x130479(0x327)](_0x37fa53,_0x37dadf){const _0x15728b=a54_0x130479,{tdx:_0x134883}=_0x37fa53,_0x37c279=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x294f0b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2e9345=0x0;while(_0x2e9345<_0x294f0b){process[_0x15728b(0x328)]['isTTY']&&process[_0x15728b(0x328)]['write']('\x1bc');let _0x1ca620,_0x31a238;try{[_0x1ca620,_0x31a238]=await Promise[_0x15728b(0x294)]([_0x134883[_0x15728b(0x2ab)]['attempt'](_0x37dadf),_0x134883[_0x15728b(0x2ab)][_0x15728b(0x1ef)](_0x37dadf,![])]);}catch(_0x1872af){console[_0x15728b(0x235)](a54_0x47fe92['red'](_0x15728b(0x356)));_0x2e9345>0x0&&console[_0x15728b(0x235)](a54_0x47fe92['dim'](_0x15728b(0x349)+_0x2e9345));throw _0x1872af;}const _0x1625f1=_0x134883['context'][_0x15728b(0x25c)],_0x6b94b4=this[_0x15728b(0x2c1)](_0x1ca620,_0x31a238,_0x1625f1);console[_0x15728b(0x303)](_0x6b94b4);const _0x797e4b=_0x1ca620['done']&&_0x31a238['every'](_0xfb261c=>_0xfb261c['state']!==_0x15728b(0x1fe)&&_0xfb261c[_0x15728b(0x260)]!==_0x15728b(0x313));if(_0x797e4b){console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x2b5)](_0x15728b(0x22d)));break;}console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x2e9)](_0x15728b(0x3a3)+_0x2e9345*0x2+_0x15728b(0x301))),await new Promise(_0x3d7df0=>setTimeout(_0x3d7df0,_0x37c279)),_0x2e9345++;}_0x2e9345>=_0x294f0b&&console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x28d)](_0x15728b(0x2a6)));}[a54_0x130479(0x2c1)](_0x2d4405,_0x160351,_0x346c93){const _0x5e0293=a54_0x130479,_0x1d9346=[],_0x4c0fc6=TIMELINE_CONFIG[_0x5e0293(0x325)],_0x4e0ac1=0x5,_0x525797=process[_0x5e0293(0x328)][_0x5e0293(0x1f3)]||0x78,_0x168d0c=_0x525797-_0x4c0fc6-_0x4e0ac1,_0x1ec6df=Math[_0x5e0293(0x2b3)](TIMELINE_CONFIG[_0x5e0293(0x25f)],Math[_0x5e0293(0x316)](_0x168d0c,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1f19bd=new Date(_0x2d4405['createdAt'])['getTime'](),_0x391a99=_0x2d4405[_0x5e0293(0x224)]?new Date(_0x2d4405[_0x5e0293(0x224)])[_0x5e0293(0x28f)]():Date[_0x5e0293(0x1fb)](),_0x148c12={'start':_0x1f19bd,'end':_0x391a99,'duration':_0x391a99-_0x1f19bd},_0x2abded=new Map(),_0x4d6cbd=[];for(const _0x437b63 of _0x160351){if(_0x437b63[_0x5e0293(0x2e0)]){const _0x264871=new Date(_0x437b63[_0x5e0293(0x2e0)])[_0x5e0293(0x28f)](),_0x378eb8=_0x437b63[_0x5e0293(0x317)]?new Date(_0x437b63['updatedAt'])[_0x5e0293(0x28f)]():Date[_0x5e0293(0x1fb)](),_0x4d93bc={'start':_0x264871,'end':_0x378eb8,'duration':_0x378eb8-_0x264871};_0x2abded[_0x5e0293(0x377)](_0x437b63['id'],_0x4d93bc),_0x4d6cbd[_0x5e0293(0x1ea)]({'name':_0x437b63['fullName'],'state':_0x437b63[_0x5e0293(0x260)]||_0x5e0293(0x38c),'window':_0x4d93bc});}else _0x4d6cbd[_0x5e0293(0x1ea)]({'name':_0x437b63[_0x5e0293(0x2f5)],'state':_0x437b63[_0x5e0293(0x260)]||'planned','window':undefined});}_0x4d6cbd['sort']((_0x33dedf,_0x2572ea)=>{const _0x217571=_0x5e0293;if(!_0x33dedf[_0x217571(0x367)])return 0x1;if(!_0x2572ea[_0x217571(0x367)])return-0x1;return _0x33dedf[_0x217571(0x367)]['start']-_0x2572ea[_0x217571(0x367)][_0x217571(0x2aa)];});const _0x159b71=_0x4d6cbd['length'],_0xa088d8=_0x159b71>TIMELINE_CONFIG[_0x5e0293(0x36c)];_0xa088d8&&_0x4d6cbd[_0x5e0293(0x33b)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1f3198=calculateTimeScale(_0x148c12,_0x1ec6df),_0x3109c0=_0x2d4405[_0x5e0293(0x38b)]?_0x2d4405[_0x5e0293(0x337)]?a54_0x47fe92[_0x5e0293(0x2b5)](_0x5e0293(0x337)):a54_0x47fe92[_0x5e0293(0x225)](_0x5e0293(0x235)):a54_0x47fe92['blue'](_0x5e0293(0x1fe)),_0x4f6742=_0x2d4405[_0x5e0293(0x298)]?.['id'],_0x46c07d=_0x2d4405[_0x5e0293(0x2ea)];let _0xd2c96a;if(_0x4f6742&&_0x46c07d){const _0x292535=getWorkflowAttemptUrl(_0x346c93,_0x4f6742,_0x46c07d,_0x2d4405['id']);_0xd2c96a=hyperlink(a54_0x47fe92[_0x5e0293(0x2e9)](_0x2d4405['id']),_0x292535);}else _0xd2c96a=a54_0x47fe92[_0x5e0293(0x2e9)](_0x2d4405['id']);_0x1d9346[_0x5e0293(0x1ea)](_0x5e0293(0x209)+_0xd2c96a+'\x20-\x20'+_0x3109c0+_0x5e0293(0x374)+formatElapsed(_0x148c12[_0x5e0293(0x2ad)]));if(_0x4d6cbd[_0x5e0293(0x273)]>0x0){const _0x5e39a1=renderTimeAxis(_0x1f3198,_0x1ec6df),_0x4c8705=new Date(_0x148c12[_0x5e0293(0x2aa)]),_0x41686e=formatDate(_0x4c8705),_0x3e263b=TIMELINE_CONFIG[_0x5e0293(0x205)]+TIMELINE_CONFIG[_0x5e0293(0x27d)]+_0x4c0fc6,_0x4495b4=_0x41686e['padStart'](_0x3e263b),_0x1a2a4c=a54_0x47fe92[_0x5e0293(0x2e9)](_0x4495b4);_0x1d9346[_0x5e0293(0x1ea)](_0x1a2a4c+'\x20'+_0x5e39a1);for(const _0x4d9d85 of _0x4d6cbd){_0x1d9346[_0x5e0293(0x1ea)](renderTaskRow(_0x4d9d85,_0x1f3198,_0x1ec6df,_0x4c0fc6));}const _0x4e0cf6=calculateStats(_0x4d6cbd);_0x1d9346[_0x5e0293(0x1ea)](formatStats(_0x4e0cf6)),_0xa088d8&&_0x1d9346['push'](a54_0x47fe92[_0x5e0293(0x28d)](_0x5e0293(0x366)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5e0293(0x21a)+_0x159b71+_0x5e0293(0x318))),_0x1d9346[_0x5e0293(0x1ea)](''),_0x1d9346[_0x5e0293(0x1ea)](a54_0x47fe92[_0x5e0293(0x2e9)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x2d4405['id']+_0x5e0293(0x357))+a54_0x47fe92[_0x5e0293(0x2e9)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1d9346[_0x5e0293(0x1ea)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1d9346[_0x5e0293(0x211)]('\x0a');}['buildTimelineData'](_0x201bcc,_0x28bcb3){const _0x17c546=a54_0x130479,_0x1ee891=new Date(_0x201bcc[_0x17c546(0x364)])['getTime'](),_0x13bc41=_0x201bcc[_0x17c546(0x224)]?new Date(_0x201bcc[_0x17c546(0x224)])[_0x17c546(0x28f)]():Date['now'](),_0x1e51fc=_0x13bc41-_0x1ee891,_0x4ef1db=[];for(const _0x4db135 of _0x28bcb3){if(_0x4db135[_0x17c546(0x2e0)]){const _0x3565f7=new Date(_0x4db135[_0x17c546(0x2e0)])[_0x17c546(0x28f)](),_0x1c514a=_0x4db135['updatedAt']?new Date(_0x4db135[_0x17c546(0x317)])['getTime']():Date[_0x17c546(0x1fb)]();_0x4ef1db[_0x17c546(0x1ea)]({'name':_0x4db135['fullName'],'state':_0x4db135['state']||_0x17c546(0x38c),'window':{'start':_0x3565f7,'end':_0x1c514a,'duration':_0x1c514a-_0x3565f7}});}else _0x4ef1db[_0x17c546(0x1ea)]({'name':_0x4db135['fullName'],'state':_0x4db135[_0x17c546(0x260)]||_0x17c546(0x313),'window':undefined});}const _0x82c3bb=calculateStats(_0x4ef1db);return{'attempt':{'id':_0x201bcc['id'],'status':_0x201bcc['done']?_0x201bcc[_0x17c546(0x337)]?_0x17c546(0x337):_0x17c546(0x235):'running','createdAt':_0x201bcc[_0x17c546(0x364)],'finishedAt':_0x201bcc[_0x17c546(0x224)],'duration_ms':_0x1e51fc},'tasks':_0x4ef1db[_0x17c546(0x263)](_0x7bbc0d=>({'name':_0x7bbc0d['name'],'state':_0x7bbc0d[_0x17c546(0x260)],'startedAt':_0x7bbc0d['window']?new Date(_0x7bbc0d[_0x17c546(0x367)][_0x17c546(0x2aa)])[_0x17c546(0x200)]():null,'updatedAt':_0x7bbc0d[_0x17c546(0x367)]?new Date(_0x7bbc0d[_0x17c546(0x367)]['end'])[_0x17c546(0x200)]():null,'duration_ms':_0x7bbc0d['window']?.[_0x17c546(0x2ad)]||null})),'stats':_0x82c3bb};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:schedules';['description']='List\x20workflow\x20schedules';async[a54_0x130479(0x22a)](_0x3b9187){const _0x398db4=a54_0x130479,{options:_0x763d55,tdx:_0x18b2a3}=_0x3b9187,_0x12dd26=await withSpinner(_0x398db4(0x33c),()=>_0x18b2a3[_0x398db4(0x2ab)][_0x398db4(0x39b)](),{'verbose':_0x763d55[_0x398db4(0x399)]}),_0x4ec8e7=_0x12dd26[_0x398db4(0x36f)];console[_0x398db4(0x235)](_0x398db4(0x393)+_0x4ec8e7['length']+_0x398db4(0x389)+(_0x4ec8e7[_0x398db4(0x273)]!==0x1?'s':''));if(isStructuredFormat(_0x763d55))await handleSDKOutput(_0x4ec8e7,_0x763d55);else{if(_0x4ec8e7['length']===0x0)console[_0x398db4(0x303)]('No\x20schedules\x20found');else for(const _0x73a11b of _0x4ec8e7){const _0x5bb44d=_0x73a11b[_0x398db4(0x2e7)]?a54_0x47fe92['yellow'](_0x398db4(0x2a0)):'',_0x448302=_0x73a11b[_0x398db4(0x298)]?.[_0x398db4(0x27b)]?a54_0x47fe92['dim']('\x20['+_0x73a11b[_0x398db4(0x298)][_0x398db4(0x27b)]+']'):'',_0x407e00=_0x73a11b['nextRunTime']?a54_0x47fe92[_0x398db4(0x2e9)](_0x398db4(0x245)+new Date(_0x73a11b['nextRunTime'])[_0x398db4(0x358)]()):'';console[_0x398db4(0x303)](_0x398db4(0x311)+_0x73a11b['id']+'\x20'+(_0x73a11b[_0x398db4(0x2ab)]?.['name']||'(unknown)')+_0x448302+_0x5bb44d+_0x407e00);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:schedule:enable';[a54_0x130479(0x376)]=a54_0x130479(0x1f2);async[a54_0x130479(0x22a)](_0xf6ae26){const _0x5e19c7=a54_0x130479,{options:_0x10c6b1,args:_0x4ac71d,tdx:_0x33e0f0}=_0xf6ae26,_0x3ec1fb=_0x4ac71d[0x0];if(!_0x3ec1fb)return console['error'](a54_0x47fe92[_0x5e19c7(0x225)](_0x5e19c7(0x25d)),_0x5e19c7(0x21d)),console[_0x5e19c7(0x235)](a54_0x47fe92['dim'](_0x5e19c7(0x34a))),console[_0x5e19c7(0x235)](a54_0x47fe92[_0x5e19c7(0x2e9)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x42e484=await withSpinner(_0x5e19c7(0x312)+_0x3ec1fb+_0x5e19c7(0x2d6),()=>_0x33e0f0[_0x5e19c7(0x2ab)][_0x5e19c7(0x228)](_0x3ec1fb),{'verbose':_0x10c6b1[_0x5e19c7(0x399)]}),_0x36f88c=_0x42e484[_0x5e19c7(0x36f)];return isStructuredFormat(_0x10c6b1)?await handleSingleObjectOutput(_0x36f88c,_0x10c6b1):(console[_0x5e19c7(0x303)](_0x5e19c7(0x307)+_0x3ec1fb+_0x5e19c7(0x20d)+(_0x36f88c[_0x5e19c7(0x2ab)]?.[_0x5e19c7(0x27b)]||_0x5e19c7(0x38c))+')'),_0x36f88c['nextRunTime']&&console[_0x5e19c7(0x303)](a54_0x47fe92[_0x5e19c7(0x2e9)](_0x5e19c7(0x2a4)+new Date(_0x36f88c[_0x5e19c7(0x387)])[_0x5e19c7(0x358)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']='workflow:schedule:disable';['description']=a54_0x130479(0x2ed);async[a54_0x130479(0x22a)](_0x4ffa9e){const _0x44a923=a54_0x130479,{options:_0x2fc527,args:_0x35b8e1,tdx:_0x5c4588}=_0x4ffa9e,_0x1a316d=_0x35b8e1[0x0];if(!_0x1a316d)return console['error'](a54_0x47fe92[_0x44a923(0x225)](_0x44a923(0x25d)),_0x44a923(0x21d)),console[_0x44a923(0x235)](a54_0x47fe92['dim'](_0x44a923(0x2f8))),console[_0x44a923(0x235)](a54_0x47fe92[_0x44a923(0x2e9)](_0x44a923(0x278))),0x1;const _0x2e7eb3=await withSpinner(_0x44a923(0x39e)+_0x1a316d+'...',()=>_0x5c4588['workflow'][_0x44a923(0x39a)](_0x1a316d),{'verbose':_0x2fc527[_0x44a923(0x399)]}),_0x1ab0e9=_0x2e7eb3['data'];return isStructuredFormat(_0x2fc527)?await handleSingleObjectOutput(_0x1ab0e9,_0x2fc527):console[_0x44a923(0x303)](_0x44a923(0x307)+_0x1a316d+_0x44a923(0x22f)+(_0x1ab0e9['workflow']?.[_0x44a923(0x27b)]||'unknown')+')'),0x0;}}