@treasuredata/tdx 2026.7.3 → 2026.7.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 (287) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.d.ts.map +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-command.js.map +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.d.ts +67 -0
  18. package/dist/commands/claude-command.d.ts.map +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-command.js.map +1 -1
  21. package/dist/commands/claude-statusline-command.js +1 -1
  22. package/dist/commands/claude-usage-command.js +1 -1
  23. package/dist/commands/command.js +1 -1
  24. package/dist/commands/connection-command.js +1 -1
  25. package/dist/commands/databases.js +1 -1
  26. package/dist/commands/delivery-command.js +1 -1
  27. package/dist/commands/describe.d.ts +11 -0
  28. package/dist/commands/describe.d.ts.map +1 -1
  29. package/dist/commands/describe.js +1 -1
  30. package/dist/commands/describe.js.map +1 -1
  31. package/dist/commands/engage-campaign-pull-command.js +1 -1
  32. package/dist/commands/engage-campaign-push-command.js +1 -1
  33. package/dist/commands/engage-campaign-validate-command.js +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/engage-template-pull-command.js +1 -1
  36. package/dist/commands/engage-template-push-command.js +1 -1
  37. package/dist/commands/engage-template-validate-command.js +1 -1
  38. package/dist/commands/job-command.d.ts.map +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/job-command.js.map +1 -1
  41. package/dist/commands/journey-command.js +1 -1
  42. package/dist/commands/journey-validate-command.js +1 -1
  43. package/dist/commands/llm-command.d.ts.map +1 -1
  44. package/dist/commands/llm-command.js +1 -1
  45. package/dist/commands/llm-command.js.map +1 -1
  46. package/dist/commands/mcp-command.js +1 -1
  47. package/dist/commands/parent-segment-command.js +1 -1
  48. package/dist/commands/policy-command.js +1 -1
  49. package/dist/commands/profile-command.js +1 -1
  50. package/dist/commands/profiles-command.js +1 -1
  51. package/dist/commands/query-command.js +1 -1
  52. package/dist/commands/schedule-command.js +1 -1
  53. package/dist/commands/segment-command.js +1 -1
  54. package/dist/commands/segment-create-command.js +1 -1
  55. package/dist/commands/segment-fields-command.js +1 -1
  56. package/dist/commands/segment-move-command.js +1 -1
  57. package/dist/commands/segment-pull-command.js +1 -1
  58. package/dist/commands/segment-push-command.js +1 -1
  59. package/dist/commands/segment-update-command.js +1 -1
  60. package/dist/commands/segment-use-command.js +1 -1
  61. package/dist/commands/segment-validate-command.js +1 -1
  62. package/dist/commands/segments.js +1 -1
  63. package/dist/commands/show.js +1 -1
  64. package/dist/commands/status-command.js +1 -1
  65. package/dist/commands/table-deleted.js +1 -1
  66. package/dist/commands/tables.js +1 -1
  67. package/dist/commands/unset-command.js +1 -1
  68. package/dist/commands/upgrade-command.js +1 -1
  69. package/dist/commands/use-command.js +1 -1
  70. package/dist/commands/user-command.js +1 -1
  71. package/dist/commands/work-command.js +1 -1
  72. package/dist/commands/workflow-command.d.ts.map +1 -1
  73. package/dist/commands/workflow-command.js +1 -1
  74. package/dist/commands/workflow-command.js.map +1 -1
  75. package/dist/core/auth.js +1 -1
  76. package/dist/core/command-output.js +1 -1
  77. package/dist/core/config.js +1 -1
  78. package/dist/core/connection-cache.js +1 -1
  79. package/dist/core/constants.js +1 -1
  80. package/dist/core/credential-cache.js +1 -1
  81. package/dist/core/global-context.js +1 -1
  82. package/dist/core/keychain.js +1 -1
  83. package/dist/core/oauth-keychain.js +1 -1
  84. package/dist/core/oauth.js +1 -1
  85. package/dist/core/profile.js +1 -1
  86. package/dist/core/project-config.js +1 -1
  87. package/dist/core/session.js +1 -1
  88. package/dist/core/user-cache.js +1 -1
  89. package/dist/core/version.js +1 -1
  90. package/dist/index.js +1 -1
  91. package/dist/mcp/server.js +1 -1
  92. package/dist/mcp/tools/index.js +1 -1
  93. package/dist/mcp/tools/tdx-run.js +1 -1
  94. package/dist/mcp/tools/tdx-search.js +1 -1
  95. package/dist/mcp/tools/work-create-item.js +1 -1
  96. package/dist/mcp/utils.js +1 -1
  97. package/dist/proxy/claude-usage-tracker.js +1 -1
  98. package/dist/proxy/passthrough-server.js +1 -1
  99. package/dist/proxy/sse-usage-parser.js +1 -1
  100. package/dist/sdk/agent/agent-config.js +1 -1
  101. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  102. package/dist/sdk/agent/agent-yaml.js +1 -1
  103. package/dist/sdk/agent/test/evaluator.js +1 -1
  104. package/dist/sdk/agent/test/executor.js +1 -1
  105. package/dist/sdk/agent/test/index.js +1 -1
  106. package/dist/sdk/agent/test/output.js +1 -1
  107. package/dist/sdk/agent/test/parser.js +1 -1
  108. package/dist/sdk/agent/tool-target-registry.js +1 -1
  109. package/dist/sdk/api.js +1 -1
  110. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  111. package/dist/sdk/cas/cas-api-client.js +1 -1
  112. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  113. package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
  114. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  115. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  116. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  117. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  118. package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
  119. package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
  120. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  121. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  122. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  123. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  124. package/dist/sdk/cas/index.js +1 -1
  125. package/dist/sdk/cas/pull-workflow.js +1 -1
  126. package/dist/sdk/cas/push-workflow.d.ts +47 -1
  127. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  128. package/dist/sdk/cas/push-workflow.js +1 -1
  129. package/dist/sdk/cas/push-workflow.js.map +1 -1
  130. package/dist/sdk/cas/validate-files.js +1 -1
  131. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  132. package/dist/sdk/client/cdp-api-client.js +1 -1
  133. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  134. package/dist/sdk/client/delivery-api-client.js +1 -1
  135. package/dist/sdk/client/endpoints.js +1 -1
  136. package/dist/sdk/client/engage-api-client.d.ts +6 -6
  137. package/dist/sdk/client/engage-api-client.js +1 -1
  138. package/dist/sdk/client/engage-api-client.js.map +1 -1
  139. package/dist/sdk/client/http-client.js +1 -1
  140. package/dist/sdk/client/llm-api-client.js +1 -1
  141. package/dist/sdk/client/oauth-refresh.js +1 -1
  142. package/dist/sdk/client/rate-limiter.js +1 -1
  143. package/dist/sdk/client/td-api-client.js +1 -1
  144. package/dist/sdk/client/trino-api-client.js +1 -1
  145. package/dist/sdk/client/workflow-client.js +1 -1
  146. package/dist/sdk/connection-validator.js +1 -1
  147. package/dist/sdk/connection.js +1 -1
  148. package/dist/sdk/delivery.js +1 -1
  149. package/dist/sdk/engage/campaign-pull.js +1 -1
  150. package/dist/sdk/engage/campaign-push.js +1 -1
  151. package/dist/sdk/engage/campaign-validator.js +1 -1
  152. package/dist/sdk/engage/campaign-yaml.js +1 -1
  153. package/dist/sdk/engage/template-pull.js +1 -1
  154. package/dist/sdk/engage/template-push.js +1 -1
  155. package/dist/sdk/engage/template-validator.js +1 -1
  156. package/dist/sdk/engage/template-yaml.js +1 -1
  157. package/dist/sdk/engage/types/campaign-def.js +1 -1
  158. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  159. package/dist/sdk/engage/types/template-schema.js +1 -1
  160. package/dist/sdk/engage.js +1 -1
  161. package/dist/sdk/errors.js +1 -1
  162. package/dist/sdk/index.js +1 -1
  163. package/dist/sdk/io/index.js +1 -1
  164. package/dist/sdk/io/node-filesystem.js +1 -1
  165. package/dist/sdk/job.js +1 -1
  166. package/dist/sdk/journey.js +1 -1
  167. package/dist/sdk/llm/chat-cache.js +1 -1
  168. package/dist/sdk/llm/index.js +1 -1
  169. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  170. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  171. package/dist/sdk/llm/model-factors.js +1 -1
  172. package/dist/sdk/llm/model-factors.js.map +1 -1
  173. package/dist/sdk/llm/user-settings.js +1 -1
  174. package/dist/sdk/personalization.js +1 -1
  175. package/dist/sdk/policy.js +1 -1
  176. package/dist/sdk/query/deleted-table-validation.js +1 -1
  177. package/dist/sdk/query/index.d.ts +9 -1
  178. package/dist/sdk/query/index.d.ts.map +1 -1
  179. package/dist/sdk/query/index.js +1 -1
  180. package/dist/sdk/query/index.js.map +1 -1
  181. package/dist/sdk/query/sql-parser.js +1 -1
  182. package/dist/sdk/realtime.js +1 -1
  183. package/dist/sdk/schedule.js +1 -1
  184. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  185. package/dist/sdk/segment/fields-display.js +1 -1
  186. package/dist/sdk/segment/file-discovery.js +1 -1
  187. package/dist/sdk/segment/journey-utils.js +1 -1
  188. package/dist/sdk/segment/journey-validator.js +1 -1
  189. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  190. package/dist/sdk/segment/journey-yaml.js +1 -1
  191. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  192. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  193. package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
  194. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  195. package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
  196. package/dist/sdk/segment/pull-workflow.js +1 -1
  197. package/dist/sdk/segment/push-recovery.js +1 -1
  198. package/dist/sdk/segment/push-workflow.js +1 -1
  199. package/dist/sdk/segment/resolution-context.js +1 -1
  200. package/dist/sdk/segment/segment-path-parser.js +1 -1
  201. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  202. package/dist/sdk/segment/segment-validator.js +1 -1
  203. package/dist/sdk/segment/target-resolution.d.ts.map +1 -1
  204. package/dist/sdk/segment/target-resolution.js +1 -1
  205. package/dist/sdk/segment/target-resolution.js.map +1 -1
  206. package/dist/sdk/segment/tdx-config.js +1 -1
  207. package/dist/sdk/segment/types/activation-schema.js +1 -1
  208. package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
  209. package/dist/sdk/segment/types/journey-def.js +1 -1
  210. package/dist/sdk/segment/types/journey-schema.js +1 -1
  211. package/dist/sdk/segment/types/parent-segment-def.d.ts.map +1 -1
  212. package/dist/sdk/segment/types/segment-def.js +1 -1
  213. package/dist/sdk/segment/types/segment-schema.js +1 -1
  214. package/dist/sdk/segment/validate-files.js +1 -1
  215. package/dist/sdk/segment/yaml-validator.js +1 -1
  216. package/dist/sdk/segment.js +1 -1
  217. package/dist/sdk/types/cas.d.ts +5 -0
  218. package/dist/sdk/types/cas.d.ts.map +1 -1
  219. package/dist/sdk/types/cdp.d.ts.map +1 -1
  220. package/dist/sdk/types/engage.d.ts.map +1 -1
  221. package/dist/sdk/types/index.js +1 -1
  222. package/dist/sdk/types/llm.d.ts.map +1 -1
  223. package/dist/sdk/types/progress.js +1 -1
  224. package/dist/sdk/types/workspace.d.ts.map +1 -1
  225. package/dist/sdk/types/workspace.js +1 -1
  226. package/dist/sdk/types/workspace.js.map +1 -1
  227. package/dist/sdk/user.js +1 -1
  228. package/dist/sdk/util/format-detector.js +1 -1
  229. package/dist/sdk/util/formatters.js +1 -1
  230. package/dist/sdk/util/index.js +1 -1
  231. package/dist/sdk/util/paginate.js +1 -1
  232. package/dist/sdk/util/tree-formatter.js +1 -1
  233. package/dist/sdk/util/tree-search.js +1 -1
  234. package/dist/sdk/workflow/archive-validation.js +1 -1
  235. package/dist/sdk/workflow/clone-workflow.js +1 -1
  236. package/dist/sdk/workflow/index.js +1 -1
  237. package/dist/sdk/workflow/pull-workflow.js +1 -1
  238. package/dist/sdk/workflow/push-workflow.js +1 -1
  239. package/dist/sdk/workflow/task-graph.js +1 -1
  240. package/dist/sdk/workflow/tdx-config.js +1 -1
  241. package/dist/sdk/workflow/workflow-utils.js +1 -1
  242. package/dist/sdk/workspace/access-tracker.js +1 -1
  243. package/dist/sdk/workspace/frontmatter.js +1 -1
  244. package/dist/sdk/workspace/git.js +1 -1
  245. package/dist/sdk/workspace/index.js +1 -1
  246. package/dist/sdk/workspace/templates.js +1 -1
  247. package/dist/sdk/workspace/weekly.js +1 -1
  248. package/dist/sdk/workspace/wikilinks.js +1 -1
  249. package/dist/test-utils/command-runner.js +1 -1
  250. package/dist/test-utils/factories.js +1 -1
  251. package/dist/test-utils/fixtures.js +1 -1
  252. package/dist/test-utils/http-mock.js +1 -1
  253. package/dist/test-utils/index.js +1 -1
  254. package/dist/utils/async.js +1 -1
  255. package/dist/utils/claude-code-state.d.ts +33 -0
  256. package/dist/utils/claude-code-state.d.ts.map +1 -0
  257. package/dist/utils/claude-code-state.js +1 -0
  258. package/dist/utils/claude-code-state.js.map +1 -0
  259. package/dist/utils/colors.js +1 -1
  260. package/dist/utils/diff.js +1 -1
  261. package/dist/utils/file-permissions.js +1 -1
  262. package/dist/utils/file-reader.js +1 -1
  263. package/dist/utils/github-releases.js +1 -1
  264. package/dist/utils/global-cache.js +1 -1
  265. package/dist/utils/json-loader.js +1 -1
  266. package/dist/utils/local-cache.js +1 -1
  267. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  268. package/dist/utils/logger/formatters/index.js +1 -1
  269. package/dist/utils/logger/handlers/console-handler.js +1 -1
  270. package/dist/utils/logger/handlers/file-handler.js +1 -1
  271. package/dist/utils/logger/handlers/index.js +1 -1
  272. package/dist/utils/logger/handlers/null-handler.js +1 -1
  273. package/dist/utils/logger/index.js +1 -1
  274. package/dist/utils/logger/logger.js +1 -1
  275. package/dist/utils/logger/types.js +1 -1
  276. package/dist/utils/option-validation.js +1 -1
  277. package/dist/utils/process.js +1 -1
  278. package/dist/utils/prompt.js +1 -1
  279. package/dist/utils/proxy-fetch.js +1 -1
  280. package/dist/utils/proxy-fetch.js.map +1 -1
  281. package/dist/utils/spinner.js +1 -1
  282. package/dist/utils/sse-parser.js +1 -1
  283. package/dist/utils/string-utils.js +1 -1
  284. package/dist/utils/table-ref-parser.js +1 -1
  285. package/dist/utils/tdx-logger.js +1 -1
  286. package/dist/utils/version-check.js +1 -1
  287. package/package.json +18 -10
@@ -1 +1 @@
1
- const a56_0x1982d8=a56_0x120f;(function(_0x24a87d,_0x27453f){const _0x2845a6=a56_0x120f,_0x58949b=_0x24a87d();while(!![]){try{const _0x453681=parseInt(_0x2845a6(0x128))/0x1+-parseInt(_0x2845a6(0x201))/0x2+-parseInt(_0x2845a6(0x11b))/0x3+parseInt(_0x2845a6(0x222))/0x4+-parseInt(_0x2845a6(0x19f))/0x5+parseInt(_0x2845a6(0x224))/0x6*(parseInt(_0x2845a6(0x195))/0x7)+-parseInt(_0x2845a6(0x231))/0x8;if(_0x453681===_0x27453f)break;else _0x58949b['push'](_0x58949b['shift']());}catch(_0x4f0adb){_0x58949b['push'](_0x58949b['shift']());}}}(a56_0x568d,0xa12e6));import a56_0x47be42 from'chalk';import{existsSync}from'fs';import a56_0x27aa68 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{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a56_0x23600a from'prompts';function getAttemptStatusDisplay(_0x37b8ec){const _0x3e2880=a56_0x120f;if(!_0x37b8ec)return{'icon':'⏳','text':''};const {done:_0x22c836,success:_0xd89bbf,cancelRequested:_0x5aeaac}=_0x37b8ec;if(!_0x22c836)return _0x5aeaac?{'icon':'🛑','text':a56_0x47be42[_0x3e2880(0x205)](_0x3e2880(0x115))}:{'icon':'🔄','text':a56_0x47be42[_0x3e2880(0x12a)](_0x3e2880(0xc0))};if(_0xd89bbf)return{'icon':'✅','text':a56_0x47be42[_0x3e2880(0x21f)](_0x3e2880(0x193))};return{'icon':'❌','text':a56_0x47be42[_0x3e2880(0x11a)](_0x3e2880(0x9f))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x23634e,_0x4827f7,_0x5ce917=0x0){return _0x23634e[_0x5ce917]||_0x4827f7['workflowProject'];}[a56_0x1982d8(0x206)](_0x5a7e19,_0x4dcbfd,_0x271d53=0x0){const _0x5be29a=a56_0x1982d8,_0x4adfd0=this['resolveProject'](_0x5a7e19,_0x4dcbfd,_0x271d53);if(!_0x4adfd0)return console['error'](a56_0x47be42['red'](_0x5be29a(0x150)),_0x5be29a(0x163)),console[_0x5be29a(0x9f)](a56_0x47be42['dim'](_0x5be29a(0x1be))),null;return _0x4adfd0;}[a56_0x1982d8(0x144)](_0x3a5575,_0x78b457){const _0x39c2c4=a56_0x1982d8;if(_0x3a5575[0x0]){const _0x2c5ea3=_0x3a5575[0x0][_0x39c2c4(0x19b)]('.');if(_0x2c5ea3[_0x39c2c4(0x140)]===0x1)return{'projectName':_0x2c5ea3[0x0],'workflowName':undefined};else return _0x2c5ea3['length']===0x2?{'projectName':_0x2c5ea3[0x0],'workflowName':_0x2c5ea3[0x1]}:(console[_0x39c2c4(0x9f)](a56_0x47be42[_0x39c2c4(0x11a)]('Error:'),_0x39c2c4(0xd7)),null);}return{'projectName':_0x78b457[_0x39c2c4(0x247)],'workflowName':undefined};}[a56_0x1982d8(0x1ec)](_0x16fda4,_0x2a8ec4,_0x3cbf09=0x0){const _0xb854a1=a56_0x1982d8;if(_0x16fda4[_0x3cbf09])return _0x16fda4[_0x3cbf09];if(_0x2a8ec4[_0xb854a1(0x247)]){const _0x310ed8=a56_0x27aa68[_0xb854a1(0x227)](process[_0xb854a1(0x1cd)](),_0xb854a1(0x18e),_0x2a8ec4[_0xb854a1(0x247)]);if(existsSync(a56_0x27aa68[_0xb854a1(0x227)](_0x310ed8,_0xb854a1(0x1bc))))return _0x310ed8;}return undefined;}async[a56_0x1982d8(0x166)](_0x313a14,_0x54123d,_0x49caf1){const _0x42cd62=a56_0x1982d8;try{const _0x551661=await _0x313a14[_0x42cd62(0x83)][_0x42cd62(0x18e)](_0x54123d,{'limit':0x1});if(_0x551661[_0x42cd62(0x140)]>0x0){const _0x3f1a0d=_0x551661[0x0]['id'],_0x44387b=getWorkflowUrl(_0x49caf1,_0x3f1a0d);console['error'](_0x42cd62(0x173)+a56_0x47be42[_0x42cd62(0x16b)](_0x44387b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a56_0x1982d8(0x16f);['description']=a56_0x1982d8(0x211);async[a56_0x1982d8(0x24e)](_0x5e79c2){const _0x1a9266=a56_0x1982d8,{options:_0x28b69d,args:_0x4568db,tdx:_0x2a38fd}=_0x5e79c2,_0x133b1b=_0x4568db[0x0],_0x16a314=_0x28b69d[_0x1a9266(0x1cc)];if(_0x16a314)return saveSessionContext({'workflow_project':undefined},_0x28b69d[_0x1a9266(0x23e)]),console['log'](a56_0x47be42['green'](_0x1a9266(0x9e))),0x0;if(!_0x133b1b)return console[_0x1a9266(0x9f)](a56_0x47be42[_0x1a9266(0x11a)]('Error:'),_0x1a9266(0x163)),console[_0x1a9266(0x9f)](a56_0x47be42['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a56_0x47be42['dim'](_0x1a9266(0xa5))),0x1;const _0x3908d9=await withSpinner(_0x1a9266(0x1c6)+_0x133b1b+'\x27...',()=>_0x2a38fd[_0x1a9266(0x83)][_0x1a9266(0x104)](_0x133b1b),{'verbose':_0x28b69d[_0x1a9266(0x1b1)]}),{name:_0x16e36f}=_0x3908d9['data'];return saveSessionContext({'workflow_project':_0x16e36f},_0x28b69d[_0x1a9266(0x23e)]),console[_0x1a9266(0xe1)](a56_0x47be42['green'](_0x1a9266(0x13a)+a56_0x47be42[_0x1a9266(0x16b)](_0x16e36f))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x239);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x16c);async[a56_0x1982d8(0x24e)](_0x42c3c6){const _0x3b0dc5=a56_0x1982d8,{options:_0x317d4e,args:_0x1491b9,tdx:_0x2f62ee}=_0x42c3c6,_0x5c8206=_0x1491b9[0x0];_0x317d4e[_0x3b0dc5(0x1b1)]&&_0x5c8206&&console[_0x3b0dc5(0x9f)](_0x3b0dc5(0x149)+_0x5c8206);const _0x1cb920=await withSpinner(_0x3b0dc5(0x1fb),()=>_0x2f62ee[_0x3b0dc5(0x83)][_0x3b0dc5(0x1da)](_0x5c8206,{'limit':_0x317d4e[_0x3b0dc5(0x226)]}),{'verbose':_0x317d4e[_0x3b0dc5(0x1b1)]});let _0x57f8f0=_0x1cb920[_0x3b0dc5(0x207)];_0x57f8f0[_0x3b0dc5(0x1ac)]((_0x3e5aa3,_0xebd194)=>_0x3e5aa3[_0x3b0dc5(0x11f)][_0x3b0dc5(0x16e)](_0xebd194[_0x3b0dc5(0x11f)]));const _0x33ba35=_0x317d4e['limit']&&_0x57f8f0['length']>=_0x317d4e[_0x3b0dc5(0x226)]?a56_0x47be42['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3b0dc5(0x9f)](_0x3b0dc5(0x1a1)+_0x57f8f0[_0x3b0dc5(0x140)]+'\x20project'+(_0x57f8f0[_0x3b0dc5(0x140)]!==0x1?'s':'')+_0x33ba35);if(_0x317d4e['format']===_0x3b0dc5(0x8c)||_0x317d4e[_0x3b0dc5(0x164)]==='jsonl'||_0x317d4e[_0x3b0dc5(0x164)]===_0x3b0dc5(0x101))await handleSDKOutput(_0x57f8f0,_0x317d4e);else{if(_0x57f8f0[_0x3b0dc5(0x140)]===0x0)_0x5c8206?console[_0x3b0dc5(0xe1)]('No\x20projects\x20match\x20pattern:\x20'+_0x5c8206):console[_0x3b0dc5(0xe1)](_0x3b0dc5(0x153));else{const _0x10989e=_0x57f8f0[_0x3b0dc5(0x7f)](_0xee50f8=>{const _0x475543=_0x3b0dc5,_0x142e0a=_0xee50f8[_0x475543(0x1f4)]?.[_0x475543(0xa8)](_0x34d1c6=>_0x34d1c6[_0x475543(0xef)]==='sys'),_0x3b1d75=_0x142e0a?a56_0x47be42['dim'](_0x475543(0x1c1)):'';return _0x475543(0xbd)+_0xee50f8[_0x475543(0x11f)]+_0x3b1d75;});await writeOutput(_0x10989e[_0x3b0dc5(0x227)]('\x0a'),_0x317d4e[_0x3b0dc5(0x238)],_0x3b0dc5(0x127));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x22d);['description']=a56_0x1982d8(0x13d);async[a56_0x1982d8(0x24e)](_0x47aab6){const _0x383f18=a56_0x1982d8,{options:_0x30076d,args:_0x3225f7,tdx:_0xf67052}=_0x47aab6,_0x453a68=this[_0x383f18(0x9a)](_0x3225f7,_0x30076d);_0x30076d[_0x383f18(0x1b1)]&&_0x453a68&&console[_0x383f18(0x9f)](_0x383f18(0x9c)+_0x453a68);const _0x52629c=await withSpinner(_0x383f18(0x159),()=>_0xf67052[_0x383f18(0x83)]['workflows'](_0x453a68,{'limit':_0x30076d[_0x383f18(0x226)]}),{'verbose':_0x30076d['verbose']});let _0xb7463a=_0x52629c['data'];_0xb7463a['sort']((_0x24b411,_0x2f1b01)=>{const _0x2ad725=_0x383f18,_0x4dc093=_0x24b411['name'][_0x2ad725(0x16e)](_0x2f1b01['name']);if(_0x4dc093!==0x0)return _0x4dc093;return(_0x24b411[_0x2ad725(0xd4)]?.[_0x2ad725(0x11f)]||'')['localeCompare'](_0x2f1b01[_0x2ad725(0xd4)]?.[_0x2ad725(0x11f)]||'');});const _0x3b6ed0=_0x30076d[_0x383f18(0x226)]&&_0xb7463a[_0x383f18(0x140)]>=_0x30076d[_0x383f18(0x226)]?a56_0x47be42[_0x383f18(0x20a)](_0x383f18(0x1d1)):'';console[_0x383f18(0x9f)](_0x383f18(0x1a1)+_0xb7463a['length']+_0x383f18(0x82)+(_0xb7463a[_0x383f18(0x140)]!==0x1?'s':'')+_0x3b6ed0);if(_0x30076d[_0x383f18(0x164)]===_0x383f18(0x8c)||_0x30076d['format']===_0x383f18(0x1c8)||_0x30076d[_0x383f18(0x164)]==='table')await handleSDKOutput(_0xb7463a,_0x30076d);else{if(_0xb7463a['length']===0x0)_0x453a68?console[_0x383f18(0xe1)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x453a68):console[_0x383f18(0xe1)]('No\x20workflows\x20found');else{const _0x33f126=_0x30076d[_0x383f18(0x194)],_0x10bd0b=_0xb7463a['map'](_0x9c6239=>{const _0xc2f26e=_0x383f18,_0x35d40a=a56_0x47be42['dim']('#'+_0x9c6239['id']),_0x449d5a=hyperlink(_0x35d40a,getWorkflowUrl(_0x33f126,_0x9c6239['id'])),_0x1b4752=_0x9c6239[_0xc2f26e(0xd4)]?.[_0xc2f26e(0x11f)]?a56_0x47be42[_0xc2f26e(0x20a)]('\x20('+_0x9c6239[_0xc2f26e(0xd4)]['name']+')'):'';return _0xc2f26e(0xed)+_0x449d5a+'\x20'+_0x9c6239[_0xc2f26e(0x11f)]+_0x1b4752;});await writeOutput(_0x10bd0b['join']('\x0a'),_0x30076d['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x185);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x199);async[a56_0x1982d8(0x24e)](_0x570a44){const _0x55859e=a56_0x1982d8,{options:_0xca8fed,args:_0x20bb6e,tdx:_0xec810d}=_0x570a44,_0x298e85=this[_0x55859e(0x144)](_0x20bb6e,_0xca8fed);if(!_0x298e85)return 0x1;const {projectName:_0x32f9bd,workflowName:_0x4010b6}=_0x298e85;if(_0xca8fed[_0x55859e(0x1b1)]){if(_0x32f9bd&&_0x4010b6)console[_0x55859e(0x9f)](_0x55859e(0x1ff)+_0x32f9bd+'.'+_0x4010b6);else _0x32f9bd&&console[_0x55859e(0x9f)](_0x55859e(0x176)+_0x32f9bd);const _0x326e22=_0xca8fed[_0x55859e(0x118)];_0x326e22&&console[_0x55859e(0x9f)](_0x55859e(0x81)+_0x326e22);}let _0x170fa7=0x28;if(process[_0x55859e(0x1e5)][_0x55859e(0x203)]&&!_0xca8fed[_0x55859e(0x238)]&&!_0xca8fed[_0x55859e(0x164)]){const _0x3ea05f=process['stdout'][_0x55859e(0x18c)]||0x28;_0x170fa7=Math[_0x55859e(0x1d4)](0x14,Math['floor'](_0x3ea05f*0x2/0x3));}const _0x1a4f7e=_0xca8fed[_0x55859e(0x226)]||_0x170fa7,_0x17ddce=await withSpinner(_0x55859e(0xf4),()=>_0xec810d[_0x55859e(0x83)]['sessions']({'projectName':_0x32f9bd,'workflowName':_0x4010b6,'status':_0xca8fed['status'],'fromTime':_0xca8fed[_0x55859e(0x1ee)],'toTime':_0xca8fed['to'],'limit':_0x1a4f7e}),{'verbose':_0xca8fed[_0x55859e(0x1b1)]}),_0x31e6a9=_0x17ddce[_0x55859e(0x207)];_0x31e6a9[_0x55859e(0x1ac)]((_0x25b458,_0x1ebf9e)=>{const _0x103207=_0x55859e,_0x253c43=_0x25b458[_0x103207(0x1fa)]||'',_0x13e88f=_0x1ebf9e[_0x103207(0x1fa)]||'';return _0x13e88f[_0x103207(0x16e)](_0x253c43);});_0x31e6a9[_0x55859e(0x140)]>=_0x1a4f7e?console[_0x55859e(0x9f)](_0x55859e(0x1a5)+_0x31e6a9[_0x55859e(0x140)]+'\x20sessions\x20'+a56_0x47be42[_0x55859e(0x20a)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x55859e(0x9f)]('✔\x20Found\x20'+_0x31e6a9['length']+_0x55859e(0x14a)+(_0x31e6a9[_0x55859e(0x140)]!==0x1?'s':''));if(_0xca8fed[_0x55859e(0x164)]===_0x55859e(0x8c)||_0xca8fed['format']===_0x55859e(0x1c8)||_0xca8fed[_0x55859e(0x164)]===_0x55859e(0x101))await handleSDKOutput(_0x31e6a9,_0xca8fed);else{if(!process[_0x55859e(0x1e5)][_0x55859e(0x203)]||_0xca8fed[_0x55859e(0x238)]){if(_0x31e6a9[_0x55859e(0x140)]===0x0){if(_0x32f9bd&&_0x4010b6)console[_0x55859e(0xe1)](_0x55859e(0x251)+_0x32f9bd+'.'+_0x4010b6);else _0x32f9bd?console[_0x55859e(0xe1)](_0x55859e(0xf1)+_0x32f9bd):console[_0x55859e(0xe1)](_0x55859e(0xe2));}else{const _0x365c84=_0xca8fed['site'],_0x5f009b=this[_0x55859e(0x1f3)](_0x31e6a9,_0x365c84);_0xca8fed[_0x55859e(0x238)]?await writeOutput(_0x5f009b,_0xca8fed['output'],_0x55859e(0x127)):console[_0x55859e(0xe1)](_0x5f009b);}!_0x32f9bd&&(console[_0x55859e(0x9f)](''),console[_0x55859e(0x9f)](a56_0x47be42['dim'](_0x55859e(0x1d3))),console['error'](a56_0x47be42[_0x55859e(0x20a)](_0x55859e(0x245))+'or'+a56_0x47be42[_0x55859e(0x20a)](_0x55859e(0x1dd))));}else{if(_0x31e6a9[_0x55859e(0x140)]===0x0){if(_0x32f9bd&&_0x4010b6)console[_0x55859e(0xe1)](_0x55859e(0x251)+_0x32f9bd+'.'+_0x4010b6);else _0x32f9bd?console[_0x55859e(0xe1)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x32f9bd):console[_0x55859e(0xe1)](_0x55859e(0xe2));}else await this[_0x55859e(0xda)](_0x31e6a9,_0x570a44,_0x32f9bd);}}return 0x0;}[a56_0x1982d8(0x1f3)](_0x3c13a7,_0x5e119e){const _0x5692b7=a56_0x1982d8,_0x4ef53a=[],_0x38f0f0=new Map();let _0x46b867=Infinity,_0x139c91=-Infinity;for(const _0x2d30a1 of _0x3c13a7){if(_0x2d30a1[_0x5692b7(0x240)]?.['createdAt']){const _0x4167f7=new Date(_0x2d30a1[_0x5692b7(0x240)][_0x5692b7(0xd9)])[_0x5692b7(0x233)](),_0x34e582=_0x2d30a1[_0x5692b7(0x240)][_0x5692b7(0x189)]?new Date(_0x2d30a1[_0x5692b7(0x240)][_0x5692b7(0x189)])[_0x5692b7(0x233)]():Date[_0x5692b7(0x175)](),_0x3eaae2=_0x2d30a1[_0x5692b7(0xd4)]?.['name']||_0x5692b7(0x15e);!_0x38f0f0[_0x5692b7(0x11e)](_0x3eaae2)&&_0x38f0f0[_0x5692b7(0x197)](_0x3eaae2,[]),_0x38f0f0['get'](_0x3eaae2)[_0x5692b7(0x215)]({'session':_0x2d30a1,'startTime':_0x4167f7,'endTime':_0x34e582,'duration':_0x34e582-_0x4167f7}),_0x46b867=Math[_0x5692b7(0xcc)](_0x46b867,_0x4167f7),_0x139c91=Math[_0x5692b7(0x1d4)](_0x139c91,_0x34e582);}}if(_0x38f0f0[_0x5692b7(0x1a0)]===0x0)return _0x5692b7(0xec);const _0x1bbcb4=process[_0x5692b7(0x1e5)]['columns']||0x78,_0x46acdf=0x1e,_0x22b459=0x32,_0x1bfc3e=0x4,_0x4b5a40=Math[_0x5692b7(0xcc)](_0x22b459,Math[_0x5692b7(0x1d4)](_0x46acdf,Math[_0x5692b7(0x10e)](_0x1bbcb4*0.3))),_0x5d7049=_0x1bbcb4-_0x4b5a40-TIMELINE_CONFIG[_0x5692b7(0x248)]-0x3-_0x1bfc3e,_0x32216f=_0x139c91-_0x46b867,_0x9226e6=_0x32216f/_0x4b5a40,_0x4974e3=renderTimeAxis({'startTime':_0x46b867,'endTime':_0x139c91,'durationMs':_0x32216f,'msPerChar':_0x9226e6},_0x4b5a40),_0x2a819e=[];for(const _0x2eb6be of _0x38f0f0['values']()){_0x2a819e[_0x5692b7(0x215)](..._0x2eb6be);}_0x2a819e[_0x5692b7(0x1ac)]((_0x4b9fdc,_0x326e7b)=>_0x326e7b['startTime']-_0x4b9fdc[_0x5692b7(0x1ae)]);const _0x219a41=new Date(_0x46b867),_0x377814=formatDate(_0x219a41),_0x4c0a76=_0x1bfc3e+TIMELINE_CONFIG[_0x5692b7(0xdb)]+TIMELINE_CONFIG[_0x5692b7(0xfa)]+_0x5d7049,_0x5755c5='\x20'['repeat'](_0x4c0a76-_0x377814['length']),_0x3c2e55=_0x5755c5+a56_0x47be42[_0x5692b7(0x20a)](_0x377814)+'\x20'+_0x4974e3;_0x4ef53a[_0x5692b7(0x215)](_0x3c2e55);const _0x2db69a=0x16;let _0x7ee13d=0x0;for(const _0x2ba8ab of _0x2a819e){const _0x18eecd=_0x2ba8ab[_0x5692b7(0x23e)]['project']?.[_0x5692b7(0x11f)]||'?',_0x24f9e7=Math[_0x5692b7(0xcc)](stringWidth(_0x18eecd),_0x2db69a);_0x7ee13d=Math['max'](_0x7ee13d,_0x24f9e7);}for(const _0x246117 of _0x2a819e){const {session:_0x1b9fae,startTime:_0x361b57,endTime:_0x2b4150,duration:_0x4dcb5c}=_0x246117,_0x4acbec=_0x1b9fae['project']?.['id'],_0x4e2b1a=_0x1b9fae['id'],_0x1b239f=_0x1b9fae[_0x5692b7(0xd4)]?.[_0x5692b7(0x11f)]||'?',_0x168f07=_0x1b9fae[_0x5692b7(0x83)]?.[_0x5692b7(0x11f)]||'?';let _0x5012df,_0x1fb33b;if(_0x1b9fae[_0x5692b7(0x240)]){const _0x3e8923=_0x1b9fae[_0x5692b7(0x240)];!_0x3e8923[_0x5692b7(0x174)]?(_0x5012df=_0x3e8923[_0x5692b7(0xdf)]?'🛑':'🔄',_0x1fb33b=_0x3e8923['cancelRequested']?a56_0x47be42['yellow']:a56_0x47be42[_0x5692b7(0x12a)]):(_0x5012df=_0x3e8923[_0x5692b7(0x193)]?'✅':'❌',_0x1fb33b=_0x3e8923[_0x5692b7(0x193)]?a56_0x47be42[_0x5692b7(0x21f)]:a56_0x47be42[_0x5692b7(0x11a)]);}else _0x5012df='⏳',_0x1fb33b=a56_0x47be42['dim'];const _0x17e229='#'+_0x4e2b1a,_0x353537=_0x4acbec?hyperlink(_0x17e229,getWorkflowSessionUrl(_0x5e119e,_0x4acbec,_0x4e2b1a)):_0x17e229;let _0x552307=_0x1b239f;stringWidth(_0x1b239f)>_0x2db69a&&(_0x552307=_0x1b239f[_0x5692b7(0x141)](0x0,_0x2db69a-0x1)+'…');const _0x5cb0c7=a56_0x47be42[_0x5692b7(0x20a)](_0x552307),_0x3c514b=stringWidth(_0x552307),_0x5a9a25='\x20'[_0x5692b7(0xa1)](_0x7ee13d-stringWidth(_0x552307)+0x2),_0x1a9640='('+formatElapsed(_0x4dcb5c)+')',_0x41a530=stringWidth(_0x1a9640),_0x44c9b3=stringWidth(_0x17e229),_0x31cf1f=_0x44c9b3+0x1+_0x3c514b+_0x5a9a25[_0x5692b7(0x140)],_0x1d3db8=_0x5d7049-_0x31cf1f-_0x41a530-0x1-0x8;let _0x226381=_0x168f07;stringWidth(_0x226381)>_0x1d3db8&&(_0x226381=_0x226381['slice'](0x0,_0x1d3db8-0x1)+'…');const _0x413e98=_0x353537+'\x20'+_0x5cb0c7+_0x5a9a25+_0x226381,_0x159112=stringWidth(_0x413e98),_0x549c39=_0x5d7049-_0x159112-_0x41a530,_0x3e19fc=_0x413e98+'\x20'[_0x5692b7(0xa1)](Math['max'](0x1,_0x549c39))+a56_0x47be42[_0x5692b7(0x20a)](_0x1a9640),_0x5cb546=Math[_0x5692b7(0x10e)]((_0x361b57-_0x46b867)/_0x9226e6),_0x90330a=Math[_0x5692b7(0x10e)]((_0x2b4150-_0x46b867)/_0x9226e6),_0x322cfa=Math[_0x5692b7(0x1d4)](_0x5cb546+0x1,_0x90330a),_0x2d8be9=new Array(_0x4b5a40)[_0x5692b7(0xbc)]('\x20');for(let _0x3101dc=_0x5cb546;_0x3101dc<Math[_0x5692b7(0xcc)](_0x322cfa,_0x4b5a40);_0x3101dc++){_0x2d8be9[_0x3101dc]='─';}const _0xd900b=_0x2d8be9[_0x5692b7(0x7f)](_0x56327e=>_0x56327e==='\x20'?'\x20':_0x1fb33b(_0x56327e))['join']('');_0x4ef53a[_0x5692b7(0x215)](_0x5012df+'\x20'+_0x3e19fc+'│'+_0xd900b+'│');}return _0x4ef53a['join']('\x0a');}async[a56_0x1982d8(0xda)](_0x16bf92,_0x194f65,_0x39b4cf){const _0x1bb8ba=a56_0x1982d8,{options:_0x10cba1,tdx:_0x467e4e}=_0x194f65,_0x54a472=_0x10cba1['site'],{timelineRows:_0x11eb80,timeAxisHeader:_0x5cac3a}=this[_0x1bb8ba(0x1b0)](_0x16bf92,_0x54a472),_0x2e052d=_0x11eb80[_0x1bb8ba(0x103)](_0x16618a=>_0x16618a[_0x1bb8ba(0x138)]);if(_0x2e052d[_0x1bb8ba(0x140)]===0x0){const _0x2bf507=this['renderSessionsTimeline'](_0x16bf92,_0x54a472);console[_0x1bb8ba(0xe1)](_0x2bf507);!_0x39b4cf&&(console[_0x1bb8ba(0x9f)](''),console[_0x1bb8ba(0x9f)](a56_0x47be42[_0x1bb8ba(0x20a)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x1bb8ba(0x9f)](a56_0x47be42[_0x1bb8ba(0x20a)](_0x1bb8ba(0x245))+'or'+a56_0x47be42[_0x1bb8ba(0x20a)](_0x1bb8ba(0x1dd))));return;}_0x5cac3a&&console[_0x1bb8ba(0xe1)](_0x5cac3a);const _0xa50f25=_0x11eb80['filter'](_0x52f6ef=>_0x52f6ef[_0x1bb8ba(0x138)])[_0x1bb8ba(0x7f)](_0xae8680=>({'title':_0xae8680[_0x1bb8ba(0x220)],'value':_0xae8680['attemptId']})),_0xea3ad3=process[_0x1bb8ba(0x1e5)][_0x1bb8ba(0x18c)]||0x3c,_0x411fd0=Math[_0x1bb8ba(0x1d4)](0x28,Math['floor'](_0xea3ad3*0x2/0x3)),_0x20377f=await a56_0x23600a({'type':'autocomplete','name':'attemptId','message':_0x1bb8ba(0x23a),'choices':_0xa50f25,'initial':-0x1,'limit':_0x411fd0,'clearFirst':!![],'fallback':{'title':_0x1bb8ba(0xb8),'value':null},'suggest':(_0x2eb56d,_0x50729b)=>{const _0x283f08=_0x1bb8ba;if(!_0x2eb56d)return Promise[_0x283f08(0x85)](_0x50729b);const _0x48fcf9=_0x50729b[_0x283f08(0x103)](_0x3af4b7=>{const _0x311424=_0x283f08,_0x5ce9a0=_0x3af4b7;return _0x5ce9a0[_0x311424(0x236)]['toLowerCase']()[_0x311424(0x10b)](_0x2eb56d['toLowerCase']());});return Promise[_0x283f08(0x85)](_0x48fcf9);}}),_0x13e61a=()=>{const _0x29e9fe=_0x1bb8ba;process['stdout']['write'](_0x29e9fe(0xf8)),process['stdout'][_0x29e9fe(0x1af)]('\x1b[1A\x1b[2K'),process['stdout'][_0x29e9fe(0x1af)](_0x29e9fe(0xf8));},_0x37e3a8=_0x20377f&&_0x20377f[_0x1bb8ba(0x138)]&&_0x20377f[_0x1bb8ba(0x138)]!==null&&_0x20377f['attemptId'][_0x1bb8ba(0xaf)]()!=='';if(!_0x37e3a8){_0x13e61a(),console[_0x1bb8ba(0xe1)](a56_0x47be42['dim'](_0x1bb8ba(0x80)));return;}_0x13e61a();const _0xd92eff=_0x16bf92[_0x1bb8ba(0x177)](_0x5b8ddb=>_0x5b8ddb[_0x1bb8ba(0x240)]?.['id']===_0x20377f[_0x1bb8ba(0x138)]);if(_0xd92eff){const _0xb1dc1c=_0xd92eff['project']?.['name']||'?',_0x4e5f1d=_0xd92eff[_0x1bb8ba(0x83)]?.[_0x1bb8ba(0x11f)]||'?';console[_0x1bb8ba(0xe1)](_0x1bb8ba(0x1ba)+a56_0x47be42['dim'](_0xb1dc1c)+_0x1bb8ba(0x148)+a56_0x47be42[_0x1bb8ba(0x20a)](_0x4e5f1d));}const _0xbee355=new WorkflowTimelineCommand();await _0xbee355['execute']({'args':[],'options':{..._0x10cba1,'attemptId':_0x20377f[_0x1bb8ba(0x138)]},'tdx':_0x467e4e});}[a56_0x1982d8(0x1b0)](_0xc2fc9,_0x4dfed7){const _0x518743=a56_0x1982d8,_0x35af54=new Map();for(const _0x43fe2d of _0xc2fc9){_0x43fe2d['id']&&_0x43fe2d[_0x518743(0x240)]?.['id']&&_0x35af54['set'](_0x43fe2d['id'],_0x43fe2d[_0x518743(0x240)]['id']);}const _0x110d17=[];let _0x1d300c='';const _0x50999f=this[_0x518743(0x1f3)](_0xc2fc9,_0x4dfed7),_0x17433e=_0x50999f['split']('\x0a');for(const _0x4412ce of _0x17433e){if(_0x4412ce[_0x518743(0x146)](_0x518743(0x1e4))||_0x4412ce[_0x518743(0x91)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1d300c=_0x4412ce;else{if(_0x4412ce[_0x518743(0x91)](/^[✅❌🔄🛑⏳]/)){const _0xb3bd59=_0x4412ce[_0x518743(0x91)](/#(\d+)/),_0x4fa7c6=_0xb3bd59?_0xb3bd59[0x1]:null,_0x5b886d=_0x4fa7c6?_0x35af54[_0x518743(0x1a9)](_0x4fa7c6)||null:null,_0x432182=_0xc2fc9['find'](_0x35fe35=>_0x35fe35['id']===_0x4fa7c6),_0xa4c12c=_0x432182?.[_0x518743(0xd4)]?.[_0x518743(0x11f)]||'';_0x110d17['push']({'displayLine':_0x4412ce,'attemptId':_0x5b886d,'projectName':_0xa4c12c});}}}return{'timelineRows':_0x110d17,'timeAxisHeader':_0x1d300c};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0xcf);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x1e9);async[a56_0x1982d8(0x24e)](_0x553462){const _0x2db468=a56_0x1982d8,{options:_0x42f311,args:_0x4cc436,tdx:_0x4beed0}=_0x553462,_0x29c261=this[_0x2db468(0x144)](_0x4cc436,_0x42f311);if(!_0x29c261)return 0x1;const {projectName:_0x1c4a4d,workflowName:_0x42b8c3}=_0x29c261,_0x253172=_0x42f311[_0x2db468(0x202)];if(_0x42f311['verbose']){if(_0x1c4a4d&&_0x42b8c3)console['error']('Filter:\x20'+_0x1c4a4d+'.'+_0x42b8c3);else _0x1c4a4d&&console['error'](_0x2db468(0x176)+_0x1c4a4d);_0x253172&&console['error']('Include\x20retried:\x20yes');}const _0x13c0bf=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x4beed0['workflow']['attempts']({'projectName':_0x1c4a4d,'workflowName':_0x42b8c3,'includeRetried':_0x253172,'limit':_0x42f311[_0x2db468(0x226)]}),{'verbose':_0x42f311[_0x2db468(0x1b1)]}),_0x1d8cbe=_0x13c0bf[_0x2db468(0x207)],_0x2251cc=_0x42f311[_0x2db468(0x226)]||0x64,_0x8bd673=_0x1d8cbe[_0x2db468(0x140)]>=_0x2251cc?a56_0x47be42[_0x2db468(0x20a)](_0x2db468(0x1d1)):'';console[_0x2db468(0x9f)](_0x2db468(0x1a1)+_0x1d8cbe[_0x2db468(0x140)]+_0x2db468(0x12d)+(_0x1d8cbe[_0x2db468(0x140)]!==0x1?'s':'')+_0x8bd673);if(_0x42f311['format']===_0x2db468(0x8c)||_0x42f311[_0x2db468(0x164)]===_0x2db468(0x1c8)||_0x42f311[_0x2db468(0x164)]===_0x2db468(0x101))await handleSDKOutput(_0x1d8cbe,_0x42f311);else{if(_0x1d8cbe[_0x2db468(0x140)]===0x0){if(_0x1c4a4d&&_0x42b8c3)console[_0x2db468(0xe1)](_0x2db468(0x218)+_0x1c4a4d+'.'+_0x42b8c3);else _0x1c4a4d?console['log'](_0x2db468(0xb5)+_0x1c4a4d):console[_0x2db468(0xe1)]('No\x20attempts\x20found');}else{const _0x2ddff9=_0x42f311[_0x2db468(0x194)],_0x3185b7=_0x1d8cbe[_0x2db468(0x7f)](_0x117407=>{const _0x28d43c=_0x2db468,_0x1292a3=a56_0x47be42[_0x28d43c(0x20a)]('#'+_0x117407['id']),_0x4a5346=_0x117407[_0x28d43c(0xd4)]?.['id'],_0x447111=_0x117407[_0x28d43c(0x1a4)]||_0x117407[_0x28d43c(0x1df)],_0x25003d=_0x4a5346&&_0x447111?hyperlink(_0x1292a3,getWorkflowAttemptUrl(_0x2ddff9,_0x4a5346,_0x447111,_0x117407['id'])):_0x1292a3,{icon:_0x429c65,text:_0x5f3934}=getAttemptStatusDisplay(_0x117407),_0x21df12=(_0x117407[_0x28d43c(0xd4)]?.[_0x28d43c(0x11f)]||'?')+'.'+(_0x117407[_0x28d43c(0x83)]?.[_0x28d43c(0x11f)]||'?'),_0x3b98a1=_0x117407[_0x28d43c(0x1fa)]?a56_0x47be42['dim'](_0x117407[_0x28d43c(0x1fa)]):'';return(_0x25003d+'\x20'+_0x429c65+(_0x5f3934?'\x20'+_0x5f3934:'')+'\x20'+_0x21df12+'\x20'+_0x3b98a1)[_0x28d43c(0x1d2)]();});await writeOutput(_0x3185b7[_0x2db468(0x227)]('\x0a'),_0x42f311[_0x2db468(0x238)],_0x2db468(0x127));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']='workflow:attempt';[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x229);async[a56_0x1982d8(0x24e)](_0x479f3f){const _0x128112=a56_0x1982d8,{options:_0x1db27e,args:_0x25f1d8,tdx:_0x5698ac}=_0x479f3f,_0x110413=_0x25f1d8[0x0];if(!_0x110413)return console[_0x128112(0x9f)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1db27e[_0x128112(0x1b1)]&&console['error'](_0x128112(0xeb)+_0x110413);const _0x551a4b=await withSpinner(_0x128112(0x170),()=>_0x5698ac[_0x128112(0x83)][_0x128112(0x20f)](_0x110413),{'verbose':_0x1db27e[_0x128112(0x1b1)]}),_0x235ab8=_0x551a4b[_0x128112(0x207)];let _0xf80d78;!_0x235ab8[_0x128112(0x174)]?_0xf80d78=_0x235ab8[_0x128112(0xdf)]?_0x128112(0x115):_0x128112(0xc0):_0xf80d78=_0x235ab8[_0x128112(0x193)]?_0x128112(0x193):'error';let _0x3fc859;if(_0x235ab8[_0x128112(0xd9)]&&_0x235ab8[_0x128112(0x189)]){const _0x1c4bf9=new Date(_0x235ab8['createdAt'])['getTime'](),_0x5322d2=new Date(_0x235ab8[_0x128112(0x189)])[_0x128112(0x233)]();_0x3fc859=Math[_0x128112(0xdd)]((_0x5322d2-_0x1c4bf9)/0x3e8);}const _0x3ae321={'attempt_id':_0x235ab8['id'],'status':_0xf80d78,..._0x235ab8[_0x128112(0x1a8)]!==undefined&&{'index':_0x235ab8['index']},..._0x235ab8[_0x128112(0xd4)]&&{'project':_0x235ab8[_0x128112(0xd4)][_0x128112(0x11f)]},..._0x235ab8[_0x128112(0x83)]&&{'workflow':_0x235ab8[_0x128112(0x83)]['name']},..._0x235ab8['sessionId']&&{'session_id':_0x235ab8['sessionId']},..._0x235ab8['sessionTime']&&{'session_time':_0x235ab8[_0x128112(0x1fa)]},..._0x235ab8['retryAttemptName']&&{'retry_attempt':_0x235ab8[_0x128112(0x1ab)]},..._0x3fc859!==undefined&&{'duration_sec':_0x3fc859},..._0x235ab8['createdAt']&&{'created_at':_0x235ab8[_0x128112(0xd9)]},..._0x235ab8[_0x128112(0x189)]&&{'finished_at':_0x235ab8['finishedAt']},...Object[_0x128112(0x1ca)](_0x235ab8[_0x128112(0x1a7)])[_0x128112(0x140)]>0x0&&{'params':_0x235ab8['params']}};return await handleSingleObjectOutput(_0x3ae321,_0x1db27e),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x1982d8(0x11f)]='workflow:tasks';[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x1e0);async['execute'](_0x1c6c72){const _0x2c3032=a56_0x1982d8,{options:_0x4aac17,args:_0xeee080,tdx:_0x193ad1}=_0x1c6c72,_0x44ae6a=_0xeee080[0x0];if(!_0x44ae6a)return console[_0x2c3032(0x9f)](_0x2c3032(0x21c)),0x1;const _0x5168c2=_0x4aac17['includeSubtasks'];_0x4aac17[_0x2c3032(0x1b1)]&&(console[_0x2c3032(0x9f)](_0x2c3032(0xeb)+_0x44ae6a),_0x5168c2&&console[_0x2c3032(0x9f)](_0x2c3032(0x158)));const _0x4ea2d8=await withSpinner(_0x2c3032(0x23d),()=>_0x193ad1[_0x2c3032(0x83)]['tasks'](_0x44ae6a,_0x5168c2||![]),{'verbose':_0x4aac17[_0x2c3032(0x1b1)]}),_0x553b5f=_0x4ea2d8[_0x2c3032(0x207)];return console[_0x2c3032(0x9f)](_0x2c3032(0x1a1)+_0x553b5f[_0x2c3032(0x140)]+_0x2c3032(0x212)+(_0x553b5f[_0x2c3032(0x140)]!==0x1?'s':'')),await handleSDKOutput(_0x553b5f,_0x4aac17),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x21d);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x1c4);async[a56_0x1982d8(0x24e)](_0x437a2b){const _0x3ce8ef=a56_0x1982d8,{options:_0x1e972b,args:_0x48c43c,tdx:_0x17933c}=_0x437a2b,_0x6fff36=_0x48c43c[0x0];let _0x5483a8=_0x48c43c[0x1];if(!_0x6fff36)return console[_0x3ce8ef(0x9f)](_0x3ce8ef(0x21c)),0x1;_0x1e972b[_0x3ce8ef(0x1b1)]&&(console[_0x3ce8ef(0x9f)](_0x3ce8ef(0xeb)+_0x6fff36),_0x5483a8&&console['error'](_0x3ce8ef(0x15a)+_0x5483a8));const _0x62e901=await withSpinner(_0x3ce8ef(0x9d),()=>_0x17933c[_0x3ce8ef(0x83)][_0x3ce8ef(0x123)](_0x6fff36,_0x5483a8),{'verbose':_0x1e972b[_0x3ce8ef(0x1b1)]}),_0x21521d=_0x62e901[_0x3ce8ef(0x207)];if(_0x21521d[_0x3ce8ef(0x140)]===0x0)return console[_0x3ce8ef(0x9f)](_0x3ce8ef(0x134)),0x0;if(!_0x5483a8&&(_0x1e972b['json']||_0x1e972b[_0x3ce8ef(0x164)]))return await handleSDKOutput(_0x21521d,_0x1e972b),0x0;if(!_0x5483a8){const _0x10f5b7=_0x21521d[_0x3ce8ef(0x7f)](_0x21754b=>({'title':_0x21754b[_0x3ce8ef(0x209)]+'\x20('+formatBytes(_0x21754b[_0x3ce8ef(0x142)])+')','value':_0x21754b[_0x3ce8ef(0x209)]})),_0x3976e9=await a56_0x23600a({'type':_0x3ce8ef(0x1b7),'name':_0x3ce8ef(0xf7),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x10f5b7});if(!_0x3976e9['task'])return console[_0x3ce8ef(0x9f)]('Cancelled'),0x0;_0x5483a8=_0x3976e9[_0x3ce8ef(0xf7)];}const _0x2f248d=await withSpinner(_0x3ce8ef(0x165),()=>_0x17933c['workflow']['logs'](_0x6fff36,_0x5483a8),{'verbose':_0x1e972b[_0x3ce8ef(0x1b1)]}),_0x5da47b=_0x2f248d[_0x3ce8ef(0x207)];return _0x5da47b?console[_0x3ce8ef(0xe1)](_0x5da47b):console['error'](_0x3ce8ef(0x1de)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']='workflow:kill';['description']='Kill\x20a\x20running\x20attempt';async[a56_0x1982d8(0x24e)](_0x40239a){const _0xf7cac0=a56_0x1982d8,{options:_0x2e5b03,args:_0xcb252c,tdx:_0x3515a2}=_0x40239a,_0x5c4a74=_0xcb252c[0x0];if(!_0x5c4a74)return console[_0xf7cac0(0x9f)](_0xf7cac0(0x21c)),0x1;const _0x5c64ee=_0x2e5b03['reason'];_0x2e5b03[_0xf7cac0(0x1b1)]&&(console[_0xf7cac0(0x9f)]('Attempt\x20ID:\x20'+_0x5c4a74),_0x5c64ee&&console[_0xf7cac0(0x9f)](_0xf7cac0(0xab)+_0x5c64ee));if(!_0x2e5b03['yes']){if(!isInteractive())return console['error'](a56_0x47be42[_0xf7cac0(0x11a)](_0xf7cac0(0x249)),_0xf7cac0(0xc7)),console[_0xf7cac0(0x9f)](a56_0x47be42[_0xf7cac0(0x20a)](_0xf7cac0(0x12f))),0x1;const _0x170e13=await confirmKey(_0xf7cac0(0x1d8)+_0x5c4a74+'?');if(!_0x170e13)return console[_0xf7cac0(0x9f)](a56_0x47be42[_0xf7cac0(0x205)](_0xf7cac0(0x80))),0x1;}const _0x4e51bd=await withSpinner(_0xf7cac0(0x1a3),()=>_0x3515a2[_0xf7cac0(0x83)][_0xf7cac0(0x20b)](_0x5c4a74,_0x5c64ee),{'verbose':_0x2e5b03[_0xf7cac0(0x1b1)]}),_0x151090=_0x4e51bd[_0xf7cac0(0x207)];return console['error']('✔\x20'+_0x151090),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a56_0x1982d8(0x14c);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x1d6);async[a56_0x1982d8(0x24e)](_0x5120d2){const _0x1168ee=a56_0x1982d8,{options:_0xcd08b5,args:_0x279f8a,tdx:_0x115995}=_0x5120d2,_0xcf64ba=_0x279f8a[0x0];if(!_0xcf64ba)return console['error'](_0x1168ee(0x12b)),console[_0x1168ee(0x9f)](_0x1168ee(0x1c2)),0x1;let _0x20217d=![],_0x5f1907=_0xcf64ba;if(_0xcf64ba[_0x1168ee(0x146)]('session:'))_0x20217d=!![],_0x5f1907=_0xcf64ba[_0x1168ee(0x108)](0x8);else{if(_0xcf64ba[_0x1168ee(0x146)]('attempt:'))_0x20217d=![],_0x5f1907=_0xcf64ba[_0x1168ee(0x108)](0x8);else return console[_0x1168ee(0x9f)](_0x1168ee(0x242)),console[_0x1168ee(0x9f)](_0x1168ee(0x1c2)),0x1;}const _0x59003f=_0xcd08b5[_0x1168ee(0x1c5)],_0x1a04c9=_0xcd08b5['resumeFrom'],_0x56652f=_0xcd08b5[_0x1168ee(0x1a7)],_0x3ae261=_0xcd08b5[_0x1168ee(0x1eb)];_0xcd08b5[_0x1168ee(0x1b1)]&&(console[_0x1168ee(0x9f)](_0x1168ee(0xe9)+(_0x20217d?'session':_0x1168ee(0x20f))+'\x20'+_0x5f1907),_0x59003f&&console['error'](_0x1168ee(0x122)+_0x59003f),_0x1a04c9&&console[_0x1168ee(0x9f)](_0x1168ee(0xe0)+_0x1a04c9),_0x56652f&&console[_0x1168ee(0x9f)](_0x1168ee(0xf2)+_0x56652f),_0x3ae261&&console[_0x1168ee(0x9f)](_0x1168ee(0x121)));let _0x4d3c17;if(_0x56652f)try{if(_0x56652f[_0x1168ee(0x146)]('@')){const _0x286583=await import(_0x1168ee(0xc2)),_0x5b7283=_0x56652f[_0x1168ee(0x108)](0x1),_0x4a3377=await _0x286583[_0x1168ee(0x1e8)](_0x5b7283,_0x1168ee(0x1cf));_0x4d3c17=JSON['parse'](_0x4a3377);}else _0x4d3c17=JSON[_0x1168ee(0x196)](_0x56652f);}catch{return console[_0x1168ee(0x9f)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0xcd08b5['yes']){if(!isInteractive())return console['error'](a56_0x47be42['red'](_0x1168ee(0x249)),_0x1168ee(0xc7)),console[_0x1168ee(0x9f)](a56_0x47be42[_0x1168ee(0x20a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5e2869=await confirmKey(_0x1168ee(0xae)+(_0x20217d?_0x1168ee(0x23e):'attempt')+'\x20'+_0x5f1907+'?');if(!_0x5e2869)return console[_0x1168ee(0x9f)](a56_0x47be42[_0x1168ee(0x205)](_0x1168ee(0x80))),0x1;}let _0x1f0352;_0x20217d?_0x1f0352=await withSpinner(_0x1168ee(0x12e),()=>_0x115995['workflow']['retrySession'](_0x5f1907,{'fromTask':_0x59003f,'retryParams':_0x4d3c17}),{'verbose':_0xcd08b5['verbose']}):_0x1f0352=await withSpinner(_0x1168ee(0x184),()=>_0x115995[_0x1168ee(0x83)][_0x1168ee(0x221)](_0x5f1907,{'resumeFrom':_0x1a04c9,'retryParams':_0x4d3c17,'force':_0x3ae261}),{'verbose':_0xcd08b5[_0x1168ee(0x1b1)]});const _0x238ca4=_0x1f0352[_0x1168ee(0x207)];return console[_0x1168ee(0x9f)](_0x1168ee(0x217)),console['error'](_0x1168ee(0x1fd)+_0x238ca4[_0x1168ee(0x138)]),console['error'](_0x1168ee(0xad)+_0x238ca4[_0x1168ee(0x1df)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x95);[a56_0x1982d8(0x14b)]='Start\x20a\x20workflow\x20run';async['execute'](_0x49a223){const _0x58db9e=a56_0x1982d8,{options:_0x408b38,args:_0x1b3956,tdx:_0xc00285}=_0x49a223;let _0x5ac952=_0x1b3956[0x0];if(!_0x5ac952){const _0x2256a6=this['resolveProject']([],_0x408b38),_0xd8e88b=await withSpinner('Loading\x20workflows...',()=>_0xc00285[_0x58db9e(0x83)][_0x58db9e(0x18e)](_0x2256a6,{'limit':_0x408b38[_0x58db9e(0x226)]}),{'verbose':_0x408b38['verbose']}),_0x3addad=_0xd8e88b['data'];if(_0x3addad[_0x58db9e(0x140)]===0x0)return console['error'](_0x58db9e(0x200)),!_0x2256a6&&console[_0x58db9e(0x9f)](a56_0x47be42[_0x58db9e(0x20a)](_0x58db9e(0x1be))),0x1;const _0x2b56ab=_0x3addad[_0x58db9e(0x7f)](_0x40f121=>({'title':_0x40f121[_0x58db9e(0xd4)]?.['name']+'.'+_0x40f121[_0x58db9e(0x11f)],'value':_0x40f121[_0x58db9e(0xd4)]?.[_0x58db9e(0x11f)]+'.'+_0x40f121['name'],'description':_0x40f121[_0x58db9e(0x22c)]?'revision:\x20'+_0x40f121[_0x58db9e(0x22c)]:undefined})),_0x45e8ea=await a56_0x23600a({'type':_0x58db9e(0x1b7),'name':_0x58db9e(0x83),'message':_0x58db9e(0x139),'choices':_0x2b56ab});if(!_0x45e8ea[_0x58db9e(0x83)])return 0x1;_0x5ac952=_0x45e8ea[_0x58db9e(0x83)];}if(!_0x5ac952[_0x58db9e(0x10b)]('.')){const _0x362b2b=this[_0x58db9e(0x9a)]([],_0x408b38);if(_0x362b2b)_0x5ac952=_0x362b2b+'.'+_0x5ac952;else return console[_0x58db9e(0x9f)](a56_0x47be42[_0x58db9e(0x11a)](_0x58db9e(0x150)),_0x58db9e(0x131)),console['error'](a56_0x47be42[_0x58db9e(0x20a)](_0x58db9e(0x1be))),0x1;}const _0x15399f=_0x408b38[_0x58db9e(0xe8)],_0xd0ebff=_0x408b38[_0x58db9e(0x1fa)],_0x1f9b99={};if(_0x15399f&&Array[_0x58db9e(0x111)](_0x15399f))for(const _0x48b22a of _0x15399f){const _0x4e6984=_0x48b22a[_0x58db9e(0x169)]('=');if(_0x4e6984===-0x1)return console[_0x58db9e(0x9f)](_0x58db9e(0x15c)+_0x48b22a),console[_0x58db9e(0x9f)](_0x58db9e(0x114)),0x1;const _0x323f70=_0x48b22a[_0x58db9e(0x108)](0x0,_0x4e6984),_0x34e72d=_0x48b22a[_0x58db9e(0x108)](_0x4e6984+0x1);try{_0x1f9b99[_0x323f70]=JSON[_0x58db9e(0x196)](_0x34e72d);}catch{_0x1f9b99[_0x323f70]=_0x34e72d;}}_0x408b38[_0x58db9e(0x1b1)]&&(console[_0x58db9e(0x9f)](_0x58db9e(0x1c0)+_0x5ac952),Object[_0x58db9e(0x1ca)](_0x1f9b99)[_0x58db9e(0x140)]>0x0&&console[_0x58db9e(0x9f)](_0x58db9e(0xc3)+JSON[_0x58db9e(0xbf)](_0x1f9b99)),_0xd0ebff&&console[_0x58db9e(0x9f)](_0x58db9e(0x1e6)+_0xd0ebff));if(_0x408b38[_0x58db9e(0xfc)])return await this[_0x58db9e(0x98)](_0x49a223,_0x5ac952,_0x1f9b99,_0xd0ebff);const _0x4bbae9=await withSpinner(_0x58db9e(0x1fe),()=>_0xc00285['workflow']['run'](_0x5ac952,_0x1f9b99,{'sessionTime':_0xd0ebff}),{'verbose':_0x408b38['verbose']}),_0x18a2d3=_0x4bbae9[_0x58db9e(0x207)];console[_0x58db9e(0x9f)](_0x58db9e(0x213)),console[_0x58db9e(0x9f)](_0x58db9e(0x1d5)+_0x18a2d3['id']),console[_0x58db9e(0x9f)](_0x58db9e(0xad)+_0x18a2d3[_0x58db9e(0x1df)]),console[_0x58db9e(0x9f)](_0x58db9e(0x1f8)+_0x18a2d3['project']?.[_0x58db9e(0x11f)]),console[_0x58db9e(0x9f)]('\x20\x20Workflow:\x20'+_0x18a2d3[_0x58db9e(0x83)]?.[_0x58db9e(0x11f)]);if(_0x18a2d3[_0x58db9e(0xd4)]?.['id']&&_0x18a2d3[_0x58db9e(0x1df)]&&_0x18a2d3['id']){const _0x5ac709=_0x408b38[_0x58db9e(0x194)],_0x509321=getConsoleUrl(_0x5ac709,_0x58db9e(0x232)+_0x18a2d3[_0x58db9e(0xd4)]['id']+_0x58db9e(0x1b2)+_0x18a2d3[_0x58db9e(0x1df)]+_0x58db9e(0x1db)+_0x18a2d3['id']);console[_0x58db9e(0x9f)]('\x20\x20Console:\x20'+a56_0x47be42['cyan'](_0x509321));}return 0x0;}async[a56_0x1982d8(0x98)](_0x20614f,_0x30152e,_0x16f585,_0x4d7006){const _0x26c0ba=a56_0x1982d8,{options:_0x52c520,tdx:_0x909ef1}=_0x20614f,_0xc4c511=await withSpinner(_0x26c0ba(0xf6)+_0x30152e+_0x26c0ba(0x1e7),()=>_0x909ef1['workflow'][_0x26c0ba(0xf0)](_0x30152e),{'verbose':_0x52c520[_0x26c0ba(0x1b1)]}),_0x479895=_0xc4c511['data'],_0x186492=_0x4d7006??new Date()[_0x26c0ba(0x1d0)]();console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x124)](_0x26c0ba(0xd8)),_0x30152e),console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x124)]('Session\x20time:'),_0x186492),console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x124)](_0x26c0ba(0x116)),JSON[_0x26c0ba(0xbf)](_0x16f585)),console[_0x26c0ba(0xe1)](''),console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x124)](_0x26c0ba(0xd0)));const _0x249102=parseTaskGraph(_0x479895[_0x26c0ba(0xac)]??null);if(_0x249102[_0x26c0ba(0x140)]===0x0)console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x20a)](_0x26c0ba(0x1d9)));else for(const _0x533512 of formatTaskGraph(_0x249102)){console[_0x26c0ba(0xe1)](_0x533512);}const _0x1e3916=summarizeTaskGraph(_0x249102),_0x362666=formatWarningSummary(_0x1e3916);return _0x362666&&(console[_0x26c0ba(0xe1)](''),console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x205)](_0x362666))),console[_0x26c0ba(0xe1)](a56_0x47be42[_0x26c0ba(0x205)](_0x26c0ba(0x1f1))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a56_0x1982d8(0x11f)]='workflow:download';[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x167);async[a56_0x1982d8(0x24e)](_0x6f39c5){const _0x107967=a56_0x1982d8,{options:_0x144604,args:_0x279847,tdx:_0x4bfe7c}=_0x6f39c5,_0x406c09=_0x279847[0x0],_0x541543=_0x279847[0x1]||'.';if(!_0x406c09)return console[_0x107967(0x9f)](_0x107967(0xa9)),console[_0x107967(0x9f)](_0x107967(0x96)),0x1;const _0x30c468=_0x144604[_0x107967(0x22c)];_0x144604['verbose']&&(console[_0x107967(0x9f)](_0x107967(0x1ba)+_0x406c09),console['error'](_0x107967(0x225)+_0x541543),_0x30c468&&console[_0x107967(0x9f)](_0x107967(0xfb)+_0x30c468));const _0x35aa50=await withSpinner('Downloading\x20project\x20'+_0x406c09+_0x107967(0x1e7),()=>_0x4bfe7c[_0x107967(0x83)]['download'](_0x406c09,_0x541543,{'revision':_0x30c468}),{'verbose':_0x144604[_0x107967(0x1b1)]}),_0x46760c=_0x35aa50[_0x107967(0x207)];return console[_0x107967(0x9f)](_0x107967(0x22e)+_0x46760c[_0x107967(0x171)]),console[_0x107967(0x9f)]('\x20\x20Revision:\x20'+_0x46760c['revision']),console[_0x107967(0x9f)](_0x107967(0x230)+_0x46760c[_0x107967(0x20c)]),console[_0x107967(0x9f)](_0x107967(0x24d)+_0x541543+'/'+_0x46760c[_0x107967(0x171)]),0x0;}}function a56_0x120f(_0x4c54c2,_0x1acb25){_0x4c54c2=_0x4c54c2-0x7d;const _0x568d71=a56_0x568d();let _0x120f7a=_0x568d71[_0x4c54c2];return _0x120f7a;}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x88);[a56_0x1982d8(0x14b)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a56_0x1982d8(0x24e)](_0x1b0e85){const _0x32d921=a56_0x1982d8,{options:_0x17e2f1,args:_0x376792,tdx:_0xcf87d}=_0x1b0e85;let _0x4064d1='.',_0x3c0eeb=_0x17e2f1['name'];if(_0x376792[0x0]){const {promises:_0x5a2cbc}=await import('fs');try{const _0x5e05d0=await _0x5a2cbc[_0x32d921(0x24b)](_0x376792[0x0]);if(_0x5e05d0[_0x32d921(0xa4)]())_0x4064d1=_0x376792[0x0];else return console[_0x32d921(0x9f)]('Error:\x20'+_0x376792[0x0]+_0x32d921(0xc5)),0x1;}catch{_0x3c0eeb=_0x376792[0x0],_0x4064d1='.';}}const _0x31e76e=_0x17e2f1[_0x32d921(0x22c)],_0x46a632=_0x17e2f1[_0x32d921(0x1c3)];_0x17e2f1[_0x32d921(0x1b1)]&&(console[_0x32d921(0x9f)](_0x32d921(0x13c)+_0x4064d1),_0x3c0eeb&&console[_0x32d921(0x9f)]('Project\x20name:\x20'+_0x3c0eeb),_0x31e76e&&console[_0x32d921(0x9f)](_0x32d921(0xfb)+_0x31e76e),_0x46a632&&console['error'](_0x32d921(0x13e)));const _0x169d74=await withSpinner(_0x32d921(0x1e3),()=>_0xcf87d[_0x32d921(0x83)][_0x32d921(0x215)](_0x4064d1,{'projectName':_0x3c0eeb,'revision':_0x31e76e,'skipValidation':_0x46a632}),{'verbose':_0x17e2f1['verbose']}),_0x3faed1=_0x169d74['data'];return console['error']('✔\x20Pushed\x20'+_0x3faed1[_0x32d921(0x171)]),console[_0x32d921(0x9f)]('\x20\x20Project\x20ID:\x20'+_0x3faed1[_0x32d921(0x216)]),console['error']('\x20\x20Revision:\x20'+_0x3faed1[_0x32d921(0x22c)]),await this[_0x32d921(0x166)](_0xcf87d,_0x3faed1[_0x32d921(0x171)],_0x17e2f1[_0x32d921(0x194)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x1982d8(0x11f)]='workflow:pull';[a56_0x1982d8(0x14b)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a56_0x1982d8(0x24e)](_0x2fd765){const _0x377f8f=a56_0x1982d8,{options:_0x1f9c39,args:_0xd6041,tdx:_0x2928b8}=_0x2fd765,_0x42fb87=_0xd6041[0x0],_0x4075eb=_0xd6041[0x1];if(!_0x42fb87)return console[_0x377f8f(0x9f)](a56_0x47be42[_0x377f8f(0x11a)](_0x377f8f(0x150)),'Project\x20name\x20is\x20required'),console['error'](a56_0x47be42[_0x377f8f(0x20a)](_0x377f8f(0x1bf))),0x1;const _0x2e1690=_0x1f9c39[_0x377f8f(0x22c)];_0x1f9c39[_0x377f8f(0x1b1)]&&(console[_0x377f8f(0x9f)](_0x377f8f(0x1ba)+_0x42fb87),_0x4075eb&&console[_0x377f8f(0x9f)](_0x377f8f(0x102)+_0x4075eb),_0x2e1690&&console[_0x377f8f(0x9f)](_0x377f8f(0xfb)+_0x2e1690),_0x1f9c39[_0x377f8f(0xfc)]&&console[_0x377f8f(0x9f)]('Dry\x20run:\x20yes'));const _0x3725a8=await withSpinner(_0x377f8f(0x94)+_0x42fb87+_0x377f8f(0x1e7),()=>_0x2928b8[_0x377f8f(0x83)][_0x377f8f(0x237)](_0x42fb87,{'targetDir':_0x4075eb,'revision':_0x2e1690}),{'verbose':_0x1f9c39[_0x377f8f(0x1b1)]}),_0x4b1146=_0x3725a8['data'];_0x4b1146[_0x377f8f(0x1cb)]?console[_0x377f8f(0x9f)]('→\x20New\x20project:\x20'+_0x4b1146[_0x377f8f(0x171)]):console['error'](_0x377f8f(0x13f)+_0x4b1146['projectName']);console[_0x377f8f(0x9f)]('\x20\x20Revision:\x20'+_0x4b1146[_0x377f8f(0x22c)]),console[_0x377f8f(0x9f)]('\x20\x20Target:\x20'+(a56_0x27aa68[_0x377f8f(0x11c)](process[_0x377f8f(0x1cd)](),_0x4b1146[_0x377f8f(0x129)])||'.')),console['error'](_0x377f8f(0x204)+a56_0x47be42['green']('+'+_0x4b1146[_0x377f8f(0x1a2)]['new']+_0x377f8f(0x246))+',\x20'+(a56_0x47be42[_0x377f8f(0x205)]('~'+_0x4b1146[_0x377f8f(0x1a2)][_0x377f8f(0x1ed)]+_0x377f8f(0x161))+',\x20')+(a56_0x47be42[_0x377f8f(0x11a)]('-'+_0x4b1146[_0x377f8f(0x1a2)][_0x377f8f(0x154)]+_0x377f8f(0x17d))+',\x20')+(''+a56_0x47be42[_0x377f8f(0x20a)](_0x4b1146[_0x377f8f(0x1a2)][_0x377f8f(0x192)]+'\x20unchanged')));for(const _0x2668db of _0x4b1146[_0x377f8f(0x160)]){_0x2668db['type']===_0x377f8f(0x1ed)&&_0x2668db[_0x377f8f(0xd6)]&&(console[_0x377f8f(0x9f)]('\x0a'+a56_0x47be42[_0x377f8f(0x16b)](_0x377f8f(0x152)+_0x2668db[_0x377f8f(0x1b4)])),console[_0x377f8f(0x9f)](_0x2668db[_0x377f8f(0xd6)]));}if(!_0x4b1146['hasChanges'])return saveSessionContext({'workflow_project':_0x4b1146[_0x377f8f(0x171)]},_0x1f9c39['session']),console[_0x377f8f(0x9f)](a56_0x47be42[_0x377f8f(0x21f)](_0x377f8f(0x17a))),console[_0x377f8f(0x9f)](a56_0x47be42[_0x377f8f(0x20a)](_0x377f8f(0x188)+_0x4b1146[_0x377f8f(0x171)])),0x0;if(_0x1f9c39[_0x377f8f(0xfc)])return console[_0x377f8f(0x9f)](a56_0x47be42['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x1f9c39['yes']){if(!isInteractive())return console['error'](a56_0x47be42[_0x377f8f(0x11a)]('\x0aError:'),_0x377f8f(0xc7)),console['error'](a56_0x47be42[_0x377f8f(0x20a)](_0x377f8f(0x12f))),0x1;const _0x5cfee9=await confirmKey(_0x377f8f(0x1bd));if(!_0x5cfee9)return console['error'](a56_0x47be42[_0x377f8f(0x205)](_0x377f8f(0x80)),_0x377f8f(0xc8)),0x1;}await withSpinner('Writing\x20files...',()=>_0x2928b8['workflow'][_0x377f8f(0x117)](_0x4b1146,{'revision':_0x2e1690}),{'verbose':_0x1f9c39[_0x377f8f(0x1b1)]}),saveSessionContext({'workflow_project':_0x4b1146['projectName']},_0x1f9c39['session']),console[_0x377f8f(0x9f)](a56_0x47be42[_0x377f8f(0x21f)](_0x377f8f(0x1a6)));const _0x38055c=a56_0x27aa68['relative'](process[_0x377f8f(0x1cd)](),_0x4b1146[_0x377f8f(0x129)])||'.';return console['error'](a56_0x47be42[_0x377f8f(0x20a)](_0x377f8f(0x24d)+_0x38055c)),console[_0x377f8f(0x9f)](a56_0x47be42['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4b1146[_0x377f8f(0x171)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x1f2);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x178);async[a56_0x1982d8(0x24e)](_0x335f3a){const _0x5d0a18=a56_0x1982d8,{options:_0x3e2f62,args:_0x29e3f0,tdx:_0x4fb5c9}=_0x335f3a,_0x3bfc38=this[_0x5d0a18(0x1ec)](_0x29e3f0,_0x3e2f62),_0x355d96=_0x3e2f62,{revision:_0x52a50b,skipValidation:_0x49b488,backfill:_0x24e143}=_0x355d96,_0x145fbf=_0x24e143===undefined?undefined:!_0x24e143;_0x3e2f62[_0x5d0a18(0x1b1)]&&(_0x3bfc38&&console[_0x5d0a18(0x9f)](_0x5d0a18(0x1f0)+_0x3bfc38),_0x52a50b&&console[_0x5d0a18(0x9f)](_0x5d0a18(0xfb)+_0x52a50b),_0x3e2f62['dryRun']&&console['error'](_0x5d0a18(0xbb)),_0x49b488&&console[_0x5d0a18(0x9f)]('Validation:\x20skipped'),_0x24e143&&console[_0x5d0a18(0x9f)](_0x5d0a18(0x187)));let _0x257914;try{_0x257914=await withSpinner('Analyzing\x20changes...',()=>_0x4fb5c9[_0x5d0a18(0x83)][_0x5d0a18(0x190)]({'sourceDir':_0x3bfc38,'revision':_0x52a50b,'skipValidation':_0x49b488,'skipSchedule':_0x145fbf}),{'verbose':_0x3e2f62[_0x5d0a18(0x1b1)]});}catch(_0x3896bd){if(_0x3896bd instanceof Error&&_0x3896bd['message']['includes']('No\x20workflow\x20tdx.json\x20found'))return console[_0x5d0a18(0x9f)](a56_0x47be42[_0x5d0a18(0x11a)](_0x5d0a18(0x150)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x3e2f62[_0x5d0a18(0x247)]?console[_0x5d0a18(0x9f)](a56_0x47be42[_0x5d0a18(0x20a)](_0x5d0a18(0x113)+_0x3e2f62['workflowProject']+_0x5d0a18(0x23c)+_0x3e2f62['workflowProject']+'\x27')):console[_0x5d0a18(0x9f)](a56_0x47be42[_0x5d0a18(0x20a)](_0x5d0a18(0x235))),0x1;throw _0x3896bd;}const _0x1b67ef=_0x257914['data'];console[_0x5d0a18(0x9f)](_0x5d0a18(0x18a)+_0x1b67ef[_0x5d0a18(0x171)]),console[_0x5d0a18(0x9f)]('\x20\x20Source:\x20'+_0x1b67ef[_0x5d0a18(0x23f)]),console[_0x5d0a18(0x9f)](_0x5d0a18(0x241)+_0x1b67ef[_0x5d0a18(0x22c)]),console[_0x5d0a18(0x9f)](_0x5d0a18(0x204)+a56_0x47be42[_0x5d0a18(0x21f)]('+'+_0x1b67ef[_0x5d0a18(0x1a2)][_0x5d0a18(0xfd)]+_0x5d0a18(0x246))+',\x20'+(a56_0x47be42[_0x5d0a18(0x205)]('~'+_0x1b67ef[_0x5d0a18(0x1a2)][_0x5d0a18(0x1ed)]+_0x5d0a18(0x161))+',\x20')+(a56_0x47be42[_0x5d0a18(0x11a)]('-'+_0x1b67ef['summary'][_0x5d0a18(0x154)]+_0x5d0a18(0x17d))+',\x20')+(''+a56_0x47be42[_0x5d0a18(0x20a)](_0x1b67ef['summary'][_0x5d0a18(0x192)]+_0x5d0a18(0x90))));for(const _0x36e9f4 of _0x1b67ef['changes']){_0x36e9f4[_0x5d0a18(0x1aa)]==='modified'&&_0x36e9f4[_0x5d0a18(0xd6)]&&(console[_0x5d0a18(0x9f)]('\x0a'+a56_0x47be42['cyan'](_0x5d0a18(0x152)+_0x36e9f4[_0x5d0a18(0x1b4)])),console[_0x5d0a18(0x9f)](_0x36e9f4[_0x5d0a18(0xd6)]));}if(!_0x1b67ef[_0x5d0a18(0x1b3)])return console['error'](a56_0x47be42[_0x5d0a18(0x21f)](_0x5d0a18(0x1f6))),await this[_0x5d0a18(0x166)](_0x4fb5c9,_0x1b67ef[_0x5d0a18(0x171)],_0x3e2f62[_0x5d0a18(0x194)]),0x0;if(_0x3e2f62[_0x5d0a18(0xfc)])return console['error'](a56_0x47be42[_0x5d0a18(0x205)](_0x5d0a18(0xe5))),0x0;if(!_0x3e2f62['yes']){if(!isInteractive())return console['error'](a56_0x47be42[_0x5d0a18(0x11a)]('\x0aError:'),_0x5d0a18(0xc7)),console['error'](a56_0x47be42['dim'](_0x5d0a18(0x12f))),0x1;const _0x457a3c=await confirmKey(_0x5d0a18(0x10a));if(!_0x457a3c)return console[_0x5d0a18(0x9f)](a56_0x47be42['yellow'](_0x5d0a18(0x80)),_0x5d0a18(0x14f)),0x1;}const _0x256b21=await withSpinner(_0x5d0a18(0xf9),()=>_0x4fb5c9[_0x5d0a18(0x83)][_0x5d0a18(0x198)](_0x1b67ef),{'verbose':_0x3e2f62[_0x5d0a18(0x1b1)]}),_0x340531=_0x256b21[_0x5d0a18(0x207)];return console[_0x5d0a18(0x9f)](a56_0x47be42['green'](_0x5d0a18(0x7d))),console[_0x5d0a18(0x9f)](_0x5d0a18(0x9b)+_0x340531[_0x5d0a18(0x216)]),console[_0x5d0a18(0x9f)]('\x20\x20Revision:\x20'+_0x340531[_0x5d0a18(0x22c)]),await this[_0x5d0a18(0x166)](_0x4fb5c9,_0x340531[_0x5d0a18(0x171)],_0x3e2f62[_0x5d0a18(0x194)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x86);['description']=a56_0x1982d8(0xd3);async[a56_0x1982d8(0x24e)](_0x382e16){const _0x3d6569=a56_0x1982d8,{options:_0x3653fc,args:_0x481aae,tdx:_0x5d6fc8}=_0x382e16,_0x3e4006=this[_0x3d6569(0x1ec)](_0x481aae,_0x3653fc),_0x425c66=_0x3653fc['name'],_0x50fa95=_0x3653fc[_0x3d6569(0x22c)],_0x3354b4=_0x3653fc[_0x3d6569(0x1c3)];if(!_0x3e4006)return console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x11a)](_0x3d6569(0x150)),_0x3d6569(0x157)),console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x20a)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x3d6569(0x9f)](a56_0x47be42['dim'](_0x3d6569(0x112))),0x1;if(!_0x425c66)return console['error'](a56_0x47be42[_0x3d6569(0x11a)](_0x3d6569(0x150)),_0x3d6569(0x12c)),console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x20a)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x3653fc[_0x3d6569(0x1b1)]&&(console[_0x3d6569(0x9f)](_0x3d6569(0x1f0)+_0x3e4006),console['error'](_0x3d6569(0xb2)+_0x425c66),_0x50fa95&&console[_0x3d6569(0x9f)](_0x3d6569(0xfb)+_0x50fa95),_0x3653fc['dryRun']&&console['error'](_0x3d6569(0xbb)),_0x3354b4&&console[_0x3d6569(0x9f)](_0x3d6569(0x13e)));const _0xc4ce4d=await withSpinner(_0x3d6569(0x172),()=>_0x5d6fc8[_0x3d6569(0x83)][_0x3d6569(0x1e1)](_0x3e4006,_0x425c66,{'revision':_0x50fa95,'skipValidation':_0x3354b4}),{'verbose':_0x3653fc[_0x3d6569(0x1b1)]}),_0x15176c=_0xc4ce4d['data'];console['error'](_0x3d6569(0x137)+_0x15176c[_0x3d6569(0x23f)]);_0x15176c['sourceProjectName']&&console['error'](_0x3d6569(0x16d)+_0x15176c['sourceProjectName']);console[_0x3d6569(0x9f)](_0x3d6569(0xb2)+_0x15176c[_0x3d6569(0xb4)]),console[_0x3d6569(0x9f)](_0x3d6569(0xfb)+_0x15176c[_0x3d6569(0x22c)]),console['error'](_0x3d6569(0x19e)+_0x15176c[_0x3d6569(0x89)]);_0x15176c[_0x3d6569(0x1ad)]&&(console[_0x3d6569(0x9f)](a56_0x47be42['yellow'](_0x3d6569(0x8e)+_0x15176c['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x15176c[_0x3d6569(0x106)]+')')),console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x205)](_0x3d6569(0x105))));if(_0x3653fc[_0x3d6569(0xfc)])return console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x205)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x3653fc[_0x3d6569(0xb0)]){if(!isInteractive())return console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x11a)]('\x0aError:'),_0x3d6569(0xc7)),console['error'](a56_0x47be42[_0x3d6569(0x20a)](_0x3d6569(0x12f))),0x1;const _0xc81d0d=_0x15176c[_0x3d6569(0xa6)]||a56_0x27aa68[_0x3d6569(0x1f5)](_0x3e4006),_0x1fb251=_0x15176c[_0x3d6569(0x1ad)]?_0x3d6569(0x19d)+_0x425c66+_0x3d6569(0x21b):_0x3d6569(0x10f)+_0xc81d0d+'\x22\x20to\x20new\x20project\x20\x22'+_0x425c66+'\x22?',_0x13418f=await confirmKey(_0x1fb251);if(!_0x13418f)return console[_0x3d6569(0x9f)](a56_0x47be42['yellow'](_0x3d6569(0x80))),0x1;}const _0x4215e0=await withSpinner(_0x15176c[_0x3d6569(0x1ad)]?_0x3d6569(0x87)+_0x425c66+_0x3d6569(0x1e7):'Cloning\x20to\x20'+_0x425c66+'...',()=>_0x5d6fc8[_0x3d6569(0x83)]['executeCloneProject'](_0x15176c),{'verbose':_0x3653fc[_0x3d6569(0x1b1)]}),_0x580e15=_0x4215e0[_0x3d6569(0x207)];return console[_0x3d6569(0x9f)](a56_0x47be42[_0x3d6569(0x21f)](_0x15176c[_0x3d6569(0x1ad)]?_0x3d6569(0x18d):_0x3d6569(0x1b9))),console[_0x3d6569(0x9f)](_0x3d6569(0x1f8)+_0x580e15['newProjectName']),console[_0x3d6569(0x9f)](_0x3d6569(0x9b)+_0x580e15['newProjectId']),console[_0x3d6569(0x9f)](_0x3d6569(0x241)+_0x580e15[_0x3d6569(0x22c)]),await this[_0x3d6569(0x166)](_0x5d6fc8,_0x580e15[_0x3d6569(0xb4)],_0x3653fc['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']='workflow:delete';['description']=a56_0x1982d8(0x15d);async[a56_0x1982d8(0x24e)](_0x3c2c3e){const _0x328ea3=a56_0x1982d8,{options:_0x15f32d,args:_0x32545c,tdx:_0x328a0c}=_0x3c2c3e,_0x553783=_0x32545c[0x0];if(!_0x553783)return console[_0x328ea3(0x9f)](_0x328ea3(0x19c)),console[_0x328ea3(0x9f)](_0x328ea3(0x125)),0x1;_0x15f32d[_0x328ea3(0x1b1)]&&console['error'](_0x328ea3(0x1ba)+_0x553783);if(!_0x15f32d['yes']){if(!isInteractive())return console[_0x328ea3(0x9f)](a56_0x47be42[_0x328ea3(0x11a)](_0x328ea3(0x249)),_0x328ea3(0xc7)),console['error'](a56_0x47be42[_0x328ea3(0x20a)](_0x328ea3(0x12f))),0x1;const _0x8d915e=await confirmKey(_0x328ea3(0x243)+_0x553783+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x8d915e)return console['error'](a56_0x47be42['yellow']('Cancelled')),0x1;}const _0x94461e=await withSpinner(_0x328ea3(0xce)+_0x553783+'...',()=>_0x328a0c[_0x328ea3(0x83)][_0x328ea3(0x23b)](_0x553783),{'verbose':_0x15f32d[_0x328ea3(0x1b1)]}),_0x1c3817=_0x94461e['data'];return console[_0x328ea3(0x9f)]('✔\x20Deleted\x20project\x20'+_0x1c3817[_0x328ea3(0x171)]),console['error'](_0x328ea3(0x9b)+_0x1c3817['projectId']),0x0;}}export function parseKeyValue(_0x551a54){const _0x48c5d4=a56_0x1982d8,_0x3fff4b=_0x551a54[_0x48c5d4(0x169)]('=');if(_0x3fff4b===-0x1)throw new Error('Invalid\x20format:\x20'+_0x551a54+_0x48c5d4(0x22a));const _0x55afb7=_0x551a54[_0x48c5d4(0x108)](0x0,_0x3fff4b),_0x5afbb2=_0x551a54['substring'](_0x3fff4b+0x1);if(!_0x55afb7)throw new Error(_0x48c5d4(0x228));return{'key':_0x55afb7,'value':_0x5afbb2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x151);[a56_0x1982d8(0x14b)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a56_0x1982d8(0x24e)](_0x1e183a){const _0x142f86=a56_0x1982d8,{options:_0x23c686,args:_0xda0300,tdx:_0x52fe42}=_0x1e183a,_0x19b36e=this['requireProject'](_0xda0300,_0x23c686);if(!_0x19b36e)return 0x1;_0x23c686[_0x142f86(0x1b1)]&&console[_0x142f86(0x9f)](_0x142f86(0x1ba)+_0x19b36e);const _0xdfdbdc=await withSpinner('Listing\x20secrets...',()=>_0x52fe42[_0x142f86(0x83)][_0x142f86(0x1f9)](_0x19b36e),{'verbose':_0x23c686[_0x142f86(0x1b1)]}),{secrets:_0x4c6d5b}=_0xdfdbdc[_0x142f86(0x207)];return console[_0x142f86(0x9f)](_0x142f86(0x1a1)+_0x4c6d5b[_0x142f86(0x140)]+_0x142f86(0x155)+(_0x4c6d5b[_0x142f86(0x140)]!==0x1?'s':'')),await handleSDKOutput(_0x4c6d5b,_0x23c686),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']='workflow:secrets:set';[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x136);async[a56_0x1982d8(0x24e)](_0x369e96){const _0x39f666=a56_0x1982d8,{options:_0x2733e5,args:_0xd5ca25,tdx:_0x517e83}=_0x369e96;let _0xc9aa79,_0x138a30;if(_0xd5ca25[_0x39f666(0x140)]>=0x1&&!_0xd5ca25[0x0]['includes']('='))_0xc9aa79=_0xd5ca25[0x0],_0x138a30=_0xd5ca25['slice'](0x1);else{if(_0xd5ca25[_0x39f666(0x140)]>=0x1&&_0x2733e5['workflowProject'])_0xc9aa79=_0x2733e5['workflowProject'],_0x138a30=_0xd5ca25;else return _0xd5ca25[_0x39f666(0x140)]>=0x1?(console['error'](_0x39f666(0xa9)),console[_0x39f666(0x9f)](_0x39f666(0x1be)),0x1):(console[_0x39f666(0x9f)](_0x39f666(0xa3)),console[_0x39f666(0x9f)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x138a30[_0x39f666(0x140)]===0x0)return console[_0x39f666(0x9f)](_0x39f666(0xa3)),console['error'](_0x39f666(0x8a)),0x1;const _0x14b208={};try{for(const _0x4b6717 of _0x138a30){const {key:_0x26f3e2,value:_0x14191a}=parseKeyValue(_0x4b6717);_0x14b208[_0x26f3e2]=_0x14191a;}}catch(_0x406ac0){return _0x406ac0 instanceof Error&&console[_0x39f666(0x9f)](a56_0x47be42['red'](_0x39f666(0x150)),_0x406ac0[_0x39f666(0x208)]),0x1;}const _0x34c525=Object['keys'](_0x14b208);_0x2733e5[_0x39f666(0x1b1)]&&(console['error']('Project:\x20'+_0xc9aa79),console['error']('Secrets\x20to\x20set:\x20'+_0x34c525[_0x39f666(0x227)](',\x20')));const _0x3aa313=await withSpinner(_0x34c525['length']===0x1?'Setting\x20secret...':_0x39f666(0x17c)+_0x34c525['length']+_0x39f666(0x119),()=>_0x517e83[_0x39f666(0x83)][_0x39f666(0x145)](_0xc9aa79,_0x14b208),{'verbose':_0x2733e5[_0x39f666(0x1b1)]}),_0x4ae082=_0x3aa313[_0x39f666(0x207)];return console['error'](_0x34c525[_0x39f666(0x140)]===0x1?_0x39f666(0x8f)+_0x4ae082[_0x39f666(0x1ca)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x4ae082[_0x39f666(0x171)]+'\x27':'✔\x20'+_0x4ae082[_0x39f666(0x1ca)][_0x39f666(0x140)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x4ae082['projectName']+'\x27'),(_0x2733e5['json']||_0x2733e5[_0x39f666(0x1c8)])&&await handleSingleObjectOutput(_0x4ae082,_0x2733e5),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a56_0x1982d8(0x1bb);[a56_0x1982d8(0x14b)]=a56_0x1982d8(0x214);async['execute'](_0x15ad5b){const _0x481e74=a56_0x1982d8,{options:_0x2c1376,args:_0x22a6b1,tdx:_0x470845}=_0x15ad5b;let _0x4387fd,_0x238679;if(_0x22a6b1[_0x481e74(0x140)]>=0x2)_0x4387fd=_0x22a6b1[0x0],_0x238679=_0x22a6b1[0x1];else{if(_0x22a6b1[_0x481e74(0x140)]===0x1&&_0x2c1376['workflowProject'])_0x4387fd=_0x2c1376['workflowProject'],_0x238679=_0x22a6b1[0x0];else return _0x22a6b1[_0x481e74(0x140)]===0x1?(console['error'](_0x481e74(0xa9)),console[_0x481e74(0x9f)](_0x481e74(0x1be)),0x1):(console[_0x481e74(0x9f)](_0x481e74(0xc1)),console[_0x481e74(0x9f)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x2c1376[_0x481e74(0x1b1)]&&(console[_0x481e74(0x9f)](_0x481e74(0x1ba)+_0x4387fd),console[_0x481e74(0x9f)]('Key:\x20'+_0x238679));if(!_0x2c1376[_0x481e74(0xb0)]){if(!isInteractive())return console['error'](a56_0x47be42[_0x481e74(0x11a)](_0x481e74(0x249)),_0x481e74(0xc7)),console[_0x481e74(0x9f)](a56_0x47be42['dim'](_0x481e74(0x12f))),0x1;const _0x1c742b=await confirmKey(_0x481e74(0x107)+_0x238679+_0x481e74(0xb7)+_0x4387fd+'\x27?');if(!_0x1c742b)return console[_0x481e74(0x9f)](a56_0x47be42[_0x481e74(0x205)](_0x481e74(0x80))),0x1;}const _0xc560b6=await withSpinner(_0x481e74(0x17b),()=>_0x470845[_0x481e74(0x83)][_0x481e74(0x143)](_0x4387fd,_0x238679),{'verbose':_0x2c1376[_0x481e74(0x1b1)]}),_0x461fec=_0xc560b6[_0x481e74(0x207)];return console['error']('✔\x20Secret\x20\x27'+_0x461fec['key']+_0x481e74(0x1d7)+_0x461fec[_0x481e74(0x171)]+'\x27'),(_0x2c1376[_0x481e74(0x8c)]||_0x2c1376[_0x481e74(0x1c8)])&&await handleSingleObjectOutput(_0x461fec,_0x2c1376),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(_0x4d2ca3){const _0x1b03af=a56_0x1982d8,_0x33a8a9=Math[_0x1b03af(0x10e)](_0x4d2ca3/0x3e8),_0x28b13e=Math['floor'](_0x33a8a9/0x3c),_0x511d3f=Math[_0x1b03af(0x10e)](_0x28b13e/0x3c),_0x2e584b=Math[_0x1b03af(0x10e)](_0x511d3f/0x18);if(_0x2e584b>0x0){const _0x132395=_0x511d3f%0x18;return _0x132395>0x0?_0x2e584b+'d\x20'+_0x132395+'h':_0x2e584b+'d';}else{if(_0x511d3f>0x0){const _0x26a318=_0x28b13e%0x3c;return _0x26a318>0x0?_0x511d3f+'h\x20'+_0x26a318+'m':_0x511d3f+'h';}else{if(_0x28b13e>0x0){const _0x341ae9=_0x33a8a9%0x3c;return _0x341ae9>0x0?_0x28b13e+'m\x20'+_0x341ae9+'s':_0x28b13e+'m';}else return _0x33a8a9+'s';}}}function formatTimestamp(_0x55d670,_0xee70b7){const _0x5ddd2c=a56_0x1982d8,_0x52b67d=new Date(_0x55d670),_0x4e1864=String(_0x52b67d[_0x5ddd2c(0x156)]())[_0x5ddd2c(0x1c7)](0x2,'0'),_0x283d50=String(_0x52b67d[_0x5ddd2c(0xf5)]())[_0x5ddd2c(0x1c7)](0x2,'0'),_0x30ba7d=_0x4e1864+':'+_0x283d50,_0x77fcc=_0x52b67d[_0x5ddd2c(0x8d)]()===_0xee70b7[_0x5ddd2c(0x8d)]()&&_0x52b67d[_0x5ddd2c(0xfe)]()===_0xee70b7['getMonth']()&&_0x52b67d[_0x5ddd2c(0x18b)]()===_0xee70b7[_0x5ddd2c(0x18b)]();if(_0x77fcc)return _0x30ba7d;else{const _0x18ed30=String(_0x52b67d['getMonth']()+0x1)[_0x5ddd2c(0x1c7)](0x2,'0'),_0x501691=String(_0x52b67d['getDate']())[_0x5ddd2c(0x1c7)](0x2,'0');return _0x18ed30+'-'+_0x501691+'\x20'+_0x30ba7d;}}function formatDate(_0x1b794e){const _0x1a0f9e=a56_0x1982d8,_0x50ed60=_0x1b794e[_0x1a0f9e(0x8d)](),_0x304da5=String(_0x1b794e['getMonth']()+0x1)[_0x1a0f9e(0x1c7)](0x2,'0'),_0x52466c=String(_0x1b794e[_0x1a0f9e(0x18b)]())[_0x1a0f9e(0x1c7)](0x2,'0');return _0x50ed60+'-'+_0x304da5+'-'+_0x52466c;}function getTaskStateIcon(_0x24a1e9){const _0xb304af={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0xb304af[_0x24a1e9]||'⚪';}function getBarChar(_0x21a990){const _0x57b452=a56_0x1982d8;return _0x21a990===_0x57b452(0x9f)||_0x21a990===_0x57b452(0x109)?'×':'─';}function getBarColor(_0x906861){const _0xeff461=a56_0x1982d8,_0x355704={'success':a56_0x47be42[_0xeff461(0x21f)],'error':a56_0x47be42['red'],'group_error':a56_0x47be42[_0xeff461(0x11a)],'running':a56_0x47be42['blue'],'blocked':a56_0x47be42[_0xeff461(0x205)],'planned':a56_0x47be42[_0xeff461(0x20a)],'canceling':a56_0x47be42[_0xeff461(0x205)]};return _0x355704[_0x906861]||a56_0x47be42[_0xeff461(0x1fc)];}function parseTaskName(_0x63ea6c){const _0x240cf6=a56_0x1982d8;let _0x42e127=_0x63ea6c[_0x240cf6(0xe4)](/^\++/,'');const _0x7a705a=_0x42e127[_0x240cf6(0x19b)]('+'),_0x3b8224=_0x7a705a[_0x240cf6(0x140)]>0x1?_0x7a705a[_0x240cf6(0x140)]-0x2:0x0,_0x42836f=_0x7a705a[_0x7a705a['length']-0x1]||_0x42e127;return{'level':_0x3b8224,'name':'+'+_0x42836f};}function truncateTaskName(_0x5a261e,_0x7283f5){const _0x5adeee=a56_0x1982d8,_0x358cfa=stringWidth(_0x5a261e);if(_0x358cfa<=_0x7283f5)return _0x5a261e;let _0x6378c9=_0x5a261e;while(stringWidth(_0x6378c9+'…')>_0x7283f5&&_0x6378c9['length']>0x0){_0x6378c9=_0x6378c9[_0x5adeee(0x141)](0x0,-0x1);}return _0x6378c9+'…';}function calculateTimeScale(_0x533ad7,_0x58181a){const _0x1064fd=a56_0x1982d8;return{'startTime':_0x533ad7[_0x1064fd(0x181)],'endTime':_0x533ad7['end'],'durationMs':_0x533ad7[_0x1064fd(0x191)],'msPerChar':_0x533ad7[_0x1064fd(0x191)]/_0x58181a};}function timeToPosition(_0x129d7a,_0x7ff154,_0x1076e8){const _0x5c9388=a56_0x1982d8,_0x4da5a1=_0x129d7a-_0x7ff154['startTime'],_0x1d604b=Math[_0x5c9388(0x10e)](_0x4da5a1/_0x7ff154[_0x5c9388(0xee)]);return Math[_0x5c9388(0x1d4)](0x0,Math['min'](_0x1d604b,_0x1076e8));}function renderTimeAxis(_0x24fe4e,_0x2321d7){const _0x26c236=a56_0x1982d8,_0x2da336=Math['min'](TIMELINE_CONFIG[_0x26c236(0x1b6)],Math[_0x26c236(0x1d4)](TIMELINE_CONFIG[_0x26c236(0x24c)],Math['floor'](_0x2321d7/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x5f154a=_0x24fe4e[_0x26c236(0x186)]/(_0x2da336-0x1),_0x41ac27=new Date(_0x24fe4e[_0x26c236(0x1ae)]),_0x400ed2=[];for(let _0x420a1b=0x0;_0x420a1b<_0x2da336;_0x420a1b++){const _0x5e5cc9=_0x24fe4e[_0x26c236(0x1ae)]+_0x420a1b*_0x5f154a,_0x3b4c6b=timeToPosition(_0x5e5cc9,_0x24fe4e,_0x2321d7),_0xe69b27=formatTimestamp(_0x5e5cc9,_0x41ac27);_0x400ed2[_0x26c236(0x215)]({'pos':_0x3b4c6b,'text':_0xe69b27});}const _0xc765dd=new Array(_0x2321d7)[_0x26c236(0xbc)]('\x20');let _0x3a4469=-0x1;for(const {pos:_0x2d81d4,text:_0x14f09a}of _0x400ed2){let _0x581b9e=Math['max'](0x0,_0x2d81d4-Math[_0x26c236(0x10e)](_0x14f09a[_0x26c236(0x140)]/0x2));_0x581b9e<=_0x3a4469+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x581b9e=_0x3a4469+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x581b9e+_0x14f09a[_0x26c236(0x140)]>_0x2321d7&&(_0x581b9e=_0x2321d7-_0x14f09a['length']);if(_0x581b9e>=0x0&&_0x581b9e+_0x14f09a[_0x26c236(0x140)]<=_0x2321d7&&_0x581b9e>_0x3a4469){for(let _0x45d6cd=0x0;_0x45d6cd<_0x14f09a[_0x26c236(0x140)];_0x45d6cd++){_0xc765dd[_0x581b9e+_0x45d6cd]=_0x14f09a[_0x45d6cd];}_0x3a4469=_0x581b9e+_0x14f09a[_0x26c236(0x140)]-0x1;}}return _0xc765dd[_0x26c236(0x227)]('');}function renderTaskRow(_0xe490b5,_0x3216b7,_0x2df9bd,_0x5bedb9){const _0x57cb44=a56_0x1982d8,{level:_0xd9321f,name:_0x264ad8}=parseTaskName(_0xe490b5[_0x57cb44(0x11f)]),_0x53c062='\x20'[_0x57cb44(0xa1)](_0xd9321f),_0x1c0fe1=_0xe490b5[_0x57cb44(0x126)]?'('+formatElapsed(_0xe490b5[_0x57cb44(0x126)][_0x57cb44(0x191)])+')':'',_0x33c482=stringWidth(_0x1c0fe1),_0x3a6567=_0xd9321f*0x1,_0x9d668=_0x5bedb9-_0x3a6567-_0x33c482-0x1,_0x11647b=truncateTaskName(_0x264ad8,_0x9d668),_0x21fc10=_0x53c062+_0x11647b,_0x5e0876=stringWidth(_0x21fc10),_0x31dd18=_0x5bedb9-_0x5e0876-_0x33c482,_0x24c3e1=_0x21fc10+'\x20'['repeat'](Math['max'](0x1,_0x31dd18))+a56_0x47be42['dim'](_0x1c0fe1),_0x5ea0f3=getTaskStateIcon(_0xe490b5[_0x57cb44(0x7e)]),_0x825e2f=new Array(_0x2df9bd)[_0x57cb44(0xbc)]('\x20');if(_0xe490b5[_0x57cb44(0x126)]){const _0xe002e4=timeToPosition(_0xe490b5[_0x57cb44(0x126)][_0x57cb44(0x181)],_0x3216b7,_0x2df9bd),_0x20ce04=timeToPosition(_0xe490b5['window'][_0x57cb44(0x147)],_0x3216b7,_0x2df9bd),_0x238e34=getBarChar(_0xe490b5['state']),_0x412b80=Math['max'](_0xe002e4+0x1,_0x20ce04);for(let _0xcd37ab=_0xe002e4;_0xcd37ab<Math[_0x57cb44(0xcc)](_0x412b80,_0x2df9bd);_0xcd37ab++){_0x825e2f[_0xcd37ab]=_0x238e34;}}const _0x56143f=getBarColor(_0xe490b5['state']),_0x55d634=_0x825e2f['map'](_0x576907=>_0x576907==='\x20'?'\x20':_0x56143f(_0x576907))[_0x57cb44(0x227)]('');return _0x5ea0f3+'\x20'+_0x24c3e1+'│'+_0x55d634+'│';}function calculateStats(_0x2e8e7a){const _0x3508c4=a56_0x1982d8,_0x4d8908={'total':_0x2e8e7a[_0x3508c4(0x140)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x233a27 of _0x2e8e7a){if(_0x233a27[_0x3508c4(0x7e)]===_0x3508c4(0x193))_0x4d8908['success']++;else{if(_0x233a27[_0x3508c4(0x7e)]===_0x3508c4(0x9f)||_0x233a27[_0x3508c4(0x7e)]===_0x3508c4(0x109))_0x4d8908[_0x3508c4(0x9f)]++;else _0x233a27['state']===_0x3508c4(0xc0)?_0x4d8908['running']++:_0x4d8908[_0x3508c4(0xa0)]++;}}return _0x4d8908;}function formatStats(_0x3f45aa){const _0x1be9a6=a56_0x1982d8;return[_0x1be9a6(0x182)+_0x3f45aa[_0x1be9a6(0x93)],'✅\x20'+_0x3f45aa['success'],'❌\x20'+_0x3f45aa[_0x1be9a6(0x9f)],_0x1be9a6(0xcd)+_0x3f45aa[_0x1be9a6(0xc0)],'⏳\x20'+_0x3f45aa[_0x1be9a6(0xa0)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]='workflow:timeline';['description']=a56_0x1982d8(0x22f);async['execute'](_0x39c7bf){const _0x4b2bd3=a56_0x1982d8,{options:_0x48305a,args:_0x147dc0,tdx:_0x5f522f}=_0x39c7bf;let _0x1ee80a,_0x14dd3e,_0x3f2802=![];if(_0x147dc0[0x0]){if(_0x147dc0[0x0][_0x4b2bd3(0x10b)]('.')){const _0x1e4221=this[_0x4b2bd3(0x144)](_0x147dc0,_0x48305a);if(!_0x1e4221)return 0x1;_0x1ee80a=_0x1e4221[_0x4b2bd3(0x171)],_0x14dd3e=_0x1e4221[_0x4b2bd3(0xd1)];}else{_0x14dd3e=_0x147dc0[0x0],_0x1ee80a=_0x48305a[_0x4b2bd3(0x247)];if(!_0x1ee80a)return console[_0x4b2bd3(0x9f)](a56_0x47be42[_0x4b2bd3(0x11a)]('Error:'),_0x4b2bd3(0x1e2)),0x1;_0x3f2802=!![];}}else{const _0x4eea13=this[_0x4b2bd3(0x144)](_0x147dc0,_0x48305a);if(!_0x4eea13)return 0x1;_0x1ee80a=_0x4eea13[_0x4b2bd3(0x171)],_0x14dd3e=_0x4eea13['workflowName'];}if(_0x48305a[_0x4b2bd3(0x1b1)]){if(_0x1ee80a&&_0x14dd3e)console[_0x4b2bd3(0x9f)](_0x4b2bd3(0x1ff)+_0x1ee80a+'.'+_0x14dd3e);else _0x1ee80a&&console[_0x4b2bd3(0x9f)]('Filter:\x20project='+_0x1ee80a);}const _0x550b4c=_0x48305a[_0x4b2bd3(0x138)],_0x2d193a=_0x48305a[_0x4b2bd3(0x1df)];if(_0x550b4c){_0x2d193a&&console[_0x4b2bd3(0x9f)](a56_0x47be42[_0x4b2bd3(0x205)](_0x4b2bd3(0x20d)),_0x4b2bd3(0x14d));const _0x181668=_0x48305a[_0x4b2bd3(0x132)];return _0x181668?await this[_0x4b2bd3(0x223)](_0x39c7bf,_0x550b4c):await this[_0x4b2bd3(0x100)](_0x39c7bf,_0x550b4c,_0x48305a),0x0;}if(_0x2d193a){const _0x400fc6=await withSpinner(_0x4b2bd3(0xea),()=>_0x5f522f[_0x4b2bd3(0x83)][_0x4b2bd3(0xc6)]({'projectName':_0x1ee80a,'workflowName':_0x14dd3e,'limit':0x64}),{'verbose':_0x48305a[_0x4b2bd3(0x1b1)]}),_0x46bd25=_0x400fc6['data']['find'](_0x85a3f9=>_0x85a3f9['id']===_0x2d193a);if(!_0x46bd25)return console[_0x4b2bd3(0x9f)](a56_0x47be42[_0x4b2bd3(0x11a)](_0x4b2bd3(0x150)),_0x4b2bd3(0x84)+_0x2d193a),0x1;if(!_0x46bd25[_0x4b2bd3(0x240)]?.['id'])return console[_0x4b2bd3(0x9f)](a56_0x47be42[_0x4b2bd3(0x11a)](_0x4b2bd3(0x150)),'Session\x20'+_0x2d193a+_0x4b2bd3(0x22b)),0x1;const _0xeea610=_0x46bd25[_0x4b2bd3(0x240)]['id'];_0x48305a[_0x4b2bd3(0x1b1)]&&console['error']('Using\x20attempt\x20'+_0xeea610+_0x4b2bd3(0xa2)+_0x2d193a);const _0x56935f=_0x48305a[_0x4b2bd3(0x132)];return _0x56935f?await this['pollTimeline'](_0x39c7bf,_0xeea610):await this[_0x4b2bd3(0x100)](_0x39c7bf,_0xeea610,_0x48305a),0x0;}const _0x2b9c9c=await withSpinner('Loading\x20sessions...',()=>_0x5f522f[_0x4b2bd3(0x83)][_0x4b2bd3(0xc6)]({'projectName':_0x1ee80a,'workflowName':_0x14dd3e,'limit':_0x48305a[_0x4b2bd3(0x226)]||0x32}),{'verbose':_0x48305a[_0x4b2bd3(0x1b1)]}),_0x28c48=_0x2b9c9c[_0x4b2bd3(0x207)];if(_0x28c48[_0x4b2bd3(0x140)]===0x0){if(_0x1ee80a&&_0x14dd3e)console[_0x4b2bd3(0x9f)](_0x4b2bd3(0x251)+_0x1ee80a+'.'+_0x14dd3e);else _0x1ee80a?console['error'](_0x4b2bd3(0xf1)+_0x1ee80a):(console[_0x4b2bd3(0x9f)]('No\x20workflow\x20sessions\x20found'),console['error'](a56_0x47be42[_0x4b2bd3(0x20a)](_0x4b2bd3(0x210))));return 0x0;}_0x28c48[_0x4b2bd3(0x1ac)]((_0x44d846,_0x282866)=>{const _0x330bb0=_0x4b2bd3,_0x394218=_0x44d846[_0x330bb0(0x1fa)]||'',_0x18e884=_0x282866[_0x330bb0(0x1fa)]||'';return _0x18e884[_0x330bb0(0x16e)](_0x394218);});if(_0x48305a[_0x4b2bd3(0x8c)]||_0x48305a[_0x4b2bd3(0x1c8)])return await handleSDKOutput(_0x28c48,_0x48305a),0x0;let _0x172f85;if(_0x3f2802){const _0x1db600=_0x28c48[0x0];if(!_0x1db600[_0x4b2bd3(0x240)]?.['id'])return console[_0x4b2bd3(0x9f)](_0x4b2bd3(0x110)),0x0;_0x172f85=_0x1db600[_0x4b2bd3(0x240)]['id'],_0x48305a[_0x4b2bd3(0x1b1)]&&console[_0x4b2bd3(0x9f)](_0x4b2bd3(0x15b)+_0x1db600['sessionTime']);}else{const _0x689cc6=_0x28c48[_0x4b2bd3(0x7f)](_0x408ea1=>{const _0x53ad79=_0x4b2bd3,_0x5e78f9=getAttemptStatusDisplay(_0x408ea1[_0x53ad79(0x240)]);return{'title':_0x408ea1[_0x53ad79(0xd4)]?.[_0x53ad79(0x11f)]+'.'+_0x408ea1['workflow']?.[_0x53ad79(0x11f)]+_0x53ad79(0x179)+_0x408ea1['sessionTime']+'\x20'+_0x5e78f9[_0x53ad79(0x1f7)],'value':_0x408ea1['lastAttempt']?.['id']||'','description':_0x5e78f9[_0x53ad79(0xbe)]};}),_0x3e5ce5=await a56_0x23600a({'type':_0x4b2bd3(0x1b7),'name':'attemptId','message':_0x4b2bd3(0x97),'choices':_0x689cc6[_0x4b2bd3(0x103)](_0x4f5119=>_0x4f5119[_0x4b2bd3(0xb9)]!=='')});if(!_0x3e5ce5[_0x4b2bd3(0x138)])return 0x0;_0x172f85=_0x3e5ce5[_0x4b2bd3(0x138)];}const _0x3a4186=_0x48305a['follow'];return _0x3a4186?await this[_0x4b2bd3(0x223)](_0x39c7bf,_0x172f85):await this[_0x4b2bd3(0x100)](_0x39c7bf,_0x172f85,_0x48305a),0x0;}async['renderSingleTimeline'](_0x55cca9,_0x4354c0,_0x1e8008){const _0x51f79a=a56_0x1982d8,{tdx:_0x126428}=_0x55cca9;let _0x32f1b9,_0x548d8c;try{[_0x32f1b9,_0x548d8c]=await Promise[_0x51f79a(0x120)]([_0x126428[_0x51f79a(0x83)][_0x51f79a(0x20f)](_0x4354c0),_0x126428[_0x51f79a(0x83)]['tasks'](_0x4354c0,![])]);}catch(_0x244ee9){console[_0x51f79a(0x9f)](a56_0x47be42[_0x51f79a(0x11a)](_0x51f79a(0x24f)));_0x1e8008[_0x51f79a(0x1b1)]&&console[_0x51f79a(0x9f)](_0x244ee9);throw _0x244ee9;}if(_0x1e8008[_0x51f79a(0x8c)]||_0x1e8008[_0x51f79a(0x1c8)]){const _0x1c975e=this[_0x51f79a(0x183)](_0x32f1b9,_0x548d8c);await handleSDKOutput([_0x1c975e],_0x1e8008);return;}const _0x195bd5=_0x126428[_0x51f79a(0xe7)][_0x51f79a(0x194)],_0x29d831=this['renderTimeline'](_0x32f1b9,_0x548d8c,_0x195bd5);console['log'](_0x29d831);}async[a56_0x1982d8(0x223)](_0x3eb068,_0x1ffa4d){const _0xe9093f=a56_0x1982d8,{tdx:_0x4f8b80}=_0x3eb068,_0x999de4=TIMELINE_CONFIG[_0xe9093f(0xcb)],_0x3ce73c=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x29cf84=0x0;while(_0x29cf84<_0x3ce73c){process['stdout'][_0xe9093f(0x203)]&&process[_0xe9093f(0x1e5)]['write']('\x1Bc');let _0x83ee7e,_0x2523b9;try{[_0x83ee7e,_0x2523b9]=await Promise[_0xe9093f(0x120)]([_0x4f8b80[_0xe9093f(0x83)][_0xe9093f(0x20f)](_0x1ffa4d),_0x4f8b80['workflow']['tasks'](_0x1ffa4d,![])]);}catch(_0x289a9e){console['error'](a56_0x47be42[_0xe9093f(0x11a)](_0xe9093f(0x130)));_0x29cf84>0x0&&console['error'](a56_0x47be42['dim'](_0xe9093f(0x1ea)+_0x29cf84));throw _0x289a9e;}const _0x1a7829=_0x4f8b80[_0xe9093f(0xe7)][_0xe9093f(0x194)],_0xdb5120=this[_0xe9093f(0xba)](_0x83ee7e,_0x2523b9,_0x1a7829);console[_0xe9093f(0xe1)](_0xdb5120);const _0x520c45=_0x83ee7e[_0xe9093f(0x174)]&&_0x2523b9[_0xe9093f(0x8b)](_0x24ec02=>_0x24ec02[_0xe9093f(0x7e)]!=='running'&&_0x24ec02[_0xe9093f(0x7e)]!==_0xe9093f(0xb3));if(_0x520c45){console[_0xe9093f(0x9f)](a56_0x47be42[_0xe9093f(0x21f)](_0xe9093f(0xd5)));break;}console[_0xe9093f(0x9f)](a56_0x47be42[_0xe9093f(0x20a)](_0xe9093f(0xaa)+_0x29cf84*0x2+_0xe9093f(0x21e))),await new Promise(_0x48ab7=>setTimeout(_0x48ab7,_0x999de4)),_0x29cf84++;}_0x29cf84>=_0x3ce73c&&console[_0xe9093f(0x9f)](a56_0x47be42[_0xe9093f(0x205)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a56_0x1982d8(0xba)](_0x57acf4,_0x48e449,_0x1c79c6){const _0x21a876=a56_0x1982d8,_0x50a8d1=[],_0x30a0fd=TIMELINE_CONFIG[_0x21a876(0x244)],_0x1767a8=0x5,_0x57a3cc=process[_0x21a876(0x1e5)][_0x21a876(0xb6)]||0x78,_0xd7b042=_0x57a3cc-_0x30a0fd-_0x1767a8,_0x3b6e5f=Math[_0x21a876(0x1d4)](TIMELINE_CONFIG[_0x21a876(0x219)],Math[_0x21a876(0xcc)](_0xd7b042,TIMELINE_CONFIG[_0x21a876(0x1dc)])),_0x492dfb=new Date(_0x57acf4['createdAt'])[_0x21a876(0x233)](),_0x1ab02b=_0x57acf4[_0x21a876(0x189)]?new Date(_0x57acf4['finishedAt'])[_0x21a876(0x233)]():Date[_0x21a876(0x175)](),_0x270831={'start':_0x492dfb,'end':_0x1ab02b,'duration':_0x1ab02b-_0x492dfb},_0x3266c7=new Map(),_0x58f756=[];for(const _0x23a553 of _0x48e449){if(_0x23a553[_0x21a876(0xd2)]){const _0x48a4d5=new Date(_0x23a553['startedAt'])[_0x21a876(0x233)](),_0x10dbb9=_0x23a553[_0x21a876(0x17e)]?new Date(_0x23a553[_0x21a876(0x17e)])['getTime']():Date['now'](),_0x22f6c5={'start':_0x48a4d5,'end':_0x10dbb9,'duration':_0x10dbb9-_0x48a4d5};_0x3266c7[_0x21a876(0x197)](_0x23a553['id'],_0x22f6c5),_0x58f756[_0x21a876(0x215)]({'name':_0x23a553[_0x21a876(0x21a)],'state':_0x23a553[_0x21a876(0x7e)]||_0x21a876(0x180),'window':_0x22f6c5});}else _0x58f756[_0x21a876(0x215)]({'name':_0x23a553[_0x21a876(0x21a)],'state':_0x23a553[_0x21a876(0x7e)]||'planned','window':undefined});}_0x58f756[_0x21a876(0x1ac)]((_0x508756,_0x5bdf25)=>{const _0x3bbd4e=_0x21a876;if(!_0x508756[_0x3bbd4e(0x126)])return 0x1;if(!_0x5bdf25[_0x3bbd4e(0x126)])return-0x1;return _0x508756[_0x3bbd4e(0x126)]['start']-_0x5bdf25[_0x3bbd4e(0x126)][_0x3bbd4e(0x181)];});const _0x391b68=_0x58f756[_0x21a876(0x140)],_0x187398=_0x391b68>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x187398&&_0x58f756[_0x21a876(0x1b5)](TIMELINE_CONFIG[_0x21a876(0xe6)]);const _0x26d763=calculateTimeScale(_0x270831,_0x3b6e5f),_0xb44de6=_0x57acf4[_0x21a876(0x174)]?_0x57acf4[_0x21a876(0x193)]?a56_0x47be42[_0x21a876(0x21f)](_0x21a876(0x193)):a56_0x47be42['red'](_0x21a876(0x9f)):a56_0x47be42['blue'](_0x21a876(0xc0)),_0xc38945=_0x57acf4['project']?.['id'],_0x182384=_0x57acf4['sessionId'];let _0x4f1332;if(_0xc38945&&_0x182384){const _0x3d4003=getWorkflowAttemptUrl(_0x1c79c6,_0xc38945,_0x182384,_0x57acf4['id']);_0x4f1332=hyperlink(a56_0x47be42[_0x21a876(0x20a)](_0x57acf4['id']),_0x3d4003);}else _0x4f1332=a56_0x47be42[_0x21a876(0x20a)](_0x57acf4['id']);_0x50a8d1['push'](_0x21a876(0x1ce)+_0x4f1332+'\x20-\x20'+_0xb44de6+_0x21a876(0x179)+formatElapsed(_0x270831['duration']));if(_0x58f756[_0x21a876(0x140)]>0x0){const _0x1f2fd8=renderTimeAxis(_0x26d763,_0x3b6e5f),_0x1377a7=new Date(_0x270831[_0x21a876(0x181)]),_0x33f09b=formatDate(_0x1377a7),_0x364c8d=TIMELINE_CONFIG[_0x21a876(0xdb)]+TIMELINE_CONFIG[_0x21a876(0xfa)]+_0x30a0fd,_0x73a702=_0x33f09b[_0x21a876(0x1c7)](_0x364c8d),_0x19cbc7=a56_0x47be42[_0x21a876(0x20a)](_0x73a702);_0x50a8d1[_0x21a876(0x215)](_0x19cbc7+'\x20'+_0x1f2fd8);for(const _0x29dcc5 of _0x58f756){_0x50a8d1['push'](renderTaskRow(_0x29dcc5,_0x26d763,_0x3b6e5f,_0x30a0fd));}const _0x81bef0=calculateStats(_0x58f756);_0x50a8d1[_0x21a876(0x215)](formatStats(_0x81bef0)),_0x187398&&_0x50a8d1[_0x21a876(0x215)](a56_0x47be42['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x21a876(0x1c9)+_0x391b68+_0x21a876(0x17f))),_0x50a8d1[_0x21a876(0x215)](''),_0x50a8d1[_0x21a876(0x215)](a56_0x47be42['dim'](_0x21a876(0xf3))+(_0x21a876(0x133)+_0x57acf4['id']+'\x20logs')+a56_0x47be42['dim'](_0x21a876(0x1ef)));}else _0x50a8d1['push'](_0x21a876(0xdc));return _0x50a8d1[_0x21a876(0x227)]('\x0a');}[a56_0x1982d8(0x183)](_0x1636e8,_0x2d7279){const _0x27d36b=a56_0x1982d8,_0x474bd1=new Date(_0x1636e8[_0x27d36b(0xd9)])[_0x27d36b(0x233)](),_0x25c1f0=_0x1636e8[_0x27d36b(0x189)]?new Date(_0x1636e8['finishedAt'])[_0x27d36b(0x233)]():Date['now'](),_0x4068a6=_0x25c1f0-_0x474bd1,_0x22d4ca=[];for(const _0x5eebd3 of _0x2d7279){if(_0x5eebd3['startedAt']){const _0x1d9565=new Date(_0x5eebd3['startedAt'])[_0x27d36b(0x233)](),_0x3cd0d1=_0x5eebd3[_0x27d36b(0x17e)]?new Date(_0x5eebd3[_0x27d36b(0x17e)])[_0x27d36b(0x233)]():Date[_0x27d36b(0x175)]();_0x22d4ca['push']({'name':_0x5eebd3[_0x27d36b(0x21a)],'state':_0x5eebd3[_0x27d36b(0x7e)]||_0x27d36b(0x180),'window':{'start':_0x1d9565,'end':_0x3cd0d1,'duration':_0x3cd0d1-_0x1d9565}});}else _0x22d4ca[_0x27d36b(0x215)]({'name':_0x5eebd3[_0x27d36b(0x21a)],'state':_0x5eebd3[_0x27d36b(0x7e)]||_0x27d36b(0xb3),'window':undefined});}const _0x14ad60=calculateStats(_0x22d4ca);return{'attempt':{'id':_0x1636e8['id'],'status':_0x1636e8[_0x27d36b(0x174)]?_0x1636e8[_0x27d36b(0x193)]?_0x27d36b(0x193):'error':_0x27d36b(0xc0),'createdAt':_0x1636e8[_0x27d36b(0xd9)],'finishedAt':_0x1636e8['finishedAt'],'duration_ms':_0x4068a6},'tasks':_0x22d4ca[_0x27d36b(0x7f)](_0x350a9d=>({'name':_0x350a9d[_0x27d36b(0x11f)],'state':_0x350a9d[_0x27d36b(0x7e)],'startedAt':_0x350a9d[_0x27d36b(0x126)]?new Date(_0x350a9d[_0x27d36b(0x126)]['start'])[_0x27d36b(0x1d0)]():null,'updatedAt':_0x350a9d['window']?new Date(_0x350a9d[_0x27d36b(0x126)][_0x27d36b(0x147)])[_0x27d36b(0x1d0)]():null,'duration_ms':_0x350a9d[_0x27d36b(0x126)]?.[_0x27d36b(0x191)]||null})),'stats':_0x14ad60};}}function a56_0x568d(){const _0x5b2f58=['\x20\x20Session\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','trim','yes','\x20schedule','New\x20project\x20name:\x20','planned','newProjectName','No\x20attempts\x20found\x20in\x20project:\x20','columns','\x27\x20from\x20project\x20\x27','No\x20matching\x20sessions\x20found','value','renderTimeline','Dry\x20run:\x20yes','fill','📁\x20','text','stringify','running','Error:\x20Secret\x20key\x20is\x20required','fs/promises','Parameters:\x20','\x20next:\x20','\x20is\x20not\x20a\x20directory','sessions','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20no\x20files\x20written','Enabling\x20schedule\x20#','disabledAt','POLL_INTERVAL_MS','min','🔄\x20','Deleting\x20project\x20','workflow:attempts','Task\x20graph:','workflowName','startedAt','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','project','\x0a✔\x20Attempt\x20complete','diff','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Workflow:','createdAt','navigateSessionsInteractive','ICON_WIDTH','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','round','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','cancelRequested','Resume\x20from:\x20','log','No\x20sessions\x20found','workflow:schedule:enable','replace','\x0aDry\x20run\x20-\x20nothing\x20pushed','MAX_TASKS_DISPLAY','context','param','Target:\x20','Loading\x20session...','Attempt\x20ID:\x20','No\x20sessions\x20with\x20timing\x20information','📋\x20','msPerChar','key','getWorkflow','No\x20sessions\x20found\x20in\x20project:\x20','Params:\x20','💡\x20Tip:\x20Use\x20','Listing\x20workflow\x20sessions...','getMinutes','Fetching\x20workflow\x20','task','\x1b[1A\x1b[2K','Pushing\x20project...','ICON_SPACING','Revision:\x20','dryRun','new','getMonth','enableSchedule','renderSingleTimeline','table','Target\x20directory:\x20','filter','resolveProjectId','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','existingProjectId','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','substring','group_error','\x0aPush\x20these\x20changes?','includes','nextTime','Schedule\x20ID\x20is\x20required','floor','\x0aClone\x20\x22','Latest\x20session\x20has\x20no\x20attempt','isArray','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Tip:\x20cd\x20to\x20workflows/','Expected\x20format:\x20--param\x20key=value','canceling','Parameters:','applyPullProject','status','\x20secrets...','red','593439btANJd','relative','listSchedules','has','name','all','Force:\x20yes','From\x20task:\x20','logFiles','bold','Usage:\x20workflow:delete\x20<project-name-or-id>','window','list','1199014sBPEhw','targetDir','blue','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20attempt','Retrying\x20session...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','follow','tdx\x20wf\x20attempt\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Source:\x20','attemptId','Select\x20a\x20workflow\x20to\x20run','✔\x20Workflow\x20project\x20set\x20to:\x20','nextRunTime','Project\x20directory:\x20','List\x20workflows','Validation:\x20skipped','→\x20Project:\x20','length','slice','fileSize','deleteSecret','parseProjectWorkflowPattern','setSecrets','startsWith','end',',\x20Workflow:\x20','Pattern:\x20','\x20session','description','workflow:retry','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','getSchedule','-\x20nothing\x20pushed','Error:','workflow:secrets:list','---\x20','No\x20workflow\x20projects\x20found','deleted','\x20secret','getHours','Source\x20directory\x20is\x20required','Including\x20subtasks:\x20yes','Listing\x20workflows...','Task\x20name:\x20','Auto-selected\x20latest\x20session:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','(unknown)','disableSchedule','changes','\x20modified','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','Project\x20name\x20is\x20required','format','Downloading\x20logs...','showWorkflowConsoleUrl','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','workflow:schedules','indexOf','✔\x20Schedule\x20found','cyan','List\x20all\x20workflow\x20projects','Source\x20project:\x20','localeCompare','workflow:use','Getting\x20attempt\x20details...','projectName','Analyzing\x20project...','\x20\x20Console:\x20','done','now','Filter:\x20project=','find','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','\x20-\x20','\x0a✔\x20Already\x20up\x20to\x20date','Deleting\x20secret...','Setting\x20','\x20deleted','updatedAt','\x20tasks','unknown','start','Total:\x20','buildTimelineData','Retrying\x20attempt...','workflow:sessions','durationMs','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','\x20\x20Session\x20context\x20set\x20to:\x20','finishedAt','✔\x20Project:\x20','getDate','rows','✔\x20Project\x20updated','workflows','Fetching\x20schedule\x20#','preparePushProject','duration','unchanged','success','site','7hqCNFy','parse','set','executePushProject','List\x20workflow\x20execution\x20sessions','\x20disabled\x20(','split','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x0aUpdate\x20existing\x20project\x20\x22','Files\x20to\x20upload:\x20','2786365FYBKYJ','size','✔\x20Found\x20','summary','Killing\x20attempt...','session_id','✔\x20Showing\x20','✔\x20Pull\x20complete','params','index','get','type','retryAttemptName','sort','targetExists','startTime','write','generateSessionTimelineRows','verbose','/sessions/','hasChanges','path','splice','MAX_LABEL_COUNT','select','List\x20workflow\x20schedules','✔\x20Clone\x20complete','Project:\x20','workflow:secrets:delete','tdx.json','\x0aApply\x20these\x20changes?','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Workflow:\x20','\x20(system)','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','skipValidation','Show\x20logs\x20for\x20a\x20workflow\x20attempt','fromTask','Resolving\x20project\x20\x27','padStart','jsonl','\x20of\x20','keys','isNewProject','clear','cwd','Attempt:\x20','utf-8','toISOString','\x20(use\x20--limit\x20to\x20show\x20more)','trimEnd','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','max','\x20\x20Attempt\x20ID:\x20','Retry\x20a\x20session\x20or\x20attempt','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','projects','/attempt/','MAX_TIMELINE_WIDTH','\x20\x20tdx\x20wf\x20use\x20<project>','No\x20log\x20content\x20found','sessionId','Show\x20tasks\x20for\x20an\x20attempt','prepareCloneProject','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Pushing\x20workflow\x20project...','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','stdout','Session\x20time:\x20','...','readFile','List\x20workflow\x20attempts','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','force','resolveProjectDir','modified','from','\x20to\x20see\x20detailed\x20logs','Source\x20directory:\x20','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','workflow:push','renderSessionsTimeline','metadata','basename','\x0a✔\x20No\x20changes\x20to\x20push','icon','\x20\x20Project:\x20','listSecrets','sessionTime','Listing\x20workflow\x20projects...','white','\x20\x20New\x20attempt\x20ID:\x20','Starting\x20workflow\x20run...','Filter:\x20','No\x20workflows\x20found','950356oCeFmf','includeRetried','isTTY','\x20\x20Changes:\x20','yellow','requireProject','data','message','taskName','dim','kill','filesExtracted','Warning:','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','attempt','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','\x20task','✔\x20Workflow\x20run\x20started','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','push','projectId','✔\x20Retry\x20started','No\x20attempts\x20found\x20for:\x20','MIN_TIMELINE_WIDTH','fullName','\x22\x20with\x20new\x20revision?','Error:\x20Attempt\x20ID\x20is\x20required','workflow:logs','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','green','displayLine','retryAttempt','2415484kmUQAc','pollTimeline','6793986lpagtY','Output\x20directory:\x20','limit','join','Key\x20cannot\x20be\x20empty','Show\x20specific\x20attempt\x20details','.\x20Expected\x20format:\x20KEY=VALUE','\x20has\x20no\x20attempts','revision','workflow:workflows','✔\x20Downloaded\x20','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20Files\x20extracted:\x20','8358032krtFph','/app/workflows/','getTime','✔\x20Schedule\x20#','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','title','pullProject','output','workflow:projects','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','delete','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Getting\x20attempt\x20tasks...','session','sourceDir','lastAttempt','\x20\x20Revision:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','TASK_NAME_WIDTH','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20new','workflowProject','GUTTER','\x0aError:','Disabling\x20schedule\x20#','stat','MIN_LABEL_COUNT','\x20\x20Location:\x20','execute','Failed\x20to\x20fetch\x20attempt\x20data','listProjectSchedules','No\x20sessions\x20found\x20for:\x20','skipSchedule','✔\x20Push\x20complete','state','map','Cancelled','Status:\x20','\x20workflow','workflow','Session\x20not\x20found:\x20','resolve','workflow:clone','Updating\x20','workflow:upload','fileCount','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','every','json','getFullYear','\x0a⚠\x20Project\x20\x22','✔\x20Secret\x20\x27','\x20unchanged','match','\x20(disabled)','total','Pulling\x20project\x20','workflow:run','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Select\x20a\x20session\x20to\x20view\x20timeline:','executeDryRun','toLocaleString','resolveProject','\x20\x20Project\x20ID:\x20','Project\x20filter:\x20','Fetching\x20log\x20files...','✔\x20Workflow\x20project\x20context\x20cleared.','error','pending','repeat','\x20from\x20session\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','isDirectory','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','sourceProjectName','Listing\x20schedules...','some','Error:\x20Project\x20name\x20is\x20required','\x0aPolling...\x20(','Reason:\x20','config'];a56_0x568d=function(){return _0x5b2f58;};return a56_0x568d();}function formatScheduleLine(_0x379ac8){const _0x39a281=a56_0x1982d8,_0x5257fc=_0x379ac8[_0x39a281(0xca)]?a56_0x47be42[_0x39a281(0x205)](_0x39a281(0x92)):'',_0x4f13a4=_0x379ac8[_0x39a281(0xd4)]?.[_0x39a281(0x11f)]?a56_0x47be42['dim']('\x20['+_0x379ac8[_0x39a281(0xd4)][_0x39a281(0x11f)]+']'):'',_0x35f45e=_0x379ac8[_0x39a281(0x13b)]?a56_0x47be42[_0x39a281(0x20a)](_0x39a281(0xc4)+new Date(_0x379ac8[_0x39a281(0x13b)])['toLocaleString']()):'';return'📅\x20#'+_0x379ac8['id']+'\x20'+(_0x379ac8['workflow']?.[_0x39a281(0x11f)]||_0x39a281(0x15e))+_0x4f13a4+_0x5257fc+_0x35f45e;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0x168);['description']=a56_0x1982d8(0x1b8);async[a56_0x1982d8(0x24e)](_0x212400){const _0x46bd5d=a56_0x1982d8,{options:_0x44ed26,args:_0x3361d6,tdx:_0x1205a6}=_0x212400,{scheduleId:_0x2eda74}=_0x44ed26;if(_0x2eda74&&_0x3361d6[0x0])return console[_0x46bd5d(0x9f)](a56_0x47be42['red'](_0x46bd5d(0x150)),_0x46bd5d(0xde)),console[_0x46bd5d(0x9f)](a56_0x47be42[_0x46bd5d(0x20a)](_0x46bd5d(0x20e))),0x1;if(_0x2eda74){const _0x1593a8=await withSpinner(_0x46bd5d(0x18f)+_0x2eda74+_0x46bd5d(0x1e7),()=>_0x1205a6[_0x46bd5d(0x83)][_0x46bd5d(0x14e)](_0x2eda74),{'verbose':_0x44ed26[_0x46bd5d(0x1b1)]}),_0x141c1a=_0x1593a8['data'];return isStructuredFormat(_0x44ed26)?await handleSingleObjectOutput(_0x141c1a,_0x44ed26):(console[_0x46bd5d(0x9f)](_0x46bd5d(0x16a)),console['log'](formatScheduleLine(_0x141c1a))),0x0;}const _0x5aab6b=this[_0x46bd5d(0x144)](_0x3361d6,_0x44ed26);if(!_0x5aab6b)return 0x1;const {projectName:_0x7507db,workflowName:_0x49f962}=_0x5aab6b,_0x5d7c7c=_0x7507db?'\x27'+_0x7507db+(_0x49f962?'.'+_0x49f962:'')+'\x27':undefined,_0x2e0440=await withSpinner(_0x5d7c7c?'Listing\x20schedules\x20for\x20'+_0x5d7c7c+'...':_0x46bd5d(0xa7),()=>_0x7507db?_0x1205a6[_0x46bd5d(0x83)][_0x46bd5d(0x250)](_0x7507db,{'workflow':_0x49f962,'limit':_0x44ed26[_0x46bd5d(0x226)]}):_0x1205a6['workflow'][_0x46bd5d(0x11d)]({'limit':_0x44ed26[_0x46bd5d(0x226)]}),{'verbose':_0x44ed26[_0x46bd5d(0x1b1)]}),_0x1f7889=_0x2e0440[_0x46bd5d(0x207)],_0x2ac8b8=_0x44ed26[_0x46bd5d(0x226)]&&_0x1f7889[_0x46bd5d(0x140)]>=_0x44ed26[_0x46bd5d(0x226)]?a56_0x47be42[_0x46bd5d(0x20a)](_0x46bd5d(0x162)):'';console[_0x46bd5d(0x9f)](_0x46bd5d(0x1a1)+_0x1f7889['length']+_0x46bd5d(0xb1)+(_0x1f7889[_0x46bd5d(0x140)]!==0x1?'s':'')+_0x2ac8b8);if(isStructuredFormat(_0x44ed26))await handleSDKOutput(_0x1f7889,_0x44ed26);else{if(_0x1f7889['length']===0x0)console[_0x46bd5d(0xe1)]('No\x20schedules\x20found');else for(const _0x2434bf of _0x1f7889){console[_0x46bd5d(0xe1)](formatScheduleLine(_0x2434bf));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x1982d8(0x11f)]=a56_0x1982d8(0xe3);['description']='Enable\x20a\x20workflow\x20schedule';async[a56_0x1982d8(0x24e)](_0xbf5b47){const _0x3b010b=a56_0x1982d8,{options:_0x1e960c,args:_0x2fa4d2,tdx:_0x526cf8}=_0xbf5b47,_0x1ada43=_0x2fa4d2[0x0];if(!_0x1ada43)return console[_0x3b010b(0x9f)](a56_0x47be42[_0x3b010b(0x11a)]('Error:'),_0x3b010b(0x10d)),console[_0x3b010b(0x9f)](a56_0x47be42[_0x3b010b(0x20a)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console['error'](a56_0x47be42[_0x3b010b(0x20a)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const {backfill:_0xa09f66,nextTime:_0x2fed2d}=_0x1e960c,_0xf2e15f={};if(_0xa09f66!==undefined)_0xf2e15f[_0x3b010b(0x252)]=!_0xa09f66;if(_0x2fed2d!==undefined)_0xf2e15f[_0x3b010b(0x10c)]=_0x2fed2d;const _0xa76436=await withSpinner(_0x3b010b(0xc9)+_0x1ada43+'...',()=>_0x526cf8[_0x3b010b(0x83)][_0x3b010b(0xff)](_0x1ada43,_0xf2e15f),{'verbose':_0x1e960c['verbose']}),_0x301a75=_0xa76436['data'];return isStructuredFormat(_0x1e960c)?await handleSingleObjectOutput(_0x301a75,_0x1e960c):(console[_0x3b010b(0xe1)](_0x3b010b(0x234)+_0x1ada43+'\x20enabled\x20('+(_0x301a75['workflow']?.[_0x3b010b(0x11f)]||_0x3b010b(0x180))+')'),_0x301a75[_0x3b010b(0x13b)]&&console[_0x3b010b(0xe1)](a56_0x47be42[_0x3b010b(0x20a)]('\x20\x20Next\x20run:\x20'+new Date(_0x301a75[_0x3b010b(0x13b)])[_0x3b010b(0x99)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']='workflow:schedule:disable';['description']='Disable\x20a\x20workflow\x20schedule';async[a56_0x1982d8(0x24e)](_0x43bccf){const _0x1b4eb3=a56_0x1982d8,{options:_0x5a17dd,args:_0x4d24fd,tdx:_0x1f7302}=_0x43bccf,_0x51975e=_0x4d24fd[0x0];if(!_0x51975e)return console[_0x1b4eb3(0x9f)](a56_0x47be42[_0x1b4eb3(0x11a)]('Error:'),_0x1b4eb3(0x10d)),console[_0x1b4eb3(0x9f)](a56_0x47be42['dim']('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console['error'](a56_0x47be42[_0x1b4eb3(0x20a)](_0x1b4eb3(0x135))),0x1;const _0x5b6a7d=await withSpinner(_0x1b4eb3(0x24a)+_0x51975e+_0x1b4eb3(0x1e7),()=>_0x1f7302['workflow'][_0x1b4eb3(0x15f)](_0x51975e),{'verbose':_0x5a17dd[_0x1b4eb3(0x1b1)]}),_0x24551c=_0x5b6a7d[_0x1b4eb3(0x207)];return isStructuredFormat(_0x5a17dd)?await handleSingleObjectOutput(_0x24551c,_0x5a17dd):console[_0x1b4eb3(0xe1)](_0x1b4eb3(0x234)+_0x51975e+_0x1b4eb3(0x19a)+(_0x24551c['workflow']?.[_0x1b4eb3(0x11f)]||_0x1b4eb3(0x180))+')'),0x0;}}
1
+ const a56_0x1ddcb4=a56_0x1ee3;(function(_0x50b8fb,_0x18bf32){const _0x2b76ca=a56_0x1ee3,_0x28f6d8=_0x50b8fb();while(!![]){try{const _0xb5b549=parseInt(_0x2b76ca(0x210))/0x1*(parseInt(_0x2b76ca(0x236))/0x2)+parseInt(_0x2b76ca(0x13e))/0x3*(parseInt(_0x2b76ca(0xff))/0x4)+-parseInt(_0x2b76ca(0xe1))/0x5+-parseInt(_0x2b76ca(0x145))/0x6*(-parseInt(_0x2b76ca(0x134))/0x7)+-parseInt(_0x2b76ca(0x28b))/0x8*(parseInt(_0x2b76ca(0x120))/0x9)+parseInt(_0x2b76ca(0x153))/0xa+parseInt(_0x2b76ca(0x260))/0xb*(-parseInt(_0x2b76ca(0x176))/0xc);if(_0xb5b549===_0x18bf32)break;else _0x28f6d8['push'](_0x28f6d8['shift']());}catch(_0x1afdff){_0x28f6d8['push'](_0x28f6d8['shift']());}}}(a56_0x498a,0x2927f));import a56_0x4d082d from'chalk';import{existsSync}from'fs';import a56_0x1268de 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{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a56_0x34435f from'prompts';function getAttemptStatusDisplay(_0x1f4e51){const _0x2efca8=a56_0x1ee3;if(!_0x1f4e51)return{'icon':'⏳','text':''};const {done:_0x108a56,success:_0x211271,cancelRequested:_0x80637e}=_0x1f4e51;if(!_0x108a56)return _0x80637e?{'icon':'🛑','text':a56_0x4d082d['yellow'](_0x2efca8(0x148))}:{'icon':'🔄','text':a56_0x4d082d[_0x2efca8(0x137)]('running')};if(_0x211271)return{'icon':'✅','text':a56_0x4d082d['green']('success')};return{'icon':'❌','text':a56_0x4d082d[_0x2efca8(0x171)](_0x2efca8(0x12a))};}export class WorkflowBaseCommand extends BaseCommand{[a56_0x1ddcb4(0x275)](_0x2ac208,_0x5ccbcd,_0x2c6082=0x0){const _0x3b7f02=a56_0x1ddcb4;return _0x2ac208[_0x2c6082]||_0x5ccbcd[_0x3b7f02(0x196)];}[a56_0x1ddcb4(0x116)](_0x4b84e8,_0x14a63f,_0x22f811=0x0){const _0x321b14=a56_0x1ddcb4,_0x4b3e4e=this[_0x321b14(0x275)](_0x4b84e8,_0x14a63f,_0x22f811);if(!_0x4b3e4e)return console[_0x321b14(0x12a)](a56_0x4d082d['red'](_0x321b14(0x106)),_0x321b14(0x22b)),console[_0x321b14(0x12a)](a56_0x4d082d[_0x321b14(0x262)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x4b3e4e;}[a56_0x1ddcb4(0x1fd)](_0x3c6ec4,_0x265731){const _0x4529e4=a56_0x1ddcb4;if(_0x3c6ec4[0x0]){const _0x30c43f=_0x3c6ec4[0x0]['split']('.');if(_0x30c43f[_0x4529e4(0x1ba)]===0x1)return{'projectName':_0x30c43f[0x0],'workflowName':undefined};else return _0x30c43f[_0x4529e4(0x1ba)]===0x2?{'projectName':_0x30c43f[0x0],'workflowName':_0x30c43f[0x1]}:(console['error'](a56_0x4d082d[_0x4529e4(0x171)](_0x4529e4(0x106)),_0x4529e4(0x167)),null);}return{'projectName':_0x265731[_0x4529e4(0x196)],'workflowName':undefined};}['resolveProjectDir'](_0x56112f,_0x184ed4,_0x51a1b1=0x0){const _0x190b6a=a56_0x1ddcb4;if(_0x56112f[_0x51a1b1])return _0x56112f[_0x51a1b1];if(_0x184ed4[_0x190b6a(0x196)]){const _0x3db18d=a56_0x1268de[_0x190b6a(0x13b)](process['cwd'](),_0x190b6a(0xd5),_0x184ed4[_0x190b6a(0x196)]);if(existsSync(a56_0x1268de['join'](_0x3db18d,_0x190b6a(0x105))))return _0x3db18d;}return undefined;}async[a56_0x1ddcb4(0x1b6)](_0x2d50fe,_0xc66e7d,_0x28a480){const _0x3c571d=a56_0x1ddcb4;try{const _0x10f394=await _0x2d50fe['workflow']['workflows'](_0xc66e7d,{'limit':0x1});if(_0x10f394[_0x3c571d(0x1ba)]>0x0){const _0x5b41da=_0x10f394[0x0]['id'],_0x4c1b4c=getWorkflowUrl(_0x28a480,_0x5b41da);console[_0x3c571d(0x12a)](_0x3c571d(0x133)+a56_0x4d082d['cyan'](_0x4c1b4c));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x11a);['description']=a56_0x1ddcb4(0xf4);async[a56_0x1ddcb4(0x12f)](_0x2e38e3){const _0x30a08e=a56_0x1ddcb4,{options:_0x1cf9a6,args:_0x142667,tdx:_0x55959e}=_0x2e38e3,_0x2c354f=_0x142667[0x0],_0x4ea5da=_0x1cf9a6['clear'];if(_0x4ea5da)return saveSessionContext({'workflow_project':undefined},_0x1cf9a6[_0x30a08e(0x1dc)]),console[_0x30a08e(0x1a1)](a56_0x4d082d[_0x30a08e(0xfb)](_0x30a08e(0x10b))),0x0;if(!_0x2c354f)return console[_0x30a08e(0x12a)](a56_0x4d082d[_0x30a08e(0x171)](_0x30a08e(0x106)),_0x30a08e(0x22b)),console[_0x30a08e(0x12a)](a56_0x4d082d[_0x30a08e(0x262)](_0x30a08e(0x1ec))),console[_0x30a08e(0x12a)](a56_0x4d082d[_0x30a08e(0x262)](_0x30a08e(0x1d6))),0x1;const _0x1a4906=await withSpinner(_0x30a08e(0x273)+_0x2c354f+_0x30a08e(0x1cc),()=>_0x55959e[_0x30a08e(0x227)]['resolveProjectId'](_0x2c354f),{'verbose':_0x1cf9a6['verbose']}),{name:_0x2c30c7}=_0x1a4906[_0x30a08e(0x14d)];return saveSessionContext({'workflow_project':_0x2c30c7},_0x1cf9a6[_0x30a08e(0x1dc)]),console[_0x30a08e(0x1a1)](a56_0x4d082d['green'](_0x30a08e(0x279)+a56_0x4d082d[_0x30a08e(0x170)](_0x2c30c7))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x12b);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0xd8);async['execute'](_0x3a8680){const _0x2f9298=a56_0x1ddcb4,{options:_0x4ecdac,args:_0x116bb6,tdx:_0x5a7887}=_0x3a8680,_0x149164=_0x116bb6[0x0];_0x4ecdac[_0x2f9298(0x199)]&&_0x149164&&console['error'](_0x2f9298(0x23f)+_0x149164);const _0x1dac5a=await withSpinner(_0x2f9298(0x1fb),()=>_0x5a7887[_0x2f9298(0x227)][_0x2f9298(0x11f)](_0x149164,{'limit':_0x4ecdac['limit']}),{'verbose':_0x4ecdac['verbose']});let _0x1047e8=_0x1dac5a['data'];_0x1047e8[_0x2f9298(0x140)]((_0x220c25,_0x4b2187)=>_0x220c25[_0x2f9298(0x161)]['localeCompare'](_0x4b2187['name']));const _0x5e98c0=_0x4ecdac[_0x2f9298(0x24e)]&&_0x1047e8[_0x2f9298(0x1ba)]>=_0x4ecdac[_0x2f9298(0x24e)]?a56_0x4d082d[_0x2f9298(0x262)](_0x2f9298(0x1a7)):'';console[_0x2f9298(0x12a)](_0x2f9298(0x1b2)+_0x1047e8[_0x2f9298(0x1ba)]+_0x2f9298(0x252)+(_0x1047e8[_0x2f9298(0x1ba)]!==0x1?'s':'')+_0x5e98c0);if(_0x4ecdac[_0x2f9298(0x123)]===_0x2f9298(0x1fc)||_0x4ecdac[_0x2f9298(0x123)]==='jsonl'||_0x4ecdac[_0x2f9298(0x123)]===_0x2f9298(0x257))await handleSDKOutput(_0x1047e8,_0x4ecdac);else{if(_0x1047e8[_0x2f9298(0x1ba)]===0x0)_0x149164?console[_0x2f9298(0x1a1)](_0x2f9298(0xde)+_0x149164):console[_0x2f9298(0x1a1)](_0x2f9298(0x109));else{const _0x2506ca=_0x1047e8[_0x2f9298(0x175)](_0x2b83ac=>{const _0x4bc670=_0x2f9298,_0x12b385=_0x2b83ac[_0x4bc670(0x216)]?.[_0x4bc670(0x1c7)](_0x2f6406=>_0x2f6406['key']===_0x4bc670(0x10e)),_0xa1c3d2=_0x12b385?a56_0x4d082d[_0x4bc670(0x262)](_0x4bc670(0x24f)):'';return _0x4bc670(0x11c)+_0x2b83ac[_0x4bc670(0x161)]+_0xa1c3d2;});await writeOutput(_0x2506ca[_0x2f9298(0x13b)]('\x0a'),_0x4ecdac[_0x2f9298(0x202)],_0x2f9298(0x13c));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0xf3);['description']=a56_0x1ddcb4(0x16a);async[a56_0x1ddcb4(0x12f)](_0x1eddbe){const _0x25d530=a56_0x1ddcb4,{options:_0x574298,args:_0xff8b3d,tdx:_0x38acfe}=_0x1eddbe,_0x2836e1=this['resolveProject'](_0xff8b3d,_0x574298);_0x574298['verbose']&&_0x2836e1&&console[_0x25d530(0x12a)](_0x25d530(0x1eb)+_0x2836e1);const _0xafaf81=await withSpinner(_0x25d530(0xdd),()=>_0x38acfe['workflow'][_0x25d530(0xd5)](_0x2836e1,{'limit':_0x574298[_0x25d530(0x24e)]}),{'verbose':_0x574298[_0x25d530(0x199)]});let _0x1286a9=_0xafaf81[_0x25d530(0x14d)];_0x1286a9[_0x25d530(0x140)]((_0x332185,_0x29f445)=>{const _0x2b2c64=_0x25d530,_0x102402=_0x332185[_0x2b2c64(0x161)][_0x2b2c64(0x138)](_0x29f445['name']);if(_0x102402!==0x0)return _0x102402;return(_0x332185[_0x2b2c64(0x162)]?.[_0x2b2c64(0x161)]||'')[_0x2b2c64(0x138)](_0x29f445['project']?.['name']||'');});const _0xdda5e1=_0x574298[_0x25d530(0x24e)]&&_0x1286a9[_0x25d530(0x1ba)]>=_0x574298[_0x25d530(0x24e)]?a56_0x4d082d[_0x25d530(0x262)](_0x25d530(0x1a7)):'';console['error']('✔\x20Found\x20'+_0x1286a9[_0x25d530(0x1ba)]+'\x20workflow'+(_0x1286a9['length']!==0x1?'s':'')+_0xdda5e1);if(_0x574298[_0x25d530(0x123)]===_0x25d530(0x1fc)||_0x574298[_0x25d530(0x123)]===_0x25d530(0x17d)||_0x574298['format']===_0x25d530(0x257))await handleSDKOutput(_0x1286a9,_0x574298);else{if(_0x1286a9[_0x25d530(0x1ba)]===0x0)_0x2836e1?console[_0x25d530(0x1a1)](_0x25d530(0x1fe)+_0x2836e1):console[_0x25d530(0x1a1)](_0x25d530(0x1bb));else{const _0x2a5675=_0x574298[_0x25d530(0x194)],_0x19894d=_0x1286a9[_0x25d530(0x175)](_0x49c115=>{const _0x5510d0=_0x25d530,_0x13a9db=a56_0x4d082d[_0x5510d0(0x262)]('#'+_0x49c115['id']),_0x5d732d=hyperlink(_0x13a9db,getWorkflowUrl(_0x2a5675,_0x49c115['id'])),_0x203ecb=_0x49c115[_0x5510d0(0x162)]?.['name']?a56_0x4d082d[_0x5510d0(0x262)]('\x20('+_0x49c115['project'][_0x5510d0(0x161)]+')'):'';return'📋\x20'+_0x5d732d+'\x20'+_0x49c115[_0x5510d0(0x161)]+_0x203ecb;});await writeOutput(_0x19894d['join']('\x0a'),_0x574298['output'],_0x25d530(0x13c));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0xfa);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0xef);async[a56_0x1ddcb4(0x12f)](_0x27ef03){const _0x3f9226=a56_0x1ddcb4,{options:_0x37ad17,args:_0x3c23ad,tdx:_0x58d72f}=_0x27ef03,_0x26d3d5=this['parseProjectWorkflowPattern'](_0x3c23ad,_0x37ad17);if(!_0x26d3d5)return 0x1;const {projectName:_0x439385,workflowName:_0x487d79}=_0x26d3d5;if(_0x37ad17[_0x3f9226(0x199)]){if(_0x439385&&_0x487d79)console[_0x3f9226(0x12a)]('Filter:\x20'+_0x439385+'.'+_0x487d79);else _0x439385&&console[_0x3f9226(0x12a)]('Filter:\x20project='+_0x439385);const _0x2c9cea=_0x37ad17[_0x3f9226(0x107)];_0x2c9cea&&console[_0x3f9226(0x12a)](_0x3f9226(0x18b)+_0x2c9cea);}let _0x4c6eab=0x28;if(process[_0x3f9226(0x1fa)][_0x3f9226(0x10c)]&&!_0x37ad17[_0x3f9226(0x202)]&&!_0x37ad17[_0x3f9226(0x123)]){const _0x216bf9=process['stdout'][_0x3f9226(0x1c1)]||0x28;_0x4c6eab=Math[_0x3f9226(0x114)](0x14,Math['floor'](_0x216bf9*0x2/0x3));}const _0x1366ef=_0x37ad17[_0x3f9226(0x24e)]||_0x4c6eab,_0x235551=await withSpinner(_0x3f9226(0x164),()=>_0x58d72f[_0x3f9226(0x227)][_0x3f9226(0x239)]({'projectName':_0x439385,'workflowName':_0x487d79,'status':_0x37ad17[_0x3f9226(0x107)],'fromTime':_0x37ad17[_0x3f9226(0x15d)],'toTime':_0x37ad17['to'],'limit':_0x1366ef}),{'verbose':_0x37ad17['verbose']}),_0x4c697b=_0x235551[_0x3f9226(0x14d)];_0x4c697b[_0x3f9226(0x140)]((_0x1b22db,_0x37a979)=>{const _0x499475=_0x3f9226,_0x1c4d7a=_0x1b22db[_0x499475(0x1c3)]||'',_0x520ca1=_0x37a979[_0x499475(0x1c3)]||'';return _0x520ca1[_0x499475(0x138)](_0x1c4d7a);});_0x4c697b[_0x3f9226(0x1ba)]>=_0x1366ef?console[_0x3f9226(0x12a)](_0x3f9226(0x1ab)+_0x4c697b[_0x3f9226(0x1ba)]+_0x3f9226(0x1a9)+a56_0x4d082d[_0x3f9226(0x262)](_0x3f9226(0xf2))):console['error'](_0x3f9226(0x1b2)+_0x4c697b[_0x3f9226(0x1ba)]+_0x3f9226(0x1e0)+(_0x4c697b['length']!==0x1?'s':''));if(_0x37ad17[_0x3f9226(0x123)]==='json'||_0x37ad17[_0x3f9226(0x123)]==='jsonl'||_0x37ad17['format']===_0x3f9226(0x257))await handleSDKOutput(_0x4c697b,_0x37ad17);else{if(!process[_0x3f9226(0x1fa)][_0x3f9226(0x10c)]||_0x37ad17['output']){if(_0x4c697b[_0x3f9226(0x1ba)]===0x0){if(_0x439385&&_0x487d79)console['log'](_0x3f9226(0x146)+_0x439385+'.'+_0x487d79);else _0x439385?console[_0x3f9226(0x1a1)](_0x3f9226(0x1d7)+_0x439385):console[_0x3f9226(0x1a1)](_0x3f9226(0x1b3));}else{const _0x3e8963=_0x37ad17[_0x3f9226(0x194)],_0x2bcc85=this[_0x3f9226(0x25b)](_0x4c697b,_0x3e8963);_0x37ad17['output']?await writeOutput(_0x2bcc85,_0x37ad17[_0x3f9226(0x202)],_0x3f9226(0x13c)):console['log'](_0x2bcc85);}!_0x439385&&(console[_0x3f9226(0x12a)](''),console[_0x3f9226(0x12a)](a56_0x4d082d[_0x3f9226(0x262)](_0x3f9226(0x25f))),console[_0x3f9226(0x12a)](a56_0x4d082d['dim'](_0x3f9226(0x172))+'or'+a56_0x4d082d[_0x3f9226(0x262)](_0x3f9226(0x12e))));}else{if(_0x4c697b[_0x3f9226(0x1ba)]===0x0){if(_0x439385&&_0x487d79)console[_0x3f9226(0x1a1)](_0x3f9226(0x146)+_0x439385+'.'+_0x487d79);else _0x439385?console[_0x3f9226(0x1a1)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x439385):console[_0x3f9226(0x1a1)](_0x3f9226(0x1b3));}else await this[_0x3f9226(0xe5)](_0x4c697b,_0x27ef03,_0x439385);}}return 0x0;}[a56_0x1ddcb4(0x25b)](_0x3f7710,_0x3c43cc){const _0x55d0ae=a56_0x1ddcb4,_0x5dd25a=[],_0x47f03c=new Map();let _0x4c1b18=Infinity,_0x2ce4ce=-Infinity;for(const _0x198f18 of _0x3f7710){if(_0x198f18[_0x55d0ae(0x181)]?.['createdAt']){const _0x98e30d=new Date(_0x198f18[_0x55d0ae(0x181)][_0x55d0ae(0x245)])[_0x55d0ae(0x1b4)](),_0x2627e9=_0x198f18[_0x55d0ae(0x181)][_0x55d0ae(0x276)]?new Date(_0x198f18[_0x55d0ae(0x181)]['finishedAt'])[_0x55d0ae(0x1b4)]():Date[_0x55d0ae(0xc4)](),_0x1fce02=_0x198f18[_0x55d0ae(0x162)]?.['name']||_0x55d0ae(0x1ae);!_0x47f03c['has'](_0x1fce02)&&_0x47f03c[_0x55d0ae(0x1c0)](_0x1fce02,[]),_0x47f03c[_0x55d0ae(0x240)](_0x1fce02)['push']({'session':_0x198f18,'startTime':_0x98e30d,'endTime':_0x2627e9,'duration':_0x2627e9-_0x98e30d}),_0x4c1b18=Math[_0x55d0ae(0x173)](_0x4c1b18,_0x98e30d),_0x2ce4ce=Math[_0x55d0ae(0x114)](_0x2ce4ce,_0x2627e9);}}if(_0x47f03c[_0x55d0ae(0xf0)]===0x0)return _0x55d0ae(0x23a);const _0x7a4181=process[_0x55d0ae(0x1fa)]['columns']||0x78,_0x4100ca=0x1e,_0x26a704=0x32,_0x2df6e9=0x4,_0xe79cfc=Math[_0x55d0ae(0x173)](_0x26a704,Math[_0x55d0ae(0x114)](_0x4100ca,Math[_0x55d0ae(0x225)](_0x7a4181*0.3))),_0x2176ac=_0x7a4181-_0xe79cfc-TIMELINE_CONFIG['GUTTER']-0x3-_0x2df6e9,_0x42cda2=_0x2ce4ce-_0x4c1b18,_0x4157a4=_0x42cda2/_0xe79cfc,_0x3b8a1c=renderTimeAxis({'startTime':_0x4c1b18,'endTime':_0x2ce4ce,'durationMs':_0x42cda2,'msPerChar':_0x4157a4},_0xe79cfc),_0x41f497=[];for(const _0x38d1a9 of _0x47f03c['values']()){_0x41f497['push'](..._0x38d1a9);}_0x41f497[_0x55d0ae(0x140)]((_0x190ca6,_0x433661)=>_0x433661[_0x55d0ae(0x14a)]-_0x190ca6['startTime']);const _0x4505ae=new Date(_0x4c1b18),_0x43a7ce=formatDate(_0x4505ae),_0x12ee3d=_0x2df6e9+TIMELINE_CONFIG[_0x55d0ae(0x182)]+TIMELINE_CONFIG[_0x55d0ae(0x21b)]+_0x2176ac,_0x75f890='\x20'[_0x55d0ae(0x129)](_0x12ee3d-_0x43a7ce[_0x55d0ae(0x1ba)]),_0x2ecb12=_0x75f890+a56_0x4d082d[_0x55d0ae(0x262)](_0x43a7ce)+'\x20'+_0x3b8a1c;_0x5dd25a[_0x55d0ae(0x103)](_0x2ecb12);const _0xa18852=0x16;let _0x2a1305=0x0;for(const _0x523881 of _0x41f497){const _0xbd542d=_0x523881[_0x55d0ae(0x1dc)][_0x55d0ae(0x162)]?.[_0x55d0ae(0x161)]||'?',_0x23a913=Math[_0x55d0ae(0x173)](stringWidth(_0xbd542d),_0xa18852);_0x2a1305=Math[_0x55d0ae(0x114)](_0x2a1305,_0x23a913);}for(const _0x3c5579 of _0x41f497){const {session:_0x23065c,startTime:_0x18fa9b,endTime:_0x921976,duration:_0x568f65}=_0x3c5579,_0x47315e=_0x23065c[_0x55d0ae(0x162)]?.['id'],_0x3165f1=_0x23065c['id'],_0x271ebb=_0x23065c['project']?.[_0x55d0ae(0x161)]||'?',_0x5baf17=_0x23065c[_0x55d0ae(0x227)]?.['name']||'?';let _0x2cfc11,_0x108964;if(_0x23065c[_0x55d0ae(0x181)]){const _0x31224d=_0x23065c[_0x55d0ae(0x181)];!_0x31224d[_0x55d0ae(0x1bd)]?(_0x2cfc11=_0x31224d[_0x55d0ae(0x269)]?'🛑':'🔄',_0x108964=_0x31224d['cancelRequested']?a56_0x4d082d[_0x55d0ae(0x288)]:a56_0x4d082d[_0x55d0ae(0x137)]):(_0x2cfc11=_0x31224d[_0x55d0ae(0x283)]?'✅':'❌',_0x108964=_0x31224d[_0x55d0ae(0x283)]?a56_0x4d082d[_0x55d0ae(0xfb)]:a56_0x4d082d[_0x55d0ae(0x171)]);}else _0x2cfc11='⏳',_0x108964=a56_0x4d082d[_0x55d0ae(0x262)];const _0x224927='#'+_0x3165f1,_0xc98243=_0x47315e?hyperlink(_0x224927,getWorkflowSessionUrl(_0x3c43cc,_0x47315e,_0x3165f1)):_0x224927;let _0x37b99a=_0x271ebb;stringWidth(_0x271ebb)>_0xa18852&&(_0x37b99a=_0x271ebb[_0x55d0ae(0x191)](0x0,_0xa18852-0x1)+'…');const _0x3af77e=a56_0x4d082d['dim'](_0x37b99a),_0x38462a=stringWidth(_0x37b99a),_0x27c88f='\x20'['repeat'](_0x2a1305-stringWidth(_0x37b99a)+0x2),_0x260fcd='('+formatElapsed(_0x568f65)+')',_0x113562=stringWidth(_0x260fcd),_0x1947af=stringWidth(_0x224927),_0x2e29f3=_0x1947af+0x1+_0x38462a+_0x27c88f[_0x55d0ae(0x1ba)],_0x217d2c=_0x2176ac-_0x2e29f3-_0x113562-0x1-0x8;let _0xe8944a=_0x5baf17;stringWidth(_0xe8944a)>_0x217d2c&&(_0xe8944a=_0xe8944a['slice'](0x0,_0x217d2c-0x1)+'…');const _0x47e737=_0xc98243+'\x20'+_0x3af77e+_0x27c88f+_0xe8944a,_0x5c5eff=stringWidth(_0x47e737),_0x3c8e33=_0x2176ac-_0x5c5eff-_0x113562,_0x54b90d=_0x47e737+'\x20'[_0x55d0ae(0x129)](Math[_0x55d0ae(0x114)](0x1,_0x3c8e33))+a56_0x4d082d[_0x55d0ae(0x262)](_0x260fcd),_0x299e45=Math[_0x55d0ae(0x225)]((_0x18fa9b-_0x4c1b18)/_0x4157a4),_0x79f989=Math['floor']((_0x921976-_0x4c1b18)/_0x4157a4),_0x19fa6e=Math['max'](_0x299e45+0x1,_0x79f989),_0x7df22b=new Array(_0xe79cfc)[_0x55d0ae(0x177)]('\x20');for(let _0x3387b9=_0x299e45;_0x3387b9<Math[_0x55d0ae(0x173)](_0x19fa6e,_0xe79cfc);_0x3387b9++){_0x7df22b[_0x3387b9]='─';}const _0x56d8b2=_0x7df22b[_0x55d0ae(0x175)](_0x4feda4=>_0x4feda4==='\x20'?'\x20':_0x108964(_0x4feda4))[_0x55d0ae(0x13b)]('');_0x5dd25a['push'](_0x2cfc11+'\x20'+_0x54b90d+'│'+_0x56d8b2+'│');}return _0x5dd25a['join']('\x0a');}async[a56_0x1ddcb4(0xe5)](_0x2c59b0,_0xb7f9d5,_0x383c99){const _0x42f9cc=a56_0x1ddcb4,{options:_0x4589fb,tdx:_0x4c5fce}=_0xb7f9d5,_0x585217=_0x4589fb[_0x42f9cc(0x194)],{timelineRows:_0xb0e4e8,timeAxisHeader:_0x59665f}=this[_0x42f9cc(0x28a)](_0x2c59b0,_0x585217),_0x2fcdd1=_0xb0e4e8[_0x42f9cc(0x16f)](_0x3ab439=>_0x3ab439[_0x42f9cc(0x271)]);if(_0x2fcdd1[_0x42f9cc(0x1ba)]===0x0){const _0xb9c580=this['renderSessionsTimeline'](_0x2c59b0,_0x585217);console['log'](_0xb9c580);!_0x383c99&&(console[_0x42f9cc(0x12a)](''),console[_0x42f9cc(0x12a)](a56_0x4d082d['dim'](_0x42f9cc(0x25f))),console[_0x42f9cc(0x12a)](a56_0x4d082d[_0x42f9cc(0x262)](_0x42f9cc(0x172))+'or'+a56_0x4d082d[_0x42f9cc(0x262)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x59665f&&console[_0x42f9cc(0x1a1)](_0x59665f);const _0x5b0496=_0xb0e4e8[_0x42f9cc(0x16f)](_0x43534a=>_0x43534a[_0x42f9cc(0x271)])['map'](_0x31858b=>({'title':_0x31858b['displayLine'],'value':_0x31858b[_0x42f9cc(0x271)]})),_0x161fc5=process[_0x42f9cc(0x1fa)][_0x42f9cc(0x1c1)]||0x3c,_0x589fe7=Math[_0x42f9cc(0x114)](0x28,Math[_0x42f9cc(0x225)](_0x161fc5*0x2/0x3)),_0x2103a9=await a56_0x34435f({'type':_0x42f9cc(0x1ff),'name':_0x42f9cc(0x271),'message':_0x42f9cc(0x256),'choices':_0x5b0496,'initial':-0x1,'limit':_0x589fe7,'clearFirst':!![],'fallback':{'title':_0x42f9cc(0x1db),'value':null},'suggest':(_0x2f0085,_0x300fe7)=>{const _0x4d668c=_0x42f9cc;if(!_0x2f0085)return Promise[_0x4d668c(0x235)](_0x300fe7);const _0x46f449=_0x300fe7[_0x4d668c(0x16f)](_0x523b6b=>{const _0x5a4aae=_0x4d668c,_0x30ebcb=_0x523b6b;return _0x30ebcb[_0x5a4aae(0x16c)][_0x5a4aae(0x15b)]()[_0x5a4aae(0x108)](_0x2f0085['toLowerCase']());});return Promise[_0x4d668c(0x235)](_0x46f449);}}),_0x2298d5=()=>{const _0x329661=_0x42f9cc;process['stdout'][_0x329661(0x20a)](_0x329661(0x117)),process[_0x329661(0x1fa)][_0x329661(0x20a)](_0x329661(0x117)),process[_0x329661(0x1fa)][_0x329661(0x20a)]('\x1b[1A\x1b[2K');},_0x1e6f6d=_0x2103a9&&_0x2103a9[_0x42f9cc(0x271)]&&_0x2103a9['attemptId']!==null&&_0x2103a9[_0x42f9cc(0x271)][_0x42f9cc(0x27e)]()!=='';if(!_0x1e6f6d){_0x2298d5(),console[_0x42f9cc(0x1a1)](a56_0x4d082d[_0x42f9cc(0x262)](_0x42f9cc(0x27d)));return;}_0x2298d5();const _0x4b98a5=_0x2c59b0[_0x42f9cc(0x23b)](_0x175637=>_0x175637['lastAttempt']?.['id']===_0x2103a9[_0x42f9cc(0x271)]);if(_0x4b98a5){const _0x5d5a0f=_0x4b98a5['project']?.[_0x42f9cc(0x161)]||'?',_0x318ca9=_0x4b98a5[_0x42f9cc(0x227)]?.[_0x42f9cc(0x161)]||'?';console[_0x42f9cc(0x1a1)](_0x42f9cc(0x19c)+a56_0x4d082d['dim'](_0x5d5a0f)+_0x42f9cc(0xcd)+a56_0x4d082d[_0x42f9cc(0x262)](_0x318ca9));}const _0x9cb1b8=new WorkflowTimelineCommand();await _0x9cb1b8[_0x42f9cc(0x12f)]({'args':[],'options':{..._0x4589fb,'attemptId':_0x2103a9[_0x42f9cc(0x271)]},'tdx':_0x4c5fce});}[a56_0x1ddcb4(0x28a)](_0x547cf6,_0x106f05){const _0x1b705a=a56_0x1ddcb4,_0xbae654=new Map();for(const _0x369451 of _0x547cf6){_0x369451['id']&&_0x369451[_0x1b705a(0x181)]?.['id']&&_0xbae654[_0x1b705a(0x1c0)](_0x369451['id'],_0x369451[_0x1b705a(0x181)]['id']);}const _0x5c68de=[];let _0xa24a62='';const _0x23631b=this[_0x1b705a(0x25b)](_0x547cf6,_0x106f05),_0x402151=_0x23631b[_0x1b705a(0x1e1)]('\x0a');for(const _0x249a05 of _0x402151){if(_0x249a05['startsWith'](_0x1b705a(0xdc))||_0x249a05[_0x1b705a(0x11d)](/^\s+\d{4}-\d{2}-\d{2}/))_0xa24a62=_0x249a05;else{if(_0x249a05['match'](/^[✅❌🔄🛑⏳]/)){const _0x4c77ad=_0x249a05['match'](/#(\d+)/),_0x2cee60=_0x4c77ad?_0x4c77ad[0x1]:null,_0x16076f=_0x2cee60?_0xbae654[_0x1b705a(0x240)](_0x2cee60)||null:null,_0x3072ed=_0x547cf6[_0x1b705a(0x23b)](_0x96c4cd=>_0x96c4cd['id']===_0x2cee60),_0xdcdf9b=_0x3072ed?.[_0x1b705a(0x162)]?.[_0x1b705a(0x161)]||'';_0x5c68de['push']({'displayLine':_0x249a05,'attemptId':_0x16076f,'projectName':_0xdcdf9b});}}}return{'timelineRows':_0x5c68de,'timeAxisHeader':_0xa24a62};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x285);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0xe4);async[a56_0x1ddcb4(0x12f)](_0x47630b){const _0x3ab53a=a56_0x1ddcb4,{options:_0x135f79,args:_0x5ee7d9,tdx:_0x3e840e}=_0x47630b,_0x158f22=this[_0x3ab53a(0x1fd)](_0x5ee7d9,_0x135f79);if(!_0x158f22)return 0x1;const {projectName:_0xa2d34b,workflowName:_0x2b6ba8}=_0x158f22,_0x9eb37e=_0x135f79[_0x3ab53a(0x1ee)];if(_0x135f79[_0x3ab53a(0x199)]){if(_0xa2d34b&&_0x2b6ba8)console[_0x3ab53a(0x12a)](_0x3ab53a(0x23c)+_0xa2d34b+'.'+_0x2b6ba8);else _0xa2d34b&&console[_0x3ab53a(0x12a)](_0x3ab53a(0x1ce)+_0xa2d34b);_0x9eb37e&&console[_0x3ab53a(0x12a)](_0x3ab53a(0x142));}const _0x21276e=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x3e840e[_0x3ab53a(0x227)][_0x3ab53a(0x163)]({'projectName':_0xa2d34b,'workflowName':_0x2b6ba8,'includeRetried':_0x9eb37e,'limit':_0x135f79[_0x3ab53a(0x24e)]}),{'verbose':_0x135f79['verbose']}),_0x570f76=_0x21276e[_0x3ab53a(0x14d)],_0x5dd2b0=_0x135f79['limit']||0x64,_0x306cd8=_0x570f76[_0x3ab53a(0x1ba)]>=_0x5dd2b0?a56_0x4d082d[_0x3ab53a(0x262)](_0x3ab53a(0x1a7)):'';console[_0x3ab53a(0x12a)](_0x3ab53a(0x1b2)+_0x570f76['length']+_0x3ab53a(0x155)+(_0x570f76['length']!==0x1?'s':'')+_0x306cd8);if(_0x135f79[_0x3ab53a(0x123)]===_0x3ab53a(0x1fc)||_0x135f79[_0x3ab53a(0x123)]===_0x3ab53a(0x17d)||_0x135f79[_0x3ab53a(0x123)]===_0x3ab53a(0x257))await handleSDKOutput(_0x570f76,_0x135f79);else{if(_0x570f76['length']===0x0){if(_0xa2d34b&&_0x2b6ba8)console['log'](_0x3ab53a(0xed)+_0xa2d34b+'.'+_0x2b6ba8);else _0xa2d34b?console[_0x3ab53a(0x1a1)](_0x3ab53a(0x1c6)+_0xa2d34b):console[_0x3ab53a(0x1a1)](_0x3ab53a(0x215));}else{const _0x27588e=_0x135f79[_0x3ab53a(0x194)],_0x4d9263=_0x570f76[_0x3ab53a(0x175)](_0xc1ec38=>{const _0x1cc79d=_0x3ab53a,_0x5667ad=a56_0x4d082d['dim']('#'+_0xc1ec38['id']),_0x40a158=_0xc1ec38['project']?.['id'],_0x861377=_0xc1ec38[_0x1cc79d(0x231)]||_0xc1ec38[_0x1cc79d(0x1f2)],_0x6cdc75=_0x40a158&&_0x861377?hyperlink(_0x5667ad,getWorkflowAttemptUrl(_0x27588e,_0x40a158,_0x861377,_0xc1ec38['id'])):_0x5667ad,{icon:_0x5bc767,text:_0x60a4ac}=getAttemptStatusDisplay(_0xc1ec38),_0x479c8a=(_0xc1ec38['project']?.[_0x1cc79d(0x161)]||'?')+'.'+(_0xc1ec38['workflow']?.[_0x1cc79d(0x161)]||'?'),_0xa6acff=_0xc1ec38[_0x1cc79d(0x1c3)]?a56_0x4d082d[_0x1cc79d(0x262)](_0xc1ec38[_0x1cc79d(0x1c3)]):'';return(_0x6cdc75+'\x20'+_0x5bc767+(_0x60a4ac?'\x20'+_0x60a4ac:'')+'\x20'+_0x479c8a+'\x20'+_0xa6acff)[_0x1cc79d(0x233)]();});await writeOutput(_0x4d9263[_0x3ab53a(0x13b)]('\x0a'),_0x135f79['output'],_0x3ab53a(0x13c));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]='workflow:attempt';[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x1ea);async[a56_0x1ddcb4(0x12f)](_0x2b9e6f){const _0x3e09e7=a56_0x1ddcb4,{options:_0x44fa72,args:_0x3e2e0e,tdx:_0x516b3f}=_0x2b9e6f,_0x4bf4f2=_0x3e2e0e[0x0];if(!_0x4bf4f2)return console[_0x3e09e7(0x12a)](_0x3e09e7(0x237)),0x1;_0x44fa72['verbose']&&console[_0x3e09e7(0x12a)]('Attempt\x20ID:\x20'+_0x4bf4f2);const _0x2458a9=await withSpinner(_0x3e09e7(0x17b),()=>_0x516b3f['workflow']['attempt'](_0x4bf4f2),{'verbose':_0x44fa72[_0x3e09e7(0x199)]}),_0x152659=_0x2458a9[_0x3e09e7(0x14d)];let _0x3e1281;!_0x152659[_0x3e09e7(0x1bd)]?_0x3e1281=_0x152659[_0x3e09e7(0x269)]?_0x3e09e7(0x148):_0x3e09e7(0x179):_0x3e1281=_0x152659[_0x3e09e7(0x283)]?_0x3e09e7(0x283):_0x3e09e7(0x12a);let _0x1a247f;if(_0x152659[_0x3e09e7(0x245)]&&_0x152659['finishedAt']){const _0x30a5d1=new Date(_0x152659[_0x3e09e7(0x245)])[_0x3e09e7(0x1b4)](),_0x334cc2=new Date(_0x152659['finishedAt'])[_0x3e09e7(0x1b4)]();_0x1a247f=Math[_0x3e09e7(0x226)]((_0x334cc2-_0x30a5d1)/0x3e8);}const _0x840cf2={'attempt_id':_0x152659['id'],'status':_0x3e1281,..._0x152659['index']!==undefined&&{'index':_0x152659[_0x3e09e7(0x261)]},..._0x152659['project']&&{'project':_0x152659['project'][_0x3e09e7(0x161)]},..._0x152659['workflow']&&{'workflow':_0x152659['workflow'][_0x3e09e7(0x161)]},..._0x152659['sessionId']&&{'session_id':_0x152659[_0x3e09e7(0x1f2)]},..._0x152659[_0x3e09e7(0x1c3)]&&{'session_time':_0x152659[_0x3e09e7(0x1c3)]},..._0x152659['retryAttemptName']&&{'retry_attempt':_0x152659[_0x3e09e7(0x17a)]},..._0x1a247f!==undefined&&{'duration_sec':_0x1a247f},..._0x152659[_0x3e09e7(0x245)]&&{'created_at':_0x152659['createdAt']},..._0x152659[_0x3e09e7(0x276)]&&{'finished_at':_0x152659['finishedAt']},...Object['keys'](_0x152659[_0x3e09e7(0x230)])[_0x3e09e7(0x1ba)]>0x0&&{'params':_0x152659[_0x3e09e7(0x230)]}};return await handleSingleObjectOutput(_0x840cf2,_0x44fa72),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x29b);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x221);async[a56_0x1ddcb4(0x12f)](_0x17646d){const _0x315893=a56_0x1ddcb4,{options:_0x4ae67a,args:_0x4b85f4,tdx:_0x23c30f}=_0x17646d,_0x408bdb=_0x4b85f4[0x0];if(!_0x408bdb)return console[_0x315893(0x12a)](_0x315893(0x237)),0x1;const _0x50a2e2=_0x4ae67a[_0x315893(0x217)];_0x4ae67a['verbose']&&(console[_0x315893(0x12a)](_0x315893(0x14c)+_0x408bdb),_0x50a2e2&&console[_0x315893(0x12a)](_0x315893(0x189)));const _0xdd7580=await withSpinner(_0x315893(0x188),()=>_0x23c30f[_0x315893(0x227)]['tasks'](_0x408bdb,_0x50a2e2||![]),{'verbose':_0x4ae67a[_0x315893(0x199)]}),_0x11bd63=_0xdd7580[_0x315893(0x14d)];return console['error'](_0x315893(0x1b2)+_0x11bd63[_0x315893(0x1ba)]+_0x315893(0x213)+(_0x11bd63[_0x315893(0x1ba)]!==0x1?'s':'')),await handleSDKOutput(_0x11bd63,_0x4ae67a),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x205);async[a56_0x1ddcb4(0x12f)](_0x4b093f){const _0x56c202=a56_0x1ddcb4,{options:_0x5acda1,args:_0x524267,tdx:_0x12331f}=_0x4b093f,_0x547ed0=_0x524267[0x0];let _0x2be55b=_0x524267[0x1];if(!_0x547ed0)return console[_0x56c202(0x12a)](_0x56c202(0x237)),0x1;_0x5acda1[_0x56c202(0x199)]&&(console[_0x56c202(0x12a)](_0x56c202(0x14c)+_0x547ed0),_0x2be55b&&console[_0x56c202(0x12a)](_0x56c202(0x1e6)+_0x2be55b));const _0xae4eab=await withSpinner(_0x56c202(0x132),()=>_0x12331f[_0x56c202(0x227)][_0x56c202(0x1ac)](_0x547ed0,_0x2be55b),{'verbose':_0x5acda1[_0x56c202(0x199)]}),_0x283513=_0xae4eab[_0x56c202(0x14d)];if(_0x283513[_0x56c202(0x1ba)]===0x0)return console[_0x56c202(0x12a)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2be55b&&(_0x5acda1[_0x56c202(0x1fc)]||_0x5acda1[_0x56c202(0x123)]))return await handleSDKOutput(_0x283513,_0x5acda1),0x0;if(!_0x2be55b){const _0x16f62a=_0x283513[_0x56c202(0x175)](_0x12c77a=>({'title':_0x12c77a['taskName']+'\x20('+formatBytes(_0x12c77a['fileSize'])+')','value':_0x12c77a[_0x56c202(0xd2)]})),_0x43dae5=await a56_0x34435f({'type':_0x56c202(0xca),'name':'task','message':_0x56c202(0x127),'choices':_0x16f62a});if(!_0x43dae5[_0x56c202(0x24b)])return console[_0x56c202(0x12a)](_0x56c202(0x27d)),0x0;_0x2be55b=_0x43dae5['task'];}const _0x5c0a7c=await withSpinner(_0x56c202(0xfe),()=>_0x12331f[_0x56c202(0x227)][_0x56c202(0x211)](_0x547ed0,_0x2be55b),{'verbose':_0x5acda1[_0x56c202(0x199)]}),_0x55f1f5=_0x5c0a7c['data'];return _0x55f1f5?console['log'](_0x55f1f5):console['error'](_0x56c202(0x136)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0xe2);['description']=a56_0x1ddcb4(0x111);async[a56_0x1ddcb4(0x12f)](_0x305a84){const _0x5bb41d=a56_0x1ddcb4,{options:_0x1049d0,args:_0x2c5be6,tdx:_0x418186}=_0x305a84,_0x16cc32=_0x2c5be6[0x0];if(!_0x16cc32)return console[_0x5bb41d(0x12a)](_0x5bb41d(0x237)),0x1;const _0x57b906=_0x1049d0['reason'];_0x1049d0[_0x5bb41d(0x199)]&&(console[_0x5bb41d(0x12a)](_0x5bb41d(0x14c)+_0x16cc32),_0x57b906&&console[_0x5bb41d(0x12a)](_0x5bb41d(0x149)+_0x57b906));if(!_0x1049d0[_0x5bb41d(0x115)]){if(!isInteractive())return console[_0x5bb41d(0x12a)](a56_0x4d082d[_0x5bb41d(0x171)](_0x5bb41d(0x18d)),_0x5bb41d(0x209)),console[_0x5bb41d(0x12a)](a56_0x4d082d[_0x5bb41d(0x262)](_0x5bb41d(0x1b5))),0x1;const _0x40e48f=await confirmKey(_0x5bb41d(0xce)+_0x16cc32+'?');if(!_0x40e48f)return console['error'](a56_0x4d082d[_0x5bb41d(0x288)](_0x5bb41d(0x27d))),0x1;}const _0x202a50=await withSpinner(_0x5bb41d(0x268),()=>_0x418186['workflow']['kill'](_0x16cc32,_0x57b906),{'verbose':_0x1049d0[_0x5bb41d(0x199)]}),_0x85dfe6=_0x202a50['data'];return console[_0x5bb41d(0x12a)]('✔\x20'+_0x85dfe6),0x0;}}function a56_0x498a(){const _0x460899=['Session\x20time:','sourceProjectName','value','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','basename','---\x20','listSchedules','projectId','/attempt/','Starting\x20workflow\x20run...','workflow:tasks','updatedAt','workflow:clone','\x20disabled\x20(','Pull\x20workflow\x20project\x20to\x20local\x20folder','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','padStart','bold','now','projectName','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Total:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','→\x20New\x20project:\x20','select','LABEL_MIN_SPACING','attempt:',',\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','Listing\x20schedules\x20for\x20','start','taskName','white','session:','workflows','utf-8','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','List\x20all\x20workflow\x20projects','disabledAt','existingProjectId','executeDryRun','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Listing\x20workflows...','No\x20projects\x20match\x20pattern:\x20','\x20\x20Revision:\x20','Source\x20directory\x20is\x20required','645250SdLVVV','workflow:kill','context','List\x20workflow\x20attempts','navigateSessionsInteractive','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Project\x20ID:\x20','description','...','newProjectId','tasks','No\x20attempts\x20found\x20for:\x20','unknown','List\x20workflow\x20execution\x20sessions','size','pullProject','(use\x20--limit\x20to\x20see\x20more)','workflow:workflows','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Resume\x20from:\x20','No\x20workflow\x20sessions\x20found','renderTimeline','Workflow:\x20','parse','workflow:sessions','green','\x20\x20Session\x20context\x20set\x20to:\x20','listSecrets','Downloading\x20logs...','4tbfOZR','Tip:\x20cd\x20to\x20workflows/','\x0a✔\x20Already\x20up\x20to\x20date','getFullYear','push','✔\x20Schedule\x20found','tdx.json','Error:','status','includes','No\x20workflow\x20projects\x20found','applyPullProject','✔\x20Workflow\x20project\x20context\x20cleared.','isTTY','Loading\x20workflows...','sys','nextRunTime','Expected\x20format:\x20--param\x20key=value','Kill\x20a\x20running\x20attempt','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','max','yes','requireProject','\x1b[1A\x1b[2K','fullName','\x20-\x20','workflow:use','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','📁\x20','match','\x20secret','projects','9qvGmuI','pending','workflow:run','format','Writing\x20files...','\x0a✔\x20No\x20changes\x20to\x20push','Select\x20a\x20workflow\x20to\x20run','Select\x20a\x20task\x20to\x20view\x20logs:','Analyzing\x20changes...','repeat','error','workflow:projects','Output\x20directory:\x20','✔\x20Downloaded\x20','\x20\x20tdx\x20wf\x20use\x20<project>','execute','fromTask','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Fetching\x20log\x20files...','\x20\x20Console:\x20','13181BJdUQM','startsWith','No\x20log\x20content\x20found','blue','localeCompare','cwd','workflow:schedule:disable','join','list','filesExtracted','696363vZmLrr','force','sort','\x20(disabled)','Include\x20retried:\x20yes','Retrying\x20attempt...','download','366AanqQE','No\x20sessions\x20found\x20for:\x20','\x20\x20Attempt\x20ID:\x20','canceling','Reason:\x20','startTime','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Attempt\x20ID:\x20','data','Error:\x20Project\x20name\x20is\x20required','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20Changes:\x20','New\x20project\x20name:\x20','\x20modified','649690ATLNJA','\x0aApply\x20these\x20changes?','\x20attempt','isNewProject','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','💡\x20Tip:\x20Use\x20','retryAttempt','dryRun','toLowerCase','stringify','from','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','getHours','name','project','attempts','Listing\x20workflow\x20sessions...','Auto-selected\x20latest\x20session:\x20','Project\x20directory:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','toISOString','readFile','List\x20workflows','workflow:secrets:set','title','fileCount','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','filter','cyan','red','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','min','\x20\x20Location:\x20','map','972yuflNv','fill','workflow:pull','running','retryAttemptName','Getting\x20attempt\x20details...','\x20\x20Files\x20extracted:\x20','jsonl','Listing\x20secrets...','Workflow:','Parameters:\x20','lastAttempt','ICON_WIDTH','Loading\x20session...','\x20secrets...','No\x20schedules\x20found','workflow:upload','hasChanges','Getting\x20attempt\x20tasks...','Including\x20subtasks:\x20yes','Revision:\x20','Status:\x20','✔\x20Project\x20updated','\x0aError:','toLocaleString','\x20new','\x20\x20Project:\x20','slice','MIN_TIMELINE_WIDTH','getSchedule','site','columns','workflowProject','MAX_POLL_ITERATIONS','No\x20workflow\x20tdx.json\x20found','verbose','Latest\x20session\x20has\x20no\x20attempt','workflowName','Project:\x20','indexOf','POLL_INTERVAL_MS','sourceDir','splice','log','getMonth','config','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Usage:\x20workflow:delete\x20<project-name-or-id>','MAX_TIMELINE_WIDTH','\x20(use\x20--limit\x20to\x20show\x20more)','startedAt','\x20sessions\x20','Validation:\x20skipped','✔\x20Showing\x20','logFiles','newProjectName','(unknown)','-\x20no\x20files\x20written','\x20\x20New\x20attempt\x20ID:\x20','executePushProject','✔\x20Found\x20','No\x20sessions\x20found','getTime','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','showWorkflowConsoleUrl','Fetching\x20workflow\x20','getDate','✔\x20Schedule\x20#','length','No\x20workflows\x20found','Enabling\x20schedule\x20#','done','Disabling\x20schedule\x20#','enableSchedule','set','rows','\x0a✔\x20Attempt\x20complete','sessionTime','\x20unchanged','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','No\x20attempts\x20found\x20in\x20project:\x20','some','new','executeCloneProject','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','type','\x27...','\x0a⚠\x20Project\x20\x22','Filter:\x20project=','\x20\x20Source:\x20','replace','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','skipValidation','follow','summary','state','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','No\x20sessions\x20found\x20in\x20project:\x20','\x0aDry\x20run\x20-\x20no\x20project\x20created','MIN_LABEL_COUNT','duration','No\x20matching\x20sessions\x20found','session','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','\x20deleted','Loading\x20sessions...','\x20session','split','\x20of\x20','\x22\x20already\x20exists\x20(ID:\x20','\x20is\x20not\x20a\x20directory','resumeFrom','Task\x20name:\x20','Pushing\x20workflow\x20project...','Analyzing\x20project...','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','Show\x20specific\x20attempt\x20details','Project\x20filter:\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','\x0aDry\x20run\x20-\x20nothing\x20pushed','includeRetried','\x0aPolling...\x20(','\x20\x20Session\x20ID:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','sessionId','window','Dry\x20run:\x20yes','deleteSecret','getWorkflow','\x0aClone\x20\x22','stat','targetDir','stdout','Listing\x20workflow\x20projects...','json','parseProjectWorkflowPattern','No\x20workflows\x20found\x20in\x20project:\x20','autocomplete','✔\x20Workflow\x20run\x20started','✔\x20Project:\x20','output','MAX_TASKS_DISPLAY','✔\x20Retry\x20started','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','changes','end','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','write','attempt','Start\x20a\x20workflow\x20run','fs/promises','\x20\x20Workflow:\x20','path','311943naeKBb','logs','planned','\x20task','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','No\x20attempts\x20found','metadata','includeSubtasks','run','workflow:timeline','Downloading\x20project\x20','ICON_SPACING','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x0aUpdate\x20existing\x20project\x20\x22','unchanged','✔\x20Secret\x20\x27','Target:\x20','Show\x20tasks\x20for\x20an\x20attempt','buildTimelineData','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','/sessions/','floor','round','workflow','-\x20nothing\x20pushed','\x22?\x20This\x20cannot\x20be\x20undone.','listProjectSchedules','Project\x20name\x20is\x20required','LABEL_WIDTH_DIVISOR','substring','relative','workflow:download','params','session_id','prepareCloneProject','trimEnd','pollTimeline','resolve','2qoPzfV','Error:\x20Attempt\x20ID\x20is\x20required','Parameters:','sessions','No\x20sessions\x20with\x20timing\x20information','find','Filter:\x20','/app/workflows/','msPerChar','Pattern:\x20','get','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','✔\x20Pull\x20complete','createdAt','✔\x20Deleted\x20project\x20','durationMs','diff','Deleting\x20project\x20','Source\x20project:\x20','task','Deleting\x20secret...','preparePushProject','limit','\x20(system)','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','param','\x20project','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Files\x20to\x20upload:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','table','Pushing\x20project...','Error:\x20Invalid\x20JSON\x20in\x20--params','workflow:secrets:delete','renderSessionsTimeline','\x20secrets\x20set\x20for\x20project\x20\x27','Source\x20directory:\x20','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','36454zDmZrt','index','dim','✔\x20Clone\x20complete','revision:\x20','targetExists','revision','Fetching\x20schedule\x20#','Killing\x20attempt...','cancelRequested','Pulling\x20project\x20','Key:\x20','workflow:retry','all','group_error','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','attemptId','\x20next:\x20','Resolving\x20project\x20\x27','message','resolveProject','finishedAt','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Using\x20attempt\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','Source:\x20','Session\x20not\x20found:\x20','\x27\x20from\x20project\x20\x27','Cancelled','trim','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','keys','\x20enabled\x20(','skipSchedule','success','\x22\x20with\x20new\x20revision?','workflow:attempts','\x0aPush\x20these\x20changes?','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','yellow','modified','generateSessionTimelineRows','1262696loZkgG','renderSingleTimeline','Error:\x20Invalid\x20parameter\x20format:\x20','retrySession','\x22\x20to\x20new\x20project\x20\x22','\x0aDry\x20run\x20-\x20no\x20files\x20written'];a56_0x498a=function(){return _0x460899;};return a56_0x498a();}export class WorkflowRetryCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x26c);[a56_0x1ddcb4(0xe9)]='Retry\x20a\x20session\x20or\x20attempt';async['execute'](_0x13c540){const _0x3265e7=a56_0x1ddcb4,{options:_0x4c0eff,args:_0x1c9ef2,tdx:_0x6653a3}=_0x13c540,_0x47d09d=_0x1c9ef2[0x0];if(!_0x47d09d)return console[_0x3265e7(0x12a)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3265e7(0x12a)](_0x3265e7(0x26f)),0x1;let _0x4e5bb4=![],_0x2b11c2=_0x47d09d;if(_0x47d09d['startsWith'](_0x3265e7(0xd4)))_0x4e5bb4=!![],_0x2b11c2=_0x47d09d[_0x3265e7(0x22d)](0x8);else{if(_0x47d09d[_0x3265e7(0x135)](_0x3265e7(0xcc)))_0x4e5bb4=![],_0x2b11c2=_0x47d09d['substring'](0x8);else return console[_0x3265e7(0x12a)](_0x3265e7(0x16e)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1820c9=_0x4c0eff[_0x3265e7(0x130)],_0x5c9e68=_0x4c0eff[_0x3265e7(0x1e5)],_0xcb696d=_0x4c0eff[_0x3265e7(0x230)],_0x1355a6=_0x4c0eff[_0x3265e7(0x13f)];_0x4c0eff[_0x3265e7(0x199)]&&(console[_0x3265e7(0x12a)](_0x3265e7(0x220)+(_0x4e5bb4?_0x3265e7(0x1dc):'attempt')+'\x20'+_0x2b11c2),_0x1820c9&&console[_0x3265e7(0x12a)]('From\x20task:\x20'+_0x1820c9),_0x5c9e68&&console['error'](_0x3265e7(0xf5)+_0x5c9e68),_0xcb696d&&console[_0x3265e7(0x12a)]('Params:\x20'+_0xcb696d),_0x1355a6&&console[_0x3265e7(0x12a)]('Force:\x20yes'));let _0x3b1a37;if(_0xcb696d)try{if(_0xcb696d[_0x3265e7(0x135)]('@')){const _0x4d7f11=await import(_0x3265e7(0x20d)),_0x55c7d0=_0xcb696d['substring'](0x1),_0xdb450f=await _0x4d7f11[_0x3265e7(0x169)](_0x55c7d0,_0x3265e7(0xd6));_0x3b1a37=JSON[_0x3265e7(0xf9)](_0xdb450f);}else _0x3b1a37=JSON[_0x3265e7(0xf9)](_0xcb696d);}catch{return console[_0x3265e7(0x12a)](_0x3265e7(0x259)),0x1;}if(!_0x4c0eff[_0x3265e7(0x115)]){if(!isInteractive())return console[_0x3265e7(0x12a)](a56_0x4d082d[_0x3265e7(0x171)](_0x3265e7(0x18d)),_0x3265e7(0x209)),console[_0x3265e7(0x12a)](a56_0x4d082d[_0x3265e7(0x262)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x564218=await confirmKey(_0x3265e7(0xc6)+(_0x4e5bb4?_0x3265e7(0x1dc):_0x3265e7(0x20b))+'\x20'+_0x2b11c2+'?');if(!_0x564218)return console[_0x3265e7(0x12a)](a56_0x4d082d[_0x3265e7(0x288)](_0x3265e7(0x27d))),0x1;}let _0x2bd5a3;_0x4e5bb4?_0x2bd5a3=await withSpinner('Retrying\x20session...',()=>_0x6653a3[_0x3265e7(0x227)][_0x3265e7(0x28e)](_0x2b11c2,{'fromTask':_0x1820c9,'retryParams':_0x3b1a37}),{'verbose':_0x4c0eff['verbose']}):_0x2bd5a3=await withSpinner(_0x3265e7(0x143),()=>_0x6653a3[_0x3265e7(0x227)][_0x3265e7(0x159)](_0x2b11c2,{'resumeFrom':_0x5c9e68,'retryParams':_0x3b1a37,'force':_0x1355a6}),{'verbose':_0x4c0eff[_0x3265e7(0x199)]});const _0x195801=_0x2bd5a3[_0x3265e7(0x14d)];return console[_0x3265e7(0x12a)](_0x3265e7(0x204)),console['error'](_0x3265e7(0x1b0)+_0x195801['attemptId']),console[_0x3265e7(0x12a)](_0x3265e7(0x1f0)+_0x195801[_0x3265e7(0x1f2)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x122);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x20c);async[a56_0x1ddcb4(0x12f)](_0x4eead0){const _0x323486=a56_0x1ddcb4,{options:_0x16737e,args:_0x661505,tdx:_0x4b8705}=_0x4eead0;let _0x13a580=_0x661505[0x0];if(!_0x13a580){const _0x3e816e=this[_0x323486(0x275)]([],_0x16737e),_0x2988e3=await withSpinner(_0x323486(0x10d),()=>_0x4b8705[_0x323486(0x227)][_0x323486(0xd5)](_0x3e816e,{'limit':_0x16737e[_0x323486(0x24e)]}),{'verbose':_0x16737e[_0x323486(0x199)]}),_0x38b550=_0x2988e3[_0x323486(0x14d)];if(_0x38b550[_0x323486(0x1ba)]===0x0)return console[_0x323486(0x12a)](_0x323486(0x1bb)),!_0x3e816e&&console[_0x323486(0x12a)](a56_0x4d082d['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x55cf59=_0x38b550['map'](_0x4fb9f3=>({'title':_0x4fb9f3[_0x323486(0x162)]?.[_0x323486(0x161)]+'.'+_0x4fb9f3[_0x323486(0x161)],'value':_0x4fb9f3[_0x323486(0x162)]?.[_0x323486(0x161)]+'.'+_0x4fb9f3[_0x323486(0x161)],'description':_0x4fb9f3[_0x323486(0x266)]?_0x323486(0x264)+_0x4fb9f3['revision']:undefined})),_0x499f14=await a56_0x34435f({'type':_0x323486(0xca),'name':_0x323486(0x227),'message':_0x323486(0x126),'choices':_0x55cf59});if(!_0x499f14['workflow'])return 0x1;_0x13a580=_0x499f14[_0x323486(0x227)];}if(!_0x13a580['includes']('.')){const _0x2535fc=this['resolveProject']([],_0x16737e);if(_0x2535fc)_0x13a580=_0x2535fc+'.'+_0x13a580;else return console[_0x323486(0x12a)](a56_0x4d082d[_0x323486(0x171)](_0x323486(0x106)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console[_0x323486(0x12a)](a56_0x4d082d[_0x323486(0x262)](_0x323486(0x2a0))),0x1;}const _0x30b777=_0x16737e[_0x323486(0x251)],_0xfd929b=_0x16737e[_0x323486(0x1c3)],_0x4123d2={};if(_0x30b777&&Array['isArray'](_0x30b777))for(const _0x7962db of _0x30b777){const _0x1fa9e9=_0x7962db[_0x323486(0x19d)]('=');if(_0x1fa9e9===-0x1)return console[_0x323486(0x12a)](_0x323486(0x28d)+_0x7962db),console[_0x323486(0x12a)](_0x323486(0x110)),0x1;const _0x1908cf=_0x7962db[_0x323486(0x22d)](0x0,_0x1fa9e9),_0x1ed0fe=_0x7962db[_0x323486(0x22d)](_0x1fa9e9+0x1);try{_0x4123d2[_0x1908cf]=JSON['parse'](_0x1ed0fe);}catch{_0x4123d2[_0x1908cf]=_0x1ed0fe;}}_0x16737e[_0x323486(0x199)]&&(console[_0x323486(0x12a)](_0x323486(0xf8)+_0x13a580),Object[_0x323486(0x280)](_0x4123d2)[_0x323486(0x1ba)]>0x0&&console[_0x323486(0x12a)](_0x323486(0x180)+JSON[_0x323486(0x15c)](_0x4123d2)),_0xfd929b&&console['error']('Session\x20time:\x20'+_0xfd929b));if(_0x16737e[_0x323486(0x15a)])return await this[_0x323486(0xdb)](_0x4eead0,_0x13a580,_0x4123d2,_0xfd929b);const _0x3648d8=await withSpinner(_0x323486(0x29a),()=>_0x4b8705[_0x323486(0x227)][_0x323486(0x218)](_0x13a580,_0x4123d2,{'sessionTime':_0xfd929b}),{'verbose':_0x16737e[_0x323486(0x199)]}),_0x5c7162=_0x3648d8[_0x323486(0x14d)];console[_0x323486(0x12a)](_0x323486(0x200)),console[_0x323486(0x12a)](_0x323486(0x147)+_0x5c7162['id']),console[_0x323486(0x12a)]('\x20\x20Session\x20ID:\x20'+_0x5c7162[_0x323486(0x1f2)]),console['error']('\x20\x20Project:\x20'+_0x5c7162['project']?.['name']),console[_0x323486(0x12a)](_0x323486(0x20e)+_0x5c7162[_0x323486(0x227)]?.[_0x323486(0x161)]);if(_0x5c7162[_0x323486(0x162)]?.['id']&&_0x5c7162['sessionId']&&_0x5c7162['id']){const _0x153378=_0x16737e[_0x323486(0x194)],_0x16b84c=getConsoleUrl(_0x153378,_0x323486(0x23d)+_0x5c7162[_0x323486(0x162)]['id']+_0x323486(0x224)+_0x5c7162['sessionId']+_0x323486(0x299)+_0x5c7162['id']);console[_0x323486(0x12a)]('\x20\x20Console:\x20'+a56_0x4d082d[_0x323486(0x170)](_0x16b84c));}return 0x0;}async[a56_0x1ddcb4(0xdb)](_0x68cc9d,_0x12f77c,_0x28122a,_0x3888f7){const _0x3d36fd=a56_0x1ddcb4,{options:_0x5cdb9a,tdx:_0x169d8c}=_0x68cc9d,_0xbc4471=await withSpinner(_0x3d36fd(0x1b7)+_0x12f77c+'...',()=>_0x169d8c['workflow'][_0x3d36fd(0x1f6)](_0x12f77c),{'verbose':_0x5cdb9a[_0x3d36fd(0x199)]}),_0x1299ee=_0xbc4471[_0x3d36fd(0x14d)],_0x3d8b87=_0x3888f7??new Date()[_0x3d36fd(0x168)]();console[_0x3d36fd(0x1a1)](a56_0x4d082d[_0x3d36fd(0xc3)](_0x3d36fd(0x17f)),_0x12f77c),console['log'](a56_0x4d082d[_0x3d36fd(0xc3)](_0x3d36fd(0x291)),_0x3d8b87),console['log'](a56_0x4d082d[_0x3d36fd(0xc3)](_0x3d36fd(0x238)),JSON[_0x3d36fd(0x15c)](_0x28122a)),console[_0x3d36fd(0x1a1)](''),console[_0x3d36fd(0x1a1)](a56_0x4d082d['bold']('Task\x20graph:'));const _0x4679de=parseTaskGraph(_0x1299ee[_0x3d36fd(0x1a3)]??null);if(_0x4679de['length']===0x0)console[_0x3d36fd(0x1a1)](a56_0x4d082d['dim'](_0x3d36fd(0x270)));else for(const _0xcbdf4f of formatTaskGraph(_0x4679de)){console[_0x3d36fd(0x1a1)](_0xcbdf4f);}const _0x1970bc=summarizeTaskGraph(_0x4679de),_0x237d19=formatWarningSummary(_0x1970bc);return _0x237d19&&(console['log'](''),console[_0x3d36fd(0x1a1)](a56_0x4d082d[_0x3d36fd(0x288)](_0x237d19))),console[_0x3d36fd(0x1a1)](a56_0x4d082d[_0x3d36fd(0x288)](_0x3d36fd(0x11b))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x22f);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x294);async[a56_0x1ddcb4(0x12f)](_0x23e098){const _0x215c16=a56_0x1ddcb4,{options:_0x275c99,args:_0x2f4ce7,tdx:_0x2aa390}=_0x23e098,_0x19df39=_0x2f4ce7[0x0],_0x3b6e77=_0x2f4ce7[0x1]||'.';if(!_0x19df39)return console[_0x215c16(0x12a)](_0x215c16(0x14e)),console[_0x215c16(0x12a)](_0x215c16(0x206)),0x1;const _0x35dc38=_0x275c99[_0x215c16(0x266)];_0x275c99[_0x215c16(0x199)]&&(console[_0x215c16(0x12a)](_0x215c16(0x19c)+_0x19df39),console[_0x215c16(0x12a)](_0x215c16(0x12c)+_0x3b6e77),_0x35dc38&&console[_0x215c16(0x12a)](_0x215c16(0x18a)+_0x35dc38));const _0x3ef6bf=await withSpinner(_0x215c16(0x21a)+_0x19df39+_0x215c16(0xea),()=>_0x2aa390[_0x215c16(0x227)][_0x215c16(0x144)](_0x19df39,_0x3b6e77,{'revision':_0x35dc38}),{'verbose':_0x275c99[_0x215c16(0x199)]}),_0x19678e=_0x3ef6bf[_0x215c16(0x14d)];return console['error'](_0x215c16(0x12d)+_0x19678e[_0x215c16(0xc5)]),console['error'](_0x215c16(0xdf)+_0x19678e[_0x215c16(0x266)]),console[_0x215c16(0x12a)](_0x215c16(0x17c)+_0x19678e[_0x215c16(0x13d)]),console['error'](_0x215c16(0x174)+_0x3b6e77+'/'+_0x19678e[_0x215c16(0xc5)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a56_0x1ddcb4(0x186);['description']=a56_0x1ddcb4(0x1ca);async[a56_0x1ddcb4(0x12f)](_0x13b3cf){const _0x170b61=a56_0x1ddcb4,{options:_0x28ec8c,args:_0xfe6f10,tdx:_0x5962d8}=_0x13b3cf;let _0x5001fa='.',_0x958ed4=_0x28ec8c[_0x170b61(0x161)];if(_0xfe6f10[0x0]){const {promises:_0x38e29e}=await import('fs');try{const _0x22f49b=await _0x38e29e[_0x170b61(0x1f8)](_0xfe6f10[0x0]);if(_0x22f49b['isDirectory']())_0x5001fa=_0xfe6f10[0x0];else return console[_0x170b61(0x12a)]('Error:\x20'+_0xfe6f10[0x0]+_0x170b61(0x1e4)),0x1;}catch{_0x958ed4=_0xfe6f10[0x0],_0x5001fa='.';}}const _0x511dda=_0x28ec8c['revision'],_0x582887=_0x28ec8c['skipValidation'];_0x28ec8c['verbose']&&(console[_0x170b61(0x12a)](_0x170b61(0x166)+_0x5001fa),_0x958ed4&&console[_0x170b61(0x12a)]('Project\x20name:\x20'+_0x958ed4),_0x511dda&&console[_0x170b61(0x12a)](_0x170b61(0x18a)+_0x511dda),_0x582887&&console['error'](_0x170b61(0x1aa)));const _0x1bd667=await withSpinner(_0x170b61(0x1e7),()=>_0x5962d8[_0x170b61(0x227)][_0x170b61(0x103)](_0x5001fa,{'projectName':_0x958ed4,'revision':_0x511dda,'skipValidation':_0x582887}),{'verbose':_0x28ec8c['verbose']}),_0x2a6eb3=_0x1bd667[_0x170b61(0x14d)];return console[_0x170b61(0x12a)]('✔\x20Pushed\x20'+_0x2a6eb3[_0x170b61(0xc5)]),console['error'](_0x170b61(0xe8)+_0x2a6eb3[_0x170b61(0x298)]),console[_0x170b61(0x12a)](_0x170b61(0xdf)+_0x2a6eb3[_0x170b61(0x266)]),await this['showWorkflowConsoleUrl'](_0x5962d8,_0x2a6eb3[_0x170b61(0xc5)],_0x28ec8c[_0x170b61(0x194)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x178);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x29f);async[a56_0x1ddcb4(0x12f)](_0x30cb56){const _0x1faed0=a56_0x1ddcb4,{options:_0x3fb6d7,args:_0x183e85,tdx:_0x3671b1}=_0x30cb56,_0x410995=_0x183e85[0x0],_0x3a19b8=_0x183e85[0x1];if(!_0x410995)return console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0x171)](_0x1faed0(0x106)),'Project\x20name\x20is\x20required'),console[_0x1faed0(0x12a)](a56_0x4d082d['dim'](_0x1faed0(0xc8))),0x1;const _0x1aff34=_0x3fb6d7[_0x1faed0(0x266)];_0x3fb6d7['verbose']&&(console[_0x1faed0(0x12a)](_0x1faed0(0x19c)+_0x410995),_0x3a19b8&&console[_0x1faed0(0x12a)]('Target\x20directory:\x20'+_0x3a19b8),_0x1aff34&&console[_0x1faed0(0x12a)](_0x1faed0(0x18a)+_0x1aff34),_0x3fb6d7[_0x1faed0(0x15a)]&&console[_0x1faed0(0x12a)](_0x1faed0(0x1f4)));const _0x271062=await withSpinner(_0x1faed0(0x26a)+_0x410995+_0x1faed0(0xea),()=>_0x3671b1[_0x1faed0(0x227)][_0x1faed0(0xf1)](_0x410995,{'targetDir':_0x3a19b8,'revision':_0x1aff34}),{'verbose':_0x3fb6d7[_0x1faed0(0x199)]}),_0x3b8cd4=_0x271062[_0x1faed0(0x14d)];_0x3b8cd4[_0x1faed0(0x156)]?console[_0x1faed0(0x12a)](_0x1faed0(0xc9)+_0x3b8cd4[_0x1faed0(0xc5)]):console['error']('→\x20Project:\x20'+_0x3b8cd4[_0x1faed0(0xc5)]);console[_0x1faed0(0x12a)](_0x1faed0(0xdf)+_0x3b8cd4[_0x1faed0(0x266)]),console['error']('\x20\x20Target:\x20'+(a56_0x1268de[_0x1faed0(0x22e)](process[_0x1faed0(0x139)](),_0x3b8cd4[_0x1faed0(0x1f9)])||'.')),console['error'](_0x1faed0(0x150)+a56_0x4d082d[_0x1faed0(0xfb)]('+'+_0x3b8cd4['summary'][_0x1faed0(0x1c8)]+_0x1faed0(0x18f))+',\x20'+(a56_0x4d082d[_0x1faed0(0x288)]('~'+_0x3b8cd4[_0x1faed0(0x1d4)]['modified']+_0x1faed0(0x152))+',\x20')+(a56_0x4d082d[_0x1faed0(0x171)]('-'+_0x3b8cd4[_0x1faed0(0x1d4)]['deleted']+_0x1faed0(0x1de))+',\x20')+(''+a56_0x4d082d[_0x1faed0(0x262)](_0x3b8cd4[_0x1faed0(0x1d4)][_0x1faed0(0x21e)]+'\x20unchanged')));for(const _0x5cb72b of _0x3b8cd4[_0x1faed0(0x207)]){_0x5cb72b['type']===_0x1faed0(0x289)&&_0x5cb72b[_0x1faed0(0x248)]&&(console[_0x1faed0(0x12a)]('\x0a'+a56_0x4d082d['cyan'](_0x1faed0(0x296)+_0x5cb72b[_0x1faed0(0x20f)])),console[_0x1faed0(0x12a)](_0x5cb72b[_0x1faed0(0x248)]));}if(!_0x3b8cd4[_0x1faed0(0x187)])return saveSessionContext({'workflow_project':_0x3b8cd4[_0x1faed0(0xc5)]},_0x3fb6d7[_0x1faed0(0x1dc)]),console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0xfb)](_0x1faed0(0x101))),console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0x262)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x3b8cd4[_0x1faed0(0xc5)])),0x0;if(_0x3fb6d7[_0x1faed0(0x15a)])return console['error'](a56_0x4d082d[_0x1faed0(0x288)](_0x1faed0(0x290))),0x0;if(!_0x3fb6d7[_0x1faed0(0x115)]){if(!isInteractive())return console['error'](a56_0x4d082d[_0x1faed0(0x171)](_0x1faed0(0x18d)),_0x1faed0(0x209)),console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0x262)](_0x1faed0(0x1b5))),0x1;const _0x4292de=await confirmKey(_0x1faed0(0x154));if(!_0x4292de)return console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0x288)](_0x1faed0(0x27d)),_0x1faed0(0x1af)),0x1;}await withSpinner(_0x1faed0(0x124),()=>_0x3671b1['workflow'][_0x1faed0(0x10a)](_0x3b8cd4,{'revision':_0x1aff34}),{'verbose':_0x3fb6d7[_0x1faed0(0x199)]}),saveSessionContext({'workflow_project':_0x3b8cd4[_0x1faed0(0xc5)]},_0x3fb6d7['session']),console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0xfb)](_0x1faed0(0x244)));const _0x3b4390=a56_0x1268de['relative'](process[_0x1faed0(0x139)](),_0x3b8cd4['targetDir'])||'.';return console[_0x1faed0(0x12a)](a56_0x4d082d['dim'](_0x1faed0(0x174)+_0x3b4390)),console[_0x1faed0(0x12a)](a56_0x4d082d[_0x1faed0(0x262)](_0x1faed0(0xfc)+_0x3b8cd4['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]='workflow:push';['description']=a56_0x1ddcb4(0x1c5);async[a56_0x1ddcb4(0x12f)](_0x3ec276){const _0x3805ef=a56_0x1ddcb4,{options:_0x42942d,args:_0x5d8975,tdx:_0xb8082}=_0x3ec276,_0x5d5875=this['resolveProjectDir'](_0x5d8975,_0x42942d),_0x4cf231=_0x42942d,{revision:_0x3d4b49,skipValidation:_0x3caf0f,backfill:_0xf0331d}=_0x4cf231,_0x216b92=_0xf0331d===undefined?undefined:!_0xf0331d;_0x42942d[_0x3805ef(0x199)]&&(_0x5d5875&&console['error'](_0x3805ef(0x25d)+_0x5d5875),_0x3d4b49&&console[_0x3805ef(0x12a)](_0x3805ef(0x18a)+_0x3d4b49),_0x42942d[_0x3805ef(0x15a)]&&console[_0x3805ef(0x12a)](_0x3805ef(0x1f4)),_0x3caf0f&&console[_0x3805ef(0x12a)]('Validation:\x20skipped'),_0xf0331d&&console['error'](_0x3805ef(0xcf)));let _0x17e71b;try{_0x17e71b=await withSpinner(_0x3805ef(0x128),()=>_0xb8082[_0x3805ef(0x227)][_0x3805ef(0x24d)]({'sourceDir':_0x5d5875,'revision':_0x3d4b49,'skipValidation':_0x3caf0f,'skipSchedule':_0x216b92}),{'verbose':_0x42942d[_0x3805ef(0x199)]});}catch(_0x3d2dda){if(_0x3d2dda instanceof Error&&_0x3d2dda[_0x3805ef(0x274)][_0x3805ef(0x108)](_0x3805ef(0x198)))return console['error'](a56_0x4d082d[_0x3805ef(0x171)](_0x3805ef(0x106)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x42942d['workflowProject']?console[_0x3805ef(0x12a)](a56_0x4d082d['dim'](_0x3805ef(0x100)+_0x42942d[_0x3805ef(0x196)]+_0x3805ef(0x214)+_0x42942d[_0x3805ef(0x196)]+'\x27')):console[_0x3805ef(0x12a)](a56_0x4d082d['dim'](_0x3805ef(0xe7))),0x1;throw _0x3d2dda;}const _0x1f668d=_0x17e71b['data'];console[_0x3805ef(0x12a)](_0x3805ef(0x201)+_0x1f668d['projectName']),console[_0x3805ef(0x12a)](_0x3805ef(0x1cf)+_0x1f668d[_0x3805ef(0x19f)]),console['error'](_0x3805ef(0xdf)+_0x1f668d[_0x3805ef(0x266)]),console[_0x3805ef(0x12a)](_0x3805ef(0x150)+a56_0x4d082d[_0x3805ef(0xfb)]('+'+_0x1f668d[_0x3805ef(0x1d4)][_0x3805ef(0x1c8)]+_0x3805ef(0x18f))+',\x20'+(a56_0x4d082d[_0x3805ef(0x288)]('~'+_0x1f668d[_0x3805ef(0x1d4)][_0x3805ef(0x289)]+'\x20modified')+',\x20')+(a56_0x4d082d[_0x3805ef(0x171)]('-'+_0x1f668d[_0x3805ef(0x1d4)]['deleted']+_0x3805ef(0x1de))+',\x20')+(''+a56_0x4d082d[_0x3805ef(0x262)](_0x1f668d[_0x3805ef(0x1d4)][_0x3805ef(0x21e)]+_0x3805ef(0x1c4))));for(const _0x37d52f of _0x1f668d[_0x3805ef(0x207)]){_0x37d52f[_0x3805ef(0x1cb)]===_0x3805ef(0x289)&&_0x37d52f[_0x3805ef(0x248)]&&(console[_0x3805ef(0x12a)]('\x0a'+a56_0x4d082d[_0x3805ef(0x170)](_0x3805ef(0x296)+_0x37d52f[_0x3805ef(0x20f)])),console[_0x3805ef(0x12a)](_0x37d52f[_0x3805ef(0x248)]));}if(!_0x1f668d[_0x3805ef(0x187)])return console[_0x3805ef(0x12a)](a56_0x4d082d[_0x3805ef(0xfb)](_0x3805ef(0x125))),await this['showWorkflowConsoleUrl'](_0xb8082,_0x1f668d[_0x3805ef(0xc5)],_0x42942d['site']),0x0;if(_0x42942d['dryRun'])return console['error'](a56_0x4d082d['yellow'](_0x3805ef(0x1ed))),0x0;if(!_0x42942d[_0x3805ef(0x115)]){if(!isInteractive())return console['error'](a56_0x4d082d[_0x3805ef(0x171)](_0x3805ef(0x18d)),_0x3805ef(0x209)),console[_0x3805ef(0x12a)](a56_0x4d082d['dim'](_0x3805ef(0x1b5))),0x1;const _0x4174bb=await confirmKey(_0x3805ef(0x286));if(!_0x4174bb)return console[_0x3805ef(0x12a)](a56_0x4d082d[_0x3805ef(0x288)](_0x3805ef(0x27d)),_0x3805ef(0x228)),0x1;}const _0x53ed61=await withSpinner(_0x3805ef(0x258),()=>_0xb8082[_0x3805ef(0x227)][_0x3805ef(0x1b1)](_0x1f668d),{'verbose':_0x42942d['verbose']}),_0x499664=_0x53ed61['data'];return console[_0x3805ef(0x12a)](a56_0x4d082d[_0x3805ef(0xfb)]('✔\x20Push\x20complete')),console[_0x3805ef(0x12a)](_0x3805ef(0xe8)+_0x499664[_0x3805ef(0x298)]),console[_0x3805ef(0x12a)](_0x3805ef(0xdf)+_0x499664['revision']),await this['showWorkflowConsoleUrl'](_0xb8082,_0x499664[_0x3805ef(0xc5)],_0x42942d['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x29d);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x157);async['execute'](_0x540bac){const _0x325f42=a56_0x1ddcb4,{options:_0x585fef,args:_0x162725,tdx:_0x5898bc}=_0x540bac,_0x1b7a72=this['resolveProjectDir'](_0x162725,_0x585fef),_0x3b0520=_0x585fef[_0x325f42(0x161)],_0x1066a9=_0x585fef['revision'],_0x536f57=_0x585fef[_0x325f42(0x1d2)];if(!_0x1b7a72)return console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x171)](_0x325f42(0x106)),_0x325f42(0xe0)),console['error'](a56_0x4d082d['dim'](_0x325f42(0x287))),console[_0x325f42(0x12a)](a56_0x4d082d['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x3b0520)return console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x171)](_0x325f42(0x106)),_0x325f42(0x14f)),console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x262)](_0x325f42(0x287))),0x1;_0x585fef[_0x325f42(0x199)]&&(console['error']('Source\x20directory:\x20'+_0x1b7a72),console['error'](_0x325f42(0x151)+_0x3b0520),_0x1066a9&&console[_0x325f42(0x12a)]('Revision:\x20'+_0x1066a9),_0x585fef[_0x325f42(0x15a)]&&console[_0x325f42(0x12a)](_0x325f42(0x1f4)),_0x536f57&&console[_0x325f42(0x12a)]('Validation:\x20skipped'));const _0x3c82d2=await withSpinner(_0x325f42(0x1e8),()=>_0x5898bc['workflow'][_0x325f42(0x232)](_0x1b7a72,_0x3b0520,{'revision':_0x1066a9,'skipValidation':_0x536f57}),{'verbose':_0x585fef[_0x325f42(0x199)]}),_0x204f22=_0x3c82d2[_0x325f42(0x14d)];console[_0x325f42(0x12a)](_0x325f42(0x27a)+_0x204f22[_0x325f42(0x19f)]);_0x204f22[_0x325f42(0x292)]&&console['error'](_0x325f42(0x24a)+_0x204f22[_0x325f42(0x292)]);console[_0x325f42(0x12a)]('New\x20project\x20name:\x20'+_0x204f22[_0x325f42(0x1ad)]),console[_0x325f42(0x12a)](_0x325f42(0x18a)+_0x204f22[_0x325f42(0x266)]),console[_0x325f42(0x12a)](_0x325f42(0x254)+_0x204f22[_0x325f42(0x16d)]);_0x204f22[_0x325f42(0x265)]&&(console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x288)](_0x325f42(0x1cd)+_0x204f22['newProjectName']+_0x325f42(0x1e3)+_0x204f22[_0x325f42(0xda)]+')')),console['error'](a56_0x4d082d['yellow'](_0x325f42(0x113))));if(_0x585fef[_0x325f42(0x15a)])return console[_0x325f42(0x12a)](a56_0x4d082d['yellow'](_0x325f42(0x1d8))),0x0;if(!_0x585fef[_0x325f42(0x115)]){if(!isInteractive())return console[_0x325f42(0x12a)](a56_0x4d082d['red'](_0x325f42(0x18d)),_0x325f42(0x209)),console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x262)](_0x325f42(0x1b5))),0x1;const _0x3caa95=_0x204f22['sourceProjectName']||a56_0x1268de[_0x325f42(0x295)](_0x1b7a72),_0x22cbbb=_0x204f22[_0x325f42(0x265)]?_0x325f42(0x21d)+_0x3b0520+_0x325f42(0x284):_0x325f42(0x1f7)+_0x3caa95+_0x325f42(0x28f)+_0x3b0520+'\x22?',_0x3db66c=await confirmKey(_0x22cbbb);if(!_0x3db66c)return console[_0x325f42(0x12a)](a56_0x4d082d[_0x325f42(0x288)]('Cancelled')),0x1;}const _0x8deb36=await withSpinner(_0x204f22['targetExists']?'Updating\x20'+_0x3b0520+_0x325f42(0xea):'Cloning\x20to\x20'+_0x3b0520+_0x325f42(0xea),()=>_0x5898bc[_0x325f42(0x227)][_0x325f42(0x1c9)](_0x204f22),{'verbose':_0x585fef['verbose']}),_0x4f8438=_0x8deb36[_0x325f42(0x14d)];return console[_0x325f42(0x12a)](a56_0x4d082d['green'](_0x204f22[_0x325f42(0x265)]?_0x325f42(0x18c):_0x325f42(0x263))),console['error'](_0x325f42(0x190)+_0x4f8438[_0x325f42(0x1ad)]),console[_0x325f42(0x12a)](_0x325f42(0xe8)+_0x4f8438[_0x325f42(0xeb)]),console[_0x325f42(0x12a)](_0x325f42(0xdf)+_0x4f8438[_0x325f42(0x266)]),await this[_0x325f42(0x1b6)](_0x5898bc,_0x4f8438[_0x325f42(0x1ad)],_0x585fef['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]='workflow:delete';[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x242);async[a56_0x1ddcb4(0x12f)](_0x321500){const _0x290166=a56_0x1ddcb4,{options:_0x38ed93,args:_0x3c6a1e,tdx:_0x40f11e}=_0x321500,_0x1abc60=_0x3c6a1e[0x0];if(!_0x1abc60)return console[_0x290166(0x12a)](_0x290166(0x253)),console[_0x290166(0x12a)](_0x290166(0x1a5)),0x1;_0x38ed93[_0x290166(0x199)]&&console[_0x290166(0x12a)](_0x290166(0x19c)+_0x1abc60);if(!_0x38ed93[_0x290166(0x115)]){if(!isInteractive())return console[_0x290166(0x12a)](a56_0x4d082d[_0x290166(0x171)](_0x290166(0x18d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a56_0x4d082d[_0x290166(0x262)](_0x290166(0x1b5))),0x1;const _0x2829bb=await confirmKey(_0x290166(0x131)+_0x1abc60+_0x290166(0x229));if(!_0x2829bb)return console[_0x290166(0x12a)](a56_0x4d082d[_0x290166(0x288)]('Cancelled')),0x1;}const _0x32789d=await withSpinner(_0x290166(0x249)+_0x1abc60+'...',()=>_0x40f11e[_0x290166(0x227)]['delete'](_0x1abc60),{'verbose':_0x38ed93['verbose']}),_0x592c8a=_0x32789d[_0x290166(0x14d)];return console['error'](_0x290166(0x246)+_0x592c8a[_0x290166(0xc5)]),console[_0x290166(0x12a)](_0x290166(0xe8)+_0x592c8a[_0x290166(0x298)]),0x0;}}export function parseKeyValue(_0x1c1b50){const _0x3924fa=a56_0x1ddcb4,_0x12a3bb=_0x1c1b50[_0x3924fa(0x19d)]('=');if(_0x12a3bb===-0x1)throw new Error('Invalid\x20format:\x20'+_0x1c1b50+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x2b4d76=_0x1c1b50[_0x3924fa(0x22d)](0x0,_0x12a3bb),_0x509d87=_0x1c1b50['substring'](_0x12a3bb+0x1);if(!_0x2b4d76)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x2b4d76,'value':_0x509d87};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']='workflow:secrets:list';[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x277);async[a56_0x1ddcb4(0x12f)](_0x21ebd2){const _0x1a1b9f=a56_0x1ddcb4,{options:_0x44aa48,args:_0x410b0a,tdx:_0x59d644}=_0x21ebd2,_0x55f285=this[_0x1a1b9f(0x116)](_0x410b0a,_0x44aa48);if(!_0x55f285)return 0x1;_0x44aa48['verbose']&&console[_0x1a1b9f(0x12a)](_0x1a1b9f(0x19c)+_0x55f285);const _0x575ef1=await withSpinner(_0x1a1b9f(0x17e),()=>_0x59d644[_0x1a1b9f(0x227)][_0x1a1b9f(0xfd)](_0x55f285),{'verbose':_0x44aa48['verbose']}),{secrets:_0x40abc7}=_0x575ef1[_0x1a1b9f(0x14d)];return console['error'](_0x1a1b9f(0x1b2)+_0x40abc7[_0x1a1b9f(0x1ba)]+_0x1a1b9f(0x11e)+(_0x40abc7[_0x1a1b9f(0x1ba)]!==0x1?'s':'')),await handleSDKOutput(_0x40abc7,_0x44aa48),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x16b);[a56_0x1ddcb4(0xe9)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async['execute'](_0x95d674){const _0x10aa7d=a56_0x1ddcb4,{options:_0x50cc98,args:_0x6e2b12,tdx:_0x13aab9}=_0x95d674;let _0x311164,_0x2afad9;if(_0x6e2b12[_0x10aa7d(0x1ba)]>=0x1&&!_0x6e2b12[0x0][_0x10aa7d(0x108)]('='))_0x311164=_0x6e2b12[0x0],_0x2afad9=_0x6e2b12['slice'](0x1);else{if(_0x6e2b12[_0x10aa7d(0x1ba)]>=0x1&&_0x50cc98[_0x10aa7d(0x196)])_0x311164=_0x50cc98['workflowProject'],_0x2afad9=_0x6e2b12;else return _0x6e2b12[_0x10aa7d(0x1ba)]>=0x1?(console['error'](_0x10aa7d(0x14e)),console[_0x10aa7d(0x12a)](_0x10aa7d(0x2a0)),0x1):(console[_0x10aa7d(0x12a)](_0x10aa7d(0x112)),console[_0x10aa7d(0x12a)](_0x10aa7d(0x1a4)),0x1);}if(_0x2afad9[_0x10aa7d(0x1ba)]===0x0)return console[_0x10aa7d(0x12a)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x10aa7d(0x12a)](_0x10aa7d(0x1a4)),0x1;const _0x36fef1={};try{for(const _0x2d1b76 of _0x2afad9){const {key:_0x424aa8,value:_0x4f5ca5}=parseKeyValue(_0x2d1b76);_0x36fef1[_0x424aa8]=_0x4f5ca5;}}catch(_0x3d469){return _0x3d469 instanceof Error&&console[_0x10aa7d(0x12a)](a56_0x4d082d['red'](_0x10aa7d(0x106)),_0x3d469['message']),0x1;}const _0x2428f4=Object[_0x10aa7d(0x280)](_0x36fef1);_0x50cc98[_0x10aa7d(0x199)]&&(console[_0x10aa7d(0x12a)](_0x10aa7d(0x19c)+_0x311164),console[_0x10aa7d(0x12a)]('Secrets\x20to\x20set:\x20'+_0x2428f4[_0x10aa7d(0x13b)](',\x20')));const _0x287920=await withSpinner(_0x2428f4[_0x10aa7d(0x1ba)]===0x1?'Setting\x20secret...':'Setting\x20'+_0x2428f4['length']+_0x10aa7d(0x184),()=>_0x13aab9[_0x10aa7d(0x227)]['setSecrets'](_0x311164,_0x36fef1),{'verbose':_0x50cc98[_0x10aa7d(0x199)]}),_0x658bbf=_0x287920['data'];return console['error'](_0x2428f4[_0x10aa7d(0x1ba)]===0x1?_0x10aa7d(0x21f)+_0x658bbf[_0x10aa7d(0x280)][0x0]+_0x10aa7d(0xe6)+_0x658bbf[_0x10aa7d(0xc5)]+'\x27':'✔\x20'+_0x658bbf[_0x10aa7d(0x280)][_0x10aa7d(0x1ba)]+_0x10aa7d(0x25c)+_0x658bbf['projectName']+'\x27'),(_0x50cc98['json']||_0x50cc98[_0x10aa7d(0x17d)])&&await handleSingleObjectOutput(_0x658bbf,_0x50cc98),0x0;}}function a56_0x1ee3(_0x1542cd,_0x30589c){_0x1542cd=_0x1542cd-0xc2;const _0x498a5c=a56_0x498a();let _0x1ee334=_0x498a5c[_0x1542cd];return _0x1ee334;}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x25a);['description']=a56_0x1ddcb4(0x15f);async['execute'](_0x1882da){const _0x1c23d8=a56_0x1ddcb4,{options:_0x3a5170,args:_0x5af34a,tdx:_0x1b7110}=_0x1882da;let _0x488681,_0x4f2579;if(_0x5af34a[_0x1c23d8(0x1ba)]>=0x2)_0x488681=_0x5af34a[0x0],_0x4f2579=_0x5af34a[0x1];else{if(_0x5af34a[_0x1c23d8(0x1ba)]===0x1&&_0x3a5170[_0x1c23d8(0x196)])_0x488681=_0x3a5170[_0x1c23d8(0x196)],_0x4f2579=_0x5af34a[0x0];else return _0x5af34a[_0x1c23d8(0x1ba)]===0x1?(console['error']('Error:\x20Project\x20name\x20is\x20required'),console[_0x1c23d8(0x12a)](_0x1c23d8(0x2a0)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x1c23d8(0x243)),0x1);}_0x3a5170[_0x1c23d8(0x199)]&&(console[_0x1c23d8(0x12a)](_0x1c23d8(0x19c)+_0x488681),console['error'](_0x1c23d8(0x26b)+_0x4f2579));if(!_0x3a5170[_0x1c23d8(0x115)]){if(!isInteractive())return console[_0x1c23d8(0x12a)](a56_0x4d082d[_0x1c23d8(0x171)](_0x1c23d8(0x18d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1c23d8(0x12a)](a56_0x4d082d[_0x1c23d8(0x262)](_0x1c23d8(0x1b5))),0x1;const _0x17e053=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x4f2579+_0x1c23d8(0x27c)+_0x488681+'\x27?');if(!_0x17e053)return console['error'](a56_0x4d082d[_0x1c23d8(0x288)](_0x1c23d8(0x27d))),0x1;}const _0x3449fa=await withSpinner(_0x1c23d8(0x24c),()=>_0x1b7110['workflow'][_0x1c23d8(0x1f5)](_0x488681,_0x4f2579),{'verbose':_0x3a5170[_0x1c23d8(0x199)]}),_0x5cce66=_0x3449fa[_0x1c23d8(0x14d)];return console['error'](_0x1c23d8(0x21f)+_0x5cce66['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x5cce66[_0x1c23d8(0xc5)]+'\x27'),(_0x3a5170[_0x1c23d8(0x1fc)]||_0x3a5170[_0x1c23d8(0x17d)])&&await handleSingleObjectOutput(_0x5cce66,_0x3a5170),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(_0x628fa1){const _0x4a4b26=a56_0x1ddcb4,_0x425119=Math[_0x4a4b26(0x225)](_0x628fa1/0x3e8),_0x1afc12=Math['floor'](_0x425119/0x3c),_0x3c9777=Math[_0x4a4b26(0x225)](_0x1afc12/0x3c),_0x10bd03=Math['floor'](_0x3c9777/0x18);if(_0x10bd03>0x0){const _0x476651=_0x3c9777%0x18;return _0x476651>0x0?_0x10bd03+'d\x20'+_0x476651+'h':_0x10bd03+'d';}else{if(_0x3c9777>0x0){const _0x56bdeb=_0x1afc12%0x3c;return _0x56bdeb>0x0?_0x3c9777+'h\x20'+_0x56bdeb+'m':_0x3c9777+'h';}else{if(_0x1afc12>0x0){const _0x50c108=_0x425119%0x3c;return _0x50c108>0x0?_0x1afc12+'m\x20'+_0x50c108+'s':_0x1afc12+'m';}else return _0x425119+'s';}}}function formatTimestamp(_0x230a39,_0x474055){const _0x65c649=a56_0x1ddcb4,_0x41f43f=new Date(_0x230a39),_0x456043=String(_0x41f43f[_0x65c649(0x160)]())['padStart'](0x2,'0'),_0x29e5bc=String(_0x41f43f['getMinutes']())[_0x65c649(0xc2)](0x2,'0'),_0x2577ac=_0x456043+':'+_0x29e5bc,_0x31e1cc=_0x41f43f['getFullYear']()===_0x474055[_0x65c649(0x102)]()&&_0x41f43f[_0x65c649(0x1a2)]()===_0x474055[_0x65c649(0x1a2)]()&&_0x41f43f[_0x65c649(0x1b8)]()===_0x474055[_0x65c649(0x1b8)]();if(_0x31e1cc)return _0x2577ac;else{const _0x30e218=String(_0x41f43f[_0x65c649(0x1a2)]()+0x1)['padStart'](0x2,'0'),_0x5dd07e=String(_0x41f43f[_0x65c649(0x1b8)]())['padStart'](0x2,'0');return _0x30e218+'-'+_0x5dd07e+'\x20'+_0x2577ac;}}function formatDate(_0x525fb0){const _0x52fb94=a56_0x1ddcb4,_0x431aa5=_0x525fb0[_0x52fb94(0x102)](),_0x133792=String(_0x525fb0['getMonth']()+0x1)[_0x52fb94(0xc2)](0x2,'0'),_0x56208b=String(_0x525fb0[_0x52fb94(0x1b8)]())[_0x52fb94(0xc2)](0x2,'0');return _0x431aa5+'-'+_0x133792+'-'+_0x56208b;}function getTaskStateIcon(_0x54afe8){const _0x386e37={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x386e37[_0x54afe8]||'⚪';}function getBarChar(_0x55893d){const _0x367e15=a56_0x1ddcb4;return _0x55893d==='error'||_0x55893d===_0x367e15(0x26e)?'×':'─';}function getBarColor(_0x2cdee0){const _0x30baf9=a56_0x1ddcb4,_0x3b20ca={'success':a56_0x4d082d[_0x30baf9(0xfb)],'error':a56_0x4d082d[_0x30baf9(0x171)],'group_error':a56_0x4d082d[_0x30baf9(0x171)],'running':a56_0x4d082d[_0x30baf9(0x137)],'blocked':a56_0x4d082d[_0x30baf9(0x288)],'planned':a56_0x4d082d[_0x30baf9(0x262)],'canceling':a56_0x4d082d[_0x30baf9(0x288)]};return _0x3b20ca[_0x2cdee0]||a56_0x4d082d[_0x30baf9(0xd3)];}function parseTaskName(_0x4fe41a){const _0x4c4b62=a56_0x1ddcb4;let _0x2b0a68=_0x4fe41a[_0x4c4b62(0x1d0)](/^\++/,'');const _0x3f62f7=_0x2b0a68[_0x4c4b62(0x1e1)]('+'),_0x12f9f2=_0x3f62f7[_0x4c4b62(0x1ba)]>0x1?_0x3f62f7['length']-0x2:0x0,_0x1f2bfd=_0x3f62f7[_0x3f62f7[_0x4c4b62(0x1ba)]-0x1]||_0x2b0a68;return{'level':_0x12f9f2,'name':'+'+_0x1f2bfd};}function truncateTaskName(_0x2b5caa,_0xd189c0){const _0x5a336a=a56_0x1ddcb4,_0x2d2108=stringWidth(_0x2b5caa);if(_0x2d2108<=_0xd189c0)return _0x2b5caa;let _0x1c6230=_0x2b5caa;while(stringWidth(_0x1c6230+'…')>_0xd189c0&&_0x1c6230[_0x5a336a(0x1ba)]>0x0){_0x1c6230=_0x1c6230[_0x5a336a(0x191)](0x0,-0x1);}return _0x1c6230+'…';}function calculateTimeScale(_0x279614,_0x2000c9){const _0x2f697d=a56_0x1ddcb4;return{'startTime':_0x279614[_0x2f697d(0xd1)],'endTime':_0x279614[_0x2f697d(0x208)],'durationMs':_0x279614['duration'],'msPerChar':_0x279614['duration']/_0x2000c9};}function timeToPosition(_0x1384ea,_0x1403da,_0x7ee5f2){const _0x17094c=a56_0x1ddcb4,_0x4f2930=_0x1384ea-_0x1403da['startTime'],_0x27c1a5=Math['floor'](_0x4f2930/_0x1403da[_0x17094c(0x23e)]);return Math['max'](0x0,Math['min'](_0x27c1a5,_0x7ee5f2));}function renderTimeAxis(_0x86358a,_0x4412c0){const _0x566d45=a56_0x1ddcb4,_0x4a312f=Math[_0x566d45(0x173)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x566d45(0x1d9)],Math[_0x566d45(0x225)](_0x4412c0/TIMELINE_CONFIG[_0x566d45(0x22c)]))),_0x1a1f4f=_0x86358a[_0x566d45(0x247)]/(_0x4a312f-0x1),_0x2e0dc9=new Date(_0x86358a[_0x566d45(0x14a)]),_0x3afc3f=[];for(let _0x7bc883=0x0;_0x7bc883<_0x4a312f;_0x7bc883++){const _0x1bc3e8=_0x86358a[_0x566d45(0x14a)]+_0x7bc883*_0x1a1f4f,_0x55f20f=timeToPosition(_0x1bc3e8,_0x86358a,_0x4412c0),_0x5170d4=formatTimestamp(_0x1bc3e8,_0x2e0dc9);_0x3afc3f[_0x566d45(0x103)]({'pos':_0x55f20f,'text':_0x5170d4});}const _0x16054d=new Array(_0x4412c0)[_0x566d45(0x177)]('\x20');let _0xdd7282=-0x1;for(const {pos:_0x4824b6,text:_0x399c5f}of _0x3afc3f){let _0x542aa5=Math[_0x566d45(0x114)](0x0,_0x4824b6-Math[_0x566d45(0x225)](_0x399c5f[_0x566d45(0x1ba)]/0x2));_0x542aa5<=_0xdd7282+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x542aa5=_0xdd7282+TIMELINE_CONFIG[_0x566d45(0xcb)]+0x1);_0x542aa5+_0x399c5f[_0x566d45(0x1ba)]>_0x4412c0&&(_0x542aa5=_0x4412c0-_0x399c5f['length']);if(_0x542aa5>=0x0&&_0x542aa5+_0x399c5f['length']<=_0x4412c0&&_0x542aa5>_0xdd7282){for(let _0x1b83c3=0x0;_0x1b83c3<_0x399c5f[_0x566d45(0x1ba)];_0x1b83c3++){_0x16054d[_0x542aa5+_0x1b83c3]=_0x399c5f[_0x1b83c3];}_0xdd7282=_0x542aa5+_0x399c5f[_0x566d45(0x1ba)]-0x1;}}return _0x16054d[_0x566d45(0x13b)]('');}function renderTaskRow(_0x4968cd,_0x596560,_0x3b4113,_0x50b35a){const _0x335df4=a56_0x1ddcb4,{level:_0x153de1,name:_0x1059a9}=parseTaskName(_0x4968cd['name']),_0x5c5050='\x20'[_0x335df4(0x129)](_0x153de1),_0x46d100=_0x4968cd['window']?'('+formatElapsed(_0x4968cd[_0x335df4(0x1f3)]['duration'])+')':'',_0xbf3ea6=stringWidth(_0x46d100),_0x1147a2=_0x153de1*0x1,_0x475d50=_0x50b35a-_0x1147a2-_0xbf3ea6-0x1,_0x53ce39=truncateTaskName(_0x1059a9,_0x475d50),_0xa57ef0=_0x5c5050+_0x53ce39,_0x4e9d9e=stringWidth(_0xa57ef0),_0x44b325=_0x50b35a-_0x4e9d9e-_0xbf3ea6,_0x3c26c7=_0xa57ef0+'\x20'[_0x335df4(0x129)](Math['max'](0x1,_0x44b325))+a56_0x4d082d[_0x335df4(0x262)](_0x46d100),_0x5660e5=getTaskStateIcon(_0x4968cd[_0x335df4(0x1d5)]),_0x4b4cd0=new Array(_0x3b4113)[_0x335df4(0x177)]('\x20');if(_0x4968cd['window']){const _0xd8928d=timeToPosition(_0x4968cd[_0x335df4(0x1f3)][_0x335df4(0xd1)],_0x596560,_0x3b4113),_0x287aed=timeToPosition(_0x4968cd['window'][_0x335df4(0x208)],_0x596560,_0x3b4113),_0x1e33e0=getBarChar(_0x4968cd[_0x335df4(0x1d5)]),_0x19acd1=Math[_0x335df4(0x114)](_0xd8928d+0x1,_0x287aed);for(let _0xed00ed=_0xd8928d;_0xed00ed<Math[_0x335df4(0x173)](_0x19acd1,_0x3b4113);_0xed00ed++){_0x4b4cd0[_0xed00ed]=_0x1e33e0;}}const _0x314e2a=getBarColor(_0x4968cd[_0x335df4(0x1d5)]),_0x417257=_0x4b4cd0[_0x335df4(0x175)](_0x36f323=>_0x36f323==='\x20'?'\x20':_0x314e2a(_0x36f323))[_0x335df4(0x13b)]('');return _0x5660e5+'\x20'+_0x3c26c7+'│'+_0x417257+'│';}function calculateStats(_0x5f5922){const _0x1d8810=a56_0x1ddcb4,_0x49d798={'total':_0x5f5922['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x370581 of _0x5f5922){if(_0x370581['state']===_0x1d8810(0x283))_0x49d798[_0x1d8810(0x283)]++;else{if(_0x370581[_0x1d8810(0x1d5)]===_0x1d8810(0x12a)||_0x370581[_0x1d8810(0x1d5)]===_0x1d8810(0x26e))_0x49d798[_0x1d8810(0x12a)]++;else _0x370581[_0x1d8810(0x1d5)]==='running'?_0x49d798[_0x1d8810(0x179)]++:_0x49d798[_0x1d8810(0x121)]++;}}return _0x49d798;}function formatStats(_0x4401c0){const _0x37fa83=a56_0x1ddcb4;return[_0x37fa83(0xc7)+_0x4401c0['total'],'✅\x20'+_0x4401c0[_0x37fa83(0x283)],'❌\x20'+_0x4401c0[_0x37fa83(0x12a)],'🔄\x20'+_0x4401c0['running'],'⏳\x20'+_0x4401c0['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]=a56_0x1ddcb4(0x219);[a56_0x1ddcb4(0xe9)]=a56_0x1ddcb4(0x27f);async[a56_0x1ddcb4(0x12f)](_0x391afa){const _0x286f27=a56_0x1ddcb4,{options:_0x50a2ee,args:_0x3d8b1c,tdx:_0x53e25c}=_0x391afa;let _0x328044,_0x84281e,_0x21cb4f=![];if(_0x3d8b1c[0x0]){if(_0x3d8b1c[0x0][_0x286f27(0x108)]('.')){const _0x16a7cb=this['parseProjectWorkflowPattern'](_0x3d8b1c,_0x50a2ee);if(!_0x16a7cb)return 0x1;_0x328044=_0x16a7cb[_0x286f27(0xc5)],_0x84281e=_0x16a7cb[_0x286f27(0x19b)];}else{_0x84281e=_0x3d8b1c[0x0],_0x328044=_0x50a2ee[_0x286f27(0x196)];if(!_0x328044)return console[_0x286f27(0x12a)](a56_0x4d082d['red'](_0x286f27(0x106)),_0x286f27(0x241)),0x1;_0x21cb4f=!![];}}else{const _0x3b0227=this[_0x286f27(0x1fd)](_0x3d8b1c,_0x50a2ee);if(!_0x3b0227)return 0x1;_0x328044=_0x3b0227[_0x286f27(0xc5)],_0x84281e=_0x3b0227[_0x286f27(0x19b)];}if(_0x50a2ee[_0x286f27(0x199)]){if(_0x328044&&_0x84281e)console[_0x286f27(0x12a)](_0x286f27(0x23c)+_0x328044+'.'+_0x84281e);else _0x328044&&console[_0x286f27(0x12a)](_0x286f27(0x1ce)+_0x328044);}const _0x5d66a7=_0x50a2ee[_0x286f27(0x271)],_0x496b60=_0x50a2ee[_0x286f27(0x1f2)];if(_0x5d66a7){_0x496b60&&console[_0x286f27(0x12a)](a56_0x4d082d[_0x286f27(0x288)]('Warning:'),_0x286f27(0x21c));const _0x4ca91d=_0x50a2ee[_0x286f27(0x1d3)];return _0x4ca91d?await this['pollTimeline'](_0x391afa,_0x5d66a7):await this['renderSingleTimeline'](_0x391afa,_0x5d66a7,_0x50a2ee),0x0;}if(_0x496b60){const _0x513513=await withSpinner(_0x286f27(0x183),()=>_0x53e25c['workflow']['sessions']({'projectName':_0x328044,'workflowName':_0x84281e,'limit':0x64}),{'verbose':_0x50a2ee[_0x286f27(0x199)]}),_0x138d99=_0x513513['data'][_0x286f27(0x23b)](_0x531d8d=>_0x531d8d['id']===_0x496b60);if(!_0x138d99)return console[_0x286f27(0x12a)](a56_0x4d082d[_0x286f27(0x171)](_0x286f27(0x106)),_0x286f27(0x27b)+_0x496b60),0x1;if(!_0x138d99[_0x286f27(0x181)]?.['id'])return console[_0x286f27(0x12a)](a56_0x4d082d[_0x286f27(0x171)](_0x286f27(0x106)),'Session\x20'+_0x496b60+'\x20has\x20no\x20attempts'),0x1;const _0x2f2e29=_0x138d99[_0x286f27(0x181)]['id'];_0x50a2ee[_0x286f27(0x199)]&&console[_0x286f27(0x12a)](_0x286f27(0x278)+_0x2f2e29+'\x20from\x20session\x20'+_0x496b60);const _0x4cb25d=_0x50a2ee[_0x286f27(0x1d3)];return _0x4cb25d?await this['pollTimeline'](_0x391afa,_0x2f2e29):await this[_0x286f27(0x28c)](_0x391afa,_0x2f2e29,_0x50a2ee),0x0;}const _0x12750f=await withSpinner(_0x286f27(0x1df),()=>_0x53e25c[_0x286f27(0x227)][_0x286f27(0x239)]({'projectName':_0x328044,'workflowName':_0x84281e,'limit':_0x50a2ee[_0x286f27(0x24e)]||0x32}),{'verbose':_0x50a2ee[_0x286f27(0x199)]}),_0x4779e3=_0x12750f['data'];if(_0x4779e3['length']===0x0){if(_0x328044&&_0x84281e)console['error'](_0x286f27(0x146)+_0x328044+'.'+_0x84281e);else _0x328044?console[_0x286f27(0x12a)](_0x286f27(0x1d7)+_0x328044):(console[_0x286f27(0x12a)](_0x286f27(0xf6)),console[_0x286f27(0x12a)](a56_0x4d082d[_0x286f27(0x262)](_0x286f27(0x25e))));return 0x0;}_0x4779e3['sort']((_0xca5b2f,_0x7539e8)=>{const _0x6762f=_0x286f27,_0x8dc3d=_0xca5b2f[_0x6762f(0x1c3)]||'',_0x15c995=_0x7539e8['sessionTime']||'';return _0x15c995[_0x6762f(0x138)](_0x8dc3d);});if(_0x50a2ee[_0x286f27(0x1fc)]||_0x50a2ee['jsonl'])return await handleSDKOutput(_0x4779e3,_0x50a2ee),0x0;let _0x2c6da3;if(_0x21cb4f){const _0x1f320c=_0x4779e3[0x0];if(!_0x1f320c['lastAttempt']?.['id'])return console['error'](_0x286f27(0x19a)),0x0;_0x2c6da3=_0x1f320c[_0x286f27(0x181)]['id'],_0x50a2ee[_0x286f27(0x199)]&&console['error'](_0x286f27(0x165)+_0x1f320c[_0x286f27(0x1c3)]);}else{const _0x37df34=_0x4779e3['map'](_0x253f7f=>{const _0x5bf05f=_0x286f27,_0x4f7232=getAttemptStatusDisplay(_0x253f7f[_0x5bf05f(0x181)]);return{'title':_0x253f7f[_0x5bf05f(0x162)]?.[_0x5bf05f(0x161)]+'.'+_0x253f7f[_0x5bf05f(0x227)]?.[_0x5bf05f(0x161)]+'\x20-\x20'+_0x253f7f[_0x5bf05f(0x1c3)]+'\x20'+_0x4f7232['icon'],'value':_0x253f7f['lastAttempt']?.['id']||'','description':_0x4f7232['text']};}),_0x4f60f3=await a56_0x34435f({'type':'select','name':_0x286f27(0x271),'message':_0x286f27(0x255),'choices':_0x37df34['filter'](_0x4b27f8=>_0x4b27f8[_0x286f27(0x293)]!=='')});if(!_0x4f60f3['attemptId'])return 0x0;_0x2c6da3=_0x4f60f3[_0x286f27(0x271)];}const _0x39e215=_0x50a2ee[_0x286f27(0x1d3)];return _0x39e215?await this['pollTimeline'](_0x391afa,_0x2c6da3):await this[_0x286f27(0x28c)](_0x391afa,_0x2c6da3,_0x50a2ee),0x0;}async['renderSingleTimeline'](_0x40b5f7,_0xce2635,_0x3caa85){const _0x30167f=a56_0x1ddcb4,{tdx:_0x815c84}=_0x40b5f7;let _0x1f60ad,_0x493cbb;try{[_0x1f60ad,_0x493cbb]=await Promise[_0x30167f(0x26d)]([_0x815c84[_0x30167f(0x227)]['attempt'](_0xce2635),_0x815c84['workflow'][_0x30167f(0xec)](_0xce2635,![])]);}catch(_0x56e775){console[_0x30167f(0x12a)](a56_0x4d082d['red']('Failed\x20to\x20fetch\x20attempt\x20data'));_0x3caa85['verbose']&&console[_0x30167f(0x12a)](_0x56e775);throw _0x56e775;}if(_0x3caa85[_0x30167f(0x1fc)]||_0x3caa85[_0x30167f(0x17d)]){const _0x3a8702=this[_0x30167f(0x222)](_0x1f60ad,_0x493cbb);await handleSDKOutput([_0x3a8702],_0x3caa85);return;}const _0xa45422=_0x815c84[_0x30167f(0xe3)][_0x30167f(0x194)],_0x1f4937=this[_0x30167f(0xf7)](_0x1f60ad,_0x493cbb,_0xa45422);console[_0x30167f(0x1a1)](_0x1f4937);}async[a56_0x1ddcb4(0x234)](_0x28d7bb,_0x1ae9a3){const _0x41026a=a56_0x1ddcb4,{tdx:_0x26ce44}=_0x28d7bb,_0x401069=TIMELINE_CONFIG[_0x41026a(0x19e)],_0xf70aa=TIMELINE_CONFIG[_0x41026a(0x197)];let _0x1281e0=0x0;while(_0x1281e0<_0xf70aa){process[_0x41026a(0x1fa)][_0x41026a(0x10c)]&&process[_0x41026a(0x1fa)]['write']('\x1Bc');let _0x44ab88,_0x517629;try{[_0x44ab88,_0x517629]=await Promise[_0x41026a(0x26d)]([_0x26ce44[_0x41026a(0x227)]['attempt'](_0x1ae9a3),_0x26ce44['workflow'][_0x41026a(0xec)](_0x1ae9a3,![])]);}catch(_0x2502dc){console[_0x41026a(0x12a)](a56_0x4d082d[_0x41026a(0x171)](_0x41026a(0x14b)));_0x1281e0>0x0&&console[_0x41026a(0x12a)](a56_0x4d082d[_0x41026a(0x262)](_0x41026a(0x1f1)+_0x1281e0));throw _0x2502dc;}const _0x3ba129=_0x26ce44[_0x41026a(0xe3)][_0x41026a(0x194)],_0x95b302=this['renderTimeline'](_0x44ab88,_0x517629,_0x3ba129);console[_0x41026a(0x1a1)](_0x95b302);const _0x24f6fb=_0x44ab88['done']&&_0x517629['every'](_0x58a08c=>_0x58a08c[_0x41026a(0x1d5)]!=='running'&&_0x58a08c[_0x41026a(0x1d5)]!==_0x41026a(0x212));if(_0x24f6fb){console[_0x41026a(0x12a)](a56_0x4d082d[_0x41026a(0xfb)](_0x41026a(0x1c2)));break;}console[_0x41026a(0x12a)](a56_0x4d082d[_0x41026a(0x262)](_0x41026a(0x1ef)+_0x1281e0*0x2+_0x41026a(0x1d1))),await new Promise(_0x1a30b8=>setTimeout(_0x1a30b8,_0x401069)),_0x1281e0++;}_0x1281e0>=_0xf70aa&&console['error'](a56_0x4d082d[_0x41026a(0x288)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a56_0x1ddcb4(0xf7)](_0x55c561,_0x4be41d,_0x57f385){const _0x50524f=a56_0x1ddcb4,_0x31bb64=[],_0x464abf=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x37f1d2=0x5,_0x174661=process[_0x50524f(0x1fa)][_0x50524f(0x195)]||0x78,_0x5433ba=_0x174661-_0x464abf-_0x37f1d2,_0xa695a4=Math['max'](TIMELINE_CONFIG[_0x50524f(0x192)],Math['min'](_0x5433ba,TIMELINE_CONFIG[_0x50524f(0x1a6)])),_0x27accd=new Date(_0x55c561['createdAt'])[_0x50524f(0x1b4)](),_0x370363=_0x55c561[_0x50524f(0x276)]?new Date(_0x55c561[_0x50524f(0x276)])[_0x50524f(0x1b4)]():Date['now'](),_0x769866={'start':_0x27accd,'end':_0x370363,'duration':_0x370363-_0x27accd},_0x1183df=new Map(),_0x43a784=[];for(const _0x2fcf67 of _0x4be41d){if(_0x2fcf67['startedAt']){const _0x476ba8=new Date(_0x2fcf67[_0x50524f(0x1a8)])['getTime'](),_0x3fed40=_0x2fcf67[_0x50524f(0x29c)]?new Date(_0x2fcf67['updatedAt'])[_0x50524f(0x1b4)]():Date[_0x50524f(0xc4)](),_0x8d7e14={'start':_0x476ba8,'end':_0x3fed40,'duration':_0x3fed40-_0x476ba8};_0x1183df[_0x50524f(0x1c0)](_0x2fcf67['id'],_0x8d7e14),_0x43a784[_0x50524f(0x103)]({'name':_0x2fcf67[_0x50524f(0x118)],'state':_0x2fcf67[_0x50524f(0x1d5)]||_0x50524f(0xee),'window':_0x8d7e14});}else _0x43a784[_0x50524f(0x103)]({'name':_0x2fcf67[_0x50524f(0x118)],'state':_0x2fcf67[_0x50524f(0x1d5)]||_0x50524f(0x212),'window':undefined});}_0x43a784[_0x50524f(0x140)]((_0x40140c,_0x3fac33)=>{const _0x58ad2e=_0x50524f;if(!_0x40140c[_0x58ad2e(0x1f3)])return 0x1;if(!_0x3fac33[_0x58ad2e(0x1f3)])return-0x1;return _0x40140c[_0x58ad2e(0x1f3)]['start']-_0x3fac33[_0x58ad2e(0x1f3)][_0x58ad2e(0xd1)];});const _0x67e149=_0x43a784[_0x50524f(0x1ba)],_0x42ae21=_0x67e149>TIMELINE_CONFIG[_0x50524f(0x203)];_0x42ae21&&_0x43a784[_0x50524f(0x1a0)](TIMELINE_CONFIG[_0x50524f(0x203)]);const _0x30d3ad=calculateTimeScale(_0x769866,_0xa695a4),_0x67da0e=_0x55c561[_0x50524f(0x1bd)]?_0x55c561[_0x50524f(0x283)]?a56_0x4d082d['green'](_0x50524f(0x283)):a56_0x4d082d[_0x50524f(0x171)](_0x50524f(0x12a)):a56_0x4d082d[_0x50524f(0x137)](_0x50524f(0x179)),_0x5b2ba1=_0x55c561[_0x50524f(0x162)]?.['id'],_0x1fd36c=_0x55c561[_0x50524f(0x1f2)];let _0x1c4313;if(_0x5b2ba1&&_0x1fd36c){const _0x35f052=getWorkflowAttemptUrl(_0x57f385,_0x5b2ba1,_0x1fd36c,_0x55c561['id']);_0x1c4313=hyperlink(a56_0x4d082d['dim'](_0x55c561['id']),_0x35f052);}else _0x1c4313=a56_0x4d082d['dim'](_0x55c561['id']);_0x31bb64['push']('Attempt:\x20'+_0x1c4313+_0x50524f(0x119)+_0x67da0e+_0x50524f(0x119)+formatElapsed(_0x769866[_0x50524f(0x1da)]));if(_0x43a784['length']>0x0){const _0x4ee419=renderTimeAxis(_0x30d3ad,_0xa695a4),_0x38964e=new Date(_0x769866['start']),_0x2badcd=formatDate(_0x38964e),_0x439dab=TIMELINE_CONFIG[_0x50524f(0x182)]+TIMELINE_CONFIG[_0x50524f(0x21b)]+_0x464abf,_0x3c59b7=_0x2badcd[_0x50524f(0xc2)](_0x439dab),_0xb0ff9f=a56_0x4d082d['dim'](_0x3c59b7);_0x31bb64[_0x50524f(0x103)](_0xb0ff9f+'\x20'+_0x4ee419);for(const _0x401052 of _0x43a784){_0x31bb64[_0x50524f(0x103)](renderTaskRow(_0x401052,_0x30d3ad,_0xa695a4,_0x464abf));}const _0x5783fb=calculateStats(_0x43a784);_0x31bb64[_0x50524f(0x103)](formatStats(_0x5783fb)),_0x42ae21&&_0x31bb64[_0x50524f(0x103)](a56_0x4d082d[_0x50524f(0x288)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x50524f(0x203)]+_0x50524f(0x1e2)+_0x67e149+'\x20tasks')),_0x31bb64[_0x50524f(0x103)](''),_0x31bb64[_0x50524f(0x103)](a56_0x4d082d['dim'](_0x50524f(0x158))+('tdx\x20wf\x20attempt\x20'+_0x55c561['id']+'\x20logs')+a56_0x4d082d[_0x50524f(0x262)]('\x20to\x20see\x20detailed\x20logs'));}else _0x31bb64[_0x50524f(0x103)](_0x50524f(0x15e));return _0x31bb64[_0x50524f(0x13b)]('\x0a');}[a56_0x1ddcb4(0x222)](_0xa6ef60,_0x17c556){const _0x47738a=a56_0x1ddcb4,_0x4fad31=new Date(_0xa6ef60[_0x47738a(0x245)])[_0x47738a(0x1b4)](),_0x194351=_0xa6ef60[_0x47738a(0x276)]?new Date(_0xa6ef60[_0x47738a(0x276)])[_0x47738a(0x1b4)]():Date[_0x47738a(0xc4)](),_0x2fd807=_0x194351-_0x4fad31,_0x5f4cdd=[];for(const _0x4c1547 of _0x17c556){if(_0x4c1547[_0x47738a(0x1a8)]){const _0x1e713a=new Date(_0x4c1547['startedAt'])[_0x47738a(0x1b4)](),_0x32be48=_0x4c1547[_0x47738a(0x29c)]?new Date(_0x4c1547[_0x47738a(0x29c)])[_0x47738a(0x1b4)]():Date[_0x47738a(0xc4)]();_0x5f4cdd[_0x47738a(0x103)]({'name':_0x4c1547[_0x47738a(0x118)],'state':_0x4c1547['state']||_0x47738a(0xee),'window':{'start':_0x1e713a,'end':_0x32be48,'duration':_0x32be48-_0x1e713a}});}else _0x5f4cdd['push']({'name':_0x4c1547[_0x47738a(0x118)],'state':_0x4c1547[_0x47738a(0x1d5)]||_0x47738a(0x212),'window':undefined});}const _0xbd65d5=calculateStats(_0x5f4cdd);return{'attempt':{'id':_0xa6ef60['id'],'status':_0xa6ef60[_0x47738a(0x1bd)]?_0xa6ef60[_0x47738a(0x283)]?_0x47738a(0x283):_0x47738a(0x12a):'running','createdAt':_0xa6ef60[_0x47738a(0x245)],'finishedAt':_0xa6ef60[_0x47738a(0x276)],'duration_ms':_0x2fd807},'tasks':_0x5f4cdd[_0x47738a(0x175)](_0x46b179=>({'name':_0x46b179[_0x47738a(0x161)],'state':_0x46b179[_0x47738a(0x1d5)],'startedAt':_0x46b179[_0x47738a(0x1f3)]?new Date(_0x46b179[_0x47738a(0x1f3)]['start'])[_0x47738a(0x168)]():null,'updatedAt':_0x46b179[_0x47738a(0x1f3)]?new Date(_0x46b179[_0x47738a(0x1f3)][_0x47738a(0x208)])[_0x47738a(0x168)]():null,'duration_ms':_0x46b179[_0x47738a(0x1f3)]?.['duration']||null})),'stats':_0xbd65d5};}}function formatScheduleLine(_0x2fa5ed){const _0x508818=a56_0x1ddcb4,_0x3dde65=_0x2fa5ed[_0x508818(0xd9)]?a56_0x4d082d[_0x508818(0x288)](_0x508818(0x141)):'',_0x2ec590=_0x2fa5ed['project']?.[_0x508818(0x161)]?a56_0x4d082d['dim']('\x20['+_0x2fa5ed[_0x508818(0x162)][_0x508818(0x161)]+']'):'',_0x3deae2=_0x2fa5ed[_0x508818(0x10f)]?a56_0x4d082d[_0x508818(0x262)](_0x508818(0x272)+new Date(_0x2fa5ed['nextRunTime'])[_0x508818(0x18e)]()):'';return'📅\x20#'+_0x2fa5ed['id']+'\x20'+(_0x2fa5ed['workflow']?.[_0x508818(0x161)]||'(unknown)')+_0x2ec590+_0x3dde65+_0x3deae2;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x1ddcb4(0x161)]='workflow:schedules';['description']='List\x20workflow\x20schedules';async[a56_0x1ddcb4(0x12f)](_0x346324){const _0x416bd1=a56_0x1ddcb4,{options:_0x21129b,args:_0x167e85,tdx:_0x5400d4}=_0x346324,{scheduleId:_0xf333f7}=_0x21129b;if(_0xf333f7&&_0x167e85[0x0])return console[_0x416bd1(0x12a)](a56_0x4d082d[_0x416bd1(0x171)](_0x416bd1(0x106)),_0x416bd1(0xd7)),console[_0x416bd1(0x12a)](a56_0x4d082d[_0x416bd1(0x262)](_0x416bd1(0x223))),0x1;if(_0xf333f7){const _0x17ef51=await withSpinner(_0x416bd1(0x267)+_0xf333f7+_0x416bd1(0xea),()=>_0x5400d4[_0x416bd1(0x227)][_0x416bd1(0x193)](_0xf333f7),{'verbose':_0x21129b['verbose']}),_0x162dde=_0x17ef51[_0x416bd1(0x14d)];return isStructuredFormat(_0x21129b)?await handleSingleObjectOutput(_0x162dde,_0x21129b):(console[_0x416bd1(0x12a)](_0x416bd1(0x104)),console['log'](formatScheduleLine(_0x162dde))),0x0;}const _0x19deeb=this[_0x416bd1(0x1fd)](_0x167e85,_0x21129b);if(!_0x19deeb)return 0x1;const {projectName:_0x45eac5,workflowName:_0x1eeca8}=_0x19deeb,_0x524d1d=_0x45eac5?'\x27'+_0x45eac5+(_0x1eeca8?'.'+_0x1eeca8:'')+'\x27':undefined,_0x4338bb=await withSpinner(_0x524d1d?_0x416bd1(0xd0)+_0x524d1d+'...':'Listing\x20schedules...',()=>_0x45eac5?_0x5400d4[_0x416bd1(0x227)][_0x416bd1(0x22a)](_0x45eac5,{'workflow':_0x1eeca8,'limit':_0x21129b[_0x416bd1(0x24e)]}):_0x5400d4[_0x416bd1(0x227)][_0x416bd1(0x297)]({'limit':_0x21129b[_0x416bd1(0x24e)]}),{'verbose':_0x21129b[_0x416bd1(0x199)]}),_0x498f88=_0x4338bb[_0x416bd1(0x14d)],_0x3bf583=_0x21129b[_0x416bd1(0x24e)]&&_0x498f88[_0x416bd1(0x1ba)]>=_0x21129b['limit']?a56_0x4d082d[_0x416bd1(0x262)](_0x416bd1(0x1dd)):'';console['error'](_0x416bd1(0x1b2)+_0x498f88[_0x416bd1(0x1ba)]+'\x20schedule'+(_0x498f88[_0x416bd1(0x1ba)]!==0x1?'s':'')+_0x3bf583);if(isStructuredFormat(_0x21129b))await handleSDKOutput(_0x498f88,_0x21129b);else{if(_0x498f88[_0x416bd1(0x1ba)]===0x0)console[_0x416bd1(0x1a1)](_0x416bd1(0x185));else for(const _0x2076f9 of _0x498f88){console[_0x416bd1(0x1a1)](formatScheduleLine(_0x2076f9));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x1ddcb4(0x161)]='workflow:schedule:enable';[a56_0x1ddcb4(0xe9)]='Enable\x20a\x20workflow\x20schedule';async['execute'](_0x57694a){const _0xac17c2=a56_0x1ddcb4,{options:_0x4d3a67,args:_0x52d4a5,tdx:_0x5a7031}=_0x57694a,_0x444449=_0x52d4a5[0x0];if(!_0x444449)return console['error'](a56_0x4d082d[_0xac17c2(0x171)](_0xac17c2(0x106)),'Schedule\x20ID\x20is\x20required'),console[_0xac17c2(0x12a)](a56_0x4d082d['dim']('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console['error'](a56_0x4d082d[_0xac17c2(0x262)](_0xac17c2(0x250))),0x1;const {backfill:_0x2f7eb8,nextTime:_0x25eec7}=_0x4d3a67,_0x2f4780={};if(_0x2f7eb8!==undefined)_0x2f4780[_0xac17c2(0x282)]=!_0x2f7eb8;if(_0x25eec7!==undefined)_0x2f4780['nextTime']=_0x25eec7;const _0x407c39=await withSpinner(_0xac17c2(0x1bc)+_0x444449+_0xac17c2(0xea),()=>_0x5a7031[_0xac17c2(0x227)][_0xac17c2(0x1bf)](_0x444449,_0x2f4780),{'verbose':_0x4d3a67['verbose']}),_0x1a639e=_0x407c39[_0xac17c2(0x14d)];return isStructuredFormat(_0x4d3a67)?await handleSingleObjectOutput(_0x1a639e,_0x4d3a67):(console[_0xac17c2(0x1a1)](_0xac17c2(0x1b9)+_0x444449+_0xac17c2(0x281)+(_0x1a639e['workflow']?.[_0xac17c2(0x161)]||_0xac17c2(0xee))+')'),_0x1a639e['nextRunTime']&&console[_0xac17c2(0x1a1)](a56_0x4d082d['dim']('\x20\x20Next\x20run:\x20'+new Date(_0x1a639e[_0xac17c2(0x10f)])[_0xac17c2(0x18e)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']=a56_0x1ddcb4(0x13a);[a56_0x1ddcb4(0xe9)]='Disable\x20a\x20workflow\x20schedule';async[a56_0x1ddcb4(0x12f)](_0x1d1113){const _0xf3fe49=a56_0x1ddcb4,{options:_0x29dc8a,args:_0x4cbf78,tdx:_0x413ed8}=_0x1d1113,_0x3adfae=_0x4cbf78[0x0];if(!_0x3adfae)return console[_0xf3fe49(0x12a)](a56_0x4d082d['red'](_0xf3fe49(0x106)),'Schedule\x20ID\x20is\x20required'),console[_0xf3fe49(0x12a)](a56_0x4d082d[_0xf3fe49(0x262)](_0xf3fe49(0x1e9))),console[_0xf3fe49(0x12a)](a56_0x4d082d[_0xf3fe49(0x262)](_0xf3fe49(0x250))),0x1;const _0x7c028c=await withSpinner(_0xf3fe49(0x1be)+_0x3adfae+_0xf3fe49(0xea),()=>_0x413ed8[_0xf3fe49(0x227)]['disableSchedule'](_0x3adfae),{'verbose':_0x29dc8a[_0xf3fe49(0x199)]}),_0xd29dd5=_0x7c028c[_0xf3fe49(0x14d)];return isStructuredFormat(_0x29dc8a)?await handleSingleObjectOutput(_0xd29dd5,_0x29dc8a):console[_0xf3fe49(0x1a1)](_0xf3fe49(0x1b9)+_0x3adfae+_0xf3fe49(0x29e)+(_0xd29dd5[_0xf3fe49(0x227)]?.[_0xf3fe49(0x161)]||_0xf3fe49(0xee))+')'),0x0;}}