@treasuredata/tdx 2026.4.4 → 2026.4.5

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.d.ts +2 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.d.ts +5 -0
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -0
  185. package/dist/sdk/workspace/access-tracker.js +1 -0
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -0
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.d.ts +1 -1
  189. package/dist/sdk/workspace/git.d.ts.map +1 -1
  190. package/dist/sdk/workspace/git.js +1 -1
  191. package/dist/sdk/workspace/git.js.map +1 -1
  192. package/dist/sdk/workspace/index.d.ts +8 -0
  193. package/dist/sdk/workspace/index.d.ts.map +1 -1
  194. package/dist/sdk/workspace/index.js +1 -1
  195. package/dist/sdk/workspace/index.js.map +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x3a8226=a54_0x5f04;(function(_0x59aec9,_0x47b2df){const _0xffb16e=a54_0x5f04,_0x1cff99=_0x59aec9();while(!![]){try{const _0x367b72=-parseInt(_0xffb16e(0xeb))/0x1+-parseInt(_0xffb16e(0x1ec))/0x2*(parseInt(_0xffb16e(0x235))/0x3)+-parseInt(_0xffb16e(0x107))/0x4+parseInt(_0xffb16e(0x1b9))/0x5+-parseInt(_0xffb16e(0x120))/0x6*(-parseInt(_0xffb16e(0x11e))/0x7)+-parseInt(_0xffb16e(0x2aa))/0x8+parseInt(_0xffb16e(0x1f3))/0x9;if(_0x367b72===_0x47b2df)break;else _0x1cff99['push'](_0x1cff99['shift']());}catch(_0x4a6528){_0x1cff99['push'](_0x1cff99['shift']());}}}(a54_0x5eae,0xbf567));import a54_0x1e596b from'chalk';import{existsSync}from'fs';function a54_0x5f04(_0xb08127,_0x13f6a0){_0xb08127=_0xb08127-0xe8;const _0x5eae79=a54_0x5eae();let _0x5f046c=_0x5eae79[_0xb08127];return _0x5f046c;}import a54_0x1e7b2e 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';import a54_0x89dadd from'prompts';function getAttemptStatusDisplay(_0x525019){const _0x2da6a3=a54_0x5f04;if(!_0x525019)return{'icon':'⏳','text':''};const {done:_0x10e647,success:_0x3dd528,cancelRequested:_0x30bbe3}=_0x525019;if(!_0x10e647)return _0x30bbe3?{'icon':'🛑','text':a54_0x1e596b[_0x2da6a3(0x1f4)](_0x2da6a3(0x1b2))}:{'icon':'🔄','text':a54_0x1e596b[_0x2da6a3(0x1df)]('running')};if(_0x3dd528)return{'icon':'✅','text':a54_0x1e596b[_0x2da6a3(0xfb)](_0x2da6a3(0x1b0))};return{'icon':'❌','text':a54_0x1e596b[_0x2da6a3(0x227)](_0x2da6a3(0x26f))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x3a8226(0x1f0)](_0x411f89,_0x489ce7,_0x2e0b82=0x0){return _0x411f89[_0x2e0b82]||_0x489ce7['workflowProject'];}[a54_0x3a8226(0x160)](_0x4c5485,_0x17e71f,_0x4c4e3d=0x0){const _0x3c131c=a54_0x3a8226,_0x2de7f6=this[_0x3c131c(0x1f0)](_0x4c5485,_0x17e71f,_0x4c4e3d);if(!_0x2de7f6)return console[_0x3c131c(0x26f)](a54_0x1e596b['red'](_0x3c131c(0x23e)),'Project\x20name\x20is\x20required'),console[_0x3c131c(0x26f)](a54_0x1e596b[_0x3c131c(0xe8)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x2de7f6;}[a54_0x3a8226(0x1ef)](_0x33d036,_0x8163ca){const _0x5419fe=a54_0x3a8226;if(_0x33d036[0x0]){const _0x21d049=_0x33d036[0x0]['split']('.');if(_0x21d049[_0x5419fe(0x294)]===0x1)return{'projectName':_0x21d049[0x0],'workflowName':undefined};else return _0x21d049[_0x5419fe(0x294)]===0x2?{'projectName':_0x21d049[0x0],'workflowName':_0x21d049[0x1]}:(console[_0x5419fe(0x26f)](a54_0x1e596b[_0x5419fe(0x227)]('Error:'),_0x5419fe(0xf6)),null);}return{'projectName':_0x8163ca[_0x5419fe(0x22d)],'workflowName':undefined};}[a54_0x3a8226(0x175)](_0x39f784,_0x2ea348,_0x1845d7=0x0){const _0x42d8d2=a54_0x3a8226;if(_0x39f784[_0x1845d7])return _0x39f784[_0x1845d7];if(_0x2ea348[_0x42d8d2(0x22d)]){const _0x44e3b1=a54_0x1e7b2e[_0x42d8d2(0x258)](process[_0x42d8d2(0x2a9)](),_0x42d8d2(0x256),_0x2ea348[_0x42d8d2(0x22d)]);if(existsSync(a54_0x1e7b2e[_0x42d8d2(0x258)](_0x44e3b1,_0x42d8d2(0x115))))return _0x44e3b1;}return undefined;}async['showWorkflowConsoleUrl'](_0x3f6bf3,_0x16a4f4,_0x5d29aa){const _0x4800ec=a54_0x3a8226;try{const _0x10d273=await _0x3f6bf3[_0x4800ec(0x267)]['workflows'](_0x16a4f4,{'limit':0x1});if(_0x10d273[_0x4800ec(0x294)]>0x0){const _0x2742ab=_0x10d273[0x0]['id'],_0x2bc084=getWorkflowUrl(_0x5d29aa,_0x2742ab);console[_0x4800ec(0x26f)](_0x4800ec(0x17a)+a54_0x1e596b[_0x4800ec(0x106)](_0x2bc084));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x22f);async[a54_0x3a8226(0x1cd)](_0x56ca1f){const _0x5ddce5=a54_0x3a8226,{options:_0x27e2fa,args:_0x42f58f,tdx:_0x33ca9d}=_0x56ca1f,_0xb82d83=_0x42f58f[0x0],_0x510ab5=_0x27e2fa['clear'];if(_0x510ab5)return saveSessionContext({'workflow_project':undefined},_0x27e2fa['session']),console[_0x5ddce5(0x204)](a54_0x1e596b['green'](_0x5ddce5(0x12c))),0x0;if(!_0xb82d83)return console[_0x5ddce5(0x26f)](a54_0x1e596b[_0x5ddce5(0x227)](_0x5ddce5(0x23e)),_0x5ddce5(0x1b4)),console[_0x5ddce5(0x26f)](a54_0x1e596b['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a54_0x1e596b[_0x5ddce5(0xe8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x41e61a=await withSpinner(_0x5ddce5(0x279)+_0xb82d83+'\x27...',()=>_0x33ca9d[_0x5ddce5(0x267)][_0x5ddce5(0x155)](_0xb82d83),{'verbose':_0x27e2fa[_0x5ddce5(0x272)]}),{name:_0x11ae11}=_0x41e61a[_0x5ddce5(0x1ba)];return saveSessionContext({'workflow_project':_0x11ae11},_0x27e2fa[_0x5ddce5(0x128)]),console[_0x5ddce5(0x204)](a54_0x1e596b[_0x5ddce5(0xfb)](_0x5ddce5(0x1a0)+a54_0x1e596b[_0x5ddce5(0x106)](_0x11ae11))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x276);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x25d);async[a54_0x3a8226(0x1cd)](_0x3a18ee){const _0x2e0f20=a54_0x3a8226,{options:_0x1bed3a,args:_0x7c9959,tdx:_0x458cff}=_0x3a18ee,_0x2e3eb9=_0x7c9959[0x0];_0x1bed3a['verbose']&&_0x2e3eb9&&console[_0x2e0f20(0x26f)](_0x2e0f20(0x167)+_0x2e3eb9);const _0x1e1961=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x458cff['workflow'][_0x2e0f20(0x297)](_0x2e3eb9,{'limit':_0x1bed3a['limit']}),{'verbose':_0x1bed3a[_0x2e0f20(0x272)]});let _0x30378d=_0x1e1961['data'];_0x30378d[_0x2e0f20(0x1c8)]((_0x59d325,_0x23617a)=>_0x59d325[_0x2e0f20(0xf9)][_0x2e0f20(0x234)](_0x23617a['name']));const _0x5754ba=_0x1bed3a['limit']||0x64,_0x12b67e=_0x30378d[_0x2e0f20(0x294)]>=_0x5754ba?a54_0x1e596b[_0x2e0f20(0xe8)](_0x2e0f20(0x214)):'';console['error'](_0x2e0f20(0x151)+_0x30378d[_0x2e0f20(0x294)]+_0x2e0f20(0xf1)+(_0x30378d[_0x2e0f20(0x294)]!==0x1?'s':'')+_0x12b67e);if(_0x1bed3a[_0x2e0f20(0x275)]===_0x2e0f20(0x10d)||_0x1bed3a[_0x2e0f20(0x275)]===_0x2e0f20(0x1c4)||_0x1bed3a[_0x2e0f20(0x275)]==='table')await handleSDKOutput(_0x30378d,_0x1bed3a);else{if(_0x30378d[_0x2e0f20(0x294)]===0x0)_0x2e3eb9?console[_0x2e0f20(0x204)](_0x2e0f20(0x18b)+_0x2e3eb9):console[_0x2e0f20(0x204)]('No\x20workflow\x20projects\x20found');else{const _0x4abcf2=_0x30378d[_0x2e0f20(0x1bc)](_0x253fc4=>{const _0x5c87de=_0x2e0f20,_0x31eb47=_0x253fc4[_0x5c87de(0x1a8)]?.['some'](_0xffa67a=>_0xffa67a[_0x5c87de(0x1fe)]===_0x5c87de(0x247)),_0x2389a1=_0x31eb47?a54_0x1e596b[_0x5c87de(0xe8)](_0x5c87de(0x1e7)):'';return'📁\x20'+_0x253fc4[_0x5c87de(0xf9)]+_0x2389a1;});await writeOutput(_0x4abcf2[_0x2e0f20(0x258)]('\x0a'),_0x1bed3a[_0x2e0f20(0x232)],_0x2e0f20(0x110));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x168);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x163);async[a54_0x3a8226(0x1cd)](_0x2faecd){const _0x5ed874=a54_0x3a8226,{options:_0x5e7af7,args:_0x54de99,tdx:_0x2c1f9b}=_0x2faecd,_0x58d1b6=this[_0x5ed874(0x1f0)](_0x54de99,_0x5e7af7);_0x5e7af7[_0x5ed874(0x272)]&&_0x58d1b6&&console[_0x5ed874(0x26f)](_0x5ed874(0x169)+_0x58d1b6);const _0x494ea5=await withSpinner(_0x5ed874(0x230),()=>_0x2c1f9b['workflow'][_0x5ed874(0x256)](_0x58d1b6,{'limit':_0x5e7af7[_0x5ed874(0x171)]}),{'verbose':_0x5e7af7[_0x5ed874(0x272)]});let _0x1e8403=_0x494ea5['data'];_0x1e8403[_0x5ed874(0x1c8)]((_0xe4d791,_0x395ee8)=>{const _0x5e7b63=_0x5ed874,_0x1fa0c0=_0xe4d791['name']['localeCompare'](_0x395ee8[_0x5e7b63(0xf9)]);if(_0x1fa0c0!==0x0)return _0x1fa0c0;return(_0xe4d791[_0x5e7b63(0x1cb)]?.['name']||'')['localeCompare'](_0x395ee8[_0x5e7b63(0x1cb)]?.['name']||'');});const _0x1b625d=_0x5e7af7['limit']||0x64,_0x3f54f9=_0x1e8403[_0x5ed874(0x294)]>=_0x1b625d?a54_0x1e596b[_0x5ed874(0xe8)](_0x5ed874(0x214)):'';console[_0x5ed874(0x26f)]('✔\x20Found\x20'+_0x1e8403[_0x5ed874(0x294)]+_0x5ed874(0x16c)+(_0x1e8403[_0x5ed874(0x294)]!==0x1?'s':'')+_0x3f54f9);if(_0x5e7af7[_0x5ed874(0x275)]===_0x5ed874(0x10d)||_0x5e7af7['format']===_0x5ed874(0x1c4)||_0x5e7af7[_0x5ed874(0x275)]==='table')await handleSDKOutput(_0x1e8403,_0x5e7af7);else{if(_0x1e8403[_0x5ed874(0x294)]===0x0)_0x58d1b6?console[_0x5ed874(0x204)](_0x5ed874(0x174)+_0x58d1b6):console[_0x5ed874(0x204)](_0x5ed874(0x1bf));else{const _0x3414fa=_0x5e7af7['site'],_0x161959=_0x1e8403['map'](_0x2ad7d3=>{const _0x58c34e=_0x5ed874,_0x2863ad=a54_0x1e596b[_0x58c34e(0xe8)]('#'+_0x2ad7d3['id']),_0x569a97=hyperlink(_0x2863ad,getWorkflowUrl(_0x3414fa,_0x2ad7d3['id'])),_0x22cae7=_0x2ad7d3[_0x58c34e(0x1cb)]?.['name']?a54_0x1e596b[_0x58c34e(0xe8)]('\x20('+_0x2ad7d3[_0x58c34e(0x1cb)][_0x58c34e(0xf9)]+')'):'';return'📋\x20'+_0x569a97+'\x20'+_0x2ad7d3['name']+_0x22cae7;});await writeOutput(_0x161959['join']('\x0a'),_0x5e7af7[_0x5ed874(0x232)],_0x5ed874(0x110));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1f5);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x263);async['execute'](_0x5ba8fc){const _0x33a835=a54_0x3a8226,{options:_0x42cc39,args:_0x3f670c,tdx:_0x595582}=_0x5ba8fc,_0x1344cc=this[_0x33a835(0x1ef)](_0x3f670c,_0x42cc39);if(!_0x1344cc)return 0x1;const {projectName:_0x45825a,workflowName:_0x5c1b55}=_0x1344cc;if(_0x42cc39[_0x33a835(0x272)]){if(_0x45825a&&_0x5c1b55)console['error'](_0x33a835(0x176)+_0x45825a+'.'+_0x5c1b55);else _0x45825a&&console[_0x33a835(0x26f)]('Filter:\x20project='+_0x45825a);const _0x5b3c2d=_0x42cc39['status'];_0x5b3c2d&&console[_0x33a835(0x26f)](_0x33a835(0x1e4)+_0x5b3c2d);}let _0x5f4b25=0x28;if(process[_0x33a835(0x1f6)][_0x33a835(0x1e8)]&&!_0x42cc39['output']&&!_0x42cc39[_0x33a835(0x275)]){const _0x1ca584=process['stdout']['rows']||0x28;_0x5f4b25=Math[_0x33a835(0xf7)](0x14,Math[_0x33a835(0x20e)](_0x1ca584*0x2/0x3));}const _0x50018c=_0x42cc39[_0x33a835(0x171)]||_0x5f4b25,_0x2bcd08=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x595582[_0x33a835(0x267)]['sessions']({'projectName':_0x45825a,'workflowName':_0x5c1b55,'status':_0x42cc39[_0x33a835(0x23b)],'fromTime':_0x42cc39['from'],'toTime':_0x42cc39['to'],'limit':_0x50018c}),{'verbose':_0x42cc39[_0x33a835(0x272)]}),_0x84c2d4=_0x2bcd08[_0x33a835(0x1ba)];_0x84c2d4[_0x33a835(0x1c8)]((_0x6b0a01,_0x5dab99)=>{const _0x25b640=_0x33a835,_0x51259d=_0x6b0a01[_0x25b640(0x194)]||'',_0x46786f=_0x5dab99['sessionTime']||'';return _0x46786f[_0x25b640(0x234)](_0x51259d);});_0x84c2d4[_0x33a835(0x294)]>=_0x50018c?console[_0x33a835(0x26f)](_0x33a835(0x181)+_0x84c2d4[_0x33a835(0x294)]+'\x20sessions\x20'+a54_0x1e596b[_0x33a835(0xe8)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x33a835(0x26f)](_0x33a835(0x151)+_0x84c2d4[_0x33a835(0x294)]+_0x33a835(0x210)+(_0x84c2d4[_0x33a835(0x294)]!==0x1?'s':''));if(_0x42cc39['format']===_0x33a835(0x10d)||_0x42cc39[_0x33a835(0x275)]===_0x33a835(0x1c4)||_0x42cc39[_0x33a835(0x275)]===_0x33a835(0x1a4))await handleSDKOutput(_0x84c2d4,_0x42cc39);else{if(!process[_0x33a835(0x1f6)][_0x33a835(0x1e8)]||_0x42cc39['output']){if(_0x84c2d4['length']===0x0){if(_0x45825a&&_0x5c1b55)console[_0x33a835(0x204)](_0x33a835(0x1d9)+_0x45825a+'.'+_0x5c1b55);else _0x45825a?console['log'](_0x33a835(0x287)+_0x45825a):console[_0x33a835(0x204)](_0x33a835(0x2ab));}else{const _0x44ecd1=_0x42cc39[_0x33a835(0x241)],_0x46e7b6=this['renderSessionsTimeline'](_0x84c2d4,_0x44ecd1);_0x42cc39[_0x33a835(0x232)]?await writeOutput(_0x46e7b6,_0x42cc39['output'],'list'):console['log'](_0x46e7b6);}!_0x45825a&&(console['error'](''),console[_0x33a835(0x26f)](a54_0x1e596b[_0x33a835(0xe8)](_0x33a835(0x25a))),console[_0x33a835(0x26f)](a54_0x1e596b['dim'](_0x33a835(0x13f))+'or'+a54_0x1e596b[_0x33a835(0xe8)](_0x33a835(0x228))));}else{if(_0x84c2d4[_0x33a835(0x294)]===0x0){if(_0x45825a&&_0x5c1b55)console['log'](_0x33a835(0x1d9)+_0x45825a+'.'+_0x5c1b55);else _0x45825a?console['log'](_0x33a835(0x287)+_0x45825a):console[_0x33a835(0x204)]('No\x20sessions\x20found');}else await this[_0x33a835(0x1e9)](_0x84c2d4,_0x5ba8fc,_0x45825a);}}return 0x0;}[a54_0x3a8226(0x19b)](_0x491d0,_0x5c563b){const _0x4230b4=a54_0x3a8226,_0x159f3e=[],_0x4d4c6d=new Map();let _0x2265fe=Infinity,_0x5ef098=-Infinity;for(const _0x5f0dbe of _0x491d0){if(_0x5f0dbe[_0x4230b4(0x212)]?.['createdAt']){const _0x4285c1=new Date(_0x5f0dbe[_0x4230b4(0x212)][_0x4230b4(0x1af)])[_0x4230b4(0x1a1)](),_0xf320f3=_0x5f0dbe['lastAttempt'][_0x4230b4(0x11f)]?new Date(_0x5f0dbe[_0x4230b4(0x212)][_0x4230b4(0x11f)])[_0x4230b4(0x1a1)]():Date[_0x4230b4(0x237)](),_0x55838b=_0x5f0dbe[_0x4230b4(0x1cb)]?.[_0x4230b4(0xf9)]||'(unknown)';!_0x4d4c6d['has'](_0x55838b)&&_0x4d4c6d[_0x4230b4(0x277)](_0x55838b,[]),_0x4d4c6d[_0x4230b4(0x1d4)](_0x55838b)['push']({'session':_0x5f0dbe,'startTime':_0x4285c1,'endTime':_0xf320f3,'duration':_0xf320f3-_0x4285c1}),_0x2265fe=Math[_0x4230b4(0x23a)](_0x2265fe,_0x4285c1),_0x5ef098=Math[_0x4230b4(0xf7)](_0x5ef098,_0xf320f3);}}if(_0x4d4c6d['size']===0x0)return _0x4230b4(0x19d);const _0x35284c=process[_0x4230b4(0x1f6)]['columns']||0x78,_0x1af0b9=0x1e,_0x44ec40=0x32,_0x331d5e=0x4,_0x186c58=Math[_0x4230b4(0x23a)](_0x44ec40,Math[_0x4230b4(0xf7)](_0x1af0b9,Math['floor'](_0x35284c*0.3))),_0x409a9c=_0x35284c-_0x186c58-TIMELINE_CONFIG[_0x4230b4(0xf5)]-0x3-_0x331d5e,_0x2e0d7b=_0x5ef098-_0x2265fe,_0x60003e=_0x2e0d7b/_0x186c58,_0x1e3c4b=renderTimeAxis({'startTime':_0x2265fe,'endTime':_0x5ef098,'durationMs':_0x2e0d7b,'msPerChar':_0x60003e},_0x186c58),_0x1d7e21=[];for(const _0x266ab9 of _0x4d4c6d[_0x4230b4(0x219)]()){_0x1d7e21[_0x4230b4(0x23c)](..._0x266ab9);}_0x1d7e21['sort']((_0x4c09b2,_0x27110a)=>_0x27110a[_0x4230b4(0x21f)]-_0x4c09b2[_0x4230b4(0x21f)]);const _0x439d63=new Date(_0x2265fe),_0x3fe888=formatDate(_0x439d63),_0x9fffca=_0x331d5e+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x409a9c,_0x56b084='\x20'[_0x4230b4(0x16d)](_0x9fffca-_0x3fe888[_0x4230b4(0x294)]),_0xa390b0=_0x56b084+a54_0x1e596b[_0x4230b4(0xe8)](_0x3fe888)+'\x20'+_0x1e3c4b;_0x159f3e[_0x4230b4(0x23c)](_0xa390b0);const _0x10659c=0x16;let _0x13dfc5=0x0;for(const _0x3d70a3 of _0x1d7e21){const _0x5b78ff=_0x3d70a3['session'][_0x4230b4(0x1cb)]?.[_0x4230b4(0xf9)]||'?',_0x4355cf=Math[_0x4230b4(0x23a)](stringWidth(_0x5b78ff),_0x10659c);_0x13dfc5=Math[_0x4230b4(0xf7)](_0x13dfc5,_0x4355cf);}for(const _0x42128e of _0x1d7e21){const {session:_0x5e5c59,startTime:_0x1cbd65,endTime:_0x30c56b,duration:_0x3371fe}=_0x42128e,_0x3b6ad3=_0x5e5c59[_0x4230b4(0x1cb)]?.['id'],_0x1ef1c3=_0x5e5c59['id'],_0x9dc6ee=_0x5e5c59['project']?.[_0x4230b4(0xf9)]||'?',_0xe1159f=_0x5e5c59[_0x4230b4(0x267)]?.[_0x4230b4(0xf9)]||'?';let _0x1e0950,_0x5d3758;if(_0x5e5c59['lastAttempt']){const _0x4c4674=_0x5e5c59[_0x4230b4(0x212)];!_0x4c4674[_0x4230b4(0x20a)]?(_0x1e0950=_0x4c4674[_0x4230b4(0x29e)]?'🛑':'🔄',_0x5d3758=_0x4c4674[_0x4230b4(0x29e)]?a54_0x1e596b[_0x4230b4(0x1f4)]:a54_0x1e596b['blue']):(_0x1e0950=_0x4c4674[_0x4230b4(0x1b0)]?'✅':'❌',_0x5d3758=_0x4c4674[_0x4230b4(0x1b0)]?a54_0x1e596b[_0x4230b4(0xfb)]:a54_0x1e596b[_0x4230b4(0x227)]);}else _0x1e0950='⏳',_0x5d3758=a54_0x1e596b['dim'];const _0x3ed7ae='#'+_0x1ef1c3,_0x249fd3=_0x3b6ad3?hyperlink(_0x3ed7ae,getWorkflowSessionUrl(_0x5c563b,_0x3b6ad3,_0x1ef1c3)):_0x3ed7ae;let _0x370dc1=_0x9dc6ee;stringWidth(_0x9dc6ee)>_0x10659c&&(_0x370dc1=_0x9dc6ee[_0x4230b4(0x12b)](0x0,_0x10659c-0x1)+'…');const _0x23c3f5=a54_0x1e596b[_0x4230b4(0xe8)](_0x370dc1),_0x209207=stringWidth(_0x370dc1),_0x4417f2='\x20'[_0x4230b4(0x16d)](_0x13dfc5-stringWidth(_0x370dc1)+0x2),_0xeb853c='('+formatElapsed(_0x3371fe)+')',_0x403c92=stringWidth(_0xeb853c),_0x47cb74=stringWidth(_0x3ed7ae),_0x265aa1=_0x47cb74+0x1+_0x209207+_0x4417f2[_0x4230b4(0x294)],_0x2864f0=_0x409a9c-_0x265aa1-_0x403c92-0x1-0x8;let _0x22044a=_0xe1159f;stringWidth(_0x22044a)>_0x2864f0&&(_0x22044a=_0x22044a[_0x4230b4(0x12b)](0x0,_0x2864f0-0x1)+'…');const _0x49a2ce=_0x249fd3+'\x20'+_0x23c3f5+_0x4417f2+_0x22044a,_0x127556=stringWidth(_0x49a2ce),_0x1e8618=_0x409a9c-_0x127556-_0x403c92,_0x5fe5f1=_0x49a2ce+'\x20'[_0x4230b4(0x16d)](Math[_0x4230b4(0xf7)](0x1,_0x1e8618))+a54_0x1e596b[_0x4230b4(0xe8)](_0xeb853c),_0x475c77=Math[_0x4230b4(0x20e)]((_0x1cbd65-_0x2265fe)/_0x60003e),_0x3ca9bb=Math[_0x4230b4(0x20e)]((_0x30c56b-_0x2265fe)/_0x60003e),_0x11c260=Math['max'](_0x475c77+0x1,_0x3ca9bb),_0x57b80a=new Array(_0x186c58)['fill']('\x20');for(let _0x1e0f9c=_0x475c77;_0x1e0f9c<Math[_0x4230b4(0x23a)](_0x11c260,_0x186c58);_0x1e0f9c++){_0x57b80a[_0x1e0f9c]='─';}const _0x46718b=_0x57b80a[_0x4230b4(0x1bc)](_0xdcf08e=>_0xdcf08e==='\x20'?'\x20':_0x5d3758(_0xdcf08e))[_0x4230b4(0x258)]('');_0x159f3e[_0x4230b4(0x23c)](_0x1e0950+'\x20'+_0x5fe5f1+'│'+_0x46718b+'│');}return _0x159f3e[_0x4230b4(0x258)]('\x0a');}async[a54_0x3a8226(0x1e9)](_0x284b6b,_0x1f35d1,_0x131c9b){const _0x1d8a28=a54_0x3a8226,{options:_0x1f3df7,tdx:_0xd07563}=_0x1f35d1,_0x4cd32f=_0x1f3df7['site'],{timelineRows:_0x16b80d,timeAxisHeader:_0x44c247}=this[_0x1d8a28(0x1ee)](_0x284b6b,_0x4cd32f),_0x18c593=_0x16b80d['filter'](_0x56def0=>_0x56def0[_0x1d8a28(0x1e2)]);if(_0x18c593[_0x1d8a28(0x294)]===0x0){const _0x2eda33=this['renderSessionsTimeline'](_0x284b6b,_0x4cd32f);console['log'](_0x2eda33);!_0x131c9b&&(console[_0x1d8a28(0x26f)](''),console['error'](a54_0x1e596b[_0x1d8a28(0xe8)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a54_0x1e596b[_0x1d8a28(0xe8)](_0x1d8a28(0x13f))+'or'+a54_0x1e596b[_0x1d8a28(0xe8)](_0x1d8a28(0x228))));return;}_0x44c247&&console[_0x1d8a28(0x204)](_0x44c247);const _0x4e6bc9=_0x16b80d[_0x1d8a28(0x242)](_0x44030b=>_0x44030b[_0x1d8a28(0x1e2)])[_0x1d8a28(0x1bc)](_0x5f135f=>({'title':_0x5f135f[_0x1d8a28(0x147)],'value':_0x5f135f[_0x1d8a28(0x1e2)]})),_0x52f479=process[_0x1d8a28(0x1f6)]['rows']||0x3c,_0x36545a=Math['max'](0x28,Math[_0x1d8a28(0x20e)](_0x52f479*0x2/0x3)),_0x25961d=await a54_0x89dadd({'type':_0x1d8a28(0x119),'name':_0x1d8a28(0x1e2),'message':_0x1d8a28(0x1cf),'choices':_0x4e6bc9,'initial':-0x1,'limit':_0x36545a,'clearFirst':!![],'fallback':{'title':_0x1d8a28(0x1c3),'value':null},'suggest':(_0x50af13,_0x49149d)=>{const _0x4f432a=_0x1d8a28;if(!_0x50af13)return Promise[_0x4f432a(0x15b)](_0x49149d);const _0x5a8ce3=_0x49149d['filter'](_0x3866db=>{const _0x516cce=_0x4f432a,_0x122f81=_0x3866db;return _0x122f81[_0x516cce(0xee)][_0x516cce(0x1ad)]()[_0x516cce(0x127)](_0x50af13['toLowerCase']());});return Promise[_0x4f432a(0x15b)](_0x5a8ce3);}}),_0x54b74f=()=>{const _0x40d3b1=_0x1d8a28;process[_0x40d3b1(0x1f6)][_0x40d3b1(0x1a7)](_0x40d3b1(0x1d5)),process[_0x40d3b1(0x1f6)]['write'](_0x40d3b1(0x1d5)),process[_0x40d3b1(0x1f6)][_0x40d3b1(0x1a7)](_0x40d3b1(0x1d5));},_0x575e74=_0x25961d&&_0x25961d[_0x1d8a28(0x1e2)]&&_0x25961d['attemptId']!==null&&_0x25961d[_0x1d8a28(0x1e2)][_0x1d8a28(0x190)]()!=='';if(!_0x575e74){_0x54b74f(),console['log'](a54_0x1e596b[_0x1d8a28(0xe8)]('Cancelled'));return;}_0x54b74f();const _0x5d9a57=_0x284b6b[_0x1d8a28(0x1da)](_0x2ad36c=>_0x2ad36c[_0x1d8a28(0x212)]?.['id']===_0x25961d[_0x1d8a28(0x1e2)]);if(_0x5d9a57){const _0x304733=_0x5d9a57[_0x1d8a28(0x1cb)]?.[_0x1d8a28(0xf9)]||'?',_0x2b42c3=_0x5d9a57[_0x1d8a28(0x267)]?.[_0x1d8a28(0xf9)]||'?';console[_0x1d8a28(0x204)](_0x1d8a28(0x183)+a54_0x1e596b[_0x1d8a28(0xe8)](_0x304733)+_0x1d8a28(0x1c7)+a54_0x1e596b[_0x1d8a28(0xe8)](_0x2b42c3));}const _0x500dfe=new WorkflowTimelineCommand();await _0x500dfe[_0x1d8a28(0x1cd)]({'args':[],'options':{..._0x1f3df7,'attemptId':_0x25961d[_0x1d8a28(0x1e2)]},'tdx':_0xd07563});}[a54_0x3a8226(0x1ee)](_0x211548,_0x59f9c6){const _0x197e5d=a54_0x3a8226,_0x10dee7=new Map();for(const _0x3baa95 of _0x211548){_0x3baa95['id']&&_0x3baa95['lastAttempt']?.['id']&&_0x10dee7['set'](_0x3baa95['id'],_0x3baa95[_0x197e5d(0x212)]['id']);}const _0x51158b=[];let _0x28dac9='';const _0x45b519=this[_0x197e5d(0x19b)](_0x211548,_0x59f9c6),_0x43079c=_0x45b519[_0x197e5d(0x10c)]('\x0a');for(const _0x5987f7 of _0x43079c){if(_0x5987f7[_0x197e5d(0x13e)](_0x197e5d(0x18d))||_0x5987f7[_0x197e5d(0x113)](/^\s+\d{4}-\d{2}-\d{2}/))_0x28dac9=_0x5987f7;else{if(_0x5987f7['match'](/^[✅❌🔄🛑⏳]/)){const _0x4f1d5e=_0x5987f7[_0x197e5d(0x113)](/#(\d+)/),_0x28313b=_0x4f1d5e?_0x4f1d5e[0x1]:null,_0x20c79b=_0x28313b?_0x10dee7[_0x197e5d(0x1d4)](_0x28313b)||null:null,_0x1e264a=_0x211548[_0x197e5d(0x1da)](_0x2b48cc=>_0x2b48cc['id']===_0x28313b),_0x357225=_0x1e264a?.[_0x197e5d(0x1cb)]?.[_0x197e5d(0xf9)]||'';_0x51158b[_0x197e5d(0x23c)]({'displayLine':_0x5987f7,'attemptId':_0x20c79b,'projectName':_0x357225});}}}return{'timelineRows':_0x51158b,'timeAxisHeader':_0x28dac9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1e3);['description']='List\x20workflow\x20attempts';async['execute'](_0x386d52){const _0x1c70e3=a54_0x3a8226,{options:_0x4a111b,args:_0x423549,tdx:_0x4fbbee}=_0x386d52,_0x5973cc=this[_0x1c70e3(0x1ef)](_0x423549,_0x4a111b);if(!_0x5973cc)return 0x1;const {projectName:_0x2d72d0,workflowName:_0x5c2954}=_0x5973cc,_0x159b36=_0x4a111b[_0x1c70e3(0x114)];if(_0x4a111b['verbose']){if(_0x2d72d0&&_0x5c2954)console[_0x1c70e3(0x26f)](_0x1c70e3(0x176)+_0x2d72d0+'.'+_0x5c2954);else _0x2d72d0&&console[_0x1c70e3(0x26f)](_0x1c70e3(0x20d)+_0x2d72d0);_0x159b36&&console[_0x1c70e3(0x26f)](_0x1c70e3(0x17d));}const _0x10d114=await withSpinner(_0x1c70e3(0x14b),()=>_0x4fbbee[_0x1c70e3(0x267)][_0x1c70e3(0x244)]({'projectName':_0x2d72d0,'workflowName':_0x5c2954,'includeRetried':_0x159b36,'limit':_0x4a111b[_0x1c70e3(0x171)]}),{'verbose':_0x4a111b[_0x1c70e3(0x272)]}),_0xb359c8=_0x10d114[_0x1c70e3(0x1ba)],_0x1b1a8f=_0x4a111b[_0x1c70e3(0x171)]||0x64,_0xc5621d=_0xb359c8[_0x1c70e3(0x294)]>=_0x1b1a8f?a54_0x1e596b[_0x1c70e3(0xe8)](_0x1c70e3(0x214)):'';console[_0x1c70e3(0x26f)](_0x1c70e3(0x151)+_0xb359c8[_0x1c70e3(0x294)]+_0x1c70e3(0xf0)+(_0xb359c8[_0x1c70e3(0x294)]!==0x1?'s':'')+_0xc5621d);if(_0x4a111b['format']==='json'||_0x4a111b['format']===_0x1c70e3(0x1c4)||_0x4a111b[_0x1c70e3(0x275)]===_0x1c70e3(0x1a4))await handleSDKOutput(_0xb359c8,_0x4a111b);else{if(_0xb359c8[_0x1c70e3(0x294)]===0x0){if(_0x2d72d0&&_0x5c2954)console['log'](_0x1c70e3(0x28b)+_0x2d72d0+'.'+_0x5c2954);else _0x2d72d0?console[_0x1c70e3(0x204)](_0x1c70e3(0x2a8)+_0x2d72d0):console[_0x1c70e3(0x204)](_0x1c70e3(0x265));}else{const _0xd8cb19=_0x4a111b[_0x1c70e3(0x241)],_0x3391f4=_0xb359c8[_0x1c70e3(0x1bc)](_0x3b8758=>{const _0x3e4dd3=_0x1c70e3,_0x3ef7c9=a54_0x1e596b['dim']('#'+_0x3b8758['id']),_0x4d6fae=_0x3b8758[_0x3e4dd3(0x1cb)]?.['id'],_0x177252=_0x3b8758[_0x3e4dd3(0x195)]||_0x3b8758[_0x3e4dd3(0x1ff)],_0x3d3bb3=_0x4d6fae&&_0x177252?hyperlink(_0x3ef7c9,getWorkflowAttemptUrl(_0xd8cb19,_0x4d6fae,_0x177252,_0x3b8758['id'])):_0x3ef7c9,{icon:_0x2478c6,text:_0x46f291}=getAttemptStatusDisplay(_0x3b8758),_0x4a917d=(_0x3b8758[_0x3e4dd3(0x1cb)]?.['name']||'?')+'.'+(_0x3b8758['workflow']?.[_0x3e4dd3(0xf9)]||'?'),_0xce8a21=_0x3b8758[_0x3e4dd3(0x194)]?a54_0x1e596b[_0x3e4dd3(0xe8)](_0x3b8758[_0x3e4dd3(0x194)]):'';return(_0x3d3bb3+'\x20'+_0x2478c6+(_0x46f291?'\x20'+_0x46f291:'')+'\x20'+_0x4a917d+'\x20'+_0xce8a21)[_0x3e4dd3(0x285)]();});await writeOutput(_0x3391f4[_0x1c70e3(0x258)]('\x0a'),_0x4a111b['output'],_0x1c70e3(0x110));}}return 0x0;}}function a54_0x5eae(){const _0x2767fc=['newProjectId','padStart','⚠\x20Showing\x20first\x20','key','sessionId','\x20\x20Attempt\x20ID:\x20','Starting\x20workflow\x20run...','\x20has\x20no\x20attempts','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','log','workflow:logs','white','\x0aPush\x20these\x20changes?','LABEL_MIN_SPACING','end','done','download','workflow:push','Filter:\x20project=','floor','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20session','\x0aDry\x20run\x20-\x20no\x20files\x20written','lastAttempt','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20(use\x20--limit\x20to\x20show\x20more)','.\x20Expected\x20format:\x20KEY=VALUE','\x0a✔\x20Already\x20up\x20to\x20date','\x20of\x20','start','values','Loading\x20sessions...','executeCloneProject','splice','\x20\x20Project:\x20','Killing\x20attempt...','startTime','summary','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Error:\x20Invalid\x20parameter\x20format:\x20','Key:\x20','\x20tasks','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20Revision:\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','basename','columns','workflowProject','→\x20Project:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Listing\x20workflows...','setSecrets','output','\x20unchanged','localeCompare','4474419zDaktN','Setting\x20','now','🔄\x20','indexOf','min','status','push','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Error:','index','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','site','filter','text','attempts','round','MAX_LABEL_COUNT','sys','✔\x20Pull\x20complete','projectName','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Deleting\x20project\x20','nextRunTime','state','Using\x20attempt\x20','path','Validation:\x20skipped','/attempt/','buildTimelineData','revision:\x20','fromTask','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflows','Fetching\x20log\x20files...','join','attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','every','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','List\x20all\x20workflow\x20projects','\x20schedule','isNewProject','Project\x20directory:\x20','\x0a⚠\x20Project\x20\x22','MAX_TIMELINE_WIDTH','List\x20workflow\x20execution\x20sessions','✔\x20Schedule\x20#','No\x20attempts\x20found','Auto-selected\x20latest\x20session:\x20','workflow','Analyzing\x20changes...','Task\x20name:\x20','\x20\x20Workflow:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Error:\x20','task','Source\x20directory\x20is\x20required','error','Source:\x20','relative','verbose','Error:\x20Secret\x20key\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','format','workflow:projects','set','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resolving\x20project\x20\x27','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','description','MAX_TASKS_DISPLAY','Select\x20a\x20task\x20to\x20view\x20logs:','\x0aDry\x20run\x20-\x20nothing\x20pushed','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','pending','retryAttempt','Select\x20a\x20workflow\x20to\x20run','Parameters:\x20','No\x20log\x20content\x20found','trimEnd','\x20\x20Target:\x20','No\x20sessions\x20found\x20in\x20project:\x20','follow','icon','workflow:secrets:delete','No\x20attempts\x20found\x20for:\x20','substring','fs/promises','Writing\x20files...','✔\x20Downloaded\x20','hasChanges','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','getFullYear','logFiles','length','MIN_LABEL_COUNT','workflow:run','projects','\x0aError:','message','group_error','attempt:','replace','✔\x20Workflow\x20run\x20started','cancelRequested','Listing\x20schedules...','isDirectory','\x27\x20from\x20project\x20\x27','Target\x20directory:\x20','planned','workflow:timeline','→\x20New\x20project:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','existingProjectId','No\x20attempts\x20found\x20in\x20project:\x20','cwd','6568704ymVtWb','No\x20sessions\x20found','unknown','dim','stringify','Downloading\x20project\x20','732664OGfkZA','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','title','workflow:schedules','\x20attempt','\x20project','getHours','Files\x20to\x20upload:\x20','Analyzing\x20project...','GUTTER','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','max','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','green','No\x20workflow\x20sessions\x20found','\x20is\x20not\x20a\x20directory','\x20-\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','fullName','deleted','\x20to\x20see\x20detailed\x20logs','Enabling\x20schedule\x20#','Source\x20directory:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','cyan','283272HiiwlA','\x22\x20to\x20new\x20project\x20\x22','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflowName','Pulling\x20project\x20','split','json','Retrying\x20session...','Resume\x20from:\x20','list','sourceProjectName','Params:\x20','match','includeRetried','tdx.json','Updating\x20','/app/workflows/','No\x20workflow\x20tdx.json\x20found','autocomplete','disableSchedule','\x0aDry\x20run\x20-\x20no\x20project\x20created','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','sourceDir','28HPZCBV','finishedAt','1954734FlZRIw','changes','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20disabled\x20(','Session\x20not\x20found:\x20','\x20\x20Location:\x20','\x20from\x20session\x20','includes','session','\x20\x20Changes:\x20','prepareCloneProject','slice','✔\x20Workflow\x20project\x20context\x20cleared.','Start\x20a\x20workflow\x20run','\x0aUpdate\x20existing\x20project\x20\x22','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0aApply\x20these\x20changes?','params','delete','\x0a✔\x20Attempt\x20complete','readFile','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','select','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','enableSchedule','Listing\x20secrets...','Pushing\x20project...','sessions','Session\x20time:\x20','startsWith','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','new','---\x20','/sessions/','modified','getMinutes','toLocaleString','✔\x20Project\x20updated','displayLine','updatedAt','\x20deleted','(unknown)','Listing\x20workflow\x20attempts...','💡\x20Tip:\x20Use\x20','-\x20nothing\x20pushed','taskName','Getting\x20attempt\x20details...','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','✔\x20Found\x20','workflow:download','pollTimeline','Latest\x20session\x20has\x20no\x20attempt','resolveProjectId','retryAttemptName','getDate','Error:\x20Invalid\x20JSON\x20in\x20--params','fileSize','\x20task','resolve','\x22?\x20This\x20cannot\x20be\x20undone.','msPerChar','projectId','window','requireProject','type','Workflow:\x20','List\x20workflows','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','showWorkflowConsoleUrl','Session\x20','Pattern:\x20','workflow:workflows','Project\x20filter:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x20workflow','repeat','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20\x20Source:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','limit','📅\x20#','Retry\x20a\x20session\x20or\x20attempt','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectDir','Filter:\x20','targetDir','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Console:\x20','workflow:attempt','\x20(disabled)','Include\x20retried:\x20yes','Dry\x20run:\x20yes','workflow:clone','Show\x20specific\x20attempt\x20details','✔\x20Showing\x20','diff','Project:\x20','New\x20project\x20name:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','Including\x20subtasks:\x20yes','Schedule\x20ID\x20is\x20required','-\x20no\x20files\x20written','\x20\x20Session\x20ID:\x20','No\x20projects\x20match\x20pattern:\x20','running','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','startedAt','Downloading\x20logs...','trim','workflow:schedule:disable','workflow:schedule:enable','MAX_POLL_ITERATIONS','sessionTime','session_id','newProjectName','duration','\x20logs','targetExists','Loading\x20session...','renderSessionsTimeline','✔\x20Pushed\x20','No\x20sessions\x20with\x20timing\x20information','Select\x20a\x20session\x20to\x20view\x20timeline:','✔\x20Secret\x20\x27','✔\x20Workflow\x20project\x20set\x20to:\x20','getTime','revision','\x20\x20Next\x20run:\x20','table','stat','Usage:\x20workflow:delete\x20<project-name-or-id>','write','metadata','executePushProject','fill','yes','all','toLowerCase','dryRun','createdAt','success','✔\x20Clone\x20complete','canceling','Warning:','Project\x20name\x20is\x20required','applyPullProject','Enable\x20a\x20workflow\x20schedule','Attempt:\x20','Disabling\x20schedule\x20#','3540925CGCvTX','data','Cancelled','map','total','Revision:\x20','No\x20workflows\x20found','Invalid\x20format:\x20','Attempt\x20ID:\x20','\x20\x20Project\x20ID:\x20','No\x20matching\x20sessions\x20found','jsonl','No\x20schedules\x20found','getMonth',',\x20Workflow:\x20','sort','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','retrySession','project','Target:\x20','execute','workflow:upload','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:tasks','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Pushing\x20workflow\x20project...','Setting\x20secret...','get','\x1b[1A\x1b[2K','deleteSecret','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','✔\x20Project:\x20','No\x20sessions\x20found\x20for:\x20','find','\x20\x20New\x20attempt\x20ID:\x20','Disable\x20a\x20workflow\x20schedule','POLL_INTERVAL_MS','skipValidation','blue','parse','Show\x20tasks\x20for\x20an\x20attempt','attemptId','workflow:attempts','Status:\x20','Expected\x20format:\x20--param\x20key=value','durationMs','\x20(system)','isTTY','navigateSessionsInteractive','workflow:secrets:set','Failed\x20to\x20fetch\x20attempt\x20data','2olbeqX','\x20new','generateSessionTimelineRows','parseProjectWorkflowPattern','resolveProject','disabledAt','renderTimeline','16995789OcUAtJ','yellow','workflow:sessions','stdout','renderSingleTimeline','\x20modified','...','keys'];a54_0x5eae=function(){return _0x2767fc;};return a54_0x5eae();}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x17b);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x180);async[a54_0x3a8226(0x1cd)](_0x223fa1){const _0x21a2d6=a54_0x3a8226,{options:_0x13e3f7,args:_0x3917bc,tdx:_0x580d41}=_0x223fa1,_0x2e9b1e=_0x3917bc[0x0];if(!_0x2e9b1e)return console['error'](_0x21a2d6(0x274)),0x1;_0x13e3f7['verbose']&&console[_0x21a2d6(0x26f)]('Attempt\x20ID:\x20'+_0x2e9b1e);const _0x5e0472=await withSpinner(_0x21a2d6(0x14f),()=>_0x580d41[_0x21a2d6(0x267)][_0x21a2d6(0x259)](_0x2e9b1e),{'verbose':_0x13e3f7[_0x21a2d6(0x272)]}),_0x30e7c4=_0x5e0472[_0x21a2d6(0x1ba)];let _0x26b1e9;!_0x30e7c4[_0x21a2d6(0x20a)]?_0x26b1e9=_0x30e7c4[_0x21a2d6(0x29e)]?_0x21a2d6(0x1b2):_0x21a2d6(0x18c):_0x26b1e9=_0x30e7c4[_0x21a2d6(0x1b0)]?'success':_0x21a2d6(0x26f);let _0x4cae02;if(_0x30e7c4[_0x21a2d6(0x1af)]&&_0x30e7c4[_0x21a2d6(0x11f)]){const _0x5729ec=new Date(_0x30e7c4[_0x21a2d6(0x1af)])[_0x21a2d6(0x1a1)](),_0x3c6382=new Date(_0x30e7c4[_0x21a2d6(0x11f)])[_0x21a2d6(0x1a1)]();_0x4cae02=Math[_0x21a2d6(0x245)]((_0x3c6382-_0x5729ec)/0x3e8);}const _0x298005={'attempt_id':_0x30e7c4['id'],'status':_0x26b1e9,..._0x30e7c4[_0x21a2d6(0x23f)]!==undefined&&{'index':_0x30e7c4[_0x21a2d6(0x23f)]},..._0x30e7c4['project']&&{'project':_0x30e7c4[_0x21a2d6(0x1cb)][_0x21a2d6(0xf9)]},..._0x30e7c4['workflow']&&{'workflow':_0x30e7c4['workflow'][_0x21a2d6(0xf9)]},..._0x30e7c4[_0x21a2d6(0x1ff)]&&{'session_id':_0x30e7c4[_0x21a2d6(0x1ff)]},..._0x30e7c4[_0x21a2d6(0x194)]&&{'session_time':_0x30e7c4[_0x21a2d6(0x194)]},..._0x30e7c4[_0x21a2d6(0x156)]&&{'retry_attempt':_0x30e7c4[_0x21a2d6(0x156)]},..._0x4cae02!==undefined&&{'duration_sec':_0x4cae02},..._0x30e7c4[_0x21a2d6(0x1af)]&&{'created_at':_0x30e7c4[_0x21a2d6(0x1af)]},..._0x30e7c4[_0x21a2d6(0x11f)]&&{'finished_at':_0x30e7c4['finishedAt']},...Object['keys'](_0x30e7c4['params'])['length']>0x0&&{'params':_0x30e7c4[_0x21a2d6(0x131)]}};return await handleSingleObjectOutput(_0x298005,_0x13e3f7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1d0);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1e1);async['execute'](_0x1e28d5){const _0x5f419e=a54_0x3a8226,{options:_0x38da9a,args:_0x5dde84,tdx:_0x1a37d8}=_0x1e28d5,_0x1a93fd=_0x5dde84[0x0];if(!_0x1a93fd)return console[_0x5f419e(0x26f)](_0x5f419e(0x274)),0x1;const _0x3b78b9=_0x38da9a['includeSubtasks'];_0x38da9a['verbose']&&(console[_0x5f419e(0x26f)](_0x5f419e(0x1c1)+_0x1a93fd),_0x3b78b9&&console[_0x5f419e(0x26f)](_0x5f419e(0x187)));const _0x206eca=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x1a37d8[_0x5f419e(0x267)][_0x5f419e(0x178)](_0x1a93fd,_0x3b78b9||![]),{'verbose':_0x38da9a[_0x5f419e(0x272)]}),_0x275d53=_0x206eca[_0x5f419e(0x1ba)];return console[_0x5f419e(0x26f)](_0x5f419e(0x151)+_0x275d53[_0x5f419e(0x294)]+_0x5f419e(0x15a)+(_0x275d53[_0x5f419e(0x294)]!==0x1?'s':'')),await handleSDKOutput(_0x275d53,_0x38da9a),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x205);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x26b);async[a54_0x3a8226(0x1cd)](_0x22ce77){const _0x39417e=a54_0x3a8226,{options:_0x342ea8,args:_0x5ea0ae,tdx:_0x3e9584}=_0x22ce77,_0x311d05=_0x5ea0ae[0x0];let _0xaec270=_0x5ea0ae[0x1];if(!_0x311d05)return console[_0x39417e(0x26f)](_0x39417e(0x274)),0x1;_0x342ea8[_0x39417e(0x272)]&&(console['error']('Attempt\x20ID:\x20'+_0x311d05),_0xaec270&&console['error'](_0x39417e(0x269)+_0xaec270));const _0x3495c9=await withSpinner(_0x39417e(0x257),()=>_0x3e9584['workflow'][_0x39417e(0x293)](_0x311d05,_0xaec270),{'verbose':_0x342ea8['verbose']}),_0x275b99=_0x3495c9['data'];if(_0x275b99[_0x39417e(0x294)]===0x0)return console[_0x39417e(0x26f)](_0x39417e(0x278)),0x0;if(!_0xaec270&&(_0x342ea8['json']||_0x342ea8['format']))return await handleSDKOutput(_0x275b99,_0x342ea8),0x0;if(!_0xaec270){const _0x32f3d1=_0x275b99[_0x39417e(0x1bc)](_0x442029=>({'title':_0x442029[_0x39417e(0x14e)]+'\x20('+formatBytes(_0x442029[_0x39417e(0x159)])+')','value':_0x442029['taskName']})),_0x53932c=await a54_0x89dadd({'type':_0x39417e(0x136),'name':_0x39417e(0x26d),'message':_0x39417e(0x27d),'choices':_0x32f3d1});if(!_0x53932c[_0x39417e(0x26d)])return console[_0x39417e(0x26f)](_0x39417e(0x1bb)),0x0;_0xaec270=_0x53932c[_0x39417e(0x26d)];}const _0x3c3ec5=await withSpinner(_0x39417e(0x18f),()=>_0x3e9584['workflow']['logs'](_0x311d05,_0xaec270),{'verbose':_0x342ea8[_0x39417e(0x272)]}),_0x4924f2=_0x3c3ec5[_0x39417e(0x1ba)];return _0x4924f2?console['log'](_0x4924f2):console[_0x39417e(0x26f)](_0x39417e(0x284)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:kill';['description']='Kill\x20a\x20running\x20attempt';async[a54_0x3a8226(0x1cd)](_0x4784c0){const _0x2428bc=a54_0x3a8226,{options:_0x3118d4,args:_0x365d91,tdx:_0x3325b8}=_0x4784c0,_0x4f8404=_0x365d91[0x0];if(!_0x4f8404)return console['error'](_0x2428bc(0x274)),0x1;const _0x305ffb=_0x3118d4['reason'];_0x3118d4['verbose']&&(console[_0x2428bc(0x26f)]('Attempt\x20ID:\x20'+_0x4f8404),_0x305ffb&&console[_0x2428bc(0x26f)]('Reason:\x20'+_0x305ffb));if(!_0x3118d4['yes']){if(!isInteractive())return console[_0x2428bc(0x26f)](a54_0x1e596b['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x1e596b[_0x2428bc(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56db1a=await confirmKey(_0x2428bc(0x1d1)+_0x4f8404+'?');if(!_0x56db1a)return console[_0x2428bc(0x26f)](a54_0x1e596b[_0x2428bc(0x1f4)](_0x2428bc(0x1bb))),0x1;}const _0x3eb5ed=await withSpinner(_0x2428bc(0x21e),()=>_0x3325b8['workflow']['kill'](_0x4f8404,_0x305ffb),{'verbose':_0x3118d4['verbose']}),_0x1f3dd2=_0x3eb5ed[_0x2428bc(0x1ba)];return console[_0x2428bc(0x26f)]('✔\x20'+_0x1f3dd2),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:retry';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x173);async[a54_0x3a8226(0x1cd)](_0x2d5d8b){const _0x3582ec=a54_0x3a8226,{options:_0x49c2e8,args:_0x2c06ee,tdx:_0x18ef56}=_0x2d5d8b,_0x27773c=_0x2c06ee[0x0];if(!_0x27773c)return console[_0x3582ec(0x26f)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3582ec(0x26f)](_0x3582ec(0x11c)),0x1;let _0x1a0771=![],_0x48ab51=_0x27773c;if(_0x27773c[_0x3582ec(0x13e)]('session:'))_0x1a0771=!![],_0x48ab51=_0x27773c['substring'](0x8);else{if(_0x27773c[_0x3582ec(0x13e)](_0x3582ec(0x29b)))_0x1a0771=![],_0x48ab51=_0x27773c[_0x3582ec(0x28c)](0x8);else return console[_0x3582ec(0x26f)](_0x3582ec(0xf8)),console[_0x3582ec(0x26f)](_0x3582ec(0x11c)),0x1;}const _0x4537a7=_0x49c2e8[_0x3582ec(0x254)],_0x130b23=_0x49c2e8['resumeFrom'],_0x482cfa=_0x49c2e8[_0x3582ec(0x131)],_0x3df70b=_0x49c2e8['force'];_0x49c2e8[_0x3582ec(0x272)]&&(console[_0x3582ec(0x26f)](_0x3582ec(0x1cc)+(_0x1a0771?_0x3582ec(0x128):_0x3582ec(0x259))+'\x20'+_0x48ab51),_0x4537a7&&console['error']('From\x20task:\x20'+_0x4537a7),_0x130b23&&console[_0x3582ec(0x26f)](_0x3582ec(0x10f)+_0x130b23),_0x482cfa&&console[_0x3582ec(0x26f)](_0x3582ec(0x112)+_0x482cfa),_0x3df70b&&console[_0x3582ec(0x26f)]('Force:\x20yes'));let _0x5daf0b;if(_0x482cfa)try{if(_0x482cfa[_0x3582ec(0x13e)]('@')){const _0x2ac93a=await import(_0x3582ec(0x28d)),_0x3a7cdc=_0x482cfa[_0x3582ec(0x28c)](0x1),_0x17a507=await _0x2ac93a[_0x3582ec(0x134)](_0x3a7cdc,'utf-8');_0x5daf0b=JSON[_0x3582ec(0x1e0)](_0x17a507);}else _0x5daf0b=JSON[_0x3582ec(0x1e0)](_0x482cfa);}catch{return console['error'](_0x3582ec(0x158)),0x1;}if(!_0x49c2e8[_0x3582ec(0x1ab)]){if(!isInteractive())return console[_0x3582ec(0x26f)](a54_0x1e596b[_0x3582ec(0x227)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3582ec(0x26f)](a54_0x1e596b[_0x3582ec(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x14d83d=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x1a0771?'session':_0x3582ec(0x259))+'\x20'+_0x48ab51+'?');if(!_0x14d83d)return console[_0x3582ec(0x26f)](a54_0x1e596b['yellow'](_0x3582ec(0x1bb))),0x1;}let _0x9d783a;_0x1a0771?_0x9d783a=await withSpinner(_0x3582ec(0x10e),()=>_0x18ef56[_0x3582ec(0x267)][_0x3582ec(0x1ca)](_0x48ab51,{'fromTask':_0x4537a7,'retryParams':_0x5daf0b}),{'verbose':_0x49c2e8[_0x3582ec(0x272)]}):_0x9d783a=await withSpinner('Retrying\x20attempt...',()=>_0x18ef56[_0x3582ec(0x267)][_0x3582ec(0x281)](_0x48ab51,{'resumeFrom':_0x130b23,'retryParams':_0x5daf0b,'force':_0x3df70b}),{'verbose':_0x49c2e8[_0x3582ec(0x272)]});const _0xb724d6=_0x9d783a[_0x3582ec(0x1ba)];return console[_0x3582ec(0x26f)]('✔\x20Retry\x20started'),console[_0x3582ec(0x26f)](_0x3582ec(0x1db)+_0xb724d6['attemptId']),console[_0x3582ec(0x26f)](_0x3582ec(0x18a)+_0xb724d6['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x3a8226(0x296);['description']=a54_0x3a8226(0x12d);async[a54_0x3a8226(0x1cd)](_0x32375f){const _0x476459=a54_0x3a8226,{options:_0x293de3,args:_0x5e48a3,tdx:_0x35cb2c}=_0x32375f;let _0x4b836f=_0x5e48a3[0x0];if(!_0x4b836f){const _0x43f4dc=this[_0x476459(0x1f0)]([],_0x293de3),_0x440198=await withSpinner('Loading\x20workflows...',()=>_0x35cb2c[_0x476459(0x267)][_0x476459(0x256)](_0x43f4dc,{'limit':_0x293de3[_0x476459(0x171)]}),{'verbose':_0x293de3[_0x476459(0x272)]}),_0x1d7a44=_0x440198[_0x476459(0x1ba)];if(_0x1d7a44[_0x476459(0x294)]===0x0)return console['error'](_0x476459(0x1bf)),!_0x43f4dc&&console[_0x476459(0x26f)](a54_0x1e596b[_0x476459(0xe8)](_0x476459(0x185))),0x1;const _0x321260=_0x1d7a44[_0x476459(0x1bc)](_0x2d4ee7=>({'title':_0x2d4ee7[_0x476459(0x1cb)]?.['name']+'.'+_0x2d4ee7[_0x476459(0xf9)],'value':_0x2d4ee7['project']?.[_0x476459(0xf9)]+'.'+_0x2d4ee7[_0x476459(0xf9)],'description':_0x2d4ee7[_0x476459(0x1a2)]?_0x476459(0x253)+_0x2d4ee7[_0x476459(0x1a2)]:undefined})),_0x56becb=await a54_0x89dadd({'type':'select','name':_0x476459(0x267),'message':_0x476459(0x282),'choices':_0x321260});if(!_0x56becb[_0x476459(0x267)])return 0x1;_0x4b836f=_0x56becb[_0x476459(0x267)];}if(!_0x4b836f[_0x476459(0x127)]('.')){const _0x547013=this['resolveProject']([],_0x293de3);if(_0x547013)_0x4b836f=_0x547013+'.'+_0x4b836f;else return console['error'](a54_0x1e596b[_0x476459(0x227)]('Error:'),_0x476459(0x138)),console[_0x476459(0x26f)](a54_0x1e596b[_0x476459(0xe8)](_0x476459(0x185))),0x1;}const _0x3af332=_0x293de3['param'],_0x988825=_0x293de3['sessionTime'],_0x2a19dc={};if(_0x3af332&&Array['isArray'](_0x3af332))for(const _0xa0e28 of _0x3af332){const _0x2040a5=_0xa0e28[_0x476459(0x239)]('=');if(_0x2040a5===-0x1)return console[_0x476459(0x26f)](_0x476459(0x223)+_0xa0e28),console['error'](_0x476459(0x1e5)),0x1;const _0x5acfd9=_0xa0e28[_0x476459(0x28c)](0x0,_0x2040a5),_0x57b538=_0xa0e28['substring'](_0x2040a5+0x1);try{_0x2a19dc[_0x5acfd9]=JSON[_0x476459(0x1e0)](_0x57b538);}catch{_0x2a19dc[_0x5acfd9]=_0x57b538;}}_0x293de3[_0x476459(0x272)]&&(console['error'](_0x476459(0x162)+_0x4b836f),Object[_0x476459(0x1fa)](_0x2a19dc)[_0x476459(0x294)]>0x0&&console['error'](_0x476459(0x283)+JSON[_0x476459(0xe9)](_0x2a19dc)),_0x988825&&console[_0x476459(0x26f)](_0x476459(0x13d)+_0x988825));const _0x17e630=await withSpinner(_0x476459(0x201),()=>_0x35cb2c['workflow']['run'](_0x4b836f,_0x2a19dc,{'sessionTime':_0x988825}),{'verbose':_0x293de3['verbose']}),_0x4bd845=_0x17e630['data'];console[_0x476459(0x26f)](_0x476459(0x29d)),console[_0x476459(0x26f)](_0x476459(0x200)+_0x4bd845['id']),console['error'](_0x476459(0x18a)+_0x4bd845['sessionId']),console[_0x476459(0x26f)](_0x476459(0x21d)+_0x4bd845['project']?.[_0x476459(0xf9)]),console[_0x476459(0x26f)](_0x476459(0x26a)+_0x4bd845['workflow']?.[_0x476459(0xf9)]);if(_0x4bd845[_0x476459(0x1cb)]?.['id']&&_0x4bd845[_0x476459(0x1ff)]&&_0x4bd845['id']){const _0x3d440d=_0x293de3['site'],_0x2fd595=getConsoleUrl(_0x3d440d,_0x476459(0x117)+_0x4bd845[_0x476459(0x1cb)]['id']+_0x476459(0x142)+_0x4bd845[_0x476459(0x1ff)]+_0x476459(0x251)+_0x4bd845['id']);console[_0x476459(0x26f)]('\x20\x20Console:\x20'+a54_0x1e596b[_0x476459(0x106)](_0x2fd595));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x3a8226(0x152);['description']=a54_0x3a8226(0x27a);async[a54_0x3a8226(0x1cd)](_0x58a88e){const _0x3efd43=a54_0x3a8226,{options:_0x26f344,args:_0x4b38c5,tdx:_0x6387d}=_0x58a88e,_0x164760=_0x4b38c5[0x0],_0xaf2b3=_0x4b38c5[0x1]||'.';if(!_0x164760)return console[_0x3efd43(0x26f)](_0x3efd43(0xec)),console[_0x3efd43(0x26f)](_0x3efd43(0x109)),0x1;const _0x555945=_0x26f344[_0x3efd43(0x1a2)];_0x26f344[_0x3efd43(0x272)]&&(console[_0x3efd43(0x26f)](_0x3efd43(0x183)+_0x164760),console[_0x3efd43(0x26f)]('Output\x20directory:\x20'+_0xaf2b3),_0x555945&&console[_0x3efd43(0x26f)]('Revision:\x20'+_0x555945));const _0x3313d8=await withSpinner(_0x3efd43(0xea)+_0x164760+_0x3efd43(0x1f9),()=>_0x6387d[_0x3efd43(0x267)][_0x3efd43(0x20b)](_0x164760,_0xaf2b3,{'revision':_0x555945}),{'verbose':_0x26f344[_0x3efd43(0x272)]}),_0x416737=_0x3313d8[_0x3efd43(0x1ba)];return console[_0x3efd43(0x26f)](_0x3efd43(0x28f)+_0x416737[_0x3efd43(0x249)]),console[_0x3efd43(0x26f)](_0x3efd43(0x229)+_0x416737[_0x3efd43(0x1a2)]),console[_0x3efd43(0x26f)]('\x20\x20Files\x20extracted:\x20'+_0x416737['filesExtracted']),console[_0x3efd43(0x26f)](_0x3efd43(0x125)+_0xaf2b3+'/'+_0x416737['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1ce);['description']=a54_0x3a8226(0x16b);async[a54_0x3a8226(0x1cd)](_0xf0f619){const _0x430a8d=a54_0x3a8226,{options:_0x44294a,args:_0x1da9e3,tdx:_0x3ce793}=_0xf0f619;let _0x26b18a='.',_0x196595=_0x44294a[_0x430a8d(0xf9)];if(_0x1da9e3[0x0]){const {promises:_0xc1dd22}=await import('fs');try{const _0x267703=await _0xc1dd22[_0x430a8d(0x1a5)](_0x1da9e3[0x0]);if(_0x267703[_0x430a8d(0x2a0)]())_0x26b18a=_0x1da9e3[0x0];else return console['error'](_0x430a8d(0x26c)+_0x1da9e3[0x0]+_0x430a8d(0xfd)),0x1;}catch{_0x196595=_0x1da9e3[0x0],_0x26b18a='.';}}const _0x3b2dbe=_0x44294a[_0x430a8d(0x1a2)],_0x1262cc=_0x44294a[_0x430a8d(0x1de)];_0x44294a[_0x430a8d(0x272)]&&(console[_0x430a8d(0x26f)](_0x430a8d(0x260)+_0x26b18a),_0x196595&&console['error']('Project\x20name:\x20'+_0x196595),_0x3b2dbe&&console[_0x430a8d(0x26f)]('Revision:\x20'+_0x3b2dbe),_0x1262cc&&console[_0x430a8d(0x26f)]('Validation:\x20skipped'));const _0x28af5a=await withSpinner(_0x430a8d(0x1d2),()=>_0x3ce793['workflow'][_0x430a8d(0x23c)](_0x26b18a,{'projectName':_0x196595,'revision':_0x3b2dbe,'skipValidation':_0x1262cc}),{'verbose':_0x44294a['verbose']}),_0x30f1fb=_0x28af5a[_0x430a8d(0x1ba)];return console[_0x430a8d(0x26f)](_0x430a8d(0x19c)+_0x30f1fb['projectName']),console[_0x430a8d(0x26f)](_0x430a8d(0x1c2)+_0x30f1fb[_0x430a8d(0x15e)]),console[_0x430a8d(0x26f)]('\x20\x20Revision:\x20'+_0x30f1fb[_0x430a8d(0x1a2)]),await this[_0x430a8d(0x165)](_0x3ce793,_0x30f1fb[_0x430a8d(0x249)],_0x44294a[_0x430a8d(0x241)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']='workflow:pull';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x16e);async[a54_0x3a8226(0x1cd)](_0x29c085){const _0x59e0e7=a54_0x3a8226,{options:_0x42c5f4,args:_0x28004b,tdx:_0x14b2b5}=_0x29c085,_0x25894f=_0x28004b[0x0],_0x2398b8=_0x28004b[0x1];if(!_0x25894f)return console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0x227)](_0x59e0e7(0x23e)),_0x59e0e7(0x1b4)),console['error'](a54_0x1e596b[_0x59e0e7(0xe8)](_0x59e0e7(0x291))),0x1;const _0x340788=_0x42c5f4[_0x59e0e7(0x1a2)];_0x42c5f4['verbose']&&(console[_0x59e0e7(0x26f)](_0x59e0e7(0x183)+_0x25894f),_0x2398b8&&console[_0x59e0e7(0x26f)](_0x59e0e7(0x2a2)+_0x2398b8),_0x340788&&console[_0x59e0e7(0x26f)]('Revision:\x20'+_0x340788),_0x42c5f4['dryRun']&&console[_0x59e0e7(0x26f)](_0x59e0e7(0x17e)));const _0x54d63a=await withSpinner(_0x59e0e7(0x10b)+_0x25894f+_0x59e0e7(0x1f9),()=>_0x14b2b5['workflow']['pullProject'](_0x25894f,{'targetDir':_0x2398b8,'revision':_0x340788}),{'verbose':_0x42c5f4[_0x59e0e7(0x272)]}),_0x2d2f9f=_0x54d63a[_0x59e0e7(0x1ba)];_0x2d2f9f[_0x59e0e7(0x25f)]?console['error'](_0x59e0e7(0x2a5)+_0x2d2f9f[_0x59e0e7(0x249)]):console[_0x59e0e7(0x26f)](_0x59e0e7(0x22e)+_0x2d2f9f[_0x59e0e7(0x249)]);console[_0x59e0e7(0x26f)](_0x59e0e7(0x229)+_0x2d2f9f[_0x59e0e7(0x1a2)]),console[_0x59e0e7(0x26f)](_0x59e0e7(0x286)+(a54_0x1e7b2e[_0x59e0e7(0x271)](process['cwd'](),_0x2d2f9f[_0x59e0e7(0x177)])||'.')),console['error']('\x20\x20Changes:\x20'+a54_0x1e596b['green']('+'+_0x2d2f9f[_0x59e0e7(0x220)][_0x59e0e7(0x140)]+_0x59e0e7(0x1ed))+',\x20'+(a54_0x1e596b['yellow']('~'+_0x2d2f9f['summary'][_0x59e0e7(0x143)]+'\x20modified')+',\x20')+(a54_0x1e596b['red']('-'+_0x2d2f9f[_0x59e0e7(0x220)][_0x59e0e7(0x101)]+_0x59e0e7(0x149))+',\x20')+(''+a54_0x1e596b['dim'](_0x2d2f9f[_0x59e0e7(0x220)]['unchanged']+_0x59e0e7(0x233))));for(const _0x30e72e of _0x2d2f9f[_0x59e0e7(0x121)]){_0x30e72e[_0x59e0e7(0x161)]===_0x59e0e7(0x143)&&_0x30e72e[_0x59e0e7(0x182)]&&(console[_0x59e0e7(0x26f)]('\x0a'+a54_0x1e596b[_0x59e0e7(0x106)](_0x59e0e7(0x141)+_0x30e72e[_0x59e0e7(0x24f)])),console[_0x59e0e7(0x26f)](_0x30e72e['diff']));}if(!_0x2d2f9f[_0x59e0e7(0x290)])return saveSessionContext({'workflow_project':_0x2d2f9f[_0x59e0e7(0x249)]},_0x42c5f4[_0x59e0e7(0x128)]),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xfb)](_0x59e0e7(0x216))),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xe8)](_0x59e0e7(0x2a6)+_0x2d2f9f[_0x59e0e7(0x249)])),0x0;if(_0x42c5f4[_0x59e0e7(0x1ae)])return console[_0x59e0e7(0x26f)](a54_0x1e596b['yellow'](_0x59e0e7(0x211))),0x0;if(!_0x42c5f4[_0x59e0e7(0x1ab)]){if(!isInteractive())return console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0x227)](_0x59e0e7(0x298)),_0x59e0e7(0x170)),console[_0x59e0e7(0x26f)](a54_0x1e596b['dim'](_0x59e0e7(0x226))),0x1;const _0x53bbe8=await confirmKey(_0x59e0e7(0x130));if(!_0x53bbe8)return console['error'](a54_0x1e596b[_0x59e0e7(0x1f4)](_0x59e0e7(0x1bb)),_0x59e0e7(0x189)),0x1;}await withSpinner(_0x59e0e7(0x28e),()=>_0x14b2b5[_0x59e0e7(0x267)][_0x59e0e7(0x1b5)](_0x2d2f9f,{'revision':_0x340788}),{'verbose':_0x42c5f4['verbose']}),saveSessionContext({'workflow_project':_0x2d2f9f[_0x59e0e7(0x249)]},_0x42c5f4[_0x59e0e7(0x128)]),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xfb)](_0x59e0e7(0x248)));const _0x2cc706=a54_0x1e7b2e[_0x59e0e7(0x271)](process[_0x59e0e7(0x2a9)](),_0x2d2f9f[_0x59e0e7(0x177)])||'.';return console[_0x59e0e7(0x26f)](a54_0x1e596b['dim'](_0x59e0e7(0x125)+_0x2cc706)),console['error'](a54_0x1e596b['dim'](_0x59e0e7(0x2a6)+_0x2d2f9f[_0x59e0e7(0x249)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x20c);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x25c);async[a54_0x3a8226(0x1cd)](_0x427fba){const _0x5e36af=a54_0x3a8226,{options:_0x32e992,args:_0x1cd81d,tdx:_0x3fb977}=_0x427fba,_0x65d726=this[_0x5e36af(0x175)](_0x1cd81d,_0x32e992),_0x107430=_0x32e992[_0x5e36af(0x1a2)],_0x5f41a7=_0x32e992['skipValidation'];_0x32e992[_0x5e36af(0x272)]&&(_0x65d726&&console[_0x5e36af(0x26f)]('Source\x20directory:\x20'+_0x65d726),_0x107430&&console['error'](_0x5e36af(0x1be)+_0x107430),_0x32e992[_0x5e36af(0x1ae)]&&console[_0x5e36af(0x26f)]('Dry\x20run:\x20yes'),_0x5f41a7&&console[_0x5e36af(0x26f)]('Validation:\x20skipped'));let _0x315119;try{_0x315119=await withSpinner(_0x5e36af(0x268),()=>_0x3fb977['workflow']['preparePushProject']({'sourceDir':_0x65d726,'revision':_0x107430,'skipValidation':_0x5f41a7}),{'verbose':_0x32e992[_0x5e36af(0x272)]});}catch(_0x8c336b){if(_0x8c336b instanceof Error&&_0x8c336b['message'][_0x5e36af(0x127)](_0x5e36af(0x118)))return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0x227)]('Error:'),_0x5e36af(0x137)),_0x32e992[_0x5e36af(0x22d)]?console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)]('Tip:\x20cd\x20to\x20workflows/'+_0x32e992[_0x5e36af(0x22d)]+_0x5e36af(0x12f)+_0x32e992['workflowProject']+'\x27')):console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)](_0x5e36af(0x1d7))),0x1;throw _0x8c336b;}const _0x554832=_0x315119[_0x5e36af(0x1ba)];console[_0x5e36af(0x26f)](_0x5e36af(0x1d8)+_0x554832[_0x5e36af(0x249)]),console['error'](_0x5e36af(0x16f)+_0x554832[_0x5e36af(0x11d)]),console[_0x5e36af(0x26f)](_0x5e36af(0x229)+_0x554832[_0x5e36af(0x1a2)]),console[_0x5e36af(0x26f)](_0x5e36af(0x129)+a54_0x1e596b[_0x5e36af(0xfb)]('+'+_0x554832['summary']['new']+_0x5e36af(0x1ed))+',\x20'+(a54_0x1e596b[_0x5e36af(0x1f4)]('~'+_0x554832['summary'][_0x5e36af(0x143)]+_0x5e36af(0x1f8))+',\x20')+(a54_0x1e596b[_0x5e36af(0x227)]('-'+_0x554832['summary'][_0x5e36af(0x101)]+_0x5e36af(0x149))+',\x20')+(''+a54_0x1e596b[_0x5e36af(0xe8)](_0x554832['summary']['unchanged']+'\x20unchanged')));for(const _0x4fee2d of _0x554832[_0x5e36af(0x121)]){_0x4fee2d[_0x5e36af(0x161)]===_0x5e36af(0x143)&&_0x4fee2d[_0x5e36af(0x182)]&&(console[_0x5e36af(0x26f)]('\x0a'+a54_0x1e596b['cyan']('---\x20'+_0x4fee2d[_0x5e36af(0x24f)])),console['error'](_0x4fee2d[_0x5e36af(0x182)]));}if(!_0x554832[_0x5e36af(0x290)])return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xfb)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x5e36af(0x165)](_0x3fb977,_0x554832['projectName'],_0x32e992[_0x5e36af(0x241)]),0x0;if(_0x32e992[_0x5e36af(0x1ae)])return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0x1f4)](_0x5e36af(0x27e))),0x0;if(!_0x32e992['yes']){if(!isInteractive())return console['error'](a54_0x1e596b[_0x5e36af(0x227)](_0x5e36af(0x298)),_0x5e36af(0x170)),console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x250a75=await confirmKey(_0x5e36af(0x207));if(!_0x250a75)return console['error'](a54_0x1e596b[_0x5e36af(0x1f4)]('Cancelled'),_0x5e36af(0x14d)),0x1;}const _0x56f8cb=await withSpinner(_0x5e36af(0x13b),()=>_0x3fb977['workflow'][_0x5e36af(0x1a9)](_0x554832),{'verbose':_0x32e992['verbose']}),_0x58c8ee=_0x56f8cb[_0x5e36af(0x1ba)];return console['error'](a54_0x1e596b[_0x5e36af(0xfb)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x58c8ee[_0x5e36af(0x15e)]),console[_0x5e36af(0x26f)](_0x5e36af(0x229)+_0x58c8ee[_0x5e36af(0x1a2)]),await this[_0x5e36af(0x165)](_0x3fb977,_0x58c8ee['projectName'],_0x32e992[_0x5e36af(0x241)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x17f);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x122);async[a54_0x3a8226(0x1cd)](_0x320a61){const _0x1ac291=a54_0x3a8226,{options:_0x4255de,args:_0x987a65,tdx:_0x5492b7}=_0x320a61,_0x1d79c6=this[_0x1ac291(0x175)](_0x987a65,_0x4255de),_0x25affd=_0x4255de[_0x1ac291(0xf9)],_0x11dbbe=_0x4255de['revision'],_0x30f113=_0x4255de['skipValidation'];if(!_0x1d79c6)return console[_0x1ac291(0x26f)](a54_0x1e596b['red'](_0x1ac291(0x23e)),_0x1ac291(0x26e)),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xe8)](_0x1ac291(0x203))),console['error'](a54_0x1e596b['dim'](_0x1ac291(0x179))),0x1;if(!_0x25affd)return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x227)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xe8)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4255de[_0x1ac291(0x272)]&&(console['error'](_0x1ac291(0x104)+_0x1d79c6),console[_0x1ac291(0x26f)](_0x1ac291(0x184)+_0x25affd),_0x11dbbe&&console[_0x1ac291(0x26f)](_0x1ac291(0x1be)+_0x11dbbe),_0x4255de[_0x1ac291(0x1ae)]&&console[_0x1ac291(0x26f)](_0x1ac291(0x17e)),_0x30f113&&console[_0x1ac291(0x26f)](_0x1ac291(0x250)));const _0x37725d=await withSpinner(_0x1ac291(0xf4),()=>_0x5492b7[_0x1ac291(0x267)][_0x1ac291(0x12a)](_0x1d79c6,_0x25affd,{'revision':_0x11dbbe,'skipValidation':_0x30f113}),{'verbose':_0x4255de[_0x1ac291(0x272)]}),_0x31289d=_0x37725d[_0x1ac291(0x1ba)];console[_0x1ac291(0x26f)](_0x1ac291(0x270)+_0x31289d[_0x1ac291(0x11d)]);_0x31289d[_0x1ac291(0x111)]&&console[_0x1ac291(0x26f)]('Source\x20project:\x20'+_0x31289d[_0x1ac291(0x111)]);console[_0x1ac291(0x26f)](_0x1ac291(0x184)+_0x31289d[_0x1ac291(0x196)]),console[_0x1ac291(0x26f)]('Revision:\x20'+_0x31289d[_0x1ac291(0x1a2)]),console[_0x1ac291(0x26f)](_0x1ac291(0xf3)+_0x31289d['fileCount']);_0x31289d['targetExists']&&(console['error'](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x261)+_0x31289d[_0x1ac291(0x196)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x31289d[_0x1ac291(0x2a7)]+')')),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x221))));if(_0x4255de[_0x1ac291(0x1ae)])return console[_0x1ac291(0x26f)](a54_0x1e596b['yellow'](_0x1ac291(0x11b))),0x0;if(!_0x4255de['yes']){if(!isInteractive())return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x227)]('\x0aError:'),_0x1ac291(0x170)),console['error'](a54_0x1e596b['dim'](_0x1ac291(0x226))),0x1;const _0x37539a=_0x31289d[_0x1ac291(0x111)]||a54_0x1e7b2e[_0x1ac291(0x22b)](_0x1d79c6),_0x5b376c=_0x31289d[_0x1ac291(0x199)]?_0x1ac291(0x12e)+_0x25affd+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x37539a+_0x1ac291(0x108)+_0x25affd+'\x22?',_0x3b1b24=await confirmKey(_0x5b376c);if(!_0x3b1b24)return console['error'](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x1bb))),0x1;}const _0x4d3ddf=await withSpinner(_0x31289d[_0x1ac291(0x199)]?_0x1ac291(0x116)+_0x25affd+_0x1ac291(0x1f9):'Cloning\x20to\x20'+_0x25affd+'...',()=>_0x5492b7['workflow'][_0x1ac291(0x21b)](_0x31289d),{'verbose':_0x4255de[_0x1ac291(0x272)]}),_0xf42e=_0x4d3ddf['data'];return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xfb)](_0x31289d['targetExists']?_0x1ac291(0x146):_0x1ac291(0x1b1))),console[_0x1ac291(0x26f)](_0x1ac291(0x21d)+_0xf42e[_0x1ac291(0x196)]),console['error']('\x20\x20Project\x20ID:\x20'+_0xf42e[_0x1ac291(0x1fb)]),console[_0x1ac291(0x26f)](_0x1ac291(0x229)+_0xf42e['revision']),await this['showWorkflowConsoleUrl'](_0x5492b7,_0xf42e[_0x1ac291(0x196)],_0x4255de[_0x1ac291(0x241)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x3ddf74){const _0x194825=a54_0x3a8226,{options:_0x4afa5c,args:_0x2c75af,tdx:_0x57e512}=_0x3ddf74,_0x1a8738=_0x2c75af[0x0];if(!_0x1a8738)return console['error'](_0x194825(0x27f)),console['error'](_0x194825(0x1a6)),0x1;_0x4afa5c[_0x194825(0x272)]&&console[_0x194825(0x26f)]('Project:\x20'+_0x1a8738);if(!_0x4afa5c[_0x194825(0x1ab)]){if(!isInteractive())return console[_0x194825(0x26f)](a54_0x1e596b[_0x194825(0x227)](_0x194825(0x298)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x1e596b[_0x194825(0xe8)](_0x194825(0x226))),0x1;const _0x5e257f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1a8738+_0x194825(0x15c));if(!_0x5e257f)return console[_0x194825(0x26f)](a54_0x1e596b[_0x194825(0x1f4)](_0x194825(0x1bb))),0x1;}const _0x2431bf=await withSpinner(_0x194825(0x24b)+_0x1a8738+'...',()=>_0x57e512[_0x194825(0x267)][_0x194825(0x132)](_0x1a8738),{'verbose':_0x4afa5c[_0x194825(0x272)]}),_0x3b0293=_0x2431bf[_0x194825(0x1ba)];return console[_0x194825(0x26f)]('✔\x20Deleted\x20project\x20'+_0x3b0293[_0x194825(0x249)]),console['error'](_0x194825(0x1c2)+_0x3b0293['projectId']),0x0;}}export function parseKeyValue(_0x1c59d4){const _0xb36d5d=a54_0x3a8226,_0x1b991c=_0x1c59d4[_0xb36d5d(0x239)]('=');if(_0x1b991c===-0x1)throw new Error(_0xb36d5d(0x1c0)+_0x1c59d4+_0xb36d5d(0x215));const _0x1a8926=_0x1c59d4[_0xb36d5d(0x28c)](0x0,_0x1b991c),_0x1a4c9=_0x1c59d4[_0xb36d5d(0x28c)](_0x1b991c+0x1);if(!_0x1a8926)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x1a8926,'value':_0x1a4c9};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]='workflow:secrets:list';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x222);async[a54_0x3a8226(0x1cd)](_0x1784bf){const _0x205f61=a54_0x3a8226,{options:_0x1c61dd,args:_0x539e07,tdx:_0x4aeb76}=_0x1784bf,_0x53e4ce=this[_0x205f61(0x160)](_0x539e07,_0x1c61dd);if(!_0x53e4ce)return 0x1;_0x1c61dd['verbose']&&console['error']('Project:\x20'+_0x53e4ce);const _0x1b763a=await withSpinner(_0x205f61(0x13a),()=>_0x4aeb76[_0x205f61(0x267)]['listSecrets'](_0x53e4ce),{'verbose':_0x1c61dd[_0x205f61(0x272)]}),{secrets:_0x5c9e48}=_0x1b763a[_0x205f61(0x1ba)];return console['error'](_0x205f61(0x151)+_0x5c9e48[_0x205f61(0x294)]+'\x20secret'+(_0x5c9e48[_0x205f61(0x294)]!==0x1?'s':'')),await handleSDKOutput(_0x5c9e48,_0x1c61dd),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1ea);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x255);async['execute'](_0x1e607c){const _0x350a93=a54_0x3a8226,{options:_0x214442,args:_0x14edff,tdx:_0x5d92dc}=_0x1e607c;let _0x13fec7,_0x11612f;if(_0x14edff[_0x350a93(0x294)]>=0x1&&!_0x14edff[0x0][_0x350a93(0x127)]('='))_0x13fec7=_0x14edff[0x0],_0x11612f=_0x14edff[_0x350a93(0x12b)](0x1);else{if(_0x14edff[_0x350a93(0x294)]>=0x1&&_0x214442['workflowProject'])_0x13fec7=_0x214442[_0x350a93(0x22d)],_0x11612f=_0x14edff;else return _0x14edff[_0x350a93(0x294)]>=0x1?(console[_0x350a93(0x26f)](_0x350a93(0xec)),console['error'](_0x350a93(0x185)),0x1):(console[_0x350a93(0x26f)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x350a93(0x26f)](_0x350a93(0x24a)),0x1);}if(_0x11612f[_0x350a93(0x294)]===0x0)return console[_0x350a93(0x26f)](_0x350a93(0x150)),console[_0x350a93(0x26f)](_0x350a93(0x24a)),0x1;const _0x312286={};try{for(const _0x351724 of _0x11612f){const {key:_0x1732ed,value:_0x16287b}=parseKeyValue(_0x351724);_0x312286[_0x1732ed]=_0x16287b;}}catch(_0x3b3aa4){return _0x3b3aa4 instanceof Error&&console['error'](a54_0x1e596b[_0x350a93(0x227)](_0x350a93(0x23e)),_0x3b3aa4[_0x350a93(0x299)]),0x1;}const _0x4d2f7d=Object[_0x350a93(0x1fa)](_0x312286);_0x214442[_0x350a93(0x272)]&&(console[_0x350a93(0x26f)](_0x350a93(0x183)+_0x13fec7),console[_0x350a93(0x26f)]('Secrets\x20to\x20set:\x20'+_0x4d2f7d['join'](',\x20')));const _0xfc1c21=await withSpinner(_0x4d2f7d[_0x350a93(0x294)]===0x1?_0x350a93(0x1d3):_0x350a93(0x236)+_0x4d2f7d[_0x350a93(0x294)]+'\x20secrets...',()=>_0x5d92dc[_0x350a93(0x267)][_0x350a93(0x231)](_0x13fec7,_0x312286),{'verbose':_0x214442['verbose']}),_0x416dfd=_0xfc1c21['data'];return console[_0x350a93(0x26f)](_0x4d2f7d['length']===0x1?_0x350a93(0x19f)+_0x416dfd['keys'][0x0]+_0x350a93(0x135)+_0x416dfd[_0x350a93(0x249)]+'\x27':'✔\x20'+_0x416dfd[_0x350a93(0x1fa)][_0x350a93(0x294)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x416dfd[_0x350a93(0x249)]+'\x27'),(_0x214442['json']||_0x214442[_0x350a93(0x1c4)])&&await handleSingleObjectOutput(_0x416dfd,_0x214442),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x28a);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1c9);async[a54_0x3a8226(0x1cd)](_0x3ee19e){const _0x324398=a54_0x3a8226,{options:_0x485510,args:_0x4b5aed,tdx:_0x514cd2}=_0x3ee19e;let _0x19397a,_0x299994;if(_0x4b5aed[_0x324398(0x294)]>=0x2)_0x19397a=_0x4b5aed[0x0],_0x299994=_0x4b5aed[0x1];else{if(_0x4b5aed[_0x324398(0x294)]===0x1&&_0x485510[_0x324398(0x22d)])_0x19397a=_0x485510[_0x324398(0x22d)],_0x299994=_0x4b5aed[0x0];else return _0x4b5aed[_0x324398(0x294)]===0x1?(console[_0x324398(0x26f)](_0x324398(0xec)),console[_0x324398(0x26f)](_0x324398(0x185)),0x1):(console['error'](_0x324398(0x273)),console[_0x324398(0x26f)](_0x324398(0xff)),0x1);}_0x485510[_0x324398(0x272)]&&(console[_0x324398(0x26f)]('Project:\x20'+_0x19397a),console['error'](_0x324398(0x224)+_0x299994));if(!_0x485510['yes']){if(!isInteractive())return console[_0x324398(0x26f)](a54_0x1e596b['red'](_0x324398(0x298)),_0x324398(0x170)),console[_0x324398(0x26f)](a54_0x1e596b[_0x324398(0xe8)](_0x324398(0x226))),0x1;const _0x16982e=await confirmKey(_0x324398(0xfa)+_0x299994+_0x324398(0x2a1)+_0x19397a+'\x27?');if(!_0x16982e)return console[_0x324398(0x26f)](a54_0x1e596b[_0x324398(0x1f4)]('Cancelled')),0x1;}const _0xc8b0ee=await withSpinner('Deleting\x20secret...',()=>_0x514cd2[_0x324398(0x267)][_0x324398(0x1d6)](_0x19397a,_0x299994),{'verbose':_0x485510[_0x324398(0x272)]}),_0x5e14c2=_0xc8b0ee['data'];return console[_0x324398(0x26f)](_0x324398(0x19f)+_0x5e14c2['key']+_0x324398(0x20f)+_0x5e14c2[_0x324398(0x249)]+'\x27'),(_0x485510[_0x324398(0x10d)]||_0x485510[_0x324398(0x1c4)])&&await handleSingleObjectOutput(_0x5e14c2,_0x485510),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(_0x5a0b64){const _0x4567c4=a54_0x3a8226,_0x302b54=Math[_0x4567c4(0x20e)](_0x5a0b64/0x3e8),_0x2a2742=Math['floor'](_0x302b54/0x3c),_0xf912cb=Math[_0x4567c4(0x20e)](_0x2a2742/0x3c),_0x12bc23=Math['floor'](_0xf912cb/0x18);if(_0x12bc23>0x0){const _0x30ca23=_0xf912cb%0x18;return _0x30ca23>0x0?_0x12bc23+'d\x20'+_0x30ca23+'h':_0x12bc23+'d';}else{if(_0xf912cb>0x0){const _0x5d6765=_0x2a2742%0x3c;return _0x5d6765>0x0?_0xf912cb+'h\x20'+_0x5d6765+'m':_0xf912cb+'h';}else{if(_0x2a2742>0x0){const _0x1174cd=_0x302b54%0x3c;return _0x1174cd>0x0?_0x2a2742+'m\x20'+_0x1174cd+'s':_0x2a2742+'m';}else return _0x302b54+'s';}}}function formatTimestamp(_0x3ef3cc,_0x166906){const _0x13b263=a54_0x3a8226,_0x16a097=new Date(_0x3ef3cc),_0xe6a3af=String(_0x16a097[_0x13b263(0xf2)]())[_0x13b263(0x1fc)](0x2,'0'),_0x169560=String(_0x16a097[_0x13b263(0x144)]())[_0x13b263(0x1fc)](0x2,'0'),_0x10f220=_0xe6a3af+':'+_0x169560,_0xa0ff4d=_0x16a097[_0x13b263(0x292)]()===_0x166906[_0x13b263(0x292)]()&&_0x16a097['getMonth']()===_0x166906[_0x13b263(0x1c6)]()&&_0x16a097[_0x13b263(0x157)]()===_0x166906[_0x13b263(0x157)]();if(_0xa0ff4d)return _0x10f220;else{const _0x1a509d=String(_0x16a097[_0x13b263(0x1c6)]()+0x1)[_0x13b263(0x1fc)](0x2,'0'),_0x6dc38e=String(_0x16a097['getDate']())[_0x13b263(0x1fc)](0x2,'0');return _0x1a509d+'-'+_0x6dc38e+'\x20'+_0x10f220;}}function formatDate(_0x1a450e){const _0x5039e6=a54_0x3a8226,_0x57520c=_0x1a450e[_0x5039e6(0x292)](),_0x1aff81=String(_0x1a450e[_0x5039e6(0x1c6)]()+0x1)[_0x5039e6(0x1fc)](0x2,'0'),_0x598fbd=String(_0x1a450e['getDate']())[_0x5039e6(0x1fc)](0x2,'0');return _0x57520c+'-'+_0x1aff81+'-'+_0x598fbd;}function getTaskStateIcon(_0x32e8b5){const _0x154e96={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x154e96[_0x32e8b5]||'⚪';}function getBarChar(_0x146738){const _0x3c0efa=a54_0x3a8226;return _0x146738===_0x3c0efa(0x26f)||_0x146738==='group_error'?'×':'─';}function getBarColor(_0x6bca29){const _0x1db828=a54_0x3a8226,_0x4f0629={'success':a54_0x1e596b[_0x1db828(0xfb)],'error':a54_0x1e596b['red'],'group_error':a54_0x1e596b[_0x1db828(0x227)],'running':a54_0x1e596b[_0x1db828(0x1df)],'blocked':a54_0x1e596b[_0x1db828(0x1f4)],'planned':a54_0x1e596b['dim'],'canceling':a54_0x1e596b[_0x1db828(0x1f4)]};return _0x4f0629[_0x6bca29]||a54_0x1e596b[_0x1db828(0x206)];}function parseTaskName(_0x54d47d){const _0x5cb6d8=a54_0x3a8226;let _0x34724a=_0x54d47d[_0x5cb6d8(0x29c)](/^\++/,'');const _0x2be6b6=_0x34724a[_0x5cb6d8(0x10c)]('+'),_0x19d8fc=_0x2be6b6[_0x5cb6d8(0x294)]>0x1?_0x2be6b6[_0x5cb6d8(0x294)]-0x2:0x0,_0x21fb63=_0x2be6b6[_0x2be6b6['length']-0x1]||_0x34724a;return{'level':_0x19d8fc,'name':'+'+_0x21fb63};}function truncateTaskName(_0x57c672,_0x352007){const _0x1eee9e=a54_0x3a8226,_0x12ea6e=stringWidth(_0x57c672);if(_0x12ea6e<=_0x352007)return _0x57c672;let _0x23377c=_0x57c672;while(stringWidth(_0x23377c+'…')>_0x352007&&_0x23377c[_0x1eee9e(0x294)]>0x0){_0x23377c=_0x23377c[_0x1eee9e(0x12b)](0x0,-0x1);}return _0x23377c+'…';}function calculateTimeScale(_0x143235,_0x5bdfa7){const _0xc7f36e=a54_0x3a8226;return{'startTime':_0x143235[_0xc7f36e(0x218)],'endTime':_0x143235[_0xc7f36e(0x209)],'durationMs':_0x143235[_0xc7f36e(0x197)],'msPerChar':_0x143235[_0xc7f36e(0x197)]/_0x5bdfa7};}function timeToPosition(_0x5010db,_0x28beed,_0x387033){const _0x125f56=a54_0x3a8226,_0x193158=_0x5010db-_0x28beed['startTime'],_0x1c1f86=Math['floor'](_0x193158/_0x28beed[_0x125f56(0x15d)]);return Math[_0x125f56(0xf7)](0x0,Math[_0x125f56(0x23a)](_0x1c1f86,_0x387033));}function renderTimeAxis(_0x4e00ff,_0x46a521){const _0x111bfc=a54_0x3a8226,_0x355f06=Math[_0x111bfc(0x23a)](TIMELINE_CONFIG[_0x111bfc(0x246)],Math['max'](TIMELINE_CONFIG[_0x111bfc(0x295)],Math[_0x111bfc(0x20e)](_0x46a521/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x41f242=_0x4e00ff[_0x111bfc(0x1e6)]/(_0x355f06-0x1),_0x48b63b=new Date(_0x4e00ff[_0x111bfc(0x21f)]),_0x1142ab=[];for(let _0x413db7=0x0;_0x413db7<_0x355f06;_0x413db7++){const _0x40ff96=_0x4e00ff[_0x111bfc(0x21f)]+_0x413db7*_0x41f242,_0x1eeb90=timeToPosition(_0x40ff96,_0x4e00ff,_0x46a521),_0x4e58d0=formatTimestamp(_0x40ff96,_0x48b63b);_0x1142ab[_0x111bfc(0x23c)]({'pos':_0x1eeb90,'text':_0x4e58d0});}const _0x20d77d=new Array(_0x46a521)[_0x111bfc(0x1aa)]('\x20');let _0x56a016=-0x1;for(const {pos:_0x4f6fa7,text:_0x18a1e4}of _0x1142ab){let _0x3e3dfb=Math[_0x111bfc(0xf7)](0x0,_0x4f6fa7-Math[_0x111bfc(0x20e)](_0x18a1e4[_0x111bfc(0x294)]/0x2));_0x3e3dfb<=_0x56a016+TIMELINE_CONFIG[_0x111bfc(0x208)]&&(_0x3e3dfb=_0x56a016+TIMELINE_CONFIG[_0x111bfc(0x208)]+0x1);_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]>_0x46a521&&(_0x3e3dfb=_0x46a521-_0x18a1e4[_0x111bfc(0x294)]);if(_0x3e3dfb>=0x0&&_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]<=_0x46a521&&_0x3e3dfb>_0x56a016){for(let _0x43826e=0x0;_0x43826e<_0x18a1e4[_0x111bfc(0x294)];_0x43826e++){_0x20d77d[_0x3e3dfb+_0x43826e]=_0x18a1e4[_0x43826e];}_0x56a016=_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]-0x1;}}return _0x20d77d['join']('');}function renderTaskRow(_0x38e3e1,_0x5dd360,_0xd4bdd6,_0x64fd7f){const _0x284bf4=a54_0x3a8226,{level:_0x40c1e1,name:_0x1542aa}=parseTaskName(_0x38e3e1[_0x284bf4(0xf9)]),_0x4260bb='\x20'[_0x284bf4(0x16d)](_0x40c1e1),_0x28073b=_0x38e3e1[_0x284bf4(0x15f)]?'('+formatElapsed(_0x38e3e1[_0x284bf4(0x15f)][_0x284bf4(0x197)])+')':'',_0x2a4949=stringWidth(_0x28073b),_0x40d13a=_0x40c1e1*0x1,_0x2bb546=_0x64fd7f-_0x40d13a-_0x2a4949-0x1,_0x10368e=truncateTaskName(_0x1542aa,_0x2bb546),_0x9e1ef8=_0x4260bb+_0x10368e,_0x2b63cd=stringWidth(_0x9e1ef8),_0x1d3f46=_0x64fd7f-_0x2b63cd-_0x2a4949,_0x5015b1=_0x9e1ef8+'\x20'[_0x284bf4(0x16d)](Math[_0x284bf4(0xf7)](0x1,_0x1d3f46))+a54_0x1e596b['dim'](_0x28073b),_0x5c62b6=getTaskStateIcon(_0x38e3e1[_0x284bf4(0x24d)]),_0x33fedf=new Array(_0xd4bdd6)[_0x284bf4(0x1aa)]('\x20');if(_0x38e3e1['window']){const _0x41dde2=timeToPosition(_0x38e3e1['window'][_0x284bf4(0x218)],_0x5dd360,_0xd4bdd6),_0x2da917=timeToPosition(_0x38e3e1[_0x284bf4(0x15f)]['end'],_0x5dd360,_0xd4bdd6),_0x2b61d1=getBarChar(_0x38e3e1[_0x284bf4(0x24d)]),_0x30a41a=Math[_0x284bf4(0xf7)](_0x41dde2+0x1,_0x2da917);for(let _0x4f50e6=_0x41dde2;_0x4f50e6<Math[_0x284bf4(0x23a)](_0x30a41a,_0xd4bdd6);_0x4f50e6++){_0x33fedf[_0x4f50e6]=_0x2b61d1;}}const _0x4388e8=getBarColor(_0x38e3e1[_0x284bf4(0x24d)]),_0x412dd6=_0x33fedf[_0x284bf4(0x1bc)](_0x70c7b2=>_0x70c7b2==='\x20'?'\x20':_0x4388e8(_0x70c7b2))[_0x284bf4(0x258)]('');return _0x5c62b6+'\x20'+_0x5015b1+'│'+_0x412dd6+'│';}function calculateStats(_0x26ffaf){const _0x573152=a54_0x3a8226,_0x1d2fa3={'total':_0x26ffaf[_0x573152(0x294)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x318629 of _0x26ffaf){if(_0x318629[_0x573152(0x24d)]===_0x573152(0x1b0))_0x1d2fa3[_0x573152(0x1b0)]++;else{if(_0x318629[_0x573152(0x24d)]===_0x573152(0x26f)||_0x318629[_0x573152(0x24d)]===_0x573152(0x29a))_0x1d2fa3[_0x573152(0x26f)]++;else _0x318629[_0x573152(0x24d)]==='running'?_0x1d2fa3[_0x573152(0x18c)]++:_0x1d2fa3['pending']++;}}return _0x1d2fa3;}function formatStats(_0x32ca6d){const _0x4d6c09=a54_0x3a8226;return['Total:\x20'+_0x32ca6d[_0x4d6c09(0x1bd)],'✅\x20'+_0x32ca6d[_0x4d6c09(0x1b0)],'❌\x20'+_0x32ca6d[_0x4d6c09(0x26f)],_0x4d6c09(0x238)+_0x32ca6d['running'],'⏳\x20'+_0x32ca6d[_0x4d6c09(0x280)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x2a4);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x164);async[a54_0x3a8226(0x1cd)](_0x3ad1fe){const _0x27a216=a54_0x3a8226,{options:_0x32997c,args:_0x2bdaa8,tdx:_0x427e6a}=_0x3ad1fe;let _0x10a1ab,_0x17a612,_0x413968=![];if(_0x2bdaa8[0x0]){if(_0x2bdaa8[0x0][_0x27a216(0x127)]('.')){const _0x508117=this[_0x27a216(0x1ef)](_0x2bdaa8,_0x32997c);if(!_0x508117)return 0x1;_0x10a1ab=_0x508117['projectName'],_0x17a612=_0x508117[_0x27a216(0x10a)];}else{_0x17a612=_0x2bdaa8[0x0],_0x10a1ab=_0x32997c[_0x27a216(0x22d)];if(!_0x10a1ab)return console[_0x27a216(0x26f)](a54_0x1e596b[_0x27a216(0x227)](_0x27a216(0x23e)),_0x27a216(0x240)),0x1;_0x413968=!![];}}else{const _0x46c732=this[_0x27a216(0x1ef)](_0x2bdaa8,_0x32997c);if(!_0x46c732)return 0x1;_0x10a1ab=_0x46c732[_0x27a216(0x249)],_0x17a612=_0x46c732['workflowName'];}if(_0x32997c[_0x27a216(0x272)]){if(_0x10a1ab&&_0x17a612)console[_0x27a216(0x26f)]('Filter:\x20'+_0x10a1ab+'.'+_0x17a612);else _0x10a1ab&&console[_0x27a216(0x26f)](_0x27a216(0x20d)+_0x10a1ab);}const _0x48e1dd=_0x32997c['attemptId'],_0x4c5e22=_0x32997c[_0x27a216(0x1ff)];if(_0x48e1dd){_0x4c5e22&&console[_0x27a216(0x26f)](a54_0x1e596b['yellow'](_0x27a216(0x1b3)),_0x27a216(0x105));const _0x2bb917=_0x32997c[_0x27a216(0x288)];return _0x2bb917?await this[_0x27a216(0x153)](_0x3ad1fe,_0x48e1dd):await this[_0x27a216(0x1f7)](_0x3ad1fe,_0x48e1dd,_0x32997c),0x0;}if(_0x4c5e22){const _0x501245=await withSpinner(_0x27a216(0x19a),()=>_0x427e6a[_0x27a216(0x267)][_0x27a216(0x13c)]({'projectName':_0x10a1ab,'workflowName':_0x17a612,'limit':0x64}),{'verbose':_0x32997c['verbose']}),_0x25e196=_0x501245[_0x27a216(0x1ba)]['find'](_0x1296d1=>_0x1296d1['id']===_0x4c5e22);if(!_0x25e196)return console[_0x27a216(0x26f)](a54_0x1e596b[_0x27a216(0x227)](_0x27a216(0x23e)),_0x27a216(0x124)+_0x4c5e22),0x1;if(!_0x25e196[_0x27a216(0x212)]?.['id'])return console[_0x27a216(0x26f)](a54_0x1e596b['red'](_0x27a216(0x23e)),_0x27a216(0x166)+_0x4c5e22+_0x27a216(0x202)),0x1;const _0x244c58=_0x25e196['lastAttempt']['id'];_0x32997c[_0x27a216(0x272)]&&console[_0x27a216(0x26f)](_0x27a216(0x24e)+_0x244c58+_0x27a216(0x126)+_0x4c5e22);const _0x29f40a=_0x32997c[_0x27a216(0x288)];return _0x29f40a?await this[_0x27a216(0x153)](_0x3ad1fe,_0x244c58):await this['renderSingleTimeline'](_0x3ad1fe,_0x244c58,_0x32997c),0x0;}const _0x220501=await withSpinner(_0x27a216(0x21a),()=>_0x427e6a[_0x27a216(0x267)]['sessions']({'projectName':_0x10a1ab,'workflowName':_0x17a612,'limit':_0x32997c[_0x27a216(0x171)]||0x32}),{'verbose':_0x32997c[_0x27a216(0x272)]}),_0x334e5d=_0x220501[_0x27a216(0x1ba)];if(_0x334e5d[_0x27a216(0x294)]===0x0){if(_0x10a1ab&&_0x17a612)console['error'](_0x27a216(0x1d9)+_0x10a1ab+'.'+_0x17a612);else _0x10a1ab?console[_0x27a216(0x26f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x10a1ab):(console[_0x27a216(0x26f)](_0x27a216(0xfc)),console[_0x27a216(0x26f)](a54_0x1e596b['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x334e5d[_0x27a216(0x1c8)]((_0x18b8d9,_0x5d23cf)=>{const _0x23862f=_0x27a216,_0x3159aa=_0x18b8d9['sessionTime']||'',_0x2a78cd=_0x5d23cf[_0x23862f(0x194)]||'';return _0x2a78cd[_0x23862f(0x234)](_0x3159aa);});if(_0x32997c['json']||_0x32997c[_0x27a216(0x1c4)])return await handleSDKOutput(_0x334e5d,_0x32997c),0x0;let _0x400c6e;if(_0x413968){const _0x2daee3=_0x334e5d[0x0];if(!_0x2daee3[_0x27a216(0x212)]?.['id'])return console[_0x27a216(0x26f)](_0x27a216(0x154)),0x0;_0x400c6e=_0x2daee3[_0x27a216(0x212)]['id'],_0x32997c[_0x27a216(0x272)]&&console['error'](_0x27a216(0x266)+_0x2daee3[_0x27a216(0x194)]);}else{const _0x378cb2=_0x334e5d['map'](_0x3a4d92=>{const _0x46ec5d=_0x27a216,_0x2e392f=getAttemptStatusDisplay(_0x3a4d92[_0x46ec5d(0x212)]);return{'title':_0x3a4d92[_0x46ec5d(0x1cb)]?.[_0x46ec5d(0xf9)]+'.'+_0x3a4d92[_0x46ec5d(0x267)]?.[_0x46ec5d(0xf9)]+'\x20-\x20'+_0x3a4d92['sessionTime']+'\x20'+_0x2e392f[_0x46ec5d(0x289)],'value':_0x3a4d92[_0x46ec5d(0x212)]?.['id']||'','description':_0x2e392f[_0x46ec5d(0x243)]};}),_0x142bc9=await a54_0x89dadd({'type':_0x27a216(0x136),'name':_0x27a216(0x1e2),'message':_0x27a216(0x19e),'choices':_0x378cb2[_0x27a216(0x242)](_0x113849=>_0x113849['value']!=='')});if(!_0x142bc9[_0x27a216(0x1e2)])return 0x0;_0x400c6e=_0x142bc9['attemptId'];}const _0x2a2801=_0x32997c[_0x27a216(0x288)];return _0x2a2801?await this[_0x27a216(0x153)](_0x3ad1fe,_0x400c6e):await this[_0x27a216(0x1f7)](_0x3ad1fe,_0x400c6e,_0x32997c),0x0;}async[a54_0x3a8226(0x1f7)](_0x4ed24c,_0x59807c,_0xa8727c){const _0x4f3c48=a54_0x3a8226,{tdx:_0x3c942b}=_0x4ed24c;let _0x395bc4,_0x18bc6a;try{[_0x395bc4,_0x18bc6a]=await Promise['all']([_0x3c942b[_0x4f3c48(0x267)][_0x4f3c48(0x259)](_0x59807c),_0x3c942b[_0x4f3c48(0x267)][_0x4f3c48(0x178)](_0x59807c,![])]);}catch(_0x44fbb5){console['error'](a54_0x1e596b[_0x4f3c48(0x227)](_0x4f3c48(0x1eb)));_0xa8727c[_0x4f3c48(0x272)]&&console[_0x4f3c48(0x26f)](_0x44fbb5);throw _0x44fbb5;}if(_0xa8727c[_0x4f3c48(0x10d)]||_0xa8727c[_0x4f3c48(0x1c4)]){const _0x20c4d0=this[_0x4f3c48(0x252)](_0x395bc4,_0x18bc6a);await handleSDKOutput([_0x20c4d0],_0xa8727c);return;}const _0x3ef686=_0x3c942b['context'][_0x4f3c48(0x241)],_0x43a92d=this[_0x4f3c48(0x1f2)](_0x395bc4,_0x18bc6a,_0x3ef686);console[_0x4f3c48(0x204)](_0x43a92d);}async['pollTimeline'](_0x5d2b1b,_0x4b5032){const _0x2316e2=a54_0x3a8226,{tdx:_0x15e90f}=_0x5d2b1b,_0x5e7f94=TIMELINE_CONFIG[_0x2316e2(0x1dd)],_0x4c7448=TIMELINE_CONFIG[_0x2316e2(0x193)];let _0x3a1ffa=0x0;while(_0x3a1ffa<_0x4c7448){process['stdout']['isTTY']&&process[_0x2316e2(0x1f6)][_0x2316e2(0x1a7)]('\x1bc');let _0x55ea58,_0x33a6d9;try{[_0x55ea58,_0x33a6d9]=await Promise[_0x2316e2(0x1ac)]([_0x15e90f[_0x2316e2(0x267)][_0x2316e2(0x259)](_0x4b5032),_0x15e90f[_0x2316e2(0x267)][_0x2316e2(0x178)](_0x4b5032,![])]);}catch(_0xb22e00){console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0x227)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x3a1ffa>0x0&&console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0xe8)](_0x2316e2(0x213)+_0x3a1ffa));throw _0xb22e00;}const _0x5c5611=_0x15e90f['context'][_0x2316e2(0x241)],_0x1f5845=this[_0x2316e2(0x1f2)](_0x55ea58,_0x33a6d9,_0x5c5611);console[_0x2316e2(0x204)](_0x1f5845);const _0x477280=_0x55ea58['done']&&_0x33a6d9[_0x2316e2(0x25b)](_0x490fd4=>_0x490fd4[_0x2316e2(0x24d)]!=='running'&&_0x490fd4[_0x2316e2(0x24d)]!==_0x2316e2(0x2a3));if(_0x477280){console[_0x2316e2(0x26f)](a54_0x1e596b['green'](_0x2316e2(0x133)));break;}console[_0x2316e2(0x26f)](a54_0x1e596b['dim']('\x0aPolling...\x20('+_0x3a1ffa*0x2+_0x2316e2(0x16a))),await new Promise(_0x483550=>setTimeout(_0x483550,_0x5e7f94)),_0x3a1ffa++;}_0x3a1ffa>=_0x4c7448&&console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0x1f4)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x3a8226(0x1f2)](_0x30849d,_0x537a88,_0x4b7d5d){const _0x1d4c86=a54_0x3a8226,_0x525a74=[],_0x1bb256=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x53d8b5=0x5,_0x3f69bf=process[_0x1d4c86(0x1f6)][_0x1d4c86(0x22c)]||0x78,_0x4a3b55=_0x3f69bf-_0x1bb256-_0x53d8b5,_0x21f929=Math[_0x1d4c86(0xf7)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x1d4c86(0x23a)](_0x4a3b55,TIMELINE_CONFIG[_0x1d4c86(0x262)])),_0x42a4c9=new Date(_0x30849d[_0x1d4c86(0x1af)])[_0x1d4c86(0x1a1)](),_0x290ee6=_0x30849d[_0x1d4c86(0x11f)]?new Date(_0x30849d['finishedAt'])[_0x1d4c86(0x1a1)]():Date[_0x1d4c86(0x237)](),_0x437177={'start':_0x42a4c9,'end':_0x290ee6,'duration':_0x290ee6-_0x42a4c9},_0x1360e5=new Map(),_0x2c670f=[];for(const _0x3097b2 of _0x537a88){if(_0x3097b2[_0x1d4c86(0x18e)]){const _0x4d6421=new Date(_0x3097b2[_0x1d4c86(0x18e)])[_0x1d4c86(0x1a1)](),_0x3b63db=_0x3097b2[_0x1d4c86(0x148)]?new Date(_0x3097b2[_0x1d4c86(0x148)])[_0x1d4c86(0x1a1)]():Date[_0x1d4c86(0x237)](),_0x336e27={'start':_0x4d6421,'end':_0x3b63db,'duration':_0x3b63db-_0x4d6421};_0x1360e5[_0x1d4c86(0x277)](_0x3097b2['id'],_0x336e27),_0x2c670f[_0x1d4c86(0x23c)]({'name':_0x3097b2[_0x1d4c86(0x100)],'state':_0x3097b2[_0x1d4c86(0x24d)]||'unknown','window':_0x336e27});}else _0x2c670f[_0x1d4c86(0x23c)]({'name':_0x3097b2[_0x1d4c86(0x100)],'state':_0x3097b2[_0x1d4c86(0x24d)]||'planned','window':undefined});}_0x2c670f[_0x1d4c86(0x1c8)]((_0x3a1b08,_0x886dca)=>{const _0x199baa=_0x1d4c86;if(!_0x3a1b08[_0x199baa(0x15f)])return 0x1;if(!_0x886dca[_0x199baa(0x15f)])return-0x1;return _0x3a1b08[_0x199baa(0x15f)][_0x199baa(0x218)]-_0x886dca[_0x199baa(0x15f)][_0x199baa(0x218)];});const _0x501027=_0x2c670f['length'],_0x569e0f=_0x501027>TIMELINE_CONFIG[_0x1d4c86(0x27c)];_0x569e0f&&_0x2c670f[_0x1d4c86(0x21c)](TIMELINE_CONFIG[_0x1d4c86(0x27c)]);const _0x59c68f=calculateTimeScale(_0x437177,_0x21f929),_0x31b67f=_0x30849d[_0x1d4c86(0x20a)]?_0x30849d['success']?a54_0x1e596b[_0x1d4c86(0xfb)]('success'):a54_0x1e596b[_0x1d4c86(0x227)](_0x1d4c86(0x26f)):a54_0x1e596b['blue'](_0x1d4c86(0x18c)),_0x3a7048=_0x30849d[_0x1d4c86(0x1cb)]?.['id'],_0x4a1a0c=_0x30849d[_0x1d4c86(0x1ff)];let _0x20d363;if(_0x3a7048&&_0x4a1a0c){const _0x40650a=getWorkflowAttemptUrl(_0x4b7d5d,_0x3a7048,_0x4a1a0c,_0x30849d['id']);_0x20d363=hyperlink(a54_0x1e596b[_0x1d4c86(0xe8)](_0x30849d['id']),_0x40650a);}else _0x20d363=a54_0x1e596b[_0x1d4c86(0xe8)](_0x30849d['id']);_0x525a74[_0x1d4c86(0x23c)](_0x1d4c86(0x1b7)+_0x20d363+_0x1d4c86(0xfe)+_0x31b67f+_0x1d4c86(0xfe)+formatElapsed(_0x437177[_0x1d4c86(0x197)]));if(_0x2c670f[_0x1d4c86(0x294)]>0x0){const _0x4ce0af=renderTimeAxis(_0x59c68f,_0x21f929),_0x11cddf=new Date(_0x437177[_0x1d4c86(0x218)]),_0x1b6532=formatDate(_0x11cddf),_0x248b87=TIMELINE_CONFIG[_0x1d4c86(0x186)]+TIMELINE_CONFIG['ICON_SPACING']+_0x1bb256,_0x2aaefe=_0x1b6532[_0x1d4c86(0x1fc)](_0x248b87),_0x589775=a54_0x1e596b[_0x1d4c86(0xe8)](_0x2aaefe);_0x525a74['push'](_0x589775+'\x20'+_0x4ce0af);for(const _0x54bbf5 of _0x2c670f){_0x525a74['push'](renderTaskRow(_0x54bbf5,_0x59c68f,_0x21f929,_0x1bb256));}const _0x514448=calculateStats(_0x2c670f);_0x525a74['push'](formatStats(_0x514448)),_0x569e0f&&_0x525a74[_0x1d4c86(0x23c)](a54_0x1e596b[_0x1d4c86(0x1f4)](_0x1d4c86(0x1fd)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1d4c86(0x217)+_0x501027+_0x1d4c86(0x225))),_0x525a74[_0x1d4c86(0x23c)](''),_0x525a74['push'](a54_0x1e596b[_0x1d4c86(0xe8)](_0x1d4c86(0x14c))+('tdx\x20wf\x20attempt\x20'+_0x30849d['id']+_0x1d4c86(0x198))+a54_0x1e596b[_0x1d4c86(0xe8)](_0x1d4c86(0x102)));}else _0x525a74[_0x1d4c86(0x23c)](_0x1d4c86(0x23d));return _0x525a74[_0x1d4c86(0x258)]('\x0a');}['buildTimelineData'](_0x1e59b0,_0x3ccea9){const _0x5eb7d5=a54_0x3a8226,_0x314f71=new Date(_0x1e59b0[_0x5eb7d5(0x1af)])[_0x5eb7d5(0x1a1)](),_0x28adb5=_0x1e59b0[_0x5eb7d5(0x11f)]?new Date(_0x1e59b0['finishedAt'])['getTime']():Date[_0x5eb7d5(0x237)](),_0x13cc46=_0x28adb5-_0x314f71,_0x1d0a5e=[];for(const _0x19bb8f of _0x3ccea9){if(_0x19bb8f['startedAt']){const _0x806f1e=new Date(_0x19bb8f[_0x5eb7d5(0x18e)])[_0x5eb7d5(0x1a1)](),_0x48e109=_0x19bb8f['updatedAt']?new Date(_0x19bb8f[_0x5eb7d5(0x148)])[_0x5eb7d5(0x1a1)]():Date['now']();_0x1d0a5e['push']({'name':_0x19bb8f[_0x5eb7d5(0x100)],'state':_0x19bb8f[_0x5eb7d5(0x24d)]||_0x5eb7d5(0x2ac),'window':{'start':_0x806f1e,'end':_0x48e109,'duration':_0x48e109-_0x806f1e}});}else _0x1d0a5e[_0x5eb7d5(0x23c)]({'name':_0x19bb8f[_0x5eb7d5(0x100)],'state':_0x19bb8f[_0x5eb7d5(0x24d)]||'planned','window':undefined});}const _0x3dc4ae=calculateStats(_0x1d0a5e);return{'attempt':{'id':_0x1e59b0['id'],'status':_0x1e59b0[_0x5eb7d5(0x20a)]?_0x1e59b0[_0x5eb7d5(0x1b0)]?'success':'error':_0x5eb7d5(0x18c),'createdAt':_0x1e59b0[_0x5eb7d5(0x1af)],'finishedAt':_0x1e59b0['finishedAt'],'duration_ms':_0x13cc46},'tasks':_0x1d0a5e['map'](_0x4f2ca5=>({'name':_0x4f2ca5[_0x5eb7d5(0xf9)],'state':_0x4f2ca5[_0x5eb7d5(0x24d)],'startedAt':_0x4f2ca5[_0x5eb7d5(0x15f)]?new Date(_0x4f2ca5[_0x5eb7d5(0x15f)][_0x5eb7d5(0x218)])['toISOString']():null,'updatedAt':_0x4f2ca5[_0x5eb7d5(0x15f)]?new Date(_0x4f2ca5['window'][_0x5eb7d5(0x209)])['toISOString']():null,'duration_ms':_0x4f2ca5[_0x5eb7d5(0x15f)]?.['duration']||null})),'stats':_0x3dc4ae};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0xef);[a54_0x3a8226(0x27b)]='List\x20workflow\x20schedules';async['execute'](_0x1d5cf9){const _0x3cabbb=a54_0x3a8226,{options:_0x2ca42d,tdx:_0x2054fa}=_0x1d5cf9,_0x3be3c3=await withSpinner(_0x3cabbb(0x29f),()=>_0x2054fa[_0x3cabbb(0x267)]['listSchedules'](),{'verbose':_0x2ca42d[_0x3cabbb(0x272)]}),_0x275040=_0x3be3c3['data'];console[_0x3cabbb(0x26f)]('✔\x20Found\x20'+_0x275040[_0x3cabbb(0x294)]+_0x3cabbb(0x25e)+(_0x275040['length']!==0x1?'s':''));if(isStructuredFormat(_0x2ca42d))await handleSDKOutput(_0x275040,_0x2ca42d);else{if(_0x275040[_0x3cabbb(0x294)]===0x0)console[_0x3cabbb(0x204)](_0x3cabbb(0x1c5));else for(const _0x50dada of _0x275040){const _0x30635b=_0x50dada[_0x3cabbb(0x1f1)]?a54_0x1e596b[_0x3cabbb(0x1f4)](_0x3cabbb(0x17c)):'',_0x19b5e3=_0x50dada['project']?.['name']?a54_0x1e596b[_0x3cabbb(0xe8)]('\x20['+_0x50dada['project']['name']+']'):'',_0x2afb0f=_0x50dada[_0x3cabbb(0x24c)]?a54_0x1e596b['dim']('\x20next:\x20'+new Date(_0x50dada[_0x3cabbb(0x24c)])[_0x3cabbb(0x145)]()):'';console[_0x3cabbb(0x204)](_0x3cabbb(0x172)+_0x50dada['id']+'\x20'+(_0x50dada[_0x3cabbb(0x267)]?.[_0x3cabbb(0xf9)]||_0x3cabbb(0x14a))+_0x19b5e3+_0x30635b+_0x2afb0f);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x192);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1b6);async[a54_0x3a8226(0x1cd)](_0x1822c4){const _0x308b88=a54_0x3a8226,{options:_0x3c20ad,args:_0x42fcdb,tdx:_0x24332a}=_0x1822c4,_0x54d2a5=_0x42fcdb[0x0];if(!_0x54d2a5)return console['error'](a54_0x1e596b[_0x308b88(0x227)](_0x308b88(0x23e)),_0x308b88(0x188)),console[_0x308b88(0x26f)](a54_0x1e596b['dim'](_0x308b88(0xed))),console[_0x308b88(0x26f)](a54_0x1e596b[_0x308b88(0xe8)](_0x308b88(0x22a))),0x1;const _0x38c5eb=await withSpinner(_0x308b88(0x103)+_0x54d2a5+_0x308b88(0x1f9),()=>_0x24332a[_0x308b88(0x267)][_0x308b88(0x139)](_0x54d2a5),{'verbose':_0x3c20ad[_0x308b88(0x272)]}),_0xa540fd=_0x38c5eb['data'];return isStructuredFormat(_0x3c20ad)?await handleSingleObjectOutput(_0xa540fd,_0x3c20ad):(console[_0x308b88(0x204)](_0x308b88(0x264)+_0x54d2a5+'\x20enabled\x20('+(_0xa540fd['workflow']?.['name']||_0x308b88(0x2ac))+')'),_0xa540fd[_0x308b88(0x24c)]&&console[_0x308b88(0x204)](a54_0x1e596b[_0x308b88(0xe8)](_0x308b88(0x1a3)+new Date(_0xa540fd[_0x308b88(0x24c)])[_0x308b88(0x145)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x191);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1dc);async[a54_0x3a8226(0x1cd)](_0x283c7a){const _0x25fdb2=a54_0x3a8226,{options:_0x2f154d,args:_0x2e1672,tdx:_0x1d00c1}=_0x283c7a,_0x608607=_0x2e1672[0x0];if(!_0x608607)return console['error'](a54_0x1e596b['red'](_0x25fdb2(0x23e)),_0x25fdb2(0x188)),console[_0x25fdb2(0x26f)](a54_0x1e596b[_0x25fdb2(0xe8)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x25fdb2(0x26f)](a54_0x1e596b[_0x25fdb2(0xe8)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x2bc74c=await withSpinner(_0x25fdb2(0x1b8)+_0x608607+_0x25fdb2(0x1f9),()=>_0x1d00c1['workflow'][_0x25fdb2(0x11a)](_0x608607),{'verbose':_0x2f154d[_0x25fdb2(0x272)]}),_0x5e8ec2=_0x2bc74c[_0x25fdb2(0x1ba)];return isStructuredFormat(_0x2f154d)?await handleSingleObjectOutput(_0x5e8ec2,_0x2f154d):console['log'](_0x25fdb2(0x264)+_0x608607+_0x25fdb2(0x123)+(_0x5e8ec2[_0x25fdb2(0x267)]?.[_0x25fdb2(0xf9)]||'unknown')+')'),0x0;}}
1
+ const a54_0x4f40c0=a54_0x4855;(function(_0x36b47d,_0x3d29a3){const _0x587e65=a54_0x4855,_0x2a29b1=_0x36b47d();while(!![]){try{const _0x5c29b8=parseInt(_0x587e65(0x12f))/0x1*(-parseInt(_0x587e65(0x181))/0x2)+parseInt(_0x587e65(0x126))/0x3*(parseInt(_0x587e65(0xd3))/0x4)+-parseInt(_0x587e65(0xb6))/0x5*(-parseInt(_0x587e65(0xab))/0x6)+parseInt(_0x587e65(0x251))/0x7+-parseInt(_0x587e65(0x16e))/0x8*(parseInt(_0x587e65(0x24e))/0x9)+-parseInt(_0x587e65(0x244))/0xa+-parseInt(_0x587e65(0x194))/0xb*(parseInt(_0x587e65(0x1af))/0xc);if(_0x5c29b8===_0x3d29a3)break;else _0x2a29b1['push'](_0x2a29b1['shift']());}catch(_0x577852){_0x2a29b1['push'](_0x2a29b1['shift']());}}}(a54_0x43e6,0x62699));import a54_0x4448c0 from'chalk';import{existsSync}from'fs';import a54_0x4ed50f 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';import a54_0x3961f9 from'prompts';function getAttemptStatusDisplay(_0x4f52c8){const _0x37baa8=a54_0x4855;if(!_0x4f52c8)return{'icon':'⏳','text':''};const {done:_0x2a1f9b,success:_0x1168c5,cancelRequested:_0x2dfc89}=_0x4f52c8;if(!_0x2a1f9b)return _0x2dfc89?{'icon':'🛑','text':a54_0x4448c0[_0x37baa8(0x13a)]('canceling')}:{'icon':'🔄','text':a54_0x4448c0[_0x37baa8(0xa6)](_0x37baa8(0x1a7))};if(_0x1168c5)return{'icon':'✅','text':a54_0x4448c0[_0x37baa8(0x229)](_0x37baa8(0xc4))};return{'icon':'❌','text':a54_0x4448c0[_0x37baa8(0x167)](_0x37baa8(0x20f))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x4f40c0(0x192)](_0x18af3a,_0x38e2a7,_0x2c6e93=0x0){const _0x3f7933=a54_0x4f40c0;return _0x18af3a[_0x2c6e93]||_0x38e2a7[_0x3f7933(0x125)];}[a54_0x4f40c0(0xc0)](_0x5de825,_0x161389,_0x3e3e2b=0x0){const _0x57168b=a54_0x4f40c0,_0x51b417=this['resolveProject'](_0x5de825,_0x161389,_0x3e3e2b);if(!_0x51b417)return console[_0x57168b(0x20f)](a54_0x4448c0[_0x57168b(0x167)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x57168b(0x20f)](a54_0x4448c0['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x51b417;}[a54_0x4f40c0(0x207)](_0x423db1,_0x7ca5e1){const _0xbfc2a6=a54_0x4f40c0;if(_0x423db1[0x0]){const _0x5c96f1=_0x423db1[0x0]['split']('.');if(_0x5c96f1[_0xbfc2a6(0x9d)]===0x1)return{'projectName':_0x5c96f1[0x0],'workflowName':undefined};else return _0x5c96f1['length']===0x2?{'projectName':_0x5c96f1[0x0],'workflowName':_0x5c96f1[0x1]}:(console['error'](a54_0x4448c0[_0xbfc2a6(0x167)](_0xbfc2a6(0x146)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x7ca5e1[_0xbfc2a6(0x125)],'workflowName':undefined};}[a54_0x4f40c0(0x1eb)](_0x1b8a69,_0x2140a3,_0x203098=0x0){const _0x2c75c8=a54_0x4f40c0;if(_0x1b8a69[_0x203098])return _0x1b8a69[_0x203098];if(_0x2140a3[_0x2c75c8(0x125)]){const _0x2db439=a54_0x4ed50f[_0x2c75c8(0x1a8)](process[_0x2c75c8(0x256)](),'workflows',_0x2140a3[_0x2c75c8(0x125)]);if(existsSync(a54_0x4ed50f[_0x2c75c8(0x1a8)](_0x2db439,_0x2c75c8(0x1ff))))return _0x2db439;}return undefined;}async[a54_0x4f40c0(0xaf)](_0x38fa7e,_0x41a384,_0x798873){const _0x3a4f0a=a54_0x4f40c0;try{const _0x53a009=await _0x38fa7e[_0x3a4f0a(0xc9)]['workflows'](_0x41a384,{'limit':0x1});if(_0x53a009[_0x3a4f0a(0x9d)]>0x0){const _0x35be59=_0x53a009[0x0]['id'],_0x5911d7=getWorkflowUrl(_0x798873,_0x35be59);console[_0x3a4f0a(0x20f)](_0x3a4f0a(0x1f8)+a54_0x4448c0[_0x3a4f0a(0x214)](_0x5911d7));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x4f40c0(0xe1);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x4f5613){const _0x3203a8=a54_0x4f40c0,{options:_0x584737,args:_0x33a909,tdx:_0x438d61}=_0x4f5613,_0x2faef0=_0x33a909[0x0],_0x2a4843=_0x584737[_0x3203a8(0x136)];if(_0x2a4843)return saveSessionContext({'workflow_project':undefined},_0x584737[_0x3203a8(0x10d)]),console[_0x3203a8(0xe7)](a54_0x4448c0['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x2faef0)return console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0x167)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0xcc)](_0x3203a8(0x23d))),console[_0x3203a8(0x20f)](a54_0x4448c0[_0x3203a8(0xcc)](_0x3203a8(0x11a))),0x1;const _0x1b405e=await withSpinner('Resolving\x20project\x20\x27'+_0x2faef0+'\x27...',()=>_0x438d61[_0x3203a8(0xc9)]['resolveProjectId'](_0x2faef0),{'verbose':_0x584737['verbose']}),{name:_0x24539a}=_0x1b405e[_0x3203a8(0xdf)];return saveSessionContext({'workflow_project':_0x24539a},_0x584737[_0x3203a8(0x10d)]),console['log'](a54_0x4448c0['green'](_0x3203a8(0x1d4)+a54_0x4448c0[_0x3203a8(0x214)](_0x24539a))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a54_0x4f40c0(0x14c);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x15d);async[a54_0x4f40c0(0x1e9)](_0x288e6a){const _0x99c1e5=a54_0x4f40c0,{options:_0x249507,args:_0x2429e2,tdx:_0x15c0c0}=_0x288e6a,_0x208979=_0x2429e2[0x0];_0x249507['verbose']&&_0x208979&&console['error'](_0x99c1e5(0x1dd)+_0x208979);const _0x582c7f=await withSpinner(_0x99c1e5(0xba),()=>_0x15c0c0[_0x99c1e5(0xc9)][_0x99c1e5(0x10c)](_0x208979,{'limit':_0x249507[_0x99c1e5(0x141)]}),{'verbose':_0x249507[_0x99c1e5(0x1c0)]});let _0x3d2b27=_0x582c7f[_0x99c1e5(0xdf)];_0x3d2b27[_0x99c1e5(0xac)]((_0x311f15,_0x499d18)=>_0x311f15['name']['localeCompare'](_0x499d18[_0x99c1e5(0x153)]));const _0x4eed02=_0x249507[_0x99c1e5(0x141)]||0x64,_0x1f78b4=_0x3d2b27[_0x99c1e5(0x9d)]>=_0x4eed02?a54_0x4448c0['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x99c1e5(0x20f)]('✔\x20Found\x20'+_0x3d2b27[_0x99c1e5(0x9d)]+'\x20project'+(_0x3d2b27[_0x99c1e5(0x9d)]!==0x1?'s':'')+_0x1f78b4);if(_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0x15b)||_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0x100)||_0x249507[_0x99c1e5(0x1f0)]===_0x99c1e5(0xb3))await handleSDKOutput(_0x3d2b27,_0x249507);else{if(_0x3d2b27[_0x99c1e5(0x9d)]===0x0)_0x208979?console['log'](_0x99c1e5(0xc5)+_0x208979):console[_0x99c1e5(0xe7)](_0x99c1e5(0x24b));else{const _0x370089=_0x3d2b27[_0x99c1e5(0x17c)](_0x4a1115=>{const _0x49d26e=_0x99c1e5,_0x3c0b11=_0x4a1115['metadata']?.['some'](_0xfcc69f=>_0xfcc69f['key']==='sys'),_0x41034a=_0x3c0b11?a54_0x4448c0[_0x49d26e(0xcc)]('\x20(system)'):'';return _0x49d26e(0x1ee)+_0x4a1115['name']+_0x41034a;});await writeOutput(_0x370089[_0x99c1e5(0x1a8)]('\x0a'),_0x249507[_0x99c1e5(0x232)],_0x99c1e5(0x132));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x208);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xf6);async['execute'](_0x6b654e){const _0x47073a=a54_0x4f40c0,{options:_0x39a7e6,args:_0x5db127,tdx:_0x3fb63a}=_0x6b654e,_0x2603b9=this['resolveProject'](_0x5db127,_0x39a7e6);_0x39a7e6[_0x47073a(0x1c0)]&&_0x2603b9&&console[_0x47073a(0x20f)]('Project\x20filter:\x20'+_0x2603b9);const _0x3120f5=await withSpinner(_0x47073a(0x245),()=>_0x3fb63a[_0x47073a(0xc9)]['workflows'](_0x2603b9,{'limit':_0x39a7e6[_0x47073a(0x141)]}),{'verbose':_0x39a7e6[_0x47073a(0x1c0)]});let _0xeebb35=_0x3120f5[_0x47073a(0xdf)];_0xeebb35[_0x47073a(0xac)]((_0x3d32ab,_0x283692)=>{const _0x2fa0c5=_0x47073a,_0x13768c=_0x3d32ab[_0x2fa0c5(0x153)]['localeCompare'](_0x283692['name']);if(_0x13768c!==0x0)return _0x13768c;return(_0x3d32ab[_0x2fa0c5(0x22b)]?.[_0x2fa0c5(0x153)]||'')[_0x2fa0c5(0x200)](_0x283692[_0x2fa0c5(0x22b)]?.[_0x2fa0c5(0x153)]||'');});const _0x5683f9=_0x39a7e6['limit']||0x64,_0x5bce1d=_0xeebb35[_0x47073a(0x9d)]>=_0x5683f9?a54_0x4448c0[_0x47073a(0xcc)](_0x47073a(0x193)):'';console[_0x47073a(0x20f)](_0x47073a(0x114)+_0xeebb35['length']+_0x47073a(0x254)+(_0xeebb35['length']!==0x1?'s':'')+_0x5bce1d);if(_0x39a7e6[_0x47073a(0x1f0)]===_0x47073a(0x15b)||_0x39a7e6[_0x47073a(0x1f0)]==='jsonl'||_0x39a7e6['format']===_0x47073a(0xb3))await handleSDKOutput(_0xeebb35,_0x39a7e6);else{if(_0xeebb35['length']===0x0)_0x2603b9?console[_0x47073a(0xe7)](_0x47073a(0xc8)+_0x2603b9):console[_0x47073a(0xe7)](_0x47073a(0x1c6));else{const _0x331030=_0x39a7e6[_0x47073a(0x174)],_0x5b1e82=_0xeebb35[_0x47073a(0x17c)](_0x186d45=>{const _0xf7f9a4=_0x47073a,_0x1748a5=a54_0x4448c0[_0xf7f9a4(0xcc)]('#'+_0x186d45['id']),_0x56550b=hyperlink(_0x1748a5,getWorkflowUrl(_0x331030,_0x186d45['id'])),_0x26350e=_0x186d45['project']?.['name']?a54_0x4448c0[_0xf7f9a4(0xcc)]('\x20('+_0x186d45['project'][_0xf7f9a4(0x153)]+')'):'';return _0xf7f9a4(0x1bd)+_0x56550b+'\x20'+_0x186d45[_0xf7f9a4(0x153)]+_0x26350e;});await writeOutput(_0x5b1e82[_0x47073a(0x1a8)]('\x0a'),_0x39a7e6[_0x47073a(0x232)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x1c2);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x148);async[a54_0x4f40c0(0x1e9)](_0x5d4dbd){const _0x11ba2b=a54_0x4f40c0,{options:_0x175166,args:_0x23d9e6,tdx:_0x5857c9}=_0x5d4dbd,_0x47e06b=this[_0x11ba2b(0x207)](_0x23d9e6,_0x175166);if(!_0x47e06b)return 0x1;const {projectName:_0x5d219d,workflowName:_0x3fb3c7}=_0x47e06b;if(_0x175166[_0x11ba2b(0x1c0)]){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0x20f)]('Filter:\x20'+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d&&console[_0x11ba2b(0x20f)]('Filter:\x20project='+_0x5d219d);const _0x1d735e=_0x175166[_0x11ba2b(0x110)];_0x1d735e&&console[_0x11ba2b(0x20f)](_0x11ba2b(0xd0)+_0x1d735e);}let _0x4a53b8=0x28;if(process['stdout'][_0x11ba2b(0x237)]&&!_0x175166[_0x11ba2b(0x232)]&&!_0x175166[_0x11ba2b(0x1f0)]){const _0x4fec71=process[_0x11ba2b(0x1d8)]['rows']||0x28;_0x4a53b8=Math[_0x11ba2b(0xfd)](0x14,Math['floor'](_0x4fec71*0x2/0x3));}const _0x56e358=_0x175166[_0x11ba2b(0x141)]||_0x4a53b8,_0x156c73=await withSpinner(_0x11ba2b(0x24c),()=>_0x5857c9[_0x11ba2b(0xc9)][_0x11ba2b(0xb5)]({'projectName':_0x5d219d,'workflowName':_0x3fb3c7,'status':_0x175166[_0x11ba2b(0x110)],'fromTime':_0x175166[_0x11ba2b(0x1e4)],'toTime':_0x175166['to'],'limit':_0x56e358}),{'verbose':_0x175166['verbose']}),_0x3fcc8b=_0x156c73[_0x11ba2b(0xdf)];_0x3fcc8b[_0x11ba2b(0xac)]((_0x7414b6,_0x33a15c)=>{const _0x5d4094=_0x11ba2b,_0x1488cf=_0x7414b6[_0x5d4094(0x24f)]||'',_0x436c09=_0x33a15c[_0x5d4094(0x24f)]||'';return _0x436c09[_0x5d4094(0x200)](_0x1488cf);});_0x3fcc8b[_0x11ba2b(0x9d)]>=_0x56e358?console[_0x11ba2b(0x20f)](_0x11ba2b(0x1a2)+_0x3fcc8b['length']+_0x11ba2b(0x1bb)+a54_0x4448c0[_0x11ba2b(0xcc)](_0x11ba2b(0x1a6))):console['error']('✔\x20Found\x20'+_0x3fcc8b['length']+_0x11ba2b(0x17a)+(_0x3fcc8b[_0x11ba2b(0x9d)]!==0x1?'s':''));if(_0x175166[_0x11ba2b(0x1f0)]===_0x11ba2b(0x15b)||_0x175166[_0x11ba2b(0x1f0)]===_0x11ba2b(0x100)||_0x175166['format']===_0x11ba2b(0xb3))await handleSDKOutput(_0x3fcc8b,_0x175166);else{if(!process[_0x11ba2b(0x1d8)]['isTTY']||_0x175166[_0x11ba2b(0x232)]){if(_0x3fcc8b['length']===0x0){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0xe7)](_0x11ba2b(0x1ec)+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d?console['log'](_0x11ba2b(0xa4)+_0x5d219d):console[_0x11ba2b(0xe7)]('No\x20sessions\x20found');}else{const _0x46879b=_0x175166[_0x11ba2b(0x174)],_0x520bc9=this[_0x11ba2b(0x236)](_0x3fcc8b,_0x46879b);_0x175166[_0x11ba2b(0x232)]?await writeOutput(_0x520bc9,_0x175166[_0x11ba2b(0x232)],'list'):console[_0x11ba2b(0xe7)](_0x520bc9);}!_0x5d219d&&(console[_0x11ba2b(0x20f)](''),console['error'](a54_0x4448c0[_0x11ba2b(0xcc)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x11ba2b(0x20f)](a54_0x4448c0['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4448c0['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x3fcc8b['length']===0x0){if(_0x5d219d&&_0x3fb3c7)console[_0x11ba2b(0xe7)](_0x11ba2b(0x1ec)+_0x5d219d+'.'+_0x3fb3c7);else _0x5d219d?console[_0x11ba2b(0xe7)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x5d219d):console['log'](_0x11ba2b(0xcb));}else await this[_0x11ba2b(0x1a5)](_0x3fcc8b,_0x5d4dbd,_0x5d219d);}}return 0x0;}[a54_0x4f40c0(0x236)](_0x5ced25,_0x1d0365){const _0x273f80=a54_0x4f40c0,_0x51040a=[],_0x34732e=new Map();let _0x2d6b40=Infinity,_0x2daaf2=-Infinity;for(const _0x441107 of _0x5ced25){if(_0x441107[_0x273f80(0x17e)]?.[_0x273f80(0xb4)]){const _0x5a2f31=new Date(_0x441107[_0x273f80(0x17e)][_0x273f80(0xb4)])['getTime'](),_0x126f61=_0x441107[_0x273f80(0x17e)]['finishedAt']?new Date(_0x441107[_0x273f80(0x17e)][_0x273f80(0x217)])[_0x273f80(0x1d6)]():Date[_0x273f80(0x131)](),_0x18788d=_0x441107['project']?.['name']||_0x273f80(0x24d);!_0x34732e[_0x273f80(0x9f)](_0x18788d)&&_0x34732e[_0x273f80(0x1c7)](_0x18788d,[]),_0x34732e[_0x273f80(0x112)](_0x18788d)['push']({'session':_0x441107,'startTime':_0x5a2f31,'endTime':_0x126f61,'duration':_0x126f61-_0x5a2f31}),_0x2d6b40=Math[_0x273f80(0x1cd)](_0x2d6b40,_0x5a2f31),_0x2daaf2=Math[_0x273f80(0xfd)](_0x2daaf2,_0x126f61);}}if(_0x34732e[_0x273f80(0x102)]===0x0)return _0x273f80(0x166);const _0x2663da=process[_0x273f80(0x1d8)][_0x273f80(0xb1)]||0x78,_0x4367ab=0x1e,_0x9fb33=0x32,_0x480a1c=0x4,_0x44e93a=Math[_0x273f80(0x1cd)](_0x9fb33,Math[_0x273f80(0xfd)](_0x4367ab,Math[_0x273f80(0x128)](_0x2663da*0.3))),_0x2c4888=_0x2663da-_0x44e93a-TIMELINE_CONFIG[_0x273f80(0x159)]-0x3-_0x480a1c,_0x453288=_0x2daaf2-_0x2d6b40,_0xd71e65=_0x453288/_0x44e93a,_0x4508fe=renderTimeAxis({'startTime':_0x2d6b40,'endTime':_0x2daaf2,'durationMs':_0x453288,'msPerChar':_0xd71e65},_0x44e93a),_0x514fcb=[];for(const _0xda321a of _0x34732e[_0x273f80(0x198)]()){_0x514fcb[_0x273f80(0x1e7)](..._0xda321a);}_0x514fcb['sort']((_0xd1c9eb,_0x4969db)=>_0x4969db[_0x273f80(0xda)]-_0xd1c9eb[_0x273f80(0xda)]);const _0x5ce1de=new Date(_0x2d6b40),_0x43e487=formatDate(_0x5ce1de),_0x50982a=_0x480a1c+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x273f80(0x165)]+_0x2c4888,_0x4001a3='\x20'[_0x273f80(0x10a)](_0x50982a-_0x43e487['length']),_0x38ac1d=_0x4001a3+a54_0x4448c0[_0x273f80(0xcc)](_0x43e487)+'\x20'+_0x4508fe;_0x51040a[_0x273f80(0x1e7)](_0x38ac1d);const _0x5963a0=0x16;let _0x18a23a=0x0;for(const _0x2b33cf of _0x514fcb){const _0x43de12=_0x2b33cf[_0x273f80(0x10d)][_0x273f80(0x22b)]?.[_0x273f80(0x153)]||'?',_0x520c4a=Math['min'](stringWidth(_0x43de12),_0x5963a0);_0x18a23a=Math[_0x273f80(0xfd)](_0x18a23a,_0x520c4a);}for(const _0x3470a3 of _0x514fcb){const {session:_0x4720fa,startTime:_0x234bed,endTime:_0x279aa4,duration:_0x40b96c}=_0x3470a3,_0x23ecab=_0x4720fa[_0x273f80(0x22b)]?.['id'],_0x5ee8df=_0x4720fa['id'],_0x2ca9b4=_0x4720fa[_0x273f80(0x22b)]?.['name']||'?',_0x53b122=_0x4720fa[_0x273f80(0xc9)]?.[_0x273f80(0x153)]||'?';let _0xc33cac,_0x2134ac;if(_0x4720fa[_0x273f80(0x17e)]){const _0x3f8442=_0x4720fa['lastAttempt'];!_0x3f8442['done']?(_0xc33cac=_0x3f8442[_0x273f80(0x1cf)]?'🛑':'🔄',_0x2134ac=_0x3f8442[_0x273f80(0x1cf)]?a54_0x4448c0['yellow']:a54_0x4448c0[_0x273f80(0xa6)]):(_0xc33cac=_0x3f8442[_0x273f80(0xc4)]?'✅':'❌',_0x2134ac=_0x3f8442['success']?a54_0x4448c0[_0x273f80(0x229)]:a54_0x4448c0['red']);}else _0xc33cac='⏳',_0x2134ac=a54_0x4448c0[_0x273f80(0xcc)];const _0x5ba60e='#'+_0x5ee8df,_0x40d3b7=_0x23ecab?hyperlink(_0x5ba60e,getWorkflowSessionUrl(_0x1d0365,_0x23ecab,_0x5ee8df)):_0x5ba60e;let _0x51336d=_0x2ca9b4;stringWidth(_0x2ca9b4)>_0x5963a0&&(_0x51336d=_0x2ca9b4[_0x273f80(0xf7)](0x0,_0x5963a0-0x1)+'…');const _0x4a4fd1=a54_0x4448c0[_0x273f80(0xcc)](_0x51336d),_0x47f707=stringWidth(_0x51336d),_0xf94b44='\x20'['repeat'](_0x18a23a-stringWidth(_0x51336d)+0x2),_0x4402cd='('+formatElapsed(_0x40b96c)+')',_0x235cee=stringWidth(_0x4402cd),_0x4e9444=stringWidth(_0x5ba60e),_0x366a57=_0x4e9444+0x1+_0x47f707+_0xf94b44[_0x273f80(0x9d)],_0x1338f5=_0x2c4888-_0x366a57-_0x235cee-0x1-0x8;let _0x7d773b=_0x53b122;stringWidth(_0x7d773b)>_0x1338f5&&(_0x7d773b=_0x7d773b[_0x273f80(0xf7)](0x0,_0x1338f5-0x1)+'…');const _0x263166=_0x40d3b7+'\x20'+_0x4a4fd1+_0xf94b44+_0x7d773b,_0x523051=stringWidth(_0x263166),_0x111293=_0x2c4888-_0x523051-_0x235cee,_0x4a9a14=_0x263166+'\x20'[_0x273f80(0x10a)](Math[_0x273f80(0xfd)](0x1,_0x111293))+a54_0x4448c0[_0x273f80(0xcc)](_0x4402cd),_0x255798=Math[_0x273f80(0x128)]((_0x234bed-_0x2d6b40)/_0xd71e65),_0x369f43=Math[_0x273f80(0x128)]((_0x279aa4-_0x2d6b40)/_0xd71e65),_0x4f139a=Math[_0x273f80(0xfd)](_0x255798+0x1,_0x369f43),_0x2bc6e0=new Array(_0x44e93a)[_0x273f80(0x1c4)]('\x20');for(let _0x3b1632=_0x255798;_0x3b1632<Math['min'](_0x4f139a,_0x44e93a);_0x3b1632++){_0x2bc6e0[_0x3b1632]='─';}const _0x746090=_0x2bc6e0[_0x273f80(0x17c)](_0x3f0fe8=>_0x3f0fe8==='\x20'?'\x20':_0x2134ac(_0x3f0fe8))[_0x273f80(0x1a8)]('');_0x51040a[_0x273f80(0x1e7)](_0xc33cac+'\x20'+_0x4a9a14+'│'+_0x746090+'│');}return _0x51040a[_0x273f80(0x1a8)]('\x0a');}async[a54_0x4f40c0(0x1a5)](_0x22f2da,_0x5a4c4e,_0x1a6a58){const _0x231e25=a54_0x4f40c0,{options:_0x217a66,tdx:_0x4869b6}=_0x5a4c4e,_0x377253=_0x217a66[_0x231e25(0x174)],{timelineRows:_0x29638b,timeAxisHeader:_0x4ab904}=this[_0x231e25(0x1f2)](_0x22f2da,_0x377253),_0x4e8fc8=_0x29638b[_0x231e25(0xb2)](_0x4d3c76=>_0x4d3c76['attemptId']);if(_0x4e8fc8['length']===0x0){const _0x21b654=this[_0x231e25(0x236)](_0x22f2da,_0x377253);console[_0x231e25(0xe7)](_0x21b654);!_0x1a6a58&&(console[_0x231e25(0x20f)](''),console[_0x231e25(0x20f)](a54_0x4448c0['dim'](_0x231e25(0x127))),console[_0x231e25(0x20f)](a54_0x4448c0[_0x231e25(0xcc)](_0x231e25(0x133))+'or'+a54_0x4448c0[_0x231e25(0xcc)](_0x231e25(0xc3))));return;}_0x4ab904&&console[_0x231e25(0xe7)](_0x4ab904);const _0x3405bd=_0x29638b[_0x231e25(0xb2)](_0x23ed50=>_0x23ed50[_0x231e25(0x249)])[_0x231e25(0x17c)](_0x5c672f=>({'title':_0x5c672f[_0x231e25(0xb8)],'value':_0x5c672f['attemptId']})),_0x1c3c79=process[_0x231e25(0x1d8)]['rows']||0x3c,_0x53521a=Math[_0x231e25(0xfd)](0x28,Math[_0x231e25(0x128)](_0x1c3c79*0x2/0x3)),_0x2d7072=await a54_0x3961f9({'type':_0x231e25(0x20e),'name':'attemptId','message':_0x231e25(0xea),'choices':_0x3405bd,'initial':-0x1,'limit':_0x53521a,'clearFirst':!![],'fallback':{'title':_0x231e25(0x1dc),'value':null},'suggest':(_0x223dc3,_0x255d37)=>{const _0x1da1b7=_0x231e25;if(!_0x223dc3)return Promise[_0x1da1b7(0xe5)](_0x255d37);const _0x8e4a85=_0x255d37['filter'](_0x4ab96e=>{const _0x42a496=_0x1da1b7,_0x566fc7=_0x4ab96e;return _0x566fc7['title'][_0x42a496(0x156)]()['includes'](_0x223dc3[_0x42a496(0x156)]());});return Promise[_0x1da1b7(0xe5)](_0x8e4a85);}}),_0x3a5d2f=()=>{const _0x5d3811=_0x231e25;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x5d3811(0x1d8)]['write'](_0x5d3811(0xae)),process[_0x5d3811(0x1d8)][_0x5d3811(0x19a)](_0x5d3811(0xae));},_0x2f73a8=_0x2d7072&&_0x2d7072[_0x231e25(0x249)]&&_0x2d7072[_0x231e25(0x249)]!==null&&_0x2d7072[_0x231e25(0x249)][_0x231e25(0xe8)]()!=='';if(!_0x2f73a8){_0x3a5d2f(),console[_0x231e25(0xe7)](a54_0x4448c0[_0x231e25(0xcc)]('Cancelled'));return;}_0x3a5d2f();const _0x27b255=_0x22f2da[_0x231e25(0x172)](_0x40ba91=>_0x40ba91[_0x231e25(0x17e)]?.['id']===_0x2d7072[_0x231e25(0x249)]);if(_0x27b255){const _0x1c9e86=_0x27b255[_0x231e25(0x22b)]?.[_0x231e25(0x153)]||'?',_0x6a23ca=_0x27b255[_0x231e25(0xc9)]?.['name']||'?';console[_0x231e25(0xe7)](_0x231e25(0x12d)+a54_0x4448c0[_0x231e25(0xcc)](_0x1c9e86)+_0x231e25(0x121)+a54_0x4448c0[_0x231e25(0xcc)](_0x6a23ca));}const _0xf3107b=new WorkflowTimelineCommand();await _0xf3107b[_0x231e25(0x1e9)]({'args':[],'options':{..._0x217a66,'attemptId':_0x2d7072['attemptId']},'tdx':_0x4869b6});}[a54_0x4f40c0(0x1f2)](_0x32c2ed,_0x55e9d5){const _0x53b524=a54_0x4f40c0,_0x589865=new Map();for(const _0x216945 of _0x32c2ed){_0x216945['id']&&_0x216945[_0x53b524(0x17e)]?.['id']&&_0x589865[_0x53b524(0x1c7)](_0x216945['id'],_0x216945[_0x53b524(0x17e)]['id']);}const _0x2a3ad7=[];let _0x528068='';const _0x2d94d3=this[_0x53b524(0x236)](_0x32c2ed,_0x55e9d5),_0x168c52=_0x2d94d3[_0x53b524(0x169)]('\x0a');for(const _0x331b96 of _0x168c52){if(_0x331b96[_0x53b524(0x155)](_0x53b524(0x158))||_0x331b96[_0x53b524(0xa7)](/^\s+\d{4}-\d{2}-\d{2}/))_0x528068=_0x331b96;else{if(_0x331b96[_0x53b524(0xa7)](/^[✅❌🔄🛑⏳]/)){const _0xf78dd1=_0x331b96[_0x53b524(0xa7)](/#(\d+)/),_0x31fc06=_0xf78dd1?_0xf78dd1[0x1]:null,_0x5b66ca=_0x31fc06?_0x589865[_0x53b524(0x112)](_0x31fc06)||null:null,_0x1e022a=_0x32c2ed['find'](_0x4cd409=>_0x4cd409['id']===_0x31fc06),_0x52cc4a=_0x1e022a?.[_0x53b524(0x22b)]?.['name']||'';_0x2a3ad7[_0x53b524(0x1e7)]({'displayLine':_0x331b96,'attemptId':_0x5b66ca,'projectName':_0x52cc4a});}}}return{'timelineRows':_0x2a3ad7,'timeAxisHeader':_0x528068};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x154);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xe3);async[a54_0x4f40c0(0x1e9)](_0x262711){const _0x49df51=a54_0x4f40c0,{options:_0x30a9e7,args:_0x5ad2fc,tdx:_0x42d423}=_0x262711,_0x1a6a82=this[_0x49df51(0x207)](_0x5ad2fc,_0x30a9e7);if(!_0x1a6a82)return 0x1;const {projectName:_0xabc4f0,workflowName:_0x100800}=_0x1a6a82,_0x8e9288=_0x30a9e7['includeRetried'];if(_0x30a9e7[_0x49df51(0x1c0)]){if(_0xabc4f0&&_0x100800)console[_0x49df51(0x20f)](_0x49df51(0x1db)+_0xabc4f0+'.'+_0x100800);else _0xabc4f0&&console['error'](_0x49df51(0x117)+_0xabc4f0);_0x8e9288&&console[_0x49df51(0x20f)]('Include\x20retried:\x20yes');}const _0x326a56=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x42d423[_0x49df51(0xc9)][_0x49df51(0xbb)]({'projectName':_0xabc4f0,'workflowName':_0x100800,'includeRetried':_0x8e9288,'limit':_0x30a9e7[_0x49df51(0x141)]}),{'verbose':_0x30a9e7['verbose']}),_0x248c91=_0x326a56[_0x49df51(0xdf)],_0x46611c=_0x30a9e7[_0x49df51(0x141)]||0x64,_0x36bb0e=_0x248c91[_0x49df51(0x9d)]>=_0x46611c?a54_0x4448c0['dim'](_0x49df51(0x193)):'';console[_0x49df51(0x20f)]('✔\x20Found\x20'+_0x248c91['length']+_0x49df51(0x1fe)+(_0x248c91['length']!==0x1?'s':'')+_0x36bb0e);if(_0x30a9e7[_0x49df51(0x1f0)]==='json'||_0x30a9e7[_0x49df51(0x1f0)]===_0x49df51(0x100)||_0x30a9e7[_0x49df51(0x1f0)]==='table')await handleSDKOutput(_0x248c91,_0x30a9e7);else{if(_0x248c91['length']===0x0){if(_0xabc4f0&&_0x100800)console[_0x49df51(0xe7)](_0x49df51(0xaa)+_0xabc4f0+'.'+_0x100800);else _0xabc4f0?console[_0x49df51(0xe7)](_0x49df51(0x108)+_0xabc4f0):console[_0x49df51(0xe7)](_0x49df51(0x15a));}else{const _0x1904f9=_0x30a9e7[_0x49df51(0x174)],_0x25a076=_0x248c91[_0x49df51(0x17c)](_0x4c6a42=>{const _0x2a233a=_0x49df51,_0x4168d8=a54_0x4448c0[_0x2a233a(0xcc)]('#'+_0x4c6a42['id']),_0x135116=_0x4c6a42[_0x2a233a(0x22b)]?.['id'],_0x32a178=_0x4c6a42[_0x2a233a(0x145)]||_0x4c6a42[_0x2a233a(0x1b6)],_0x39ca3f=_0x135116&&_0x32a178?hyperlink(_0x4168d8,getWorkflowAttemptUrl(_0x1904f9,_0x135116,_0x32a178,_0x4c6a42['id'])):_0x4168d8,{icon:_0x3b2196,text:_0x129d17}=getAttemptStatusDisplay(_0x4c6a42),_0x321881=(_0x4c6a42[_0x2a233a(0x22b)]?.[_0x2a233a(0x153)]||'?')+'.'+(_0x4c6a42['workflow']?.[_0x2a233a(0x153)]||'?'),_0x37fb75=_0x4c6a42['sessionTime']?a54_0x4448c0[_0x2a233a(0xcc)](_0x4c6a42[_0x2a233a(0x24f)]):'';return(_0x39ca3f+'\x20'+_0x3b2196+(_0x129d17?'\x20'+_0x129d17:'')+'\x20'+_0x321881+'\x20'+_0x37fb75)[_0x2a233a(0x9e)]();});await writeOutput(_0x25a076['join']('\x0a'),_0x30a9e7[_0x49df51(0x232)],_0x49df51(0x132));}}return 0x0;}}function a54_0x43e6(){const _0x4b55dc=['disabledAt','newProjectName','MAX_TIMELINE_WIDTH','\x0a⚠\x20Project\x20\x22','Source:\x20','Source\x20directory\x20is\x20required','deleted','attempt','resolveProject','\x20(use\x20--limit\x20to\x20show\x20more)','253DFGLsi','dryRun','yes','\x20task','values','executePushProject','write','Error:\x20','\x20\x20Session\x20ID:\x20','value','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','workflow:secrets:list','Parameters:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Showing\x20','→\x20Project:\x20','✔\x20Pull\x20complete','navigateSessionsInteractive','(use\x20--limit\x20to\x20see\x20more)','running','join','\x20\x20Revision:\x20','type','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x22\x20to\x20new\x20project\x20\x22','workflow:timeline','55464pgfQKt','✔\x20Schedule\x20#','Loading\x20workflows...','workflow:kill','\x20\x20New\x20attempt\x20ID:\x20','context','Retrying\x20attempt...','sessionId','isNewProject','\x20\x20Source:\x20','Output\x20directory:\x20','Cancelled','\x20sessions\x20','startedAt','📋\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20secret','verbose','fs/promises','workflow:sessions','TASK_NAME_WIDTH','fill','listSecrets','No\x20workflows\x20found','set','\x20-\x20','\x0aApply\x20these\x20changes?','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Expected\x20format:\x20--param\x20key=value','enableSchedule','min','path','cancelRequested','Project\x20directory:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','resumeFrom','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','✔\x20Workflow\x20project\x20set\x20to:\x20','toISOString','getTime','Pulling\x20project\x20','stdout','Pushing\x20workflow\x20project...','\x20from\x20session\x20','Filter:\x20','No\x20matching\x20sessions\x20found','Pattern:\x20','Files\x20to\x20upload:\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','MIN_LABEL_COUNT','\x20logs','from','✔\x20Project:\x20','workflow:secrets:delete','push','Setting\x20','execute','select','resolveProjectDir','No\x20sessions\x20found\x20for:\x20','POLL_INTERVAL_MS','📁\x20','toLocaleString','format','✔\x20Push\x20complete','generateSessionTimelineRows','Project\x20name\x20is\x20required','-\x20nothing\x20pushed','\x0aPush\x20these\x20changes?','MAX_POLL_ITERATIONS','getMinutes','\x20\x20Console:\x20','\x20next:\x20','start','workflow:run','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','\x20attempt','tdx.json','localeCompare','LABEL_WIDTH_DIVISOR','✔\x20Downloaded\x20','renderTimeline','revision','Session\x20time:\x20','fullName','parseProjectWorkflowPattern','workflow:workflows','readFile','Killing\x20attempt...','preparePushProject','skipValidation','\x20\x20Files\x20extracted:\x20','autocomplete','error','relative','workflow:schedules','\x20\x20Project\x20ID:\x20','revision:\x20','cyan','Including\x20subtasks:\x20yes','Analyzing\x20project...','finishedAt','Loading\x20sessions...','updatedAt','LABEL_MIN_SPACING','existingProjectId','targetExists','Analyzing\x20changes...','Force:\x20yes','sourceProjectName','isArray','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Auto-selected\x20latest\x20session:\x20','reason','\x0aUpdate\x20existing\x20project\x20\x22','workflows','round','done','kill','green','Target:\x20','project','canceling','parse','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','MIN_TIMELINE_WIDTH','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x20\x20Attempt\x20ID:\x20','output','workflow:retry','params','Error:\x20Project\x20name\x20is\x20required','renderSessionsTimeline','isTTY','fileCount','nextRunTime','filesExtracted','indexOf','state','Usage:\x20tdx\x20wf\x20use\x20<project>','replace','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','pending','Project\x20name:\x20','workflow:attempt','ICON_WIDTH','4899490UmpvHI','Listing\x20workflows...','task','logs','\x20(disabled)','attemptId','workflow:secrets:set','No\x20workflow\x20projects\x20found','Listing\x20workflow\x20sessions...','(unknown)','72fkLbFy','sessionTime','unknown','2743510JGEpsJ','\x20\x20Session\x20context\x20set\x20to:\x20','summary','\x20workflow','prepareCloneProject','cwd','index','workflow:clone','MAX_TASKS_DISPLAY','fileSize','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Retry\x20a\x20session\x20or\x20attempt','projectName','changes','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20secrets\x20set\x20for\x20project\x20\x27','length','trimEnd','has','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','diff','Disabling\x20schedule\x20#','stringify','No\x20sessions\x20found\x20in\x20project:\x20','Downloading\x20logs...','blue','match','No\x20log\x20files\x20found\x20for\x20this\x20attempt','download','No\x20attempts\x20found\x20for:\x20','6zHeirO','sort','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x1b[1A\x1b[2K','showWorkflowConsoleUrl','Show\x20tasks\x20for\x20an\x20attempt','columns','filter','table','createdAt','sessions','3486805geNnOx','splice','displayLine','Deleting\x20secret...','Listing\x20workflow\x20projects...','attempts','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','.\x20Expected\x20format:\x20KEY=VALUE','\x20modified','workflow:download','requireProject','param','duration','\x20\x20tdx\x20wf\x20use\x20<project>','success','No\x20projects\x20match\x20pattern:\x20','getMonth','includes','No\x20workflows\x20found\x20in\x20project:\x20','workflow','end','No\x20sessions\x20found','dim','✔\x20Retry\x20started','unchanged','renderSingleTimeline','Status:\x20','Revision:\x20','includeSubtasks','1400100uRaeCq','description','\x20\x20Changes:\x20','No\x20log\x20content\x20found','projectId','\x27\x20from\x20project\x20\x27','padStart','startTime','Listing\x20schedules...','workflow:tasks','Fetching\x20log\x20files...','text','data','Total:\x20','workflow:use','\x20schedule','List\x20workflow\x20attempts','pollTimeline','resolve','Using\x20attempt\x20','log','trim','getFullYear','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Latest\x20session\x20has\x20no\x20attempt','durationMs','Enabling\x20schedule\x20#','Attempt:\x20','group_error','workflow:schedule:enable','retryAttempt','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Setting\x20secret...','...','-\x20no\x20files\x20written','List\x20workflows','slice','✔\x20Clone\x20complete','/app/workflows/','Kill\x20a\x20running\x20attempt','listSchedules','Disable\x20a\x20workflow\x20schedule','max','\x20\x20Project:\x20','---\x20','jsonl','\x0aClone\x20\x22','size','From\x20task:\x20','\x20secrets...','new','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20workflow\x20sessions\x20found','No\x20attempts\x20found\x20in\x20project:\x20','Error:\x20Attempt\x20ID\x20is\x20required','repeat','Show\x20specific\x20attempt\x20details','projects','session','window','✔\x20Project\x20updated','status','⚠\x20Showing\x20first\x20','get','workflow:delete','✔\x20Found\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:upload','Filter:\x20project=','workflowName','workflow:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Workflow:\x20','Key\x20cannot\x20be\x20empty','\x20\x20Next\x20run:\x20','📅\x20#','getDate','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)',',\x20Workflow:\x20','Deleting\x20project\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','taskName','workflowProject','6aKKXJD','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','floor','No\x20schedules\x20found','Getting\x20attempt\x20tasks...','executeCloneProject','Session\x20','Project:\x20','\x20\x20Target:\x20','6301gCSpHV','targetDir','now','list','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x0a✔\x20No\x20changes\x20to\x20push','Target\x20directory:\x20','clear','\x0aDry\x20run\x20-\x20no\x20project\x20created','Loading\x20session...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','yellow','substring','Starting\x20workflow\x20run...','tdx\x20wf\x20attempt\x20','\x20disabled\x20(','\x0aPolling...\x20(','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','limit','\x20deleted','\x20is\x20not\x20a\x20directory','Error:\x20Secret\x20key\x20is\x20required','session_id','Error:','✔\x20Workflow\x20run\x20started','List\x20workflow\x20execution\x20sessions','retryAttemptName','workflow:schedule:disable','✔\x20Deleted\x20project\x20','workflow:projects','session:','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','workflow:logs','Select\x20a\x20session\x20to\x20view\x20timeline:','Schedule\x20ID\x20is\x20required','name','workflow:attempts','startsWith','toLowerCase','msPerChar','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','GUTTER','No\x20attempts\x20found','json','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','List\x20all\x20workflow\x20projects','Listing\x20secrets...','Resume\x20from:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20new','keys','tasks','ICON_SPACING','No\x20sessions\x20with\x20timing\x20information','red','🔄\x20','split','Dry\x20run:\x20yes','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Select\x20a\x20task\x20to\x20view\x20logs:','follow','733280CoaIho','icon','\x0aError:','\x0aDry\x20run\x20-\x20nothing\x20pushed','find','Select\x20a\x20workflow\x20to\x20run','site','getHours','key','\x0a✔\x20Already\x20up\x20to\x20date','buildTimelineData','\x20tasks','\x20session','modified','map','✔\x20Secret\x20\x27','lastAttempt','disableSchedule','planned','18QRHzYw','\x20\x20Location:\x20','Validation:\x20skipped','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','New\x20project\x20name:\x20','Failed\x20to\x20fetch\x20attempt\x20data','\x22\x20with\x20new\x20revision?','Attempt\x20ID:\x20','hasChanges'];a54_0x43e6=function(){return _0x4b55dc;};return a54_0x43e6();}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x242);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x10b);async[a54_0x4f40c0(0x1e9)](_0x232884){const _0x545183=a54_0x4f40c0,{options:_0x4dd349,args:_0x5b643f,tdx:_0x3abe09}=_0x232884,_0x473a3c=_0x5b643f[0x0];if(!_0x473a3c)return console[_0x545183(0x20f)](_0x545183(0x109)),0x1;_0x4dd349[_0x545183(0x1c0)]&&console[_0x545183(0x20f)](_0x545183(0x188)+_0x473a3c);const _0x340c90=await withSpinner('Getting\x20attempt\x20details...',()=>_0x3abe09[_0x545183(0xc9)]['attempt'](_0x473a3c),{'verbose':_0x4dd349[_0x545183(0x1c0)]}),_0xba36f9=_0x340c90[_0x545183(0xdf)];let _0x204c76;!_0xba36f9[_0x545183(0x227)]?_0x204c76=_0xba36f9[_0x545183(0x1cf)]?_0x545183(0x22c):_0x545183(0x1a7):_0x204c76=_0xba36f9[_0x545183(0xc4)]?_0x545183(0xc4):_0x545183(0x20f);let _0x59b08f;if(_0xba36f9[_0x545183(0xb4)]&&_0xba36f9[_0x545183(0x217)]){const _0x728004=new Date(_0xba36f9[_0x545183(0xb4)])[_0x545183(0x1d6)](),_0x44817e=new Date(_0xba36f9[_0x545183(0x217)])[_0x545183(0x1d6)]();_0x59b08f=Math[_0x545183(0x226)]((_0x44817e-_0x728004)/0x3e8);}const _0x3d9b51={'attempt_id':_0xba36f9['id'],'status':_0x204c76,..._0xba36f9[_0x545183(0x257)]!==undefined&&{'index':_0xba36f9['index']},..._0xba36f9[_0x545183(0x22b)]&&{'project':_0xba36f9[_0x545183(0x22b)]['name']},..._0xba36f9['workflow']&&{'workflow':_0xba36f9[_0x545183(0xc9)][_0x545183(0x153)]},..._0xba36f9['sessionId']&&{'session_id':_0xba36f9[_0x545183(0x1b6)]},..._0xba36f9[_0x545183(0x24f)]&&{'session_time':_0xba36f9[_0x545183(0x24f)]},..._0xba36f9[_0x545183(0x149)]&&{'retry_attempt':_0xba36f9[_0x545183(0x149)]},..._0x59b08f!==undefined&&{'duration_sec':_0x59b08f},..._0xba36f9['createdAt']&&{'created_at':_0xba36f9[_0x545183(0xb4)]},..._0xba36f9[_0x545183(0x217)]&&{'finished_at':_0xba36f9[_0x545183(0x217)]},...Object[_0x545183(0x163)](_0xba36f9[_0x545183(0x234)])[_0x545183(0x9d)]>0x0&&{'params':_0xba36f9[_0x545183(0x234)]}};return await handleSingleObjectOutput(_0x3d9b51,_0x4dd349),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0xdc);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xb0);async[a54_0x4f40c0(0x1e9)](_0x1564df){const _0x3311cb=a54_0x4f40c0,{options:_0x515022,args:_0x5a5e69,tdx:_0x23a75c}=_0x1564df,_0x35e873=_0x5a5e69[0x0];if(!_0x35e873)return console[_0x3311cb(0x20f)](_0x3311cb(0x109)),0x1;const _0xf5b915=_0x515022[_0x3311cb(0xd2)];_0x515022[_0x3311cb(0x1c0)]&&(console[_0x3311cb(0x20f)](_0x3311cb(0x188)+_0x35e873),_0xf5b915&&console[_0x3311cb(0x20f)](_0x3311cb(0x215)));const _0xbc3cea=await withSpinner(_0x3311cb(0x12a),()=>_0x23a75c['workflow'][_0x3311cb(0x164)](_0x35e873,_0xf5b915||![]),{'verbose':_0x515022['verbose']}),_0x2f618f=_0xbc3cea[_0x3311cb(0xdf)];return console[_0x3311cb(0x20f)]('✔\x20Found\x20'+_0x2f618f[_0x3311cb(0x9d)]+_0x3311cb(0x197)+(_0x2f618f[_0x3311cb(0x9d)]!==0x1?'s':'')),await handleSDKOutput(_0x2f618f,_0x515022),0x0;}}function a54_0x4855(_0x318f13,_0x570f20){_0x318f13=_0x318f13-0x99;const _0x43e6ba=a54_0x43e6();let _0x485513=_0x43e6ba[_0x318f13];return _0x485513;}export class WorkflowLogsCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x150);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x115);async[a54_0x4f40c0(0x1e9)](_0x4cf1fd){const _0x5c428b=a54_0x4f40c0,{options:_0x144f78,args:_0x1e9e2e,tdx:_0x8b25f1}=_0x4cf1fd,_0x1a559f=_0x1e9e2e[0x0];let _0x1df2b6=_0x1e9e2e[0x1];if(!_0x1a559f)return console[_0x5c428b(0x20f)](_0x5c428b(0x109)),0x1;_0x144f78[_0x5c428b(0x1c0)]&&(console[_0x5c428b(0x20f)](_0x5c428b(0x188)+_0x1a559f),_0x1df2b6&&console['error']('Task\x20name:\x20'+_0x1df2b6));const _0x4955d8=await withSpinner(_0x5c428b(0xdd),()=>_0x8b25f1['workflow']['logFiles'](_0x1a559f,_0x1df2b6),{'verbose':_0x144f78['verbose']}),_0x48c1f8=_0x4955d8['data'];if(_0x48c1f8[_0x5c428b(0x9d)]===0x0)return console[_0x5c428b(0x20f)](_0x5c428b(0xa8)),0x0;if(!_0x1df2b6&&(_0x144f78[_0x5c428b(0x15b)]||_0x144f78[_0x5c428b(0x1f0)]))return await handleSDKOutput(_0x48c1f8,_0x144f78),0x0;if(!_0x1df2b6){const _0x58c20b=_0x48c1f8[_0x5c428b(0x17c)](_0x45065c=>({'title':_0x45065c[_0x5c428b(0x124)]+'\x20('+formatBytes(_0x45065c[_0x5c428b(0x25a)])+')','value':_0x45065c[_0x5c428b(0x124)]})),_0x2e583b=await a54_0x3961f9({'type':_0x5c428b(0x1ea),'name':_0x5c428b(0x246),'message':_0x5c428b(0x16c),'choices':_0x58c20b});if(!_0x2e583b['task'])return console[_0x5c428b(0x20f)](_0x5c428b(0x1ba)),0x0;_0x1df2b6=_0x2e583b['task'];}const _0x3a033a=await withSpinner(_0x5c428b(0xa5),()=>_0x8b25f1[_0x5c428b(0xc9)][_0x5c428b(0x247)](_0x1a559f,_0x1df2b6),{'verbose':_0x144f78['verbose']}),_0x299aa7=_0x3a033a[_0x5c428b(0xdf)];return _0x299aa7?console[_0x5c428b(0xe7)](_0x299aa7):console[_0x5c428b(0x20f)](_0x5c428b(0xd6)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1b2);['description']=a54_0x4f40c0(0xfa);async['execute'](_0x4a89cc){const _0x15cef2=a54_0x4f40c0,{options:_0x1084b2,args:_0x503b13,tdx:_0x10ab81}=_0x4a89cc,_0x567e8e=_0x503b13[0x0];if(!_0x567e8e)return console[_0x15cef2(0x20f)](_0x15cef2(0x109)),0x1;const _0x34d8b9=_0x1084b2[_0x15cef2(0x223)];_0x1084b2[_0x15cef2(0x1c0)]&&(console[_0x15cef2(0x20f)]('Attempt\x20ID:\x20'+_0x567e8e),_0x34d8b9&&console[_0x15cef2(0x20f)]('Reason:\x20'+_0x34d8b9));if(!_0x1084b2['yes']){if(!isInteractive())return console[_0x15cef2(0x20f)](a54_0x4448c0[_0x15cef2(0x167)](_0x15cef2(0x170)),_0x15cef2(0x106)),console[_0x15cef2(0x20f)](a54_0x4448c0[_0x15cef2(0xcc)](_0x15cef2(0x140))),0x1;const _0x22d7a1=await confirmKey(_0x15cef2(0x15c)+_0x567e8e+'?');if(!_0x22d7a1)return console[_0x15cef2(0x20f)](a54_0x4448c0['yellow'](_0x15cef2(0x1ba))),0x1;}const _0x805ec6=await withSpinner(_0x15cef2(0x20a),()=>_0x10ab81[_0x15cef2(0xc9)][_0x15cef2(0x228)](_0x567e8e,_0x34d8b9),{'verbose':_0x1084b2['verbose']}),_0x85be89=_0x805ec6[_0x15cef2(0xdf)];return console[_0x15cef2(0x20f)]('✔\x20'+_0x85be89),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x233);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x25c);async[a54_0x4f40c0(0x1e9)](_0x134e44){const _0x5ec997=a54_0x4f40c0,{options:_0x4ed81b,args:_0xfffa7d,tdx:_0x500b78}=_0x134e44,_0x5ec81c=_0xfffa7d[0x0];if(!_0x5ec81c)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x5ec997(0x20f)](_0x5ec997(0x1ac)),0x1;let _0x5d6aca=![],_0x4ca7de=_0x5ec81c;if(_0x5ec81c['startsWith'](_0x5ec997(0x14d)))_0x5d6aca=!![],_0x4ca7de=_0x5ec81c[_0x5ec997(0x13b)](0x8);else{if(_0x5ec81c[_0x5ec997(0x155)]('attempt:'))_0x5d6aca=![],_0x4ca7de=_0x5ec81c[_0x5ec997(0x13b)](0x8);else return console[_0x5ec997(0x20f)](_0x5ec997(0x1be)),console[_0x5ec997(0x20f)](_0x5ec997(0x1ac)),0x1;}const _0x479052=_0x4ed81b['fromTask'],_0x1a0f4c=_0x4ed81b[_0x5ec997(0x1d2)],_0x7cb855=_0x4ed81b[_0x5ec997(0x234)],_0x1053db=_0x4ed81b['force'];_0x4ed81b[_0x5ec997(0x1c0)]&&(console[_0x5ec997(0x20f)](_0x5ec997(0x22a)+(_0x5d6aca?_0x5ec997(0x10d):_0x5ec997(0x191))+'\x20'+_0x4ca7de),_0x479052&&console['error'](_0x5ec997(0x103)+_0x479052),_0x1a0f4c&&console['error'](_0x5ec997(0x15f)+_0x1a0f4c),_0x7cb855&&console[_0x5ec997(0x20f)]('Params:\x20'+_0x7cb855),_0x1053db&&console[_0x5ec997(0x20f)](_0x5ec997(0x21e)));let _0x42a27f;if(_0x7cb855)try{if(_0x7cb855['startsWith']('@')){const _0x3712ba=await import(_0x5ec997(0x1c1)),_0x42d973=_0x7cb855['substring'](0x1),_0x554070=await _0x3712ba[_0x5ec997(0x209)](_0x42d973,'utf-8');_0x42a27f=JSON['parse'](_0x554070);}else _0x42a27f=JSON[_0x5ec997(0x22d)](_0x7cb855);}catch{return console[_0x5ec997(0x20f)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x4ed81b[_0x5ec997(0x196)]){if(!isInteractive())return console[_0x5ec997(0x20f)](a54_0x4448c0[_0x5ec997(0x167)](_0x5ec997(0x170)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5ec997(0x20f)](a54_0x4448c0['dim'](_0x5ec997(0x140))),0x1;const _0x2916ee=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5d6aca?_0x5ec997(0x10d):_0x5ec997(0x191))+'\x20'+_0x4ca7de+'?');if(!_0x2916ee)return console[_0x5ec997(0x20f)](a54_0x4448c0['yellow'](_0x5ec997(0x1ba))),0x1;}let _0xe3c806;_0x5d6aca?_0xe3c806=await withSpinner('Retrying\x20session...',()=>_0x500b78[_0x5ec997(0xc9)]['retrySession'](_0x4ca7de,{'fromTask':_0x479052,'retryParams':_0x42a27f}),{'verbose':_0x4ed81b[_0x5ec997(0x1c0)]}):_0xe3c806=await withSpinner(_0x5ec997(0x1b5),()=>_0x500b78[_0x5ec997(0xc9)][_0x5ec997(0xf1)](_0x4ca7de,{'resumeFrom':_0x1a0f4c,'retryParams':_0x42a27f,'force':_0x1053db}),{'verbose':_0x4ed81b[_0x5ec997(0x1c0)]});const _0x4b4190=_0xe3c806[_0x5ec997(0xdf)];return console[_0x5ec997(0x20f)](_0x5ec997(0xcd)),console['error'](_0x5ec997(0x1b3)+_0x4b4190[_0x5ec997(0x249)]),console[_0x5ec997(0x20f)](_0x5ec997(0x19c)+_0x4b4190[_0x5ec997(0x1b6)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1fb);[a54_0x4f40c0(0xd4)]='Start\x20a\x20workflow\x20run';async[a54_0x4f40c0(0x1e9)](_0x291c94){const _0xe538dd=a54_0x4f40c0,{options:_0x356523,args:_0x3730c2,tdx:_0x2994e3}=_0x291c94;let _0x5aa74b=_0x3730c2[0x0];if(!_0x5aa74b){const _0x2aa532=this[_0xe538dd(0x192)]([],_0x356523),_0x5e34ed=await withSpinner(_0xe538dd(0x1b1),()=>_0x2994e3[_0xe538dd(0xc9)][_0xe538dd(0x225)](_0x2aa532,{'limit':_0x356523[_0xe538dd(0x141)]}),{'verbose':_0x356523[_0xe538dd(0x1c0)]}),_0x497331=_0x5e34ed[_0xe538dd(0xdf)];if(_0x497331[_0xe538dd(0x9d)]===0x0)return console[_0xe538dd(0x20f)]('No\x20workflows\x20found'),!_0x2aa532&&console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0xcc)](_0xe538dd(0x23f))),0x1;const _0x5026bc=_0x497331[_0xe538dd(0x17c)](_0x721101=>({'title':_0x721101[_0xe538dd(0x22b)]?.['name']+'.'+_0x721101[_0xe538dd(0x153)],'value':_0x721101[_0xe538dd(0x22b)]?.[_0xe538dd(0x153)]+'.'+_0x721101[_0xe538dd(0x153)],'description':_0x721101[_0xe538dd(0x204)]?_0xe538dd(0x213)+_0x721101[_0xe538dd(0x204)]:undefined})),_0x56fa7f=await a54_0x3961f9({'type':'select','name':_0xe538dd(0xc9),'message':_0xe538dd(0x173),'choices':_0x5026bc});if(!_0x56fa7f[_0xe538dd(0xc9)])return 0x1;_0x5aa74b=_0x56fa7f['workflow'];}if(!_0x5aa74b[_0xe538dd(0xc7)]('.')){const _0x32f0c7=this[_0xe538dd(0x192)]([],_0x356523);if(_0x32f0c7)_0x5aa74b=_0x32f0c7+'.'+_0x5aa74b;else return console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0x167)](_0xe538dd(0x146)),_0xe538dd(0x1fd)),console[_0xe538dd(0x20f)](a54_0x4448c0[_0xe538dd(0xcc)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x45fd39=_0x356523[_0xe538dd(0xc1)],_0xb528b3=_0x356523[_0xe538dd(0x24f)],_0x260b1b={};if(_0x45fd39&&Array[_0xe538dd(0x220)](_0x45fd39))for(const _0x1aa5f5 of _0x45fd39){const _0x845c24=_0x1aa5f5[_0xe538dd(0x23b)]('=');if(_0x845c24===-0x1)return console[_0xe538dd(0x20f)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x1aa5f5),console['error'](_0xe538dd(0x1cb)),0x1;const _0x19cf90=_0x1aa5f5[_0xe538dd(0x13b)](0x0,_0x845c24),_0x71951b=_0x1aa5f5[_0xe538dd(0x13b)](_0x845c24+0x1);try{_0x260b1b[_0x19cf90]=JSON['parse'](_0x71951b);}catch{_0x260b1b[_0x19cf90]=_0x71951b;}}_0x356523[_0xe538dd(0x1c0)]&&(console[_0xe538dd(0x20f)]('Workflow:\x20'+_0x5aa74b),Object[_0xe538dd(0x163)](_0x260b1b)[_0xe538dd(0x9d)]>0x0&&console[_0xe538dd(0x20f)](_0xe538dd(0x1a0)+JSON[_0xe538dd(0xa3)](_0x260b1b)),_0xb528b3&&console['error'](_0xe538dd(0x205)+_0xb528b3));const _0x4c600d=await withSpinner(_0xe538dd(0x13c),()=>_0x2994e3[_0xe538dd(0xc9)]['run'](_0x5aa74b,_0x260b1b,{'sessionTime':_0xb528b3}),{'verbose':_0x356523[_0xe538dd(0x1c0)]}),_0x2a31dc=_0x4c600d['data'];console[_0xe538dd(0x20f)](_0xe538dd(0x147)),console['error'](_0xe538dd(0x231)+_0x2a31dc['id']),console[_0xe538dd(0x20f)](_0xe538dd(0x19c)+_0x2a31dc[_0xe538dd(0x1b6)]),console[_0xe538dd(0x20f)](_0xe538dd(0xfe)+_0x2a31dc[_0xe538dd(0x22b)]?.[_0xe538dd(0x153)]),console[_0xe538dd(0x20f)](_0xe538dd(0x11b)+_0x2a31dc['workflow']?.[_0xe538dd(0x153)]);if(_0x2a31dc[_0xe538dd(0x22b)]?.['id']&&_0x2a31dc[_0xe538dd(0x1b6)]&&_0x2a31dc['id']){const _0x27fd61=_0x356523[_0xe538dd(0x174)],_0x2511d1=getConsoleUrl(_0x27fd61,_0xe538dd(0xf9)+_0x2a31dc[_0xe538dd(0x22b)]['id']+'/sessions/'+_0x2a31dc[_0xe538dd(0x1b6)]+'/attempt/'+_0x2a31dc['id']);console[_0xe538dd(0x20f)]('\x20\x20Console:\x20'+a54_0x4448c0[_0xe538dd(0x214)](_0x2511d1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x4f40c0(0xbf);[a54_0x4f40c0(0xd4)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x4f40c0(0x1e9)](_0x44f46a){const _0x405a64=a54_0x4f40c0,{options:_0x56e18d,args:_0x34d6ba,tdx:_0xb1caa4}=_0x44f46a,_0x54614b=_0x34d6ba[0x0],_0x1efba2=_0x34d6ba[0x1]||'.';if(!_0x54614b)return console[_0x405a64(0x20f)](_0x405a64(0x235)),console[_0x405a64(0x20f)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x361739=_0x56e18d['revision'];_0x56e18d[_0x405a64(0x1c0)]&&(console['error'](_0x405a64(0x12d)+_0x54614b),console['error'](_0x405a64(0x1b9)+_0x1efba2),_0x361739&&console['error'](_0x405a64(0xd1)+_0x361739));const _0xf76a01=await withSpinner('Downloading\x20project\x20'+_0x54614b+_0x405a64(0xf4),()=>_0xb1caa4['workflow'][_0x405a64(0xa9)](_0x54614b,_0x1efba2,{'revision':_0x361739}),{'verbose':_0x56e18d['verbose']}),_0x57ef88=_0xf76a01[_0x405a64(0xdf)];return console[_0x405a64(0x20f)](_0x405a64(0x202)+_0x57ef88[_0x405a64(0x99)]),console['error']('\x20\x20Revision:\x20'+_0x57ef88['revision']),console['error'](_0x405a64(0x20d)+_0x57ef88[_0x405a64(0x23a)]),console['error'](_0x405a64(0x182)+_0x1efba2+'/'+_0x57ef88[_0x405a64(0x99)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x116);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x120);async['execute'](_0x4d9393){const _0x5af7a6=a54_0x4f40c0,{options:_0x201e44,args:_0x853626,tdx:_0x3bde15}=_0x4d9393;let _0x51dbe9='.',_0x288f73=_0x201e44[_0x5af7a6(0x153)];if(_0x853626[0x0]){const {promises:_0x283aeb}=await import('fs');try{const _0xb95d78=await _0x283aeb['stat'](_0x853626[0x0]);if(_0xb95d78['isDirectory']())_0x51dbe9=_0x853626[0x0];else return console[_0x5af7a6(0x20f)](_0x5af7a6(0x19b)+_0x853626[0x0]+_0x5af7a6(0x143)),0x1;}catch{_0x288f73=_0x853626[0x0],_0x51dbe9='.';}}const _0x290fdb=_0x201e44['revision'],_0x472001=_0x201e44['skipValidation'];_0x201e44['verbose']&&(console['error'](_0x5af7a6(0x1d0)+_0x51dbe9),_0x288f73&&console[_0x5af7a6(0x20f)](_0x5af7a6(0x241)+_0x288f73),_0x290fdb&&console['error'](_0x5af7a6(0xd1)+_0x290fdb),_0x472001&&console[_0x5af7a6(0x20f)]('Validation:\x20skipped'));const _0x2034d5=await withSpinner(_0x5af7a6(0x1d9),()=>_0x3bde15[_0x5af7a6(0xc9)][_0x5af7a6(0x1e7)](_0x51dbe9,{'projectName':_0x288f73,'revision':_0x290fdb,'skipValidation':_0x472001}),{'verbose':_0x201e44[_0x5af7a6(0x1c0)]}),_0x2813af=_0x2034d5['data'];return console[_0x5af7a6(0x20f)]('✔\x20Pushed\x20'+_0x2813af[_0x5af7a6(0x99)]),console[_0x5af7a6(0x20f)](_0x5af7a6(0x212)+_0x2813af[_0x5af7a6(0xd7)]),console['error'](_0x5af7a6(0x1a9)+_0x2813af['revision']),await this[_0x5af7a6(0xaf)](_0x3bde15,_0x2813af[_0x5af7a6(0x99)],_0x201e44[_0x5af7a6(0x174)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x119);[a54_0x4f40c0(0xd4)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x4890b6){const _0x54a350=a54_0x4f40c0,{options:_0x268f7b,args:_0x2ef52d,tdx:_0x3f8c74}=_0x4890b6,_0x37ed32=_0x2ef52d[0x0],_0x39eb55=_0x2ef52d[0x1];if(!_0x37ed32)return console['error'](a54_0x4448c0[_0x54a350(0x167)](_0x54a350(0x146)),_0x54a350(0x1f3)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0xf2))),0x1;const _0x32db88=_0x268f7b[_0x54a350(0x204)];_0x268f7b[_0x54a350(0x1c0)]&&(console[_0x54a350(0x20f)](_0x54a350(0x12d)+_0x37ed32),_0x39eb55&&console['error'](_0x54a350(0x135)+_0x39eb55),_0x32db88&&console[_0x54a350(0x20f)](_0x54a350(0xd1)+_0x32db88),_0x268f7b[_0x54a350(0x195)]&&console[_0x54a350(0x20f)](_0x54a350(0x16a)));const _0x52efb2=await withSpinner(_0x54a350(0x1d7)+_0x37ed32+_0x54a350(0xf4),()=>_0x3f8c74[_0x54a350(0xc9)]['pullProject'](_0x37ed32,{'targetDir':_0x39eb55,'revision':_0x32db88}),{'verbose':_0x268f7b[_0x54a350(0x1c0)]}),_0x3821f0=_0x52efb2[_0x54a350(0xdf)];_0x3821f0[_0x54a350(0x1b7)]?console[_0x54a350(0x20f)]('→\x20New\x20project:\x20'+_0x3821f0[_0x54a350(0x99)]):console['error'](_0x54a350(0x1a3)+_0x3821f0['projectName']);console[_0x54a350(0x20f)](_0x54a350(0x1a9)+_0x3821f0[_0x54a350(0x204)]),console['error'](_0x54a350(0x12e)+(a54_0x4ed50f[_0x54a350(0x210)](process[_0x54a350(0x256)](),_0x3821f0[_0x54a350(0x130)])||'.')),console[_0x54a350(0x20f)](_0x54a350(0xd5)+a54_0x4448c0[_0x54a350(0x229)]('+'+_0x3821f0[_0x54a350(0x253)][_0x54a350(0x105)]+'\x20new')+',\x20'+(a54_0x4448c0[_0x54a350(0x13a)]('~'+_0x3821f0['summary'][_0x54a350(0x17b)]+'\x20modified')+',\x20')+(a54_0x4448c0[_0x54a350(0x167)]('-'+_0x3821f0[_0x54a350(0x253)][_0x54a350(0x190)]+_0x54a350(0x142))+',\x20')+(''+a54_0x4448c0[_0x54a350(0xcc)](_0x3821f0[_0x54a350(0x253)][_0x54a350(0xce)]+'\x20unchanged')));for(const _0x3c10c2 of _0x3821f0[_0x54a350(0x9a)]){_0x3c10c2[_0x54a350(0x1aa)]===_0x54a350(0x17b)&&_0x3c10c2['diff']&&(console[_0x54a350(0x20f)]('\x0a'+a54_0x4448c0[_0x54a350(0x214)](_0x54a350(0xff)+_0x3c10c2[_0x54a350(0x1ce)])),console[_0x54a350(0x20f)](_0x3c10c2['diff']));}if(!_0x3821f0[_0x54a350(0x189)])return saveSessionContext({'workflow_project':_0x3821f0['projectName']},_0x268f7b[_0x54a350(0x10d)]),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x229)](_0x54a350(0x177))),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0x252)+_0x3821f0['projectName'])),0x0;if(_0x268f7b[_0x54a350(0x195)])return console['error'](a54_0x4448c0['yellow'](_0x54a350(0x230))),0x0;if(!_0x268f7b['yes']){if(!isInteractive())return console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x167)]('\x0aError:'),_0x54a350(0x106)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)](_0x54a350(0x140))),0x1;const _0x24c608=await confirmKey(_0x54a350(0x1c9));if(!_0x24c608)return console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0x13a)]('Cancelled'),_0x54a350(0xf5)),0x1;}await withSpinner('Writing\x20files...',()=>_0x3f8c74[_0x54a350(0xc9)]['applyPullProject'](_0x3821f0,{'revision':_0x32db88}),{'verbose':_0x268f7b[_0x54a350(0x1c0)]}),saveSessionContext({'workflow_project':_0x3821f0[_0x54a350(0x99)]},_0x268f7b[_0x54a350(0x10d)]),console['error'](a54_0x4448c0['green'](_0x54a350(0x1a4)));const _0x1b503d=a54_0x4ed50f[_0x54a350(0x210)](process[_0x54a350(0x256)](),_0x3821f0['targetDir'])||'.';return console[_0x54a350(0x20f)](a54_0x4448c0['dim'](_0x54a350(0x182)+_0x1b503d)),console[_0x54a350(0x20f)](a54_0x4448c0[_0x54a350(0xcc)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3821f0[_0x54a350(0x99)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x160);async['execute'](_0x274c54){const _0x4d02a6=a54_0x4f40c0,{options:_0x4e5506,args:_0xf31171,tdx:_0x167aee}=_0x274c54,_0x3d293b=this[_0x4d02a6(0x1eb)](_0xf31171,_0x4e5506),_0x327ac0=_0x4e5506[_0x4d02a6(0x204)],_0x740007=_0x4e5506[_0x4d02a6(0x20c)];_0x4e5506['verbose']&&(_0x3d293b&&console[_0x4d02a6(0x20f)]('Source\x20directory:\x20'+_0x3d293b),_0x327ac0&&console['error']('Revision:\x20'+_0x327ac0),_0x4e5506['dryRun']&&console[_0x4d02a6(0x20f)](_0x4d02a6(0x16a)),_0x740007&&console[_0x4d02a6(0x20f)](_0x4d02a6(0x183)));let _0x20209b;try{_0x20209b=await withSpinner(_0x4d02a6(0x21d),()=>_0x167aee[_0x4d02a6(0xc9)][_0x4d02a6(0x20b)]({'sourceDir':_0x3d293b,'revision':_0x327ac0,'skipValidation':_0x740007}),{'verbose':_0x4e5506['verbose']});}catch(_0x4f695b){if(_0x4f695b instanceof Error&&_0x4f695b['message'][_0x4d02a6(0xc7)]('No\x20workflow\x20tdx.json\x20found'))return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x167)]('Error:'),_0x4d02a6(0xbc)),_0x4e5506[_0x4d02a6(0x125)]?console['error'](a54_0x4448c0[_0x4d02a6(0xcc)]('Tip:\x20cd\x20to\x20workflows/'+_0x4e5506[_0x4d02a6(0x125)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4e5506[_0x4d02a6(0x125)]+'\x27')):console['error'](a54_0x4448c0['dim'](_0x4d02a6(0x19e))),0x1;throw _0x4f695b;}const _0xaa435a=_0x20209b[_0x4d02a6(0xdf)];console[_0x4d02a6(0x20f)](_0x4d02a6(0x1e5)+_0xaa435a['projectName']),console[_0x4d02a6(0x20f)](_0x4d02a6(0x1b8)+_0xaa435a['sourceDir']),console[_0x4d02a6(0x20f)]('\x20\x20Revision:\x20'+_0xaa435a[_0x4d02a6(0x204)]),console[_0x4d02a6(0x20f)](_0x4d02a6(0xd5)+a54_0x4448c0[_0x4d02a6(0x229)]('+'+_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0x105)]+_0x4d02a6(0x162))+',\x20'+(a54_0x4448c0['yellow']('~'+_0xaa435a['summary']['modified']+_0x4d02a6(0xbe))+',\x20')+(a54_0x4448c0['red']('-'+_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0x190)]+'\x20deleted')+',\x20')+(''+a54_0x4448c0['dim'](_0xaa435a[_0x4d02a6(0x253)][_0x4d02a6(0xce)]+'\x20unchanged')));for(const _0x14907f of _0xaa435a['changes']){_0x14907f['type']===_0x4d02a6(0x17b)&&_0x14907f['diff']&&(console[_0x4d02a6(0x20f)]('\x0a'+a54_0x4448c0[_0x4d02a6(0x214)]('---\x20'+_0x14907f[_0x4d02a6(0x1ce)])),console[_0x4d02a6(0x20f)](_0x14907f[_0x4d02a6(0xa1)]));}if(!_0xaa435a[_0x4d02a6(0x189)])return console[_0x4d02a6(0x20f)](a54_0x4448c0['green'](_0x4d02a6(0x134))),await this[_0x4d02a6(0xaf)](_0x167aee,_0xaa435a[_0x4d02a6(0x99)],_0x4e5506[_0x4d02a6(0x174)]),0x0;if(_0x4e5506[_0x4d02a6(0x195)])return console[_0x4d02a6(0x20f)](a54_0x4448c0['yellow'](_0x4d02a6(0x171))),0x0;if(!_0x4e5506[_0x4d02a6(0x196)]){if(!isInteractive())return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x167)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x4448c0['dim'](_0x4d02a6(0x140))),0x1;const _0x2cdf7b=await confirmKey(_0x4d02a6(0x1f5));if(!_0x2cdf7b)return console[_0x4d02a6(0x20f)](a54_0x4448c0[_0x4d02a6(0x13a)](_0x4d02a6(0x1ba)),_0x4d02a6(0x1f4)),0x1;}const _0x2469ea=await withSpinner('Pushing\x20project...',()=>_0x167aee[_0x4d02a6(0xc9)][_0x4d02a6(0x199)](_0xaa435a),{'verbose':_0x4e5506[_0x4d02a6(0x1c0)]}),_0x12ec1b=_0x2469ea['data'];return console['error'](a54_0x4448c0['green'](_0x4d02a6(0x1f1))),console['error'](_0x4d02a6(0x212)+_0x12ec1b['projectId']),console[_0x4d02a6(0x20f)](_0x4d02a6(0x1a9)+_0x12ec1b[_0x4d02a6(0x204)]),await this[_0x4d02a6(0xaf)](_0x167aee,_0x12ec1b[_0x4d02a6(0x99)],_0x4e5506['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x258);[a54_0x4f40c0(0xd4)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x4f40c0(0x1e9)](_0x4f29d1){const _0x5c7306=a54_0x4f40c0,{options:_0x4c2e44,args:_0x9f6835,tdx:_0x10ddba}=_0x4f29d1,_0x4466e7=this[_0x5c7306(0x1eb)](_0x9f6835,_0x4c2e44),_0x38b0e9=_0x4c2e44[_0x5c7306(0x153)],_0x5c4e6b=_0x4c2e44['revision'],_0x242e60=_0x4c2e44['skipValidation'];if(!_0x4466e7)return console['error'](a54_0x4448c0['red'](_0x5c7306(0x146)),_0x5c7306(0x18f)),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0xcc)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a54_0x4448c0[_0x5c7306(0xcc)](_0x5c7306(0x184))),0x1;if(!_0x38b0e9)return console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x167)](_0x5c7306(0x146)),_0x5c7306(0x1d3)),console[_0x5c7306(0x20f)](a54_0x4448c0['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4c2e44['verbose']&&(console[_0x5c7306(0x20f)]('Source\x20directory:\x20'+_0x4466e7),console['error'](_0x5c7306(0x185)+_0x38b0e9),_0x5c4e6b&&console[_0x5c7306(0x20f)](_0x5c7306(0xd1)+_0x5c4e6b),_0x4c2e44[_0x5c7306(0x195)]&&console[_0x5c7306(0x20f)](_0x5c7306(0x16a)),_0x242e60&&console[_0x5c7306(0x20f)]('Validation:\x20skipped'));const _0xd28c7c=await withSpinner(_0x5c7306(0x216),()=>_0x10ddba[_0x5c7306(0xc9)][_0x5c7306(0x255)](_0x4466e7,_0x38b0e9,{'revision':_0x5c4e6b,'skipValidation':_0x242e60}),{'verbose':_0x4c2e44[_0x5c7306(0x1c0)]}),_0x58dc5e=_0xd28c7c[_0x5c7306(0xdf)];console[_0x5c7306(0x20f)](_0x5c7306(0x18e)+_0x58dc5e['sourceDir']);_0x58dc5e[_0x5c7306(0x21f)]&&console[_0x5c7306(0x20f)]('Source\x20project:\x20'+_0x58dc5e['sourceProjectName']);console[_0x5c7306(0x20f)](_0x5c7306(0x185)+_0x58dc5e[_0x5c7306(0x18b)]),console[_0x5c7306(0x20f)]('Revision:\x20'+_0x58dc5e[_0x5c7306(0x204)]),console['error'](_0x5c7306(0x1de)+_0x58dc5e[_0x5c7306(0x238)]);_0x58dc5e[_0x5c7306(0x21c)]&&(console[_0x5c7306(0x20f)](a54_0x4448c0['yellow'](_0x5c7306(0x18d)+_0x58dc5e[_0x5c7306(0x18b)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x58dc5e[_0x5c7306(0x21b)]+')')),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x13a)](_0x5c7306(0x1df))));if(_0x4c2e44[_0x5c7306(0x195)])return console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0x13a)](_0x5c7306(0x137))),0x0;if(!_0x4c2e44[_0x5c7306(0x196)]){if(!isInteractive())return console[_0x5c7306(0x20f)](a54_0x4448c0['red']('\x0aError:'),_0x5c7306(0x106)),console[_0x5c7306(0x20f)](a54_0x4448c0[_0x5c7306(0xcc)](_0x5c7306(0x140))),0x1;const _0x58e422=_0x58dc5e[_0x5c7306(0x21f)]||a54_0x4ed50f['basename'](_0x4466e7),_0x3024d5=_0x58dc5e[_0x5c7306(0x21c)]?_0x5c7306(0x224)+_0x38b0e9+_0x5c7306(0x187):_0x5c7306(0x101)+_0x58e422+_0x5c7306(0x1ad)+_0x38b0e9+'\x22?',_0x105704=await confirmKey(_0x3024d5);if(!_0x105704)return console['error'](a54_0x4448c0[_0x5c7306(0x13a)]('Cancelled')),0x1;}const _0x21c48f=await withSpinner(_0x58dc5e['targetExists']?'Updating\x20'+_0x38b0e9+_0x5c7306(0xf4):'Cloning\x20to\x20'+_0x38b0e9+_0x5c7306(0xf4),()=>_0x10ddba[_0x5c7306(0xc9)][_0x5c7306(0x12b)](_0x58dc5e),{'verbose':_0x4c2e44[_0x5c7306(0x1c0)]}),_0x19a5a0=_0x21c48f[_0x5c7306(0xdf)];return console['error'](a54_0x4448c0[_0x5c7306(0x229)](_0x58dc5e[_0x5c7306(0x21c)]?_0x5c7306(0x10f):_0x5c7306(0xf8))),console[_0x5c7306(0x20f)]('\x20\x20Project:\x20'+_0x19a5a0['newProjectName']),console[_0x5c7306(0x20f)](_0x5c7306(0x212)+_0x19a5a0['newProjectId']),console[_0x5c7306(0x20f)]('\x20\x20Revision:\x20'+_0x19a5a0[_0x5c7306(0x204)]),await this[_0x5c7306(0xaf)](_0x10ddba,_0x19a5a0[_0x5c7306(0x18b)],_0x4c2e44[_0x5c7306(0x174)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x113);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x16b);async['execute'](_0xd0cb3a){const _0x189913=a54_0x4f40c0,{options:_0x5819c5,args:_0x11ba2a,tdx:_0x3aa62b}=_0xd0cb3a,_0x3c24d0=_0x11ba2a[0x0];if(!_0x3c24d0)return console['error'](_0x189913(0x1fc)),console[_0x189913(0x20f)](_0x189913(0x1a1)),0x1;_0x5819c5[_0x189913(0x1c0)]&&console['error'](_0x189913(0x12d)+_0x3c24d0);if(!_0x5819c5[_0x189913(0x196)]){if(!isInteractive())return console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0x167)](_0x189913(0x170)),_0x189913(0x106)),console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0xcc)](_0x189913(0x140))),0x1;const _0x1aa06a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x3c24d0+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x1aa06a)return console[_0x189913(0x20f)](a54_0x4448c0[_0x189913(0x13a)](_0x189913(0x1ba))),0x1;}const _0x239a8b=await withSpinner(_0x189913(0x122)+_0x3c24d0+_0x189913(0xf4),()=>_0x3aa62b[_0x189913(0xc9)]['delete'](_0x3c24d0),{'verbose':_0x5819c5[_0x189913(0x1c0)]}),_0x42bdc8=_0x239a8b[_0x189913(0xdf)];return console[_0x189913(0x20f)](_0x189913(0x14b)+_0x42bdc8['projectName']),console[_0x189913(0x20f)]('\x20\x20Project\x20ID:\x20'+_0x42bdc8[_0x189913(0xd7)]),0x0;}}export function parseKeyValue(_0x4ab2d6){const _0x122311=a54_0x4f40c0,_0x3cf4e4=_0x4ab2d6['indexOf']('=');if(_0x3cf4e4===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4ab2d6+_0x122311(0xbd));const _0x44dda9=_0x4ab2d6['substring'](0x0,_0x3cf4e4),_0xc17f07=_0x4ab2d6['substring'](_0x3cf4e4+0x1);if(!_0x44dda9)throw new Error(_0x122311(0x11c));return{'key':_0x44dda9,'value':_0xc17f07};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x19f);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x161);async['execute'](_0x5f473d){const _0x122270=a54_0x4f40c0,{options:_0x2a0536,args:_0x4b5900,tdx:_0x5004a8}=_0x5f473d,_0x430b19=this[_0x122270(0xc0)](_0x4b5900,_0x2a0536);if(!_0x430b19)return 0x1;_0x2a0536[_0x122270(0x1c0)]&&console[_0x122270(0x20f)](_0x122270(0x12d)+_0x430b19);const _0x238e14=await withSpinner(_0x122270(0x15e),()=>_0x5004a8[_0x122270(0xc9)][_0x122270(0x1c5)](_0x430b19),{'verbose':_0x2a0536[_0x122270(0x1c0)]}),{secrets:_0x4ae148}=_0x238e14[_0x122270(0xdf)];return console[_0x122270(0x20f)](_0x122270(0x114)+_0x4ae148[_0x122270(0x9d)]+_0x122270(0x1bf)+(_0x4ae148['length']!==0x1?'s':'')),await handleSDKOutput(_0x4ae148,_0x2a0536),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x24a);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0x123);async[a54_0x4f40c0(0x1e9)](_0xfbc366){const _0x356dbc=a54_0x4f40c0,{options:_0x4091b9,args:_0x86e23b,tdx:_0x38bbe9}=_0xfbc366;let _0x391c1a,_0x2e975a;if(_0x86e23b[_0x356dbc(0x9d)]>=0x1&&!_0x86e23b[0x0][_0x356dbc(0xc7)]('='))_0x391c1a=_0x86e23b[0x0],_0x2e975a=_0x86e23b['slice'](0x1);else{if(_0x86e23b[_0x356dbc(0x9d)]>=0x1&&_0x4091b9[_0x356dbc(0x125)])_0x391c1a=_0x4091b9['workflowProject'],_0x2e975a=_0x86e23b;else return _0x86e23b['length']>=0x1?(console['error'](_0x356dbc(0x235)),console[_0x356dbc(0x20f)](_0x356dbc(0x23f)),0x1):(console[_0x356dbc(0x20f)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x356dbc(0x20f)](_0x356dbc(0x14f)),0x1);}if(_0x2e975a[_0x356dbc(0x9d)]===0x0)return console[_0x356dbc(0x20f)](_0x356dbc(0x25b)),console[_0x356dbc(0x20f)](_0x356dbc(0x14f)),0x1;const _0x13b018={};try{for(const _0x169db4 of _0x2e975a){const {key:_0x3b5989,value:_0x234859}=parseKeyValue(_0x169db4);_0x13b018[_0x3b5989]=_0x234859;}}catch(_0x3cf93c){return _0x3cf93c instanceof Error&&console[_0x356dbc(0x20f)](a54_0x4448c0[_0x356dbc(0x167)](_0x356dbc(0x146)),_0x3cf93c['message']),0x1;}const _0x3e1df2=Object['keys'](_0x13b018);_0x4091b9[_0x356dbc(0x1c0)]&&(console[_0x356dbc(0x20f)]('Project:\x20'+_0x391c1a),console[_0x356dbc(0x20f)]('Secrets\x20to\x20set:\x20'+_0x3e1df2[_0x356dbc(0x1a8)](',\x20')));const _0x4a2fdb=await withSpinner(_0x3e1df2[_0x356dbc(0x9d)]===0x1?_0x356dbc(0xf3):_0x356dbc(0x1e8)+_0x3e1df2[_0x356dbc(0x9d)]+_0x356dbc(0x104),()=>_0x38bbe9[_0x356dbc(0xc9)]['setSecrets'](_0x391c1a,_0x13b018),{'verbose':_0x4091b9[_0x356dbc(0x1c0)]}),_0x535dc0=_0x4a2fdb[_0x356dbc(0xdf)];return console[_0x356dbc(0x20f)](_0x3e1df2[_0x356dbc(0x9d)]===0x1?_0x356dbc(0x17d)+_0x535dc0[_0x356dbc(0x163)][0x0]+_0x356dbc(0xad)+_0x535dc0['projectName']+'\x27':'✔\x20'+_0x535dc0['keys']['length']+_0x356dbc(0x9c)+_0x535dc0['projectName']+'\x27'),(_0x4091b9[_0x356dbc(0x15b)]||_0x4091b9['jsonl'])&&await handleSingleObjectOutput(_0x535dc0,_0x4091b9),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x4f40c0(0x1e6);[a54_0x4f40c0(0xd4)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0x1c3fd9){const _0x2c08e5=a54_0x4f40c0,{options:_0x16e83d,args:_0x470dd5,tdx:_0x594a4b}=_0x1c3fd9;let _0x5b54f8,_0x407a66;if(_0x470dd5[_0x2c08e5(0x9d)]>=0x2)_0x5b54f8=_0x470dd5[0x0],_0x407a66=_0x470dd5[0x1];else{if(_0x470dd5[_0x2c08e5(0x9d)]===0x1&&_0x16e83d[_0x2c08e5(0x125)])_0x5b54f8=_0x16e83d[_0x2c08e5(0x125)],_0x407a66=_0x470dd5[0x0];else return _0x470dd5['length']===0x1?(console[_0x2c08e5(0x20f)](_0x2c08e5(0x235)),console[_0x2c08e5(0x20f)](_0x2c08e5(0x23f)),0x1):(console[_0x2c08e5(0x20f)](_0x2c08e5(0x144)),console['error'](_0x2c08e5(0x139)),0x1);}_0x16e83d['verbose']&&(console[_0x2c08e5(0x20f)]('Project:\x20'+_0x5b54f8),console['error']('Key:\x20'+_0x407a66));if(!_0x16e83d['yes']){if(!isInteractive())return console[_0x2c08e5(0x20f)](a54_0x4448c0[_0x2c08e5(0x167)](_0x2c08e5(0x170)),_0x2c08e5(0x106)),console[_0x2c08e5(0x20f)](a54_0x4448c0[_0x2c08e5(0xcc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x11291a=await confirmKey(_0x2c08e5(0x221)+_0x407a66+_0x2c08e5(0xd8)+_0x5b54f8+'\x27?');if(!_0x11291a)return console['error'](a54_0x4448c0[_0x2c08e5(0x13a)]('Cancelled')),0x1;}const _0x29480d=await withSpinner(_0x2c08e5(0xb9),()=>_0x594a4b[_0x2c08e5(0xc9)]['deleteSecret'](_0x5b54f8,_0x407a66),{'verbose':_0x16e83d[_0x2c08e5(0x1c0)]}),_0x963fa1=_0x29480d[_0x2c08e5(0xdf)];return console[_0x2c08e5(0x20f)](_0x2c08e5(0x17d)+_0x963fa1[_0x2c08e5(0x176)]+_0x2c08e5(0x1e0)+_0x963fa1[_0x2c08e5(0x99)]+'\x27'),(_0x16e83d[_0x2c08e5(0x15b)]||_0x16e83d[_0x2c08e5(0x100)])&&await handleSingleObjectOutput(_0x963fa1,_0x16e83d),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(_0x307883){const _0x17237b=a54_0x4f40c0,_0x28193c=Math[_0x17237b(0x128)](_0x307883/0x3e8),_0x440605=Math[_0x17237b(0x128)](_0x28193c/0x3c),_0x39c637=Math[_0x17237b(0x128)](_0x440605/0x3c),_0x14408e=Math['floor'](_0x39c637/0x18);if(_0x14408e>0x0){const _0x3b2bb5=_0x39c637%0x18;return _0x3b2bb5>0x0?_0x14408e+'d\x20'+_0x3b2bb5+'h':_0x14408e+'d';}else{if(_0x39c637>0x0){const _0x317d79=_0x440605%0x3c;return _0x317d79>0x0?_0x39c637+'h\x20'+_0x317d79+'m':_0x39c637+'h';}else{if(_0x440605>0x0){const _0x19eab9=_0x28193c%0x3c;return _0x19eab9>0x0?_0x440605+'m\x20'+_0x19eab9+'s':_0x440605+'m';}else return _0x28193c+'s';}}}function formatTimestamp(_0x4ce860,_0x22f89e){const _0x55b40d=a54_0x4f40c0,_0x57b7be=new Date(_0x4ce860),_0x5025bb=String(_0x57b7be[_0x55b40d(0x175)]())[_0x55b40d(0xd9)](0x2,'0'),_0x5a0ae8=String(_0x57b7be[_0x55b40d(0x1f7)]())[_0x55b40d(0xd9)](0x2,'0'),_0x22b7d0=_0x5025bb+':'+_0x5a0ae8,_0x5288b4=_0x57b7be[_0x55b40d(0xe9)]()===_0x22f89e['getFullYear']()&&_0x57b7be[_0x55b40d(0xc6)]()===_0x22f89e[_0x55b40d(0xc6)]()&&_0x57b7be['getDate']()===_0x22f89e[_0x55b40d(0x11f)]();if(_0x5288b4)return _0x22b7d0;else{const _0x282cda=String(_0x57b7be['getMonth']()+0x1)['padStart'](0x2,'0'),_0x202046=String(_0x57b7be[_0x55b40d(0x11f)]())[_0x55b40d(0xd9)](0x2,'0');return _0x282cda+'-'+_0x202046+'\x20'+_0x22b7d0;}}function formatDate(_0x392646){const _0x1bb5ff=a54_0x4f40c0,_0x5e0a63=_0x392646[_0x1bb5ff(0xe9)](),_0x56cbe8=String(_0x392646['getMonth']()+0x1)[_0x1bb5ff(0xd9)](0x2,'0'),_0x438fbc=String(_0x392646[_0x1bb5ff(0x11f)]())[_0x1bb5ff(0xd9)](0x2,'0');return _0x5e0a63+'-'+_0x56cbe8+'-'+_0x438fbc;}function getTaskStateIcon(_0x286cd2){const _0x27ab55={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x27ab55[_0x286cd2]||'⚪';}function getBarChar(_0x3ce7ac){const _0x153497=a54_0x4f40c0;return _0x3ce7ac===_0x153497(0x20f)||_0x3ce7ac===_0x153497(0xef)?'×':'─';}function getBarColor(_0x29d31d){const _0x303af5=a54_0x4f40c0,_0x5e7dc9={'success':a54_0x4448c0['green'],'error':a54_0x4448c0[_0x303af5(0x167)],'group_error':a54_0x4448c0[_0x303af5(0x167)],'running':a54_0x4448c0[_0x303af5(0xa6)],'blocked':a54_0x4448c0[_0x303af5(0x13a)],'planned':a54_0x4448c0['dim'],'canceling':a54_0x4448c0['yellow']};return _0x5e7dc9[_0x29d31d]||a54_0x4448c0['white'];}function parseTaskName(_0x23db00){const _0x18adec=a54_0x4f40c0;let _0x417820=_0x23db00[_0x18adec(0x23e)](/^\++/,'');const _0xc6e378=_0x417820['split']('+'),_0x4c54bd=_0xc6e378[_0x18adec(0x9d)]>0x1?_0xc6e378['length']-0x2:0x0,_0xbcda28=_0xc6e378[_0xc6e378[_0x18adec(0x9d)]-0x1]||_0x417820;return{'level':_0x4c54bd,'name':'+'+_0xbcda28};}function truncateTaskName(_0x27213f,_0x46eff1){const _0x4069cf=a54_0x4f40c0,_0xde46da=stringWidth(_0x27213f);if(_0xde46da<=_0x46eff1)return _0x27213f;let _0x5254ad=_0x27213f;while(stringWidth(_0x5254ad+'…')>_0x46eff1&&_0x5254ad[_0x4069cf(0x9d)]>0x0){_0x5254ad=_0x5254ad[_0x4069cf(0xf7)](0x0,-0x1);}return _0x5254ad+'…';}function calculateTimeScale(_0x4a48a0,_0x47f21c){const _0x56df3a=a54_0x4f40c0;return{'startTime':_0x4a48a0[_0x56df3a(0x1fa)],'endTime':_0x4a48a0['end'],'durationMs':_0x4a48a0['duration'],'msPerChar':_0x4a48a0[_0x56df3a(0xc2)]/_0x47f21c};}function timeToPosition(_0x1f66d2,_0x264ac3,_0x1555d1){const _0x205645=a54_0x4f40c0,_0x207917=_0x1f66d2-_0x264ac3[_0x205645(0xda)],_0x35e44e=Math[_0x205645(0x128)](_0x207917/_0x264ac3[_0x205645(0x157)]);return Math[_0x205645(0xfd)](0x0,Math['min'](_0x35e44e,_0x1555d1));}function renderTimeAxis(_0x21531f,_0x2fdd5f){const _0x102054=a54_0x4f40c0,_0x2486cf=Math[_0x102054(0x1cd)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x102054(0x1e2)],Math['floor'](_0x2fdd5f/TIMELINE_CONFIG[_0x102054(0x201)]))),_0x334e78=_0x21531f[_0x102054(0xec)]/(_0x2486cf-0x1),_0x17a1b3=new Date(_0x21531f[_0x102054(0xda)]),_0x41e632=[];for(let _0x370b8d=0x0;_0x370b8d<_0x2486cf;_0x370b8d++){const _0xe2524c=_0x21531f[_0x102054(0xda)]+_0x370b8d*_0x334e78,_0x414111=timeToPosition(_0xe2524c,_0x21531f,_0x2fdd5f),_0x2da41d=formatTimestamp(_0xe2524c,_0x17a1b3);_0x41e632['push']({'pos':_0x414111,'text':_0x2da41d});}const _0x1f8dcf=new Array(_0x2fdd5f)[_0x102054(0x1c4)]('\x20');let _0x4355ff=-0x1;for(const {pos:_0xd24b5,text:_0x31f323}of _0x41e632){let _0x4d2b28=Math[_0x102054(0xfd)](0x0,_0xd24b5-Math[_0x102054(0x128)](_0x31f323['length']/0x2));_0x4d2b28<=_0x4355ff+TIMELINE_CONFIG[_0x102054(0x21a)]&&(_0x4d2b28=_0x4355ff+TIMELINE_CONFIG[_0x102054(0x21a)]+0x1);_0x4d2b28+_0x31f323[_0x102054(0x9d)]>_0x2fdd5f&&(_0x4d2b28=_0x2fdd5f-_0x31f323[_0x102054(0x9d)]);if(_0x4d2b28>=0x0&&_0x4d2b28+_0x31f323['length']<=_0x2fdd5f&&_0x4d2b28>_0x4355ff){for(let _0x1410ef=0x0;_0x1410ef<_0x31f323[_0x102054(0x9d)];_0x1410ef++){_0x1f8dcf[_0x4d2b28+_0x1410ef]=_0x31f323[_0x1410ef];}_0x4355ff=_0x4d2b28+_0x31f323[_0x102054(0x9d)]-0x1;}}return _0x1f8dcf[_0x102054(0x1a8)]('');}function renderTaskRow(_0x8d6666,_0x13798f,_0xe0de9e,_0x55cec3){const _0x53a214=a54_0x4f40c0,{level:_0x3380ad,name:_0x28e0c7}=parseTaskName(_0x8d6666['name']),_0x571c3f='\x20'[_0x53a214(0x10a)](_0x3380ad),_0x89240c=_0x8d6666['window']?'('+formatElapsed(_0x8d6666[_0x53a214(0x10e)]['duration'])+')':'',_0x4f2841=stringWidth(_0x89240c),_0x35a6e3=_0x3380ad*0x1,_0x3f2eec=_0x55cec3-_0x35a6e3-_0x4f2841-0x1,_0x405bec=truncateTaskName(_0x28e0c7,_0x3f2eec),_0x67f282=_0x571c3f+_0x405bec,_0x531935=stringWidth(_0x67f282),_0x4b7f8f=_0x55cec3-_0x531935-_0x4f2841,_0x320411=_0x67f282+'\x20'[_0x53a214(0x10a)](Math[_0x53a214(0xfd)](0x1,_0x4b7f8f))+a54_0x4448c0['dim'](_0x89240c),_0x31ce1c=getTaskStateIcon(_0x8d6666[_0x53a214(0x23c)]),_0x5459bf=new Array(_0xe0de9e)[_0x53a214(0x1c4)]('\x20');if(_0x8d6666[_0x53a214(0x10e)]){const _0x4950b8=timeToPosition(_0x8d6666['window'][_0x53a214(0x1fa)],_0x13798f,_0xe0de9e),_0x4b8e5f=timeToPosition(_0x8d6666['window'][_0x53a214(0xca)],_0x13798f,_0xe0de9e),_0x493b77=getBarChar(_0x8d6666[_0x53a214(0x23c)]),_0x9c5dc9=Math[_0x53a214(0xfd)](_0x4950b8+0x1,_0x4b8e5f);for(let _0x11dce3=_0x4950b8;_0x11dce3<Math['min'](_0x9c5dc9,_0xe0de9e);_0x11dce3++){_0x5459bf[_0x11dce3]=_0x493b77;}}const _0x203144=getBarColor(_0x8d6666[_0x53a214(0x23c)]),_0x2c110b=_0x5459bf[_0x53a214(0x17c)](_0x5a4d94=>_0x5a4d94==='\x20'?'\x20':_0x203144(_0x5a4d94))[_0x53a214(0x1a8)]('');return _0x31ce1c+'\x20'+_0x320411+'│'+_0x2c110b+'│';}function calculateStats(_0xe43bac){const _0x45d776=a54_0x4f40c0,_0x1d13c4={'total':_0xe43bac[_0x45d776(0x9d)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3dc109 of _0xe43bac){if(_0x3dc109[_0x45d776(0x23c)]===_0x45d776(0xc4))_0x1d13c4[_0x45d776(0xc4)]++;else{if(_0x3dc109[_0x45d776(0x23c)]==='error'||_0x3dc109[_0x45d776(0x23c)]===_0x45d776(0xef))_0x1d13c4[_0x45d776(0x20f)]++;else _0x3dc109[_0x45d776(0x23c)]===_0x45d776(0x1a7)?_0x1d13c4[_0x45d776(0x1a7)]++:_0x1d13c4[_0x45d776(0x240)]++;}}return _0x1d13c4;}function formatStats(_0x2e19f2){const _0x53e974=a54_0x4f40c0;return[_0x53e974(0xe0)+_0x2e19f2['total'],'✅\x20'+_0x2e19f2[_0x53e974(0xc4)],'❌\x20'+_0x2e19f2['error'],_0x53e974(0x168)+_0x2e19f2[_0x53e974(0x1a7)],'⏳\x20'+_0x2e19f2['pending']][_0x53e974(0x1a8)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x1ae);[a54_0x4f40c0(0xd4)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x45480b){const _0x223173=a54_0x4f40c0,{options:_0x22e61c,args:_0x57560f,tdx:_0x561c71}=_0x45480b;let _0x4f6f63,_0x4ab063,_0x906c81=![];if(_0x57560f[0x0]){if(_0x57560f[0x0][_0x223173(0xc7)]('.')){const _0x14e296=this[_0x223173(0x207)](_0x57560f,_0x22e61c);if(!_0x14e296)return 0x1;_0x4f6f63=_0x14e296[_0x223173(0x99)],_0x4ab063=_0x14e296[_0x223173(0x118)];}else{_0x4ab063=_0x57560f[0x0],_0x4f6f63=_0x22e61c['workflowProject'];if(!_0x4f6f63)return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)](_0x223173(0x146)),_0x223173(0xa0)),0x1;_0x906c81=!![];}}else{const _0x5c1630=this[_0x223173(0x207)](_0x57560f,_0x22e61c);if(!_0x5c1630)return 0x1;_0x4f6f63=_0x5c1630[_0x223173(0x99)],_0x4ab063=_0x5c1630['workflowName'];}if(_0x22e61c['verbose']){if(_0x4f6f63&&_0x4ab063)console['error'](_0x223173(0x1db)+_0x4f6f63+'.'+_0x4ab063);else _0x4f6f63&&console[_0x223173(0x20f)](_0x223173(0x117)+_0x4f6f63);}const _0x195b10=_0x22e61c[_0x223173(0x249)],_0x1f8663=_0x22e61c[_0x223173(0x1b6)];if(_0x195b10){_0x1f8663&&console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x13a)]('Warning:'),_0x223173(0x14e));const _0x3cf081=_0x22e61c['follow'];return _0x3cf081?await this[_0x223173(0xe4)](_0x45480b,_0x195b10):await this[_0x223173(0xcf)](_0x45480b,_0x195b10,_0x22e61c),0x0;}if(_0x1f8663){const _0x4bf14=await withSpinner(_0x223173(0x138),()=>_0x561c71[_0x223173(0xc9)][_0x223173(0xb5)]({'projectName':_0x4f6f63,'workflowName':_0x4ab063,'limit':0x64}),{'verbose':_0x22e61c[_0x223173(0x1c0)]}),_0x226ab2=_0x4bf14['data'][_0x223173(0x172)](_0x5915fa=>_0x5915fa['id']===_0x1f8663);if(!_0x226ab2)return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)](_0x223173(0x146)),'Session\x20not\x20found:\x20'+_0x1f8663),0x1;if(!_0x226ab2[_0x223173(0x17e)]?.['id'])return console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0x167)]('Error:'),_0x223173(0x12c)+_0x1f8663+'\x20has\x20no\x20attempts'),0x1;const _0x288800=_0x226ab2['lastAttempt']['id'];_0x22e61c[_0x223173(0x1c0)]&&console[_0x223173(0x20f)](_0x223173(0xe6)+_0x288800+_0x223173(0x1da)+_0x1f8663);const _0x4818c2=_0x22e61c['follow'];return _0x4818c2?await this[_0x223173(0xe4)](_0x45480b,_0x288800):await this[_0x223173(0xcf)](_0x45480b,_0x288800,_0x22e61c),0x0;}const _0x1ae417=await withSpinner(_0x223173(0x218),()=>_0x561c71[_0x223173(0xc9)][_0x223173(0xb5)]({'projectName':_0x4f6f63,'workflowName':_0x4ab063,'limit':_0x22e61c[_0x223173(0x141)]||0x32}),{'verbose':_0x22e61c[_0x223173(0x1c0)]}),_0x708f79=_0x1ae417['data'];if(_0x708f79[_0x223173(0x9d)]===0x0){if(_0x4f6f63&&_0x4ab063)console['error'](_0x223173(0x1ec)+_0x4f6f63+'.'+_0x4ab063);else _0x4f6f63?console[_0x223173(0x20f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4f6f63):(console[_0x223173(0x20f)](_0x223173(0x107)),console[_0x223173(0x20f)](a54_0x4448c0[_0x223173(0xcc)](_0x223173(0x1e1))));return 0x0;}_0x708f79[_0x223173(0xac)]((_0x272d67,_0x44e19a)=>{const _0x10b27e=_0x223173,_0x12cc33=_0x272d67['sessionTime']||'',_0x36d063=_0x44e19a[_0x10b27e(0x24f)]||'';return _0x36d063['localeCompare'](_0x12cc33);});if(_0x22e61c['json']||_0x22e61c[_0x223173(0x100)])return await handleSDKOutput(_0x708f79,_0x22e61c),0x0;let _0x3d670f;if(_0x906c81){const _0x5befb1=_0x708f79[0x0];if(!_0x5befb1[_0x223173(0x17e)]?.['id'])return console[_0x223173(0x20f)](_0x223173(0xeb)),0x0;_0x3d670f=_0x5befb1[_0x223173(0x17e)]['id'],_0x22e61c['verbose']&&console[_0x223173(0x20f)](_0x223173(0x222)+_0x5befb1[_0x223173(0x24f)]);}else{const _0x16e61a=_0x708f79['map'](_0x1a6c05=>{const _0x30b455=_0x223173,_0x1616e1=getAttemptStatusDisplay(_0x1a6c05[_0x30b455(0x17e)]);return{'title':_0x1a6c05[_0x30b455(0x22b)]?.[_0x30b455(0x153)]+'.'+_0x1a6c05[_0x30b455(0xc9)]?.[_0x30b455(0x153)]+_0x30b455(0x1c8)+_0x1a6c05[_0x30b455(0x24f)]+'\x20'+_0x1616e1[_0x30b455(0x16f)],'value':_0x1a6c05[_0x30b455(0x17e)]?.['id']||'','description':_0x1616e1[_0x30b455(0xde)]};}),_0x45e9de=await a54_0x3961f9({'type':'select','name':'attemptId','message':_0x223173(0x151),'choices':_0x16e61a['filter'](_0x3d4fc8=>_0x3d4fc8[_0x223173(0x19d)]!=='')});if(!_0x45e9de[_0x223173(0x249)])return 0x0;_0x3d670f=_0x45e9de[_0x223173(0x249)];}const _0xe73ae5=_0x22e61c[_0x223173(0x16d)];return _0xe73ae5?await this[_0x223173(0xe4)](_0x45480b,_0x3d670f):await this['renderSingleTimeline'](_0x45480b,_0x3d670f,_0x22e61c),0x0;}async[a54_0x4f40c0(0xcf)](_0x3a3337,_0x2df44d,_0x44ad3d){const _0x4dca0f=a54_0x4f40c0,{tdx:_0x4c7867}=_0x3a3337;let _0x258b4c,_0x4b780c;try{[_0x258b4c,_0x4b780c]=await Promise['all']([_0x4c7867[_0x4dca0f(0xc9)][_0x4dca0f(0x191)](_0x2df44d),_0x4c7867[_0x4dca0f(0xc9)][_0x4dca0f(0x164)](_0x2df44d,![])]);}catch(_0x34a12f){console[_0x4dca0f(0x20f)](a54_0x4448c0[_0x4dca0f(0x167)](_0x4dca0f(0x186)));_0x44ad3d[_0x4dca0f(0x1c0)]&&console[_0x4dca0f(0x20f)](_0x34a12f);throw _0x34a12f;}if(_0x44ad3d['json']||_0x44ad3d[_0x4dca0f(0x100)]){const _0x390f59=this[_0x4dca0f(0x178)](_0x258b4c,_0x4b780c);await handleSDKOutput([_0x390f59],_0x44ad3d);return;}const _0x1b4951=_0x4c7867['context'][_0x4dca0f(0x174)],_0xd752f5=this[_0x4dca0f(0x203)](_0x258b4c,_0x4b780c,_0x1b4951);console[_0x4dca0f(0xe7)](_0xd752f5);}async['pollTimeline'](_0x588614,_0x58b097){const _0x1efc4f=a54_0x4f40c0,{tdx:_0x26bac1}=_0x588614,_0x3d7991=TIMELINE_CONFIG[_0x1efc4f(0x1ed)],_0x216e49=TIMELINE_CONFIG[_0x1efc4f(0x1f6)];let _0x4ed54f=0x0;while(_0x4ed54f<_0x216e49){process[_0x1efc4f(0x1d8)]['isTTY']&&process[_0x1efc4f(0x1d8)]['write']('\x1bc');let _0x2bacb6,_0x4e9237;try{[_0x2bacb6,_0x4e9237]=await Promise['all']([_0x26bac1[_0x1efc4f(0xc9)]['attempt'](_0x58b097),_0x26bac1['workflow']['tasks'](_0x58b097,![])]);}catch(_0xbc329f){console[_0x1efc4f(0x20f)](a54_0x4448c0[_0x1efc4f(0x167)](_0x1efc4f(0x1ab)));_0x4ed54f>0x0&&console[_0x1efc4f(0x20f)](a54_0x4448c0['dim'](_0x1efc4f(0x9b)+_0x4ed54f));throw _0xbc329f;}const _0x4772f2=_0x26bac1[_0x1efc4f(0x1b4)][_0x1efc4f(0x174)],_0x2aaefb=this[_0x1efc4f(0x203)](_0x2bacb6,_0x4e9237,_0x4772f2);console[_0x1efc4f(0xe7)](_0x2aaefb);const _0x44c192=_0x2bacb6[_0x1efc4f(0x227)]&&_0x4e9237['every'](_0x44ce11=>_0x44ce11['state']!=='running'&&_0x44ce11[_0x1efc4f(0x23c)]!==_0x1efc4f(0x180));if(_0x44c192){console[_0x1efc4f(0x20f)](a54_0x4448c0[_0x1efc4f(0x229)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x1efc4f(0x20f)](a54_0x4448c0['dim'](_0x1efc4f(0x13f)+_0x4ed54f*0x2+_0x1efc4f(0x1d1))),await new Promise(_0x308656=>setTimeout(_0x308656,_0x3d7991)),_0x4ed54f++;}_0x4ed54f>=_0x216e49&&console['error'](a54_0x4448c0['yellow'](_0x1efc4f(0x1ca)));}[a54_0x4f40c0(0x203)](_0x1d3bba,_0x344cf5,_0x183108){const _0x1ee6ed=a54_0x4f40c0,_0x561968=[],_0xfeed86=TIMELINE_CONFIG[_0x1ee6ed(0x1c3)],_0x50b23a=0x5,_0x358587=process[_0x1ee6ed(0x1d8)][_0x1ee6ed(0xb1)]||0x78,_0xd2c7b2=_0x358587-_0xfeed86-_0x50b23a,_0x154ba4=Math[_0x1ee6ed(0xfd)](TIMELINE_CONFIG[_0x1ee6ed(0x22f)],Math[_0x1ee6ed(0x1cd)](_0xd2c7b2,TIMELINE_CONFIG[_0x1ee6ed(0x18c)])),_0x19367d=new Date(_0x1d3bba[_0x1ee6ed(0xb4)])[_0x1ee6ed(0x1d6)](),_0x2c2b8d=_0x1d3bba[_0x1ee6ed(0x217)]?new Date(_0x1d3bba[_0x1ee6ed(0x217)])['getTime']():Date[_0x1ee6ed(0x131)](),_0x45e180={'start':_0x19367d,'end':_0x2c2b8d,'duration':_0x2c2b8d-_0x19367d},_0x4d8a77=new Map(),_0x100330=[];for(const _0x252b1f of _0x344cf5){if(_0x252b1f[_0x1ee6ed(0x1bc)]){const _0x2fd6d2=new Date(_0x252b1f[_0x1ee6ed(0x1bc)])[_0x1ee6ed(0x1d6)](),_0x3746d4=_0x252b1f[_0x1ee6ed(0x219)]?new Date(_0x252b1f['updatedAt'])[_0x1ee6ed(0x1d6)]():Date[_0x1ee6ed(0x131)](),_0x5b5835={'start':_0x2fd6d2,'end':_0x3746d4,'duration':_0x3746d4-_0x2fd6d2};_0x4d8a77['set'](_0x252b1f['id'],_0x5b5835),_0x100330[_0x1ee6ed(0x1e7)]({'name':_0x252b1f[_0x1ee6ed(0x206)],'state':_0x252b1f[_0x1ee6ed(0x23c)]||_0x1ee6ed(0x250),'window':_0x5b5835});}else _0x100330[_0x1ee6ed(0x1e7)]({'name':_0x252b1f[_0x1ee6ed(0x206)],'state':_0x252b1f[_0x1ee6ed(0x23c)]||'planned','window':undefined});}_0x100330['sort']((_0x1a0d94,_0x194347)=>{const _0x8dbf9b=_0x1ee6ed;if(!_0x1a0d94[_0x8dbf9b(0x10e)])return 0x1;if(!_0x194347[_0x8dbf9b(0x10e)])return-0x1;return _0x1a0d94[_0x8dbf9b(0x10e)][_0x8dbf9b(0x1fa)]-_0x194347[_0x8dbf9b(0x10e)]['start'];});const _0x31167a=_0x100330[_0x1ee6ed(0x9d)],_0x5990f8=_0x31167a>TIMELINE_CONFIG[_0x1ee6ed(0x259)];_0x5990f8&&_0x100330[_0x1ee6ed(0xb7)](TIMELINE_CONFIG[_0x1ee6ed(0x259)]);const _0x560eaa=calculateTimeScale(_0x45e180,_0x154ba4),_0x2459b1=_0x1d3bba[_0x1ee6ed(0x227)]?_0x1d3bba['success']?a54_0x4448c0[_0x1ee6ed(0x229)](_0x1ee6ed(0xc4)):a54_0x4448c0['red'](_0x1ee6ed(0x20f)):a54_0x4448c0[_0x1ee6ed(0xa6)](_0x1ee6ed(0x1a7)),_0x641eba=_0x1d3bba[_0x1ee6ed(0x22b)]?.['id'],_0x315608=_0x1d3bba[_0x1ee6ed(0x1b6)];let _0x3b1979;if(_0x641eba&&_0x315608){const _0x3bc88c=getWorkflowAttemptUrl(_0x183108,_0x641eba,_0x315608,_0x1d3bba['id']);_0x3b1979=hyperlink(a54_0x4448c0[_0x1ee6ed(0xcc)](_0x1d3bba['id']),_0x3bc88c);}else _0x3b1979=a54_0x4448c0[_0x1ee6ed(0xcc)](_0x1d3bba['id']);_0x561968[_0x1ee6ed(0x1e7)](_0x1ee6ed(0xee)+_0x3b1979+_0x1ee6ed(0x1c8)+_0x2459b1+_0x1ee6ed(0x1c8)+formatElapsed(_0x45e180[_0x1ee6ed(0xc2)]));if(_0x100330[_0x1ee6ed(0x9d)]>0x0){const _0x4a9afa=renderTimeAxis(_0x560eaa,_0x154ba4),_0x26a15e=new Date(_0x45e180[_0x1ee6ed(0x1fa)]),_0x4b5f22=formatDate(_0x26a15e),_0x59a05c=TIMELINE_CONFIG[_0x1ee6ed(0x243)]+TIMELINE_CONFIG[_0x1ee6ed(0x165)]+_0xfeed86,_0x195168=_0x4b5f22[_0x1ee6ed(0xd9)](_0x59a05c),_0x4804f3=a54_0x4448c0[_0x1ee6ed(0xcc)](_0x195168);_0x561968[_0x1ee6ed(0x1e7)](_0x4804f3+'\x20'+_0x4a9afa);for(const _0x3aff97 of _0x100330){_0x561968['push'](renderTaskRow(_0x3aff97,_0x560eaa,_0x154ba4,_0xfeed86));}const _0x36bb40=calculateStats(_0x100330);_0x561968[_0x1ee6ed(0x1e7)](formatStats(_0x36bb40)),_0x5990f8&&_0x561968[_0x1ee6ed(0x1e7)](a54_0x4448c0['yellow'](_0x1ee6ed(0x111)+TIMELINE_CONFIG[_0x1ee6ed(0x259)]+'\x20of\x20'+_0x31167a+_0x1ee6ed(0x179))),_0x561968[_0x1ee6ed(0x1e7)](''),_0x561968['push'](a54_0x4448c0[_0x1ee6ed(0xcc)]('💡\x20Tip:\x20Use\x20')+(_0x1ee6ed(0x13d)+_0x1d3bba['id']+_0x1ee6ed(0x1e3))+a54_0x4448c0[_0x1ee6ed(0xcc)]('\x20to\x20see\x20detailed\x20logs'));}else _0x561968[_0x1ee6ed(0x1e7)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x561968[_0x1ee6ed(0x1a8)]('\x0a');}['buildTimelineData'](_0x5e5f04,_0x990135){const _0x168c31=a54_0x4f40c0,_0x2ff3ad=new Date(_0x5e5f04[_0x168c31(0xb4)])[_0x168c31(0x1d6)](),_0x1bae19=_0x5e5f04[_0x168c31(0x217)]?new Date(_0x5e5f04[_0x168c31(0x217)])[_0x168c31(0x1d6)]():Date[_0x168c31(0x131)](),_0x223700=_0x1bae19-_0x2ff3ad,_0x39d17a=[];for(const _0x13cc5f of _0x990135){if(_0x13cc5f['startedAt']){const _0x1d26f8=new Date(_0x13cc5f[_0x168c31(0x1bc)])[_0x168c31(0x1d6)](),_0x11118c=_0x13cc5f['updatedAt']?new Date(_0x13cc5f['updatedAt'])['getTime']():Date[_0x168c31(0x131)]();_0x39d17a['push']({'name':_0x13cc5f[_0x168c31(0x206)],'state':_0x13cc5f[_0x168c31(0x23c)]||'unknown','window':{'start':_0x1d26f8,'end':_0x11118c,'duration':_0x11118c-_0x1d26f8}});}else _0x39d17a[_0x168c31(0x1e7)]({'name':_0x13cc5f[_0x168c31(0x206)],'state':_0x13cc5f[_0x168c31(0x23c)]||_0x168c31(0x180),'window':undefined});}const _0x3e41ea=calculateStats(_0x39d17a);return{'attempt':{'id':_0x5e5f04['id'],'status':_0x5e5f04[_0x168c31(0x227)]?_0x5e5f04[_0x168c31(0xc4)]?_0x168c31(0xc4):_0x168c31(0x20f):'running','createdAt':_0x5e5f04['createdAt'],'finishedAt':_0x5e5f04[_0x168c31(0x217)],'duration_ms':_0x223700},'tasks':_0x39d17a['map'](_0xd52983=>({'name':_0xd52983['name'],'state':_0xd52983[_0x168c31(0x23c)],'startedAt':_0xd52983[_0x168c31(0x10e)]?new Date(_0xd52983[_0x168c31(0x10e)]['start'])[_0x168c31(0x1d5)]():null,'updatedAt':_0xd52983[_0x168c31(0x10e)]?new Date(_0xd52983[_0x168c31(0x10e)]['end'])[_0x168c31(0x1d5)]():null,'duration_ms':_0xd52983[_0x168c31(0x10e)]?.[_0x168c31(0xc2)]||null})),'stats':_0x3e41ea};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x4f40c0(0x211);[a54_0x4f40c0(0xd4)]='List\x20workflow\x20schedules';async['execute'](_0x49d2b2){const _0x1fe789=a54_0x4f40c0,{options:_0x5bce19,tdx:_0x4a6c54}=_0x49d2b2,_0x44d4f6=await withSpinner(_0x1fe789(0xdb),()=>_0x4a6c54[_0x1fe789(0xc9)][_0x1fe789(0xfb)](),{'verbose':_0x5bce19[_0x1fe789(0x1c0)]}),_0x220750=_0x44d4f6['data'];console[_0x1fe789(0x20f)]('✔\x20Found\x20'+_0x220750['length']+_0x1fe789(0xe2)+(_0x220750[_0x1fe789(0x9d)]!==0x1?'s':''));if(isStructuredFormat(_0x5bce19))await handleSDKOutput(_0x220750,_0x5bce19);else{if(_0x220750[_0x1fe789(0x9d)]===0x0)console[_0x1fe789(0xe7)](_0x1fe789(0x129));else for(const _0x230e10 of _0x220750){const _0xf2309a=_0x230e10[_0x1fe789(0x18a)]?a54_0x4448c0[_0x1fe789(0x13a)](_0x1fe789(0x248)):'',_0x480e7e=_0x230e10[_0x1fe789(0x22b)]?.[_0x1fe789(0x153)]?a54_0x4448c0['dim']('\x20['+_0x230e10[_0x1fe789(0x22b)][_0x1fe789(0x153)]+']'):'',_0x14ae7b=_0x230e10[_0x1fe789(0x239)]?a54_0x4448c0[_0x1fe789(0xcc)](_0x1fe789(0x1f9)+new Date(_0x230e10[_0x1fe789(0x239)])[_0x1fe789(0x1ef)]()):'';console[_0x1fe789(0xe7)](_0x1fe789(0x11e)+_0x230e10['id']+'\x20'+(_0x230e10['workflow']?.[_0x1fe789(0x153)]||_0x1fe789(0x24d))+_0x480e7e+_0xf2309a+_0x14ae7b);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0xf0);[a54_0x4f40c0(0xd4)]='Enable\x20a\x20workflow\x20schedule';async[a54_0x4f40c0(0x1e9)](_0x2bc319){const _0x598b29=a54_0x4f40c0,{options:_0x201769,args:_0x27ab24,tdx:_0x19a090}=_0x2bc319,_0x1be7b1=_0x27ab24[0x0];if(!_0x1be7b1)return console[_0x598b29(0x20f)](a54_0x4448c0[_0x598b29(0x167)](_0x598b29(0x146)),_0x598b29(0x152)),console[_0x598b29(0x20f)](a54_0x4448c0[_0x598b29(0xcc)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console['error'](a54_0x4448c0['dim'](_0x598b29(0x22e))),0x1;const _0x22ad69=await withSpinner(_0x598b29(0xed)+_0x1be7b1+'...',()=>_0x19a090['workflow'][_0x598b29(0x1cc)](_0x1be7b1),{'verbose':_0x201769[_0x598b29(0x1c0)]}),_0x450e46=_0x22ad69[_0x598b29(0xdf)];return isStructuredFormat(_0x201769)?await handleSingleObjectOutput(_0x450e46,_0x201769):(console[_0x598b29(0xe7)](_0x598b29(0x1b0)+_0x1be7b1+'\x20enabled\x20('+(_0x450e46['workflow']?.[_0x598b29(0x153)]||_0x598b29(0x250))+')'),_0x450e46[_0x598b29(0x239)]&&console['log'](a54_0x4448c0[_0x598b29(0xcc)](_0x598b29(0x11d)+new Date(_0x450e46[_0x598b29(0x239)])[_0x598b29(0x1ef)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x4f40c0(0x153)]=a54_0x4f40c0(0x14a);[a54_0x4f40c0(0xd4)]=a54_0x4f40c0(0xfc);async[a54_0x4f40c0(0x1e9)](_0x48c39b){const _0x16cb68=a54_0x4f40c0,{options:_0x3d4279,args:_0x2c1d7d,tdx:_0x101a6c}=_0x48c39b,_0x42b471=_0x2c1d7d[0x0];if(!_0x42b471)return console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0x167)]('Error:'),_0x16cb68(0x152)),console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0xcc)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x16cb68(0x20f)](a54_0x4448c0[_0x16cb68(0xcc)](_0x16cb68(0x22e))),0x1;const _0x300dde=await withSpinner(_0x16cb68(0xa2)+_0x42b471+_0x16cb68(0xf4),()=>_0x101a6c[_0x16cb68(0xc9)][_0x16cb68(0x17f)](_0x42b471),{'verbose':_0x3d4279[_0x16cb68(0x1c0)]}),_0xe00208=_0x300dde['data'];return isStructuredFormat(_0x3d4279)?await handleSingleObjectOutput(_0xe00208,_0x3d4279):console[_0x16cb68(0xe7)](_0x16cb68(0x1b0)+_0x42b471+_0x16cb68(0x13e)+(_0xe00208[_0x16cb68(0xc9)]?.[_0x16cb68(0x153)]||_0x16cb68(0x250))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a55_0x29a7(){const _0x5aea94=['X-Trino-User','TD1\x20','replace','7583565TRzEWy','9gDzBDZ','929914VDgoZC','6ewXAeD','Bearer\x20','length','10038656YUqmsn','tdx/','3241596CSSCeE','4GhzwTV','version','Authorization','58919660JqiErR','2947494xkZmYO','entries','9241799DhuELK'];a55_0x29a7=function(){return _0x5aea94;};return a55_0x29a7();}(function(_0x4fa2b7,_0x3ce18a){const _0x339ba1=a55_0x434a,_0x1318fa=_0x4fa2b7();while(!![]){try{const _0x5ed3ac=-parseInt(_0x339ba1(0xc9))/0x1+-parseInt(_0x339ba1(0xd4))/0x2+-parseInt(_0x339ba1(0xcf))/0x3+parseInt(_0x339ba1(0xd0))/0x4*(-parseInt(_0x339ba1(0xc7))/0x5)+-parseInt(_0x339ba1(0xca))/0x6*(parseInt(_0x339ba1(0xd6))/0x7)+parseInt(_0x339ba1(0xcd))/0x8+parseInt(_0x339ba1(0xc8))/0x9*(parseInt(_0x339ba1(0xd3))/0xa);if(_0x5ed3ac===_0x3ce18a)break;else _0x1318fa['push'](_0x1318fa['shift']());}catch(_0xb7bace){_0x1318fa['push'](_0x1318fa['shift']());}}}(a55_0x29a7,0xc9923));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x462a0a=a55_0x434a,_0x27db97=getVersion(),_0x4ba0b5=platform(),_0x210ce0=process[_0x462a0a(0xd1)][_0x462a0a(0xc6)]('v','');return _0x462a0a(0xce)+_0x27db97+'\x20('+_0x4ba0b5+';\x20node/'+_0x210ce0+')';}export function getAuthHeaders(_0x37269b,_0x32ff98,_0x4815b3){const _0xc2b30c=a55_0x434a,_0x49a4c3=getVersion(),_0x88c91d={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x49a4c3};if(_0x4815b3)_0x88c91d[_0xc2b30c(0xd2)]=_0xc2b30c(0xcb)+_0x4815b3;else _0x32ff98&&(_0x88c91d[_0xc2b30c(0xd2)]=_0xc2b30c(0xd8)+_0x32ff98);return _0x88c91d;}function a55_0x434a(_0xe4a717,_0x1c0f59){_0xe4a717=_0xe4a717-0xc6;const _0x29a755=a55_0x29a7();let _0x434a8a=_0x29a755[_0xe4a717];return _0x434a8a;}export function toHeaderRecord(_0x404c3b){const _0x21ba4d=a55_0x434a,_0x1a84e1={};for(const [_0x27336e,_0x51af1c]of Object[_0x21ba4d(0xd5)](_0x404c3b)){_0x51af1c!==undefined&&(_0x1a84e1[_0x27336e]=_0x51af1c);}return _0x1a84e1;}export function getTrinoHeaders(_0x2a48bc,_0x3c2e17,_0x11d350){const _0xf2be93=a55_0x434a,_0x5769da=getAuthHeaders(_0x2a48bc),_0x51f90c=toHeaderRecord(_0x5769da);if(_0x11d350)_0x51f90c[_0xf2be93(0xd2)]=_0xf2be93(0xcb)+_0x11d350;else _0x3c2e17&&(_0x51f90c[_0xf2be93(0xd7)]=_0x3c2e17);return _0x51f90c;}export function hasAPIKey(_0x455e9e){const _0x1d358e=a55_0x434a,_0x3e0b6a=getAPIKey();return _0x3e0b6a!==undefined&&_0x3e0b6a[_0x1d358e(0xcc)]>0x0;}
1
+ (function(_0x284e9b,_0x2cce7a){const _0xb0efe1=a55_0x58e2,_0x1651f7=_0x284e9b();while(!![]){try{const _0x2f3edb=-parseInt(_0xb0efe1(0x171))/0x1+-parseInt(_0xb0efe1(0x16f))/0x2*(parseInt(_0xb0efe1(0x161))/0x3)+parseInt(_0xb0efe1(0x172))/0x4*(-parseInt(_0xb0efe1(0x16e))/0x5)+-parseInt(_0xb0efe1(0x164))/0x6*(-parseInt(_0xb0efe1(0x169))/0x7)+parseInt(_0xb0efe1(0x16a))/0x8*(parseInt(_0xb0efe1(0x163))/0x9)+-parseInt(_0xb0efe1(0x16c))/0xa+-parseInt(_0xb0efe1(0x160))/0xb*(-parseInt(_0xb0efe1(0x16b))/0xc);if(_0x2f3edb===_0x2cce7a)break;else _0x1651f7['push'](_0x1651f7['shift']());}catch(_0x4cb289){_0x1651f7['push'](_0x1651f7['shift']());}}}(a55_0x5c99,0x8977d));import{platform}from'os';function a55_0x5c99(){const _0x29fee3=['133192mJvWze','168nLcvzw','8280650qhgFpM','Authorization','25385AWNJcD','542xfSIFy','replace','14222olDOan','592KvFrWe','length','1278827nFuGEP','11355QhddpF','TD1\x20','414XPTeSN','78tfWIPM','version','tdx','tdx/','entries','424865sSGfbc'];a55_0x5c99=function(){return _0x29fee3;};return a55_0x5c99();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x443f5c=a55_0x58e2,_0x1e4f22=getVersion(),_0x273aff=platform(),_0xeacf43=process[_0x443f5c(0x165)][_0x443f5c(0x170)]('v','');return _0x443f5c(0x167)+_0x1e4f22+'\x20('+_0x273aff+';\x20node/'+_0xeacf43+')';}export function getAuthHeaders(_0x5cec88,_0x13ffa8,_0x269ae2){const _0x54b77c=a55_0x58e2,_0x53a023=getVersion(),_0x277a50={'User-Agent':getUserAgent(),'X-TD-Client':_0x54b77c(0x166),'X-TD-Client-Version':_0x53a023};if(_0x269ae2)_0x277a50[_0x54b77c(0x16d)]='Bearer\x20'+_0x269ae2;else _0x13ffa8&&(_0x277a50[_0x54b77c(0x16d)]=_0x54b77c(0x162)+_0x13ffa8);return _0x277a50;}export function toHeaderRecord(_0x3dbe37){const _0x2871ab=a55_0x58e2,_0x1cd5d9={};for(const [_0x5b7144,_0x1fec1e]of Object[_0x2871ab(0x168)](_0x3dbe37)){_0x1fec1e!==undefined&&(_0x1cd5d9[_0x5b7144]=_0x1fec1e);}return _0x1cd5d9;}function a55_0x58e2(_0xe08f3f,_0x50980d){_0xe08f3f=_0xe08f3f-0x15f;const _0x5c991d=a55_0x5c99();let _0x58e2da=_0x5c991d[_0xe08f3f];return _0x58e2da;}export function getTrinoHeaders(_0x46bdcd,_0x4f3550,_0x40e30d){const _0x1a2072=a55_0x58e2,_0x5678f8=getAuthHeaders(_0x46bdcd),_0x30b15e=toHeaderRecord(_0x5678f8);if(_0x40e30d)_0x30b15e[_0x1a2072(0x16d)]='Bearer\x20'+_0x40e30d;else _0x4f3550&&(_0x30b15e['X-Trino-User']=_0x4f3550);return _0x30b15e;}export function hasAPIKey(_0x4bb555){const _0x5c6402=a55_0x58e2,_0x10192d=getAPIKey();return _0x10192d!==undefined&&_0x10192d[_0x5c6402(0x15f)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x576b27,_0x44d9d2){const _0xbf205b=a56_0x42d8,_0x30eb5c=_0x576b27();while(!![]){try{const _0x381aeb=parseInt(_0xbf205b(0x109))/0x1*(-parseInt(_0xbf205b(0x14a))/0x2)+-parseInt(_0xbf205b(0x110))/0x3+parseInt(_0xbf205b(0x123))/0x4+-parseInt(_0xbf205b(0x145))/0x5*(parseInt(_0xbf205b(0x104))/0x6)+parseInt(_0xbf205b(0x117))/0x7*(-parseInt(_0xbf205b(0x114))/0x8)+parseInt(_0xbf205b(0x12b))/0x9*(parseInt(_0xbf205b(0x121))/0xa)+parseInt(_0xbf205b(0x127))/0xb;if(_0x381aeb===_0x44d9d2)break;else _0x30eb5c['push'](_0x30eb5c['shift']());}catch(_0x41c1bf){_0x30eb5c['push'](_0x30eb5c['shift']());}}}(a56_0x234e,0x6c421));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x27e193 from'chalk';function a56_0x42d8(_0x1cfaab,_0x201864){_0x1cfaab=_0x1cfaab-0x100;const _0x234e8d=a56_0x234e();let _0x42d89d=_0x234e8d[_0x1cfaab];return _0x42d89d;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2bec30){const _0x493859=a56_0x42d8;return _0x2bec30['format']===_0x493859(0x118)||_0x2bec30['format']==='jsonl'||_0x2bec30[_0x493859(0x11c)]==='tsv'||_0x2bec30[_0x493859(0x11c)]===_0x493859(0x131)||_0x2bec30[_0x493859(0x118)]===!![]||_0x2bec30[_0x493859(0x100)]===!![]||_0x2bec30[_0x493859(0x149)]===!![]||_0x2bec30[_0x493859(0x131)]===!![];}export function parseOutputOptions(_0x5539a6){const _0x27294e=a56_0x42d8;return{'format':_0x5539a6['format']||'table','output':_0x5539a6[_0x27294e(0x129)]||'','limit':_0x5539a6[_0x27294e(0x105)],'limitStructuredFormats':_0x5539a6['limitStructuredFormats'],'color':_0x5539a6[_0x27294e(0x147)],'noColor':_0x5539a6['noColor']};}function convertSDKResultToQueryResult(_0x6abf8f){const _0x26234a=a56_0x42d8,_0x2c57ee=[];if(_0x6abf8f[_0x26234a(0x101)]>0x0){const _0x174a4d=_0x6abf8f[0x0];for(const [_0x14f00a,_0x580c86]of Object[_0x26234a(0x12a)](_0x174a4d)){let _0x4200b1=_0x26234a(0x140);if(typeof _0x580c86===_0x26234a(0x134))_0x4200b1=Number[_0x26234a(0x124)](_0x580c86)?_0x26234a(0x103):_0x26234a(0x102);else{if(typeof _0x580c86==='boolean')_0x4200b1=_0x26234a(0x135);else _0x580c86===null&&(_0x4200b1=_0x26234a(0x140));}_0x2c57ee[_0x26234a(0x13f)]({'name':_0x14f00a,'type':_0x4200b1});}}return{'queryId':_0x26234a(0x146),'columns':_0x2c57ee,'data':_0x6abf8f,'stats':{'state':_0x26234a(0x125),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x6abf8f['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x170dda,_0x26118b){const _0x392c14=convertSDKResultToQueryResult(_0x170dda);return formatQueryOutput(_0x392c14,_0x26118b);}export async function formatQueryOutput(_0x554264,_0x70382b){const _0x2df624=a56_0x42d8,{format:_0x2eabdc,limit:_0x2e4841,output:_0x45c4fb,color:_0x51cfac,noColor:_0x5ad1ff,limitStructuredFormats:_0x36d9fc}=_0x70382b,_0x4dd923=Boolean(_0x45c4fb)&&!_0x51cfac,_0x12aa2c={'color':_0x51cfac,'noColor':_0x5ad1ff||_0x4dd923};if(_0x2eabdc==='table'){const _0x48feeb=shouldUseLess(_0x2eabdc,_0x45c4fb);return formatAsTable(_0x554264,_0x2e4841,_0x48feeb,_0x12aa2c);}const _0x3e1f9a=_0x36d9fc&&Number['isFinite'](_0x2e4841)&&_0x554264['data'][_0x2df624(0x101)]>_0x2e4841?{..._0x554264,'data':_0x554264[_0x2df624(0x13c)][_0x2df624(0x10a)](0x0,_0x2e4841)}:_0x554264;if(_0x2eabdc==='json')return formatAsJSON(_0x3e1f9a,_0x12aa2c);else return _0x2eabdc==='jsonl'?formatAsJSONL(_0x3e1f9a,_0x12aa2c):formatQueryResult(_0x3e1f9a,_0x2eabdc);}function shouldUseLess(_0x183d73,_0x19ab9d){const _0x464535=a56_0x42d8;return(_0x183d73===_0x464535(0x131)||_0x183d73===_0x464535(0x11e))&&process[_0x464535(0x106)][_0x464535(0x133)]&&!_0x19ab9d;}export function resolveOutputOptions(_0x161810){const _0x3e29e6=a56_0x42d8,_0x4e8d56=_0x161810[_0x3e29e6(0x129)]||'',_0x338535=resolveOutputFormat(_0x161810[_0x3e29e6(0x11c)],_0x4e8d56,'table');let _0x1e3ffc=typeof _0x161810[_0x3e29e6(0x105)]===_0x3e29e6(0x134)?_0x161810['limit']:parseInt(_0x161810['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x161810[_0x3e29e6(0x105)]===undefined&&shouldUseLess(_0x338535,_0x4e8d56)&&(_0x1e3ffc=Infinity),{'format':_0x338535,'output':_0x4e8d56,'limit':_0x1e3ffc,'limitStructuredFormats':_0x161810[_0x3e29e6(0x13a)],'color':_0x161810[_0x3e29e6(0x147)],'noColor':_0x161810['noColor']};}export function writeOutput(_0x7a338b,_0x125f11,_0x2d708a){const _0x5c8c63=a56_0x42d8;return _0x125f11?(writeFileSync(_0x125f11,_0x7a338b),console[_0x5c8c63(0x138)](_0x5c8c63(0x112)+_0x125f11),Promise[_0x5c8c63(0x107)]()):shouldUseLess(_0x2d708a||'','')?new Promise(_0x4f73a8=>{const _0x3aa625=_0x5c8c63,_0x14bb2b=spawn(_0x3aa625(0x141),[_0x3aa625(0x126)],{'stdio':[_0x3aa625(0x144),_0x3aa625(0x13b),_0x3aa625(0x13b)]});let _0x137341=![];_0x14bb2b['on'](_0x3aa625(0x138),()=>{!_0x137341&&(_0x137341=!![],console['log'](_0x7a338b),_0x4f73a8());}),_0x14bb2b['on'](_0x3aa625(0x130),()=>{!_0x137341&&(_0x137341=!![],_0x4f73a8());}),_0x14bb2b['on']('spawn',()=>{const _0x19ecdc=_0x3aa625;!_0x137341&&_0x14bb2b[_0x19ecdc(0x10e)]&&(_0x14bb2b[_0x19ecdc(0x10e)]['on'](_0x19ecdc(0x138),()=>{}),_0x14bb2b[_0x19ecdc(0x10e)][_0x19ecdc(0x113)](_0x7a338b),_0x14bb2b[_0x19ecdc(0x10e)]['end']());}),!_0x14bb2b[_0x3aa625(0x10e)]&&(!_0x137341&&(_0x137341=!![],console[_0x3aa625(0x11b)](_0x7a338b),_0x4f73a8()));}):(console[_0x5c8c63(0x11b)](_0x7a338b),Promise[_0x5c8c63(0x107)]());}function a56_0x234e(){const _0x5325f6=['3137964fDjVXR','isInteger','FINISHED','-FXRSn','9635615pzFmVG','string','output','entries','297KualAw','magenta','─┴─','split','debug','close','table','[error]','isTTY','number','boolean','[logs]','[Object]','error','map','limitStructuredFormats','inherit','data','rule','max','push','varchar','less','filter','stringify','pipe','5KBQhPF','sdk-result','color','forEach','tsv','858fDVlOE','jsonl','length','double','bigint','497166CHbTdR','limit','stdout','resolve','blue','1378tiLcMw','slice','[params]','join','padEnd','stdin','repeat','1419027FOUMRt','query','Results\x20saved\x20to\x20','write','168sRtYKz','params','cmdout','264068QKvQkf','json','bold','No\x20data','log','format','stderr','list','trim','keys','218850LioznL','─┬─'];a56_0x234e=function(){return _0x5325f6;};return a56_0x234e();}export async function handleSDKOutput(_0x33609c,_0x92e98f){const _0xbc4b95=a56_0x42d8,_0x5c6d76=resolveOutputOptions(_0x92e98f),_0x50082f=await formatSDKOutput(_0x33609c,_0x5c6d76);await writeOutput(_0x50082f,_0x5c6d76[_0xbc4b95(0x129)]||undefined,_0x5c6d76['format']);}export async function handleQueryOutput(_0x1945d2,_0x1bb352){const _0x415722=a56_0x42d8,_0x571fb4=resolveOutputOptions(_0x1bb352),_0x59fed7=await formatQueryOutput(_0x1945d2,_0x571fb4);await writeOutput(_0x59fed7,_0x571fb4[_0x415722(0x129)]||undefined,_0x571fb4[_0x415722(0x11c)]);}async function formatSingleObject(_0x1e73a1,_0x3d13a4){const _0x4c594c=a56_0x42d8,{format:_0x3a89ed,color:_0x40e164,noColor:_0x1c6c1f}=_0x3d13a4,_0x96b809={'color':_0x40e164,'noColor':_0x1c6c1f};if(_0x3a89ed===_0x4c594c(0x118)){if(shouldUseColor(_0x96b809))return colorizeJSON(_0x1e73a1,_0x96b809);return JSON[_0x4c594c(0x143)](_0x1e73a1,null,0x2);}else{if(_0x3a89ed==='jsonl'){if(shouldUseColor(_0x96b809))return colorizeJSONCompact(_0x1e73a1,_0x96b809);return JSON[_0x4c594c(0x143)](_0x1e73a1);}else{if(_0x3a89ed===_0x4c594c(0x149))return Object[_0x4c594c(0x12a)](_0x1e73a1)[_0x4c594c(0x139)](([_0x2c8825,_0x365eea])=>_0x2c8825+'\x09'+_0x365eea)[_0x4c594c(0x10c)]('\x0a');else{const _0x2d51ca=Object[_0x4c594c(0x12a)](_0x1e73a1);if(_0x2d51ca[_0x4c594c(0x101)]===0x0)return _0x4c594c(0x11a);const _0x1c3efc=_0x1e73a1[_0x4c594c(0x12f)],_0x26b19b=_0x1e73a1['query'],_0x31817e=_0x1e73a1[_0x4c594c(0x115)],_0x2af90c=_0x1e73a1[_0x4c594c(0x13d)],_0x24dcaf=_0x26b19b?typeof _0x26b19b===_0x4c594c(0x128)?_0x26b19b:JSON[_0x4c594c(0x143)](_0x26b19b,null,0x2):undefined,_0x263076=_0x31817e&&Object['keys'](_0x31817e)[_0x4c594c(0x101)]>0x0?JSON[_0x4c594c(0x143)](_0x31817e,null,0x2):undefined,_0x5bee44=_0x2af90c&&Object[_0x4c594c(0x120)](_0x2af90c)[_0x4c594c(0x101)]>0x0?JSON[_0x4c594c(0x143)](_0x2af90c,null,0x2):undefined,_0x21ff38=_0x2d51ca[_0x4c594c(0x142)](([_0x77cb24])=>_0x77cb24!=='debug'&&_0x77cb24!==_0x4c594c(0x111)&&_0x77cb24!==_0x4c594c(0x115)&&_0x77cb24!=='rule'),_0x6c3d09=Math['max'](..._0x21ff38['map'](([_0x261a9e])=>_0x261a9e[_0x4c594c(0x101)])),_0x2869ba=Math[_0x4c594c(0x13e)](..._0x21ff38[_0x4c594c(0x139)](([,_0xd4adec])=>{const _0x11683a=_0x4c594c;try{const _0x48d4e3=_0xd4adec===null||_0xd4adec===undefined?'':typeof _0xd4adec==='object'?JSON['stringify'](_0xd4adec):String(_0xd4adec),_0x12dcb1=_0x48d4e3[_0x11683a(0x12e)]('\x0a');return Math['max'](..._0x12dcb1[_0x11683a(0x139)](_0x4b57a1=>_0x4b57a1[_0x11683a(0x101)]),0x0);}catch{return 0x0;}}),0x14),_0xa16272=[];_0xa16272[_0x4c594c(0x13f)](colorBorder('┌─'+'─'[_0x4c594c(0x10f)](_0x6c3d09)+_0x4c594c(0x122)+'─'[_0x4c594c(0x10f)](_0x2869ba)+'─┐',_0x96b809)),_0x21ff38[_0x4c594c(0x148)](([_0x49b385,_0x4d7ea5])=>{const _0x312d73=_0x4c594c;let _0x54789;try{_0x54789=_0x4d7ea5===null||_0x4d7ea5===undefined?'':typeof _0x4d7ea5==='object'?JSON[_0x312d73(0x143)](_0x4d7ea5):String(_0x4d7ea5);}catch{_0x54789=_0x312d73(0x137);}const _0x3bf8d3=_0x49b385[_0x312d73(0x10d)](_0x6c3d09),_0x21c661=_0x54789[_0x312d73(0x12e)]('\x0a');_0x21c661[_0x312d73(0x148)]((_0x3064d3,_0x300da2)=>{const _0x3ad413=_0x312d73,_0x47ad03=colorBorder('│',_0x96b809);_0x300da2===0x0?_0xa16272[_0x3ad413(0x13f)](_0x47ad03+'\x20'+_0x3bf8d3+'\x20'+_0x47ad03+'\x20'+_0x3064d3['padEnd'](_0x2869ba)+'\x20'+_0x47ad03):_0xa16272['push'](_0x47ad03+'\x20'+'\x20'[_0x3ad413(0x10f)](_0x6c3d09)+'\x20'+_0x47ad03+'\x20'+_0x3064d3['padEnd'](_0x2869ba)+'\x20'+_0x47ad03);});}),_0xa16272[_0x4c594c(0x13f)](colorBorder('└─'+'─'['repeat'](_0x6c3d09)+_0x4c594c(0x12d)+'─'['repeat'](_0x2869ba)+'─┘',_0x96b809));_0x24dcaf&&(_0xa16272['push'](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193['yellow'][_0x4c594c(0x119)]('[query]'))),_0xa16272['push'](_0x24dcaf));_0x263076&&(_0xa16272['push'](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193[_0x4c594c(0x108)][_0x4c594c(0x119)](_0x4c594c(0x10b)))),_0xa16272[_0x4c594c(0x13f)](_0x263076));_0x5bee44&&(_0xa16272[_0x4c594c(0x13f)](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193[_0x4c594c(0x12c)][_0x4c594c(0x119)]('[rule]'))),_0xa16272['push'](_0x5bee44));if(_0x1c3efc){if(_0x1c3efc[_0x4c594c(0x11d)]){_0xa16272[_0x4c594c(0x13f)](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193['red'][_0x4c594c(0x119)](_0x4c594c(0x132))));const _0x2fd8d1=_0x1c3efc[_0x4c594c(0x11d)][_0x4c594c(0x12e)]('\x0a');_0x2fd8d1['forEach'](_0x430b9c=>{const _0x410c81=_0x4c594c;_0x430b9c[_0x410c81(0x11f)]()&&_0xa16272[_0x410c81(0x13f)](_0x430b9c);});}if(_0x1c3efc[_0x4c594c(0x116)]){_0xa16272[_0x4c594c(0x13f)](''),_0xa16272['push'](String(a56_0x27e193['cyan'][_0x4c594c(0x119)](_0x4c594c(0x136))));const _0x4b2114=_0x1c3efc['cmdout'][_0x4c594c(0x12e)]('\x0a');_0x4b2114[_0x4c594c(0x148)](_0x2612b6=>{const _0x2077dd=_0x4c594c;_0x2612b6[_0x2077dd(0x11f)]()&&_0xa16272[_0x2077dd(0x13f)](_0x2612b6);});}}return _0xa16272['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x2f9c21,_0x482237){const _0x4339e3=a56_0x42d8;if(_0x482237[_0x4339e3(0x11c)]===_0x4339e3(0x131)){await handleSDKOutput([_0x2f9c21],_0x482237);return;}const _0x44114e=resolveOutputOptions(_0x482237),_0x445dc7=await formatSingleObject(_0x2f9c21,_0x44114e);await writeOutput(_0x445dc7,_0x44114e[_0x4339e3(0x129)]||undefined,_0x44114e['format']);}
1
+ (function(_0xfe500e,_0x5ee886){const _0x5b0a6f=a56_0x30f3,_0x568cd7=_0xfe500e();while(!![]){try{const _0x2a5fef=parseInt(_0x5b0a6f(0xb6))/0x1+-parseInt(_0x5b0a6f(0xb3))/0x2*(-parseInt(_0x5b0a6f(0xa0))/0x3)+-parseInt(_0x5b0a6f(0x9e))/0x4*(-parseInt(_0x5b0a6f(0x97))/0x5)+parseInt(_0x5b0a6f(0xa8))/0x6+-parseInt(_0x5b0a6f(0xb8))/0x7*(parseInt(_0x5b0a6f(0xaf))/0x8)+-parseInt(_0x5b0a6f(0xb9))/0x9*(-parseInt(_0x5b0a6f(0x89))/0xa)+parseInt(_0x5b0a6f(0xb7))/0xb*(-parseInt(_0x5b0a6f(0x8f))/0xc);if(_0x2a5fef===_0x5ee886)break;else _0x568cd7['push'](_0x568cd7['shift']());}catch(_0x3a61d1){_0x568cd7['push'](_0x568cd7['shift']());}}}(a56_0x1511,0xab6ae));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x5eb0d5 from'chalk';function a56_0x30f3(_0x570f71,_0x11f667){_0x570f71=_0x570f71-0x70;const _0x1511ba=a56_0x1511();let _0x30f3ac=_0x1511ba[_0x570f71];return _0x30f3ac;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x28c80b){const _0x2ebddd=a56_0x30f3;return _0x28c80b[_0x2ebddd(0xbd)]==='json'||_0x28c80b[_0x2ebddd(0xbd)]===_0x2ebddd(0xac)||_0x28c80b[_0x2ebddd(0xbd)]===_0x2ebddd(0x79)||_0x28c80b['format']===_0x2ebddd(0xb2)||_0x28c80b['json']===!![]||_0x28c80b[_0x2ebddd(0xac)]===!![]||_0x28c80b[_0x2ebddd(0x79)]===!![]||_0x28c80b['table']===!![];}export function parseOutputOptions(_0x3569ab){const _0x4eba8e=a56_0x30f3;return{'format':_0x3569ab[_0x4eba8e(0xbd)]||'table','output':_0x3569ab['output']||'','limit':_0x3569ab[_0x4eba8e(0x8d)],'limitStructuredFormats':_0x3569ab[_0x4eba8e(0xa4)],'color':_0x3569ab[_0x4eba8e(0xb5)],'noColor':_0x3569ab['noColor']};}function convertSDKResultToQueryResult(_0x19974b){const _0x23d4f2=a56_0x30f3,_0x3cda03=[];if(_0x19974b[_0x23d4f2(0x99)]>0x0){const _0x1b182f=_0x19974b[0x0];for(const [_0x1272ec,_0x13a89f]of Object[_0x23d4f2(0x76)](_0x1b182f)){let _0x3cb34f=_0x23d4f2(0xae);if(typeof _0x13a89f===_0x23d4f2(0x7c))_0x3cb34f=Number[_0x23d4f2(0xbb)](_0x13a89f)?'bigint':_0x23d4f2(0x78);else{if(typeof _0x13a89f==='boolean')_0x3cb34f=_0x23d4f2(0xb4);else _0x13a89f===null&&(_0x3cb34f='varchar');}_0x3cda03[_0x23d4f2(0x70)]({'name':_0x1272ec,'type':_0x3cb34f});}}return{'queryId':_0x23d4f2(0x88),'columns':_0x3cda03,'data':_0x19974b,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x19974b[_0x23d4f2(0x99)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x239db4,_0x2899dd){const _0xc57ad8=convertSDKResultToQueryResult(_0x239db4);return formatQueryOutput(_0xc57ad8,_0x2899dd);}export async function formatQueryOutput(_0x2647bb,_0x3ae97e){const _0x4463a9=a56_0x30f3,{format:_0x4001bf,limit:_0x5536f6,output:_0x55ae13,color:_0x53d096,noColor:_0xb3e376,limitStructuredFormats:_0x442b0c}=_0x3ae97e,_0x32556c=Boolean(_0x55ae13)&&!_0x53d096,_0xd103b3={'color':_0x53d096,'noColor':_0xb3e376||_0x32556c};if(_0x4001bf===_0x4463a9(0xb2)){const _0x557c89=shouldUseLess(_0x4001bf,_0x55ae13);return formatAsTable(_0x2647bb,_0x5536f6,_0x557c89,_0xd103b3);}const _0x23fa4c=_0x442b0c&&Number[_0x4463a9(0xbe)](_0x5536f6)&&_0x2647bb[_0x4463a9(0x87)]['length']>_0x5536f6?{..._0x2647bb,'data':_0x2647bb[_0x4463a9(0x87)][_0x4463a9(0x9b)](0x0,_0x5536f6)}:_0x2647bb;if(_0x4001bf===_0x4463a9(0xbc))return formatAsJSON(_0x23fa4c,_0xd103b3);else return _0x4001bf===_0x4463a9(0xac)?formatAsJSONL(_0x23fa4c,_0xd103b3):formatQueryResult(_0x23fa4c,_0x4001bf);}function shouldUseLess(_0x137a6d,_0x4b49cb){const _0x1ca926=a56_0x30f3;return(_0x137a6d===_0x1ca926(0xb2)||_0x137a6d===_0x1ca926(0xa3))&&process[_0x1ca926(0x86)][_0x1ca926(0xa6)]&&!_0x4b49cb;}export function resolveOutputOptions(_0x1570bd){const _0x48939=a56_0x30f3,_0x583845=_0x1570bd[_0x48939(0x81)]||'',_0x30cf1c=resolveOutputFormat(_0x1570bd[_0x48939(0xbd)],_0x583845,_0x48939(0xb2));let _0x39652e=typeof _0x1570bd[_0x48939(0x8d)]===_0x48939(0x7c)?_0x1570bd[_0x48939(0x8d)]:parseInt(_0x1570bd[_0x48939(0x8d)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1570bd[_0x48939(0x8d)]===undefined&&shouldUseLess(_0x30cf1c,_0x583845)&&(_0x39652e=Infinity),{'format':_0x30cf1c,'output':_0x583845,'limit':_0x39652e,'limitStructuredFormats':_0x1570bd[_0x48939(0xa4)],'color':_0x1570bd[_0x48939(0xb5)],'noColor':_0x1570bd['noColor']};}export function writeOutput(_0x451445,_0x5cb84d,_0x74fddc){const _0x117e5a=a56_0x30f3;return _0x5cb84d?(writeFileSync(_0x5cb84d,_0x451445),console[_0x117e5a(0x9f)]('Results\x20saved\x20to\x20'+_0x5cb84d),Promise['resolve']()):shouldUseLess(_0x74fddc||'','')?new Promise(_0x28ddc9=>{const _0x35db3f=_0x117e5a,_0x2ac896=spawn(_0x35db3f(0xa9),[_0x35db3f(0x9d)],{'stdio':[_0x35db3f(0x93),_0x35db3f(0x92),_0x35db3f(0x92)]});let _0x4f405d=![];_0x2ac896['on'](_0x35db3f(0x9f),()=>{const _0x963804=_0x35db3f;!_0x4f405d&&(_0x4f405d=!![],console[_0x963804(0xb0)](_0x451445),_0x28ddc9());}),_0x2ac896['on'](_0x35db3f(0xa1),()=>{!_0x4f405d&&(_0x4f405d=!![],_0x28ddc9());}),_0x2ac896['on'](_0x35db3f(0x98),()=>{const _0x1dd913=_0x35db3f;!_0x4f405d&&_0x2ac896[_0x1dd913(0x7f)]&&(_0x2ac896[_0x1dd913(0x7f)]['on'](_0x1dd913(0x9f),()=>{}),_0x2ac896[_0x1dd913(0x7f)][_0x1dd913(0x95)](_0x451445),_0x2ac896[_0x1dd913(0x7f)][_0x1dd913(0x73)]());}),!_0x2ac896[_0x35db3f(0x7f)]&&(!_0x4f405d&&(_0x4f405d=!![],console['log'](_0x451445),_0x28ddc9()));}):(console['log'](_0x451445),Promise[_0x117e5a(0x83)]());}export async function handleSDKOutput(_0x6adc6e,_0x3eceb5){const _0x2ebde9=a56_0x30f3,_0x51aad3=resolveOutputOptions(_0x3eceb5),_0x4451ee=await formatSDKOutput(_0x6adc6e,_0x51aad3);await writeOutput(_0x4451ee,_0x51aad3[_0x2ebde9(0x81)]||undefined,_0x51aad3[_0x2ebde9(0xbd)]);}export async function handleQueryOutput(_0xdb9c3b,_0x3982f4){const _0x39e672=a56_0x30f3,_0x748ccb=resolveOutputOptions(_0x3982f4),_0x1185bc=await formatQueryOutput(_0xdb9c3b,_0x748ccb);await writeOutput(_0x1185bc,_0x748ccb[_0x39e672(0x81)]||undefined,_0x748ccb['format']);}async function formatSingleObject(_0xaff2dd,_0x166897){const _0x3c61b4=a56_0x30f3,{format:_0x289e77,color:_0xdcc7dd,noColor:_0xc0aae2}=_0x166897,_0x1d770f={'color':_0xdcc7dd,'noColor':_0xc0aae2};if(_0x289e77==='json'){if(shouldUseColor(_0x1d770f))return colorizeJSON(_0xaff2dd,_0x1d770f);return JSON['stringify'](_0xaff2dd,null,0x2);}else{if(_0x289e77===_0x3c61b4(0xac)){if(shouldUseColor(_0x1d770f))return colorizeJSONCompact(_0xaff2dd,_0x1d770f);return JSON[_0x3c61b4(0x74)](_0xaff2dd);}else{if(_0x289e77===_0x3c61b4(0x79))return Object[_0x3c61b4(0x76)](_0xaff2dd)[_0x3c61b4(0x85)](([_0x51403,_0x5d9b51])=>_0x51403+'\x09'+_0x5d9b51)[_0x3c61b4(0x8e)]('\x0a');else{const _0x20bb25=Object[_0x3c61b4(0x76)](_0xaff2dd);if(_0x20bb25['length']===0x0)return _0x3c61b4(0x7a);const _0x37b3a6=_0xaff2dd[_0x3c61b4(0x90)],_0xba0dc1=_0xaff2dd[_0x3c61b4(0xab)],_0x38e820=_0xaff2dd[_0x3c61b4(0xad)],_0x2509a9=_0xaff2dd[_0x3c61b4(0x80)],_0x12cfb6=_0xba0dc1?typeof _0xba0dc1===_0x3c61b4(0x72)?_0xba0dc1:JSON[_0x3c61b4(0x74)](_0xba0dc1,null,0x2):undefined,_0x8031d6=_0x38e820&&Object[_0x3c61b4(0x94)](_0x38e820)[_0x3c61b4(0x99)]>0x0?JSON[_0x3c61b4(0x74)](_0x38e820,null,0x2):undefined,_0x3ec53e=_0x2509a9&&Object['keys'](_0x2509a9)['length']>0x0?JSON[_0x3c61b4(0x74)](_0x2509a9,null,0x2):undefined,_0x35565f=_0x20bb25['filter'](([_0x3131b7])=>_0x3131b7!=='debug'&&_0x3131b7!==_0x3c61b4(0xab)&&_0x3131b7!==_0x3c61b4(0xad)&&_0x3131b7!==_0x3c61b4(0x80)),_0x22f252=Math[_0x3c61b4(0x7b)](..._0x35565f[_0x3c61b4(0x85)](([_0x5e0d52])=>_0x5e0d52[_0x3c61b4(0x99)])),_0x58222d=Math[_0x3c61b4(0x7b)](..._0x35565f[_0x3c61b4(0x85)](([,_0x47445a])=>{const _0x345eca=_0x3c61b4;try{const _0x227a82=_0x47445a===null||_0x47445a===undefined?'':typeof _0x47445a==='object'?JSON[_0x345eca(0x74)](_0x47445a):String(_0x47445a),_0x5240bc=_0x227a82['split']('\x0a');return Math[_0x345eca(0x7b)](..._0x5240bc[_0x345eca(0x85)](_0x24fcd6=>_0x24fcd6[_0x345eca(0x99)]),0x0);}catch{return 0x0;}}),0x14),_0x4a14ce=[];_0x4a14ce['push'](colorBorder('┌─'+'─'['repeat'](_0x22f252)+'─┬─'+'─'[_0x3c61b4(0x75)](_0x58222d)+'─┐',_0x1d770f)),_0x35565f[_0x3c61b4(0xb1)](([_0x3dbb1a,_0x42d5a5])=>{const _0x4c10a9=_0x3c61b4;let _0x4279b2;try{_0x4279b2=_0x42d5a5===null||_0x42d5a5===undefined?'':typeof _0x42d5a5===_0x4c10a9(0x8c)?JSON['stringify'](_0x42d5a5):String(_0x42d5a5);}catch{_0x4279b2=_0x4c10a9(0xa7);}const _0xeba6c9=_0x3dbb1a['padEnd'](_0x22f252),_0x22179c=_0x4279b2['split']('\x0a');_0x22179c['forEach']((_0x4549ff,_0x15204f)=>{const _0x5bc61e=_0x4c10a9,_0x3bff90=colorBorder('│',_0x1d770f);_0x15204f===0x0?_0x4a14ce['push'](_0x3bff90+'\x20'+_0xeba6c9+'\x20'+_0x3bff90+'\x20'+_0x4549ff[_0x5bc61e(0x96)](_0x58222d)+'\x20'+_0x3bff90):_0x4a14ce[_0x5bc61e(0x70)](_0x3bff90+'\x20'+'\x20'[_0x5bc61e(0x75)](_0x22f252)+'\x20'+_0x3bff90+'\x20'+_0x4549ff['padEnd'](_0x58222d)+'\x20'+_0x3bff90);});}),_0x4a14ce[_0x3c61b4(0x70)](colorBorder('└─'+'─'[_0x3c61b4(0x75)](_0x22f252)+_0x3c61b4(0x82)+'─'[_0x3c61b4(0x75)](_0x58222d)+'─┘',_0x1d770f));_0x12cfb6&&(_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce['push'](String(a56_0x5eb0d5[_0x3c61b4(0x9c)][_0x3c61b4(0x9a)](_0x3c61b4(0x77)))),_0x4a14ce[_0x3c61b4(0x70)](_0x12cfb6));_0x8031d6&&(_0x4a14ce['push'](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0x8a)][_0x3c61b4(0x9a)](_0x3c61b4(0x7e)))),_0x4a14ce[_0x3c61b4(0x70)](_0x8031d6));_0x3ec53e&&(_0x4a14ce['push'](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0xaa)]['bold'](_0x3c61b4(0x71)))),_0x4a14ce[_0x3c61b4(0x70)](_0x3ec53e));if(_0x37b3a6){if(_0x37b3a6[_0x3c61b4(0xa5)]){_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0x8b)]['bold']('[error]')));const _0x5a7abd=_0x37b3a6['stderr'][_0x3c61b4(0x84)]('\x0a');_0x5a7abd['forEach'](_0x1ff718=>{const _0x5ea31b=_0x3c61b4;_0x1ff718[_0x5ea31b(0x7d)]()&&_0x4a14ce[_0x5ea31b(0x70)](_0x1ff718);});}if(_0x37b3a6[_0x3c61b4(0x91)]){_0x4a14ce[_0x3c61b4(0x70)](''),_0x4a14ce[_0x3c61b4(0x70)](String(a56_0x5eb0d5[_0x3c61b4(0xa2)]['bold'](_0x3c61b4(0xba))));const _0x5d2d77=_0x37b3a6[_0x3c61b4(0x91)][_0x3c61b4(0x84)]('\x0a');_0x5d2d77['forEach'](_0x3ecbbd=>{const _0x409bdb=_0x3c61b4;_0x3ecbbd[_0x409bdb(0x7d)]()&&_0x4a14ce['push'](_0x3ecbbd);});}}return _0x4a14ce[_0x3c61b4(0x8e)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x49983a,_0x3a658d){const _0x5947fa=a56_0x30f3;if(_0x3a658d[_0x5947fa(0xbd)]===_0x5947fa(0xb2)){await handleSDKOutput([_0x49983a],_0x3a658d);return;}const _0xe59f88=resolveOutputOptions(_0x3a658d),_0x2728c9=await formatSingleObject(_0x49983a,_0xe59f88);await writeOutput(_0x2728c9,_0xe59f88[_0x5947fa(0x81)]||undefined,_0xe59f88[_0x5947fa(0xbd)]);}function a56_0x1511(){const _0x467162=['join','883812YkIqui','debug','cmdout','inherit','pipe','keys','write','padEnd','5SjOfdN','spawn','length','bold','slice','yellow','-FXRSn','3370772cKWAGW','error','13353elXPmF','close','cyan','list','limitStructuredFormats','stderr','isTTY','[Object]','8217498lzOSbQ','less','magenta','query','jsonl','params','varchar','8JFcEwN','log','forEach','table','94hQVBET','boolean','color','445620bmOIOh','264tKaLbf','9774744VhFRuH','9xFNJRd','[logs]','isInteger','json','format','isFinite','push','[rule]','string','end','stringify','repeat','entries','[query]','double','tsv','No\x20data','max','number','trim','[params]','stdin','rule','output','─┴─','resolve','split','map','stdout','data','sdk-result','9990490EjNmno','blue','red','object','limit'];a56_0x1511=function(){return _0x467162;};return a56_0x1511();}