@treasuredata/tdx 2026.7.6 → 2026.8.1

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 (332) 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.d.ts.map +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/api-command.js.map +1 -1
  13. package/dist/commands/auth-command.d.ts +9 -0
  14. package/dist/commands/auth-command.d.ts.map +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/auth-command.js.map +1 -1
  17. package/dist/commands/cas-command.js +1 -1
  18. package/dist/commands/cas-segment-command.js +1 -1
  19. package/dist/commands/chat-command.js +1 -1
  20. package/dist/commands/claude-command.d.ts +10 -1
  21. package/dist/commands/claude-command.d.ts.map +1 -1
  22. package/dist/commands/claude-command.js +1 -1
  23. package/dist/commands/claude-command.js.map +1 -1
  24. package/dist/commands/claude-statusline-command.js +1 -1
  25. package/dist/commands/claude-usage-command.js +1 -1
  26. package/dist/commands/command.d.ts +8 -0
  27. package/dist/commands/command.d.ts.map +1 -1
  28. package/dist/commands/command.js +1 -1
  29. package/dist/commands/command.js.map +1 -1
  30. package/dist/commands/connection-command.js +1 -1
  31. package/dist/commands/databases.js +1 -1
  32. package/dist/commands/delivery-command.js +1 -1
  33. package/dist/commands/describe.js +1 -1
  34. package/dist/commands/engage-always-on-campaign-pull-command.d.ts +16 -0
  35. package/dist/commands/engage-always-on-campaign-pull-command.d.ts.map +1 -0
  36. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -0
  37. package/dist/commands/engage-always-on-campaign-pull-command.js.map +1 -0
  38. package/dist/commands/engage-always-on-campaign-push-command.d.ts +16 -0
  39. package/dist/commands/engage-always-on-campaign-push-command.d.ts.map +1 -0
  40. package/dist/commands/engage-always-on-campaign-push-command.js +1 -0
  41. package/dist/commands/engage-always-on-campaign-push-command.js.map +1 -0
  42. package/dist/commands/engage-always-on-campaign-validate-command.d.ts +16 -0
  43. package/dist/commands/engage-always-on-campaign-validate-command.d.ts.map +1 -0
  44. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -0
  45. package/dist/commands/engage-always-on-campaign-validate-command.js.map +1 -0
  46. package/dist/commands/engage-campaign-pull-command.js +1 -1
  47. package/dist/commands/engage-campaign-push-command.js +1 -1
  48. package/dist/commands/engage-campaign-validate-command.js +1 -1
  49. package/dist/commands/engage-command.d.ts +1 -1
  50. package/dist/commands/engage-command.js +1 -1
  51. package/dist/commands/engage-template-pull-command.js +1 -1
  52. package/dist/commands/engage-template-push-command.js +1 -1
  53. package/dist/commands/engage-template-validate-command.js +1 -1
  54. package/dist/commands/job-command.js +1 -1
  55. package/dist/commands/journey-command.js +1 -1
  56. package/dist/commands/journey-validate-command.js +1 -1
  57. package/dist/commands/llm-command.js +1 -1
  58. package/dist/commands/mcp-command.js +1 -1
  59. package/dist/commands/parent-segment-command.js +1 -1
  60. package/dist/commands/policy-command.js +1 -1
  61. package/dist/commands/profile-command.js +1 -1
  62. package/dist/commands/profile-command.js.map +1 -1
  63. package/dist/commands/profiles-command.js +1 -1
  64. package/dist/commands/query-command.js +1 -1
  65. package/dist/commands/schedule-command.js +1 -1
  66. package/dist/commands/segment-command.js +1 -1
  67. package/dist/commands/segment-create-command.js +1 -1
  68. package/dist/commands/segment-fields-command.js +1 -1
  69. package/dist/commands/segment-move-command.js +1 -1
  70. package/dist/commands/segment-pull-command.js +1 -1
  71. package/dist/commands/segment-push-command.d.ts.map +1 -1
  72. package/dist/commands/segment-push-command.js +1 -1
  73. package/dist/commands/segment-push-command.js.map +1 -1
  74. package/dist/commands/segment-update-command.js +1 -1
  75. package/dist/commands/segment-use-command.js +1 -1
  76. package/dist/commands/segment-validate-command.js +1 -1
  77. package/dist/commands/segments.js +1 -1
  78. package/dist/commands/show.js +1 -1
  79. package/dist/commands/status-command.d.ts.map +1 -1
  80. package/dist/commands/status-command.js +1 -1
  81. package/dist/commands/status-command.js.map +1 -1
  82. package/dist/commands/table-deleted.js +1 -1
  83. package/dist/commands/tables.js +1 -1
  84. package/dist/commands/unset-command.js +1 -1
  85. package/dist/commands/upgrade-command.js +1 -1
  86. package/dist/commands/use-command.d.ts.map +1 -1
  87. package/dist/commands/use-command.js +1 -1
  88. package/dist/commands/use-command.js.map +1 -1
  89. package/dist/commands/user-command.js +1 -1
  90. package/dist/commands/work-command.js +1 -1
  91. package/dist/commands/workflow-command.js +1 -1
  92. package/dist/core/auth.js +1 -1
  93. package/dist/core/command-output.js +1 -1
  94. package/dist/core/config.js +1 -1
  95. package/dist/core/connection-cache.js +1 -1
  96. package/dist/core/constants.js +1 -1
  97. package/dist/core/credential-cache.js +1 -1
  98. package/dist/core/global-context.d.ts +35 -1
  99. package/dist/core/global-context.d.ts.map +1 -1
  100. package/dist/core/global-context.js +1 -1
  101. package/dist/core/global-context.js.map +1 -1
  102. package/dist/core/keychain.js +1 -1
  103. package/dist/core/oauth-keychain.js +1 -1
  104. package/dist/core/oauth.js +1 -1
  105. package/dist/core/profile.js +1 -1
  106. package/dist/core/project-config.js +1 -1
  107. package/dist/core/session.js +1 -1
  108. package/dist/core/site-mismatch.d.ts +68 -0
  109. package/dist/core/site-mismatch.d.ts.map +1 -0
  110. package/dist/core/site-mismatch.js +1 -0
  111. package/dist/core/site-mismatch.js.map +1 -0
  112. package/dist/core/user-cache.js +1 -1
  113. package/dist/core/version.js +1 -1
  114. package/dist/index.js +1 -1
  115. package/dist/mcp/server.js +1 -1
  116. package/dist/mcp/tools/index.js +1 -1
  117. package/dist/mcp/tools/tdx-run.js +1 -1
  118. package/dist/mcp/tools/tdx-search.js +1 -1
  119. package/dist/mcp/tools/work-create-item.js +1 -1
  120. package/dist/mcp/utils.js +1 -1
  121. package/dist/proxy/claude-usage-tracker.js +1 -1
  122. package/dist/proxy/passthrough-server.js +1 -1
  123. package/dist/proxy/sse-usage-parser.js +1 -1
  124. package/dist/sdk/agent/agent-config.js +1 -1
  125. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  126. package/dist/sdk/agent/agent-yaml.js +1 -1
  127. package/dist/sdk/agent/test/evaluator.js +1 -1
  128. package/dist/sdk/agent/test/executor.js +1 -1
  129. package/dist/sdk/agent/test/index.js +1 -1
  130. package/dist/sdk/agent/test/output.js +1 -1
  131. package/dist/sdk/agent/test/parser.js +1 -1
  132. package/dist/sdk/agent/tool-target-registry.js +1 -1
  133. package/dist/sdk/api.js +1 -1
  134. package/dist/sdk/auth-token.d.ts +23 -0
  135. package/dist/sdk/auth-token.d.ts.map +1 -0
  136. package/dist/sdk/auth-token.js +1 -0
  137. package/dist/sdk/auth-token.js.map +1 -0
  138. package/dist/sdk/cas/cas-api-client.js +1 -1
  139. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  140. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  141. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  142. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  143. package/dist/sdk/cas/index.js +1 -1
  144. package/dist/sdk/cas/pull-workflow.js +1 -1
  145. package/dist/sdk/cas/push-workflow.js +1 -1
  146. package/dist/sdk/cas/validate-files.js +1 -1
  147. package/dist/sdk/client/cdp-api-client.js +1 -1
  148. package/dist/sdk/client/delivery-api-client.js +1 -1
  149. package/dist/sdk/client/endpoints.js +1 -1
  150. package/dist/sdk/client/engage-api-client.d.ts +1 -1
  151. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  152. package/dist/sdk/client/engage-api-client.js +1 -1
  153. package/dist/sdk/client/engage-api-client.js.map +1 -1
  154. package/dist/sdk/client/http-client.js +1 -1
  155. package/dist/sdk/client/llm-api-client.js +1 -1
  156. package/dist/sdk/client/oauth-refresh.js +1 -1
  157. package/dist/sdk/client/rate-limiter.js +1 -1
  158. package/dist/sdk/client/td-api-client.js +1 -1
  159. package/dist/sdk/client/trino-api-client.js +1 -1
  160. package/dist/sdk/client/workflow-client.js +1 -1
  161. package/dist/sdk/connection-validator.d.ts +7 -4
  162. package/dist/sdk/connection-validator.d.ts.map +1 -1
  163. package/dist/sdk/connection-validator.js +1 -1
  164. package/dist/sdk/connection-validator.js.map +1 -1
  165. package/dist/sdk/connection.d.ts +15 -0
  166. package/dist/sdk/connection.d.ts.map +1 -1
  167. package/dist/sdk/connection.js +1 -1
  168. package/dist/sdk/connection.js.map +1 -1
  169. package/dist/sdk/delivery.js +1 -1
  170. package/dist/sdk/engage/always-on-campaign-pull.d.ts +66 -0
  171. package/dist/sdk/engage/always-on-campaign-pull.d.ts.map +1 -0
  172. package/dist/sdk/engage/always-on-campaign-pull.js +1 -0
  173. package/dist/sdk/engage/always-on-campaign-pull.js.map +1 -0
  174. package/dist/sdk/engage/always-on-campaign-push.d.ts +93 -0
  175. package/dist/sdk/engage/always-on-campaign-push.d.ts.map +1 -0
  176. package/dist/sdk/engage/always-on-campaign-push.js +1 -0
  177. package/dist/sdk/engage/always-on-campaign-push.js.map +1 -0
  178. package/dist/sdk/engage/always-on-campaign-validator.d.ts +18 -0
  179. package/dist/sdk/engage/always-on-campaign-validator.d.ts.map +1 -0
  180. package/dist/sdk/engage/always-on-campaign-validator.js +1 -0
  181. package/dist/sdk/engage/always-on-campaign-validator.js.map +1 -0
  182. package/dist/sdk/engage/always-on-campaign-yaml.d.ts +62 -0
  183. package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -0
  184. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -0
  185. package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -0
  186. package/dist/sdk/engage/campaign-pull.js +1 -1
  187. package/dist/sdk/engage/campaign-push.js +1 -1
  188. package/dist/sdk/engage/campaign-validator.js +1 -1
  189. package/dist/sdk/engage/campaign-yaml.js +1 -1
  190. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  191. package/dist/sdk/engage/template-pull.js +1 -1
  192. package/dist/sdk/engage/template-push.js +1 -1
  193. package/dist/sdk/engage/template-validator.js +1 -1
  194. package/dist/sdk/engage/template-yaml.js +1 -1
  195. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +125 -0
  196. package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -0
  197. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -0
  198. package/dist/sdk/engage/types/always-on-campaign-schema.js.map +1 -0
  199. package/dist/sdk/engage/types/campaign-def.js +1 -1
  200. package/dist/sdk/engage/types/campaign-schema.d.ts +8 -8
  201. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  202. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  203. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  204. package/dist/sdk/engage/types/template-schema.js +1 -1
  205. package/dist/sdk/engage.d.ts +20 -0
  206. package/dist/sdk/engage.d.ts.map +1 -1
  207. package/dist/sdk/engage.js +1 -1
  208. package/dist/sdk/engage.js.map +1 -1
  209. package/dist/sdk/errors.d.ts +13 -2
  210. package/dist/sdk/errors.d.ts.map +1 -1
  211. package/dist/sdk/errors.js +1 -1
  212. package/dist/sdk/errors.js.map +1 -1
  213. package/dist/sdk/index.js +1 -1
  214. package/dist/sdk/io/index.js +1 -1
  215. package/dist/sdk/io/node-filesystem.js +1 -1
  216. package/dist/sdk/job.js +1 -1
  217. package/dist/sdk/journey.js +1 -1
  218. package/dist/sdk/llm/chat-cache.js +1 -1
  219. package/dist/sdk/llm/index.js +1 -1
  220. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  221. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  222. package/dist/sdk/llm/model-factors.js +1 -1
  223. package/dist/sdk/llm/model-factors.js.map +1 -1
  224. package/dist/sdk/llm/user-settings.js +1 -1
  225. package/dist/sdk/personalization.js +1 -1
  226. package/dist/sdk/policy.js +1 -1
  227. package/dist/sdk/query/deleted-table-validation.js +1 -1
  228. package/dist/sdk/query/index.js +1 -1
  229. package/dist/sdk/query/sql-parser.js +1 -1
  230. package/dist/sdk/realtime.js +1 -1
  231. package/dist/sdk/schedule.js +1 -1
  232. package/dist/sdk/segment/child-segment-yaml.d.ts +12 -2
  233. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  234. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  235. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  236. package/dist/sdk/segment/fields-display.js +1 -1
  237. package/dist/sdk/segment/file-discovery.js +1 -1
  238. package/dist/sdk/segment/journey-utils.js +1 -1
  239. package/dist/sdk/segment/journey-validator.js +1 -1
  240. package/dist/sdk/segment/journey-yaml.js +1 -1
  241. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  242. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  243. package/dist/sdk/segment/pull-workflow.js +1 -1
  244. package/dist/sdk/segment/push-recovery.js +1 -1
  245. package/dist/sdk/segment/push-workflow.js +1 -1
  246. package/dist/sdk/segment/resolution-context.js +1 -1
  247. package/dist/sdk/segment/segment-path-parser.js +1 -1
  248. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  249. package/dist/sdk/segment/segment-validator.js +1 -1
  250. package/dist/sdk/segment/target-resolution.js +1 -1
  251. package/dist/sdk/segment/tdx-config.js +1 -1
  252. package/dist/sdk/segment/types/activation-schema.js +1 -1
  253. package/dist/sdk/segment/types/journey-def.js +1 -1
  254. package/dist/sdk/segment/types/journey-schema.js +1 -1
  255. package/dist/sdk/segment/types/segment-def.js +1 -1
  256. package/dist/sdk/segment/types/segment-schema.js +1 -1
  257. package/dist/sdk/segment/validate-files.d.ts +6 -1
  258. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  259. package/dist/sdk/segment/validate-files.js +1 -1
  260. package/dist/sdk/segment/validate-files.js.map +1 -1
  261. package/dist/sdk/segment/yaml-validator.js +1 -1
  262. package/dist/sdk/segment.js +1 -1
  263. package/dist/sdk/types/engage.d.ts +31 -5
  264. package/dist/sdk/types/engage.d.ts.map +1 -1
  265. package/dist/sdk/types/index.d.ts +1 -1
  266. package/dist/sdk/types/index.d.ts.map +1 -1
  267. package/dist/sdk/types/index.js +1 -1
  268. package/dist/sdk/types/progress.js +1 -1
  269. package/dist/sdk/types/workspace.js +1 -1
  270. package/dist/sdk/user.js +1 -1
  271. package/dist/sdk/util/format-detector.js +1 -1
  272. package/dist/sdk/util/formatters.js +1 -1
  273. package/dist/sdk/util/index.js +1 -1
  274. package/dist/sdk/util/paginate.js +1 -1
  275. package/dist/sdk/util/tree-formatter.js +1 -1
  276. package/dist/sdk/util/tree-search.js +1 -1
  277. package/dist/sdk/workflow/archive-validation.js +1 -1
  278. package/dist/sdk/workflow/clone-workflow.js +1 -1
  279. package/dist/sdk/workflow/index.js +1 -1
  280. package/dist/sdk/workflow/pull-workflow.js +1 -1
  281. package/dist/sdk/workflow/push-workflow.js +1 -1
  282. package/dist/sdk/workflow/task-graph.js +1 -1
  283. package/dist/sdk/workflow/tdx-config.js +1 -1
  284. package/dist/sdk/workflow/workflow-utils.js +1 -1
  285. package/dist/sdk/workspace/access-tracker.js +1 -1
  286. package/dist/sdk/workspace/frontmatter.js +1 -1
  287. package/dist/sdk/workspace/git.js +1 -1
  288. package/dist/sdk/workspace/index.js +1 -1
  289. package/dist/sdk/workspace/templates.js +1 -1
  290. package/dist/sdk/workspace/weekly.js +1 -1
  291. package/dist/sdk/workspace/wikilinks.js +1 -1
  292. package/dist/test-utils/command-runner.js +1 -1
  293. package/dist/test-utils/factories.d.ts +6 -0
  294. package/dist/test-utils/factories.d.ts.map +1 -1
  295. package/dist/test-utils/factories.js +1 -1
  296. package/dist/test-utils/factories.js.map +1 -1
  297. package/dist/test-utils/fixtures.js +1 -1
  298. package/dist/test-utils/http-mock.js +1 -1
  299. package/dist/test-utils/index.d.ts +1 -1
  300. package/dist/test-utils/index.d.ts.map +1 -1
  301. package/dist/test-utils/index.js +1 -1
  302. package/dist/test-utils/index.js.map +1 -1
  303. package/dist/utils/async.js +1 -1
  304. package/dist/utils/claude-code-state.js +1 -1
  305. package/dist/utils/colors.js +1 -1
  306. package/dist/utils/diff.js +1 -1
  307. package/dist/utils/file-permissions.js +1 -1
  308. package/dist/utils/file-reader.js +1 -1
  309. package/dist/utils/github-releases.js +1 -1
  310. package/dist/utils/global-cache.js +1 -1
  311. package/dist/utils/json-loader.js +1 -1
  312. package/dist/utils/local-cache.js +1 -1
  313. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  314. package/dist/utils/logger/formatters/index.js +1 -1
  315. package/dist/utils/logger/handlers/console-handler.js +1 -1
  316. package/dist/utils/logger/handlers/file-handler.js +1 -1
  317. package/dist/utils/logger/handlers/index.js +1 -1
  318. package/dist/utils/logger/handlers/null-handler.js +1 -1
  319. package/dist/utils/logger/index.js +1 -1
  320. package/dist/utils/logger/logger.js +1 -1
  321. package/dist/utils/logger/types.js +1 -1
  322. package/dist/utils/option-validation.js +1 -1
  323. package/dist/utils/process.js +1 -1
  324. package/dist/utils/prompt.js +1 -1
  325. package/dist/utils/proxy-fetch.js +1 -1
  326. package/dist/utils/spinner.js +1 -1
  327. package/dist/utils/sse-parser.js +1 -1
  328. package/dist/utils/string-utils.js +1 -1
  329. package/dist/utils/table-ref-parser.js +1 -1
  330. package/dist/utils/tdx-logger.js +1 -1
  331. package/dist/utils/version-check.js +1 -1
  332. package/package.json +1 -1
@@ -1 +1 @@
1
- const a56_0x4d17f9=a56_0x26aa;(function(_0x28a23d,_0x25ebfb){const _0x503fe8=a56_0x26aa,_0x49ae0d=_0x28a23d();while(!![]){try{const _0x395219=parseInt(_0x503fe8(0x23c))/0x1*(parseInt(_0x503fe8(0x154))/0x2)+parseInt(_0x503fe8(0x28a))/0x3*(-parseInt(_0x503fe8(0x137))/0x4)+parseInt(_0x503fe8(0x1d0))/0x5*(parseInt(_0x503fe8(0x134))/0x6)+parseInt(_0x503fe8(0x1c0))/0x7*(parseInt(_0x503fe8(0x2ad))/0x8)+-parseInt(_0x503fe8(0x209))/0x9+-parseInt(_0x503fe8(0x140))/0xa+parseInt(_0x503fe8(0x238))/0xb;if(_0x395219===_0x25ebfb)break;else _0x49ae0d['push'](_0x49ae0d['shift']());}catch(_0x1791d9){_0x49ae0d['push'](_0x49ae0d['shift']());}}}(a56_0x1da5,0x255ab));import a56_0x3e0f1d from'chalk';import{existsSync}from'fs';import a56_0x1d0c78 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_0x2c360c from'prompts';function getAttemptStatusDisplay(_0x3a1a2a){const _0x936d50=a56_0x26aa;if(!_0x3a1a2a)return{'icon':'⏳','text':''};const {done:_0xea5f0b,success:_0x367fc4,cancelRequested:_0x466ae1}=_0x3a1a2a;if(!_0xea5f0b)return _0x466ae1?{'icon':'🛑','text':a56_0x3e0f1d[_0x936d50(0x2a8)]('canceling')}:{'icon':'🔄','text':a56_0x3e0f1d[_0x936d50(0x2cb)](_0x936d50(0x15b))};if(_0x367fc4)return{'icon':'✅','text':a56_0x3e0f1d[_0x936d50(0x182)](_0x936d50(0x2f1))};return{'icon':'❌','text':a56_0x3e0f1d[_0x936d50(0x2d7)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a56_0x4d17f9(0x180)](_0x17868f,_0x1599cd,_0x5cad29=0x0){const _0x132b17=a56_0x4d17f9;return _0x17868f[_0x5cad29]||_0x1599cd[_0x132b17(0x1e4)];}[a56_0x4d17f9(0x14c)](_0x28d834,_0x1281d1,_0x27ef95=0x0){const _0x107d0e=a56_0x4d17f9,_0x48fb15=this[_0x107d0e(0x180)](_0x28d834,_0x1281d1,_0x27ef95);if(!_0x48fb15)return console['error'](a56_0x3e0f1d['red'](_0x107d0e(0x244)),_0x107d0e(0x1bc)),console[_0x107d0e(0x19d)](a56_0x3e0f1d['dim'](_0x107d0e(0x24d))),null;return _0x48fb15;}[a56_0x4d17f9(0x167)](_0x5a7275,_0x2952ca){const _0xed074a=a56_0x4d17f9;if(_0x5a7275[0x0]){const _0x5d7059=_0x5a7275[0x0][_0xed074a(0x2c0)]('.');if(_0x5d7059[_0xed074a(0x1d4)]===0x1)return{'projectName':_0x5d7059[0x0],'workflowName':undefined};else return _0x5d7059['length']===0x2?{'projectName':_0x5d7059[0x0],'workflowName':_0x5d7059[0x1]}:(console[_0xed074a(0x19d)](a56_0x3e0f1d[_0xed074a(0x2d7)]('Error:'),_0xed074a(0x201)),null);}return{'projectName':_0x2952ca[_0xed074a(0x1e4)],'workflowName':undefined};}['resolveProjectDir'](_0x1e0fee,_0x32ebcc,_0x899fc2=0x0){const _0x3683bc=a56_0x4d17f9;if(_0x1e0fee[_0x899fc2])return _0x1e0fee[_0x899fc2];if(_0x32ebcc[_0x3683bc(0x1e4)]){const _0x1d5f2c=a56_0x1d0c78[_0x3683bc(0x278)](process[_0x3683bc(0x2ca)](),'workflows',_0x32ebcc[_0x3683bc(0x1e4)]);if(existsSync(a56_0x1d0c78['join'](_0x1d5f2c,_0x3683bc(0x2e6))))return _0x1d5f2c;}return undefined;}async[a56_0x4d17f9(0x2b1)](_0x24a6ca,_0x5450f4,_0x166aff){const _0xb5b9e6=a56_0x4d17f9;try{const _0x16954c=await _0x24a6ca['workflow'][_0xb5b9e6(0x2d0)](_0x5450f4,{'limit':0x1});if(_0x16954c[_0xb5b9e6(0x1d4)]>0x0){const _0x44ffb1=_0x16954c[0x0]['id'],_0x49864d=getWorkflowUrl(_0x166aff,_0x44ffb1);console['error'](_0xb5b9e6(0x188)+a56_0x3e0f1d[_0xb5b9e6(0x222)](_0x49864d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x20e);['description']=a56_0x4d17f9(0x26b);async['execute'](_0x43f7d8){const _0x56d1aa=a56_0x4d17f9,{options:_0x201886,args:_0xa325eb,tdx:_0x10920f}=_0x43f7d8,_0x44b3ec=_0xa325eb[0x0],_0x3d5ddd=_0x201886[_0x56d1aa(0x2df)];if(_0x3d5ddd)return saveSessionContext({'workflow_project':undefined},_0x201886['session']),console[_0x56d1aa(0x221)](a56_0x3e0f1d[_0x56d1aa(0x182)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x44b3ec)return console['error'](a56_0x3e0f1d['red']('Error:'),_0x56d1aa(0x1bc)),console[_0x56d1aa(0x19d)](a56_0x3e0f1d[_0x56d1aa(0x1f9)](_0x56d1aa(0x226))),console[_0x56d1aa(0x19d)](a56_0x3e0f1d[_0x56d1aa(0x1f9)](_0x56d1aa(0x135))),0x1;const _0x429c39=await withSpinner(_0x56d1aa(0x223)+_0x44b3ec+_0x56d1aa(0x240),()=>_0x10920f[_0x56d1aa(0x13f)][_0x56d1aa(0x2c2)](_0x44b3ec),{'verbose':_0x201886[_0x56d1aa(0x1c8)]}),{name:_0x378d5d}=_0x429c39['data'];return saveSessionContext({'workflow_project':_0x378d5d},_0x201886[_0x56d1aa(0x1c9)]),console[_0x56d1aa(0x221)](a56_0x3e0f1d[_0x56d1aa(0x182)](_0x56d1aa(0x28e)+a56_0x3e0f1d[_0x56d1aa(0x222)](_0x378d5d))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']='workflow:projects';[a56_0x4d17f9(0x155)]='List\x20all\x20workflow\x20projects';async[a56_0x4d17f9(0x25e)](_0x8044df){const _0x5dbc64=a56_0x4d17f9,{options:_0x28d875,args:_0x586edf,tdx:_0x395377}=_0x8044df,_0x5eb43a=_0x586edf[0x0];_0x28d875['verbose']&&_0x5eb43a&&console[_0x5dbc64(0x19d)](_0x5dbc64(0x150)+_0x5eb43a);const _0x22d1ab=await withSpinner(_0x5dbc64(0x18a),()=>_0x395377[_0x5dbc64(0x13f)][_0x5dbc64(0x2e4)](_0x5eb43a,{'limit':_0x28d875[_0x5dbc64(0x1d8)]}),{'verbose':_0x28d875[_0x5dbc64(0x1c8)]});let _0x47f952=_0x22d1ab[_0x5dbc64(0x126)];_0x47f952['sort']((_0x65d9ec,_0xc9c753)=>_0x65d9ec[_0x5dbc64(0x1b7)][_0x5dbc64(0x231)](_0xc9c753['name']));const _0x5eb4dc=_0x28d875[_0x5dbc64(0x1d8)]&&_0x47f952[_0x5dbc64(0x1d4)]>=_0x28d875[_0x5dbc64(0x1d8)]?a56_0x3e0f1d['dim'](_0x5dbc64(0x21d)):'';console[_0x5dbc64(0x19d)](_0x5dbc64(0x233)+_0x47f952[_0x5dbc64(0x1d4)]+_0x5dbc64(0x26d)+(_0x47f952[_0x5dbc64(0x1d4)]!==0x1?'s':'')+_0x5eb4dc);if(_0x28d875['format']===_0x5dbc64(0x257)||_0x28d875['format']===_0x5dbc64(0x2f5)||_0x28d875[_0x5dbc64(0x1b4)]===_0x5dbc64(0x1cb))await handleSDKOutput(_0x47f952,_0x28d875);else{if(_0x47f952['length']===0x0)_0x5eb43a?console[_0x5dbc64(0x221)](_0x5dbc64(0x183)+_0x5eb43a):console[_0x5dbc64(0x221)](_0x5dbc64(0x151));else{const _0x58d6f8=_0x47f952[_0x5dbc64(0x2b5)](_0x55d5e7=>{const _0x50eeef=_0x5dbc64,_0x4904bb=_0x55d5e7[_0x50eeef(0x1ad)]?.[_0x50eeef(0x171)](_0x2e8f4c=>_0x2e8f4c['key']==='sys'),_0x2199a0=_0x4904bb?a56_0x3e0f1d['dim'](_0x50eeef(0x193)):'';return'📁\x20'+_0x55d5e7[_0x50eeef(0x1b7)]+_0x2199a0;});await writeOutput(_0x58d6f8['join']('\x0a'),_0x28d875[_0x5dbc64(0x178)],_0x5dbc64(0x1db));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a56_0x4d17f9(0x155)]='List\x20workflows';async[a56_0x4d17f9(0x25e)](_0x58135f){const _0x136f8e=a56_0x4d17f9,{options:_0x2c9d63,args:_0x2eac0f,tdx:_0x45056d}=_0x58135f,_0x51eb19=this[_0x136f8e(0x180)](_0x2eac0f,_0x2c9d63);_0x2c9d63[_0x136f8e(0x1c8)]&&_0x51eb19&&console['error']('Project\x20filter:\x20'+_0x51eb19);const _0x52f72f=await withSpinner(_0x136f8e(0x1ee),()=>_0x45056d[_0x136f8e(0x13f)][_0x136f8e(0x2d0)](_0x51eb19,{'limit':_0x2c9d63['limit']}),{'verbose':_0x2c9d63[_0x136f8e(0x1c8)]});let _0x26ca2d=_0x52f72f[_0x136f8e(0x126)];_0x26ca2d[_0x136f8e(0x214)]((_0x415eeb,_0x1bab04)=>{const _0x4e53cb=_0x136f8e,_0x5d9235=_0x415eeb[_0x4e53cb(0x1b7)]['localeCompare'](_0x1bab04[_0x4e53cb(0x1b7)]);if(_0x5d9235!==0x0)return _0x5d9235;return(_0x415eeb[_0x4e53cb(0x275)]?.[_0x4e53cb(0x1b7)]||'')[_0x4e53cb(0x231)](_0x1bab04[_0x4e53cb(0x275)]?.['name']||'');});const _0x591161=_0x2c9d63['limit']&&_0x26ca2d[_0x136f8e(0x1d4)]>=_0x2c9d63[_0x136f8e(0x1d8)]?a56_0x3e0f1d[_0x136f8e(0x1f9)](_0x136f8e(0x21d)):'';console[_0x136f8e(0x19d)]('✔\x20Found\x20'+_0x26ca2d[_0x136f8e(0x1d4)]+_0x136f8e(0x170)+(_0x26ca2d['length']!==0x1?'s':'')+_0x591161);if(_0x2c9d63[_0x136f8e(0x1b4)]==='json'||_0x2c9d63[_0x136f8e(0x1b4)]===_0x136f8e(0x2f5)||_0x2c9d63[_0x136f8e(0x1b4)]===_0x136f8e(0x1cb))await handleSDKOutput(_0x26ca2d,_0x2c9d63);else{if(_0x26ca2d['length']===0x0)_0x51eb19?console[_0x136f8e(0x221)](_0x136f8e(0x219)+_0x51eb19):console['log'](_0x136f8e(0x124));else{const _0x5d20eb=_0x2c9d63[_0x136f8e(0x249)],_0x53c81b=_0x26ca2d[_0x136f8e(0x2b5)](_0x32a0d8=>{const _0x538dfb=_0x136f8e,_0x1c4e39=a56_0x3e0f1d[_0x538dfb(0x1f9)]('#'+_0x32a0d8['id']),_0x860dc=hyperlink(_0x1c4e39,getWorkflowUrl(_0x5d20eb,_0x32a0d8['id'])),_0x2a675c=_0x32a0d8[_0x538dfb(0x275)]?.[_0x538dfb(0x1b7)]?a56_0x3e0f1d[_0x538dfb(0x1f9)]('\x20('+_0x32a0d8[_0x538dfb(0x275)]['name']+')'):'';return'📋\x20'+_0x860dc+'\x20'+_0x32a0d8[_0x538dfb(0x1b7)]+_0x2a675c;});await writeOutput(_0x53c81b[_0x136f8e(0x278)]('\x0a'),_0x2c9d63[_0x136f8e(0x178)],_0x136f8e(0x1db));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x289);['description']='List\x20workflow\x20execution\x20sessions';async[a56_0x4d17f9(0x25e)](_0x192e35){const _0x50ccb5=a56_0x4d17f9,{options:_0xe66d35,args:_0x1b0096,tdx:_0x2bb779}=_0x192e35,_0x393e50=this[_0x50ccb5(0x167)](_0x1b0096,_0xe66d35);if(!_0x393e50)return 0x1;const {projectName:_0x4e03e7,workflowName:_0x112e77}=_0x393e50;if(_0xe66d35['verbose']){if(_0x4e03e7&&_0x112e77)console[_0x50ccb5(0x19d)](_0x50ccb5(0x2da)+_0x4e03e7+'.'+_0x112e77);else _0x4e03e7&&console[_0x50ccb5(0x19d)](_0x50ccb5(0x1e7)+_0x4e03e7);const _0x277500=_0xe66d35['status'];_0x277500&&console[_0x50ccb5(0x19d)](_0x50ccb5(0x271)+_0x277500);}let _0x2d0f44=0x28;if(process[_0x50ccb5(0x2a5)][_0x50ccb5(0x190)]&&!_0xe66d35[_0x50ccb5(0x178)]&&!_0xe66d35[_0x50ccb5(0x1b4)]){const _0x342789=process[_0x50ccb5(0x2a5)][_0x50ccb5(0x1da)]||0x28;_0x2d0f44=Math[_0x50ccb5(0x2d6)](0x14,Math[_0x50ccb5(0x1f8)](_0x342789*0x2/0x3));}const _0x5f4c44=_0xe66d35[_0x50ccb5(0x1d8)]||_0x2d0f44,_0x550e13=await withSpinner(_0x50ccb5(0x187),()=>_0x2bb779[_0x50ccb5(0x13f)][_0x50ccb5(0x246)]({'projectName':_0x4e03e7,'workflowName':_0x112e77,'status':_0xe66d35[_0x50ccb5(0x21f)],'fromTime':_0xe66d35[_0x50ccb5(0x15d)],'toTime':_0xe66d35['to'],'limit':_0x5f4c44}),{'verbose':_0xe66d35['verbose']}),_0x1b8a12=_0x550e13[_0x50ccb5(0x126)];_0x1b8a12[_0x50ccb5(0x214)]((_0x5d86d1,_0x594a5c)=>{const _0x27add0=_0x5d86d1['sessionTime']||'',_0x3843b9=_0x594a5c['sessionTime']||'';return _0x3843b9['localeCompare'](_0x27add0);});_0x1b8a12['length']>=_0x5f4c44?console[_0x50ccb5(0x19d)](_0x50ccb5(0x174)+_0x1b8a12['length']+_0x50ccb5(0x1ff)+a56_0x3e0f1d[_0x50ccb5(0x1f9)](_0x50ccb5(0x225))):console[_0x50ccb5(0x19d)]('✔\x20Found\x20'+_0x1b8a12[_0x50ccb5(0x1d4)]+_0x50ccb5(0x2a0)+(_0x1b8a12['length']!==0x1?'s':''));if(_0xe66d35[_0x50ccb5(0x1b4)]===_0x50ccb5(0x257)||_0xe66d35[_0x50ccb5(0x1b4)]===_0x50ccb5(0x2f5)||_0xe66d35['format']===_0x50ccb5(0x1cb))await handleSDKOutput(_0x1b8a12,_0xe66d35);else{if(!process[_0x50ccb5(0x2a5)][_0x50ccb5(0x190)]||_0xe66d35['output']){if(_0x1b8a12[_0x50ccb5(0x1d4)]===0x0){if(_0x4e03e7&&_0x112e77)console[_0x50ccb5(0x221)](_0x50ccb5(0x2ae)+_0x4e03e7+'.'+_0x112e77);else _0x4e03e7?console[_0x50ccb5(0x221)](_0x50ccb5(0x149)+_0x4e03e7):console['log']('No\x20sessions\x20found');}else{const _0x37baa1=_0xe66d35[_0x50ccb5(0x249)],_0x3d31db=this[_0x50ccb5(0x20a)](_0x1b8a12,_0x37baa1);_0xe66d35[_0x50ccb5(0x178)]?await writeOutput(_0x3d31db,_0xe66d35['output'],_0x50ccb5(0x1db)):console[_0x50ccb5(0x221)](_0x3d31db);}!_0x4e03e7&&(console[_0x50ccb5(0x19d)](''),console['error'](a56_0x3e0f1d[_0x50ccb5(0x1f9)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x50ccb5(0x19d)](a56_0x3e0f1d['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a56_0x3e0f1d[_0x50ccb5(0x1f9)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x1b8a12[_0x50ccb5(0x1d4)]===0x0){if(_0x4e03e7&&_0x112e77)console[_0x50ccb5(0x221)](_0x50ccb5(0x2ae)+_0x4e03e7+'.'+_0x112e77);else _0x4e03e7?console[_0x50ccb5(0x221)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x4e03e7):console[_0x50ccb5(0x221)](_0x50ccb5(0x2f7));}else await this['navigateSessionsInteractive'](_0x1b8a12,_0x192e35,_0x4e03e7);}}return 0x0;}[a56_0x4d17f9(0x20a)](_0x37e764,_0xee5b3c){const _0x2c24d7=a56_0x4d17f9,_0x518e27=[],_0x358058=new Map();let _0x4ea99b=Infinity,_0x48e1b8=-Infinity;for(const _0x290a51 of _0x37e764){if(_0x290a51[_0x2c24d7(0x202)]?.[_0x2c24d7(0x186)]){const _0x46240a=new Date(_0x290a51[_0x2c24d7(0x202)][_0x2c24d7(0x186)])[_0x2c24d7(0x19c)](),_0x16d082=_0x290a51[_0x2c24d7(0x202)]['finishedAt']?new Date(_0x290a51[_0x2c24d7(0x202)][_0x2c24d7(0x2b3)])[_0x2c24d7(0x19c)]():Date[_0x2c24d7(0x25d)](),_0x18b2b5=_0x290a51[_0x2c24d7(0x275)]?.[_0x2c24d7(0x1b7)]||_0x2c24d7(0x29e);!_0x358058['has'](_0x18b2b5)&&_0x358058['set'](_0x18b2b5,[]),_0x358058[_0x2c24d7(0x234)](_0x18b2b5)[_0x2c24d7(0x250)]({'session':_0x290a51,'startTime':_0x46240a,'endTime':_0x16d082,'duration':_0x16d082-_0x46240a}),_0x4ea99b=Math[_0x2c24d7(0x295)](_0x4ea99b,_0x46240a),_0x48e1b8=Math[_0x2c24d7(0x2d6)](_0x48e1b8,_0x16d082);}}if(_0x358058[_0x2c24d7(0x1ba)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x36448c=process['stdout'][_0x2c24d7(0x175)]||0x78,_0x573932=0x1e,_0x39478d=0x32,_0x5a745b=0x4,_0x5ca6ef=Math[_0x2c24d7(0x295)](_0x39478d,Math[_0x2c24d7(0x2d6)](_0x573932,Math['floor'](_0x36448c*0.3))),_0x5adffa=_0x36448c-_0x5ca6ef-TIMELINE_CONFIG['GUTTER']-0x3-_0x5a745b,_0xf22492=_0x48e1b8-_0x4ea99b,_0x51c481=_0xf22492/_0x5ca6ef,_0xf77a92=renderTimeAxis({'startTime':_0x4ea99b,'endTime':_0x48e1b8,'durationMs':_0xf22492,'msPerChar':_0x51c481},_0x5ca6ef),_0x10bf29=[];for(const _0x13dad1 of _0x358058[_0x2c24d7(0x20b)]()){_0x10bf29[_0x2c24d7(0x250)](..._0x13dad1);}_0x10bf29['sort']((_0x155b46,_0x154cb9)=>_0x154cb9[_0x2c24d7(0x1aa)]-_0x155b46[_0x2c24d7(0x1aa)]);const _0x2c1093=new Date(_0x4ea99b),_0xc2e6a8=formatDate(_0x2c1093),_0x3ac644=_0x5a745b+TIMELINE_CONFIG[_0x2c24d7(0x1dd)]+TIMELINE_CONFIG[_0x2c24d7(0x1fe)]+_0x5adffa,_0x33402e='\x20'[_0x2c24d7(0x156)](_0x3ac644-_0xc2e6a8[_0x2c24d7(0x1d4)]),_0xff36bc=_0x33402e+a56_0x3e0f1d['dim'](_0xc2e6a8)+'\x20'+_0xf77a92;_0x518e27['push'](_0xff36bc);const _0x48b6e9=0x16;let _0x418e29=0x0;for(const _0x37798c of _0x10bf29){const _0x523404=_0x37798c['session']['project']?.['name']||'?',_0x43ebd4=Math[_0x2c24d7(0x295)](stringWidth(_0x523404),_0x48b6e9);_0x418e29=Math[_0x2c24d7(0x2d6)](_0x418e29,_0x43ebd4);}for(const _0xcf4c13 of _0x10bf29){const {session:_0x37925f,startTime:_0x629bfb,endTime:_0x4f8da8,duration:_0x55fef4}=_0xcf4c13,_0xd2ee52=_0x37925f['project']?.['id'],_0x27217e=_0x37925f['id'],_0xec3f38=_0x37925f['project']?.[_0x2c24d7(0x1b7)]||'?',_0x44a95e=_0x37925f[_0x2c24d7(0x13f)]?.[_0x2c24d7(0x1b7)]||'?';let _0x7381bf,_0x2ce07d;if(_0x37925f[_0x2c24d7(0x202)]){const _0x36720d=_0x37925f[_0x2c24d7(0x202)];!_0x36720d[_0x2c24d7(0x203)]?(_0x7381bf=_0x36720d[_0x2c24d7(0x262)]?'🛑':'🔄',_0x2ce07d=_0x36720d[_0x2c24d7(0x262)]?a56_0x3e0f1d['yellow']:a56_0x3e0f1d[_0x2c24d7(0x2cb)]):(_0x7381bf=_0x36720d['success']?'✅':'❌',_0x2ce07d=_0x36720d['success']?a56_0x3e0f1d[_0x2c24d7(0x182)]:a56_0x3e0f1d['red']);}else _0x7381bf='⏳',_0x2ce07d=a56_0x3e0f1d['dim'];const _0x3b5ffa='#'+_0x27217e,_0xf43131=_0xd2ee52?hyperlink(_0x3b5ffa,getWorkflowSessionUrl(_0xee5b3c,_0xd2ee52,_0x27217e)):_0x3b5ffa;let _0x17d9e3=_0xec3f38;stringWidth(_0xec3f38)>_0x48b6e9&&(_0x17d9e3=_0xec3f38[_0x2c24d7(0x2bb)](0x0,_0x48b6e9-0x1)+'…');const _0xe289b3=a56_0x3e0f1d['dim'](_0x17d9e3),_0x31d090=stringWidth(_0x17d9e3),_0x2e3adc='\x20'[_0x2c24d7(0x156)](_0x418e29-stringWidth(_0x17d9e3)+0x2),_0x4df19b='('+formatElapsed(_0x55fef4)+')',_0xb99e21=stringWidth(_0x4df19b),_0x2e100f=stringWidth(_0x3b5ffa),_0x3c8a58=_0x2e100f+0x1+_0x31d090+_0x2e3adc['length'],_0xd9cca1=_0x5adffa-_0x3c8a58-_0xb99e21-0x1-0x8;let _0x54e86f=_0x44a95e;stringWidth(_0x54e86f)>_0xd9cca1&&(_0x54e86f=_0x54e86f[_0x2c24d7(0x2bb)](0x0,_0xd9cca1-0x1)+'…');const _0x5623ab=_0xf43131+'\x20'+_0xe289b3+_0x2e3adc+_0x54e86f,_0x26a1c6=stringWidth(_0x5623ab),_0xcff8e6=_0x5adffa-_0x26a1c6-_0xb99e21,_0x5942b7=_0x5623ab+'\x20'[_0x2c24d7(0x156)](Math[_0x2c24d7(0x2d6)](0x1,_0xcff8e6))+a56_0x3e0f1d[_0x2c24d7(0x1f9)](_0x4df19b),_0x2fb936=Math[_0x2c24d7(0x1f8)]((_0x629bfb-_0x4ea99b)/_0x51c481),_0xc77403=Math[_0x2c24d7(0x1f8)]((_0x4f8da8-_0x4ea99b)/_0x51c481),_0x33bb44=Math['max'](_0x2fb936+0x1,_0xc77403),_0x170298=new Array(_0x5ca6ef)[_0x2c24d7(0x195)]('\x20');for(let _0x41b820=_0x2fb936;_0x41b820<Math['min'](_0x33bb44,_0x5ca6ef);_0x41b820++){_0x170298[_0x41b820]='─';}const _0x3694dc=_0x170298[_0x2c24d7(0x2b5)](_0x20999c=>_0x20999c==='\x20'?'\x20':_0x2ce07d(_0x20999c))[_0x2c24d7(0x278)]('');_0x518e27['push'](_0x7381bf+'\x20'+_0x5942b7+'│'+_0x3694dc+'│');}return _0x518e27[_0x2c24d7(0x278)]('\x0a');}async[a56_0x4d17f9(0x279)](_0x1eced2,_0x4f4035,_0x309737){const _0x6540db=a56_0x4d17f9,{options:_0x379aeb,tdx:_0x1d941b}=_0x4f4035,_0x5662db=_0x379aeb['site'],{timelineRows:_0x3a5096,timeAxisHeader:_0x47c7c5}=this[_0x6540db(0x173)](_0x1eced2,_0x5662db),_0x4d3ace=_0x3a5096[_0x6540db(0x19b)](_0x22ab73=>_0x22ab73['attemptId']);if(_0x4d3ace[_0x6540db(0x1d4)]===0x0){const _0xdb8ed=this[_0x6540db(0x20a)](_0x1eced2,_0x5662db);console[_0x6540db(0x221)](_0xdb8ed);!_0x309737&&(console[_0x6540db(0x19d)](''),console[_0x6540db(0x19d)](a56_0x3e0f1d[_0x6540db(0x1f9)](_0x6540db(0x2cd))),console[_0x6540db(0x19d)](a56_0x3e0f1d['dim'](_0x6540db(0x18c))+'or'+a56_0x3e0f1d[_0x6540db(0x1f9)](_0x6540db(0x2e2))));return;}_0x47c7c5&&console[_0x6540db(0x221)](_0x47c7c5);const _0x2c7ceb=_0x3a5096['filter'](_0x17e514=>_0x17e514[_0x6540db(0x236)])[_0x6540db(0x2b5)](_0xe56312=>({'title':_0xe56312[_0x6540db(0x2c5)],'value':_0xe56312[_0x6540db(0x236)]})),_0x105977=process[_0x6540db(0x2a5)][_0x6540db(0x1da)]||0x3c,_0x53e346=Math[_0x6540db(0x2d6)](0x28,Math['floor'](_0x105977*0x2/0x3)),_0x2e7eef=await a56_0x2c360c({'type':'autocomplete','name':_0x6540db(0x236),'message':_0x6540db(0x12e),'choices':_0x2c7ceb,'initial':-0x1,'limit':_0x53e346,'clearFirst':!![],'fallback':{'title':_0x6540db(0x2d4),'value':null},'suggest':(_0x326c4a,_0x1587df)=>{const _0x4355cc=_0x6540db;if(!_0x326c4a)return Promise['resolve'](_0x1587df);const _0x3bd292=_0x1587df[_0x4355cc(0x19b)](_0x27c5de=>{const _0x1edd1f=_0x4355cc,_0x161c76=_0x27c5de;return _0x161c76[_0x1edd1f(0x2c8)]['toLowerCase']()[_0x1edd1f(0x2de)](_0x326c4a[_0x1edd1f(0x2bd)]());});return Promise['resolve'](_0x3bd292);}}),_0x2137e2=()=>{const _0x592309=_0x6540db;process['stdout'][_0x592309(0x18b)](_0x592309(0x1f1)),process[_0x592309(0x2a5)][_0x592309(0x18b)](_0x592309(0x1f1)),process[_0x592309(0x2a5)][_0x592309(0x18b)](_0x592309(0x1f1));},_0x388a5d=_0x2e7eef&&_0x2e7eef[_0x6540db(0x236)]&&_0x2e7eef[_0x6540db(0x236)]!==null&&_0x2e7eef[_0x6540db(0x236)][_0x6540db(0x2f8)]()!=='';if(!_0x388a5d){_0x2137e2(),console[_0x6540db(0x221)](a56_0x3e0f1d[_0x6540db(0x1f9)](_0x6540db(0x14e)));return;}_0x2137e2();const _0x2f7ce6=_0x1eced2[_0x6540db(0x252)](_0x185d0a=>_0x185d0a[_0x6540db(0x202)]?.['id']===_0x2e7eef[_0x6540db(0x236)]);if(_0x2f7ce6){const _0x5869fd=_0x2f7ce6[_0x6540db(0x275)]?.[_0x6540db(0x1b7)]||'?',_0x2ae8de=_0x2f7ce6['workflow']?.[_0x6540db(0x1b7)]||'?';console[_0x6540db(0x221)](_0x6540db(0x26e)+a56_0x3e0f1d[_0x6540db(0x1f9)](_0x5869fd)+_0x6540db(0x276)+a56_0x3e0f1d[_0x6540db(0x1f9)](_0x2ae8de));}const _0x2ea364=new WorkflowTimelineCommand();await _0x2ea364[_0x6540db(0x25e)]({'args':[],'options':{..._0x379aeb,'attemptId':_0x2e7eef[_0x6540db(0x236)]},'tdx':_0x1d941b});}[a56_0x4d17f9(0x173)](_0x334b38,_0x40795f){const _0x5769a2=a56_0x4d17f9,_0x4fc15f=new Map();for(const _0x453dbf of _0x334b38){_0x453dbf['id']&&_0x453dbf[_0x5769a2(0x202)]?.['id']&&_0x4fc15f[_0x5769a2(0x26f)](_0x453dbf['id'],_0x453dbf[_0x5769a2(0x202)]['id']);}const _0x1c0d5e=[];let _0x3a9760='';const _0x223440=this[_0x5769a2(0x20a)](_0x334b38,_0x40795f),_0x138ce8=_0x223440['split']('\x0a');for(const _0x4286bb of _0x138ce8){if(_0x4286bb[_0x5769a2(0x2a6)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x4286bb[_0x5769a2(0x200)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3a9760=_0x4286bb;else{if(_0x4286bb[_0x5769a2(0x200)](/^[✅❌🔄🛑⏳]/)){const _0x23d1a6=_0x4286bb[_0x5769a2(0x200)](/#(\d+)/),_0x2004c9=_0x23d1a6?_0x23d1a6[0x1]:null,_0x3ab6ea=_0x2004c9?_0x4fc15f[_0x5769a2(0x234)](_0x2004c9)||null:null,_0x1615e7=_0x334b38[_0x5769a2(0x252)](_0x5aff19=>_0x5aff19['id']===_0x2004c9),_0x48af31=_0x1615e7?.[_0x5769a2(0x275)]?.[_0x5769a2(0x1b7)]||'';_0x1c0d5e[_0x5769a2(0x250)]({'displayLine':_0x4286bb,'attemptId':_0x3ab6ea,'projectName':_0x48af31});}}}return{'timelineRows':_0x1c0d5e,'timeAxisHeader':_0x3a9760};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x21b);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x16d);async[a56_0x4d17f9(0x25e)](_0x109d7e){const _0x8e0b72=a56_0x4d17f9,{options:_0x2c7265,args:_0x1df0f3,tdx:_0x548538}=_0x109d7e,_0x4a11f7=this['parseProjectWorkflowPattern'](_0x1df0f3,_0x2c7265);if(!_0x4a11f7)return 0x1;const {projectName:_0xe7a4c8,workflowName:_0xec6e9f}=_0x4a11f7,_0x5c899c=_0x2c7265[_0x8e0b72(0x2e0)];if(_0x2c7265[_0x8e0b72(0x1c8)]){if(_0xe7a4c8&&_0xec6e9f)console['error'](_0x8e0b72(0x2da)+_0xe7a4c8+'.'+_0xec6e9f);else _0xe7a4c8&&console['error'](_0x8e0b72(0x1e7)+_0xe7a4c8);_0x5c899c&&console[_0x8e0b72(0x19d)]('Include\x20retried:\x20yes');}const _0x3b9049=await withSpinner(_0x8e0b72(0x287),()=>_0x548538[_0x8e0b72(0x13f)][_0x8e0b72(0x251)]({'projectName':_0xe7a4c8,'workflowName':_0xec6e9f,'includeRetried':_0x5c899c,'limit':_0x2c7265[_0x8e0b72(0x1d8)]}),{'verbose':_0x2c7265[_0x8e0b72(0x1c8)]}),_0x5379eb=_0x3b9049[_0x8e0b72(0x126)],_0x40b406=_0x2c7265[_0x8e0b72(0x1d8)]||0x64,_0x545564=_0x5379eb[_0x8e0b72(0x1d4)]>=_0x40b406?a56_0x3e0f1d[_0x8e0b72(0x1f9)](_0x8e0b72(0x21d)):'';console[_0x8e0b72(0x19d)]('✔\x20Found\x20'+_0x5379eb[_0x8e0b72(0x1d4)]+_0x8e0b72(0x1be)+(_0x5379eb[_0x8e0b72(0x1d4)]!==0x1?'s':'')+_0x545564);if(_0x2c7265['format']===_0x8e0b72(0x257)||_0x2c7265[_0x8e0b72(0x1b4)]===_0x8e0b72(0x2f5)||_0x2c7265[_0x8e0b72(0x1b4)]===_0x8e0b72(0x1cb))await handleSDKOutput(_0x5379eb,_0x2c7265);else{if(_0x5379eb[_0x8e0b72(0x1d4)]===0x0){if(_0xe7a4c8&&_0xec6e9f)console[_0x8e0b72(0x221)](_0x8e0b72(0x239)+_0xe7a4c8+'.'+_0xec6e9f);else _0xe7a4c8?console[_0x8e0b72(0x221)](_0x8e0b72(0x15c)+_0xe7a4c8):console['log'](_0x8e0b72(0x2f6));}else{const _0x3089cd=_0x2c7265[_0x8e0b72(0x249)],_0x4fd222=_0x5379eb[_0x8e0b72(0x2b5)](_0x56b63e=>{const _0x16a198=_0x8e0b72,_0x2acf7f=a56_0x3e0f1d[_0x16a198(0x1f9)]('#'+_0x56b63e['id']),_0x517784=_0x56b63e[_0x16a198(0x275)]?.['id'],_0xda43e3=_0x56b63e[_0x16a198(0x123)]||_0x56b63e[_0x16a198(0x163)],_0x2f4f28=_0x517784&&_0xda43e3?hyperlink(_0x2acf7f,getWorkflowAttemptUrl(_0x3089cd,_0x517784,_0xda43e3,_0x56b63e['id'])):_0x2acf7f,{icon:_0x3970d1,text:_0x8acb90}=getAttemptStatusDisplay(_0x56b63e),_0x53f6fc=(_0x56b63e[_0x16a198(0x275)]?.[_0x16a198(0x1b7)]||'?')+'.'+(_0x56b63e[_0x16a198(0x13f)]?.[_0x16a198(0x1b7)]||'?'),_0x4acf71=_0x56b63e[_0x16a198(0x255)]?a56_0x3e0f1d[_0x16a198(0x1f9)](_0x56b63e['sessionTime']):'';return(_0x2f4f28+'\x20'+_0x3970d1+(_0x8acb90?'\x20'+_0x8acb90:'')+'\x20'+_0x53f6fc+'\x20'+_0x4acf71)[_0x16a198(0x211)]();});await writeOutput(_0x4fd222[_0x8e0b72(0x278)]('\x0a'),_0x2c7265[_0x8e0b72(0x178)],_0x8e0b72(0x1db));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]='workflow:attempt';[a56_0x4d17f9(0x155)]='Show\x20specific\x20attempt\x20details';async[a56_0x4d17f9(0x25e)](_0x1573c9){const _0x44608d=a56_0x4d17f9,{options:_0x50a649,args:_0x3466ea,tdx:_0x540436}=_0x1573c9,_0x4cb096=_0x3466ea[0x0];if(!_0x4cb096)return console['error'](_0x44608d(0x2cf)),0x1;_0x50a649['verbose']&&console[_0x44608d(0x19d)](_0x44608d(0x2b7)+_0x4cb096);const _0x4f1662=await withSpinner(_0x44608d(0x16c),()=>_0x540436[_0x44608d(0x13f)][_0x44608d(0x266)](_0x4cb096),{'verbose':_0x50a649[_0x44608d(0x1c8)]}),_0x826102=_0x4f1662[_0x44608d(0x126)];let _0x382f06;!_0x826102[_0x44608d(0x203)]?_0x382f06=_0x826102['cancelRequested']?_0x44608d(0x2e1):'running':_0x382f06=_0x826102[_0x44608d(0x2f1)]?_0x44608d(0x2f1):_0x44608d(0x19d);let _0x3b1e5d;if(_0x826102[_0x44608d(0x186)]&&_0x826102['finishedAt']){const _0x50341b=new Date(_0x826102['createdAt'])[_0x44608d(0x19c)](),_0x120549=new Date(_0x826102[_0x44608d(0x2b3)])[_0x44608d(0x19c)]();_0x3b1e5d=Math[_0x44608d(0x253)]((_0x120549-_0x50341b)/0x3e8);}const _0x472a4b={'attempt_id':_0x826102['id'],'status':_0x382f06,..._0x826102[_0x44608d(0x1a5)]!==undefined&&{'index':_0x826102[_0x44608d(0x1a5)]},..._0x826102['project']&&{'project':_0x826102[_0x44608d(0x275)]['name']},..._0x826102['workflow']&&{'workflow':_0x826102[_0x44608d(0x13f)][_0x44608d(0x1b7)]},..._0x826102[_0x44608d(0x163)]&&{'session_id':_0x826102[_0x44608d(0x163)]},..._0x826102['sessionTime']&&{'session_time':_0x826102[_0x44608d(0x255)]},..._0x826102[_0x44608d(0x17d)]&&{'retry_attempt':_0x826102[_0x44608d(0x17d)]},..._0x3b1e5d!==undefined&&{'duration_sec':_0x3b1e5d},..._0x826102[_0x44608d(0x186)]&&{'created_at':_0x826102['createdAt']},..._0x826102['finishedAt']&&{'finished_at':_0x826102['finishedAt']},...Object['keys'](_0x826102[_0x44608d(0x16e)])[_0x44608d(0x1d4)]>0x0&&{'params':_0x826102['params']}};return await handleSingleObjectOutput(_0x472a4b,_0x50a649),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]='workflow:tasks';[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x139);async['execute'](_0x26f1dd){const _0xab64ba=a56_0x4d17f9,{options:_0x369042,args:_0x5080c0,tdx:_0x3afab5}=_0x26f1dd,_0x36b267=_0x5080c0[0x0];if(!_0x36b267)return console[_0xab64ba(0x19d)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x57f9b4=_0x369042[_0xab64ba(0x1d7)];_0x369042['verbose']&&(console[_0xab64ba(0x19d)](_0xab64ba(0x2b7)+_0x36b267),_0x57f9b4&&console[_0xab64ba(0x19d)](_0xab64ba(0x1d1)));const _0x739fd8=await withSpinner(_0xab64ba(0x228),()=>_0x3afab5[_0xab64ba(0x13f)][_0xab64ba(0x1dc)](_0x36b267,_0x57f9b4||![]),{'verbose':_0x369042[_0xab64ba(0x1c8)]}),_0xf449d3=_0x739fd8[_0xab64ba(0x126)];return console[_0xab64ba(0x19d)](_0xab64ba(0x233)+_0xf449d3[_0xab64ba(0x1d4)]+_0xab64ba(0x2a3)+(_0xf449d3[_0xab64ba(0x1d4)]!==0x1?'s':'')),await handleSDKOutput(_0xf449d3,_0x369042),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x2b9);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x1cf);async[a56_0x4d17f9(0x25e)](_0x327d3c){const _0x15ae5a=a56_0x4d17f9,{options:_0x4be925,args:_0x59bd39,tdx:_0x4c9211}=_0x327d3c,_0x4fde8a=_0x59bd39[0x0];let _0x37ace2=_0x59bd39[0x1];if(!_0x4fde8a)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x4be925[_0x15ae5a(0x1c8)]&&(console['error'](_0x15ae5a(0x2b7)+_0x4fde8a),_0x37ace2&&console[_0x15ae5a(0x19d)](_0x15ae5a(0x268)+_0x37ace2));const _0x4a33f2=await withSpinner('Fetching\x20log\x20files...',()=>_0x4c9211[_0x15ae5a(0x13f)]['logFiles'](_0x4fde8a,_0x37ace2),{'verbose':_0x4be925[_0x15ae5a(0x1c8)]}),_0xbb88ee=_0x4a33f2[_0x15ae5a(0x126)];if(_0xbb88ee['length']===0x0)return console['error'](_0x15ae5a(0x138)),0x0;if(!_0x37ace2&&(_0x4be925['json']||_0x4be925[_0x15ae5a(0x1b4)]))return await handleSDKOutput(_0xbb88ee,_0x4be925),0x0;if(!_0x37ace2){const _0x49a305=_0xbb88ee[_0x15ae5a(0x2b5)](_0x383e4f=>({'title':_0x383e4f['taskName']+'\x20('+formatBytes(_0x383e4f[_0x15ae5a(0x281)])+')','value':_0x383e4f[_0x15ae5a(0x2ed)]})),_0x4254cd=await a56_0x2c360c({'type':'select','name':_0x15ae5a(0x184),'message':_0x15ae5a(0x1b5),'choices':_0x49a305});if(!_0x4254cd['task'])return console[_0x15ae5a(0x19d)](_0x15ae5a(0x14e)),0x0;_0x37ace2=_0x4254cd[_0x15ae5a(0x184)];}const _0x3a3468=await withSpinner(_0x15ae5a(0x1c4),()=>_0x4c9211[_0x15ae5a(0x13f)]['logs'](_0x4fde8a,_0x37ace2),{'verbose':_0x4be925[_0x15ae5a(0x1c8)]}),_0x45e1ac=_0x3a3468[_0x15ae5a(0x126)];return _0x45e1ac?console[_0x15ae5a(0x221)](_0x45e1ac):console[_0x15ae5a(0x19d)](_0x15ae5a(0x2c3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x1f2);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x27a);async[a56_0x4d17f9(0x25e)](_0x3737da){const _0x1fb4ff=a56_0x4d17f9,{options:_0x229100,args:_0x42dd65,tdx:_0x4c1032}=_0x3737da,_0x27dac0=_0x42dd65[0x0];if(!_0x27dac0)return console[_0x1fb4ff(0x19d)](_0x1fb4ff(0x2cf)),0x1;const _0x335292=_0x229100['reason'];_0x229100[_0x1fb4ff(0x1c8)]&&(console[_0x1fb4ff(0x19d)]('Attempt\x20ID:\x20'+_0x27dac0),_0x335292&&console[_0x1fb4ff(0x19d)]('Reason:\x20'+_0x335292));if(!_0x229100[_0x1fb4ff(0x179)]){if(!isInteractive())return console['error'](a56_0x3e0f1d[_0x1fb4ff(0x2d7)](_0x1fb4ff(0x1f3)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1fb4ff(0x19d)](a56_0x3e0f1d[_0x1fb4ff(0x1f9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d4ded=await confirmKey(_0x1fb4ff(0x159)+_0x27dac0+'?');if(!_0x2d4ded)return console[_0x1fb4ff(0x19d)](a56_0x3e0f1d[_0x1fb4ff(0x2a8)]('Cancelled')),0x1;}const _0x2eebed=await withSpinner(_0x1fb4ff(0x2f2),()=>_0x4c1032['workflow'][_0x1fb4ff(0x1fc)](_0x27dac0,_0x335292),{'verbose':_0x229100['verbose']}),_0x125ea4=_0x2eebed[_0x1fb4ff(0x126)];return console[_0x1fb4ff(0x19d)]('✔\x20'+_0x125ea4),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x29c);[a56_0x4d17f9(0x155)]='Retry\x20a\x20session\x20or\x20attempt';async[a56_0x4d17f9(0x25e)](_0x12e919){const _0x454156=a56_0x4d17f9,{options:_0x48cf26,args:_0x21c503,tdx:_0x20e8ad}=_0x12e919,_0x177967=_0x21c503[0x0];if(!_0x177967)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x42f40e=![],_0x16cb1d=_0x177967;if(_0x177967[_0x454156(0x2a6)](_0x454156(0x23a)))_0x42f40e=!![],_0x16cb1d=_0x177967[_0x454156(0x141)](0x8);else{if(_0x177967['startsWith'](_0x454156(0x1ea)))_0x42f40e=![],_0x16cb1d=_0x177967[_0x454156(0x141)](0x8);else return console[_0x454156(0x19d)](_0x454156(0x198)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5ed303=_0x48cf26['fromTask'],_0x51cd61=_0x48cf26[_0x454156(0x1ce)],_0x20b258=_0x48cf26[_0x454156(0x16e)],_0x100aae=_0x48cf26[_0x454156(0x22c)];_0x48cf26[_0x454156(0x1c8)]&&(console[_0x454156(0x19d)]('Target:\x20'+(_0x42f40e?_0x454156(0x1c9):_0x454156(0x266))+'\x20'+_0x16cb1d),_0x5ed303&&console['error'](_0x454156(0x16b)+_0x5ed303),_0x51cd61&&console['error'](_0x454156(0x264)+_0x51cd61),_0x20b258&&console[_0x454156(0x19d)](_0x454156(0x2ac)+_0x20b258),_0x100aae&&console['error'](_0x454156(0x1d3)));let _0x509e71;if(_0x20b258)try{if(_0x20b258[_0x454156(0x2a6)]('@')){const _0x42a820=await import(_0x454156(0x280)),_0x554828=_0x20b258[_0x454156(0x141)](0x1),_0xd3ec55=await _0x42a820[_0x454156(0x294)](_0x554828,_0x454156(0x260));_0x509e71=JSON[_0x454156(0x1a8)](_0xd3ec55);}else _0x509e71=JSON[_0x454156(0x1a8)](_0x20b258);}catch{return console[_0x454156(0x19d)](_0x454156(0x26c)),0x1;}if(!_0x48cf26[_0x454156(0x179)]){if(!isInteractive())return console['error'](a56_0x3e0f1d[_0x454156(0x2d7)](_0x454156(0x1f3)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x454156(0x19d)](a56_0x3e0f1d[_0x454156(0x1f9)](_0x454156(0x24a))),0x1;const _0x59e0e0=await confirmKey(_0x454156(0x1a9)+(_0x42f40e?_0x454156(0x1c9):'attempt')+'\x20'+_0x16cb1d+'?');if(!_0x59e0e0)return console[_0x454156(0x19d)](a56_0x3e0f1d['yellow'](_0x454156(0x14e))),0x1;}let _0x2cfb96;_0x42f40e?_0x2cfb96=await withSpinner(_0x454156(0x29f),()=>_0x20e8ad[_0x454156(0x13f)][_0x454156(0x2d9)](_0x16cb1d,{'fromTask':_0x5ed303,'retryParams':_0x509e71}),{'verbose':_0x48cf26['verbose']}):_0x2cfb96=await withSpinner(_0x454156(0x1bb),()=>_0x20e8ad['workflow'][_0x454156(0x1a2)](_0x16cb1d,{'resumeFrom':_0x51cd61,'retryParams':_0x509e71,'force':_0x100aae}),{'verbose':_0x48cf26[_0x454156(0x1c8)]});const _0x299d3f=_0x2cfb96[_0x454156(0x126)];return console[_0x454156(0x19d)](_0x454156(0x1bf)),console[_0x454156(0x19d)](_0x454156(0x299)+_0x299d3f['attemptId']),console['error'](_0x454156(0x1b8)+_0x299d3f['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x210);[a56_0x4d17f9(0x155)]='Start\x20a\x20workflow\x20run';async[a56_0x4d17f9(0x25e)](_0x383fea){const _0x1c64bf=a56_0x4d17f9,{options:_0x38ec5d,args:_0x4ee6db,tdx:_0x4b6908}=_0x383fea;let _0x355cb8=_0x4ee6db[0x0];if(!_0x355cb8){const _0x4918bf=this[_0x1c64bf(0x180)]([],_0x38ec5d),_0x39da6d=await withSpinner('Loading\x20workflows...',()=>_0x4b6908[_0x1c64bf(0x13f)][_0x1c64bf(0x2d0)](_0x4918bf,{'limit':_0x38ec5d[_0x1c64bf(0x1d8)]}),{'verbose':_0x38ec5d[_0x1c64bf(0x1c8)]}),_0x5caa51=_0x39da6d['data'];if(_0x5caa51[_0x1c64bf(0x1d4)]===0x0)return console[_0x1c64bf(0x19d)](_0x1c64bf(0x124)),!_0x4918bf&&console['error'](a56_0x3e0f1d['dim'](_0x1c64bf(0x24d))),0x1;const _0x469679=_0x5caa51[_0x1c64bf(0x2b5)](_0x1272ce=>({'title':_0x1272ce['project']?.['name']+'.'+_0x1272ce[_0x1c64bf(0x1b7)],'value':_0x1272ce[_0x1c64bf(0x275)]?.[_0x1c64bf(0x1b7)]+'.'+_0x1272ce[_0x1c64bf(0x1b7)],'description':_0x1272ce[_0x1c64bf(0x15a)]?_0x1c64bf(0x1ae)+_0x1272ce['revision']:undefined})),_0x1699ed=await a56_0x2c360c({'type':_0x1c64bf(0x2dd),'name':'workflow','message':_0x1c64bf(0x160),'choices':_0x469679});if(!_0x1699ed['workflow'])return 0x1;_0x355cb8=_0x1699ed['workflow'];}if(!_0x355cb8[_0x1c64bf(0x2de)]('.')){const _0x4c5c2a=this['resolveProject']([],_0x38ec5d);if(_0x4c5c2a)_0x355cb8=_0x4c5c2a+'.'+_0x355cb8;else return console[_0x1c64bf(0x19d)](a56_0x3e0f1d[_0x1c64bf(0x2d7)](_0x1c64bf(0x244)),_0x1c64bf(0x24f)),console['error'](a56_0x3e0f1d[_0x1c64bf(0x1f9)](_0x1c64bf(0x24d))),0x1;}const _0x17fdcd=_0x38ec5d[_0x1c64bf(0x258)],_0x48d222=_0x38ec5d[_0x1c64bf(0x255)],_0x3f4613={};if(_0x17fdcd&&Array[_0x1c64bf(0x1c1)](_0x17fdcd))for(const _0x2e9cf3 of _0x17fdcd){const _0x446aa8=_0x2e9cf3[_0x1c64bf(0x2dc)]('=');if(_0x446aa8===-0x1)return console[_0x1c64bf(0x19d)](_0x1c64bf(0x13b)+_0x2e9cf3),console[_0x1c64bf(0x19d)](_0x1c64bf(0x297)),0x1;const _0x49db82=_0x2e9cf3['substring'](0x0,_0x446aa8),_0x2c1ff6=_0x2e9cf3[_0x1c64bf(0x141)](_0x446aa8+0x1);try{_0x3f4613[_0x49db82]=JSON['parse'](_0x2c1ff6);}catch{_0x3f4613[_0x49db82]=_0x2c1ff6;}}_0x38ec5d['verbose']&&(console[_0x1c64bf(0x19d)](_0x1c64bf(0x237)+_0x355cb8),Object[_0x1c64bf(0x1b0)](_0x3f4613)[_0x1c64bf(0x1d4)]>0x0&&console['error'](_0x1c64bf(0x259)+JSON['stringify'](_0x3f4613)),_0x48d222&&console[_0x1c64bf(0x19d)](_0x1c64bf(0x1e3)+_0x48d222));if(_0x38ec5d[_0x1c64bf(0x241)])return await this[_0x1c64bf(0x199)](_0x383fea,_0x355cb8,_0x3f4613,_0x48d222);const _0x342fa8=await withSpinner(_0x1c64bf(0x197),()=>_0x4b6908['workflow'][_0x1c64bf(0x1f4)](_0x355cb8,_0x3f4613,{'sessionTime':_0x48d222}),{'verbose':_0x38ec5d[_0x1c64bf(0x1c8)]}),_0x7a6779=_0x342fa8['data'];console[_0x1c64bf(0x19d)](_0x1c64bf(0x2b2)),console[_0x1c64bf(0x19d)]('\x20\x20Attempt\x20ID:\x20'+_0x7a6779['id']),console['error'](_0x1c64bf(0x1b8)+_0x7a6779[_0x1c64bf(0x163)]),console['error'](_0x1c64bf(0x24e)+_0x7a6779[_0x1c64bf(0x275)]?.[_0x1c64bf(0x1b7)]),console['error']('\x20\x20Workflow:\x20'+_0x7a6779[_0x1c64bf(0x13f)]?.[_0x1c64bf(0x1b7)]);if(_0x7a6779['project']?.['id']&&_0x7a6779[_0x1c64bf(0x163)]&&_0x7a6779['id']){const _0x135426=_0x38ec5d[_0x1c64bf(0x249)],_0x50a7ac=getConsoleUrl(_0x135426,'/app/workflows/'+_0x7a6779['project']['id']+'/sessions/'+_0x7a6779[_0x1c64bf(0x163)]+_0x1c64bf(0x205)+_0x7a6779['id']);console[_0x1c64bf(0x19d)]('\x20\x20Console:\x20'+a56_0x3e0f1d['cyan'](_0x50a7ac));}return 0x0;}async[a56_0x4d17f9(0x199)](_0x2220f1,_0x828c53,_0x7b5b21,_0x8b1f82){const _0xc35757=a56_0x4d17f9,{options:_0x3d7bb9,tdx:_0x2361c9}=_0x2220f1,_0x575f01=await withSpinner(_0xc35757(0x2a2)+_0x828c53+_0xc35757(0x17a),()=>_0x2361c9[_0xc35757(0x13f)][_0xc35757(0x20c)](_0x828c53),{'verbose':_0x3d7bb9[_0xc35757(0x1c8)]}),_0x552d4f=_0x575f01['data'],_0x5514ec=_0x8b1f82??new Date()['toISOString']();console[_0xc35757(0x221)](a56_0x3e0f1d[_0xc35757(0x2d2)](_0xc35757(0x1eb)),_0x828c53),console['log'](a56_0x3e0f1d[_0xc35757(0x2d2)](_0xc35757(0x217)),_0x5514ec),console[_0xc35757(0x221)](a56_0x3e0f1d[_0xc35757(0x2d2)](_0xc35757(0x2ea)),JSON[_0xc35757(0x2e3)](_0x7b5b21)),console[_0xc35757(0x221)](''),console[_0xc35757(0x221)](a56_0x3e0f1d[_0xc35757(0x2d2)](_0xc35757(0x283)));const _0x42404e=parseTaskGraph(_0x552d4f[_0xc35757(0x1a1)]??null);if(_0x42404e['length']===0x0)console[_0xc35757(0x221)](a56_0x3e0f1d[_0xc35757(0x1f9)](_0xc35757(0x168)));else for(const _0x54e30d of formatTaskGraph(_0x42404e)){console['log'](_0x54e30d);}const _0x3022a3=summarizeTaskGraph(_0x42404e),_0x360ef4=formatWarningSummary(_0x3022a3);return _0x360ef4&&(console[_0xc35757(0x221)](''),console[_0xc35757(0x221)](a56_0x3e0f1d[_0xc35757(0x2a8)](_0x360ef4))),console[_0xc35757(0x221)](a56_0x3e0f1d['yellow']('\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.')),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x12d);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x242);async[a56_0x4d17f9(0x25e)](_0x385f57){const _0x14d71b=a56_0x4d17f9,{options:_0x597c0f,args:_0x14eb9f,tdx:_0x2b3a8b}=_0x385f57,_0xae64cd=_0x14eb9f[0x0],_0x293205=_0x14eb9f[0x1]||'.';if(!_0xae64cd)return console[_0x14d71b(0x19d)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x14d71b(0x161)),0x1;const _0x392ad5=_0x597c0f[_0x14d71b(0x15a)];_0x597c0f['verbose']&&(console[_0x14d71b(0x19d)](_0x14d71b(0x26e)+_0xae64cd),console[_0x14d71b(0x19d)](_0x14d71b(0x267)+_0x293205),_0x392ad5&&console[_0x14d71b(0x19d)](_0x14d71b(0x18e)+_0x392ad5));const _0x292156=await withSpinner(_0x14d71b(0x224)+_0xae64cd+'...',()=>_0x2b3a8b[_0x14d71b(0x13f)][_0x14d71b(0x284)](_0xae64cd,_0x293205,{'revision':_0x392ad5}),{'verbose':_0x597c0f['verbose']}),_0x598be2=_0x292156['data'];return console[_0x14d71b(0x19d)]('✔\x20Downloaded\x20'+_0x598be2[_0x14d71b(0x2d5)]),console[_0x14d71b(0x19d)]('\x20\x20Revision:\x20'+_0x598be2['revision']),console[_0x14d71b(0x19d)](_0x14d71b(0x27e)+_0x598be2[_0x14d71b(0x125)]),console['error'](_0x14d71b(0x1d2)+_0x293205+'/'+_0x598be2['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]='workflow:upload';[a56_0x4d17f9(0x155)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async['execute'](_0x4a5c22){const _0x5dd4b2=a56_0x4d17f9,{options:_0x556ded,args:_0xa7ea4b,tdx:_0x1a48fc}=_0x4a5c22;let _0xb98287='.',_0x22a480=_0x556ded[_0x5dd4b2(0x1b7)];if(_0xa7ea4b[0x0]){const {promises:_0x3fbebb}=await import('fs');try{const _0x186bd8=await _0x3fbebb[_0x5dd4b2(0x208)](_0xa7ea4b[0x0]);if(_0x186bd8[_0x5dd4b2(0x2a7)]())_0xb98287=_0xa7ea4b[0x0];else return console['error'](_0x5dd4b2(0x15f)+_0xa7ea4b[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x22a480=_0xa7ea4b[0x0],_0xb98287='.';}}const _0x3b27f2=_0x556ded[_0x5dd4b2(0x15a)],_0xb150cc=_0x556ded[_0x5dd4b2(0x1e0)];_0x556ded[_0x5dd4b2(0x1c8)]&&(console[_0x5dd4b2(0x19d)]('Project\x20directory:\x20'+_0xb98287),_0x22a480&&console[_0x5dd4b2(0x19d)](_0x5dd4b2(0x133)+_0x22a480),_0x3b27f2&&console[_0x5dd4b2(0x19d)](_0x5dd4b2(0x18e)+_0x3b27f2),_0xb150cc&&console[_0x5dd4b2(0x19d)]('Validation:\x20skipped'));const _0x5db0af=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x1a48fc[_0x5dd4b2(0x13f)][_0x5dd4b2(0x250)](_0xb98287,{'projectName':_0x22a480,'revision':_0x3b27f2,'skipValidation':_0xb150cc}),{'verbose':_0x556ded[_0x5dd4b2(0x1c8)]}),_0x11b2a9=_0x5db0af['data'];return console[_0x5dd4b2(0x19d)]('✔\x20Pushed\x20'+_0x11b2a9[_0x5dd4b2(0x2d5)]),console[_0x5dd4b2(0x19d)](_0x5dd4b2(0x28f)+_0x11b2a9['projectId']),console[_0x5dd4b2(0x19d)](_0x5dd4b2(0x235)+_0x11b2a9[_0x5dd4b2(0x15a)]),await this['showWorkflowConsoleUrl'](_0x1a48fc,_0x11b2a9[_0x5dd4b2(0x2d5)],_0x556ded[_0x5dd4b2(0x249)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x2b6);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x2af);async[a56_0x4d17f9(0x25e)](_0x2946e5){const _0x22cf0b=a56_0x4d17f9,{options:_0x58348e,args:_0x1cffa7,tdx:_0x5e56aa}=_0x2946e5,_0x3a9aa8=_0x1cffa7[0x0],_0x5a41f0=_0x1cffa7[0x1];if(!_0x3a9aa8)return console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x2d7)](_0x22cf0b(0x244)),_0x22cf0b(0x1bc)),console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x1f9)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x57a898=_0x58348e[_0x22cf0b(0x15a)];_0x58348e[_0x22cf0b(0x1c8)]&&(console[_0x22cf0b(0x19d)](_0x22cf0b(0x26e)+_0x3a9aa8),_0x5a41f0&&console['error'](_0x22cf0b(0x230)+_0x5a41f0),_0x57a898&&console[_0x22cf0b(0x19d)](_0x22cf0b(0x18e)+_0x57a898),_0x58348e[_0x22cf0b(0x241)]&&console[_0x22cf0b(0x19d)](_0x22cf0b(0x1e9)));const _0x3e5ee5=await withSpinner(_0x22cf0b(0x227)+_0x3a9aa8+'...',()=>_0x5e56aa[_0x22cf0b(0x13f)]['pullProject'](_0x3a9aa8,{'targetDir':_0x5a41f0,'revision':_0x57a898}),{'verbose':_0x58348e['verbose']}),_0xaad3c6=_0x3e5ee5['data'];_0xaad3c6[_0x22cf0b(0x298)]?console[_0x22cf0b(0x19d)](_0x22cf0b(0x13d)+_0xaad3c6[_0x22cf0b(0x2d5)]):console[_0x22cf0b(0x19d)](_0x22cf0b(0x1cc)+_0xaad3c6[_0x22cf0b(0x2d5)]);console[_0x22cf0b(0x19d)](_0x22cf0b(0x235)+_0xaad3c6[_0x22cf0b(0x15a)]),console['error']('\x20\x20Target:\x20'+(a56_0x1d0c78[_0x22cf0b(0x2ce)](process[_0x22cf0b(0x2ca)](),_0xaad3c6[_0x22cf0b(0x22a)])||'.')),console[_0x22cf0b(0x19d)](_0x22cf0b(0x1a6)+a56_0x3e0f1d[_0x22cf0b(0x182)]('+'+_0xaad3c6[_0x22cf0b(0x291)]['new']+_0x22cf0b(0x1c5))+',\x20'+(a56_0x3e0f1d[_0x22cf0b(0x2a8)]('~'+_0xaad3c6[_0x22cf0b(0x291)][_0x22cf0b(0x216)]+_0x22cf0b(0x2d3))+',\x20')+(a56_0x3e0f1d[_0x22cf0b(0x2d7)]('-'+_0xaad3c6[_0x22cf0b(0x291)][_0x22cf0b(0x1fa)]+'\x20deleted')+',\x20')+(''+a56_0x3e0f1d[_0x22cf0b(0x1f9)](_0xaad3c6[_0x22cf0b(0x291)][_0x22cf0b(0x29b)]+'\x20unchanged')));for(const _0x125ab9 of _0xaad3c6[_0x22cf0b(0x215)]){_0x125ab9['type']===_0x22cf0b(0x216)&&_0x125ab9['diff']&&(console[_0x22cf0b(0x19d)]('\x0a'+a56_0x3e0f1d[_0x22cf0b(0x222)](_0x22cf0b(0x17b)+_0x125ab9[_0x22cf0b(0x12f)])),console['error'](_0x125ab9['diff']));}if(!_0xaad3c6[_0x22cf0b(0x1d5)])return saveSessionContext({'workflow_project':_0xaad3c6['projectName']},_0x58348e['session']),console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x182)](_0x22cf0b(0x2ec))),console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x1f9)](_0x22cf0b(0x1ef)+_0xaad3c6[_0x22cf0b(0x2d5)])),0x0;if(_0x58348e['dryRun'])return console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x2a8)](_0x22cf0b(0x285))),0x0;if(!_0x58348e[_0x22cf0b(0x179)]){if(!isInteractive())return console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x2d7)](_0x22cf0b(0x1f3)),_0x22cf0b(0x1a7)),console['error'](a56_0x3e0f1d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2670bc=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x2670bc)return console['error'](a56_0x3e0f1d['yellow']('Cancelled'),_0x22cf0b(0x263)),0x1;}await withSpinner(_0x22cf0b(0x206),()=>_0x5e56aa['workflow'][_0x22cf0b(0x2b4)](_0xaad3c6,{'revision':_0x57a898}),{'verbose':_0x58348e[_0x22cf0b(0x1c8)]}),saveSessionContext({'workflow_project':_0xaad3c6[_0x22cf0b(0x2d5)]},_0x58348e[_0x22cf0b(0x1c9)]),console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x182)](_0x22cf0b(0x27f)));const _0x46fa9d=a56_0x1d0c78[_0x22cf0b(0x2ce)](process[_0x22cf0b(0x2ca)](),_0xaad3c6[_0x22cf0b(0x22a)])||'.';return console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x1f9)]('\x20\x20Location:\x20'+_0x46fa9d)),console[_0x22cf0b(0x19d)](a56_0x3e0f1d[_0x22cf0b(0x1f9)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0xaad3c6['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x2f3);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x2f0);async[a56_0x4d17f9(0x25e)](_0x1cd24e){const _0x43e162=a56_0x4d17f9,{options:_0x5d3ed0,args:_0x1c958b,tdx:_0x210221}=_0x1cd24e,_0x490d15=this[_0x43e162(0x181)](_0x1c958b,_0x5d3ed0),_0x3e2647=_0x5d3ed0,{revision:_0x33f352,skipValidation:_0x4108a8,backfill:_0x5ac58e}=_0x3e2647,_0xbd5640=_0x5ac58e===undefined?undefined:!_0x5ac58e;_0x5d3ed0[_0x43e162(0x1c8)]&&(_0x490d15&&console['error'](_0x43e162(0x136)+_0x490d15),_0x33f352&&console['error']('Revision:\x20'+_0x33f352),_0x5d3ed0['dryRun']&&console['error']('Dry\x20run:\x20yes'),_0x4108a8&&console['error'](_0x43e162(0x24b)),_0x5ac58e&&console[_0x43e162(0x19d)](_0x43e162(0x2eb)));let _0x524dc0;try{_0x524dc0=await withSpinner(_0x43e162(0x2f9),()=>_0x210221[_0x43e162(0x13f)]['preparePushProject']({'sourceDir':_0x490d15,'revision':_0x33f352,'skipValidation':_0x4108a8,'skipSchedule':_0xbd5640}),{'verbose':_0x5d3ed0[_0x43e162(0x1c8)]});}catch(_0x1639e7){if(_0x1639e7 instanceof Error&&_0x1639e7[_0x43e162(0x1c3)][_0x43e162(0x2de)](_0x43e162(0x177)))return console[_0x43e162(0x19d)](a56_0x3e0f1d[_0x43e162(0x2d7)](_0x43e162(0x244)),_0x43e162(0x272)),_0x5d3ed0[_0x43e162(0x1e4)]?console[_0x43e162(0x19d)](a56_0x3e0f1d['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x5d3ed0[_0x43e162(0x1e4)]+_0x43e162(0x14d)+_0x5d3ed0[_0x43e162(0x1e4)]+'\x27')):console[_0x43e162(0x19d)](a56_0x3e0f1d[_0x43e162(0x1f9)](_0x43e162(0x18d))),0x1;throw _0x1639e7;}const _0x4ee5ef=_0x524dc0[_0x43e162(0x126)];console['error'](_0x43e162(0x218)+_0x4ee5ef[_0x43e162(0x2d5)]),console[_0x43e162(0x19d)](_0x43e162(0x28b)+_0x4ee5ef['sourceDir']),console[_0x43e162(0x19d)](_0x43e162(0x235)+_0x4ee5ef[_0x43e162(0x15a)]),console[_0x43e162(0x19d)](_0x43e162(0x1a6)+a56_0x3e0f1d[_0x43e162(0x182)]('+'+_0x4ee5ef[_0x43e162(0x291)]['new']+'\x20new')+',\x20'+(a56_0x3e0f1d[_0x43e162(0x2a8)]('~'+_0x4ee5ef[_0x43e162(0x291)]['modified']+_0x43e162(0x2d3))+',\x20')+(a56_0x3e0f1d['red']('-'+_0x4ee5ef[_0x43e162(0x291)][_0x43e162(0x1fa)]+'\x20deleted')+',\x20')+(''+a56_0x3e0f1d['dim'](_0x4ee5ef['summary'][_0x43e162(0x29b)]+'\x20unchanged')));for(const _0x51417e of _0x4ee5ef[_0x43e162(0x215)]){_0x51417e['type']===_0x43e162(0x216)&&_0x51417e[_0x43e162(0x166)]&&(console[_0x43e162(0x19d)]('\x0a'+a56_0x3e0f1d[_0x43e162(0x222)](_0x43e162(0x17b)+_0x51417e[_0x43e162(0x12f)])),console[_0x43e162(0x19d)](_0x51417e[_0x43e162(0x166)]));}if(!_0x4ee5ef[_0x43e162(0x1d5)])return console['error'](a56_0x3e0f1d['green'](_0x43e162(0x148))),await this[_0x43e162(0x2b1)](_0x210221,_0x4ee5ef[_0x43e162(0x2d5)],_0x5d3ed0['site']),0x0;if(_0x5d3ed0['dryRun'])return console['error'](a56_0x3e0f1d[_0x43e162(0x2a8)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x5d3ed0[_0x43e162(0x179)]){if(!isInteractive())return console['error'](a56_0x3e0f1d['red'](_0x43e162(0x1f3)),_0x43e162(0x1a7)),console[_0x43e162(0x19d)](a56_0x3e0f1d[_0x43e162(0x1f9)](_0x43e162(0x24a))),0x1;const _0x15a883=await confirmKey(_0x43e162(0x12c));if(!_0x15a883)return console[_0x43e162(0x19d)](a56_0x3e0f1d[_0x43e162(0x2a8)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const _0x131c08=await withSpinner('Pushing\x20project...',()=>_0x210221['workflow'][_0x43e162(0x172)](_0x4ee5ef),{'verbose':_0x5d3ed0['verbose']}),_0x14632b=_0x131c08[_0x43e162(0x126)];return console[_0x43e162(0x19d)](a56_0x3e0f1d[_0x43e162(0x182)]('✔\x20Push\x20complete')),console[_0x43e162(0x19d)]('\x20\x20Project\x20ID:\x20'+_0x14632b[_0x43e162(0x292)]),console['error'](_0x43e162(0x235)+_0x14632b['revision']),await this[_0x43e162(0x2b1)](_0x210221,_0x14632b[_0x43e162(0x2d5)],_0x5d3ed0[_0x43e162(0x249)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]='workflow:clone';['description']=a56_0x4d17f9(0x2d1);async[a56_0x4d17f9(0x25e)](_0x4abc67){const _0x91b46c=a56_0x4d17f9,{options:_0x28c0c5,args:_0x527d64,tdx:_0x163ffc}=_0x4abc67,_0x29b873=this[_0x91b46c(0x181)](_0x527d64,_0x28c0c5),_0x42def2=_0x28c0c5[_0x91b46c(0x1b7)],_0x307804=_0x28c0c5[_0x91b46c(0x15a)],_0x56a0b0=_0x28c0c5[_0x91b46c(0x1e0)];if(!_0x29b873)return console[_0x91b46c(0x19d)](a56_0x3e0f1d['red'](_0x91b46c(0x244)),_0x91b46c(0x153)),console[_0x91b46c(0x19d)](a56_0x3e0f1d[_0x91b46c(0x1f9)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x91b46c(0x19d)](a56_0x3e0f1d[_0x91b46c(0x1f9)](_0x91b46c(0x286))),0x1;if(!_0x42def2)return console[_0x91b46c(0x19d)](a56_0x3e0f1d[_0x91b46c(0x2d7)](_0x91b46c(0x244)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x91b46c(0x19d)](a56_0x3e0f1d[_0x91b46c(0x1f9)](_0x91b46c(0x12a))),0x1;_0x28c0c5[_0x91b46c(0x1c8)]&&(console['error'](_0x91b46c(0x136)+_0x29b873),console[_0x91b46c(0x19d)](_0x91b46c(0x142)+_0x42def2),_0x307804&&console['error'](_0x91b46c(0x18e)+_0x307804),_0x28c0c5[_0x91b46c(0x241)]&&console[_0x91b46c(0x19d)](_0x91b46c(0x1e9)),_0x56a0b0&&console[_0x91b46c(0x19d)](_0x91b46c(0x24b)));const _0x5ab3d9=await withSpinner(_0x91b46c(0x2e7),()=>_0x163ffc[_0x91b46c(0x13f)][_0x91b46c(0x256)](_0x29b873,_0x42def2,{'revision':_0x307804,'skipValidation':_0x56a0b0}),{'verbose':_0x28c0c5['verbose']}),_0x225ef2=_0x5ab3d9['data'];console['error'](_0x91b46c(0x1b6)+_0x225ef2['sourceDir']);_0x225ef2['sourceProjectName']&&console[_0x91b46c(0x19d)](_0x91b46c(0x2aa)+_0x225ef2[_0x91b46c(0x296)]);console[_0x91b46c(0x19d)](_0x91b46c(0x142)+_0x225ef2[_0x91b46c(0x293)]),console['error'](_0x91b46c(0x18e)+_0x225ef2[_0x91b46c(0x15a)]),console[_0x91b46c(0x19d)](_0x91b46c(0x20f)+_0x225ef2[_0x91b46c(0x265)]);_0x225ef2['targetExists']&&(console['error'](a56_0x3e0f1d['yellow'](_0x91b46c(0x25f)+_0x225ef2[_0x91b46c(0x293)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x225ef2['existingProjectId']+')')),console['error'](a56_0x3e0f1d[_0x91b46c(0x2a8)](_0x91b46c(0x2c7))));if(_0x28c0c5[_0x91b46c(0x241)])return console['error'](a56_0x3e0f1d['yellow'](_0x91b46c(0x132))),0x0;if(!_0x28c0c5[_0x91b46c(0x179)]){if(!isInteractive())return console['error'](a56_0x3e0f1d[_0x91b46c(0x2d7)](_0x91b46c(0x1f3)),_0x91b46c(0x1a7)),console[_0x91b46c(0x19d)](a56_0x3e0f1d[_0x91b46c(0x1f9)](_0x91b46c(0x24a))),0x1;const _0x3e36ff=_0x225ef2[_0x91b46c(0x296)]||a56_0x1d0c78[_0x91b46c(0x169)](_0x29b873),_0x493648=_0x225ef2['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x42def2+_0x91b46c(0x176):_0x91b46c(0x2f4)+_0x3e36ff+_0x91b46c(0x22e)+_0x42def2+'\x22?',_0x518b7a=await confirmKey(_0x493648);if(!_0x518b7a)return console['error'](a56_0x3e0f1d[_0x91b46c(0x2a8)]('Cancelled')),0x1;}const _0x5270f6=await withSpinner(_0x225ef2[_0x91b46c(0x13a)]?_0x91b46c(0x27c)+_0x42def2+_0x91b46c(0x17a):_0x91b46c(0x2bc)+_0x42def2+'...',()=>_0x163ffc['workflow'][_0x91b46c(0x229)](_0x225ef2),{'verbose':_0x28c0c5[_0x91b46c(0x1c8)]}),_0x572290=_0x5270f6['data'];return console['error'](a56_0x3e0f1d['green'](_0x225ef2['targetExists']?'✔\x20Project\x20updated':_0x91b46c(0x165))),console[_0x91b46c(0x19d)](_0x91b46c(0x24e)+_0x572290[_0x91b46c(0x293)]),console[_0x91b46c(0x19d)](_0x91b46c(0x28f)+_0x572290[_0x91b46c(0x248)]),console[_0x91b46c(0x19d)](_0x91b46c(0x235)+_0x572290[_0x91b46c(0x15a)]),await this[_0x91b46c(0x2b1)](_0x163ffc,_0x572290[_0x91b46c(0x293)],_0x28c0c5['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x1e2);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x12b);async[a56_0x4d17f9(0x25e)](_0x1a331d){const _0x3f4e37=a56_0x4d17f9,{options:_0x43e240,args:_0x550f77,tdx:_0x301753}=_0x1a331d,_0x337d8b=_0x550f77[0x0];if(!_0x337d8b)return console['error'](_0x3f4e37(0x269)),console[_0x3f4e37(0x19d)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x43e240[_0x3f4e37(0x1c8)]&&console[_0x3f4e37(0x19d)](_0x3f4e37(0x26e)+_0x337d8b);if(!_0x43e240[_0x3f4e37(0x179)]){if(!isInteractive())return console[_0x3f4e37(0x19d)](a56_0x3e0f1d['red'](_0x3f4e37(0x1f3)),_0x3f4e37(0x1a7)),console[_0x3f4e37(0x19d)](a56_0x3e0f1d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57b4b9=await confirmKey(_0x3f4e37(0x1b3)+_0x337d8b+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x57b4b9)return console['error'](a56_0x3e0f1d[_0x3f4e37(0x2a8)](_0x3f4e37(0x14e))),0x1;}const _0x116754=await withSpinner(_0x3f4e37(0x23d)+_0x337d8b+'...',()=>_0x301753[_0x3f4e37(0x13f)][_0x3f4e37(0x2a4)](_0x337d8b),{'verbose':_0x43e240['verbose']}),_0x20ec47=_0x116754[_0x3f4e37(0x126)];return console[_0x3f4e37(0x19d)](_0x3f4e37(0x2db)+_0x20ec47['projectName']),console[_0x3f4e37(0x19d)](_0x3f4e37(0x28f)+_0x20ec47[_0x3f4e37(0x292)]),0x0;}}export function parseKeyValue(_0x613b10){const _0x307e81=a56_0x4d17f9,_0x10fc79=_0x613b10[_0x307e81(0x2dc)]('=');if(_0x10fc79===-0x1)throw new Error(_0x307e81(0x273)+_0x613b10+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x111475=_0x613b10[_0x307e81(0x141)](0x0,_0x10fc79),_0x4b0562=_0x613b10[_0x307e81(0x141)](_0x10fc79+0x1);if(!_0x111475)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x111475,'value':_0x4b0562};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x129);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x1c6);async[a56_0x4d17f9(0x25e)](_0x1088e1){const _0x46b677=a56_0x4d17f9,{options:_0x4c98a3,args:_0x1f0c38,tdx:_0x1e8d03}=_0x1088e1,_0x191ada=this['requireProject'](_0x1f0c38,_0x4c98a3);if(!_0x191ada)return 0x1;_0x4c98a3[_0x46b677(0x1c8)]&&console['error'](_0x46b677(0x26e)+_0x191ada);const _0x1fe64d=await withSpinner(_0x46b677(0x2b8),()=>_0x1e8d03[_0x46b677(0x13f)][_0x46b677(0x243)](_0x191ada),{'verbose':_0x4c98a3[_0x46b677(0x1c8)]}),{secrets:_0x1cbffc}=_0x1fe64d['data'];return console['error'](_0x46b677(0x233)+_0x1cbffc[_0x46b677(0x1d4)]+'\x20secret'+(_0x1cbffc[_0x46b677(0x1d4)]!==0x1?'s':'')),await handleSDKOutput(_0x1cbffc,_0x4c98a3),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x247);['description']=a56_0x4d17f9(0x1fb);async[a56_0x4d17f9(0x25e)](_0x42e988){const _0x3951a9=a56_0x4d17f9,{options:_0x50b654,args:_0x2105e4,tdx:_0x2527b5}=_0x42e988;let _0xfe2da5,_0x1b243b;if(_0x2105e4[_0x3951a9(0x1d4)]>=0x1&&!_0x2105e4[0x0]['includes']('='))_0xfe2da5=_0x2105e4[0x0],_0x1b243b=_0x2105e4[_0x3951a9(0x2bb)](0x1);else{if(_0x2105e4[_0x3951a9(0x1d4)]>=0x1&&_0x50b654[_0x3951a9(0x1e4)])_0xfe2da5=_0x50b654[_0x3951a9(0x1e4)],_0x1b243b=_0x2105e4;else return _0x2105e4['length']>=0x1?(console[_0x3951a9(0x19d)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x3951a9(0x19d)](_0x3951a9(0x24d)),0x1):(console[_0x3951a9(0x19d)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x3951a9(0x28d)),0x1);}if(_0x1b243b[_0x3951a9(0x1d4)]===0x0)return console[_0x3951a9(0x19d)](_0x3951a9(0x162)),console[_0x3951a9(0x19d)](_0x3951a9(0x28d)),0x1;const _0x4f7b5f={};try{for(const _0x19fa7a of _0x1b243b){const {key:_0x503675,value:_0x4bacf6}=parseKeyValue(_0x19fa7a);_0x4f7b5f[_0x503675]=_0x4bacf6;}}catch(_0x5b66d7){return _0x5b66d7 instanceof Error&&console[_0x3951a9(0x19d)](a56_0x3e0f1d[_0x3951a9(0x2d7)]('Error:'),_0x5b66d7[_0x3951a9(0x1c3)]),0x1;}const _0x14d8c4=Object[_0x3951a9(0x1b0)](_0x4f7b5f);_0x50b654[_0x3951a9(0x1c8)]&&(console[_0x3951a9(0x19d)](_0x3951a9(0x26e)+_0xfe2da5),console['error'](_0x3951a9(0x232)+_0x14d8c4[_0x3951a9(0x278)](',\x20')));const _0x4f5f3f=await withSpinner(_0x14d8c4[_0x3951a9(0x1d4)]===0x1?_0x3951a9(0x2ee):_0x3951a9(0x17f)+_0x14d8c4[_0x3951a9(0x1d4)]+_0x3951a9(0x13e),()=>_0x2527b5[_0x3951a9(0x13f)][_0x3951a9(0x277)](_0xfe2da5,_0x4f7b5f),{'verbose':_0x50b654[_0x3951a9(0x1c8)]}),_0x2cfd7a=_0x4f5f3f['data'];return console['error'](_0x14d8c4['length']===0x1?_0x3951a9(0x194)+_0x2cfd7a[_0x3951a9(0x1b0)][0x0]+_0x3951a9(0x23f)+_0x2cfd7a[_0x3951a9(0x2d5)]+'\x27':'✔\x20'+_0x2cfd7a[_0x3951a9(0x1b0)][_0x3951a9(0x1d4)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x2cfd7a['projectName']+'\x27'),(_0x50b654[_0x3951a9(0x257)]||_0x50b654['jsonl'])&&await handleSingleObjectOutput(_0x2cfd7a,_0x50b654),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a56_0x4d17f9(0x27b);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x2c1);async[a56_0x4d17f9(0x25e)](_0xbdeb99){const _0x573540=a56_0x4d17f9,{options:_0x17620a,args:_0x472c12,tdx:_0x2ce78a}=_0xbdeb99;let _0x28a3c8,_0x4ac6ff;if(_0x472c12[_0x573540(0x1d4)]>=0x2)_0x28a3c8=_0x472c12[0x0],_0x4ac6ff=_0x472c12[0x1];else{if(_0x472c12[_0x573540(0x1d4)]===0x1&&_0x17620a[_0x573540(0x1e4)])_0x28a3c8=_0x17620a[_0x573540(0x1e4)],_0x4ac6ff=_0x472c12[0x0];else return _0x472c12[_0x573540(0x1d4)]===0x1?(console[_0x573540(0x19d)](_0x573540(0x158)),console[_0x573540(0x19d)](_0x573540(0x24d)),0x1):(console[_0x573540(0x19d)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x573540(0x19d)](_0x573540(0x1ed)),0x1);}_0x17620a[_0x573540(0x1c8)]&&(console[_0x573540(0x19d)]('Project:\x20'+_0x28a3c8),console['error'](_0x573540(0x21c)+_0x4ac6ff));if(!_0x17620a[_0x573540(0x179)]){if(!isInteractive())return console[_0x573540(0x19d)](a56_0x3e0f1d[_0x573540(0x2d7)]('\x0aError:'),_0x573540(0x1a7)),console[_0x573540(0x19d)](a56_0x3e0f1d['dim'](_0x573540(0x24a))),0x1;const _0x17a074=await confirmKey(_0x573540(0x26a)+_0x4ac6ff+'\x27\x20from\x20project\x20\x27'+_0x28a3c8+'\x27?');if(!_0x17a074)return console[_0x573540(0x19d)](a56_0x3e0f1d['yellow'](_0x573540(0x14e))),0x1;}const _0x38afe5=await withSpinner(_0x573540(0x17c),()=>_0x2ce78a[_0x573540(0x13f)][_0x573540(0x1a3)](_0x28a3c8,_0x4ac6ff),{'verbose':_0x17620a[_0x573540(0x1c8)]}),_0x2d8c0d=_0x38afe5[_0x573540(0x126)];return console[_0x573540(0x19d)](_0x573540(0x194)+_0x2d8c0d[_0x573540(0x152)]+_0x573540(0x27d)+_0x2d8c0d[_0x573540(0x2d5)]+'\x27'),(_0x17620a['json']||_0x17620a[_0x573540(0x2f5)])&&await handleSingleObjectOutput(_0x2d8c0d,_0x17620a),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(_0x430344){const _0x4cbbe4=a56_0x4d17f9,_0x4df1c1=Math[_0x4cbbe4(0x1f8)](_0x430344/0x3e8),_0x4880b2=Math['floor'](_0x4df1c1/0x3c),_0x13d2f5=Math[_0x4cbbe4(0x1f8)](_0x4880b2/0x3c),_0x362d68=Math[_0x4cbbe4(0x1f8)](_0x13d2f5/0x18);if(_0x362d68>0x0){const _0x21aef9=_0x13d2f5%0x18;return _0x21aef9>0x0?_0x362d68+'d\x20'+_0x21aef9+'h':_0x362d68+'d';}else{if(_0x13d2f5>0x0){const _0x47eb18=_0x4880b2%0x3c;return _0x47eb18>0x0?_0x13d2f5+'h\x20'+_0x47eb18+'m':_0x13d2f5+'h';}else{if(_0x4880b2>0x0){const _0x5af1ff=_0x4df1c1%0x3c;return _0x5af1ff>0x0?_0x4880b2+'m\x20'+_0x5af1ff+'s':_0x4880b2+'m';}else return _0x4df1c1+'s';}}}function formatTimestamp(_0x30d652,_0x8090ea){const _0x39738d=a56_0x4d17f9,_0xcc795f=new Date(_0x30d652),_0x1ba6f9=String(_0xcc795f[_0x39738d(0x28c)]())[_0x39738d(0x14b)](0x2,'0'),_0x454d4f=String(_0xcc795f[_0x39738d(0x1a0)]())['padStart'](0x2,'0'),_0x16de84=_0x1ba6f9+':'+_0x454d4f,_0x3b41f4=_0xcc795f[_0x39738d(0x2e9)]()===_0x8090ea[_0x39738d(0x2e9)]()&&_0xcc795f['getMonth']()===_0x8090ea[_0x39738d(0x2e8)]()&&_0xcc795f[_0x39738d(0x1f0)]()===_0x8090ea[_0x39738d(0x1f0)]();if(_0x3b41f4)return _0x16de84;else{const _0x130fa6=String(_0xcc795f[_0x39738d(0x2e8)]()+0x1)[_0x39738d(0x14b)](0x2,'0'),_0x2e0b39=String(_0xcc795f[_0x39738d(0x1f0)]())[_0x39738d(0x14b)](0x2,'0');return _0x130fa6+'-'+_0x2e0b39+'\x20'+_0x16de84;}}function formatDate(_0x3a1c95){const _0x2debe1=a56_0x4d17f9,_0x3667f6=_0x3a1c95[_0x2debe1(0x2e9)](),_0x84591b=String(_0x3a1c95[_0x2debe1(0x2e8)]()+0x1)[_0x2debe1(0x14b)](0x2,'0'),_0x337bdc=String(_0x3a1c95[_0x2debe1(0x1f0)]())[_0x2debe1(0x14b)](0x2,'0');return _0x3667f6+'-'+_0x84591b+'-'+_0x337bdc;}function getTaskStateIcon(_0x2e6cdf){const _0x3868aa={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3868aa[_0x2e6cdf]||'⚪';}function a56_0x1da5(){const _0x493098=['No\x20attempts\x20found\x20in\x20project:\x20','from','skipSchedule','Error:\x20','Select\x20a\x20workflow\x20to\x20run','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','sessionId','Listing\x20schedules\x20for\x20','✔\x20Clone\x20complete','diff','parseProjectWorkflowPattern','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','basename','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','From\x20task:\x20','Getting\x20attempt\x20details...','List\x20workflow\x20attempts','params','Disabling\x20schedule\x20#','\x20workflow','some','executePushProject','generateSessionTimelineRows','✔\x20Showing\x20','columns','\x22\x20with\x20new\x20revision?','No\x20workflow\x20tdx.json\x20found','output','yes','...','---\x20','Deleting\x20secret...','retryAttemptName','fullName','Setting\x20','resolveProject','resolveProjectDir','green','No\x20projects\x20match\x20pattern:\x20','task','Listing\x20schedules...','createdAt','Listing\x20workflow\x20sessions...','\x20\x20Console:\x20','✔\x20Schedule\x20found','Listing\x20workflow\x20projects...','write','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Revision:\x20','Fetching\x20schedule\x20#','isTTY','every','Session\x20','\x20(system)','✔\x20Secret\x20\x27','fill','\x0aPolling...\x20(','Starting\x20workflow\x20run...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','executeDryRun','Attempt:\x20','filter','getTime','error','POLL_INTERVAL_MS','✔\x20Schedule\x20#','getMinutes','config','retryAttempt','deleteSecret','disableSchedule','index','\x20\x20Changes:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parse','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','startTime','\x20to\x20see\x20detailed\x20logs','end','metadata','revision:\x20','replace','keys','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','window','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','format','Select\x20a\x20task\x20to\x20view\x20logs:','Source:\x20','name','\x20\x20Session\x20ID:\x20','splice','size','Retrying\x20attempt...','Project\x20name\x20is\x20required','renderTimeline','\x20attempt','✔\x20Retry\x20started','14AvGmpy','isArray','listProjectSchedules','message','Downloading\x20logs...','\x20new','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','disabledAt','verbose','session','💡\x20Tip:\x20Use\x20','table','→\x20Project:\x20','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','resumeFrom','Show\x20logs\x20for\x20a\x20workflow\x20attempt','5bOKBYM','Including\x20subtasks:\x20yes','\x20\x20Location:\x20','Force:\x20yes','length','hasChanges','msPerChar','includeSubtasks','limit','LABEL_MIN_SPACING','rows','list','tasks','ICON_WIDTH','Total:\x20','MAX_TIMELINE_WIDTH','skipValidation','Loading\x20session...','workflow:delete','Session\x20time:\x20','workflowProject','duration','LABEL_WIDTH_DIVISOR','Filter:\x20project=','toISOString','Dry\x20run:\x20yes','attempt:','Workflow:','getSchedule','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Listing\x20workflows...','\x20\x20Session\x20context\x20set\x20to:\x20','getDate','\x1b[1A\x1b[2K','workflow:kill','\x0aError:','run','updatedAt','TASK_NAME_WIDTH','MAX_LABEL_COUNT','floor','dim','deleted','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','kill','workflow:schedule:disable','ICON_SPACING','\x20sessions\x20','match','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','lastAttempt','done','enableSchedule','/attempt/','Writing\x20files...','\x20logs','stat','2328912gloRJP','renderSessionsTimeline','values','getWorkflow','\x20from\x20session\x20','workflow:use','Files\x20to\x20upload:\x20','workflow:run','trimEnd','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','\x20disabled\x20(','sort','changes','modified','Session\x20time:','✔\x20Project:\x20','No\x20workflows\x20found\x20in\x20project:\x20','nextRunTime','workflow:attempts','Key:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','\x20has\x20no\x20attempts','status','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','log','cyan','Resolving\x20project\x20\x27','Downloading\x20project\x20','(use\x20--limit\x20to\x20see\x20more)','Usage:\x20tdx\x20wf\x20use\x20<project>','Pulling\x20project\x20','Getting\x20attempt\x20tasks...','executeCloneProject','targetDir','unknown','force','Auto-selected\x20latest\x20session:\x20','\x22\x20to\x20new\x20project\x20\x22','workflow:timeline','Target\x20directory:\x20','localeCompare','Secrets\x20to\x20set:\x20','✔\x20Found\x20','get','\x20\x20Revision:\x20','attemptId','Workflow:\x20','7310204vyPoNk','No\x20attempts\x20found\x20for:\x20','session:','\x20next:\x20','1bUzvGH','Deleting\x20project\x20','nextTime','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x27...','dryRun','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','listSecrets','Error:','follow','sessions','workflow:secrets:set','newProjectId','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Validation:\x20skipped','pending','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20\x20Project:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','attempts','find','round','\x0a✔\x20Attempt\x20complete','sessionTime','prepareCloneProject','json','param','Parameters:\x20','workflowName','\x20tasks','MAX_TASKS_DISPLAY','now','execute','\x0a⚠\x20Project\x20\x22','utf-8','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','cancelRequested','-\x20no\x20files\x20written','Resume\x20from:\x20','fileCount','attempt','Output\x20directory:\x20','Task\x20name:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Error:\x20Invalid\x20JSON\x20in\x20--params','\x20project','Project:\x20','set','listSchedules','Status:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Invalid\x20format:\x20','No\x20schedules\x20found','project',',\x20Workflow:\x20','setSecrets','join','navigateSessionsInteractive','Kill\x20a\x20running\x20attempt','workflow:secrets:delete','Updating\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20\x20Files\x20extracted:\x20','✔\x20Pull\x20complete','fs/promises','fileSize','planned','Task\x20graph:','download','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Listing\x20workflow\x20attempts...','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:sessions','870300mtwbVx','\x20\x20Source:\x20','getHours','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20\x20Project\x20ID:\x20','⚠\x20Showing\x20first\x20','summary','projectId','newProjectName','readFile','min','sourceProjectName','Expected\x20format:\x20--param\x20key=value','isNewProject','\x20\x20New\x20attempt\x20ID:\x20','Using\x20attempt\x20','unchanged','workflow:retry','renderSingleTimeline','(unknown)','Retrying\x20session...','\x20session','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','Fetching\x20workflow\x20','\x20task','delete','stdout','startsWith','isDirectory','yellow','No\x20workflow\x20sessions\x20found','Source\x20project:\x20','Loading\x20sessions...','Params:\x20','445816TFmdsV','No\x20sessions\x20found\x20for:\x20','Pull\x20workflow\x20project\x20to\x20local\x20folder','MIN_LABEL_COUNT','showWorkflowConsoleUrl','✔\x20Workflow\x20run\x20started','finishedAt','applyPullProject','map','workflow:pull','Attempt\x20ID:\x20','Listing\x20secrets...','workflow:logs','text','slice','Cloning\x20to\x20','toLowerCase','List\x20workflow\x20schedules','context','split','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','resolveProjectId','No\x20log\x20content\x20found','MAX_POLL_ITERATIONS','displayLine','pollTimeline','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','title','buildTimelineData','cwd','blue','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','relative','Error:\x20Attempt\x20ID\x20is\x20required','workflows','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','bold','\x20modified','No\x20matching\x20sessions\x20found','projectName','max','red','toLocaleString','retrySession','Filter:\x20','✔\x20Deleted\x20project\x20','indexOf','select','includes','clear','includeRetried','canceling','\x20\x20tdx\x20wf\x20use\x20<project>','stringify','projects','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','tdx.json','Analyzing\x20project...','getMonth','getFullYear','Parameters:','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','\x0a✔\x20Already\x20up\x20to\x20date','taskName','Setting\x20secret...','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','success','Killing\x20attempt...','workflow:push','\x0aClone\x20\x22','jsonl','No\x20attempts\x20found','No\x20sessions\x20found','trim','Analyzing\x20changes...','group_error','Latest\x20session\x20has\x20no\x20attempt','session_id','No\x20workflows\x20found','filesExtracted','data','icon','\x20-\x20','workflow:secrets:list','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','\x0aPush\x20these\x20changes?','workflow:download','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','path','workflow:schedules','startedAt','\x0aDry\x20run\x20-\x20no\x20project\x20created','Project\x20name:\x20','483234TbuSrY','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Source\x20directory:\x20','4uBbxfr','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Show\x20tasks\x20for\x20an\x20attempt','targetExists','Error:\x20Invalid\x20parameter\x20format:\x20','\x20of\x20','→\x20New\x20project:\x20','\x20secrets...','workflow','2112830OhbKcl','substring','New\x20project\x20name:\x20','start','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','MIN_TIMELINE_WIDTH','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','total','\x0a✔\x20No\x20changes\x20to\x20push','No\x20sessions\x20found\x20in\x20project:\x20','Session\x20not\x20found:\x20','padStart','requireProject','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Cancelled','all','Pattern:\x20','No\x20workflow\x20projects\x20found','key','Source\x20directory\x20is\x20required','113194QHvsVl','description','repeat','state','Error:\x20Project\x20name\x20is\x20required','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','revision','running'];a56_0x1da5=function(){return _0x493098;};return a56_0x1da5();}function getBarChar(_0x52008f){const _0x217817=a56_0x4d17f9;return _0x52008f==='error'||_0x52008f===_0x217817(0x2fa)?'×':'─';}function getBarColor(_0x34ea3c){const _0x3e988d=a56_0x4d17f9,_0x5aa53c={'success':a56_0x3e0f1d['green'],'error':a56_0x3e0f1d[_0x3e988d(0x2d7)],'group_error':a56_0x3e0f1d[_0x3e988d(0x2d7)],'running':a56_0x3e0f1d[_0x3e988d(0x2cb)],'blocked':a56_0x3e0f1d[_0x3e988d(0x2a8)],'planned':a56_0x3e0f1d[_0x3e988d(0x1f9)],'canceling':a56_0x3e0f1d[_0x3e988d(0x2a8)]};return _0x5aa53c[_0x34ea3c]||a56_0x3e0f1d['white'];}function parseTaskName(_0x1af945){const _0x55bb0a=a56_0x4d17f9;let _0x1be4dc=_0x1af945[_0x55bb0a(0x1af)](/^\++/,'');const _0x14db4b=_0x1be4dc[_0x55bb0a(0x2c0)]('+'),_0x5bb2ad=_0x14db4b[_0x55bb0a(0x1d4)]>0x1?_0x14db4b['length']-0x2:0x0,_0x5e8f5a=_0x14db4b[_0x14db4b[_0x55bb0a(0x1d4)]-0x1]||_0x1be4dc;return{'level':_0x5bb2ad,'name':'+'+_0x5e8f5a};}function truncateTaskName(_0x5b6c41,_0x17d4d6){const _0xbda89c=a56_0x4d17f9,_0x2dc6a1=stringWidth(_0x5b6c41);if(_0x2dc6a1<=_0x17d4d6)return _0x5b6c41;let _0x4cd5c1=_0x5b6c41;while(stringWidth(_0x4cd5c1+'…')>_0x17d4d6&&_0x4cd5c1[_0xbda89c(0x1d4)]>0x0){_0x4cd5c1=_0x4cd5c1[_0xbda89c(0x2bb)](0x0,-0x1);}return _0x4cd5c1+'…';}function calculateTimeScale(_0x438ecd,_0x38457b){const _0x3d4c7c=a56_0x4d17f9;return{'startTime':_0x438ecd[_0x3d4c7c(0x143)],'endTime':_0x438ecd['end'],'durationMs':_0x438ecd['duration'],'msPerChar':_0x438ecd['duration']/_0x38457b};}function timeToPosition(_0x599060,_0xa3312,_0x43ce9f){const _0x3005a4=a56_0x4d17f9,_0x379b1e=_0x599060-_0xa3312['startTime'],_0x20b943=Math[_0x3005a4(0x1f8)](_0x379b1e/_0xa3312[_0x3005a4(0x1d6)]);return Math[_0x3005a4(0x2d6)](0x0,Math['min'](_0x20b943,_0x43ce9f));}function renderTimeAxis(_0x1f0bf3,_0x56dd83){const _0x1c671e=a56_0x4d17f9,_0x32df62=Math[_0x1c671e(0x295)](TIMELINE_CONFIG[_0x1c671e(0x1f7)],Math['max'](TIMELINE_CONFIG[_0x1c671e(0x2b0)],Math['floor'](_0x56dd83/TIMELINE_CONFIG[_0x1c671e(0x1e6)]))),_0x2beb74=_0x1f0bf3['durationMs']/(_0x32df62-0x1),_0x29bca1=new Date(_0x1f0bf3[_0x1c671e(0x1aa)]),_0x1a97e9=[];for(let _0x1ad96e=0x0;_0x1ad96e<_0x32df62;_0x1ad96e++){const _0x97ed55=_0x1f0bf3['startTime']+_0x1ad96e*_0x2beb74,_0xc2b765=timeToPosition(_0x97ed55,_0x1f0bf3,_0x56dd83),_0x497e8a=formatTimestamp(_0x97ed55,_0x29bca1);_0x1a97e9[_0x1c671e(0x250)]({'pos':_0xc2b765,'text':_0x497e8a});}const _0x35cbf9=new Array(_0x56dd83)[_0x1c671e(0x195)]('\x20');let _0x3af01f=-0x1;for(const {pos:_0x5cfda4,text:_0x18a202}of _0x1a97e9){let _0x18990f=Math[_0x1c671e(0x2d6)](0x0,_0x5cfda4-Math[_0x1c671e(0x1f8)](_0x18a202['length']/0x2));_0x18990f<=_0x3af01f+TIMELINE_CONFIG[_0x1c671e(0x1d9)]&&(_0x18990f=_0x3af01f+TIMELINE_CONFIG[_0x1c671e(0x1d9)]+0x1);_0x18990f+_0x18a202[_0x1c671e(0x1d4)]>_0x56dd83&&(_0x18990f=_0x56dd83-_0x18a202[_0x1c671e(0x1d4)]);if(_0x18990f>=0x0&&_0x18990f+_0x18a202[_0x1c671e(0x1d4)]<=_0x56dd83&&_0x18990f>_0x3af01f){for(let _0x5cc97a=0x0;_0x5cc97a<_0x18a202[_0x1c671e(0x1d4)];_0x5cc97a++){_0x35cbf9[_0x18990f+_0x5cc97a]=_0x18a202[_0x5cc97a];}_0x3af01f=_0x18990f+_0x18a202[_0x1c671e(0x1d4)]-0x1;}}return _0x35cbf9[_0x1c671e(0x278)]('');}function renderTaskRow(_0x214fb1,_0x1931ff,_0x75179d,_0x5f4938){const _0x2bbe0b=a56_0x4d17f9,{level:_0x2c25e6,name:_0xe896c8}=parseTaskName(_0x214fb1[_0x2bbe0b(0x1b7)]),_0x14855='\x20'[_0x2bbe0b(0x156)](_0x2c25e6),_0x1e0984=_0x214fb1[_0x2bbe0b(0x1b2)]?'('+formatElapsed(_0x214fb1[_0x2bbe0b(0x1b2)]['duration'])+')':'',_0x4bb78b=stringWidth(_0x1e0984),_0x3f2829=_0x2c25e6*0x1,_0x20a961=_0x5f4938-_0x3f2829-_0x4bb78b-0x1,_0x34e2be=truncateTaskName(_0xe896c8,_0x20a961),_0x229a11=_0x14855+_0x34e2be,_0x2a0369=stringWidth(_0x229a11),_0x4fdb6c=_0x5f4938-_0x2a0369-_0x4bb78b,_0x36dd3c=_0x229a11+'\x20'['repeat'](Math[_0x2bbe0b(0x2d6)](0x1,_0x4fdb6c))+a56_0x3e0f1d[_0x2bbe0b(0x1f9)](_0x1e0984),_0x5cacb6=getTaskStateIcon(_0x214fb1[_0x2bbe0b(0x157)]),_0x21f0b0=new Array(_0x75179d)[_0x2bbe0b(0x195)]('\x20');if(_0x214fb1[_0x2bbe0b(0x1b2)]){const _0x147715=timeToPosition(_0x214fb1[_0x2bbe0b(0x1b2)]['start'],_0x1931ff,_0x75179d),_0x686660=timeToPosition(_0x214fb1[_0x2bbe0b(0x1b2)][_0x2bbe0b(0x1ac)],_0x1931ff,_0x75179d),_0x309af7=getBarChar(_0x214fb1[_0x2bbe0b(0x157)]),_0x4b9fb7=Math[_0x2bbe0b(0x2d6)](_0x147715+0x1,_0x686660);for(let _0x77ab55=_0x147715;_0x77ab55<Math[_0x2bbe0b(0x295)](_0x4b9fb7,_0x75179d);_0x77ab55++){_0x21f0b0[_0x77ab55]=_0x309af7;}}const _0x3de954=getBarColor(_0x214fb1['state']),_0x3f9f35=_0x21f0b0[_0x2bbe0b(0x2b5)](_0x2d80fa=>_0x2d80fa==='\x20'?'\x20':_0x3de954(_0x2d80fa))['join']('');return _0x5cacb6+'\x20'+_0x36dd3c+'│'+_0x3f9f35+'│';}function calculateStats(_0x234672){const _0x10604f=a56_0x4d17f9,_0x4da9a3={'total':_0x234672[_0x10604f(0x1d4)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x25cb7f of _0x234672){if(_0x25cb7f[_0x10604f(0x157)]===_0x10604f(0x2f1))_0x4da9a3[_0x10604f(0x2f1)]++;else{if(_0x25cb7f[_0x10604f(0x157)]===_0x10604f(0x19d)||_0x25cb7f[_0x10604f(0x157)]===_0x10604f(0x2fa))_0x4da9a3[_0x10604f(0x19d)]++;else _0x25cb7f[_0x10604f(0x157)]===_0x10604f(0x15b)?_0x4da9a3[_0x10604f(0x15b)]++:_0x4da9a3[_0x10604f(0x24c)]++;}}return _0x4da9a3;}function formatStats(_0x4aea92){const _0x554149=a56_0x4d17f9;return[_0x554149(0x1de)+_0x4aea92[_0x554149(0x147)],'✅\x20'+_0x4aea92[_0x554149(0x2f1)],'❌\x20'+_0x4aea92[_0x554149(0x19d)],'🔄\x20'+_0x4aea92[_0x554149(0x15b)],'⏳\x20'+_0x4aea92[_0x554149(0x24c)]][_0x554149(0x278)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x22f);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x2e5);async[a56_0x4d17f9(0x25e)](_0x5152f6){const _0x696f3e=a56_0x4d17f9,{options:_0x50059b,args:_0x2c9a1c,tdx:_0x706106}=_0x5152f6;let _0x39bf3a,_0x2788dd,_0x57ea03=![];if(_0x2c9a1c[0x0]){if(_0x2c9a1c[0x0][_0x696f3e(0x2de)]('.')){const _0x4d5520=this['parseProjectWorkflowPattern'](_0x2c9a1c,_0x50059b);if(!_0x4d5520)return 0x1;_0x39bf3a=_0x4d5520['projectName'],_0x2788dd=_0x4d5520[_0x696f3e(0x25a)];}else{_0x2788dd=_0x2c9a1c[0x0],_0x39bf3a=_0x50059b['workflowProject'];if(!_0x39bf3a)return console[_0x696f3e(0x19d)](a56_0x3e0f1d[_0x696f3e(0x2d7)](_0x696f3e(0x244)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x57ea03=!![];}}else{const _0xfd628d=this[_0x696f3e(0x167)](_0x2c9a1c,_0x50059b);if(!_0xfd628d)return 0x1;_0x39bf3a=_0xfd628d['projectName'],_0x2788dd=_0xfd628d['workflowName'];}if(_0x50059b['verbose']){if(_0x39bf3a&&_0x2788dd)console['error']('Filter:\x20'+_0x39bf3a+'.'+_0x2788dd);else _0x39bf3a&&console[_0x696f3e(0x19d)]('Filter:\x20project='+_0x39bf3a);}const _0x2d0b58=_0x50059b['attemptId'],_0x2eabd4=_0x50059b['sessionId'];if(_0x2d0b58){_0x2eabd4&&console[_0x696f3e(0x19d)](a56_0x3e0f1d[_0x696f3e(0x2a8)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x309325=_0x50059b[_0x696f3e(0x245)];return _0x309325?await this[_0x696f3e(0x2c6)](_0x5152f6,_0x2d0b58):await this[_0x696f3e(0x29d)](_0x5152f6,_0x2d0b58,_0x50059b),0x0;}if(_0x2eabd4){const _0x52461f=await withSpinner(_0x696f3e(0x1e1),()=>_0x706106[_0x696f3e(0x13f)]['sessions']({'projectName':_0x39bf3a,'workflowName':_0x2788dd,'limit':0x64}),{'verbose':_0x50059b[_0x696f3e(0x1c8)]}),_0x87ba99=_0x52461f[_0x696f3e(0x126)][_0x696f3e(0x252)](_0x1a8288=>_0x1a8288['id']===_0x2eabd4);if(!_0x87ba99)return console[_0x696f3e(0x19d)](a56_0x3e0f1d[_0x696f3e(0x2d7)]('Error:'),_0x696f3e(0x14a)+_0x2eabd4),0x1;if(!_0x87ba99[_0x696f3e(0x202)]?.['id'])return console['error'](a56_0x3e0f1d[_0x696f3e(0x2d7)]('Error:'),_0x696f3e(0x192)+_0x2eabd4+_0x696f3e(0x21e)),0x1;const _0xc1c098=_0x87ba99[_0x696f3e(0x202)]['id'];_0x50059b['verbose']&&console['error'](_0x696f3e(0x29a)+_0xc1c098+_0x696f3e(0x20d)+_0x2eabd4);const _0x7a3a98=_0x50059b[_0x696f3e(0x245)];return _0x7a3a98?await this[_0x696f3e(0x2c6)](_0x5152f6,_0xc1c098):await this[_0x696f3e(0x29d)](_0x5152f6,_0xc1c098,_0x50059b),0x0;}const _0x1b36ee=await withSpinner(_0x696f3e(0x2ab),()=>_0x706106['workflow']['sessions']({'projectName':_0x39bf3a,'workflowName':_0x2788dd,'limit':_0x50059b[_0x696f3e(0x1d8)]||0x32}),{'verbose':_0x50059b['verbose']}),_0x219c8d=_0x1b36ee[_0x696f3e(0x126)];if(_0x219c8d[_0x696f3e(0x1d4)]===0x0){if(_0x39bf3a&&_0x2788dd)console['error'](_0x696f3e(0x2ae)+_0x39bf3a+'.'+_0x2788dd);else _0x39bf3a?console[_0x696f3e(0x19d)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x39bf3a):(console[_0x696f3e(0x19d)](_0x696f3e(0x2a9)),console[_0x696f3e(0x19d)](a56_0x3e0f1d[_0x696f3e(0x1f9)](_0x696f3e(0x1b1))));return 0x0;}_0x219c8d['sort']((_0x35b6a7,_0x3bf55c)=>{const _0x553685=_0x696f3e,_0x233115=_0x35b6a7[_0x553685(0x255)]||'',_0x43b7a1=_0x3bf55c['sessionTime']||'';return _0x43b7a1[_0x553685(0x231)](_0x233115);});if(_0x50059b[_0x696f3e(0x257)]||_0x50059b['jsonl'])return await handleSDKOutput(_0x219c8d,_0x50059b),0x0;let _0x4cf40a;if(_0x57ea03){const _0x36012f=_0x219c8d[0x0];if(!_0x36012f[_0x696f3e(0x202)]?.['id'])return console['error'](_0x696f3e(0x122)),0x0;_0x4cf40a=_0x36012f['lastAttempt']['id'],_0x50059b[_0x696f3e(0x1c8)]&&console[_0x696f3e(0x19d)](_0x696f3e(0x22d)+_0x36012f['sessionTime']);}else{const _0x31b396=_0x219c8d[_0x696f3e(0x2b5)](_0x1ef19d=>{const _0x2b0d19=_0x696f3e,_0x15195a=getAttemptStatusDisplay(_0x1ef19d[_0x2b0d19(0x202)]);return{'title':_0x1ef19d[_0x2b0d19(0x275)]?.[_0x2b0d19(0x1b7)]+'.'+_0x1ef19d[_0x2b0d19(0x13f)]?.[_0x2b0d19(0x1b7)]+_0x2b0d19(0x128)+_0x1ef19d[_0x2b0d19(0x255)]+'\x20'+_0x15195a[_0x2b0d19(0x127)],'value':_0x1ef19d[_0x2b0d19(0x202)]?.['id']||'','description':_0x15195a[_0x2b0d19(0x2ba)]};}),_0x4f3856=await a56_0x2c360c({'type':'select','name':'attemptId','message':_0x696f3e(0x288),'choices':_0x31b396[_0x696f3e(0x19b)](_0x1c5ea2=>_0x1c5ea2['value']!=='')});if(!_0x4f3856[_0x696f3e(0x236)])return 0x0;_0x4cf40a=_0x4f3856[_0x696f3e(0x236)];}const _0x5e2479=_0x50059b[_0x696f3e(0x245)];return _0x5e2479?await this['pollTimeline'](_0x5152f6,_0x4cf40a):await this[_0x696f3e(0x29d)](_0x5152f6,_0x4cf40a,_0x50059b),0x0;}async[a56_0x4d17f9(0x29d)](_0x10cc73,_0x2abd3c,_0x50a5d3){const _0x493fa4=a56_0x4d17f9,{tdx:_0x122c9e}=_0x10cc73;let _0x1a2443,_0x3341fd;try{[_0x1a2443,_0x3341fd]=await Promise[_0x493fa4(0x14f)]([_0x122c9e[_0x493fa4(0x13f)]['attempt'](_0x2abd3c),_0x122c9e[_0x493fa4(0x13f)][_0x493fa4(0x1dc)](_0x2abd3c,![])]);}catch(_0x29b371){console['error'](a56_0x3e0f1d[_0x493fa4(0x2d7)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x50a5d3[_0x493fa4(0x1c8)]&&console[_0x493fa4(0x19d)](_0x29b371);throw _0x29b371;}if(_0x50a5d3[_0x493fa4(0x257)]||_0x50a5d3['jsonl']){const _0x457675=this[_0x493fa4(0x2c9)](_0x1a2443,_0x3341fd);await handleSDKOutput([_0x457675],_0x50a5d3);return;}const _0x166e4c=_0x122c9e[_0x493fa4(0x2bf)][_0x493fa4(0x249)],_0x36d675=this[_0x493fa4(0x1bd)](_0x1a2443,_0x3341fd,_0x166e4c);console['log'](_0x36d675);}async['pollTimeline'](_0x235ff6,_0x5bcb24){const _0x2bcb03=a56_0x4d17f9,{tdx:_0x4d0bd2}=_0x235ff6,_0x597f11=TIMELINE_CONFIG[_0x2bcb03(0x19e)],_0x18a7ee=TIMELINE_CONFIG[_0x2bcb03(0x2c4)];let _0x37f8a5=0x0;while(_0x37f8a5<_0x18a7ee){process[_0x2bcb03(0x2a5)][_0x2bcb03(0x190)]&&process[_0x2bcb03(0x2a5)][_0x2bcb03(0x18b)]('\x1Bc');let _0x52c343,_0xdfc60a;try{[_0x52c343,_0xdfc60a]=await Promise[_0x2bcb03(0x14f)]([_0x4d0bd2[_0x2bcb03(0x13f)][_0x2bcb03(0x266)](_0x5bcb24),_0x4d0bd2[_0x2bcb03(0x13f)]['tasks'](_0x5bcb24,![])]);}catch(_0x31e2c6){console[_0x2bcb03(0x19d)](a56_0x3e0f1d[_0x2bcb03(0x2d7)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x37f8a5>0x0&&console[_0x2bcb03(0x19d)](a56_0x3e0f1d['dim'](_0x2bcb03(0x16a)+_0x37f8a5));throw _0x31e2c6;}const _0x1ff05d=_0x4d0bd2[_0x2bcb03(0x2bf)][_0x2bcb03(0x249)],_0x5d493d=this[_0x2bcb03(0x1bd)](_0x52c343,_0xdfc60a,_0x1ff05d);console[_0x2bcb03(0x221)](_0x5d493d);const _0x11f919=_0x52c343[_0x2bcb03(0x203)]&&_0xdfc60a[_0x2bcb03(0x191)](_0x258a76=>_0x258a76[_0x2bcb03(0x157)]!==_0x2bcb03(0x15b)&&_0x258a76['state']!==_0x2bcb03(0x282));if(_0x11f919){console[_0x2bcb03(0x19d)](a56_0x3e0f1d[_0x2bcb03(0x182)](_0x2bcb03(0x254)));break;}console['error'](a56_0x3e0f1d[_0x2bcb03(0x1f9)](_0x2bcb03(0x196)+_0x37f8a5*0x2+_0x2bcb03(0x220))),await new Promise(_0x1c8022=>setTimeout(_0x1c8022,_0x597f11)),_0x37f8a5++;}_0x37f8a5>=_0x18a7ee&&console['error'](a56_0x3e0f1d[_0x2bcb03(0x2a8)](_0x2bcb03(0x146)));}['renderTimeline'](_0x3f77f3,_0x2ff2b9,_0x31db10){const _0x246088=a56_0x4d17f9,_0xec237f=[],_0x59058a=TIMELINE_CONFIG[_0x246088(0x1f6)],_0x57b798=0x5,_0x35b3f6=process['stdout'][_0x246088(0x175)]||0x78,_0x235805=_0x35b3f6-_0x59058a-_0x57b798,_0x2fef3f=Math[_0x246088(0x2d6)](TIMELINE_CONFIG[_0x246088(0x145)],Math[_0x246088(0x295)](_0x235805,TIMELINE_CONFIG[_0x246088(0x1df)])),_0x37a3bc=new Date(_0x3f77f3[_0x246088(0x186)])['getTime'](),_0x3a6f5f=_0x3f77f3[_0x246088(0x2b3)]?new Date(_0x3f77f3[_0x246088(0x2b3)])[_0x246088(0x19c)]():Date['now'](),_0x4cf19f={'start':_0x37a3bc,'end':_0x3a6f5f,'duration':_0x3a6f5f-_0x37a3bc},_0x8cc90d=new Map(),_0x134924=[];for(const _0x106e4f of _0x2ff2b9){if(_0x106e4f[_0x246088(0x131)]){const _0xfc7f33=new Date(_0x106e4f[_0x246088(0x131)])['getTime'](),_0xb72a6=_0x106e4f['updatedAt']?new Date(_0x106e4f[_0x246088(0x1f5)])['getTime']():Date['now'](),_0x26ea79={'start':_0xfc7f33,'end':_0xb72a6,'duration':_0xb72a6-_0xfc7f33};_0x8cc90d[_0x246088(0x26f)](_0x106e4f['id'],_0x26ea79),_0x134924[_0x246088(0x250)]({'name':_0x106e4f[_0x246088(0x17e)],'state':_0x106e4f[_0x246088(0x157)]||_0x246088(0x22b),'window':_0x26ea79});}else _0x134924[_0x246088(0x250)]({'name':_0x106e4f[_0x246088(0x17e)],'state':_0x106e4f[_0x246088(0x157)]||'planned','window':undefined});}_0x134924[_0x246088(0x214)]((_0x4df1fe,_0x4c5054)=>{const _0x2f952f=_0x246088;if(!_0x4df1fe[_0x2f952f(0x1b2)])return 0x1;if(!_0x4c5054['window'])return-0x1;return _0x4df1fe[_0x2f952f(0x1b2)][_0x2f952f(0x143)]-_0x4c5054[_0x2f952f(0x1b2)][_0x2f952f(0x143)];});const _0x1c5c0a=_0x134924[_0x246088(0x1d4)],_0x8c4ff7=_0x1c5c0a>TIMELINE_CONFIG[_0x246088(0x25c)];_0x8c4ff7&&_0x134924[_0x246088(0x1b9)](TIMELINE_CONFIG[_0x246088(0x25c)]);const _0x4224b4=calculateTimeScale(_0x4cf19f,_0x2fef3f),_0x460443=_0x3f77f3[_0x246088(0x203)]?_0x3f77f3[_0x246088(0x2f1)]?a56_0x3e0f1d[_0x246088(0x182)](_0x246088(0x2f1)):a56_0x3e0f1d[_0x246088(0x2d7)]('error'):a56_0x3e0f1d[_0x246088(0x2cb)](_0x246088(0x15b)),_0x31cd28=_0x3f77f3[_0x246088(0x275)]?.['id'],_0xce5964=_0x3f77f3['sessionId'];let _0x2f7225;if(_0x31cd28&&_0xce5964){const _0x1e9db6=getWorkflowAttemptUrl(_0x31db10,_0x31cd28,_0xce5964,_0x3f77f3['id']);_0x2f7225=hyperlink(a56_0x3e0f1d[_0x246088(0x1f9)](_0x3f77f3['id']),_0x1e9db6);}else _0x2f7225=a56_0x3e0f1d[_0x246088(0x1f9)](_0x3f77f3['id']);_0xec237f[_0x246088(0x250)](_0x246088(0x19a)+_0x2f7225+_0x246088(0x128)+_0x460443+_0x246088(0x128)+formatElapsed(_0x4cf19f[_0x246088(0x1e5)]));if(_0x134924['length']>0x0){const _0x5b302e=renderTimeAxis(_0x4224b4,_0x2fef3f),_0x576dd2=new Date(_0x4cf19f[_0x246088(0x143)]),_0x35e464=formatDate(_0x576dd2),_0x43c360=TIMELINE_CONFIG[_0x246088(0x1dd)]+TIMELINE_CONFIG[_0x246088(0x1fe)]+_0x59058a,_0x392483=_0x35e464['padStart'](_0x43c360),_0x312caa=a56_0x3e0f1d['dim'](_0x392483);_0xec237f[_0x246088(0x250)](_0x312caa+'\x20'+_0x5b302e);for(const _0x55f049 of _0x134924){_0xec237f[_0x246088(0x250)](renderTaskRow(_0x55f049,_0x4224b4,_0x2fef3f,_0x59058a));}const _0x2f1805=calculateStats(_0x134924);_0xec237f[_0x246088(0x250)](formatStats(_0x2f1805)),_0x8c4ff7&&_0xec237f[_0x246088(0x250)](a56_0x3e0f1d[_0x246088(0x2a8)](_0x246088(0x290)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x246088(0x13c)+_0x1c5c0a+_0x246088(0x25b))),_0xec237f['push'](''),_0xec237f['push'](a56_0x3e0f1d['dim'](_0x246088(0x1ca))+('tdx\x20wf\x20attempt\x20'+_0x3f77f3['id']+_0x246088(0x207))+a56_0x3e0f1d[_0x246088(0x1f9)](_0x246088(0x1ab)));}else _0xec237f[_0x246088(0x250)](_0x246088(0x144));return _0xec237f[_0x246088(0x278)]('\x0a');}[a56_0x4d17f9(0x2c9)](_0xb5305a,_0x25f6ac){const _0x12d8fa=a56_0x4d17f9,_0x2c68f1=new Date(_0xb5305a[_0x12d8fa(0x186)])[_0x12d8fa(0x19c)](),_0x554f5a=_0xb5305a[_0x12d8fa(0x2b3)]?new Date(_0xb5305a['finishedAt'])['getTime']():Date['now'](),_0x447fb1=_0x554f5a-_0x2c68f1,_0x6bbf0a=[];for(const _0x5e9cdd of _0x25f6ac){if(_0x5e9cdd[_0x12d8fa(0x131)]){const _0x2b9cf5=new Date(_0x5e9cdd[_0x12d8fa(0x131)])[_0x12d8fa(0x19c)](),_0xdc7bf7=_0x5e9cdd['updatedAt']?new Date(_0x5e9cdd['updatedAt'])['getTime']():Date['now']();_0x6bbf0a['push']({'name':_0x5e9cdd[_0x12d8fa(0x17e)],'state':_0x5e9cdd[_0x12d8fa(0x157)]||_0x12d8fa(0x22b),'window':{'start':_0x2b9cf5,'end':_0xdc7bf7,'duration':_0xdc7bf7-_0x2b9cf5}});}else _0x6bbf0a['push']({'name':_0x5e9cdd[_0x12d8fa(0x17e)],'state':_0x5e9cdd[_0x12d8fa(0x157)]||'planned','window':undefined});}const _0x56eebf=calculateStats(_0x6bbf0a);return{'attempt':{'id':_0xb5305a['id'],'status':_0xb5305a[_0x12d8fa(0x203)]?_0xb5305a['success']?_0x12d8fa(0x2f1):'error':_0x12d8fa(0x15b),'createdAt':_0xb5305a[_0x12d8fa(0x186)],'finishedAt':_0xb5305a[_0x12d8fa(0x2b3)],'duration_ms':_0x447fb1},'tasks':_0x6bbf0a[_0x12d8fa(0x2b5)](_0x31abbe=>({'name':_0x31abbe[_0x12d8fa(0x1b7)],'state':_0x31abbe[_0x12d8fa(0x157)],'startedAt':_0x31abbe['window']?new Date(_0x31abbe[_0x12d8fa(0x1b2)][_0x12d8fa(0x143)])[_0x12d8fa(0x1e8)]():null,'updatedAt':_0x31abbe[_0x12d8fa(0x1b2)]?new Date(_0x31abbe[_0x12d8fa(0x1b2)][_0x12d8fa(0x1ac)])[_0x12d8fa(0x1e8)]():null,'duration_ms':_0x31abbe[_0x12d8fa(0x1b2)]?.['duration']||null})),'stats':_0x56eebf};}}function formatScheduleLine(_0x449318){const _0x3661e5=a56_0x4d17f9,_0x2cee48=_0x449318[_0x3661e5(0x1c7)]?a56_0x3e0f1d[_0x3661e5(0x2a8)]('\x20(disabled)'):'',_0x46d53c=_0x449318[_0x3661e5(0x275)]?.[_0x3661e5(0x1b7)]?a56_0x3e0f1d[_0x3661e5(0x1f9)]('\x20['+_0x449318['project']['name']+']'):'',_0x3a8fd9=_0x449318[_0x3661e5(0x21a)]?a56_0x3e0f1d[_0x3661e5(0x1f9)](_0x3661e5(0x23b)+new Date(_0x449318[_0x3661e5(0x21a)])['toLocaleString']()):'';return'📅\x20#'+_0x449318['id']+'\x20'+(_0x449318[_0x3661e5(0x13f)]?.[_0x3661e5(0x1b7)]||_0x3661e5(0x29e))+_0x46d53c+_0x2cee48+_0x3a8fd9;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a56_0x4d17f9(0x1b7)]=a56_0x4d17f9(0x130);[a56_0x4d17f9(0x155)]=a56_0x4d17f9(0x2be);async['execute'](_0x44410e){const _0x45c01e=a56_0x4d17f9,{options:_0x371459,args:_0x4618e5,tdx:_0x37542c}=_0x44410e,{scheduleId:_0x3ac2ba}=_0x371459;if(_0x3ac2ba&&_0x4618e5[0x0])return console[_0x45c01e(0x19d)](a56_0x3e0f1d[_0x45c01e(0x2d7)](_0x45c01e(0x244)),_0x45c01e(0x2a1)),console[_0x45c01e(0x19d)](a56_0x3e0f1d[_0x45c01e(0x1f9)](_0x45c01e(0x1cd))),0x1;if(_0x3ac2ba){const _0x2ab0aa=await withSpinner(_0x45c01e(0x18f)+_0x3ac2ba+_0x45c01e(0x17a),()=>_0x37542c[_0x45c01e(0x13f)][_0x45c01e(0x1ec)](_0x3ac2ba),{'verbose':_0x371459['verbose']}),_0x35713f=_0x2ab0aa[_0x45c01e(0x126)];return isStructuredFormat(_0x371459)?await handleSingleObjectOutput(_0x35713f,_0x371459):(console[_0x45c01e(0x19d)](_0x45c01e(0x189)),console[_0x45c01e(0x221)](formatScheduleLine(_0x35713f))),0x0;}const _0x4b71a=this[_0x45c01e(0x167)](_0x4618e5,_0x371459);if(!_0x4b71a)return 0x1;const {projectName:_0x3f7fd0,workflowName:_0x4c5adb}=_0x4b71a,_0x310993=_0x3f7fd0?'\x27'+_0x3f7fd0+(_0x4c5adb?'.'+_0x4c5adb:'')+'\x27':undefined,_0x7ad9a6=await withSpinner(_0x310993?_0x45c01e(0x164)+_0x310993+_0x45c01e(0x17a):_0x45c01e(0x185),()=>_0x3f7fd0?_0x37542c['workflow'][_0x45c01e(0x1c2)](_0x3f7fd0,{'workflow':_0x4c5adb,'limit':_0x371459[_0x45c01e(0x1d8)]}):_0x37542c[_0x45c01e(0x13f)][_0x45c01e(0x270)]({'limit':_0x371459[_0x45c01e(0x1d8)]}),{'verbose':_0x371459['verbose']}),_0x280d15=_0x7ad9a6['data'],_0x51d704=_0x371459['limit']&&_0x280d15[_0x45c01e(0x1d4)]>=_0x371459[_0x45c01e(0x1d8)]?a56_0x3e0f1d[_0x45c01e(0x1f9)](_0x45c01e(0x212)):'';console[_0x45c01e(0x19d)](_0x45c01e(0x233)+_0x280d15[_0x45c01e(0x1d4)]+'\x20schedule'+(_0x280d15[_0x45c01e(0x1d4)]!==0x1?'s':'')+_0x51d704);if(isStructuredFormat(_0x371459))await handleSDKOutput(_0x280d15,_0x371459);else{if(_0x280d15[_0x45c01e(0x1d4)]===0x0)console['log'](_0x45c01e(0x274));else for(const _0x51c521 of _0x280d15){console[_0x45c01e(0x221)](formatScheduleLine(_0x51c521));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a56_0x4d17f9(0x1b7)]='workflow:schedule:enable';[a56_0x4d17f9(0x155)]='Enable\x20a\x20workflow\x20schedule';async['execute'](_0x348558){const _0x107f75=a56_0x4d17f9,{options:_0x3ea4fd,args:_0x50e949,tdx:_0x4afd25}=_0x348558,_0x3e87d8=_0x50e949[0x0];if(!_0x3e87d8)return console[_0x107f75(0x19d)](a56_0x3e0f1d[_0x107f75(0x2d7)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x107f75(0x19d)](a56_0x3e0f1d[_0x107f75(0x1f9)](_0x107f75(0x2ef))),console[_0x107f75(0x19d)](a56_0x3e0f1d[_0x107f75(0x1f9)](_0x107f75(0x2cc))),0x1;const {backfill:_0x221c81,nextTime:_0xe8fe5e}=_0x3ea4fd,_0x46d45c={};if(_0x221c81!==undefined)_0x46d45c[_0x107f75(0x15e)]=!_0x221c81;if(_0xe8fe5e!==undefined)_0x46d45c[_0x107f75(0x23e)]=_0xe8fe5e;const _0x3aeac9=await withSpinner('Enabling\x20schedule\x20#'+_0x3e87d8+_0x107f75(0x17a),()=>_0x4afd25[_0x107f75(0x13f)][_0x107f75(0x204)](_0x3e87d8,_0x46d45c),{'verbose':_0x3ea4fd['verbose']}),_0x1b4224=_0x3aeac9['data'];return isStructuredFormat(_0x3ea4fd)?await handleSingleObjectOutput(_0x1b4224,_0x3ea4fd):(console[_0x107f75(0x221)](_0x107f75(0x19f)+_0x3e87d8+'\x20enabled\x20('+(_0x1b4224[_0x107f75(0x13f)]?.['name']||_0x107f75(0x22b))+')'),_0x1b4224[_0x107f75(0x21a)]&&console['log'](a56_0x3e0f1d[_0x107f75(0x1f9)]('\x20\x20Next\x20run:\x20'+new Date(_0x1b4224[_0x107f75(0x21a)])[_0x107f75(0x2d8)]()))),0x0;}}function a56_0x26aa(_0x21877c,_0x446ba1){_0x21877c=_0x21877c-0x122;const _0x1da5c2=a56_0x1da5();let _0x26aa7b=_0x1da5c2[_0x21877c];return _0x26aa7b;}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']=a56_0x4d17f9(0x1fd);[a56_0x4d17f9(0x155)]='Disable\x20a\x20workflow\x20schedule';async[a56_0x4d17f9(0x25e)](_0x44063b){const _0x28c43f=a56_0x4d17f9,{options:_0x54e50d,args:_0x42b347,tdx:_0x55b8b0}=_0x44063b,_0x5b5901=_0x42b347[0x0];if(!_0x5b5901)return console[_0x28c43f(0x19d)](a56_0x3e0f1d[_0x28c43f(0x2d7)](_0x28c43f(0x244)),'Schedule\x20ID\x20is\x20required'),console[_0x28c43f(0x19d)](a56_0x3e0f1d[_0x28c43f(0x1f9)](_0x28c43f(0x261))),console['error'](a56_0x3e0f1d[_0x28c43f(0x1f9)](_0x28c43f(0x2cc))),0x1;const _0x542aef=await withSpinner(_0x28c43f(0x16f)+_0x5b5901+'...',()=>_0x55b8b0['workflow'][_0x28c43f(0x1a4)](_0x5b5901),{'verbose':_0x54e50d[_0x28c43f(0x1c8)]}),_0x2cfe68=_0x542aef[_0x28c43f(0x126)];return isStructuredFormat(_0x54e50d)?await handleSingleObjectOutput(_0x2cfe68,_0x54e50d):console['log'](_0x28c43f(0x19f)+_0x5b5901+_0x28c43f(0x213)+(_0x2cfe68['workflow']?.[_0x28c43f(0x1b7)]||_0x28c43f(0x22b))+')'),0x0;}}
1
+ const a59_0x69291=a59_0x2c40;(function(_0x3104cd,_0x18a381){const _0x416807=a59_0x2c40,_0x244bc0=_0x3104cd();while(!![]){try{const _0x3d9900=-parseInt(_0x416807(0x28c))/0x1+-parseInt(_0x416807(0x14c))/0x2*(parseInt(_0x416807(0x2e8))/0x3)+parseInt(_0x416807(0x22d))/0x4+parseInt(_0x416807(0x252))/0x5*(parseInt(_0x416807(0x1b4))/0x6)+parseInt(_0x416807(0x219))/0x7+parseInt(_0x416807(0x291))/0x8+parseInt(_0x416807(0x17c))/0x9*(-parseInt(_0x416807(0x299))/0xa);if(_0x3d9900===_0x18a381)break;else _0x244bc0['push'](_0x244bc0['shift']());}catch(_0x10cd94){_0x244bc0['push'](_0x244bc0['shift']());}}}(a59_0x5020,0x7a173));import a59_0x34c7bd from'chalk';import{existsSync}from'fs';import a59_0x28ffa6 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 a59_0x3da1fb from'prompts';function getAttemptStatusDisplay(_0x3eb3d8){const _0x1feb40=a59_0x2c40;if(!_0x3eb3d8)return{'icon':'⏳','text':''};const {done:_0x438da3,success:_0x2d8a42,cancelRequested:_0x5a232e}=_0x3eb3d8;if(!_0x438da3)return _0x5a232e?{'icon':'🛑','text':a59_0x34c7bd[_0x1feb40(0x196)](_0x1feb40(0x173))}:{'icon':'🔄','text':a59_0x34c7bd[_0x1feb40(0x269)](_0x1feb40(0x152))};if(_0x2d8a42)return{'icon':'✅','text':a59_0x34c7bd[_0x1feb40(0x2d5)](_0x1feb40(0x210))};return{'icon':'❌','text':a59_0x34c7bd['red'](_0x1feb40(0x274))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x24db61,_0x715640,_0x4218c8=0x0){return _0x24db61[_0x4218c8]||_0x715640['workflowProject'];}[a59_0x69291(0x1ee)](_0x48911c,_0x327868,_0x3e3d55=0x0){const _0x193590=a59_0x69291,_0x3be884=this[_0x193590(0x1f1)](_0x48911c,_0x327868,_0x3e3d55);if(!_0x3be884)return console['error'](a59_0x34c7bd[_0x193590(0x2f8)](_0x193590(0x287)),'Project\x20name\x20is\x20required'),console[_0x193590(0x274)](a59_0x34c7bd[_0x193590(0x27d)](_0x193590(0x298))),null;return _0x3be884;}[a59_0x69291(0x1a5)](_0x4db037,_0x250812){const _0x57f768=a59_0x69291;if(_0x4db037[0x0]){const _0x1814bc=_0x4db037[0x0][_0x57f768(0x1cc)]('.');if(_0x1814bc[_0x57f768(0x204)]===0x1)return{'projectName':_0x1814bc[0x0],'workflowName':undefined};else return _0x1814bc[_0x57f768(0x204)]===0x2?{'projectName':_0x1814bc[0x0],'workflowName':_0x1814bc[0x1]}:(console[_0x57f768(0x274)](a59_0x34c7bd[_0x57f768(0x2f8)](_0x57f768(0x287)),_0x57f768(0x238)),null);}return{'projectName':_0x250812[_0x57f768(0x19c)],'workflowName':undefined};}['resolveProjectDir'](_0x340960,_0x23dc02,_0x1c1123=0x0){const _0x123f77=a59_0x69291;if(_0x340960[_0x1c1123])return _0x340960[_0x1c1123];if(_0x23dc02[_0x123f77(0x19c)]){const _0x43528a=a59_0x28ffa6['join'](process[_0x123f77(0x2e3)](),_0x123f77(0x1cb),_0x23dc02['workflowProject']);if(existsSync(a59_0x28ffa6['join'](_0x43528a,_0x123f77(0x1cd))))return _0x43528a;}return undefined;}async[a59_0x69291(0x264)](_0x365bf0,_0x5ae966,_0x529c66){const _0x1eb6a0=a59_0x69291;try{const _0x2dde83=await _0x365bf0[_0x1eb6a0(0x19a)][_0x1eb6a0(0x1cb)](_0x5ae966,{'limit':0x1});if(_0x2dde83[_0x1eb6a0(0x204)]>0x0){const _0x57ea28=_0x2dde83[0x0]['id'],_0x262a3b=getWorkflowUrl(_0x529c66,_0x57ea28);console['error'](_0x1eb6a0(0x13d)+a59_0x34c7bd[_0x1eb6a0(0x251)](_0x262a3b));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a59_0x69291(0x1c9);[a59_0x69291(0x134)]=a59_0x69291(0x22a);async[a59_0x69291(0x2fa)](_0x5416fd){const _0x1f0993=a59_0x69291,{options:_0x5b346c,args:_0x370638,tdx:_0x53c14b}=_0x5416fd,_0x52ee43=_0x370638[0x0],_0x2f6443=_0x5b346c[_0x1f0993(0x2ba)];if(_0x2f6443)return saveSessionContext({'workflow_project':undefined},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)](_0x1f0993(0x22c))),0x0;if(!_0x52ee43)return console[_0x1f0993(0x274)](a59_0x34c7bd['red']('Error:'),_0x1f0993(0x2be)),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x14a))),console[_0x1f0993(0x274)](a59_0x34c7bd[_0x1f0993(0x27d)](_0x1f0993(0x16e))),0x1;const _0x3865a1=await withSpinner(_0x1f0993(0x1da)+_0x52ee43+'\x27...',()=>_0x53c14b[_0x1f0993(0x19a)][_0x1f0993(0x1ec)](_0x52ee43),{'verbose':_0x5b346c['verbose']}),{name:_0x448fa8}=_0x3865a1[_0x1f0993(0x162)];return saveSessionContext({'workflow_project':_0x448fa8},_0x5b346c['session']),console[_0x1f0993(0x296)](a59_0x34c7bd[_0x1f0993(0x2d5)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a59_0x34c7bd[_0x1f0993(0x251)](_0x448fa8))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a59_0x69291(0x297);[a59_0x69291(0x134)]='List\x20all\x20workflow\x20projects';async[a59_0x69291(0x2fa)](_0x1f9dcc){const _0x1309c7=a59_0x69291,{options:_0x31a5d4,args:_0x174f5b,tdx:_0x4639bc}=_0x1f9dcc,_0x3bcd8e=_0x174f5b[0x0];_0x31a5d4[_0x1309c7(0x151)]&&_0x3bcd8e&&console[_0x1309c7(0x274)]('Pattern:\x20'+_0x3bcd8e);const _0x28a4a4=await withSpinner(_0x1309c7(0x20d),()=>_0x4639bc[_0x1309c7(0x19a)]['projects'](_0x3bcd8e,{'limit':_0x31a5d4['limit']}),{'verbose':_0x31a5d4[_0x1309c7(0x151)]});let _0x3120a9=_0x28a4a4[_0x1309c7(0x162)];_0x3120a9[_0x1309c7(0x279)]((_0x2687b3,_0x20dc46)=>_0x2687b3[_0x1309c7(0x268)][_0x1309c7(0x286)](_0x20dc46['name']));const _0x1e6c2d=_0x31a5d4[_0x1309c7(0x2db)]&&_0x3120a9[_0x1309c7(0x204)]>=_0x31a5d4[_0x1309c7(0x2db)]?a59_0x34c7bd['dim'](_0x1309c7(0x188)):'';console['error']('✔\x20Found\x20'+_0x3120a9['length']+_0x1309c7(0x24d)+(_0x3120a9[_0x1309c7(0x204)]!==0x1?'s':'')+_0x1e6c2d);if(_0x31a5d4[_0x1309c7(0x2ad)]==='json'||_0x31a5d4['format']===_0x1309c7(0x1d8)||_0x31a5d4[_0x1309c7(0x2ad)]===_0x1309c7(0x1dd))await handleSDKOutput(_0x3120a9,_0x31a5d4);else{if(_0x3120a9[_0x1309c7(0x204)]===0x0)_0x3bcd8e?console['log'](_0x1309c7(0x141)+_0x3bcd8e):console[_0x1309c7(0x296)]('No\x20workflow\x20projects\x20found');else{const _0x5ae2a2=_0x3120a9[_0x1309c7(0x1b8)](_0x2f0d6f=>{const _0x2c517a=_0x1309c7,_0x373cf8=_0x2f0d6f[_0x2c517a(0x1b6)]?.[_0x2c517a(0x2ef)](_0x3d6ecd=>_0x3d6ecd[_0x2c517a(0x243)]===_0x2c517a(0x1d7)),_0x4a39d7=_0x373cf8?a59_0x34c7bd['dim'](_0x2c517a(0x167)):'';return'📁\x20'+_0x2f0d6f[_0x2c517a(0x268)]+_0x4a39d7;});await writeOutput(_0x5ae2a2[_0x1309c7(0x19d)]('\x0a'),_0x31a5d4[_0x1309c7(0x207)],_0x1309c7(0x2e9));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x256);[a59_0x69291(0x134)]=a59_0x69291(0x174);async[a59_0x69291(0x2fa)](_0x30ed41){const _0x56d6d9=a59_0x69291,{options:_0x17b559,args:_0x18b873,tdx:_0x506afe}=_0x30ed41,_0x397af7=this[_0x56d6d9(0x1f1)](_0x18b873,_0x17b559);_0x17b559[_0x56d6d9(0x151)]&&_0x397af7&&console[_0x56d6d9(0x274)]('Project\x20filter:\x20'+_0x397af7);const _0x1eb321=await withSpinner(_0x56d6d9(0x2ea),()=>_0x506afe[_0x56d6d9(0x19a)][_0x56d6d9(0x1cb)](_0x397af7,{'limit':_0x17b559[_0x56d6d9(0x2db)]}),{'verbose':_0x17b559['verbose']});let _0x717b58=_0x1eb321['data'];_0x717b58[_0x56d6d9(0x279)]((_0x3abe2d,_0xed1127)=>{const _0x157c98=_0x56d6d9,_0x4f4952=_0x3abe2d[_0x157c98(0x268)][_0x157c98(0x286)](_0xed1127[_0x157c98(0x268)]);if(_0x4f4952!==0x0)return _0x4f4952;return(_0x3abe2d['project']?.[_0x157c98(0x268)]||'')[_0x157c98(0x286)](_0xed1127['project']?.[_0x157c98(0x268)]||'');});const _0x67d008=_0x17b559['limit']&&_0x717b58['length']>=_0x17b559['limit']?a59_0x34c7bd[_0x56d6d9(0x27d)](_0x56d6d9(0x188)):'';console['error'](_0x56d6d9(0x164)+_0x717b58[_0x56d6d9(0x204)]+_0x56d6d9(0x236)+(_0x717b58[_0x56d6d9(0x204)]!==0x1?'s':'')+_0x67d008);if(_0x17b559[_0x56d6d9(0x2ad)]==='json'||_0x17b559['format']==='jsonl'||_0x17b559[_0x56d6d9(0x2ad)]==='table')await handleSDKOutput(_0x717b58,_0x17b559);else{if(_0x717b58[_0x56d6d9(0x204)]===0x0)_0x397af7?console[_0x56d6d9(0x296)](_0x56d6d9(0x227)+_0x397af7):console['log'](_0x56d6d9(0x282));else{const _0x4f7656=_0x17b559[_0x56d6d9(0x2bf)],_0x37c601=_0x717b58[_0x56d6d9(0x1b8)](_0x14bde4=>{const _0xd216f6=_0x56d6d9,_0x1bd1f3=a59_0x34c7bd[_0xd216f6(0x27d)]('#'+_0x14bde4['id']),_0x2ff341=hyperlink(_0x1bd1f3,getWorkflowUrl(_0x4f7656,_0x14bde4['id'])),_0x51ec44=_0x14bde4['project']?.[_0xd216f6(0x268)]?a59_0x34c7bd[_0xd216f6(0x27d)]('\x20('+_0x14bde4['project']['name']+')'):'';return _0xd216f6(0x224)+_0x2ff341+'\x20'+_0x14bde4[_0xd216f6(0x268)]+_0x51ec44;});await writeOutput(_0x37c601[_0x56d6d9(0x19d)]('\x0a'),_0x17b559[_0x56d6d9(0x207)],_0x56d6d9(0x2e9));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:sessions';[a59_0x69291(0x134)]=a59_0x69291(0x1d6);async[a59_0x69291(0x2fa)](_0x120fb7){const _0x4eb721=a59_0x69291,{options:_0x6403d9,args:_0x7591b7,tdx:_0x3282c8}=_0x120fb7,_0xa85f02=this[_0x4eb721(0x1a5)](_0x7591b7,_0x6403d9);if(!_0xa85f02)return 0x1;const {projectName:_0x4270d6,workflowName:_0x18c642}=_0xa85f02;if(_0x6403d9[_0x4eb721(0x151)]){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x274)](_0x4eb721(0x21a)+_0x4270d6+'.'+_0x18c642);else _0x4270d6&&console[_0x4eb721(0x274)](_0x4eb721(0x161)+_0x4270d6);const _0x3bc565=_0x6403d9[_0x4eb721(0x21f)];_0x3bc565&&console[_0x4eb721(0x274)](_0x4eb721(0x137)+_0x3bc565);}let _0x34b544=0x28;if(process[_0x4eb721(0x2a5)][_0x4eb721(0x206)]&&!_0x6403d9[_0x4eb721(0x207)]&&!_0x6403d9['format']){const _0x28dfe6=process[_0x4eb721(0x2a5)][_0x4eb721(0x2a8)]||0x28;_0x34b544=Math[_0x4eb721(0x14f)](0x14,Math[_0x4eb721(0x2c1)](_0x28dfe6*0x2/0x3));}const _0xa7b779=_0x6403d9['limit']||_0x34b544,_0x247d09=await withSpinner(_0x4eb721(0x17b),()=>_0x3282c8['workflow']['sessions']({'projectName':_0x4270d6,'workflowName':_0x18c642,'status':_0x6403d9[_0x4eb721(0x21f)],'fromTime':_0x6403d9[_0x4eb721(0x2de)],'toTime':_0x6403d9['to'],'limit':_0xa7b779}),{'verbose':_0x6403d9['verbose']}),_0x419f0b=_0x247d09[_0x4eb721(0x162)];_0x419f0b['sort']((_0xa1b5aa,_0x15db41)=>{const _0x1fe3f2=_0x4eb721,_0x31f7d4=_0xa1b5aa[_0x1fe3f2(0x155)]||'',_0x384003=_0x15db41[_0x1fe3f2(0x155)]||'';return _0x384003['localeCompare'](_0x31f7d4);});_0x419f0b['length']>=_0xa7b779?console['error']('✔\x20Showing\x20'+_0x419f0b[_0x4eb721(0x204)]+_0x4eb721(0x2bc)+a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x2e1))):console['error'](_0x4eb721(0x164)+_0x419f0b['length']+_0x4eb721(0x21d)+(_0x419f0b[_0x4eb721(0x204)]!==0x1?'s':''));if(_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x18b)||_0x6403d9[_0x4eb721(0x2ad)]===_0x4eb721(0x1d8)||_0x6403d9['format']==='table')await handleSDKOutput(_0x419f0b,_0x6403d9);else{if(!process['stdout'][_0x4eb721(0x206)]||_0x6403d9[_0x4eb721(0x207)]){if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console['log'](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console['log'](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else{const _0x4dae33=_0x6403d9[_0x4eb721(0x2bf)],_0x556b2c=this['renderSessionsTimeline'](_0x419f0b,_0x4dae33);_0x6403d9['output']?await writeOutput(_0x556b2c,_0x6403d9['output'],_0x4eb721(0x2e9)):console[_0x4eb721(0x296)](_0x556b2c);}!_0x4270d6&&(console['error'](''),console['error'](a59_0x34c7bd[_0x4eb721(0x27d)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x4eb721(0x274)](a59_0x34c7bd[_0x4eb721(0x27d)](_0x4eb721(0x1ac))+'or'+a59_0x34c7bd[_0x4eb721(0x27d)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x419f0b[_0x4eb721(0x204)]===0x0){if(_0x4270d6&&_0x18c642)console[_0x4eb721(0x296)](_0x4eb721(0x2ce)+_0x4270d6+'.'+_0x18c642);else _0x4270d6?console[_0x4eb721(0x296)](_0x4eb721(0x23c)+_0x4270d6):console[_0x4eb721(0x296)](_0x4eb721(0x190));}else await this[_0x4eb721(0x149)](_0x419f0b,_0x120fb7,_0x4270d6);}}return 0x0;}[a59_0x69291(0x1d9)](_0x12ed45,_0x52dbd8){const _0x7c8158=a59_0x69291,_0x5867e0=[],_0x5cab20=new Map();let _0x2a0012=Infinity,_0x531f0e=-Infinity;for(const _0x1333a1 of _0x12ed45){if(_0x1333a1[_0x7c8158(0x29f)]?.[_0x7c8158(0x1f8)]){const _0x22b382=new Date(_0x1333a1['lastAttempt']['createdAt'])['getTime'](),_0x54f409=_0x1333a1[_0x7c8158(0x29f)][_0x7c8158(0x265)]?new Date(_0x1333a1['lastAttempt'][_0x7c8158(0x265)])[_0x7c8158(0x1b3)]():Date[_0x7c8158(0x14d)](),_0x44fb4f=_0x1333a1[_0x7c8158(0x235)]?.[_0x7c8158(0x268)]||_0x7c8158(0x159);!_0x5cab20[_0x7c8158(0x230)](_0x44fb4f)&&_0x5cab20['set'](_0x44fb4f,[]),_0x5cab20[_0x7c8158(0x248)](_0x44fb4f)['push']({'session':_0x1333a1,'startTime':_0x22b382,'endTime':_0x54f409,'duration':_0x54f409-_0x22b382}),_0x2a0012=Math[_0x7c8158(0x1f9)](_0x2a0012,_0x22b382),_0x531f0e=Math[_0x7c8158(0x14f)](_0x531f0e,_0x54f409);}}if(_0x5cab20[_0x7c8158(0x2dd)]===0x0)return _0x7c8158(0x304);const _0x4f6199=process[_0x7c8158(0x2a5)][_0x7c8158(0x1b9)]||0x78,_0x26b7a9=0x1e,_0x4dfe15=0x32,_0x21ed27=0x4,_0x1e7a6b=Math[_0x7c8158(0x1f9)](_0x4dfe15,Math['max'](_0x26b7a9,Math[_0x7c8158(0x2c1)](_0x4f6199*0.3))),_0x2848f5=_0x4f6199-_0x1e7a6b-TIMELINE_CONFIG['GUTTER']-0x3-_0x21ed27,_0x14e8ce=_0x531f0e-_0x2a0012,_0x4234d1=_0x14e8ce/_0x1e7a6b,_0x65de8a=renderTimeAxis({'startTime':_0x2a0012,'endTime':_0x531f0e,'durationMs':_0x14e8ce,'msPerChar':_0x4234d1},_0x1e7a6b),_0x1492fe=[];for(const _0x33b781 of _0x5cab20[_0x7c8158(0x2eb)]()){_0x1492fe[_0x7c8158(0x2ec)](..._0x33b781);}_0x1492fe[_0x7c8158(0x279)]((_0x4523d9,_0x1f6554)=>_0x1f6554[_0x7c8158(0x153)]-_0x4523d9[_0x7c8158(0x153)]);const _0x338460=new Date(_0x2a0012),_0x5161f1=formatDate(_0x338460),_0x3ef842=_0x21ed27+TIMELINE_CONFIG[_0x7c8158(0x2fd)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2848f5,_0x34b763='\x20'['repeat'](_0x3ef842-_0x5161f1[_0x7c8158(0x204)]),_0x2bf568=_0x34b763+a59_0x34c7bd['dim'](_0x5161f1)+'\x20'+_0x65de8a;_0x5867e0[_0x7c8158(0x2ec)](_0x2bf568);const _0x238aed=0x16;let _0x61af2c=0x0;for(const _0x4c4d2b of _0x1492fe){const _0xe9c4e2=_0x4c4d2b[_0x7c8158(0x28a)]['project']?.[_0x7c8158(0x268)]||'?',_0x497d34=Math[_0x7c8158(0x1f9)](stringWidth(_0xe9c4e2),_0x238aed);_0x61af2c=Math['max'](_0x61af2c,_0x497d34);}for(const _0x426fa7 of _0x1492fe){const {session:_0x5ac445,startTime:_0x1e5361,endTime:_0x21afce,duration:_0x3a6b13}=_0x426fa7,_0x5b98a6=_0x5ac445[_0x7c8158(0x235)]?.['id'],_0x23e355=_0x5ac445['id'],_0x22176b=_0x5ac445[_0x7c8158(0x235)]?.['name']||'?',_0x4c4ba0=_0x5ac445[_0x7c8158(0x19a)]?.['name']||'?';let _0x186c2d,_0x3af3ae;if(_0x5ac445[_0x7c8158(0x29f)]){const _0x5256f0=_0x5ac445[_0x7c8158(0x29f)];!_0x5256f0[_0x7c8158(0x28b)]?(_0x186c2d=_0x5256f0[_0x7c8158(0x266)]?'🛑':'🔄',_0x3af3ae=_0x5256f0[_0x7c8158(0x266)]?a59_0x34c7bd[_0x7c8158(0x196)]:a59_0x34c7bd['blue']):(_0x186c2d=_0x5256f0['success']?'✅':'❌',_0x3af3ae=_0x5256f0[_0x7c8158(0x210)]?a59_0x34c7bd[_0x7c8158(0x2d5)]:a59_0x34c7bd['red']);}else _0x186c2d='⏳',_0x3af3ae=a59_0x34c7bd[_0x7c8158(0x27d)];const _0x2ae64b='#'+_0x23e355,_0x2c7599=_0x5b98a6?hyperlink(_0x2ae64b,getWorkflowSessionUrl(_0x52dbd8,_0x5b98a6,_0x23e355)):_0x2ae64b;let _0x5f4bb3=_0x22176b;stringWidth(_0x22176b)>_0x238aed&&(_0x5f4bb3=_0x22176b[_0x7c8158(0x2ee)](0x0,_0x238aed-0x1)+'…');const _0x168494=a59_0x34c7bd[_0x7c8158(0x27d)](_0x5f4bb3),_0x4651cf=stringWidth(_0x5f4bb3),_0x57eb11='\x20'[_0x7c8158(0x181)](_0x61af2c-stringWidth(_0x5f4bb3)+0x2),_0x1171c4='('+formatElapsed(_0x3a6b13)+')',_0x3a1859=stringWidth(_0x1171c4),_0x246512=stringWidth(_0x2ae64b),_0x24f3db=_0x246512+0x1+_0x4651cf+_0x57eb11['length'],_0x2ea2fd=_0x2848f5-_0x24f3db-_0x3a1859-0x1-0x8;let _0x1350e9=_0x4c4ba0;stringWidth(_0x1350e9)>_0x2ea2fd&&(_0x1350e9=_0x1350e9[_0x7c8158(0x2ee)](0x0,_0x2ea2fd-0x1)+'…');const _0x551014=_0x2c7599+'\x20'+_0x168494+_0x57eb11+_0x1350e9,_0x5c1b3b=stringWidth(_0x551014),_0x28751b=_0x2848f5-_0x5c1b3b-_0x3a1859,_0x537ac7=_0x551014+'\x20'[_0x7c8158(0x181)](Math[_0x7c8158(0x14f)](0x1,_0x28751b))+a59_0x34c7bd[_0x7c8158(0x27d)](_0x1171c4),_0x45d8d2=Math[_0x7c8158(0x2c1)]((_0x1e5361-_0x2a0012)/_0x4234d1),_0xea4ea6=Math['floor']((_0x21afce-_0x2a0012)/_0x4234d1),_0x413d04=Math[_0x7c8158(0x14f)](_0x45d8d2+0x1,_0xea4ea6),_0x40f7b1=new Array(_0x1e7a6b)[_0x7c8158(0x1e6)]('\x20');for(let _0x16de9c=_0x45d8d2;_0x16de9c<Math['min'](_0x413d04,_0x1e7a6b);_0x16de9c++){_0x40f7b1[_0x16de9c]='─';}const _0x4658c2=_0x40f7b1[_0x7c8158(0x1b8)](_0x119083=>_0x119083==='\x20'?'\x20':_0x3af3ae(_0x119083))['join']('');_0x5867e0['push'](_0x186c2d+'\x20'+_0x537ac7+'│'+_0x4658c2+'│');}return _0x5867e0[_0x7c8158(0x19d)]('\x0a');}async[a59_0x69291(0x149)](_0x186196,_0x3a17d1,_0xfecb4f){const _0x115946=a59_0x69291,{options:_0x425f2a,tdx:_0x3e3c4c}=_0x3a17d1,_0x4ac038=_0x425f2a[_0x115946(0x2bf)],{timelineRows:_0x561775,timeAxisHeader:_0x2c25c3}=this[_0x115946(0x2f1)](_0x186196,_0x4ac038),_0x36b517=_0x561775[_0x115946(0x1b7)](_0x30d964=>_0x30d964[_0x115946(0x21b)]);if(_0x36b517[_0x115946(0x204)]===0x0){const _0x379473=this[_0x115946(0x1d9)](_0x186196,_0x4ac038);console[_0x115946(0x296)](_0x379473);!_0xfecb4f&&(console[_0x115946(0x274)](''),console['error'](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2c7))),console[_0x115946(0x274)](a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x1ac))+'or'+a59_0x34c7bd[_0x115946(0x27d)](_0x115946(0x2d9))));return;}_0x2c25c3&&console[_0x115946(0x296)](_0x2c25c3);const _0x54f1bc=_0x561775[_0x115946(0x1b7)](_0x11f85c=>_0x11f85c['attemptId'])[_0x115946(0x1b8)](_0x4cddf0=>({'title':_0x4cddf0[_0x115946(0x240)],'value':_0x4cddf0[_0x115946(0x21b)]})),_0x141118=process[_0x115946(0x2a5)][_0x115946(0x2a8)]||0x3c,_0x182ae0=Math[_0x115946(0x14f)](0x28,Math[_0x115946(0x2c1)](_0x141118*0x2/0x3)),_0x216bc2=await a59_0x3da1fb({'type':_0x115946(0x29a),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x54f1bc,'initial':-0x1,'limit':_0x182ae0,'clearFirst':!![],'fallback':{'title':_0x115946(0x26f),'value':null},'suggest':(_0x594b1f,_0x2df09b)=>{const _0x2ddd8f=_0x115946;if(!_0x594b1f)return Promise['resolve'](_0x2df09b);const _0x4ca5f3=_0x2df09b[_0x2ddd8f(0x1b7)](_0x78a9d2=>{const _0x4019d0=_0x2ddd8f,_0x24b646=_0x78a9d2;return _0x24b646[_0x4019d0(0x222)][_0x4019d0(0x231)]()[_0x4019d0(0x302)](_0x594b1f['toLowerCase']());});return Promise['resolve'](_0x4ca5f3);}}),_0x4f310a=()=>{const _0x204ea7=_0x115946;process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K'),process[_0x204ea7(0x2a5)][_0x204ea7(0x29c)]('\x1b[1A\x1b[2K');},_0xd0db53=_0x216bc2&&_0x216bc2[_0x115946(0x21b)]&&_0x216bc2['attemptId']!==null&&_0x216bc2[_0x115946(0x21b)][_0x115946(0x202)]()!=='';if(!_0xd0db53){_0x4f310a(),console[_0x115946(0x296)](a59_0x34c7bd['dim'](_0x115946(0x292)));return;}_0x4f310a();const _0x4a876a=_0x186196[_0x115946(0x172)](_0x5a05b0=>_0x5a05b0[_0x115946(0x29f)]?.['id']===_0x216bc2[_0x115946(0x21b)]);if(_0x4a876a){const _0x2cb05d=_0x4a876a[_0x115946(0x235)]?.[_0x115946(0x268)]||'?',_0x3c6f0c=_0x4a876a[_0x115946(0x19a)]?.[_0x115946(0x268)]||'?';console['log']('Project:\x20'+a59_0x34c7bd[_0x115946(0x27d)](_0x2cb05d)+_0x115946(0x189)+a59_0x34c7bd['dim'](_0x3c6f0c));}const _0x28c75a=new WorkflowTimelineCommand();await _0x28c75a['execute']({'args':[],'options':{..._0x425f2a,'attemptId':_0x216bc2['attemptId']},'tdx':_0x3e3c4c});}[a59_0x69291(0x2f1)](_0x2469a4,_0x1e6965){const _0x44a4b4=a59_0x69291,_0x2c67cd=new Map();for(const _0x80f831 of _0x2469a4){_0x80f831['id']&&_0x80f831[_0x44a4b4(0x29f)]?.['id']&&_0x2c67cd[_0x44a4b4(0x1d0)](_0x80f831['id'],_0x80f831['lastAttempt']['id']);}const _0x5225be=[];let _0x46b889='';const _0x218815=this[_0x44a4b4(0x1d9)](_0x2469a4,_0x1e6965),_0x5512ae=_0x218815[_0x44a4b4(0x1cc)]('\x0a');for(const _0x420db3 of _0x5512ae){if(_0x420db3[_0x44a4b4(0x22e)](_0x44a4b4(0x1ff))||_0x420db3[_0x44a4b4(0x1f4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x46b889=_0x420db3;else{if(_0x420db3[_0x44a4b4(0x1f4)](/^[✅❌🔄🛑⏳]/)){const _0x2879d1=_0x420db3[_0x44a4b4(0x1f4)](/#(\d+)/),_0xd5d4a0=_0x2879d1?_0x2879d1[0x1]:null,_0x1c4ff5=_0xd5d4a0?_0x2c67cd[_0x44a4b4(0x248)](_0xd5d4a0)||null:null,_0x377a4b=_0x2469a4['find'](_0x23903c=>_0x23903c['id']===_0xd5d4a0),_0x2114f6=_0x377a4b?.[_0x44a4b4(0x235)]?.[_0x44a4b4(0x268)]||'';_0x5225be[_0x44a4b4(0x2ec)]({'displayLine':_0x420db3,'attemptId':_0x1c4ff5,'projectName':_0x2114f6});}}}return{'timelineRows':_0x5225be,'timeAxisHeader':_0x46b889};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1ad);[a59_0x69291(0x134)]=a59_0x69291(0x2a1);async['execute'](_0x1c603c){const _0x17eb7d=a59_0x69291,{options:_0xda1e62,args:_0x312f06,tdx:_0x5658c1}=_0x1c603c,_0x194e2d=this[_0x17eb7d(0x1a5)](_0x312f06,_0xda1e62);if(!_0x194e2d)return 0x1;const {projectName:_0x46f5ba,workflowName:_0x56ede6}=_0x194e2d,_0x32c2b2=_0xda1e62[_0x17eb7d(0x1e5)];if(_0xda1e62[_0x17eb7d(0x151)]){if(_0x46f5ba&&_0x56ede6)console[_0x17eb7d(0x274)](_0x17eb7d(0x21a)+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba&&console[_0x17eb7d(0x274)](_0x17eb7d(0x161)+_0x46f5ba);_0x32c2b2&&console[_0x17eb7d(0x274)](_0x17eb7d(0x14e));}const _0x546b5d=await withSpinner(_0x17eb7d(0x1fa),()=>_0x5658c1[_0x17eb7d(0x19a)]['attempts']({'projectName':_0x46f5ba,'workflowName':_0x56ede6,'includeRetried':_0x32c2b2,'limit':_0xda1e62['limit']}),{'verbose':_0xda1e62[_0x17eb7d(0x151)]}),_0x2d7a59=_0x546b5d[_0x17eb7d(0x162)],_0x17aedd=_0xda1e62[_0x17eb7d(0x2db)]||0x64,_0x4caeb8=_0x2d7a59[_0x17eb7d(0x204)]>=_0x17aedd?a59_0x34c7bd[_0x17eb7d(0x27d)](_0x17eb7d(0x188)):'';console[_0x17eb7d(0x274)](_0x17eb7d(0x164)+_0x2d7a59[_0x17eb7d(0x204)]+_0x17eb7d(0x244)+(_0x2d7a59[_0x17eb7d(0x204)]!==0x1?'s':'')+_0x4caeb8);if(_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x18b)||_0xda1e62[_0x17eb7d(0x2ad)]==='jsonl'||_0xda1e62[_0x17eb7d(0x2ad)]===_0x17eb7d(0x1dd))await handleSDKOutput(_0x2d7a59,_0xda1e62);else{if(_0x2d7a59[_0x17eb7d(0x204)]===0x0){if(_0x46f5ba&&_0x56ede6)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x46f5ba+'.'+_0x56ede6);else _0x46f5ba?console[_0x17eb7d(0x296)](_0x17eb7d(0x21c)+_0x46f5ba):console[_0x17eb7d(0x296)](_0x17eb7d(0x170));}else{const _0x40b79a=_0xda1e62[_0x17eb7d(0x2bf)],_0x55ece2=_0x2d7a59[_0x17eb7d(0x1b8)](_0x4c0891=>{const _0x204f0d=_0x17eb7d,_0x39bd00=a59_0x34c7bd['dim']('#'+_0x4c0891['id']),_0x5c7d95=_0x4c0891[_0x204f0d(0x235)]?.['id'],_0x5312ba=_0x4c0891[_0x204f0d(0x2e2)]||_0x4c0891[_0x204f0d(0x220)],_0x3a8fe1=_0x5c7d95&&_0x5312ba?hyperlink(_0x39bd00,getWorkflowAttemptUrl(_0x40b79a,_0x5c7d95,_0x5312ba,_0x4c0891['id'])):_0x39bd00,{icon:_0x1a2f66,text:_0x5e8c3c}=getAttemptStatusDisplay(_0x4c0891),_0x43146f=(_0x4c0891[_0x204f0d(0x235)]?.['name']||'?')+'.'+(_0x4c0891[_0x204f0d(0x19a)]?.['name']||'?'),_0x5c312b=_0x4c0891[_0x204f0d(0x155)]?a59_0x34c7bd['dim'](_0x4c0891[_0x204f0d(0x155)]):'';return(_0x3a8fe1+'\x20'+_0x1a2f66+(_0x5e8c3c?'\x20'+_0x5e8c3c:'')+'\x20'+_0x43146f+'\x20'+_0x5c312b)['trimEnd']();});await writeOutput(_0x55ece2[_0x17eb7d(0x19d)]('\x0a'),_0xda1e62['output'],_0x17eb7d(0x2e9));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{['name']=a59_0x69291(0x183);[a59_0x69291(0x134)]=a59_0x69291(0x1c6);async[a59_0x69291(0x2fa)](_0x2b47bb){const _0x5c9271=a59_0x69291,{options:_0x3b05e5,args:_0x4850b0,tdx:_0x369a8e}=_0x2b47bb,_0x291cf0=_0x4850b0[0x0];if(!_0x291cf0)return console[_0x5c9271(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3b05e5['verbose']&&console[_0x5c9271(0x274)](_0x5c9271(0x270)+_0x291cf0);const _0x4a9c7f=await withSpinner('Getting\x20attempt\x20details...',()=>_0x369a8e[_0x5c9271(0x19a)]['attempt'](_0x291cf0),{'verbose':_0x3b05e5[_0x5c9271(0x151)]}),_0xf3e84d=_0x4a9c7f[_0x5c9271(0x162)];let _0x57bb96;!_0xf3e84d[_0x5c9271(0x28b)]?_0x57bb96=_0xf3e84d['cancelRequested']?_0x5c9271(0x173):_0x5c9271(0x152):_0x57bb96=_0xf3e84d[_0x5c9271(0x210)]?_0x5c9271(0x210):_0x5c9271(0x274);let _0x43e041;if(_0xf3e84d[_0x5c9271(0x1f8)]&&_0xf3e84d[_0x5c9271(0x265)]){const _0x5f1d21=new Date(_0xf3e84d[_0x5c9271(0x1f8)])[_0x5c9271(0x1b3)](),_0x62f98=new Date(_0xf3e84d[_0x5c9271(0x265)])[_0x5c9271(0x1b3)]();_0x43e041=Math[_0x5c9271(0x13a)]((_0x62f98-_0x5f1d21)/0x3e8);}const _0x47849a={'attempt_id':_0xf3e84d['id'],'status':_0x57bb96,..._0xf3e84d[_0x5c9271(0x1f7)]!==undefined&&{'index':_0xf3e84d[_0x5c9271(0x1f7)]},..._0xf3e84d[_0x5c9271(0x235)]&&{'project':_0xf3e84d[_0x5c9271(0x235)][_0x5c9271(0x268)]},..._0xf3e84d[_0x5c9271(0x19a)]&&{'workflow':_0xf3e84d[_0x5c9271(0x19a)]['name']},..._0xf3e84d[_0x5c9271(0x220)]&&{'session_id':_0xf3e84d[_0x5c9271(0x220)]},..._0xf3e84d[_0x5c9271(0x155)]&&{'session_time':_0xf3e84d['sessionTime']},..._0xf3e84d[_0x5c9271(0x1a2)]&&{'retry_attempt':_0xf3e84d[_0x5c9271(0x1a2)]},..._0x43e041!==undefined&&{'duration_sec':_0x43e041},..._0xf3e84d[_0x5c9271(0x1f8)]&&{'created_at':_0xf3e84d['createdAt']},..._0xf3e84d['finishedAt']&&{'finished_at':_0xf3e84d[_0x5c9271(0x265)]},...Object['keys'](_0xf3e84d[_0x5c9271(0x25d)])[_0x5c9271(0x204)]>0x0&&{'params':_0xf3e84d[_0x5c9271(0x25d)]}};return await handleSingleObjectOutput(_0x47849a,_0x3b05e5),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x27e);['description']=a59_0x69291(0x2ae);async['execute'](_0x24081d){const _0x4576f8=a59_0x69291,{options:_0x30be20,args:_0x2b1b0d,tdx:_0x3db675}=_0x24081d,_0x9003da=_0x2b1b0d[0x0];if(!_0x9003da)return console[_0x4576f8(0x274)](_0x4576f8(0x138)),0x1;const _0x97658f=_0x30be20['includeSubtasks'];_0x30be20[_0x4576f8(0x151)]&&(console[_0x4576f8(0x274)](_0x4576f8(0x270)+_0x9003da),_0x97658f&&console['error'](_0x4576f8(0x20b)));const _0x2a574f=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x3db675[_0x4576f8(0x19a)][_0x4576f8(0x184)](_0x9003da,_0x97658f||![]),{'verbose':_0x30be20['verbose']}),_0x3b3f0b=_0x2a574f[_0x4576f8(0x162)];return console[_0x4576f8(0x274)](_0x4576f8(0x164)+_0x3b3f0b['length']+_0x4576f8(0x278)+(_0x3b3f0b[_0x4576f8(0x204)]!==0x1?'s':'')),await handleSDKOutput(_0x3b3f0b,_0x30be20),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x245);[a59_0x69291(0x134)]=a59_0x69291(0x148);async['execute'](_0x203f28){const _0x4f7eaf=a59_0x69291,{options:_0x2a40f2,args:_0x3ce88f,tdx:_0x5c1384}=_0x203f28,_0x5586af=_0x3ce88f[0x0];let _0x405657=_0x3ce88f[0x1];if(!_0x5586af)return console[_0x4f7eaf(0x274)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2a40f2[_0x4f7eaf(0x151)]&&(console[_0x4f7eaf(0x274)]('Attempt\x20ID:\x20'+_0x5586af),_0x405657&&console[_0x4f7eaf(0x274)](_0x4f7eaf(0x166)+_0x405657));const _0x53e3f7=await withSpinner(_0x4f7eaf(0x185),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x24a)](_0x5586af,_0x405657),{'verbose':_0x2a40f2[_0x4f7eaf(0x151)]}),_0x1b08bb=_0x53e3f7[_0x4f7eaf(0x162)];if(_0x1b08bb[_0x4f7eaf(0x204)]===0x0)return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x246)),0x0;if(!_0x405657&&(_0x2a40f2['json']||_0x2a40f2[_0x4f7eaf(0x2ad)]))return await handleSDKOutput(_0x1b08bb,_0x2a40f2),0x0;if(!_0x405657){const _0x50abe8=_0x1b08bb[_0x4f7eaf(0x1b8)](_0x16e344=>({'title':_0x16e344['taskName']+'\x20('+formatBytes(_0x16e344[_0x4f7eaf(0x2b1)])+')','value':_0x16e344[_0x4f7eaf(0x2e4)]})),_0x58106d=await a59_0x3da1fb({'type':'select','name':_0x4f7eaf(0x2fb),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x50abe8});if(!_0x58106d['task'])return console[_0x4f7eaf(0x274)](_0x4f7eaf(0x292)),0x0;_0x405657=_0x58106d['task'];}const _0x549137=await withSpinner(_0x4f7eaf(0x194),()=>_0x5c1384[_0x4f7eaf(0x19a)][_0x4f7eaf(0x2cf)](_0x5586af,_0x405657),{'verbose':_0x2a40f2['verbose']}),_0x515d58=_0x549137[_0x4f7eaf(0x162)];return _0x515d58?console[_0x4f7eaf(0x296)](_0x515d58):console[_0x4f7eaf(0x274)](_0x4f7eaf(0x1a4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1c2);[a59_0x69291(0x134)]=a59_0x69291(0x1de);async[a59_0x69291(0x2fa)](_0x51fcec){const _0x5a9ae0=a59_0x69291,{options:_0x26d4b6,args:_0x48b612,tdx:_0x5e3f43}=_0x51fcec,_0x33a816=_0x48b612[0x0];if(!_0x33a816)return console[_0x5a9ae0(0x274)](_0x5a9ae0(0x138)),0x1;const _0x224db3=_0x26d4b6['reason'];_0x26d4b6['verbose']&&(console['error'](_0x5a9ae0(0x270)+_0x33a816),_0x224db3&&console['error']('Reason:\x20'+_0x224db3));if(!_0x26d4b6[_0x5a9ae0(0x1ae)]){if(!isInteractive())return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x2f8)](_0x5a9ae0(0x2f6)),_0x5a9ae0(0x2d1)),console[_0x5a9ae0(0x274)](a59_0x34c7bd['dim'](_0x5a9ae0(0x275))),0x1;const _0x52414b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x33a816+'?');if(!_0x52414b)return console[_0x5a9ae0(0x274)](a59_0x34c7bd[_0x5a9ae0(0x196)](_0x5a9ae0(0x292))),0x1;}const _0x332042=await withSpinner(_0x5a9ae0(0x199),()=>_0x5e3f43[_0x5a9ae0(0x19a)][_0x5a9ae0(0x234)](_0x33a816,_0x224db3),{'verbose':_0x26d4b6['verbose']}),_0x58d284=_0x332042[_0x5a9ae0(0x162)];return console[_0x5a9ae0(0x274)]('✔\x20'+_0x58d284),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1be);[a59_0x69291(0x134)]=a59_0x69291(0x1ea);async[a59_0x69291(0x2fa)](_0xda9ee1){const _0x21f8cf=a59_0x69291,{options:_0x55a961,args:_0x1b64f4,tdx:_0x42dbd7}=_0xda9ee1,_0x140332=_0x1b64f4[0x0];if(!_0x140332)return console[_0x21f8cf(0x274)](_0x21f8cf(0x2a7)),console[_0x21f8cf(0x274)](_0x21f8cf(0x2d0)),0x1;let _0x1f7e81=![],_0x32a09f=_0x140332;if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x193)))_0x1f7e81=!![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else{if(_0x140332[_0x21f8cf(0x22e)](_0x21f8cf(0x2df)))_0x1f7e81=![],_0x32a09f=_0x140332[_0x21f8cf(0x1a3)](0x8);else return console[_0x21f8cf(0x274)](_0x21f8cf(0x27f)),console[_0x21f8cf(0x274)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x264557=_0x55a961[_0x21f8cf(0x1b1)],_0x2964eb=_0x55a961[_0x21f8cf(0x175)],_0x49f4a9=_0x55a961[_0x21f8cf(0x25d)],_0x59fd10=_0x55a961[_0x21f8cf(0x180)];_0x55a961[_0x21f8cf(0x151)]&&(console[_0x21f8cf(0x274)](_0x21f8cf(0x1ef)+(_0x1f7e81?_0x21f8cf(0x28a):'attempt')+'\x20'+_0x32a09f),_0x264557&&console[_0x21f8cf(0x274)]('From\x20task:\x20'+_0x264557),_0x2964eb&&console['error'](_0x21f8cf(0x16f)+_0x2964eb),_0x49f4a9&&console[_0x21f8cf(0x274)](_0x21f8cf(0x250)+_0x49f4a9),_0x59fd10&&console[_0x21f8cf(0x274)](_0x21f8cf(0x168)));let _0x2dcc51;if(_0x49f4a9)try{if(_0x49f4a9['startsWith']('@')){const _0x4f230d=await import(_0x21f8cf(0x131)),_0x4664dc=_0x49f4a9[_0x21f8cf(0x1a3)](0x1),_0x39b821=await _0x4f230d[_0x21f8cf(0x285)](_0x4664dc,_0x21f8cf(0x1ca));_0x2dcc51=JSON['parse'](_0x39b821);}else _0x2dcc51=JSON[_0x21f8cf(0x233)](_0x49f4a9);}catch{return console[_0x21f8cf(0x274)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x55a961['yes']){if(!isInteractive())return console[_0x21f8cf(0x274)](a59_0x34c7bd['red'](_0x21f8cf(0x2f6)),_0x21f8cf(0x2d1)),console['error'](a59_0x34c7bd[_0x21f8cf(0x27d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x517e0c=await confirmKey(_0x21f8cf(0x2a4)+(_0x1f7e81?_0x21f8cf(0x28a):_0x21f8cf(0x217))+'\x20'+_0x32a09f+'?');if(!_0x517e0c)return console[_0x21f8cf(0x274)](a59_0x34c7bd[_0x21f8cf(0x196)](_0x21f8cf(0x292))),0x1;}let _0x523f43;_0x1f7e81?_0x523f43=await withSpinner(_0x21f8cf(0x28e),()=>_0x42dbd7[_0x21f8cf(0x19a)][_0x21f8cf(0x200)](_0x32a09f,{'fromTask':_0x264557,'retryParams':_0x2dcc51}),{'verbose':_0x55a961[_0x21f8cf(0x151)]}):_0x523f43=await withSpinner(_0x21f8cf(0x218),()=>_0x42dbd7['workflow']['retryAttempt'](_0x32a09f,{'resumeFrom':_0x2964eb,'retryParams':_0x2dcc51,'force':_0x59fd10}),{'verbose':_0x55a961[_0x21f8cf(0x151)]});const _0x619a60=_0x523f43[_0x21f8cf(0x162)];return console[_0x21f8cf(0x274)](_0x21f8cf(0x24c)),console[_0x21f8cf(0x274)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x619a60['attemptId']),console['error'](_0x21f8cf(0x191)+_0x619a60['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]='workflow:run';[a59_0x69291(0x134)]='Start\x20a\x20workflow\x20run';async[a59_0x69291(0x2fa)](_0x5b7fa0){const _0x30b8fb=a59_0x69291,{options:_0x3bd086,args:_0x5bf2f9,tdx:_0x490dd2}=_0x5b7fa0;let _0x9f1e32=_0x5bf2f9[0x0];if(!_0x9f1e32){const _0x3e7ea4=this[_0x30b8fb(0x1f1)]([],_0x3bd086),_0x23171e=await withSpinner(_0x30b8fb(0x139),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x1cb)](_0x3e7ea4,{'limit':_0x3bd086[_0x30b8fb(0x2db)]}),{'verbose':_0x3bd086[_0x30b8fb(0x151)]}),_0x153303=_0x23171e['data'];if(_0x153303[_0x30b8fb(0x204)]===0x0)return console[_0x30b8fb(0x274)](_0x30b8fb(0x282)),!_0x3e7ea4&&console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;const _0xa30fb1=_0x153303[_0x30b8fb(0x1b8)](_0x5915f0=>({'title':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'value':_0x5915f0[_0x30b8fb(0x235)]?.[_0x30b8fb(0x268)]+'.'+_0x5915f0[_0x30b8fb(0x268)],'description':_0x5915f0['revision']?_0x30b8fb(0x187)+_0x5915f0[_0x30b8fb(0x1db)]:undefined})),_0xd57187=await a59_0x3da1fb({'type':'select','name':_0x30b8fb(0x19a),'message':_0x30b8fb(0x228),'choices':_0xa30fb1});if(!_0xd57187[_0x30b8fb(0x19a)])return 0x1;_0x9f1e32=_0xd57187['workflow'];}if(!_0x9f1e32[_0x30b8fb(0x302)]('.')){const _0x48123d=this[_0x30b8fb(0x1f1)]([],_0x3bd086);if(_0x48123d)_0x9f1e32=_0x48123d+'.'+_0x9f1e32;else return console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x2f8)](_0x30b8fb(0x287)),_0x30b8fb(0x23f)),console[_0x30b8fb(0x274)](a59_0x34c7bd[_0x30b8fb(0x27d)](_0x30b8fb(0x298))),0x1;}const _0x550940=_0x3bd086[_0x30b8fb(0x1a7)],_0x2046ff=_0x3bd086[_0x30b8fb(0x155)],_0x279fd5={};if(_0x550940&&Array['isArray'](_0x550940))for(const _0x4c0353 of _0x550940){const _0x13074e=_0x4c0353[_0x30b8fb(0x295)]('=');if(_0x13074e===-0x1)return console[_0x30b8fb(0x274)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4c0353),console[_0x30b8fb(0x274)](_0x30b8fb(0x277)),0x1;const _0x4cd327=_0x4c0353[_0x30b8fb(0x1a3)](0x0,_0x13074e),_0x48ab3b=_0x4c0353[_0x30b8fb(0x1a3)](_0x13074e+0x1);try{_0x279fd5[_0x4cd327]=JSON[_0x30b8fb(0x233)](_0x48ab3b);}catch{_0x279fd5[_0x4cd327]=_0x48ab3b;}}_0x3bd086[_0x30b8fb(0x151)]&&(console[_0x30b8fb(0x274)](_0x30b8fb(0x280)+_0x9f1e32),Object[_0x30b8fb(0x20a)](_0x279fd5)['length']>0x0&&console[_0x30b8fb(0x274)]('Parameters:\x20'+JSON[_0x30b8fb(0x288)](_0x279fd5)),_0x2046ff&&console[_0x30b8fb(0x274)](_0x30b8fb(0x1d5)+_0x2046ff));if(_0x3bd086[_0x30b8fb(0x255)])return await this[_0x30b8fb(0x2b8)](_0x5b7fa0,_0x9f1e32,_0x279fd5,_0x2046ff);const _0x3095e3=await withSpinner(_0x30b8fb(0x242),()=>_0x490dd2[_0x30b8fb(0x19a)][_0x30b8fb(0x2b7)](_0x9f1e32,_0x279fd5,{'sessionTime':_0x2046ff}),{'verbose':_0x3bd086['verbose']}),_0x114109=_0x3095e3[_0x30b8fb(0x162)];console[_0x30b8fb(0x274)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x30b8fb(0x215)+_0x114109['id']),console[_0x30b8fb(0x274)](_0x30b8fb(0x191)+_0x114109[_0x30b8fb(0x220)]),console[_0x30b8fb(0x274)](_0x30b8fb(0x223)+_0x114109[_0x30b8fb(0x235)]?.['name']),console[_0x30b8fb(0x274)](_0x30b8fb(0x2cd)+_0x114109[_0x30b8fb(0x19a)]?.[_0x30b8fb(0x268)]);if(_0x114109[_0x30b8fb(0x235)]?.['id']&&_0x114109['sessionId']&&_0x114109['id']){const _0x57e565=_0x3bd086[_0x30b8fb(0x2bf)],_0x2a4bd0=getConsoleUrl(_0x57e565,'/app/workflows/'+_0x114109[_0x30b8fb(0x235)]['id']+_0x30b8fb(0x146)+_0x114109[_0x30b8fb(0x220)]+'/attempt/'+_0x114109['id']);console[_0x30b8fb(0x274)](_0x30b8fb(0x13d)+a59_0x34c7bd['cyan'](_0x2a4bd0));}return 0x0;}async[a59_0x69291(0x2b8)](_0x14af8c,_0x579615,_0x53a96a,_0xa42084){const _0x1616fd=a59_0x69291,{options:_0xb6ed3c,tdx:_0x3780ed}=_0x14af8c,_0x5602d4=await withSpinner('Fetching\x20workflow\x20'+_0x579615+'...',()=>_0x3780ed[_0x1616fd(0x19a)][_0x1616fd(0x2af)](_0x579615),{'verbose':_0xb6ed3c['verbose']}),_0x1de57e=_0x5602d4[_0x1616fd(0x162)],_0x2a3783=_0xa42084??new Date()[_0x1616fd(0x1bb)]();console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1df)),_0x579615),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x1fe)),_0x2a3783),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)]('Parameters:'),JSON['stringify'](_0x53a96a)),console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x1d1)](_0x1616fd(0x2d6)));const _0x2d37d7=parseTaskGraph(_0x1de57e[_0x1616fd(0x176)]??null);if(_0x2d37d7[_0x1616fd(0x204)]===0x0)console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x27d)](_0x1616fd(0x2cc)));else for(const _0x17c5ba of formatTaskGraph(_0x2d37d7)){console[_0x1616fd(0x296)](_0x17c5ba);}const _0x4d7af6=summarizeTaskGraph(_0x2d37d7),_0x49dd78=formatWarningSummary(_0x4d7af6);return _0x49dd78&&(console['log'](''),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x49dd78))),console[_0x1616fd(0x296)](a59_0x34c7bd[_0x1616fd(0x196)](_0x1616fd(0x212))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x254);[a59_0x69291(0x134)]=a59_0x69291(0x27b);async['execute'](_0x4403b5){const _0x26be27=a59_0x69291,{options:_0x31aafe,args:_0x55b208,tdx:_0x462c47}=_0x4403b5,_0x1ad2de=_0x55b208[0x0],_0x3b2745=_0x55b208[0x1]||'.';if(!_0x1ad2de)return console['error'](_0x26be27(0x261)),console[_0x26be27(0x274)](_0x26be27(0x22f)),0x1;const _0x486ab4=_0x31aafe[_0x26be27(0x1db)];_0x31aafe[_0x26be27(0x151)]&&(console['error']('Project:\x20'+_0x1ad2de),console[_0x26be27(0x274)](_0x26be27(0x1b2)+_0x3b2745),_0x486ab4&&console[_0x26be27(0x274)]('Revision:\x20'+_0x486ab4));const _0xdb24ea=await withSpinner(_0x26be27(0x165)+_0x1ad2de+_0x26be27(0x1c3),()=>_0x462c47[_0x26be27(0x19a)][_0x26be27(0x177)](_0x1ad2de,_0x3b2745,{'revision':_0x486ab4}),{'verbose':_0x31aafe[_0x26be27(0x151)]}),_0x221eba=_0xdb24ea[_0x26be27(0x162)];return console[_0x26be27(0x274)](_0x26be27(0x1bd)+_0x221eba[_0x26be27(0x26c)]),console[_0x26be27(0x274)]('\x20\x20Revision:\x20'+_0x221eba[_0x26be27(0x1db)]),console['error']('\x20\x20Files\x20extracted:\x20'+_0x221eba['filesExtracted']),console['error'](_0x26be27(0x209)+_0x3b2745+'/'+_0x221eba[_0x26be27(0x26c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x1a6);[a59_0x69291(0x134)]=a59_0x69291(0x186);async[a59_0x69291(0x2fa)](_0x4b3dad){const _0x178120=a59_0x69291,{options:_0x21268a,args:_0x38fe96,tdx:_0x18acf1}=_0x4b3dad;let _0x1f53dd='.',_0x187c37=_0x21268a[_0x178120(0x268)];if(_0x38fe96[0x0]){const {promises:_0x2ad5d0}=await import('fs');try{const _0x5ec94a=await _0x2ad5d0['stat'](_0x38fe96[0x0]);if(_0x5ec94a['isDirectory']())_0x1f53dd=_0x38fe96[0x0];else return console[_0x178120(0x274)](_0x178120(0x2b4)+_0x38fe96[0x0]+_0x178120(0x2d8)),0x1;}catch{_0x187c37=_0x38fe96[0x0],_0x1f53dd='.';}}const _0x55cb65=_0x21268a[_0x178120(0x1db)],_0xb85ec9=_0x21268a[_0x178120(0x2aa)];_0x21268a[_0x178120(0x151)]&&(console['error'](_0x178120(0x198)+_0x1f53dd),_0x187c37&&console[_0x178120(0x274)](_0x178120(0x23a)+_0x187c37),_0x55cb65&&console[_0x178120(0x274)](_0x178120(0x216)+_0x55cb65),_0xb85ec9&&console[_0x178120(0x274)]('Validation:\x20skipped'));const _0x325f28=await withSpinner(_0x178120(0x24e),()=>_0x18acf1['workflow']['push'](_0x1f53dd,{'projectName':_0x187c37,'revision':_0x55cb65,'skipValidation':_0xb85ec9}),{'verbose':_0x21268a['verbose']}),_0x28e595=_0x325f28['data'];return console['error'](_0x178120(0x2fe)+_0x28e595[_0x178120(0x26c)]),console[_0x178120(0x274)](_0x178120(0x1bc)+_0x28e595[_0x178120(0x2c2)]),console['error'](_0x178120(0x1e4)+_0x28e595[_0x178120(0x1db)]),await this['showWorkflowConsoleUrl'](_0x18acf1,_0x28e595[_0x178120(0x26c)],_0x21268a[_0x178120(0x2bf)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x201);[a59_0x69291(0x134)]=a59_0x69291(0x16b);async[a59_0x69291(0x2fa)](_0x4eeccb){const _0x51416f=a59_0x69291,{options:_0x28637d,args:_0x4179ba,tdx:_0x212ca3}=_0x4eeccb,_0x52e0ae=_0x4179ba[0x0],_0x2cbe84=_0x4179ba[0x1];if(!_0x52e0ae)return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x287)),_0x51416f(0x2be)),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x15a))),0x1;const _0x585cb9=_0x28637d[_0x51416f(0x1db)];_0x28637d[_0x51416f(0x151)]&&(console[_0x51416f(0x274)](_0x51416f(0x17e)+_0x52e0ae),_0x2cbe84&&console[_0x51416f(0x274)](_0x51416f(0x29b)+_0x2cbe84),_0x585cb9&&console[_0x51416f(0x274)](_0x51416f(0x216)+_0x585cb9),_0x28637d[_0x51416f(0x255)]&&console[_0x51416f(0x274)]('Dry\x20run:\x20yes'));const _0x3095f8=await withSpinner('Pulling\x20project\x20'+_0x52e0ae+_0x51416f(0x1c3),()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x130)](_0x52e0ae,{'targetDir':_0x2cbe84,'revision':_0x585cb9}),{'verbose':_0x28637d['verbose']}),_0x4162c8=_0x3095f8[_0x51416f(0x162)];_0x4162c8[_0x51416f(0x301)]?console[_0x51416f(0x274)](_0x51416f(0x276)+_0x4162c8[_0x51416f(0x26c)]):console[_0x51416f(0x274)]('→\x20Project:\x20'+_0x4162c8['projectName']);console[_0x51416f(0x274)](_0x51416f(0x1e4)+_0x4162c8['revision']),console['error'](_0x51416f(0x25a)+(a59_0x28ffa6['relative'](process[_0x51416f(0x2e3)](),_0x4162c8[_0x51416f(0x1e1)])||'.')),console['error']('\x20\x20Changes:\x20'+a59_0x34c7bd[_0x51416f(0x2d5)]('+'+_0x4162c8['summary'][_0x51416f(0x267)]+_0x51416f(0x17f))+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4162c8[_0x51416f(0x2c8)]['modified']+_0x51416f(0x12d))+',\x20')+(a59_0x34c7bd[_0x51416f(0x2f8)]('-'+_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x23b)]+'\x20deleted')+',\x20')+(''+a59_0x34c7bd[_0x51416f(0x27d)](_0x4162c8[_0x51416f(0x2c8)][_0x51416f(0x241)]+'\x20unchanged')));for(const _0x59d491 of _0x4162c8[_0x51416f(0x1e8)]){_0x59d491[_0x51416f(0x29d)]===_0x51416f(0x26b)&&_0x59d491[_0x51416f(0x205)]&&(console[_0x51416f(0x274)]('\x0a'+a59_0x34c7bd[_0x51416f(0x251)](_0x51416f(0x1ba)+_0x59d491['path'])),console['error'](_0x59d491['diff']));}if(!_0x4162c8['hasChanges'])return saveSessionContext({'workflow_project':_0x4162c8[_0x51416f(0x26c)]},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x211))),console[_0x51416f(0x274)](a59_0x34c7bd['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x4162c8[_0x51416f(0x26c)])),0x0;if(_0x28637d['dryRun'])return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x24f))),0x0;if(!_0x28637d[_0x51416f(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x51416f(0x2f8)](_0x51416f(0x2f6)),_0x51416f(0x2d1)),console['error'](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x275))),0x1;const _0x501d7a=await confirmKey(_0x51416f(0x18e));if(!_0x501d7a)return console['error'](a59_0x34c7bd[_0x51416f(0x196)](_0x51416f(0x292)),_0x51416f(0x2b3)),0x1;}await withSpinner('Writing\x20files...',()=>_0x212ca3[_0x51416f(0x19a)][_0x51416f(0x25b)](_0x4162c8,{'revision':_0x585cb9}),{'verbose':_0x28637d[_0x51416f(0x151)]}),saveSessionContext({'workflow_project':_0x4162c8['projectName']},_0x28637d['session']),console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x2d5)](_0x51416f(0x2a3)));const _0x4565f5=a59_0x28ffa6[_0x51416f(0x1e0)](process[_0x51416f(0x2e3)](),_0x4162c8['targetDir'])||'.';return console[_0x51416f(0x274)](a59_0x34c7bd[_0x51416f(0x27d)](_0x51416f(0x209)+_0x4565f5)),console[_0x51416f(0x274)](a59_0x34c7bd['dim'](_0x51416f(0x1a0)+_0x4162c8[_0x51416f(0x26c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x272);['description']=a59_0x69291(0x17a);async['execute'](_0x40e182){const _0x4ac6e3=a59_0x69291,{options:_0x2a3134,args:_0x11f908,tdx:_0x4dece6}=_0x40e182,_0x35b8d3=this[_0x4ac6e3(0x1fd)](_0x11f908,_0x2a3134),_0x5925db=_0x2a3134,{revision:_0x3689e1,skipValidation:_0x2c7c64,backfill:_0x5aa654}=_0x5925db,_0x4692ac=_0x5aa654===undefined?undefined:!_0x5aa654;_0x2a3134[_0x4ac6e3(0x151)]&&(_0x35b8d3&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x260)+_0x35b8d3),_0x3689e1&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x216)+_0x3689e1),_0x2a3134[_0x4ac6e3(0x255)]&&console['error']('Dry\x20run:\x20yes'),_0x2c7c64&&console[_0x4ac6e3(0x274)]('Validation:\x20skipped'),_0x5aa654&&console[_0x4ac6e3(0x274)](_0x4ac6e3(0x15c)));let _0x7d3cf4;try{_0x7d3cf4=await withSpinner(_0x4ac6e3(0x1e9),()=>_0x4dece6['workflow'][_0x4ac6e3(0x12f)]({'sourceDir':_0x35b8d3,'revision':_0x3689e1,'skipValidation':_0x2c7c64,'skipSchedule':_0x4692ac}),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]});}catch(_0xa3b52b){if(_0xa3b52b instanceof Error&&_0xa3b52b['message'][_0x4ac6e3(0x302)](_0x4ac6e3(0x2dc)))return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2f8)](_0x4ac6e3(0x287)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x2a3134[_0x4ac6e3(0x19c)]?console['error'](a59_0x34c7bd['dim'](_0x4ac6e3(0x1e7)+_0x2a3134[_0x4ac6e3(0x19c)]+_0x4ac6e3(0x15e)+_0x2a3134[_0x4ac6e3(0x19c)]+'\x27')):console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x2c6))),0x1;throw _0xa3b52b;}const _0x4cd3e5=_0x7d3cf4[_0x4ac6e3(0x162)];console[_0x4ac6e3(0x274)](_0x4ac6e3(0x247)+_0x4cd3e5[_0x4ac6e3(0x26c)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x221)+_0x4cd3e5[_0x4ac6e3(0x213)]),console[_0x4ac6e3(0x274)]('\x20\x20Revision:\x20'+_0x4cd3e5[_0x4ac6e3(0x1db)]),console[_0x4ac6e3(0x274)]('\x20\x20Changes:\x20'+a59_0x34c7bd['green']('+'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x267)]+'\x20new')+',\x20'+(a59_0x34c7bd['yellow']('~'+_0x4cd3e5[_0x4ac6e3(0x2c8)][_0x4ac6e3(0x26b)]+_0x4ac6e3(0x12d))+',\x20')+(a59_0x34c7bd['red']('-'+_0x4cd3e5[_0x4ac6e3(0x2c8)]['deleted']+_0x4ac6e3(0x2bb))+',\x20')+(''+a59_0x34c7bd['dim'](_0x4cd3e5['summary'][_0x4ac6e3(0x241)]+_0x4ac6e3(0x1f0))));for(const _0x57de2f of _0x4cd3e5['changes']){_0x57de2f[_0x4ac6e3(0x29d)]===_0x4ac6e3(0x26b)&&_0x57de2f[_0x4ac6e3(0x205)]&&(console['error']('\x0a'+a59_0x34c7bd[_0x4ac6e3(0x251)](_0x4ac6e3(0x1ba)+_0x57de2f[_0x4ac6e3(0x2f0)])),console[_0x4ac6e3(0x274)](_0x57de2f['diff']));}if(!_0x4cd3e5['hasChanges'])return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x4ac6e3(0x264)](_0x4dece6,_0x4cd3e5[_0x4ac6e3(0x26c)],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;if(_0x2a3134[_0x4ac6e3(0x255)])return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x2a3134['yes']){if(!isInteractive())return console[_0x4ac6e3(0x274)](a59_0x34c7bd['red'](_0x4ac6e3(0x2f6)),_0x4ac6e3(0x2d1)),console['error'](a59_0x34c7bd[_0x4ac6e3(0x27d)](_0x4ac6e3(0x275))),0x1;const _0x2933cc=await confirmKey(_0x4ac6e3(0x1e3));if(!_0x2933cc)return console[_0x4ac6e3(0x274)](a59_0x34c7bd['yellow'](_0x4ac6e3(0x292)),_0x4ac6e3(0x249)),0x1;}const _0x236ea5=await withSpinner(_0x4ac6e3(0x182),()=>_0x4dece6['workflow'][_0x4ac6e3(0x16d)](_0x4cd3e5),{'verbose':_0x2a3134[_0x4ac6e3(0x151)]}),_0x3237a0=_0x236ea5[_0x4ac6e3(0x162)];return console[_0x4ac6e3(0x274)](a59_0x34c7bd[_0x4ac6e3(0x2d5)](_0x4ac6e3(0x273))),console['error'](_0x4ac6e3(0x1bc)+_0x3237a0[_0x4ac6e3(0x2c2)]),console[_0x4ac6e3(0x274)](_0x4ac6e3(0x1e4)+_0x3237a0['revision']),await this['showWorkflowConsoleUrl'](_0x4dece6,_0x3237a0['projectName'],_0x2a3134[_0x4ac6e3(0x2bf)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x2ac);[a59_0x69291(0x134)]=a59_0x69291(0x1c7);async[a59_0x69291(0x2fa)](_0x547fd6){const _0x6a6319=a59_0x69291,{options:_0x53bcd8,args:_0x4fb42a,tdx:_0xce07bd}=_0x547fd6,_0x4768ba=this['resolveProjectDir'](_0x4fb42a,_0x53bcd8),_0x2f96f6=_0x53bcd8['name'],_0x236063=_0x53bcd8[_0x6a6319(0x1db)],_0x566e92=_0x53bcd8[_0x6a6319(0x2aa)];if(!_0x4768ba)return console['error'](a59_0x34c7bd['red'](_0x6a6319(0x287)),'Source\x20directory\x20is\x20required'),console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x27d)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x192))),0x1;if(!_0x2f96f6)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x2f8)]('Error:'),_0x6a6319(0x2e6)),console['error'](a59_0x34c7bd[_0x6a6319(0x27d)](_0x6a6319(0x1c0))),0x1;_0x53bcd8[_0x6a6319(0x151)]&&(console[_0x6a6319(0x274)](_0x6a6319(0x260)+_0x4768ba),console[_0x6a6319(0x274)](_0x6a6319(0x259)+_0x2f96f6),_0x236063&&console[_0x6a6319(0x274)](_0x6a6319(0x216)+_0x236063),_0x53bcd8[_0x6a6319(0x255)]&&console['error'](_0x6a6319(0x178)),_0x566e92&&console[_0x6a6319(0x274)](_0x6a6319(0x1b0)));const _0x440a9c=await withSpinner('Analyzing\x20project...',()=>_0xce07bd[_0x6a6319(0x19a)]['prepareCloneProject'](_0x4768ba,_0x2f96f6,{'revision':_0x236063,'skipValidation':_0x566e92}),{'verbose':_0x53bcd8['verbose']}),_0x157c86=_0x440a9c['data'];console[_0x6a6319(0x274)]('Source:\x20'+_0x157c86[_0x6a6319(0x213)]);_0x157c86[_0x6a6319(0x27c)]&&console['error'](_0x6a6319(0x15d)+_0x157c86[_0x6a6319(0x27c)]);console['error'](_0x6a6319(0x259)+_0x157c86[_0x6a6319(0x214)]),console[_0x6a6319(0x274)]('Revision:\x20'+_0x157c86[_0x6a6319(0x1db)]),console[_0x6a6319(0x274)](_0x6a6319(0x1c8)+_0x157c86[_0x6a6319(0x18f)]);_0x157c86[_0x6a6319(0x226)]&&(console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2c9)+_0x157c86[_0x6a6319(0x214)]+_0x6a6319(0x20e)+_0x157c86[_0x6a6319(0x2f2)]+')')),console['error'](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2cb))));if(_0x53bcd8[_0x6a6319(0x255)])return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x2f5))),0x0;if(!_0x53bcd8[_0x6a6319(0x1ae)]){if(!isInteractive())return console['error'](a59_0x34c7bd[_0x6a6319(0x2f8)](_0x6a6319(0x2f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x6a6319(0x274)](a59_0x34c7bd['dim'](_0x6a6319(0x275))),0x1;const _0x3d80f5=_0x157c86['sourceProjectName']||a59_0x28ffa6['basename'](_0x4768ba),_0x2be6d8=_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x2d4)+_0x2f96f6+_0x6a6319(0x160):_0x6a6319(0x140)+_0x3d80f5+_0x6a6319(0x2e5)+_0x2f96f6+'\x22?',_0x3751e8=await confirmKey(_0x2be6d8);if(!_0x3751e8)return console[_0x6a6319(0x274)](a59_0x34c7bd[_0x6a6319(0x196)](_0x6a6319(0x292))),0x1;}const _0x58316f=await withSpinner(_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x1dc)+_0x2f96f6+_0x6a6319(0x1c3):_0x6a6319(0x19e)+_0x2f96f6+_0x6a6319(0x1c3),()=>_0xce07bd['workflow']['executeCloneProject'](_0x157c86),{'verbose':_0x53bcd8[_0x6a6319(0x151)]}),_0x12b9d9=_0x58316f[_0x6a6319(0x162)];return console['error'](a59_0x34c7bd['green'](_0x157c86[_0x6a6319(0x226)]?_0x6a6319(0x283):'✔\x20Clone\x20complete')),console[_0x6a6319(0x274)](_0x6a6319(0x223)+_0x12b9d9[_0x6a6319(0x214)]),console[_0x6a6319(0x274)](_0x6a6319(0x1bc)+_0x12b9d9[_0x6a6319(0x289)]),console[_0x6a6319(0x274)]('\x20\x20Revision:\x20'+_0x12b9d9[_0x6a6319(0x1db)]),await this['showWorkflowConsoleUrl'](_0xce07bd,_0x12b9d9['newProjectName'],_0x53bcd8[_0x6a6319(0x2bf)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x69291(0x268)]='workflow:delete';[a59_0x69291(0x134)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x414ce5){const _0x56b8f7=a59_0x69291,{options:_0x82744d,args:_0x4af2cb,tdx:_0xb70637}=_0x414ce5,_0x4b91c1=_0x4af2cb[0x0];if(!_0x4b91c1)return console[_0x56b8f7(0x274)](_0x56b8f7(0x294)),console[_0x56b8f7(0x274)](_0x56b8f7(0x197)),0x1;_0x82744d[_0x56b8f7(0x151)]&&console[_0x56b8f7(0x274)]('Project:\x20'+_0x4b91c1);if(!_0x82744d[_0x56b8f7(0x1ae)]){if(!isInteractive())return console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x2f8)](_0x56b8f7(0x2f6)),_0x56b8f7(0x2d1)),console[_0x56b8f7(0x274)](a59_0x34c7bd[_0x56b8f7(0x27d)](_0x56b8f7(0x275))),0x1;const _0x10c540=await confirmKey(_0x56b8f7(0x18c)+_0x4b91c1+_0x56b8f7(0x1a9));if(!_0x10c540)return console[_0x56b8f7(0x274)](a59_0x34c7bd['yellow']('Cancelled')),0x1;}const _0x3b85c9=await withSpinner(_0x56b8f7(0x2fc)+_0x4b91c1+_0x56b8f7(0x1c3),()=>_0xb70637[_0x56b8f7(0x19a)][_0x56b8f7(0x290)](_0x4b91c1),{'verbose':_0x82744d[_0x56b8f7(0x151)]}),_0x5cc28b=_0x3b85c9[_0x56b8f7(0x162)];return console[_0x56b8f7(0x274)]('✔\x20Deleted\x20project\x20'+_0x5cc28b[_0x56b8f7(0x26c)]),console[_0x56b8f7(0x274)]('\x20\x20Project\x20ID:\x20'+_0x5cc28b[_0x56b8f7(0x2c2)]),0x0;}}export function parseKeyValue(_0x3eb392){const _0x38b767=a59_0x69291,_0x2bb173=_0x3eb392[_0x38b767(0x295)]('=');if(_0x2bb173===-0x1)throw new Error(_0x38b767(0x19b)+_0x3eb392+_0x38b767(0x2ab));const _0x153d4f=_0x3eb392['substring'](0x0,_0x2bb173),_0x510c02=_0x3eb392[_0x38b767(0x1a3)](_0x2bb173+0x1);if(!_0x153d4f)throw new Error(_0x38b767(0x23e));return{'key':_0x153d4f,'value':_0x510c02};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a59_0x69291(0x20c);[a59_0x69291(0x134)]=a59_0x69291(0x13c);async[a59_0x69291(0x2fa)](_0x5e93ab){const _0x775529=a59_0x69291,{options:_0x3f414d,args:_0x3d2922,tdx:_0x8037bd}=_0x5e93ab,_0x2fa2bd=this[_0x775529(0x1ee)](_0x3d2922,_0x3f414d);if(!_0x2fa2bd)return 0x1;_0x3f414d[_0x775529(0x151)]&&console['error']('Project:\x20'+_0x2fa2bd);const _0x32efc2=await withSpinner('Listing\x20secrets...',()=>_0x8037bd[_0x775529(0x19a)][_0x775529(0x16a)](_0x2fa2bd),{'verbose':_0x3f414d[_0x775529(0x151)]}),{secrets:_0x15f42b}=_0x32efc2[_0x775529(0x162)];return console[_0x775529(0x274)]('✔\x20Found\x20'+_0x15f42b[_0x775529(0x204)]+'\x20secret'+(_0x15f42b['length']!==0x1?'s':'')),await handleSDKOutput(_0x15f42b,_0x3f414d),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x28d);[a59_0x69291(0x134)]=a59_0x69291(0x2b5);async[a59_0x69291(0x2fa)](_0x5880e6){const _0xa1a332=a59_0x69291,{options:_0x4f272e,args:_0x2c81f2,tdx:_0x4beba7}=_0x5880e6;let _0x3c9ab6,_0x387e0e;if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&!_0x2c81f2[0x0][_0xa1a332(0x302)]('='))_0x3c9ab6=_0x2c81f2[0x0],_0x387e0e=_0x2c81f2['slice'](0x1);else{if(_0x2c81f2[_0xa1a332(0x204)]>=0x1&&_0x4f272e['workflowProject'])_0x3c9ab6=_0x4f272e[_0xa1a332(0x19c)],_0x387e0e=_0x2c81f2;else return _0x2c81f2['length']>=0x1?(console['error'](_0xa1a332(0x261)),console[_0xa1a332(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0xa1a332(0x274)](_0xa1a332(0x15b)),console[_0xa1a332(0x274)](_0xa1a332(0x1cf)),0x1);}if(_0x387e0e[_0xa1a332(0x204)]===0x0)return console['error'](_0xa1a332(0x15b)),console[_0xa1a332(0x274)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x1548e8={};try{for(const _0x3b4ffd of _0x387e0e){const {key:_0x18ad4a,value:_0x31c404}=parseKeyValue(_0x3b4ffd);_0x1548e8[_0x18ad4a]=_0x31c404;}}catch(_0x223ef4){return _0x223ef4 instanceof Error&&console[_0xa1a332(0x274)](a59_0x34c7bd[_0xa1a332(0x2f8)]('Error:'),_0x223ef4['message']),0x1;}const _0x284011=Object[_0xa1a332(0x20a)](_0x1548e8);_0x4f272e[_0xa1a332(0x151)]&&(console[_0xa1a332(0x274)]('Project:\x20'+_0x3c9ab6),console['error']('Secrets\x20to\x20set:\x20'+_0x284011[_0xa1a332(0x19d)](',\x20')));const _0x848f1d=await withSpinner(_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x13b):'Setting\x20'+_0x284011[_0xa1a332(0x204)]+_0xa1a332(0x18d),()=>_0x4beba7[_0xa1a332(0x19a)][_0xa1a332(0x203)](_0x3c9ab6,_0x1548e8),{'verbose':_0x4f272e[_0xa1a332(0x151)]}),_0x1a69d8=_0x848f1d[_0xa1a332(0x162)];return console[_0xa1a332(0x274)](_0x284011[_0xa1a332(0x204)]===0x1?_0xa1a332(0x26d)+_0x1a69d8[_0xa1a332(0x20a)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27':'✔\x20'+_0x1a69d8['keys'][_0xa1a332(0x204)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x1a69d8[_0xa1a332(0x26c)]+'\x27'),(_0x4f272e[_0xa1a332(0x18b)]||_0x4f272e['jsonl'])&&await handleSingleObjectOutput(_0x1a69d8,_0x4f272e),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x229);[a59_0x69291(0x134)]=a59_0x69291(0x2c5);async[a59_0x69291(0x2fa)](_0x3208fa){const _0x43304a=a59_0x69291,{options:_0xbfb41a,args:_0x5ef52d,tdx:_0x55fde2}=_0x3208fa;let _0x2d1af2,_0x359fcf;if(_0x5ef52d['length']>=0x2)_0x2d1af2=_0x5ef52d[0x0],_0x359fcf=_0x5ef52d[0x1];else{if(_0x5ef52d['length']===0x1&&_0xbfb41a[_0x43304a(0x19c)])_0x2d1af2=_0xbfb41a[_0x43304a(0x19c)],_0x359fcf=_0x5ef52d[0x0];else return _0x5ef52d[_0x43304a(0x204)]===0x1?(console[_0x43304a(0x274)](_0x43304a(0x261)),console[_0x43304a(0x274)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console[_0x43304a(0x274)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0xbfb41a['verbose']&&(console['error']('Project:\x20'+_0x2d1af2),console['error'](_0x43304a(0x2f9)+_0x359fcf));if(!_0xbfb41a[_0x43304a(0x1ae)]){if(!isInteractive())return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x2f8)](_0x43304a(0x2f6)),_0x43304a(0x2d1)),console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x27d)](_0x43304a(0x275))),0x1;const _0x39fd22=await confirmKey(_0x43304a(0x14b)+_0x359fcf+_0x43304a(0x1b5)+_0x2d1af2+'\x27?');if(!_0x39fd22)return console[_0x43304a(0x274)](a59_0x34c7bd[_0x43304a(0x196)]('Cancelled')),0x1;}const _0x50ace8=await withSpinner(_0x43304a(0x163),()=>_0x55fde2[_0x43304a(0x19a)][_0x43304a(0x281)](_0x2d1af2,_0x359fcf),{'verbose':_0xbfb41a[_0x43304a(0x151)]}),_0xaffddc=_0x50ace8[_0x43304a(0x162)];return console[_0x43304a(0x274)](_0x43304a(0x26d)+_0xaffddc[_0x43304a(0x243)]+_0x43304a(0x1d4)+_0xaffddc[_0x43304a(0x26c)]+'\x27'),(_0xbfb41a[_0x43304a(0x18b)]||_0xbfb41a[_0x43304a(0x1d8)])&&await handleSingleObjectOutput(_0xaffddc,_0xbfb41a),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 a59_0x5020(){const _0x13b5f9=['jsonl','renderSessionsTimeline','Resolving\x20project\x20\x27','revision','Updating\x20','table','Kill\x20a\x20running\x20attempt','Workflow:','relative','targetDir','buildTimelineData','\x0aPush\x20these\x20changes?','\x20\x20Revision:\x20','includeRetried','fill','Tip:\x20cd\x20to\x20workflows/','changes','Analyzing\x20changes...','Retry\x20a\x20session\x20or\x20attempt','all','resolveProjectId','\x20enabled\x20(','requireProject','Target:\x20','\x20unchanged','resolveProject','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Using\x20attempt\x20','match','\x0aPolling...\x20(','LABEL_WIDTH_DIVISOR','index','createdAt','min','Listing\x20workflow\x20attempts...','durationMs','MAX_TASKS_DISPLAY','resolveProjectDir','Session\x20time:','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','retrySession','workflow:pull','trim','setSecrets','length','diff','isTTY','output','skipSchedule','\x20\x20Location:\x20','keys','Including\x20subtasks:\x20yes','workflow:secrets:list','Listing\x20workflow\x20projects...','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Schedule\x20#','success','\x0a✔\x20Already\x20up\x20to\x20date','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','sourceDir','newProjectName','\x20\x20Attempt\x20ID:\x20','Revision:\x20','attempt','Retrying\x20attempt...','6312747RpMHaJ','Filter:\x20','attemptId','No\x20attempts\x20found\x20in\x20project:\x20','\x20session','renderSingleTimeline','status','sessionId','\x20\x20Source:\x20','title','\x20\x20Project:\x20','📋\x20','workflow:schedules','targetExists','No\x20workflows\x20found\x20in\x20project:\x20','Select\x20a\x20workflow\x20to\x20run','workflow:secrets:delete','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','MAX_LABEL_COUNT','✔\x20Workflow\x20project\x20context\x20cleared.','3418840EzgxXJ','startsWith','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','has','toLowerCase','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','parse','kill','project','\x20workflow','group_error','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','nextRunTime','Project\x20name:\x20','deleted','No\x20sessions\x20found\x20in\x20project:\x20','Listing\x20schedules...','Key\x20cannot\x20be\x20empty','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','displayLine','unchanged','Starting\x20workflow\x20run...','key','\x20attempt','workflow:logs','No\x20log\x20files\x20found\x20for\x20this\x20attempt','✔\x20Project:\x20','get','-\x20nothing\x20pushed','logFiles','icon','✔\x20Retry\x20started','\x20project','Pushing\x20workflow\x20project...','\x0aDry\x20run\x20-\x20no\x20files\x20written','Params:\x20','cyan','12695rTKvth','unknown','workflow:download','dryRun','workflow:workflows','No\x20schedules\x20found','getHours','New\x20project\x20name:\x20','\x20\x20Target:\x20','applyPullProject','msPerChar','params','padStart','💡\x20Tip:\x20Use\x20','Source\x20directory:\x20','Error:\x20Project\x20name\x20is\x20required','POLL_INTERVAL_MS','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','showWorkflowConsoleUrl','finishedAt','cancelRequested','new','name','blue','pending','modified','projectName','✔\x20Secret\x20\x27','startedAt','No\x20matching\x20sessions\x20found','Attempt\x20ID:\x20','⚠\x20Showing\x20first\x20','workflow:push','✔\x20Push\x20complete','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','→\x20New\x20project:\x20','Expected\x20format:\x20--param\x20key=value','\x20task','sort','MIN_LABEL_COUNT','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','sourceProjectName','dim','workflow:tasks','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Workflow:\x20','deleteSecret','No\x20workflows\x20found','✔\x20Project\x20updated','pollTimeline','readFile','localeCompare','Error:','stringify','newProjectId','session','done','614453TNuqaK','workflow:secrets:set','Retrying\x20session...','🔄\x20','delete','5908608gBLDyQ','Cancelled','end','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','indexOf','log','workflow:projects','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','1630qxfcFz','autocomplete','Target\x20directory:\x20','write','type','\x20has\x20no\x20attempts','lastAttempt','disableSchedule','List\x20workflow\x20attempts','start','✔\x20Pull\x20complete','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','stdout','Total:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','rows','getFullYear','skipValidation','.\x20Expected\x20format:\x20KEY=VALUE','workflow:clone','format','Show\x20tasks\x20for\x20an\x20attempt','getWorkflow','context','fileSize','renderTimeline','-\x20no\x20files\x20written','Error:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','run','executeDryRun','white','clear','\x20deleted','\x20sessions\x20','\x0a✔\x20Attempt\x20complete','Project\x20name\x20is\x20required','site','\x20disabled\x20(','floor','projectId','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','every','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','summary','\x0a⚠\x20Project\x20\x22','\x20from\x20session\x20','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','\x20\x20Workflow:\x20','No\x20sessions\x20found\x20for:\x20','logs','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20-\x20','total','\x0aUpdate\x20existing\x20project\x20\x22','green','Task\x20graph:','planned','\x20is\x20not\x20a\x20directory','\x20\x20tdx\x20wf\x20use\x20<project>','getMinutes','limit','No\x20workflow\x20tdx.json\x20found','size','from','attempt:','workflow:timeline','(use\x20--limit\x20to\x20see\x20more)','session_id','cwd','taskName','\x22\x20to\x20new\x20project\x20\x22','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Loading\x20sessions...','93210IQiXrC','list','Listing\x20workflows...','values','push','✔\x20Schedule\x20found','slice','some','path','generateSessionTimelineRows','existingProjectId','getSchedule','List\x20workflow\x20schedules','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0aError:','getDate','red','Key:\x20','execute','task','Deleting\x20project\x20','ICON_WIDTH','✔\x20Pushed\x20','fullName','window','isNewProject','includes','Disabling\x20schedule\x20#','No\x20sessions\x20with\x20timing\x20information','\x20modified','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','preparePushProject','pullProject','fs/promises','disabledAt','\x20next:\x20','description','Select\x20a\x20session\x20to\x20view\x20timeline:','workflow:schedule:disable','Status:\x20','Error:\x20Attempt\x20ID\x20is\x20required','Loading\x20workflows...','round','Setting\x20secret...','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','\x20\x20Console:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','follow','\x0aClone\x20\x22','No\x20projects\x20match\x20pattern:\x20','Failed\x20to\x20fetch\x20attempt\x20data','updatedAt','workflow:schedule:enable','sessions','/sessions/','Loading\x20session...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','navigateSessionsInteractive','Usage:\x20tdx\x20wf\x20use\x20<project>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','22WEqGWO','now','Include\x20retried:\x20yes','max','Auto-selected\x20latest\x20session:\x20','verbose','running','startTime','enableSchedule','sessionTime','Fetching\x20schedule\x20#','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','(unknown)','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','Source\x20project:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x20\x20Next\x20run:\x20','\x22\x20with\x20new\x20revision?','Filter:\x20project=','data','Deleting\x20secret...','✔\x20Found\x20','Downloading\x20project\x20','Task\x20name:\x20','\x20(system)','Force:\x20yes','getMonth','listSecrets','Pull\x20workflow\x20project\x20to\x20local\x20folder','Attempt:\x20','executePushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Resume\x20from:\x20','No\x20attempts\x20found','TASK_NAME_WIDTH','find','canceling','List\x20workflows','resumeFrom','config','download','Dry\x20run:\x20yes','MAX_TIMELINE_WIDTH','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Listing\x20workflow\x20sessions...','110349TBDYjP','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project:\x20','\x20new','force','repeat','Pushing\x20project...','workflow:attempt','tasks','Fetching\x20log\x20files...','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','revision:\x20','\x20(use\x20--limit\x20to\x20show\x20more)',',\x20Workflow:\x20','Session\x20','json','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','\x20secrets...','\x0aApply\x20these\x20changes?','fileCount','No\x20sessions\x20found','\x20\x20Session\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','session:','Downloading\x20logs...','duration','yellow','Usage:\x20workflow:delete\x20<project-name-or-id>','Project\x20directory:\x20','Killing\x20attempt...','workflow','Invalid\x20format:\x20','workflowProject','join','Cloning\x20to\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20\x20Session\x20context\x20set\x20to:\x20','replace','retryAttemptName','substring','No\x20log\x20content\x20found','parseProjectWorkflowPattern','workflow:upload','param','Enabling\x20schedule\x20#','\x22?\x20This\x20cannot\x20be\x20undone.','state','workflowName','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:attempts','yes','listSchedules','Validation:\x20skipped','fromTask','Output\x20directory:\x20','getTime','2268fjSsIu','\x27\x20from\x20project\x20\x27','metadata','filter','map','columns','---\x20','toISOString','\x20\x20Project\x20ID:\x20','✔\x20Downloaded\x20','workflow:retry','LABEL_MIN_SPACING','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','tdx\x20wf\x20attempt\x20','workflow:kill','...','toLocaleString','📅\x20#','Show\x20specific\x20attempt\x20details','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Files\x20to\x20upload:\x20','workflow:use','utf-8','workflows','split','tdx.json','Schedule\x20ID\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','set','bold','text','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Session\x20time:\x20','List\x20workflow\x20execution\x20sessions','sys'];a59_0x5020=function(){return _0x13b5f9;};return a59_0x5020();}function formatElapsed(_0x5ef5d2){const _0x1651cb=a59_0x69291,_0x2b1c72=Math['floor'](_0x5ef5d2/0x3e8),_0x4bb6fd=Math[_0x1651cb(0x2c1)](_0x2b1c72/0x3c),_0xaee7d4=Math['floor'](_0x4bb6fd/0x3c),_0x423d61=Math[_0x1651cb(0x2c1)](_0xaee7d4/0x18);if(_0x423d61>0x0){const _0x4d6b9f=_0xaee7d4%0x18;return _0x4d6b9f>0x0?_0x423d61+'d\x20'+_0x4d6b9f+'h':_0x423d61+'d';}else{if(_0xaee7d4>0x0){const _0x475615=_0x4bb6fd%0x3c;return _0x475615>0x0?_0xaee7d4+'h\x20'+_0x475615+'m':_0xaee7d4+'h';}else{if(_0x4bb6fd>0x0){const _0x3cd501=_0x2b1c72%0x3c;return _0x3cd501>0x0?_0x4bb6fd+'m\x20'+_0x3cd501+'s':_0x4bb6fd+'m';}else return _0x2b1c72+'s';}}}function formatTimestamp(_0x48bfcf,_0x2bd311){const _0x113d22=a59_0x69291,_0x2d577e=new Date(_0x48bfcf),_0x2790c5=String(_0x2d577e[_0x113d22(0x258)]())['padStart'](0x2,'0'),_0x538b10=String(_0x2d577e[_0x113d22(0x2da)]())[_0x113d22(0x25e)](0x2,'0'),_0x174b72=_0x2790c5+':'+_0x538b10,_0x18f580=_0x2d577e[_0x113d22(0x2a9)]()===_0x2bd311[_0x113d22(0x2a9)]()&&_0x2d577e['getMonth']()===_0x2bd311[_0x113d22(0x169)]()&&_0x2d577e[_0x113d22(0x2f7)]()===_0x2bd311[_0x113d22(0x2f7)]();if(_0x18f580)return _0x174b72;else{const _0x43d334=String(_0x2d577e[_0x113d22(0x169)]()+0x1)[_0x113d22(0x25e)](0x2,'0'),_0x386e16=String(_0x2d577e[_0x113d22(0x2f7)]())[_0x113d22(0x25e)](0x2,'0');return _0x43d334+'-'+_0x386e16+'\x20'+_0x174b72;}}function formatDate(_0x9117d7){const _0x231352=a59_0x69291,_0x4651de=_0x9117d7[_0x231352(0x2a9)](),_0x2ae579=String(_0x9117d7[_0x231352(0x169)]()+0x1)[_0x231352(0x25e)](0x2,'0'),_0x5e29bd=String(_0x9117d7['getDate']())[_0x231352(0x25e)](0x2,'0');return _0x4651de+'-'+_0x2ae579+'-'+_0x5e29bd;}function getTaskStateIcon(_0x3464d5){const _0x582665={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x582665[_0x3464d5]||'⚪';}function getBarChar(_0x386942){const _0x39921f=a59_0x69291;return _0x386942===_0x39921f(0x274)||_0x386942===_0x39921f(0x237)?'×':'─';}function getBarColor(_0x4c0c88){const _0x22314d=a59_0x69291,_0x5e7ff1={'success':a59_0x34c7bd['green'],'error':a59_0x34c7bd[_0x22314d(0x2f8)],'group_error':a59_0x34c7bd[_0x22314d(0x2f8)],'running':a59_0x34c7bd[_0x22314d(0x269)],'blocked':a59_0x34c7bd[_0x22314d(0x196)],'planned':a59_0x34c7bd[_0x22314d(0x27d)],'canceling':a59_0x34c7bd[_0x22314d(0x196)]};return _0x5e7ff1[_0x4c0c88]||a59_0x34c7bd[_0x22314d(0x2b9)];}function parseTaskName(_0x495347){const _0x2cf043=a59_0x69291;let _0xea9f4e=_0x495347[_0x2cf043(0x1a1)](/^\++/,'');const _0x42fb74=_0xea9f4e[_0x2cf043(0x1cc)]('+'),_0x4d4071=_0x42fb74[_0x2cf043(0x204)]>0x1?_0x42fb74[_0x2cf043(0x204)]-0x2:0x0,_0x320ae4=_0x42fb74[_0x42fb74[_0x2cf043(0x204)]-0x1]||_0xea9f4e;return{'level':_0x4d4071,'name':'+'+_0x320ae4};}function a59_0x2c40(_0x2bac8e,_0x3d9b57){_0x2bac8e=_0x2bac8e-0x12d;const _0x50204f=a59_0x5020();let _0x2c4051=_0x50204f[_0x2bac8e];return _0x2c4051;}function truncateTaskName(_0xf25174,_0x5560c1){const _0x4c91f9=a59_0x69291,_0x2ee9bf=stringWidth(_0xf25174);if(_0x2ee9bf<=_0x5560c1)return _0xf25174;let _0x5d889e=_0xf25174;while(stringWidth(_0x5d889e+'…')>_0x5560c1&&_0x5d889e[_0x4c91f9(0x204)]>0x0){_0x5d889e=_0x5d889e[_0x4c91f9(0x2ee)](0x0,-0x1);}return _0x5d889e+'…';}function calculateTimeScale(_0x486b4f,_0x48ce43){const _0x3217ce=a59_0x69291;return{'startTime':_0x486b4f[_0x3217ce(0x2a2)],'endTime':_0x486b4f[_0x3217ce(0x293)],'durationMs':_0x486b4f[_0x3217ce(0x195)],'msPerChar':_0x486b4f[_0x3217ce(0x195)]/_0x48ce43};}function timeToPosition(_0x227710,_0x2aea15,_0x4a29eb){const _0xa204bf=a59_0x69291,_0x3cd907=_0x227710-_0x2aea15['startTime'],_0x3a2a86=Math['floor'](_0x3cd907/_0x2aea15[_0xa204bf(0x25c)]);return Math[_0xa204bf(0x14f)](0x0,Math[_0xa204bf(0x1f9)](_0x3a2a86,_0x4a29eb));}function renderTimeAxis(_0x29cd11,_0x5c7c6e){const _0x2129e1=a59_0x69291,_0x5c38d9=Math[_0x2129e1(0x1f9)](TIMELINE_CONFIG[_0x2129e1(0x22b)],Math[_0x2129e1(0x14f)](TIMELINE_CONFIG[_0x2129e1(0x27a)],Math[_0x2129e1(0x2c1)](_0x5c7c6e/TIMELINE_CONFIG[_0x2129e1(0x1f6)]))),_0x253855=_0x29cd11[_0x2129e1(0x1fb)]/(_0x5c38d9-0x1),_0x2e87ed=new Date(_0x29cd11[_0x2129e1(0x153)]),_0x22cc78=[];for(let _0x1e0c4a=0x0;_0x1e0c4a<_0x5c38d9;_0x1e0c4a++){const _0x29a585=_0x29cd11[_0x2129e1(0x153)]+_0x1e0c4a*_0x253855,_0x48a779=timeToPosition(_0x29a585,_0x29cd11,_0x5c7c6e),_0x1d496d=formatTimestamp(_0x29a585,_0x2e87ed);_0x22cc78[_0x2129e1(0x2ec)]({'pos':_0x48a779,'text':_0x1d496d});}const _0x2f8e15=new Array(_0x5c7c6e)[_0x2129e1(0x1e6)]('\x20');let _0x51b30c=-0x1;for(const {pos:_0x5f5bc2,text:_0x354a5}of _0x22cc78){let _0x5abb7e=Math[_0x2129e1(0x14f)](0x0,_0x5f5bc2-Math[_0x2129e1(0x2c1)](_0x354a5[_0x2129e1(0x204)]/0x2));_0x5abb7e<=_0x51b30c+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x5abb7e=_0x51b30c+TIMELINE_CONFIG[_0x2129e1(0x1bf)]+0x1);_0x5abb7e+_0x354a5[_0x2129e1(0x204)]>_0x5c7c6e&&(_0x5abb7e=_0x5c7c6e-_0x354a5[_0x2129e1(0x204)]);if(_0x5abb7e>=0x0&&_0x5abb7e+_0x354a5[_0x2129e1(0x204)]<=_0x5c7c6e&&_0x5abb7e>_0x51b30c){for(let _0x51479e=0x0;_0x51479e<_0x354a5[_0x2129e1(0x204)];_0x51479e++){_0x2f8e15[_0x5abb7e+_0x51479e]=_0x354a5[_0x51479e];}_0x51b30c=_0x5abb7e+_0x354a5[_0x2129e1(0x204)]-0x1;}}return _0x2f8e15[_0x2129e1(0x19d)]('');}function renderTaskRow(_0x5475b5,_0x4375c5,_0x455b9f,_0x2d8fce){const _0x41e62f=a59_0x69291,{level:_0x994f6e,name:_0x545de4}=parseTaskName(_0x5475b5[_0x41e62f(0x268)]),_0x324d05='\x20'[_0x41e62f(0x181)](_0x994f6e),_0x1ccb30=_0x5475b5['window']?'('+formatElapsed(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x195)])+')':'',_0x1501d7=stringWidth(_0x1ccb30),_0x313beb=_0x994f6e*0x1,_0x45320e=_0x2d8fce-_0x313beb-_0x1501d7-0x1,_0x2edfeb=truncateTaskName(_0x545de4,_0x45320e),_0x2cc5e2=_0x324d05+_0x2edfeb,_0x75e6fc=stringWidth(_0x2cc5e2),_0x143441=_0x2d8fce-_0x75e6fc-_0x1501d7,_0x1772d1=_0x2cc5e2+'\x20'[_0x41e62f(0x181)](Math[_0x41e62f(0x14f)](0x1,_0x143441))+a59_0x34c7bd[_0x41e62f(0x27d)](_0x1ccb30),_0x291991=getTaskStateIcon(_0x5475b5[_0x41e62f(0x1aa)]),_0x47868a=new Array(_0x455b9f)[_0x41e62f(0x1e6)]('\x20');if(_0x5475b5[_0x41e62f(0x300)]){const _0xb6248b=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x2a2)],_0x4375c5,_0x455b9f),_0x42e72c=timeToPosition(_0x5475b5[_0x41e62f(0x300)][_0x41e62f(0x293)],_0x4375c5,_0x455b9f),_0x5bd1b8=getBarChar(_0x5475b5[_0x41e62f(0x1aa)]),_0x56a2fb=Math[_0x41e62f(0x14f)](_0xb6248b+0x1,_0x42e72c);for(let _0x59a410=_0xb6248b;_0x59a410<Math[_0x41e62f(0x1f9)](_0x56a2fb,_0x455b9f);_0x59a410++){_0x47868a[_0x59a410]=_0x5bd1b8;}}const _0x19cb9a=getBarColor(_0x5475b5[_0x41e62f(0x1aa)]),_0x7eab6a=_0x47868a['map'](_0x24730c=>_0x24730c==='\x20'?'\x20':_0x19cb9a(_0x24730c))[_0x41e62f(0x19d)]('');return _0x291991+'\x20'+_0x1772d1+'│'+_0x7eab6a+'│';}function calculateStats(_0xfdb242){const _0x2f1aaf=a59_0x69291,_0x165184={'total':_0xfdb242[_0x2f1aaf(0x204)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xe7beb0 of _0xfdb242){if(_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x210))_0x165184['success']++;else{if(_0xe7beb0[_0x2f1aaf(0x1aa)]==='error'||_0xe7beb0[_0x2f1aaf(0x1aa)]===_0x2f1aaf(0x237))_0x165184[_0x2f1aaf(0x274)]++;else _0xe7beb0['state']===_0x2f1aaf(0x152)?_0x165184['running']++:_0x165184[_0x2f1aaf(0x26a)]++;}}return _0x165184;}function formatStats(_0x5b0bea){const _0xa78f45=a59_0x69291;return[_0xa78f45(0x2a6)+_0x5b0bea[_0xa78f45(0x2d3)],'✅\x20'+_0x5b0bea[_0xa78f45(0x210)],'❌\x20'+_0x5b0bea['error'],_0xa78f45(0x28f)+_0x5b0bea[_0xa78f45(0x152)],'⏳\x20'+_0x5b0bea[_0xa78f45(0x26a)]][_0xa78f45(0x19d)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x2e0);[a59_0x69291(0x134)]=a59_0x69291(0x158);async[a59_0x69291(0x2fa)](_0x599ad7){const _0x1b79dc=a59_0x69291,{options:_0x402932,args:_0x497baf,tdx:_0x4db04b}=_0x599ad7;let _0x36188b,_0x503e4c,_0x54b5ba=![];if(_0x497baf[0x0]){if(_0x497baf[0x0][_0x1b79dc(0x302)]('.')){const _0x5d11f8=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x5d11f8)return 0x1;_0x36188b=_0x5d11f8[_0x1b79dc(0x26c)],_0x503e4c=_0x5d11f8[_0x1b79dc(0x1ab)];}else{_0x503e4c=_0x497baf[0x0],_0x36188b=_0x402932['workflowProject'];if(!_0x36188b)return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),_0x1b79dc(0x232)),0x1;_0x54b5ba=!![];}}else{const _0x9e6889=this[_0x1b79dc(0x1a5)](_0x497baf,_0x402932);if(!_0x9e6889)return 0x1;_0x36188b=_0x9e6889[_0x1b79dc(0x26c)],_0x503e4c=_0x9e6889[_0x1b79dc(0x1ab)];}if(_0x402932['verbose']){if(_0x36188b&&_0x503e4c)console['error'](_0x1b79dc(0x21a)+_0x36188b+'.'+_0x503e4c);else _0x36188b&&console[_0x1b79dc(0x274)](_0x1b79dc(0x161)+_0x36188b);}const _0x7aeef0=_0x402932[_0x1b79dc(0x21b)],_0x213a85=_0x402932['sessionId'];if(_0x7aeef0){_0x213a85&&console['error'](a59_0x34c7bd[_0x1b79dc(0x196)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x14dcb9=_0x402932[_0x1b79dc(0x13f)];return _0x14dcb9?await this[_0x1b79dc(0x284)](_0x599ad7,_0x7aeef0):await this['renderSingleTimeline'](_0x599ad7,_0x7aeef0,_0x402932),0x0;}if(_0x213a85){const _0x5e0a8a=await withSpinner(_0x1b79dc(0x147),()=>_0x4db04b[_0x1b79dc(0x19a)]['sessions']({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':0x64}),{'verbose':_0x402932[_0x1b79dc(0x151)]}),_0x1907e1=_0x5e0a8a['data'][_0x1b79dc(0x172)](_0x288ca5=>_0x288ca5['id']===_0x213a85);if(!_0x1907e1)return console['error'](a59_0x34c7bd[_0x1b79dc(0x2f8)](_0x1b79dc(0x287)),'Session\x20not\x20found:\x20'+_0x213a85),0x1;if(!_0x1907e1['lastAttempt']?.['id'])return console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x2f8)]('Error:'),_0x1b79dc(0x18a)+_0x213a85+_0x1b79dc(0x29e)),0x1;const _0xb6f395=_0x1907e1['lastAttempt']['id'];_0x402932['verbose']&&console[_0x1b79dc(0x274)](_0x1b79dc(0x1f3)+_0xb6f395+_0x1b79dc(0x2ca)+_0x213a85);const _0x7c4511=_0x402932[_0x1b79dc(0x13f)];return _0x7c4511?await this[_0x1b79dc(0x284)](_0x599ad7,_0xb6f395):await this['renderSingleTimeline'](_0x599ad7,_0xb6f395,_0x402932),0x0;}const _0x6d3c83=await withSpinner(_0x1b79dc(0x2e7),()=>_0x4db04b[_0x1b79dc(0x19a)][_0x1b79dc(0x145)]({'projectName':_0x36188b,'workflowName':_0x503e4c,'limit':_0x402932[_0x1b79dc(0x2db)]||0x32}),{'verbose':_0x402932['verbose']}),_0x1d7cd7=_0x6d3c83['data'];if(_0x1d7cd7[_0x1b79dc(0x204)]===0x0){if(_0x36188b&&_0x503e4c)console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20for:\x20'+_0x36188b+'.'+_0x503e4c);else _0x36188b?console[_0x1b79dc(0x274)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x36188b):(console['error']('No\x20workflow\x20sessions\x20found'),console[_0x1b79dc(0x274)](a59_0x34c7bd[_0x1b79dc(0x27d)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x1d7cd7[_0x1b79dc(0x279)]((_0x231d52,_0x4dca1c)=>{const _0x137b1c=_0x1b79dc,_0x196fd6=_0x231d52['sessionTime']||'',_0x54740d=_0x4dca1c['sessionTime']||'';return _0x54740d[_0x137b1c(0x286)](_0x196fd6);});if(_0x402932[_0x1b79dc(0x18b)]||_0x402932[_0x1b79dc(0x1d8)])return await handleSDKOutput(_0x1d7cd7,_0x402932),0x0;let _0x19c5f9;if(_0x54b5ba){const _0x480557=_0x1d7cd7[0x0];if(!_0x480557[_0x1b79dc(0x29f)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x19c5f9=_0x480557[_0x1b79dc(0x29f)]['id'],_0x402932[_0x1b79dc(0x151)]&&console[_0x1b79dc(0x274)](_0x1b79dc(0x150)+_0x480557[_0x1b79dc(0x155)]);}else{const _0x12d6c2=_0x1d7cd7[_0x1b79dc(0x1b8)](_0x1295b7=>{const _0x12989c=_0x1b79dc,_0x3d2af9=getAttemptStatusDisplay(_0x1295b7[_0x12989c(0x29f)]);return{'title':_0x1295b7[_0x12989c(0x235)]?.[_0x12989c(0x268)]+'.'+_0x1295b7[_0x12989c(0x19a)]?.[_0x12989c(0x268)]+'\x20-\x20'+_0x1295b7[_0x12989c(0x155)]+'\x20'+_0x3d2af9[_0x12989c(0x24b)],'value':_0x1295b7[_0x12989c(0x29f)]?.['id']||'','description':_0x3d2af9[_0x12989c(0x1d2)]};}),_0xd2b8a8=await a59_0x3da1fb({'type':'select','name':_0x1b79dc(0x21b),'message':_0x1b79dc(0x135),'choices':_0x12d6c2['filter'](_0x134930=>_0x134930['value']!=='')});if(!_0xd2b8a8[_0x1b79dc(0x21b)])return 0x0;_0x19c5f9=_0xd2b8a8['attemptId'];}const _0x36a6dc=_0x402932[_0x1b79dc(0x13f)];return _0x36a6dc?await this['pollTimeline'](_0x599ad7,_0x19c5f9):await this[_0x1b79dc(0x21e)](_0x599ad7,_0x19c5f9,_0x402932),0x0;}async[a59_0x69291(0x21e)](_0x1b28cd,_0x292d76,_0x25f7ea){const _0x36ad24=a59_0x69291,{tdx:_0x4b00ac}=_0x1b28cd;let _0x512ea9,_0x101041;try{[_0x512ea9,_0x101041]=await Promise[_0x36ad24(0x1eb)]([_0x4b00ac[_0x36ad24(0x19a)][_0x36ad24(0x217)](_0x292d76),_0x4b00ac['workflow'][_0x36ad24(0x184)](_0x292d76,![])]);}catch(_0x4fcd85){console[_0x36ad24(0x274)](a59_0x34c7bd['red'](_0x36ad24(0x142)));_0x25f7ea[_0x36ad24(0x151)]&&console[_0x36ad24(0x274)](_0x4fcd85);throw _0x4fcd85;}if(_0x25f7ea[_0x36ad24(0x18b)]||_0x25f7ea[_0x36ad24(0x1d8)]){const _0x1f66ed=this[_0x36ad24(0x1e2)](_0x512ea9,_0x101041);await handleSDKOutput([_0x1f66ed],_0x25f7ea);return;}const _0x88fcb1=_0x4b00ac[_0x36ad24(0x2b0)][_0x36ad24(0x2bf)],_0x40c53a=this[_0x36ad24(0x2b2)](_0x512ea9,_0x101041,_0x88fcb1);console[_0x36ad24(0x296)](_0x40c53a);}async[a59_0x69291(0x284)](_0x58080a,_0x3844b5){const _0x3eafac=a59_0x69291,{tdx:_0x3d8904}=_0x58080a,_0x3775f6=TIMELINE_CONFIG[_0x3eafac(0x262)],_0x588449=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x308301=0x0;while(_0x308301<_0x588449){process['stdout']['isTTY']&&process[_0x3eafac(0x2a5)]['write']('\x1Bc');let _0x1e8467,_0x1c83d3;try{[_0x1e8467,_0x1c83d3]=await Promise[_0x3eafac(0x1eb)]([_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x217)](_0x3844b5),_0x3d8904[_0x3eafac(0x19a)][_0x3eafac(0x184)](_0x3844b5,![])]);}catch(_0x3c6946){console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x2f8)](_0x3eafac(0x157)));_0x308301>0x0&&console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x19f)+_0x308301));throw _0x3c6946;}const _0x6bcddd=_0x3d8904[_0x3eafac(0x2b0)]['site'],_0x2e4926=this[_0x3eafac(0x2b2)](_0x1e8467,_0x1c83d3,_0x6bcddd);console[_0x3eafac(0x296)](_0x2e4926);const _0x29df27=_0x1e8467[_0x3eafac(0x28b)]&&_0x1c83d3[_0x3eafac(0x2c4)](_0x54db7c=>_0x54db7c['state']!=='running'&&_0x54db7c[_0x3eafac(0x1aa)]!==_0x3eafac(0x2d7));if(_0x29df27){console['error'](a59_0x34c7bd[_0x3eafac(0x2d5)](_0x3eafac(0x2bd)));break;}console[_0x3eafac(0x274)](a59_0x34c7bd[_0x3eafac(0x27d)](_0x3eafac(0x1f5)+_0x308301*0x2+_0x3eafac(0x13e))),await new Promise(_0x42cd26=>setTimeout(_0x42cd26,_0x3775f6)),_0x308301++;}_0x308301>=_0x588449&&console['error'](a59_0x34c7bd[_0x3eafac(0x196)](_0x3eafac(0x17d)));}[a59_0x69291(0x2b2)](_0x10d42a,_0x3d47e7,_0x5ee4e3){const _0x293ddb=a59_0x69291,_0x11a09d=[],_0x1f47a8=TIMELINE_CONFIG[_0x293ddb(0x171)],_0x414696=0x5,_0x29a79d=process['stdout'][_0x293ddb(0x1b9)]||0x78,_0x3f19b3=_0x29a79d-_0x1f47a8-_0x414696,_0x14ce3c=Math[_0x293ddb(0x14f)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x293ddb(0x1f9)](_0x3f19b3,TIMELINE_CONFIG[_0x293ddb(0x179)])),_0x147219=new Date(_0x10d42a[_0x293ddb(0x1f8)])['getTime'](),_0x3effe8=_0x10d42a['finishedAt']?new Date(_0x10d42a['finishedAt'])[_0x293ddb(0x1b3)]():Date[_0x293ddb(0x14d)](),_0x1b1d5d={'start':_0x147219,'end':_0x3effe8,'duration':_0x3effe8-_0x147219},_0xf7752e=new Map(),_0x4aaec4=[];for(const _0x530942 of _0x3d47e7){if(_0x530942['startedAt']){const _0x4e05a0=new Date(_0x530942[_0x293ddb(0x26e)])['getTime'](),_0x410d80=_0x530942['updatedAt']?new Date(_0x530942[_0x293ddb(0x143)])['getTime']():Date[_0x293ddb(0x14d)](),_0x2f351d={'start':_0x4e05a0,'end':_0x410d80,'duration':_0x410d80-_0x4e05a0};_0xf7752e[_0x293ddb(0x1d0)](_0x530942['id'],_0x2f351d),_0x4aaec4[_0x293ddb(0x2ec)]({'name':_0x530942['fullName'],'state':_0x530942['state']||'unknown','window':_0x2f351d});}else _0x4aaec4['push']({'name':_0x530942['fullName'],'state':_0x530942[_0x293ddb(0x1aa)]||_0x293ddb(0x2d7),'window':undefined});}_0x4aaec4[_0x293ddb(0x279)]((_0x5890c9,_0x585b8a)=>{const _0x23687d=_0x293ddb;if(!_0x5890c9['window'])return 0x1;if(!_0x585b8a['window'])return-0x1;return _0x5890c9[_0x23687d(0x300)][_0x23687d(0x2a2)]-_0x585b8a[_0x23687d(0x300)][_0x23687d(0x2a2)];});const _0x1907cb=_0x4aaec4[_0x293ddb(0x204)],_0x417db8=_0x1907cb>TIMELINE_CONFIG[_0x293ddb(0x1fc)];_0x417db8&&_0x4aaec4['splice'](TIMELINE_CONFIG[_0x293ddb(0x1fc)]);const _0x24f952=calculateTimeScale(_0x1b1d5d,_0x14ce3c),_0x379f19=_0x10d42a[_0x293ddb(0x28b)]?_0x10d42a[_0x293ddb(0x210)]?a59_0x34c7bd[_0x293ddb(0x2d5)](_0x293ddb(0x210)):a59_0x34c7bd['red'](_0x293ddb(0x274)):a59_0x34c7bd[_0x293ddb(0x269)](_0x293ddb(0x152)),_0x327d97=_0x10d42a['project']?.['id'],_0x276888=_0x10d42a[_0x293ddb(0x220)];let _0x1a8bf6;if(_0x327d97&&_0x276888){const _0x1b1635=getWorkflowAttemptUrl(_0x5ee4e3,_0x327d97,_0x276888,_0x10d42a['id']);_0x1a8bf6=hyperlink(a59_0x34c7bd[_0x293ddb(0x27d)](_0x10d42a['id']),_0x1b1635);}else _0x1a8bf6=a59_0x34c7bd['dim'](_0x10d42a['id']);_0x11a09d[_0x293ddb(0x2ec)](_0x293ddb(0x16c)+_0x1a8bf6+_0x293ddb(0x2d2)+_0x379f19+'\x20-\x20'+formatElapsed(_0x1b1d5d['duration']));if(_0x4aaec4[_0x293ddb(0x204)]>0x0){const _0x497403=renderTimeAxis(_0x24f952,_0x14ce3c),_0x41ccfe=new Date(_0x1b1d5d[_0x293ddb(0x2a2)]),_0x47e2dc=formatDate(_0x41ccfe),_0x132e43=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x1f47a8,_0x57c976=_0x47e2dc['padStart'](_0x132e43),_0x5803be=a59_0x34c7bd[_0x293ddb(0x27d)](_0x57c976);_0x11a09d[_0x293ddb(0x2ec)](_0x5803be+'\x20'+_0x497403);for(const _0x18b938 of _0x4aaec4){_0x11a09d[_0x293ddb(0x2ec)](renderTaskRow(_0x18b938,_0x24f952,_0x14ce3c,_0x1f47a8));}const _0x35e4e3=calculateStats(_0x4aaec4);_0x11a09d[_0x293ddb(0x2ec)](formatStats(_0x35e4e3)),_0x417db8&&_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd['yellow'](_0x293ddb(0x271)+TIMELINE_CONFIG[_0x293ddb(0x1fc)]+'\x20of\x20'+_0x1907cb+'\x20tasks')),_0x11a09d[_0x293ddb(0x2ec)](''),_0x11a09d[_0x293ddb(0x2ec)](a59_0x34c7bd[_0x293ddb(0x27d)](_0x293ddb(0x25f))+(_0x293ddb(0x1c1)+_0x10d42a['id']+'\x20logs')+a59_0x34c7bd[_0x293ddb(0x27d)]('\x20to\x20see\x20detailed\x20logs'));}else _0x11a09d['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x11a09d[_0x293ddb(0x19d)]('\x0a');}[a59_0x69291(0x1e2)](_0x3dd9bb,_0x5010d3){const _0x4a0e97=a59_0x69291,_0x1968d1=new Date(_0x3dd9bb[_0x4a0e97(0x1f8)])['getTime'](),_0x4acc90=_0x3dd9bb['finishedAt']?new Date(_0x3dd9bb[_0x4a0e97(0x265)])[_0x4a0e97(0x1b3)]():Date[_0x4a0e97(0x14d)](),_0x20bae9=_0x4acc90-_0x1968d1,_0x5ba3ef=[];for(const _0x258d77 of _0x5010d3){if(_0x258d77[_0x4a0e97(0x26e)]){const _0x1fde96=new Date(_0x258d77[_0x4a0e97(0x26e)])[_0x4a0e97(0x1b3)](),_0x42eb15=_0x258d77[_0x4a0e97(0x143)]?new Date(_0x258d77[_0x4a0e97(0x143)])[_0x4a0e97(0x1b3)]():Date['now']();_0x5ba3ef[_0x4a0e97(0x2ec)]({'name':_0x258d77['fullName'],'state':_0x258d77[_0x4a0e97(0x1aa)]||'unknown','window':{'start':_0x1fde96,'end':_0x42eb15,'duration':_0x42eb15-_0x1fde96}});}else _0x5ba3ef['push']({'name':_0x258d77[_0x4a0e97(0x2ff)],'state':_0x258d77[_0x4a0e97(0x1aa)]||_0x4a0e97(0x2d7),'window':undefined});}const _0x23e821=calculateStats(_0x5ba3ef);return{'attempt':{'id':_0x3dd9bb['id'],'status':_0x3dd9bb['done']?_0x3dd9bb[_0x4a0e97(0x210)]?_0x4a0e97(0x210):_0x4a0e97(0x274):_0x4a0e97(0x152),'createdAt':_0x3dd9bb[_0x4a0e97(0x1f8)],'finishedAt':_0x3dd9bb[_0x4a0e97(0x265)],'duration_ms':_0x20bae9},'tasks':_0x5ba3ef[_0x4a0e97(0x1b8)](_0x5d1c8e=>({'name':_0x5d1c8e['name'],'state':_0x5d1c8e[_0x4a0e97(0x1aa)],'startedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)][_0x4a0e97(0x2a2)])['toISOString']():null,'updatedAt':_0x5d1c8e[_0x4a0e97(0x300)]?new Date(_0x5d1c8e[_0x4a0e97(0x300)]['end'])['toISOString']():null,'duration_ms':_0x5d1c8e['window']?.['duration']||null})),'stats':_0x23e821};}}function formatScheduleLine(_0x47f96c){const _0x1fe9fb=a59_0x69291,_0x4195eb=_0x47f96c[_0x1fe9fb(0x132)]?a59_0x34c7bd['yellow']('\x20(disabled)'):'',_0x5cd6df=_0x47f96c['project']?.['name']?a59_0x34c7bd[_0x1fe9fb(0x27d)]('\x20['+_0x47f96c[_0x1fe9fb(0x235)][_0x1fe9fb(0x268)]+']'):'',_0x3d7c93=_0x47f96c[_0x1fe9fb(0x239)]?a59_0x34c7bd[_0x1fe9fb(0x27d)](_0x1fe9fb(0x133)+new Date(_0x47f96c[_0x1fe9fb(0x239)])[_0x1fe9fb(0x1c4)]()):'';return _0x1fe9fb(0x1c5)+_0x47f96c['id']+'\x20'+(_0x47f96c['workflow']?.[_0x1fe9fb(0x268)]||_0x1fe9fb(0x159))+_0x5cd6df+_0x4195eb+_0x3d7c93;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x225);[a59_0x69291(0x134)]=a59_0x69291(0x2f4);async[a59_0x69291(0x2fa)](_0x3ce257){const _0x455f5c=a59_0x69291,{options:_0x254bee,args:_0x33d165,tdx:_0x139874}=_0x3ce257,{scheduleId:_0xa021c2}=_0x254bee;if(_0xa021c2&&_0x33d165[0x0])return console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x2f8)](_0x455f5c(0x287)),_0x455f5c(0x1d3)),console[_0x455f5c(0x274)](a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x2b6))),0x1;if(_0xa021c2){const _0x4fa854=await withSpinner(_0x455f5c(0x156)+_0xa021c2+'...',()=>_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x2f3)](_0xa021c2),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0xc446cc=_0x4fa854['data'];return isStructuredFormat(_0x254bee)?await handleSingleObjectOutput(_0xc446cc,_0x254bee):(console[_0x455f5c(0x274)](_0x455f5c(0x2ed)),console[_0x455f5c(0x296)](formatScheduleLine(_0xc446cc))),0x0;}const _0x3291a2=this[_0x455f5c(0x1a5)](_0x33d165,_0x254bee);if(!_0x3291a2)return 0x1;const {projectName:_0x55fb78,workflowName:_0x46f3dc}=_0x3291a2,_0x11adb4=_0x55fb78?'\x27'+_0x55fb78+(_0x46f3dc?'.'+_0x46f3dc:'')+'\x27':undefined,_0x249f38=await withSpinner(_0x11adb4?'Listing\x20schedules\x20for\x20'+_0x11adb4+_0x455f5c(0x1c3):_0x455f5c(0x23d),()=>_0x55fb78?_0x139874['workflow']['listProjectSchedules'](_0x55fb78,{'workflow':_0x46f3dc,'limit':_0x254bee[_0x455f5c(0x2db)]}):_0x139874[_0x455f5c(0x19a)][_0x455f5c(0x1af)]({'limit':_0x254bee[_0x455f5c(0x2db)]}),{'verbose':_0x254bee[_0x455f5c(0x151)]}),_0x45f1d1=_0x249f38['data'],_0x95bccb=_0x254bee[_0x455f5c(0x2db)]&&_0x45f1d1[_0x455f5c(0x204)]>=_0x254bee[_0x455f5c(0x2db)]?a59_0x34c7bd[_0x455f5c(0x27d)](_0x455f5c(0x263)):'';console[_0x455f5c(0x274)](_0x455f5c(0x164)+_0x45f1d1[_0x455f5c(0x204)]+'\x20schedule'+(_0x45f1d1[_0x455f5c(0x204)]!==0x1?'s':'')+_0x95bccb);if(isStructuredFormat(_0x254bee))await handleSDKOutput(_0x45f1d1,_0x254bee);else{if(_0x45f1d1['length']===0x0)console[_0x455f5c(0x296)](_0x455f5c(0x257));else for(const _0x5cf9b1 of _0x45f1d1){console[_0x455f5c(0x296)](formatScheduleLine(_0x5cf9b1));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x144);[a59_0x69291(0x134)]='Enable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0x5407c2){const _0x530b5e=a59_0x69291,{options:_0xc3e534,args:_0xd5ddb3,tdx:_0x4091cc}=_0x5407c2,_0x47b98d=_0xd5ddb3[0x0];if(!_0x47b98d)return console[_0x530b5e(0x274)](a59_0x34c7bd['red'](_0x530b5e(0x287)),_0x530b5e(0x1ce)),console[_0x530b5e(0x274)](a59_0x34c7bd['dim'](_0x530b5e(0x12e))),console[_0x530b5e(0x274)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x1f2))),0x1;const {backfill:_0x555b7c,nextTime:_0x42321e}=_0xc3e534,_0x1f78af={};if(_0x555b7c!==undefined)_0x1f78af[_0x530b5e(0x208)]=!_0x555b7c;if(_0x42321e!==undefined)_0x1f78af['nextTime']=_0x42321e;const _0x21d8ee=await withSpinner(_0x530b5e(0x1a8)+_0x47b98d+_0x530b5e(0x1c3),()=>_0x4091cc[_0x530b5e(0x19a)][_0x530b5e(0x154)](_0x47b98d,_0x1f78af),{'verbose':_0xc3e534[_0x530b5e(0x151)]}),_0x48ae01=_0x21d8ee[_0x530b5e(0x162)];return isStructuredFormat(_0xc3e534)?await handleSingleObjectOutput(_0x48ae01,_0xc3e534):(console[_0x530b5e(0x296)](_0x530b5e(0x20f)+_0x47b98d+_0x530b5e(0x1ed)+(_0x48ae01[_0x530b5e(0x19a)]?.[_0x530b5e(0x268)]||'unknown')+')'),_0x48ae01[_0x530b5e(0x239)]&&console[_0x530b5e(0x296)](a59_0x34c7bd[_0x530b5e(0x27d)](_0x530b5e(0x15f)+new Date(_0x48ae01[_0x530b5e(0x239)])[_0x530b5e(0x1c4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x69291(0x268)]=a59_0x69291(0x136);[a59_0x69291(0x134)]='Disable\x20a\x20workflow\x20schedule';async[a59_0x69291(0x2fa)](_0xb3313a){const _0x2c1892=a59_0x69291,{options:_0x4e33a4,args:_0x46ff91,tdx:_0x1408e6}=_0xb3313a,_0x136442=_0x46ff91[0x0];if(!_0x136442)return console[_0x2c1892(0x274)](a59_0x34c7bd[_0x2c1892(0x2f8)]('Error:'),'Schedule\x20ID\x20is\x20required'),console[_0x2c1892(0x274)](a59_0x34c7bd['dim'](_0x2c1892(0x2c3))),console['error'](a59_0x34c7bd[_0x2c1892(0x27d)](_0x2c1892(0x1f2))),0x1;const _0x4004fa=await withSpinner(_0x2c1892(0x303)+_0x136442+_0x2c1892(0x1c3),()=>_0x1408e6[_0x2c1892(0x19a)][_0x2c1892(0x2a0)](_0x136442),{'verbose':_0x4e33a4[_0x2c1892(0x151)]}),_0x1830ac=_0x4004fa[_0x2c1892(0x162)];return isStructuredFormat(_0x4e33a4)?await handleSingleObjectOutput(_0x1830ac,_0x4e33a4):console[_0x2c1892(0x296)]('✔\x20Schedule\x20#'+_0x136442+_0x2c1892(0x2c0)+(_0x1830ac[_0x2c1892(0x19a)]?.[_0x2c1892(0x268)]||_0x2c1892(0x253))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a57_0x2187(_0x82b528,_0x50b021){_0x82b528=_0x82b528-0x188;const _0x70cc8b=a57_0x70cc();let _0x218749=_0x70cc8b[_0x82b528];return _0x218749;}(function(_0x3564cf,_0x5693fa){const _0x48e0a5=a57_0x2187,_0x9de22c=_0x3564cf();while(!![]){try{const _0x8c413=parseInt(_0x48e0a5(0x19a))/0x1*(parseInt(_0x48e0a5(0x194))/0x2)+-parseInt(_0x48e0a5(0x193))/0x3+-parseInt(_0x48e0a5(0x189))/0x4*(parseInt(_0x48e0a5(0x188))/0x5)+parseInt(_0x48e0a5(0x195))/0x6+parseInt(_0x48e0a5(0x199))/0x7*(-parseInt(_0x48e0a5(0x18a))/0x8)+-parseInt(_0x48e0a5(0x196))/0x9+parseInt(_0x48e0a5(0x18d))/0xa;if(_0x8c413===_0x5693fa)break;else _0x9de22c['push'](_0x9de22c['shift']());}catch(_0x5d8659){_0x9de22c['push'](_0x9de22c['shift']());}}}(a57_0x70cc,0xbccef));import{platform}from'os';function a57_0x70cc(){const _0x367ed=['8475750AKdNwL','Bearer\x20','replace','77LbrRbr','1213153DTNEJA','675vwKMHn','428yRqZfg','1067608WFDhBJ',';\x20node/','tdx','19980100dKbaur','Authorization','tdx/','length','X-Trino-User','version','1889775roMJct','2izoNuZ','3697662gHYlxd'];a57_0x70cc=function(){return _0x367ed;};return a57_0x70cc();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x18fc40=a57_0x2187,_0xa1cc4e=getVersion(),_0x5953ea=platform(),_0x5e11f1=process[_0x18fc40(0x192)][_0x18fc40(0x198)]('v','');return _0x18fc40(0x18f)+_0xa1cc4e+'\x20('+_0x5953ea+_0x18fc40(0x18b)+_0x5e11f1+')';}export function getAuthHeaders(_0x5139c2,_0x1692f4,_0x2aa36e){const _0x3f374b=a57_0x2187,_0x3915c3=getVersion(),_0x2cf6b2={'User-Agent':getUserAgent(),'X-TD-Client':_0x3f374b(0x18c),'X-TD-Client-Version':_0x3915c3};if(_0x2aa36e)_0x2cf6b2[_0x3f374b(0x18e)]=_0x3f374b(0x197)+_0x2aa36e;else _0x1692f4&&(_0x2cf6b2[_0x3f374b(0x18e)]='TD1\x20'+_0x1692f4);return _0x2cf6b2;}export function toHeaderRecord(_0x483fe5){const _0x3c82dc={};for(const [_0x6affdd,_0x5bfcbb]of Object['entries'](_0x483fe5)){_0x5bfcbb!==undefined&&(_0x3c82dc[_0x6affdd]=_0x5bfcbb);}return _0x3c82dc;}export function getTrinoHeaders(_0x3050f7,_0x13d726,_0x359d70){const _0x4068b1=a57_0x2187,_0x21673=getAuthHeaders(_0x3050f7),_0x4dc53b=toHeaderRecord(_0x21673);if(_0x359d70)_0x4dc53b['Authorization']=_0x4068b1(0x197)+_0x359d70;else _0x13d726&&(_0x4dc53b[_0x4068b1(0x191)]=_0x13d726);return _0x4dc53b;}export function hasAPIKey(_0x2e2394){const _0x40f1ff=a57_0x2187,_0x1a9e85=getAPIKey();return _0x1a9e85!==undefined&&_0x1a9e85[_0x40f1ff(0x190)]>0x0;}
1
+ (function(_0x1d67c0,_0x4bf81f){const _0x637e4a=a60_0xd125,_0x5487ae=_0x1d67c0();while(!![]){try{const _0xff6d9e=-parseInt(_0x637e4a(0x163))/0x1+-parseInt(_0x637e4a(0x159))/0x2*(-parseInt(_0x637e4a(0x15b))/0x3)+parseInt(_0x637e4a(0x168))/0x4*(-parseInt(_0x637e4a(0x15d))/0x5)+-parseInt(_0x637e4a(0x15f))/0x6*(-parseInt(_0x637e4a(0x15a))/0x7)+-parseInt(_0x637e4a(0x165))/0x8+parseInt(_0x637e4a(0x15e))/0x9*(-parseInt(_0x637e4a(0x158))/0xa)+-parseInt(_0x637e4a(0x161))/0xb*(-parseInt(_0x637e4a(0x16a))/0xc);if(_0xff6d9e===_0x4bf81f)break;else _0x5487ae['push'](_0x5487ae['shift']());}catch(_0x39ff8b){_0x5487ae['push'](_0x5487ae['shift']());}}}(a60_0x3cb4,0xb7a0a));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5b4e2d=a60_0xd125,_0x47d06f=getVersion(),_0x43fe26=platform(),_0x5bb0f6=process[_0x5b4e2d(0x166)][_0x5b4e2d(0x16b)]('v','');return _0x5b4e2d(0x160)+_0x47d06f+'\x20('+_0x43fe26+_0x5b4e2d(0x167)+_0x5bb0f6+')';}export function getAuthHeaders(_0x55fe59,_0x15007a,_0x1b9620){const _0xbff96d=a60_0xd125,_0x2b9d94=getVersion(),_0x57ef43={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x2b9d94};if(_0x1b9620)_0x57ef43['Authorization']=_0xbff96d(0x169)+_0x1b9620;else _0x15007a&&(_0x57ef43['Authorization']=_0xbff96d(0x157)+_0x15007a);return _0x57ef43;}export function toHeaderRecord(_0xf683a2){const _0x453832=a60_0xd125,_0x5f49db={};for(const [_0x18e477,_0x219230]of Object[_0x453832(0x164)](_0xf683a2)){_0x219230!==undefined&&(_0x5f49db[_0x18e477]=_0x219230);}return _0x5f49db;}export function getTrinoHeaders(_0x4e63ef,_0x2ec458,_0x127bbb){const _0x1f3265=a60_0xd125,_0x508318=getAuthHeaders(_0x4e63ef),_0x56bf1e=toHeaderRecord(_0x508318);if(_0x127bbb)_0x56bf1e[_0x1f3265(0x162)]=_0x1f3265(0x169)+_0x127bbb;else _0x2ec458&&(_0x56bf1e[_0x1f3265(0x15c)]=_0x2ec458);return _0x56bf1e;}function a60_0xd125(_0x19de45,_0x5b847f){_0x19de45=_0x19de45-0x157;const _0x3cb4e3=a60_0x3cb4();let _0xd1250b=_0x3cb4e3[_0x19de45];return _0xd1250b;}export function hasAPIKey(_0x18cfdd){const _0x54c19=a60_0xd125,_0x32d86a=getAPIKey();return _0x32d86a!==undefined&&_0x32d86a[_0x54c19(0x16c)]>0x0;}function a60_0x3cb4(){const _0x330443=['35001696kAjjPP','replace','length','TD1\x20','20qCnNvq','34tijlaZ','7zYscUG','107634cGInWR','X-Trino-User','5DPNlES','6603345UlXrom','2783142yArtxY','tdx/','11XZjzRX','Authorization','736649jMjxYI','entries','5055200MmoaSL','version',';\x20node/','1609976jKmuUS','Bearer\x20'];a60_0x3cb4=function(){return _0x330443;};return a60_0x3cb4();}