@treasuredata/tdx 2026.8.2 → 2026.8.3

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 (247) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-move-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/table-deleted.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/site-mismatch.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/auth-token.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  100. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  104. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.d.ts +10 -0
  108. package/dist/sdk/cas/index.d.ts.map +1 -1
  109. package/dist/sdk/cas/index.js +1 -1
  110. package/dist/sdk/cas/index.js.map +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/validate-files.js +1 -1
  114. package/dist/sdk/client/cdp-api-client.js +1 -1
  115. package/dist/sdk/client/delivery-api-client.js +1 -1
  116. package/dist/sdk/client/endpoints.js +1 -1
  117. package/dist/sdk/client/engage-api-client.js +1 -1
  118. package/dist/sdk/client/http-client.js +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/oauth-refresh.js +1 -1
  121. package/dist/sdk/client/rate-limiter.js +1 -1
  122. package/dist/sdk/client/td-api-client.js +1 -1
  123. package/dist/sdk/client/trino-api-client.js +1 -1
  124. package/dist/sdk/client/workflow-client.js +1 -1
  125. package/dist/sdk/connection-validator.js +1 -1
  126. package/dist/sdk/connection.js +1 -1
  127. package/dist/sdk/delivery.js +1 -1
  128. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  129. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  130. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  131. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-yaml.js +1 -1
  136. package/dist/sdk/engage/template-pull.js +1 -1
  137. package/dist/sdk/engage/template-push.js +1 -1
  138. package/dist/sdk/engage/template-validator.js +1 -1
  139. package/dist/sdk/engage/template-yaml.js +1 -1
  140. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.js +1 -1
  153. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  154. package/dist/sdk/llm/model-factors.js +1 -1
  155. package/dist/sdk/llm/user-settings.js +1 -1
  156. package/dist/sdk/personalization.js +1 -1
  157. package/dist/sdk/policy.js +1 -1
  158. package/dist/sdk/query/deleted-table-validation.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.js +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/util/tree-search.js +1 -1
  198. package/dist/sdk/workflow/archive-validation.js +1 -1
  199. package/dist/sdk/workflow/clone-workflow.js +1 -1
  200. package/dist/sdk/workflow/index.js +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.js +1 -1
  203. package/dist/sdk/workflow/task-graph.js +1 -1
  204. package/dist/sdk/workflow/tdx-config.js +1 -1
  205. package/dist/sdk/workflow/workflow-utils.js +1 -1
  206. package/dist/sdk/workspace/access-tracker.js +1 -1
  207. package/dist/sdk/workspace/frontmatter.js +1 -1
  208. package/dist/sdk/workspace/git.js +1 -1
  209. package/dist/sdk/workspace/index.js +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.js +1 -1
  212. package/dist/sdk/workspace/wikilinks.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/claude-code-state.js +1 -1
  220. package/dist/utils/colors.js +1 -1
  221. package/dist/utils/diff.js +1 -1
  222. package/dist/utils/file-permissions.js +1 -1
  223. package/dist/utils/file-reader.js +1 -1
  224. package/dist/utils/github-releases.js +1 -1
  225. package/dist/utils/global-cache.js +1 -1
  226. package/dist/utils/json-loader.js +1 -1
  227. package/dist/utils/local-cache.js +1 -1
  228. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  229. package/dist/utils/logger/formatters/index.js +1 -1
  230. package/dist/utils/logger/handlers/console-handler.js +1 -1
  231. package/dist/utils/logger/handlers/file-handler.js +1 -1
  232. package/dist/utils/logger/handlers/index.js +1 -1
  233. package/dist/utils/logger/handlers/null-handler.js +1 -1
  234. package/dist/utils/logger/index.js +1 -1
  235. package/dist/utils/logger/logger.js +1 -1
  236. package/dist/utils/logger/types.js +1 -1
  237. package/dist/utils/option-validation.js +1 -1
  238. package/dist/utils/process.js +1 -1
  239. package/dist/utils/prompt.js +1 -1
  240. package/dist/utils/proxy-fetch.js +1 -1
  241. package/dist/utils/spinner.js +1 -1
  242. package/dist/utils/sse-parser.js +1 -1
  243. package/dist/utils/string-utils.js +1 -1
  244. package/dist/utils/table-ref-parser.js +1 -1
  245. package/dist/utils/tdx-logger.js +1 -1
  246. package/dist/utils/version-check.js +1 -1
  247. package/package.json +1 -1
@@ -1 +1 @@
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;}}
1
+ const a59_0x34b1fc=a59_0x2d50;(function(_0x5518b3,_0x55a372){const _0x1f7229=a59_0x2d50,_0x4a19e9=_0x5518b3();while(!![]){try{const _0x55d555=-parseInt(_0x1f7229(0x1cb))/0x1+parseInt(_0x1f7229(0xb3))/0x2*(parseInt(_0x1f7229(0x1c9))/0x3)+-parseInt(_0x1f7229(0x231))/0x4*(-parseInt(_0x1f7229(0x1cf))/0x5)+-parseInt(_0x1f7229(0xcf))/0x6+parseInt(_0x1f7229(0x8a))/0x7+-parseInt(_0x1f7229(0x206))/0x8+parseInt(_0x1f7229(0x188))/0x9*(parseInt(_0x1f7229(0x222))/0xa);if(_0x55d555===_0x55a372)break;else _0x4a19e9['push'](_0x4a19e9['shift']());}catch(_0x54f1ca){_0x4a19e9['push'](_0x4a19e9['shift']());}}}(a59_0x314e,0x7256f));import a59_0x564dd3 from'chalk';import{existsSync}from'fs';import a59_0x156221 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import{parseTaskGraph,formatTaskGraph,summarizeTaskGraph,formatWarningSummary}from'../sdk/workflow/task-graph.js';import a59_0x17b23b from'prompts';function getAttemptStatusDisplay(_0x424832){const _0x4d47d1=a59_0x2d50;if(!_0x424832)return{'icon':'⏳','text':''};const {done:_0x150e59,success:_0x840346,cancelRequested:_0x3c88ae}=_0x424832;if(!_0x150e59)return _0x3c88ae?{'icon':'🛑','text':a59_0x564dd3[_0x4d47d1(0x204)](_0x4d47d1(0x247))}:{'icon':'🔄','text':a59_0x564dd3[_0x4d47d1(0x1f6)](_0x4d47d1(0x6e))};if(_0x840346)return{'icon':'✅','text':a59_0x564dd3[_0x4d47d1(0xcd)](_0x4d47d1(0x1b7))};return{'icon':'❌','text':a59_0x564dd3[_0x4d47d1(0x1a4)](_0x4d47d1(0x23a))};}export class WorkflowBaseCommand extends BaseCommand{[a59_0x34b1fc(0xd0)](_0x28b875,_0x985310,_0xabdeb3=0x0){const _0x58bd1b=a59_0x34b1fc;return _0x28b875[_0xabdeb3]||_0x985310[_0x58bd1b(0x20b)];}[a59_0x34b1fc(0x213)](_0x1bd8f5,_0xbfc1ef,_0x30ed4e=0x0){const _0x5bd83a=a59_0x34b1fc,_0x12aa42=this[_0x5bd83a(0xd0)](_0x1bd8f5,_0xbfc1ef,_0x30ed4e);if(!_0x12aa42)return console[_0x5bd83a(0x23a)](a59_0x564dd3[_0x5bd83a(0x1a4)](_0x5bd83a(0x168)),'Project\x20name\x20is\x20required'),console[_0x5bd83a(0x23a)](a59_0x564dd3['dim'](_0x5bd83a(0x185))),null;return _0x12aa42;}[a59_0x34b1fc(0x194)](_0x553d8e,_0x130d9d){const _0x397cec=a59_0x34b1fc;if(_0x553d8e[0x0]){const _0x53f441=_0x553d8e[0x0][_0x397cec(0x101)]('.');if(_0x53f441[_0x397cec(0x217)]===0x1)return{'projectName':_0x53f441[0x0],'workflowName':undefined};else return _0x53f441[_0x397cec(0x217)]===0x2?{'projectName':_0x53f441[0x0],'workflowName':_0x53f441[0x1]}:(console[_0x397cec(0x23a)](a59_0x564dd3['red'](_0x397cec(0x168)),_0x397cec(0x7c)),null);}return{'projectName':_0x130d9d[_0x397cec(0x20b)],'workflowName':undefined};}[a59_0x34b1fc(0x14e)](_0x215518,_0x25f9dd,_0x188bf7=0x0){const _0x4e587c=a59_0x34b1fc;if(_0x215518[_0x188bf7])return _0x215518[_0x188bf7];if(_0x25f9dd[_0x4e587c(0x20b)]){const _0x44cbe1=a59_0x156221[_0x4e587c(0xf7)](process[_0x4e587c(0x154)](),_0x4e587c(0x1d0),_0x25f9dd['workflowProject']);if(existsSync(a59_0x156221['join'](_0x44cbe1,_0x4e587c(0xd9))))return _0x44cbe1;}return undefined;}async[a59_0x34b1fc(0xe2)](_0x265beb,_0x1ac3e7,_0x270f8e){const _0x14e9a5=a59_0x34b1fc;try{const _0x5cbc52=await _0x265beb['workflow']['workflows'](_0x1ac3e7,{'limit':0x1});if(_0x5cbc52[_0x14e9a5(0x217)]>0x0){const _0x2efb5c=_0x5cbc52[0x0]['id'],_0x1a3777=getWorkflowUrl(_0x270f8e,_0x2efb5c);console['error'](_0x14e9a5(0xda)+a59_0x564dd3[_0x14e9a5(0x1ae)](_0x1a3777));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1c7);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x243);async[a59_0x34b1fc(0x203)](_0x52b2fe){const _0x18b899=a59_0x34b1fc,{options:_0x37ffad,args:_0x556ee6,tdx:_0x21fe54}=_0x52b2fe,_0x35b1e1=_0x556ee6[0x0],_0xdef50a=_0x37ffad[_0x18b899(0xfc)];if(_0xdef50a)return saveSessionContext({'workflow_project':undefined},_0x37ffad['session']),console[_0x18b899(0x223)](a59_0x564dd3['green'](_0x18b899(0xf2))),0x0;if(!_0x35b1e1)return console[_0x18b899(0x23a)](a59_0x564dd3['red'](_0x18b899(0x168)),_0x18b899(0x1ac)),console['error'](a59_0x564dd3[_0x18b899(0x6f)](_0x18b899(0x136))),console[_0x18b899(0x23a)](a59_0x564dd3[_0x18b899(0x6f)](_0x18b899(0x17d))),0x1;const _0x59060e=await withSpinner(_0x18b899(0xe0)+_0x35b1e1+_0x18b899(0x8f),()=>_0x21fe54['workflow'][_0x18b899(0x88)](_0x35b1e1),{'verbose':_0x37ffad[_0x18b899(0x1ab)]}),{name:_0xe62717}=_0x59060e[_0x18b899(0x138)];return saveSessionContext({'workflow_project':_0xe62717},_0x37ffad['session']),console['log'](a59_0x564dd3[_0x18b899(0xcd)](_0x18b899(0x114)+a59_0x564dd3['cyan'](_0xe62717))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]='workflow:projects';[a59_0x34b1fc(0x229)]='List\x20all\x20workflow\x20projects';async[a59_0x34b1fc(0x203)](_0x5027dd){const _0x2e85bc=a59_0x34b1fc,{options:_0xfc0f43,args:_0x38e7e5,tdx:_0x312bd4}=_0x5027dd,_0x24a7f0=_0x38e7e5[0x0];_0xfc0f43['verbose']&&_0x24a7f0&&console['error'](_0x2e85bc(0x115)+_0x24a7f0);const _0x6a4717=await withSpinner(_0x2e85bc(0x1c0),()=>_0x312bd4[_0x2e85bc(0x14b)][_0x2e85bc(0x10f)](_0x24a7f0,{'limit':_0xfc0f43[_0x2e85bc(0x7d)]}),{'verbose':_0xfc0f43['verbose']});let _0x4bd08f=_0x6a4717[_0x2e85bc(0x138)];_0x4bd08f[_0x2e85bc(0x65)]((_0x1a20fa,_0x3dde74)=>_0x1a20fa[_0x2e85bc(0x7b)][_0x2e85bc(0x16e)](_0x3dde74[_0x2e85bc(0x7b)]));const _0x40f84d=_0xfc0f43['limit']&&_0x4bd08f['length']>=_0xfc0f43['limit']?a59_0x564dd3['dim'](_0x2e85bc(0x207)):'';console[_0x2e85bc(0x23a)](_0x2e85bc(0x24a)+_0x4bd08f[_0x2e85bc(0x217)]+'\x20project'+(_0x4bd08f[_0x2e85bc(0x217)]!==0x1?'s':'')+_0x40f84d);if(_0xfc0f43[_0x2e85bc(0x197)]===_0x2e85bc(0x1e8)||_0xfc0f43[_0x2e85bc(0x197)]==='jsonl'||_0xfc0f43[_0x2e85bc(0x197)]==='table')await handleSDKOutput(_0x4bd08f,_0xfc0f43);else{if(_0x4bd08f[_0x2e85bc(0x217)]===0x0)_0x24a7f0?console[_0x2e85bc(0x223)](_0x2e85bc(0x68)+_0x24a7f0):console[_0x2e85bc(0x223)]('No\x20workflow\x20projects\x20found');else{const _0x13fc7b=_0x4bd08f[_0x2e85bc(0xb1)](_0x109bc9=>{const _0x2f0add=_0x2e85bc,_0x196382=_0x109bc9[_0x2f0add(0xc9)]?.[_0x2f0add(0xf3)](_0x4a9336=>_0x4a9336[_0x2f0add(0x24e)]==='sys'),_0x54562f=_0x196382?a59_0x564dd3['dim'](_0x2f0add(0x1d4)):'';return'📁\x20'+_0x109bc9[_0x2f0add(0x7b)]+_0x54562f;});await writeOutput(_0x13fc7b[_0x2e85bc(0xf7)]('\x0a'),_0xfc0f43['output'],_0x2e85bc(0xab));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1e1);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1c6);async[a59_0x34b1fc(0x203)](_0x4f8c77){const _0x337f21=a59_0x34b1fc,{options:_0x45b9b4,args:_0x1ac2d6,tdx:_0x485daa}=_0x4f8c77,_0x126c0b=this['resolveProject'](_0x1ac2d6,_0x45b9b4);_0x45b9b4['verbose']&&_0x126c0b&&console[_0x337f21(0x23a)](_0x337f21(0x16f)+_0x126c0b);const _0x254100=await withSpinner(_0x337f21(0x1fb),()=>_0x485daa['workflow'][_0x337f21(0x1d0)](_0x126c0b,{'limit':_0x45b9b4['limit']}),{'verbose':_0x45b9b4[_0x337f21(0x1ab)]});let _0x23b6d8=_0x254100[_0x337f21(0x138)];_0x23b6d8[_0x337f21(0x65)]((_0x232067,_0x28419a)=>{const _0x475d21=_0x337f21,_0x3f9786=_0x232067[_0x475d21(0x7b)][_0x475d21(0x16e)](_0x28419a[_0x475d21(0x7b)]);if(_0x3f9786!==0x0)return _0x3f9786;return(_0x232067['project']?.[_0x475d21(0x7b)]||'')[_0x475d21(0x16e)](_0x28419a[_0x475d21(0xc6)]?.[_0x475d21(0x7b)]||'');});const _0x4242d0=_0x45b9b4[_0x337f21(0x7d)]&&_0x23b6d8[_0x337f21(0x217)]>=_0x45b9b4[_0x337f21(0x7d)]?a59_0x564dd3[_0x337f21(0x6f)](_0x337f21(0x207)):'';console['error']('✔\x20Found\x20'+_0x23b6d8['length']+'\x20workflow'+(_0x23b6d8[_0x337f21(0x217)]!==0x1?'s':'')+_0x4242d0);if(_0x45b9b4[_0x337f21(0x197)]==='json'||_0x45b9b4[_0x337f21(0x197)]==='jsonl'||_0x45b9b4[_0x337f21(0x197)]===_0x337f21(0x13f))await handleSDKOutput(_0x23b6d8,_0x45b9b4);else{if(_0x23b6d8[_0x337f21(0x217)]===0x0)_0x126c0b?console['log'](_0x337f21(0x87)+_0x126c0b):console['log']('No\x20workflows\x20found');else{const _0x1919bd=_0x45b9b4[_0x337f21(0xc7)],_0x47fea5=_0x23b6d8['map'](_0x5392c2=>{const _0x141d0e=_0x337f21,_0x449ab6=a59_0x564dd3['dim']('#'+_0x5392c2['id']),_0x49d26b=hyperlink(_0x449ab6,getWorkflowUrl(_0x1919bd,_0x5392c2['id'])),_0x468f9b=_0x5392c2['project']?.[_0x141d0e(0x7b)]?a59_0x564dd3[_0x141d0e(0x6f)]('\x20('+_0x5392c2[_0x141d0e(0xc6)][_0x141d0e(0x7b)]+')'):'';return'📋\x20'+_0x49d26b+'\x20'+_0x5392c2['name']+_0x468f9b;});await writeOutput(_0x47fea5[_0x337f21(0xf7)]('\x0a'),_0x45b9b4['output'],_0x337f21(0xab));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:sessions';['description']=a59_0x34b1fc(0xb7);async[a59_0x34b1fc(0x203)](_0x19c121){const _0x144370=a59_0x34b1fc,{options:_0x228540,args:_0x2e7000,tdx:_0x39df22}=_0x19c121,_0x2a63a0=this['parseProjectWorkflowPattern'](_0x2e7000,_0x228540);if(!_0x2a63a0)return 0x1;const {projectName:_0x28b21c,workflowName:_0x55dd47}=_0x2a63a0;if(_0x228540['verbose']){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x23a)](_0x144370(0x1fd)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c&&console[_0x144370(0x23a)](_0x144370(0x123)+_0x28b21c);const _0x396943=_0x228540[_0x144370(0x1b6)];_0x396943&&console['error']('Status:\x20'+_0x396943);}let _0x22fc39=0x28;if(process[_0x144370(0x122)][_0x144370(0x10b)]&&!_0x228540[_0x144370(0x95)]&&!_0x228540[_0x144370(0x197)]){const _0x9b8ffe=process['stdout']['rows']||0x28;_0x22fc39=Math['max'](0x14,Math['floor'](_0x9b8ffe*0x2/0x3));}const _0x130148=_0x228540[_0x144370(0x7d)]||_0x22fc39,_0x7cdbaf=await withSpinner(_0x144370(0xc8),()=>_0x39df22[_0x144370(0x14b)][_0x144370(0x1ef)]({'projectName':_0x28b21c,'workflowName':_0x55dd47,'status':_0x228540['status'],'fromTime':_0x228540[_0x144370(0xec)],'toTime':_0x228540['to'],'limit':_0x130148}),{'verbose':_0x228540[_0x144370(0x1ab)]}),_0x4f4483=_0x7cdbaf[_0x144370(0x138)];_0x4f4483[_0x144370(0x65)]((_0x4715b0,_0x2d3105)=>{const _0x2481e8=_0x144370,_0x4f57d6=_0x4715b0[_0x2481e8(0xad)]||'',_0x285f5c=_0x2d3105[_0x2481e8(0xad)]||'';return _0x285f5c[_0x2481e8(0x16e)](_0x4f57d6);});_0x4f4483[_0x144370(0x217)]>=_0x130148?console[_0x144370(0x23a)](_0x144370(0x190)+_0x4f4483['length']+_0x144370(0x79)+a59_0x564dd3[_0x144370(0x6f)](_0x144370(0x140))):console[_0x144370(0x23a)](_0x144370(0x24a)+_0x4f4483[_0x144370(0x217)]+_0x144370(0x233)+(_0x4f4483[_0x144370(0x217)]!==0x1?'s':''));if(_0x228540[_0x144370(0x197)]===_0x144370(0x1e8)||_0x228540[_0x144370(0x197)]===_0x144370(0x77)||_0x228540[_0x144370(0x197)]===_0x144370(0x13f))await handleSDKOutput(_0x4f4483,_0x228540);else{if(!process[_0x144370(0x122)]['isTTY']||_0x228540[_0x144370(0x95)]){if(_0x4f4483['length']===0x0){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x223)](_0x144370(0x7f)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c?console[_0x144370(0x223)](_0x144370(0xb5)+_0x28b21c):console['log'](_0x144370(0x1db));}else{const _0x3a0993=_0x228540[_0x144370(0xc7)],_0x8445c4=this[_0x144370(0x6c)](_0x4f4483,_0x3a0993);_0x228540[_0x144370(0x95)]?await writeOutput(_0x8445c4,_0x228540['output'],'list'):console[_0x144370(0x223)](_0x8445c4);}!_0x28b21c&&(console['error'](''),console['error'](a59_0x564dd3[_0x144370(0x6f)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x144370(0x23a)](a59_0x564dd3['dim'](_0x144370(0x1fe))+'or'+a59_0x564dd3[_0x144370(0x6f)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x4f4483[_0x144370(0x217)]===0x0){if(_0x28b21c&&_0x55dd47)console[_0x144370(0x223)](_0x144370(0x7f)+_0x28b21c+'.'+_0x55dd47);else _0x28b21c?console['log'](_0x144370(0xb5)+_0x28b21c):console[_0x144370(0x223)](_0x144370(0x1db));}else await this['navigateSessionsInteractive'](_0x4f4483,_0x19c121,_0x28b21c);}}return 0x0;}[a59_0x34b1fc(0x6c)](_0x390a2b,_0x2023f1){const _0x1f379c=a59_0x34b1fc,_0x4e8435=[],_0x449908=new Map();let _0x21e2b9=Infinity,_0x3f3381=-Infinity;for(const _0xf24b5 of _0x390a2b){if(_0xf24b5[_0x1f379c(0x20a)]?.[_0x1f379c(0xc0)]){const _0xf947f=new Date(_0xf24b5[_0x1f379c(0x20a)][_0x1f379c(0xc0)])[_0x1f379c(0x11a)](),_0x486cb1=_0xf24b5[_0x1f379c(0x20a)][_0x1f379c(0x10a)]?new Date(_0xf24b5['lastAttempt'][_0x1f379c(0x10a)])[_0x1f379c(0x11a)]():Date['now'](),_0x200904=_0xf24b5[_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'(unknown)';!_0x449908[_0x1f379c(0x1a3)](_0x200904)&&_0x449908['set'](_0x200904,[]),_0x449908['get'](_0x200904)[_0x1f379c(0x1f9)]({'session':_0xf24b5,'startTime':_0xf947f,'endTime':_0x486cb1,'duration':_0x486cb1-_0xf947f}),_0x21e2b9=Math[_0x1f379c(0x105)](_0x21e2b9,_0xf947f),_0x3f3381=Math['max'](_0x3f3381,_0x486cb1);}}if(_0x449908[_0x1f379c(0x163)]===0x0)return _0x1f379c(0xee);const _0x37dbb0=process['stdout']['columns']||0x78,_0x1bb5a4=0x1e,_0x2da799=0x32,_0xb55a45=0x4,_0x13812b=Math[_0x1f379c(0x105)](_0x2da799,Math['max'](_0x1bb5a4,Math['floor'](_0x37dbb0*0.3))),_0x317d5d=_0x37dbb0-_0x13812b-TIMELINE_CONFIG[_0x1f379c(0x113)]-0x3-_0xb55a45,_0x1813d0=_0x3f3381-_0x21e2b9,_0x390538=_0x1813d0/_0x13812b,_0x1c6145=renderTimeAxis({'startTime':_0x21e2b9,'endTime':_0x3f3381,'durationMs':_0x1813d0,'msPerChar':_0x390538},_0x13812b),_0x4dff19=[];for(const _0x271db1 of _0x449908[_0x1f379c(0x19a)]()){_0x4dff19[_0x1f379c(0x1f9)](..._0x271db1);}_0x4dff19[_0x1f379c(0x65)]((_0x179ae2,_0x48fff6)=>_0x48fff6[_0x1f379c(0x8c)]-_0x179ae2[_0x1f379c(0x8c)]);const _0x2bc6bb=new Date(_0x21e2b9),_0x5749cb=formatDate(_0x2bc6bb),_0x589788=_0xb55a45+TIMELINE_CONFIG[_0x1f379c(0x120)]+TIMELINE_CONFIG['ICON_SPACING']+_0x317d5d,_0x549c0c='\x20'[_0x1f379c(0xaf)](_0x589788-_0x5749cb[_0x1f379c(0x217)]),_0x3c8d30=_0x549c0c+a59_0x564dd3['dim'](_0x5749cb)+'\x20'+_0x1c6145;_0x4e8435[_0x1f379c(0x1f9)](_0x3c8d30);const _0x296ed0=0x16;let _0x56eccc=0x0;for(const _0x498c37 of _0x4dff19){const _0x14f299=_0x498c37[_0x1f379c(0x167)][_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'?',_0x2b65e7=Math[_0x1f379c(0x105)](stringWidth(_0x14f299),_0x296ed0);_0x56eccc=Math[_0x1f379c(0xc3)](_0x56eccc,_0x2b65e7);}for(const _0x271d9a of _0x4dff19){const {session:_0x2670a8,startTime:_0x1e01c2,endTime:_0x1a0c42,duration:_0x3b009a}=_0x271d9a,_0x34b941=_0x2670a8[_0x1f379c(0xc6)]?.['id'],_0xf53554=_0x2670a8['id'],_0x4909ce=_0x2670a8[_0x1f379c(0xc6)]?.[_0x1f379c(0x7b)]||'?',_0x2504fc=_0x2670a8['workflow']?.[_0x1f379c(0x7b)]||'?';let _0x19021b,_0x2ce79d;if(_0x2670a8[_0x1f379c(0x20a)]){const _0x4ccd80=_0x2670a8[_0x1f379c(0x20a)];!_0x4ccd80[_0x1f379c(0xbc)]?(_0x19021b=_0x4ccd80[_0x1f379c(0xa0)]?'🛑':'🔄',_0x2ce79d=_0x4ccd80[_0x1f379c(0xa0)]?a59_0x564dd3['yellow']:a59_0x564dd3[_0x1f379c(0x1f6)]):(_0x19021b=_0x4ccd80['success']?'✅':'❌',_0x2ce79d=_0x4ccd80[_0x1f379c(0x1b7)]?a59_0x564dd3[_0x1f379c(0xcd)]:a59_0x564dd3[_0x1f379c(0x1a4)]);}else _0x19021b='⏳',_0x2ce79d=a59_0x564dd3['dim'];const _0x24d540='#'+_0xf53554,_0x3d80dd=_0x34b941?hyperlink(_0x24d540,getWorkflowSessionUrl(_0x2023f1,_0x34b941,_0xf53554)):_0x24d540;let _0x26f24e=_0x4909ce;stringWidth(_0x4909ce)>_0x296ed0&&(_0x26f24e=_0x4909ce[_0x1f379c(0x156)](0x0,_0x296ed0-0x1)+'…');const _0x208ecd=a59_0x564dd3[_0x1f379c(0x6f)](_0x26f24e),_0x2ea3b0=stringWidth(_0x26f24e),_0x106d8f='\x20'[_0x1f379c(0xaf)](_0x56eccc-stringWidth(_0x26f24e)+0x2),_0x239a03='('+formatElapsed(_0x3b009a)+')',_0x4bdec0=stringWidth(_0x239a03),_0x38b3a7=stringWidth(_0x24d540),_0x5831ac=_0x38b3a7+0x1+_0x2ea3b0+_0x106d8f[_0x1f379c(0x217)],_0x195547=_0x317d5d-_0x5831ac-_0x4bdec0-0x1-0x8;let _0x1256c9=_0x2504fc;stringWidth(_0x1256c9)>_0x195547&&(_0x1256c9=_0x1256c9[_0x1f379c(0x156)](0x0,_0x195547-0x1)+'…');const _0x186a40=_0x3d80dd+'\x20'+_0x208ecd+_0x106d8f+_0x1256c9,_0x471cf=stringWidth(_0x186a40),_0x4089ed=_0x317d5d-_0x471cf-_0x4bdec0,_0x51ce10=_0x186a40+'\x20'[_0x1f379c(0xaf)](Math['max'](0x1,_0x4089ed))+a59_0x564dd3['dim'](_0x239a03),_0xaaa0ae=Math[_0x1f379c(0x9e)]((_0x1e01c2-_0x21e2b9)/_0x390538),_0x84322=Math[_0x1f379c(0x9e)]((_0x1a0c42-_0x21e2b9)/_0x390538),_0x3fe5ed=Math['max'](_0xaaa0ae+0x1,_0x84322),_0x2f25af=new Array(_0x13812b)[_0x1f379c(0x174)]('\x20');for(let _0x2c1c6=_0xaaa0ae;_0x2c1c6<Math[_0x1f379c(0x105)](_0x3fe5ed,_0x13812b);_0x2c1c6++){_0x2f25af[_0x2c1c6]='─';}const _0x2b33e3=_0x2f25af[_0x1f379c(0xb1)](_0x5cb686=>_0x5cb686==='\x20'?'\x20':_0x2ce79d(_0x5cb686))['join']('');_0x4e8435[_0x1f379c(0x1f9)](_0x19021b+'\x20'+_0x51ce10+'│'+_0x2b33e3+'│');}return _0x4e8435[_0x1f379c(0xf7)]('\x0a');}async[a59_0x34b1fc(0x78)](_0x42ec7f,_0x214a0a,_0xcd7960){const _0x40e030=a59_0x34b1fc,{options:_0x40a448,tdx:_0x338441}=_0x214a0a,_0x525064=_0x40a448[_0x40e030(0xc7)],{timelineRows:_0x267c16,timeAxisHeader:_0x381e97}=this[_0x40e030(0xca)](_0x42ec7f,_0x525064),_0x252ed6=_0x267c16['filter'](_0x4a70d5=>_0x4a70d5['attemptId']);if(_0x252ed6[_0x40e030(0x217)]===0x0){const _0xeb7f97=this[_0x40e030(0x6c)](_0x42ec7f,_0x525064);console[_0x40e030(0x223)](_0xeb7f97);!_0xcd7960&&(console[_0x40e030(0x23a)](''),console[_0x40e030(0x23a)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0x1bb))),console[_0x40e030(0x23a)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0x1fe))+'or'+a59_0x564dd3[_0x40e030(0x6f)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x381e97&&console[_0x40e030(0x223)](_0x381e97);const _0x2f1414=_0x267c16[_0x40e030(0x1f1)](_0x1aaa9a=>_0x1aaa9a[_0x40e030(0x1e9)])[_0x40e030(0xb1)](_0xb7f413=>({'title':_0xb7f413[_0x40e030(0x12c)],'value':_0xb7f413[_0x40e030(0x1e9)]})),_0x27aa4f=process[_0x40e030(0x122)]['rows']||0x3c,_0x1b11ea=Math[_0x40e030(0xc3)](0x28,Math[_0x40e030(0x9e)](_0x27aa4f*0x2/0x3)),_0x2a59e4=await a59_0x17b23b({'type':'autocomplete','name':_0x40e030(0x1e9),'message':_0x40e030(0x98),'choices':_0x2f1414,'initial':-0x1,'limit':_0x1b11ea,'clearFirst':!![],'fallback':{'title':_0x40e030(0x21c),'value':null},'suggest':(_0x402a87,_0x22f170)=>{const _0x5a2300=_0x40e030;if(!_0x402a87)return Promise[_0x5a2300(0xbd)](_0x22f170);const _0x16d473=_0x22f170[_0x5a2300(0x1f1)](_0x4ad69a=>{const _0x2a32ad=_0x5a2300,_0x10260c=_0x4ad69a;return _0x10260c[_0x2a32ad(0xce)][_0x2a32ad(0x1b5)]()['includes'](_0x402a87[_0x2a32ad(0x1b5)]());});return Promise['resolve'](_0x16d473);}}),_0x49e532=()=>{const _0x4cfcd5=_0x40e030;process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc)),process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc)),process[_0x4cfcd5(0x122)][_0x4cfcd5(0x22f)](_0x4cfcd5(0xdc));},_0x41f724=_0x2a59e4&&_0x2a59e4[_0x40e030(0x1e9)]&&_0x2a59e4[_0x40e030(0x1e9)]!==null&&_0x2a59e4[_0x40e030(0x1e9)][_0x40e030(0x152)]()!=='';if(!_0x41f724){_0x49e532(),console[_0x40e030(0x223)](a59_0x564dd3[_0x40e030(0x6f)](_0x40e030(0xf4)));return;}_0x49e532();const _0x172c28=_0x42ec7f[_0x40e030(0x1b9)](_0x44d8c4=>_0x44d8c4[_0x40e030(0x20a)]?.['id']===_0x2a59e4[_0x40e030(0x1e9)]);if(_0x172c28){const _0x473156=_0x172c28['project']?.[_0x40e030(0x7b)]||'?',_0x19078b=_0x172c28[_0x40e030(0x14b)]?.[_0x40e030(0x7b)]||'?';console['log'](_0x40e030(0x124)+a59_0x564dd3[_0x40e030(0x6f)](_0x473156)+',\x20Workflow:\x20'+a59_0x564dd3[_0x40e030(0x6f)](_0x19078b));}const _0x32bdc7=new WorkflowTimelineCommand();await _0x32bdc7[_0x40e030(0x203)]({'args':[],'options':{..._0x40a448,'attemptId':_0x2a59e4[_0x40e030(0x1e9)]},'tdx':_0x338441});}[a59_0x34b1fc(0xca)](_0x539e8b,_0x392b83){const _0x141794=a59_0x34b1fc,_0xa6c6ae=new Map();for(const _0x9ee649 of _0x539e8b){_0x9ee649['id']&&_0x9ee649['lastAttempt']?.['id']&&_0xa6c6ae[_0x141794(0x20e)](_0x9ee649['id'],_0x9ee649[_0x141794(0x20a)]['id']);}const _0x3e1764=[];let _0x2fec4f='';const _0x55ec56=this[_0x141794(0x6c)](_0x539e8b,_0x392b83),_0x3d0508=_0x55ec56['split']('\x0a');for(const _0xef2a15 of _0x3d0508){if(_0xef2a15[_0x141794(0xbf)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0xef2a15[_0x141794(0x1c4)](/^\s+\d{4}-\d{2}-\d{2}/))_0x2fec4f=_0xef2a15;else{if(_0xef2a15['match'](/^[✅❌🔄🛑⏳]/)){const _0x118afe=_0xef2a15[_0x141794(0x1c4)](/#(\d+)/),_0x344f74=_0x118afe?_0x118afe[0x1]:null,_0x3a9f42=_0x344f74?_0xa6c6ae[_0x141794(0x209)](_0x344f74)||null:null,_0x4496d6=_0x539e8b[_0x141794(0x1b9)](_0x3356b0=>_0x3356b0['id']===_0x344f74),_0x409dd3=_0x4496d6?.[_0x141794(0xc6)]?.[_0x141794(0x7b)]||'';_0x3e1764['push']({'displayLine':_0xef2a15,'attemptId':_0x3a9f42,'projectName':_0x409dd3});}}}return{'timelineRows':_0x3e1764,'timeAxisHeader':_0x2fec4f};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a59_0x34b1fc(0x201);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x241);async[a59_0x34b1fc(0x203)](_0x4d8a05){const _0xf76d6=a59_0x34b1fc,{options:_0x1c5c46,args:_0x4c4b59,tdx:_0x68ad69}=_0x4d8a05,_0x3b7216=this[_0xf76d6(0x194)](_0x4c4b59,_0x1c5c46);if(!_0x3b7216)return 0x1;const {projectName:_0x5c75fa,workflowName:_0x42ba2c}=_0x3b7216,_0x56881f=_0x1c5c46[_0xf76d6(0xb6)];if(_0x1c5c46['verbose']){if(_0x5c75fa&&_0x42ba2c)console[_0xf76d6(0x23a)](_0xf76d6(0x1fd)+_0x5c75fa+'.'+_0x42ba2c);else _0x5c75fa&&console[_0xf76d6(0x23a)](_0xf76d6(0x123)+_0x5c75fa);_0x56881f&&console['error']('Include\x20retried:\x20yes');}const _0x34218f=await withSpinner(_0xf76d6(0x71),()=>_0x68ad69[_0xf76d6(0x14b)][_0xf76d6(0x157)]({'projectName':_0x5c75fa,'workflowName':_0x42ba2c,'includeRetried':_0x56881f,'limit':_0x1c5c46[_0xf76d6(0x7d)]}),{'verbose':_0x1c5c46['verbose']}),_0x40f8d4=_0x34218f[_0xf76d6(0x138)],_0x182995=_0x1c5c46[_0xf76d6(0x7d)]||0x64,_0x1426fb=_0x40f8d4[_0xf76d6(0x217)]>=_0x182995?a59_0x564dd3[_0xf76d6(0x6f)](_0xf76d6(0x207)):'';console[_0xf76d6(0x23a)](_0xf76d6(0x24a)+_0x40f8d4[_0xf76d6(0x217)]+_0xf76d6(0x1f0)+(_0x40f8d4[_0xf76d6(0x217)]!==0x1?'s':'')+_0x1426fb);if(_0x1c5c46[_0xf76d6(0x197)]==='json'||_0x1c5c46[_0xf76d6(0x197)]===_0xf76d6(0x77)||_0x1c5c46[_0xf76d6(0x197)]===_0xf76d6(0x13f))await handleSDKOutput(_0x40f8d4,_0x1c5c46);else{if(_0x40f8d4['length']===0x0){if(_0x5c75fa&&_0x42ba2c)console[_0xf76d6(0x223)](_0xf76d6(0x67)+_0x5c75fa+'.'+_0x42ba2c);else _0x5c75fa?console[_0xf76d6(0x223)](_0xf76d6(0x72)+_0x5c75fa):console[_0xf76d6(0x223)](_0xf76d6(0x1e0));}else{const _0x152614=_0x1c5c46['site'],_0x131302=_0x40f8d4['map'](_0x82a3c5=>{const _0x709364=_0xf76d6,_0xafadec=a59_0x564dd3[_0x709364(0x6f)]('#'+_0x82a3c5['id']),_0x5790d4=_0x82a3c5['project']?.['id'],_0x2b6716=_0x82a3c5[_0x709364(0x121)]||_0x82a3c5['sessionId'],_0x45781a=_0x5790d4&&_0x2b6716?hyperlink(_0xafadec,getWorkflowAttemptUrl(_0x152614,_0x5790d4,_0x2b6716,_0x82a3c5['id'])):_0xafadec,{icon:_0x3c6aca,text:_0x568131}=getAttemptStatusDisplay(_0x82a3c5),_0x4f0d72=(_0x82a3c5[_0x709364(0xc6)]?.[_0x709364(0x7b)]||'?')+'.'+(_0x82a3c5['workflow']?.[_0x709364(0x7b)]||'?'),_0x267d9c=_0x82a3c5[_0x709364(0xad)]?a59_0x564dd3[_0x709364(0x6f)](_0x82a3c5[_0x709364(0xad)]):'';return(_0x45781a+'\x20'+_0x3c6aca+(_0x568131?'\x20'+_0x568131:'')+'\x20'+_0x4f0d72+'\x20'+_0x267d9c)[_0x709364(0x85)]();});await writeOutput(_0x131302[_0xf76d6(0xf7)]('\x0a'),_0x1c5c46['output'],_0xf76d6(0xab));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1b2);[a59_0x34b1fc(0x229)]='Show\x20specific\x20attempt\x20details';async[a59_0x34b1fc(0x203)](_0x5e84e2){const _0x13995=a59_0x34b1fc,{options:_0x3605a0,args:_0x25dc09,tdx:_0x4c6777}=_0x5e84e2,_0x2e648e=_0x25dc09[0x0];if(!_0x2e648e)return console['error'](_0x13995(0xac)),0x1;_0x3605a0[_0x13995(0x1ab)]&&console[_0x13995(0x23a)](_0x13995(0x1fa)+_0x2e648e);const _0x288678=await withSpinner(_0x13995(0xf1),()=>_0x4c6777[_0x13995(0x14b)]['attempt'](_0x2e648e),{'verbose':_0x3605a0[_0x13995(0x1ab)]}),_0x38e718=_0x288678['data'];let _0x185798;!_0x38e718[_0x13995(0xbc)]?_0x185798=_0x38e718[_0x13995(0xa0)]?_0x13995(0x247):'running':_0x185798=_0x38e718[_0x13995(0x1b7)]?_0x13995(0x1b7):'error';let _0x4bc695;if(_0x38e718['createdAt']&&_0x38e718['finishedAt']){const _0x262a58=new Date(_0x38e718['createdAt'])[_0x13995(0x11a)](),_0x34b87d=new Date(_0x38e718[_0x13995(0x10a)])[_0x13995(0x11a)]();_0x4bc695=Math[_0x13995(0x18f)]((_0x34b87d-_0x262a58)/0x3e8);}const _0x197be5={'attempt_id':_0x38e718['id'],'status':_0x185798,..._0x38e718[_0x13995(0xd4)]!==undefined&&{'index':_0x38e718['index']},..._0x38e718[_0x13995(0xc6)]&&{'project':_0x38e718[_0x13995(0xc6)]['name']},..._0x38e718['workflow']&&{'workflow':_0x38e718['workflow'][_0x13995(0x7b)]},..._0x38e718[_0x13995(0x6b)]&&{'session_id':_0x38e718['sessionId']},..._0x38e718[_0x13995(0xad)]&&{'session_time':_0x38e718['sessionTime']},..._0x38e718[_0x13995(0x210)]&&{'retry_attempt':_0x38e718[_0x13995(0x210)]},..._0x4bc695!==undefined&&{'duration_sec':_0x4bc695},..._0x38e718[_0x13995(0xc0)]&&{'created_at':_0x38e718['createdAt']},..._0x38e718[_0x13995(0x10a)]&&{'finished_at':_0x38e718['finishedAt']},...Object[_0x13995(0x1d3)](_0x38e718['params'])[_0x13995(0x217)]>0x0&&{'params':_0x38e718[_0x13995(0xe5)]}};return await handleSingleObjectOutput(_0x197be5,_0x3605a0),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x17b);['description']=a59_0x34b1fc(0x1ed);async[a59_0x34b1fc(0x203)](_0x548d70){const _0x1f9f13=a59_0x34b1fc,{options:_0x44b1b4,args:_0x2e735e,tdx:_0x479ef5}=_0x548d70,_0x6e843f=_0x2e735e[0x0];if(!_0x6e843f)return console[_0x1f9f13(0x23a)](_0x1f9f13(0xac)),0x1;const _0x3aaa51=_0x44b1b4['includeSubtasks'];_0x44b1b4[_0x1f9f13(0x1ab)]&&(console[_0x1f9f13(0x23a)](_0x1f9f13(0x1fa)+_0x6e843f),_0x3aaa51&&console[_0x1f9f13(0x23a)](_0x1f9f13(0xd8)));const _0x566847=await withSpinner(_0x1f9f13(0xe9),()=>_0x479ef5[_0x1f9f13(0x14b)][_0x1f9f13(0x148)](_0x6e843f,_0x3aaa51||![]),{'verbose':_0x44b1b4[_0x1f9f13(0x1ab)]}),_0x5e793c=_0x566847[_0x1f9f13(0x138)];return console[_0x1f9f13(0x23a)](_0x1f9f13(0x24a)+_0x5e793c['length']+_0x1f9f13(0x155)+(_0x5e793c[_0x1f9f13(0x217)]!==0x1?'s':'')),await handleSDKOutput(_0x5e793c,_0x44b1b4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1f7);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x22b);async[a59_0x34b1fc(0x203)](_0x33cc9e){const _0xea33f8=a59_0x34b1fc,{options:_0x53f884,args:_0x41f5c4,tdx:_0x5ad3db}=_0x33cc9e,_0x2aa026=_0x41f5c4[0x0];let _0x2707cd=_0x41f5c4[0x1];if(!_0x2aa026)return console['error'](_0xea33f8(0xac)),0x1;_0x53f884[_0xea33f8(0x1ab)]&&(console[_0xea33f8(0x23a)](_0xea33f8(0x1fa)+_0x2aa026),_0x2707cd&&console[_0xea33f8(0x23a)](_0xea33f8(0x110)+_0x2707cd));const _0xe16e78=await withSpinner(_0xea33f8(0xfa),()=>_0x5ad3db[_0xea33f8(0x14b)]['logFiles'](_0x2aa026,_0x2707cd),{'verbose':_0x53f884[_0xea33f8(0x1ab)]}),_0x4cd257=_0xe16e78['data'];if(_0x4cd257[_0xea33f8(0x217)]===0x0)return console['error']('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x2707cd&&(_0x53f884[_0xea33f8(0x1e8)]||_0x53f884[_0xea33f8(0x197)]))return await handleSDKOutput(_0x4cd257,_0x53f884),0x0;if(!_0x2707cd){const _0x19cadd=_0x4cd257[_0xea33f8(0xb1)](_0x14ce8a=>({'title':_0x14ce8a[_0xea33f8(0x84)]+'\x20('+formatBytes(_0x14ce8a[_0xea33f8(0x13c)])+')','value':_0x14ce8a[_0xea33f8(0x84)]})),_0x2f8677=await a59_0x17b23b({'type':_0xea33f8(0x1fc),'name':_0xea33f8(0x8e),'message':_0xea33f8(0x94),'choices':_0x19cadd});if(!_0x2f8677['task'])return console[_0xea33f8(0x23a)](_0xea33f8(0xf4)),0x0;_0x2707cd=_0x2f8677[_0xea33f8(0x8e)];}const _0x4c08c4=await withSpinner(_0xea33f8(0x9b),()=>_0x5ad3db[_0xea33f8(0x14b)][_0xea33f8(0x9f)](_0x2aa026,_0x2707cd),{'verbose':_0x53f884[_0xea33f8(0x1ab)]}),_0x65c6dd=_0x4c08c4['data'];return _0x65c6dd?console[_0xea33f8(0x223)](_0x65c6dd):console[_0xea33f8(0x23a)](_0xea33f8(0x125)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1a2);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xf9);async['execute'](_0x3deba3){const _0x188131=a59_0x34b1fc,{options:_0x34fbbe,args:_0x323e64,tdx:_0x2d4601}=_0x3deba3,_0x12e27c=_0x323e64[0x0];if(!_0x12e27c)return console[_0x188131(0x23a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x303809=_0x34fbbe[_0x188131(0x97)];_0x34fbbe[_0x188131(0x1ab)]&&(console[_0x188131(0x23a)](_0x188131(0x1fa)+_0x12e27c),_0x303809&&console[_0x188131(0x23a)]('Reason:\x20'+_0x303809));if(!_0x34fbbe[_0x188131(0x100)]){if(!isInteractive())return console[_0x188131(0x23a)](a59_0x564dd3['red'](_0x188131(0x131)),_0x188131(0x246)),console['error'](a59_0x564dd3['dim'](_0x188131(0xbb))),0x1;const _0x34c365=await confirmKey(_0x188131(0x111)+_0x12e27c+'?');if(!_0x34c365)return console[_0x188131(0x23a)](a59_0x564dd3[_0x188131(0x204)]('Cancelled')),0x1;}const _0xed839d=await withSpinner(_0x188131(0x15c),()=>_0x2d4601['workflow'][_0x188131(0x21f)](_0x12e27c,_0x303809),{'verbose':_0x34fbbe['verbose']}),_0x2f0d21=_0xed839d['data'];return console[_0x188131(0x23a)]('✔\x20'+_0x2f0d21),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a59_0x34b1fc(0x240);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x220);async['execute'](_0x3c390e){const _0x9d8033=a59_0x34b1fc,{options:_0x3ee760,args:_0x71511d,tdx:_0x1b2846}=_0x3c390e,_0x14c49a=_0x71511d[0x0];if(!_0x14c49a)return console[_0x9d8033(0x23a)](_0x9d8033(0x21a)),console['error'](_0x9d8033(0x177)),0x1;let _0x487e1d=![],_0x4caed0=_0x14c49a;if(_0x14c49a[_0x9d8033(0xbf)](_0x9d8033(0x1ea)))_0x487e1d=!![],_0x4caed0=_0x14c49a[_0x9d8033(0x235)](0x8);else{if(_0x14c49a[_0x9d8033(0xbf)]('attempt:'))_0x487e1d=![],_0x4caed0=_0x14c49a[_0x9d8033(0x235)](0x8);else return console[_0x9d8033(0x23a)](_0x9d8033(0x1c1)),console[_0x9d8033(0x23a)](_0x9d8033(0x177)),0x1;}const _0x447435=_0x3ee760[_0x9d8033(0x17a)],_0x4691b5=_0x3ee760[_0x9d8033(0x89)],_0x22b124=_0x3ee760[_0x9d8033(0xe5)],_0x46ef42=_0x3ee760[_0x9d8033(0x81)];_0x3ee760[_0x9d8033(0x1ab)]&&(console[_0x9d8033(0x23a)]('Target:\x20'+(_0x487e1d?'session':_0x9d8033(0x22a))+'\x20'+_0x4caed0),_0x447435&&console[_0x9d8033(0x23a)](_0x9d8033(0x182)+_0x447435),_0x4691b5&&console[_0x9d8033(0x23a)](_0x9d8033(0x12f)+_0x4691b5),_0x22b124&&console[_0x9d8033(0x23a)]('Params:\x20'+_0x22b124),_0x46ef42&&console[_0x9d8033(0x23a)](_0x9d8033(0x70)));let _0x46c633;if(_0x22b124)try{if(_0x22b124[_0x9d8033(0xbf)]('@')){const _0xc53a77=await import('fs/promises'),_0x171957=_0x22b124[_0x9d8033(0x235)](0x1),_0xebe2c5=await _0xc53a77['readFile'](_0x171957,_0x9d8033(0x80));_0x46c633=JSON['parse'](_0xebe2c5);}else _0x46c633=JSON['parse'](_0x22b124);}catch{return console[_0x9d8033(0x23a)](_0x9d8033(0x227)),0x1;}if(!_0x3ee760[_0x9d8033(0x100)]){if(!isInteractive())return console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x1a4)](_0x9d8033(0x131)),_0x9d8033(0x246)),console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x6f)](_0x9d8033(0xbb))),0x1;const _0x11f3f9=await confirmKey(_0x9d8033(0x132)+(_0x487e1d?_0x9d8033(0x167):_0x9d8033(0x22a))+'\x20'+_0x4caed0+'?');if(!_0x11f3f9)return console[_0x9d8033(0x23a)](a59_0x564dd3[_0x9d8033(0x204)]('Cancelled')),0x1;}let _0x4dae71;_0x487e1d?_0x4dae71=await withSpinner(_0x9d8033(0x202),()=>_0x1b2846[_0x9d8033(0x14b)]['retrySession'](_0x4caed0,{'fromTask':_0x447435,'retryParams':_0x46c633}),{'verbose':_0x3ee760[_0x9d8033(0x1ab)]}):_0x4dae71=await withSpinner('Retrying\x20attempt...',()=>_0x1b2846[_0x9d8033(0x14b)][_0x9d8033(0x8d)](_0x4caed0,{'resumeFrom':_0x4691b5,'retryParams':_0x46c633,'force':_0x46ef42}),{'verbose':_0x3ee760[_0x9d8033(0x1ab)]});const _0x5b5a12=_0x4dae71[_0x9d8033(0x138)];return console['error']('✔\x20Retry\x20started'),console[_0x9d8033(0x23a)](_0x9d8033(0x1f3)+_0x5b5a12[_0x9d8033(0x1e9)]),console[_0x9d8033(0x23a)](_0x9d8033(0x13d)+_0x5b5a12['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0xdd);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1da);async[a59_0x34b1fc(0x203)](_0x3ea294){const _0x41d07d=a59_0x34b1fc,{options:_0x2669d4,args:_0x426c6f,tdx:_0x3fcd4f}=_0x3ea294;let _0x276794=_0x426c6f[0x0];if(!_0x276794){const _0x2c4072=this['resolveProject']([],_0x2669d4),_0x1f13af=await withSpinner(_0x41d07d(0x143),()=>_0x3fcd4f[_0x41d07d(0x14b)][_0x41d07d(0x1d0)](_0x2c4072,{'limit':_0x2669d4['limit']}),{'verbose':_0x2669d4[_0x41d07d(0x1ab)]}),_0x4de514=_0x1f13af[_0x41d07d(0x138)];if(_0x4de514['length']===0x0)return console[_0x41d07d(0x23a)](_0x41d07d(0x92)),!_0x2c4072&&console['error'](a59_0x564dd3['dim'](_0x41d07d(0x185))),0x1;const _0x19d9ea=_0x4de514['map'](_0x141ad5=>({'title':_0x141ad5[_0x41d07d(0xc6)]?.[_0x41d07d(0x7b)]+'.'+_0x141ad5[_0x41d07d(0x7b)],'value':_0x141ad5['project']?.[_0x41d07d(0x7b)]+'.'+_0x141ad5[_0x41d07d(0x7b)],'description':_0x141ad5[_0x41d07d(0x22e)]?_0x41d07d(0x214)+_0x141ad5['revision']:undefined})),_0x990561=await a59_0x17b23b({'type':_0x41d07d(0x1fc),'name':_0x41d07d(0x14b),'message':_0x41d07d(0xe3),'choices':_0x19d9ea});if(!_0x990561[_0x41d07d(0x14b)])return 0x1;_0x276794=_0x990561[_0x41d07d(0x14b)];}if(!_0x276794[_0x41d07d(0x228)]('.')){const _0x2e6f86=this[_0x41d07d(0xd0)]([],_0x2669d4);if(_0x2e6f86)_0x276794=_0x2e6f86+'.'+_0x276794;else return console[_0x41d07d(0x23a)](a59_0x564dd3[_0x41d07d(0x1a4)]('Error:'),_0x41d07d(0x76)),console[_0x41d07d(0x23a)](a59_0x564dd3[_0x41d07d(0x6f)](_0x41d07d(0x185))),0x1;}const _0x36ac73=_0x2669d4[_0x41d07d(0x9c)],_0x4894ff=_0x2669d4[_0x41d07d(0xad)],_0x362904={};if(_0x36ac73&&Array[_0x41d07d(0x1e7)](_0x36ac73))for(const _0x54f112 of _0x36ac73){const _0x289621=_0x54f112['indexOf']('=');if(_0x289621===-0x1)return console[_0x41d07d(0x23a)](_0x41d07d(0x130)+_0x54f112),console[_0x41d07d(0x23a)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x584452=_0x54f112[_0x41d07d(0x235)](0x0,_0x289621),_0xa266c6=_0x54f112[_0x41d07d(0x235)](_0x289621+0x1);try{_0x362904[_0x584452]=JSON['parse'](_0xa266c6);}catch{_0x362904[_0x584452]=_0xa266c6;}}_0x2669d4[_0x41d07d(0x1ab)]&&(console[_0x41d07d(0x23a)](_0x41d07d(0x219)+_0x276794),Object['keys'](_0x362904)[_0x41d07d(0x217)]>0x0&&console['error'](_0x41d07d(0xe8)+JSON[_0x41d07d(0x237)](_0x362904)),_0x4894ff&&console[_0x41d07d(0x23a)](_0x41d07d(0x225)+_0x4894ff));if(_0x2669d4[_0x41d07d(0xa6)])return await this[_0x41d07d(0x1d5)](_0x3ea294,_0x276794,_0x362904,_0x4894ff);const _0x589d49=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3fcd4f['workflow'][_0x41d07d(0xba)](_0x276794,_0x362904,{'sessionTime':_0x4894ff}),{'verbose':_0x2669d4[_0x41d07d(0x1ab)]}),_0x2ec36e=_0x589d49[_0x41d07d(0x138)];console[_0x41d07d(0x23a)](_0x41d07d(0xeb)),console[_0x41d07d(0x23a)](_0x41d07d(0x15a)+_0x2ec36e['id']),console[_0x41d07d(0x23a)](_0x41d07d(0x13d)+_0x2ec36e['sessionId']),console[_0x41d07d(0x23a)](_0x41d07d(0xd5)+_0x2ec36e[_0x41d07d(0xc6)]?.[_0x41d07d(0x7b)]),console[_0x41d07d(0x23a)](_0x41d07d(0x134)+_0x2ec36e['workflow']?.[_0x41d07d(0x7b)]);if(_0x2ec36e[_0x41d07d(0xc6)]?.['id']&&_0x2ec36e[_0x41d07d(0x6b)]&&_0x2ec36e['id']){const _0x58bcce=_0x2669d4['site'],_0x33df4e=getConsoleUrl(_0x58bcce,_0x41d07d(0x1cd)+_0x2ec36e[_0x41d07d(0xc6)]['id']+_0x41d07d(0xa3)+_0x2ec36e[_0x41d07d(0x6b)]+_0x41d07d(0x147)+_0x2ec36e['id']);console[_0x41d07d(0x23a)]('\x20\x20Console:\x20'+a59_0x564dd3[_0x41d07d(0x1ae)](_0x33df4e));}return 0x0;}async[a59_0x34b1fc(0x1d5)](_0x45bb18,_0x4af006,_0x128c39,_0x451411){const _0x5072da=a59_0x34b1fc,{options:_0x35f06f,tdx:_0x187efc}=_0x45bb18,_0x49be30=await withSpinner('Fetching\x20workflow\x20'+_0x4af006+_0x5072da(0x104),()=>_0x187efc[_0x5072da(0x14b)][_0x5072da(0x1bc)](_0x4af006),{'verbose':_0x35f06f[_0x5072da(0x1ab)]}),_0x41a223=_0x49be30[_0x5072da(0x138)],_0x383807=_0x451411??new Date()[_0x5072da(0x13a)]();console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x1de)),_0x4af006),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x112)),_0x383807),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x73)),JSON[_0x5072da(0x237)](_0x128c39)),console[_0x5072da(0x223)](''),console['log'](a59_0x564dd3[_0x5072da(0x171)](_0x5072da(0x19e)));const _0x3029a7=parseTaskGraph(_0x41a223[_0x5072da(0x200)]??null);if(_0x3029a7[_0x5072da(0x217)]===0x0)console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x6f)](_0x5072da(0x23c)));else for(const _0x16f5d0 of formatTaskGraph(_0x3029a7)){console[_0x5072da(0x223)](_0x16f5d0);}const _0x577ab8=summarizeTaskGraph(_0x3029a7),_0x52f1c1=formatWarningSummary(_0x577ab8);return _0x52f1c1&&(console[_0x5072da(0x223)](''),console['log'](a59_0x564dd3[_0x5072da(0x204)](_0x52f1c1))),console[_0x5072da(0x223)](a59_0x564dd3[_0x5072da(0x204)](_0x5072da(0x82))),0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a59_0x34b1fc(0xdb);[a59_0x34b1fc(0x229)]='Download\x20workflow\x20project\x20from\x20Treasure\x20AI';async[a59_0x34b1fc(0x203)](_0x1505bd){const _0x1c4622=a59_0x34b1fc,{options:_0x4c4ab3,args:_0x426670,tdx:_0x18e28d}=_0x1505bd,_0x13d324=_0x426670[0x0],_0xb9205f=_0x426670[0x1]||'.';if(!_0x13d324)return console[_0x1c4622(0x23a)](_0x1c4622(0x129)),console[_0x1c4622(0x23a)](_0x1c4622(0x19c)),0x1;const _0x5c4ace=_0x4c4ab3[_0x1c4622(0x22e)];_0x4c4ab3[_0x1c4622(0x1ab)]&&(console[_0x1c4622(0x23a)](_0x1c4622(0x124)+_0x13d324),console[_0x1c4622(0x23a)]('Output\x20directory:\x20'+_0xb9205f),_0x5c4ace&&console[_0x1c4622(0x23a)]('Revision:\x20'+_0x5c4ace));const _0x35dd2d=await withSpinner(_0x1c4622(0xa8)+_0x13d324+_0x1c4622(0x104),()=>_0x18e28d[_0x1c4622(0x14b)][_0x1c4622(0x239)](_0x13d324,_0xb9205f,{'revision':_0x5c4ace}),{'verbose':_0x4c4ab3[_0x1c4622(0x1ab)]}),_0x467f90=_0x35dd2d['data'];return console['error'](_0x1c4622(0x1eb)+_0x467f90['projectName']),console[_0x1c4622(0x23a)]('\x20\x20Revision:\x20'+_0x467f90[_0x1c4622(0x22e)]),console['error'](_0x1c4622(0x118)+_0x467f90['filesExtracted']),console[_0x1c4622(0x23a)]('\x20\x20Location:\x20'+_0xb9205f+'/'+_0x467f90[_0x1c4622(0x179)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x205);[a59_0x34b1fc(0x229)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20AI\x20(digdag-style)';async[a59_0x34b1fc(0x203)](_0x1aca34){const _0x12c1bc=a59_0x34b1fc,{options:_0x44bd05,args:_0x3db353,tdx:_0x21f24e}=_0x1aca34;let _0x3f8918='.',_0x1131fe=_0x44bd05[_0x12c1bc(0x7b)];if(_0x3db353[0x0]){const {promises:_0x234f36}=await import('fs');try{const _0x27265d=await _0x234f36[_0x12c1bc(0x14c)](_0x3db353[0x0]);if(_0x27265d[_0x12c1bc(0x1d2)]())_0x3f8918=_0x3db353[0x0];else return console['error']('Error:\x20'+_0x3db353[0x0]+_0x12c1bc(0x221)),0x1;}catch{_0x1131fe=_0x3db353[0x0],_0x3f8918='.';}}const _0x5b155b=_0x44bd05[_0x12c1bc(0x22e)],_0x3fdf8e=_0x44bd05['skipValidation'];_0x44bd05[_0x12c1bc(0x1ab)]&&(console['error']('Project\x20directory:\x20'+_0x3f8918),_0x1131fe&&console['error'](_0x12c1bc(0x21d)+_0x1131fe),_0x5b155b&&console[_0x12c1bc(0x23a)](_0x12c1bc(0x1a9)+_0x5b155b),_0x3fdf8e&&console[_0x12c1bc(0x23a)](_0x12c1bc(0x149)));const _0x45b03e=await withSpinner(_0x12c1bc(0x170),()=>_0x21f24e[_0x12c1bc(0x14b)][_0x12c1bc(0x1f9)](_0x3f8918,{'projectName':_0x1131fe,'revision':_0x5b155b,'skipValidation':_0x3fdf8e}),{'verbose':_0x44bd05['verbose']}),_0x3c7832=_0x45b03e['data'];return console[_0x12c1bc(0x23a)](_0x12c1bc(0x230)+_0x3c7832['projectName']),console[_0x12c1bc(0x23a)](_0x12c1bc(0x245)+_0x3c7832[_0x12c1bc(0x162)]),console[_0x12c1bc(0x23a)]('\x20\x20Revision:\x20'+_0x3c7832[_0x12c1bc(0x22e)]),await this[_0x12c1bc(0xe2)](_0x21f24e,_0x3c7832[_0x12c1bc(0x179)],_0x44bd05[_0x12c1bc(0xc7)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16b);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xed);async[a59_0x34b1fc(0x203)](_0x2371fb){const _0x511d3e=a59_0x34b1fc,{options:_0x443907,args:_0x17aaab,tdx:_0x5c4ba8}=_0x2371fb,_0x1e986f=_0x17aaab[0x0],_0x65d38=_0x17aaab[0x1];if(!_0x1e986f)return console[_0x511d3e(0x23a)](a59_0x564dd3['red'](_0x511d3e(0x168)),_0x511d3e(0x1ac)),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0x193))),0x1;const _0x41b16d=_0x443907[_0x511d3e(0x22e)];_0x443907['verbose']&&(console[_0x511d3e(0x23a)](_0x511d3e(0x124)+_0x1e986f),_0x65d38&&console[_0x511d3e(0x23a)](_0x511d3e(0x1bd)+_0x65d38),_0x41b16d&&console[_0x511d3e(0x23a)](_0x511d3e(0x1a9)+_0x41b16d),_0x443907[_0x511d3e(0xa6)]&&console[_0x511d3e(0x23a)](_0x511d3e(0x1d1)));const _0x46895c=await withSpinner(_0x511d3e(0x151)+_0x1e986f+_0x511d3e(0x104),()=>_0x5c4ba8[_0x511d3e(0x14b)]['pullProject'](_0x1e986f,{'targetDir':_0x65d38,'revision':_0x41b16d}),{'verbose':_0x443907[_0x511d3e(0x1ab)]}),_0x21990b=_0x46895c[_0x511d3e(0x138)];_0x21990b[_0x511d3e(0x1ce)]?console['error'](_0x511d3e(0x19b)+_0x21990b[_0x511d3e(0x179)]):console[_0x511d3e(0x23a)](_0x511d3e(0x20f)+_0x21990b[_0x511d3e(0x179)]);console['error'](_0x511d3e(0x189)+_0x21990b[_0x511d3e(0x22e)]),console[_0x511d3e(0x23a)](_0x511d3e(0x102)+(a59_0x156221['relative'](process[_0x511d3e(0x154)](),_0x21990b['targetDir'])||'.')),console[_0x511d3e(0x23a)](_0x511d3e(0x146)+a59_0x564dd3[_0x511d3e(0xcd)]('+'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0xb2)]+_0x511d3e(0xc2))+',\x20'+(a59_0x564dd3[_0x511d3e(0x204)]('~'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0xa7)]+_0x511d3e(0x232))+',\x20')+(a59_0x564dd3[_0x511d3e(0x1a4)]('-'+_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0x173)]+_0x511d3e(0x1a7))+',\x20')+(''+a59_0x564dd3[_0x511d3e(0x6f)](_0x21990b[_0x511d3e(0x1f8)][_0x511d3e(0x144)]+_0x511d3e(0xa5))));for(const _0x49c5cb of _0x21990b['changes']){_0x49c5cb[_0x511d3e(0x14a)]===_0x511d3e(0xa7)&&_0x49c5cb[_0x511d3e(0x7e)]&&(console['error']('\x0a'+a59_0x564dd3[_0x511d3e(0x1ae)](_0x511d3e(0xb8)+_0x49c5cb[_0x511d3e(0x11f)])),console['error'](_0x49c5cb['diff']));}if(!_0x21990b['hasChanges'])return saveSessionContext({'workflow_project':_0x21990b[_0x511d3e(0x179)]},_0x443907[_0x511d3e(0x167)]),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0xcd)](_0x511d3e(0xe1))),console[_0x511d3e(0x23a)](a59_0x564dd3['dim'](_0x511d3e(0xd1)+_0x21990b[_0x511d3e(0x179)])),0x0;if(_0x443907['dryRun'])return console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x204)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x443907['yes']){if(!isInteractive())return console[_0x511d3e(0x23a)](a59_0x564dd3['red'](_0x511d3e(0x131)),_0x511d3e(0x246)),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12aecd=await confirmKey(_0x511d3e(0x176));if(!_0x12aecd)return console[_0x511d3e(0x23a)](a59_0x564dd3['yellow'](_0x511d3e(0xf4)),_0x511d3e(0x234)),0x1;}await withSpinner(_0x511d3e(0x215),()=>_0x5c4ba8[_0x511d3e(0x14b)][_0x511d3e(0x172)](_0x21990b,{'revision':_0x41b16d}),{'verbose':_0x443907[_0x511d3e(0x1ab)]}),saveSessionContext({'workflow_project':_0x21990b['projectName']},_0x443907['session']),console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0xcd)]('✔\x20Pull\x20complete'));const _0x23ecdf=a59_0x156221[_0x511d3e(0x66)](process['cwd'](),_0x21990b[_0x511d3e(0xa4)])||'.';return console[_0x511d3e(0x23a)](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0x196)+_0x23ecdf)),console['error'](a59_0x564dd3[_0x511d3e(0x6f)](_0x511d3e(0xd1)+_0x21990b['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16a);['description']=a59_0x34b1fc(0x17e);async['execute'](_0x344b01){const _0x48beb3=a59_0x34b1fc,{options:_0x25a3be,args:_0x30127a,tdx:_0x5c814f}=_0x344b01,_0x12b29e=this['resolveProjectDir'](_0x30127a,_0x25a3be),_0x391d6b=_0x25a3be,{revision:_0x6faee8,skipValidation:_0x2e47bc,backfill:_0x59b05d}=_0x391d6b,_0x3ca0f9=_0x59b05d===undefined?undefined:!_0x59b05d;_0x25a3be['verbose']&&(_0x12b29e&&console[_0x48beb3(0x23a)](_0x48beb3(0x1bf)+_0x12b29e),_0x6faee8&&console[_0x48beb3(0x23a)](_0x48beb3(0x1a9)+_0x6faee8),_0x25a3be[_0x48beb3(0xa6)]&&console[_0x48beb3(0x23a)](_0x48beb3(0x1d1)),_0x2e47bc&&console[_0x48beb3(0x23a)](_0x48beb3(0x149)),_0x59b05d&&console['error'](_0x48beb3(0x236)));let _0xb4f166;try{_0xb4f166=await withSpinner(_0x48beb3(0x150),()=>_0x5c814f['workflow'][_0x48beb3(0x1ec)]({'sourceDir':_0x12b29e,'revision':_0x6faee8,'skipValidation':_0x2e47bc,'skipSchedule':_0x3ca0f9}),{'verbose':_0x25a3be[_0x48beb3(0x1ab)]});}catch(_0x5674b4){if(_0x5674b4 instanceof Error&&_0x5674b4['message'][_0x48beb3(0x228)](_0x48beb3(0xe6)))return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x1a4)](_0x48beb3(0x168)),_0x48beb3(0xea)),_0x25a3be[_0x48beb3(0x20b)]?console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0x14f)+_0x25a3be[_0x48beb3(0x20b)]+_0x48beb3(0xf8)+_0x25a3be[_0x48beb3(0x20b)]+'\x27')):console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0x133))),0x1;throw _0x5674b4;}const _0x350cab=_0xb4f166['data'];console['error'](_0x48beb3(0x109)+_0x350cab['projectName']),console[_0x48beb3(0x23a)](_0x48beb3(0xa9)+_0x350cab['sourceDir']),console[_0x48beb3(0x23a)]('\x20\x20Revision:\x20'+_0x350cab[_0x48beb3(0x22e)]),console['error'](_0x48beb3(0x146)+a59_0x564dd3[_0x48beb3(0xcd)]('+'+_0x350cab['summary'][_0x48beb3(0xb2)]+_0x48beb3(0xc2))+',\x20'+(a59_0x564dd3[_0x48beb3(0x204)]('~'+_0x350cab[_0x48beb3(0x1f8)]['modified']+_0x48beb3(0x232))+',\x20')+(a59_0x564dd3[_0x48beb3(0x1a4)]('-'+_0x350cab[_0x48beb3(0x1f8)][_0x48beb3(0x173)]+_0x48beb3(0x1a7))+',\x20')+(''+a59_0x564dd3['dim'](_0x350cab['summary']['unchanged']+_0x48beb3(0xa5))));for(const _0x2b89db of _0x350cab[_0x48beb3(0x135)]){_0x2b89db[_0x48beb3(0x14a)]===_0x48beb3(0xa7)&&_0x2b89db['diff']&&(console[_0x48beb3(0x23a)]('\x0a'+a59_0x564dd3[_0x48beb3(0x1ae)](_0x48beb3(0xb8)+_0x2b89db[_0x48beb3(0x11f)])),console[_0x48beb3(0x23a)](_0x2b89db[_0x48beb3(0x7e)]));}if(!_0x350cab[_0x48beb3(0x10e)])return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0xcd)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x48beb3(0xe2)](_0x5c814f,_0x350cab[_0x48beb3(0x179)],_0x25a3be[_0x48beb3(0xc7)]),0x0;if(_0x25a3be[_0x48beb3(0xa6)])return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x204)](_0x48beb3(0xf5))),0x0;if(!_0x25a3be[_0x48beb3(0x100)]){if(!isInteractive())return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0x1a4)](_0x48beb3(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a59_0x564dd3[_0x48beb3(0x6f)](_0x48beb3(0xbb))),0x1;const _0x269724=await confirmKey(_0x48beb3(0x1dc));if(!_0x269724)return console['error'](a59_0x564dd3[_0x48beb3(0x204)](_0x48beb3(0xf4)),_0x48beb3(0xc4)),0x1;}const _0x1fd621=await withSpinner(_0x48beb3(0x180),()=>_0x5c814f[_0x48beb3(0x14b)][_0x48beb3(0xb4)](_0x350cab),{'verbose':_0x25a3be[_0x48beb3(0x1ab)]}),_0x3d0723=_0x1fd621[_0x48beb3(0x138)];return console[_0x48beb3(0x23a)](a59_0x564dd3[_0x48beb3(0xcd)]('✔\x20Push\x20complete')),console[_0x48beb3(0x23a)](_0x48beb3(0x245)+_0x3d0723[_0x48beb3(0x162)]),console[_0x48beb3(0x23a)](_0x48beb3(0x189)+_0x3d0723[_0x48beb3(0x22e)]),await this[_0x48beb3(0xe2)](_0x5c814f,_0x3d0723[_0x48beb3(0x179)],_0x25a3be[_0x48beb3(0xc7)]),0x0;}}function a59_0x314e(){const _0x2327d4=['disableSchedule','\x20\x20Attempt\x20ID:\x20','--schedule-id\x20cannot\x20be\x20combined\x20with\x20a\x20project.workflow\x20filter','Killing\x20attempt...','Disabling\x20schedule\x20#','.\x20Expected\x20format:\x20KEY=VALUE','TASK_NAME_WIDTH','setSecrets','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','projectId','size','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Analyzing\x20project...','Session\x20','session','Error:','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow:push','workflow:pull','workflow:secrets:delete','Session\x20not\x20found:\x20','localeCompare','Project\x20filter:\x20','Pushing\x20workflow\x20project...','bold','applyPullProject','deleted','fill','Invalid\x20format:\x20','\x0aApply\x20these\x20changes?','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','\x22?\x20This\x20cannot\x20be\x20undone.','projectName','fromTask','workflow:tasks','\x0a⚠\x20Project\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20AI','start','Pushing\x20project...','Files\x20to\x20upload:\x20','From\x20task:\x20','durationMs','now','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','icon','executeCloneProject','81mYFePZ','\x20\x20Revision:\x20','\x20from\x20session\x20','Source\x20directory\x20is\x20required','workflowName','newProjectId','total','round','✔\x20Showing\x20','listSecrets','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','parseProjectWorkflowPattern','unknown','\x20\x20Location:\x20','format','nextTime','Key\x20cannot\x20be\x20empty','values','→\x20New\x20project:\x20','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20to\x20see\x20detailed\x20logs','Task\x20graph:','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','\x20schedule','padStart','workflow:kill','has','red','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20deleted','sourceDir','Revision:\x20','🔄\x20','verbose','Project\x20name\x20is\x20required','getDate','cyan','✔\x20Clone\x20complete','POLL_INTERVAL_MS','Schedule\x20ID\x20is\x20required','workflow:attempt','replace','\x20(use\x20a\x20larger\x20--limit\x20to\x20show\x20more)','toLowerCase','status','success','Setting\x20','find','basename','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','getWorkflow','Target\x20directory:\x20','existingProjectId','Source\x20directory:\x20','Listing\x20workflow\x20projects...','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','MIN_TIMELINE_WIDTH','Source\x20project:\x20','match','deleteSecret','List\x20workflows','workflow:use','follow','323397MSyGvm','workflow:schedule:disable','358606AEHeTe','✔\x20Schedule\x20found','/app/workflows/','isNewProject','5WSeZwj','workflows','Dry\x20run:\x20yes','isDirectory','keys','\x20(system)','executeDryRun','Listing\x20secrets...','Deleting\x20secret...','duration','enableSchedule','Start\x20a\x20workflow\x20run','No\x20sessions\x20found','\x0aPush\x20these\x20changes?','\x0aDry\x20run\x20-\x20no\x20project\x20created','Workflow:','MAX_LABEL_COUNT','No\x20attempts\x20found','workflow:workflows','planned','Latest\x20session\x20has\x20no\x20attempt','every','Loading\x20session...','getHours','isArray','json','attemptId','session:','✔\x20Downloaded\x20','preparePushProject','Show\x20tasks\x20for\x20an\x20attempt','targetExists','sessions','\x20attempt','filter','end','\x20\x20New\x20attempt\x20ID:\x20','\x22\x20to\x20new\x20project\x20\x22','✔\x20Secret\x20\x27','blue','workflow:logs','summary','push','Attempt\x20ID:\x20','Listing\x20workflows...','select','Filter:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','config','workflow:attempts','Retrying\x20session...','execute','yellow','workflow:upload','6769104pQZXuz','\x20(use\x20--limit\x20to\x20show\x20more)','buildTimelineData','get','lastAttempt','workflowProject','startedAt','Cloning\x20to\x20','set','→\x20Project:\x20','retryAttemptName','listProjectSchedules','Enable\x20a\x20workflow\x20schedule','requireProject','revision:\x20','Writing\x20files...','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','length','List\x20workflow\x20schedules','Workflow:\x20','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','prepareCloneProject','No\x20matching\x20sessions\x20found','Project\x20name:\x20','Setting\x20secret...','kill','Retry\x20a\x20session\x20or\x20attempt','\x20is\x20not\x20a\x20directory','721950KZqNqN','log','state','Session\x20time:\x20','MAX_POLL_ITERATIONS','Error:\x20Invalid\x20JSON\x20in\x20--params','includes','description','attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Delete\x20workflow\x20project\x20from\x20Treasure\x20AI','New\x20project\x20name:\x20','revision','write','✔\x20Pushed\x20','2299876YqaXrG','\x20modified','\x20session','-\x20no\x20files\x20written','substring','Schedule:\x20backfill\x20runs\x20enabled\x20(--backfill)','stringify','ICON_SPACING','download','error','pollTimeline','\x20\x20(no\x20tasks\x20found\x20in\x20workflow\x20definition)','Key:\x20','(unknown)','📅\x20#','workflow:retry','List\x20workflow\x20attempts','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','✔\x20Deleted\x20project\x20','\x20\x20Project\x20ID:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','canceling','\x20next:\x20','Fetching\x20schedule\x20#','✔\x20Found\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','context','skipValidation','key','white','sort','relative','No\x20attempts\x20found\x20for:\x20','No\x20projects\x20match\x20pattern:\x20','Updating\x20','nextRunTime','sessionId','renderSessionsTimeline','Auto-selected\x20latest\x20session:\x20','running','dim','Force:\x20yes','Listing\x20workflow\x20attempts...','No\x20attempts\x20found\x20in\x20project:\x20','Parameters:','tdx\x20wf\x20attempt\x20','LABEL_WIDTH_DIVISOR','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','jsonl','navigateSessionsInteractive','\x20sessions\x20','getMonth','name','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','limit','diff','No\x20sessions\x20found\x20for:\x20','utf-8','force','\x0a[Dry\x20run]\x20Workflow\x20was\x20NOT\x20executed.','getFullYear','taskName','trimEnd','\x0a✔\x20Attempt\x20complete','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectId','resumeFrom','5014401vXiMvU','value','startTime','retryAttempt','task','\x27...','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20enabled\x20(','No\x20workflows\x20found','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','Select\x20a\x20task\x20to\x20view\x20logs:','output','skipSchedule','reason','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','Listing\x20schedules\x20for\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Downloading\x20logs...','param','\x22\x20with\x20new\x20revision?','floor','logs','cancelRequested','\x20logs','\x20of\x20','/sessions/','targetDir','\x20unchanged','dryRun','modified','Downloading\x20project\x20','\x20\x20Source:\x20','Error:\x20Secret\x20key\x20is\x20required','list','Error:\x20Attempt\x20ID\x20is\x20required','sessionTime','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','repeat','MIN_LABEL_COUNT','map','new','8CXngbg','executePushProject','No\x20sessions\x20found\x20in\x20project:\x20','includeRetried','List\x20workflow\x20execution\x20sessions','---\x20','msPerChar','run','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','done','resolve','renderTimeline','startsWith','createdAt','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','\x20new','max','-\x20nothing\x20pushed','Secrets\x20to\x20set:\x20','project','site','Listing\x20workflow\x20sessions...','metadata','generateSessionTimelineRows','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','splice','green','title','4195104jnhgxq','resolveProject','\x20\x20Session\x20context\x20set\x20to:\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','\x27\x20from\x20project\x20\x27','index','\x20\x20Project:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','workflow:secrets:list','Including\x20subtasks:\x20yes','tdx.json','\x20\x20Console:\x20','workflow:download','\x1b[1A\x1b[2K','workflow:run','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Warning:','Resolving\x20project\x20\x27','\x0a✔\x20Already\x20up\x20to\x20date','showWorkflowConsoleUrl','Select\x20a\x20workflow\x20to\x20run','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','params','No\x20workflow\x20tdx.json\x20found','toLocaleString','Parameters:\x20','Getting\x20attempt\x20tasks...','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Workflow\x20run\x20started','from','Pull\x20workflow\x20project\x20to\x20local\x20folder','No\x20sessions\x20with\x20timing\x20information','✔\x20Schedule\x20#','updatedAt','Getting\x20attempt\x20details...','✔\x20Workflow\x20project\x20context\x20cleared.','some','Cancelled','\x0aDry\x20run\x20-\x20nothing\x20pushed','LABEL_MIN_SPACING','join','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Kill\x20a\x20running\x20attempt','Fetching\x20log\x20files...','delete','clear','\x20(disabled)','Usage:\x20tdx\x20wf\x20schedule\x20list\x20[project[.workflow]]\x20|\x20--schedule-id\x20<id>','renderSingleTimeline','yes','split','\x20\x20Target:\x20','Failed\x20to\x20fetch\x20attempt\x20data','...','min','✔\x20Project\x20updated','\x20has\x20no\x20attempts','Using\x20attempt\x20','✔\x20Project:\x20','finishedAt','isTTY','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20secrets\x20set\x20for\x20project\x20\x27','hasChanges','projects','Task\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Session\x20time:','GUTTER','✔\x20Workflow\x20project\x20set\x20to:\x20','Pattern:\x20','Attempt:\x20','columns','\x20\x20Files\x20extracted:\x20','newProjectName','getTime','Disable\x20a\x20workflow\x20schedule','workflow:schedule:enable','\x0aClone\x20\x22','fullName','path','ICON_WIDTH','session_id','stdout','Filter:\x20project=','Project:\x20','No\x20log\x20content\x20found','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Enabling\x20schedule\x20#','Error:\x20Project\x20name\x20is\x20required','all','sourceProjectName','displayLine','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Resume\x20from:\x20','Error:\x20Invalid\x20parameter\x20format:\x20','\x0aError:','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Workflow:\x20','changes','Usage:\x20tdx\x20wf\x20use\x20<project>','\x20secret','data','\x20\x20Next\x20run:\x20','toISOString','\x20-\x20','fileSize','\x20\x20Session\x20ID:\x20','window','table','(use\x20--limit\x20to\x20see\x20more)','\x0aFailed\x20to\x20fetch\x20attempt\x20data','listSchedules','Loading\x20workflows...','unchanged','pending','\x20\x20Changes:\x20','/attempt/','tasks','Validation:\x20skipped','type','workflow','stat','group_error','resolveProjectDir','Tip:\x20cd\x20to\x20workflows/','Analyzing\x20changes...','Pulling\x20project\x20','trim','MAX_TASKS_DISPLAY','cwd','\x20task','slice','attempts','Loading\x20sessions...'];a59_0x314e=function(){return _0x2327d4;};return a59_0x314e();}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:clone';[a59_0x34b1fc(0x229)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a59_0x34b1fc(0x203)](_0xecdbdb){const _0x11b0bb=a59_0x34b1fc,{options:_0x379dd0,args:_0x44d631,tdx:_0x1e6499}=_0xecdbdb,_0xcda34f=this['resolveProjectDir'](_0x44d631,_0x379dd0),_0x41cf33=_0x379dd0['name'],_0xe76a31=_0x379dd0[_0x11b0bb(0x22e)],_0x591227=_0x379dd0[_0x11b0bb(0x24d)];if(!_0xcda34f)return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)](_0x11b0bb(0x168)),_0x11b0bb(0x18b)),console['error'](a59_0x564dd3[_0x11b0bb(0x6f)](_0x11b0bb(0x10c))),console['error'](a59_0x564dd3[_0x11b0bb(0x6f)](_0x11b0bb(0x1ff))),0x1;if(!_0x41cf33)return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)]('Error:'),_0x11b0bb(0x9a)),console['error'](a59_0x564dd3['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x379dd0['verbose']&&(console[_0x11b0bb(0x23a)](_0x11b0bb(0x1bf)+_0xcda34f),console['error'](_0x11b0bb(0x22d)+_0x41cf33),_0xe76a31&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x1a9)+_0xe76a31),_0x379dd0[_0x11b0bb(0xa6)]&&console[_0x11b0bb(0x23a)]('Dry\x20run:\x20yes'),_0x591227&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x149)));const _0x361bce=await withSpinner(_0x11b0bb(0x165),()=>_0x1e6499['workflow'][_0x11b0bb(0x21b)](_0xcda34f,_0x41cf33,{'revision':_0xe76a31,'skipValidation':_0x591227}),{'verbose':_0x379dd0[_0x11b0bb(0x1ab)]}),_0x349c3a=_0x361bce['data'];console[_0x11b0bb(0x23a)]('Source:\x20'+_0x349c3a[_0x11b0bb(0x1a8)]);_0x349c3a['sourceProjectName']&&console[_0x11b0bb(0x23a)](_0x11b0bb(0x1c3)+_0x349c3a[_0x11b0bb(0x12b)]);console[_0x11b0bb(0x23a)](_0x11b0bb(0x22d)+_0x349c3a[_0x11b0bb(0x119)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x1a9)+_0x349c3a['revision']),console[_0x11b0bb(0x23a)](_0x11b0bb(0x181)+_0x349c3a['fileCount']);_0x349c3a[_0x11b0bb(0x1ee)]&&(console[_0x11b0bb(0x23a)](a59_0x564dd3['yellow'](_0x11b0bb(0x17c)+_0x349c3a['newProjectName']+_0x11b0bb(0x12d)+_0x349c3a[_0x11b0bb(0x1be)]+')')),console['error'](a59_0x564dd3[_0x11b0bb(0x204)](_0x11b0bb(0x161))));if(_0x379dd0[_0x11b0bb(0xa6)])return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x204)](_0x11b0bb(0x1dd))),0x0;if(!_0x379dd0[_0x11b0bb(0x100)]){if(!isInteractive())return console[_0x11b0bb(0x23a)](a59_0x564dd3[_0x11b0bb(0x1a4)]('\x0aError:'),_0x11b0bb(0x246)),console[_0x11b0bb(0x23a)](a59_0x564dd3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x10527a=_0x349c3a[_0x11b0bb(0x12b)]||a59_0x156221[_0x11b0bb(0x1ba)](_0xcda34f),_0x33bb48=_0x349c3a[_0x11b0bb(0x1ee)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x41cf33+_0x11b0bb(0x9d):_0x11b0bb(0x11d)+_0x10527a+_0x11b0bb(0x1f4)+_0x41cf33+'\x22?',_0xb4c4a4=await confirmKey(_0x33bb48);if(!_0xb4c4a4)return console['error'](a59_0x564dd3[_0x11b0bb(0x204)]('Cancelled')),0x1;}const _0x5d3968=await withSpinner(_0x349c3a[_0x11b0bb(0x1ee)]?_0x11b0bb(0x69)+_0x41cf33+_0x11b0bb(0x104):_0x11b0bb(0x20d)+_0x41cf33+'...',()=>_0x1e6499[_0x11b0bb(0x14b)][_0x11b0bb(0x187)](_0x349c3a),{'verbose':_0x379dd0['verbose']}),_0x3084d5=_0x5d3968[_0x11b0bb(0x138)];return console[_0x11b0bb(0x23a)](a59_0x564dd3['green'](_0x349c3a[_0x11b0bb(0x1ee)]?_0x11b0bb(0x106):_0x11b0bb(0x1af))),console[_0x11b0bb(0x23a)](_0x11b0bb(0xd5)+_0x3084d5[_0x11b0bb(0x119)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x245)+_0x3084d5[_0x11b0bb(0x18d)]),console[_0x11b0bb(0x23a)](_0x11b0bb(0x189)+_0x3084d5[_0x11b0bb(0x22e)]),await this[_0x11b0bb(0xe2)](_0x1e6499,_0x3084d5[_0x11b0bb(0x119)],_0x379dd0['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]='workflow:delete';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x22c);async[a59_0x34b1fc(0x203)](_0x3fce1b){const _0x4759d3=a59_0x34b1fc,{options:_0xbd6e4f,args:_0x43e6a2,tdx:_0x372e51}=_0x3fce1b,_0x5ddb78=_0x43e6a2[0x0];if(!_0x5ddb78)return console['error'](_0x4759d3(0x12e)),console[_0x4759d3(0x23a)](_0x4759d3(0x169)),0x1;_0xbd6e4f[_0x4759d3(0x1ab)]&&console['error'](_0x4759d3(0x124)+_0x5ddb78);if(!_0xbd6e4f[_0x4759d3(0x100)]){if(!isInteractive())return console[_0x4759d3(0x23a)](a59_0x564dd3[_0x4759d3(0x1a4)](_0x4759d3(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4759d3(0x23a)](a59_0x564dd3['dim'](_0x4759d3(0xbb))),0x1;const _0x345f88=await confirmKey(_0x4759d3(0xe4)+_0x5ddb78+_0x4759d3(0x178));if(!_0x345f88)return console[_0x4759d3(0x23a)](a59_0x564dd3[_0x4759d3(0x204)](_0x4759d3(0xf4))),0x1;}const _0x156969=await withSpinner('Deleting\x20project\x20'+_0x5ddb78+'...',()=>_0x372e51['workflow'][_0x4759d3(0xfb)](_0x5ddb78),{'verbose':_0xbd6e4f[_0x4759d3(0x1ab)]}),_0x1336cb=_0x156969['data'];return console[_0x4759d3(0x23a)](_0x4759d3(0x244)+_0x1336cb[_0x4759d3(0x179)]),console[_0x4759d3(0x23a)](_0x4759d3(0x245)+_0x1336cb[_0x4759d3(0x162)]),0x0;}}export function parseKeyValue(_0x6de4ad){const _0x32a7b8=a59_0x34b1fc,_0x41044b=_0x6de4ad['indexOf']('=');if(_0x41044b===-0x1)throw new Error(_0x32a7b8(0x175)+_0x6de4ad+_0x32a7b8(0x15e));const _0x16db05=_0x6de4ad[_0x32a7b8(0x235)](0x0,_0x41044b),_0x51ada7=_0x6de4ad['substring'](_0x41044b+0x1);if(!_0x16db05)throw new Error(_0x32a7b8(0x199));return{'key':_0x16db05,'value':_0x51ada7};}function a59_0x2d50(_0x4be168,_0x591872){_0x4be168=_0x4be168-0x65;const _0x314e2e=a59_0x314e();let _0x2d5078=_0x314e2e[_0x4be168];return _0x2d5078;}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0xd7);['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a59_0x34b1fc(0x203)](_0x1b3e09){const _0x10f02c=a59_0x34b1fc,{options:_0x363b12,args:_0x582f2b,tdx:_0x1e9b87}=_0x1b3e09,_0xd1ebfd=this[_0x10f02c(0x213)](_0x582f2b,_0x363b12);if(!_0xd1ebfd)return 0x1;_0x363b12['verbose']&&console[_0x10f02c(0x23a)](_0x10f02c(0x124)+_0xd1ebfd);const _0x52b2b7=await withSpinner(_0x10f02c(0x1d6),()=>_0x1e9b87[_0x10f02c(0x14b)][_0x10f02c(0x191)](_0xd1ebfd),{'verbose':_0x363b12['verbose']}),{secrets:_0xa29f93}=_0x52b2b7[_0x10f02c(0x138)];return console[_0x10f02c(0x23a)](_0x10f02c(0x24a)+_0xa29f93[_0x10f02c(0x217)]+_0x10f02c(0x137)+(_0xa29f93['length']!==0x1?'s':'')),await handleSDKOutput(_0xa29f93,_0x363b12),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:secrets:set';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x1a5);async['execute'](_0x3805b9){const _0x4b38f6=a59_0x34b1fc,{options:_0x35719a,args:_0x727768,tdx:_0x3d749a}=_0x3805b9;let _0x3a4352,_0x34e564;if(_0x727768[_0x4b38f6(0x217)]>=0x1&&!_0x727768[0x0][_0x4b38f6(0x228)]('='))_0x3a4352=_0x727768[0x0],_0x34e564=_0x727768[_0x4b38f6(0x156)](0x1);else{if(_0x727768[_0x4b38f6(0x217)]>=0x1&&_0x35719a[_0x4b38f6(0x20b)])_0x3a4352=_0x35719a[_0x4b38f6(0x20b)],_0x34e564=_0x727768;else return _0x727768[_0x4b38f6(0x217)]>=0x1?(console[_0x4b38f6(0x23a)](_0x4b38f6(0x129)),console['error'](_0x4b38f6(0x185)),0x1):(console['error'](_0x4b38f6(0x126)),console[_0x4b38f6(0x23a)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x34e564[_0x4b38f6(0x217)]===0x0)return console['error']('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x4b38f6(0x23a)](_0x4b38f6(0x192)),0x1;const _0x22731a={};try{for(const _0xde08fd of _0x34e564){const {key:_0x328062,value:_0x1ca621}=parseKeyValue(_0xde08fd);_0x22731a[_0x328062]=_0x1ca621;}}catch(_0x228745){return _0x228745 instanceof Error&&console[_0x4b38f6(0x23a)](a59_0x564dd3[_0x4b38f6(0x1a4)]('Error:'),_0x228745['message']),0x1;}const _0x38bf50=Object[_0x4b38f6(0x1d3)](_0x22731a);_0x35719a[_0x4b38f6(0x1ab)]&&(console['error']('Project:\x20'+_0x3a4352),console['error'](_0x4b38f6(0xc5)+_0x38bf50[_0x4b38f6(0xf7)](',\x20')));const _0x315a8b=await withSpinner(_0x38bf50[_0x4b38f6(0x217)]===0x1?_0x4b38f6(0x21e):_0x4b38f6(0x1b8)+_0x38bf50[_0x4b38f6(0x217)]+'\x20secrets...',()=>_0x3d749a[_0x4b38f6(0x14b)][_0x4b38f6(0x160)](_0x3a4352,_0x22731a),{'verbose':_0x35719a[_0x4b38f6(0x1ab)]}),_0x84b7c4=_0x315a8b[_0x4b38f6(0x138)];return console[_0x4b38f6(0x23a)](_0x38bf50['length']===0x1?_0x4b38f6(0x1f5)+_0x84b7c4[_0x4b38f6(0x1d3)][0x0]+_0x4b38f6(0x93)+_0x84b7c4['projectName']+'\x27':'✔\x20'+_0x84b7c4[_0x4b38f6(0x1d3)][_0x4b38f6(0x217)]+_0x4b38f6(0x10d)+_0x84b7c4[_0x4b38f6(0x179)]+'\x27'),(_0x35719a[_0x4b38f6(0x1e8)]||_0x35719a[_0x4b38f6(0x77)])&&await handleSingleObjectOutput(_0x84b7c4,_0x35719a),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x16c);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0xde);async[a59_0x34b1fc(0x203)](_0xf74d40){const _0x42593b=a59_0x34b1fc,{options:_0x6e080a,args:_0x458cdf,tdx:_0x162372}=_0xf74d40;let _0x3d9ca3,_0x23860d;if(_0x458cdf[_0x42593b(0x217)]>=0x2)_0x3d9ca3=_0x458cdf[0x0],_0x23860d=_0x458cdf[0x1];else{if(_0x458cdf[_0x42593b(0x217)]===0x1&&_0x6e080a[_0x42593b(0x20b)])_0x3d9ca3=_0x6e080a[_0x42593b(0x20b)],_0x23860d=_0x458cdf[0x0];else return _0x458cdf[_0x42593b(0x217)]===0x1?(console[_0x42593b(0x23a)](_0x42593b(0x129)),console[_0x42593b(0x23a)](_0x42593b(0x185)),0x1):(console[_0x42593b(0x23a)](_0x42593b(0xaa)),console[_0x42593b(0x23a)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x6e080a[_0x42593b(0x1ab)]&&(console[_0x42593b(0x23a)]('Project:\x20'+_0x3d9ca3),console[_0x42593b(0x23a)](_0x42593b(0x23d)+_0x23860d));if(!_0x6e080a[_0x42593b(0x100)]){if(!isInteractive())return console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x1a4)](_0x42593b(0x131)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x6f)](_0x42593b(0xbb))),0x1;const _0x1f2c21=await confirmKey(_0x42593b(0x216)+_0x23860d+_0x42593b(0xd3)+_0x3d9ca3+'\x27?');if(!_0x1f2c21)return console[_0x42593b(0x23a)](a59_0x564dd3[_0x42593b(0x204)]('Cancelled')),0x1;}const _0x5962f6=await withSpinner(_0x42593b(0x1d7),()=>_0x162372['workflow'][_0x42593b(0x1c5)](_0x3d9ca3,_0x23860d),{'verbose':_0x6e080a[_0x42593b(0x1ab)]}),_0x23776d=_0x5962f6[_0x42593b(0x138)];return console[_0x42593b(0x23a)](_0x42593b(0x1f5)+_0x23776d['key']+_0x42593b(0x1a6)+_0x23776d['projectName']+'\x27'),(_0x6e080a[_0x42593b(0x1e8)]||_0x6e080a[_0x42593b(0x77)])&&await handleSingleObjectOutput(_0x23776d,_0x6e080a),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(_0x5e51f8){const _0x2e5b40=a59_0x34b1fc,_0xd60a62=Math[_0x2e5b40(0x9e)](_0x5e51f8/0x3e8),_0x4cce52=Math[_0x2e5b40(0x9e)](_0xd60a62/0x3c),_0x1971a1=Math[_0x2e5b40(0x9e)](_0x4cce52/0x3c),_0x4ded59=Math[_0x2e5b40(0x9e)](_0x1971a1/0x18);if(_0x4ded59>0x0){const _0x5dd8b3=_0x1971a1%0x18;return _0x5dd8b3>0x0?_0x4ded59+'d\x20'+_0x5dd8b3+'h':_0x4ded59+'d';}else{if(_0x1971a1>0x0){const _0x58d962=_0x4cce52%0x3c;return _0x58d962>0x0?_0x1971a1+'h\x20'+_0x58d962+'m':_0x1971a1+'h';}else{if(_0x4cce52>0x0){const _0x5c403d=_0xd60a62%0x3c;return _0x5c403d>0x0?_0x4cce52+'m\x20'+_0x5c403d+'s':_0x4cce52+'m';}else return _0xd60a62+'s';}}}function formatTimestamp(_0x36d31a,_0x2a184){const _0x2382c7=a59_0x34b1fc,_0xdf1ca2=new Date(_0x36d31a),_0x16521e=String(_0xdf1ca2[_0x2382c7(0x1e6)]())[_0x2382c7(0x1a1)](0x2,'0'),_0x36c9d3=String(_0xdf1ca2['getMinutes']())[_0x2382c7(0x1a1)](0x2,'0'),_0x16dedc=_0x16521e+':'+_0x36c9d3,_0x18ae53=_0xdf1ca2['getFullYear']()===_0x2a184[_0x2382c7(0x83)]()&&_0xdf1ca2[_0x2382c7(0x7a)]()===_0x2a184['getMonth']()&&_0xdf1ca2[_0x2382c7(0x1ad)]()===_0x2a184['getDate']();if(_0x18ae53)return _0x16dedc;else{const _0x3aa18c=String(_0xdf1ca2[_0x2382c7(0x7a)]()+0x1)['padStart'](0x2,'0'),_0x42d15a=String(_0xdf1ca2['getDate']())[_0x2382c7(0x1a1)](0x2,'0');return _0x3aa18c+'-'+_0x42d15a+'\x20'+_0x16dedc;}}function formatDate(_0x396d49){const _0x113645=a59_0x34b1fc,_0x2d8c0d=_0x396d49['getFullYear'](),_0x40db93=String(_0x396d49[_0x113645(0x7a)]()+0x1)[_0x113645(0x1a1)](0x2,'0'),_0x4c088a=String(_0x396d49[_0x113645(0x1ad)]())[_0x113645(0x1a1)](0x2,'0');return _0x2d8c0d+'-'+_0x40db93+'-'+_0x4c088a;}function getTaskStateIcon(_0x26ed16){const _0x22db91={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x22db91[_0x26ed16]||'⚪';}function getBarChar(_0x3fdf1b){const _0x59f864=a59_0x34b1fc;return _0x3fdf1b===_0x59f864(0x23a)||_0x3fdf1b==='group_error'?'×':'─';}function getBarColor(_0x575b1d){const _0x44c235=a59_0x34b1fc,_0x36eb29={'success':a59_0x564dd3['green'],'error':a59_0x564dd3['red'],'group_error':a59_0x564dd3[_0x44c235(0x1a4)],'running':a59_0x564dd3['blue'],'blocked':a59_0x564dd3['yellow'],'planned':a59_0x564dd3[_0x44c235(0x6f)],'canceling':a59_0x564dd3['yellow']};return _0x36eb29[_0x575b1d]||a59_0x564dd3[_0x44c235(0x24f)];}function parseTaskName(_0xa1903e){const _0x561ee3=a59_0x34b1fc;let _0x220ca5=_0xa1903e[_0x561ee3(0x1b3)](/^\++/,'');const _0x3854e7=_0x220ca5[_0x561ee3(0x101)]('+'),_0x5dce92=_0x3854e7[_0x561ee3(0x217)]>0x1?_0x3854e7[_0x561ee3(0x217)]-0x2:0x0,_0x332488=_0x3854e7[_0x3854e7[_0x561ee3(0x217)]-0x1]||_0x220ca5;return{'level':_0x5dce92,'name':'+'+_0x332488};}function truncateTaskName(_0x53d2e9,_0x40e89b){const _0x2ff641=a59_0x34b1fc,_0x2695e9=stringWidth(_0x53d2e9);if(_0x2695e9<=_0x40e89b)return _0x53d2e9;let _0x5164a2=_0x53d2e9;while(stringWidth(_0x5164a2+'…')>_0x40e89b&&_0x5164a2[_0x2ff641(0x217)]>0x0){_0x5164a2=_0x5164a2['slice'](0x0,-0x1);}return _0x5164a2+'…';}function calculateTimeScale(_0x49f217,_0x1f3b3f){const _0x4bd3a8=a59_0x34b1fc;return{'startTime':_0x49f217['start'],'endTime':_0x49f217[_0x4bd3a8(0x1f2)],'durationMs':_0x49f217['duration'],'msPerChar':_0x49f217[_0x4bd3a8(0x1d8)]/_0x1f3b3f};}function timeToPosition(_0xea8af3,_0x4198b8,_0x866a7f){const _0x131859=a59_0x34b1fc,_0x31fd89=_0xea8af3-_0x4198b8['startTime'],_0x17462b=Math[_0x131859(0x9e)](_0x31fd89/_0x4198b8[_0x131859(0xb9)]);return Math['max'](0x0,Math['min'](_0x17462b,_0x866a7f));}function renderTimeAxis(_0x114611,_0x3548b5){const _0x269d05=a59_0x34b1fc,_0x4e0f49=Math['min'](TIMELINE_CONFIG[_0x269d05(0x1df)],Math[_0x269d05(0xc3)](TIMELINE_CONFIG[_0x269d05(0xb0)],Math[_0x269d05(0x9e)](_0x3548b5/TIMELINE_CONFIG[_0x269d05(0x75)]))),_0x417257=_0x114611[_0x269d05(0x183)]/(_0x4e0f49-0x1),_0x19a2b2=new Date(_0x114611[_0x269d05(0x8c)]),_0xa6dd62=[];for(let _0x3cd0bc=0x0;_0x3cd0bc<_0x4e0f49;_0x3cd0bc++){const _0x45c563=_0x114611[_0x269d05(0x8c)]+_0x3cd0bc*_0x417257,_0x45d8f3=timeToPosition(_0x45c563,_0x114611,_0x3548b5),_0x219f4f=formatTimestamp(_0x45c563,_0x19a2b2);_0xa6dd62['push']({'pos':_0x45d8f3,'text':_0x219f4f});}const _0x191cf2=new Array(_0x3548b5)[_0x269d05(0x174)]('\x20');let _0x4f424d=-0x1;for(const {pos:_0x1f1c14,text:_0x1a7d42}of _0xa6dd62){let _0x11d462=Math[_0x269d05(0xc3)](0x0,_0x1f1c14-Math[_0x269d05(0x9e)](_0x1a7d42['length']/0x2));_0x11d462<=_0x4f424d+TIMELINE_CONFIG[_0x269d05(0xf6)]&&(_0x11d462=_0x4f424d+TIMELINE_CONFIG[_0x269d05(0xf6)]+0x1);_0x11d462+_0x1a7d42['length']>_0x3548b5&&(_0x11d462=_0x3548b5-_0x1a7d42[_0x269d05(0x217)]);if(_0x11d462>=0x0&&_0x11d462+_0x1a7d42[_0x269d05(0x217)]<=_0x3548b5&&_0x11d462>_0x4f424d){for(let _0x2adf50=0x0;_0x2adf50<_0x1a7d42[_0x269d05(0x217)];_0x2adf50++){_0x191cf2[_0x11d462+_0x2adf50]=_0x1a7d42[_0x2adf50];}_0x4f424d=_0x11d462+_0x1a7d42[_0x269d05(0x217)]-0x1;}}return _0x191cf2[_0x269d05(0xf7)]('');}function renderTaskRow(_0x49503c,_0xdaf69b,_0x598071,_0x582991){const _0x5c9967=a59_0x34b1fc,{level:_0x1c38da,name:_0x1cb0bd}=parseTaskName(_0x49503c[_0x5c9967(0x7b)]),_0x28d188='\x20'[_0x5c9967(0xaf)](_0x1c38da),_0xb416e8=_0x49503c[_0x5c9967(0x13e)]?'('+formatElapsed(_0x49503c[_0x5c9967(0x13e)][_0x5c9967(0x1d8)])+')':'',_0x4199ee=stringWidth(_0xb416e8),_0x199de7=_0x1c38da*0x1,_0x4ece61=_0x582991-_0x199de7-_0x4199ee-0x1,_0x70da8=truncateTaskName(_0x1cb0bd,_0x4ece61),_0x1d99b7=_0x28d188+_0x70da8,_0x29097b=stringWidth(_0x1d99b7),_0x3271e9=_0x582991-_0x29097b-_0x4199ee,_0x5c675a=_0x1d99b7+'\x20'[_0x5c9967(0xaf)](Math['max'](0x1,_0x3271e9))+a59_0x564dd3[_0x5c9967(0x6f)](_0xb416e8),_0x1ea5c6=getTaskStateIcon(_0x49503c[_0x5c9967(0x224)]),_0x5b76b7=new Array(_0x598071)['fill']('\x20');if(_0x49503c['window']){const _0x3e9f3d=timeToPosition(_0x49503c[_0x5c9967(0x13e)][_0x5c9967(0x17f)],_0xdaf69b,_0x598071),_0x4d01de=timeToPosition(_0x49503c['window'][_0x5c9967(0x1f2)],_0xdaf69b,_0x598071),_0x3173d3=getBarChar(_0x49503c[_0x5c9967(0x224)]),_0x1ca0d5=Math[_0x5c9967(0xc3)](_0x3e9f3d+0x1,_0x4d01de);for(let _0x55a88f=_0x3e9f3d;_0x55a88f<Math['min'](_0x1ca0d5,_0x598071);_0x55a88f++){_0x5b76b7[_0x55a88f]=_0x3173d3;}}const _0x12e640=getBarColor(_0x49503c[_0x5c9967(0x224)]),_0x14f29d=_0x5b76b7[_0x5c9967(0xb1)](_0x14a53d=>_0x14a53d==='\x20'?'\x20':_0x12e640(_0x14a53d))[_0x5c9967(0xf7)]('');return _0x1ea5c6+'\x20'+_0x5c675a+'│'+_0x14f29d+'│';}function calculateStats(_0x3bdeb0){const _0x19c845=a59_0x34b1fc,_0x2565fa={'total':_0x3bdeb0['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5ae07d of _0x3bdeb0){if(_0x5ae07d[_0x19c845(0x224)]==='success')_0x2565fa[_0x19c845(0x1b7)]++;else{if(_0x5ae07d['state']==='error'||_0x5ae07d[_0x19c845(0x224)]===_0x19c845(0x14d))_0x2565fa[_0x19c845(0x23a)]++;else _0x5ae07d[_0x19c845(0x224)]==='running'?_0x2565fa['running']++:_0x2565fa[_0x19c845(0x145)]++;}}return _0x2565fa;}function formatStats(_0x29b49e){const _0x4cd9a2=a59_0x34b1fc;return['Total:\x20'+_0x29b49e[_0x4cd9a2(0x18e)],'✅\x20'+_0x29b49e[_0x4cd9a2(0x1b7)],'❌\x20'+_0x29b49e[_0x4cd9a2(0x23a)],_0x4cd9a2(0x1aa)+_0x29b49e[_0x4cd9a2(0x6e)],'⏳\x20'+_0x29b49e[_0x4cd9a2(0x145)]][_0x4cd9a2(0xf7)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']='workflow:timeline';[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x19f);async[a59_0x34b1fc(0x203)](_0x11a530){const _0x417e2b=a59_0x34b1fc,{options:_0x1fe10c,args:_0x24934b,tdx:_0x32e27e}=_0x11a530;let _0x46e662,_0x1faa5a,_0xdbaa98=![];if(_0x24934b[0x0]){if(_0x24934b[0x0][_0x417e2b(0x228)]('.')){const _0x3cddd9=this[_0x417e2b(0x194)](_0x24934b,_0x1fe10c);if(!_0x3cddd9)return 0x1;_0x46e662=_0x3cddd9[_0x417e2b(0x179)],_0x1faa5a=_0x3cddd9['workflowName'];}else{_0x1faa5a=_0x24934b[0x0],_0x46e662=_0x1fe10c[_0x417e2b(0x20b)];if(!_0x46e662)return console[_0x417e2b(0x23a)](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x242)),0x1;_0xdbaa98=!![];}}else{const _0x4d7618=this[_0x417e2b(0x194)](_0x24934b,_0x1fe10c);if(!_0x4d7618)return 0x1;_0x46e662=_0x4d7618['projectName'],_0x1faa5a=_0x4d7618[_0x417e2b(0x18c)];}if(_0x1fe10c['verbose']){if(_0x46e662&&_0x1faa5a)console['error']('Filter:\x20'+_0x46e662+'.'+_0x1faa5a);else _0x46e662&&console[_0x417e2b(0x23a)]('Filter:\x20project='+_0x46e662);}const _0x50409a=_0x1fe10c[_0x417e2b(0x1e9)],_0x3fffdf=_0x1fe10c['sessionId'];if(_0x50409a){_0x3fffdf&&console[_0x417e2b(0x23a)](a59_0x564dd3[_0x417e2b(0x204)](_0x417e2b(0xdf)),_0x417e2b(0xae));const _0x1bf3e1=_0x1fe10c[_0x417e2b(0x1c8)];return _0x1bf3e1?await this[_0x417e2b(0x23b)](_0x11a530,_0x50409a):await this[_0x417e2b(0xff)](_0x11a530,_0x50409a,_0x1fe10c),0x0;}if(_0x3fffdf){const _0x23f29c=await withSpinner(_0x417e2b(0x1e5),()=>_0x32e27e[_0x417e2b(0x14b)]['sessions']({'projectName':_0x46e662,'workflowName':_0x1faa5a,'limit':0x64}),{'verbose':_0x1fe10c[_0x417e2b(0x1ab)]}),_0xdbe941=_0x23f29c[_0x417e2b(0x138)][_0x417e2b(0x1b9)](_0x5f011c=>_0x5f011c['id']===_0x3fffdf);if(!_0xdbe941)return console['error'](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x16d)+_0x3fffdf),0x1;if(!_0xdbe941['lastAttempt']?.['id'])return console['error'](a59_0x564dd3[_0x417e2b(0x1a4)](_0x417e2b(0x168)),_0x417e2b(0x166)+_0x3fffdf+_0x417e2b(0x107)),0x1;const _0x11146e=_0xdbe941[_0x417e2b(0x20a)]['id'];_0x1fe10c[_0x417e2b(0x1ab)]&&console['error'](_0x417e2b(0x108)+_0x11146e+_0x417e2b(0x18a)+_0x3fffdf);const _0x4a0420=_0x1fe10c['follow'];return _0x4a0420?await this[_0x417e2b(0x23b)](_0x11a530,_0x11146e):await this['renderSingleTimeline'](_0x11a530,_0x11146e,_0x1fe10c),0x0;}const _0x38e657=await withSpinner(_0x417e2b(0x158),()=>_0x32e27e[_0x417e2b(0x14b)]['sessions']({'projectName':_0x46e662,'workflowName':_0x1faa5a,'limit':_0x1fe10c[_0x417e2b(0x7d)]||0x32}),{'verbose':_0x1fe10c['verbose']}),_0x523e28=_0x38e657['data'];if(_0x523e28[_0x417e2b(0x217)]===0x0){if(_0x46e662&&_0x1faa5a)console['error'](_0x417e2b(0x7f)+_0x46e662+'.'+_0x1faa5a);else _0x46e662?console[_0x417e2b(0x23a)](_0x417e2b(0xb5)+_0x46e662):(console[_0x417e2b(0x23a)]('No\x20workflow\x20sessions\x20found'),console['error'](a59_0x564dd3[_0x417e2b(0x6f)](_0x417e2b(0x127))));return 0x0;}_0x523e28[_0x417e2b(0x65)]((_0x4b76a,_0x21fcd3)=>{const _0x10471d=_0x417e2b,_0x18b826=_0x4b76a[_0x10471d(0xad)]||'',_0x3df45b=_0x21fcd3[_0x10471d(0xad)]||'';return _0x3df45b['localeCompare'](_0x18b826);});if(_0x1fe10c[_0x417e2b(0x1e8)]||_0x1fe10c[_0x417e2b(0x77)])return await handleSDKOutput(_0x523e28,_0x1fe10c),0x0;let _0x8d7e12;if(_0xdbaa98){const _0x3e2cb7=_0x523e28[0x0];if(!_0x3e2cb7['lastAttempt']?.['id'])return console[_0x417e2b(0x23a)](_0x417e2b(0x1e3)),0x0;_0x8d7e12=_0x3e2cb7[_0x417e2b(0x20a)]['id'],_0x1fe10c['verbose']&&console[_0x417e2b(0x23a)](_0x417e2b(0x6d)+_0x3e2cb7['sessionTime']);}else{const _0x403c5e=_0x523e28['map'](_0x4086b7=>{const _0x39963b=_0x417e2b,_0x5dbab1=getAttemptStatusDisplay(_0x4086b7[_0x39963b(0x20a)]);return{'title':_0x4086b7[_0x39963b(0xc6)]?.[_0x39963b(0x7b)]+'.'+_0x4086b7[_0x39963b(0x14b)]?.[_0x39963b(0x7b)]+_0x39963b(0x13b)+_0x4086b7[_0x39963b(0xad)]+'\x20'+_0x5dbab1[_0x39963b(0x186)],'value':_0x4086b7[_0x39963b(0x20a)]?.['id']||'','description':_0x5dbab1['text']};}),_0xa7cf54=await a59_0x17b23b({'type':_0x417e2b(0x1fc),'name':_0x417e2b(0x1e9),'message':_0x417e2b(0x90),'choices':_0x403c5e['filter'](_0x22a94c=>_0x22a94c[_0x417e2b(0x8b)]!=='')});if(!_0xa7cf54[_0x417e2b(0x1e9)])return 0x0;_0x8d7e12=_0xa7cf54[_0x417e2b(0x1e9)];}const _0x39f49f=_0x1fe10c[_0x417e2b(0x1c8)];return _0x39f49f?await this[_0x417e2b(0x23b)](_0x11a530,_0x8d7e12):await this[_0x417e2b(0xff)](_0x11a530,_0x8d7e12,_0x1fe10c),0x0;}async['renderSingleTimeline'](_0x57f03e,_0x3694dd,_0x44ff2b){const _0x3d309b=a59_0x34b1fc,{tdx:_0xda87f4}=_0x57f03e;let _0x2053d4,_0x121486;try{[_0x2053d4,_0x121486]=await Promise['all']([_0xda87f4['workflow'][_0x3d309b(0x22a)](_0x3694dd),_0xda87f4[_0x3d309b(0x14b)][_0x3d309b(0x148)](_0x3694dd,![])]);}catch(_0x64e84a){console[_0x3d309b(0x23a)](a59_0x564dd3[_0x3d309b(0x1a4)](_0x3d309b(0x103)));_0x44ff2b[_0x3d309b(0x1ab)]&&console['error'](_0x64e84a);throw _0x64e84a;}if(_0x44ff2b[_0x3d309b(0x1e8)]||_0x44ff2b[_0x3d309b(0x77)]){const _0x478ffb=this[_0x3d309b(0x208)](_0x2053d4,_0x121486);await handleSDKOutput([_0x478ffb],_0x44ff2b);return;}const _0x2885fd=_0xda87f4['context'][_0x3d309b(0xc7)],_0x86433b=this[_0x3d309b(0xbe)](_0x2053d4,_0x121486,_0x2885fd);console[_0x3d309b(0x223)](_0x86433b);}async[a59_0x34b1fc(0x23b)](_0x2744ae,_0x3a4df4){const _0x472b85=a59_0x34b1fc,{tdx:_0x21c886}=_0x2744ae,_0x5a4fda=TIMELINE_CONFIG[_0x472b85(0x1b0)],_0x20317d=TIMELINE_CONFIG[_0x472b85(0x226)];let _0x39f19c=0x0;while(_0x39f19c<_0x20317d){process['stdout'][_0x472b85(0x10b)]&&process[_0x472b85(0x122)][_0x472b85(0x22f)]('\x1Bc');let _0x524eb5,_0x3ee0d9;try{[_0x524eb5,_0x3ee0d9]=await Promise[_0x472b85(0x12a)]([_0x21c886[_0x472b85(0x14b)]['attempt'](_0x3a4df4),_0x21c886[_0x472b85(0x14b)]['tasks'](_0x3a4df4,![])]);}catch(_0x335c72){console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x1a4)](_0x472b85(0x141)));_0x39f19c>0x0&&console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x6f)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x39f19c));throw _0x335c72;}const _0x1fb99b=_0x21c886[_0x472b85(0x24c)]['site'],_0x5e5865=this[_0x472b85(0xbe)](_0x524eb5,_0x3ee0d9,_0x1fb99b);console[_0x472b85(0x223)](_0x5e5865);const _0x4f7695=_0x524eb5[_0x472b85(0xbc)]&&_0x3ee0d9[_0x472b85(0x1e4)](_0x25238b=>_0x25238b[_0x472b85(0x224)]!==_0x472b85(0x6e)&&_0x25238b[_0x472b85(0x224)]!==_0x472b85(0x1e2));if(_0x4f7695){console[_0x472b85(0x23a)](a59_0x564dd3['green'](_0x472b85(0x86)));break;}console[_0x472b85(0x23a)](a59_0x564dd3[_0x472b85(0x6f)]('\x0aPolling...\x20('+_0x39f19c*0x2+_0x472b85(0x24b))),await new Promise(_0xcf8387=>setTimeout(_0xcf8387,_0x5a4fda)),_0x39f19c++;}_0x39f19c>=_0x20317d&&console['error'](a59_0x564dd3[_0x472b85(0x204)](_0x472b85(0x164)));}[a59_0x34b1fc(0xbe)](_0x273aec,_0x2ab67b,_0x4f2c9e){const _0x313d72=a59_0x34b1fc,_0x53d9df=[],_0xa7ac31=TIMELINE_CONFIG[_0x313d72(0x15f)],_0x95d1a3=0x5,_0x59ea05=process['stdout'][_0x313d72(0x117)]||0x78,_0x590413=_0x59ea05-_0xa7ac31-_0x95d1a3,_0x3d22e2=Math[_0x313d72(0xc3)](TIMELINE_CONFIG[_0x313d72(0x1c2)],Math['min'](_0x590413,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1b6ab9=new Date(_0x273aec[_0x313d72(0xc0)])[_0x313d72(0x11a)](),_0x182127=_0x273aec[_0x313d72(0x10a)]?new Date(_0x273aec[_0x313d72(0x10a)])['getTime']():Date[_0x313d72(0x184)](),_0x1263ed={'start':_0x1b6ab9,'end':_0x182127,'duration':_0x182127-_0x1b6ab9},_0x45d2af=new Map(),_0x1e6c06=[];for(const _0x301686 of _0x2ab67b){if(_0x301686[_0x313d72(0x20c)]){const _0x5b39c9=new Date(_0x301686['startedAt'])['getTime'](),_0x266b66=_0x301686[_0x313d72(0xf0)]?new Date(_0x301686[_0x313d72(0xf0)])[_0x313d72(0x11a)]():Date['now'](),_0x521255={'start':_0x5b39c9,'end':_0x266b66,'duration':_0x266b66-_0x5b39c9};_0x45d2af['set'](_0x301686['id'],_0x521255),_0x1e6c06[_0x313d72(0x1f9)]({'name':_0x301686[_0x313d72(0x11e)],'state':_0x301686[_0x313d72(0x224)]||_0x313d72(0x195),'window':_0x521255});}else _0x1e6c06['push']({'name':_0x301686[_0x313d72(0x11e)],'state':_0x301686[_0x313d72(0x224)]||_0x313d72(0x1e2),'window':undefined});}_0x1e6c06['sort']((_0x516f7a,_0x3a4f73)=>{const _0xda3cd2=_0x313d72;if(!_0x516f7a[_0xda3cd2(0x13e)])return 0x1;if(!_0x3a4f73[_0xda3cd2(0x13e)])return-0x1;return _0x516f7a[_0xda3cd2(0x13e)]['start']-_0x3a4f73[_0xda3cd2(0x13e)][_0xda3cd2(0x17f)];});const _0x2e9c26=_0x1e6c06[_0x313d72(0x217)],_0x4cc2cf=_0x2e9c26>TIMELINE_CONFIG[_0x313d72(0x153)];_0x4cc2cf&&_0x1e6c06[_0x313d72(0xcc)](TIMELINE_CONFIG[_0x313d72(0x153)]);const _0x270956=calculateTimeScale(_0x1263ed,_0x3d22e2),_0x478915=_0x273aec[_0x313d72(0xbc)]?_0x273aec['success']?a59_0x564dd3[_0x313d72(0xcd)]('success'):a59_0x564dd3[_0x313d72(0x1a4)](_0x313d72(0x23a)):a59_0x564dd3['blue'](_0x313d72(0x6e)),_0x18b08b=_0x273aec[_0x313d72(0xc6)]?.['id'],_0x566caf=_0x273aec['sessionId'];let _0x22fa69;if(_0x18b08b&&_0x566caf){const _0x2151a7=getWorkflowAttemptUrl(_0x4f2c9e,_0x18b08b,_0x566caf,_0x273aec['id']);_0x22fa69=hyperlink(a59_0x564dd3[_0x313d72(0x6f)](_0x273aec['id']),_0x2151a7);}else _0x22fa69=a59_0x564dd3[_0x313d72(0x6f)](_0x273aec['id']);_0x53d9df[_0x313d72(0x1f9)](_0x313d72(0x116)+_0x22fa69+_0x313d72(0x13b)+_0x478915+_0x313d72(0x13b)+formatElapsed(_0x1263ed[_0x313d72(0x1d8)]));if(_0x1e6c06[_0x313d72(0x217)]>0x0){const _0x15a76c=renderTimeAxis(_0x270956,_0x3d22e2),_0x4a20ac=new Date(_0x1263ed[_0x313d72(0x17f)]),_0x4bcc41=formatDate(_0x4a20ac),_0x2ed9bf=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x313d72(0x238)]+_0xa7ac31,_0x5c3128=_0x4bcc41[_0x313d72(0x1a1)](_0x2ed9bf),_0x3fe4e7=a59_0x564dd3[_0x313d72(0x6f)](_0x5c3128);_0x53d9df[_0x313d72(0x1f9)](_0x3fe4e7+'\x20'+_0x15a76c);for(const _0x3de6eb of _0x1e6c06){_0x53d9df[_0x313d72(0x1f9)](renderTaskRow(_0x3de6eb,_0x270956,_0x3d22e2,_0xa7ac31));}const _0x1b60bd=calculateStats(_0x1e6c06);_0x53d9df['push'](formatStats(_0x1b60bd)),_0x4cc2cf&&_0x53d9df[_0x313d72(0x1f9)](a59_0x564dd3[_0x313d72(0x204)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x313d72(0xa2)+_0x2e9c26+'\x20tasks')),_0x53d9df[_0x313d72(0x1f9)](''),_0x53d9df[_0x313d72(0x1f9)](a59_0x564dd3[_0x313d72(0x6f)]('💡\x20Tip:\x20Use\x20')+(_0x313d72(0x74)+_0x273aec['id']+_0x313d72(0xa1))+a59_0x564dd3[_0x313d72(0x6f)](_0x313d72(0x19d)));}else _0x53d9df[_0x313d72(0x1f9)](_0x313d72(0xd6));return _0x53d9df[_0x313d72(0xf7)]('\x0a');}[a59_0x34b1fc(0x208)](_0x59103c,_0x1e9be9){const _0x1dc5db=a59_0x34b1fc,_0x86807f=new Date(_0x59103c['createdAt'])[_0x1dc5db(0x11a)](),_0x4198f9=_0x59103c[_0x1dc5db(0x10a)]?new Date(_0x59103c[_0x1dc5db(0x10a)])['getTime']():Date[_0x1dc5db(0x184)](),_0x1ecb61=_0x4198f9-_0x86807f,_0x4eff64=[];for(const _0x3967ef of _0x1e9be9){if(_0x3967ef[_0x1dc5db(0x20c)]){const _0x17a356=new Date(_0x3967ef['startedAt'])[_0x1dc5db(0x11a)](),_0x548200=_0x3967ef['updatedAt']?new Date(_0x3967ef[_0x1dc5db(0xf0)])['getTime']():Date[_0x1dc5db(0x184)]();_0x4eff64[_0x1dc5db(0x1f9)]({'name':_0x3967ef[_0x1dc5db(0x11e)],'state':_0x3967ef['state']||_0x1dc5db(0x195),'window':{'start':_0x17a356,'end':_0x548200,'duration':_0x548200-_0x17a356}});}else _0x4eff64[_0x1dc5db(0x1f9)]({'name':_0x3967ef[_0x1dc5db(0x11e)],'state':_0x3967ef[_0x1dc5db(0x224)]||_0x1dc5db(0x1e2),'window':undefined});}const _0x134b0e=calculateStats(_0x4eff64);return{'attempt':{'id':_0x59103c['id'],'status':_0x59103c['done']?_0x59103c[_0x1dc5db(0x1b7)]?'success':_0x1dc5db(0x23a):_0x1dc5db(0x6e),'createdAt':_0x59103c[_0x1dc5db(0xc0)],'finishedAt':_0x59103c['finishedAt'],'duration_ms':_0x1ecb61},'tasks':_0x4eff64['map'](_0x20f4c6=>({'name':_0x20f4c6[_0x1dc5db(0x7b)],'state':_0x20f4c6[_0x1dc5db(0x224)],'startedAt':_0x20f4c6['window']?new Date(_0x20f4c6[_0x1dc5db(0x13e)][_0x1dc5db(0x17f)])[_0x1dc5db(0x13a)]():null,'updatedAt':_0x20f4c6[_0x1dc5db(0x13e)]?new Date(_0x20f4c6[_0x1dc5db(0x13e)][_0x1dc5db(0x1f2)])[_0x1dc5db(0x13a)]():null,'duration_ms':_0x20f4c6[_0x1dc5db(0x13e)]?.[_0x1dc5db(0x1d8)]||null})),'stats':_0x134b0e};}}function formatScheduleLine(_0x43c8e5){const _0x42f4cd=a59_0x34b1fc,_0xa88a5=_0x43c8e5['disabledAt']?a59_0x564dd3['yellow'](_0x42f4cd(0xfd)):'',_0x208eac=_0x43c8e5[_0x42f4cd(0xc6)]?.['name']?a59_0x564dd3[_0x42f4cd(0x6f)]('\x20['+_0x43c8e5[_0x42f4cd(0xc6)]['name']+']'):'',_0x1ca01f=_0x43c8e5[_0x42f4cd(0x6a)]?a59_0x564dd3[_0x42f4cd(0x6f)](_0x42f4cd(0x248)+new Date(_0x43c8e5[_0x42f4cd(0x6a)])[_0x42f4cd(0xe7)]()):'';return _0x42f4cd(0x23f)+_0x43c8e5['id']+'\x20'+(_0x43c8e5[_0x42f4cd(0x14b)]?.[_0x42f4cd(0x7b)]||_0x42f4cd(0x23e))+_0x208eac+_0xa88a5+_0x1ca01f;}export class WorkflowSchedulesCommand extends WorkflowBaseCommand{[a59_0x34b1fc(0x7b)]='workflow:schedules';['description']=a59_0x34b1fc(0x218);async[a59_0x34b1fc(0x203)](_0x110ea5){const _0x4036c7=a59_0x34b1fc,{options:_0x597603,args:_0x2aabbf,tdx:_0x1581fb}=_0x110ea5,{scheduleId:_0xb48231}=_0x597603;if(_0xb48231&&_0x2aabbf[0x0])return console[_0x4036c7(0x23a)](a59_0x564dd3[_0x4036c7(0x1a4)](_0x4036c7(0x168)),_0x4036c7(0x15b)),console['error'](a59_0x564dd3[_0x4036c7(0x6f)](_0x4036c7(0xfe))),0x1;if(_0xb48231){const _0x31c5c8=await withSpinner(_0x4036c7(0x249)+_0xb48231+_0x4036c7(0x104),()=>_0x1581fb['workflow']['getSchedule'](_0xb48231),{'verbose':_0x597603['verbose']}),_0x560e5e=_0x31c5c8['data'];return isStructuredFormat(_0x597603)?await handleSingleObjectOutput(_0x560e5e,_0x597603):(console['error'](_0x4036c7(0x1cc)),console[_0x4036c7(0x223)](formatScheduleLine(_0x560e5e))),0x0;}const _0x501572=this[_0x4036c7(0x194)](_0x2aabbf,_0x597603);if(!_0x501572)return 0x1;const {projectName:_0x9d09d0,workflowName:_0x1502a2}=_0x501572,_0x35aa80=_0x9d09d0?'\x27'+_0x9d09d0+(_0x1502a2?'.'+_0x1502a2:'')+'\x27':undefined,_0x1f3372=await withSpinner(_0x35aa80?_0x4036c7(0x99)+_0x35aa80+_0x4036c7(0x104):'Listing\x20schedules...',()=>_0x9d09d0?_0x1581fb[_0x4036c7(0x14b)][_0x4036c7(0x211)](_0x9d09d0,{'workflow':_0x1502a2,'limit':_0x597603[_0x4036c7(0x7d)]}):_0x1581fb[_0x4036c7(0x14b)][_0x4036c7(0x142)]({'limit':_0x597603['limit']}),{'verbose':_0x597603[_0x4036c7(0x1ab)]}),_0x221e8a=_0x1f3372[_0x4036c7(0x138)],_0x3cae17=_0x597603[_0x4036c7(0x7d)]&&_0x221e8a['length']>=_0x597603[_0x4036c7(0x7d)]?a59_0x564dd3['dim'](_0x4036c7(0x1b4)):'';console[_0x4036c7(0x23a)](_0x4036c7(0x24a)+_0x221e8a[_0x4036c7(0x217)]+_0x4036c7(0x1a0)+(_0x221e8a['length']!==0x1?'s':'')+_0x3cae17);if(isStructuredFormat(_0x597603))await handleSDKOutput(_0x221e8a,_0x597603);else{if(_0x221e8a[_0x4036c7(0x217)]===0x0)console['log']('No\x20schedules\x20found');else for(const _0x3b4194 of _0x221e8a){console[_0x4036c7(0x223)](formatScheduleLine(_0x3b4194));}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x11c);['description']=a59_0x34b1fc(0x212);async[a59_0x34b1fc(0x203)](_0x5c7055){const _0x5dd46e=a59_0x34b1fc,{options:_0x5c5164,args:_0x4ed410,tdx:_0x876cb0}=_0x5c7055,_0x58de5a=_0x4ed410[0x0];if(!_0x58de5a)return console['error'](a59_0x564dd3[_0x5dd46e(0x1a4)](_0x5dd46e(0x168)),_0x5dd46e(0x1b1)),console[_0x5dd46e(0x23a)](a59_0x564dd3[_0x5dd46e(0x6f)](_0x5dd46e(0xc1))),console[_0x5dd46e(0x23a)](a59_0x564dd3[_0x5dd46e(0x6f)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const {backfill:_0x52961f,nextTime:_0x28c762}=_0x5c5164,_0x61f0e1={};if(_0x52961f!==undefined)_0x61f0e1[_0x5dd46e(0x96)]=!_0x52961f;if(_0x28c762!==undefined)_0x61f0e1[_0x5dd46e(0x198)]=_0x28c762;const _0x46b05a=await withSpinner(_0x5dd46e(0x128)+_0x58de5a+_0x5dd46e(0x104),()=>_0x876cb0[_0x5dd46e(0x14b)][_0x5dd46e(0x1d9)](_0x58de5a,_0x61f0e1),{'verbose':_0x5c5164[_0x5dd46e(0x1ab)]}),_0x42e218=_0x46b05a[_0x5dd46e(0x138)];return isStructuredFormat(_0x5c5164)?await handleSingleObjectOutput(_0x42e218,_0x5c5164):(console[_0x5dd46e(0x223)](_0x5dd46e(0xef)+_0x58de5a+_0x5dd46e(0x91)+(_0x42e218['workflow']?.[_0x5dd46e(0x7b)]||_0x5dd46e(0x195))+')'),_0x42e218[_0x5dd46e(0x6a)]&&console[_0x5dd46e(0x223)](a59_0x564dd3[_0x5dd46e(0x6f)](_0x5dd46e(0x139)+new Date(_0x42e218[_0x5dd46e(0x6a)])[_0x5dd46e(0xe7)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a59_0x34b1fc(0x7b)]=a59_0x34b1fc(0x1ca);[a59_0x34b1fc(0x229)]=a59_0x34b1fc(0x11b);async['execute'](_0x36df86){const _0x3c54aa=a59_0x34b1fc,{options:_0x5848a4,args:_0x234b40,tdx:_0xddab0}=_0x36df86,_0x285f96=_0x234b40[0x0];if(!_0x285f96)return console[_0x3c54aa(0x23a)](a59_0x564dd3[_0x3c54aa(0x1a4)](_0x3c54aa(0x168)),_0x3c54aa(0x1b1)),console['error'](a59_0x564dd3['dim'](_0x3c54aa(0xcb))),console[_0x3c54aa(0x23a)](a59_0x564dd3[_0x3c54aa(0x6f)](_0x3c54aa(0xd2))),0x1;const _0x110fdb=await withSpinner(_0x3c54aa(0x15d)+_0x285f96+_0x3c54aa(0x104),()=>_0xddab0[_0x3c54aa(0x14b)][_0x3c54aa(0x159)](_0x285f96),{'verbose':_0x5848a4['verbose']}),_0x5e9890=_0x110fdb['data'];return isStructuredFormat(_0x5848a4)?await handleSingleObjectOutput(_0x5e9890,_0x5848a4):console['log'](_0x3c54aa(0xef)+_0x285f96+'\x20disabled\x20('+(_0x5e9890[_0x3c54aa(0x14b)]?.[_0x3c54aa(0x7b)]||_0x3c54aa(0x195))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
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;}
1
+ function a60_0x31c6(_0x1a9c72,_0x22f1bf){_0x1a9c72=_0x1a9c72-0x1af;const _0xb7de74=a60_0xb7de();let _0x31c6da=_0xb7de74[_0x1a9c72];return _0x31c6da;}(function(_0x249039,_0x3b0941){const _0x58a96b=a60_0x31c6,_0x9df1e=_0x249039();while(!![]){try{const _0x200b87=-parseInt(_0x58a96b(0x1b3))/0x1+parseInt(_0x58a96b(0x1b5))/0x2*(parseInt(_0x58a96b(0x1b8))/0x3)+-parseInt(_0x58a96b(0x1b4))/0x4*(parseInt(_0x58a96b(0x1be))/0x5)+-parseInt(_0x58a96b(0x1b1))/0x6+parseInt(_0x58a96b(0x1ba))/0x7+parseInt(_0x58a96b(0x1bc))/0x8*(parseInt(_0x58a96b(0x1b6))/0x9)+-parseInt(_0x58a96b(0x1c1))/0xa;if(_0x200b87===_0x3b0941)break;else _0x9df1e['push'](_0x9df1e['shift']());}catch(_0x5b376c){_0x9df1e['push'](_0x9df1e['shift']());}}}(a60_0xb7de,0x1a1fc));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x2aaf34=a60_0x31c6,_0x25baf4=getVersion(),_0x4fad51=platform(),_0x52ffd0=process[_0x2aaf34(0x1b2)][_0x2aaf34(0x1b0)]('v','');return _0x2aaf34(0x1b9)+_0x25baf4+'\x20('+_0x4fad51+_0x2aaf34(0x1bb)+_0x52ffd0+')';}function a60_0xb7de(){const _0x4e3765=['36PsvXpZ','66elrFZx','367839NfvqUg','entries','10929wlvQNE','tdx/','763910xKeulQ',';\x20node/','24YLoNBh','length','9635hxBMmC','X-Trino-User','Authorization','743650oCFMlh','Bearer\x20','tdx','replace','891336EHipqb','version','4694XjnpBo'];a60_0xb7de=function(){return _0x4e3765;};return a60_0xb7de();}export function getAuthHeaders(_0x17b9c4,_0x4c0294,_0x471776){const _0x4d274a=a60_0x31c6,_0x2d5181=getVersion(),_0x5826ff={'User-Agent':getUserAgent(),'X-TD-Client':_0x4d274a(0x1af),'X-TD-Client-Version':_0x2d5181};if(_0x471776)_0x5826ff['Authorization']=_0x4d274a(0x1c2)+_0x471776;else _0x4c0294&&(_0x5826ff[_0x4d274a(0x1c0)]='TD1\x20'+_0x4c0294);return _0x5826ff;}export function toHeaderRecord(_0x5ceffb){const _0x154712=a60_0x31c6,_0x239b4e={};for(const [_0x837d0d,_0x476a90]of Object[_0x154712(0x1b7)](_0x5ceffb)){_0x476a90!==undefined&&(_0x239b4e[_0x837d0d]=_0x476a90);}return _0x239b4e;}export function getTrinoHeaders(_0x27bd99,_0x2104cb,_0x5d4cf8){const _0x1eb362=a60_0x31c6,_0x535678=getAuthHeaders(_0x27bd99),_0x4e828e=toHeaderRecord(_0x535678);if(_0x5d4cf8)_0x4e828e['Authorization']=_0x1eb362(0x1c2)+_0x5d4cf8;else _0x2104cb&&(_0x4e828e[_0x1eb362(0x1bf)]=_0x2104cb);return _0x4e828e;}export function hasAPIKey(_0x36adb2){const _0xaa0b18=a60_0x31c6,_0x1ff997=getAPIKey();return _0x1ff997!==undefined&&_0x1ff997[_0xaa0b18(0x1bd)]>0x0;}