@treasuredata/tdx 2026.3.31 → 2026.3.32

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 (256) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-login-command.js +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.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.d.ts +36 -0
  61. package/dist/commands/work-command.d.ts.map +1 -0
  62. package/dist/commands/work-command.js +1 -0
  63. package/dist/commands/work-command.js.map +1 -0
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.js +1 -1
  75. package/dist/core/profile.js +1 -1
  76. package/dist/core/project-config.d.ts +2 -0
  77. package/dist/core/project-config.d.ts.map +1 -1
  78. package/dist/core/project-config.js +1 -1
  79. package/dist/core/project-config.js.map +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.js +1 -1
  89. package/dist/proxy/claude-usage-tracker.js +1 -1
  90. package/dist/proxy/passthrough-server.js +1 -1
  91. package/dist/proxy/sse-usage-parser.js +1 -1
  92. package/dist/sdk/agent/agent-config.js +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.js +1 -1
  95. package/dist/sdk/agent/test/evaluator.js +1 -1
  96. package/dist/sdk/agent/test/executor.js +1 -1
  97. package/dist/sdk/agent/test/index.js +1 -1
  98. package/dist/sdk/agent/test/output.js +1 -1
  99. package/dist/sdk/agent/test/parser.js +1 -1
  100. package/dist/sdk/agent/tool-target-registry.js +1 -1
  101. package/dist/sdk/api.js +1 -1
  102. package/dist/sdk/cas/cas-api-client.js +1 -1
  103. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  104. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  105. package/dist/sdk/cas/index.js +1 -1
  106. package/dist/sdk/cas/pull-workflow.js +1 -1
  107. package/dist/sdk/cas/push-workflow.js +1 -1
  108. package/dist/sdk/client/cdp-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.js +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/llm-api-client.js +1 -1
  114. package/dist/sdk/client/oauth-refresh.js +1 -1
  115. package/dist/sdk/client/rate-limiter.js +1 -1
  116. package/dist/sdk/client/td-api-client.js +1 -1
  117. package/dist/sdk/client/trino-api-client.js +1 -1
  118. package/dist/sdk/client/workflow-client.js +1 -1
  119. package/dist/sdk/connection-validator.js +1 -1
  120. package/dist/sdk/connection.js +1 -1
  121. package/dist/sdk/delivery.js +1 -1
  122. package/dist/sdk/engage/campaign-pull.js +1 -1
  123. package/dist/sdk/engage/campaign-push.js +1 -1
  124. package/dist/sdk/engage/campaign-validator.js +1 -1
  125. package/dist/sdk/engage/campaign-yaml.js +1 -1
  126. package/dist/sdk/engage/template-pull.js +1 -1
  127. package/dist/sdk/engage/template-push.js +1 -1
  128. package/dist/sdk/engage/template-validator.js +1 -1
  129. package/dist/sdk/engage/template-yaml.js +1 -1
  130. package/dist/sdk/engage/types/campaign-def.js +1 -1
  131. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  132. package/dist/sdk/engage/types/template-schema.js +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/errors.js +1 -1
  135. package/dist/sdk/index.d.ts +1 -0
  136. package/dist/sdk/index.d.ts.map +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/index.js.map +1 -1
  139. package/dist/sdk/io/index.js +1 -1
  140. package/dist/sdk/io/node-filesystem.js +1 -1
  141. package/dist/sdk/job.js +1 -1
  142. package/dist/sdk/journey.js +1 -1
  143. package/dist/sdk/llm/chat-cache.js +1 -1
  144. package/dist/sdk/llm/index.js +1 -1
  145. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  146. package/dist/sdk/llm/model-factors.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/index.js +1 -1
  150. package/dist/sdk/query/sql-parser.js +1 -1
  151. package/dist/sdk/realtime.js +1 -1
  152. package/dist/sdk/schedule.js +1 -1
  153. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  154. package/dist/sdk/segment/fields-display.js +1 -1
  155. package/dist/sdk/segment/file-discovery.js +1 -1
  156. package/dist/sdk/segment/journey-utils.js +1 -1
  157. package/dist/sdk/segment/journey-validator.js +1 -1
  158. package/dist/sdk/segment/journey-yaml.js +1 -1
  159. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  160. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  161. package/dist/sdk/segment/pull-workflow.js +1 -1
  162. package/dist/sdk/segment/push-recovery.js +1 -1
  163. package/dist/sdk/segment/push-workflow.js +1 -1
  164. package/dist/sdk/segment/resolution-context.js +1 -1
  165. package/dist/sdk/segment/segment-path-parser.js +1 -1
  166. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  167. package/dist/sdk/segment/segment-validator.js +1 -1
  168. package/dist/sdk/segment/target-resolution.js +1 -1
  169. package/dist/sdk/segment/tdx-config.js +1 -1
  170. package/dist/sdk/segment/types/activation-schema.js +1 -1
  171. package/dist/sdk/segment/types/journey-def.js +1 -1
  172. package/dist/sdk/segment/types/journey-schema.js +1 -1
  173. package/dist/sdk/segment/types/segment-def.js +1 -1
  174. package/dist/sdk/segment/types/segment-schema.js +1 -1
  175. package/dist/sdk/segment/validate-files.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/index.d.ts +2 -0
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.d.ts +146 -0
  184. package/dist/sdk/types/workspace.d.ts.map +1 -0
  185. package/dist/sdk/types/workspace.js +1 -0
  186. package/dist/sdk/types/workspace.js.map +1 -0
  187. package/dist/sdk/user.js +1 -1
  188. package/dist/sdk/util/format-detector.js +1 -1
  189. package/dist/sdk/util/formatters.js +1 -1
  190. package/dist/sdk/util/index.js +1 -1
  191. package/dist/sdk/util/paginate.js +1 -1
  192. package/dist/sdk/util/tree-formatter.js +1 -1
  193. package/dist/sdk/workflow/archive-validation.js +1 -1
  194. package/dist/sdk/workflow/clone-workflow.js +1 -1
  195. package/dist/sdk/workflow/index.js +1 -1
  196. package/dist/sdk/workflow/pull-workflow.js +1 -1
  197. package/dist/sdk/workflow/push-workflow.js +1 -1
  198. package/dist/sdk/workflow/tdx-config.js +1 -1
  199. package/dist/sdk/workflow/workflow-utils.js +1 -1
  200. package/dist/sdk/workspace/frontmatter.d.ts +28 -0
  201. package/dist/sdk/workspace/frontmatter.d.ts.map +1 -0
  202. package/dist/sdk/workspace/frontmatter.js +1 -0
  203. package/dist/sdk/workspace/frontmatter.js.map +1 -0
  204. package/dist/sdk/workspace/git.d.ts +55 -0
  205. package/dist/sdk/workspace/git.d.ts.map +1 -0
  206. package/dist/sdk/workspace/git.js +1 -0
  207. package/dist/sdk/workspace/git.js.map +1 -0
  208. package/dist/sdk/workspace/index.d.ts +149 -0
  209. package/dist/sdk/workspace/index.d.ts.map +1 -0
  210. package/dist/sdk/workspace/index.js +1 -0
  211. package/dist/sdk/workspace/index.js.map +1 -0
  212. package/dist/sdk/workspace/skills.d.ts +34 -0
  213. package/dist/sdk/workspace/skills.d.ts.map +1 -0
  214. package/dist/sdk/workspace/skills.js +1 -0
  215. package/dist/sdk/workspace/skills.js.map +1 -0
  216. package/dist/sdk/workspace/templates.d.ts +17 -0
  217. package/dist/sdk/workspace/templates.d.ts.map +1 -0
  218. package/dist/sdk/workspace/templates.js +1 -0
  219. package/dist/sdk/workspace/templates.js.map +1 -0
  220. package/dist/sdk/workspace/wikilinks.d.ts +44 -0
  221. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -0
  222. package/dist/sdk/workspace/wikilinks.js +1 -0
  223. package/dist/sdk/workspace/wikilinks.js.map +1 -0
  224. package/dist/test-utils/command-runner.js +1 -1
  225. package/dist/test-utils/factories.js +1 -1
  226. package/dist/test-utils/fixtures.js +1 -1
  227. package/dist/test-utils/http-mock.js +1 -1
  228. package/dist/test-utils/index.js +1 -1
  229. package/dist/utils/async.js +1 -1
  230. package/dist/utils/colors.js +1 -1
  231. package/dist/utils/diff.js +1 -1
  232. package/dist/utils/file-permissions.js +1 -1
  233. package/dist/utils/file-reader.js +1 -1
  234. package/dist/utils/github-releases.js +1 -1
  235. package/dist/utils/global-cache.js +1 -1
  236. package/dist/utils/json-loader.js +1 -1
  237. package/dist/utils/local-cache.js +1 -1
  238. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  239. package/dist/utils/logger/formatters/index.js +1 -1
  240. package/dist/utils/logger/handlers/console-handler.js +1 -1
  241. package/dist/utils/logger/handlers/file-handler.js +1 -1
  242. package/dist/utils/logger/handlers/index.js +1 -1
  243. package/dist/utils/logger/handlers/null-handler.js +1 -1
  244. package/dist/utils/logger/index.js +1 -1
  245. package/dist/utils/logger/logger.js +1 -1
  246. package/dist/utils/logger/types.js +1 -1
  247. package/dist/utils/option-validation.js +1 -1
  248. package/dist/utils/process.js +1 -1
  249. package/dist/utils/prompt.js +1 -1
  250. package/dist/utils/spinner.js +1 -1
  251. package/dist/utils/sse-parser.js +1 -1
  252. package/dist/utils/string-utils.js +1 -1
  253. package/dist/utils/table-ref-parser.js +1 -1
  254. package/dist/utils/tdx-logger.js +1 -1
  255. package/dist/utils/version-check.js +1 -1
  256. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x15b982=a54_0xde2c;(function(_0x321865,_0x22aa20){const _0x30d908=a54_0xde2c,_0x291407=_0x321865();while(!![]){try{const _0x32c9f4=parseInt(_0x30d908(0x144))/0x1+parseInt(_0x30d908(0x1c1))/0x2+-parseInt(_0x30d908(0x15b))/0x3+parseInt(_0x30d908(0x147))/0x4+-parseInt(_0x30d908(0x1c7))/0x5+-parseInt(_0x30d908(0x16d))/0x6+parseInt(_0x30d908(0x208))/0x7;if(_0x32c9f4===_0x22aa20)break;else _0x291407['push'](_0x291407['shift']());}catch(_0x42a215){_0x291407['push'](_0x291407['shift']());}}}(a54_0x4524,0x941e0));import a54_0x21c86d from'chalk';import{existsSync}from'fs';import a54_0xe47c0a from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';function a54_0x4524(){const _0x1dddec=['sessions','Deleting\x20secret...','retryAttemptName','clear','revision:\x20','LABEL_WIDTH_DIVISOR','\x20\x20Files\x20extracted:\x20','trim','pending','\x0aFailed\x20to\x20fetch\x20attempt\x20data','unknown','renderTimeline','isTTY','utf-8','✔\x20Found\x20','fromTask','indexOf','\x20from\x20session\x20','index','follow','split','Loading\x20workflows...','size','revision','limit','startedAt','GUTTER','✔\x20Push\x20complete','log','getHours','Output\x20directory:\x20','List\x20workflows','displayLine','red','running','Setting\x20','includes','\x0aUpdate\x20existing\x20project\x20\x22','renderSessionsTimeline','No\x20log\x20content\x20found','MAX_LABEL_COUNT','Secrets\x20to\x20set:\x20','\x20\x20Changes:\x20','Error:\x20Project\x20name\x20is\x20required','changes','\x22\x20with\x20new\x20revision?','getFullYear','map','Killing\x20attempt...','preparePushProject','📋\x20','match','Downloading\x20logs...','cwd','\x0aDry\x20run\x20-\x20no\x20project\x20created','context','\x20\x20Session\x20context\x20set\x20to:\x20','Using\x20attempt\x20','lastAttempt','No\x20sessions\x20found\x20in\x20project:\x20','ICON_SPACING','Source:\x20','set','relative','workflowName','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','projects','resumeFrom','2033612CGGgKn','Filter:\x20','pollTimeline','state','applyPullProject','TASK_NAME_WIDTH','5816495LETKHU','Including\x20subtasks:\x20yes','repeat','length','prepareCloneProject','workflows','summary','/app/workflows/','Workflow:\x20','resolveProject','✔\x20Project\x20updated','join','session_id','Cloning\x20to\x20','sessionTime','params','...','window','\x0a✔\x20No\x20changes\x20to\x20push','Project\x20filter:\x20','Fetching\x20log\x20files...','.\x20Expected\x20format:\x20KEY=VALUE','rows','Retry\x20a\x20session\x20or\x20attempt','createdAt','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','resolve','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','/sessions/','\x22\x20to\x20new\x20project\x20\x22','Resolving\x20project\x20\x27','MAX_TIMELINE_WIDTH','→\x20New\x20project:\x20','workflow:secrets:delete','all','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20secrets...','POLL_INTERVAL_MS',',\x20Workflow:\x20','workflow:download','\x20secret','cyan','dim','Error:\x20','\x20is\x20not\x20a\x20directory','sourceDir','New\x20project\x20name:\x20','Downloading\x20project\x20','dryRun','session:','kill','generateSessionTimelineRows','execute','group_error','sessionId','Auto-selected\x20latest\x20session:\x20','error','\x20(use\x20--limit\x20to\x20show\x20more)','list','start','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','No\x20sessions\x20with\x20timing\x20information','/attempt/','select','1837297miKniQ','---\x20','trimEnd','Resume\x20from:\x20','retryAttempt','No\x20attempts\x20found','Select\x20a\x20task\x20to\x20view\x20logs:','workflow','Loading\x20session...','isArray','param','data','Listing\x20workflow\x20projects...','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','\x20task','No\x20workflow\x20sessions\x20found','newProjectName','attempt','skipValidation','\x20workflow','workflow:timeline','unchanged','Session\x20','slice','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','Loading\x20sessions...','Failed\x20to\x20fetch\x20attempt\x20data','blue','\x20\x20Attempt\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','setSecrets','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Setting\x20secret...','\x20\x20tdx\x20wf\x20use\x20<project>','from','workflow:push','projectId','deleted','localeCompare','navigateSessionsInteractive','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','table','getMinutes','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','icon','listSecrets','\x20attempt','padStart','stdout','resolveProjectId','workflowProject','\x0aPolling...\x20(','Retrying\x20session...','values','executeCloneProject','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Latest\x20session\x20has\x20no\x20attempt','MAX_TASKS_DISPLAY','getTime','getDate','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','📁\x20','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20deleted','Attempt\x20ID:\x20','taskName','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','\x20of\x20','value','includeRetried','✔\x20Clone\x20complete','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','deleteSecret','attempts','Usage:\x20tdx\x20wf\x20use\x20<project>','Listing\x20workflow\x20sessions...','Writing\x20files...','fill','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','msPerChar','\x22?\x20This\x20cannot\x20be\x20undone.','finishedAt','yes','✔\x20Secret\x20\x27','From\x20task:\x20','has','existingProjectId','newProjectId','targetDir','\x20\x20Target:\x20','modified','sys','Start\x20a\x20workflow\x20run','Listing\x20workflow\x20attempts...','requireProject','retrySession','workflow:attempt','download','\x20\x20New\x20attempt\x20ID:\x20','jsonl','Project\x20name:\x20','Revision:\x20','buildTimelineData','diff','project','name','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Warning:','\x20\x20Revision:\x20','Invalid\x20format:\x20','toISOString','durationMs','\x20tasks','task','Task\x20name:\x20','\x0aError:','updatedAt','path','Session\x20time:\x20','No\x20projects\x20match\x20pattern:\x20','Dry\x20run:\x20yes','status','Error:\x20Attempt\x20ID\x20is\x20required','parseProjectWorkflowPattern','parse','Total:\x20','attemptId','stringify','\x20\x20Workflow:\x20','✔\x20Showing\x20','Source\x20directory:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','getMonth','✔\x20Deleted\x20project\x20','session','List\x20workflow\x20execution\x20sessions','💡\x20Tip:\x20Use\x20','No\x20sessions\x20found\x20for:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','resolveProjectDir','MAX_POLL_ITERATIONS','Error:\x20Invalid\x20parameter\x20format:\x20','Cancelled','verbose','\x20\x20Location:\x20','reason','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','green','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Target\x20directory:\x20','cancelRequested','Project\x20name\x20is\x20required','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','key','success','floor','MIN_LABEL_COUNT','new','max','site','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','\x20-\x20','-\x20nothing\x20pushed','ICON_WIDTH','Filter:\x20project=','Key:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','json','\x20new','Attempt:\x20','splice','attempt:','Select\x20a\x20session\x20to\x20view\x20timeline:','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','includeSubtasks','\x20project','fs/promises','Pulling\x20project\x20','\x20\x20Source:\x20','sort','workflow:pull','write','find','output','end','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Project\x20ID:\x20','push','projectName','Show\x20tasks\x20for\x20an\x20attempt','Source\x20directory\x20is\x20required','now','workflow:kill','workflow:secrets:set','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','\x0a✔\x20Attempt\x20complete','\x0a⚠\x20Project\x20\x22','Reason:\x20','Analyzing\x20changes...','columns','get','\x0aDry\x20run\x20-\x20nothing\x20pushed','title','total','No\x20attempts\x20found\x20in\x20project:\x20','Error:','min','fileSize','MIN_TIMELINE_WIDTH','\x20\x20Project:\x20','sourceProjectName','duration','showWorkflowConsoleUrl','fullName','Getting\x20attempt\x20details...','workflow:sessions','Select\x20a\x20workflow\x20to\x20run','Pushing\x20workflow\x20project...','renderSingleTimeline','startTime','autocomplete','readFile','workflow:clone','\x20modified','yellow','done','No\x20workflow\x20projects\x20found','Show\x20specific\x20attempt\x20details','1140371monrOj','Project:\x20','workflow:secrets:list','3265716TQiWqX','Source\x20project:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','planned','Status:\x20','substring','format','List\x20workflow\x20attempts','toLowerCase','\x1b[1A\x1b[2K','Expected\x20format:\x20--param\x20key=value','Listing\x20secrets...','workflow:logs','force','targetExists','isNewProject','LABEL_MIN_SPACING','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','List\x20all\x20workflow\x20projects','type','1647480emERkB','delete','tasks','round','workflow:use','(unknown)','\x0aDry\x20run\x20-\x20no\x20files\x20written','keys','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x20unchanged','Force:\x20yes','✔\x20Pushed\x20','No\x20workflows\x20found','filter','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','logs','\x20sessions\x20','\x20has\x20no\x20attempts','5501580zsuKWs','fileCount','hasChanges','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','No\x20workflow\x20tdx.json\x20found','description','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20logs','\x20\x20Console:\x20','Files\x20to\x20upload:\x20','tdx.json','startsWith','Validation:\x20skipped','Target:\x20','\x20secrets\x20set\x20for\x20project\x20\x27','canceling'];a54_0x4524=function(){return _0x1dddec;};return a54_0x4524();}import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x5ddf8c from'prompts';function getAttemptStatusDisplay(_0x4448a6){const _0x83b941=a54_0xde2c;if(!_0x4448a6)return{'icon':'⏳','text':''};const {done:_0x3b69d4,success:_0xcb3f1d,cancelRequested:_0x291a74}=_0x4448a6;if(!_0x3b69d4)return _0x291a74?{'icon':'🛑','text':a54_0x21c86d[_0x83b941(0x140)](_0x83b941(0x17c))}:{'icon':'🔄','text':a54_0x21c86d[_0x83b941(0x223)](_0x83b941(0x19f))};if(_0xcb3f1d)return{'icon':'✅','text':a54_0x21c86d[_0x83b941(0xf2)]('success')};return{'icon':'❌','text':a54_0x21c86d[_0x83b941(0x19e)](_0x83b941(0x200))};}function a54_0xde2c(_0x24e70e,_0x35bc37){_0x24e70e=_0x24e70e-0xeb;const _0x452410=a54_0x4524();let _0xde2cca=_0x452410[_0x24e70e];return _0xde2cca;}export class WorkflowBaseCommand extends BaseCommand{[a54_0x15b982(0x1d0)](_0x526a45,_0x27b1c0,_0x39f106=0x0){return _0x526a45[_0x39f106]||_0x27b1c0['workflowProject'];}[a54_0x15b982(0x266)](_0xbd9beb,_0x4de3e6,_0x2b9498=0x0){const _0xfa91f2=a54_0x15b982,_0x33f71b=this[_0xfa91f2(0x1d0)](_0xbd9beb,_0x4de3e6,_0x2b9498);if(!_0x33f71b)return console[_0xfa91f2(0x200)](a54_0x21c86d[_0xfa91f2(0x19e)](_0xfa91f2(0x12d)),_0xfa91f2(0xf6)),console['error'](a54_0x21c86d[_0xfa91f2(0x1f2)](_0xfa91f2(0x163))),null;return _0x33f71b;}['parseProjectWorkflowPattern'](_0x27d9b9,_0x5f1521){const _0x4d7cae=a54_0x15b982;if(_0x27d9b9[0x0]){const _0x3d05dd=_0x27d9b9[0x0][_0x4d7cae(0x191)]('.');if(_0x3d05dd[_0x4d7cae(0x1ca)]===0x1)return{'projectName':_0x3d05dd[0x0],'workflowName':undefined};else return _0x3d05dd[_0x4d7cae(0x1ca)]===0x2?{'projectName':_0x3d05dd[0x0],'workflowName':_0x3d05dd[0x1]}:(console[_0x4d7cae(0x200)](a54_0x21c86d['red'](_0x4d7cae(0x12d)),_0x4d7cae(0x1e1)),null);}return{'projectName':_0x5f1521[_0x4d7cae(0x23a)],'workflowName':undefined};}[a54_0x15b982(0x294)](_0x569cd6,_0x43a230,_0x10f888=0x0){const _0x5ea582=a54_0x15b982;if(_0x569cd6[_0x10f888])return _0x569cd6[_0x10f888];if(_0x43a230['workflowProject']){const _0x316e54=a54_0xe47c0a[_0x5ea582(0x1d2)](process[_0x5ea582(0x1b2)](),'workflows',_0x43a230[_0x5ea582(0x23a)]);if(existsSync(a54_0xe47c0a['join'](_0x316e54,_0x5ea582(0x177))))return _0x316e54;}return undefined;}async['showWorkflowConsoleUrl'](_0x3ffd9b,_0x14336a,_0x4617cb){const _0x42d9d4=a54_0x15b982;try{const _0x5c378c=await _0x3ffd9b[_0x42d9d4(0x20f)][_0x42d9d4(0x1cc)](_0x14336a,{'limit':0x1});if(_0x5c378c[_0x42d9d4(0x1ca)]>0x0){const _0x140a65=_0x5c378c[0x0]['id'],_0x5a6dee=getWorkflowUrl(_0x4617cb,_0x140a65);console[_0x42d9d4(0x200)](_0x42d9d4(0x175)+a54_0x21c86d['cyan'](_0x5a6dee));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x15b982(0x15f);[a54_0x15b982(0x172)]=a54_0x15b982(0x28c);async[a54_0x15b982(0x1fc)](_0x4ed831){const _0x3da0d1=a54_0x15b982,{options:_0x5f02d9,args:_0x3b9143,tdx:_0x4c198f}=_0x4ed831,_0x349877=_0x3b9143[0x0],_0x109305=_0x5f02d9[_0x3da0d1(0x180)];if(_0x109305)return saveSessionContext({'workflow_project':undefined},_0x5f02d9[_0x3da0d1(0x28f)]),console[_0x3da0d1(0x199)](a54_0x21c86d['green']('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x349877)return console[_0x3da0d1(0x200)](a54_0x21c86d[_0x3da0d1(0x19e)]('Error:'),_0x3da0d1(0xf6)),console[_0x3da0d1(0x200)](a54_0x21c86d[_0x3da0d1(0x1f2)](_0x3da0d1(0x252))),console[_0x3da0d1(0x200)](a54_0x21c86d['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x2e9c3c=await withSpinner(_0x3da0d1(0x1e6)+_0x349877+'\x27...',()=>_0x4c198f[_0x3da0d1(0x20f)][_0x3da0d1(0x239)](_0x349877),{'verbose':_0x5f02d9[_0x3da0d1(0xee)]}),{name:_0x4dcc94}=_0x2e9c3c['data'];return saveSessionContext({'workflow_project':_0x4dcc94},_0x5f02d9[_0x3da0d1(0x28f)]),console[_0x3da0d1(0x199)](a54_0x21c86d[_0x3da0d1(0xf2)](_0x3da0d1(0x246)+a54_0x21c86d[_0x3da0d1(0x1f1)](_0x4dcc94))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']='workflow:projects';['description']=a54_0x15b982(0x159);async[a54_0x15b982(0x1fc)](_0x59a8b7){const _0x8291d9=a54_0x15b982,{options:_0x23b495,args:_0x51792d,tdx:_0x52908d}=_0x59a8b7,_0x2f9282=_0x51792d[0x0];_0x23b495[_0x8291d9(0xee)]&&_0x2f9282&&console[_0x8291d9(0x200)]('Pattern:\x20'+_0x2f9282);const _0x43adcf=await withSpinner(_0x8291d9(0x214),()=>_0x52908d[_0x8291d9(0x20f)][_0x8291d9(0x1bf)](_0x2f9282,{'limit':_0x23b495[_0x8291d9(0x195)]}),{'verbose':_0x23b495[_0x8291d9(0xee)]});let _0x1d1c42=_0x43adcf[_0x8291d9(0x213)];_0x1d1c42[_0x8291d9(0x113)]((_0x2a2d86,_0x3b3c73)=>_0x2a2d86['name'][_0x8291d9(0x22e)](_0x3b3c73[_0x8291d9(0x271)]));const _0x19faa8=_0x23b495['limit']||0x64,_0x48c100=_0x1d1c42[_0x8291d9(0x1ca)]>=_0x19faa8?a54_0x21c86d['dim'](_0x8291d9(0x201)):'';console[_0x8291d9(0x200)](_0x8291d9(0x18b)+_0x1d1c42['length']+_0x8291d9(0x10f)+(_0x1d1c42['length']!==0x1?'s':'')+_0x48c100);if(_0x23b495[_0x8291d9(0x14d)]===_0x8291d9(0x107)||_0x23b495[_0x8291d9(0x14d)]===_0x8291d9(0x26b)||_0x23b495[_0x8291d9(0x14d)]===_0x8291d9(0x231))await handleSDKOutput(_0x1d1c42,_0x23b495);else{if(_0x1d1c42[_0x8291d9(0x1ca)]===0x0)_0x2f9282?console[_0x8291d9(0x199)](_0x8291d9(0x280)+_0x2f9282):console[_0x8291d9(0x199)](_0x8291d9(0x142));else{const _0x1036f3=_0x1d1c42[_0x8291d9(0x1ac)](_0x5f0846=>{const _0x12c43d=_0x8291d9,_0x42409a=_0x5f0846['metadata']?.['some'](_0x3e6199=>_0x3e6199[_0x12c43d(0xf8)]===_0x12c43d(0x263)),_0x170aaa=_0x42409a?a54_0x21c86d[_0x12c43d(0x1f2)]('\x20(system)'):'';return _0x12c43d(0x245)+_0x5f0846[_0x12c43d(0x271)]+_0x170aaa;});await writeOutput(_0x1036f3[_0x8291d9(0x1d2)]('\x0a'),_0x23b495[_0x8291d9(0x117)],_0x8291d9(0x202));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a54_0x15b982(0x172)]=a54_0x15b982(0x19c);async[a54_0x15b982(0x1fc)](_0x4d9413){const _0x1accfa=a54_0x15b982,{options:_0x5d8dd4,args:_0x4b876b,tdx:_0x31165a}=_0x4d9413,_0x4883d2=this[_0x1accfa(0x1d0)](_0x4b876b,_0x5d8dd4);_0x5d8dd4[_0x1accfa(0xee)]&&_0x4883d2&&console['error'](_0x1accfa(0x1da)+_0x4883d2);const _0x5cd10d=await withSpinner('Listing\x20workflows...',()=>_0x31165a['workflow'][_0x1accfa(0x1cc)](_0x4883d2,{'limit':_0x5d8dd4[_0x1accfa(0x195)]}),{'verbose':_0x5d8dd4['verbose']});let _0x212d38=_0x5cd10d[_0x1accfa(0x213)];_0x212d38[_0x1accfa(0x113)]((_0x4d512c,_0x2d3cd6)=>{const _0x39c21c=_0x1accfa,_0x197877=_0x4d512c[_0x39c21c(0x271)][_0x39c21c(0x22e)](_0x2d3cd6[_0x39c21c(0x271)]);if(_0x197877!==0x0)return _0x197877;return(_0x4d512c['project']?.['name']||'')['localeCompare'](_0x2d3cd6[_0x39c21c(0x270)]?.[_0x39c21c(0x271)]||'');});const _0x59a1ab=_0x5d8dd4[_0x1accfa(0x195)]||0x64,_0x387e8a=_0x212d38[_0x1accfa(0x1ca)]>=_0x59a1ab?a54_0x21c86d[_0x1accfa(0x1f2)](_0x1accfa(0x201)):'';console[_0x1accfa(0x200)]('✔\x20Found\x20'+_0x212d38['length']+_0x1accfa(0x21b)+(_0x212d38[_0x1accfa(0x1ca)]!==0x1?'s':'')+_0x387e8a);if(_0x5d8dd4[_0x1accfa(0x14d)]===_0x1accfa(0x107)||_0x5d8dd4[_0x1accfa(0x14d)]==='jsonl'||_0x5d8dd4[_0x1accfa(0x14d)]===_0x1accfa(0x231))await handleSDKOutput(_0x212d38,_0x5d8dd4);else{if(_0x212d38[_0x1accfa(0x1ca)]===0x0)_0x4883d2?console[_0x1accfa(0x199)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x4883d2):console[_0x1accfa(0x199)](_0x1accfa(0x167));else{const _0xed36c5=_0x5d8dd4[_0x1accfa(0xfe)],_0x146191=_0x212d38[_0x1accfa(0x1ac)](_0x4f6fdd=>{const _0x1aa415=_0x1accfa,_0x51dc8e=a54_0x21c86d[_0x1aa415(0x1f2)]('#'+_0x4f6fdd['id']),_0xac6157=hyperlink(_0x51dc8e,getWorkflowUrl(_0xed36c5,_0x4f6fdd['id'])),_0x50300e=_0x4f6fdd[_0x1aa415(0x270)]?.[_0x1aa415(0x271)]?a54_0x21c86d[_0x1aa415(0x1f2)]('\x20('+_0x4f6fdd[_0x1aa415(0x270)][_0x1aa415(0x271)]+')'):'';return _0x1aa415(0x1af)+_0xac6157+'\x20'+_0x4f6fdd[_0x1aa415(0x271)]+_0x50300e;});await writeOutput(_0x146191['join']('\x0a'),_0x5d8dd4[_0x1accfa(0x117)],_0x1accfa(0x202));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a54_0x15b982(0x137);[a54_0x15b982(0x172)]=a54_0x15b982(0x290);async['execute'](_0x33fa78){const _0x23cb34=a54_0x15b982,{options:_0x5a1f6d,args:_0x418628,tdx:_0x9319ed}=_0x33fa78,_0x113b91=this['parseProjectWorkflowPattern'](_0x418628,_0x5a1f6d);if(!_0x113b91)return 0x1;const {projectName:_0x5efabf,workflowName:_0x3aa827}=_0x113b91;if(_0x5a1f6d['verbose']){if(_0x5efabf&&_0x3aa827)console[_0x23cb34(0x200)]('Filter:\x20'+_0x5efabf+'.'+_0x3aa827);else _0x5efabf&&console[_0x23cb34(0x200)](_0x23cb34(0x104)+_0x5efabf);const _0x25f9b3=_0x5a1f6d['status'];_0x25f9b3&&console[_0x23cb34(0x200)](_0x23cb34(0x14b)+_0x25f9b3);}let _0xcfc2ac=0x28;if(process[_0x23cb34(0x238)][_0x23cb34(0x189)]&&!_0x5a1f6d[_0x23cb34(0x117)]&&!_0x5a1f6d[_0x23cb34(0x14d)]){const _0x45c7d6=process[_0x23cb34(0x238)]['rows']||0x28;_0xcfc2ac=Math[_0x23cb34(0xfd)](0x14,Math[_0x23cb34(0xfa)](_0x45c7d6*0x2/0x3));}const _0x51b00b=_0x5a1f6d[_0x23cb34(0x195)]||_0xcfc2ac,_0x596810=await withSpinner(_0x23cb34(0x253),()=>_0x9319ed[_0x23cb34(0x20f)][_0x23cb34(0x17d)]({'projectName':_0x5efabf,'workflowName':_0x3aa827,'status':_0x5a1f6d[_0x23cb34(0x282)],'fromTime':_0x5a1f6d[_0x23cb34(0x22a)],'toTime':_0x5a1f6d['to'],'limit':_0x51b00b}),{'verbose':_0x5a1f6d[_0x23cb34(0xee)]}),_0x4bc9c9=_0x596810[_0x23cb34(0x213)];_0x4bc9c9[_0x23cb34(0x113)]((_0x1c8445,_0x18cdc2)=>{const _0xbccaad=_0x23cb34,_0x2dcae9=_0x1c8445[_0xbccaad(0x1d5)]||'',_0x503f79=_0x18cdc2[_0xbccaad(0x1d5)]||'';return _0x503f79[_0xbccaad(0x22e)](_0x2dcae9);});_0x4bc9c9[_0x23cb34(0x1ca)]>=_0x51b00b?console[_0x23cb34(0x200)](_0x23cb34(0x28a)+_0x4bc9c9[_0x23cb34(0x1ca)]+_0x23cb34(0x16b)+a54_0x21c86d[_0x23cb34(0x1f2)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x23cb34(0x200)](_0x23cb34(0x18b)+_0x4bc9c9['length']+'\x20session'+(_0x4bc9c9[_0x23cb34(0x1ca)]!==0x1?'s':''));if(_0x5a1f6d[_0x23cb34(0x14d)]===_0x23cb34(0x107)||_0x5a1f6d[_0x23cb34(0x14d)]===_0x23cb34(0x26b)||_0x5a1f6d[_0x23cb34(0x14d)]==='table')await handleSDKOutput(_0x4bc9c9,_0x5a1f6d);else{if(!process[_0x23cb34(0x238)][_0x23cb34(0x189)]||_0x5a1f6d[_0x23cb34(0x117)]){if(_0x4bc9c9[_0x23cb34(0x1ca)]===0x0){if(_0x5efabf&&_0x3aa827)console[_0x23cb34(0x199)](_0x23cb34(0x292)+_0x5efabf+'.'+_0x3aa827);else _0x5efabf?console['log'](_0x23cb34(0x1b8)+_0x5efabf):console['log']('No\x20sessions\x20found');}else{const _0x167de5=_0x5a1f6d['site'],_0x133e18=this[_0x23cb34(0x1a3)](_0x4bc9c9,_0x167de5);_0x5a1f6d[_0x23cb34(0x117)]?await writeOutput(_0x133e18,_0x5a1f6d[_0x23cb34(0x117)],_0x23cb34(0x202)):console['log'](_0x133e18);}!_0x5efabf&&(console[_0x23cb34(0x200)](''),console[_0x23cb34(0x200)](a54_0x21c86d[_0x23cb34(0x1f2)](_0x23cb34(0x273))),console[_0x23cb34(0x200)](a54_0x21c86d[_0x23cb34(0x1f2)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x21c86d[_0x23cb34(0x1f2)](_0x23cb34(0x229))));}else{if(_0x4bc9c9[_0x23cb34(0x1ca)]===0x0){if(_0x5efabf&&_0x3aa827)console[_0x23cb34(0x199)]('No\x20sessions\x20found\x20for:\x20'+_0x5efabf+'.'+_0x3aa827);else _0x5efabf?console[_0x23cb34(0x199)](_0x23cb34(0x1b8)+_0x5efabf):console[_0x23cb34(0x199)]('No\x20sessions\x20found');}else await this['navigateSessionsInteractive'](_0x4bc9c9,_0x33fa78,_0x5efabf);}}return 0x0;}['renderSessionsTimeline'](_0x4ee7e2,_0xb78bf4){const _0x24abce=a54_0x15b982,_0x1f610a=[],_0x2e2246=new Map();let _0x452a23=Infinity,_0x25dd96=-Infinity;for(const _0x4ca249 of _0x4ee7e2){if(_0x4ca249['lastAttempt']?.['createdAt']){const _0x400363=new Date(_0x4ca249['lastAttempt'][_0x24abce(0x1df)])[_0x24abce(0x242)](),_0x1188fe=_0x4ca249[_0x24abce(0x1b7)]['finishedAt']?new Date(_0x4ca249[_0x24abce(0x1b7)][_0x24abce(0x259)])['getTime']():Date[_0x24abce(0x11f)](),_0xd2e26=_0x4ca249[_0x24abce(0x270)]?.[_0x24abce(0x271)]||_0x24abce(0x160);!_0x2e2246[_0x24abce(0x25d)](_0xd2e26)&&_0x2e2246[_0x24abce(0x1bb)](_0xd2e26,[]),_0x2e2246[_0x24abce(0x128)](_0xd2e26)['push']({'session':_0x4ca249,'startTime':_0x400363,'endTime':_0x1188fe,'duration':_0x1188fe-_0x400363}),_0x452a23=Math['min'](_0x452a23,_0x400363),_0x25dd96=Math[_0x24abce(0xfd)](_0x25dd96,_0x1188fe);}}if(_0x2e2246[_0x24abce(0x193)]===0x0)return _0x24abce(0x205);const _0x1c5f25=process['stdout'][_0x24abce(0x127)]||0x78,_0x5a7554=0x1e,_0x1f2f73=0x32,_0x39c395=0x4,_0x34b42c=Math[_0x24abce(0x12e)](_0x1f2f73,Math[_0x24abce(0xfd)](_0x5a7554,Math[_0x24abce(0xfa)](_0x1c5f25*0.3))),_0xb9b191=_0x1c5f25-_0x34b42c-TIMELINE_CONFIG[_0x24abce(0x197)]-0x3-_0x39c395,_0x40c713=_0x25dd96-_0x452a23,_0x13d25f=_0x40c713/_0x34b42c,_0x381baa=renderTimeAxis({'startTime':_0x452a23,'endTime':_0x25dd96,'durationMs':_0x40c713,'msPerChar':_0x13d25f},_0x34b42c),_0x476fd7=[];for(const _0x1760d3 of _0x2e2246[_0x24abce(0x23d)]()){_0x476fd7[_0x24abce(0x11b)](..._0x1760d3);}_0x476fd7[_0x24abce(0x113)]((_0x35a2c8,_0x321da2)=>_0x321da2[_0x24abce(0x13b)]-_0x35a2c8['startTime']);const _0x3d7aa5=new Date(_0x452a23),_0x2c176f=formatDate(_0x3d7aa5),_0x490815=_0x39c395+TIMELINE_CONFIG[_0x24abce(0x103)]+TIMELINE_CONFIG['ICON_SPACING']+_0xb9b191,_0x236296='\x20'[_0x24abce(0x1c9)](_0x490815-_0x2c176f['length']),_0x41f5ff=_0x236296+a54_0x21c86d['dim'](_0x2c176f)+'\x20'+_0x381baa;_0x1f610a[_0x24abce(0x11b)](_0x41f5ff);const _0x2ca363=0x16;let _0x1bcbab=0x0;for(const _0x1881a3 of _0x476fd7){const _0x1ac7ba=_0x1881a3[_0x24abce(0x28f)][_0x24abce(0x270)]?.[_0x24abce(0x271)]||'?',_0x2617a5=Math[_0x24abce(0x12e)](stringWidth(_0x1ac7ba),_0x2ca363);_0x1bcbab=Math[_0x24abce(0xfd)](_0x1bcbab,_0x2617a5);}for(const _0xb72eb of _0x476fd7){const {session:_0x3886e1,startTime:_0x5bb87f,endTime:_0x385e3b,duration:_0x4ff9ff}=_0xb72eb,_0x3ee664=_0x3886e1[_0x24abce(0x270)]?.['id'],_0x39b3ba=_0x3886e1['id'],_0x2bf126=_0x3886e1['project']?.[_0x24abce(0x271)]||'?',_0x4a68ab=_0x3886e1[_0x24abce(0x20f)]?.[_0x24abce(0x271)]||'?';let _0x516651,_0x498c08;if(_0x3886e1[_0x24abce(0x1b7)]){const _0x5269dd=_0x3886e1[_0x24abce(0x1b7)];!_0x5269dd['done']?(_0x516651=_0x5269dd['cancelRequested']?'🛑':'🔄',_0x498c08=_0x5269dd['cancelRequested']?a54_0x21c86d[_0x24abce(0x140)]:a54_0x21c86d[_0x24abce(0x223)]):(_0x516651=_0x5269dd[_0x24abce(0xf9)]?'✅':'❌',_0x498c08=_0x5269dd[_0x24abce(0xf9)]?a54_0x21c86d['green']:a54_0x21c86d[_0x24abce(0x19e)]);}else _0x516651='⏳',_0x498c08=a54_0x21c86d[_0x24abce(0x1f2)];const _0x5bb6a1='#'+_0x39b3ba,_0x11cb77=_0x3ee664?hyperlink(_0x5bb6a1,getWorkflowSessionUrl(_0xb78bf4,_0x3ee664,_0x39b3ba)):_0x5bb6a1;let _0x411706=_0x2bf126;stringWidth(_0x2bf126)>_0x2ca363&&(_0x411706=_0x2bf126[_0x24abce(0x21f)](0x0,_0x2ca363-0x1)+'…');const _0x7bf6a1=a54_0x21c86d[_0x24abce(0x1f2)](_0x411706),_0x52dd67=stringWidth(_0x411706),_0x6ae3e5='\x20'[_0x24abce(0x1c9)](_0x1bcbab-stringWidth(_0x411706)+0x2),_0x19def7='('+formatElapsed(_0x4ff9ff)+')',_0x5aee98=stringWidth(_0x19def7),_0x590130=stringWidth(_0x5bb6a1),_0x5dae6d=_0x590130+0x1+_0x52dd67+_0x6ae3e5[_0x24abce(0x1ca)],_0x9849c9=_0xb9b191-_0x5dae6d-_0x5aee98-0x1-0x8;let _0x532a3a=_0x4a68ab;stringWidth(_0x532a3a)>_0x9849c9&&(_0x532a3a=_0x532a3a[_0x24abce(0x21f)](0x0,_0x9849c9-0x1)+'…');const _0x199ef2=_0x11cb77+'\x20'+_0x7bf6a1+_0x6ae3e5+_0x532a3a,_0x298ddc=stringWidth(_0x199ef2),_0x6119dd=_0xb9b191-_0x298ddc-_0x5aee98,_0x51edfd=_0x199ef2+'\x20'[_0x24abce(0x1c9)](Math[_0x24abce(0xfd)](0x1,_0x6119dd))+a54_0x21c86d[_0x24abce(0x1f2)](_0x19def7),_0x5b43f1=Math[_0x24abce(0xfa)]((_0x5bb87f-_0x452a23)/_0x13d25f),_0x590da7=Math[_0x24abce(0xfa)]((_0x385e3b-_0x452a23)/_0x13d25f),_0x4969f3=Math[_0x24abce(0xfd)](_0x5b43f1+0x1,_0x590da7),_0x46575e=new Array(_0x34b42c)['fill']('\x20');for(let _0x17e270=_0x5b43f1;_0x17e270<Math[_0x24abce(0x12e)](_0x4969f3,_0x34b42c);_0x17e270++){_0x46575e[_0x17e270]='─';}const _0x24d850=_0x46575e[_0x24abce(0x1ac)](_0x1c4972=>_0x1c4972==='\x20'?'\x20':_0x498c08(_0x1c4972))[_0x24abce(0x1d2)]('');_0x1f610a['push'](_0x516651+'\x20'+_0x51edfd+'│'+_0x24d850+'│');}return _0x1f610a[_0x24abce(0x1d2)]('\x0a');}async[a54_0x15b982(0x22f)](_0x2b7baa,_0x4f4aee,_0x438ec0){const _0x183141=a54_0x15b982,{options:_0x49759a,tdx:_0x3115f9}=_0x4f4aee,_0x384a27=_0x49759a[_0x183141(0xfe)],{timelineRows:_0x58a8c9,timeAxisHeader:_0x46f382}=this[_0x183141(0x1fb)](_0x2b7baa,_0x384a27),_0x35037a=_0x58a8c9['filter'](_0x34bb21=>_0x34bb21[_0x183141(0x287)]);if(_0x35037a[_0x183141(0x1ca)]===0x0){const _0x481ddf=this['renderSessionsTimeline'](_0x2b7baa,_0x384a27);console[_0x183141(0x199)](_0x481ddf);!_0x438ec0&&(console[_0x183141(0x200)](''),console[_0x183141(0x200)](a54_0x21c86d['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x183141(0x200)](a54_0x21c86d[_0x183141(0x1f2)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x21c86d[_0x183141(0x1f2)](_0x183141(0x229))));return;}_0x46f382&&console[_0x183141(0x199)](_0x46f382);const _0x40269f=_0x58a8c9['filter'](_0x47dc3e=>_0x47dc3e[_0x183141(0x287)])['map'](_0x374e16=>({'title':_0x374e16[_0x183141(0x19d)],'value':_0x374e16[_0x183141(0x287)]})),_0x4adfd1=process['stdout'][_0x183141(0x1dd)]||0x3c,_0x40104d=Math[_0x183141(0xfd)](0x28,Math[_0x183141(0xfa)](_0x4adfd1*0x2/0x3)),_0x2002c7=await a54_0x5ddf8c({'type':_0x183141(0x13c),'name':_0x183141(0x287),'message':_0x183141(0x169),'choices':_0x40269f,'initial':-0x1,'limit':_0x40104d,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x4168a5,_0x2c9b4a)=>{const _0x2418df=_0x183141;if(!_0x4168a5)return Promise[_0x2418df(0x1e2)](_0x2c9b4a);const _0x5b52ac=_0x2c9b4a[_0x2418df(0x168)](_0x267688=>{const _0x327fb9=_0x2418df,_0x598b9a=_0x267688;return _0x598b9a[_0x327fb9(0x12a)]['toLowerCase']()[_0x327fb9(0x1a1)](_0x4168a5[_0x327fb9(0x14f)]());});return Promise[_0x2418df(0x1e2)](_0x5b52ac);}}),_0x44dd76=()=>{const _0x5c8023=_0x183141;process[_0x5c8023(0x238)][_0x5c8023(0x115)]('\x1b[1A\x1b[2K'),process[_0x5c8023(0x238)][_0x5c8023(0x115)](_0x5c8023(0x150)),process['stdout']['write'](_0x5c8023(0x150));},_0xed20bd=_0x2002c7&&_0x2002c7['attemptId']&&_0x2002c7[_0x183141(0x287)]!==null&&_0x2002c7['attemptId'][_0x183141(0x184)]()!=='';if(!_0xed20bd){_0x44dd76(),console['log'](a54_0x21c86d[_0x183141(0x1f2)](_0x183141(0xed)));return;}_0x44dd76();const _0x5f5d27=_0x2b7baa[_0x183141(0x116)](_0x32ccf6=>_0x32ccf6[_0x183141(0x1b7)]?.['id']===_0x2002c7[_0x183141(0x287)]);if(_0x5f5d27){const _0x176cf2=_0x5f5d27[_0x183141(0x270)]?.[_0x183141(0x271)]||'?',_0xbc817e=_0x5f5d27[_0x183141(0x20f)]?.[_0x183141(0x271)]||'?';console[_0x183141(0x199)](_0x183141(0x145)+a54_0x21c86d[_0x183141(0x1f2)](_0x176cf2)+_0x183141(0x1ee)+a54_0x21c86d[_0x183141(0x1f2)](_0xbc817e));}const _0x185516=new WorkflowTimelineCommand();await _0x185516[_0x183141(0x1fc)]({'args':[],'options':{..._0x49759a,'attemptId':_0x2002c7[_0x183141(0x287)]},'tdx':_0x3115f9});}[a54_0x15b982(0x1fb)](_0x1076eb,_0xbf7d48){const _0x114a41=a54_0x15b982,_0x5d2672=new Map();for(const _0x39c9f9 of _0x1076eb){_0x39c9f9['id']&&_0x39c9f9[_0x114a41(0x1b7)]?.['id']&&_0x5d2672[_0x114a41(0x1bb)](_0x39c9f9['id'],_0x39c9f9['lastAttempt']['id']);}const _0x333b17=[];let _0x3bdac7='';const _0x3b2b8a=this[_0x114a41(0x1a3)](_0x1076eb,_0xbf7d48),_0x2c8bb3=_0x3b2b8a[_0x114a41(0x191)]('\x0a');for(const _0x3411c1 of _0x2c8bb3){if(_0x3411c1[_0x114a41(0x178)](_0x114a41(0x23f))||_0x3411c1[_0x114a41(0x1b0)](/^\s+\d{4}-\d{2}-\d{2}/))_0x3bdac7=_0x3411c1;else{if(_0x3411c1[_0x114a41(0x1b0)](/^[✅❌🔄🛑⏳]/)){const _0x27c7c7=_0x3411c1['match'](/#(\d+)/),_0xdfe1f4=_0x27c7c7?_0x27c7c7[0x1]:null,_0x5029e0=_0xdfe1f4?_0x5d2672[_0x114a41(0x128)](_0xdfe1f4)||null:null,_0xf53f67=_0x1076eb[_0x114a41(0x116)](_0x34d064=>_0x34d064['id']===_0xdfe1f4),_0x5e205e=_0xf53f67?.[_0x114a41(0x270)]?.[_0x114a41(0x271)]||'';_0x333b17[_0x114a41(0x11b)]({'displayLine':_0x3411c1,'attemptId':_0x5029e0,'projectName':_0x5e205e});}}}return{'timelineRows':_0x333b17,'timeAxisHeader':_0x3bdac7};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]='workflow:attempts';['description']=a54_0x15b982(0x14e);async[a54_0x15b982(0x1fc)](_0x3f7a54){const _0x2419fa=a54_0x15b982,{options:_0x451fb5,args:_0x330f8f,tdx:_0x1e7008}=_0x3f7a54,_0x2195ce=this[_0x2419fa(0x284)](_0x330f8f,_0x451fb5);if(!_0x2195ce)return 0x1;const {projectName:_0x5f3464,workflowName:_0x318604}=_0x2195ce,_0x45daa1=_0x451fb5[_0x2419fa(0x24d)];if(_0x451fb5[_0x2419fa(0xee)]){if(_0x5f3464&&_0x318604)console[_0x2419fa(0x200)](_0x2419fa(0x1c2)+_0x5f3464+'.'+_0x318604);else _0x5f3464&&console[_0x2419fa(0x200)](_0x2419fa(0x104)+_0x5f3464);_0x45daa1&&console[_0x2419fa(0x200)]('Include\x20retried:\x20yes');}const _0x8c9bf6=await withSpinner(_0x2419fa(0x265),()=>_0x1e7008[_0x2419fa(0x20f)][_0x2419fa(0x251)]({'projectName':_0x5f3464,'workflowName':_0x318604,'includeRetried':_0x45daa1,'limit':_0x451fb5[_0x2419fa(0x195)]}),{'verbose':_0x451fb5[_0x2419fa(0xee)]}),_0x16aa8d=_0x8c9bf6[_0x2419fa(0x213)],_0x45f6cd=_0x451fb5[_0x2419fa(0x195)]||0x64,_0x5a199f=_0x16aa8d[_0x2419fa(0x1ca)]>=_0x45f6cd?a54_0x21c86d[_0x2419fa(0x1f2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x2419fa(0x200)]('✔\x20Found\x20'+_0x16aa8d[_0x2419fa(0x1ca)]+_0x2419fa(0x236)+(_0x16aa8d[_0x2419fa(0x1ca)]!==0x1?'s':'')+_0x5a199f);if(_0x451fb5['format']===_0x2419fa(0x107)||_0x451fb5['format']==='jsonl'||_0x451fb5[_0x2419fa(0x14d)]===_0x2419fa(0x231))await handleSDKOutput(_0x16aa8d,_0x451fb5);else{if(_0x16aa8d[_0x2419fa(0x1ca)]===0x0){if(_0x5f3464&&_0x318604)console['log']('No\x20attempts\x20found\x20for:\x20'+_0x5f3464+'.'+_0x318604);else _0x5f3464?console[_0x2419fa(0x199)](_0x2419fa(0x12c)+_0x5f3464):console['log'](_0x2419fa(0x20d));}else{const _0x39372c=_0x451fb5[_0x2419fa(0xfe)],_0x384917=_0x16aa8d[_0x2419fa(0x1ac)](_0x402333=>{const _0x10a8b0=_0x2419fa,_0x2dc3fc=a54_0x21c86d[_0x10a8b0(0x1f2)]('#'+_0x402333['id']),_0x44c9be=_0x402333[_0x10a8b0(0x270)]?.['id'],_0x141dde=_0x402333[_0x10a8b0(0x1d3)]||_0x402333[_0x10a8b0(0x1fe)],_0x215393=_0x44c9be&&_0x141dde?hyperlink(_0x2dc3fc,getWorkflowAttemptUrl(_0x39372c,_0x44c9be,_0x141dde,_0x402333['id'])):_0x2dc3fc,{icon:_0x5566de,text:_0x23e72f}=getAttemptStatusDisplay(_0x402333),_0x29704c=(_0x402333[_0x10a8b0(0x270)]?.[_0x10a8b0(0x271)]||'?')+'.'+(_0x402333[_0x10a8b0(0x20f)]?.[_0x10a8b0(0x271)]||'?'),_0x1e0a72=_0x402333[_0x10a8b0(0x1d5)]?a54_0x21c86d[_0x10a8b0(0x1f2)](_0x402333[_0x10a8b0(0x1d5)]):'';return(_0x215393+'\x20'+_0x5566de+(_0x23e72f?'\x20'+_0x23e72f:'')+'\x20'+_0x29704c+'\x20'+_0x1e0a72)[_0x10a8b0(0x20a)]();});await writeOutput(_0x384917[_0x2419fa(0x1d2)]('\x0a'),_0x451fb5[_0x2419fa(0x117)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x268);[a54_0x15b982(0x172)]=a54_0x15b982(0x143);async[a54_0x15b982(0x1fc)](_0x1de4b6){const _0x333b54=a54_0x15b982,{options:_0x41aef7,args:_0xaf6bd7,tdx:_0x4cea0f}=_0x1de4b6,_0x426925=_0xaf6bd7[0x0];if(!_0x426925)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x41aef7['verbose']&&console[_0x333b54(0x200)](_0x333b54(0x248)+_0x426925);const _0x340646=await withSpinner(_0x333b54(0x136),()=>_0x4cea0f[_0x333b54(0x20f)][_0x333b54(0x219)](_0x426925),{'verbose':_0x41aef7[_0x333b54(0xee)]}),_0x28046c=_0x340646[_0x333b54(0x213)];let _0x16dc5a;!_0x28046c[_0x333b54(0x141)]?_0x16dc5a=_0x28046c[_0x333b54(0xf5)]?_0x333b54(0x17c):_0x333b54(0x19f):_0x16dc5a=_0x28046c[_0x333b54(0xf9)]?'success':_0x333b54(0x200);let _0x12c84e;if(_0x28046c[_0x333b54(0x1df)]&&_0x28046c[_0x333b54(0x259)]){const _0x3e855f=new Date(_0x28046c[_0x333b54(0x1df)])[_0x333b54(0x242)](),_0x45ed8e=new Date(_0x28046c[_0x333b54(0x259)])[_0x333b54(0x242)]();_0x12c84e=Math[_0x333b54(0x15e)]((_0x45ed8e-_0x3e855f)/0x3e8);}const _0x1c8a47={'attempt_id':_0x28046c['id'],'status':_0x16dc5a,..._0x28046c[_0x333b54(0x18f)]!==undefined&&{'index':_0x28046c[_0x333b54(0x18f)]},..._0x28046c[_0x333b54(0x270)]&&{'project':_0x28046c['project'][_0x333b54(0x271)]},..._0x28046c[_0x333b54(0x20f)]&&{'workflow':_0x28046c['workflow'][_0x333b54(0x271)]},..._0x28046c[_0x333b54(0x1fe)]&&{'session_id':_0x28046c[_0x333b54(0x1fe)]},..._0x28046c[_0x333b54(0x1d5)]&&{'session_time':_0x28046c[_0x333b54(0x1d5)]},..._0x28046c[_0x333b54(0x17f)]&&{'retry_attempt':_0x28046c[_0x333b54(0x17f)]},..._0x12c84e!==undefined&&{'duration_sec':_0x12c84e},..._0x28046c['createdAt']&&{'created_at':_0x28046c[_0x333b54(0x1df)]},..._0x28046c['finishedAt']&&{'finished_at':_0x28046c[_0x333b54(0x259)]},...Object[_0x333b54(0x162)](_0x28046c[_0x333b54(0x1d6)])[_0x333b54(0x1ca)]>0x0&&{'params':_0x28046c['params']}};return await handleSingleObjectOutput(_0x1c8a47,_0x41aef7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x15b982(0x271)]='workflow:tasks';[a54_0x15b982(0x172)]=a54_0x15b982(0x11d);async[a54_0x15b982(0x1fc)](_0x729f24){const _0x36ca6d=a54_0x15b982,{options:_0x5d1ab6,args:_0x1fdb19,tdx:_0x4a36df}=_0x729f24,_0x5d6bcd=_0x1fdb19[0x0];if(!_0x5d6bcd)return console[_0x36ca6d(0x200)](_0x36ca6d(0x283)),0x1;const _0x29a0ab=_0x5d1ab6[_0x36ca6d(0x10e)];_0x5d1ab6[_0x36ca6d(0xee)]&&(console[_0x36ca6d(0x200)](_0x36ca6d(0x248)+_0x5d6bcd),_0x29a0ab&&console[_0x36ca6d(0x200)](_0x36ca6d(0x1c8)));const _0x22f8d2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4a36df[_0x36ca6d(0x20f)][_0x36ca6d(0x15d)](_0x5d6bcd,_0x29a0ab||![]),{'verbose':_0x5d1ab6[_0x36ca6d(0xee)]}),_0x19afa5=_0x22f8d2[_0x36ca6d(0x213)];return console[_0x36ca6d(0x200)]('✔\x20Found\x20'+_0x19afa5['length']+_0x36ca6d(0x216)+(_0x19afa5[_0x36ca6d(0x1ca)]!==0x1?'s':'')),await handleSDKOutput(_0x19afa5,_0x5d1ab6),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x153);[a54_0x15b982(0x172)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async['execute'](_0x3fce83){const _0x1b3de0=a54_0x15b982,{options:_0x5356a4,args:_0x3ffe52,tdx:_0xd89a8c}=_0x3fce83,_0x3a61ff=_0x3ffe52[0x0];let _0x3669cb=_0x3ffe52[0x1];if(!_0x3a61ff)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x5356a4['verbose']&&(console[_0x1b3de0(0x200)](_0x1b3de0(0x248)+_0x3a61ff),_0x3669cb&&console[_0x1b3de0(0x200)](_0x1b3de0(0x27b)+_0x3669cb));const _0x2d4f8a=await withSpinner(_0x1b3de0(0x1db),()=>_0xd89a8c[_0x1b3de0(0x20f)]['logFiles'](_0x3a61ff,_0x3669cb),{'verbose':_0x5356a4[_0x1b3de0(0xee)]}),_0x2611ea=_0x2d4f8a[_0x1b3de0(0x213)];if(_0x2611ea[_0x1b3de0(0x1ca)]===0x0)return console[_0x1b3de0(0x200)]('No\x20log\x20files\x20found\x20for\x20this\x20attempt'),0x0;if(!_0x3669cb&&(_0x5356a4[_0x1b3de0(0x107)]||_0x5356a4[_0x1b3de0(0x14d)]))return await handleSDKOutput(_0x2611ea,_0x5356a4),0x0;if(!_0x3669cb){const _0x4a7b4f=_0x2611ea[_0x1b3de0(0x1ac)](_0x37a2ca=>({'title':_0x37a2ca[_0x1b3de0(0x249)]+'\x20('+formatBytes(_0x37a2ca[_0x1b3de0(0x12f)])+')','value':_0x37a2ca[_0x1b3de0(0x249)]})),_0x30ec9e=await a54_0x5ddf8c({'type':'select','name':'task','message':_0x1b3de0(0x20e),'choices':_0x4a7b4f});if(!_0x30ec9e[_0x1b3de0(0x27a)])return console[_0x1b3de0(0x200)]('Cancelled'),0x0;_0x3669cb=_0x30ec9e['task'];}const _0x3ee609=await withSpinner(_0x1b3de0(0x1b1),()=>_0xd89a8c[_0x1b3de0(0x20f)][_0x1b3de0(0x16a)](_0x3a61ff,_0x3669cb),{'verbose':_0x5356a4['verbose']}),_0x37c539=_0x3ee609['data'];return _0x37c539?console[_0x1b3de0(0x199)](_0x37c539):console[_0x1b3de0(0x200)](_0x1b3de0(0x1a4)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x120);['description']='Kill\x20a\x20running\x20attempt';async[a54_0x15b982(0x1fc)](_0x3299d4){const _0x2cfd48=a54_0x15b982,{options:_0x3c678a,args:_0x8764fa,tdx:_0x26afe7}=_0x3299d4,_0x34cbe7=_0x8764fa[0x0];if(!_0x34cbe7)return console['error'](_0x2cfd48(0x283)),0x1;const _0x33d621=_0x3c678a[_0x2cfd48(0xf0)];_0x3c678a['verbose']&&(console['error'](_0x2cfd48(0x248)+_0x34cbe7),_0x33d621&&console[_0x2cfd48(0x200)](_0x2cfd48(0x125)+_0x33d621));if(!_0x3c678a[_0x2cfd48(0x25a)]){if(!isInteractive())return console[_0x2cfd48(0x200)](a54_0x21c86d['red'](_0x2cfd48(0x27c)),_0x2cfd48(0x119)),console[_0x2cfd48(0x200)](a54_0x21c86d[_0x2cfd48(0x1f2)](_0x2cfd48(0x106))),0x1;const _0x3038c4=await confirmKey(_0x2cfd48(0x122)+_0x34cbe7+'?');if(!_0x3038c4)return console[_0x2cfd48(0x200)](a54_0x21c86d['yellow'](_0x2cfd48(0xed))),0x1;}const _0x1a2e10=await withSpinner(_0x2cfd48(0x1ad),()=>_0x26afe7['workflow'][_0x2cfd48(0x1fa)](_0x34cbe7,_0x33d621),{'verbose':_0x3c678a[_0x2cfd48(0xee)]}),_0x1a460c=_0x1a2e10[_0x2cfd48(0x213)];return console[_0x2cfd48(0x200)]('✔\x20'+_0x1a460c),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x15b982(0x271)]='workflow:retry';[a54_0x15b982(0x172)]=a54_0x15b982(0x1de);async[a54_0x15b982(0x1fc)](_0x21516f){const _0x7ec9b0=a54_0x15b982,{options:_0x5d31cd,args:_0x19b156,tdx:_0x263889}=_0x21516f,_0x5b698c=_0x19b156[0x0];if(!_0x5b698c)return console[_0x7ec9b0(0x200)](_0x7ec9b0(0x173)),console['error'](_0x7ec9b0(0x24f)),0x1;let _0x4f8a99=![],_0x4ce074=_0x5b698c;if(_0x5b698c[_0x7ec9b0(0x178)](_0x7ec9b0(0x1f9)))_0x4f8a99=!![],_0x4ce074=_0x5b698c[_0x7ec9b0(0x14c)](0x8);else{if(_0x5b698c['startsWith'](_0x7ec9b0(0x10b)))_0x4f8a99=![],_0x4ce074=_0x5b698c[_0x7ec9b0(0x14c)](0x8);else return console[_0x7ec9b0(0x200)](_0x7ec9b0(0x293)),console[_0x7ec9b0(0x200)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x1434fb=_0x5d31cd[_0x7ec9b0(0x18c)],_0x4161c1=_0x5d31cd[_0x7ec9b0(0x1c0)],_0x76e1bc=_0x5d31cd[_0x7ec9b0(0x1d6)],_0x2a978b=_0x5d31cd[_0x7ec9b0(0x154)];_0x5d31cd[_0x7ec9b0(0xee)]&&(console['error'](_0x7ec9b0(0x17a)+(_0x4f8a99?'session':_0x7ec9b0(0x219))+'\x20'+_0x4ce074),_0x1434fb&&console[_0x7ec9b0(0x200)](_0x7ec9b0(0x25c)+_0x1434fb),_0x4161c1&&console[_0x7ec9b0(0x200)](_0x7ec9b0(0x20b)+_0x4161c1),_0x76e1bc&&console[_0x7ec9b0(0x200)]('Params:\x20'+_0x76e1bc),_0x2a978b&&console[_0x7ec9b0(0x200)](_0x7ec9b0(0x165)));let _0x2cf5c3;if(_0x76e1bc)try{if(_0x76e1bc[_0x7ec9b0(0x178)]('@')){const _0x289c4e=await import(_0x7ec9b0(0x110)),_0x2cc64a=_0x76e1bc['substring'](0x1),_0xe2e9fe=await _0x289c4e[_0x7ec9b0(0x13d)](_0x2cc64a,_0x7ec9b0(0x18a));_0x2cf5c3=JSON['parse'](_0xe2e9fe);}else _0x2cf5c3=JSON[_0x7ec9b0(0x285)](_0x76e1bc);}catch{return console[_0x7ec9b0(0x200)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x5d31cd[_0x7ec9b0(0x25a)]){if(!isInteractive())return console[_0x7ec9b0(0x200)](a54_0x21c86d[_0x7ec9b0(0x19e)](_0x7ec9b0(0x27c)),_0x7ec9b0(0x119)),console[_0x7ec9b0(0x200)](a54_0x21c86d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1ddf83=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x4f8a99?_0x7ec9b0(0x28f):_0x7ec9b0(0x219))+'\x20'+_0x4ce074+'?');if(!_0x1ddf83)return console['error'](a54_0x21c86d[_0x7ec9b0(0x140)](_0x7ec9b0(0xed))),0x1;}let _0x50df35;_0x4f8a99?_0x50df35=await withSpinner(_0x7ec9b0(0x23c),()=>_0x263889['workflow'][_0x7ec9b0(0x267)](_0x4ce074,{'fromTask':_0x1434fb,'retryParams':_0x2cf5c3}),{'verbose':_0x5d31cd['verbose']}):_0x50df35=await withSpinner('Retrying\x20attempt...',()=>_0x263889['workflow'][_0x7ec9b0(0x20c)](_0x4ce074,{'resumeFrom':_0x4161c1,'retryParams':_0x2cf5c3,'force':_0x2a978b}),{'verbose':_0x5d31cd['verbose']});const _0x2a2195=_0x50df35[_0x7ec9b0(0x213)];return console[_0x7ec9b0(0x200)]('✔\x20Retry\x20started'),console[_0x7ec9b0(0x200)](_0x7ec9b0(0x26a)+_0x2a2195['attemptId']),console[_0x7ec9b0(0x200)]('\x20\x20Session\x20ID:\x20'+_0x2a2195[_0x7ec9b0(0x1fe)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]='workflow:run';[a54_0x15b982(0x172)]=a54_0x15b982(0x264);async['execute'](_0x4f3e38){const _0x1c1a4a=a54_0x15b982,{options:_0x1f9096,args:_0x28eec8,tdx:_0x316f15}=_0x4f3e38;let _0x4107d1=_0x28eec8[0x0];if(!_0x4107d1){const _0x5b549d=this[_0x1c1a4a(0x1d0)]([],_0x1f9096),_0x2c59d0=await withSpinner(_0x1c1a4a(0x192),()=>_0x316f15[_0x1c1a4a(0x20f)][_0x1c1a4a(0x1cc)](_0x5b549d,{'limit':_0x1f9096['limit']}),{'verbose':_0x1f9096[_0x1c1a4a(0xee)]}),_0x272744=_0x2c59d0[_0x1c1a4a(0x213)];if(_0x272744[_0x1c1a4a(0x1ca)]===0x0)return console[_0x1c1a4a(0x200)](_0x1c1a4a(0x167)),!_0x5b549d&&console[_0x1c1a4a(0x200)](a54_0x21c86d['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x34fabd=_0x272744[_0x1c1a4a(0x1ac)](_0x5b9aab=>({'title':_0x5b9aab[_0x1c1a4a(0x270)]?.[_0x1c1a4a(0x271)]+'.'+_0x5b9aab[_0x1c1a4a(0x271)],'value':_0x5b9aab[_0x1c1a4a(0x270)]?.['name']+'.'+_0x5b9aab[_0x1c1a4a(0x271)],'description':_0x5b9aab[_0x1c1a4a(0x194)]?_0x1c1a4a(0x181)+_0x5b9aab[_0x1c1a4a(0x194)]:undefined})),_0x50598b=await a54_0x5ddf8c({'type':_0x1c1a4a(0x207),'name':_0x1c1a4a(0x20f),'message':_0x1c1a4a(0x138),'choices':_0x34fabd});if(!_0x50598b[_0x1c1a4a(0x20f)])return 0x1;_0x4107d1=_0x50598b[_0x1c1a4a(0x20f)];}if(!_0x4107d1[_0x1c1a4a(0x1a1)]('.')){const _0x3232ff=this[_0x1c1a4a(0x1d0)]([],_0x1f9096);if(_0x3232ff)_0x4107d1=_0x3232ff+'.'+_0x4107d1;else return console[_0x1c1a4a(0x200)](a54_0x21c86d['red'](_0x1c1a4a(0x12d)),_0x1c1a4a(0xf3)),console['error'](a54_0x21c86d[_0x1c1a4a(0x1f2)](_0x1c1a4a(0x163))),0x1;}const _0x26f278=_0x1f9096[_0x1c1a4a(0x212)],_0x4d4bc8=_0x1f9096[_0x1c1a4a(0x1d5)],_0x56b2b0={};if(_0x26f278&&Array[_0x1c1a4a(0x211)](_0x26f278))for(const _0x54bdb1 of _0x26f278){const _0xb2b5e9=_0x54bdb1[_0x1c1a4a(0x18d)]('=');if(_0xb2b5e9===-0x1)return console['error'](_0x1c1a4a(0xec)+_0x54bdb1),console['error'](_0x1c1a4a(0x151)),0x1;const _0x40f29=_0x54bdb1[_0x1c1a4a(0x14c)](0x0,_0xb2b5e9),_0x313df7=_0x54bdb1[_0x1c1a4a(0x14c)](_0xb2b5e9+0x1);try{_0x56b2b0[_0x40f29]=JSON['parse'](_0x313df7);}catch{_0x56b2b0[_0x40f29]=_0x313df7;}}_0x1f9096['verbose']&&(console[_0x1c1a4a(0x200)](_0x1c1a4a(0x1cf)+_0x4107d1),Object[_0x1c1a4a(0x162)](_0x56b2b0)[_0x1c1a4a(0x1ca)]>0x0&&console[_0x1c1a4a(0x200)]('Parameters:\x20'+JSON[_0x1c1a4a(0x288)](_0x56b2b0)),_0x4d4bc8&&console[_0x1c1a4a(0x200)](_0x1c1a4a(0x27f)+_0x4d4bc8));const _0x4b8f22=await withSpinner('Starting\x20workflow\x20run...',()=>_0x316f15['workflow']['run'](_0x4107d1,_0x56b2b0,{'sessionTime':_0x4d4bc8}),{'verbose':_0x1f9096[_0x1c1a4a(0xee)]}),_0x1a5836=_0x4b8f22['data'];console['error']('✔\x20Workflow\x20run\x20started'),console[_0x1c1a4a(0x200)](_0x1c1a4a(0x224)+_0x1a5836['id']),console['error']('\x20\x20Session\x20ID:\x20'+_0x1a5836[_0x1c1a4a(0x1fe)]),console[_0x1c1a4a(0x200)](_0x1c1a4a(0x131)+_0x1a5836[_0x1c1a4a(0x270)]?.[_0x1c1a4a(0x271)]),console['error'](_0x1c1a4a(0x289)+_0x1a5836[_0x1c1a4a(0x20f)]?.['name']);if(_0x1a5836[_0x1c1a4a(0x270)]?.['id']&&_0x1a5836[_0x1c1a4a(0x1fe)]&&_0x1a5836['id']){const _0xfb50c4=_0x1f9096[_0x1c1a4a(0xfe)],_0x520de5=getConsoleUrl(_0xfb50c4,_0x1c1a4a(0x1ce)+_0x1a5836[_0x1c1a4a(0x270)]['id']+_0x1c1a4a(0x1e4)+_0x1a5836[_0x1c1a4a(0x1fe)]+_0x1c1a4a(0x206)+_0x1a5836['id']);console[_0x1c1a4a(0x200)](_0x1c1a4a(0x175)+a54_0x21c86d[_0x1c1a4a(0x1f1)](_0x520de5));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x1ef);['description']=a54_0x15b982(0x244);async['execute'](_0x14e30c){const _0x1bdec6=a54_0x15b982,{options:_0x22b2cf,args:_0x5019bc,tdx:_0x3a12c3}=_0x14e30c,_0x181e64=_0x5019bc[0x0],_0x2f41cc=_0x5019bc[0x1]||'.';if(!_0x181e64)return console['error'](_0x1bdec6(0x1a8)),console[_0x1bdec6(0x200)](_0x1bdec6(0x220)),0x1;const _0x17c79f=_0x22b2cf['revision'];_0x22b2cf[_0x1bdec6(0xee)]&&(console['error'](_0x1bdec6(0x145)+_0x181e64),console['error'](_0x1bdec6(0x19b)+_0x2f41cc),_0x17c79f&&console[_0x1bdec6(0x200)]('Revision:\x20'+_0x17c79f));const _0x28384e=await withSpinner(_0x1bdec6(0x1f7)+_0x181e64+_0x1bdec6(0x1d7),()=>_0x3a12c3[_0x1bdec6(0x20f)][_0x1bdec6(0x269)](_0x181e64,_0x2f41cc,{'revision':_0x17c79f}),{'verbose':_0x22b2cf[_0x1bdec6(0xee)]}),_0x1d8c41=_0x28384e['data'];return console[_0x1bdec6(0x200)]('✔\x20Downloaded\x20'+_0x1d8c41[_0x1bdec6(0x11c)]),console['error'](_0x1bdec6(0x275)+_0x1d8c41[_0x1bdec6(0x194)]),console[_0x1bdec6(0x200)](_0x1bdec6(0x183)+_0x1d8c41['filesExtracted']),console['error'](_0x1bdec6(0xef)+_0x2f41cc+'/'+_0x1d8c41[_0x1bdec6(0x11c)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]='workflow:upload';['description']=a54_0x15b982(0x10d);async[a54_0x15b982(0x1fc)](_0x41bb60){const _0x27311e=a54_0x15b982,{options:_0x31faa3,args:_0x54851c,tdx:_0x15910f}=_0x41bb60;let _0x25bb5e='.',_0x5aa91a=_0x31faa3[_0x27311e(0x271)];if(_0x54851c[0x0]){const {promises:_0x398264}=await import('fs');try{const _0xe3172d=await _0x398264['stat'](_0x54851c[0x0]);if(_0xe3172d['isDirectory']())_0x25bb5e=_0x54851c[0x0];else return console[_0x27311e(0x200)](_0x27311e(0x1f3)+_0x54851c[0x0]+_0x27311e(0x1f4)),0x1;}catch{_0x5aa91a=_0x54851c[0x0],_0x25bb5e='.';}}const _0x44fd1a=_0x31faa3[_0x27311e(0x194)],_0x3d0be2=_0x31faa3[_0x27311e(0x21a)];_0x31faa3['verbose']&&(console[_0x27311e(0x200)]('Project\x20directory:\x20'+_0x25bb5e),_0x5aa91a&&console[_0x27311e(0x200)](_0x27311e(0x26c)+_0x5aa91a),_0x44fd1a&&console[_0x27311e(0x200)](_0x27311e(0x26d)+_0x44fd1a),_0x3d0be2&&console[_0x27311e(0x200)](_0x27311e(0x179)));const _0x30cffd=await withSpinner(_0x27311e(0x139),()=>_0x15910f[_0x27311e(0x20f)][_0x27311e(0x11b)](_0x25bb5e,{'projectName':_0x5aa91a,'revision':_0x44fd1a,'skipValidation':_0x3d0be2}),{'verbose':_0x31faa3['verbose']}),_0x3a0fe7=_0x30cffd['data'];return console['error'](_0x27311e(0x166)+_0x3a0fe7[_0x27311e(0x11c)]),console[_0x27311e(0x200)](_0x27311e(0x11a)+_0x3a0fe7[_0x27311e(0x22c)]),console[_0x27311e(0x200)](_0x27311e(0x275)+_0x3a0fe7['revision']),await this[_0x27311e(0x134)](_0x15910f,_0x3a0fe7[_0x27311e(0x11c)],_0x31faa3['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']=a54_0x15b982(0x114);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x15b982(0x1fc)](_0x51593f){const _0x19e09f=a54_0x15b982,{options:_0x594862,args:_0x105111,tdx:_0x48affc}=_0x51593f,_0x3420d1=_0x105111[0x0],_0x1ecd10=_0x105111[0x1];if(!_0x3420d1)return console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0x19e)](_0x19e09f(0x12d)),_0x19e09f(0xf6)),console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0x1f2)](_0x19e09f(0x100))),0x1;const _0x2121cb=_0x594862[_0x19e09f(0x194)];_0x594862[_0x19e09f(0xee)]&&(console[_0x19e09f(0x200)](_0x19e09f(0x145)+_0x3420d1),_0x1ecd10&&console['error'](_0x19e09f(0xf4)+_0x1ecd10),_0x2121cb&&console[_0x19e09f(0x200)](_0x19e09f(0x26d)+_0x2121cb),_0x594862[_0x19e09f(0x1f8)]&&console[_0x19e09f(0x200)](_0x19e09f(0x281)));const _0x4863d9=await withSpinner(_0x19e09f(0x111)+_0x3420d1+'...',()=>_0x48affc[_0x19e09f(0x20f)]['pullProject'](_0x3420d1,{'targetDir':_0x1ecd10,'revision':_0x2121cb}),{'verbose':_0x594862[_0x19e09f(0xee)]}),_0x3e1008=_0x4863d9[_0x19e09f(0x213)];_0x3e1008[_0x19e09f(0x156)]?console[_0x19e09f(0x200)](_0x19e09f(0x1e8)+_0x3e1008[_0x19e09f(0x11c)]):console[_0x19e09f(0x200)]('→\x20Project:\x20'+_0x3e1008[_0x19e09f(0x11c)]);console['error'](_0x19e09f(0x275)+_0x3e1008['revision']),console[_0x19e09f(0x200)](_0x19e09f(0x261)+(a54_0xe47c0a[_0x19e09f(0x1bc)](process[_0x19e09f(0x1b2)](),_0x3e1008[_0x19e09f(0x260)])||'.')),console[_0x19e09f(0x200)]('\x20\x20Changes:\x20'+a54_0x21c86d[_0x19e09f(0xf2)]('+'+_0x3e1008[_0x19e09f(0x1cd)][_0x19e09f(0xfc)]+_0x19e09f(0x108))+',\x20'+(a54_0x21c86d[_0x19e09f(0x140)]('~'+_0x3e1008[_0x19e09f(0x1cd)][_0x19e09f(0x262)]+_0x19e09f(0x13f))+',\x20')+(a54_0x21c86d['red']('-'+_0x3e1008['summary'][_0x19e09f(0x22d)]+'\x20deleted')+',\x20')+(''+a54_0x21c86d[_0x19e09f(0x1f2)](_0x3e1008[_0x19e09f(0x1cd)][_0x19e09f(0x21d)]+_0x19e09f(0x164))));for(const _0x367573 of _0x3e1008[_0x19e09f(0x1a9)]){_0x367573['type']===_0x19e09f(0x262)&&_0x367573[_0x19e09f(0x26f)]&&(console[_0x19e09f(0x200)]('\x0a'+a54_0x21c86d[_0x19e09f(0x1f1)](_0x19e09f(0x209)+_0x367573[_0x19e09f(0x27e)])),console['error'](_0x367573[_0x19e09f(0x26f)]));}if(!_0x3e1008[_0x19e09f(0x16f)])return saveSessionContext({'workflow_project':_0x3e1008['projectName']},_0x594862[_0x19e09f(0x28f)]),console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0xf2)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x19e09f(0x200)](a54_0x21c86d['dim'](_0x19e09f(0x1b5)+_0x3e1008['projectName'])),0x0;if(_0x594862['dryRun'])return console['error'](a54_0x21c86d[_0x19e09f(0x140)](_0x19e09f(0x161))),0x0;if(!_0x594862[_0x19e09f(0x25a)]){if(!isInteractive())return console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0x19e)](_0x19e09f(0x27c)),_0x19e09f(0x119)),console[_0x19e09f(0x200)](a54_0x21c86d['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x31f9e3=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x31f9e3)return console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0x140)](_0x19e09f(0xed)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x19e09f(0x254),()=>_0x48affc[_0x19e09f(0x20f)][_0x19e09f(0x1c5)](_0x3e1008,{'revision':_0x2121cb}),{'verbose':_0x594862['verbose']}),saveSessionContext({'workflow_project':_0x3e1008[_0x19e09f(0x11c)]},_0x594862[_0x19e09f(0x28f)]),console['error'](a54_0x21c86d[_0x19e09f(0xf2)]('✔\x20Pull\x20complete'));const _0x53a8a1=a54_0xe47c0a[_0x19e09f(0x1bc)](process[_0x19e09f(0x1b2)](),_0x3e1008[_0x19e09f(0x260)])||'.';return console[_0x19e09f(0x200)](a54_0x21c86d[_0x19e09f(0x1f2)](_0x19e09f(0xef)+_0x53a8a1)),console['error'](a54_0x21c86d[_0x19e09f(0x1f2)](_0x19e09f(0x1b5)+_0x3e1008[_0x19e09f(0x11c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x22b);[a54_0x15b982(0x172)]=a54_0x15b982(0x215);async[a54_0x15b982(0x1fc)](_0x51e13d){const _0x16c1fe=a54_0x15b982,{options:_0x51688f,args:_0x16b9bb,tdx:_0x30fe0c}=_0x51e13d,_0x5a31ab=this['resolveProjectDir'](_0x16b9bb,_0x51688f),_0x862f49=_0x51688f[_0x16c1fe(0x194)],_0x404229=_0x51688f['skipValidation'];_0x51688f[_0x16c1fe(0xee)]&&(_0x5a31ab&&console[_0x16c1fe(0x200)](_0x16c1fe(0x28b)+_0x5a31ab),_0x862f49&&console[_0x16c1fe(0x200)](_0x16c1fe(0x26d)+_0x862f49),_0x51688f['dryRun']&&console['error']('Dry\x20run:\x20yes'),_0x404229&&console[_0x16c1fe(0x200)](_0x16c1fe(0x179)));let _0x532c40;try{_0x532c40=await withSpinner(_0x16c1fe(0x126),()=>_0x30fe0c['workflow'][_0x16c1fe(0x1ae)]({'sourceDir':_0x5a31ab,'revision':_0x862f49,'skipValidation':_0x404229}),{'verbose':_0x51688f[_0x16c1fe(0xee)]});}catch(_0x24d4b8){if(_0x24d4b8 instanceof Error&&_0x24d4b8['message'][_0x16c1fe(0x1a1)](_0x16c1fe(0x171)))return console['error'](a54_0x21c86d[_0x16c1fe(0x19e)](_0x16c1fe(0x12d)),_0x16c1fe(0x233)),_0x51688f[_0x16c1fe(0x23a)]?console[_0x16c1fe(0x200)](a54_0x21c86d['dim']('Tip:\x20cd\x20to\x20workflows/'+_0x51688f['workflowProject']+_0x16c1fe(0x1e3)+_0x51688f[_0x16c1fe(0x23a)]+'\x27')):console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0x1f2)](_0x16c1fe(0x204))),0x1;throw _0x24d4b8;}const _0x30adad=_0x532c40['data'];console[_0x16c1fe(0x200)]('✔\x20Project:\x20'+_0x30adad[_0x16c1fe(0x11c)]),console['error'](_0x16c1fe(0x112)+_0x30adad['sourceDir']),console[_0x16c1fe(0x200)](_0x16c1fe(0x275)+_0x30adad[_0x16c1fe(0x194)]),console[_0x16c1fe(0x200)](_0x16c1fe(0x1a7)+a54_0x21c86d['green']('+'+_0x30adad[_0x16c1fe(0x1cd)][_0x16c1fe(0xfc)]+_0x16c1fe(0x108))+',\x20'+(a54_0x21c86d[_0x16c1fe(0x140)]('~'+_0x30adad[_0x16c1fe(0x1cd)][_0x16c1fe(0x262)]+_0x16c1fe(0x13f))+',\x20')+(a54_0x21c86d['red']('-'+_0x30adad['summary']['deleted']+_0x16c1fe(0x247))+',\x20')+(''+a54_0x21c86d[_0x16c1fe(0x1f2)](_0x30adad[_0x16c1fe(0x1cd)][_0x16c1fe(0x21d)]+_0x16c1fe(0x164))));for(const _0x12f171 of _0x30adad[_0x16c1fe(0x1a9)]){_0x12f171[_0x16c1fe(0x15a)]==='modified'&&_0x12f171['diff']&&(console[_0x16c1fe(0x200)]('\x0a'+a54_0x21c86d[_0x16c1fe(0x1f1)]('---\x20'+_0x12f171[_0x16c1fe(0x27e)])),console[_0x16c1fe(0x200)](_0x12f171['diff']));}if(!_0x30adad[_0x16c1fe(0x16f)])return console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0xf2)](_0x16c1fe(0x1d9))),await this[_0x16c1fe(0x134)](_0x30fe0c,_0x30adad['projectName'],_0x51688f['site']),0x0;if(_0x51688f['dryRun'])return console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0x140)](_0x16c1fe(0x129))),0x0;if(!_0x51688f[_0x16c1fe(0x25a)]){if(!isInteractive())return console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0x19e)](_0x16c1fe(0x27c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0x1f2)](_0x16c1fe(0x106))),0x1;const _0x23258f=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x23258f)return console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0x140)]('Cancelled'),_0x16c1fe(0x102)),0x1;}const _0x59303b=await withSpinner('Pushing\x20project...',()=>_0x30fe0c['workflow']['executePushProject'](_0x30adad),{'verbose':_0x51688f['verbose']}),_0x330c98=_0x59303b[_0x16c1fe(0x213)];return console[_0x16c1fe(0x200)](a54_0x21c86d[_0x16c1fe(0xf2)](_0x16c1fe(0x198))),console['error'](_0x16c1fe(0x11a)+_0x330c98['projectId']),console[_0x16c1fe(0x200)]('\x20\x20Revision:\x20'+_0x330c98[_0x16c1fe(0x194)]),await this[_0x16c1fe(0x134)](_0x30fe0c,_0x330c98['projectName'],_0x51688f[_0x16c1fe(0xfe)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x13e);[a54_0x15b982(0x172)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a54_0x15b982(0x1fc)](_0x54bcf3){const _0x337007=a54_0x15b982,{options:_0x96478b,args:_0x1895e7,tdx:_0x19c617}=_0x54bcf3,_0x405d7e=this[_0x337007(0x294)](_0x1895e7,_0x96478b),_0x428911=_0x96478b[_0x337007(0x271)],_0x257ebf=_0x96478b[_0x337007(0x194)],_0x561a27=_0x96478b['skipValidation'];if(!_0x405d7e)return console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x19e)](_0x337007(0x12d)),_0x337007(0x11e)),console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x1f2)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x1f2)](_0x337007(0x225))),0x1;if(!_0x428911)return console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x19e)](_0x337007(0x12d)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x1f2)](_0x337007(0xff))),0x1;_0x96478b[_0x337007(0xee)]&&(console[_0x337007(0x200)](_0x337007(0x28b)+_0x405d7e),console[_0x337007(0x200)](_0x337007(0x1f6)+_0x428911),_0x257ebf&&console[_0x337007(0x200)]('Revision:\x20'+_0x257ebf),_0x96478b[_0x337007(0x1f8)]&&console[_0x337007(0x200)](_0x337007(0x281)),_0x561a27&&console[_0x337007(0x200)](_0x337007(0x179)));const _0x5aaf0f=await withSpinner('Analyzing\x20project...',()=>_0x19c617[_0x337007(0x20f)][_0x337007(0x1cb)](_0x405d7e,_0x428911,{'revision':_0x257ebf,'skipValidation':_0x561a27}),{'verbose':_0x96478b[_0x337007(0xee)]}),_0x5f0e5d=_0x5aaf0f[_0x337007(0x213)];console[_0x337007(0x200)](_0x337007(0x1ba)+_0x5f0e5d[_0x337007(0x1f5)]);_0x5f0e5d[_0x337007(0x132)]&&console[_0x337007(0x200)](_0x337007(0x148)+_0x5f0e5d['sourceProjectName']);console[_0x337007(0x200)](_0x337007(0x1f6)+_0x5f0e5d[_0x337007(0x218)]),console[_0x337007(0x200)](_0x337007(0x26d)+_0x5f0e5d[_0x337007(0x194)]),console[_0x337007(0x200)](_0x337007(0x176)+_0x5f0e5d[_0x337007(0x16e)]);_0x5f0e5d[_0x337007(0x155)]&&(console['error'](a54_0x21c86d[_0x337007(0x140)](_0x337007(0x124)+_0x5f0e5d['newProjectName']+'\x22\x20already\x20exists\x20(ID:\x20'+_0x5f0e5d[_0x337007(0x25e)]+')')),console['error'](a54_0x21c86d['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x96478b[_0x337007(0x1f8)])return console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x140)](_0x337007(0x1b3))),0x0;if(!_0x96478b[_0x337007(0x25a)]){if(!isInteractive())return console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x19e)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x1f2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5c1fd6=_0x5f0e5d[_0x337007(0x132)]||a54_0xe47c0a['basename'](_0x405d7e),_0x404200=_0x5f0e5d['targetExists']?_0x337007(0x1a2)+_0x428911+_0x337007(0x1aa):'\x0aClone\x20\x22'+_0x5c1fd6+_0x337007(0x1e5)+_0x428911+'\x22?',_0x10351c=await confirmKey(_0x404200);if(!_0x10351c)return console[_0x337007(0x200)](a54_0x21c86d[_0x337007(0x140)](_0x337007(0xed))),0x1;}const _0xce7df1=await withSpinner(_0x5f0e5d[_0x337007(0x155)]?'Updating\x20'+_0x428911+'...':_0x337007(0x1d4)+_0x428911+_0x337007(0x1d7),()=>_0x19c617[_0x337007(0x20f)][_0x337007(0x23e)](_0x5f0e5d),{'verbose':_0x96478b['verbose']}),_0x269268=_0xce7df1[_0x337007(0x213)];return console['error'](a54_0x21c86d[_0x337007(0xf2)](_0x5f0e5d[_0x337007(0x155)]?_0x337007(0x1d1):_0x337007(0x24e))),console[_0x337007(0x200)](_0x337007(0x131)+_0x269268[_0x337007(0x218)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x269268[_0x337007(0x25f)]),console[_0x337007(0x200)](_0x337007(0x275)+_0x269268[_0x337007(0x194)]),await this[_0x337007(0x134)](_0x19c617,_0x269268['newProjectName'],_0x96478b['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x15b982(0x271)]='workflow:delete';[a54_0x15b982(0x172)]=a54_0x15b982(0x1e0);async['execute'](_0x3d096d){const _0x4e594d=a54_0x15b982,{options:_0x1c5fb2,args:_0x15c87f,tdx:_0x4c81a6}=_0x3d096d,_0x45fbe4=_0x15c87f[0x0];if(!_0x45fbe4)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x4e594d(0x200)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x1c5fb2[_0x4e594d(0xee)]&&console[_0x4e594d(0x200)](_0x4e594d(0x145)+_0x45fbe4);if(!_0x1c5fb2[_0x4e594d(0x25a)]){if(!isInteractive())return console[_0x4e594d(0x200)](a54_0x21c86d[_0x4e594d(0x19e)](_0x4e594d(0x27c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4e594d(0x200)](a54_0x21c86d[_0x4e594d(0x1f2)](_0x4e594d(0x106))),0x1;const _0x2f5065=await confirmKey(_0x4e594d(0x256)+_0x45fbe4+_0x4e594d(0x258));if(!_0x2f5065)return console[_0x4e594d(0x200)](a54_0x21c86d[_0x4e594d(0x140)](_0x4e594d(0xed))),0x1;}const _0x516ee2=await withSpinner('Deleting\x20project\x20'+_0x45fbe4+_0x4e594d(0x1d7),()=>_0x4c81a6[_0x4e594d(0x20f)][_0x4e594d(0x15c)](_0x45fbe4),{'verbose':_0x1c5fb2[_0x4e594d(0xee)]}),_0x321fec=_0x516ee2[_0x4e594d(0x213)];return console[_0x4e594d(0x200)](_0x4e594d(0x28e)+_0x321fec[_0x4e594d(0x11c)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x321fec[_0x4e594d(0x22c)]),0x0;}}export function parseKeyValue(_0x2145c5){const _0x4971ed=a54_0x15b982,_0xe3c23a=_0x2145c5[_0x4971ed(0x18d)]('=');if(_0xe3c23a===-0x1)throw new Error(_0x4971ed(0x276)+_0x2145c5+_0x4971ed(0x1dc));const _0x5750b0=_0x2145c5[_0x4971ed(0x14c)](0x0,_0xe3c23a),_0x58bf42=_0x2145c5['substring'](_0xe3c23a+0x1);if(!_0x5750b0)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x5750b0,'value':_0x58bf42};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x146);[a54_0x15b982(0x172)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a54_0x15b982(0x1fc)](_0x5d4ad6){const _0x2dfd60=a54_0x15b982,{options:_0x5423df,args:_0x33c802,tdx:_0x5d2e77}=_0x5d4ad6,_0x51a5a6=this[_0x2dfd60(0x266)](_0x33c802,_0x5423df);if(!_0x51a5a6)return 0x1;_0x5423df['verbose']&&console[_0x2dfd60(0x200)](_0x2dfd60(0x145)+_0x51a5a6);const _0x49f03a=await withSpinner(_0x2dfd60(0x152),()=>_0x5d2e77['workflow'][_0x2dfd60(0x235)](_0x51a5a6),{'verbose':_0x5423df[_0x2dfd60(0xee)]}),{secrets:_0x5a148f}=_0x49f03a[_0x2dfd60(0x213)];return console[_0x2dfd60(0x200)]('✔\x20Found\x20'+_0x5a148f[_0x2dfd60(0x1ca)]+_0x2dfd60(0x1f0)+(_0x5a148f[_0x2dfd60(0x1ca)]!==0x1?'s':'')),await handleSDKOutput(_0x5a148f,_0x5423df),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x121);[a54_0x15b982(0x172)]=a54_0x15b982(0x158);async[a54_0x15b982(0x1fc)](_0x4dc6df){const _0x457e81=a54_0x15b982,{options:_0x8b3536,args:_0x2524d7,tdx:_0x55ef51}=_0x4dc6df;let _0x22a26e,_0x32ca9a;if(_0x2524d7[_0x457e81(0x1ca)]>=0x1&&!_0x2524d7[0x0]['includes']('='))_0x22a26e=_0x2524d7[0x0],_0x32ca9a=_0x2524d7[_0x457e81(0x21f)](0x1);else{if(_0x2524d7['length']>=0x1&&_0x8b3536[_0x457e81(0x23a)])_0x22a26e=_0x8b3536['workflowProject'],_0x32ca9a=_0x2524d7;else return _0x2524d7[_0x457e81(0x1ca)]>=0x1?(console[_0x457e81(0x200)](_0x457e81(0x1a8)),console['error'](_0x457e81(0x163)),0x1):(console[_0x457e81(0x200)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x457e81(0x200)](_0x457e81(0x1eb)),0x1);}if(_0x32ca9a[_0x457e81(0x1ca)]===0x0)return console[_0x457e81(0x200)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console['error'](_0x457e81(0x1eb)),0x1;const _0x1627ef={};try{for(const _0x5f3abb of _0x32ca9a){const {key:_0x1e0a89,value:_0xe88860}=parseKeyValue(_0x5f3abb);_0x1627ef[_0x1e0a89]=_0xe88860;}}catch(_0x25e38c){return _0x25e38c instanceof Error&&console[_0x457e81(0x200)](a54_0x21c86d[_0x457e81(0x19e)](_0x457e81(0x12d)),_0x25e38c['message']),0x1;}const _0x292155=Object[_0x457e81(0x162)](_0x1627ef);_0x8b3536[_0x457e81(0xee)]&&(console[_0x457e81(0x200)](_0x457e81(0x145)+_0x22a26e),console['error'](_0x457e81(0x1a6)+_0x292155[_0x457e81(0x1d2)](',\x20')));const _0xdfe927=await withSpinner(_0x292155['length']===0x1?_0x457e81(0x228):_0x457e81(0x1a0)+_0x292155[_0x457e81(0x1ca)]+_0x457e81(0x1ec),()=>_0x55ef51['workflow'][_0x457e81(0x226)](_0x22a26e,_0x1627ef),{'verbose':_0x8b3536[_0x457e81(0xee)]}),_0x465ea0=_0xdfe927[_0x457e81(0x213)];return console[_0x457e81(0x200)](_0x292155[_0x457e81(0x1ca)]===0x1?_0x457e81(0x25b)+_0x465ea0[_0x457e81(0x162)][0x0]+_0x457e81(0xf1)+_0x465ea0[_0x457e81(0x11c)]+'\x27':'✔\x20'+_0x465ea0['keys'][_0x457e81(0x1ca)]+_0x457e81(0x17b)+_0x465ea0[_0x457e81(0x11c)]+'\x27'),(_0x8b3536['json']||_0x8b3536['jsonl'])&&await handleSingleObjectOutput(_0x465ea0,_0x8b3536),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x1e9);[a54_0x15b982(0x172)]='Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project';async['execute'](_0x2dac7a){const _0xc7bb62=a54_0x15b982,{options:_0x479b06,args:_0x5377e6,tdx:_0x34fc7d}=_0x2dac7a;let _0x4b0af9,_0x5201f5;if(_0x5377e6[_0xc7bb62(0x1ca)]>=0x2)_0x4b0af9=_0x5377e6[0x0],_0x5201f5=_0x5377e6[0x1];else{if(_0x5377e6[_0xc7bb62(0x1ca)]===0x1&&_0x479b06[_0xc7bb62(0x23a)])_0x4b0af9=_0x479b06[_0xc7bb62(0x23a)],_0x5201f5=_0x5377e6[0x0];else return _0x5377e6[_0xc7bb62(0x1ca)]===0x1?(console[_0xc7bb62(0x200)](_0xc7bb62(0x1a8)),console['error'](_0xc7bb62(0x163)),0x1):(console[_0xc7bb62(0x200)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0xc7bb62(0x200)](_0xc7bb62(0x1be)),0x1);}_0x479b06[_0xc7bb62(0xee)]&&(console[_0xc7bb62(0x200)]('Project:\x20'+_0x4b0af9),console[_0xc7bb62(0x200)](_0xc7bb62(0x105)+_0x5201f5));if(!_0x479b06[_0xc7bb62(0x25a)]){if(!isInteractive())return console['error'](a54_0x21c86d[_0xc7bb62(0x19e)](_0xc7bb62(0x27c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xc7bb62(0x200)](a54_0x21c86d[_0xc7bb62(0x1f2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5399cc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x5201f5+'\x27\x20from\x20project\x20\x27'+_0x4b0af9+'\x27?');if(!_0x5399cc)return console[_0xc7bb62(0x200)](a54_0x21c86d['yellow'](_0xc7bb62(0xed))),0x1;}const _0x1c1bd=await withSpinner(_0xc7bb62(0x17e),()=>_0x34fc7d[_0xc7bb62(0x20f)][_0xc7bb62(0x250)](_0x4b0af9,_0x5201f5),{'verbose':_0x479b06[_0xc7bb62(0xee)]}),_0x5da50b=_0x1c1bd[_0xc7bb62(0x213)];return console[_0xc7bb62(0x200)](_0xc7bb62(0x25b)+_0x5da50b[_0xc7bb62(0xf8)]+_0xc7bb62(0x272)+_0x5da50b['projectName']+'\x27'),(_0x479b06['json']||_0x479b06[_0xc7bb62(0x26b)])&&await handleSingleObjectOutput(_0x5da50b,_0x479b06),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(_0x3fe8bc){const _0x4c0529=a54_0x15b982,_0x4a8917=Math[_0x4c0529(0xfa)](_0x3fe8bc/0x3e8),_0x25a572=Math['floor'](_0x4a8917/0x3c),_0xf1400e=Math[_0x4c0529(0xfa)](_0x25a572/0x3c),_0x3841c3=Math[_0x4c0529(0xfa)](_0xf1400e/0x18);if(_0x3841c3>0x0){const _0x4d1a31=_0xf1400e%0x18;return _0x4d1a31>0x0?_0x3841c3+'d\x20'+_0x4d1a31+'h':_0x3841c3+'d';}else{if(_0xf1400e>0x0){const _0x42a3f9=_0x25a572%0x3c;return _0x42a3f9>0x0?_0xf1400e+'h\x20'+_0x42a3f9+'m':_0xf1400e+'h';}else{if(_0x25a572>0x0){const _0x529dd6=_0x4a8917%0x3c;return _0x529dd6>0x0?_0x25a572+'m\x20'+_0x529dd6+'s':_0x25a572+'m';}else return _0x4a8917+'s';}}}function formatTimestamp(_0x5cf166,_0x3151b6){const _0x36c395=a54_0x15b982,_0x4dc96b=new Date(_0x5cf166),_0x2b55a7=String(_0x4dc96b[_0x36c395(0x19a)]())[_0x36c395(0x237)](0x2,'0'),_0x1d5600=String(_0x4dc96b[_0x36c395(0x232)]())[_0x36c395(0x237)](0x2,'0'),_0x4a1025=_0x2b55a7+':'+_0x1d5600,_0x1cc678=_0x4dc96b[_0x36c395(0x1ab)]()===_0x3151b6[_0x36c395(0x1ab)]()&&_0x4dc96b[_0x36c395(0x28d)]()===_0x3151b6[_0x36c395(0x28d)]()&&_0x4dc96b[_0x36c395(0x243)]()===_0x3151b6[_0x36c395(0x243)]();if(_0x1cc678)return _0x4a1025;else{const _0x5836b1=String(_0x4dc96b['getMonth']()+0x1)[_0x36c395(0x237)](0x2,'0'),_0x426741=String(_0x4dc96b[_0x36c395(0x243)]())[_0x36c395(0x237)](0x2,'0');return _0x5836b1+'-'+_0x426741+'\x20'+_0x4a1025;}}function formatDate(_0xedea86){const _0x5065e6=a54_0x15b982,_0x3e76c3=_0xedea86[_0x5065e6(0x1ab)](),_0x3b0deb=String(_0xedea86[_0x5065e6(0x28d)]()+0x1)[_0x5065e6(0x237)](0x2,'0'),_0x5137ce=String(_0xedea86[_0x5065e6(0x243)]())[_0x5065e6(0x237)](0x2,'0');return _0x3e76c3+'-'+_0x3b0deb+'-'+_0x5137ce;}function getTaskStateIcon(_0x41fd87){const _0x5dba8e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5dba8e[_0x41fd87]||'⚪';}function getBarChar(_0x5387de){const _0x597413=a54_0x15b982;return _0x5387de===_0x597413(0x200)||_0x5387de===_0x597413(0x1fd)?'×':'─';}function getBarColor(_0x243590){const _0x2bfc5b=a54_0x15b982,_0x4165a6={'success':a54_0x21c86d[_0x2bfc5b(0xf2)],'error':a54_0x21c86d[_0x2bfc5b(0x19e)],'group_error':a54_0x21c86d[_0x2bfc5b(0x19e)],'running':a54_0x21c86d['blue'],'blocked':a54_0x21c86d[_0x2bfc5b(0x140)],'planned':a54_0x21c86d[_0x2bfc5b(0x1f2)],'canceling':a54_0x21c86d[_0x2bfc5b(0x140)]};return _0x4165a6[_0x243590]||a54_0x21c86d['white'];}function parseTaskName(_0x1d7932){const _0x5763f2=a54_0x15b982;let _0x82d1c6=_0x1d7932['replace'](/^\++/,'');const _0x1e3fae=_0x82d1c6[_0x5763f2(0x191)]('+'),_0x69db47=_0x1e3fae['length']>0x1?_0x1e3fae[_0x5763f2(0x1ca)]-0x2:0x0,_0xd8d657=_0x1e3fae[_0x1e3fae[_0x5763f2(0x1ca)]-0x1]||_0x82d1c6;return{'level':_0x69db47,'name':'+'+_0xd8d657};}function truncateTaskName(_0x1c70c3,_0x105301){const _0x5e4465=a54_0x15b982,_0x893e22=stringWidth(_0x1c70c3);if(_0x893e22<=_0x105301)return _0x1c70c3;let _0x5a22cb=_0x1c70c3;while(stringWidth(_0x5a22cb+'…')>_0x105301&&_0x5a22cb[_0x5e4465(0x1ca)]>0x0){_0x5a22cb=_0x5a22cb[_0x5e4465(0x21f)](0x0,-0x1);}return _0x5a22cb+'…';}function calculateTimeScale(_0x1f5022,_0x51819f){const _0x4644d0=a54_0x15b982;return{'startTime':_0x1f5022['start'],'endTime':_0x1f5022[_0x4644d0(0x118)],'durationMs':_0x1f5022[_0x4644d0(0x133)],'msPerChar':_0x1f5022[_0x4644d0(0x133)]/_0x51819f};}function timeToPosition(_0x43279b,_0x3c2190,_0x373470){const _0x493fc3=a54_0x15b982,_0x54a86a=_0x43279b-_0x3c2190[_0x493fc3(0x13b)],_0x6f3420=Math[_0x493fc3(0xfa)](_0x54a86a/_0x3c2190[_0x493fc3(0x257)]);return Math[_0x493fc3(0xfd)](0x0,Math[_0x493fc3(0x12e)](_0x6f3420,_0x373470));}function renderTimeAxis(_0x3df3a5,_0x332add){const _0x3542d0=a54_0x15b982,_0xa5a4aa=Math['min'](TIMELINE_CONFIG[_0x3542d0(0x1a5)],Math[_0x3542d0(0xfd)](TIMELINE_CONFIG[_0x3542d0(0xfb)],Math[_0x3542d0(0xfa)](_0x332add/TIMELINE_CONFIG[_0x3542d0(0x182)]))),_0x24daab=_0x3df3a5[_0x3542d0(0x278)]/(_0xa5a4aa-0x1),_0x3cd90f=new Date(_0x3df3a5[_0x3542d0(0x13b)]),_0x52231e=[];for(let _0x1b7c3e=0x0;_0x1b7c3e<_0xa5a4aa;_0x1b7c3e++){const _0x1a453a=_0x3df3a5[_0x3542d0(0x13b)]+_0x1b7c3e*_0x24daab,_0xe668b8=timeToPosition(_0x1a453a,_0x3df3a5,_0x332add),_0x2cf12a=formatTimestamp(_0x1a453a,_0x3cd90f);_0x52231e[_0x3542d0(0x11b)]({'pos':_0xe668b8,'text':_0x2cf12a});}const _0x1b0202=new Array(_0x332add)[_0x3542d0(0x255)]('\x20');let _0x546912=-0x1;for(const {pos:_0x248d10,text:_0x1ab0a6}of _0x52231e){let _0x4c2dfb=Math[_0x3542d0(0xfd)](0x0,_0x248d10-Math[_0x3542d0(0xfa)](_0x1ab0a6[_0x3542d0(0x1ca)]/0x2));_0x4c2dfb<=_0x546912+TIMELINE_CONFIG[_0x3542d0(0x157)]&&(_0x4c2dfb=_0x546912+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x4c2dfb+_0x1ab0a6[_0x3542d0(0x1ca)]>_0x332add&&(_0x4c2dfb=_0x332add-_0x1ab0a6[_0x3542d0(0x1ca)]);if(_0x4c2dfb>=0x0&&_0x4c2dfb+_0x1ab0a6['length']<=_0x332add&&_0x4c2dfb>_0x546912){for(let _0x4a1707=0x0;_0x4a1707<_0x1ab0a6[_0x3542d0(0x1ca)];_0x4a1707++){_0x1b0202[_0x4c2dfb+_0x4a1707]=_0x1ab0a6[_0x4a1707];}_0x546912=_0x4c2dfb+_0x1ab0a6[_0x3542d0(0x1ca)]-0x1;}}return _0x1b0202[_0x3542d0(0x1d2)]('');}function renderTaskRow(_0xb38022,_0x2b6158,_0x53810e,_0x12bea1){const _0x2261f5=a54_0x15b982,{level:_0x129202,name:_0x50feb4}=parseTaskName(_0xb38022[_0x2261f5(0x271)]),_0x376fae='\x20'[_0x2261f5(0x1c9)](_0x129202),_0x434785=_0xb38022['window']?'('+formatElapsed(_0xb38022['window'][_0x2261f5(0x133)])+')':'',_0x4a583a=stringWidth(_0x434785),_0x45c5be=_0x129202*0x1,_0x1b0dc8=_0x12bea1-_0x45c5be-_0x4a583a-0x1,_0x5d9514=truncateTaskName(_0x50feb4,_0x1b0dc8),_0x125f36=_0x376fae+_0x5d9514,_0x234d85=stringWidth(_0x125f36),_0x51491a=_0x12bea1-_0x234d85-_0x4a583a,_0x49e667=_0x125f36+'\x20'['repeat'](Math['max'](0x1,_0x51491a))+a54_0x21c86d['dim'](_0x434785),_0x9635e7=getTaskStateIcon(_0xb38022[_0x2261f5(0x1c4)]),_0x45cf7b=new Array(_0x53810e)[_0x2261f5(0x255)]('\x20');if(_0xb38022[_0x2261f5(0x1d8)]){const _0x2bf868=timeToPosition(_0xb38022[_0x2261f5(0x1d8)][_0x2261f5(0x203)],_0x2b6158,_0x53810e),_0x32d26e=timeToPosition(_0xb38022['window'][_0x2261f5(0x118)],_0x2b6158,_0x53810e),_0x151d27=getBarChar(_0xb38022[_0x2261f5(0x1c4)]),_0x52d07f=Math[_0x2261f5(0xfd)](_0x2bf868+0x1,_0x32d26e);for(let _0x511545=_0x2bf868;_0x511545<Math[_0x2261f5(0x12e)](_0x52d07f,_0x53810e);_0x511545++){_0x45cf7b[_0x511545]=_0x151d27;}}const _0x25094f=getBarColor(_0xb38022['state']),_0x5a8658=_0x45cf7b['map'](_0xbeb977=>_0xbeb977==='\x20'?'\x20':_0x25094f(_0xbeb977))[_0x2261f5(0x1d2)]('');return _0x9635e7+'\x20'+_0x49e667+'│'+_0x5a8658+'│';}function calculateStats(_0xc9e54f){const _0x356a81=a54_0x15b982,_0x4c13f7={'total':_0xc9e54f[_0x356a81(0x1ca)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x2db4c9 of _0xc9e54f){if(_0x2db4c9[_0x356a81(0x1c4)]==='success')_0x4c13f7[_0x356a81(0xf9)]++;else{if(_0x2db4c9[_0x356a81(0x1c4)]===_0x356a81(0x200)||_0x2db4c9['state']===_0x356a81(0x1fd))_0x4c13f7[_0x356a81(0x200)]++;else _0x2db4c9[_0x356a81(0x1c4)]==='running'?_0x4c13f7[_0x356a81(0x19f)]++:_0x4c13f7[_0x356a81(0x185)]++;}}return _0x4c13f7;}function formatStats(_0x3ff80e){const _0x51049f=a54_0x15b982;return[_0x51049f(0x286)+_0x3ff80e[_0x51049f(0x12b)],'✅\x20'+_0x3ff80e['success'],'❌\x20'+_0x3ff80e[_0x51049f(0x200)],'🔄\x20'+_0x3ff80e[_0x51049f(0x19f)],'⏳\x20'+_0x3ff80e[_0x51049f(0x185)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x15b982(0x271)]=a54_0x15b982(0x21c);[a54_0x15b982(0x172)]=a54_0x15b982(0x230);async[a54_0x15b982(0x1fc)](_0x5f15bb){const _0x48da47=a54_0x15b982,{options:_0x47bd4b,args:_0x1e9407,tdx:_0x126736}=_0x5f15bb;let _0x8df1a1,_0xf2ca67,_0x360631=![];if(_0x1e9407[0x0]){if(_0x1e9407[0x0][_0x48da47(0x1a1)]('.')){const _0x236cee=this[_0x48da47(0x284)](_0x1e9407,_0x47bd4b);if(!_0x236cee)return 0x1;_0x8df1a1=_0x236cee['projectName'],_0xf2ca67=_0x236cee['workflowName'];}else{_0xf2ca67=_0x1e9407[0x0],_0x8df1a1=_0x47bd4b[_0x48da47(0x23a)];if(!_0x8df1a1)return console['error'](a54_0x21c86d['red'](_0x48da47(0x12d)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x360631=!![];}}else{const _0xb70a27=this[_0x48da47(0x284)](_0x1e9407,_0x47bd4b);if(!_0xb70a27)return 0x1;_0x8df1a1=_0xb70a27[_0x48da47(0x11c)],_0xf2ca67=_0xb70a27[_0x48da47(0x1bd)];}if(_0x47bd4b[_0x48da47(0xee)]){if(_0x8df1a1&&_0xf2ca67)console['error'](_0x48da47(0x1c2)+_0x8df1a1+'.'+_0xf2ca67);else _0x8df1a1&&console[_0x48da47(0x200)](_0x48da47(0x104)+_0x8df1a1);}const _0x5a1728=_0x47bd4b[_0x48da47(0x287)],_0x43a026=_0x47bd4b[_0x48da47(0x1fe)];if(_0x5a1728){_0x43a026&&console[_0x48da47(0x200)](a54_0x21c86d[_0x48da47(0x140)](_0x48da47(0x274)),_0x48da47(0x24a));const _0x5eeaa4=_0x47bd4b[_0x48da47(0x190)];return _0x5eeaa4?await this[_0x48da47(0x1c3)](_0x5f15bb,_0x5a1728):await this[_0x48da47(0x13a)](_0x5f15bb,_0x5a1728,_0x47bd4b),0x0;}if(_0x43a026){const _0x4df8bd=await withSpinner(_0x48da47(0x210),()=>_0x126736[_0x48da47(0x20f)][_0x48da47(0x17d)]({'projectName':_0x8df1a1,'workflowName':_0xf2ca67,'limit':0x64}),{'verbose':_0x47bd4b[_0x48da47(0xee)]}),_0x297fa4=_0x4df8bd[_0x48da47(0x213)]['find'](_0x3c3549=>_0x3c3549['id']===_0x43a026);if(!_0x297fa4)return console['error'](a54_0x21c86d['red'](_0x48da47(0x12d)),'Session\x20not\x20found:\x20'+_0x43a026),0x1;if(!_0x297fa4[_0x48da47(0x1b7)]?.['id'])return console[_0x48da47(0x200)](a54_0x21c86d['red'](_0x48da47(0x12d)),_0x48da47(0x21e)+_0x43a026+_0x48da47(0x16c)),0x1;const _0x3085f8=_0x297fa4[_0x48da47(0x1b7)]['id'];_0x47bd4b['verbose']&&console['error'](_0x48da47(0x1b6)+_0x3085f8+_0x48da47(0x18e)+_0x43a026);const _0x302d3a=_0x47bd4b[_0x48da47(0x190)];return _0x302d3a?await this[_0x48da47(0x1c3)](_0x5f15bb,_0x3085f8):await this[_0x48da47(0x13a)](_0x5f15bb,_0x3085f8,_0x47bd4b),0x0;}const _0x833088=await withSpinner(_0x48da47(0x221),()=>_0x126736[_0x48da47(0x20f)]['sessions']({'projectName':_0x8df1a1,'workflowName':_0xf2ca67,'limit':_0x47bd4b[_0x48da47(0x195)]||0x32}),{'verbose':_0x47bd4b[_0x48da47(0xee)]}),_0x25feb8=_0x833088[_0x48da47(0x213)];if(_0x25feb8[_0x48da47(0x1ca)]===0x0){if(_0x8df1a1&&_0xf2ca67)console[_0x48da47(0x200)](_0x48da47(0x292)+_0x8df1a1+'.'+_0xf2ca67);else _0x8df1a1?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x8df1a1):(console[_0x48da47(0x200)](_0x48da47(0x217)),console[_0x48da47(0x200)](a54_0x21c86d[_0x48da47(0x1f2)](_0x48da47(0x227))));return 0x0;}_0x25feb8[_0x48da47(0x113)]((_0x1db760,_0x598674)=>{const _0x1acfac=_0x48da47,_0x13972d=_0x1db760['sessionTime']||'',_0x2de67d=_0x598674['sessionTime']||'';return _0x2de67d[_0x1acfac(0x22e)](_0x13972d);});if(_0x47bd4b[_0x48da47(0x107)]||_0x47bd4b[_0x48da47(0x26b)])return await handleSDKOutput(_0x25feb8,_0x47bd4b),0x0;let _0x10c4a9;if(_0x360631){const _0x31f7d0=_0x25feb8[0x0];if(!_0x31f7d0[_0x48da47(0x1b7)]?.['id'])return console['error'](_0x48da47(0x240)),0x0;_0x10c4a9=_0x31f7d0[_0x48da47(0x1b7)]['id'],_0x47bd4b['verbose']&&console[_0x48da47(0x200)](_0x48da47(0x1ff)+_0x31f7d0[_0x48da47(0x1d5)]);}else{const _0x2b935b=_0x25feb8[_0x48da47(0x1ac)](_0x5570c1=>{const _0x5390bd=_0x48da47,_0x4c5c5b=getAttemptStatusDisplay(_0x5570c1[_0x5390bd(0x1b7)]);return{'title':_0x5570c1[_0x5390bd(0x270)]?.[_0x5390bd(0x271)]+'.'+_0x5570c1[_0x5390bd(0x20f)]?.['name']+_0x5390bd(0x101)+_0x5570c1['sessionTime']+'\x20'+_0x4c5c5b[_0x5390bd(0x234)],'value':_0x5570c1[_0x5390bd(0x1b7)]?.['id']||'','description':_0x4c5c5b['text']};}),_0x5009cc=await a54_0x5ddf8c({'type':_0x48da47(0x207),'name':_0x48da47(0x287),'message':_0x48da47(0x10c),'choices':_0x2b935b[_0x48da47(0x168)](_0xa5a859=>_0xa5a859[_0x48da47(0x24c)]!=='')});if(!_0x5009cc[_0x48da47(0x287)])return 0x0;_0x10c4a9=_0x5009cc['attemptId'];}const _0x49e9fd=_0x47bd4b[_0x48da47(0x190)];return _0x49e9fd?await this[_0x48da47(0x1c3)](_0x5f15bb,_0x10c4a9):await this[_0x48da47(0x13a)](_0x5f15bb,_0x10c4a9,_0x47bd4b),0x0;}async['renderSingleTimeline'](_0x3bdb0d,_0x1a487c,_0x28602b){const _0x4fe726=a54_0x15b982,{tdx:_0xecb9ed}=_0x3bdb0d;let _0x38682b,_0x2d153a;try{[_0x38682b,_0x2d153a]=await Promise['all']([_0xecb9ed[_0x4fe726(0x20f)][_0x4fe726(0x219)](_0x1a487c),_0xecb9ed[_0x4fe726(0x20f)][_0x4fe726(0x15d)](_0x1a487c,![])]);}catch(_0x3cfd7d){console[_0x4fe726(0x200)](a54_0x21c86d[_0x4fe726(0x19e)](_0x4fe726(0x222)));_0x28602b['verbose']&&console[_0x4fe726(0x200)](_0x3cfd7d);throw _0x3cfd7d;}if(_0x28602b[_0x4fe726(0x107)]||_0x28602b['jsonl']){const _0x4a364a=this[_0x4fe726(0x26e)](_0x38682b,_0x2d153a);await handleSDKOutput([_0x4a364a],_0x28602b);return;}const _0x5c388f=_0xecb9ed[_0x4fe726(0x1b4)][_0x4fe726(0xfe)],_0x54b23b=this['renderTimeline'](_0x38682b,_0x2d153a,_0x5c388f);console[_0x4fe726(0x199)](_0x54b23b);}async[a54_0x15b982(0x1c3)](_0x46adf2,_0x3562eb){const _0x342f27=a54_0x15b982,{tdx:_0x82e5b0}=_0x46adf2,_0x3fb64f=TIMELINE_CONFIG[_0x342f27(0x1ed)],_0x38fda9=TIMELINE_CONFIG[_0x342f27(0xeb)];let _0x493ba2=0x0;while(_0x493ba2<_0x38fda9){process[_0x342f27(0x238)][_0x342f27(0x189)]&&process[_0x342f27(0x238)][_0x342f27(0x115)]('\x1bc');let _0x493049,_0x14fe5b;try{[_0x493049,_0x14fe5b]=await Promise[_0x342f27(0x1ea)]([_0x82e5b0['workflow'][_0x342f27(0x219)](_0x3562eb),_0x82e5b0[_0x342f27(0x20f)][_0x342f27(0x15d)](_0x3562eb,![])]);}catch(_0x5d6bf2){console[_0x342f27(0x200)](a54_0x21c86d[_0x342f27(0x19e)](_0x342f27(0x186)));_0x493ba2>0x0&&console[_0x342f27(0x200)](a54_0x21c86d['dim'](_0x342f27(0xf7)+_0x493ba2));throw _0x5d6bf2;}const _0x2dffd8=_0x82e5b0['context'][_0x342f27(0xfe)],_0x22d2ad=this['renderTimeline'](_0x493049,_0x14fe5b,_0x2dffd8);console['log'](_0x22d2ad);const _0x25e84a=_0x493049['done']&&_0x14fe5b['every'](_0x32149d=>_0x32149d['state']!=='running'&&_0x32149d[_0x342f27(0x1c4)]!=='planned');if(_0x25e84a){console['error'](a54_0x21c86d[_0x342f27(0xf2)](_0x342f27(0x123)));break;}console[_0x342f27(0x200)](a54_0x21c86d[_0x342f27(0x1f2)](_0x342f27(0x23b)+_0x493ba2*0x2+_0x342f27(0x149))),await new Promise(_0x2ff043=>setTimeout(_0x2ff043,_0x3fb64f)),_0x493ba2++;}_0x493ba2>=_0x38fda9&&console[_0x342f27(0x200)](a54_0x21c86d[_0x342f27(0x140)](_0x342f27(0x170)));}[a54_0x15b982(0x188)](_0x30bb70,_0xc340e3,_0x149387){const _0x5ccca9=a54_0x15b982,_0x20f945=[],_0x1aa6f9=TIMELINE_CONFIG[_0x5ccca9(0x1c6)],_0x1213fe=0x5,_0x34fdc2=process[_0x5ccca9(0x238)][_0x5ccca9(0x127)]||0x78,_0x17cff0=_0x34fdc2-_0x1aa6f9-_0x1213fe,_0x563da7=Math[_0x5ccca9(0xfd)](TIMELINE_CONFIG[_0x5ccca9(0x130)],Math[_0x5ccca9(0x12e)](_0x17cff0,TIMELINE_CONFIG[_0x5ccca9(0x1e7)])),_0x1eb336=new Date(_0x30bb70[_0x5ccca9(0x1df)])[_0x5ccca9(0x242)](),_0x264162=_0x30bb70[_0x5ccca9(0x259)]?new Date(_0x30bb70[_0x5ccca9(0x259)])[_0x5ccca9(0x242)]():Date[_0x5ccca9(0x11f)](),_0x2aa10b={'start':_0x1eb336,'end':_0x264162,'duration':_0x264162-_0x1eb336},_0x1cdfe0=new Map(),_0xc7a2e4=[];for(const _0x4dc73a of _0xc340e3){if(_0x4dc73a[_0x5ccca9(0x196)]){const _0x2e02ba=new Date(_0x4dc73a[_0x5ccca9(0x196)])[_0x5ccca9(0x242)](),_0x10fd05=_0x4dc73a[_0x5ccca9(0x27d)]?new Date(_0x4dc73a[_0x5ccca9(0x27d)])[_0x5ccca9(0x242)]():Date[_0x5ccca9(0x11f)](),_0x384ab2={'start':_0x2e02ba,'end':_0x10fd05,'duration':_0x10fd05-_0x2e02ba};_0x1cdfe0[_0x5ccca9(0x1bb)](_0x4dc73a['id'],_0x384ab2),_0xc7a2e4['push']({'name':_0x4dc73a[_0x5ccca9(0x135)],'state':_0x4dc73a[_0x5ccca9(0x1c4)]||_0x5ccca9(0x187),'window':_0x384ab2});}else _0xc7a2e4[_0x5ccca9(0x11b)]({'name':_0x4dc73a['fullName'],'state':_0x4dc73a[_0x5ccca9(0x1c4)]||_0x5ccca9(0x14a),'window':undefined});}_0xc7a2e4[_0x5ccca9(0x113)]((_0x4c4291,_0x273101)=>{const _0x4794f2=_0x5ccca9;if(!_0x4c4291[_0x4794f2(0x1d8)])return 0x1;if(!_0x273101[_0x4794f2(0x1d8)])return-0x1;return _0x4c4291[_0x4794f2(0x1d8)][_0x4794f2(0x203)]-_0x273101[_0x4794f2(0x1d8)][_0x4794f2(0x203)];});const _0x27e638=_0xc7a2e4['length'],_0x590ccb=_0x27e638>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x590ccb&&_0xc7a2e4[_0x5ccca9(0x10a)](TIMELINE_CONFIG[_0x5ccca9(0x241)]);const _0x48345c=calculateTimeScale(_0x2aa10b,_0x563da7),_0x4d6b4a=_0x30bb70[_0x5ccca9(0x141)]?_0x30bb70[_0x5ccca9(0xf9)]?a54_0x21c86d[_0x5ccca9(0xf2)]('success'):a54_0x21c86d['red']('error'):a54_0x21c86d[_0x5ccca9(0x223)]('running'),_0x107d5a=_0x30bb70[_0x5ccca9(0x270)]?.['id'],_0x1b4c81=_0x30bb70[_0x5ccca9(0x1fe)];let _0x2f8eea;if(_0x107d5a&&_0x1b4c81){const _0x4044a6=getWorkflowAttemptUrl(_0x149387,_0x107d5a,_0x1b4c81,_0x30bb70['id']);_0x2f8eea=hyperlink(a54_0x21c86d['dim'](_0x30bb70['id']),_0x4044a6);}else _0x2f8eea=a54_0x21c86d[_0x5ccca9(0x1f2)](_0x30bb70['id']);_0x20f945[_0x5ccca9(0x11b)](_0x5ccca9(0x109)+_0x2f8eea+'\x20-\x20'+_0x4d6b4a+_0x5ccca9(0x101)+formatElapsed(_0x2aa10b[_0x5ccca9(0x133)]));if(_0xc7a2e4[_0x5ccca9(0x1ca)]>0x0){const _0xb2405a=renderTimeAxis(_0x48345c,_0x563da7),_0x249c49=new Date(_0x2aa10b[_0x5ccca9(0x203)]),_0x2958c9=formatDate(_0x249c49),_0x40278b=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x5ccca9(0x1b9)]+_0x1aa6f9,_0x23af06=_0x2958c9[_0x5ccca9(0x237)](_0x40278b),_0x1bd6c1=a54_0x21c86d['dim'](_0x23af06);_0x20f945[_0x5ccca9(0x11b)](_0x1bd6c1+'\x20'+_0xb2405a);for(const _0x4f29fd of _0xc7a2e4){_0x20f945[_0x5ccca9(0x11b)](renderTaskRow(_0x4f29fd,_0x48345c,_0x563da7,_0x1aa6f9));}const _0x3ab279=calculateStats(_0xc7a2e4);_0x20f945[_0x5ccca9(0x11b)](formatStats(_0x3ab279)),_0x590ccb&&_0x20f945[_0x5ccca9(0x11b)](a54_0x21c86d[_0x5ccca9(0x140)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5ccca9(0x24b)+_0x27e638+_0x5ccca9(0x279))),_0x20f945[_0x5ccca9(0x11b)](''),_0x20f945[_0x5ccca9(0x11b)](a54_0x21c86d[_0x5ccca9(0x1f2)](_0x5ccca9(0x291))+('tdx\x20wf\x20attempt\x20'+_0x30bb70['id']+_0x5ccca9(0x174))+a54_0x21c86d['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x20f945['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x20f945[_0x5ccca9(0x1d2)]('\x0a');}[a54_0x15b982(0x26e)](_0x11250b,_0x508d6b){const _0x4ac40b=a54_0x15b982,_0x228cd6=new Date(_0x11250b[_0x4ac40b(0x1df)])['getTime'](),_0x56f7bc=_0x11250b[_0x4ac40b(0x259)]?new Date(_0x11250b[_0x4ac40b(0x259)])[_0x4ac40b(0x242)]():Date[_0x4ac40b(0x11f)](),_0x3634b7=_0x56f7bc-_0x228cd6,_0x3af6e6=[];for(const _0x42b0bf of _0x508d6b){if(_0x42b0bf[_0x4ac40b(0x196)]){const _0x3d4290=new Date(_0x42b0bf['startedAt'])['getTime'](),_0x129221=_0x42b0bf[_0x4ac40b(0x27d)]?new Date(_0x42b0bf[_0x4ac40b(0x27d)])['getTime']():Date['now']();_0x3af6e6[_0x4ac40b(0x11b)]({'name':_0x42b0bf[_0x4ac40b(0x135)],'state':_0x42b0bf[_0x4ac40b(0x1c4)]||_0x4ac40b(0x187),'window':{'start':_0x3d4290,'end':_0x129221,'duration':_0x129221-_0x3d4290}});}else _0x3af6e6[_0x4ac40b(0x11b)]({'name':_0x42b0bf[_0x4ac40b(0x135)],'state':_0x42b0bf[_0x4ac40b(0x1c4)]||_0x4ac40b(0x14a),'window':undefined});}const _0x5998f0=calculateStats(_0x3af6e6);return{'attempt':{'id':_0x11250b['id'],'status':_0x11250b[_0x4ac40b(0x141)]?_0x11250b[_0x4ac40b(0xf9)]?_0x4ac40b(0xf9):_0x4ac40b(0x200):_0x4ac40b(0x19f),'createdAt':_0x11250b[_0x4ac40b(0x1df)],'finishedAt':_0x11250b[_0x4ac40b(0x259)],'duration_ms':_0x3634b7},'tasks':_0x3af6e6['map'](_0x55251e=>({'name':_0x55251e[_0x4ac40b(0x271)],'state':_0x55251e['state'],'startedAt':_0x55251e['window']?new Date(_0x55251e[_0x4ac40b(0x1d8)]['start'])[_0x4ac40b(0x277)]():null,'updatedAt':_0x55251e[_0x4ac40b(0x1d8)]?new Date(_0x55251e['window'][_0x4ac40b(0x118)])['toISOString']():null,'duration_ms':_0x55251e[_0x4ac40b(0x1d8)]?.[_0x4ac40b(0x133)]||null})),'stats':_0x5998f0};}}
1
+ const a55_0x51cda1=a55_0x1db5;(function(_0x5e06e3,_0x38dc0a){const _0x9156af=a55_0x1db5,_0x43ec2c=_0x5e06e3();while(!![]){try{const _0x3173c4=parseInt(_0x9156af(0x268))/0x1*(-parseInt(_0x9156af(0x33f))/0x2)+-parseInt(_0x9156af(0x368))/0x3+parseInt(_0x9156af(0x286))/0x4*(-parseInt(_0x9156af(0x370))/0x5)+parseInt(_0x9156af(0x312))/0x6+-parseInt(_0x9156af(0x307))/0x7+-parseInt(_0x9156af(0x332))/0x8*(-parseInt(_0x9156af(0x298))/0x9)+-parseInt(_0x9156af(0x229))/0xa*(-parseInt(_0x9156af(0x378))/0xb);if(_0x3173c4===_0x38dc0a)break;else _0x43ec2c['push'](_0x43ec2c['shift']());}catch(_0x218b10){_0x43ec2c['push'](_0x43ec2c['shift']());}}}(a55_0x352b,0x4729a));import a55_0x169b33 from'chalk';import{existsSync}from'fs';import a55_0x2d2e63 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,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 a55_0x4fbd47 from'prompts';function getAttemptStatusDisplay(_0x3316ae){const _0x3f516b=a55_0x1db5;if(!_0x3316ae)return{'icon':'⏳','text':''};const {done:_0x4d5cde,success:_0x2d8082,cancelRequested:_0x5c552d}=_0x3316ae;if(!_0x4d5cde)return _0x5c552d?{'icon':'🛑','text':a55_0x169b33[_0x3f516b(0x22d)]('canceling')}:{'icon':'🔄','text':a55_0x169b33[_0x3f516b(0x214)](_0x3f516b(0x36c))};if(_0x2d8082)return{'icon':'✅','text':a55_0x169b33[_0x3f516b(0x2cd)](_0x3f516b(0x271))};return{'icon':'❌','text':a55_0x169b33[_0x3f516b(0x352)]('error')};}export class WorkflowBaseCommand extends BaseCommand{[a55_0x51cda1(0x25c)](_0x476689,_0x5c972f,_0x423f9e=0x0){const _0x4a17a9=a55_0x51cda1;return _0x476689[_0x423f9e]||_0x5c972f[_0x4a17a9(0x272)];}[a55_0x51cda1(0x32a)](_0x5c5c38,_0x441b87,_0x3c9b92=0x0){const _0x1f80b0=a55_0x51cda1,_0x1d0c23=this[_0x1f80b0(0x25c)](_0x5c5c38,_0x441b87,_0x3c9b92);if(!_0x1d0c23)return console['error'](a55_0x169b33[_0x1f80b0(0x352)]('Error:'),_0x1f80b0(0x2f7)),console['error'](a55_0x169b33[_0x1f80b0(0x2df)](_0x1f80b0(0x290))),null;return _0x1d0c23;}[a55_0x51cda1(0x2d9)](_0x55133c,_0x1c2f6b){const _0x2e1730=a55_0x51cda1;if(_0x55133c[0x0]){const _0x58db51=_0x55133c[0x0][_0x2e1730(0x28a)]('.');if(_0x58db51[_0x2e1730(0x2e7)]===0x1)return{'projectName':_0x58db51[0x0],'workflowName':undefined};else return _0x58db51[_0x2e1730(0x2e7)]===0x2?{'projectName':_0x58db51[0x0],'workflowName':_0x58db51[0x1]}:(console[_0x2e1730(0x1f9)](a55_0x169b33[_0x2e1730(0x352)](_0x2e1730(0x249)),_0x2e1730(0x26a)),null);}return{'projectName':_0x1c2f6b[_0x2e1730(0x272)],'workflowName':undefined};}[a55_0x51cda1(0x383)](_0x55bf40,_0x281597,_0x575efe=0x0){const _0x4c81d7=a55_0x51cda1;if(_0x55bf40[_0x575efe])return _0x55bf40[_0x575efe];if(_0x281597[_0x4c81d7(0x272)]){const _0x2f1713=a55_0x2d2e63['join'](process['cwd'](),_0x4c81d7(0x2e4),_0x281597[_0x4c81d7(0x272)]);if(existsSync(a55_0x2d2e63['join'](_0x2f1713,_0x4c81d7(0x2c1))))return _0x2f1713;}return undefined;}async[a55_0x51cda1(0x348)](_0x219977,_0x40aeb0,_0x276203){const _0x3529ef=a55_0x51cda1;try{const _0x5bb4c3=await _0x219977[_0x3529ef(0x284)][_0x3529ef(0x2e4)](_0x40aeb0,{'limit':0x1});if(_0x5bb4c3[_0x3529ef(0x2e7)]>0x0){const _0x262f61=_0x5bb4c3[0x0]['id'],_0x16f917=getWorkflowUrl(_0x276203,_0x262f61);console[_0x3529ef(0x1f9)]('\x20\x20Console:\x20'+a55_0x169b33[_0x3529ef(0x219)](_0x16f917));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]='workflow:use';[a55_0x51cda1(0x2d1)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a55_0x51cda1(0x339)](_0x431d61){const _0x1b5994=a55_0x51cda1,{options:_0x348ff9,args:_0x1fec62,tdx:_0x19dea1}=_0x431d61,_0xfd7c89=_0x1fec62[0x0],_0x4619dd=_0x348ff9[_0x1b5994(0x37e)];if(_0x4619dd)return saveSessionContext({'workflow_project':undefined},_0x348ff9[_0x1b5994(0x29e)]),console[_0x1b5994(0x37f)](a55_0x169b33['green'](_0x1b5994(0x34f))),0x0;if(!_0xfd7c89)return console[_0x1b5994(0x1f9)](a55_0x169b33['red'](_0x1b5994(0x249)),_0x1b5994(0x2f7)),console['error'](a55_0x169b33['dim'](_0x1b5994(0x264))),console[_0x1b5994(0x1f9)](a55_0x169b33[_0x1b5994(0x2df)](_0x1b5994(0x255))),0x1;const _0x3fa7bc=await withSpinner(_0x1b5994(0x217)+_0xfd7c89+'\x27...',()=>_0x19dea1[_0x1b5994(0x284)][_0x1b5994(0x2ba)](_0xfd7c89),{'verbose':_0x348ff9[_0x1b5994(0x248)]}),{name:_0x28528c}=_0x3fa7bc[_0x1b5994(0x33a)];return saveSessionContext({'workflow_project':_0x28528c},_0x348ff9[_0x1b5994(0x29e)]),console['log'](a55_0x169b33['green']('✔\x20Workflow\x20project\x20set\x20to:\x20'+a55_0x169b33[_0x1b5994(0x219)](_0x28528c))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x237);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x22a);async[a55_0x51cda1(0x339)](_0x13521e){const _0x144975=a55_0x51cda1,{options:_0x1f474d,args:_0x1b68da,tdx:_0x238321}=_0x13521e,_0x34eb95=_0x1b68da[0x0];_0x1f474d[_0x144975(0x248)]&&_0x34eb95&&console[_0x144975(0x1f9)](_0x144975(0x1f7)+_0x34eb95);const _0x55ed36=await withSpinner(_0x144975(0x2ac),()=>_0x238321[_0x144975(0x284)][_0x144975(0x318)](_0x34eb95,{'limit':_0x1f474d[_0x144975(0x24f)]}),{'verbose':_0x1f474d[_0x144975(0x248)]});let _0x23ca9e=_0x55ed36[_0x144975(0x33a)];_0x23ca9e[_0x144975(0x324)]((_0x4fb29b,_0x146169)=>_0x4fb29b['name'][_0x144975(0x33c)](_0x146169[_0x144975(0x2d2)]));const _0xea336a=_0x1f474d[_0x144975(0x24f)]||0x64,_0x39129f=_0x23ca9e['length']>=_0xea336a?a55_0x169b33['dim'](_0x144975(0x319)):'';console[_0x144975(0x1f9)](_0x144975(0x32d)+_0x23ca9e['length']+_0x144975(0x26d)+(_0x23ca9e[_0x144975(0x2e7)]!==0x1?'s':'')+_0x39129f);if(_0x1f474d['format']===_0x144975(0x29b)||_0x1f474d[_0x144975(0x390)]==='jsonl'||_0x1f474d[_0x144975(0x390)]===_0x144975(0x2d5))await handleSDKOutput(_0x23ca9e,_0x1f474d);else{if(_0x23ca9e['length']===0x0)_0x34eb95?console[_0x144975(0x37f)](_0x144975(0x297)+_0x34eb95):console[_0x144975(0x37f)](_0x144975(0x257));else{const _0x1bfccb=_0x23ca9e[_0x144975(0x2cc)](_0x5d9645=>{const _0x2f3df9=_0x144975,_0x612344=_0x5d9645['metadata']?.['some'](_0x507f26=>_0x507f26[_0x2f3df9(0x3a0)]===_0x2f3df9(0x270)),_0x1170e9=_0x612344?a55_0x169b33['dim'](_0x2f3df9(0x32b)):'';return _0x2f3df9(0x2fa)+_0x5d9645['name']+_0x1170e9;});await writeOutput(_0x1bfccb[_0x144975(0x342)]('\x0a'),_0x1f474d[_0x144975(0x38d)],_0x144975(0x359));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x2bb);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x2c6);async[a55_0x51cda1(0x339)](_0x8738a9){const _0x49a177=a55_0x51cda1,{options:_0x1fa019,args:_0x4a3677,tdx:_0x5e230d}=_0x8738a9,_0x4a5a01=this[_0x49a177(0x25c)](_0x4a3677,_0x1fa019);_0x1fa019['verbose']&&_0x4a5a01&&console[_0x49a177(0x1f9)](_0x49a177(0x27f)+_0x4a5a01);const _0x322801=await withSpinner(_0x49a177(0x387),()=>_0x5e230d['workflow']['workflows'](_0x4a5a01,{'limit':_0x1fa019[_0x49a177(0x24f)]}),{'verbose':_0x1fa019[_0x49a177(0x248)]});let _0x38a419=_0x322801[_0x49a177(0x33a)];_0x38a419[_0x49a177(0x324)]((_0x19ff96,_0x2e651b)=>{const _0x412305=_0x49a177,_0x314f69=_0x19ff96[_0x412305(0x2d2)][_0x412305(0x33c)](_0x2e651b['name']);if(_0x314f69!==0x0)return _0x314f69;return(_0x19ff96[_0x412305(0x35e)]?.['name']||'')[_0x412305(0x33c)](_0x2e651b['project']?.['name']||'');});const _0x1032b2=_0x1fa019[_0x49a177(0x24f)]||0x64,_0x64b164=_0x38a419[_0x49a177(0x2e7)]>=_0x1032b2?a55_0x169b33[_0x49a177(0x2df)](_0x49a177(0x319)):'';console[_0x49a177(0x1f9)]('✔\x20Found\x20'+_0x38a419[_0x49a177(0x2e7)]+'\x20workflow'+(_0x38a419[_0x49a177(0x2e7)]!==0x1?'s':'')+_0x64b164);if(_0x1fa019[_0x49a177(0x390)]==='json'||_0x1fa019[_0x49a177(0x390)]==='jsonl'||_0x1fa019['format']===_0x49a177(0x2d5))await handleSDKOutput(_0x38a419,_0x1fa019);else{if(_0x38a419[_0x49a177(0x2e7)]===0x0)_0x4a5a01?console[_0x49a177(0x37f)](_0x49a177(0x397)+_0x4a5a01):console[_0x49a177(0x37f)](_0x49a177(0x2fd));else{const _0x17bfbc=_0x1fa019[_0x49a177(0x31c)],_0x36c7ab=_0x38a419[_0x49a177(0x2cc)](_0x5a61db=>{const _0x5ae989=_0x49a177,_0x5a1635=a55_0x169b33['dim']('#'+_0x5a61db['id']),_0x13ec9e=hyperlink(_0x5a1635,getWorkflowUrl(_0x17bfbc,_0x5a61db['id'])),_0x808e09=_0x5a61db[_0x5ae989(0x35e)]?.['name']?a55_0x169b33['dim']('\x20('+_0x5a61db[_0x5ae989(0x35e)][_0x5ae989(0x2d2)]+')'):'';return _0x5ae989(0x345)+_0x13ec9e+'\x20'+_0x5a61db[_0x5ae989(0x2d2)]+_0x808e09;});await writeOutput(_0x36c7ab[_0x49a177(0x342)]('\x0a'),_0x1fa019['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]='workflow:sessions';[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x357);async['execute'](_0x79a39){const _0x53b306=a55_0x51cda1,{options:_0x41ede4,args:_0x311a55,tdx:_0x1105bc}=_0x79a39,_0x3bd76f=this[_0x53b306(0x2d9)](_0x311a55,_0x41ede4);if(!_0x3bd76f)return 0x1;const {projectName:_0x13c70e,workflowName:_0x1216ba}=_0x3bd76f;if(_0x41ede4['verbose']){if(_0x13c70e&&_0x1216ba)console[_0x53b306(0x1f9)](_0x53b306(0x308)+_0x13c70e+'.'+_0x1216ba);else _0x13c70e&&console[_0x53b306(0x1f9)](_0x53b306(0x23c)+_0x13c70e);const _0xb36edb=_0x41ede4[_0x53b306(0x37c)];_0xb36edb&&console[_0x53b306(0x1f9)](_0x53b306(0x36d)+_0xb36edb);}let _0x163853=0x28;if(process[_0x53b306(0x389)]['isTTY']&&!_0x41ede4[_0x53b306(0x38d)]&&!_0x41ede4[_0x53b306(0x390)]){const _0xbd7c16=process[_0x53b306(0x389)][_0x53b306(0x2f3)]||0x28;_0x163853=Math['max'](0x14,Math[_0x53b306(0x2e8)](_0xbd7c16*0x2/0x3));}const _0x3e4138=_0x41ede4[_0x53b306(0x24f)]||_0x163853,_0x3d421b=await withSpinner(_0x53b306(0x2c3),()=>_0x1105bc[_0x53b306(0x284)][_0x53b306(0x23a)]({'projectName':_0x13c70e,'workflowName':_0x1216ba,'status':_0x41ede4['status'],'fromTime':_0x41ede4[_0x53b306(0x2b1)],'toTime':_0x41ede4['to'],'limit':_0x3e4138}),{'verbose':_0x41ede4['verbose']}),_0xeec98b=_0x3d421b['data'];_0xeec98b[_0x53b306(0x324)]((_0x871ece,_0x5002a2)=>{const _0x329504=_0x53b306,_0x1b410e=_0x871ece[_0x329504(0x226)]||'',_0x4ba06f=_0x5002a2[_0x329504(0x226)]||'';return _0x4ba06f[_0x329504(0x33c)](_0x1b410e);});_0xeec98b[_0x53b306(0x2e7)]>=_0x3e4138?console['error']('✔\x20Showing\x20'+_0xeec98b['length']+'\x20sessions\x20'+a55_0x169b33['dim'](_0x53b306(0x395))):console[_0x53b306(0x1f9)](_0x53b306(0x32d)+_0xeec98b['length']+_0x53b306(0x333)+(_0xeec98b[_0x53b306(0x2e7)]!==0x1?'s':''));if(_0x41ede4[_0x53b306(0x390)]===_0x53b306(0x29b)||_0x41ede4[_0x53b306(0x390)]===_0x53b306(0x241)||_0x41ede4['format']===_0x53b306(0x2d5))await handleSDKOutput(_0xeec98b,_0x41ede4);else{if(!process['stdout'][_0x53b306(0x21d)]||_0x41ede4[_0x53b306(0x38d)]){if(_0xeec98b[_0x53b306(0x2e7)]===0x0){if(_0x13c70e&&_0x1216ba)console[_0x53b306(0x37f)](_0x53b306(0x2a5)+_0x13c70e+'.'+_0x1216ba);else _0x13c70e?console[_0x53b306(0x37f)](_0x53b306(0x295)+_0x13c70e):console['log']('No\x20sessions\x20found');}else{const _0x4cde13=_0x41ede4[_0x53b306(0x31c)],_0x2dba4f=this[_0x53b306(0x2a0)](_0xeec98b,_0x4cde13);_0x41ede4[_0x53b306(0x38d)]?await writeOutput(_0x2dba4f,_0x41ede4[_0x53b306(0x38d)],_0x53b306(0x359)):console[_0x53b306(0x37f)](_0x2dba4f);}!_0x13c70e&&(console['error'](''),console[_0x53b306(0x1f9)](a55_0x169b33[_0x53b306(0x2df)](_0x53b306(0x289))),console[_0x53b306(0x1f9)](a55_0x169b33[_0x53b306(0x2df)](_0x53b306(0x1f1))+'or'+a55_0x169b33[_0x53b306(0x2df)](_0x53b306(0x22e))));}else{if(_0xeec98b[_0x53b306(0x2e7)]===0x0){if(_0x13c70e&&_0x1216ba)console[_0x53b306(0x37f)](_0x53b306(0x2a5)+_0x13c70e+'.'+_0x1216ba);else _0x13c70e?console[_0x53b306(0x37f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x13c70e):console['log'](_0x53b306(0x228));}else await this[_0x53b306(0x30a)](_0xeec98b,_0x79a39,_0x13c70e);}}return 0x0;}[a55_0x51cda1(0x2a0)](_0x53aa87,_0x4e40b8){const _0x50ace5=a55_0x51cda1,_0x5cd9f2=[],_0x40fb3b=new Map();let _0x95c213=Infinity,_0x3817bd=-Infinity;for(const _0x12da81 of _0x53aa87){if(_0x12da81[_0x50ace5(0x32c)]?.[_0x50ace5(0x1f5)]){const _0x53a1c7=new Date(_0x12da81[_0x50ace5(0x32c)]['createdAt'])[_0x50ace5(0x336)](),_0x173d57=_0x12da81['lastAttempt'][_0x50ace5(0x20b)]?new Date(_0x12da81['lastAttempt'][_0x50ace5(0x20b)])['getTime']():Date['now'](),_0x3e824e=_0x12da81[_0x50ace5(0x35e)]?.[_0x50ace5(0x2d2)]||'(unknown)';!_0x40fb3b[_0x50ace5(0x2a7)](_0x3e824e)&&_0x40fb3b['set'](_0x3e824e,[]),_0x40fb3b[_0x50ace5(0x328)](_0x3e824e)['push']({'session':_0x12da81,'startTime':_0x53a1c7,'endTime':_0x173d57,'duration':_0x173d57-_0x53a1c7}),_0x95c213=Math[_0x50ace5(0x2d8)](_0x95c213,_0x53a1c7),_0x3817bd=Math[_0x50ace5(0x20e)](_0x3817bd,_0x173d57);}}if(_0x40fb3b['size']===0x0)return _0x50ace5(0x37a);const _0x7f7ccd=process[_0x50ace5(0x389)][_0x50ace5(0x384)]||0x78,_0x49c778=0x1e,_0x5b4423=0x32,_0x380b35=0x4,_0x55d647=Math[_0x50ace5(0x2d8)](_0x5b4423,Math[_0x50ace5(0x20e)](_0x49c778,Math[_0x50ace5(0x2e8)](_0x7f7ccd*0.3))),_0x302edd=_0x7f7ccd-_0x55d647-TIMELINE_CONFIG[_0x50ace5(0x337)]-0x3-_0x380b35,_0x11ae6f=_0x3817bd-_0x95c213,_0x504c8e=_0x11ae6f/_0x55d647,_0x349b4e=renderTimeAxis({'startTime':_0x95c213,'endTime':_0x3817bd,'durationMs':_0x11ae6f,'msPerChar':_0x504c8e},_0x55d647),_0x5ea782=[];for(const _0xcb0732 of _0x40fb3b[_0x50ace5(0x34a)]()){_0x5ea782[_0x50ace5(0x1f4)](..._0xcb0732);}_0x5ea782[_0x50ace5(0x324)]((_0x2d6163,_0x4fb96d)=>_0x4fb96d[_0x50ace5(0x30d)]-_0x2d6163['startTime']);const _0x4e778c=new Date(_0x95c213),_0x53a08f=formatDate(_0x4e778c),_0x8b9111=_0x380b35+TIMELINE_CONFIG[_0x50ace5(0x2fb)]+TIMELINE_CONFIG[_0x50ace5(0x2a2)]+_0x302edd,_0x5c7855='\x20'[_0x50ace5(0x2dd)](_0x8b9111-_0x53a08f[_0x50ace5(0x2e7)]),_0x5f451a=_0x5c7855+a55_0x169b33[_0x50ace5(0x2df)](_0x53a08f)+'\x20'+_0x349b4e;_0x5cd9f2[_0x50ace5(0x1f4)](_0x5f451a);const _0x344bca=0x16;let _0x1aec65=0x0;for(const _0x184a2e of _0x5ea782){const _0x2b0104=_0x184a2e[_0x50ace5(0x29e)][_0x50ace5(0x35e)]?.['name']||'?',_0x2f8af5=Math[_0x50ace5(0x2d8)](stringWidth(_0x2b0104),_0x344bca);_0x1aec65=Math[_0x50ace5(0x20e)](_0x1aec65,_0x2f8af5);}for(const _0x43b3b7 of _0x5ea782){const {session:_0x2adfc9,startTime:_0x102277,endTime:_0x490f2d,duration:_0xb66a27}=_0x43b3b7,_0x23b88a=_0x2adfc9[_0x50ace5(0x35e)]?.['id'],_0x3e6800=_0x2adfc9['id'],_0x1054bb=_0x2adfc9[_0x50ace5(0x35e)]?.['name']||'?',_0x19d75c=_0x2adfc9[_0x50ace5(0x284)]?.[_0x50ace5(0x2d2)]||'?';let _0xb627cc,_0x44ae46;if(_0x2adfc9[_0x50ace5(0x32c)]){const _0x49a06c=_0x2adfc9[_0x50ace5(0x32c)];!_0x49a06c['done']?(_0xb627cc=_0x49a06c[_0x50ace5(0x24b)]?'🛑':'🔄',_0x44ae46=_0x49a06c[_0x50ace5(0x24b)]?a55_0x169b33[_0x50ace5(0x22d)]:a55_0x169b33[_0x50ace5(0x214)]):(_0xb627cc=_0x49a06c['success']?'✅':'❌',_0x44ae46=_0x49a06c[_0x50ace5(0x271)]?a55_0x169b33[_0x50ace5(0x2cd)]:a55_0x169b33[_0x50ace5(0x352)]);}else _0xb627cc='⏳',_0x44ae46=a55_0x169b33[_0x50ace5(0x2df)];const _0x536559='#'+_0x3e6800,_0x1d450c=_0x23b88a?hyperlink(_0x536559,getWorkflowSessionUrl(_0x4e40b8,_0x23b88a,_0x3e6800)):_0x536559;let _0x201d4f=_0x1054bb;stringWidth(_0x1054bb)>_0x344bca&&(_0x201d4f=_0x1054bb[_0x50ace5(0x392)](0x0,_0x344bca-0x1)+'…');const _0x4ff0c0=a55_0x169b33[_0x50ace5(0x2df)](_0x201d4f),_0x53ee7e=stringWidth(_0x201d4f),_0x520679='\x20'[_0x50ace5(0x2dd)](_0x1aec65-stringWidth(_0x201d4f)+0x2),_0x471efe='('+formatElapsed(_0xb66a27)+')',_0x2273e8=stringWidth(_0x471efe),_0x4a888d=stringWidth(_0x536559),_0x225d9f=_0x4a888d+0x1+_0x53ee7e+_0x520679['length'],_0x3ba7a2=_0x302edd-_0x225d9f-_0x2273e8-0x1-0x8;let _0x581a97=_0x19d75c;stringWidth(_0x581a97)>_0x3ba7a2&&(_0x581a97=_0x581a97['slice'](0x0,_0x3ba7a2-0x1)+'…');const _0x2bc2cd=_0x1d450c+'\x20'+_0x4ff0c0+_0x520679+_0x581a97,_0x3d2d08=stringWidth(_0x2bc2cd),_0x2dc024=_0x302edd-_0x3d2d08-_0x2273e8,_0x6a89b0=_0x2bc2cd+'\x20'[_0x50ace5(0x2dd)](Math[_0x50ace5(0x20e)](0x1,_0x2dc024))+a55_0x169b33[_0x50ace5(0x2df)](_0x471efe),_0x130baf=Math['floor']((_0x102277-_0x95c213)/_0x504c8e),_0x387ef9=Math[_0x50ace5(0x2e8)]((_0x490f2d-_0x95c213)/_0x504c8e),_0x19b7fb=Math['max'](_0x130baf+0x1,_0x387ef9),_0x76841b=new Array(_0x55d647)[_0x50ace5(0x327)]('\x20');for(let _0x1f4384=_0x130baf;_0x1f4384<Math[_0x50ace5(0x2d8)](_0x19b7fb,_0x55d647);_0x1f4384++){_0x76841b[_0x1f4384]='─';}const _0x46a40f=_0x76841b[_0x50ace5(0x2cc)](_0x148b2b=>_0x148b2b==='\x20'?'\x20':_0x44ae46(_0x148b2b))[_0x50ace5(0x342)]('');_0x5cd9f2[_0x50ace5(0x1f4)](_0xb627cc+'\x20'+_0x6a89b0+'│'+_0x46a40f+'│');}return _0x5cd9f2[_0x50ace5(0x342)]('\x0a');}async['navigateSessionsInteractive'](_0x21ed0f,_0x2bcab2,_0x1a1094){const _0x3a873e=a55_0x51cda1,{options:_0x210ddd,tdx:_0x380a58}=_0x2bcab2,_0x3d40a4=_0x210ddd[_0x3a873e(0x31c)],{timelineRows:_0x568bc6,timeAxisHeader:_0x167a2e}=this[_0x3a873e(0x21b)](_0x21ed0f,_0x3d40a4),_0x8634f3=_0x568bc6[_0x3a873e(0x2f2)](_0x5abc02=>_0x5abc02['attemptId']);if(_0x8634f3[_0x3a873e(0x2e7)]===0x0){const _0x36d00f=this[_0x3a873e(0x2a0)](_0x21ed0f,_0x3d40a4);console[_0x3a873e(0x37f)](_0x36d00f);!_0x1a1094&&(console[_0x3a873e(0x1f9)](''),console['error'](a55_0x169b33[_0x3a873e(0x2df)](_0x3a873e(0x289))),console[_0x3a873e(0x1f9)](a55_0x169b33[_0x3a873e(0x2df)](_0x3a873e(0x1f1))+'or'+a55_0x169b33[_0x3a873e(0x2df)](_0x3a873e(0x22e))));return;}_0x167a2e&&console['log'](_0x167a2e);const _0x2800a4=_0x568bc6[_0x3a873e(0x2f2)](_0x43b4c5=>_0x43b4c5[_0x3a873e(0x274)])[_0x3a873e(0x2cc)](_0x1a3cc0=>({'title':_0x1a3cc0[_0x3a873e(0x265)],'value':_0x1a3cc0['attemptId']})),_0x2d20fd=process[_0x3a873e(0x389)][_0x3a873e(0x2f3)]||0x3c,_0x276586=Math[_0x3a873e(0x20e)](0x28,Math[_0x3a873e(0x2e8)](_0x2d20fd*0x2/0x3)),_0x503b47=await a55_0x4fbd47({'type':_0x3a873e(0x335),'name':'attemptId','message':_0x3a873e(0x2f4),'choices':_0x2800a4,'initial':-0x1,'limit':_0x276586,'clearFirst':!![],'fallback':{'title':_0x3a873e(0x346),'value':null},'suggest':(_0x28bba3,_0x393726)=>{const _0x1c5d67=_0x3a873e;if(!_0x28bba3)return Promise['resolve'](_0x393726);const _0x57b3b1=_0x393726[_0x1c5d67(0x2f2)](_0xa1fb05=>{const _0xc880d6=_0x1c5d67,_0x27d02a=_0xa1fb05;return _0x27d02a[_0xc880d6(0x320)][_0xc880d6(0x30e)]()[_0xc880d6(0x386)](_0x28bba3[_0xc880d6(0x30e)]());});return Promise[_0x1c5d67(0x220)](_0x57b3b1);}}),_0x42c1b6=()=>{const _0x164080=_0x3a873e;process[_0x164080(0x389)][_0x164080(0x306)](_0x164080(0x2db)),process[_0x164080(0x389)][_0x164080(0x306)](_0x164080(0x2db)),process[_0x164080(0x389)][_0x164080(0x306)](_0x164080(0x2db));},_0x214c32=_0x503b47&&_0x503b47['attemptId']&&_0x503b47[_0x3a873e(0x274)]!==null&&_0x503b47['attemptId'][_0x3a873e(0x350)]()!=='';if(!_0x214c32){_0x42c1b6(),console[_0x3a873e(0x37f)](a55_0x169b33[_0x3a873e(0x2df)](_0x3a873e(0x33d)));return;}_0x42c1b6();const _0x439c9a=_0x21ed0f[_0x3a873e(0x372)](_0x4e83ec=>_0x4e83ec[_0x3a873e(0x32c)]?.['id']===_0x503b47[_0x3a873e(0x274)]);if(_0x439c9a){const _0x41ab25=_0x439c9a['project']?.[_0x3a873e(0x2d2)]||'?',_0x55d51c=_0x439c9a[_0x3a873e(0x284)]?.['name']||'?';console[_0x3a873e(0x37f)](_0x3a873e(0x23b)+a55_0x169b33[_0x3a873e(0x2df)](_0x41ab25)+_0x3a873e(0x34b)+a55_0x169b33[_0x3a873e(0x2df)](_0x55d51c));}const _0x511b8b=new WorkflowTimelineCommand();await _0x511b8b[_0x3a873e(0x339)]({'args':[],'options':{..._0x210ddd,'attemptId':_0x503b47['attemptId']},'tdx':_0x380a58});}[a55_0x51cda1(0x21b)](_0x1c5c9b,_0xe2f3e7){const _0x49a09e=a55_0x51cda1,_0x2c408b=new Map();for(const _0x32ec10 of _0x1c5c9b){_0x32ec10['id']&&_0x32ec10[_0x49a09e(0x32c)]?.['id']&&_0x2c408b[_0x49a09e(0x2e3)](_0x32ec10['id'],_0x32ec10['lastAttempt']['id']);}const _0x540e97=[];let _0x120e81='';const _0x448977=this[_0x49a09e(0x2a0)](_0x1c5c9b,_0xe2f3e7),_0x1828cc=_0x448977['split']('\x0a');for(const _0x4b1e19 of _0x1828cc){if(_0x4b1e19[_0x49a09e(0x282)](_0x49a09e(0x223))||_0x4b1e19[_0x49a09e(0x2b0)](/^\s+\d{4}-\d{2}-\d{2}/))_0x120e81=_0x4b1e19;else{if(_0x4b1e19[_0x49a09e(0x2b0)](/^[✅❌🔄🛑⏳]/)){const _0x23789d=_0x4b1e19[_0x49a09e(0x2b0)](/#(\d+)/),_0x299d3c=_0x23789d?_0x23789d[0x1]:null,_0x4f05cc=_0x299d3c?_0x2c408b['get'](_0x299d3c)||null:null,_0x58d163=_0x1c5c9b['find'](_0x13b6f4=>_0x13b6f4['id']===_0x299d3c),_0x35134c=_0x58d163?.[_0x49a09e(0x35e)]?.[_0x49a09e(0x2d2)]||'';_0x540e97[_0x49a09e(0x1f4)]({'displayLine':_0x4b1e19,'attemptId':_0x4f05cc,'projectName':_0x35134c});}}}return{'timelineRows':_0x540e97,'timeAxisHeader':_0x120e81};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']=a55_0x51cda1(0x244);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x3a2);async[a55_0x51cda1(0x339)](_0x41acd9){const _0x3f3fcf=a55_0x51cda1,{options:_0x3f136a,args:_0x20169c,tdx:_0x3c6af9}=_0x41acd9,_0x13928=this[_0x3f3fcf(0x2d9)](_0x20169c,_0x3f136a);if(!_0x13928)return 0x1;const {projectName:_0xd0c83b,workflowName:_0x2a999b}=_0x13928,_0x2e6c9a=_0x3f136a[_0x3f3fcf(0x311)];if(_0x3f136a['verbose']){if(_0xd0c83b&&_0x2a999b)console['error'](_0x3f3fcf(0x308)+_0xd0c83b+'.'+_0x2a999b);else _0xd0c83b&&console[_0x3f3fcf(0x1f9)](_0x3f3fcf(0x23c)+_0xd0c83b);_0x2e6c9a&&console[_0x3f3fcf(0x1f9)](_0x3f3fcf(0x242));}const _0x5294a5=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x3c6af9[_0x3f3fcf(0x284)]['attempts']({'projectName':_0xd0c83b,'workflowName':_0x2a999b,'includeRetried':_0x2e6c9a,'limit':_0x3f136a[_0x3f3fcf(0x24f)]}),{'verbose':_0x3f136a[_0x3f3fcf(0x248)]}),_0x4fcf09=_0x5294a5['data'],_0x64287c=_0x3f136a[_0x3f3fcf(0x24f)]||0x64,_0x4a7eca=_0x4fcf09['length']>=_0x64287c?a55_0x169b33[_0x3f3fcf(0x2df)](_0x3f3fcf(0x319)):'';console[_0x3f3fcf(0x1f9)](_0x3f3fcf(0x32d)+_0x4fcf09[_0x3f3fcf(0x2e7)]+_0x3f3fcf(0x22b)+(_0x4fcf09[_0x3f3fcf(0x2e7)]!==0x1?'s':'')+_0x4a7eca);if(_0x3f136a[_0x3f3fcf(0x390)]===_0x3f3fcf(0x29b)||_0x3f136a[_0x3f3fcf(0x390)]===_0x3f3fcf(0x241)||_0x3f136a[_0x3f3fcf(0x390)]===_0x3f3fcf(0x2d5))await handleSDKOutput(_0x4fcf09,_0x3f136a);else{if(_0x4fcf09[_0x3f3fcf(0x2e7)]===0x0){if(_0xd0c83b&&_0x2a999b)console[_0x3f3fcf(0x37f)](_0x3f3fcf(0x39d)+_0xd0c83b+'.'+_0x2a999b);else _0xd0c83b?console[_0x3f3fcf(0x37f)](_0x3f3fcf(0x326)+_0xd0c83b):console['log'](_0x3f3fcf(0x30c));}else{const _0x1904b3=_0x3f136a[_0x3f3fcf(0x31c)],_0x399a8d=_0x4fcf09['map'](_0x113631=>{const _0x40cb2f=_0x3f3fcf,_0x2af5db=a55_0x169b33['dim']('#'+_0x113631['id']),_0x36a125=_0x113631[_0x40cb2f(0x35e)]?.['id'],_0x5aa3aa=_0x113631['session_id']||_0x113631[_0x40cb2f(0x29f)],_0x146eaf=_0x36a125&&_0x5aa3aa?hyperlink(_0x2af5db,getWorkflowAttemptUrl(_0x1904b3,_0x36a125,_0x5aa3aa,_0x113631['id'])):_0x2af5db,{icon:_0x279c9c,text:_0x2dfbc6}=getAttemptStatusDisplay(_0x113631),_0x320706=(_0x113631[_0x40cb2f(0x35e)]?.[_0x40cb2f(0x2d2)]||'?')+'.'+(_0x113631[_0x40cb2f(0x284)]?.['name']||'?'),_0x9d09df=_0x113631[_0x40cb2f(0x226)]?a55_0x169b33['dim'](_0x113631[_0x40cb2f(0x226)]):'';return(_0x146eaf+'\x20'+_0x279c9c+(_0x2dfbc6?'\x20'+_0x2dfbc6:'')+'\x20'+_0x320706+'\x20'+_0x9d09df)['trimEnd']();});await writeOutput(_0x399a8d[_0x3f3fcf(0x342)]('\x0a'),_0x3f136a['output'],_0x3f3fcf(0x359));}}return 0x0;}}function a55_0x1db5(_0x350b5d,_0x53930f){_0x350b5d=_0x350b5d-0x1ef;const _0x352bcb=a55_0x352b();let _0x1db508=_0x352bcb[_0x350b5d];return _0x1db508;}export class WorkflowAttemptCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]='workflow:attempt';[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x34d);async[a55_0x51cda1(0x339)](_0x513675){const _0x52bc7f=a55_0x51cda1,{options:_0x41c093,args:_0x35e863,tdx:_0x4c1ef1}=_0x513675,_0x1107e2=_0x35e863[0x0];if(!_0x1107e2)return console['error'](_0x52bc7f(0x280)),0x1;_0x41c093[_0x52bc7f(0x248)]&&console['error'](_0x52bc7f(0x28b)+_0x1107e2);const _0x42f353=await withSpinner('Getting\x20attempt\x20details...',()=>_0x4c1ef1['workflow'][_0x52bc7f(0x2ee)](_0x1107e2),{'verbose':_0x41c093[_0x52bc7f(0x248)]}),_0x3ff346=_0x42f353['data'];let _0x3f1c5b;!_0x3ff346['done']?_0x3f1c5b=_0x3ff346['cancelRequested']?_0x52bc7f(0x365):'running':_0x3f1c5b=_0x3ff346[_0x52bc7f(0x271)]?'success':_0x52bc7f(0x1f9);let _0x78f2a5;if(_0x3ff346[_0x52bc7f(0x1f5)]&&_0x3ff346[_0x52bc7f(0x20b)]){const _0x108f0f=new Date(_0x3ff346['createdAt'])[_0x52bc7f(0x336)](),_0x4a33c4=new Date(_0x3ff346['finishedAt'])[_0x52bc7f(0x336)]();_0x78f2a5=Math[_0x52bc7f(0x2b7)]((_0x4a33c4-_0x108f0f)/0x3e8);}const _0x476119={'attempt_id':_0x3ff346['id'],'status':_0x3f1c5b,..._0x3ff346[_0x52bc7f(0x25b)]!==undefined&&{'index':_0x3ff346[_0x52bc7f(0x25b)]},..._0x3ff346[_0x52bc7f(0x35e)]&&{'project':_0x3ff346[_0x52bc7f(0x35e)][_0x52bc7f(0x2d2)]},..._0x3ff346['workflow']&&{'workflow':_0x3ff346[_0x52bc7f(0x284)][_0x52bc7f(0x2d2)]},..._0x3ff346[_0x52bc7f(0x29f)]&&{'session_id':_0x3ff346[_0x52bc7f(0x29f)]},..._0x3ff346['sessionTime']&&{'session_time':_0x3ff346[_0x52bc7f(0x226)]},..._0x3ff346[_0x52bc7f(0x252)]&&{'retry_attempt':_0x3ff346[_0x52bc7f(0x252)]},..._0x78f2a5!==undefined&&{'duration_sec':_0x78f2a5},..._0x3ff346[_0x52bc7f(0x1f5)]&&{'created_at':_0x3ff346[_0x52bc7f(0x1f5)]},..._0x3ff346['finishedAt']&&{'finished_at':_0x3ff346[_0x52bc7f(0x20b)]},...Object[_0x52bc7f(0x31e)](_0x3ff346[_0x52bc7f(0x2f0)])[_0x52bc7f(0x2e7)]>0x0&&{'params':_0x3ff346[_0x52bc7f(0x2f0)]}};return await handleSingleObjectOutput(_0x476119,_0x41c093),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x2d6);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x26c);async[a55_0x51cda1(0x339)](_0x135998){const _0x391009=a55_0x51cda1,{options:_0x598ce8,args:_0x4730d8,tdx:_0x278da5}=_0x135998,_0x5d9e60=_0x4730d8[0x0];if(!_0x5d9e60)return console[_0x391009(0x1f9)](_0x391009(0x280)),0x1;const _0x8da947=_0x598ce8[_0x391009(0x302)];_0x598ce8[_0x391009(0x248)]&&(console[_0x391009(0x1f9)](_0x391009(0x28b)+_0x5d9e60),_0x8da947&&console['error'](_0x391009(0x29c)));const _0x26f4af=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x278da5[_0x391009(0x284)][_0x391009(0x292)](_0x5d9e60,_0x8da947||![]),{'verbose':_0x598ce8['verbose']}),_0x2bbeea=_0x26f4af['data'];return console['error'](_0x391009(0x32d)+_0x2bbeea[_0x391009(0x2e7)]+_0x391009(0x256)+(_0x2bbeea[_0x391009(0x2e7)]!==0x1?'s':'')),await handleSDKOutput(_0x2bbeea,_0x598ce8),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x21a);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x353);async[a55_0x51cda1(0x339)](_0x278b1d){const _0x2f1653=a55_0x51cda1,{options:_0x2fd716,args:_0x1968c0,tdx:_0x1d3029}=_0x278b1d,_0xbc53a3=_0x1968c0[0x0];let _0x5aed97=_0x1968c0[0x1];if(!_0xbc53a3)return console[_0x2f1653(0x1f9)](_0x2f1653(0x280)),0x1;_0x2fd716[_0x2f1653(0x248)]&&(console[_0x2f1653(0x1f9)](_0x2f1653(0x28b)+_0xbc53a3),_0x5aed97&&console[_0x2f1653(0x1f9)]('Task\x20name:\x20'+_0x5aed97));const _0x1e76f6=await withSpinner(_0x2f1653(0x20d),()=>_0x1d3029[_0x2f1653(0x284)]['logFiles'](_0xbc53a3,_0x5aed97),{'verbose':_0x2fd716[_0x2f1653(0x248)]}),_0x9e1d5=_0x1e76f6[_0x2f1653(0x33a)];if(_0x9e1d5[_0x2f1653(0x2e7)]===0x0)return console[_0x2f1653(0x1f9)](_0x2f1653(0x32f)),0x0;if(!_0x5aed97&&(_0x2fd716[_0x2f1653(0x29b)]||_0x2fd716['format']))return await handleSDKOutput(_0x9e1d5,_0x2fd716),0x0;if(!_0x5aed97){const _0x587a0e=_0x9e1d5[_0x2f1653(0x2cc)](_0x51dc35=>({'title':_0x51dc35[_0x2f1653(0x2ec)]+'\x20('+formatBytes(_0x51dc35[_0x2f1653(0x26e)])+')','value':_0x51dc35[_0x2f1653(0x2ec)]})),_0x476530=await a55_0x4fbd47({'type':_0x2f1653(0x22c),'name':_0x2f1653(0x1f6),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x587a0e});if(!_0x476530[_0x2f1653(0x1f6)])return console['error'](_0x2f1653(0x33d)),0x0;_0x5aed97=_0x476530['task'];}const _0x27a277=await withSpinner('Downloading\x20logs...',()=>_0x1d3029['workflow']['logs'](_0xbc53a3,_0x5aed97),{'verbose':_0x2fd716[_0x2f1653(0x248)]}),_0x4215e1=_0x27a277[_0x2f1653(0x33a)];return _0x4215e1?console[_0x2f1653(0x37f)](_0x4215e1):console['error']('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x2b9);[a55_0x51cda1(0x2d1)]='Kill\x20a\x20running\x20attempt';async[a55_0x51cda1(0x339)](_0x5e1d34){const _0x37c626=a55_0x51cda1,{options:_0x1d5702,args:_0x3d3f30,tdx:_0xa208dc}=_0x5e1d34,_0x209b99=_0x3d3f30[0x0];if(!_0x209b99)return console[_0x37c626(0x1f9)](_0x37c626(0x280)),0x1;const _0x23d57a=_0x1d5702[_0x37c626(0x262)];_0x1d5702[_0x37c626(0x248)]&&(console[_0x37c626(0x1f9)](_0x37c626(0x28b)+_0x209b99),_0x23d57a&&console[_0x37c626(0x1f9)]('Reason:\x20'+_0x23d57a));if(!_0x1d5702[_0x37c626(0x254)]){if(!isInteractive())return console[_0x37c626(0x1f9)](a55_0x169b33[_0x37c626(0x352)](_0x37c626(0x303)),_0x37c626(0x316)),console[_0x37c626(0x1f9)](a55_0x169b33[_0x37c626(0x2df)](_0x37c626(0x38e))),0x1;const _0x26c5d1=await confirmKey(_0x37c626(0x27a)+_0x209b99+'?');if(!_0x26c5d1)return console[_0x37c626(0x1f9)](a55_0x169b33[_0x37c626(0x22d)](_0x37c626(0x33d))),0x1;}const _0x47d986=await withSpinner(_0x37c626(0x1fb),()=>_0xa208dc[_0x37c626(0x284)][_0x37c626(0x382)](_0x209b99,_0x23d57a),{'verbose':_0x1d5702[_0x37c626(0x248)]}),_0x16f3f0=_0x47d986['data'];return console[_0x37c626(0x1f9)]('✔\x20'+_0x16f3f0),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x1f8);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x201);async[a55_0x51cda1(0x339)](_0x396f92){const _0x5d79a3=a55_0x51cda1,{options:_0x54a865,args:_0x3f2c3e,tdx:_0x5dda0}=_0x396f92,_0x5d8c8f=_0x3f2c3e[0x0];if(!_0x5d8c8f)return console['error'](_0x5d79a3(0x358)),console[_0x5d79a3(0x1f9)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5c31c6=![],_0x32bd24=_0x5d8c8f;if(_0x5d8c8f[_0x5d79a3(0x282)]('session:'))_0x5c31c6=!![],_0x32bd24=_0x5d8c8f[_0x5d79a3(0x2e6)](0x8);else{if(_0x5d8c8f[_0x5d79a3(0x282)](_0x5d79a3(0x375)))_0x5c31c6=![],_0x32bd24=_0x5d8c8f['substring'](0x8);else return console[_0x5d79a3(0x1f9)](_0x5d79a3(0x300)),console[_0x5d79a3(0x1f9)](_0x5d79a3(0x2ce)),0x1;}const _0x25c16c=_0x54a865[_0x5d79a3(0x209)],_0x5f2a34=_0x54a865[_0x5d79a3(0x39f)],_0x459afb=_0x54a865[_0x5d79a3(0x2f0)],_0x25f358=_0x54a865[_0x5d79a3(0x37d)];_0x54a865['verbose']&&(console[_0x5d79a3(0x1f9)](_0x5d79a3(0x31b)+(_0x5c31c6?_0x5d79a3(0x29e):_0x5d79a3(0x2ee))+'\x20'+_0x32bd24),_0x25c16c&&console[_0x5d79a3(0x1f9)](_0x5d79a3(0x304)+_0x25c16c),_0x5f2a34&&console[_0x5d79a3(0x1f9)](_0x5d79a3(0x323)+_0x5f2a34),_0x459afb&&console[_0x5d79a3(0x1f9)]('Params:\x20'+_0x459afb),_0x25f358&&console[_0x5d79a3(0x1f9)]('Force:\x20yes'));let _0xa1d4bc;if(_0x459afb)try{if(_0x459afb[_0x5d79a3(0x282)]('@')){const _0x402273=await import(_0x5d79a3(0x251)),_0x1a82dd=_0x459afb['substring'](0x1),_0x237b7a=await _0x402273['readFile'](_0x1a82dd,_0x5d79a3(0x31a));_0xa1d4bc=JSON['parse'](_0x237b7a);}else _0xa1d4bc=JSON['parse'](_0x459afb);}catch{return console[_0x5d79a3(0x1f9)](_0x5d79a3(0x2e2)),0x1;}if(!_0x54a865[_0x5d79a3(0x254)]){if(!isInteractive())return console[_0x5d79a3(0x1f9)](a55_0x169b33['red'](_0x5d79a3(0x303)),_0x5d79a3(0x316)),console[_0x5d79a3(0x1f9)](a55_0x169b33[_0x5d79a3(0x2df)](_0x5d79a3(0x38e))),0x1;const _0x179b24=await confirmKey(_0x5d79a3(0x230)+(_0x5c31c6?_0x5d79a3(0x29e):_0x5d79a3(0x2ee))+'\x20'+_0x32bd24+'?');if(!_0x179b24)return console[_0x5d79a3(0x1f9)](a55_0x169b33[_0x5d79a3(0x22d)](_0x5d79a3(0x33d))),0x1;}let _0x34b09c;_0x5c31c6?_0x34b09c=await withSpinner(_0x5d79a3(0x2c7),()=>_0x5dda0[_0x5d79a3(0x284)][_0x5d79a3(0x341)](_0x32bd24,{'fromTask':_0x25c16c,'retryParams':_0xa1d4bc}),{'verbose':_0x54a865[_0x5d79a3(0x248)]}):_0x34b09c=await withSpinner(_0x5d79a3(0x354),()=>_0x5dda0['workflow'][_0x5d79a3(0x2ae)](_0x32bd24,{'resumeFrom':_0x5f2a34,'retryParams':_0xa1d4bc,'force':_0x25f358}),{'verbose':_0x54a865[_0x5d79a3(0x248)]});const _0x2b317d=_0x34b09c[_0x5d79a3(0x33a)];return console[_0x5d79a3(0x1f9)](_0x5d79a3(0x2ca)),console[_0x5d79a3(0x1f9)](_0x5d79a3(0x34c)+_0x2b317d[_0x5d79a3(0x274)]),console[_0x5d79a3(0x1f9)](_0x5d79a3(0x36e)+_0x2b317d[_0x5d79a3(0x29f)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]='workflow:run';[a55_0x51cda1(0x2d1)]='Start\x20a\x20workflow\x20run';async[a55_0x51cda1(0x339)](_0x5664b0){const _0x27e714=a55_0x51cda1,{options:_0x10023d,args:_0x4a6f32,tdx:_0x1ad6fd}=_0x5664b0;let _0x4df97d=_0x4a6f32[0x0];if(!_0x4df97d){const _0x4622e3=this[_0x27e714(0x25c)]([],_0x10023d),_0x5ab479=await withSpinner(_0x27e714(0x21c),()=>_0x1ad6fd[_0x27e714(0x284)][_0x27e714(0x2e4)](_0x4622e3,{'limit':_0x10023d[_0x27e714(0x24f)]}),{'verbose':_0x10023d['verbose']}),_0xea46e1=_0x5ab479[_0x27e714(0x33a)];if(_0xea46e1[_0x27e714(0x2e7)]===0x0)return console[_0x27e714(0x1f9)](_0x27e714(0x2fd)),!_0x4622e3&&console['error'](a55_0x169b33[_0x27e714(0x2df)](_0x27e714(0x290))),0x1;const _0x5f946a=_0xea46e1['map'](_0x70ec26=>({'title':_0x70ec26[_0x27e714(0x35e)]?.['name']+'.'+_0x70ec26[_0x27e714(0x2d2)],'value':_0x70ec26[_0x27e714(0x35e)]?.[_0x27e714(0x2d2)]+'.'+_0x70ec26['name'],'description':_0x70ec26['revision']?_0x27e714(0x24d)+_0x70ec26[_0x27e714(0x20c)]:undefined})),_0x418a06=await a55_0x4fbd47({'type':'select','name':_0x27e714(0x284),'message':_0x27e714(0x20f),'choices':_0x5f946a});if(!_0x418a06[_0x27e714(0x284)])return 0x1;_0x4df97d=_0x418a06['workflow'];}if(!_0x4df97d[_0x27e714(0x386)]('.')){const _0x562711=this[_0x27e714(0x25c)]([],_0x10023d);if(_0x562711)_0x4df97d=_0x562711+'.'+_0x4df97d;else return console['error'](a55_0x169b33[_0x27e714(0x352)](_0x27e714(0x249)),_0x27e714(0x2a6)),console[_0x27e714(0x1f9)](a55_0x169b33[_0x27e714(0x2df)](_0x27e714(0x290))),0x1;}const _0x5b5181=_0x10023d['param'],_0x594375=_0x10023d[_0x27e714(0x226)],_0x52f066={};if(_0x5b5181&&Array['isArray'](_0x5b5181))for(const _0xff2172 of _0x5b5181){const _0x7ff132=_0xff2172[_0x27e714(0x203)]('=');if(_0x7ff132===-0x1)return console['error'](_0x27e714(0x340)+_0xff2172),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x4e62d4=_0xff2172[_0x27e714(0x2e6)](0x0,_0x7ff132),_0x3cb026=_0xff2172[_0x27e714(0x2e6)](_0x7ff132+0x1);try{_0x52f066[_0x4e62d4]=JSON['parse'](_0x3cb026);}catch{_0x52f066[_0x4e62d4]=_0x3cb026;}}_0x10023d[_0x27e714(0x248)]&&(console[_0x27e714(0x1f9)](_0x27e714(0x253)+_0x4df97d),Object[_0x27e714(0x31e)](_0x52f066)[_0x27e714(0x2e7)]>0x0&&console['error'](_0x27e714(0x278)+JSON['stringify'](_0x52f066)),_0x594375&&console[_0x27e714(0x1f9)](_0x27e714(0x2a9)+_0x594375));const _0x4e0f45=await withSpinner(_0x27e714(0x291),()=>_0x1ad6fd['workflow'][_0x27e714(0x224)](_0x4df97d,_0x52f066,{'sessionTime':_0x594375}),{'verbose':_0x10023d[_0x27e714(0x248)]}),_0x25ae8c=_0x4e0f45[_0x27e714(0x33a)];console[_0x27e714(0x1f9)](_0x27e714(0x25d)),console[_0x27e714(0x1f9)](_0x27e714(0x1fc)+_0x25ae8c['id']),console[_0x27e714(0x1f9)](_0x27e714(0x36e)+_0x25ae8c[_0x27e714(0x29f)]),console[_0x27e714(0x1f9)](_0x27e714(0x36a)+_0x25ae8c['project']?.['name']),console[_0x27e714(0x1f9)](_0x27e714(0x329)+_0x25ae8c[_0x27e714(0x284)]?.[_0x27e714(0x2d2)]);if(_0x25ae8c[_0x27e714(0x35e)]?.['id']&&_0x25ae8c[_0x27e714(0x29f)]&&_0x25ae8c['id']){const _0x30e545=_0x10023d['site'],_0x594e64=getConsoleUrl(_0x30e545,'/app/workflows/'+_0x25ae8c['project']['id']+'/sessions/'+_0x25ae8c[_0x27e714(0x29f)]+_0x27e714(0x305)+_0x25ae8c['id']);console[_0x27e714(0x1f9)](_0x27e714(0x279)+a55_0x169b33[_0x27e714(0x219)](_0x594e64));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a55_0x51cda1(0x281);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x334);async[a55_0x51cda1(0x339)](_0x21fe71){const _0x5675c2=a55_0x51cda1,{options:_0x9130ff,args:_0x36f111,tdx:_0x24fd87}=_0x21fe71,_0xf5bbac=_0x36f111[0x0],_0x11551b=_0x36f111[0x1]||'.';if(!_0xf5bbac)return console['error'](_0x5675c2(0x33b)),console[_0x5675c2(0x1f9)](_0x5675c2(0x396)),0x1;const _0x578b65=_0x9130ff['revision'];_0x9130ff[_0x5675c2(0x248)]&&(console[_0x5675c2(0x1f9)]('Project:\x20'+_0xf5bbac),console[_0x5675c2(0x1f9)]('Output\x20directory:\x20'+_0x11551b),_0x578b65&&console[_0x5675c2(0x1f9)](_0x5675c2(0x344)+_0x578b65));const _0x298717=await withSpinner(_0x5675c2(0x347)+_0xf5bbac+_0x5675c2(0x35d),()=>_0x24fd87['workflow']['download'](_0xf5bbac,_0x11551b,{'revision':_0x578b65}),{'verbose':_0x9130ff[_0x5675c2(0x248)]}),_0x49789a=_0x298717[_0x5675c2(0x33a)];return console[_0x5675c2(0x1f9)](_0x5675c2(0x377)+_0x49789a['projectName']),console[_0x5675c2(0x1f9)]('\x20\x20Revision:\x20'+_0x49789a['revision']),console[_0x5675c2(0x1f9)](_0x5675c2(0x2c5)+_0x49789a[_0x5675c2(0x20a)]),console[_0x5675c2(0x1f9)](_0x5675c2(0x24c)+_0x11551b+'/'+_0x49789a['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x325);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x380);async[a55_0x51cda1(0x339)](_0xab3c53){const _0x5c6d38=a55_0x51cda1,{options:_0x202a6b,args:_0x27da64,tdx:_0x3f89f4}=_0xab3c53;let _0x336833='.',_0x19a618=_0x202a6b['name'];if(_0x27da64[0x0]){const {promises:_0xb0b76}=await import('fs');try{const _0x48b0c0=await _0xb0b76[_0x5c6d38(0x1f3)](_0x27da64[0x0]);if(_0x48b0c0[_0x5c6d38(0x2bf)]())_0x336833=_0x27da64[0x0];else return console[_0x5c6d38(0x1f9)](_0x5c6d38(0x2aa)+_0x27da64[0x0]+_0x5c6d38(0x366)),0x1;}catch{_0x19a618=_0x27da64[0x0],_0x336833='.';}}const _0x303573=_0x202a6b[_0x5c6d38(0x20c)],_0x57901d=_0x202a6b[_0x5c6d38(0x393)];_0x202a6b[_0x5c6d38(0x248)]&&(console[_0x5c6d38(0x1f9)](_0x5c6d38(0x234)+_0x336833),_0x19a618&&console[_0x5c6d38(0x1f9)](_0x5c6d38(0x2cf)+_0x19a618),_0x303573&&console[_0x5c6d38(0x1f9)](_0x5c6d38(0x344)+_0x303573),_0x57901d&&console[_0x5c6d38(0x1f9)]('Validation:\x20skipped'));const _0x180e7d=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3f89f4[_0x5c6d38(0x284)][_0x5c6d38(0x1f4)](_0x336833,{'projectName':_0x19a618,'revision':_0x303573,'skipValidation':_0x57901d}),{'verbose':_0x202a6b[_0x5c6d38(0x248)]}),_0x36817c=_0x180e7d[_0x5c6d38(0x33a)];return console['error'](_0x5c6d38(0x32e)+_0x36817c['projectName']),console[_0x5c6d38(0x1f9)]('\x20\x20Project\x20ID:\x20'+_0x36817c[_0x5c6d38(0x360)]),console[_0x5c6d38(0x1f9)](_0x5c6d38(0x28e)+_0x36817c[_0x5c6d38(0x20c)]),await this[_0x5c6d38(0x348)](_0x3f89f4,_0x36817c[_0x5c6d38(0x27c)],_0x202a6b[_0x5c6d38(0x31c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a55_0x51cda1(0x2d2)]='workflow:pull';[a55_0x51cda1(0x2d1)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async['execute'](_0x3f3da3){const _0x586eab=a55_0x51cda1,{options:_0x16ad94,args:_0x557896,tdx:_0x115b49}=_0x3f3da3,_0x5b980a=_0x557896[0x0],_0x358067=_0x557896[0x1];if(!_0x5b980a)return console['error'](a55_0x169b33[_0x586eab(0x352)](_0x586eab(0x249)),_0x586eab(0x2f7)),console[_0x586eab(0x1f9)](a55_0x169b33['dim'](_0x586eab(0x24a))),0x1;const _0x3ffc27=_0x16ad94[_0x586eab(0x20c)];_0x16ad94[_0x586eab(0x248)]&&(console[_0x586eab(0x1f9)](_0x586eab(0x23b)+_0x5b980a),_0x358067&&console[_0x586eab(0x1f9)]('Target\x20directory:\x20'+_0x358067),_0x3ffc27&&console['error']('Revision:\x20'+_0x3ffc27),_0x16ad94['dryRun']&&console['error'](_0x586eab(0x2b5)));const _0x7efa7e=await withSpinner(_0x586eab(0x205)+_0x5b980a+_0x586eab(0x35d),()=>_0x115b49['workflow'][_0x586eab(0x2dc)](_0x5b980a,{'targetDir':_0x358067,'revision':_0x3ffc27}),{'verbose':_0x16ad94[_0x586eab(0x248)]}),_0x12e484=_0x7efa7e[_0x586eab(0x33a)];_0x12e484['isNewProject']?console['error'](_0x586eab(0x211)+_0x12e484[_0x586eab(0x27c)]):console[_0x586eab(0x1f9)](_0x586eab(0x2f1)+_0x12e484['projectName']);console[_0x586eab(0x1f9)]('\x20\x20Revision:\x20'+_0x12e484[_0x586eab(0x20c)]),console[_0x586eab(0x1f9)](_0x586eab(0x374)+(a55_0x2d2e63[_0x586eab(0x2e9)](process['cwd'](),_0x12e484[_0x586eab(0x2a3)])||'.')),console['error'](_0x586eab(0x369)+a55_0x169b33['green']('+'+_0x12e484['summary'][_0x586eab(0x26f)]+_0x586eab(0x236))+',\x20'+(a55_0x169b33['yellow']('~'+_0x12e484[_0x586eab(0x2eb)]['modified']+_0x586eab(0x391))+',\x20')+(a55_0x169b33[_0x586eab(0x352)]('-'+_0x12e484[_0x586eab(0x2eb)]['deleted']+_0x586eab(0x276))+',\x20')+(''+a55_0x169b33[_0x586eab(0x2df)](_0x12e484[_0x586eab(0x2eb)][_0x586eab(0x2bc)]+_0x586eab(0x261))));for(const _0x49c0fb of _0x12e484[_0x586eab(0x1fa)]){_0x49c0fb[_0x586eab(0x1fd)]==='modified'&&_0x49c0fb['diff']&&(console[_0x586eab(0x1f9)]('\x0a'+a55_0x169b33[_0x586eab(0x219)]('---\x20'+_0x49c0fb['path'])),console[_0x586eab(0x1f9)](_0x49c0fb[_0x586eab(0x28f)]));}if(!_0x12e484[_0x586eab(0x373)])return saveSessionContext({'workflow_project':_0x12e484[_0x586eab(0x27c)]},_0x16ad94[_0x586eab(0x29e)]),console['error'](a55_0x169b33['green'](_0x586eab(0x39a))),console[_0x586eab(0x1f9)](a55_0x169b33[_0x586eab(0x2df)](_0x586eab(0x35a)+_0x12e484[_0x586eab(0x27c)])),0x0;if(_0x16ad94[_0x586eab(0x2af)])return console[_0x586eab(0x1f9)](a55_0x169b33['yellow']('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x16ad94['yes']){if(!isInteractive())return console[_0x586eab(0x1f9)](a55_0x169b33['red'](_0x586eab(0x303)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x586eab(0x1f9)](a55_0x169b33[_0x586eab(0x2df)](_0x586eab(0x38e))),0x1;const _0x474fac=await confirmKey(_0x586eab(0x1ff));if(!_0x474fac)return console[_0x586eab(0x1f9)](a55_0x169b33['yellow'](_0x586eab(0x33d)),_0x586eab(0x204)),0x1;}await withSpinner(_0x586eab(0x398),()=>_0x115b49[_0x586eab(0x284)][_0x586eab(0x351)](_0x12e484,{'revision':_0x3ffc27}),{'verbose':_0x16ad94['verbose']}),saveSessionContext({'workflow_project':_0x12e484[_0x586eab(0x27c)]},_0x16ad94[_0x586eab(0x29e)]),console['error'](a55_0x169b33['green'](_0x586eab(0x239)));const _0x155ef5=a55_0x2d2e63[_0x586eab(0x2e9)](process[_0x586eab(0x2d7)](),_0x12e484[_0x586eab(0x2a3)])||'.';return console[_0x586eab(0x1f9)](a55_0x169b33[_0x586eab(0x2df)](_0x586eab(0x24c)+_0x155ef5)),console[_0x586eab(0x1f9)](a55_0x169b33[_0x586eab(0x2df)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x12e484[_0x586eab(0x27c)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x310);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x2fe);async[a55_0x51cda1(0x339)](_0x46ed79){const _0x41a95f=a55_0x51cda1,{options:_0x1d9785,args:_0x460b85,tdx:_0x5997c2}=_0x46ed79,_0x19b693=this[_0x41a95f(0x383)](_0x460b85,_0x1d9785),_0x3d1fe6=_0x1d9785['revision'],_0x296e21=_0x1d9785[_0x41a95f(0x393)];_0x1d9785['verbose']&&(_0x19b693&&console[_0x41a95f(0x1f9)](_0x41a95f(0x2ad)+_0x19b693),_0x3d1fe6&&console[_0x41a95f(0x1f9)](_0x41a95f(0x344)+_0x3d1fe6),_0x1d9785['dryRun']&&console[_0x41a95f(0x1f9)](_0x41a95f(0x2b5)),_0x296e21&&console[_0x41a95f(0x1f9)](_0x41a95f(0x36b)));let _0x844102;try{_0x844102=await withSpinner(_0x41a95f(0x215),()=>_0x5997c2[_0x41a95f(0x284)]['preparePushProject']({'sourceDir':_0x19b693,'revision':_0x3d1fe6,'skipValidation':_0x296e21}),{'verbose':_0x1d9785[_0x41a95f(0x248)]});}catch(_0xecef05){if(_0xecef05 instanceof Error&&_0xecef05[_0x41a95f(0x2a1)]['includes'](_0x41a95f(0x207)))return console[_0x41a95f(0x1f9)](a55_0x169b33[_0x41a95f(0x352)](_0x41a95f(0x249)),_0x41a95f(0x23e)),_0x1d9785[_0x41a95f(0x272)]?console['error'](a55_0x169b33[_0x41a95f(0x2df)](_0x41a95f(0x288)+_0x1d9785['workflowProject']+_0x41a95f(0x2f8)+_0x1d9785[_0x41a95f(0x272)]+'\x27')):console[_0x41a95f(0x1f9)](a55_0x169b33[_0x41a95f(0x2df)](_0x41a95f(0x206))),0x1;throw _0xecef05;}const _0x54a11=_0x844102[_0x41a95f(0x33a)];console[_0x41a95f(0x1f9)](_0x41a95f(0x36f)+_0x54a11[_0x41a95f(0x27c)]),console[_0x41a95f(0x1f9)](_0x41a95f(0x235)+_0x54a11[_0x41a95f(0x2b3)]),console[_0x41a95f(0x1f9)](_0x41a95f(0x28e)+_0x54a11['revision']),console['error'](_0x41a95f(0x369)+a55_0x169b33[_0x41a95f(0x2cd)]('+'+_0x54a11['summary']['new']+'\x20new')+',\x20'+(a55_0x169b33['yellow']('~'+_0x54a11[_0x41a95f(0x2eb)][_0x41a95f(0x23d)]+_0x41a95f(0x391))+',\x20')+(a55_0x169b33[_0x41a95f(0x352)]('-'+_0x54a11[_0x41a95f(0x2eb)][_0x41a95f(0x3a1)]+_0x41a95f(0x276))+',\x20')+(''+a55_0x169b33[_0x41a95f(0x2df)](_0x54a11[_0x41a95f(0x2eb)][_0x41a95f(0x2bc)]+_0x41a95f(0x261))));for(const _0x344c0e of _0x54a11['changes']){_0x344c0e['type']===_0x41a95f(0x23d)&&_0x344c0e[_0x41a95f(0x28f)]&&(console[_0x41a95f(0x1f9)]('\x0a'+a55_0x169b33['cyan'](_0x41a95f(0x269)+_0x344c0e[_0x41a95f(0x227)])),console['error'](_0x344c0e['diff']));}if(!_0x54a11[_0x41a95f(0x373)])return console['error'](a55_0x169b33[_0x41a95f(0x2cd)](_0x41a95f(0x2d4))),await this[_0x41a95f(0x348)](_0x5997c2,_0x54a11[_0x41a95f(0x27c)],_0x1d9785[_0x41a95f(0x31c)]),0x0;if(_0x1d9785['dryRun'])return console[_0x41a95f(0x1f9)](a55_0x169b33[_0x41a95f(0x22d)](_0x41a95f(0x294))),0x0;if(!_0x1d9785['yes']){if(!isInteractive())return console['error'](a55_0x169b33[_0x41a95f(0x352)](_0x41a95f(0x303)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41a95f(0x1f9)](a55_0x169b33[_0x41a95f(0x2df)](_0x41a95f(0x38e))),0x1;const _0x4405de=await confirmKey(_0x41a95f(0x371));if(!_0x4405de)return console[_0x41a95f(0x1f9)](a55_0x169b33['yellow'](_0x41a95f(0x33d)),'-\x20nothing\x20pushed'),0x1;}const _0x16d426=await withSpinner(_0x41a95f(0x313),()=>_0x5997c2[_0x41a95f(0x284)]['executePushProject'](_0x54a11),{'verbose':_0x1d9785[_0x41a95f(0x248)]}),_0x56acfb=_0x16d426['data'];return console['error'](a55_0x169b33[_0x41a95f(0x2cd)]('✔\x20Push\x20complete')),console[_0x41a95f(0x1f9)]('\x20\x20Project\x20ID:\x20'+_0x56acfb[_0x41a95f(0x360)]),console['error'](_0x41a95f(0x28e)+_0x56acfb[_0x41a95f(0x20c)]),await this[_0x41a95f(0x348)](_0x5997c2,_0x56acfb[_0x41a95f(0x27c)],_0x1d9785[_0x41a95f(0x31c)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]='workflow:clone';['description']=a55_0x51cda1(0x293);async[a55_0x51cda1(0x339)](_0x20693a){const _0x5ddd7c=a55_0x51cda1,{options:_0x1046f,args:_0x26a096,tdx:_0x16d5ac}=_0x20693a,_0x1ceb27=this['resolveProjectDir'](_0x26a096,_0x1046f),_0xc61163=_0x1046f[_0x5ddd7c(0x2d2)],_0x33efe8=_0x1046f[_0x5ddd7c(0x20c)],_0x527c06=_0x1046f[_0x5ddd7c(0x393)];if(!_0x1ceb27)return console[_0x5ddd7c(0x1f9)](a55_0x169b33['red'](_0x5ddd7c(0x249)),_0x5ddd7c(0x2cb)),console['error'](a55_0x169b33[_0x5ddd7c(0x2df)](_0x5ddd7c(0x35b))),console['error'](a55_0x169b33[_0x5ddd7c(0x2df)](_0x5ddd7c(0x1fe))),0x1;if(!_0xc61163)return console[_0x5ddd7c(0x1f9)](a55_0x169b33['red'](_0x5ddd7c(0x249)),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x5ddd7c(0x1f9)](a55_0x169b33['dim']('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x1046f[_0x5ddd7c(0x248)]&&(console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x2ad)+_0x1ceb27),console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x287)+_0xc61163),_0x33efe8&&console['error']('Revision:\x20'+_0x33efe8),_0x1046f['dryRun']&&console[_0x5ddd7c(0x1f9)]('Dry\x20run:\x20yes'),_0x527c06&&console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x36b)));const _0x4b6213=await withSpinner(_0x5ddd7c(0x266),()=>_0x16d5ac['workflow'][_0x5ddd7c(0x285)](_0x1ceb27,_0xc61163,{'revision':_0x33efe8,'skipValidation':_0x527c06}),{'verbose':_0x1046f['verbose']}),_0x25e631=_0x4b6213[_0x5ddd7c(0x33a)];console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x213)+_0x25e631[_0x5ddd7c(0x2b3)]);_0x25e631[_0x5ddd7c(0x394)]&&console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x299)+_0x25e631[_0x5ddd7c(0x394)]);console[_0x5ddd7c(0x1f9)]('New\x20project\x20name:\x20'+_0x25e631[_0x5ddd7c(0x2f6)]),console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x344)+_0x25e631[_0x5ddd7c(0x20c)]),console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x2a8)+_0x25e631[_0x5ddd7c(0x31d)]);_0x25e631['targetExists']&&(console[_0x5ddd7c(0x1f9)](a55_0x169b33[_0x5ddd7c(0x22d)](_0x5ddd7c(0x338)+_0x25e631[_0x5ddd7c(0x2f6)]+_0x5ddd7c(0x2ea)+_0x25e631[_0x5ddd7c(0x38b)]+')')),console[_0x5ddd7c(0x1f9)](a55_0x169b33[_0x5ddd7c(0x22d)](_0x5ddd7c(0x2c4))));if(_0x1046f['dryRun'])return console[_0x5ddd7c(0x1f9)](a55_0x169b33[_0x5ddd7c(0x22d)](_0x5ddd7c(0x38f))),0x0;if(!_0x1046f['yes']){if(!isInteractive())return console[_0x5ddd7c(0x1f9)](a55_0x169b33['red'](_0x5ddd7c(0x303)),_0x5ddd7c(0x316)),console[_0x5ddd7c(0x1f9)](a55_0x169b33[_0x5ddd7c(0x2df)](_0x5ddd7c(0x38e))),0x1;const _0x1f74da=_0x25e631[_0x5ddd7c(0x394)]||a55_0x2d2e63[_0x5ddd7c(0x25e)](_0x1ceb27),_0x402297=_0x25e631[_0x5ddd7c(0x309)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0xc61163+_0x5ddd7c(0x243):_0x5ddd7c(0x267)+_0x1f74da+_0x5ddd7c(0x21f)+_0xc61163+'\x22?',_0x325f4d=await confirmKey(_0x402297);if(!_0x325f4d)return console['error'](a55_0x169b33[_0x5ddd7c(0x22d)](_0x5ddd7c(0x33d))),0x1;}const _0x1fb117=await withSpinner(_0x25e631[_0x5ddd7c(0x309)]?_0x5ddd7c(0x258)+_0xc61163+_0x5ddd7c(0x35d):_0x5ddd7c(0x263)+_0xc61163+_0x5ddd7c(0x35d),()=>_0x16d5ac[_0x5ddd7c(0x284)][_0x5ddd7c(0x2da)](_0x25e631),{'verbose':_0x1046f[_0x5ddd7c(0x248)]}),_0x8b63a0=_0x1fb117[_0x5ddd7c(0x33a)];return console[_0x5ddd7c(0x1f9)](a55_0x169b33[_0x5ddd7c(0x2cd)](_0x25e631[_0x5ddd7c(0x309)]?_0x5ddd7c(0x23f):_0x5ddd7c(0x28d))),console[_0x5ddd7c(0x1f9)](_0x5ddd7c(0x36a)+_0x8b63a0['newProjectName']),console[_0x5ddd7c(0x1f9)]('\x20\x20Project\x20ID:\x20'+_0x8b63a0[_0x5ddd7c(0x24e)]),console[_0x5ddd7c(0x1f9)]('\x20\x20Revision:\x20'+_0x8b63a0[_0x5ddd7c(0x20c)]),await this['showWorkflowConsoleUrl'](_0x16d5ac,_0x8b63a0[_0x5ddd7c(0x2f6)],_0x1046f[_0x5ddd7c(0x31c)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a55_0x51cda1(0x238);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x39e);async['execute'](_0x1f1ead){const _0x1d3b4e=a55_0x51cda1,{options:_0x4b5df0,args:_0x2af7c8,tdx:_0x19503e}=_0x1f1ead,_0x492de7=_0x2af7c8[0x0];if(!_0x492de7)return console[_0x1d3b4e(0x1f9)](_0x1d3b4e(0x2f9)),console['error'](_0x1d3b4e(0x1f2)),0x1;_0x4b5df0[_0x1d3b4e(0x248)]&&console[_0x1d3b4e(0x1f9)]('Project:\x20'+_0x492de7);if(!_0x4b5df0[_0x1d3b4e(0x254)]){if(!isInteractive())return console[_0x1d3b4e(0x1f9)](a55_0x169b33[_0x1d3b4e(0x352)](_0x1d3b4e(0x303)),_0x1d3b4e(0x316)),console[_0x1d3b4e(0x1f9)](a55_0x169b33[_0x1d3b4e(0x2df)](_0x1d3b4e(0x38e))),0x1;const _0x5c707a=await confirmKey(_0x1d3b4e(0x246)+_0x492de7+_0x1d3b4e(0x2ef));if(!_0x5c707a)return console[_0x1d3b4e(0x1f9)](a55_0x169b33[_0x1d3b4e(0x22d)](_0x1d3b4e(0x33d))),0x1;}const _0x45c353=await withSpinner(_0x1d3b4e(0x208)+_0x492de7+_0x1d3b4e(0x35d),()=>_0x19503e['workflow']['delete'](_0x492de7),{'verbose':_0x4b5df0[_0x1d3b4e(0x248)]}),_0x55d0a0=_0x45c353[_0x1d3b4e(0x33a)];return console['error']('✔\x20Deleted\x20project\x20'+_0x55d0a0[_0x1d3b4e(0x27c)]),console[_0x1d3b4e(0x1f9)](_0x1d3b4e(0x216)+_0x55d0a0['projectId']),0x0;}}export function parseKeyValue(_0x5a01bf){const _0x57dcd9=a55_0x51cda1,_0x168f1e=_0x5a01bf['indexOf']('=');if(_0x168f1e===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5a01bf+_0x57dcd9(0x2c2));const _0x540f20=_0x5a01bf['substring'](0x0,_0x168f1e),_0x2d20a0=_0x5a01bf['substring'](_0x168f1e+0x1);if(!_0x540f20)throw new Error(_0x57dcd9(0x330));return{'key':_0x540f20,'value':_0x2d20a0};}function a55_0x352b(){const _0x30b944=['Analyzing\x20changes...','\x20\x20Project\x20ID:\x20','Resolving\x20project\x20\x27','Setting\x20secret...','cyan','workflow:logs','generateSessionTimelineRows','Loading\x20workflows...','isTTY','LABEL_WIDTH_DIVISOR','\x22\x20to\x20new\x20project\x20\x22','resolve','\x20-\x20','POLL_INTERVAL_MS','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','run','unknown','sessionTime','path','No\x20sessions\x20found','950AcmNNt','List\x20all\x20workflow\x20projects','\x20attempt','select','yellow','\x20\x20tdx\x20wf\x20use\x20<project>','context','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Secrets\x20to\x20set:\x20','Loading\x20session...','✔\x20Secret\x20\x27','Project\x20directory:\x20','\x20\x20Source:\x20','\x20new','workflow:projects','workflow:delete','✔\x20Pull\x20complete','sessions','Project:\x20','Filter:\x20project=','modified','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','✔\x20Project\x20updated','fullName','jsonl','Include\x20retried:\x20yes','\x22\x20with\x20new\x20revision?','workflow:attempts','now','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','workflowName','verbose','Error:','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','cancelRequested','\x20\x20Location:\x20','revision:\x20','newProjectId','limit','Warning:','fs/promises','retryAttemptName','Workflow:\x20','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20task','No\x20workflow\x20projects\x20found','Updating\x20','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','getMinutes','index','resolveProject','✔\x20Workflow\x20run\x20started','basename','\x0a✔\x20Attempt\x20complete','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x20unchanged','reason','Cloning\x20to\x20','Usage:\x20tdx\x20wf\x20use\x20<project>','displayLine','Analyzing\x20project...','\x0aClone\x20\x22','373yNwDcl','---\x20','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','renderSingleTimeline','Show\x20tasks\x20for\x20an\x20attempt','\x20project','fileSize','new','sys','success','workflowProject','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','attemptId','workflow:secrets:set','\x20deleted','\x20of\x20','Parameters:\x20','\x20\x20Console:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','white','projectName','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','state','Project\x20filter:\x20','Error:\x20Attempt\x20ID\x20is\x20required','workflow:download','startsWith','\x0aPolling...\x20(','workflow','prepareCloneProject','68860oVwtTq','New\x20project\x20name:\x20','Tip:\x20cd\x20to\x20workflows/','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','split','Attempt\x20ID:\x20','msPerChar','✔\x20Clone\x20complete','\x20\x20Revision:\x20','diff','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Starting\x20workflow\x20run...','tasks','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20sessions\x20found\x20in\x20project:\x20','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','No\x20projects\x20match\x20pattern:\x20','180pidgIm','Source\x20project:\x20','renderTimeline','json','Including\x20subtasks:\x20yes','buildTimelineData','session','sessionId','renderSessionsTimeline','message','ICON_SPACING','targetDir','toISOString','No\x20sessions\x20found\x20for:\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','has','Files\x20to\x20upload:\x20','Session\x20time:\x20','Error:\x20','deleteSecret','Listing\x20workflow\x20projects...','Source\x20directory:\x20','retryAttempt','dryRun','match','from','Select\x20a\x20session\x20to\x20view\x20timeline:','sourceDir','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Dry\x20run:\x20yes','Session\x20','round','padStart','workflow:kill','resolveProjectId','workflow:workflows','unchanged','window','MAX_TASKS_DISPLAY','isDirectory','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','tdx.json','.\x20Expected\x20format:\x20KEY=VALUE','Listing\x20workflow\x20sessions...','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x20\x20Files\x20extracted:\x20','List\x20workflows','Retrying\x20session...','💡\x20Tip:\x20Use\x20','startedAt','✔\x20Retry\x20started','Source\x20directory\x20is\x20required','map','green','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Project\x20name:\x20','tdx\x20wf\x20attempt\x20','description','name','Failed\x20to\x20fetch\x20attempt\x20data','\x0a✔\x20No\x20changes\x20to\x20push','table','workflow:tasks','cwd','min','parseProjectWorkflowPattern','executeCloneProject','\x1b[1A\x1b[2K','pullProject','repeat','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','dim','pending','Loading\x20sessions...','Error:\x20Invalid\x20JSON\x20in\x20--params','set','workflows','text','substring','length','floor','relative','\x22\x20already\x20exists\x20(ID:\x20','summary','taskName','LABEL_MIN_SPACING','attempt','\x22?\x20This\x20cannot\x20be\x20undone.','params','→\x20Project:\x20','filter','rows','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','follow','newProjectName','Project\x20name\x20is\x20required','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','📁\x20','ICON_WIDTH','Session\x20not\x20found:\x20','No\x20workflows\x20found','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','end','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','value','includeSubtasks','\x0aError:','From\x20task:\x20','/attempt/','write','3099005fahuHe','Filter:\x20','targetExists','navigateSessionsInteractive','\x0aFailed\x20to\x20fetch\x20attempt\x20data','No\x20attempts\x20found','startTime','toLowerCase','start','workflow:push','includeRetried','701886NiIggI','Pushing\x20project...','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','durationMs','projects','\x20(use\x20--limit\x20to\x20show\x20more)','utf-8','Target:\x20','site','fileCount','keys','No\x20workflow\x20sessions\x20found','title','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Setting\x20','Resume\x20from:\x20','sort','workflow:upload','No\x20attempts\x20found\x20in\x20project:\x20','fill','get','\x20\x20Workflow:\x20','requireProject','\x20(system)','lastAttempt','✔\x20Found\x20','✔\x20Pushed\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Key\x20cannot\x20be\x20empty','setSecrets','25552nCbtrX','\x20session','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','autocomplete','getTime','GUTTER','\x0a⚠\x20Project\x20\x22','execute','data','Error:\x20Project\x20name\x20is\x20required','localeCompare','Cancelled','pollTimeline','794pFvWmE','Error:\x20Invalid\x20parameter\x20format:\x20','retrySession','join','Using\x20attempt\x20','Revision:\x20','📋\x20','No\x20matching\x20sessions\x20found','Downloading\x20project\x20','showWorkflowConsoleUrl','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','values',',\x20Workflow:\x20','\x20\x20New\x20attempt\x20ID:\x20','Show\x20specific\x20attempt\x20details','total','✔\x20Workflow\x20project\x20context\x20cleared.','trim','applyPullProject','red','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Retrying\x20attempt...','Key:\x20','⚠\x20Showing\x20first\x20','List\x20workflow\x20execution\x20sessions','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','list','\x20\x20Session\x20context\x20set\x20to:\x20','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','\x20from\x20session\x20','...','project','workflow:secrets:delete','projectId','updatedAt','workflow:timeline','getDate','\x20tasks','canceling','\x20is\x20not\x20a\x20directory','getFullYear','909834quwAOp','\x20\x20Changes:\x20','\x20\x20Project:\x20','Validation:\x20skipped','running','Status:\x20','\x20\x20Session\x20ID:\x20','✔\x20Project:\x20','30GDjjkn','\x0aPush\x20these\x20changes?','find','hasChanges','\x20\x20Target:\x20','attempt:','done','✔\x20Downloaded\x20','128293JLeZCk','\x27\x20from\x20project\x20\x27','No\x20sessions\x20with\x20timing\x20information','MAX_POLL_ITERATIONS','status','force','clear','log','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x20secret','kill','resolveProjectDir','columns','MIN_LABEL_COUNT','includes','Listing\x20workflows...','getMonth','stdout','replace','existingProjectId','workflow:secrets:list','output','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aDry\x20run\x20-\x20no\x20project\x20created','format','\x20modified','slice','skipValidation','sourceProjectName','(use\x20--limit\x20to\x20see\x20more)','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','No\x20workflows\x20found\x20in\x20project:\x20','Writing\x20files...','\x20to\x20see\x20detailed\x20logs','\x0a✔\x20Already\x20up\x20to\x20date','all','duration','No\x20attempts\x20found\x20for:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','resumeFrom','key','deleted','List\x20workflow\x20attempts','planned','MAX_LABEL_COUNT','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','stat','push','createdAt','task','Pattern:\x20','workflow:retry','error','changes','Killing\x20attempt...','\x20\x20Attempt\x20ID:\x20','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x0aApply\x20these\x20changes?','Attempt:\x20','Retry\x20a\x20session\x20or\x20attempt','Total:\x20','indexOf','-\x20no\x20files\x20written','Pulling\x20project\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','No\x20workflow\x20tdx.json\x20found','Deleting\x20project\x20','fromTask','filesExtracted','finishedAt','revision','Fetching\x20log\x20files...','max','Select\x20a\x20workflow\x20to\x20run','\x20secrets\x20set\x20for\x20project\x20\x27','→\x20New\x20project:\x20','Listing\x20secrets...','Source:\x20','blue'];a55_0x352b=function(){return _0x30b944;};return a55_0x352b();}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a55_0x51cda1(0x38c);[a55_0x51cda1(0x2d1)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a55_0x51cda1(0x339)](_0x1d7526){const _0x501ace=a55_0x51cda1,{options:_0x528221,args:_0x261713,tdx:_0x543ed0}=_0x1d7526,_0x369bc1=this[_0x501ace(0x32a)](_0x261713,_0x528221);if(!_0x369bc1)return 0x1;_0x528221[_0x501ace(0x248)]&&console[_0x501ace(0x1f9)](_0x501ace(0x23b)+_0x369bc1);const _0xcbd684=await withSpinner(_0x501ace(0x212),()=>_0x543ed0[_0x501ace(0x284)]['listSecrets'](_0x369bc1),{'verbose':_0x528221[_0x501ace(0x248)]}),{secrets:_0x14720a}=_0xcbd684['data'];return console[_0x501ace(0x1f9)](_0x501ace(0x32d)+_0x14720a['length']+_0x501ace(0x381)+(_0x14720a[_0x501ace(0x2e7)]!==0x1?'s':'')),await handleSDKOutput(_0x14720a,_0x528221),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x275);[a55_0x51cda1(0x2d1)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a55_0x51cda1(0x339)](_0x3bc4a6){const _0x734ef1=a55_0x51cda1,{options:_0x1b2a0b,args:_0x1b5d43,tdx:_0x2ffb15}=_0x3bc4a6;let _0x37f281,_0x5e8a07;if(_0x1b5d43[_0x734ef1(0x2e7)]>=0x1&&!_0x1b5d43[0x0][_0x734ef1(0x386)]('='))_0x37f281=_0x1b5d43[0x0],_0x5e8a07=_0x1b5d43['slice'](0x1);else{if(_0x1b5d43[_0x734ef1(0x2e7)]>=0x1&&_0x1b2a0b[_0x734ef1(0x272)])_0x37f281=_0x1b2a0b['workflowProject'],_0x5e8a07=_0x1b5d43;else return _0x1b5d43[_0x734ef1(0x2e7)]>=0x1?(console[_0x734ef1(0x1f9)](_0x734ef1(0x33b)),console[_0x734ef1(0x1f9)](_0x734ef1(0x290)),0x1):(console[_0x734ef1(0x1f9)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x734ef1(0x1f9)](_0x734ef1(0x260)),0x1);}if(_0x5e8a07[_0x734ef1(0x2e7)]===0x0)return console[_0x734ef1(0x1f9)](_0x734ef1(0x259)),console[_0x734ef1(0x1f9)](_0x734ef1(0x260)),0x1;const _0x55d07e={};try{for(const _0x17519c of _0x5e8a07){const {key:_0x2c7dc9,value:_0x1d7cca}=parseKeyValue(_0x17519c);_0x55d07e[_0x2c7dc9]=_0x1d7cca;}}catch(_0x2fe4ff){return _0x2fe4ff instanceof Error&&console[_0x734ef1(0x1f9)](a55_0x169b33[_0x734ef1(0x352)](_0x734ef1(0x249)),_0x2fe4ff['message']),0x1;}const _0x51ffcd=Object[_0x734ef1(0x31e)](_0x55d07e);_0x1b2a0b[_0x734ef1(0x248)]&&(console[_0x734ef1(0x1f9)](_0x734ef1(0x23b)+_0x37f281),console[_0x734ef1(0x1f9)](_0x734ef1(0x231)+_0x51ffcd[_0x734ef1(0x342)](',\x20')));const _0x556380=await withSpinner(_0x51ffcd[_0x734ef1(0x2e7)]===0x1?_0x734ef1(0x218):_0x734ef1(0x322)+_0x51ffcd[_0x734ef1(0x2e7)]+'\x20secrets...',()=>_0x2ffb15[_0x734ef1(0x284)][_0x734ef1(0x331)](_0x37f281,_0x55d07e),{'verbose':_0x1b2a0b[_0x734ef1(0x248)]}),_0x45bd44=_0x556380[_0x734ef1(0x33a)];return console['error'](_0x51ffcd['length']===0x1?'✔\x20Secret\x20\x27'+_0x45bd44[_0x734ef1(0x31e)][0x0]+_0x734ef1(0x296)+_0x45bd44[_0x734ef1(0x27c)]+'\x27':'✔\x20'+_0x45bd44[_0x734ef1(0x31e)][_0x734ef1(0x2e7)]+_0x734ef1(0x210)+_0x45bd44[_0x734ef1(0x27c)]+'\x27'),(_0x1b2a0b[_0x734ef1(0x29b)]||_0x1b2a0b[_0x734ef1(0x241)])&&await handleSingleObjectOutput(_0x45bd44,_0x1b2a0b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x35f);['description']=a55_0x51cda1(0x2c0);async[a55_0x51cda1(0x339)](_0x49c284){const _0x5027cc=a55_0x51cda1,{options:_0x1067d3,args:_0x4d24a3,tdx:_0x4a783b}=_0x49c284;let _0x3d9650,_0x3050c7;if(_0x4d24a3['length']>=0x2)_0x3d9650=_0x4d24a3[0x0],_0x3050c7=_0x4d24a3[0x1];else{if(_0x4d24a3[_0x5027cc(0x2e7)]===0x1&&_0x1067d3['workflowProject'])_0x3d9650=_0x1067d3[_0x5027cc(0x272)],_0x3050c7=_0x4d24a3[0x0];else return _0x4d24a3[_0x5027cc(0x2e7)]===0x1?(console[_0x5027cc(0x1f9)](_0x5027cc(0x33b)),console[_0x5027cc(0x1f9)](_0x5027cc(0x290)),0x1):(console[_0x5027cc(0x1f9)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x5027cc(0x1f9)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1067d3[_0x5027cc(0x248)]&&(console[_0x5027cc(0x1f9)](_0x5027cc(0x23b)+_0x3d9650),console[_0x5027cc(0x1f9)](_0x5027cc(0x355)+_0x3050c7));if(!_0x1067d3[_0x5027cc(0x254)]){if(!isInteractive())return console[_0x5027cc(0x1f9)](a55_0x169b33[_0x5027cc(0x352)](_0x5027cc(0x303)),_0x5027cc(0x316)),console[_0x5027cc(0x1f9)](a55_0x169b33['dim'](_0x5027cc(0x38e))),0x1;const _0x2d80c4=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x3050c7+_0x5027cc(0x379)+_0x3d9650+'\x27?');if(!_0x2d80c4)return console['error'](a55_0x169b33['yellow'](_0x5027cc(0x33d))),0x1;}const _0x1f98d6=await withSpinner('Deleting\x20secret...',()=>_0x4a783b['workflow'][_0x5027cc(0x2ab)](_0x3d9650,_0x3050c7),{'verbose':_0x1067d3[_0x5027cc(0x248)]}),_0x387e3e=_0x1f98d6[_0x5027cc(0x33a)];return console[_0x5027cc(0x1f9)](_0x5027cc(0x233)+_0x387e3e[_0x5027cc(0x3a0)]+_0x5027cc(0x2de)+_0x387e3e[_0x5027cc(0x27c)]+'\x27'),(_0x1067d3[_0x5027cc(0x29b)]||_0x1067d3[_0x5027cc(0x241)])&&await handleSingleObjectOutput(_0x387e3e,_0x1067d3),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(_0x743fb4){const _0x7fb966=a55_0x51cda1,_0xcbd950=Math['floor'](_0x743fb4/0x3e8),_0x519afc=Math[_0x7fb966(0x2e8)](_0xcbd950/0x3c),_0x3badfe=Math[_0x7fb966(0x2e8)](_0x519afc/0x3c),_0x25f1fd=Math[_0x7fb966(0x2e8)](_0x3badfe/0x18);if(_0x25f1fd>0x0){const _0x55800c=_0x3badfe%0x18;return _0x55800c>0x0?_0x25f1fd+'d\x20'+_0x55800c+'h':_0x25f1fd+'d';}else{if(_0x3badfe>0x0){const _0x3a87d6=_0x519afc%0x3c;return _0x3a87d6>0x0?_0x3badfe+'h\x20'+_0x3a87d6+'m':_0x3badfe+'h';}else{if(_0x519afc>0x0){const _0x3efaae=_0xcbd950%0x3c;return _0x3efaae>0x0?_0x519afc+'m\x20'+_0x3efaae+'s':_0x519afc+'m';}else return _0xcbd950+'s';}}}function formatTimestamp(_0x109086,_0x2be490){const _0x15977b=a55_0x51cda1,_0x1376f3=new Date(_0x109086),_0x229178=String(_0x1376f3['getHours']())[_0x15977b(0x2b8)](0x2,'0'),_0x1fcba6=String(_0x1376f3[_0x15977b(0x25a)]())[_0x15977b(0x2b8)](0x2,'0'),_0x1f75bc=_0x229178+':'+_0x1fcba6,_0x4f5dd2=_0x1376f3[_0x15977b(0x367)]()===_0x2be490[_0x15977b(0x367)]()&&_0x1376f3['getMonth']()===_0x2be490['getMonth']()&&_0x1376f3['getDate']()===_0x2be490[_0x15977b(0x363)]();if(_0x4f5dd2)return _0x1f75bc;else{const _0x201d31=String(_0x1376f3['getMonth']()+0x1)[_0x15977b(0x2b8)](0x2,'0'),_0x46ff07=String(_0x1376f3[_0x15977b(0x363)]())[_0x15977b(0x2b8)](0x2,'0');return _0x201d31+'-'+_0x46ff07+'\x20'+_0x1f75bc;}}function formatDate(_0x3845d6){const _0x1d05e8=a55_0x51cda1,_0x2bada1=_0x3845d6[_0x1d05e8(0x367)](),_0x49800f=String(_0x3845d6[_0x1d05e8(0x388)]()+0x1)[_0x1d05e8(0x2b8)](0x2,'0'),_0x4ae60f=String(_0x3845d6['getDate']())[_0x1d05e8(0x2b8)](0x2,'0');return _0x2bada1+'-'+_0x49800f+'-'+_0x4ae60f;}function getTaskStateIcon(_0x49df9d){const _0x5b4d8c={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5b4d8c[_0x49df9d]||'⚪';}function getBarChar(_0x584eec){const _0x2e1279=a55_0x51cda1;return _0x584eec===_0x2e1279(0x1f9)||_0x584eec==='group_error'?'×':'─';}function getBarColor(_0x4c8e73){const _0xfc9e94=a55_0x51cda1,_0x40904d={'success':a55_0x169b33[_0xfc9e94(0x2cd)],'error':a55_0x169b33[_0xfc9e94(0x352)],'group_error':a55_0x169b33[_0xfc9e94(0x352)],'running':a55_0x169b33[_0xfc9e94(0x214)],'blocked':a55_0x169b33[_0xfc9e94(0x22d)],'planned':a55_0x169b33[_0xfc9e94(0x2df)],'canceling':a55_0x169b33[_0xfc9e94(0x22d)]};return _0x40904d[_0x4c8e73]||a55_0x169b33[_0xfc9e94(0x27b)];}function parseTaskName(_0x4d34b1){const _0x347302=a55_0x51cda1;let _0x24e45d=_0x4d34b1[_0x347302(0x38a)](/^\++/,'');const _0x44c1c7=_0x24e45d[_0x347302(0x28a)]('+'),_0x4029ca=_0x44c1c7[_0x347302(0x2e7)]>0x1?_0x44c1c7[_0x347302(0x2e7)]-0x2:0x0,_0x3dcbba=_0x44c1c7[_0x44c1c7[_0x347302(0x2e7)]-0x1]||_0x24e45d;return{'level':_0x4029ca,'name':'+'+_0x3dcbba};}function truncateTaskName(_0x5c34de,_0x384c13){const _0x155828=a55_0x51cda1,_0x55256c=stringWidth(_0x5c34de);if(_0x55256c<=_0x384c13)return _0x5c34de;let _0x1a72b0=_0x5c34de;while(stringWidth(_0x1a72b0+'…')>_0x384c13&&_0x1a72b0[_0x155828(0x2e7)]>0x0){_0x1a72b0=_0x1a72b0[_0x155828(0x392)](0x0,-0x1);}return _0x1a72b0+'…';}function calculateTimeScale(_0x4add3e,_0x4c8a5b){const _0x48f5be=a55_0x51cda1;return{'startTime':_0x4add3e[_0x48f5be(0x30f)],'endTime':_0x4add3e[_0x48f5be(0x2ff)],'durationMs':_0x4add3e[_0x48f5be(0x39c)],'msPerChar':_0x4add3e[_0x48f5be(0x39c)]/_0x4c8a5b};}function timeToPosition(_0x586cbf,_0x5de98f,_0x2e8b6a){const _0x1cedc7=a55_0x51cda1,_0x42d0f4=_0x586cbf-_0x5de98f[_0x1cedc7(0x30d)],_0x2f8ace=Math[_0x1cedc7(0x2e8)](_0x42d0f4/_0x5de98f[_0x1cedc7(0x28c)]);return Math[_0x1cedc7(0x20e)](0x0,Math[_0x1cedc7(0x2d8)](_0x2f8ace,_0x2e8b6a));}function renderTimeAxis(_0x3da495,_0x37e342){const _0x101b8f=a55_0x51cda1,_0x1163c9=Math['min'](TIMELINE_CONFIG[_0x101b8f(0x1f0)],Math[_0x101b8f(0x20e)](TIMELINE_CONFIG[_0x101b8f(0x385)],Math['floor'](_0x37e342/TIMELINE_CONFIG[_0x101b8f(0x21e)]))),_0x45c5df=_0x3da495[_0x101b8f(0x317)]/(_0x1163c9-0x1),_0x17f802=new Date(_0x3da495[_0x101b8f(0x30d)]),_0xdadc5d=[];for(let _0x422563=0x0;_0x422563<_0x1163c9;_0x422563++){const _0x29f455=_0x3da495[_0x101b8f(0x30d)]+_0x422563*_0x45c5df,_0x56d68e=timeToPosition(_0x29f455,_0x3da495,_0x37e342),_0x59a9bc=formatTimestamp(_0x29f455,_0x17f802);_0xdadc5d[_0x101b8f(0x1f4)]({'pos':_0x56d68e,'text':_0x59a9bc});}const _0x326d2b=new Array(_0x37e342)[_0x101b8f(0x327)]('\x20');let _0x4a9e51=-0x1;for(const {pos:_0x4a3eca,text:_0x5d2e1c}of _0xdadc5d){let _0x568b4a=Math[_0x101b8f(0x20e)](0x0,_0x4a3eca-Math[_0x101b8f(0x2e8)](_0x5d2e1c[_0x101b8f(0x2e7)]/0x2));_0x568b4a<=_0x4a9e51+TIMELINE_CONFIG[_0x101b8f(0x2ed)]&&(_0x568b4a=_0x4a9e51+TIMELINE_CONFIG[_0x101b8f(0x2ed)]+0x1);_0x568b4a+_0x5d2e1c[_0x101b8f(0x2e7)]>_0x37e342&&(_0x568b4a=_0x37e342-_0x5d2e1c[_0x101b8f(0x2e7)]);if(_0x568b4a>=0x0&&_0x568b4a+_0x5d2e1c[_0x101b8f(0x2e7)]<=_0x37e342&&_0x568b4a>_0x4a9e51){for(let _0x6de8fc=0x0;_0x6de8fc<_0x5d2e1c['length'];_0x6de8fc++){_0x326d2b[_0x568b4a+_0x6de8fc]=_0x5d2e1c[_0x6de8fc];}_0x4a9e51=_0x568b4a+_0x5d2e1c[_0x101b8f(0x2e7)]-0x1;}}return _0x326d2b[_0x101b8f(0x342)]('');}function renderTaskRow(_0x316823,_0x5e0cd7,_0x58fdf4,_0x196c3a){const _0x434381=a55_0x51cda1,{level:_0x412016,name:_0x3693c1}=parseTaskName(_0x316823[_0x434381(0x2d2)]),_0xb5b7ea='\x20'[_0x434381(0x2dd)](_0x412016),_0x3e5695=_0x316823[_0x434381(0x2bd)]?'('+formatElapsed(_0x316823['window']['duration'])+')':'',_0x3e8fae=stringWidth(_0x3e5695),_0x50a0b7=_0x412016*0x1,_0x568b15=_0x196c3a-_0x50a0b7-_0x3e8fae-0x1,_0x5595c3=truncateTaskName(_0x3693c1,_0x568b15),_0x4f30b6=_0xb5b7ea+_0x5595c3,_0xae66e2=stringWidth(_0x4f30b6),_0x550ed8=_0x196c3a-_0xae66e2-_0x3e8fae,_0x7dfa7=_0x4f30b6+'\x20'[_0x434381(0x2dd)](Math['max'](0x1,_0x550ed8))+a55_0x169b33['dim'](_0x3e5695),_0x5c81e2=getTaskStateIcon(_0x316823[_0x434381(0x27e)]),_0x24035a=new Array(_0x58fdf4)[_0x434381(0x327)]('\x20');if(_0x316823['window']){const _0x1244cd=timeToPosition(_0x316823[_0x434381(0x2bd)][_0x434381(0x30f)],_0x5e0cd7,_0x58fdf4),_0x362051=timeToPosition(_0x316823[_0x434381(0x2bd)]['end'],_0x5e0cd7,_0x58fdf4),_0xd0c572=getBarChar(_0x316823[_0x434381(0x27e)]),_0x129baa=Math['max'](_0x1244cd+0x1,_0x362051);for(let _0x3837db=_0x1244cd;_0x3837db<Math[_0x434381(0x2d8)](_0x129baa,_0x58fdf4);_0x3837db++){_0x24035a[_0x3837db]=_0xd0c572;}}const _0x87ddba=getBarColor(_0x316823[_0x434381(0x27e)]),_0x5cd95c=_0x24035a[_0x434381(0x2cc)](_0x27f25d=>_0x27f25d==='\x20'?'\x20':_0x87ddba(_0x27f25d))['join']('');return _0x5c81e2+'\x20'+_0x7dfa7+'│'+_0x5cd95c+'│';}function calculateStats(_0x2cae51){const _0x123f34=a55_0x51cda1,_0x4c905d={'total':_0x2cae51[_0x123f34(0x2e7)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x226fdd of _0x2cae51){if(_0x226fdd[_0x123f34(0x27e)]===_0x123f34(0x271))_0x4c905d['success']++;else{if(_0x226fdd['state']===_0x123f34(0x1f9)||_0x226fdd[_0x123f34(0x27e)]==='group_error')_0x4c905d[_0x123f34(0x1f9)]++;else _0x226fdd[_0x123f34(0x27e)]==='running'?_0x4c905d[_0x123f34(0x36c)]++:_0x4c905d[_0x123f34(0x2e0)]++;}}return _0x4c905d;}function formatStats(_0x4f4663){const _0x136d7a=a55_0x51cda1;return[_0x136d7a(0x202)+_0x4f4663[_0x136d7a(0x34e)],'✅\x20'+_0x4f4663[_0x136d7a(0x271)],'❌\x20'+_0x4f4663[_0x136d7a(0x1f9)],'🔄\x20'+_0x4f4663['running'],'⏳\x20'+_0x4f4663[_0x136d7a(0x2e0)]][_0x136d7a(0x342)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a55_0x51cda1(0x2d2)]=a55_0x51cda1(0x362);[a55_0x51cda1(0x2d1)]=a55_0x51cda1(0x314);async['execute'](_0x3917b6){const _0x3f4c43=a55_0x51cda1,{options:_0x402cdf,args:_0x27ba87,tdx:_0x2900bc}=_0x3917b6;let _0x380340,_0x1b8df4,_0x1fd4a3=![];if(_0x27ba87[0x0]){if(_0x27ba87[0x0][_0x3f4c43(0x386)]('.')){const _0x34ff8e=this[_0x3f4c43(0x2d9)](_0x27ba87,_0x402cdf);if(!_0x34ff8e)return 0x1;_0x380340=_0x34ff8e[_0x3f4c43(0x27c)],_0x1b8df4=_0x34ff8e[_0x3f4c43(0x247)];}else{_0x1b8df4=_0x27ba87[0x0],_0x380340=_0x402cdf[_0x3f4c43(0x272)];if(!_0x380340)return console[_0x3f4c43(0x1f9)](a55_0x169b33[_0x3f4c43(0x352)](_0x3f4c43(0x249)),_0x3f4c43(0x321)),0x1;_0x1fd4a3=!![];}}else{const _0xef189e=this[_0x3f4c43(0x2d9)](_0x27ba87,_0x402cdf);if(!_0xef189e)return 0x1;_0x380340=_0xef189e[_0x3f4c43(0x27c)],_0x1b8df4=_0xef189e['workflowName'];}if(_0x402cdf[_0x3f4c43(0x248)]){if(_0x380340&&_0x1b8df4)console[_0x3f4c43(0x1f9)](_0x3f4c43(0x308)+_0x380340+'.'+_0x1b8df4);else _0x380340&&console['error'](_0x3f4c43(0x23c)+_0x380340);}const _0x494fcb=_0x402cdf[_0x3f4c43(0x274)],_0x1babbf=_0x402cdf[_0x3f4c43(0x29f)];if(_0x494fcb){_0x1babbf&&console[_0x3f4c43(0x1f9)](a55_0x169b33[_0x3f4c43(0x22d)](_0x3f4c43(0x250)),_0x3f4c43(0x2b4));const _0x508c0c=_0x402cdf[_0x3f4c43(0x2f5)];return _0x508c0c?await this[_0x3f4c43(0x33e)](_0x3917b6,_0x494fcb):await this['renderSingleTimeline'](_0x3917b6,_0x494fcb,_0x402cdf),0x0;}if(_0x1babbf){const _0x513f85=await withSpinner(_0x3f4c43(0x232),()=>_0x2900bc[_0x3f4c43(0x284)][_0x3f4c43(0x23a)]({'projectName':_0x380340,'workflowName':_0x1b8df4,'limit':0x64}),{'verbose':_0x402cdf[_0x3f4c43(0x248)]}),_0x334e2f=_0x513f85[_0x3f4c43(0x33a)]['find'](_0x3dc766=>_0x3dc766['id']===_0x1babbf);if(!_0x334e2f)return console[_0x3f4c43(0x1f9)](a55_0x169b33['red']('Error:'),_0x3f4c43(0x2fc)+_0x1babbf),0x1;if(!_0x334e2f[_0x3f4c43(0x32c)]?.['id'])return console['error'](a55_0x169b33['red']('Error:'),_0x3f4c43(0x2b6)+_0x1babbf+'\x20has\x20no\x20attempts'),0x1;const _0x3c6de9=_0x334e2f[_0x3f4c43(0x32c)]['id'];_0x402cdf[_0x3f4c43(0x248)]&&console[_0x3f4c43(0x1f9)](_0x3f4c43(0x343)+_0x3c6de9+_0x3f4c43(0x35c)+_0x1babbf);const _0x1a4b5d=_0x402cdf[_0x3f4c43(0x2f5)];return _0x1a4b5d?await this[_0x3f4c43(0x33e)](_0x3917b6,_0x3c6de9):await this['renderSingleTimeline'](_0x3917b6,_0x3c6de9,_0x402cdf),0x0;}const _0xe73baa=await withSpinner(_0x3f4c43(0x2e1),()=>_0x2900bc[_0x3f4c43(0x284)][_0x3f4c43(0x23a)]({'projectName':_0x380340,'workflowName':_0x1b8df4,'limit':_0x402cdf['limit']||0x32}),{'verbose':_0x402cdf[_0x3f4c43(0x248)]}),_0x38532f=_0xe73baa[_0x3f4c43(0x33a)];if(_0x38532f['length']===0x0){if(_0x380340&&_0x1b8df4)console[_0x3f4c43(0x1f9)]('No\x20sessions\x20found\x20for:\x20'+_0x380340+'.'+_0x1b8df4);else _0x380340?console[_0x3f4c43(0x1f9)](_0x3f4c43(0x295)+_0x380340):(console[_0x3f4c43(0x1f9)](_0x3f4c43(0x31f)),console[_0x3f4c43(0x1f9)](a55_0x169b33[_0x3f4c43(0x2df)](_0x3f4c43(0x27d))));return 0x0;}_0x38532f[_0x3f4c43(0x324)]((_0x55666f,_0x3a12be)=>{const _0x4d602b=_0x3f4c43,_0x495647=_0x55666f[_0x4d602b(0x226)]||'',_0x5200d4=_0x3a12be[_0x4d602b(0x226)]||'';return _0x5200d4[_0x4d602b(0x33c)](_0x495647);});if(_0x402cdf['json']||_0x402cdf['jsonl'])return await handleSDKOutput(_0x38532f,_0x402cdf),0x0;let _0x1c7b13;if(_0x1fd4a3){const _0x83ab72=_0x38532f[0x0];if(!_0x83ab72['lastAttempt']?.['id'])return console[_0x3f4c43(0x1f9)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x1c7b13=_0x83ab72[_0x3f4c43(0x32c)]['id'],_0x402cdf[_0x3f4c43(0x248)]&&console[_0x3f4c43(0x1f9)]('Auto-selected\x20latest\x20session:\x20'+_0x83ab72[_0x3f4c43(0x226)]);}else{const _0x1f4e80=_0x38532f['map'](_0x546b54=>{const _0x599a9a=_0x3f4c43,_0x249d48=getAttemptStatusDisplay(_0x546b54[_0x599a9a(0x32c)]);return{'title':_0x546b54['project']?.[_0x599a9a(0x2d2)]+'.'+_0x546b54[_0x599a9a(0x284)]?.[_0x599a9a(0x2d2)]+'\x20-\x20'+_0x546b54[_0x599a9a(0x226)]+'\x20'+_0x249d48['icon'],'value':_0x546b54['lastAttempt']?.['id']||'','description':_0x249d48[_0x599a9a(0x2e5)]};}),_0x4ca2e3=await a55_0x4fbd47({'type':'select','name':'attemptId','message':_0x3f4c43(0x2b2),'choices':_0x1f4e80[_0x3f4c43(0x2f2)](_0x4ca60c=>_0x4ca60c[_0x3f4c43(0x301)]!=='')});if(!_0x4ca2e3['attemptId'])return 0x0;_0x1c7b13=_0x4ca2e3['attemptId'];}const _0x1eb8b7=_0x402cdf[_0x3f4c43(0x2f5)];return _0x1eb8b7?await this[_0x3f4c43(0x33e)](_0x3917b6,_0x1c7b13):await this[_0x3f4c43(0x26b)](_0x3917b6,_0x1c7b13,_0x402cdf),0x0;}async[a55_0x51cda1(0x26b)](_0xf1d766,_0x5c4e15,_0x14eed4){const _0x35bf59=a55_0x51cda1,{tdx:_0x3dbb6f}=_0xf1d766;let _0x602f8a,_0x40d18f;try{[_0x602f8a,_0x40d18f]=await Promise[_0x35bf59(0x39b)]([_0x3dbb6f[_0x35bf59(0x284)]['attempt'](_0x5c4e15),_0x3dbb6f['workflow'][_0x35bf59(0x292)](_0x5c4e15,![])]);}catch(_0x23f575){console[_0x35bf59(0x1f9)](a55_0x169b33[_0x35bf59(0x352)](_0x35bf59(0x2d3)));_0x14eed4[_0x35bf59(0x248)]&&console[_0x35bf59(0x1f9)](_0x23f575);throw _0x23f575;}if(_0x14eed4[_0x35bf59(0x29b)]||_0x14eed4[_0x35bf59(0x241)]){const _0x9aba60=this['buildTimelineData'](_0x602f8a,_0x40d18f);await handleSDKOutput([_0x9aba60],_0x14eed4);return;}const _0x112e12=_0x3dbb6f[_0x35bf59(0x22f)][_0x35bf59(0x31c)],_0x59aa58=this[_0x35bf59(0x29a)](_0x602f8a,_0x40d18f,_0x112e12);console['log'](_0x59aa58);}async[a55_0x51cda1(0x33e)](_0x407721,_0x46324b){const _0x59e996=a55_0x51cda1,{tdx:_0x18855d}=_0x407721,_0x2f6e18=TIMELINE_CONFIG[_0x59e996(0x222)],_0x2bfd18=TIMELINE_CONFIG[_0x59e996(0x37b)];let _0x1a3621=0x0;while(_0x1a3621<_0x2bfd18){process['stdout'][_0x59e996(0x21d)]&&process[_0x59e996(0x389)][_0x59e996(0x306)]('\x1bc');let _0x7418ea,_0x40f8f2;try{[_0x7418ea,_0x40f8f2]=await Promise[_0x59e996(0x39b)]([_0x18855d['workflow'][_0x59e996(0x2ee)](_0x46324b),_0x18855d[_0x59e996(0x284)][_0x59e996(0x292)](_0x46324b,![])]);}catch(_0x288ce1){console[_0x59e996(0x1f9)](a55_0x169b33['red'](_0x59e996(0x30b)));_0x1a3621>0x0&&console['error'](a55_0x169b33[_0x59e996(0x2df)](_0x59e996(0x349)+_0x1a3621));throw _0x288ce1;}const _0x48234f=_0x18855d['context'][_0x59e996(0x31c)],_0x4dde92=this['renderTimeline'](_0x7418ea,_0x40f8f2,_0x48234f);console[_0x59e996(0x37f)](_0x4dde92);const _0xec30d3=_0x7418ea[_0x59e996(0x376)]&&_0x40f8f2['every'](_0x359bdf=>_0x359bdf['state']!==_0x59e996(0x36c)&&_0x359bdf[_0x59e996(0x27e)]!==_0x59e996(0x1ef));if(_0xec30d3){console['error'](a55_0x169b33['green'](_0x59e996(0x25f)));break;}console[_0x59e996(0x1f9)](a55_0x169b33[_0x59e996(0x2df)](_0x59e996(0x283)+_0x1a3621*0x2+_0x59e996(0x273))),await new Promise(_0x46ca9f=>setTimeout(_0x46ca9f,_0x2f6e18)),_0x1a3621++;}_0x1a3621>=_0x2bfd18&&console['error'](a55_0x169b33[_0x59e996(0x22d)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}['renderTimeline'](_0x2c0d82,_0x222d57,_0x4f06a7){const _0x154d82=a55_0x51cda1,_0x17f56a=[],_0x3a73a8=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x4974d5=0x5,_0x5d806f=process[_0x154d82(0x389)][_0x154d82(0x384)]||0x78,_0x455f71=_0x5d806f-_0x3a73a8-_0x4974d5,_0xf8149f=Math[_0x154d82(0x20e)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x154d82(0x2d8)](_0x455f71,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x37a276=new Date(_0x2c0d82[_0x154d82(0x1f5)])[_0x154d82(0x336)](),_0x2ae487=_0x2c0d82[_0x154d82(0x20b)]?new Date(_0x2c0d82[_0x154d82(0x20b)])[_0x154d82(0x336)]():Date[_0x154d82(0x245)](),_0xec53a9={'start':_0x37a276,'end':_0x2ae487,'duration':_0x2ae487-_0x37a276},_0x169ee0=new Map(),_0x1ec22c=[];for(const _0x876745 of _0x222d57){if(_0x876745[_0x154d82(0x2c9)]){const _0x27758d=new Date(_0x876745[_0x154d82(0x2c9)])[_0x154d82(0x336)](),_0x6cf9aa=_0x876745[_0x154d82(0x361)]?new Date(_0x876745[_0x154d82(0x361)])['getTime']():Date[_0x154d82(0x245)](),_0xb5b7d2={'start':_0x27758d,'end':_0x6cf9aa,'duration':_0x6cf9aa-_0x27758d};_0x169ee0[_0x154d82(0x2e3)](_0x876745['id'],_0xb5b7d2),_0x1ec22c[_0x154d82(0x1f4)]({'name':_0x876745['fullName'],'state':_0x876745[_0x154d82(0x27e)]||_0x154d82(0x225),'window':_0xb5b7d2});}else _0x1ec22c[_0x154d82(0x1f4)]({'name':_0x876745[_0x154d82(0x240)],'state':_0x876745[_0x154d82(0x27e)]||'planned','window':undefined});}_0x1ec22c[_0x154d82(0x324)]((_0x4e237a,_0xbaac59)=>{const _0x3bd3e3=_0x154d82;if(!_0x4e237a['window'])return 0x1;if(!_0xbaac59[_0x3bd3e3(0x2bd)])return-0x1;return _0x4e237a[_0x3bd3e3(0x2bd)][_0x3bd3e3(0x30f)]-_0xbaac59[_0x3bd3e3(0x2bd)][_0x3bd3e3(0x30f)];});const _0x365c06=_0x1ec22c[_0x154d82(0x2e7)],_0x35296d=_0x365c06>TIMELINE_CONFIG[_0x154d82(0x2be)];_0x35296d&&_0x1ec22c['splice'](TIMELINE_CONFIG[_0x154d82(0x2be)]);const _0x448902=calculateTimeScale(_0xec53a9,_0xf8149f),_0x33ff41=_0x2c0d82[_0x154d82(0x376)]?_0x2c0d82[_0x154d82(0x271)]?a55_0x169b33[_0x154d82(0x2cd)](_0x154d82(0x271)):a55_0x169b33[_0x154d82(0x352)]('error'):a55_0x169b33[_0x154d82(0x214)](_0x154d82(0x36c)),_0x46c256=_0x2c0d82[_0x154d82(0x35e)]?.['id'],_0x19e0b1=_0x2c0d82[_0x154d82(0x29f)];let _0x195952;if(_0x46c256&&_0x19e0b1){const _0x1f8905=getWorkflowAttemptUrl(_0x4f06a7,_0x46c256,_0x19e0b1,_0x2c0d82['id']);_0x195952=hyperlink(a55_0x169b33[_0x154d82(0x2df)](_0x2c0d82['id']),_0x1f8905);}else _0x195952=a55_0x169b33[_0x154d82(0x2df)](_0x2c0d82['id']);_0x17f56a['push'](_0x154d82(0x200)+_0x195952+_0x154d82(0x221)+_0x33ff41+_0x154d82(0x221)+formatElapsed(_0xec53a9[_0x154d82(0x39c)]));if(_0x1ec22c[_0x154d82(0x2e7)]>0x0){const _0xe2f0e3=renderTimeAxis(_0x448902,_0xf8149f),_0x251efa=new Date(_0xec53a9['start']),_0x31eed6=formatDate(_0x251efa),_0x41d0e5=TIMELINE_CONFIG[_0x154d82(0x2fb)]+TIMELINE_CONFIG[_0x154d82(0x2a2)]+_0x3a73a8,_0x49bf60=_0x31eed6['padStart'](_0x41d0e5),_0x487dc9=a55_0x169b33[_0x154d82(0x2df)](_0x49bf60);_0x17f56a['push'](_0x487dc9+'\x20'+_0xe2f0e3);for(const _0x2f8b9f of _0x1ec22c){_0x17f56a[_0x154d82(0x1f4)](renderTaskRow(_0x2f8b9f,_0x448902,_0xf8149f,_0x3a73a8));}const _0x1a4bbd=calculateStats(_0x1ec22c);_0x17f56a[_0x154d82(0x1f4)](formatStats(_0x1a4bbd)),_0x35296d&&_0x17f56a['push'](a55_0x169b33[_0x154d82(0x22d)](_0x154d82(0x356)+TIMELINE_CONFIG[_0x154d82(0x2be)]+_0x154d82(0x277)+_0x365c06+_0x154d82(0x364))),_0x17f56a[_0x154d82(0x1f4)](''),_0x17f56a['push'](a55_0x169b33['dim'](_0x154d82(0x2c8))+(_0x154d82(0x2d0)+_0x2c0d82['id']+'\x20logs')+a55_0x169b33['dim'](_0x154d82(0x399)));}else _0x17f56a[_0x154d82(0x1f4)](_0x154d82(0x315));return _0x17f56a[_0x154d82(0x342)]('\x0a');}[a55_0x51cda1(0x29d)](_0x43125a,_0x37037c){const _0x32bf12=a55_0x51cda1,_0x311f25=new Date(_0x43125a[_0x32bf12(0x1f5)])[_0x32bf12(0x336)](),_0x535c0e=_0x43125a[_0x32bf12(0x20b)]?new Date(_0x43125a[_0x32bf12(0x20b)])['getTime']():Date[_0x32bf12(0x245)](),_0x4b8a65=_0x535c0e-_0x311f25,_0x14622a=[];for(const _0x22bf64 of _0x37037c){if(_0x22bf64[_0x32bf12(0x2c9)]){const _0xf689c3=new Date(_0x22bf64[_0x32bf12(0x2c9)])[_0x32bf12(0x336)](),_0x6544bd=_0x22bf64['updatedAt']?new Date(_0x22bf64[_0x32bf12(0x361)])[_0x32bf12(0x336)]():Date[_0x32bf12(0x245)]();_0x14622a['push']({'name':_0x22bf64[_0x32bf12(0x240)],'state':_0x22bf64['state']||'unknown','window':{'start':_0xf689c3,'end':_0x6544bd,'duration':_0x6544bd-_0xf689c3}});}else _0x14622a[_0x32bf12(0x1f4)]({'name':_0x22bf64[_0x32bf12(0x240)],'state':_0x22bf64[_0x32bf12(0x27e)]||'planned','window':undefined});}const _0x2808bc=calculateStats(_0x14622a);return{'attempt':{'id':_0x43125a['id'],'status':_0x43125a[_0x32bf12(0x376)]?_0x43125a[_0x32bf12(0x271)]?_0x32bf12(0x271):_0x32bf12(0x1f9):_0x32bf12(0x36c),'createdAt':_0x43125a[_0x32bf12(0x1f5)],'finishedAt':_0x43125a[_0x32bf12(0x20b)],'duration_ms':_0x4b8a65},'tasks':_0x14622a[_0x32bf12(0x2cc)](_0x24471d=>({'name':_0x24471d[_0x32bf12(0x2d2)],'state':_0x24471d['state'],'startedAt':_0x24471d[_0x32bf12(0x2bd)]?new Date(_0x24471d[_0x32bf12(0x2bd)]['start'])[_0x32bf12(0x2a4)]():null,'updatedAt':_0x24471d[_0x32bf12(0x2bd)]?new Date(_0x24471d[_0x32bf12(0x2bd)][_0x32bf12(0x2ff)])[_0x32bf12(0x2a4)]():null,'duration_ms':_0x24471d[_0x32bf12(0x2bd)]?.[_0x32bf12(0x39c)]||null})),'stats':_0x2808bc};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x65ab0,_0x3fa733){const _0x5291b0=a55_0xe520,_0x524927=_0x65ab0();while(!![]){try{const _0x309d98=-parseInt(_0x5291b0(0x12e))/0x1+parseInt(_0x5291b0(0x128))/0x2+parseInt(_0x5291b0(0x12f))/0x3+parseInt(_0x5291b0(0x125))/0x4+parseInt(_0x5291b0(0x12a))/0x5*(parseInt(_0x5291b0(0x129))/0x6)+-parseInt(_0x5291b0(0x131))/0x7+-parseInt(_0x5291b0(0x130))/0x8*(-parseInt(_0x5291b0(0x120))/0x9);if(_0x309d98===_0x3fa733)break;else _0x524927['push'](_0x524927['shift']());}catch(_0x3047e4){_0x524927['push'](_0x524927['shift']());}}}(a55_0x504d,0x8f4a3));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a55_0xe520(_0x588d36,_0x195b8d){_0x588d36=_0x588d36-0x11e;const _0x504dbb=a55_0x504d();let _0xe520c9=_0x504dbb[_0x588d36];return _0xe520c9;}function a55_0x504d(){const _0x362108=['612060stBhfe','replace','Bearer\x20','1332672mYkeip','3893514XcUOST','5VWbrNk','length','TD1\x20','Authorization','904064ITIbpE','1291098sUvNuk','344RncWxv','3469746UjWqKS','X-Trino-User','tdx','18423yoSfAR','version',';\x20node/','tdx/','entries'];a55_0x504d=function(){return _0x362108;};return a55_0x504d();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x1ef4e1=a55_0xe520,_0x3ae1ab=getVersion(),_0x23f81b=platform(),_0x426624=process[_0x1ef4e1(0x121)][_0x1ef4e1(0x126)]('v','');return _0x1ef4e1(0x123)+_0x3ae1ab+'\x20('+_0x23f81b+_0x1ef4e1(0x122)+_0x426624+')';}export function getAuthHeaders(_0x1589d0,_0x2eff09,_0x3dff4d){const _0x43b842=a55_0xe520,_0x20034f=getVersion(),_0x354f19={'User-Agent':getUserAgent(),'X-TD-Client':_0x43b842(0x11f),'X-TD-Client-Version':_0x20034f};if(_0x3dff4d)_0x354f19[_0x43b842(0x12d)]=_0x43b842(0x127)+_0x3dff4d;else _0x2eff09&&(_0x354f19[_0x43b842(0x12d)]=_0x43b842(0x12c)+_0x2eff09);return _0x354f19;}export function toHeaderRecord(_0x18a456){const _0x6eead0=a55_0xe520,_0x4c9cbf={};for(const [_0x14c512,_0x27ada4]of Object[_0x6eead0(0x124)](_0x18a456)){_0x27ada4!==undefined&&(_0x4c9cbf[_0x14c512]=_0x27ada4);}return _0x4c9cbf;}export function getTrinoHeaders(_0x24fbd2,_0x1ba990,_0x5487a4){const _0x13abfc=a55_0xe520,_0x4ef73c=getAuthHeaders(_0x24fbd2),_0x572ed0=toHeaderRecord(_0x4ef73c);if(_0x5487a4)_0x572ed0[_0x13abfc(0x12d)]='Bearer\x20'+_0x5487a4;else _0x1ba990&&(_0x572ed0[_0x13abfc(0x11e)]=_0x1ba990);return _0x572ed0;}export function hasAPIKey(_0x5492ce){const _0x33122d=a55_0xe520,_0x5cc14e=getAPIKey();return _0x5cc14e!==undefined&&_0x5cc14e[_0x33122d(0x12b)]>0x0;}
1
+ (function(_0x1460de,_0x49aee1){const _0x469b18=a56_0x4bc3,_0x4b881f=_0x1460de();while(!![]){try{const _0x3a149f=parseInt(_0x469b18(0x1c4))/0x1*(-parseInt(_0x469b18(0x1ce))/0x2)+-parseInt(_0x469b18(0x1cf))/0x3*(parseInt(_0x469b18(0x1ca))/0x4)+parseInt(_0x469b18(0x1c3))/0x5+parseInt(_0x469b18(0x1bd))/0x6*(parseInt(_0x469b18(0x1c0))/0x7)+parseInt(_0x469b18(0x1c5))/0x8*(parseInt(_0x469b18(0x1cc))/0x9)+-parseInt(_0x469b18(0x1cd))/0xa*(parseInt(_0x469b18(0x1c2))/0xb)+parseInt(_0x469b18(0x1c1))/0xc*(parseInt(_0x469b18(0x1c6))/0xd);if(_0x3a149f===_0x49aee1)break;else _0x4b881f['push'](_0x4b881f['shift']());}catch(_0x54d1f6){_0x4b881f['push'](_0x4b881f['shift']());}}}(a56_0x3f49,0xe08b0));function a56_0x4bc3(_0x18d92b,_0x3047b8){_0x18d92b=_0x18d92b-0x1bb;const _0x3f49c4=a56_0x3f49();let _0x4bc3c9=_0x3f49c4[_0x18d92b];return _0x4bc3c9;}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 _0x39f9a1=a56_0x4bc3,_0x53f70e=getVersion(),_0x4d1387=platform(),_0x546f4f=process['version']['replace']('v','');return _0x39f9a1(0x1c7)+_0x53f70e+'\x20('+_0x4d1387+_0x39f9a1(0x1bb)+_0x546f4f+')';}function a56_0x3f49(){const _0x5f553d=['tdx','entries','7aqdYra','72516gRLqLD','16625906ZppOum','2069290wElhca','1794502CQJBKB','8tHwJde','3133hDphEK','tdx/','X-Trino-User','Authorization','131956adDjeH','length','15567399jLlhnf','10iveUOM','2nthnYm','6JXQrqt',';\x20node/','Bearer\x20','4150332JTCyYz'];a56_0x3f49=function(){return _0x5f553d;};return a56_0x3f49();}export function getAuthHeaders(_0x16bb86,_0xc1002e,_0x38a4e2){const _0x3665e1=a56_0x4bc3,_0x1696f9=getVersion(),_0x1d758c={'User-Agent':getUserAgent(),'X-TD-Client':_0x3665e1(0x1be),'X-TD-Client-Version':_0x1696f9};if(_0x38a4e2)_0x1d758c[_0x3665e1(0x1c9)]=_0x3665e1(0x1bc)+_0x38a4e2;else _0xc1002e&&(_0x1d758c[_0x3665e1(0x1c9)]='TD1\x20'+_0xc1002e);return _0x1d758c;}export function toHeaderRecord(_0x2bc9e1){const _0x3bed15=a56_0x4bc3,_0x3681b4={};for(const [_0x41e4df,_0xb00dad]of Object[_0x3bed15(0x1bf)](_0x2bc9e1)){_0xb00dad!==undefined&&(_0x3681b4[_0x41e4df]=_0xb00dad);}return _0x3681b4;}export function getTrinoHeaders(_0x56a507,_0xa3c7e0,_0x4a2a6b){const _0x35824f=a56_0x4bc3,_0x755c76=getAuthHeaders(_0x56a507),_0x1b1e5c=toHeaderRecord(_0x755c76);if(_0x4a2a6b)_0x1b1e5c[_0x35824f(0x1c9)]=_0x35824f(0x1bc)+_0x4a2a6b;else _0xa3c7e0&&(_0x1b1e5c[_0x35824f(0x1c8)]=_0xa3c7e0);return _0x1b1e5c;}export function hasAPIKey(_0x101130){const _0x2d03ad=a56_0x4bc3,_0x3e7d58=getAPIKey();return _0x3e7d58!==undefined&&_0x3e7d58[_0x2d03ad(0x1cb)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x4ff3a9,_0xf9af64){const _0x25efa3=a56_0x41f0,_0x14a742=_0x4ff3a9();while(!![]){try{const _0x575d14=-parseInt(_0x25efa3(0x214))/0x1*(-parseInt(_0x25efa3(0x211))/0x2)+-parseInt(_0x25efa3(0x208))/0x3+parseInt(_0x25efa3(0x1f3))/0x4+parseInt(_0x25efa3(0x1d2))/0x5+parseInt(_0x25efa3(0x1d1))/0x6+-parseInt(_0x25efa3(0x1f7))/0x7*(parseInt(_0x25efa3(0x1d5))/0x8)+-parseInt(_0x25efa3(0x212))/0x9*(parseInt(_0x25efa3(0x20c))/0xa);if(_0x575d14===_0xf9af64)break;else _0x14a742['push'](_0x14a742['shift']());}catch(_0x2f15ad){_0x14a742['push'](_0x14a742['shift']());}}}(a56_0x3b4e,0xdf545));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x2be6cd from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';function a56_0x41f0(_0x346355,_0x5cfc7a){_0x346355=_0x346355-0x1ca;const _0x3b4ea9=a56_0x3b4e();let _0x41f047=_0x3b4ea9[_0x346355];return _0x41f047;}function a56_0x3b4e(){const _0x1a040f=['[error]','-FXRSn','─┴─','sdk-result','yellow','resolve','stringify','output','limit','1716408cAhJFI','─┬─','forEach','format','7GuRilR','json','stderr','[logs]','noColor','repeat','bigint','error','color','data','max','isFinite','bold','entries','length','debug','tsv','1217268veWLrb','push','padEnd','less','30BOaEfL','pipe','spawn','[query]','log','28410bkExYU','4628241ckFsSf','write','5DydPbi','rule','FINISHED','join','list','jsonl','map','params','4996878DCuLZI','7987470vdVhqV','varchar','trim','537392EMhHPG','No\x20data','Results\x20saved\x20to\x20','string','magenta','query','boolean','cmdout','table','split','isTTY','close','limitStructuredFormats','number','double','stdin','[rule]','[Object]','object','[params]','filter'];a56_0x3b4e=function(){return _0x1a040f;};return a56_0x3b4e();}export function isStructuredFormat(_0x2b6c27){const _0x898027=a56_0x41f0;return _0x2b6c27[_0x898027(0x1f6)]===_0x898027(0x1f8)||_0x2b6c27['format']===_0x898027(0x1ce)||_0x2b6c27[_0x898027(0x1f6)]===_0x898027(0x207)||_0x2b6c27[_0x898027(0x1f6)]===_0x898027(0x1dd)||_0x2b6c27[_0x898027(0x1f8)]===!![]||_0x2b6c27['jsonl']===!![]||_0x2b6c27['tsv']===!![]||_0x2b6c27[_0x898027(0x1dd)]===!![];}export function parseOutputOptions(_0x4d64af){const _0x45a0d5=a56_0x41f0;return{'format':_0x4d64af[_0x45a0d5(0x1f6)]||'table','output':_0x4d64af[_0x45a0d5(0x1f1)]||'','limit':_0x4d64af[_0x45a0d5(0x1f2)],'limitStructuredFormats':_0x4d64af[_0x45a0d5(0x1e1)],'color':_0x4d64af[_0x45a0d5(0x1ff)],'noColor':_0x4d64af[_0x45a0d5(0x1fb)]};}function convertSDKResultToQueryResult(_0x393e0e){const _0x561b1f=a56_0x41f0,_0x330c72=[];if(_0x393e0e[_0x561b1f(0x205)]>0x0){const _0x3f87bd=_0x393e0e[0x0];for(const [_0x35ed61,_0x74b7aa]of Object[_0x561b1f(0x204)](_0x3f87bd)){let _0x4125a5=_0x561b1f(0x1d3);if(typeof _0x74b7aa===_0x561b1f(0x1e2))_0x4125a5=Number['isInteger'](_0x74b7aa)?_0x561b1f(0x1fd):_0x561b1f(0x1e3);else{if(typeof _0x74b7aa===_0x561b1f(0x1db))_0x4125a5=_0x561b1f(0x1db);else _0x74b7aa===null&&(_0x4125a5=_0x561b1f(0x1d3));}_0x330c72[_0x561b1f(0x209)]({'name':_0x35ed61,'type':_0x4125a5});}}return{'queryId':_0x561b1f(0x1ed),'columns':_0x330c72,'data':_0x393e0e,'stats':{'state':_0x561b1f(0x1cb),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x393e0e[_0x561b1f(0x205)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x17f86a,_0x5d069c){const _0x1926c3=convertSDKResultToQueryResult(_0x17f86a);return formatQueryOutput(_0x1926c3,_0x5d069c);}export async function formatQueryOutput(_0x2f2834,_0x3e0079){const _0x47b57a=a56_0x41f0,{format:_0x23b215,limit:_0x4cd132,output:_0x2880e5,color:_0x44f6a2,noColor:_0x61d6c1,limitStructuredFormats:_0x4f5702}=_0x3e0079,_0x3f5ee8=Boolean(_0x2880e5)&&!_0x44f6a2,_0x3c880c={'color':_0x44f6a2,'noColor':_0x61d6c1||_0x3f5ee8};if(_0x23b215===_0x47b57a(0x1dd)){const _0x5bbf92=shouldUseLess(_0x23b215,_0x2880e5);return formatAsTable(_0x2f2834,_0x4cd132,_0x5bbf92,_0x3c880c);}const _0xac6b19=_0x4f5702&&Number[_0x47b57a(0x202)](_0x4cd132)&&_0x2f2834[_0x47b57a(0x200)][_0x47b57a(0x205)]>_0x4cd132?{..._0x2f2834,'data':_0x2f2834[_0x47b57a(0x200)]['slice'](0x0,_0x4cd132)}:_0x2f2834;if(_0x23b215===_0x47b57a(0x1f8))return formatAsJSON(_0xac6b19,_0x3c880c);else return _0x23b215===_0x47b57a(0x1ce)?formatAsJSONL(_0xac6b19,_0x3c880c):formatQueryResult(_0xac6b19,_0x23b215);}function shouldUseLess(_0x1a1db1,_0x50b957){const _0x500eb6=a56_0x41f0;return(_0x1a1db1===_0x500eb6(0x1dd)||_0x1a1db1===_0x500eb6(0x1cd))&&process['stdout'][_0x500eb6(0x1df)]&&!_0x50b957;}export function resolveOutputOptions(_0x46c243){const _0x407926=a56_0x41f0,_0x1f3398=_0x46c243['output']||'',_0x10e6b3=resolveOutputFormat(_0x46c243[_0x407926(0x1f6)],_0x1f3398,_0x407926(0x1dd));let _0x221fa7=typeof _0x46c243[_0x407926(0x1f2)]==='number'?_0x46c243['limit']:parseInt(_0x46c243['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x46c243[_0x407926(0x1f2)]===undefined&&shouldUseLess(_0x10e6b3,_0x1f3398)&&(_0x221fa7=Infinity),{'format':_0x10e6b3,'output':_0x1f3398,'limit':_0x221fa7,'limitStructuredFormats':_0x46c243[_0x407926(0x1e1)],'color':_0x46c243[_0x407926(0x1ff)],'noColor':_0x46c243[_0x407926(0x1fb)]};}export function writeOutput(_0x1a129b,_0x272b27,_0x4e9d32){const _0x5ffc2e=a56_0x41f0;return _0x272b27?(writeFileSync(_0x272b27,_0x1a129b),console[_0x5ffc2e(0x1fe)](_0x5ffc2e(0x1d7)+_0x272b27),Promise[_0x5ffc2e(0x1ef)]()):shouldUseLess(_0x4e9d32||'','')?new Promise(_0x1456ce=>{const _0x24cd98=_0x5ffc2e,_0xc695dc=spawn(_0x24cd98(0x20b),[_0x24cd98(0x1eb)],{'stdio':[_0x24cd98(0x20d),'inherit','inherit']});let _0x144aa6=![];_0xc695dc['on']('error',()=>{const _0x33fb73=_0x24cd98;!_0x144aa6&&(_0x144aa6=!![],console[_0x33fb73(0x210)](_0x1a129b),_0x1456ce());}),_0xc695dc['on'](_0x24cd98(0x1e0),()=>{!_0x144aa6&&(_0x144aa6=!![],_0x1456ce());}),_0xc695dc['on'](_0x24cd98(0x20e),()=>{const _0x59ccae=_0x24cd98;!_0x144aa6&&_0xc695dc[_0x59ccae(0x1e4)]&&(_0xc695dc[_0x59ccae(0x1e4)]['on']('error',()=>{}),_0xc695dc[_0x59ccae(0x1e4)][_0x59ccae(0x213)](_0x1a129b),_0xc695dc[_0x59ccae(0x1e4)]['end']());}),!_0xc695dc['stdin']&&(!_0x144aa6&&(_0x144aa6=!![],console[_0x24cd98(0x210)](_0x1a129b),_0x1456ce()));}):(console[_0x5ffc2e(0x210)](_0x1a129b),Promise[_0x5ffc2e(0x1ef)]());}export async function handleSDKOutput(_0x2446fd,_0x127386){const _0x42bc8b=a56_0x41f0,_0x26cca8=resolveOutputOptions(_0x127386),_0x45f1da=await formatSDKOutput(_0x2446fd,_0x26cca8);await writeOutput(_0x45f1da,_0x26cca8['output']||undefined,_0x26cca8[_0x42bc8b(0x1f6)]);}export async function handleQueryOutput(_0x1f9807,_0x3301ab){const _0x52b11d=a56_0x41f0,_0xcd08e0=resolveOutputOptions(_0x3301ab),_0xb1f967=await formatQueryOutput(_0x1f9807,_0xcd08e0);await writeOutput(_0xb1f967,_0xcd08e0[_0x52b11d(0x1f1)]||undefined,_0xcd08e0['format']);}async function formatSingleObject(_0x16ae3f,_0x25092f){const _0x30f51c=a56_0x41f0,{format:_0x2a8039,color:_0x5df6b6,noColor:_0x461ac5}=_0x25092f,_0x34e9b4={'color':_0x5df6b6,'noColor':_0x461ac5};if(_0x2a8039===_0x30f51c(0x1f8)){if(shouldUseColor(_0x34e9b4))return colorizeJSON(_0x16ae3f,_0x34e9b4);return JSON[_0x30f51c(0x1f0)](_0x16ae3f,null,0x2);}else{if(_0x2a8039===_0x30f51c(0x1ce)){if(shouldUseColor(_0x34e9b4))return colorizeJSONCompact(_0x16ae3f,_0x34e9b4);return JSON['stringify'](_0x16ae3f);}else{if(_0x2a8039===_0x30f51c(0x207))return Object[_0x30f51c(0x204)](_0x16ae3f)[_0x30f51c(0x1cf)](([_0x5d6d27,_0x2cc17a])=>_0x5d6d27+'\x09'+_0x2cc17a)[_0x30f51c(0x1cc)]('\x0a');else{const _0x12478f=Object[_0x30f51c(0x204)](_0x16ae3f);if(_0x12478f['length']===0x0)return _0x30f51c(0x1d6);const _0x3ad670=_0x16ae3f[_0x30f51c(0x206)],_0x1a83d0=_0x16ae3f[_0x30f51c(0x1da)],_0x5164ed=_0x16ae3f[_0x30f51c(0x1d0)],_0x3baba9=_0x16ae3f[_0x30f51c(0x1ca)],_0x1cf902=_0x1a83d0?typeof _0x1a83d0===_0x30f51c(0x1d8)?_0x1a83d0:JSON[_0x30f51c(0x1f0)](_0x1a83d0,null,0x2):undefined,_0x4d37dc=_0x5164ed&&Object['keys'](_0x5164ed)[_0x30f51c(0x205)]>0x0?JSON[_0x30f51c(0x1f0)](_0x5164ed,null,0x2):undefined,_0x38d92c=_0x3baba9&&Object['keys'](_0x3baba9)[_0x30f51c(0x205)]>0x0?JSON[_0x30f51c(0x1f0)](_0x3baba9,null,0x2):undefined,_0x3a136f=_0x12478f[_0x30f51c(0x1e9)](([_0x17bab8])=>_0x17bab8!==_0x30f51c(0x206)&&_0x17bab8!=='query'&&_0x17bab8!==_0x30f51c(0x1d0)&&_0x17bab8!=='rule'),_0xc0af30=Math[_0x30f51c(0x201)](..._0x3a136f[_0x30f51c(0x1cf)](([_0x4ccf16])=>_0x4ccf16['length'])),_0x583c39=Math['max'](..._0x3a136f[_0x30f51c(0x1cf)](([,_0x58b165])=>{const _0x15904a=_0x30f51c;try{const _0x1aaf91=_0x58b165===null||_0x58b165===undefined?'':typeof _0x58b165==='object'?JSON[_0x15904a(0x1f0)](_0x58b165):String(_0x58b165),_0x4653b6=_0x1aaf91[_0x15904a(0x1de)]('\x0a');return Math[_0x15904a(0x201)](..._0x4653b6[_0x15904a(0x1cf)](_0x189098=>_0x189098['length']),0x0);}catch{return 0x0;}}),0x14),_0x1c7c43=[];_0x1c7c43[_0x30f51c(0x209)](colorBorder('┌─'+'─'[_0x30f51c(0x1fc)](_0xc0af30)+_0x30f51c(0x1f4)+'─'[_0x30f51c(0x1fc)](_0x583c39)+'─┐',_0x34e9b4)),_0x3a136f[_0x30f51c(0x1f5)](([_0x8f6b59,_0x476fa0])=>{const _0x3a6f80=_0x30f51c;let _0x4a83b9;try{_0x4a83b9=_0x476fa0===null||_0x476fa0===undefined?'':typeof _0x476fa0===_0x3a6f80(0x1e7)?JSON[_0x3a6f80(0x1f0)](_0x476fa0):String(_0x476fa0);}catch{_0x4a83b9=_0x3a6f80(0x1e6);}const _0x5f4b7b=_0x8f6b59[_0x3a6f80(0x20a)](_0xc0af30),_0x59162e=_0x4a83b9[_0x3a6f80(0x1de)]('\x0a');_0x59162e[_0x3a6f80(0x1f5)]((_0xebcb43,_0x4b97df)=>{const _0x585b4d=_0x3a6f80,_0x2e212f=colorBorder('│',_0x34e9b4);_0x4b97df===0x0?_0x1c7c43[_0x585b4d(0x209)](_0x2e212f+'\x20'+_0x5f4b7b+'\x20'+_0x2e212f+'\x20'+_0xebcb43[_0x585b4d(0x20a)](_0x583c39)+'\x20'+_0x2e212f):_0x1c7c43['push'](_0x2e212f+'\x20'+'\x20'[_0x585b4d(0x1fc)](_0xc0af30)+'\x20'+_0x2e212f+'\x20'+_0xebcb43[_0x585b4d(0x20a)](_0x583c39)+'\x20'+_0x2e212f);});}),_0x1c7c43[_0x30f51c(0x209)](colorBorder('└─'+'─'[_0x30f51c(0x1fc)](_0xc0af30)+_0x30f51c(0x1ec)+'─'[_0x30f51c(0x1fc)](_0x583c39)+'─┘',_0x34e9b4));_0x1cf902&&(_0x1c7c43[_0x30f51c(0x209)](''),_0x1c7c43[_0x30f51c(0x209)](String(a56_0x2be6cd[_0x30f51c(0x1ee)]['bold'](_0x30f51c(0x20f)))),_0x1c7c43[_0x30f51c(0x209)](_0x1cf902));_0x4d37dc&&(_0x1c7c43['push'](''),_0x1c7c43['push'](String(a56_0x2be6cd['blue'][_0x30f51c(0x203)](_0x30f51c(0x1e8)))),_0x1c7c43[_0x30f51c(0x209)](_0x4d37dc));_0x38d92c&&(_0x1c7c43[_0x30f51c(0x209)](''),_0x1c7c43[_0x30f51c(0x209)](String(a56_0x2be6cd[_0x30f51c(0x1d9)][_0x30f51c(0x203)](_0x30f51c(0x1e5)))),_0x1c7c43[_0x30f51c(0x209)](_0x38d92c));if(_0x3ad670){if(_0x3ad670[_0x30f51c(0x1f9)]){_0x1c7c43[_0x30f51c(0x209)](''),_0x1c7c43[_0x30f51c(0x209)](String(a56_0x2be6cd['red'][_0x30f51c(0x203)](_0x30f51c(0x1ea))));const _0x1f2a66=_0x3ad670['stderr'][_0x30f51c(0x1de)]('\x0a');_0x1f2a66[_0x30f51c(0x1f5)](_0x2e5aeb=>{const _0x4bc6e2=_0x30f51c;_0x2e5aeb[_0x4bc6e2(0x1d4)]()&&_0x1c7c43[_0x4bc6e2(0x209)](_0x2e5aeb);});}if(_0x3ad670[_0x30f51c(0x1dc)]){_0x1c7c43[_0x30f51c(0x209)](''),_0x1c7c43[_0x30f51c(0x209)](String(a56_0x2be6cd['cyan'][_0x30f51c(0x203)](_0x30f51c(0x1fa))));const _0x1b80d5=_0x3ad670[_0x30f51c(0x1dc)]['split']('\x0a');_0x1b80d5['forEach'](_0xe5342b=>{const _0x4f3aca=_0x30f51c;_0xe5342b[_0x4f3aca(0x1d4)]()&&_0x1c7c43[_0x4f3aca(0x209)](_0xe5342b);});}}return _0x1c7c43[_0x30f51c(0x1cc)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x27ee1c,_0x59a5ad){const _0x1fd600=a56_0x41f0;if(_0x59a5ad[_0x1fd600(0x1f6)]==='table'){await handleSDKOutput([_0x27ee1c],_0x59a5ad);return;}const _0x2f8037=resolveOutputOptions(_0x59a5ad),_0xf616d6=await formatSingleObject(_0x27ee1c,_0x2f8037);await writeOutput(_0xf616d6,_0x2f8037[_0x1fd600(0x1f1)]||undefined,_0x2f8037[_0x1fd600(0x1f6)]);}
1
+ (function(_0xe8b0f1,_0x524c0d){const _0x479d4b=a57_0x3e82,_0x4915e6=_0xe8b0f1();while(!![]){try{const _0x470edd=-parseInt(_0x479d4b(0x206))/0x1+parseInt(_0x479d4b(0x20e))/0x2+parseInt(_0x479d4b(0x1f1))/0x3+-parseInt(_0x479d4b(0x207))/0x4+-parseInt(_0x479d4b(0x237))/0x5+-parseInt(_0x479d4b(0x20a))/0x6*(parseInt(_0x479d4b(0x226))/0x7)+-parseInt(_0x479d4b(0x1f5))/0x8*(-parseInt(_0x479d4b(0x22c))/0x9);if(_0x470edd===_0x524c0d)break;else _0x4915e6['push'](_0x4915e6['shift']());}catch(_0x46ba38){_0x4915e6['push'](_0x4915e6['shift']());}}}(a57_0x3ed5,0x6a97b));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a57_0x33f4e1 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x1dd45a){const _0x5e51e8=a57_0x3e82;return _0x1dd45a[_0x5e51e8(0x201)]===_0x5e51e8(0x235)||_0x1dd45a[_0x5e51e8(0x201)]===_0x5e51e8(0x234)||_0x1dd45a[_0x5e51e8(0x201)]===_0x5e51e8(0x217)||_0x1dd45a[_0x5e51e8(0x201)]===_0x5e51e8(0x211)||_0x1dd45a[_0x5e51e8(0x235)]===!![]||_0x1dd45a['jsonl']===!![]||_0x1dd45a[_0x5e51e8(0x217)]===!![]||_0x1dd45a[_0x5e51e8(0x211)]===!![];}function a57_0x3e82(_0x29e4ae,_0x9bf435){_0x29e4ae=_0x29e4ae-0x1ec;const _0x3ed59a=a57_0x3ed5();let _0x3e82e3=_0x3ed59a[_0x29e4ae];return _0x3e82e3;}export function parseOutputOptions(_0x103735){const _0x141817=a57_0x3e82;return{'format':_0x103735[_0x141817(0x201)]||'table','output':_0x103735[_0x141817(0x1f8)]||'','limit':_0x103735['limit'],'limitStructuredFormats':_0x103735['limitStructuredFormats'],'color':_0x103735['color'],'noColor':_0x103735[_0x141817(0x233)]};}function convertSDKResultToQueryResult(_0x1f6956){const _0x167fb9=a57_0x3e82,_0x231d65=[];if(_0x1f6956[_0x167fb9(0x222)]>0x0){const _0x452e23=_0x1f6956[0x0];for(const [_0x10282e,_0x23afdc]of Object['entries'](_0x452e23)){let _0x42dc10=_0x167fb9(0x209);if(typeof _0x23afdc===_0x167fb9(0x203))_0x42dc10=Number[_0x167fb9(0x21d)](_0x23afdc)?_0x167fb9(0x216):'double';else{if(typeof _0x23afdc===_0x167fb9(0x1ff))_0x42dc10='boolean';else _0x23afdc===null&&(_0x42dc10=_0x167fb9(0x209));}_0x231d65[_0x167fb9(0x20f)]({'name':_0x10282e,'type':_0x42dc10});}}return{'queryId':_0x167fb9(0x1fc),'columns':_0x231d65,'data':_0x1f6956,'stats':{'state':_0x167fb9(0x210),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1f6956[_0x167fb9(0x222)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x45eafd,_0x27d621){const _0x30cc5c=convertSDKResultToQueryResult(_0x45eafd);return formatQueryOutput(_0x30cc5c,_0x27d621);}export async function formatQueryOutput(_0x1aeff4,_0x16fdb2){const _0x63938=a57_0x3e82,{format:_0x624ddc,limit:_0x42ef2f,output:_0x3e2618,color:_0x493817,noColor:_0x308642,limitStructuredFormats:_0x5d6e05}=_0x16fdb2,_0x5697d0=Boolean(_0x3e2618)&&!_0x493817,_0x218ad3={'color':_0x493817,'noColor':_0x308642||_0x5697d0};if(_0x624ddc===_0x63938(0x211)){const _0x2998ae=shouldUseLess(_0x624ddc,_0x3e2618);return formatAsTable(_0x1aeff4,_0x42ef2f,_0x2998ae,_0x218ad3);}const _0x4098c4=_0x5d6e05&&Number['isFinite'](_0x42ef2f)&&_0x1aeff4[_0x63938(0x22f)]['length']>_0x42ef2f?{..._0x1aeff4,'data':_0x1aeff4['data'][_0x63938(0x220)](0x0,_0x42ef2f)}:_0x1aeff4;if(_0x624ddc===_0x63938(0x235))return formatAsJSON(_0x4098c4,_0x218ad3);else return _0x624ddc==='jsonl'?formatAsJSONL(_0x4098c4,_0x218ad3):formatQueryResult(_0x4098c4,_0x624ddc);}function shouldUseLess(_0x17a292,_0x3e9730){const _0x3354a8=a57_0x3e82;return(_0x17a292===_0x3354a8(0x211)||_0x17a292===_0x3354a8(0x22b))&&process[_0x3354a8(0x1fb)][_0x3354a8(0x1ec)]&&!_0x3e9730;}export function resolveOutputOptions(_0x33e9fa){const _0x3ce079=a57_0x3e82,_0x24d227=_0x33e9fa['output']||'',_0x501814=resolveOutputFormat(_0x33e9fa['format'],_0x24d227,_0x3ce079(0x211));let _0x4d9236=typeof _0x33e9fa['limit']===_0x3ce079(0x203)?_0x33e9fa[_0x3ce079(0x230)]:parseInt(_0x33e9fa['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x33e9fa['limit']===undefined&&shouldUseLess(_0x501814,_0x24d227)&&(_0x4d9236=Infinity),{'format':_0x501814,'output':_0x24d227,'limit':_0x4d9236,'limitStructuredFormats':_0x33e9fa[_0x3ce079(0x202)],'color':_0x33e9fa[_0x3ce079(0x1fa)],'noColor':_0x33e9fa['noColor']};}export function writeOutput(_0x2daa60,_0x1c3764,_0x57df57){const _0x5ada7e=a57_0x3e82;return _0x1c3764?(writeFileSync(_0x1c3764,_0x2daa60),console[_0x5ada7e(0x1f6)](_0x5ada7e(0x200)+_0x1c3764),Promise[_0x5ada7e(0x21a)]()):shouldUseLess(_0x57df57||'','')?new Promise(_0x4b8f2f=>{const _0x5e2ec7=_0x5ada7e,_0x27ac24=spawn(_0x5e2ec7(0x1ed),[_0x5e2ec7(0x221)],{'stdio':[_0x5e2ec7(0x1f9),_0x5e2ec7(0x20d),_0x5e2ec7(0x20d)]});let _0x4ceb14=![];_0x27ac24['on'](_0x5e2ec7(0x1f6),()=>{const _0x5c4349=_0x5e2ec7;!_0x4ceb14&&(_0x4ceb14=!![],console[_0x5c4349(0x236)](_0x2daa60),_0x4b8f2f());}),_0x27ac24['on'](_0x5e2ec7(0x22e),()=>{!_0x4ceb14&&(_0x4ceb14=!![],_0x4b8f2f());}),_0x27ac24['on']('spawn',()=>{const _0x28dc1e=_0x5e2ec7;!_0x4ceb14&&_0x27ac24['stdin']&&(_0x27ac24[_0x28dc1e(0x212)]['on'](_0x28dc1e(0x1f6),()=>{}),_0x27ac24[_0x28dc1e(0x212)]['write'](_0x2daa60),_0x27ac24['stdin']['end']());}),!_0x27ac24[_0x5e2ec7(0x212)]&&(!_0x4ceb14&&(_0x4ceb14=!![],console[_0x5e2ec7(0x236)](_0x2daa60),_0x4b8f2f()));}):(console[_0x5ada7e(0x236)](_0x2daa60),Promise[_0x5ada7e(0x21a)]());}export async function handleSDKOutput(_0x471aae,_0x4e8a02){const _0x49b43f=a57_0x3e82,_0x10cf28=resolveOutputOptions(_0x4e8a02),_0x67aded=await formatSDKOutput(_0x471aae,_0x10cf28);await writeOutput(_0x67aded,_0x10cf28[_0x49b43f(0x1f8)]||undefined,_0x10cf28[_0x49b43f(0x201)]);}function a57_0x3ed5(){const _0x5e8a97=['join','varchar','30UCAeux','max','query','inherit','1114048Vpanrs','push','FINISHED','table','stdin','[params]','stderr','No\x20data','bigint','tsv','cmdout','split','resolve','debug','[query]','isInteger','map','padEnd','slice','-FXRSn','length','stringify','red','string','1077181nkqCky','cyan','rule','[rule]','magenta','list','18TyHtAw','forEach','close','data','limit','trim','keys','noColor','jsonl','json','log','557155hSRBjV','isTTY','less','filter','repeat','object','2286867hhSMOv','bold','[logs]','params','4070544jibGCd','error','[Object]','output','pipe','color','stdout','sdk-result','entries','─┴─','boolean','Results\x20saved\x20to\x20','format','limitStructuredFormats','number','yellow','─┬─','302465RSbgKj','2868140dgqiwu'];a57_0x3ed5=function(){return _0x5e8a97;};return a57_0x3ed5();}export async function handleQueryOutput(_0x318318,_0x281e91){const _0x2f48c3=a57_0x3e82,_0x370b79=resolveOutputOptions(_0x281e91),_0x38002f=await formatQueryOutput(_0x318318,_0x370b79);await writeOutput(_0x38002f,_0x370b79[_0x2f48c3(0x1f8)]||undefined,_0x370b79[_0x2f48c3(0x201)]);}async function formatSingleObject(_0x42bc30,_0x367204){const _0x5ca976=a57_0x3e82,{format:_0x4effc3,color:_0x13b222,noColor:_0x375011}=_0x367204,_0x1d9226={'color':_0x13b222,'noColor':_0x375011};if(_0x4effc3===_0x5ca976(0x235)){if(shouldUseColor(_0x1d9226))return colorizeJSON(_0x42bc30,_0x1d9226);return JSON[_0x5ca976(0x223)](_0x42bc30,null,0x2);}else{if(_0x4effc3==='jsonl'){if(shouldUseColor(_0x1d9226))return colorizeJSONCompact(_0x42bc30,_0x1d9226);return JSON[_0x5ca976(0x223)](_0x42bc30);}else{if(_0x4effc3===_0x5ca976(0x217))return Object[_0x5ca976(0x1fd)](_0x42bc30)[_0x5ca976(0x21e)](([_0xf925e5,_0x145304])=>_0xf925e5+'\x09'+_0x145304)[_0x5ca976(0x208)]('\x0a');else{const _0x9af6cd=Object[_0x5ca976(0x1fd)](_0x42bc30);if(_0x9af6cd[_0x5ca976(0x222)]===0x0)return _0x5ca976(0x215);const _0x58be7e=_0x42bc30['debug'],_0x1d7378=_0x42bc30[_0x5ca976(0x20c)],_0x486d23=_0x42bc30[_0x5ca976(0x1f4)],_0xf28b1=_0x42bc30['rule'],_0x3c2237=_0x1d7378?typeof _0x1d7378===_0x5ca976(0x225)?_0x1d7378:JSON['stringify'](_0x1d7378,null,0x2):undefined,_0x12416f=_0x486d23&&Object[_0x5ca976(0x232)](_0x486d23)[_0x5ca976(0x222)]>0x0?JSON[_0x5ca976(0x223)](_0x486d23,null,0x2):undefined,_0x5e3323=_0xf28b1&&Object[_0x5ca976(0x232)](_0xf28b1)['length']>0x0?JSON[_0x5ca976(0x223)](_0xf28b1,null,0x2):undefined,_0x564d63=_0x9af6cd[_0x5ca976(0x1ee)](([_0x1e9068])=>_0x1e9068!==_0x5ca976(0x21b)&&_0x1e9068!=='query'&&_0x1e9068!==_0x5ca976(0x1f4)&&_0x1e9068!==_0x5ca976(0x228)),_0x3ebc77=Math[_0x5ca976(0x20b)](..._0x564d63[_0x5ca976(0x21e)](([_0x66ac9b])=>_0x66ac9b[_0x5ca976(0x222)])),_0x34ac01=Math[_0x5ca976(0x20b)](..._0x564d63[_0x5ca976(0x21e)](([,_0x47bf2f])=>{const _0x2df5ce=_0x5ca976;try{const _0x1a2db0=_0x47bf2f===null||_0x47bf2f===undefined?'':typeof _0x47bf2f===_0x2df5ce(0x1f0)?JSON[_0x2df5ce(0x223)](_0x47bf2f):String(_0x47bf2f),_0x4ec666=_0x1a2db0[_0x2df5ce(0x219)]('\x0a');return Math[_0x2df5ce(0x20b)](..._0x4ec666[_0x2df5ce(0x21e)](_0x4833b8=>_0x4833b8['length']),0x0);}catch{return 0x0;}}),0x14),_0x40e401=[];_0x40e401['push'](colorBorder('┌─'+'─'['repeat'](_0x3ebc77)+_0x5ca976(0x205)+'─'[_0x5ca976(0x1ef)](_0x34ac01)+'─┐',_0x1d9226)),_0x564d63[_0x5ca976(0x22d)](([_0xac35fd,_0x201a4f])=>{const _0xc6c1b5=_0x5ca976;let _0x1e5e3c;try{_0x1e5e3c=_0x201a4f===null||_0x201a4f===undefined?'':typeof _0x201a4f==='object'?JSON[_0xc6c1b5(0x223)](_0x201a4f):String(_0x201a4f);}catch{_0x1e5e3c=_0xc6c1b5(0x1f7);}const _0x1f9ebe=_0xac35fd[_0xc6c1b5(0x21f)](_0x3ebc77),_0x351865=_0x1e5e3c[_0xc6c1b5(0x219)]('\x0a');_0x351865[_0xc6c1b5(0x22d)]((_0x11ca77,_0x2484e8)=>{const _0x3c4791=_0xc6c1b5,_0x1a1ae7=colorBorder('│',_0x1d9226);_0x2484e8===0x0?_0x40e401[_0x3c4791(0x20f)](_0x1a1ae7+'\x20'+_0x1f9ebe+'\x20'+_0x1a1ae7+'\x20'+_0x11ca77['padEnd'](_0x34ac01)+'\x20'+_0x1a1ae7):_0x40e401[_0x3c4791(0x20f)](_0x1a1ae7+'\x20'+'\x20'[_0x3c4791(0x1ef)](_0x3ebc77)+'\x20'+_0x1a1ae7+'\x20'+_0x11ca77['padEnd'](_0x34ac01)+'\x20'+_0x1a1ae7);});}),_0x40e401[_0x5ca976(0x20f)](colorBorder('└─'+'─'[_0x5ca976(0x1ef)](_0x3ebc77)+_0x5ca976(0x1fe)+'─'[_0x5ca976(0x1ef)](_0x34ac01)+'─┘',_0x1d9226));_0x3c2237&&(_0x40e401['push'](''),_0x40e401[_0x5ca976(0x20f)](String(a57_0x33f4e1[_0x5ca976(0x204)][_0x5ca976(0x1f2)](_0x5ca976(0x21c)))),_0x40e401[_0x5ca976(0x20f)](_0x3c2237));_0x12416f&&(_0x40e401['push'](''),_0x40e401[_0x5ca976(0x20f)](String(a57_0x33f4e1['blue'][_0x5ca976(0x1f2)](_0x5ca976(0x213)))),_0x40e401['push'](_0x12416f));_0x5e3323&&(_0x40e401[_0x5ca976(0x20f)](''),_0x40e401['push'](String(a57_0x33f4e1[_0x5ca976(0x22a)][_0x5ca976(0x1f2)](_0x5ca976(0x229)))),_0x40e401[_0x5ca976(0x20f)](_0x5e3323));if(_0x58be7e){if(_0x58be7e[_0x5ca976(0x214)]){_0x40e401['push'](''),_0x40e401[_0x5ca976(0x20f)](String(a57_0x33f4e1[_0x5ca976(0x224)][_0x5ca976(0x1f2)]('[error]')));const _0x27fe06=_0x58be7e['stderr'][_0x5ca976(0x219)]('\x0a');_0x27fe06[_0x5ca976(0x22d)](_0x5e7863=>{const _0x25932b=_0x5ca976;_0x5e7863[_0x25932b(0x231)]()&&_0x40e401[_0x25932b(0x20f)](_0x5e7863);});}if(_0x58be7e[_0x5ca976(0x218)]){_0x40e401[_0x5ca976(0x20f)](''),_0x40e401[_0x5ca976(0x20f)](String(a57_0x33f4e1[_0x5ca976(0x227)][_0x5ca976(0x1f2)](_0x5ca976(0x1f3))));const _0xcfe197=_0x58be7e[_0x5ca976(0x218)][_0x5ca976(0x219)]('\x0a');_0xcfe197['forEach'](_0x52493b=>{_0x52493b['trim']()&&_0x40e401['push'](_0x52493b);});}}return _0x40e401[_0x5ca976(0x208)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x10f124,_0xada018){const _0x215352=a57_0x3e82;if(_0xada018[_0x215352(0x201)]===_0x215352(0x211)){await handleSDKOutput([_0x10f124],_0xada018);return;}const _0x46fe1f=resolveOutputOptions(_0xada018),_0x16b00a=await formatSingleObject(_0x10f124,_0x46fe1f);await writeOutput(_0x16b00a,_0x46fe1f[_0x215352(0x1f8)]||undefined,_0x46fe1f[_0x215352(0x201)]);}