@treasuredata/tdx 2026.8.0 → 2026.8.2

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 (263) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts +9 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.d.ts +10 -1
  19. package/dist/commands/claude-command.d.ts.map +1 -1
  20. package/dist/commands/claude-command.js +1 -1
  21. package/dist/commands/claude-command.js.map +1 -1
  22. package/dist/commands/claude-statusline-command.js +1 -1
  23. package/dist/commands/claude-usage-command.js +1 -1
  24. package/dist/commands/command.js +1 -1
  25. package/dist/commands/connection-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/delivery-command.js +1 -1
  28. package/dist/commands/describe.js +1 -1
  29. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  30. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  31. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  32. package/dist/commands/engage-campaign-pull-command.js +1 -1
  33. package/dist/commands/engage-campaign-push-command.js +1 -1
  34. package/dist/commands/engage-campaign-validate-command.js +1 -1
  35. package/dist/commands/engage-command.js +1 -1
  36. package/dist/commands/engage-template-pull-command.js +1 -1
  37. package/dist/commands/engage-template-push-command.js +1 -1
  38. package/dist/commands/engage-template-validate-command.js +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/parent-segment-command.js +1 -1
  45. package/dist/commands/policy-command.js +1 -1
  46. package/dist/commands/profile-command.js +1 -1
  47. package/dist/commands/profiles-command.js +1 -1
  48. package/dist/commands/query-command.js +1 -1
  49. package/dist/commands/schedule-command.js +1 -1
  50. package/dist/commands/segment-command.js +1 -1
  51. package/dist/commands/segment-create-command.js +1 -1
  52. package/dist/commands/segment-fields-command.js +1 -1
  53. package/dist/commands/segment-move-command.js +1 -1
  54. package/dist/commands/segment-pull-command.js +1 -1
  55. package/dist/commands/segment-push-command.js +1 -1
  56. package/dist/commands/segment-update-command.js +1 -1
  57. package/dist/commands/segment-use-command.js +1 -1
  58. package/dist/commands/segment-validate-command.js +1 -1
  59. package/dist/commands/segments.js +1 -1
  60. package/dist/commands/show.js +1 -1
  61. package/dist/commands/status-command.js +1 -1
  62. package/dist/commands/table-deleted.js +1 -1
  63. package/dist/commands/tables.js +1 -1
  64. package/dist/commands/unset-command.js +1 -1
  65. package/dist/commands/upgrade-command.js +1 -1
  66. package/dist/commands/use-command.js +1 -1
  67. package/dist/commands/user-command.js +1 -1
  68. package/dist/commands/work-command.js +1 -1
  69. package/dist/commands/workflow-command.js +1 -1
  70. package/dist/core/auth.js +1 -1
  71. package/dist/core/command-output.js +1 -1
  72. package/dist/core/config.js +1 -1
  73. package/dist/core/connection-cache.js +1 -1
  74. package/dist/core/constants.js +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.js +1 -1
  77. package/dist/core/keychain.js +1 -1
  78. package/dist/core/oauth-keychain.js +1 -1
  79. package/dist/core/oauth.js +1 -1
  80. package/dist/core/profile.js +1 -1
  81. package/dist/core/project-config.js +1 -1
  82. package/dist/core/session.js +1 -1
  83. package/dist/core/site-mismatch.js +1 -1
  84. package/dist/core/user-cache.js +1 -1
  85. package/dist/core/version.js +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/mcp/server.js +1 -1
  88. package/dist/mcp/tools/index.js +1 -1
  89. package/dist/mcp/tools/tdx-run.js +1 -1
  90. package/dist/mcp/tools/tdx-search.js +1 -1
  91. package/dist/mcp/tools/work-create-item.js +1 -1
  92. package/dist/mcp/utils.js +1 -1
  93. package/dist/proxy/claude-usage-tracker.js +1 -1
  94. package/dist/proxy/passthrough-server.js +1 -1
  95. package/dist/proxy/sse-usage-parser.js +1 -1
  96. package/dist/sdk/agent/agent-config.js +1 -1
  97. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  98. package/dist/sdk/agent/agent-yaml.js +1 -1
  99. package/dist/sdk/agent/test/evaluator.js +1 -1
  100. package/dist/sdk/agent/test/executor.js +1 -1
  101. package/dist/sdk/agent/test/index.js +1 -1
  102. package/dist/sdk/agent/test/output.js +1 -1
  103. package/dist/sdk/agent/test/parser.js +1 -1
  104. package/dist/sdk/agent/tool-target-registry.js +1 -1
  105. package/dist/sdk/api.js +1 -1
  106. package/dist/sdk/auth-token.d.ts +23 -0
  107. package/dist/sdk/auth-token.d.ts.map +1 -0
  108. package/dist/sdk/auth-token.js +1 -0
  109. package/dist/sdk/auth-token.js.map +1 -0
  110. package/dist/sdk/cas/cas-api-client.js +1 -1
  111. package/dist/sdk/cas/cas-audience-schema.d.ts +2 -0
  112. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  113. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  114. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  115. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  116. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  117. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  118. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  119. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  120. package/dist/sdk/cas/index.js +1 -1
  121. package/dist/sdk/cas/pull-workflow.js +1 -1
  122. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  123. package/dist/sdk/cas/push-workflow.js +1 -1
  124. package/dist/sdk/cas/push-workflow.js.map +1 -1
  125. package/dist/sdk/cas/types.d.ts +2 -0
  126. package/dist/sdk/cas/types.d.ts.map +1 -1
  127. package/dist/sdk/cas/validate-files.js +1 -1
  128. package/dist/sdk/client/cdp-api-client.js +1 -1
  129. package/dist/sdk/client/delivery-api-client.js +1 -1
  130. package/dist/sdk/client/endpoints.js +1 -1
  131. package/dist/sdk/client/engage-api-client.js +1 -1
  132. package/dist/sdk/client/http-client.js +1 -1
  133. package/dist/sdk/client/llm-api-client.js +1 -1
  134. package/dist/sdk/client/oauth-refresh.js +1 -1
  135. package/dist/sdk/client/rate-limiter.js +1 -1
  136. package/dist/sdk/client/td-api-client.js +1 -1
  137. package/dist/sdk/client/trino-api-client.js +1 -1
  138. package/dist/sdk/client/workflow-client.js +1 -1
  139. package/dist/sdk/connection-validator.js +1 -1
  140. package/dist/sdk/connection.js +1 -1
  141. package/dist/sdk/delivery.js +1 -1
  142. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  143. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  144. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  145. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  146. package/dist/sdk/engage/campaign-pull.js +1 -1
  147. package/dist/sdk/engage/campaign-push.js +1 -1
  148. package/dist/sdk/engage/campaign-validator.js +1 -1
  149. package/dist/sdk/engage/campaign-yaml.js +1 -1
  150. package/dist/sdk/engage/template-pull.js +1 -1
  151. package/dist/sdk/engage/template-push.js +1 -1
  152. package/dist/sdk/engage/template-validator.js +1 -1
  153. package/dist/sdk/engage/template-yaml.js +1 -1
  154. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  155. package/dist/sdk/engage/types/campaign-def.js +1 -1
  156. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  157. package/dist/sdk/engage/types/template-schema.js +1 -1
  158. package/dist/sdk/engage.js +1 -1
  159. package/dist/sdk/errors.js +1 -1
  160. package/dist/sdk/index.js +1 -1
  161. package/dist/sdk/io/index.js +1 -1
  162. package/dist/sdk/io/node-filesystem.js +1 -1
  163. package/dist/sdk/job.js +1 -1
  164. package/dist/sdk/journey.js +1 -1
  165. package/dist/sdk/llm/chat-cache.js +1 -1
  166. package/dist/sdk/llm/index.js +1 -1
  167. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  168. package/dist/sdk/llm/model-factors.js +1 -1
  169. package/dist/sdk/llm/user-settings.js +1 -1
  170. package/dist/sdk/personalization.js +1 -1
  171. package/dist/sdk/policy.js +1 -1
  172. package/dist/sdk/query/deleted-table-validation.js +1 -1
  173. package/dist/sdk/query/index.js +1 -1
  174. package/dist/sdk/query/sql-parser.js +1 -1
  175. package/dist/sdk/realtime.js +1 -1
  176. package/dist/sdk/schedule.js +1 -1
  177. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  178. package/dist/sdk/segment/fields-display.js +1 -1
  179. package/dist/sdk/segment/file-discovery.js +1 -1
  180. package/dist/sdk/segment/journey-utils.js +1 -1
  181. package/dist/sdk/segment/journey-validator.js +1 -1
  182. package/dist/sdk/segment/journey-yaml.js +1 -1
  183. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  184. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  185. package/dist/sdk/segment/pull-workflow.js +1 -1
  186. package/dist/sdk/segment/push-recovery.js +1 -1
  187. package/dist/sdk/segment/push-workflow.js +1 -1
  188. package/dist/sdk/segment/resolution-context.js +1 -1
  189. package/dist/sdk/segment/segment-path-parser.js +1 -1
  190. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  191. package/dist/sdk/segment/segment-validator.js +1 -1
  192. package/dist/sdk/segment/target-resolution.js +1 -1
  193. package/dist/sdk/segment/tdx-config.js +1 -1
  194. package/dist/sdk/segment/types/activation-schema.js +1 -1
  195. package/dist/sdk/segment/types/journey-def.js +1 -1
  196. package/dist/sdk/segment/types/journey-schema.js +1 -1
  197. package/dist/sdk/segment/types/segment-def.js +1 -1
  198. package/dist/sdk/segment/types/segment-schema.js +1 -1
  199. package/dist/sdk/segment/validate-files.js +1 -1
  200. package/dist/sdk/segment/yaml-validator.js +1 -1
  201. package/dist/sdk/segment.js +1 -1
  202. package/dist/sdk/types/cas.d.ts +4 -0
  203. package/dist/sdk/types/cas.d.ts.map +1 -1
  204. package/dist/sdk/types/index.js +1 -1
  205. package/dist/sdk/types/progress.js +1 -1
  206. package/dist/sdk/types/workspace.js +1 -1
  207. package/dist/sdk/user.js +1 -1
  208. package/dist/sdk/util/format-detector.js +1 -1
  209. package/dist/sdk/util/formatters.js +1 -1
  210. package/dist/sdk/util/index.js +1 -1
  211. package/dist/sdk/util/paginate.js +1 -1
  212. package/dist/sdk/util/tree-formatter.js +1 -1
  213. package/dist/sdk/util/tree-search.js +1 -1
  214. package/dist/sdk/workflow/archive-validation.js +1 -1
  215. package/dist/sdk/workflow/clone-workflow.js +1 -1
  216. package/dist/sdk/workflow/index.js +1 -1
  217. package/dist/sdk/workflow/pull-workflow.js +1 -1
  218. package/dist/sdk/workflow/push-workflow.js +1 -1
  219. package/dist/sdk/workflow/task-graph.js +1 -1
  220. package/dist/sdk/workflow/tdx-config.js +1 -1
  221. package/dist/sdk/workflow/workflow-utils.js +1 -1
  222. package/dist/sdk/workspace/access-tracker.js +1 -1
  223. package/dist/sdk/workspace/frontmatter.js +1 -1
  224. package/dist/sdk/workspace/git.js +1 -1
  225. package/dist/sdk/workspace/index.js +1 -1
  226. package/dist/sdk/workspace/templates.js +1 -1
  227. package/dist/sdk/workspace/weekly.js +1 -1
  228. package/dist/sdk/workspace/wikilinks.js +1 -1
  229. package/dist/test-utils/command-runner.js +1 -1
  230. package/dist/test-utils/factories.js +1 -1
  231. package/dist/test-utils/fixtures.js +1 -1
  232. package/dist/test-utils/http-mock.js +1 -1
  233. package/dist/test-utils/index.js +1 -1
  234. package/dist/utils/async.js +1 -1
  235. package/dist/utils/claude-code-state.js +1 -1
  236. package/dist/utils/colors.js +1 -1
  237. package/dist/utils/diff.js +1 -1
  238. package/dist/utils/file-permissions.js +1 -1
  239. package/dist/utils/file-reader.js +1 -1
  240. package/dist/utils/github-releases.js +1 -1
  241. package/dist/utils/global-cache.js +1 -1
  242. package/dist/utils/json-loader.js +1 -1
  243. package/dist/utils/local-cache.js +1 -1
  244. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  245. package/dist/utils/logger/formatters/index.js +1 -1
  246. package/dist/utils/logger/handlers/console-handler.js +1 -1
  247. package/dist/utils/logger/handlers/file-handler.js +1 -1
  248. package/dist/utils/logger/handlers/index.js +1 -1
  249. package/dist/utils/logger/handlers/null-handler.js +1 -1
  250. package/dist/utils/logger/index.js +1 -1
  251. package/dist/utils/logger/logger.js +1 -1
  252. package/dist/utils/logger/types.js +1 -1
  253. package/dist/utils/option-validation.js +1 -1
  254. package/dist/utils/process.js +1 -1
  255. package/dist/utils/prompt.js +1 -1
  256. package/dist/utils/proxy-fetch.js +1 -1
  257. package/dist/utils/spinner.js +1 -1
  258. package/dist/utils/sse-parser.js +1 -1
  259. package/dist/utils/string-utils.js +1 -1
  260. package/dist/utils/table-ref-parser.js +1 -1
  261. package/dist/utils/tdx-logger.js +1 -1
  262. package/dist/utils/version-check.js +1 -1
  263. package/package.json +1 -1
@@ -1 +1 @@
1
- const a59_0x5f4ff5=a59_0x47c9;(function(_0x1bd117,_0x10894){const _0x234eef=a59_0x47c9,_0x2df622=_0x1bd117();while(!![]){try{const _0x3b576d=-parseInt(_0x234eef(0x1b5))/0x1*(parseInt(_0x234eef(0x27f))/0x2)+-parseInt(_0x234eef(0x11b))/0x3+parseInt(_0x234eef(0x149))/0x4*(parseInt(_0x234eef(0x274))/0x5)+parseInt(_0x234eef(0x181))/0x6+parseInt(_0x234eef(0x14a))/0x7*(-parseInt(_0x234eef(0x124))/0x8)+parseInt(_0x234eef(0x1d3))/0x9*(parseInt(_0x234eef(0x266))/0xa)+-parseInt(_0x234eef(0x24e))/0xb;if(_0x3b576d===_0x10894)break;else _0x2df622['push'](_0x2df622['shift']());}catch(_0x1b9ff2){_0x2df622['push'](_0x2df622['shift']());}}}(a59_0x5f4b,0xcd576));import a59_0xc31aad from'chalk';import{existsSync}from'fs';import a59_0x532ea4 from'path';import{BaseCommand}from'./command.js';function a59_0x5f4b(){const _0x1b0907=['Fetching\x20workflow\x20','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','workflow:attempts','Resume\x20from:\x20','MAX_LABEL_COUNT','Listing\x20workflow\x20projects...','yes','resolveProjectId','join','Auto-selected\x20latest\x20session:\x20','success','No\x20attempts\x20found','trimEnd','Enabling\x20schedule\x20#','blue','Tip:\x20cd\x20to\x20workflows/','title','5343836OPxkVd','312004GcoFDn','Loading\x20sessions...','(use\x20--limit\x20to\x20see\x20more)','sessionTime','indexOf','Listing\x20schedules\x20for\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','→\x20Project:\x20','Source\x20directory\x20is\x20required','unknown','Download\x20workflow\x20project\x20from\x20Treasure\x20AI','limit','Session\x20not\x20found:\x20','sys','pullProject','\x20has\x20no\x20attempts','✔\x20Secret\x20\x27','workflow:push','existingProjectId','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','newProjectId','kill','Pull\x20workflow\x20project\x20to\x20local\x20folder','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Retrying\x20session...','\x20\x20Changes:\x20','sessionId','context','Workflow:\x20','dryRun','Error:\x20Project\x20name\x20is\x20required','isTTY','planned','log','tdx.json','No\x20workflow\x20tdx.json\x20found','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','setSecrets','applyPullProject','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','updatedAt','Disabling\x20schedule\x20#','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','get','includes','split','index','workflow:timeline','List\x20workflow\x20execution\x20sessions','attempts','executeCloneProject','state','generateSessionTimelineRows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','2638518zSlAzi','→\x20New\x20project:\x20','navigateSessionsInteractive','fileCount','workflow:upload','data','\x20enabled\x20(','Listing\x20secrets...','Enable\x20a\x20workflow\x20schedule','task','No\x20sessions\x20found\x20for:\x20','ICON_WIDTH','workflow:schedule:enable','modified','\x20is\x20not\x20a\x20directory','all','workflow:secrets:list','Cloning\x20to\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision:\x20','write','\x20(use\x20--limit\x20to\x20show\x20more)','group_error','Analyzing\x20project...','No\x20workflow\x20sessions\x20found','\x20tasks','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Using\x20attempt\x20','✔\x20Clone\x20complete','stringify','filter','params','MAX_POLL_ITERATIONS','yellow','\x20\x20Project\x20ID:\x20','fullName','\x22\x20with\x20new\x20revision?','finishedAt','toISOString','attempt','workflow:use','workflowProject','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','message','running','Listing\x20workflow\x20sessions...','Retry\x20a\x20session\x20or\x20attempt','executeDryRun','min','workflow:projects','workflow:pull','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','558jiNqAK','status','targetDir','disableSchedule','✔\x20Workflow\x20project\x20context\x20cleared.','Key:\x20','New\x20project\x20name:\x20','showWorkflowConsoleUrl','config','Session\x20time:','getHours','duration','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','resolveProjectDir','every','MIN_LABEL_COUNT','stat','projectName','tasks','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Retry\x20started','text','✔\x20Push\x20complete','Warning:','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','...','\x20\x20Location:\x20','enableSchedule','List\x20workflows','getTime','18THkKnb','includeRetried','Invalid\x20format:\x20','LABEL_MIN_SPACING','workflow:sessions','workflow:delete','slice','now','\x20from\x20session\x20','skipSchedule','\x22\x20already\x20exists\x20(ID:\x20','GUTTER','jsonl','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','new',',\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','🔄\x20','dim','length','resumeFrom','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','getSchedule','Retrying\x20attempt...','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x20\x20Session\x20context\x20set\x20to:\x20','Updating\x20','\x20-\x20','\x20next:\x20','Workflow:','values','workflow:download','pollTimeline','Schedule\x20ID\x20is\x20required','window','Source:\x20','✔\x20Downloaded\x20','✔\x20Project:\x20','\x20sessions\x20','Downloading\x20logs...','isDirectory','cancelRequested','Validation:\x20skipped','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','bold','✔\x20Workflow\x20project\x20set\x20to:\x20','listProjectSchedules','workflow','Project:\x20','reason','type','workflowName','✔\x20Deleted\x20project\x20','List\x20all\x20workflow\x20projects','red','listSchedules','\x0aFailed\x20to\x20fetch\x20attempt\x20data','table','\x20deleted','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','replace','createdAt','Include\x20retried:\x20yes','No\x20matching\x20sessions\x20found','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','download','Loading\x20session...','set','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','buildTimelineData','msPerChar','Error:\x20Invalid\x20JSON\x20in\x20--params','readFile','MAX_TASKS_DISPLAY','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','prepareCloneProject','nextRunTime','workflow:logs','summary','Deleting\x20project\x20','\x20\x20Console:\x20','parse','repeat','Params:\x20','floor','description','Error:','\x0aDry\x20run\x20-\x20no\x20files\x20written','\x22\x20to\x20new\x20project\x20\x22','📁\x20','from','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','getWorkflow','Fetching\x20schedule\x20#','Target\x20directory:\x20','canceling','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Expected\x20format:\x20--param\x20key=value','preparePushProject','✔\x20Workflow\x20run\x20started','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','logFiles','\x20(disabled)','\x20secrets\x20set\x20for\x20project\x20\x27','💡\x20Tip:\x20Use\x20','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','Filter:\x20project=','attempt:','nextTime','cwd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','workflow:tasks','relative','No\x20sessions\x20found\x20in\x20project:\x20','Target:\x20','\x20disabled\x20(','⚠\x20Showing\x20first\x20','Attempt:\x20','\x20\x20Session\x20ID:\x20','session','\x0aPolling...\x20(','keys','6927844UPWGiq','Pushing\x20project...','Pattern:\x20','match','\x0a✔\x20Attempt\x20complete','\x20\x20tdx\x20wf\x20use\x20<project>','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20schedule','sort','No\x20log\x20content\x20found','\x1b[1A\x1b[2K','Failed\x20to\x20fetch\x20attempt\x20data','Total:\x20','getDate','Task\x20graph:','Attempt\x20ID:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','push','Resolving\x20project\x20\x27','Project\x20directory:\x20','fill','substring','Listing\x20workflows...','7283500Tvxxft','✔\x20Found\x20','projects','verbose','---\x20','renderSingleTimeline','Kill\x20a\x20running\x20attempt','Source\x20directory:\x20','-\x20nothing\x20pushed','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Project\x20name:\x20','Session\x20time:\x20','startedAt','splice','5UhsUDj','\x0aClone\x20\x22','Writing\x20files...','json','Project\x20name\x20is\x20required','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','TASK_NAME_WIDTH','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parseProjectWorkflowPattern','targetExists','2812BQazuL','Deleting\x20secret...','force','name','\x20\x20Revision:\x20','isArray','some','path','icon','Parameters:','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','changes','session_id','run','Files\x20to\x20upload:\x20','MIN_TIMELINE_WIDTH','✔\x20Schedule\x20#','\x0aError:','Pushing\x20workflow\x20project...','\x20unchanged','Select\x20a\x20workflow\x20to\x20run','utf-8','requireProject','resolve','tdx\x20wf\x20attempt\x20','resolveProject','Error:\x20Attempt\x20ID\x20is\x20required','autocomplete','workflow:secrets:delete','Revision:\x20','unchanged','startTime','No\x20attempts\x20found\x20in\x20project:\x20','\x27\x20from\x20project\x20\x27','toLowerCase','fs/promises','POLL_INTERVAL_MS','end','\x20\x20Project:\x20','📅\x20#','Analyzing\x20changes...','includeSubtasks','find','\x22?\x20This\x20cannot\x20be\x20undone.','start','Setting\x20secret...','Cancelled','Dry\x20run:\x20yes','Including\x20subtasks:\x20yes','listSecrets','sessions','logs','/sessions/','done','newProjectName','\x20task','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','follow','workflow:workflows','📋\x20','map','taskName','deleted','\x0a⚠\x20Project\x20\x22','max','durationMs','output','retryAttemptName','\x20\x20Attempt\x20ID:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','has','project','Output\x20directory:\x20','stdout','list','\x20new','projectId','\x20secret','renderSessionsTimeline','startsWith','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','Listing\x20workflow\x20attempts...','sourceDir','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','Usage:\x20tdx\x20wf\x20use\x20<project>','No\x20workflows\x20found\x20in\x20project:\x20','retryAttempt','Show\x20specific\x20attempt\x20details','workflow:run','LABEL_WIDTH_DIVISOR','.\x20Expected\x20format:\x20KEY=VALUE','clear','workflow:clone','Select\x20a\x20session\x20to\x20view\x20timeline:','No\x20sessions\x20with\x20timing\x20information','\x20of\x20','renderTimeline','sourceProjectName','getMinutes','Listing\x20schedules...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Killing\x20attempt...','error','✔\x20Showing\x20','fromTask','Force:\x20yes','Loading\x20workflows...','metadata','padStart','\x20project','Getting\x20attempt\x20details...','cyan','diff','\x20\x20Workflow:\x20','select','green','hasChanges','\x0aApply\x20these\x20changes?','2529798gkwFGT','No\x20attempts\x20found\x20for:\x20','workflow:secrets:set','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getMonth','Filter:\x20','\x20modified','pending','List\x20workflow\x20schedules','24sOHonw','attemptId','getFullYear','param','No\x20workflow\x20projects\x20found','columns','execute','localeCompare','delete','\x0a✔\x20Already\x20up\x20to\x20date','lastAttempt','format','site','toLocaleString','Select\x20a\x20task\x20to\x20view\x20logs:','ICON_SPACING','/app/workflows/','revision','workflows','Disable\x20a\x20workflow\x20schedule'];a59_0x5f4b=function(){return _0x1b0907;};return a59_0x5f4b();}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';function a59_0x47c9(_0x20e1d4,_0x2e9bb4){_0x20e1d4=_0x20e1d4-0xd4;const _0x5f4bc9=a59_0x5f4b();let _0x47c9fb=_0x5f4bc9[_0x20e1d4];return _0x47c9fb;}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a59_0x42cf4e from'prompts';function getAttemptStatusDisplay(_0x2e2989){const _0x326bbd=a59_0x47c9;if(!_0x2e2989)return{'icon':'⏳','text':''};const {done:_0x24641e,success:_0x50d5fe,cancelRequested:_0x344f29}=_0x2e2989;if(!_0x24641e)return _0x344f29?{'icon':'🛑','text':a59_0xc31aad[_0x326bbd(0x1a2)]('canceling')}:{'icon':'🔄','text':a59_0xc31aad[_0x326bbd(0x146)](_0x326bbd(0x1ad))};if(_0x50d5fe)return{'icon':'✅','text':a59_0xc31aad[_0x326bbd(0x118)]('success')};return{'icon':'❌','text':a59_0xc31aad[_0x326bbd(0x209)](_0x326bbd(0x10b))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x2fe86c,_0xb7250b,_0x4b568e=0x0){const _0x1a5701=a59_0x47c9;return _0x2fe86c[_0x4b568e]||_0xb7250b[_0x1a5701(0x1aa)];}[a59_0x5f4ff5(0x295)](_0x1e37e8,_0x2d3786,_0x40883c=0x0){const _0x276a48=a59_0x5f4ff5,_0x5a15ee=this[_0x276a48(0x298)](_0x1e37e8,_0x2d3786,_0x40883c);if(!_0x5a15ee)return console[_0x276a48(0x10b)](a59_0xc31aad[_0x276a48(0x209)](_0x276a48(0x229)),_0x276a48(0x278)),console[_0x276a48(0x10b)](a59_0xc31aad[_0x276a48(0x1e5)](_0x276a48(0x289))),null;return _0x5a15ee;}[a59_0x5f4ff5(0x27d)](_0x22a348,_0x2343ea){const _0x2d4dd0=a59_0x5f4ff5;if(_0x22a348[0x0]){const _0xcc61dc=_0x22a348[0x0][_0x2d4dd0(0x178)]('.');if(_0xcc61dc[_0x2d4dd0(0x1e6)]===0x1)return{'projectName':_0xcc61dc[0x0],'workflowName':undefined};else return _0xcc61dc[_0x2d4dd0(0x1e6)]===0x2?{'projectName':_0xcc61dc[0x0],'workflowName':_0xcc61dc[0x1]}:(console[_0x2d4dd0(0x10b)](a59_0xc31aad[_0x2d4dd0(0x209)](_0x2d4dd0(0x229)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x2343ea[_0x2d4dd0(0x1aa)],'workflowName':undefined};}[a59_0x5f4ff5(0x1c2)](_0x8c5ec8,_0x3e55ec,_0x30e89f=0x0){const _0x1129ed=a59_0x5f4ff5;if(_0x8c5ec8[_0x30e89f])return _0x8c5ec8[_0x30e89f];if(_0x3e55ec[_0x1129ed(0x1aa)]){const _0x337acf=a59_0x532ea4['join'](process[_0x1129ed(0x240)](),'workflows',_0x3e55ec[_0x1129ed(0x1aa)]);if(existsSync(a59_0x532ea4[_0x1129ed(0x140)](_0x337acf,_0x1129ed(0x16d))))return _0x337acf;}return undefined;}async[a59_0x5f4ff5(0x1bc)](_0x3612fc,_0x56a7c9,_0x31986d){const _0x3dbca6=a59_0x5f4ff5;try{const _0x4bb075=await _0x3612fc[_0x3dbca6(0x202)][_0x3dbca6(0x136)](_0x56a7c9,{'limit':0x1});if(_0x4bb075[_0x3dbca6(0x1e6)]>0x0){const _0x236a14=_0x4bb075[0x0]['id'],_0x2649da=getWorkflowUrl(_0x31986d,_0x236a14);console['error']('\x20\x20Console:\x20'+a59_0xc31aad[_0x3dbca6(0x114)](_0x2649da));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1a9);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x16f);async[a59_0x5f4ff5(0x12a)](_0xa93355){const _0xd13d8=a59_0x5f4ff5,{options:_0x5214fb,args:_0x5da045,tdx:_0xdf60b4}=_0xa93355,_0x48c771=_0x5da045[0x0],_0x520378=_0x5214fb[_0xd13d8(0x100)];if(_0x520378)return saveSessionContext({'workflow_project':undefined},_0x5214fb['session']),console[_0xd13d8(0x16c)](a59_0xc31aad[_0xd13d8(0x118)](_0xd13d8(0x1b9))),0x0;if(!_0x48c771)return console['error'](a59_0xc31aad[_0xd13d8(0x209)](_0xd13d8(0x229)),_0xd13d8(0x278)),console[_0xd13d8(0x10b)](a59_0xc31aad[_0xd13d8(0x1e5)](_0xd13d8(0xf9))),console['error'](a59_0xc31aad[_0xd13d8(0x1e5)](_0xd13d8(0x180))),0x1;const _0x267de4=await withSpinner(_0xd13d8(0x261)+_0x48c771+'\x27...',()=>_0xdf60b4[_0xd13d8(0x202)][_0xd13d8(0x13f)](_0x48c771),{'verbose':_0x5214fb[_0xd13d8(0x269)]}),{name:_0x1aceac}=_0x267de4[_0xd13d8(0x186)];return saveSessionContext({'workflow_project':_0x1aceac},_0x5214fb['session']),console['log'](a59_0xc31aad[_0xd13d8(0x118)](_0xd13d8(0x200)+a59_0xc31aad[_0xd13d8(0x114)](_0x1aceac))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1b2);['description']=a59_0x5f4ff5(0x208);async[a59_0x5f4ff5(0x12a)](_0x1a704e){const _0xe75703=a59_0x5f4ff5,{options:_0x669611,args:_0x3bdbdc,tdx:_0x515c40}=_0x1a704e,_0x597733=_0x3bdbdc[0x0];_0x669611[_0xe75703(0x269)]&&_0x597733&&console[_0xe75703(0x10b)](_0xe75703(0x250)+_0x597733);const _0x31baf1=await withSpinner(_0xe75703(0x13d),()=>_0x515c40['workflow'][_0xe75703(0x268)](_0x597733,{'limit':_0x669611[_0xe75703(0x156)]}),{'verbose':_0x669611[_0xe75703(0x269)]});let _0x33b2f3=_0x31baf1[_0xe75703(0x186)];_0x33b2f3[_0xe75703(0x257)]((_0xf3fd6,_0x51b46d)=>_0xf3fd6['name'][_0xe75703(0x12b)](_0x51b46d[_0xe75703(0x282)]));const _0x2c5afe=_0x669611[_0xe75703(0x156)]&&_0x33b2f3[_0xe75703(0x1e6)]>=_0x669611[_0xe75703(0x156)]?a59_0xc31aad[_0xe75703(0x1e5)](_0xe75703(0x196)):'';console['error'](_0xe75703(0x267)+_0x33b2f3[_0xe75703(0x1e6)]+_0xe75703(0x112)+(_0x33b2f3[_0xe75703(0x1e6)]!==0x1?'s':'')+_0x2c5afe);if(_0x669611['format']==='json'||_0x669611[_0xe75703(0x12f)]==='jsonl'||_0x669611[_0xe75703(0x12f)]===_0xe75703(0x20c))await handleSDKOutput(_0x33b2f3,_0x669611);else{if(_0x33b2f3[_0xe75703(0x1e6)]===0x0)_0x597733?console[_0xe75703(0x16c)]('No\x20projects\x20match\x20pattern:\x20'+_0x597733):console[_0xe75703(0x16c)](_0xe75703(0x128));else{const _0x27e4d8=_0x33b2f3[_0xe75703(0xe1)](_0x3f221b=>{const _0x59e830=_0xe75703,_0x56ed29=_0x3f221b[_0x59e830(0x110)]?.[_0x59e830(0x285)](_0x38849c=>_0x38849c['key']===_0x59e830(0x158)),_0x34bc41=_0x56ed29?a59_0xc31aad[_0x59e830(0x1e5)]('\x20(system)'):'';return _0x59e830(0x22c)+_0x3f221b[_0x59e830(0x282)]+_0x34bc41;});await writeOutput(_0x27e4d8[_0xe75703(0x140)]('\x0a'),_0x669611[_0xe75703(0xe7)],_0xe75703(0xef));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0xdf);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1d1);async[a59_0x5f4ff5(0x12a)](_0x3d31ea){const _0x9ff395=a59_0x5f4ff5,{options:_0x3198a0,args:_0x498e32,tdx:_0x2c08c5}=_0x3d31ea,_0x5df1fc=this[_0x9ff395(0x298)](_0x498e32,_0x3198a0);_0x3198a0[_0x9ff395(0x269)]&&_0x5df1fc&&console[_0x9ff395(0x10b)]('Project\x20filter:\x20'+_0x5df1fc);const _0x24f3bb=await withSpinner(_0x9ff395(0x265),()=>_0x2c08c5[_0x9ff395(0x202)][_0x9ff395(0x136)](_0x5df1fc,{'limit':_0x3198a0[_0x9ff395(0x156)]}),{'verbose':_0x3198a0[_0x9ff395(0x269)]});let _0x164a77=_0x24f3bb['data'];_0x164a77['sort']((_0x57804a,_0x4ed626)=>{const _0x162930=_0x9ff395,_0xe5325c=_0x57804a[_0x162930(0x282)][_0x162930(0x12b)](_0x4ed626['name']);if(_0xe5325c!==0x0)return _0xe5325c;return(_0x57804a[_0x162930(0xec)]?.[_0x162930(0x282)]||'')['localeCompare'](_0x4ed626[_0x162930(0xec)]?.[_0x162930(0x282)]||'');});const _0x19948d=_0x3198a0[_0x9ff395(0x156)]&&_0x164a77[_0x9ff395(0x1e6)]>=_0x3198a0[_0x9ff395(0x156)]?a59_0xc31aad['dim'](_0x9ff395(0x196)):'';console[_0x9ff395(0x10b)](_0x9ff395(0x267)+_0x164a77[_0x9ff395(0x1e6)]+'\x20workflow'+(_0x164a77[_0x9ff395(0x1e6)]!==0x1?'s':'')+_0x19948d);if(_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x277)||_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x1df)||_0x3198a0[_0x9ff395(0x12f)]===_0x9ff395(0x20c))await handleSDKOutput(_0x164a77,_0x3198a0);else{if(_0x164a77[_0x9ff395(0x1e6)]===0x0)_0x5df1fc?console[_0x9ff395(0x16c)](_0x9ff395(0xfa)+_0x5df1fc):console[_0x9ff395(0x16c)]('No\x20workflows\x20found');else{const _0x47c1ad=_0x3198a0['site'],_0x99cf0a=_0x164a77[_0x9ff395(0xe1)](_0x2469f5=>{const _0x323eb8=_0x9ff395,_0x5139a0=a59_0xc31aad[_0x323eb8(0x1e5)]('#'+_0x2469f5['id']),_0x28b109=hyperlink(_0x5139a0,getWorkflowUrl(_0x47c1ad,_0x2469f5['id'])),_0x1f8f71=_0x2469f5[_0x323eb8(0xec)]?.[_0x323eb8(0x282)]?a59_0xc31aad[_0x323eb8(0x1e5)]('\x20('+_0x2469f5[_0x323eb8(0xec)][_0x323eb8(0x282)]+')'):'';return _0x323eb8(0xe0)+_0x28b109+'\x20'+_0x2469f5[_0x323eb8(0x282)]+_0x1f8f71;});await writeOutput(_0x99cf0a[_0x9ff395(0x140)]('\x0a'),_0x3198a0['output'],_0x9ff395(0xef));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x1d7);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x17b);async[a59_0x5f4ff5(0x12a)](_0x49740f){const _0x1db014=a59_0x5f4ff5,{options:_0x3cf857,args:_0x19a05d,tdx:_0x1cc5b4}=_0x49740f,_0x435794=this[_0x1db014(0x27d)](_0x19a05d,_0x3cf857);if(!_0x435794)return 0x1;const {projectName:_0x23ef41,workflowName:_0x20c95e}=_0x435794;if(_0x3cf857[_0x1db014(0x269)]){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x10b)]('Filter:\x20'+_0x23ef41+'.'+_0x20c95e);else _0x23ef41&&console[_0x1db014(0x10b)]('Filter:\x20project='+_0x23ef41);const _0x58233c=_0x3cf857[_0x1db014(0x1b6)];_0x58233c&&console['error']('Status:\x20'+_0x58233c);}let _0xa95d16=0x28;if(process[_0x1db014(0xee)][_0x1db014(0x16a)]&&!_0x3cf857[_0x1db014(0xe7)]&&!_0x3cf857[_0x1db014(0x12f)]){const _0x5b02a0=process['stdout']['rows']||0x28;_0xa95d16=Math['max'](0x14,Math[_0x1db014(0x227)](_0x5b02a0*0x2/0x3));}const _0x457f30=_0x3cf857[_0x1db014(0x156)]||_0xa95d16,_0x287fae=await withSpinner(_0x1db014(0x1ae),()=>_0x1cc5b4[_0x1db014(0x202)]['sessions']({'projectName':_0x23ef41,'workflowName':_0x20c95e,'status':_0x3cf857[_0x1db014(0x1b6)],'fromTime':_0x3cf857[_0x1db014(0x22d)],'toTime':_0x3cf857['to'],'limit':_0x457f30}),{'verbose':_0x3cf857[_0x1db014(0x269)]}),_0x3597c7=_0x287fae['data'];_0x3597c7[_0x1db014(0x257)]((_0x4f3b8a,_0x268357)=>{const _0x4498a8=_0x1db014,_0x3b39bd=_0x4f3b8a[_0x4498a8(0x14d)]||'',_0x375214=_0x268357[_0x4498a8(0x14d)]||'';return _0x375214['localeCompare'](_0x3b39bd);});_0x3597c7[_0x1db014(0x1e6)]>=_0x457f30?console[_0x1db014(0x10b)](_0x1db014(0x10c)+_0x3597c7[_0x1db014(0x1e6)]+_0x1db014(0x1f9)+a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x14c))):console[_0x1db014(0x10b)](_0x1db014(0x267)+_0x3597c7['length']+'\x20session'+(_0x3597c7[_0x1db014(0x1e6)]!==0x1?'s':''));if(_0x3cf857[_0x1db014(0x12f)]===_0x1db014(0x277)||_0x3cf857[_0x1db014(0x12f)]===_0x1db014(0x1df)||_0x3cf857['format']===_0x1db014(0x20c))await handleSDKOutput(_0x3597c7,_0x3cf857);else{if(!process[_0x1db014(0xee)]['isTTY']||_0x3cf857[_0x1db014(0xe7)]){if(_0x3597c7[_0x1db014(0x1e6)]===0x0){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x16c)]('No\x20sessions\x20found\x20for:\x20'+_0x23ef41+'.'+_0x20c95e);else _0x23ef41?console[_0x1db014(0x16c)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x23ef41):console[_0x1db014(0x16c)]('No\x20sessions\x20found');}else{const _0x4646c7=_0x3cf857[_0x1db014(0x130)],_0x59d184=this[_0x1db014(0xf3)](_0x3597c7,_0x4646c7);_0x3cf857[_0x1db014(0xe7)]?await writeOutput(_0x59d184,_0x3cf857[_0x1db014(0xe7)],'list'):console['log'](_0x59d184);}!_0x23ef41&&(console['error'](''),console[_0x1db014(0x10b)](a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x11e))),console['error'](a59_0xc31aad['dim']('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a59_0xc31aad[_0x1db014(0x1e5)](_0x1db014(0x253))));}else{if(_0x3597c7[_0x1db014(0x1e6)]===0x0){if(_0x23ef41&&_0x20c95e)console[_0x1db014(0x16c)](_0x1db014(0x18b)+_0x23ef41+'.'+_0x20c95e);else _0x23ef41?console[_0x1db014(0x16c)](_0x1db014(0x245)+_0x23ef41):console['log']('No\x20sessions\x20found');}else await this[_0x1db014(0x183)](_0x3597c7,_0x49740f,_0x23ef41);}}return 0x0;}[a59_0x5f4ff5(0xf3)](_0x56b98b,_0x57e75b){const _0x19e167=a59_0x5f4ff5,_0x44a387=[],_0x3cca60=new Map();let _0xba1564=Infinity,_0x458270=-Infinity;for(const _0x577b58 of _0x56b98b){if(_0x577b58['lastAttempt']?.[_0x19e167(0x210)]){const _0x3a606c=new Date(_0x577b58[_0x19e167(0x12e)][_0x19e167(0x210)])[_0x19e167(0x1d2)](),_0x14c884=_0x577b58[_0x19e167(0x12e)][_0x19e167(0x1a6)]?new Date(_0x577b58[_0x19e167(0x12e)]['finishedAt'])[_0x19e167(0x1d2)]():Date[_0x19e167(0x1da)](),_0x76bc13=_0x577b58[_0x19e167(0xec)]?.[_0x19e167(0x282)]||'(unknown)';!_0x3cca60[_0x19e167(0xeb)](_0x76bc13)&&_0x3cca60[_0x19e167(0x216)](_0x76bc13,[]),_0x3cca60[_0x19e167(0x176)](_0x76bc13)[_0x19e167(0x260)]({'session':_0x577b58,'startTime':_0x3a606c,'endTime':_0x14c884,'duration':_0x14c884-_0x3a606c}),_0xba1564=Math[_0x19e167(0x1b1)](_0xba1564,_0x3a606c),_0x458270=Math[_0x19e167(0xe5)](_0x458270,_0x14c884);}}if(_0x3cca60['size']===0x0)return _0x19e167(0x103);const _0x495352=process[_0x19e167(0xee)]['columns']||0x78,_0x11bec8=0x1e,_0x7e257b=0x32,_0x5b47b7=0x4,_0x58a539=Math[_0x19e167(0x1b1)](_0x7e257b,Math[_0x19e167(0xe5)](_0x11bec8,Math[_0x19e167(0x227)](_0x495352*0.3))),_0x4819c8=_0x495352-_0x58a539-TIMELINE_CONFIG[_0x19e167(0x1de)]-0x3-_0x5b47b7,_0x2b35e5=_0x458270-_0xba1564,_0x4c1587=_0x2b35e5/_0x58a539,_0x1428d1=renderTimeAxis({'startTime':_0xba1564,'endTime':_0x458270,'durationMs':_0x2b35e5,'msPerChar':_0x4c1587},_0x58a539),_0x1db7c7=[];for(const _0x4cf6d7 of _0x3cca60[_0x19e167(0x1f1)]()){_0x1db7c7[_0x19e167(0x260)](..._0x4cf6d7);}_0x1db7c7[_0x19e167(0x257)]((_0x2bcc27,_0x2a29ee)=>_0x2a29ee[_0x19e167(0x29e)]-_0x2bcc27[_0x19e167(0x29e)]);const _0x333547=new Date(_0xba1564),_0x1c4b1a=formatDate(_0x333547),_0xa3b33b=_0x5b47b7+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x19e167(0x133)]+_0x4819c8,_0x3c4d3a='\x20'[_0x19e167(0x225)](_0xa3b33b-_0x1c4b1a['length']),_0x1008bd=_0x3c4d3a+a59_0xc31aad[_0x19e167(0x1e5)](_0x1c4b1a)+'\x20'+_0x1428d1;_0x44a387['push'](_0x1008bd);const _0x475e3c=0x16;let _0x5a819a=0x0;for(const _0x3e0dc4 of _0x1db7c7){const _0x510413=_0x3e0dc4[_0x19e167(0x24b)][_0x19e167(0xec)]?.[_0x19e167(0x282)]||'?',_0x589e2f=Math[_0x19e167(0x1b1)](stringWidth(_0x510413),_0x475e3c);_0x5a819a=Math[_0x19e167(0xe5)](_0x5a819a,_0x589e2f);}for(const _0x184fb5 of _0x1db7c7){const {session:_0x34180b,startTime:_0x570d03,endTime:_0x58badf,duration:_0x48194a}=_0x184fb5,_0x452727=_0x34180b['project']?.['id'],_0x7db8f8=_0x34180b['id'],_0x4fc8b5=_0x34180b[_0x19e167(0xec)]?.[_0x19e167(0x282)]||'?',_0x592d64=_0x34180b[_0x19e167(0x202)]?.[_0x19e167(0x282)]||'?';let _0x553d7,_0x59846f;if(_0x34180b[_0x19e167(0x12e)]){const _0x18f3bb=_0x34180b[_0x19e167(0x12e)];!_0x18f3bb[_0x19e167(0xda)]?(_0x553d7=_0x18f3bb[_0x19e167(0x1fc)]?'🛑':'🔄',_0x59846f=_0x18f3bb[_0x19e167(0x1fc)]?a59_0xc31aad[_0x19e167(0x1a2)]:a59_0xc31aad[_0x19e167(0x146)]):(_0x553d7=_0x18f3bb[_0x19e167(0x142)]?'✅':'❌',_0x59846f=_0x18f3bb[_0x19e167(0x142)]?a59_0xc31aad[_0x19e167(0x118)]:a59_0xc31aad[_0x19e167(0x209)]);}else _0x553d7='⏳',_0x59846f=a59_0xc31aad[_0x19e167(0x1e5)];const _0x5cb13a='#'+_0x7db8f8,_0x4ce9ee=_0x452727?hyperlink(_0x5cb13a,getWorkflowSessionUrl(_0x57e75b,_0x452727,_0x7db8f8)):_0x5cb13a;let _0x346a90=_0x4fc8b5;stringWidth(_0x4fc8b5)>_0x475e3c&&(_0x346a90=_0x4fc8b5['slice'](0x0,_0x475e3c-0x1)+'…');const _0x5507c7=a59_0xc31aad[_0x19e167(0x1e5)](_0x346a90),_0x44764a=stringWidth(_0x346a90),_0x2592ee='\x20'[_0x19e167(0x225)](_0x5a819a-stringWidth(_0x346a90)+0x2),_0x27ba0c='('+formatElapsed(_0x48194a)+')',_0x292a65=stringWidth(_0x27ba0c),_0x34d18f=stringWidth(_0x5cb13a),_0x2b519c=_0x34d18f+0x1+_0x44764a+_0x2592ee[_0x19e167(0x1e6)],_0x15a914=_0x4819c8-_0x2b519c-_0x292a65-0x1-0x8;let _0x5a7f6d=_0x592d64;stringWidth(_0x5a7f6d)>_0x15a914&&(_0x5a7f6d=_0x5a7f6d[_0x19e167(0x1d9)](0x0,_0x15a914-0x1)+'…');const _0x50fee4=_0x4ce9ee+'\x20'+_0x5507c7+_0x2592ee+_0x5a7f6d,_0x518444=stringWidth(_0x50fee4),_0x5ace35=_0x4819c8-_0x518444-_0x292a65,_0x21c29f=_0x50fee4+'\x20'[_0x19e167(0x225)](Math[_0x19e167(0xe5)](0x1,_0x5ace35))+a59_0xc31aad[_0x19e167(0x1e5)](_0x27ba0c),_0x522697=Math[_0x19e167(0x227)]((_0x570d03-_0xba1564)/_0x4c1587),_0x21e5de=Math[_0x19e167(0x227)]((_0x58badf-_0xba1564)/_0x4c1587),_0x28eba0=Math[_0x19e167(0xe5)](_0x522697+0x1,_0x21e5de),_0x241006=new Array(_0x58a539)[_0x19e167(0x263)]('\x20');for(let _0x38a548=_0x522697;_0x38a548<Math[_0x19e167(0x1b1)](_0x28eba0,_0x58a539);_0x38a548++){_0x241006[_0x38a548]='─';}const _0x5d35b6=_0x241006[_0x19e167(0xe1)](_0x4030a3=>_0x4030a3==='\x20'?'\x20':_0x59846f(_0x4030a3))[_0x19e167(0x140)]('');_0x44a387['push'](_0x553d7+'\x20'+_0x21c29f+'│'+_0x5d35b6+'│');}return _0x44a387[_0x19e167(0x140)]('\x0a');}async[a59_0x5f4ff5(0x183)](_0x4e46bd,_0x40c3eb,_0x2d4f70){const _0x5162be=a59_0x5f4ff5,{options:_0x3adbbc,tdx:_0x2cdf0d}=_0x40c3eb,_0x444af4=_0x3adbbc[_0x5162be(0x130)],{timelineRows:_0x5dcc7c,timeAxisHeader:_0x560c19}=this['generateSessionTimelineRows'](_0x4e46bd,_0x444af4),_0x3c9c0d=_0x5dcc7c[_0x5162be(0x19f)](_0xfb9097=>_0xfb9097['attemptId']);if(_0x3c9c0d[_0x5162be(0x1e6)]===0x0){const _0x49dc97=this['renderSessionsTimeline'](_0x4e46bd,_0x444af4);console[_0x5162be(0x16c)](_0x49dc97);!_0x2d4f70&&(console[_0x5162be(0x10b)](''),console[_0x5162be(0x10b)](a59_0xc31aad[_0x5162be(0x1e5)](_0x5162be(0x11e))),console[_0x5162be(0x10b)](a59_0xc31aad[_0x5162be(0x1e5)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a59_0xc31aad[_0x5162be(0x1e5)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x560c19&&console[_0x5162be(0x16c)](_0x560c19);const _0x3bfa6a=_0x5dcc7c[_0x5162be(0x19f)](_0x5551ee=>_0x5551ee[_0x5162be(0x125)])[_0x5162be(0xe1)](_0x53572f=>({'title':_0x53572f['displayLine'],'value':_0x53572f[_0x5162be(0x125)]})),_0x4cd9bb=process[_0x5162be(0xee)]['rows']||0x3c,_0x16c279=Math[_0x5162be(0xe5)](0x28,Math[_0x5162be(0x227)](_0x4cd9bb*0x2/0x3)),_0x2c13b1=await a59_0x42cf4e({'type':_0x5162be(0x29a),'name':_0x5162be(0x125),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x3bfa6a,'initial':-0x1,'limit':_0x16c279,'clearFirst':!![],'fallback':{'title':_0x5162be(0x212),'value':null},'suggest':(_0x85a47c,_0x202c89)=>{const _0x2ecd24=_0x5162be;if(!_0x85a47c)return Promise[_0x2ecd24(0x296)](_0x202c89);const _0x592672=_0x202c89[_0x2ecd24(0x19f)](_0x1d920c=>{const _0x570ebf=_0x2ecd24,_0x3334e7=_0x1d920c;return _0x3334e7[_0x570ebf(0x148)]['toLowerCase']()[_0x570ebf(0x177)](_0x85a47c[_0x570ebf(0x2a1)]());});return Promise[_0x2ecd24(0x296)](_0x592672);}}),_0x30f20b=()=>{const _0x2d2543=_0x5162be;process[_0x2d2543(0xee)]['write'](_0x2d2543(0x259)),process[_0x2d2543(0xee)][_0x2d2543(0x195)](_0x2d2543(0x259)),process[_0x2d2543(0xee)][_0x2d2543(0x195)](_0x2d2543(0x259));},_0x527b58=_0x2c13b1&&_0x2c13b1[_0x5162be(0x125)]&&_0x2c13b1[_0x5162be(0x125)]!==null&&_0x2c13b1[_0x5162be(0x125)]['trim']()!=='';if(!_0x527b58){_0x30f20b(),console[_0x5162be(0x16c)](a59_0xc31aad[_0x5162be(0x1e5)](_0x5162be(0x2ad)));return;}_0x30f20b();const _0x2f8a18=_0x4e46bd['find'](_0x181d9e=>_0x181d9e[_0x5162be(0x12e)]?.['id']===_0x2c13b1['attemptId']);if(_0x2f8a18){const _0x363d1a=_0x2f8a18[_0x5162be(0xec)]?.[_0x5162be(0x282)]||'?',_0x1618d8=_0x2f8a18[_0x5162be(0x202)]?.[_0x5162be(0x282)]||'?';console['log'](_0x5162be(0x203)+a59_0xc31aad[_0x5162be(0x1e5)](_0x363d1a)+_0x5162be(0x1e2)+a59_0xc31aad['dim'](_0x1618d8));}const _0x235b2f=new WorkflowTimelineCommand();await _0x235b2f[_0x5162be(0x12a)]({'args':[],'options':{..._0x3adbbc,'attemptId':_0x2c13b1[_0x5162be(0x125)]},'tdx':_0x2cdf0d});}[a59_0x5f4ff5(0x17f)](_0x49d9c9,_0x39b5a2){const _0x578f2c=a59_0x5f4ff5,_0x3ed69f=new Map();for(const _0x14d493 of _0x49d9c9){_0x14d493['id']&&_0x14d493[_0x578f2c(0x12e)]?.['id']&&_0x3ed69f[_0x578f2c(0x216)](_0x14d493['id'],_0x14d493[_0x578f2c(0x12e)]['id']);}const _0x59c146=[];let _0x1e66f5='';const _0x344ad7=this[_0x578f2c(0xf3)](_0x49d9c9,_0x39b5a2),_0xdb8d41=_0x344ad7[_0x578f2c(0x178)]('\x0a');for(const _0x49ee54 of _0xdb8d41){if(_0x49ee54[_0x578f2c(0xf4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x49ee54[_0x578f2c(0x251)](/^\s+\d{4}-\d{2}-\d{2}/))_0x1e66f5=_0x49ee54;else{if(_0x49ee54[_0x578f2c(0x251)](/^[✅❌🔄🛑⏳]/)){const _0x4526ac=_0x49ee54['match'](/#(\d+)/),_0xb1da48=_0x4526ac?_0x4526ac[0x1]:null,_0x520e52=_0xb1da48?_0x3ed69f['get'](_0xb1da48)||null:null,_0x246274=_0x49d9c9[_0x578f2c(0x2a9)](_0x516032=>_0x516032['id']===_0xb1da48),_0x4f1057=_0x246274?.['project']?.[_0x578f2c(0x282)]||'';_0x59c146['push']({'displayLine':_0x49ee54,'attemptId':_0x520e52,'projectName':_0x4f1057});}}}return{'timelineRows':_0x59c146,'timeAxisHeader':_0x1e66f5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x13a);['description']='List\x20workflow\x20attempts';async[a59_0x5f4ff5(0x12a)](_0x476166){const _0x11429f=a59_0x5f4ff5,{options:_0x1674de,args:_0x2c2e49,tdx:_0x13f3ed}=_0x476166,_0x22dc16=this['parseProjectWorkflowPattern'](_0x2c2e49,_0x1674de);if(!_0x22dc16)return 0x1;const {projectName:_0x45aa3c,workflowName:_0x326074}=_0x22dc16,_0x16c2cc=_0x1674de[_0x11429f(0x1d4)];if(_0x1674de[_0x11429f(0x269)]){if(_0x45aa3c&&_0x326074)console[_0x11429f(0x10b)](_0x11429f(0x120)+_0x45aa3c+'.'+_0x326074);else _0x45aa3c&&console['error']('Filter:\x20project='+_0x45aa3c);_0x16c2cc&&console[_0x11429f(0x10b)](_0x11429f(0x211));}const _0x532f51=await withSpinner(_0x11429f(0xf6),()=>_0x13f3ed[_0x11429f(0x202)][_0x11429f(0x17c)]({'projectName':_0x45aa3c,'workflowName':_0x326074,'includeRetried':_0x16c2cc,'limit':_0x1674de[_0x11429f(0x156)]}),{'verbose':_0x1674de[_0x11429f(0x269)]}),_0x3cc05d=_0x532f51[_0x11429f(0x186)],_0x2e68db=_0x1674de[_0x11429f(0x156)]||0x64,_0x5a152d=_0x3cc05d[_0x11429f(0x1e6)]>=_0x2e68db?a59_0xc31aad[_0x11429f(0x1e5)](_0x11429f(0x196)):'';console['error'](_0x11429f(0x267)+_0x3cc05d[_0x11429f(0x1e6)]+'\x20attempt'+(_0x3cc05d[_0x11429f(0x1e6)]!==0x1?'s':'')+_0x5a152d);if(_0x1674de[_0x11429f(0x12f)]===_0x11429f(0x277)||_0x1674de['format']==='jsonl'||_0x1674de['format']==='table')await handleSDKOutput(_0x3cc05d,_0x1674de);else{if(_0x3cc05d[_0x11429f(0x1e6)]===0x0){if(_0x45aa3c&&_0x326074)console[_0x11429f(0x16c)](_0x11429f(0x11c)+_0x45aa3c+'.'+_0x326074);else _0x45aa3c?console[_0x11429f(0x16c)](_0x11429f(0x29f)+_0x45aa3c):console[_0x11429f(0x16c)](_0x11429f(0x143));}else{const _0x990c9c=_0x1674de[_0x11429f(0x130)],_0x5eb37d=_0x3cc05d[_0x11429f(0xe1)](_0x4264ae=>{const _0x1bbfd5=_0x11429f,_0x59fbb3=a59_0xc31aad['dim']('#'+_0x4264ae['id']),_0x550afc=_0x4264ae['project']?.['id'],_0x4e8ebe=_0x4264ae[_0x1bbfd5(0x28b)]||_0x4264ae[_0x1bbfd5(0x165)],_0x4ef7aa=_0x550afc&&_0x4e8ebe?hyperlink(_0x59fbb3,getWorkflowAttemptUrl(_0x990c9c,_0x550afc,_0x4e8ebe,_0x4264ae['id'])):_0x59fbb3,{icon:_0x210609,text:_0x28b70c}=getAttemptStatusDisplay(_0x4264ae),_0x53de3d=(_0x4264ae['project']?.[_0x1bbfd5(0x282)]||'?')+'.'+(_0x4264ae[_0x1bbfd5(0x202)]?.[_0x1bbfd5(0x282)]||'?'),_0x4fb246=_0x4264ae['sessionTime']?a59_0xc31aad[_0x1bbfd5(0x1e5)](_0x4264ae[_0x1bbfd5(0x14d)]):'';return(_0x4ef7aa+'\x20'+_0x210609+(_0x28b70c?'\x20'+_0x28b70c:'')+'\x20'+_0x53de3d+'\x20'+_0x4fb246)[_0x1bbfd5(0x144)]();});await writeOutput(_0x5eb37d[_0x11429f(0x140)]('\x0a'),_0x1674de[_0x11429f(0xe7)],_0x11429f(0xef));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:attempt';['description']=a59_0x5f4ff5(0xfc);async['execute'](_0x295dd5){const _0x12ab7f=a59_0x5f4ff5,{options:_0x1c51b2,args:_0x59931d,tdx:_0x350970}=_0x295dd5,_0x434dd5=_0x59931d[0x0];if(!_0x434dd5)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1c51b2[_0x12ab7f(0x269)]&&console[_0x12ab7f(0x10b)](_0x12ab7f(0x25e)+_0x434dd5);const _0x249729=await withSpinner(_0x12ab7f(0x113),()=>_0x350970[_0x12ab7f(0x202)]['attempt'](_0x434dd5),{'verbose':_0x1c51b2[_0x12ab7f(0x269)]}),_0x2ccf3f=_0x249729[_0x12ab7f(0x186)];let _0x5a2738;!_0x2ccf3f[_0x12ab7f(0xda)]?_0x5a2738=_0x2ccf3f['cancelRequested']?_0x12ab7f(0x232):_0x12ab7f(0x1ad):_0x5a2738=_0x2ccf3f[_0x12ab7f(0x142)]?_0x12ab7f(0x142):_0x12ab7f(0x10b);let _0x3ac6e5;if(_0x2ccf3f['createdAt']&&_0x2ccf3f[_0x12ab7f(0x1a6)]){const _0x363360=new Date(_0x2ccf3f[_0x12ab7f(0x210)])[_0x12ab7f(0x1d2)](),_0x2c38a5=new Date(_0x2ccf3f[_0x12ab7f(0x1a6)])['getTime']();_0x3ac6e5=Math['round']((_0x2c38a5-_0x363360)/0x3e8);}const _0x2f3c88={'attempt_id':_0x2ccf3f['id'],'status':_0x5a2738,..._0x2ccf3f[_0x12ab7f(0x179)]!==undefined&&{'index':_0x2ccf3f[_0x12ab7f(0x179)]},..._0x2ccf3f[_0x12ab7f(0xec)]&&{'project':_0x2ccf3f[_0x12ab7f(0xec)][_0x12ab7f(0x282)]},..._0x2ccf3f['workflow']&&{'workflow':_0x2ccf3f['workflow']['name']},..._0x2ccf3f[_0x12ab7f(0x165)]&&{'session_id':_0x2ccf3f[_0x12ab7f(0x165)]},..._0x2ccf3f[_0x12ab7f(0x14d)]&&{'session_time':_0x2ccf3f[_0x12ab7f(0x14d)]},..._0x2ccf3f['retryAttemptName']&&{'retry_attempt':_0x2ccf3f[_0x12ab7f(0xe8)]},..._0x3ac6e5!==undefined&&{'duration_sec':_0x3ac6e5},..._0x2ccf3f[_0x12ab7f(0x210)]&&{'created_at':_0x2ccf3f[_0x12ab7f(0x210)]},..._0x2ccf3f[_0x12ab7f(0x1a6)]&&{'finished_at':_0x2ccf3f[_0x12ab7f(0x1a6)]},...Object[_0x12ab7f(0x24d)](_0x2ccf3f[_0x12ab7f(0x1a0)])['length']>0x0&&{'params':_0x2ccf3f['params']}};return await handleSingleObjectOutput(_0x2f3c88,_0x1c51b2),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x243);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x254);async['execute'](_0x5e933c){const _0x1f1019=a59_0x5f4ff5,{options:_0xda08db,args:_0x277dd2,tdx:_0x14fd68}=_0x5e933c,_0x2c5d07=_0x277dd2[0x0];if(!_0x2c5d07)return console[_0x1f1019(0x10b)](_0x1f1019(0x299)),0x1;const _0x43053b=_0xda08db[_0x1f1019(0x2a8)];_0xda08db['verbose']&&(console[_0x1f1019(0x10b)]('Attempt\x20ID:\x20'+_0x2c5d07),_0x43053b&&console['error'](_0x1f1019(0xd5)));const _0x492110=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x14fd68[_0x1f1019(0x202)][_0x1f1019(0x1c7)](_0x2c5d07,_0x43053b||![]),{'verbose':_0xda08db['verbose']}),_0x2dd148=_0x492110[_0x1f1019(0x186)];return console[_0x1f1019(0x10b)]('✔\x20Found\x20'+_0x2dd148[_0x1f1019(0x1e6)]+_0x1f1019(0xdc)+(_0x2dd148[_0x1f1019(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x2dd148,_0xda08db),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x220);[a59_0x5f4ff5(0x228)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x4c95ba){const _0x2ef21d=a59_0x5f4ff5,{options:_0x3e18d9,args:_0x4310e5,tdx:_0x2504c6}=_0x4c95ba,_0x18ede8=_0x4310e5[0x0];let _0x554e09=_0x4310e5[0x1];if(!_0x18ede8)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3e18d9[_0x2ef21d(0x269)]&&(console[_0x2ef21d(0x10b)](_0x2ef21d(0x25e)+_0x18ede8),_0x554e09&&console['error']('Task\x20name:\x20'+_0x554e09));const _0x36d967=await withSpinner('Fetching\x20log\x20files...',()=>_0x2504c6[_0x2ef21d(0x202)][_0x2ef21d(0x238)](_0x18ede8,_0x554e09),{'verbose':_0x3e18d9[_0x2ef21d(0x269)]}),_0x2c3cbc=_0x36d967[_0x2ef21d(0x186)];if(_0x2c3cbc['length']===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x554e09&&(_0x3e18d9[_0x2ef21d(0x277)]||_0x3e18d9[_0x2ef21d(0x12f)]))return await handleSDKOutput(_0x2c3cbc,_0x3e18d9),0x0;if(!_0x554e09){const _0x528225=_0x2c3cbc[_0x2ef21d(0xe1)](_0x2a1eb8=>({'title':_0x2a1eb8[_0x2ef21d(0xe2)]+'\x20('+formatBytes(_0x2a1eb8['fileSize'])+')','value':_0x2a1eb8[_0x2ef21d(0xe2)]})),_0x219d2e=await a59_0x42cf4e({'type':_0x2ef21d(0x117),'name':_0x2ef21d(0x18a),'message':_0x2ef21d(0x132),'choices':_0x528225});if(!_0x219d2e[_0x2ef21d(0x18a)])return console['error']('Cancelled'),0x0;_0x554e09=_0x219d2e['task'];}const _0x69861b=await withSpinner(_0x2ef21d(0x1fa),()=>_0x2504c6[_0x2ef21d(0x202)][_0x2ef21d(0xd8)](_0x18ede8,_0x554e09),{'verbose':_0x3e18d9[_0x2ef21d(0x269)]}),_0x537ab7=_0x69861b['data'];return _0x537ab7?console['log'](_0x537ab7):console[_0x2ef21d(0x10b)](_0x2ef21d(0x258)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:kill';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x26c);async[a59_0x5f4ff5(0x12a)](_0x56d7b3){const _0xfe0543=a59_0x5f4ff5,{options:_0x16c7de,args:_0xf288f4,tdx:_0x2005c6}=_0x56d7b3,_0x5f0f04=_0xf288f4[0x0];if(!_0x5f0f04)return console[_0xfe0543(0x10b)](_0xfe0543(0x299)),0x1;const _0x111990=_0x16c7de[_0xfe0543(0x204)];_0x16c7de['verbose']&&(console[_0xfe0543(0x10b)]('Attempt\x20ID:\x20'+_0x5f0f04),_0x111990&&console['error']('Reason:\x20'+_0x111990));if(!_0x16c7de['yes']){if(!isInteractive())return console[_0xfe0543(0x10b)](a59_0xc31aad['red'](_0xfe0543(0x290)),_0xfe0543(0x241)),console[_0xfe0543(0x10b)](a59_0xc31aad[_0xfe0543(0x1e5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b9d28=await confirmKey(_0xfe0543(0x162)+_0x5f0f04+'?');if(!_0x1b9d28)return console[_0xfe0543(0x10b)](a59_0xc31aad['yellow']('Cancelled')),0x1;}const _0x4a0df9=await withSpinner(_0xfe0543(0x10a),()=>_0x2005c6[_0xfe0543(0x202)][_0xfe0543(0x160)](_0x5f0f04,_0x111990),{'verbose':_0x16c7de[_0xfe0543(0x269)]}),_0x6e049c=_0x4a0df9[_0xfe0543(0x186)];return console[_0xfe0543(0x10b)]('✔\x20'+_0x6e049c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:retry';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1af);async[a59_0x5f4ff5(0x12a)](_0x5b3473){const _0x39511d=a59_0x5f4ff5,{options:_0x584ad3,args:_0x4f944c,tdx:_0x3c5d59}=_0x5b3473,_0x4274b6=_0x4f944c[0x0];if(!_0x4274b6)return console[_0x39511d(0x10b)](_0x39511d(0x1cd)),console[_0x39511d(0x10b)](_0x39511d(0x1eb)),0x1;let _0xf78b4b=![],_0x153436=_0x4274b6;if(_0x4274b6[_0x39511d(0xf4)]('session:'))_0xf78b4b=!![],_0x153436=_0x4274b6[_0x39511d(0x264)](0x8);else{if(_0x4274b6[_0x39511d(0xf4)](_0x39511d(0x23e)))_0xf78b4b=![],_0x153436=_0x4274b6[_0x39511d(0x264)](0x8);else return console['error'](_0x39511d(0x193)),console[_0x39511d(0x10b)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x45ee73=_0x584ad3[_0x39511d(0x10d)],_0x1772af=_0x584ad3[_0x39511d(0x1e7)],_0x49d1aa=_0x584ad3[_0x39511d(0x1a0)],_0x58d591=_0x584ad3[_0x39511d(0x281)];_0x584ad3[_0x39511d(0x269)]&&(console['error'](_0x39511d(0x246)+(_0xf78b4b?'session':_0x39511d(0x1a8))+'\x20'+_0x153436),_0x45ee73&&console[_0x39511d(0x10b)]('From\x20task:\x20'+_0x45ee73),_0x1772af&&console['error'](_0x39511d(0x13b)+_0x1772af),_0x49d1aa&&console[_0x39511d(0x10b)](_0x39511d(0x226)+_0x49d1aa),_0x58d591&&console[_0x39511d(0x10b)](_0x39511d(0x10e)));let _0x54144b;if(_0x49d1aa)try{if(_0x49d1aa[_0x39511d(0xf4)]('@')){const _0x4ec7b3=await import(_0x39511d(0x2a2)),_0x8503fa=_0x49d1aa[_0x39511d(0x264)](0x1),_0x2740a4=await _0x4ec7b3[_0x39511d(0x21b)](_0x8503fa,_0x39511d(0x294));_0x54144b=JSON[_0x39511d(0x224)](_0x2740a4);}else _0x54144b=JSON[_0x39511d(0x224)](_0x49d1aa);}catch{return console[_0x39511d(0x10b)](_0x39511d(0x21a)),0x1;}if(!_0x584ad3[_0x39511d(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x39511d(0x209)](_0x39511d(0x290)),_0x39511d(0x241)),console[_0x39511d(0x10b)](a59_0xc31aad[_0x39511d(0x1e5)](_0x39511d(0x27c))),0x1;const _0x10153b=await confirmKey(_0x39511d(0x1b4)+(_0xf78b4b?_0x39511d(0x24b):_0x39511d(0x1a8))+'\x20'+_0x153436+'?');if(!_0x10153b)return console[_0x39511d(0x10b)](a59_0xc31aad[_0x39511d(0x1a2)](_0x39511d(0x2ad))),0x1;}let _0x4c616b;_0xf78b4b?_0x4c616b=await withSpinner(_0x39511d(0x163),()=>_0x3c5d59[_0x39511d(0x202)]['retrySession'](_0x153436,{'fromTask':_0x45ee73,'retryParams':_0x54144b}),{'verbose':_0x584ad3[_0x39511d(0x269)]}):_0x4c616b=await withSpinner(_0x39511d(0x1ea),()=>_0x3c5d59[_0x39511d(0x202)][_0x39511d(0xfb)](_0x153436,{'resumeFrom':_0x1772af,'retryParams':_0x54144b,'force':_0x58d591}),{'verbose':_0x584ad3[_0x39511d(0x269)]});const _0x2c103e=_0x4c616b[_0x39511d(0x186)];return console[_0x39511d(0x10b)](_0x39511d(0x1c9)),console[_0x39511d(0x10b)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x2c103e[_0x39511d(0x125)]),console[_0x39511d(0x10b)](_0x39511d(0x24a)+_0x2c103e[_0x39511d(0x165)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0xfd);[a59_0x5f4ff5(0x228)]='Start\x20a\x20workflow\x20run';async[a59_0x5f4ff5(0x12a)](_0x16a590){const _0x313171=a59_0x5f4ff5,{options:_0x445b54,args:_0x461326,tdx:_0x3bdf33}=_0x16a590;let _0x4e2fb1=_0x461326[0x0];if(!_0x4e2fb1){const _0x2eebdf=this['resolveProject']([],_0x445b54),_0x3d4fde=await withSpinner(_0x313171(0x10f),()=>_0x3bdf33[_0x313171(0x202)]['workflows'](_0x2eebdf,{'limit':_0x445b54[_0x313171(0x156)]}),{'verbose':_0x445b54[_0x313171(0x269)]}),_0x195c7d=_0x3d4fde[_0x313171(0x186)];if(_0x195c7d[_0x313171(0x1e6)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x2eebdf&&console[_0x313171(0x10b)](a59_0xc31aad[_0x313171(0x1e5)](_0x313171(0x289))),0x1;const _0x55aa9d=_0x195c7d['map'](_0x5e5660=>({'title':_0x5e5660[_0x313171(0xec)]?.[_0x313171(0x282)]+'.'+_0x5e5660[_0x313171(0x282)],'value':_0x5e5660[_0x313171(0xec)]?.[_0x313171(0x282)]+'.'+_0x5e5660[_0x313171(0x282)],'description':_0x5e5660[_0x313171(0x135)]?_0x313171(0x194)+_0x5e5660['revision']:undefined})),_0x5c937b=await a59_0x42cf4e({'type':_0x313171(0x117),'name':'workflow','message':_0x313171(0x293),'choices':_0x55aa9d});if(!_0x5c937b['workflow'])return 0x1;_0x4e2fb1=_0x5c937b[_0x313171(0x202)];}if(!_0x4e2fb1[_0x313171(0x177)]('.')){const _0x11fad7=this['resolveProject']([],_0x445b54);if(_0x11fad7)_0x4e2fb1=_0x11fad7+'.'+_0x4e2fb1;else return console[_0x313171(0x10b)](a59_0xc31aad['red'](_0x313171(0x229)),_0x313171(0x242)),console[_0x313171(0x10b)](a59_0xc31aad[_0x313171(0x1e5)](_0x313171(0x289))),0x1;}const _0x13fb58=_0x445b54[_0x313171(0x127)],_0x517723=_0x445b54[_0x313171(0x14d)],_0x59f33b={};if(_0x13fb58&&Array[_0x313171(0x284)](_0x13fb58))for(const _0x30dcfe of _0x13fb58){const _0x2f8fba=_0x30dcfe[_0x313171(0x14e)]('=');if(_0x2f8fba===-0x1)return console[_0x313171(0x10b)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x30dcfe),console[_0x313171(0x10b)](_0x313171(0x234)),0x1;const _0x445855=_0x30dcfe[_0x313171(0x264)](0x0,_0x2f8fba),_0x447bf1=_0x30dcfe[_0x313171(0x264)](_0x2f8fba+0x1);try{_0x59f33b[_0x445855]=JSON[_0x313171(0x224)](_0x447bf1);}catch{_0x59f33b[_0x445855]=_0x447bf1;}}_0x445b54[_0x313171(0x269)]&&(console[_0x313171(0x10b)](_0x313171(0x167)+_0x4e2fb1),Object['keys'](_0x59f33b)[_0x313171(0x1e6)]>0x0&&console[_0x313171(0x10b)]('Parameters:\x20'+JSON[_0x313171(0x19e)](_0x59f33b)),_0x517723&&console[_0x313171(0x10b)](_0x313171(0x271)+_0x517723));if(_0x445b54[_0x313171(0x168)])return await this[_0x313171(0x1b0)](_0x16a590,_0x4e2fb1,_0x59f33b,_0x517723);const _0x3c97ea=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3bdf33[_0x313171(0x202)][_0x313171(0x28c)](_0x4e2fb1,_0x59f33b,{'sessionTime':_0x517723}),{'verbose':_0x445b54[_0x313171(0x269)]}),_0x433508=_0x3c97ea[_0x313171(0x186)];console[_0x313171(0x10b)](_0x313171(0x236)),console[_0x313171(0x10b)](_0x313171(0xe9)+_0x433508['id']),console['error'](_0x313171(0x24a)+_0x433508['sessionId']),console[_0x313171(0x10b)](_0x313171(0x2a5)+_0x433508[_0x313171(0xec)]?.[_0x313171(0x282)]),console[_0x313171(0x10b)](_0x313171(0x116)+_0x433508[_0x313171(0x202)]?.['name']);if(_0x433508[_0x313171(0xec)]?.['id']&&_0x433508[_0x313171(0x165)]&&_0x433508['id']){const _0x1053e5=_0x445b54['site'],_0x5dc6e4=getConsoleUrl(_0x1053e5,_0x313171(0x134)+_0x433508['project']['id']+_0x313171(0xd9)+_0x433508[_0x313171(0x165)]+'/attempt/'+_0x433508['id']);console['error'](_0x313171(0x223)+a59_0xc31aad[_0x313171(0x114)](_0x5dc6e4));}return 0x0;}async['executeDryRun'](_0x1e31cc,_0x41584b,_0x50e9ba,_0x138021){const _0x2786e2=a59_0x5f4ff5,{options:_0x219cb9,tdx:_0x5f1837}=_0x1e31cc,_0x3887f6=await withSpinner(_0x2786e2(0x138)+_0x41584b+_0x2786e2(0x1ce),()=>_0x5f1837['workflow'][_0x2786e2(0x22f)](_0x41584b),{'verbose':_0x219cb9[_0x2786e2(0x269)]}),_0x2aa421=_0x3887f6['data'],_0x4c7f4f=_0x138021??new Date()['toISOString']();console['log'](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x1f0)),_0x41584b),console[_0x2786e2(0x16c)](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x1be)),_0x4c7f4f),console[_0x2786e2(0x16c)](a59_0xc31aad['bold'](_0x2786e2(0x288)),JSON[_0x2786e2(0x19e)](_0x50e9ba)),console[_0x2786e2(0x16c)](''),console['log'](a59_0xc31aad[_0x2786e2(0x1ff)](_0x2786e2(0x25d)));const _0x199a5b=parseTaskGraph(_0x2aa421[_0x2786e2(0x1bd)]??null);if(_0x199a5b[_0x2786e2(0x1e6)]===0x0)console[_0x2786e2(0x16c)](a59_0xc31aad['dim'](_0x2786e2(0x151)));else for(const _0x3bea39 of formatTaskGraph(_0x199a5b)){console[_0x2786e2(0x16c)](_0x3bea39);}const _0x437744=summarizeTaskGraph(_0x199a5b),_0x5c21df=formatWarningSummary(_0x437744);return _0x5c21df&&(console[_0x2786e2(0x16c)](''),console['log'](a59_0xc31aad[_0x2786e2(0x1a2)](_0x5c21df))),console[_0x2786e2(0x16c)](a59_0xc31aad[_0x2786e2(0x1a2)](_0x2786e2(0x23c))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x1f2);['description']=a59_0x5f4ff5(0x155);async['execute'](_0x4af2f7){const _0xaaed6c=a59_0x5f4ff5,{options:_0x32b804,args:_0x54ee1b,tdx:_0x3aa64e}=_0x4af2f7,_0x1160f2=_0x54ee1b[0x0],_0x224592=_0x54ee1b[0x1]||'.';if(!_0x1160f2)return console['error'](_0xaaed6c(0x169)),console[_0xaaed6c(0x10b)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x52aa2b=_0x32b804[_0xaaed6c(0x135)];_0x32b804[_0xaaed6c(0x269)]&&(console[_0xaaed6c(0x10b)](_0xaaed6c(0x203)+_0x1160f2),console[_0xaaed6c(0x10b)](_0xaaed6c(0xed)+_0x224592),_0x52aa2b&&console['error'](_0xaaed6c(0x29c)+_0x52aa2b));const _0x36cb6d=await withSpinner('Downloading\x20project\x20'+_0x1160f2+_0xaaed6c(0x1ce),()=>_0x3aa64e[_0xaaed6c(0x202)][_0xaaed6c(0x214)](_0x1160f2,_0x224592,{'revision':_0x52aa2b}),{'verbose':_0x32b804[_0xaaed6c(0x269)]}),_0x600a05=_0x36cb6d['data'];return console[_0xaaed6c(0x10b)](_0xaaed6c(0x1f7)+_0x600a05[_0xaaed6c(0x1c6)]),console[_0xaaed6c(0x10b)](_0xaaed6c(0x283)+_0x600a05[_0xaaed6c(0x135)]),console[_0xaaed6c(0x10b)]('\x20\x20Files\x20extracted:\x20'+_0x600a05['filesExtracted']),console['error'](_0xaaed6c(0x1cf)+_0x224592+'/'+_0x600a05[_0xaaed6c(0x1c6)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x185);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xf8);async[a59_0x5f4ff5(0x12a)](_0x33cb69){const _0x5ddbca=a59_0x5f4ff5,{options:_0x41d8d9,args:_0x3e290d,tdx:_0x56b0d8}=_0x33cb69;let _0x2dfe67='.',_0xb9dfca=_0x41d8d9[_0x5ddbca(0x282)];if(_0x3e290d[0x0]){const {promises:_0x2a46ed}=await import('fs');try{const _0x43c3b9=await _0x2a46ed[_0x5ddbca(0x1c5)](_0x3e290d[0x0]);if(_0x43c3b9[_0x5ddbca(0x1fb)]())_0x2dfe67=_0x3e290d[0x0];else return console[_0x5ddbca(0x10b)]('Error:\x20'+_0x3e290d[0x0]+_0x5ddbca(0x18f)),0x1;}catch{_0xb9dfca=_0x3e290d[0x0],_0x2dfe67='.';}}const _0x139912=_0x41d8d9['revision'],_0x230499=_0x41d8d9['skipValidation'];_0x41d8d9['verbose']&&(console[_0x5ddbca(0x10b)](_0x5ddbca(0x262)+_0x2dfe67),_0xb9dfca&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x270)+_0xb9dfca),_0x139912&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x29c)+_0x139912),_0x230499&&console[_0x5ddbca(0x10b)](_0x5ddbca(0x1fd)));const _0x130038=await withSpinner(_0x5ddbca(0x291),()=>_0x56b0d8[_0x5ddbca(0x202)][_0x5ddbca(0x260)](_0x2dfe67,{'projectName':_0xb9dfca,'revision':_0x139912,'skipValidation':_0x230499}),{'verbose':_0x41d8d9[_0x5ddbca(0x269)]}),_0x149092=_0x130038[_0x5ddbca(0x186)];return console[_0x5ddbca(0x10b)]('✔\x20Pushed\x20'+_0x149092[_0x5ddbca(0x1c6)]),console[_0x5ddbca(0x10b)](_0x5ddbca(0x1a3)+_0x149092[_0x5ddbca(0xf1)]),console[_0x5ddbca(0x10b)]('\x20\x20Revision:\x20'+_0x149092[_0x5ddbca(0x135)]),await this['showWorkflowConsoleUrl'](_0x56b0d8,_0x149092[_0x5ddbca(0x1c6)],_0x41d8d9[_0x5ddbca(0x130)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x1b3);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x161);async[a59_0x5f4ff5(0x12a)](_0x1cbf34){const _0x5972f7=a59_0x5f4ff5,{options:_0x1eb3ca,args:_0x40030b,tdx:_0x35f9fa}=_0x1cbf34,_0x4eb6d1=_0x40030b[0x0],_0x2f325d=_0x40030b[0x1];if(!_0x4eb6d1)return console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x209)](_0x5972f7(0x229)),'Project\x20name\x20is\x20required'),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0xc7367d=_0x1eb3ca[_0x5972f7(0x135)];_0x1eb3ca[_0x5972f7(0x269)]&&(console[_0x5972f7(0x10b)](_0x5972f7(0x203)+_0x4eb6d1),_0x2f325d&&console['error'](_0x5972f7(0x231)+_0x2f325d),_0xc7367d&&console[_0x5972f7(0x10b)](_0x5972f7(0x29c)+_0xc7367d),_0x1eb3ca['dryRun']&&console[_0x5972f7(0x10b)](_0x5972f7(0xd4)));const _0x148470=await withSpinner('Pulling\x20project\x20'+_0x4eb6d1+_0x5972f7(0x1ce),()=>_0x35f9fa[_0x5972f7(0x202)][_0x5972f7(0x159)](_0x4eb6d1,{'targetDir':_0x2f325d,'revision':_0xc7367d}),{'verbose':_0x1eb3ca[_0x5972f7(0x269)]}),_0x149b9e=_0x148470['data'];_0x149b9e['isNewProject']?console[_0x5972f7(0x10b)](_0x5972f7(0x182)+_0x149b9e[_0x5972f7(0x1c6)]):console['error'](_0x5972f7(0x152)+_0x149b9e[_0x5972f7(0x1c6)]);console[_0x5972f7(0x10b)]('\x20\x20Revision:\x20'+_0x149b9e[_0x5972f7(0x135)]),console[_0x5972f7(0x10b)]('\x20\x20Target:\x20'+(a59_0x532ea4[_0x5972f7(0x244)](process['cwd'](),_0x149b9e[_0x5972f7(0x1b7)])||'.')),console[_0x5972f7(0x10b)](_0x5972f7(0x164)+a59_0xc31aad[_0x5972f7(0x118)]('+'+_0x149b9e[_0x5972f7(0x221)]['new']+'\x20new')+',\x20'+(a59_0xc31aad[_0x5972f7(0x1a2)]('~'+_0x149b9e[_0x5972f7(0x221)][_0x5972f7(0x18e)]+_0x5972f7(0x121))+',\x20')+(a59_0xc31aad[_0x5972f7(0x209)]('-'+_0x149b9e['summary'][_0x5972f7(0xe3)]+_0x5972f7(0x20d))+',\x20')+(''+a59_0xc31aad[_0x5972f7(0x1e5)](_0x149b9e[_0x5972f7(0x221)][_0x5972f7(0x29d)]+'\x20unchanged')));for(const _0x3cf46f of _0x149b9e[_0x5972f7(0x28a)]){_0x3cf46f[_0x5972f7(0x205)]===_0x5972f7(0x18e)&&_0x3cf46f[_0x5972f7(0x115)]&&(console[_0x5972f7(0x10b)]('\x0a'+a59_0xc31aad[_0x5972f7(0x114)](_0x5972f7(0x26a)+_0x3cf46f['path'])),console[_0x5972f7(0x10b)](_0x3cf46f[_0x5972f7(0x115)]));}if(!_0x149b9e[_0x5972f7(0x119)])return saveSessionContext({'workflow_project':_0x149b9e['projectName']},_0x1eb3ca['session']),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x118)](_0x5972f7(0x12d))),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x149b9e['projectName'])),0x0;if(_0x1eb3ca[_0x5972f7(0x168)])return console[_0x5972f7(0x10b)](a59_0xc31aad['yellow'](_0x5972f7(0x22a))),0x0;if(!_0x1eb3ca[_0x5972f7(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x5972f7(0x209)](_0x5972f7(0x290)),_0x5972f7(0x241)),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x1e5)](_0x5972f7(0x27c))),0x1;const _0x1c8f63=await confirmKey(_0x5972f7(0x11a));if(!_0x1c8f63)return console['error'](a59_0xc31aad[_0x5972f7(0x1a2)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x5972f7(0x276),()=>_0x35f9fa['workflow'][_0x5972f7(0x171)](_0x149b9e,{'revision':_0xc7367d}),{'verbose':_0x1eb3ca[_0x5972f7(0x269)]}),saveSessionContext({'workflow_project':_0x149b9e['projectName']},_0x1eb3ca[_0x5972f7(0x24b)]),console[_0x5972f7(0x10b)](a59_0xc31aad[_0x5972f7(0x118)]('✔\x20Pull\x20complete'));const _0x4d7229=a59_0x532ea4['relative'](process[_0x5972f7(0x240)](),_0x149b9e[_0x5972f7(0x1b7)])||'.';return console['error'](a59_0xc31aad['dim'](_0x5972f7(0x1cf)+_0x4d7229)),console['error'](a59_0xc31aad[_0x5972f7(0x1e5)](_0x5972f7(0x1ec)+_0x149b9e[_0x5972f7(0x1c6)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x15c);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xf5);async[a59_0x5f4ff5(0x12a)](_0x13adcd){const _0x1e7453=a59_0x5f4ff5,{options:_0x56cddc,args:_0x4d6b89,tdx:_0x250852}=_0x13adcd,_0x332df8=this['resolveProjectDir'](_0x4d6b89,_0x56cddc),_0x1da114=_0x56cddc,{revision:_0x49b1da,skipValidation:_0x595b67,backfill:_0x1079ef}=_0x1da114,_0x4d8fd4=_0x1079ef===undefined?undefined:!_0x1079ef;_0x56cddc[_0x1e7453(0x269)]&&(_0x332df8&&console['error'](_0x1e7453(0x26d)+_0x332df8),_0x49b1da&&console[_0x1e7453(0x10b)]('Revision:\x20'+_0x49b1da),_0x56cddc['dryRun']&&console[_0x1e7453(0x10b)]('Dry\x20run:\x20yes'),_0x595b67&&console[_0x1e7453(0x10b)](_0x1e7453(0x1fd)),_0x1079ef&&console[_0x1e7453(0x10b)](_0x1e7453(0x1ab)));let _0x5b2d70;try{_0x5b2d70=await withSpinner(_0x1e7453(0x2a7),()=>_0x250852[_0x1e7453(0x202)][_0x1e7453(0x235)]({'sourceDir':_0x332df8,'revision':_0x49b1da,'skipValidation':_0x595b67,'skipSchedule':_0x4d8fd4}),{'verbose':_0x56cddc['verbose']});}catch(_0x14cc14){if(_0x14cc14 instanceof Error&&_0x14cc14[_0x1e7453(0x1ac)][_0x1e7453(0x177)](_0x1e7453(0x16e)))return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x209)](_0x1e7453(0x229)),_0x1e7453(0x20e)),_0x56cddc[_0x1e7453(0x1aa)]?console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1e5)](_0x1e7453(0x147)+_0x56cddc[_0x1e7453(0x1aa)]+_0x1e7453(0x25f)+_0x56cddc[_0x1e7453(0x1aa)]+'\x27')):console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1e5)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x14cc14;}const _0x4f3044=_0x5b2d70['data'];console['error'](_0x1e7453(0x1f8)+_0x4f3044[_0x1e7453(0x1c6)]),console[_0x1e7453(0x10b)]('\x20\x20Source:\x20'+_0x4f3044[_0x1e7453(0xf7)]),console[_0x1e7453(0x10b)]('\x20\x20Revision:\x20'+_0x4f3044[_0x1e7453(0x135)]),console[_0x1e7453(0x10b)](_0x1e7453(0x164)+a59_0xc31aad[_0x1e7453(0x118)]('+'+_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0x1e1)]+_0x1e7453(0xf0))+',\x20'+(a59_0xc31aad['yellow']('~'+_0x4f3044['summary'][_0x1e7453(0x18e)]+'\x20modified')+',\x20')+(a59_0xc31aad['red']('-'+_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0xe3)]+_0x1e7453(0x20d))+',\x20')+(''+a59_0xc31aad[_0x1e7453(0x1e5)](_0x4f3044[_0x1e7453(0x221)][_0x1e7453(0x29d)]+_0x1e7453(0x292))));for(const _0x1826b8 of _0x4f3044['changes']){_0x1826b8[_0x1e7453(0x205)]===_0x1e7453(0x18e)&&_0x1826b8[_0x1e7453(0x115)]&&(console[_0x1e7453(0x10b)]('\x0a'+a59_0xc31aad[_0x1e7453(0x114)]('---\x20'+_0x1826b8[_0x1e7453(0x286)])),console['error'](_0x1826b8[_0x1e7453(0x115)]));}if(!_0x4f3044[_0x1e7453(0x119)])return console[_0x1e7453(0x10b)](a59_0xc31aad['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x1e7453(0x1bc)](_0x250852,_0x4f3044['projectName'],_0x56cddc[_0x1e7453(0x130)]),0x0;if(_0x56cddc[_0x1e7453(0x168)])return console['error'](a59_0xc31aad[_0x1e7453(0x1a2)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x56cddc[_0x1e7453(0x13e)]){if(!isInteractive())return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x209)](_0x1e7453(0x290)),_0x1e7453(0x241)),console['error'](a59_0xc31aad[_0x1e7453(0x1e5)](_0x1e7453(0x27c))),0x1;const _0x4e498c=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x4e498c)return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x1a2)](_0x1e7453(0x2ad)),_0x1e7453(0x26e)),0x1;}const _0x71da4d=await withSpinner(_0x1e7453(0x24f),()=>_0x250852[_0x1e7453(0x202)]['executePushProject'](_0x4f3044),{'verbose':_0x56cddc[_0x1e7453(0x269)]}),_0x232971=_0x71da4d[_0x1e7453(0x186)];return console[_0x1e7453(0x10b)](a59_0xc31aad[_0x1e7453(0x118)](_0x1e7453(0x1cb))),console[_0x1e7453(0x10b)](_0x1e7453(0x1a3)+_0x232971[_0x1e7453(0xf1)]),console[_0x1e7453(0x10b)](_0x1e7453(0x283)+_0x232971[_0x1e7453(0x135)]),await this[_0x1e7453(0x1bc)](_0x250852,_0x232971['projectName'],_0x56cddc['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x101);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x21d);async[a59_0x5f4ff5(0x12a)](_0x4358fe){const _0x153153=a59_0x5f4ff5,{options:_0x2fc2d6,args:_0x560ebf,tdx:_0x1cfc12}=_0x4358fe,_0x1a7b32=this[_0x153153(0x1c2)](_0x560ebf,_0x2fc2d6),_0x4cdc0b=_0x2fc2d6[_0x153153(0x282)],_0x3a9ef7=_0x2fc2d6[_0x153153(0x135)],_0x2d5599=_0x2fc2d6['skipValidation'];if(!_0x1a7b32)return console[_0x153153(0x10b)](a59_0xc31aad['red']('Error:'),_0x153153(0x153)),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)](_0x153153(0x175))),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x4cdc0b)return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x209)](_0x153153(0x229)),_0x153153(0x1fe)),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1e5)](_0x153153(0x175))),0x1;_0x2fc2d6[_0x153153(0x269)]&&(console[_0x153153(0x10b)]('Source\x20directory:\x20'+_0x1a7b32),console[_0x153153(0x10b)](_0x153153(0x1bb)+_0x4cdc0b),_0x3a9ef7&&console[_0x153153(0x10b)]('Revision:\x20'+_0x3a9ef7),_0x2fc2d6[_0x153153(0x168)]&&console['error'](_0x153153(0xd4)),_0x2d5599&&console['error'](_0x153153(0x1fd)));const _0x49d71d=await withSpinner(_0x153153(0x198),()=>_0x1cfc12[_0x153153(0x202)][_0x153153(0x21e)](_0x1a7b32,_0x4cdc0b,{'revision':_0x3a9ef7,'skipValidation':_0x2d5599}),{'verbose':_0x2fc2d6[_0x153153(0x269)]}),_0x1596d0=_0x49d71d[_0x153153(0x186)];console[_0x153153(0x10b)](_0x153153(0x1f6)+_0x1596d0[_0x153153(0xf7)]);_0x1596d0[_0x153153(0x106)]&&console[_0x153153(0x10b)]('Source\x20project:\x20'+_0x1596d0[_0x153153(0x106)]);console[_0x153153(0x10b)]('New\x20project\x20name:\x20'+_0x1596d0[_0x153153(0xdb)]),console[_0x153153(0x10b)](_0x153153(0x29c)+_0x1596d0[_0x153153(0x135)]),console[_0x153153(0x10b)](_0x153153(0x28d)+_0x1596d0[_0x153153(0x184)]);_0x1596d0[_0x153153(0x27e)]&&(console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1a2)](_0x153153(0xe4)+_0x1596d0[_0x153153(0xdb)]+_0x153153(0x1dd)+_0x1596d0[_0x153153(0x15d)]+')')),console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x1a2)](_0x153153(0xdd))));if(_0x2fc2d6[_0x153153(0x168)])return console['error'](a59_0xc31aad[_0x153153(0x1a2)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x2fc2d6[_0x153153(0x13e)]){if(!isInteractive())return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x209)](_0x153153(0x290)),_0x153153(0x241)),console[_0x153153(0x10b)](a59_0xc31aad['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4b15de=_0x1596d0['sourceProjectName']||a59_0x532ea4['basename'](_0x1a7b32),_0x1be22b=_0x1596d0[_0x153153(0x27e)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x4cdc0b+_0x153153(0x1a5):_0x153153(0x275)+_0x4b15de+_0x153153(0x22b)+_0x4cdc0b+'\x22?',_0x1789f4=await confirmKey(_0x1be22b);if(!_0x1789f4)return console[_0x153153(0x10b)](a59_0xc31aad['yellow'](_0x153153(0x2ad))),0x1;}const _0x46f84d=await withSpinner(_0x1596d0[_0x153153(0x27e)]?_0x153153(0x1ed)+_0x4cdc0b+_0x153153(0x1ce):_0x153153(0x192)+_0x4cdc0b+_0x153153(0x1ce),()=>_0x1cfc12['workflow'][_0x153153(0x17d)](_0x1596d0),{'verbose':_0x2fc2d6['verbose']}),_0x40043e=_0x46f84d[_0x153153(0x186)];return console[_0x153153(0x10b)](a59_0xc31aad[_0x153153(0x118)](_0x1596d0['targetExists']?'✔\x20Project\x20updated':_0x153153(0x19d))),console['error'](_0x153153(0x2a5)+_0x40043e[_0x153153(0xdb)]),console[_0x153153(0x10b)]('\x20\x20Project\x20ID:\x20'+_0x40043e[_0x153153(0x15f)]),console[_0x153153(0x10b)](_0x153153(0x283)+_0x40043e['revision']),await this[_0x153153(0x1bc)](_0x1cfc12,_0x40043e['newProjectName'],_0x2fc2d6[_0x153153(0x130)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x1d8);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x1c1);async['execute'](_0x156b08){const _0x1d877b=a59_0x5f4ff5,{options:_0x3f6d33,args:_0x3c13af,tdx:_0x5ef661}=_0x156b08,_0xc24648=_0x3c13af[0x0];if(!_0xc24648)return console['error'](_0x1d877b(0x255)),console[_0x1d877b(0x10b)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x3f6d33[_0x1d877b(0x269)]&&console['error']('Project:\x20'+_0xc24648);if(!_0x3f6d33[_0x1d877b(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x1d877b(0x209)]('\x0aError:'),_0x1d877b(0x241)),console['error'](a59_0xc31aad[_0x1d877b(0x1e5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b45ec=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0xc24648+_0x1d877b(0x2aa));if(!_0x5b45ec)return console[_0x1d877b(0x10b)](a59_0xc31aad[_0x1d877b(0x1a2)](_0x1d877b(0x2ad))),0x1;}const _0x6d432e=await withSpinner(_0x1d877b(0x222)+_0xc24648+_0x1d877b(0x1ce),()=>_0x5ef661[_0x1d877b(0x202)][_0x1d877b(0x12c)](_0xc24648),{'verbose':_0x3f6d33['verbose']}),_0x56fbd5=_0x6d432e['data'];return console[_0x1d877b(0x10b)](_0x1d877b(0x207)+_0x56fbd5[_0x1d877b(0x1c6)]),console['error'](_0x1d877b(0x1a3)+_0x56fbd5[_0x1d877b(0xf1)]),0x0;}}export function parseKeyValue(_0x16b266){const _0x1c4bb7=a59_0x5f4ff5,_0x1f3e18=_0x16b266['indexOf']('=');if(_0x1f3e18===-0x1)throw new Error(_0x1c4bb7(0x1d5)+_0x16b266+_0x1c4bb7(0xff));const _0x5c1623=_0x16b266['substring'](0x0,_0x1f3e18),_0x468cf2=_0x16b266[_0x1c4bb7(0x264)](_0x1f3e18+0x1);if(!_0x5c1623)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x5c1623,'value':_0x468cf2};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x191);[a59_0x5f4ff5(0x228)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a59_0x5f4ff5(0x12a)](_0x426eeb){const _0x590346=a59_0x5f4ff5,{options:_0x386674,args:_0x40eb66,tdx:_0x32f602}=_0x426eeb,_0xed86fa=this['requireProject'](_0x40eb66,_0x386674);if(!_0xed86fa)return 0x1;_0x386674['verbose']&&console[_0x590346(0x10b)](_0x590346(0x203)+_0xed86fa);const _0x4bd195=await withSpinner(_0x590346(0x188),()=>_0x32f602[_0x590346(0x202)][_0x590346(0xd6)](_0xed86fa),{'verbose':_0x386674[_0x590346(0x269)]}),{secrets:_0x5f3203}=_0x4bd195['data'];return console[_0x590346(0x10b)](_0x590346(0x267)+_0x5f3203[_0x590346(0x1e6)]+_0x590346(0xf2)+(_0x5f3203[_0x590346(0x1e6)]!==0x1?'s':'')),await handleSDKOutput(_0x5f3203,_0x386674),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x11d);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0xea);async['execute'](_0x1e1f47){const _0x1e4679=a59_0x5f4ff5,{options:_0x2e21e4,args:_0x5001f6,tdx:_0x280055}=_0x1e1f47;let _0x273963,_0x2d39f9;if(_0x5001f6[_0x1e4679(0x1e6)]>=0x1&&!_0x5001f6[0x0]['includes']('='))_0x273963=_0x5001f6[0x0],_0x2d39f9=_0x5001f6[_0x1e4679(0x1d9)](0x1);else{if(_0x5001f6[_0x1e4679(0x1e6)]>=0x1&&_0x2e21e4[_0x1e4679(0x1aa)])_0x273963=_0x2e21e4[_0x1e4679(0x1aa)],_0x2d39f9=_0x5001f6;else return _0x5001f6[_0x1e4679(0x1e6)]>=0x1?(console[_0x1e4679(0x10b)](_0x1e4679(0x169)),console[_0x1e4679(0x10b)](_0x1e4679(0x289)),0x1):(console[_0x1e4679(0x10b)](_0x1e4679(0x233)),console[_0x1e4679(0x10b)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x2d39f9[_0x1e4679(0x1e6)]===0x0)return console[_0x1e4679(0x10b)](_0x1e4679(0x233)),console[_0x1e4679(0x10b)](_0x1e4679(0x237)),0x1;const _0x3eb654={};try{for(const _0xadfcfc of _0x2d39f9){const {key:_0x491e2d,value:_0x1e940e}=parseKeyValue(_0xadfcfc);_0x3eb654[_0x491e2d]=_0x1e940e;}}catch(_0x5b890c){return _0x5b890c instanceof Error&&console[_0x1e4679(0x10b)](a59_0xc31aad[_0x1e4679(0x209)]('Error:'),_0x5b890c[_0x1e4679(0x1ac)]),0x1;}const _0x38cbed=Object[_0x1e4679(0x24d)](_0x3eb654);_0x2e21e4[_0x1e4679(0x269)]&&(console[_0x1e4679(0x10b)](_0x1e4679(0x203)+_0x273963),console[_0x1e4679(0x10b)]('Secrets\x20to\x20set:\x20'+_0x38cbed[_0x1e4679(0x140)](',\x20')));const _0x181e17=await withSpinner(_0x38cbed[_0x1e4679(0x1e6)]===0x1?_0x1e4679(0x2ac):'Setting\x20'+_0x38cbed['length']+'\x20secrets...',()=>_0x280055[_0x1e4679(0x202)][_0x1e4679(0x170)](_0x273963,_0x3eb654),{'verbose':_0x2e21e4[_0x1e4679(0x269)]}),_0x3b8ec2=_0x181e17[_0x1e4679(0x186)];return console[_0x1e4679(0x10b)](_0x38cbed[_0x1e4679(0x1e6)]===0x1?_0x1e4679(0x15b)+_0x3b8ec2[_0x1e4679(0x24d)][0x0]+_0x1e4679(0x109)+_0x3b8ec2[_0x1e4679(0x1c6)]+'\x27':'✔\x20'+_0x3b8ec2[_0x1e4679(0x24d)][_0x1e4679(0x1e6)]+_0x1e4679(0x23a)+_0x3b8ec2['projectName']+'\x27'),(_0x2e21e4[_0x1e4679(0x277)]||_0x2e21e4[_0x1e4679(0x1df)])&&await handleSingleObjectOutput(_0x3b8ec2,_0x2e21e4),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x5f4ff5(0x282)]=a59_0x5f4ff5(0x29b);[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x27a);async[a59_0x5f4ff5(0x12a)](_0xf8804d){const _0x41837d=a59_0x5f4ff5,{options:_0x412695,args:_0x56854b,tdx:_0x553560}=_0xf8804d;let _0x2176b5,_0x42ebc2;if(_0x56854b[_0x41837d(0x1e6)]>=0x2)_0x2176b5=_0x56854b[0x0],_0x42ebc2=_0x56854b[0x1];else{if(_0x56854b[_0x41837d(0x1e6)]===0x1&&_0x412695[_0x41837d(0x1aa)])_0x2176b5=_0x412695['workflowProject'],_0x42ebc2=_0x56854b[0x0];else return _0x56854b[_0x41837d(0x1e6)]===0x1?(console['error'](_0x41837d(0x169)),console[_0x41837d(0x10b)](_0x41837d(0x289)),0x1):(console['error']('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x41837d(0x213)),0x1);}_0x412695['verbose']&&(console[_0x41837d(0x10b)]('Project:\x20'+_0x2176b5),console[_0x41837d(0x10b)](_0x41837d(0x1ba)+_0x42ebc2));if(!_0x412695[_0x41837d(0x13e)]){if(!isInteractive())return console['error'](a59_0xc31aad[_0x41837d(0x209)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41837d(0x10b)](a59_0xc31aad[_0x41837d(0x1e5)](_0x41837d(0x27c))),0x1;const _0x125be5=await confirmKey(_0x41837d(0x1e3)+_0x42ebc2+_0x41837d(0x2a0)+_0x2176b5+'\x27?');if(!_0x125be5)return console[_0x41837d(0x10b)](a59_0xc31aad['yellow']('Cancelled')),0x1;}const _0x40cfc8=await withSpinner(_0x41837d(0x280),()=>_0x553560[_0x41837d(0x202)]['deleteSecret'](_0x2176b5,_0x42ebc2),{'verbose':_0x412695['verbose']}),_0x53daeb=_0x40cfc8[_0x41837d(0x186)];return console[_0x41837d(0x10b)]('✔\x20Secret\x20\x27'+_0x53daeb['key']+_0x41837d(0x1c8)+_0x53daeb['projectName']+'\x27'),(_0x412695[_0x41837d(0x277)]||_0x412695[_0x41837d(0x1df)])&&await handleSingleObjectOutput(_0x53daeb,_0x412695),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(_0x1f0a89){const _0x36c1aa=a59_0x5f4ff5,_0x5821da=Math[_0x36c1aa(0x227)](_0x1f0a89/0x3e8),_0x36e73f=Math[_0x36c1aa(0x227)](_0x5821da/0x3c),_0x270c8a=Math[_0x36c1aa(0x227)](_0x36e73f/0x3c),_0x5ec872=Math[_0x36c1aa(0x227)](_0x270c8a/0x18);if(_0x5ec872>0x0){const _0x4811c1=_0x270c8a%0x18;return _0x4811c1>0x0?_0x5ec872+'d\x20'+_0x4811c1+'h':_0x5ec872+'d';}else{if(_0x270c8a>0x0){const _0xac4235=_0x36e73f%0x3c;return _0xac4235>0x0?_0x270c8a+'h\x20'+_0xac4235+'m':_0x270c8a+'h';}else{if(_0x36e73f>0x0){const _0x160c05=_0x5821da%0x3c;return _0x160c05>0x0?_0x36e73f+'m\x20'+_0x160c05+'s':_0x36e73f+'m';}else return _0x5821da+'s';}}}function formatTimestamp(_0x405000,_0x141ac9){const _0x58a5e4=a59_0x5f4ff5,_0xc70559=new Date(_0x405000),_0x1cfa97=String(_0xc70559[_0x58a5e4(0x1bf)]())[_0x58a5e4(0x111)](0x2,'0'),_0x3ba575=String(_0xc70559[_0x58a5e4(0x107)]())[_0x58a5e4(0x111)](0x2,'0'),_0x3798b6=_0x1cfa97+':'+_0x3ba575,_0x416681=_0xc70559[_0x58a5e4(0x126)]()===_0x141ac9[_0x58a5e4(0x126)]()&&_0xc70559[_0x58a5e4(0x11f)]()===_0x141ac9['getMonth']()&&_0xc70559[_0x58a5e4(0x25c)]()===_0x141ac9[_0x58a5e4(0x25c)]();if(_0x416681)return _0x3798b6;else{const _0x2eceab=String(_0xc70559[_0x58a5e4(0x11f)]()+0x1)[_0x58a5e4(0x111)](0x2,'0'),_0x326a59=String(_0xc70559[_0x58a5e4(0x25c)]())[_0x58a5e4(0x111)](0x2,'0');return _0x2eceab+'-'+_0x326a59+'\x20'+_0x3798b6;}}function formatDate(_0xd33625){const _0x4def6c=a59_0x5f4ff5,_0x44bdb4=_0xd33625[_0x4def6c(0x126)](),_0x23ea0f=String(_0xd33625[_0x4def6c(0x11f)]()+0x1)[_0x4def6c(0x111)](0x2,'0'),_0x22f965=String(_0xd33625[_0x4def6c(0x25c)]())['padStart'](0x2,'0');return _0x44bdb4+'-'+_0x23ea0f+'-'+_0x22f965;}function getTaskStateIcon(_0xc1eef2){const _0x7e1d1f={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x7e1d1f[_0xc1eef2]||'⚪';}function getBarChar(_0x23b936){const _0x1c3d30=a59_0x5f4ff5;return _0x23b936===_0x1c3d30(0x10b)||_0x23b936===_0x1c3d30(0x197)?'×':'─';}function getBarColor(_0x38c961){const _0x197769=a59_0x5f4ff5,_0xe34d34={'success':a59_0xc31aad[_0x197769(0x118)],'error':a59_0xc31aad[_0x197769(0x209)],'group_error':a59_0xc31aad[_0x197769(0x209)],'running':a59_0xc31aad[_0x197769(0x146)],'blocked':a59_0xc31aad[_0x197769(0x1a2)],'planned':a59_0xc31aad['dim'],'canceling':a59_0xc31aad[_0x197769(0x1a2)]};return _0xe34d34[_0x38c961]||a59_0xc31aad['white'];}function parseTaskName(_0x20e279){const _0xef0df9=a59_0x5f4ff5;let _0x13b2f7=_0x20e279[_0xef0df9(0x20f)](/^\++/,'');const _0x435f62=_0x13b2f7[_0xef0df9(0x178)]('+'),_0x39b3bf=_0x435f62[_0xef0df9(0x1e6)]>0x1?_0x435f62[_0xef0df9(0x1e6)]-0x2:0x0,_0x36c96d=_0x435f62[_0x435f62['length']-0x1]||_0x13b2f7;return{'level':_0x39b3bf,'name':'+'+_0x36c96d};}function truncateTaskName(_0x45c2a2,_0xf57156){const _0x16b094=a59_0x5f4ff5,_0x1c0121=stringWidth(_0x45c2a2);if(_0x1c0121<=_0xf57156)return _0x45c2a2;let _0x4d0a66=_0x45c2a2;while(stringWidth(_0x4d0a66+'…')>_0xf57156&&_0x4d0a66[_0x16b094(0x1e6)]>0x0){_0x4d0a66=_0x4d0a66[_0x16b094(0x1d9)](0x0,-0x1);}return _0x4d0a66+'…';}function calculateTimeScale(_0x116980,_0x478cc1){const _0x287f3c=a59_0x5f4ff5;return{'startTime':_0x116980[_0x287f3c(0x2ab)],'endTime':_0x116980[_0x287f3c(0x2a4)],'durationMs':_0x116980[_0x287f3c(0x1c0)],'msPerChar':_0x116980[_0x287f3c(0x1c0)]/_0x478cc1};}function timeToPosition(_0xeaa145,_0x384d1c,_0x544ded){const _0x346c22=a59_0x5f4ff5,_0x3282f1=_0xeaa145-_0x384d1c[_0x346c22(0x29e)],_0x474fa2=Math['floor'](_0x3282f1/_0x384d1c[_0x346c22(0x219)]);return Math[_0x346c22(0xe5)](0x0,Math['min'](_0x474fa2,_0x544ded));}function renderTimeAxis(_0x15f63e,_0xd743bc){const _0x1cc041=a59_0x5f4ff5,_0x25bbd1=Math['min'](TIMELINE_CONFIG[_0x1cc041(0x13c)],Math[_0x1cc041(0xe5)](TIMELINE_CONFIG[_0x1cc041(0x1c4)],Math['floor'](_0xd743bc/TIMELINE_CONFIG[_0x1cc041(0xfe)]))),_0x1b2432=_0x15f63e[_0x1cc041(0xe6)]/(_0x25bbd1-0x1),_0x4595ae=new Date(_0x15f63e['startTime']),_0x3594ed=[];for(let _0x3211ce=0x0;_0x3211ce<_0x25bbd1;_0x3211ce++){const _0x2b98aa=_0x15f63e[_0x1cc041(0x29e)]+_0x3211ce*_0x1b2432,_0x286ff9=timeToPosition(_0x2b98aa,_0x15f63e,_0xd743bc),_0x4618bb=formatTimestamp(_0x2b98aa,_0x4595ae);_0x3594ed[_0x1cc041(0x260)]({'pos':_0x286ff9,'text':_0x4618bb});}const _0xce1263=new Array(_0xd743bc)[_0x1cc041(0x263)]('\x20');let _0xe08428=-0x1;for(const {pos:_0x5502f3,text:_0x37fa40}of _0x3594ed){let _0x8be841=Math[_0x1cc041(0xe5)](0x0,_0x5502f3-Math['floor'](_0x37fa40['length']/0x2));_0x8be841<=_0xe08428+TIMELINE_CONFIG[_0x1cc041(0x1d6)]&&(_0x8be841=_0xe08428+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x8be841+_0x37fa40[_0x1cc041(0x1e6)]>_0xd743bc&&(_0x8be841=_0xd743bc-_0x37fa40[_0x1cc041(0x1e6)]);if(_0x8be841>=0x0&&_0x8be841+_0x37fa40['length']<=_0xd743bc&&_0x8be841>_0xe08428){for(let _0x51509d=0x0;_0x51509d<_0x37fa40[_0x1cc041(0x1e6)];_0x51509d++){_0xce1263[_0x8be841+_0x51509d]=_0x37fa40[_0x51509d];}_0xe08428=_0x8be841+_0x37fa40[_0x1cc041(0x1e6)]-0x1;}}return _0xce1263[_0x1cc041(0x140)]('');}function renderTaskRow(_0x1595c5,_0x1586d3,_0x4be00f,_0x5257e){const _0x1e4aac=a59_0x5f4ff5,{level:_0x121db4,name:_0x17faf6}=parseTaskName(_0x1595c5[_0x1e4aac(0x282)]),_0x101e57='\x20'[_0x1e4aac(0x225)](_0x121db4),_0x47cfff=_0x1595c5[_0x1e4aac(0x1f5)]?'('+formatElapsed(_0x1595c5[_0x1e4aac(0x1f5)][_0x1e4aac(0x1c0)])+')':'',_0x1bda2b=stringWidth(_0x47cfff),_0x3b015b=_0x121db4*0x1,_0x32e37c=_0x5257e-_0x3b015b-_0x1bda2b-0x1,_0x5efb3c=truncateTaskName(_0x17faf6,_0x32e37c),_0x3888ab=_0x101e57+_0x5efb3c,_0x3bf000=stringWidth(_0x3888ab),_0x5def5f=_0x5257e-_0x3bf000-_0x1bda2b,_0xe6da30=_0x3888ab+'\x20'['repeat'](Math[_0x1e4aac(0xe5)](0x1,_0x5def5f))+a59_0xc31aad['dim'](_0x47cfff),_0x4010cc=getTaskStateIcon(_0x1595c5['state']),_0x2a6c1a=new Array(_0x4be00f)[_0x1e4aac(0x263)]('\x20');if(_0x1595c5[_0x1e4aac(0x1f5)]){const _0x6b7375=timeToPosition(_0x1595c5[_0x1e4aac(0x1f5)]['start'],_0x1586d3,_0x4be00f),_0x5d7453=timeToPosition(_0x1595c5[_0x1e4aac(0x1f5)][_0x1e4aac(0x2a4)],_0x1586d3,_0x4be00f),_0x35edb3=getBarChar(_0x1595c5[_0x1e4aac(0x17e)]),_0x5c51fc=Math[_0x1e4aac(0xe5)](_0x6b7375+0x1,_0x5d7453);for(let _0x234670=_0x6b7375;_0x234670<Math['min'](_0x5c51fc,_0x4be00f);_0x234670++){_0x2a6c1a[_0x234670]=_0x35edb3;}}const _0x5548b1=getBarColor(_0x1595c5['state']),_0x33a7db=_0x2a6c1a[_0x1e4aac(0xe1)](_0x446157=>_0x446157==='\x20'?'\x20':_0x5548b1(_0x446157))['join']('');return _0x4010cc+'\x20'+_0xe6da30+'│'+_0x33a7db+'│';}function calculateStats(_0x4816f9){const _0x3f5ff7=a59_0x5f4ff5,_0xb0a6e={'total':_0x4816f9['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x392196 of _0x4816f9){if(_0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x142))_0xb0a6e[_0x3f5ff7(0x142)]++;else{if(_0x392196[_0x3f5ff7(0x17e)]==='error'||_0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x197))_0xb0a6e[_0x3f5ff7(0x10b)]++;else _0x392196[_0x3f5ff7(0x17e)]===_0x3f5ff7(0x1ad)?_0xb0a6e[_0x3f5ff7(0x1ad)]++:_0xb0a6e[_0x3f5ff7(0x122)]++;}}return _0xb0a6e;}function formatStats(_0x1cef11){const _0x584024=a59_0x5f4ff5;return[_0x584024(0x25b)+_0x1cef11['total'],'✅\x20'+_0x1cef11[_0x584024(0x142)],'❌\x20'+_0x1cef11['error'],_0x584024(0x1e4)+_0x1cef11[_0x584024(0x1ad)],'⏳\x20'+_0x1cef11[_0x584024(0x122)]][_0x584024(0x140)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a59_0x5f4ff5(0x17a);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async['execute'](_0xa13eed){const _0x4411ff=a59_0x5f4ff5,{options:_0x3b9b7c,args:_0x501aae,tdx:_0x41aad3}=_0xa13eed;let _0x330b12,_0x35c57e,_0x49050b=![];if(_0x501aae[0x0]){if(_0x501aae[0x0][_0x4411ff(0x177)]('.')){const _0xc98f11=this['parseProjectWorkflowPattern'](_0x501aae,_0x3b9b7c);if(!_0xc98f11)return 0x1;_0x330b12=_0xc98f11[_0x4411ff(0x1c6)],_0x35c57e=_0xc98f11[_0x4411ff(0x206)];}else{_0x35c57e=_0x501aae[0x0],_0x330b12=_0x3b9b7c[_0x4411ff(0x1aa)];if(!_0x330b12)return console['error'](a59_0xc31aad[_0x4411ff(0x209)]('Error:'),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x49050b=!![];}}else{const _0x3f93e0=this['parseProjectWorkflowPattern'](_0x501aae,_0x3b9b7c);if(!_0x3f93e0)return 0x1;_0x330b12=_0x3f93e0['projectName'],_0x35c57e=_0x3f93e0['workflowName'];}if(_0x3b9b7c[_0x4411ff(0x269)]){if(_0x330b12&&_0x35c57e)console['error']('Filter:\x20'+_0x330b12+'.'+_0x35c57e);else _0x330b12&&console[_0x4411ff(0x10b)](_0x4411ff(0x23d)+_0x330b12);}const _0x2a504a=_0x3b9b7c[_0x4411ff(0x125)],_0xecd417=_0x3b9b7c[_0x4411ff(0x165)];if(_0x2a504a){_0xecd417&&console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x1a2)](_0x4411ff(0x1cc)),_0x4411ff(0x26f));const _0x204f2f=_0x3b9b7c['follow'];return _0x204f2f?await this[_0x4411ff(0x1f3)](_0xa13eed,_0x2a504a):await this[_0x4411ff(0x26b)](_0xa13eed,_0x2a504a,_0x3b9b7c),0x0;}if(_0xecd417){const _0x2ea164=await withSpinner(_0x4411ff(0x215),()=>_0x41aad3['workflow'][_0x4411ff(0xd7)]({'projectName':_0x330b12,'workflowName':_0x35c57e,'limit':0x64}),{'verbose':_0x3b9b7c[_0x4411ff(0x269)]}),_0x76f0cc=_0x2ea164[_0x4411ff(0x186)][_0x4411ff(0x2a9)](_0x3ffeb6=>_0x3ffeb6['id']===_0xecd417);if(!_0x76f0cc)return console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x209)](_0x4411ff(0x229)),_0x4411ff(0x157)+_0xecd417),0x1;if(!_0x76f0cc[_0x4411ff(0x12e)]?.['id'])return console[_0x4411ff(0x10b)](a59_0xc31aad['red'](_0x4411ff(0x229)),'Session\x20'+_0xecd417+_0x4411ff(0x15a)),0x1;const _0x4bc44e=_0x76f0cc[_0x4411ff(0x12e)]['id'];_0x3b9b7c[_0x4411ff(0x269)]&&console[_0x4411ff(0x10b)](_0x4411ff(0x19c)+_0x4bc44e+_0x4411ff(0x1db)+_0xecd417);const _0x17d5b3=_0x3b9b7c[_0x4411ff(0xde)];return _0x17d5b3?await this[_0x4411ff(0x1f3)](_0xa13eed,_0x4bc44e):await this[_0x4411ff(0x26b)](_0xa13eed,_0x4bc44e,_0x3b9b7c),0x0;}const _0x1e7e5d=await withSpinner(_0x4411ff(0x14b),()=>_0x41aad3[_0x4411ff(0x202)][_0x4411ff(0xd7)]({'projectName':_0x330b12,'workflowName':_0x35c57e,'limit':_0x3b9b7c[_0x4411ff(0x156)]||0x32}),{'verbose':_0x3b9b7c[_0x4411ff(0x269)]}),_0x2458e5=_0x1e7e5d[_0x4411ff(0x186)];if(_0x2458e5[_0x4411ff(0x1e6)]===0x0){if(_0x330b12&&_0x35c57e)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x330b12+'.'+_0x35c57e);else _0x330b12?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x330b12):(console[_0x4411ff(0x10b)](_0x4411ff(0x199)),console[_0x4411ff(0x10b)](a59_0xc31aad[_0x4411ff(0x1e5)](_0x4411ff(0x1e0))));return 0x0;}_0x2458e5[_0x4411ff(0x257)]((_0x482a28,_0x598aa5)=>{const _0x2aca53=_0x4411ff,_0x3fb9c3=_0x482a28['sessionTime']||'',_0x309bf1=_0x598aa5[_0x2aca53(0x14d)]||'';return _0x309bf1[_0x2aca53(0x12b)](_0x3fb9c3);});if(_0x3b9b7c[_0x4411ff(0x277)]||_0x3b9b7c[_0x4411ff(0x1df)])return await handleSDKOutput(_0x2458e5,_0x3b9b7c),0x0;let _0x1e143c;if(_0x49050b){const _0x466b84=_0x2458e5[0x0];if(!_0x466b84[_0x4411ff(0x12e)]?.['id'])return console[_0x4411ff(0x10b)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x1e143c=_0x466b84['lastAttempt']['id'],_0x3b9b7c[_0x4411ff(0x269)]&&console[_0x4411ff(0x10b)](_0x4411ff(0x141)+_0x466b84[_0x4411ff(0x14d)]);}else{const _0x3d6478=_0x2458e5[_0x4411ff(0xe1)](_0x241797=>{const _0xa00aaa=_0x4411ff,_0x18a601=getAttemptStatusDisplay(_0x241797[_0xa00aaa(0x12e)]);return{'title':_0x241797['project']?.[_0xa00aaa(0x282)]+'.'+_0x241797[_0xa00aaa(0x202)]?.[_0xa00aaa(0x282)]+'\x20-\x20'+_0x241797['sessionTime']+'\x20'+_0x18a601[_0xa00aaa(0x287)],'value':_0x241797[_0xa00aaa(0x12e)]?.['id']||'','description':_0x18a601[_0xa00aaa(0x1ca)]};}),_0x291d0a=await a59_0x42cf4e({'type':'select','name':_0x4411ff(0x125),'message':_0x4411ff(0x102),'choices':_0x3d6478[_0x4411ff(0x19f)](_0x41473b=>_0x41473b['value']!=='')});if(!_0x291d0a['attemptId'])return 0x0;_0x1e143c=_0x291d0a[_0x4411ff(0x125)];}const _0xf53001=_0x3b9b7c[_0x4411ff(0xde)];return _0xf53001?await this['pollTimeline'](_0xa13eed,_0x1e143c):await this[_0x4411ff(0x26b)](_0xa13eed,_0x1e143c,_0x3b9b7c),0x0;}async['renderSingleTimeline'](_0x21c712,_0x1221fb,_0x166d24){const _0xfeff53=a59_0x5f4ff5,{tdx:_0xe7c4fe}=_0x21c712;let _0xa07a3c,_0x399d36;try{[_0xa07a3c,_0x399d36]=await Promise[_0xfeff53(0x190)]([_0xe7c4fe['workflow'][_0xfeff53(0x1a8)](_0x1221fb),_0xe7c4fe[_0xfeff53(0x202)][_0xfeff53(0x1c7)](_0x1221fb,![])]);}catch(_0x24b5d8){console['error'](a59_0xc31aad['red'](_0xfeff53(0x25a)));_0x166d24['verbose']&&console['error'](_0x24b5d8);throw _0x24b5d8;}if(_0x166d24[_0xfeff53(0x277)]||_0x166d24[_0xfeff53(0x1df)]){const _0x48700a=this[_0xfeff53(0x218)](_0xa07a3c,_0x399d36);await handleSDKOutput([_0x48700a],_0x166d24);return;}const _0x4665d5=_0xe7c4fe[_0xfeff53(0x166)][_0xfeff53(0x130)],_0x107bc7=this[_0xfeff53(0x105)](_0xa07a3c,_0x399d36,_0x4665d5);console[_0xfeff53(0x16c)](_0x107bc7);}async['pollTimeline'](_0x43e520,_0xfa92e7){const _0x3f63da=a59_0x5f4ff5,{tdx:_0x113120}=_0x43e520,_0x1e5bc8=TIMELINE_CONFIG[_0x3f63da(0x2a3)],_0x173a61=TIMELINE_CONFIG[_0x3f63da(0x1a1)];let _0x2c4018=0x0;while(_0x2c4018<_0x173a61){process['stdout'][_0x3f63da(0x16a)]&&process[_0x3f63da(0xee)]['write']('\x1Bc');let _0x480e20,_0x3fb40b;try{[_0x480e20,_0x3fb40b]=await Promise[_0x3f63da(0x190)]([_0x113120[_0x3f63da(0x202)][_0x3f63da(0x1a8)](_0xfa92e7),_0x113120['workflow'][_0x3f63da(0x1c7)](_0xfa92e7,![])]);}catch(_0x82dbfa){console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x209)](_0x3f63da(0x20b)));_0x2c4018>0x0&&console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1e5)](_0x3f63da(0x172)+_0x2c4018));throw _0x82dbfa;}const _0x5465d7=_0x113120[_0x3f63da(0x166)]['site'],_0x2ce442=this[_0x3f63da(0x105)](_0x480e20,_0x3fb40b,_0x5465d7);console['log'](_0x2ce442);const _0x1a81c0=_0x480e20[_0x3f63da(0xda)]&&_0x3fb40b[_0x3f63da(0x1c3)](_0x3ad078=>_0x3ad078[_0x3f63da(0x17e)]!==_0x3f63da(0x1ad)&&_0x3ad078['state']!==_0x3f63da(0x16b));if(_0x1a81c0){console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x118)](_0x3f63da(0x252)));break;}console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1e5)](_0x3f63da(0x24c)+_0x2c4018*0x2+_0x3f63da(0x19b))),await new Promise(_0x4a5f9d=>setTimeout(_0x4a5f9d,_0x1e5bc8)),_0x2c4018++;}_0x2c4018>=_0x173a61&&console[_0x3f63da(0x10b)](a59_0xc31aad[_0x3f63da(0x1a2)](_0x3f63da(0x279)));}['renderTimeline'](_0x22005a,_0x5ed1ff,_0x502bf0){const _0x555d20=a59_0x5f4ff5,_0x1d98b9=[],_0x3a2c62=TIMELINE_CONFIG[_0x555d20(0x27b)],_0x101ec6=0x5,_0x28bd87=process[_0x555d20(0xee)][_0x555d20(0x129)]||0x78,_0x19e054=_0x28bd87-_0x3a2c62-_0x101ec6,_0x83b605=Math[_0x555d20(0xe5)](TIMELINE_CONFIG[_0x555d20(0x28e)],Math[_0x555d20(0x1b1)](_0x19e054,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0xee0e2a=new Date(_0x22005a[_0x555d20(0x210)])[_0x555d20(0x1d2)](),_0x4fee70=_0x22005a['finishedAt']?new Date(_0x22005a[_0x555d20(0x1a6)])['getTime']():Date[_0x555d20(0x1da)](),_0x55a8a2={'start':_0xee0e2a,'end':_0x4fee70,'duration':_0x4fee70-_0xee0e2a},_0x120814=new Map(),_0x50c31f=[];for(const _0x437ea4 of _0x5ed1ff){if(_0x437ea4[_0x555d20(0x272)]){const _0x34bb1b=new Date(_0x437ea4['startedAt'])[_0x555d20(0x1d2)](),_0x1ee22d=_0x437ea4['updatedAt']?new Date(_0x437ea4['updatedAt'])[_0x555d20(0x1d2)]():Date[_0x555d20(0x1da)](),_0x30c69e={'start':_0x34bb1b,'end':_0x1ee22d,'duration':_0x1ee22d-_0x34bb1b};_0x120814['set'](_0x437ea4['id'],_0x30c69e),_0x50c31f[_0x555d20(0x260)]({'name':_0x437ea4['fullName'],'state':_0x437ea4['state']||_0x555d20(0x154),'window':_0x30c69e});}else _0x50c31f[_0x555d20(0x260)]({'name':_0x437ea4[_0x555d20(0x1a4)],'state':_0x437ea4[_0x555d20(0x17e)]||_0x555d20(0x16b),'window':undefined});}_0x50c31f[_0x555d20(0x257)]((_0xd2e9f1,_0x2b8a28)=>{const _0x34ed37=_0x555d20;if(!_0xd2e9f1[_0x34ed37(0x1f5)])return 0x1;if(!_0x2b8a28['window'])return-0x1;return _0xd2e9f1[_0x34ed37(0x1f5)][_0x34ed37(0x2ab)]-_0x2b8a28[_0x34ed37(0x1f5)][_0x34ed37(0x2ab)];});const _0x2a6485=_0x50c31f[_0x555d20(0x1e6)],_0x26de87=_0x2a6485>TIMELINE_CONFIG[_0x555d20(0x21c)];_0x26de87&&_0x50c31f[_0x555d20(0x273)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x4c36fa=calculateTimeScale(_0x55a8a2,_0x83b605),_0x308240=_0x22005a['done']?_0x22005a[_0x555d20(0x142)]?a59_0xc31aad[_0x555d20(0x118)]('success'):a59_0xc31aad[_0x555d20(0x209)](_0x555d20(0x10b)):a59_0xc31aad[_0x555d20(0x146)](_0x555d20(0x1ad)),_0x247820=_0x22005a[_0x555d20(0xec)]?.['id'],_0x3e07ac=_0x22005a[_0x555d20(0x165)];let _0x58d30c;if(_0x247820&&_0x3e07ac){const _0x530ccb=getWorkflowAttemptUrl(_0x502bf0,_0x247820,_0x3e07ac,_0x22005a['id']);_0x58d30c=hyperlink(a59_0xc31aad[_0x555d20(0x1e5)](_0x22005a['id']),_0x530ccb);}else _0x58d30c=a59_0xc31aad[_0x555d20(0x1e5)](_0x22005a['id']);_0x1d98b9[_0x555d20(0x260)](_0x555d20(0x249)+_0x58d30c+'\x20-\x20'+_0x308240+_0x555d20(0x1ee)+formatElapsed(_0x55a8a2['duration']));if(_0x50c31f[_0x555d20(0x1e6)]>0x0){const _0x56f286=renderTimeAxis(_0x4c36fa,_0x83b605),_0x5e9694=new Date(_0x55a8a2[_0x555d20(0x2ab)]),_0x1b2abb=formatDate(_0x5e9694),_0x28e26c=TIMELINE_CONFIG[_0x555d20(0x18c)]+TIMELINE_CONFIG[_0x555d20(0x133)]+_0x3a2c62,_0x2382b3=_0x1b2abb['padStart'](_0x28e26c),_0xadd105=a59_0xc31aad[_0x555d20(0x1e5)](_0x2382b3);_0x1d98b9[_0x555d20(0x260)](_0xadd105+'\x20'+_0x56f286);for(const _0x331796 of _0x50c31f){_0x1d98b9['push'](renderTaskRow(_0x331796,_0x4c36fa,_0x83b605,_0x3a2c62));}const _0x9bb2b6=calculateStats(_0x50c31f);_0x1d98b9[_0x555d20(0x260)](formatStats(_0x9bb2b6)),_0x26de87&&_0x1d98b9['push'](a59_0xc31aad[_0x555d20(0x1a2)](_0x555d20(0x248)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x555d20(0x104)+_0x2a6485+_0x555d20(0x19a))),_0x1d98b9[_0x555d20(0x260)](''),_0x1d98b9[_0x555d20(0x260)](a59_0xc31aad[_0x555d20(0x1e5)](_0x555d20(0x23b))+(_0x555d20(0x297)+_0x22005a['id']+'\x20logs')+a59_0xc31aad[_0x555d20(0x1e5)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1d98b9[_0x555d20(0x260)](_0x555d20(0x22e));return _0x1d98b9[_0x555d20(0x140)]('\x0a');}[a59_0x5f4ff5(0x218)](_0x22ac16,_0x24c123){const _0x4f0ac1=a59_0x5f4ff5,_0x2df42c=new Date(_0x22ac16['createdAt'])[_0x4f0ac1(0x1d2)](),_0x3985a0=_0x22ac16['finishedAt']?new Date(_0x22ac16[_0x4f0ac1(0x1a6)])[_0x4f0ac1(0x1d2)]():Date[_0x4f0ac1(0x1da)](),_0x50a349=_0x3985a0-_0x2df42c,_0x24d768=[];for(const _0x25fac9 of _0x24c123){if(_0x25fac9[_0x4f0ac1(0x272)]){const _0x3cf536=new Date(_0x25fac9[_0x4f0ac1(0x272)])['getTime'](),_0x40140f=_0x25fac9[_0x4f0ac1(0x173)]?new Date(_0x25fac9['updatedAt'])[_0x4f0ac1(0x1d2)]():Date['now']();_0x24d768[_0x4f0ac1(0x260)]({'name':_0x25fac9[_0x4f0ac1(0x1a4)],'state':_0x25fac9['state']||_0x4f0ac1(0x154),'window':{'start':_0x3cf536,'end':_0x40140f,'duration':_0x40140f-_0x3cf536}});}else _0x24d768[_0x4f0ac1(0x260)]({'name':_0x25fac9[_0x4f0ac1(0x1a4)],'state':_0x25fac9[_0x4f0ac1(0x17e)]||'planned','window':undefined});}const _0x59ae44=calculateStats(_0x24d768);return{'attempt':{'id':_0x22ac16['id'],'status':_0x22ac16[_0x4f0ac1(0xda)]?_0x22ac16[_0x4f0ac1(0x142)]?_0x4f0ac1(0x142):'error':_0x4f0ac1(0x1ad),'createdAt':_0x22ac16[_0x4f0ac1(0x210)],'finishedAt':_0x22ac16['finishedAt'],'duration_ms':_0x50a349},'tasks':_0x24d768[_0x4f0ac1(0xe1)](_0x593b4d=>({'name':_0x593b4d[_0x4f0ac1(0x282)],'state':_0x593b4d[_0x4f0ac1(0x17e)],'startedAt':_0x593b4d['window']?new Date(_0x593b4d[_0x4f0ac1(0x1f5)]['start'])[_0x4f0ac1(0x1a7)]():null,'updatedAt':_0x593b4d[_0x4f0ac1(0x1f5)]?new Date(_0x593b4d[_0x4f0ac1(0x1f5)][_0x4f0ac1(0x2a4)])[_0x4f0ac1(0x1a7)]():null,'duration_ms':_0x593b4d['window']?.[_0x4f0ac1(0x1c0)]||null})),'stats':_0x59ae44};}}function formatScheduleLine(_0x4a7c81){const _0x385e66=a59_0x5f4ff5,_0x58f09d=_0x4a7c81['disabledAt']?a59_0xc31aad['yellow'](_0x385e66(0x239)):'',_0x313d0a=_0x4a7c81[_0x385e66(0xec)]?.['name']?a59_0xc31aad['dim']('\x20['+_0x4a7c81['project'][_0x385e66(0x282)]+']'):'',_0x14aaa6=_0x4a7c81[_0x385e66(0x21f)]?a59_0xc31aad['dim'](_0x385e66(0x1ef)+new Date(_0x4a7c81[_0x385e66(0x21f)])[_0x385e66(0x131)]()):'';return _0x385e66(0x2a6)+_0x4a7c81['id']+'\x20'+(_0x4a7c81[_0x385e66(0x202)]?.[_0x385e66(0x282)]||'(unknown)')+_0x313d0a+_0x58f09d+_0x14aaa6;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{['name']='workflow:schedules';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x123);async[a59_0x5f4ff5(0x12a)](_0x4adc1b){const _0x3cbbbf=a59_0x5f4ff5,{options:_0x54e4e0,args:_0x3b58a8,tdx:_0x37e30f}=_0x4adc1b,{scheduleId:_0x5cf54d}=_0x54e4e0;if(_0x5cf54d&&_0x3b58a8[0x0])return console[_0x3cbbbf(0x10b)](a59_0xc31aad[_0x3cbbbf(0x209)]('Error:'),_0x3cbbbf(0x217)),console[_0x3cbbbf(0x10b)](a59_0xc31aad['dim'](_0x3cbbbf(0x15e))),0x1;if(_0x5cf54d){const _0x1b3743=await withSpinner(_0x3cbbbf(0x230)+_0x5cf54d+_0x3cbbbf(0x1ce),()=>_0x37e30f[_0x3cbbbf(0x202)][_0x3cbbbf(0x1e9)](_0x5cf54d),{'verbose':_0x54e4e0[_0x3cbbbf(0x269)]}),_0x35b24d=_0x1b3743[_0x3cbbbf(0x186)];return isStructuredFormat(_0x54e4e0)?await handleSingleObjectOutput(_0x35b24d,_0x54e4e0):(console['error']('✔\x20Schedule\x20found'),console['log'](formatScheduleLine(_0x35b24d))),0x0;}const _0x3cd11a=this[_0x3cbbbf(0x27d)](_0x3b58a8,_0x54e4e0);if(!_0x3cd11a)return 0x1;const {projectName:_0x22ac33,workflowName:_0x5f4dc1}=_0x3cd11a,_0x23c252=_0x22ac33?'\x27'+_0x22ac33+(_0x5f4dc1?'.'+_0x5f4dc1:'')+'\x27':undefined,_0x142f44=await withSpinner(_0x23c252?_0x3cbbbf(0x14f)+_0x23c252+_0x3cbbbf(0x1ce):_0x3cbbbf(0x108),()=>_0x22ac33?_0x37e30f['workflow'][_0x3cbbbf(0x201)](_0x22ac33,{'workflow':_0x5f4dc1,'limit':_0x54e4e0[_0x3cbbbf(0x156)]}):_0x37e30f['workflow'][_0x3cbbbf(0x20a)]({'limit':_0x54e4e0['limit']}),{'verbose':_0x54e4e0['verbose']}),_0x1cb997=_0x142f44[_0x3cbbbf(0x186)],_0x4c2b3c=_0x54e4e0[_0x3cbbbf(0x156)]&&_0x1cb997[_0x3cbbbf(0x1e6)]>=_0x54e4e0[_0x3cbbbf(0x156)]?a59_0xc31aad[_0x3cbbbf(0x1e5)](_0x3cbbbf(0x139)):'';console[_0x3cbbbf(0x10b)](_0x3cbbbf(0x267)+_0x1cb997['length']+_0x3cbbbf(0x256)+(_0x1cb997[_0x3cbbbf(0x1e6)]!==0x1?'s':'')+_0x4c2b3c);if(isStructuredFormat(_0x54e4e0))await handleSDKOutput(_0x1cb997,_0x54e4e0);else{if(_0x1cb997[_0x3cbbbf(0x1e6)]===0x0)console[_0x3cbbbf(0x16c)]('No\x20schedules\x20found');else for(const _0x1ec5e3 of _0x1cb997){console[_0x3cbbbf(0x16c)](formatScheduleLine(_0x1ec5e3));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a59_0x5f4ff5(0x18d);['description']=a59_0x5f4ff5(0x189);async[a59_0x5f4ff5(0x12a)](_0x4951c){const _0x3dfd41=a59_0x5f4ff5,{options:_0x1a86de,args:_0xe7ee83,tdx:_0x57bce7}=_0x4951c,_0x19de2b=_0xe7ee83[0x0];if(!_0x19de2b)return console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x209)](_0x3dfd41(0x229)),_0x3dfd41(0x1f4)),console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x1e5)]('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x3dfd41(0x10b)](a59_0xc31aad[_0x3dfd41(0x1e5)](_0x3dfd41(0x1e8))),0x1;const {backfill:_0x2ed280,nextTime:_0x455b63}=_0x1a86de,_0x34ac99={};if(_0x2ed280!==undefined)_0x34ac99[_0x3dfd41(0x1dc)]=!_0x2ed280;if(_0x455b63!==undefined)_0x34ac99[_0x3dfd41(0x23f)]=_0x455b63;const _0x3d3f6a=await withSpinner(_0x3dfd41(0x145)+_0x19de2b+_0x3dfd41(0x1ce),()=>_0x57bce7[_0x3dfd41(0x202)][_0x3dfd41(0x1d0)](_0x19de2b,_0x34ac99),{'verbose':_0x1a86de[_0x3dfd41(0x269)]}),_0x40f6f1=_0x3d3f6a['data'];return isStructuredFormat(_0x1a86de)?await handleSingleObjectOutput(_0x40f6f1,_0x1a86de):(console[_0x3dfd41(0x16c)](_0x3dfd41(0x28f)+_0x19de2b+_0x3dfd41(0x187)+(_0x40f6f1[_0x3dfd41(0x202)]?.[_0x3dfd41(0x282)]||_0x3dfd41(0x154))+')'),_0x40f6f1['nextRunTime']&&console[_0x3dfd41(0x16c)](a59_0xc31aad[_0x3dfd41(0x1e5)]('\x20\x20Next\x20run:\x20'+new Date(_0x40f6f1[_0x3dfd41(0x21f)])[_0x3dfd41(0x131)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x5f4ff5(0x282)]='workflow:schedule:disable';[a59_0x5f4ff5(0x228)]=a59_0x5f4ff5(0x137);async['execute'](_0x57b743){const _0x520d7f=a59_0x5f4ff5,{options:_0x3902f2,args:_0x8cdeb1,tdx:_0x82a7b9}=_0x57b743,_0xbfe409=_0x8cdeb1[0x0];if(!_0xbfe409)return console[_0x520d7f(0x10b)](a59_0xc31aad[_0x520d7f(0x209)](_0x520d7f(0x229)),'Schedule\x20ID\x20is\x20required'),console[_0x520d7f(0x10b)](a59_0xc31aad[_0x520d7f(0x1e5)](_0x520d7f(0x150))),console['error'](a59_0xc31aad['dim'](_0x520d7f(0x1e8))),0x1;const _0x514324=await withSpinner(_0x520d7f(0x174)+_0xbfe409+_0x520d7f(0x1ce),()=>_0x82a7b9[_0x520d7f(0x202)][_0x520d7f(0x1b8)](_0xbfe409),{'verbose':_0x3902f2[_0x520d7f(0x269)]}),_0x3ca560=_0x514324['data'];return isStructuredFormat(_0x3902f2)?await handleSingleObjectOutput(_0x3ca560,_0x3902f2):console['log'](_0x520d7f(0x28f)+_0xbfe409+_0x520d7f(0x247)+(_0x3ca560[_0x520d7f(0x202)]?.[_0x520d7f(0x282)]||_0x520d7f(0x154))+')'),0x0;}}
1
+ const a59_0x7f9071=a59_0x392d;(function(_0x502a70,_0x19ef9b){const _0x3a8531=a59_0x392d,_0x1e540f=_0x502a70();while(!![]){try{const _0x16678f=-parseInt(_0x3a8531(0x309))/0x1*(parseInt(_0x3a8531(0x1b9))/0x2)+parseInt(_0x3a8531(0x334))/0x3+-parseInt(_0x3a8531(0x2d5))/0x4+parseInt(_0x3a8531(0x285))/0x5*(-parseInt(_0x3a8531(0x323))/0x6)+-parseInt(_0x3a8531(0x2b6))/0x7+-parseInt(_0x3a8531(0x1d8))/0x8+parseInt(_0x3a8531(0x360))/0x9;if(_0x16678f===_0x19ef9b)break;else _0x1e540f['push'](_0x1e540f['shift']());}catch(_0x92eb82){_0x1e540f['push'](_0x1e540f['shift']());}}}(a59_0x1a0d,0x9889e));import a59_0x33ddab from'chalk';import{existsSync}from'fs';import a59_0x1642f5 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';function a59_0x1a0d(){const _0x56b896=['Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','session','Show\x20tasks\x20for\x20an\x20attempt','group_error','Kill\x20a\x20running\x20attempt','verbose','Using\x20attempt\x20','workflow:workflows','success','Listing\x20workflow\x20attempts...','set','Fetching\x20schedule\x20#','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','list','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','planned','✔\x20Project:\x20','Auto-selected\x20latest\x20session:\x20','data','dim','MAX_TIMELINE_WIDTH','(use\x20--limit\x20to\x20see\x20more)','cyan','\x20schedule','/app/workflows/','modified','\x20\x20Session\x20context\x20set\x20to:\x20','Select\x20a\x20workflow\x20to\x20run','renderSessionsTimeline','localeCompare','resolveProjectId','params','workflow','basename','Schedule\x20ID\x20is\x20required','sort','values','\x20session','readFile','text','Error:\x20Project\x20name\x20is\x20required','toISOString','(unknown)','index','red','\x22\x20to\x20new\x20project\x20\x22','...','renderTimeline','Error:','💡\x20Tip:\x20Use\x20','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','get','Revision:\x20','length','follow','Listing\x20workflows...','indexOf','Pushing\x20workflow\x20project...','resolveProject','Disable\x20a\x20workflow\x20schedule','Error:\x20Secret\x20key\x20is\x20required','newProjectName','\x22\x20with\x20new\x20revision?','workflow:secrets:list','fileSize','\x0aError:','has','Getting\x20attempt\x20tasks...','Attempt\x20ID:\x20','New\x20project\x20name:\x20','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','sessions','✔\x20Pushed\x20','workflow:upload','some','setSecrets','\x20of\x20','Key:\x20','No\x20workflow\x20projects\x20found','✔\x20Secret\x20\x27','workflows','Parameters:\x20','trim','disableSchedule','isTTY','push','\x20secret','output','Filter:\x20project=','splice','\x22\x20already\x20exists\x20(ID:\x20','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','status','workflow:push','workflow:run','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','workflow:attempt','fill','Getting\x20attempt\x20details...','✔\x20Workflow\x20run\x20started','filesExtracted','Latest\x20session\x20has\x20no\x20attempt','---\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Project:\x20','error','nextRunTime','\x20next:\x20','getDate','Deleting\x20project\x20','Task\x20name:\x20','message','\x1b[1A\x1b[2K','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20task','workflow:schedule:enable','Usage:\x20workflow:delete\x20<project-name-or-id>','sessionTime','From\x20task:\x20','targetDir','slice','No\x20workflows\x20found\x20in\x20project:\x20','\x20has\x20no\x20attempts','taskName','navigateSessionsInteractive','Target:\x20','⚠\x20Showing\x20first\x20','Project\x20name\x20is\x20required','site','getMonth','Filter:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','isArray','\x20logs','Validation:\x20skipped','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','floor','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','Select\x20a\x20task\x20to\x20view\x20logs:','resolveProjectDir','path','Output\x20directory:\x20','Enabling\x20schedule\x20#','\x20unchanged','startsWith','json','workflow:secrets:delete','getHours','createdAt','done','Key\x20cannot\x20be\x20empty','logs','Session\x20','parse','duration','1396465KqNJoA','Expected\x20format:\x20--param\x20key=value','Show\x20specific\x20attempt\x20details','Workflow:','Retry\x20a\x20session\x20or\x20attempt','Session\x20time:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','limit','metadata','retryAttemptName','cancelRequested','isNewProject','✔\x20Retry\x20started','task','new','startTime','projects','green','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20\x20Project:\x20','No\x20attempts\x20found\x20in\x20project:\x20','\x20-\x20','resolve','Cancelled','yes','\x0a✔\x20Attempt\x20complete','param','session:','revision:\x20','\x20\x20Attempt\x20ID:\x20','type','sourceDir','✔\x20Workflow\x20project\x20context\x20cleared.','write','\x20\x20Changes:\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','columns','Reason:\x20','state','size','project','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','pollTimeline','✔\x20Schedule\x20found','Workflow:\x20','startedAt','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Loading\x20session...','5956097DLCdAc','\x20(system)','No\x20sessions\x20with\x20timing\x20information','List\x20workflows','\x20workflow','\x20tasks','Dry\x20run:\x20yes','end','summary','Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)','Total:\x20','Enable\x20a\x20workflow\x20schedule','Analyzing\x20changes...','\x20\x20Location:\x20','workflow:attempts','substring','workflowProject','split','download','-\x20no\x20files\x20written','kill','skipValidation','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','window',',\x20Workflow:\x20','attemptId','tasks','toLowerCase','\x20\x20tdx\x20wf\x20use\x20<project>','Resolving\x20project\x20\x27','workflow:logs','4118748ONFwsS','Select\x20a\x20session\x20to\x20view\x20timeline:','fullName','\x20(use\x20--limit\x20to\x20show\x20more)','\x20is\x20not\x20a\x20directory','\x20secrets\x20set\x20for\x20project\x20\x27','workflow:delete','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','config','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:use','filter','prepareCloneProject','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','sys','now','Attempt:\x20','parseProjectWorkflowPattern','Pattern:\x20','✔\x20Schedule\x20#','LABEL_MIN_SPACING','msPerChar','Loading\x20workflows...','fileCount','running','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','sessionId','join','Pushing\x20project...','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','sourceProjectName','\x0aApply\x20these\x20changes?','getWorkflow','\x20\x20Console:\x20','from','log','MAX_LABEL_COUNT','Setting\x20secret...','map','hasChanges','✔\x20Clone\x20complete','getFullYear','includeRetried','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','table','padStart','Parameters:','List\x20workflow\x20schedules','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','13BiENAX','select','deleteSecret','\x20\x20Target:\x20','isDirectory','workflow:sessions','pending','blue','workflow:tasks','Error:\x20Attempt\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','MAX_TASKS_DISPLAY','preparePushProject','No\x20workflow\x20tdx.json\x20found','workflow:timeline','\x0a✔\x20No\x20changes\x20to\x20push','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Session\x20ID:\x20','attempts','updatedAt','changes','Listing\x20schedules\x20for\x20','keys','revision','Retrying\x20session...','find','12PgWrqe','\x20modified','\x20\x20Workflow:\x20','session_id','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x20\x20Revision:\x20','diff','format','bold','projectId','executePushProject','trimEnd','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','generateSessionTimelineRows','Pull\x20workflow\x20project\x20to\x20local\x20folder','listProjectSchedules','\x20project','68856kwhxgG','workflow:schedules','logFiles','workflow:download','Target\x20directory:\x20','Session\x20time:','toLocaleString','newProjectId','requireProject','disabledAt','projectName','all','min','\x0aClone\x20\x22','canceling','🔄\x20','deleted','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20Project\x20ID:\x20','Fetching\x20log\x20files...','No\x20attempts\x20found\x20for:\x20','\x20disabled\x20(','execute','No\x20workflow\x20sessions\x20found','✔\x20Showing\x20','finishedAt','retrySession','/attempt/','\x20to\x20see\x20detailed\x20logs','yellow','No\x20sessions\x20found\x20in\x20project:\x20','getMinutes','white','description','stdout','executeDryRun','workflow:retry','\x20secrets...','key','Project\x20filter:\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','jsonl','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Project\x20updated','42557562FendAq','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','Listing\x20secrets...','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Killing\x20attempt...','\x0aPush\x20these\x20changes?','value','includes','Source\x20directory:\x20','Disabling\x20schedule\x20#','name','✔\x20Found\x20','skipSchedule','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20log\x20content\x20found','Error:\x20Invalid\x20JSON\x20in\x20--params','No\x20sessions\x20found','Status:\x20','replace','\x0a⚠\x20Project\x20\x22','renderSingleTimeline','workflow:projects','existingProjectId','Start\x20a\x20workflow\x20run','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','start','.\x20Expected\x20format:\x20KEY=VALUE','ICON_SPACING','includeSubtasks','force','relative','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','ICON_WIDTH','Params:\x20','\x20from\x20session\x20','fromTask','148854mWoZta','\x20\x20Next\x20run:\x20','showWorkflowConsoleUrl','\x20(disabled)','✔\x20Deleted\x20project\x20','No\x20sessions\x20found\x20for:\x20','delete','\x20attempt','cwd','\x20new','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getSchedule','total','max','targetExists','stat','Downloading\x20logs...','Starting\x20workflow\x20run...','✔\x20Workflow\x20project\x20set\x20to:\x20','round','→\x20New\x20project:\x20','MIN_TIMELINE_WIDTH','Downloading\x20project\x20','dryRun','Failed\x20to\x20fetch\x20attempt\x20data','\x20deleted','getTime','workflow:pull','match','lastAttempt','repeat','5760616jGyQgo','rows','MIN_LABEL_COUNT','Invalid\x20format:\x20','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','unknown','utf-8','List\x20all\x20workflow\x20projects','Pulling\x20project\x20','\x0a✔\x20Already\x20up\x20to\x20date','unchanged','No\x20workflows\x20found','attempt','\x0aDry\x20run\x20-\x20no\x20project\x20created','retryAttempt','Writing\x20files...'];a59_0x1a0d=function(){return _0x56b896;};return a59_0x1a0d();}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_0x30a0c4 from'prompts';function getAttemptStatusDisplay(_0x351efc){const _0x549c86=a59_0x392d;if(!_0x351efc)return{'icon':'⏳','text':''};const {done:_0x5c9b33,success:_0xb981b5,cancelRequested:_0x4ec461}=_0x351efc;if(!_0x5c9b33)return _0x4ec461?{'icon':'🛑','text':a59_0x33ddab[_0x549c86(0x351)](_0x549c86(0x342))}:{'icon':'🔄','text':a59_0x33ddab['blue'](_0x549c86(0x2f0))};if(_0xb981b5)return{'icon':'✅','text':a59_0x33ddab[_0x549c86(0x296)](_0x549c86(0x1f0))};return{'icon':'❌','text':a59_0x33ddab['red'](_0x549c86(0x253))};}export class WorkflowBaseCommand extends BaseCommand{[a59_0x7f9071(0x222)](_0x59cffe,_0x25b8be,_0x191220=0x0){const _0x170b76=a59_0x7f9071;return _0x59cffe[_0x191220]||_0x25b8be[_0x170b76(0x2c6)];}[a59_0x7f9071(0x33c)](_0x461404,_0x5a3768,_0x172de8=0x0){const _0x2df138=a59_0x7f9071,_0x52932d=this[_0x2df138(0x222)](_0x461404,_0x5a3768,_0x172de8);if(!_0x52932d)return console[_0x2df138(0x253)](a59_0x33ddab[_0x2df138(0x214)](_0x2df138(0x218)),_0x2df138(0x269)),console[_0x2df138(0x253)](a59_0x33ddab[_0x2df138(0x1fb)](_0x2df138(0x2ae))),null;return _0x52932d;}[a59_0x7f9071(0x2e9)](_0x50b508,_0x232efd){const _0x55a8c3=a59_0x7f9071;if(_0x50b508[0x0]){const _0x1f99d4=_0x50b508[0x0]['split']('.');if(_0x1f99d4['length']===0x1)return{'projectName':_0x1f99d4[0x0],'workflowName':undefined};else return _0x1f99d4[_0x55a8c3(0x21d)]===0x2?{'projectName':_0x1f99d4[0x0],'workflowName':_0x1f99d4[0x1]}:(console[_0x55a8c3(0x253)](a59_0x33ddab[_0x55a8c3(0x214)]('Error:'),_0x55a8c3(0x35c)),null);}return{'projectName':_0x232efd[_0x55a8c3(0x2c6)],'workflowName':undefined};}[a59_0x7f9071(0x275)](_0x393612,_0x2415e8,_0x2524ca=0x0){const _0x410a22=a59_0x7f9071;if(_0x393612[_0x2524ca])return _0x393612[_0x2524ca];if(_0x2415e8[_0x410a22(0x2c6)]){const _0x5ab348=a59_0x1642f5[_0x410a22(0x2f3)](process[_0x410a22(0x1c1)](),_0x410a22(0x238),_0x2415e8[_0x410a22(0x2c6)]);if(existsSync(a59_0x1642f5[_0x410a22(0x2f3)](_0x5ab348,'tdx.json')))return _0x5ab348;}return undefined;}async[a59_0x7f9071(0x1bb)](_0x4ee634,_0x3e876b,_0x402419){const _0x1a7837=a59_0x7f9071;try{const _0xe02466=await _0x4ee634[_0x1a7837(0x208)][_0x1a7837(0x238)](_0x3e876b,{'limit':0x1});if(_0xe02466[_0x1a7837(0x21d)]>0x0){const _0x13410d=_0xe02466[0x0]['id'],_0x22b2a1=getWorkflowUrl(_0x402419,_0x13410d);console[_0x1a7837(0x253)]('\x20\x20Console:\x20'+a59_0x33ddab[_0x1a7837(0x1fe)](_0x22b2a1));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a59_0x7f9071(0x2e1);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x363);async[a59_0x7f9071(0x34a)](_0x77f9a8){const _0x50a45e=a59_0x7f9071,{options:_0x198f24,args:_0x2a3f22,tdx:_0x323118}=_0x77f9a8,_0x4cf7d0=_0x2a3f22[0x0],_0x1b452d=_0x198f24['clear'];if(_0x1b452d)return saveSessionContext({'workflow_project':undefined},_0x198f24['session']),console[_0x50a45e(0x2fb)](a59_0x33ddab[_0x50a45e(0x296)](_0x50a45e(0x2a5))),0x0;if(!_0x4cf7d0)return console[_0x50a45e(0x253)](a59_0x33ddab[_0x50a45e(0x214)](_0x50a45e(0x218)),_0x50a45e(0x269)),console[_0x50a45e(0x253)](a59_0x33ddab[_0x50a45e(0x1fb)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x50a45e(0x253)](a59_0x33ddab['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x5e8f58=await withSpinner(_0x50a45e(0x2d3)+_0x4cf7d0+'\x27...',()=>_0x323118['workflow'][_0x50a45e(0x206)](_0x4cf7d0),{'verbose':_0x198f24['verbose']}),{name:_0x5e177e}=_0x5e8f58[_0x50a45e(0x1fa)];return saveSessionContext({'workflow_project':_0x5e177e},_0x198f24['session']),console['log'](a59_0x33ddab['green'](_0x50a45e(0x1cb)+a59_0x33ddab[_0x50a45e(0x1fe)](_0x5e177e))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x1aa);['description']=a59_0x7f9071(0x1df);async[a59_0x7f9071(0x34a)](_0x2f473f){const _0x209090=a59_0x7f9071,{options:_0x381e70,args:_0x447b6f,tdx:_0x3cbb68}=_0x2f473f,_0x24d3ef=_0x447b6f[0x0];_0x381e70[_0x209090(0x1ed)]&&_0x24d3ef&&console[_0x209090(0x253)](_0x209090(0x2ea)+_0x24d3ef);const _0xb5c970=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3cbb68[_0x209090(0x208)][_0x209090(0x295)](_0x24d3ef,{'limit':_0x381e70[_0x209090(0x28c)]}),{'verbose':_0x381e70[_0x209090(0x1ed)]});let _0x5d004d=_0xb5c970[_0x209090(0x1fa)];_0x5d004d[_0x209090(0x20b)]((_0x18c45e,_0x2b41ed)=>_0x18c45e[_0x209090(0x19f)][_0x209090(0x205)](_0x2b41ed['name']));const _0xaaf9e2=_0x381e70[_0x209090(0x28c)]&&_0x5d004d[_0x209090(0x21d)]>=_0x381e70[_0x209090(0x28c)]?a59_0x33ddab[_0x209090(0x1fb)](_0x209090(0x2d8)):'';console[_0x209090(0x253)](_0x209090(0x1a0)+_0x5d004d[_0x209090(0x21d)]+_0x209090(0x333)+(_0x5d004d[_0x209090(0x21d)]!==0x1?'s':'')+_0xaaf9e2);if(_0x381e70[_0x209090(0x32a)]===_0x209090(0x27b)||_0x381e70['format']===_0x209090(0x35d)||_0x381e70[_0x209090(0x32a)]===_0x209090(0x304))await handleSDKOutput(_0x5d004d,_0x381e70);else{if(_0x5d004d['length']===0x0)_0x24d3ef?console['log']('No\x20projects\x20match\x20pattern:\x20'+_0x24d3ef):console[_0x209090(0x2fb)](_0x209090(0x236));else{const _0x120d1b=_0x5d004d[_0x209090(0x2fe)](_0x52a281=>{const _0x4f39bf=_0x209090,_0x270535=_0x52a281[_0x4f39bf(0x28d)]?.[_0x4f39bf(0x232)](_0x21c172=>_0x21c172[_0x4f39bf(0x35a)]===_0x4f39bf(0x2e6)),_0x185be3=_0x270535?a59_0x33ddab[_0x4f39bf(0x1fb)](_0x4f39bf(0x2b7)):'';return'📁\x20'+_0x52a281[_0x4f39bf(0x19f)]+_0x185be3;});await writeOutput(_0x120d1b[_0x209090(0x2f3)]('\x0a'),_0x381e70[_0x209090(0x23f)],_0x209090(0x1f5));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x1ef);['description']=a59_0x7f9071(0x2b9);async['execute'](_0x5933a){const _0x5835e8=a59_0x7f9071,{options:_0x5daf3a,args:_0x49cae2,tdx:_0x32a3ee}=_0x5933a,_0x28440b=this['resolveProject'](_0x49cae2,_0x5daf3a);_0x5daf3a['verbose']&&_0x28440b&&console['error'](_0x5835e8(0x35b)+_0x28440b);const _0x1286e5=await withSpinner(_0x5835e8(0x21f),()=>_0x32a3ee[_0x5835e8(0x208)][_0x5835e8(0x238)](_0x28440b,{'limit':_0x5daf3a[_0x5835e8(0x28c)]}),{'verbose':_0x5daf3a['verbose']});let _0x1c8686=_0x1286e5[_0x5835e8(0x1fa)];_0x1c8686[_0x5835e8(0x20b)]((_0x1358ef,_0x23e0e8)=>{const _0xc651db=_0x5835e8,_0x16226a=_0x1358ef[_0xc651db(0x19f)][_0xc651db(0x205)](_0x23e0e8[_0xc651db(0x19f)]);if(_0x16226a!==0x0)return _0x16226a;return(_0x1358ef['project']?.[_0xc651db(0x19f)]||'')[_0xc651db(0x205)](_0x23e0e8[_0xc651db(0x2ad)]?.[_0xc651db(0x19f)]||'');});const _0x4dcf6e=_0x5daf3a[_0x5835e8(0x28c)]&&_0x1c8686[_0x5835e8(0x21d)]>=_0x5daf3a[_0x5835e8(0x28c)]?a59_0x33ddab[_0x5835e8(0x1fb)](_0x5835e8(0x2d8)):'';console[_0x5835e8(0x253)](_0x5835e8(0x1a0)+_0x1c8686['length']+_0x5835e8(0x2ba)+(_0x1c8686[_0x5835e8(0x21d)]!==0x1?'s':'')+_0x4dcf6e);if(_0x5daf3a[_0x5835e8(0x32a)]==='json'||_0x5daf3a[_0x5835e8(0x32a)]===_0x5835e8(0x35d)||_0x5daf3a[_0x5835e8(0x32a)]==='table')await handleSDKOutput(_0x1c8686,_0x5daf3a);else{if(_0x1c8686[_0x5835e8(0x21d)]===0x0)_0x28440b?console['log'](_0x5835e8(0x263)+_0x28440b):console[_0x5835e8(0x2fb)]('No\x20workflows\x20found');else{const _0xb6b062=_0x5daf3a['site'],_0x128906=_0x1c8686[_0x5835e8(0x2fe)](_0x1f5c58=>{const _0x48a4f4=_0x5835e8,_0x14fa63=a59_0x33ddab['dim']('#'+_0x1f5c58['id']),_0x454c26=hyperlink(_0x14fa63,getWorkflowUrl(_0xb6b062,_0x1f5c58['id'])),_0x591dbb=_0x1f5c58[_0x48a4f4(0x2ad)]?.['name']?a59_0x33ddab[_0x48a4f4(0x1fb)]('\x20('+_0x1f5c58[_0x48a4f4(0x2ad)]['name']+')'):'';return'📋\x20'+_0x454c26+'\x20'+_0x1f5c58[_0x48a4f4(0x19f)]+_0x591dbb;});await writeOutput(_0x128906[_0x5835e8(0x2f3)]('\x0a'),_0x5daf3a[_0x5835e8(0x23f)],_0x5835e8(0x1f5));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x30e);[a59_0x7f9071(0x355)]='List\x20workflow\x20execution\x20sessions';async[a59_0x7f9071(0x34a)](_0x14dac4){const _0x379afa=a59_0x7f9071,{options:_0x44ec12,args:_0x46ea4b,tdx:_0x2e08a5}=_0x14dac4,_0x4cf527=this[_0x379afa(0x2e9)](_0x46ea4b,_0x44ec12);if(!_0x4cf527)return 0x1;const {projectName:_0x152424,workflowName:_0x37c2e4}=_0x4cf527;if(_0x44ec12[_0x379afa(0x1ed)]){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x253)](_0x379afa(0x26c)+_0x152424+'.'+_0x37c2e4);else _0x152424&&console['error']('Filter:\x20project='+_0x152424);const _0x1323c8=_0x44ec12['status'];_0x1323c8&&console[_0x379afa(0x253)](_0x379afa(0x1a6)+_0x1323c8);}let _0x40ebba=0x28;if(process['stdout'][_0x379afa(0x23c)]&&!_0x44ec12[_0x379afa(0x23f)]&&!_0x44ec12[_0x379afa(0x32a)]){const _0x386ffd=process[_0x379afa(0x356)]['rows']||0x28;_0x40ebba=Math['max'](0x14,Math[_0x379afa(0x272)](_0x386ffd*0x2/0x3));}const _0x1f21fe=_0x44ec12[_0x379afa(0x28c)]||_0x40ebba,_0x135ddd=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x2e08a5['workflow']['sessions']({'projectName':_0x152424,'workflowName':_0x37c2e4,'status':_0x44ec12[_0x379afa(0x244)],'fromTime':_0x44ec12[_0x379afa(0x2fa)],'toTime':_0x44ec12['to'],'limit':_0x1f21fe}),{'verbose':_0x44ec12[_0x379afa(0x1ed)]}),_0x43e596=_0x135ddd['data'];_0x43e596[_0x379afa(0x20b)]((_0x10f23d,_0x5d4bc6)=>{const _0xf6324e=_0x379afa,_0x50c81e=_0x10f23d['sessionTime']||'',_0x2f8e3a=_0x5d4bc6[_0xf6324e(0x25f)]||'';return _0x2f8e3a['localeCompare'](_0x50c81e);});_0x43e596[_0x379afa(0x21d)]>=_0x1f21fe?console[_0x379afa(0x253)](_0x379afa(0x34c)+_0x43e596[_0x379afa(0x21d)]+'\x20sessions\x20'+a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x1fd))):console['error'](_0x379afa(0x1a0)+_0x43e596[_0x379afa(0x21d)]+_0x379afa(0x20d)+(_0x43e596[_0x379afa(0x21d)]!==0x1?'s':''));if(_0x44ec12['format']==='json'||_0x44ec12[_0x379afa(0x32a)]===_0x379afa(0x35d)||_0x44ec12[_0x379afa(0x32a)]===_0x379afa(0x304))await handleSDKOutput(_0x43e596,_0x44ec12);else{if(!process[_0x379afa(0x356)][_0x379afa(0x23c)]||_0x44ec12[_0x379afa(0x23f)]){if(_0x43e596[_0x379afa(0x21d)]===0x0){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x2fb)](_0x379afa(0x1be)+_0x152424+'.'+_0x37c2e4);else _0x152424?console[_0x379afa(0x2fb)](_0x379afa(0x352)+_0x152424):console[_0x379afa(0x2fb)](_0x379afa(0x1a5));}else{const _0x26fa0e=_0x44ec12[_0x379afa(0x26a)],_0x304841=this['renderSessionsTimeline'](_0x43e596,_0x26fa0e);_0x44ec12[_0x379afa(0x23f)]?await writeOutput(_0x304841,_0x44ec12[_0x379afa(0x23f)],_0x379afa(0x1f5)):console[_0x379afa(0x2fb)](_0x304841);}!_0x152424&&(console[_0x379afa(0x253)](''),console[_0x379afa(0x253)](a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x1c3))),console[_0x379afa(0x253)](a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x2e5))+'or'+a59_0x33ddab[_0x379afa(0x1fb)](_0x379afa(0x2d2))));}else{if(_0x43e596[_0x379afa(0x21d)]===0x0){if(_0x152424&&_0x37c2e4)console[_0x379afa(0x2fb)](_0x379afa(0x1be)+_0x152424+'.'+_0x37c2e4);else _0x152424?console['log'](_0x379afa(0x352)+_0x152424):console[_0x379afa(0x2fb)](_0x379afa(0x1a5));}else await this[_0x379afa(0x266)](_0x43e596,_0x14dac4,_0x152424);}}return 0x0;}[a59_0x7f9071(0x204)](_0x57ad15,_0x21f972){const _0x25ffb4=a59_0x7f9071,_0x17fcae=[],_0x7eda5a=new Map();let _0x19865e=Infinity,_0x4d18fb=-Infinity;for(const _0x53e407 of _0x57ad15){if(_0x53e407[_0x25ffb4(0x1d6)]?.[_0x25ffb4(0x27e)]){const _0x21c33c=new Date(_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x27e)])[_0x25ffb4(0x1d3)](),_0x1d3fde=_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x34d)]?new Date(_0x53e407[_0x25ffb4(0x1d6)][_0x25ffb4(0x34d)])[_0x25ffb4(0x1d3)]():Date[_0x25ffb4(0x2e7)](),_0x22d5f4=_0x53e407[_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||_0x25ffb4(0x212);!_0x7eda5a[_0x25ffb4(0x22a)](_0x22d5f4)&&_0x7eda5a[_0x25ffb4(0x1f2)](_0x22d5f4,[]),_0x7eda5a[_0x25ffb4(0x21b)](_0x22d5f4)[_0x25ffb4(0x23d)]({'session':_0x53e407,'startTime':_0x21c33c,'endTime':_0x1d3fde,'duration':_0x1d3fde-_0x21c33c}),_0x19865e=Math[_0x25ffb4(0x340)](_0x19865e,_0x21c33c),_0x4d18fb=Math[_0x25ffb4(0x1c6)](_0x4d18fb,_0x1d3fde);}}if(_0x7eda5a[_0x25ffb4(0x2ac)]===0x0)return _0x25ffb4(0x2b8);const _0x16710a=process[_0x25ffb4(0x356)][_0x25ffb4(0x2a9)]||0x78,_0x1119a0=0x1e,_0x1b7ac3=0x32,_0x528423=0x4,_0x29a7ef=Math[_0x25ffb4(0x340)](_0x1b7ac3,Math[_0x25ffb4(0x1c6)](_0x1119a0,Math[_0x25ffb4(0x272)](_0x16710a*0.3))),_0x2f7c72=_0x16710a-_0x29a7ef-TIMELINE_CONFIG['GUTTER']-0x3-_0x528423,_0xf5213d=_0x4d18fb-_0x19865e,_0xd4fd46=_0xf5213d/_0x29a7ef,_0x5e50a7=renderTimeAxis({'startTime':_0x19865e,'endTime':_0x4d18fb,'durationMs':_0xf5213d,'msPerChar':_0xd4fd46},_0x29a7ef),_0x49dbfe=[];for(const _0x3da0dc of _0x7eda5a[_0x25ffb4(0x20c)]()){_0x49dbfe[_0x25ffb4(0x23d)](..._0x3da0dc);}_0x49dbfe[_0x25ffb4(0x20b)]((_0xade70,_0x34a7fe)=>_0x34a7fe['startTime']-_0xade70[_0x25ffb4(0x294)]);const _0x2f53d3=new Date(_0x19865e),_0x1e2672=formatDate(_0x2f53d3),_0x34e226=_0x528423+TIMELINE_CONFIG[_0x25ffb4(0x1b5)]+TIMELINE_CONFIG[_0x25ffb4(0x1b0)]+_0x2f7c72,_0x37c865='\x20'[_0x25ffb4(0x1d7)](_0x34e226-_0x1e2672[_0x25ffb4(0x21d)]),_0x458c26=_0x37c865+a59_0x33ddab[_0x25ffb4(0x1fb)](_0x1e2672)+'\x20'+_0x5e50a7;_0x17fcae[_0x25ffb4(0x23d)](_0x458c26);const _0x1d1c80=0x16;let _0x46b8a6=0x0;for(const _0x5cb636 of _0x49dbfe){const _0x3b83a4=_0x5cb636[_0x25ffb4(0x1e9)][_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||'?',_0x25b840=Math[_0x25ffb4(0x340)](stringWidth(_0x3b83a4),_0x1d1c80);_0x46b8a6=Math[_0x25ffb4(0x1c6)](_0x46b8a6,_0x25b840);}for(const _0x1e8056 of _0x49dbfe){const {session:_0x4ebe73,startTime:_0x18ef64,endTime:_0x8e13bd,duration:_0x117106}=_0x1e8056,_0x902b77=_0x4ebe73[_0x25ffb4(0x2ad)]?.['id'],_0x4c1703=_0x4ebe73['id'],_0x2a8d16=_0x4ebe73[_0x25ffb4(0x2ad)]?.[_0x25ffb4(0x19f)]||'?',_0x15760c=_0x4ebe73[_0x25ffb4(0x208)]?.[_0x25ffb4(0x19f)]||'?';let _0x40a3b1,_0x4f90b3;if(_0x4ebe73[_0x25ffb4(0x1d6)]){const _0x451049=_0x4ebe73[_0x25ffb4(0x1d6)];!_0x451049[_0x25ffb4(0x27f)]?(_0x40a3b1=_0x451049[_0x25ffb4(0x28f)]?'🛑':'🔄',_0x4f90b3=_0x451049[_0x25ffb4(0x28f)]?a59_0x33ddab[_0x25ffb4(0x351)]:a59_0x33ddab[_0x25ffb4(0x310)]):(_0x40a3b1=_0x451049['success']?'✅':'❌',_0x4f90b3=_0x451049[_0x25ffb4(0x1f0)]?a59_0x33ddab[_0x25ffb4(0x296)]:a59_0x33ddab[_0x25ffb4(0x214)]);}else _0x40a3b1='⏳',_0x4f90b3=a59_0x33ddab['dim'];const _0x3f684e='#'+_0x4c1703,_0x143e13=_0x902b77?hyperlink(_0x3f684e,getWorkflowSessionUrl(_0x21f972,_0x902b77,_0x4c1703)):_0x3f684e;let _0xef6ec3=_0x2a8d16;stringWidth(_0x2a8d16)>_0x1d1c80&&(_0xef6ec3=_0x2a8d16[_0x25ffb4(0x262)](0x0,_0x1d1c80-0x1)+'…');const _0x3ac70e=a59_0x33ddab[_0x25ffb4(0x1fb)](_0xef6ec3),_0x2d7462=stringWidth(_0xef6ec3),_0x55de40='\x20'[_0x25ffb4(0x1d7)](_0x46b8a6-stringWidth(_0xef6ec3)+0x2),_0x4817b8='('+formatElapsed(_0x117106)+')',_0x2319c3=stringWidth(_0x4817b8),_0x307b4c=stringWidth(_0x3f684e),_0xe56de6=_0x307b4c+0x1+_0x2d7462+_0x55de40[_0x25ffb4(0x21d)],_0x23bef0=_0x2f7c72-_0xe56de6-_0x2319c3-0x1-0x8;let _0x38842b=_0x15760c;stringWidth(_0x38842b)>_0x23bef0&&(_0x38842b=_0x38842b['slice'](0x0,_0x23bef0-0x1)+'…');const _0xd84d23=_0x143e13+'\x20'+_0x3ac70e+_0x55de40+_0x38842b,_0xc3b9de=stringWidth(_0xd84d23),_0xbebfe2=_0x2f7c72-_0xc3b9de-_0x2319c3,_0x41e125=_0xd84d23+'\x20'[_0x25ffb4(0x1d7)](Math['max'](0x1,_0xbebfe2))+a59_0x33ddab[_0x25ffb4(0x1fb)](_0x4817b8),_0x1b7179=Math[_0x25ffb4(0x272)]((_0x18ef64-_0x19865e)/_0xd4fd46),_0x3373cc=Math['floor']((_0x8e13bd-_0x19865e)/_0xd4fd46),_0x3a5111=Math['max'](_0x1b7179+0x1,_0x3373cc),_0x291161=new Array(_0x29a7ef)[_0x25ffb4(0x24b)]('\x20');for(let _0x1107a0=_0x1b7179;_0x1107a0<Math['min'](_0x3a5111,_0x29a7ef);_0x1107a0++){_0x291161[_0x1107a0]='─';}const _0x4b1165=_0x291161[_0x25ffb4(0x2fe)](_0x4b51fc=>_0x4b51fc==='\x20'?'\x20':_0x4f90b3(_0x4b51fc))[_0x25ffb4(0x2f3)]('');_0x17fcae['push'](_0x40a3b1+'\x20'+_0x41e125+'│'+_0x4b1165+'│');}return _0x17fcae[_0x25ffb4(0x2f3)]('\x0a');}async[a59_0x7f9071(0x266)](_0x6cd726,_0x3cbc3,_0x25cc7c){const _0x19cfe7=a59_0x7f9071,{options:_0x1e886f,tdx:_0x698b9f}=_0x3cbc3,_0x3c7e7f=_0x1e886f['site'],{timelineRows:_0x21cdac,timeAxisHeader:_0x3c6cc2}=this['generateSessionTimelineRows'](_0x6cd726,_0x3c7e7f),_0x3cefe2=_0x21cdac[_0x19cfe7(0x2e2)](_0x3e1b9d=>_0x3e1b9d[_0x19cfe7(0x2cf)]);if(_0x3cefe2['length']===0x0){const _0x943f4d=this['renderSessionsTimeline'](_0x6cd726,_0x3c7e7f);console[_0x19cfe7(0x2fb)](_0x943f4d);!_0x25cc7c&&(console[_0x19cfe7(0x253)](''),console['error'](a59_0x33ddab['dim'](_0x19cfe7(0x1c3))),console['error'](a59_0x33ddab['dim'](_0x19cfe7(0x2e5))+'or'+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x19cfe7(0x2d2))));return;}_0x3c6cc2&&console[_0x19cfe7(0x2fb)](_0x3c6cc2);const _0x837ba0=_0x21cdac[_0x19cfe7(0x2e2)](_0x1af568=>_0x1af568[_0x19cfe7(0x2cf)])[_0x19cfe7(0x2fe)](_0x1af0b0=>({'title':_0x1af0b0['displayLine'],'value':_0x1af0b0[_0x19cfe7(0x2cf)]})),_0x466a58=process[_0x19cfe7(0x356)][_0x19cfe7(0x1d9)]||0x3c,_0x2977d7=Math['max'](0x28,Math[_0x19cfe7(0x272)](_0x466a58*0x2/0x3)),_0x1d8486=await a59_0x30a0c4({'type':'autocomplete','name':_0x19cfe7(0x2cf),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x837ba0,'initial':-0x1,'limit':_0x2977d7,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0xe0944d,_0x2609dc)=>{const _0x40f442=_0x19cfe7;if(!_0xe0944d)return Promise[_0x40f442(0x29b)](_0x2609dc);const _0x3719e2=_0x2609dc[_0x40f442(0x2e2)](_0x568301=>{const _0x4535d7=_0x40f442,_0xe69fe2=_0x568301;return _0xe69fe2['title'][_0x4535d7(0x2d1)]()[_0x4535d7(0x367)](_0xe0944d[_0x4535d7(0x2d1)]());});return Promise['resolve'](_0x3719e2);}}),_0x2d2552=()=>{const _0x497293=_0x19cfe7;process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a)),process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a)),process[_0x497293(0x356)][_0x497293(0x2a6)](_0x497293(0x25a));},_0x50b4a7=_0x1d8486&&_0x1d8486[_0x19cfe7(0x2cf)]&&_0x1d8486['attemptId']!==null&&_0x1d8486['attemptId'][_0x19cfe7(0x23a)]()!=='';if(!_0x50b4a7){_0x2d2552(),console[_0x19cfe7(0x2fb)](a59_0x33ddab[_0x19cfe7(0x1fb)](_0x19cfe7(0x29c)));return;}_0x2d2552();const _0x5f244e=_0x6cd726[_0x19cfe7(0x322)](_0x358519=>_0x358519[_0x19cfe7(0x1d6)]?.['id']===_0x1d8486[_0x19cfe7(0x2cf)]);if(_0x5f244e){const _0x47511a=_0x5f244e[_0x19cfe7(0x2ad)]?.[_0x19cfe7(0x19f)]||'?',_0x4b3db6=_0x5f244e[_0x19cfe7(0x208)]?.[_0x19cfe7(0x19f)]||'?';console[_0x19cfe7(0x2fb)](_0x19cfe7(0x252)+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x47511a)+_0x19cfe7(0x2ce)+a59_0x33ddab[_0x19cfe7(0x1fb)](_0x4b3db6));}const _0x3443f7=new WorkflowTimelineCommand();await _0x3443f7['execute']({'args':[],'options':{..._0x1e886f,'attemptId':_0x1d8486[_0x19cfe7(0x2cf)]},'tdx':_0x698b9f});}[a59_0x7f9071(0x330)](_0x199513,_0x3d6c29){const _0x38664e=a59_0x7f9071,_0x295c5c=new Map();for(const _0x4d0e8e of _0x199513){_0x4d0e8e['id']&&_0x4d0e8e[_0x38664e(0x1d6)]?.['id']&&_0x295c5c[_0x38664e(0x1f2)](_0x4d0e8e['id'],_0x4d0e8e['lastAttempt']['id']);}const _0x9116b5=[];let _0x268315='';const _0x93b332=this['renderSessionsTimeline'](_0x199513,_0x3d6c29),_0x32c902=_0x93b332[_0x38664e(0x2c7)]('\x0a');for(const _0x11339b of _0x32c902){if(_0x11339b[_0x38664e(0x27a)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x11339b[_0x38664e(0x1d5)](/^\s+\d{4}-\d{2}-\d{2}/))_0x268315=_0x11339b;else{if(_0x11339b['match'](/^[✅❌🔄🛑⏳]/)){const _0x273232=_0x11339b[_0x38664e(0x1d5)](/#(\d+)/),_0x3d87b6=_0x273232?_0x273232[0x1]:null,_0x28c541=_0x3d87b6?_0x295c5c[_0x38664e(0x21b)](_0x3d87b6)||null:null,_0xa0212b=_0x199513[_0x38664e(0x322)](_0x2b8078=>_0x2b8078['id']===_0x3d87b6),_0x5af510=_0xa0212b?.['project']?.['name']||'';_0x9116b5[_0x38664e(0x23d)]({'displayLine':_0x11339b,'attemptId':_0x28c541,'projectName':_0x5af510});}}}return{'timelineRows':_0x9116b5,'timeAxisHeader':_0x268315};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x2c4);['description']='List\x20workflow\x20attempts';async[a59_0x7f9071(0x34a)](_0x2dfddc){const _0xca313d=a59_0x7f9071,{options:_0x45418f,args:_0x307765,tdx:_0x35d4e6}=_0x2dfddc,_0x2d4ab7=this[_0xca313d(0x2e9)](_0x307765,_0x45418f);if(!_0x2d4ab7)return 0x1;const {projectName:_0x32364a,workflowName:_0x118637}=_0x2d4ab7,_0x28a6d0=_0x45418f[_0xca313d(0x302)];if(_0x45418f[_0xca313d(0x1ed)]){if(_0x32364a&&_0x118637)console['error'](_0xca313d(0x26c)+_0x32364a+'.'+_0x118637);else _0x32364a&&console[_0xca313d(0x253)](_0xca313d(0x240)+_0x32364a);_0x28a6d0&&console[_0xca313d(0x253)]('Include\x20retried:\x20yes');}const _0xe7f2cf=await withSpinner(_0xca313d(0x1f1),()=>_0x35d4e6[_0xca313d(0x208)][_0xca313d(0x31b)]({'projectName':_0x32364a,'workflowName':_0x118637,'includeRetried':_0x28a6d0,'limit':_0x45418f[_0xca313d(0x28c)]}),{'verbose':_0x45418f[_0xca313d(0x1ed)]}),_0x3959bb=_0xe7f2cf[_0xca313d(0x1fa)],_0x3a8a86=_0x45418f['limit']||0x64,_0x3dc630=_0x3959bb[_0xca313d(0x21d)]>=_0x3a8a86?a59_0x33ddab[_0xca313d(0x1fb)](_0xca313d(0x2d8)):'';console[_0xca313d(0x253)](_0xca313d(0x1a0)+_0x3959bb[_0xca313d(0x21d)]+_0xca313d(0x1c0)+(_0x3959bb['length']!==0x1?'s':'')+_0x3dc630);if(_0x45418f['format']==='json'||_0x45418f['format']===_0xca313d(0x35d)||_0x45418f['format']==='table')await handleSDKOutput(_0x3959bb,_0x45418f);else{if(_0x3959bb[_0xca313d(0x21d)]===0x0){if(_0x32364a&&_0x118637)console[_0xca313d(0x2fb)](_0xca313d(0x348)+_0x32364a+'.'+_0x118637);else _0x32364a?console[_0xca313d(0x2fb)](_0xca313d(0x299)+_0x32364a):console['log']('No\x20attempts\x20found');}else{const _0x4688ef=_0x45418f[_0xca313d(0x26a)],_0x5d369a=_0x3959bb['map'](_0x3188c3=>{const _0x2b8b6c=_0xca313d,_0x3dbd0d=a59_0x33ddab[_0x2b8b6c(0x1fb)]('#'+_0x3188c3['id']),_0x2d6976=_0x3188c3[_0x2b8b6c(0x2ad)]?.['id'],_0x13c98b=_0x3188c3[_0x2b8b6c(0x326)]||_0x3188c3['sessionId'],_0x5e0264=_0x2d6976&&_0x13c98b?hyperlink(_0x3dbd0d,getWorkflowAttemptUrl(_0x4688ef,_0x2d6976,_0x13c98b,_0x3188c3['id'])):_0x3dbd0d,{icon:_0x33d9bb,text:_0x37f977}=getAttemptStatusDisplay(_0x3188c3),_0x1a6495=(_0x3188c3['project']?.[_0x2b8b6c(0x19f)]||'?')+'.'+(_0x3188c3['workflow']?.[_0x2b8b6c(0x19f)]||'?'),_0x516cd0=_0x3188c3['sessionTime']?a59_0x33ddab[_0x2b8b6c(0x1fb)](_0x3188c3[_0x2b8b6c(0x25f)]):'';return(_0x5e0264+'\x20'+_0x33d9bb+(_0x37f977?'\x20'+_0x37f977:'')+'\x20'+_0x1a6495+'\x20'+_0x516cd0)[_0x2b8b6c(0x32e)]();});await writeOutput(_0x5d369a[_0xca313d(0x2f3)]('\x0a'),_0x45418f[_0xca313d(0x23f)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x24a);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x287);async['execute'](_0x481330){const _0x209e73=a59_0x7f9071,{options:_0x1fb097,args:_0x534bc0,tdx:_0x29356b}=_0x481330,_0x5e9ee6=_0x534bc0[0x0];if(!_0x5e9ee6)return console['error'](_0x209e73(0x312)),0x1;_0x1fb097['verbose']&&console[_0x209e73(0x253)](_0x209e73(0x22c)+_0x5e9ee6);const _0x77da2c=await withSpinner(_0x209e73(0x24c),()=>_0x29356b['workflow'][_0x209e73(0x1e4)](_0x5e9ee6),{'verbose':_0x1fb097['verbose']}),_0x5498d9=_0x77da2c[_0x209e73(0x1fa)];let _0x569dc7;!_0x5498d9[_0x209e73(0x27f)]?_0x569dc7=_0x5498d9['cancelRequested']?_0x209e73(0x342):_0x209e73(0x2f0):_0x569dc7=_0x5498d9[_0x209e73(0x1f0)]?_0x209e73(0x1f0):_0x209e73(0x253);let _0x397338;if(_0x5498d9['createdAt']&&_0x5498d9['finishedAt']){const _0x45b731=new Date(_0x5498d9[_0x209e73(0x27e)])[_0x209e73(0x1d3)](),_0x3de209=new Date(_0x5498d9[_0x209e73(0x34d)])['getTime']();_0x397338=Math[_0x209e73(0x1cc)]((_0x3de209-_0x45b731)/0x3e8);}const _0x50e569={'attempt_id':_0x5498d9['id'],'status':_0x569dc7,..._0x5498d9[_0x209e73(0x213)]!==undefined&&{'index':_0x5498d9[_0x209e73(0x213)]},..._0x5498d9['project']&&{'project':_0x5498d9[_0x209e73(0x2ad)][_0x209e73(0x19f)]},..._0x5498d9['workflow']&&{'workflow':_0x5498d9[_0x209e73(0x208)][_0x209e73(0x19f)]},..._0x5498d9[_0x209e73(0x2f2)]&&{'session_id':_0x5498d9[_0x209e73(0x2f2)]},..._0x5498d9['sessionTime']&&{'session_time':_0x5498d9[_0x209e73(0x25f)]},..._0x5498d9[_0x209e73(0x28e)]&&{'retry_attempt':_0x5498d9['retryAttemptName']},..._0x397338!==undefined&&{'duration_sec':_0x397338},..._0x5498d9[_0x209e73(0x27e)]&&{'created_at':_0x5498d9['createdAt']},..._0x5498d9[_0x209e73(0x34d)]&&{'finished_at':_0x5498d9[_0x209e73(0x34d)]},...Object[_0x209e73(0x31f)](_0x5498d9[_0x209e73(0x207)])[_0x209e73(0x21d)]>0x0&&{'params':_0x5498d9['params']}};return await handleSingleObjectOutput(_0x50e569,_0x1fb097),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a59_0x7f9071(0x311);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ea);async[a59_0x7f9071(0x34a)](_0x45a4c4){const _0x5c9aed=a59_0x7f9071,{options:_0x1ade39,args:_0x11f0ef,tdx:_0x4b0707}=_0x45a4c4,_0x2cb051=_0x11f0ef[0x0];if(!_0x2cb051)return console[_0x5c9aed(0x253)](_0x5c9aed(0x312)),0x1;const _0x51c592=_0x1ade39[_0x5c9aed(0x1b1)];_0x1ade39[_0x5c9aed(0x1ed)]&&(console[_0x5c9aed(0x253)](_0x5c9aed(0x22c)+_0x2cb051),_0x51c592&&console[_0x5c9aed(0x253)]('Including\x20subtasks:\x20yes'));const _0x450fee=await withSpinner(_0x5c9aed(0x22b),()=>_0x4b0707[_0x5c9aed(0x208)][_0x5c9aed(0x2d0)](_0x2cb051,_0x51c592||![]),{'verbose':_0x1ade39[_0x5c9aed(0x1ed)]}),_0x515aef=_0x450fee['data'];return console[_0x5c9aed(0x253)](_0x5c9aed(0x1a0)+_0x515aef['length']+_0x5c9aed(0x25c)+(_0x515aef['length']!==0x1?'s':'')),await handleSDKOutput(_0x515aef,_0x1ade39),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x2d4);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2df);async[a59_0x7f9071(0x34a)](_0x371507){const _0x2eb2e5=a59_0x7f9071,{options:_0x5895aa,args:_0x31aae4,tdx:_0x32129d}=_0x371507,_0x45d8a3=_0x31aae4[0x0];let _0x32575f=_0x31aae4[0x1];if(!_0x45d8a3)return console[_0x2eb2e5(0x253)](_0x2eb2e5(0x312)),0x1;_0x5895aa[_0x2eb2e5(0x1ed)]&&(console[_0x2eb2e5(0x253)](_0x2eb2e5(0x22c)+_0x45d8a3),_0x32575f&&console[_0x2eb2e5(0x253)](_0x2eb2e5(0x258)+_0x32575f));const _0x5ae3a0=await withSpinner(_0x2eb2e5(0x347),()=>_0x32129d[_0x2eb2e5(0x208)][_0x2eb2e5(0x336)](_0x45d8a3,_0x32575f),{'verbose':_0x5895aa['verbose']}),_0x4442bf=_0x5ae3a0['data'];if(_0x4442bf[_0x2eb2e5(0x21d)]===0x0)return console['error'](_0x2eb2e5(0x2a8)),0x0;if(!_0x32575f&&(_0x5895aa[_0x2eb2e5(0x27b)]||_0x5895aa['format']))return await handleSDKOutput(_0x4442bf,_0x5895aa),0x0;if(!_0x32575f){const _0x35fb27=_0x4442bf[_0x2eb2e5(0x2fe)](_0x18e4fe=>({'title':_0x18e4fe[_0x2eb2e5(0x265)]+'\x20('+formatBytes(_0x18e4fe[_0x2eb2e5(0x228)])+')','value':_0x18e4fe['taskName']})),_0x2d1741=await a59_0x30a0c4({'type':_0x2eb2e5(0x30a),'name':'task','message':_0x2eb2e5(0x274),'choices':_0x35fb27});if(!_0x2d1741['task'])return console['error'](_0x2eb2e5(0x29c)),0x0;_0x32575f=_0x2d1741[_0x2eb2e5(0x292)];}const _0x26fb8a=await withSpinner(_0x2eb2e5(0x1c9),()=>_0x32129d[_0x2eb2e5(0x208)][_0x2eb2e5(0x281)](_0x45d8a3,_0x32575f),{'verbose':_0x5895aa[_0x2eb2e5(0x1ed)]}),_0x1fc25f=_0x26fb8a[_0x2eb2e5(0x1fa)];return _0x1fc25f?console[_0x2eb2e5(0x2fb)](_0x1fc25f):console[_0x2eb2e5(0x253)](_0x2eb2e5(0x1a3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x7f9071(0x19f)]='workflow:kill';[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ec);async[a59_0x7f9071(0x34a)](_0x16ab6b){const _0x435e2e=a59_0x7f9071,{options:_0xa27f7,args:_0x42e84f,tdx:_0x3a2bab}=_0x16ab6b,_0x424d4a=_0x42e84f[0x0];if(!_0x424d4a)return console[_0x435e2e(0x253)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x266de0=_0xa27f7['reason'];_0xa27f7[_0x435e2e(0x1ed)]&&(console['error'](_0x435e2e(0x22c)+_0x424d4a),_0x266de0&&console[_0x435e2e(0x253)](_0x435e2e(0x2aa)+_0x266de0));if(!_0xa27f7['yes']){if(!isInteractive())return console[_0x435e2e(0x253)](a59_0x33ddab[_0x435e2e(0x214)](_0x435e2e(0x229)),_0x435e2e(0x2dd)),console[_0x435e2e(0x253)](a59_0x33ddab['dim'](_0x435e2e(0x319))),0x1;const _0xf1f51f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x424d4a+'?');if(!_0xf1f51f)return console[_0x435e2e(0x253)](a59_0x33ddab[_0x435e2e(0x351)]('Cancelled')),0x1;}const _0x225fe7=await withSpinner(_0x435e2e(0x364),()=>_0x3a2bab[_0x435e2e(0x208)][_0x435e2e(0x2ca)](_0x424d4a,_0x266de0),{'verbose':_0xa27f7[_0x435e2e(0x1ed)]}),_0x209a06=_0x225fe7[_0x435e2e(0x1fa)];return console[_0x435e2e(0x253)]('✔\x20'+_0x209a06),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x358);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x289);async['execute'](_0x2e6d23){const _0x5246d0=a59_0x7f9071,{options:_0x7d04bd,args:_0x2b833d,tdx:_0x8fb737}=_0x2e6d23,_0x2b33d5=_0x2b833d[0x0];if(!_0x2b33d5)return console['error'](_0x5246d0(0x249)),console[_0x5246d0(0x253)](_0x5246d0(0x2e0)),0x1;let _0x5ee5e=![],_0x4386ea=_0x2b33d5;if(_0x2b33d5[_0x5246d0(0x27a)](_0x5246d0(0x2a0)))_0x5ee5e=!![],_0x4386ea=_0x2b33d5[_0x5246d0(0x2c5)](0x8);else{if(_0x2b33d5[_0x5246d0(0x27a)]('attempt:'))_0x5ee5e=![],_0x4386ea=_0x2b33d5[_0x5246d0(0x2c5)](0x8);else return console[_0x5246d0(0x253)](_0x5246d0(0x327)),console[_0x5246d0(0x253)](_0x5246d0(0x2e0)),0x1;}const _0x58ef1c=_0x7d04bd[_0x5246d0(0x1b8)],_0x3f0295=_0x7d04bd['resumeFrom'],_0x1fef3d=_0x7d04bd[_0x5246d0(0x207)],_0x39492d=_0x7d04bd[_0x5246d0(0x1b2)];_0x7d04bd[_0x5246d0(0x1ed)]&&(console['error'](_0x5246d0(0x267)+(_0x5ee5e?_0x5246d0(0x1e9):'attempt')+'\x20'+_0x4386ea),_0x58ef1c&&console[_0x5246d0(0x253)](_0x5246d0(0x260)+_0x58ef1c),_0x3f0295&&console[_0x5246d0(0x253)]('Resume\x20from:\x20'+_0x3f0295),_0x1fef3d&&console['error'](_0x5246d0(0x1b6)+_0x1fef3d),_0x39492d&&console[_0x5246d0(0x253)]('Force:\x20yes'));let _0x525c1c;if(_0x1fef3d)try{if(_0x1fef3d['startsWith']('@')){const _0x319eb1=await import('fs/promises'),_0x1c67a9=_0x1fef3d['substring'](0x1),_0x4e2ba5=await _0x319eb1[_0x5246d0(0x20e)](_0x1c67a9,_0x5246d0(0x1de));_0x525c1c=JSON['parse'](_0x4e2ba5);}else _0x525c1c=JSON[_0x5246d0(0x283)](_0x1fef3d);}catch{return console['error'](_0x5246d0(0x1a4)),0x1;}if(!_0x7d04bd[_0x5246d0(0x29d)]){if(!isInteractive())return console['error'](a59_0x33ddab[_0x5246d0(0x214)](_0x5246d0(0x229)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a59_0x33ddab[_0x5246d0(0x1fb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3593be=await confirmKey(_0x5246d0(0x1a2)+(_0x5ee5e?_0x5246d0(0x1e9):_0x5246d0(0x1e4))+'\x20'+_0x4386ea+'?');if(!_0x3593be)return console[_0x5246d0(0x253)](a59_0x33ddab[_0x5246d0(0x351)](_0x5246d0(0x29c))),0x1;}let _0x54514b;_0x5ee5e?_0x54514b=await withSpinner(_0x5246d0(0x321),()=>_0x8fb737[_0x5246d0(0x208)][_0x5246d0(0x34e)](_0x4386ea,{'fromTask':_0x58ef1c,'retryParams':_0x525c1c}),{'verbose':_0x7d04bd[_0x5246d0(0x1ed)]}):_0x54514b=await withSpinner('Retrying\x20attempt...',()=>_0x8fb737['workflow'][_0x5246d0(0x1e6)](_0x4386ea,{'resumeFrom':_0x3f0295,'retryParams':_0x525c1c,'force':_0x39492d}),{'verbose':_0x7d04bd[_0x5246d0(0x1ed)]});const _0x8e7f7=_0x54514b[_0x5246d0(0x1fa)];return console[_0x5246d0(0x253)](_0x5246d0(0x291)),console[_0x5246d0(0x253)](_0x5246d0(0x313)+_0x8e7f7[_0x5246d0(0x2cf)]),console[_0x5246d0(0x253)]('\x20\x20Session\x20ID:\x20'+_0x8e7f7[_0x5246d0(0x2f2)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x246);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x1ac);async['execute'](_0x13f876){const _0x1600fb=a59_0x7f9071,{options:_0x160504,args:_0x15ad57,tdx:_0x36a111}=_0x13f876;let _0x2393cd=_0x15ad57[0x0];if(!_0x2393cd){const _0x5bf747=this[_0x1600fb(0x222)]([],_0x160504),_0x428a4b=await withSpinner(_0x1600fb(0x2ee),()=>_0x36a111[_0x1600fb(0x208)]['workflows'](_0x5bf747,{'limit':_0x160504[_0x1600fb(0x28c)]}),{'verbose':_0x160504[_0x1600fb(0x1ed)]}),_0x4e3ecd=_0x428a4b[_0x1600fb(0x1fa)];if(_0x4e3ecd[_0x1600fb(0x21d)]===0x0)return console[_0x1600fb(0x253)](_0x1600fb(0x1e3)),!_0x5bf747&&console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x1fb)](_0x1600fb(0x2ae))),0x1;const _0x4ca0bf=_0x4e3ecd['map'](_0x4260e4=>({'title':_0x4260e4[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]+'.'+_0x4260e4[_0x1600fb(0x19f)],'value':_0x4260e4[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]+'.'+_0x4260e4[_0x1600fb(0x19f)],'description':_0x4260e4[_0x1600fb(0x320)]?_0x1600fb(0x2a1)+_0x4260e4[_0x1600fb(0x320)]:undefined})),_0x2fb3e1=await a59_0x30a0c4({'type':_0x1600fb(0x30a),'name':_0x1600fb(0x208),'message':_0x1600fb(0x203),'choices':_0x4ca0bf});if(!_0x2fb3e1[_0x1600fb(0x208)])return 0x1;_0x2393cd=_0x2fb3e1[_0x1600fb(0x208)];}if(!_0x2393cd['includes']('.')){const _0x3cd8e2=this[_0x1600fb(0x222)]([],_0x160504);if(_0x3cd8e2)_0x2393cd=_0x3cd8e2+'.'+_0x2393cd;else return console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x214)](_0x1600fb(0x218)),_0x1600fb(0x2cc)),console[_0x1600fb(0x253)](a59_0x33ddab[_0x1600fb(0x1fb)](_0x1600fb(0x2ae))),0x1;}const _0x4dbec6=_0x160504[_0x1600fb(0x29f)],_0x4793b0=_0x160504[_0x1600fb(0x25f)],_0x291da6={};if(_0x4dbec6&&Array[_0x1600fb(0x26e)](_0x4dbec6))for(const _0x4c2027 of _0x4dbec6){const _0x59806d=_0x4c2027[_0x1600fb(0x220)]('=');if(_0x59806d===-0x1)return console[_0x1600fb(0x253)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x4c2027),console['error'](_0x1600fb(0x286)),0x1;const _0x2eb111=_0x4c2027['substring'](0x0,_0x59806d),_0x1e46a3=_0x4c2027['substring'](_0x59806d+0x1);try{_0x291da6[_0x2eb111]=JSON[_0x1600fb(0x283)](_0x1e46a3);}catch{_0x291da6[_0x2eb111]=_0x1e46a3;}}_0x160504['verbose']&&(console[_0x1600fb(0x253)](_0x1600fb(0x2b2)+_0x2393cd),Object[_0x1600fb(0x31f)](_0x291da6)[_0x1600fb(0x21d)]>0x0&&console[_0x1600fb(0x253)](_0x1600fb(0x239)+JSON['stringify'](_0x291da6)),_0x4793b0&&console[_0x1600fb(0x253)](_0x1600fb(0x28a)+_0x4793b0));if(_0x160504['dryRun'])return await this[_0x1600fb(0x357)](_0x13f876,_0x2393cd,_0x291da6,_0x4793b0);const _0x56ade5=await withSpinner(_0x1600fb(0x1ca),()=>_0x36a111['workflow']['run'](_0x2393cd,_0x291da6,{'sessionTime':_0x4793b0}),{'verbose':_0x160504[_0x1600fb(0x1ed)]}),_0xec01e3=_0x56ade5[_0x1600fb(0x1fa)];console[_0x1600fb(0x253)](_0x1600fb(0x24d)),console[_0x1600fb(0x253)](_0x1600fb(0x2a2)+_0xec01e3['id']),console[_0x1600fb(0x253)](_0x1600fb(0x31a)+_0xec01e3[_0x1600fb(0x2f2)]),console['error'](_0x1600fb(0x298)+_0xec01e3[_0x1600fb(0x2ad)]?.[_0x1600fb(0x19f)]),console[_0x1600fb(0x253)](_0x1600fb(0x325)+_0xec01e3[_0x1600fb(0x208)]?.['name']);if(_0xec01e3[_0x1600fb(0x2ad)]?.['id']&&_0xec01e3[_0x1600fb(0x2f2)]&&_0xec01e3['id']){const _0xfcf93c=_0x160504[_0x1600fb(0x26a)],_0x3ebe6b=getConsoleUrl(_0xfcf93c,_0x1600fb(0x200)+_0xec01e3[_0x1600fb(0x2ad)]['id']+'/sessions/'+_0xec01e3[_0x1600fb(0x2f2)]+_0x1600fb(0x34f)+_0xec01e3['id']);console[_0x1600fb(0x253)](_0x1600fb(0x2f9)+a59_0x33ddab[_0x1600fb(0x1fe)](_0x3ebe6b));}return 0x0;}async[a59_0x7f9071(0x357)](_0x440196,_0x2d9057,_0x274404,_0x3c7a9e){const _0x18c4b3=a59_0x7f9071,{options:_0x31e9f5,tdx:_0x1f36d6}=_0x440196,_0x32e8de=await withSpinner('Fetching\x20workflow\x20'+_0x2d9057+_0x18c4b3(0x216),()=>_0x1f36d6[_0x18c4b3(0x208)][_0x18c4b3(0x2f8)](_0x2d9057),{'verbose':_0x31e9f5[_0x18c4b3(0x1ed)]}),_0x37af7b=_0x32e8de[_0x18c4b3(0x1fa)],_0x4ed62e=_0x3c7a9e??new Date()[_0x18c4b3(0x211)]();console['log'](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x288)),_0x2d9057),console['log'](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x339)),_0x4ed62e),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x32b)](_0x18c4b3(0x306)),JSON['stringify'](_0x274404)),console[_0x18c4b3(0x2fb)](''),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x32b)]('Task\x20graph:'));const _0x3bce84=parseTaskGraph(_0x37af7b[_0x18c4b3(0x2de)]??null);if(_0x3bce84[_0x18c4b3(0x21d)]===0x0)console[_0x18c4b3(0x2fb)](a59_0x33ddab['dim'](_0x18c4b3(0x1f6)));else for(const _0x195446 of formatTaskGraph(_0x3bce84)){console['log'](_0x195446);}const _0x53a323=summarizeTaskGraph(_0x3bce84),_0x391e8a=formatWarningSummary(_0x53a323);return _0x391e8a&&(console['log'](''),console[_0x18c4b3(0x2fb)](a59_0x33ddab[_0x18c4b3(0x351)](_0x391e8a))),console['log'](a59_0x33ddab[_0x18c4b3(0x351)](_0x18c4b3(0x1dc))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x7f9071(0x337);[a59_0x7f9071(0x355)]='Download\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a59_0x7f9071(0x34a)](_0x50356b){const _0x3eb25c=a59_0x7f9071,{options:_0x1a6812,args:_0x5b40fa,tdx:_0x295534}=_0x50356b,_0x2d2dfc=_0x5b40fa[0x0],_0x2e9a50=_0x5b40fa[0x1]||'.';if(!_0x2d2dfc)return console[_0x3eb25c(0x253)](_0x3eb25c(0x210)),console['error'](_0x3eb25c(0x345)),0x1;const _0x59bc9b=_0x1a6812[_0x3eb25c(0x320)];_0x1a6812['verbose']&&(console[_0x3eb25c(0x253)](_0x3eb25c(0x252)+_0x2d2dfc),console[_0x3eb25c(0x253)](_0x3eb25c(0x277)+_0x2e9a50),_0x59bc9b&&console['error'](_0x3eb25c(0x21c)+_0x59bc9b));const _0x21a93a=await withSpinner(_0x3eb25c(0x1cf)+_0x2d2dfc+_0x3eb25c(0x216),()=>_0x295534['workflow'][_0x3eb25c(0x2c8)](_0x2d2dfc,_0x2e9a50,{'revision':_0x59bc9b}),{'verbose':_0x1a6812[_0x3eb25c(0x1ed)]}),_0x8ad2f9=_0x21a93a[_0x3eb25c(0x1fa)];return console['error']('✔\x20Downloaded\x20'+_0x8ad2f9[_0x3eb25c(0x33e)]),console[_0x3eb25c(0x253)]('\x20\x20Revision:\x20'+_0x8ad2f9['revision']),console[_0x3eb25c(0x253)]('\x20\x20Files\x20extracted:\x20'+_0x8ad2f9[_0x3eb25c(0x24e)]),console[_0x3eb25c(0x253)](_0x3eb25c(0x2c3)+_0x2e9a50+'/'+_0x8ad2f9[_0x3eb25c(0x33e)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x231);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2bf);async[a59_0x7f9071(0x34a)](_0x2cc88e){const _0x55c463=a59_0x7f9071,{options:_0x2413f7,args:_0x25aa84,tdx:_0x1730ae}=_0x2cc88e;let _0x131f96='.',_0x71a0e=_0x2413f7[_0x55c463(0x19f)];if(_0x25aa84[0x0]){const {promises:_0x4c217a}=await import('fs');try{const _0x40151c=await _0x4c217a[_0x55c463(0x1c8)](_0x25aa84[0x0]);if(_0x40151c[_0x55c463(0x30d)]())_0x131f96=_0x25aa84[0x0];else return console['error']('Error:\x20'+_0x25aa84[0x0]+_0x55c463(0x2d9)),0x1;}catch{_0x71a0e=_0x25aa84[0x0],_0x131f96='.';}}const _0x408dce=_0x2413f7[_0x55c463(0x320)],_0x1c6c4f=_0x2413f7['skipValidation'];_0x2413f7[_0x55c463(0x1ed)]&&(console[_0x55c463(0x253)]('Project\x20directory:\x20'+_0x131f96),_0x71a0e&&console[_0x55c463(0x253)]('Project\x20name:\x20'+_0x71a0e),_0x408dce&&console[_0x55c463(0x253)](_0x55c463(0x21c)+_0x408dce),_0x1c6c4f&&console[_0x55c463(0x253)](_0x55c463(0x270)));const _0x4f3ed9=await withSpinner(_0x55c463(0x221),()=>_0x1730ae[_0x55c463(0x208)][_0x55c463(0x23d)](_0x131f96,{'projectName':_0x71a0e,'revision':_0x408dce,'skipValidation':_0x1c6c4f}),{'verbose':_0x2413f7[_0x55c463(0x1ed)]}),_0x544cc3=_0x4f3ed9[_0x55c463(0x1fa)];return console['error'](_0x55c463(0x230)+_0x544cc3[_0x55c463(0x33e)]),console['error'](_0x55c463(0x346)+_0x544cc3['projectId']),console[_0x55c463(0x253)](_0x55c463(0x328)+_0x544cc3[_0x55c463(0x320)]),await this['showWorkflowConsoleUrl'](_0x1730ae,_0x544cc3[_0x55c463(0x33e)],_0x2413f7['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a59_0x7f9071(0x1d4);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x331);async[a59_0x7f9071(0x34a)](_0xd4f2ca){const _0x57ebf1=a59_0x7f9071,{options:_0x5a2c66,args:_0x3baea1,tdx:_0x137ad6}=_0xd4f2ca,_0x5872ac=_0x3baea1[0x0],_0x4acfe4=_0x3baea1[0x1];if(!_0x5872ac)return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x214)](_0x57ebf1(0x218)),_0x57ebf1(0x269)),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x1f4))),0x1;const _0x2b8224=_0x5a2c66['revision'];_0x5a2c66[_0x57ebf1(0x1ed)]&&(console[_0x57ebf1(0x253)](_0x57ebf1(0x252)+_0x5872ac),_0x4acfe4&&console[_0x57ebf1(0x253)](_0x57ebf1(0x338)+_0x4acfe4),_0x2b8224&&console['error'](_0x57ebf1(0x21c)+_0x2b8224),_0x5a2c66[_0x57ebf1(0x1d0)]&&console['error'](_0x57ebf1(0x2bc)));const _0x315f85=await withSpinner(_0x57ebf1(0x1e0)+_0x5872ac+_0x57ebf1(0x216),()=>_0x137ad6[_0x57ebf1(0x208)]['pullProject'](_0x5872ac,{'targetDir':_0x4acfe4,'revision':_0x2b8224}),{'verbose':_0x5a2c66['verbose']}),_0x477e63=_0x315f85[_0x57ebf1(0x1fa)];_0x477e63[_0x57ebf1(0x290)]?console[_0x57ebf1(0x253)](_0x57ebf1(0x1cd)+_0x477e63[_0x57ebf1(0x33e)]):console[_0x57ebf1(0x253)]('→\x20Project:\x20'+_0x477e63['projectName']);console['error'](_0x57ebf1(0x328)+_0x477e63['revision']),console[_0x57ebf1(0x253)](_0x57ebf1(0x30c)+(a59_0x1642f5[_0x57ebf1(0x1b3)](process[_0x57ebf1(0x1c1)](),_0x477e63[_0x57ebf1(0x261)])||'.')),console[_0x57ebf1(0x253)](_0x57ebf1(0x2a7)+a59_0x33ddab[_0x57ebf1(0x296)]('+'+_0x477e63[_0x57ebf1(0x2be)][_0x57ebf1(0x293)]+_0x57ebf1(0x1c2))+',\x20'+(a59_0x33ddab[_0x57ebf1(0x351)]('~'+_0x477e63[_0x57ebf1(0x2be)][_0x57ebf1(0x201)]+_0x57ebf1(0x324))+',\x20')+(a59_0x33ddab[_0x57ebf1(0x214)]('-'+_0x477e63['summary'][_0x57ebf1(0x344)]+_0x57ebf1(0x1d2))+',\x20')+(''+a59_0x33ddab['dim'](_0x477e63[_0x57ebf1(0x2be)]['unchanged']+_0x57ebf1(0x279))));for(const _0x2824a3 of _0x477e63[_0x57ebf1(0x31d)]){_0x2824a3[_0x57ebf1(0x2a3)]===_0x57ebf1(0x201)&&_0x2824a3[_0x57ebf1(0x329)]&&(console[_0x57ebf1(0x253)]('\x0a'+a59_0x33ddab[_0x57ebf1(0x1fe)](_0x57ebf1(0x250)+_0x2824a3[_0x57ebf1(0x276)])),console[_0x57ebf1(0x253)](_0x2824a3[_0x57ebf1(0x329)]));}if(!_0x477e63[_0x57ebf1(0x2ff)])return saveSessionContext({'workflow_project':_0x477e63[_0x57ebf1(0x33e)]},_0x5a2c66[_0x57ebf1(0x1e9)]),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x296)](_0x57ebf1(0x1e1))),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x202)+_0x477e63[_0x57ebf1(0x33e)])),0x0;if(_0x5a2c66[_0x57ebf1(0x1d0)])return console[_0x57ebf1(0x253)](a59_0x33ddab['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x5a2c66[_0x57ebf1(0x29d)]){if(!isInteractive())return console['error'](a59_0x33ddab['red']('\x0aError:'),_0x57ebf1(0x2dd)),console['error'](a59_0x33ddab[_0x57ebf1(0x1fb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x982818=await confirmKey(_0x57ebf1(0x2f7));if(!_0x982818)return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x351)](_0x57ebf1(0x29c)),_0x57ebf1(0x2c9)),0x1;}await withSpinner(_0x57ebf1(0x1e7),()=>_0x137ad6[_0x57ebf1(0x208)]['applyPullProject'](_0x477e63,{'revision':_0x2b8224}),{'verbose':_0x5a2c66[_0x57ebf1(0x1ed)]}),saveSessionContext({'workflow_project':_0x477e63['projectName']},_0x5a2c66[_0x57ebf1(0x1e9)]),console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x296)]('✔\x20Pull\x20complete'));const _0x23a4ec=a59_0x1642f5[_0x57ebf1(0x1b3)](process[_0x57ebf1(0x1c1)](),_0x477e63[_0x57ebf1(0x261)])||'.';return console[_0x57ebf1(0x253)](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x2c3)+_0x23a4ec)),console['error'](a59_0x33ddab[_0x57ebf1(0x1fb)](_0x57ebf1(0x202)+_0x477e63[_0x57ebf1(0x33e)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x245);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2af);async[a59_0x7f9071(0x34a)](_0x4bb901){const _0x52b5d5=a59_0x7f9071,{options:_0x251a9e,args:_0x3b3df8,tdx:_0x29db89}=_0x4bb901,_0x26824c=this['resolveProjectDir'](_0x3b3df8,_0x251a9e),_0x16dbc0=_0x251a9e,{revision:_0x45ac30,skipValidation:_0x524d13,backfill:_0x4cf11f}=_0x16dbc0,_0x444019=_0x4cf11f===undefined?undefined:!_0x4cf11f;_0x251a9e[_0x52b5d5(0x1ed)]&&(_0x26824c&&console['error'](_0x52b5d5(0x368)+_0x26824c),_0x45ac30&&console['error'](_0x52b5d5(0x21c)+_0x45ac30),_0x251a9e[_0x52b5d5(0x1d0)]&&console[_0x52b5d5(0x253)]('Dry\x20run:\x20yes'),_0x524d13&&console[_0x52b5d5(0x253)](_0x52b5d5(0x270)),_0x4cf11f&&console[_0x52b5d5(0x253)](_0x52b5d5(0x303)));let _0x38d3b6;try{_0x38d3b6=await withSpinner(_0x52b5d5(0x2c2),()=>_0x29db89[_0x52b5d5(0x208)][_0x52b5d5(0x315)]({'sourceDir':_0x26824c,'revision':_0x45ac30,'skipValidation':_0x524d13,'skipSchedule':_0x444019}),{'verbose':_0x251a9e[_0x52b5d5(0x1ed)]});}catch(_0x280f13){if(_0x280f13 instanceof Error&&_0x280f13['message'][_0x52b5d5(0x367)](_0x52b5d5(0x316)))return console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x214)](_0x52b5d5(0x218)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x251a9e[_0x52b5d5(0x2c6)]?console['error'](a59_0x33ddab[_0x52b5d5(0x1fb)]('Tip:\x20cd\x20to\x20workflows/'+_0x251a9e[_0x52b5d5(0x2c6)]+_0x52b5d5(0x22e)+_0x251a9e['workflowProject']+'\x27')):console[_0x52b5d5(0x253)](a59_0x33ddab['dim'](_0x52b5d5(0x308))),0x1;throw _0x280f13;}const _0x624949=_0x38d3b6['data'];console[_0x52b5d5(0x253)](_0x52b5d5(0x1f8)+_0x624949['projectName']),console[_0x52b5d5(0x253)]('\x20\x20Source:\x20'+_0x624949[_0x52b5d5(0x2a4)]),console[_0x52b5d5(0x253)](_0x52b5d5(0x328)+_0x624949[_0x52b5d5(0x320)]),console['error'](_0x52b5d5(0x2a7)+a59_0x33ddab['green']('+'+_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x293)]+_0x52b5d5(0x1c2))+',\x20'+(a59_0x33ddab[_0x52b5d5(0x351)]('~'+_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x201)]+_0x52b5d5(0x324))+',\x20')+(a59_0x33ddab[_0x52b5d5(0x214)]('-'+_0x624949[_0x52b5d5(0x2be)]['deleted']+'\x20deleted')+',\x20')+(''+a59_0x33ddab[_0x52b5d5(0x1fb)](_0x624949[_0x52b5d5(0x2be)][_0x52b5d5(0x1e2)]+_0x52b5d5(0x279))));for(const _0x3b8ca7 of _0x624949[_0x52b5d5(0x31d)]){_0x3b8ca7[_0x52b5d5(0x2a3)]==='modified'&&_0x3b8ca7['diff']&&(console[_0x52b5d5(0x253)]('\x0a'+a59_0x33ddab[_0x52b5d5(0x1fe)](_0x52b5d5(0x250)+_0x3b8ca7[_0x52b5d5(0x276)])),console[_0x52b5d5(0x253)](_0x3b8ca7[_0x52b5d5(0x329)]));}if(!_0x624949[_0x52b5d5(0x2ff)])return console[_0x52b5d5(0x253)](a59_0x33ddab['green'](_0x52b5d5(0x318))),await this[_0x52b5d5(0x1bb)](_0x29db89,_0x624949[_0x52b5d5(0x33e)],_0x251a9e[_0x52b5d5(0x26a)]),0x0;if(_0x251a9e[_0x52b5d5(0x1d0)])return console['error'](a59_0x33ddab[_0x52b5d5(0x351)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x251a9e[_0x52b5d5(0x29d)]){if(!isInteractive())return console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x214)](_0x52b5d5(0x229)),_0x52b5d5(0x2dd)),console[_0x52b5d5(0x253)](a59_0x33ddab[_0x52b5d5(0x1fb)](_0x52b5d5(0x319))),0x1;const _0x5e0973=await confirmKey(_0x52b5d5(0x365));if(!_0x5e0973)return console[_0x52b5d5(0x253)](a59_0x33ddab['yellow'](_0x52b5d5(0x29c)),'-\x20nothing\x20pushed'),0x1;}const _0x100d62=await withSpinner(_0x52b5d5(0x2f4),()=>_0x29db89[_0x52b5d5(0x208)][_0x52b5d5(0x32d)](_0x624949),{'verbose':_0x251a9e[_0x52b5d5(0x1ed)]}),_0x1291bd=_0x100d62[_0x52b5d5(0x1fa)];return console[_0x52b5d5(0x253)](a59_0x33ddab['green']('✔\x20Push\x20complete')),console[_0x52b5d5(0x253)](_0x52b5d5(0x346)+_0x1291bd[_0x52b5d5(0x32c)]),console[_0x52b5d5(0x253)](_0x52b5d5(0x328)+_0x1291bd[_0x52b5d5(0x320)]),await this[_0x52b5d5(0x1bb)](_0x29db89,_0x1291bd[_0x52b5d5(0x33e)],_0x251a9e[_0x52b5d5(0x26a)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]='workflow:clone';['description']=a59_0x7f9071(0x1ad);async[a59_0x7f9071(0x34a)](_0x463217){const _0x43e46f=a59_0x7f9071,{options:_0x3f7856,args:_0x427e32,tdx:_0xb5fd25}=_0x463217,_0xa6e40=this['resolveProjectDir'](_0x427e32,_0x3f7856),_0x246fdc=_0x3f7856[_0x43e46f(0x19f)],_0x3721a1=_0x3f7856['revision'],_0x20a40a=_0x3f7856[_0x43e46f(0x2cb)];if(!_0xa6e40)return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x218)),'Source\x20directory\x20is\x20required'),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x1b4))),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x246fdc)return console['error'](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x218)),_0x43e46f(0x297)),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x1b4))),0x1;_0x3f7856[_0x43e46f(0x1ed)]&&(console[_0x43e46f(0x253)]('Source\x20directory:\x20'+_0xa6e40),console[_0x43e46f(0x253)](_0x43e46f(0x22d)+_0x246fdc),_0x3721a1&&console[_0x43e46f(0x253)](_0x43e46f(0x21c)+_0x3721a1),_0x3f7856['dryRun']&&console['error'](_0x43e46f(0x2bc)),_0x20a40a&&console['error'](_0x43e46f(0x270)));const _0x42c8de=await withSpinner('Analyzing\x20project...',()=>_0xb5fd25[_0x43e46f(0x208)][_0x43e46f(0x2e3)](_0xa6e40,_0x246fdc,{'revision':_0x3721a1,'skipValidation':_0x20a40a}),{'verbose':_0x3f7856[_0x43e46f(0x1ed)]}),_0x595bc2=_0x42c8de[_0x43e46f(0x1fa)];console[_0x43e46f(0x253)]('Source:\x20'+_0x595bc2[_0x43e46f(0x2a4)]);_0x595bc2[_0x43e46f(0x2f6)]&&console[_0x43e46f(0x253)]('Source\x20project:\x20'+_0x595bc2[_0x43e46f(0x2f6)]);console[_0x43e46f(0x253)]('New\x20project\x20name:\x20'+_0x595bc2[_0x43e46f(0x225)]),console[_0x43e46f(0x253)](_0x43e46f(0x21c)+_0x595bc2[_0x43e46f(0x320)]),console[_0x43e46f(0x253)]('Files\x20to\x20upload:\x20'+_0x595bc2[_0x43e46f(0x2ef)]);_0x595bc2['targetExists']&&(console[_0x43e46f(0x253)](a59_0x33ddab['yellow'](_0x43e46f(0x1a8)+_0x595bc2[_0x43e46f(0x225)]+_0x43e46f(0x242)+_0x595bc2[_0x43e46f(0x1ab)]+')')),console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x351)](_0x43e46f(0x32f))));if(_0x3f7856[_0x43e46f(0x1d0)])return console['error'](a59_0x33ddab[_0x43e46f(0x351)](_0x43e46f(0x1e5))),0x0;if(!_0x3f7856[_0x43e46f(0x29d)]){if(!isInteractive())return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x214)](_0x43e46f(0x229)),_0x43e46f(0x2dd)),console['error'](a59_0x33ddab[_0x43e46f(0x1fb)](_0x43e46f(0x319))),0x1;const _0x49b03e=_0x595bc2[_0x43e46f(0x2f6)]||a59_0x1642f5[_0x43e46f(0x209)](_0xa6e40),_0x2044f3=_0x595bc2['targetExists']?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x246fdc+_0x43e46f(0x226):_0x43e46f(0x341)+_0x49b03e+_0x43e46f(0x215)+_0x246fdc+'\x22?',_0x130803=await confirmKey(_0x2044f3);if(!_0x130803)return console[_0x43e46f(0x253)](a59_0x33ddab['yellow']('Cancelled')),0x1;}const _0x16b531=await withSpinner(_0x595bc2[_0x43e46f(0x1c7)]?'Updating\x20'+_0x246fdc+_0x43e46f(0x216):'Cloning\x20to\x20'+_0x246fdc+'...',()=>_0xb5fd25[_0x43e46f(0x208)]['executeCloneProject'](_0x595bc2),{'verbose':_0x3f7856[_0x43e46f(0x1ed)]}),_0x357979=_0x16b531[_0x43e46f(0x1fa)];return console[_0x43e46f(0x253)](a59_0x33ddab[_0x43e46f(0x296)](_0x595bc2[_0x43e46f(0x1c7)]?_0x43e46f(0x35f):_0x43e46f(0x300))),console[_0x43e46f(0x253)](_0x43e46f(0x298)+_0x357979['newProjectName']),console[_0x43e46f(0x253)](_0x43e46f(0x346)+_0x357979[_0x43e46f(0x33b)]),console[_0x43e46f(0x253)]('\x20\x20Revision:\x20'+_0x357979['revision']),await this[_0x43e46f(0x1bb)](_0xb5fd25,_0x357979[_0x43e46f(0x225)],_0x3f7856['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x2db);[a59_0x7f9071(0x355)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20AI';async['execute'](_0x4195fa){const _0x21685b=a59_0x7f9071,{options:_0x20cca6,args:_0xb83666,tdx:_0xb69ff3}=_0x4195fa,_0x1b40be=_0xb83666[0x0];if(!_0x1b40be)return console[_0x21685b(0x253)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x21685b(0x253)](_0x21685b(0x25e)),0x1;_0x20cca6[_0x21685b(0x1ed)]&&console[_0x21685b(0x253)](_0x21685b(0x252)+_0x1b40be);if(!_0x20cca6[_0x21685b(0x29d)]){if(!isInteractive())return console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x214)]('\x0aError:'),_0x21685b(0x2dd)),console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x1fb)](_0x21685b(0x319))),0x1;const _0x1d6c51=await confirmKey(_0x21685b(0x2dc)+_0x1b40be+'\x22?\x20This\x20cannot\x20be\x20undone.');if(!_0x1d6c51)return console[_0x21685b(0x253)](a59_0x33ddab[_0x21685b(0x351)](_0x21685b(0x29c))),0x1;}const _0x32bcb1=await withSpinner(_0x21685b(0x257)+_0x1b40be+_0x21685b(0x216),()=>_0xb69ff3[_0x21685b(0x208)][_0x21685b(0x1bf)](_0x1b40be),{'verbose':_0x20cca6['verbose']}),_0x5065d5=_0x32bcb1['data'];return console[_0x21685b(0x253)](_0x21685b(0x1bd)+_0x5065d5['projectName']),console[_0x21685b(0x253)]('\x20\x20Project\x20ID:\x20'+_0x5065d5[_0x21685b(0x32c)]),0x0;}}export function parseKeyValue(_0x32b625){const _0x15f767=a59_0x7f9071,_0x406bf7=_0x32b625['indexOf']('=');if(_0x406bf7===-0x1)throw new Error(_0x15f767(0x1db)+_0x32b625+_0x15f767(0x1af));const _0x285943=_0x32b625[_0x15f767(0x2c5)](0x0,_0x406bf7),_0x109611=_0x32b625[_0x15f767(0x2c5)](_0x406bf7+0x1);if(!_0x285943)throw new Error(_0x15f767(0x280));return{'key':_0x285943,'value':_0x109611};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x227);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x251);async[a59_0x7f9071(0x34a)](_0x517db4){const _0x2c429c=a59_0x7f9071,{options:_0x37a9f5,args:_0x3d29e0,tdx:_0x1970a6}=_0x517db4,_0x1d4aa3=this['requireProject'](_0x3d29e0,_0x37a9f5);if(!_0x1d4aa3)return 0x1;_0x37a9f5[_0x2c429c(0x1ed)]&&console[_0x2c429c(0x253)](_0x2c429c(0x252)+_0x1d4aa3);const _0x1a9cb0=await withSpinner(_0x2c429c(0x362),()=>_0x1970a6[_0x2c429c(0x208)]['listSecrets'](_0x1d4aa3),{'verbose':_0x37a9f5[_0x2c429c(0x1ed)]}),{secrets:_0x54779c}=_0x1a9cb0[_0x2c429c(0x1fa)];return console[_0x2c429c(0x253)](_0x2c429c(0x1a0)+_0x54779c[_0x2c429c(0x21d)]+_0x2c429c(0x23e)+(_0x54779c[_0x2c429c(0x21d)]!==0x1?'s':'')),await handleSDKOutput(_0x54779c,_0x37a9f5),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]='workflow:secrets:set';['description']=a59_0x7f9071(0x2f5);async[a59_0x7f9071(0x34a)](_0x4b25d2){const _0x3702b7=a59_0x7f9071,{options:_0x3da97d,args:_0x344486,tdx:_0x2dc0c2}=_0x4b25d2;let _0x15f40d,_0x537a6e;if(_0x344486[_0x3702b7(0x21d)]>=0x1&&!_0x344486[0x0][_0x3702b7(0x367)]('='))_0x15f40d=_0x344486[0x0],_0x537a6e=_0x344486['slice'](0x1);else{if(_0x344486[_0x3702b7(0x21d)]>=0x1&&_0x3da97d[_0x3702b7(0x2c6)])_0x15f40d=_0x3da97d['workflowProject'],_0x537a6e=_0x344486;else return _0x344486['length']>=0x1?(console['error'](_0x3702b7(0x210)),console[_0x3702b7(0x253)](_0x3702b7(0x2ae)),0x1):(console[_0x3702b7(0x253)](_0x3702b7(0x1e8)),console['error'](_0x3702b7(0x28b)),0x1);}if(_0x537a6e[_0x3702b7(0x21d)]===0x0)return console[_0x3702b7(0x253)](_0x3702b7(0x1e8)),console[_0x3702b7(0x253)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x153d50={};try{for(const _0x2c3cf9 of _0x537a6e){const {key:_0x5bd47c,value:_0x37887f}=parseKeyValue(_0x2c3cf9);_0x153d50[_0x5bd47c]=_0x37887f;}}catch(_0x4c4f7a){return _0x4c4f7a instanceof Error&&console[_0x3702b7(0x253)](a59_0x33ddab['red'](_0x3702b7(0x218)),_0x4c4f7a[_0x3702b7(0x259)]),0x1;}const _0x5c22f9=Object['keys'](_0x153d50);_0x3da97d[_0x3702b7(0x1ed)]&&(console[_0x3702b7(0x253)]('Project:\x20'+_0x15f40d),console['error']('Secrets\x20to\x20set:\x20'+_0x5c22f9[_0x3702b7(0x2f3)](',\x20')));const _0x5069fb=await withSpinner(_0x5c22f9[_0x3702b7(0x21d)]===0x1?_0x3702b7(0x2fd):'Setting\x20'+_0x5c22f9['length']+_0x3702b7(0x359),()=>_0x2dc0c2[_0x3702b7(0x208)][_0x3702b7(0x233)](_0x15f40d,_0x153d50),{'verbose':_0x3da97d[_0x3702b7(0x1ed)]}),_0x23feb1=_0x5069fb[_0x3702b7(0x1fa)];return console[_0x3702b7(0x253)](_0x5c22f9[_0x3702b7(0x21d)]===0x1?'✔\x20Secret\x20\x27'+_0x23feb1[_0x3702b7(0x31f)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x23feb1[_0x3702b7(0x33e)]+'\x27':'✔\x20'+_0x23feb1[_0x3702b7(0x31f)]['length']+_0x3702b7(0x2da)+_0x23feb1['projectName']+'\x27'),(_0x3da97d['json']||_0x3da97d[_0x3702b7(0x35d)])&&await handleSingleObjectOutput(_0x23feb1,_0x3da97d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x27c);['description']=a59_0x7f9071(0x26d);async[a59_0x7f9071(0x34a)](_0xc01e22){const _0x2e670e=a59_0x7f9071,{options:_0x4d1765,args:_0x2af1be,tdx:_0x43acfe}=_0xc01e22;let _0x435989,_0x5c942c;if(_0x2af1be[_0x2e670e(0x21d)]>=0x2)_0x435989=_0x2af1be[0x0],_0x5c942c=_0x2af1be[0x1];else{if(_0x2af1be[_0x2e670e(0x21d)]===0x1&&_0x4d1765[_0x2e670e(0x2c6)])_0x435989=_0x4d1765[_0x2e670e(0x2c6)],_0x5c942c=_0x2af1be[0x0];else return _0x2af1be[_0x2e670e(0x21d)]===0x1?(console[_0x2e670e(0x253)](_0x2e670e(0x210)),console[_0x2e670e(0x253)](_0x2e670e(0x2ae)),0x1):(console[_0x2e670e(0x253)](_0x2e670e(0x224)),console[_0x2e670e(0x253)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x4d1765[_0x2e670e(0x1ed)]&&(console[_0x2e670e(0x253)](_0x2e670e(0x252)+_0x435989),console[_0x2e670e(0x253)](_0x2e670e(0x235)+_0x5c942c));if(!_0x4d1765[_0x2e670e(0x29d)]){if(!isInteractive())return console[_0x2e670e(0x253)](a59_0x33ddab[_0x2e670e(0x214)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2e670e(0x253)](a59_0x33ddab['dim'](_0x2e670e(0x319))),0x1;const _0x529cb9=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5c942c+'\x27\x20from\x20project\x20\x27'+_0x435989+'\x27?');if(!_0x529cb9)return console[_0x2e670e(0x253)](a59_0x33ddab[_0x2e670e(0x351)](_0x2e670e(0x29c))),0x1;}const _0x41e1b3=await withSpinner('Deleting\x20secret...',()=>_0x43acfe['workflow'][_0x2e670e(0x30b)](_0x435989,_0x5c942c),{'verbose':_0x4d1765[_0x2e670e(0x1ed)]}),_0x40687b=_0x41e1b3[_0x2e670e(0x1fa)];return console['error'](_0x2e670e(0x237)+_0x40687b[_0x2e670e(0x35a)]+_0x2e670e(0x2f1)+_0x40687b['projectName']+'\x27'),(_0x4d1765['json']||_0x4d1765[_0x2e670e(0x35d)])&&await handleSingleObjectOutput(_0x40687b,_0x4d1765),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(_0x16b552){const _0x14bb0a=a59_0x7f9071,_0x5bd5f9=Math[_0x14bb0a(0x272)](_0x16b552/0x3e8),_0x39bda7=Math['floor'](_0x5bd5f9/0x3c),_0xbe06a1=Math[_0x14bb0a(0x272)](_0x39bda7/0x3c),_0x1ad141=Math['floor'](_0xbe06a1/0x18);if(_0x1ad141>0x0){const _0x5ce70d=_0xbe06a1%0x18;return _0x5ce70d>0x0?_0x1ad141+'d\x20'+_0x5ce70d+'h':_0x1ad141+'d';}else{if(_0xbe06a1>0x0){const _0x28bb84=_0x39bda7%0x3c;return _0x28bb84>0x0?_0xbe06a1+'h\x20'+_0x28bb84+'m':_0xbe06a1+'h';}else{if(_0x39bda7>0x0){const _0x4f2f25=_0x5bd5f9%0x3c;return _0x4f2f25>0x0?_0x39bda7+'m\x20'+_0x4f2f25+'s':_0x39bda7+'m';}else return _0x5bd5f9+'s';}}}function formatTimestamp(_0x5533b2,_0xdfce43){const _0x22bea9=a59_0x7f9071,_0x2052d5=new Date(_0x5533b2),_0x329db6=String(_0x2052d5[_0x22bea9(0x27d)]())[_0x22bea9(0x305)](0x2,'0'),_0x2707ad=String(_0x2052d5[_0x22bea9(0x353)]())[_0x22bea9(0x305)](0x2,'0'),_0x37a3b7=_0x329db6+':'+_0x2707ad,_0x2f7b39=_0x2052d5[_0x22bea9(0x301)]()===_0xdfce43[_0x22bea9(0x301)]()&&_0x2052d5[_0x22bea9(0x26b)]()===_0xdfce43[_0x22bea9(0x26b)]()&&_0x2052d5[_0x22bea9(0x256)]()===_0xdfce43['getDate']();if(_0x2f7b39)return _0x37a3b7;else{const _0x2209d4=String(_0x2052d5[_0x22bea9(0x26b)]()+0x1)[_0x22bea9(0x305)](0x2,'0'),_0x131639=String(_0x2052d5['getDate']())[_0x22bea9(0x305)](0x2,'0');return _0x2209d4+'-'+_0x131639+'\x20'+_0x37a3b7;}}function formatDate(_0x5347f2){const _0x1b03df=a59_0x7f9071,_0x59e2f9=_0x5347f2['getFullYear'](),_0x56124d=String(_0x5347f2[_0x1b03df(0x26b)]()+0x1)[_0x1b03df(0x305)](0x2,'0'),_0x43e5de=String(_0x5347f2[_0x1b03df(0x256)]())[_0x1b03df(0x305)](0x2,'0');return _0x59e2f9+'-'+_0x56124d+'-'+_0x43e5de;}function getTaskStateIcon(_0x4c0d9d){const _0x2b6bc3={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x2b6bc3[_0x4c0d9d]||'⚪';}function getBarChar(_0x1c1fc8){const _0x43b363=a59_0x7f9071;return _0x1c1fc8===_0x43b363(0x253)||_0x1c1fc8===_0x43b363(0x1eb)?'×':'─';}function getBarColor(_0x1c9b7b){const _0xcbb117=a59_0x7f9071,_0x51aa9d={'success':a59_0x33ddab[_0xcbb117(0x296)],'error':a59_0x33ddab[_0xcbb117(0x214)],'group_error':a59_0x33ddab[_0xcbb117(0x214)],'running':a59_0x33ddab['blue'],'blocked':a59_0x33ddab[_0xcbb117(0x351)],'planned':a59_0x33ddab['dim'],'canceling':a59_0x33ddab[_0xcbb117(0x351)]};return _0x51aa9d[_0x1c9b7b]||a59_0x33ddab[_0xcbb117(0x354)];}function parseTaskName(_0x20a777){const _0x50509f=a59_0x7f9071;let _0x2e5881=_0x20a777[_0x50509f(0x1a7)](/^\++/,'');const _0x46687b=_0x2e5881[_0x50509f(0x2c7)]('+'),_0x45517a=_0x46687b[_0x50509f(0x21d)]>0x1?_0x46687b['length']-0x2:0x0,_0x3e49c2=_0x46687b[_0x46687b[_0x50509f(0x21d)]-0x1]||_0x2e5881;return{'level':_0x45517a,'name':'+'+_0x3e49c2};}function truncateTaskName(_0x4e301d,_0x4fb483){const _0x2c2d86=stringWidth(_0x4e301d);if(_0x2c2d86<=_0x4fb483)return _0x4e301d;let _0x50b62a=_0x4e301d;while(stringWidth(_0x50b62a+'…')>_0x4fb483&&_0x50b62a['length']>0x0){_0x50b62a=_0x50b62a['slice'](0x0,-0x1);}return _0x50b62a+'…';}function calculateTimeScale(_0x13d566,_0x1fd616){const _0x1776dc=a59_0x7f9071;return{'startTime':_0x13d566['start'],'endTime':_0x13d566[_0x1776dc(0x2bd)],'durationMs':_0x13d566[_0x1776dc(0x284)],'msPerChar':_0x13d566[_0x1776dc(0x284)]/_0x1fd616};}function timeToPosition(_0x30997c,_0x15e48c,_0x5e090a){const _0x3d8118=a59_0x7f9071,_0x3b97a4=_0x30997c-_0x15e48c[_0x3d8118(0x294)],_0x44c222=Math['floor'](_0x3b97a4/_0x15e48c[_0x3d8118(0x2ed)]);return Math[_0x3d8118(0x1c6)](0x0,Math['min'](_0x44c222,_0x5e090a));}function a59_0x392d(_0x1391e9,_0x189eb4){_0x1391e9=_0x1391e9-0x19f;const _0x1a0de5=a59_0x1a0d();let _0x392d9f=_0x1a0de5[_0x1391e9];return _0x392d9f;}function renderTimeAxis(_0x21ff12,_0x536630){const _0x3dba73=a59_0x7f9071,_0x23b235=Math[_0x3dba73(0x340)](TIMELINE_CONFIG[_0x3dba73(0x2fc)],Math[_0x3dba73(0x1c6)](TIMELINE_CONFIG[_0x3dba73(0x1da)],Math[_0x3dba73(0x272)](_0x536630/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x1635e0=_0x21ff12['durationMs']/(_0x23b235-0x1),_0x600377=new Date(_0x21ff12[_0x3dba73(0x294)]),_0x4f966f=[];for(let _0x192c54=0x0;_0x192c54<_0x23b235;_0x192c54++){const _0xc1d61c=_0x21ff12[_0x3dba73(0x294)]+_0x192c54*_0x1635e0,_0xe94be1=timeToPosition(_0xc1d61c,_0x21ff12,_0x536630),_0x4ba609=formatTimestamp(_0xc1d61c,_0x600377);_0x4f966f[_0x3dba73(0x23d)]({'pos':_0xe94be1,'text':_0x4ba609});}const _0x4adff3=new Array(_0x536630)['fill']('\x20');let _0x150362=-0x1;for(const {pos:_0x438728,text:_0x363767}of _0x4f966f){let _0xe9eb9b=Math[_0x3dba73(0x1c6)](0x0,_0x438728-Math['floor'](_0x363767[_0x3dba73(0x21d)]/0x2));_0xe9eb9b<=_0x150362+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0xe9eb9b=_0x150362+TIMELINE_CONFIG[_0x3dba73(0x2ec)]+0x1);_0xe9eb9b+_0x363767['length']>_0x536630&&(_0xe9eb9b=_0x536630-_0x363767[_0x3dba73(0x21d)]);if(_0xe9eb9b>=0x0&&_0xe9eb9b+_0x363767[_0x3dba73(0x21d)]<=_0x536630&&_0xe9eb9b>_0x150362){for(let _0x56b1f4=0x0;_0x56b1f4<_0x363767['length'];_0x56b1f4++){_0x4adff3[_0xe9eb9b+_0x56b1f4]=_0x363767[_0x56b1f4];}_0x150362=_0xe9eb9b+_0x363767[_0x3dba73(0x21d)]-0x1;}}return _0x4adff3['join']('');}function renderTaskRow(_0x495508,_0x2a5f92,_0x564326,_0x1f9462){const _0x39674f=a59_0x7f9071,{level:_0x5f5dc6,name:_0x5731ef}=parseTaskName(_0x495508[_0x39674f(0x19f)]),_0x8d48ff='\x20'['repeat'](_0x5f5dc6),_0x2477d0=_0x495508[_0x39674f(0x2cd)]?'('+formatElapsed(_0x495508['window'][_0x39674f(0x284)])+')':'',_0x149330=stringWidth(_0x2477d0),_0x39f5ea=_0x5f5dc6*0x1,_0x416a12=_0x1f9462-_0x39f5ea-_0x149330-0x1,_0x7853ab=truncateTaskName(_0x5731ef,_0x416a12),_0x2d7f44=_0x8d48ff+_0x7853ab,_0x1bcab2=stringWidth(_0x2d7f44),_0x44a69e=_0x1f9462-_0x1bcab2-_0x149330,_0x42f2c2=_0x2d7f44+'\x20'[_0x39674f(0x1d7)](Math['max'](0x1,_0x44a69e))+a59_0x33ddab[_0x39674f(0x1fb)](_0x2477d0),_0x87c8bd=getTaskStateIcon(_0x495508[_0x39674f(0x2ab)]),_0x5ab322=new Array(_0x564326)[_0x39674f(0x24b)]('\x20');if(_0x495508[_0x39674f(0x2cd)]){const _0x594694=timeToPosition(_0x495508['window'][_0x39674f(0x1ae)],_0x2a5f92,_0x564326),_0x40bf89=timeToPosition(_0x495508[_0x39674f(0x2cd)]['end'],_0x2a5f92,_0x564326),_0x56110f=getBarChar(_0x495508['state']),_0x3f23d9=Math['max'](_0x594694+0x1,_0x40bf89);for(let _0x30dbb3=_0x594694;_0x30dbb3<Math[_0x39674f(0x340)](_0x3f23d9,_0x564326);_0x30dbb3++){_0x5ab322[_0x30dbb3]=_0x56110f;}}const _0x32aa1b=getBarColor(_0x495508[_0x39674f(0x2ab)]),_0x3f5676=_0x5ab322[_0x39674f(0x2fe)](_0x3d3e3a=>_0x3d3e3a==='\x20'?'\x20':_0x32aa1b(_0x3d3e3a))[_0x39674f(0x2f3)]('');return _0x87c8bd+'\x20'+_0x42f2c2+'│'+_0x3f5676+'│';}function calculateStats(_0x98c7ac){const _0xa50145=a59_0x7f9071,_0x5f0561={'total':_0x98c7ac['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x568010 of _0x98c7ac){if(_0x568010['state']==='success')_0x5f0561[_0xa50145(0x1f0)]++;else{if(_0x568010['state']===_0xa50145(0x253)||_0x568010[_0xa50145(0x2ab)]==='group_error')_0x5f0561[_0xa50145(0x253)]++;else _0x568010[_0xa50145(0x2ab)]===_0xa50145(0x2f0)?_0x5f0561['running']++:_0x5f0561[_0xa50145(0x30f)]++;}}return _0x5f0561;}function formatStats(_0x723905){const _0x16c2a1=a59_0x7f9071;return[_0x16c2a1(0x2c0)+_0x723905[_0x16c2a1(0x1c5)],'✅\x20'+_0x723905[_0x16c2a1(0x1f0)],'❌\x20'+_0x723905[_0x16c2a1(0x253)],_0x16c2a1(0x343)+_0x723905[_0x16c2a1(0x2f0)],'⏳\x20'+_0x723905[_0x16c2a1(0x30f)]][_0x16c2a1(0x2f3)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a59_0x7f9071(0x317);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2e4);async['execute'](_0x27a6e0){const _0x1d2f6c=a59_0x7f9071,{options:_0x37cfd6,args:_0x59d18c,tdx:_0x536958}=_0x27a6e0;let _0x2e3d75,_0x556de7,_0x40569b=![];if(_0x59d18c[0x0]){if(_0x59d18c[0x0]['includes']('.')){const _0x1a1f41=this[_0x1d2f6c(0x2e9)](_0x59d18c,_0x37cfd6);if(!_0x1a1f41)return 0x1;_0x2e3d75=_0x1a1f41[_0x1d2f6c(0x33e)],_0x556de7=_0x1a1f41['workflowName'];}else{_0x556de7=_0x59d18c[0x0],_0x2e3d75=_0x37cfd6[_0x1d2f6c(0x2c6)];if(!_0x2e3d75)return console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x214)](_0x1d2f6c(0x218)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x40569b=!![];}}else{const _0x430c07=this['parseProjectWorkflowPattern'](_0x59d18c,_0x37cfd6);if(!_0x430c07)return 0x1;_0x2e3d75=_0x430c07[_0x1d2f6c(0x33e)],_0x556de7=_0x430c07['workflowName'];}if(_0x37cfd6[_0x1d2f6c(0x1ed)]){if(_0x2e3d75&&_0x556de7)console[_0x1d2f6c(0x253)](_0x1d2f6c(0x26c)+_0x2e3d75+'.'+_0x556de7);else _0x2e3d75&&console['error'](_0x1d2f6c(0x240)+_0x2e3d75);}const _0x3d0c02=_0x37cfd6[_0x1d2f6c(0x2cf)],_0x109c67=_0x37cfd6[_0x1d2f6c(0x2f2)];if(_0x3d0c02){_0x109c67&&console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x351)]('Warning:'),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x3fa22d=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x3fa22d?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x3d0c02):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x3d0c02,_0x37cfd6),0x0;}if(_0x109c67){const _0x448c9c=await withSpinner(_0x1d2f6c(0x2b5),()=>_0x536958[_0x1d2f6c(0x208)][_0x1d2f6c(0x22f)]({'projectName':_0x2e3d75,'workflowName':_0x556de7,'limit':0x64}),{'verbose':_0x37cfd6['verbose']}),_0x953578=_0x448c9c[_0x1d2f6c(0x1fa)][_0x1d2f6c(0x322)](_0x493168=>_0x493168['id']===_0x109c67);if(!_0x953578)return console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x214)]('Error:'),'Session\x20not\x20found:\x20'+_0x109c67),0x1;if(!_0x953578['lastAttempt']?.['id'])return console['error'](a59_0x33ddab[_0x1d2f6c(0x214)](_0x1d2f6c(0x218)),_0x1d2f6c(0x282)+_0x109c67+_0x1d2f6c(0x264)),0x1;const _0x548f12=_0x953578['lastAttempt']['id'];_0x37cfd6[_0x1d2f6c(0x1ed)]&&console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1ee)+_0x548f12+_0x1d2f6c(0x1b7)+_0x109c67);const _0x12cfe2=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x12cfe2?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x548f12):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x548f12,_0x37cfd6),0x0;}const _0x1f565c=await withSpinner('Loading\x20sessions...',()=>_0x536958[_0x1d2f6c(0x208)][_0x1d2f6c(0x22f)]({'projectName':_0x2e3d75,'workflowName':_0x556de7,'limit':_0x37cfd6[_0x1d2f6c(0x28c)]||0x32}),{'verbose':_0x37cfd6[_0x1d2f6c(0x1ed)]}),_0x49cba2=_0x1f565c[_0x1d2f6c(0x1fa)];if(_0x49cba2[_0x1d2f6c(0x21d)]===0x0){if(_0x2e3d75&&_0x556de7)console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1be)+_0x2e3d75+'.'+_0x556de7);else _0x2e3d75?console['error'](_0x1d2f6c(0x352)+_0x2e3d75):(console[_0x1d2f6c(0x253)](_0x1d2f6c(0x34b)),console[_0x1d2f6c(0x253)](a59_0x33ddab[_0x1d2f6c(0x1fb)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x49cba2['sort']((_0x40f224,_0x2be9b9)=>{const _0x1268b5=_0x1d2f6c,_0x286607=_0x40f224[_0x1268b5(0x25f)]||'',_0x14c247=_0x2be9b9['sessionTime']||'';return _0x14c247[_0x1268b5(0x205)](_0x286607);});if(_0x37cfd6[_0x1d2f6c(0x27b)]||_0x37cfd6[_0x1d2f6c(0x35d)])return await handleSDKOutput(_0x49cba2,_0x37cfd6),0x0;let _0x29bd02;if(_0x40569b){const _0x4dd159=_0x49cba2[0x0];if(!_0x4dd159[_0x1d2f6c(0x1d6)]?.['id'])return console[_0x1d2f6c(0x253)](_0x1d2f6c(0x24f)),0x0;_0x29bd02=_0x4dd159[_0x1d2f6c(0x1d6)]['id'],_0x37cfd6[_0x1d2f6c(0x1ed)]&&console[_0x1d2f6c(0x253)](_0x1d2f6c(0x1f9)+_0x4dd159[_0x1d2f6c(0x25f)]);}else{const _0x3d0f81=_0x49cba2[_0x1d2f6c(0x2fe)](_0x598b61=>{const _0x255828=_0x1d2f6c,_0x27dc66=getAttemptStatusDisplay(_0x598b61[_0x255828(0x1d6)]);return{'title':_0x598b61[_0x255828(0x2ad)]?.[_0x255828(0x19f)]+'.'+_0x598b61[_0x255828(0x208)]?.['name']+'\x20-\x20'+_0x598b61[_0x255828(0x25f)]+'\x20'+_0x27dc66['icon'],'value':_0x598b61[_0x255828(0x1d6)]?.['id']||'','description':_0x27dc66[_0x255828(0x20f)]};}),_0x1da1d9=await a59_0x30a0c4({'type':_0x1d2f6c(0x30a),'name':_0x1d2f6c(0x2cf),'message':_0x1d2f6c(0x2d6),'choices':_0x3d0f81['filter'](_0x2e6a23=>_0x2e6a23[_0x1d2f6c(0x366)]!=='')});if(!_0x1da1d9[_0x1d2f6c(0x2cf)])return 0x0;_0x29bd02=_0x1da1d9['attemptId'];}const _0x33eb05=_0x37cfd6[_0x1d2f6c(0x21e)];return _0x33eb05?await this[_0x1d2f6c(0x2b0)](_0x27a6e0,_0x29bd02):await this[_0x1d2f6c(0x1a9)](_0x27a6e0,_0x29bd02,_0x37cfd6),0x0;}async[a59_0x7f9071(0x1a9)](_0x306991,_0x1b783a,_0x104d3){const _0x4b37e1=a59_0x7f9071,{tdx:_0xa1def4}=_0x306991;let _0x1320b3,_0x4f581b;try{[_0x1320b3,_0x4f581b]=await Promise['all']([_0xa1def4[_0x4b37e1(0x208)][_0x4b37e1(0x1e4)](_0x1b783a),_0xa1def4['workflow'][_0x4b37e1(0x2d0)](_0x1b783a,![])]);}catch(_0x2d765){console[_0x4b37e1(0x253)](a59_0x33ddab['red'](_0x4b37e1(0x1d1)));_0x104d3[_0x4b37e1(0x1ed)]&&console[_0x4b37e1(0x253)](_0x2d765);throw _0x2d765;}if(_0x104d3[_0x4b37e1(0x27b)]||_0x104d3['jsonl']){const _0x431e23=this['buildTimelineData'](_0x1320b3,_0x4f581b);await handleSDKOutput([_0x431e23],_0x104d3);return;}const _0x38e6c0=_0xa1def4['context'][_0x4b37e1(0x26a)],_0x51bb66=this['renderTimeline'](_0x1320b3,_0x4f581b,_0x38e6c0);console[_0x4b37e1(0x2fb)](_0x51bb66);}async['pollTimeline'](_0x9b7dcc,_0x363113){const _0xbce2f9=a59_0x7f9071,{tdx:_0x14d43a}=_0x9b7dcc,_0x116435=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0xb6abda=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x474ced=0x0;while(_0x474ced<_0xb6abda){process['stdout'][_0xbce2f9(0x23c)]&&process[_0xbce2f9(0x356)]['write']('\x1Bc');let _0x6f0842,_0x1f44a2;try{[_0x6f0842,_0x1f44a2]=await Promise[_0xbce2f9(0x33f)]([_0x14d43a[_0xbce2f9(0x208)][_0xbce2f9(0x1e4)](_0x363113),_0x14d43a[_0xbce2f9(0x208)]['tasks'](_0x363113,![])]);}catch(_0x6a3423){console[_0xbce2f9(0x253)](a59_0x33ddab[_0xbce2f9(0x214)](_0xbce2f9(0x25b)));_0x474ced>0x0&&console[_0xbce2f9(0x253)](a59_0x33ddab['dim'](_0xbce2f9(0x35e)+_0x474ced));throw _0x6a3423;}const _0x42fb6a=_0x14d43a['context']['site'],_0x534a10=this[_0xbce2f9(0x217)](_0x6f0842,_0x1f44a2,_0x42fb6a);console[_0xbce2f9(0x2fb)](_0x534a10);const _0x45ddf6=_0x6f0842['done']&&_0x1f44a2['every'](_0x1a7d12=>_0x1a7d12[_0xbce2f9(0x2ab)]!==_0xbce2f9(0x2f0)&&_0x1a7d12[_0xbce2f9(0x2ab)]!==_0xbce2f9(0x1f7));if(_0x45ddf6){console[_0xbce2f9(0x253)](a59_0x33ddab['green'](_0xbce2f9(0x29e)));break;}console[_0xbce2f9(0x253)](a59_0x33ddab[_0xbce2f9(0x1fb)]('\x0aPolling...\x20('+_0x474ced*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x13e205=>setTimeout(_0x13e205,_0x116435)),_0x474ced++;}_0x474ced>=_0xb6abda&&console[_0xbce2f9(0x253)](a59_0x33ddab['yellow'](_0xbce2f9(0x271)));}[a59_0x7f9071(0x217)](_0x57293c,_0x52eca4,_0x2db3df){const _0x21459b=a59_0x7f9071,_0x2b2ca4=[],_0x5e452f=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x3696c4=0x5,_0xfa164f=process[_0x21459b(0x356)][_0x21459b(0x2a9)]||0x78,_0x486874=_0xfa164f-_0x5e452f-_0x3696c4,_0x16a962=Math[_0x21459b(0x1c6)](TIMELINE_CONFIG[_0x21459b(0x1ce)],Math[_0x21459b(0x340)](_0x486874,TIMELINE_CONFIG[_0x21459b(0x1fc)])),_0x474a67=new Date(_0x57293c[_0x21459b(0x27e)])['getTime'](),_0x5957c0=_0x57293c['finishedAt']?new Date(_0x57293c[_0x21459b(0x34d)])[_0x21459b(0x1d3)]():Date[_0x21459b(0x2e7)](),_0x3e3095={'start':_0x474a67,'end':_0x5957c0,'duration':_0x5957c0-_0x474a67},_0x4a2543=new Map(),_0xed9343=[];for(const _0x1ab537 of _0x52eca4){if(_0x1ab537[_0x21459b(0x2b3)]){const _0x67cb2f=new Date(_0x1ab537['startedAt'])['getTime'](),_0x2a8b92=_0x1ab537['updatedAt']?new Date(_0x1ab537[_0x21459b(0x31c)])[_0x21459b(0x1d3)]():Date[_0x21459b(0x2e7)](),_0x2475c5={'start':_0x67cb2f,'end':_0x2a8b92,'duration':_0x2a8b92-_0x67cb2f};_0x4a2543[_0x21459b(0x1f2)](_0x1ab537['id'],_0x2475c5),_0xed9343[_0x21459b(0x23d)]({'name':_0x1ab537[_0x21459b(0x2d7)],'state':_0x1ab537[_0x21459b(0x2ab)]||'unknown','window':_0x2475c5});}else _0xed9343['push']({'name':_0x1ab537[_0x21459b(0x2d7)],'state':_0x1ab537[_0x21459b(0x2ab)]||_0x21459b(0x1f7),'window':undefined});}_0xed9343['sort']((_0x4989c1,_0x17329f)=>{const _0x55a64b=_0x21459b;if(!_0x4989c1['window'])return 0x1;if(!_0x17329f[_0x55a64b(0x2cd)])return-0x1;return _0x4989c1[_0x55a64b(0x2cd)]['start']-_0x17329f[_0x55a64b(0x2cd)]['start'];});const _0x31a21f=_0xed9343['length'],_0xd2d6a1=_0x31a21f>TIMELINE_CONFIG[_0x21459b(0x314)];_0xd2d6a1&&_0xed9343[_0x21459b(0x241)](TIMELINE_CONFIG[_0x21459b(0x314)]);const _0x3ad254=calculateTimeScale(_0x3e3095,_0x16a962),_0x1bf7d3=_0x57293c[_0x21459b(0x27f)]?_0x57293c[_0x21459b(0x1f0)]?a59_0x33ddab['green'](_0x21459b(0x1f0)):a59_0x33ddab[_0x21459b(0x214)](_0x21459b(0x253)):a59_0x33ddab['blue'](_0x21459b(0x2f0)),_0x542573=_0x57293c[_0x21459b(0x2ad)]?.['id'],_0x49f74f=_0x57293c[_0x21459b(0x2f2)];let _0x24622a;if(_0x542573&&_0x49f74f){const _0x55403d=getWorkflowAttemptUrl(_0x2db3df,_0x542573,_0x49f74f,_0x57293c['id']);_0x24622a=hyperlink(a59_0x33ddab[_0x21459b(0x1fb)](_0x57293c['id']),_0x55403d);}else _0x24622a=a59_0x33ddab[_0x21459b(0x1fb)](_0x57293c['id']);_0x2b2ca4[_0x21459b(0x23d)](_0x21459b(0x2e8)+_0x24622a+_0x21459b(0x29a)+_0x1bf7d3+_0x21459b(0x29a)+formatElapsed(_0x3e3095[_0x21459b(0x284)]));if(_0xed9343['length']>0x0){const _0xa8d306=renderTimeAxis(_0x3ad254,_0x16a962),_0x5b388a=new Date(_0x3e3095[_0x21459b(0x1ae)]),_0x16e7c=formatDate(_0x5b388a),_0x124822=TIMELINE_CONFIG[_0x21459b(0x1b5)]+TIMELINE_CONFIG[_0x21459b(0x1b0)]+_0x5e452f,_0x84e770=_0x16e7c[_0x21459b(0x305)](_0x124822),_0x5cee4b=a59_0x33ddab['dim'](_0x84e770);_0x2b2ca4[_0x21459b(0x23d)](_0x5cee4b+'\x20'+_0xa8d306);for(const _0x463b34 of _0xed9343){_0x2b2ca4[_0x21459b(0x23d)](renderTaskRow(_0x463b34,_0x3ad254,_0x16a962,_0x5e452f));}const _0x564ac4=calculateStats(_0xed9343);_0x2b2ca4[_0x21459b(0x23d)](formatStats(_0x564ac4)),_0xd2d6a1&&_0x2b2ca4[_0x21459b(0x23d)](a59_0x33ddab[_0x21459b(0x351)](_0x21459b(0x268)+TIMELINE_CONFIG[_0x21459b(0x314)]+_0x21459b(0x234)+_0x31a21f+_0x21459b(0x2bb))),_0x2b2ca4['push'](''),_0x2b2ca4['push'](a59_0x33ddab['dim'](_0x21459b(0x219))+('tdx\x20wf\x20attempt\x20'+_0x57293c['id']+_0x21459b(0x26f))+a59_0x33ddab[_0x21459b(0x1fb)](_0x21459b(0x350)));}else _0x2b2ca4[_0x21459b(0x23d)](_0x21459b(0x2b4));return _0x2b2ca4['join']('\x0a');}['buildTimelineData'](_0x3ae920,_0x3b2948){const _0x416dc5=a59_0x7f9071,_0xecebd=new Date(_0x3ae920[_0x416dc5(0x27e)])['getTime'](),_0x40b0f0=_0x3ae920[_0x416dc5(0x34d)]?new Date(_0x3ae920[_0x416dc5(0x34d)])['getTime']():Date[_0x416dc5(0x2e7)](),_0x591fc4=_0x40b0f0-_0xecebd,_0x1db682=[];for(const _0x40e214 of _0x3b2948){if(_0x40e214[_0x416dc5(0x2b3)]){const _0x47cf46=new Date(_0x40e214[_0x416dc5(0x2b3)])[_0x416dc5(0x1d3)](),_0xea090f=_0x40e214[_0x416dc5(0x31c)]?new Date(_0x40e214[_0x416dc5(0x31c)])[_0x416dc5(0x1d3)]():Date[_0x416dc5(0x2e7)]();_0x1db682[_0x416dc5(0x23d)]({'name':_0x40e214['fullName'],'state':_0x40e214['state']||_0x416dc5(0x1dd),'window':{'start':_0x47cf46,'end':_0xea090f,'duration':_0xea090f-_0x47cf46}});}else _0x1db682[_0x416dc5(0x23d)]({'name':_0x40e214[_0x416dc5(0x2d7)],'state':_0x40e214[_0x416dc5(0x2ab)]||_0x416dc5(0x1f7),'window':undefined});}const _0x3c3daf=calculateStats(_0x1db682);return{'attempt':{'id':_0x3ae920['id'],'status':_0x3ae920[_0x416dc5(0x27f)]?_0x3ae920[_0x416dc5(0x1f0)]?_0x416dc5(0x1f0):_0x416dc5(0x253):_0x416dc5(0x2f0),'createdAt':_0x3ae920[_0x416dc5(0x27e)],'finishedAt':_0x3ae920[_0x416dc5(0x34d)],'duration_ms':_0x591fc4},'tasks':_0x1db682[_0x416dc5(0x2fe)](_0x339237=>({'name':_0x339237[_0x416dc5(0x19f)],'state':_0x339237[_0x416dc5(0x2ab)],'startedAt':_0x339237['window']?new Date(_0x339237[_0x416dc5(0x2cd)][_0x416dc5(0x1ae)])[_0x416dc5(0x211)]():null,'updatedAt':_0x339237[_0x416dc5(0x2cd)]?new Date(_0x339237['window'][_0x416dc5(0x2bd)])[_0x416dc5(0x211)]():null,'duration_ms':_0x339237[_0x416dc5(0x2cd)]?.[_0x416dc5(0x284)]||null})),'stats':_0x3c3daf};}}function formatScheduleLine(_0x505a64){const _0x562d71=a59_0x7f9071,_0x23003f=_0x505a64[_0x562d71(0x33d)]?a59_0x33ddab['yellow'](_0x562d71(0x1bc)):'',_0x2ee650=_0x505a64[_0x562d71(0x2ad)]?.[_0x562d71(0x19f)]?a59_0x33ddab[_0x562d71(0x1fb)]('\x20['+_0x505a64['project']['name']+']'):'',_0xb56b64=_0x505a64[_0x562d71(0x254)]?a59_0x33ddab[_0x562d71(0x1fb)](_0x562d71(0x255)+new Date(_0x505a64[_0x562d71(0x254)])[_0x562d71(0x33a)]()):'';return'📅\x20#'+_0x505a64['id']+'\x20'+(_0x505a64[_0x562d71(0x208)]?.[_0x562d71(0x19f)]||_0x562d71(0x212))+_0x2ee650+_0x23003f+_0xb56b64;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x7f9071(0x19f)]=a59_0x7f9071(0x335);['description']=a59_0x7f9071(0x307);async['execute'](_0x3fa896){const _0x28f852=a59_0x7f9071,{options:_0x4ac181,args:_0x135879,tdx:_0x59fa52}=_0x3fa896,{scheduleId:_0x4ad6bf}=_0x4ac181;if(_0x4ad6bf&&_0x135879[0x0])return console[_0x28f852(0x253)](a59_0x33ddab[_0x28f852(0x214)](_0x28f852(0x218)),_0x28f852(0x21a)),console[_0x28f852(0x253)](a59_0x33ddab[_0x28f852(0x1fb)](_0x28f852(0x361))),0x1;if(_0x4ad6bf){const _0x1d5364=await withSpinner(_0x28f852(0x1f3)+_0x4ad6bf+_0x28f852(0x216),()=>_0x59fa52[_0x28f852(0x208)][_0x28f852(0x1c4)](_0x4ad6bf),{'verbose':_0x4ac181['verbose']}),_0xc9d8a5=_0x1d5364[_0x28f852(0x1fa)];return isStructuredFormat(_0x4ac181)?await handleSingleObjectOutput(_0xc9d8a5,_0x4ac181):(console[_0x28f852(0x253)](_0x28f852(0x2b1)),console[_0x28f852(0x2fb)](formatScheduleLine(_0xc9d8a5))),0x0;}const _0x11b7ad=this[_0x28f852(0x2e9)](_0x135879,_0x4ac181);if(!_0x11b7ad)return 0x1;const {projectName:_0x367132,workflowName:_0x4ec636}=_0x11b7ad,_0x14a67d=_0x367132?'\x27'+_0x367132+(_0x4ec636?'.'+_0x4ec636:'')+'\x27':undefined,_0x1220d8=await withSpinner(_0x14a67d?_0x28f852(0x31e)+_0x14a67d+_0x28f852(0x216):'Listing\x20schedules...',()=>_0x367132?_0x59fa52[_0x28f852(0x208)][_0x28f852(0x332)](_0x367132,{'workflow':_0x4ec636,'limit':_0x4ac181[_0x28f852(0x28c)]}):_0x59fa52[_0x28f852(0x208)]['listSchedules']({'limit':_0x4ac181['limit']}),{'verbose':_0x4ac181['verbose']}),_0x17e4a4=_0x1220d8[_0x28f852(0x1fa)],_0x56b6a6=_0x4ac181[_0x28f852(0x28c)]&&_0x17e4a4[_0x28f852(0x21d)]>=_0x4ac181['limit']?a59_0x33ddab[_0x28f852(0x1fb)](_0x28f852(0x273)):'';console['error'](_0x28f852(0x1a0)+_0x17e4a4[_0x28f852(0x21d)]+_0x28f852(0x1ff)+(_0x17e4a4[_0x28f852(0x21d)]!==0x1?'s':'')+_0x56b6a6);if(isStructuredFormat(_0x4ac181))await handleSDKOutput(_0x17e4a4,_0x4ac181);else{if(_0x17e4a4[_0x28f852(0x21d)]===0x0)console[_0x28f852(0x2fb)]('No\x20schedules\x20found');else for(const _0x5189e5 of _0x17e4a4){console[_0x28f852(0x2fb)](formatScheduleLine(_0x5189e5));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{['name']=a59_0x7f9071(0x25d);[a59_0x7f9071(0x355)]=a59_0x7f9071(0x2c1);async[a59_0x7f9071(0x34a)](_0x15fcc1){const _0x4aaeb8=a59_0x7f9071,{options:_0x323f13,args:_0x5c1d24,tdx:_0x126126}=_0x15fcc1,_0x252847=_0x5c1d24[0x0];if(!_0x252847)return console[_0x4aaeb8(0x253)](a59_0x33ddab[_0x4aaeb8(0x214)](_0x4aaeb8(0x218)),_0x4aaeb8(0x20a)),console[_0x4aaeb8(0x253)](a59_0x33ddab['dim'](_0x4aaeb8(0x248))),console[_0x4aaeb8(0x253)](a59_0x33ddab['dim'](_0x4aaeb8(0x247))),0x1;const {backfill:_0x32d290,nextTime:_0x3c3cf2}=_0x323f13,_0x1e0ec9={};if(_0x32d290!==undefined)_0x1e0ec9[_0x4aaeb8(0x1a1)]=!_0x32d290;if(_0x3c3cf2!==undefined)_0x1e0ec9['nextTime']=_0x3c3cf2;const _0x44d3de=await withSpinner(_0x4aaeb8(0x278)+_0x252847+_0x4aaeb8(0x216),()=>_0x126126['workflow']['enableSchedule'](_0x252847,_0x1e0ec9),{'verbose':_0x323f13[_0x4aaeb8(0x1ed)]}),_0x8989f5=_0x44d3de[_0x4aaeb8(0x1fa)];return isStructuredFormat(_0x323f13)?await handleSingleObjectOutput(_0x8989f5,_0x323f13):(console[_0x4aaeb8(0x2fb)](_0x4aaeb8(0x2eb)+_0x252847+'\x20enabled\x20('+(_0x8989f5[_0x4aaeb8(0x208)]?.[_0x4aaeb8(0x19f)]||_0x4aaeb8(0x1dd))+')'),_0x8989f5[_0x4aaeb8(0x254)]&&console[_0x4aaeb8(0x2fb)](a59_0x33ddab['dim'](_0x4aaeb8(0x1ba)+new Date(_0x8989f5['nextRunTime'])[_0x4aaeb8(0x33a)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x7f9071(0x19f)]='workflow:schedule:disable';[a59_0x7f9071(0x355)]=a59_0x7f9071(0x223);async['execute'](_0x4e3bec){const _0x1d0a36=a59_0x7f9071,{options:_0x380127,args:_0x45566a,tdx:_0x185890}=_0x4e3bec,_0x4bbb2d=_0x45566a[0x0];if(!_0x4bbb2d)return console[_0x1d0a36(0x253)](a59_0x33ddab[_0x1d0a36(0x214)](_0x1d0a36(0x218)),_0x1d0a36(0x20a)),console[_0x1d0a36(0x253)](a59_0x33ddab[_0x1d0a36(0x1fb)](_0x1d0a36(0x243))),console['error'](a59_0x33ddab['dim'](_0x1d0a36(0x247))),0x1;const _0xf78a86=await withSpinner(_0x1d0a36(0x369)+_0x4bbb2d+_0x1d0a36(0x216),()=>_0x185890['workflow'][_0x1d0a36(0x23b)](_0x4bbb2d),{'verbose':_0x380127[_0x1d0a36(0x1ed)]}),_0x350a81=_0xf78a86[_0x1d0a36(0x1fa)];return isStructuredFormat(_0x380127)?await handleSingleObjectOutput(_0x350a81,_0x380127):console[_0x1d0a36(0x2fb)](_0x1d0a36(0x2eb)+_0x4bbb2d+_0x1d0a36(0x349)+(_0x350a81[_0x1d0a36(0x208)]?.[_0x1d0a36(0x19f)]||'unknown')+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x57eb05,_0x35ba40){const _0x372336=a60_0xa257,_0x527c9a=_0x57eb05();while(!![]){try{const _0x597313=parseInt(_0x372336(0x1b3))/0x1*(-parseInt(_0x372336(0x1af))/0x2)+-parseInt(_0x372336(0x1b0))/0x3*(parseInt(_0x372336(0x1b1))/0x4)+parseInt(_0x372336(0x1ba))/0x5*(-parseInt(_0x372336(0x1a7))/0x6)+parseInt(_0x372336(0x1a9))/0x7*(-parseInt(_0x372336(0x1ab))/0x8)+-parseInt(_0x372336(0x1b2))/0x9*(parseInt(_0x372336(0x1b9))/0xa)+parseInt(_0x372336(0x1a4))/0xb*(parseInt(_0x372336(0x1b7))/0xc)+parseInt(_0x372336(0x1a8))/0xd;if(_0x597313===_0x35ba40)break;else _0x527c9a['push'](_0x527c9a['shift']());}catch(_0x221ca3){_0x527c9a['push'](_0x527c9a['shift']());}}}(a60_0x3c3a,0x6dddc));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a60_0x3c3a(){const _0x321cd1=['6IYFLSG','36626473vrdzTX','2330363ZIrihA','tdx','16OpCNKW',';\x20node/','X-Trino-User','Authorization','962RgScMC','6yRABBx','1255024OaooxI','2547kJmjnZ','1673kGXqbN','Bearer\x20','entries','TD1\x20','12VRQwna','tdx/','21030tHSDAb','657515gMSyPf','5030146ixBAkm','replace','version'];a60_0x3c3a=function(){return _0x321cd1;};return a60_0x3c3a();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3e3020=a60_0xa257,_0x2e80e9=getVersion(),_0x2da903=platform(),_0x31e788=process[_0x3e3020(0x1a6)][_0x3e3020(0x1a5)]('v','');return _0x3e3020(0x1b8)+_0x2e80e9+'\x20('+_0x2da903+_0x3e3020(0x1ac)+_0x31e788+')';}export function getAuthHeaders(_0x5f1a51,_0x32c64e,_0x3bc32a){const _0x4d9419=a60_0xa257,_0x1a2915=getVersion(),_0x183d86={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d9419(0x1aa),'X-TD-Client-Version':_0x1a2915};if(_0x3bc32a)_0x183d86[_0x4d9419(0x1ae)]='Bearer\x20'+_0x3bc32a;else _0x32c64e&&(_0x183d86[_0x4d9419(0x1ae)]=_0x4d9419(0x1b6)+_0x32c64e);return _0x183d86;}function a60_0xa257(_0x37c572,_0x74c277){_0x37c572=_0x37c572-0x1a4;const _0x3c3af1=a60_0x3c3a();let _0xa25787=_0x3c3af1[_0x37c572];return _0xa25787;}export function toHeaderRecord(_0x40b611){const _0x2284fc=a60_0xa257,_0x6d8dd0={};for(const [_0x33b954,_0x10adab]of Object[_0x2284fc(0x1b5)](_0x40b611)){_0x10adab!==undefined&&(_0x6d8dd0[_0x33b954]=_0x10adab);}return _0x6d8dd0;}export function getTrinoHeaders(_0x560815,_0x4b7c4c,_0x13ab6b){const _0x2885ed=a60_0xa257,_0x54524e=getAuthHeaders(_0x560815),_0x49632c=toHeaderRecord(_0x54524e);if(_0x13ab6b)_0x49632c['Authorization']=_0x2885ed(0x1b4)+_0x13ab6b;else _0x4b7c4c&&(_0x49632c[_0x2885ed(0x1ad)]=_0x4b7c4c);return _0x49632c;}export function hasAPIKey(_0x5880b6){const _0x5488ca=getAPIKey();return _0x5488ca!==undefined&&_0x5488ca['length']>0x0;}
1
+ function a60_0x2c9b(){const _0x5c7769=['80510KTcpZf','version',';\x20node/','tdx/','6MRJRkp','tdx','33rcWgsL','TD1\x20','4694200jfQUxX','replace','171dNhogn','15123163waOxDW','534ASzDgZ','188492uyNcxm','Bearer\x20','entries','119544ZOwQKZ','7547450cShngb','Authorization','18385fKcHoo'];a60_0x2c9b=function(){return _0x5c7769;};return a60_0x2c9b();}(function(_0x1efe47,_0x1453b9){const _0x1cdbbe=a60_0x2c0a,_0x374929=_0x1efe47();while(!![]){try{const _0x15f232=-parseInt(_0x1cdbbe(0x1f3))/0x1*(-parseInt(_0x1cdbbe(0x1f7))/0x2)+-parseInt(_0x1cdbbe(0x1e5))/0x3*(parseInt(_0x1cdbbe(0x1ec))/0x4)+-parseInt(_0x1cdbbe(0x1f2))/0x5*(parseInt(_0x1cdbbe(0x1eb))/0x6)+parseInt(_0x1cdbbe(0x1e7))/0x7+parseInt(_0x1cdbbe(0x1ef))/0x8*(-parseInt(_0x1cdbbe(0x1e9))/0x9)+-parseInt(_0x1cdbbe(0x1f0))/0xa+parseInt(_0x1cdbbe(0x1ea))/0xb;if(_0x15f232===_0x1453b9)break;else _0x374929['push'](_0x374929['shift']());}catch(_0x5cc8f2){_0x374929['push'](_0x374929['shift']());}}}(a60_0x2c9b,0x62507));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a60_0x2c0a(_0x39bd8f,_0x232260){_0x39bd8f=_0x39bd8f-0x1e5;const _0x2c9b06=a60_0x2c9b();let _0x2c0aa5=_0x2c9b06[_0x39bd8f];return _0x2c0aa5;}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5ede35=a60_0x2c0a,_0x15d360=getVersion(),_0x7c5b72=platform(),_0x16a5b4=process[_0x5ede35(0x1f4)][_0x5ede35(0x1e8)]('v','');return _0x5ede35(0x1f6)+_0x15d360+'\x20('+_0x7c5b72+_0x5ede35(0x1f5)+_0x16a5b4+')';}export function getAuthHeaders(_0x3bcacc,_0x5163fe,_0x4e6f90){const _0xec7d25=a60_0x2c0a,_0x4cf4f0=getVersion(),_0x9a05a6={'User-Agent':getUserAgent(),'X-TD-Client':_0xec7d25(0x1f8),'X-TD-Client-Version':_0x4cf4f0};if(_0x4e6f90)_0x9a05a6[_0xec7d25(0x1f1)]=_0xec7d25(0x1ed)+_0x4e6f90;else _0x5163fe&&(_0x9a05a6['Authorization']=_0xec7d25(0x1e6)+_0x5163fe);return _0x9a05a6;}export function toHeaderRecord(_0x14482c){const _0x26156c=a60_0x2c0a,_0x3534ea={};for(const [_0x33250e,_0x53be13]of Object[_0x26156c(0x1ee)](_0x14482c)){_0x53be13!==undefined&&(_0x3534ea[_0x33250e]=_0x53be13);}return _0x3534ea;}export function getTrinoHeaders(_0x11ea48,_0x43965b,_0x512e8c){const _0x1861e3=a60_0x2c0a,_0x3c5355=getAuthHeaders(_0x11ea48),_0x254fbe=toHeaderRecord(_0x3c5355);if(_0x512e8c)_0x254fbe[_0x1861e3(0x1f1)]='Bearer\x20'+_0x512e8c;else _0x43965b&&(_0x254fbe['X-Trino-User']=_0x43965b);return _0x254fbe;}export function hasAPIKey(_0x1ba92e){const _0x54089d=getAPIKey();return _0x54089d!==undefined&&_0x54089d['length']>0x0;}