@treasuredata/tdx 2026.3.6 → 2026.3.8

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 (208) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.d.ts.map +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/profiles-command.js.map +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.d.ts.map +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/user-command.js.map +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.d.ts.map +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/oauth.js.map +1 -1
  71. package/dist/core/profile.js +1 -1
  72. package/dist/core/project-config.js +1 -1
  73. package/dist/core/session.js +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/mcp/server.js +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/tdx-run.js +1 -1
  80. package/dist/mcp/tools/tdx-search.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/client/cdp-api-client.js +1 -1
  96. package/dist/sdk/client/delivery-api-client.js +1 -1
  97. package/dist/sdk/client/endpoints.js +1 -1
  98. package/dist/sdk/client/engage-api-client.js +1 -1
  99. package/dist/sdk/client/http-client.js +1 -1
  100. package/dist/sdk/client/llm-api-client.js +1 -1
  101. package/dist/sdk/client/oauth-refresh.js +1 -1
  102. package/dist/sdk/client/rate-limiter.js +1 -1
  103. package/dist/sdk/client/td-api-client.js +1 -1
  104. package/dist/sdk/client/trino-api-client.js +1 -1
  105. package/dist/sdk/client/workflow-client.js +1 -1
  106. package/dist/sdk/connection-validator.js +1 -1
  107. package/dist/sdk/connection.js +1 -1
  108. package/dist/sdk/delivery.js +1 -1
  109. package/dist/sdk/engage/campaign-pull.js +1 -1
  110. package/dist/sdk/engage/campaign-push.js +1 -1
  111. package/dist/sdk/engage/campaign-validator.js +1 -1
  112. package/dist/sdk/engage/campaign-yaml.js +1 -1
  113. package/dist/sdk/engage/template-pull.js +1 -1
  114. package/dist/sdk/engage/template-push.js +1 -1
  115. package/dist/sdk/engage/template-validator.js +1 -1
  116. package/dist/sdk/engage/template-yaml.js +1 -1
  117. package/dist/sdk/engage/types/campaign-def.js +1 -1
  118. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  119. package/dist/sdk/engage/types/template-schema.js +1 -1
  120. package/dist/sdk/engage.js +1 -1
  121. package/dist/sdk/errors.js +1 -1
  122. package/dist/sdk/index.js +1 -1
  123. package/dist/sdk/io/index.js +1 -1
  124. package/dist/sdk/io/node-filesystem.js +1 -1
  125. package/dist/sdk/job.js +1 -1
  126. package/dist/sdk/journey.js +1 -1
  127. package/dist/sdk/llm/chat-cache.js +1 -1
  128. package/dist/sdk/llm/index.js +1 -1
  129. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  130. package/dist/sdk/llm/model-factors.js +1 -1
  131. package/dist/sdk/personalization.js +1 -1
  132. package/dist/sdk/query/index.js +1 -1
  133. package/dist/sdk/query/sql-parser.js +1 -1
  134. package/dist/sdk/realtime.js +1 -1
  135. package/dist/sdk/schedule.js +1 -1
  136. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/fields-display.js +1 -1
  138. package/dist/sdk/segment/file-discovery.js +1 -1
  139. package/dist/sdk/segment/journey-utils.js +1 -1
  140. package/dist/sdk/segment/journey-validator.js +1 -1
  141. package/dist/sdk/segment/journey-yaml.js +1 -1
  142. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  143. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/pull-workflow.js +1 -1
  145. package/dist/sdk/segment/push-recovery.js +1 -1
  146. package/dist/sdk/segment/push-workflow.js +1 -1
  147. package/dist/sdk/segment/resolution-context.js +1 -1
  148. package/dist/sdk/segment/segment-path-parser.js +1 -1
  149. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  150. package/dist/sdk/segment/segment-validator.js +1 -1
  151. package/dist/sdk/segment/target-resolution.js +1 -1
  152. package/dist/sdk/segment/tdx-config.js +1 -1
  153. package/dist/sdk/segment/types/activation-schema.js +1 -1
  154. package/dist/sdk/segment/types/journey-def.js +1 -1
  155. package/dist/sdk/segment/types/journey-schema.js +1 -1
  156. package/dist/sdk/segment/types/segment-def.js +1 -1
  157. package/dist/sdk/segment/types/segment-schema.js +1 -1
  158. package/dist/sdk/segment/validate-files.js +1 -1
  159. package/dist/sdk/segment/yaml-validator.js +1 -1
  160. package/dist/sdk/segment.js +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a51_0x467f12=a51_0x56f9;(function(_0xceb76b,_0x1e911a){const _0x43eabb=a51_0x56f9,_0x209e75=_0xceb76b();while(!![]){try{const _0x548da6=-parseInt(_0x43eabb(0x278))/0x1+-parseInt(_0x43eabb(0x31a))/0x2+parseInt(_0x43eabb(0x1b1))/0x3*(parseInt(_0x43eabb(0x214))/0x4)+parseInt(_0x43eabb(0x21f))/0x5+-parseInt(_0x43eabb(0x277))/0x6*(parseInt(_0x43eabb(0x26c))/0x7)+-parseInt(_0x43eabb(0x222))/0x8*(-parseInt(_0x43eabb(0x1ad))/0x9)+-parseInt(_0x43eabb(0x1b4))/0xa*(-parseInt(_0x43eabb(0x231))/0xb);if(_0x548da6===_0x1e911a)break;else _0x209e75['push'](_0x209e75['shift']());}catch(_0x14fe01){_0x209e75['push'](_0x209e75['shift']());}}}(a51_0xf6ba,0x6a7a1));import a51_0x221e70 from'chalk';import{existsSync}from'fs';import a51_0x5534f1 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a51_0xf6ba(){const _0x2ce8a0=['143gQTGRI','Project:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','start','window','workflows','MAX_TASKS_DISPLAY','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22\x20already\x20exists\x20(ID:\x20','includes','Retrying\x20session...','No\x20workflow\x20projects\x20found','running','No\x20workflows\x20found\x20in\x20project:\x20','project','parse','sort','description','List\x20workflow\x20execution\x20sessions','\x0aDry\x20run\x20-\x20no\x20files\x20written','skipValidation','durationMs','executePushProject','Loading\x20session...','stringify','Project\x20filter:\x20','params','error','isTTY','Select\x20a\x20workflow\x20to\x20run','getDate','workflow:delete','fullName','format','workflow:kill','done','execute','Pulling\x20project\x20','ICON_SPACING','New\x20project\x20name:\x20','Error:\x20Secret\x20key\x20is\x20required','green','Kill\x20a\x20running\x20attempt','startTime','startsWith','✔\x20Workflow\x20project\x20context\x20cleared.','...','\x20\x20Revision:\x20','existingProjectId','setSecret','---\x20','data','\x0a✔\x20Attempt\x20complete','get','workflow:sessions','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:timeline','basename','planned','7cQPwxa','\x20\x20Changes:\x20','length','site','msPerChar','Project\x20name:\x20','hasChanges','find','clear','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','→\x20New\x20project:\x20','599736MPAXJh','693281psvFww','Usage:\x20tdx\x20wf\x20use\x20<project>','Show\x20tasks\x20for\x20an\x20attempt','utf-8','Validation:\x20skipped','attemptId','Warning:','type','Filter:\x20','Analyzing\x20project...','Files\x20to\x20upload:\x20','Filter:\x20project=','taskName','✔\x20Found\x20','\x20\x20Session\x20ID:\x20',',\x20Workflow:\x20','modified','\x20-\x20','lastAttempt','Revision:\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','unknown','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20to\x20new\x20project\x20\x22','attempt','\x20deleted','\x20\x20Console:\x20','No\x20sessions\x20found','stat','log','yellow','workflow:attempt','✔\x20Project:\x20','Listing\x20workflow\x20sessions...','pullProject','List\x20workflows','session','\x20is\x20not\x20a\x20directory','indexOf','limit','MIN_LABEL_COUNT','Pushing\x20project...','Killing\x20attempt...','Project\x20directory:\x20','fs/promises','key','end','✔\x20Secret\x20\x27','No\x20workflow\x20tdx.json\x20found','new','targetExists','summary','session:','includeSubtasks','getTime','blue','cyan','jsonl','workflow:logs','dim','substring','→\x20Project:\x20','map','Downloading\x20logs...','Listing\x20workflow\x20attempts...','context','/attempt/','No\x20projects\x20match\x20pattern:\x20','displayLine','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','slice','renderSingleTimeline','\x20\x20New\x20attempt\x20ID:\x20','Listing\x20secrets...','\x20\x20Project:\x20','round','changes','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Key:\x20','index','icon','Retry\x20a\x20session\x20or\x20attempt','MIN_TIMELINE_WIDTH','\x20sessions\x20','newProjectId','navigateSessionsInteractive','match','localeCompare','Listing\x20workflows...','\x20task','MAX_TIMELINE_WIDTH','deleteSecret','workflow:run','Source\x20directory:\x20','workflow:retry','min','Source\x20directory\x20is\x20required','projectId','pending','\x20\x20Attempt\x20ID:\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','cwd','\x20secret','\x20unchanged','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20Showing\x20','splice','json','join','List\x20workflow\x20attempts','listSecrets','table','status','renderTimeline','delete','follow','Error:\x20Project\x20name\x20is\x20required','Attempt\x20ID:\x20','\x22\x20with\x20new\x20revision?','No\x20attempts\x20found\x20in\x20project:\x20','includeRetried','updatedAt','run','revision','Total:\x20','\x0a⚠\x20Project\x20\x22','\x22?\x20This\x20cannot\x20be\x20undone.','✔\x20Clone\x20complete','Workflow:\x20','\x20\x20Target:\x20','🔄\x20','param','sourceDir','select','workflow:workflows','set','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20Project\x20ID:\x20','trim','list','Analyzing\x20changes...','Resolving\x20project\x20\x27','yes','\x0a✔\x20Already\x20up\x20to\x20date','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','push','From\x20task:\x20','fill','Writing\x20files...','Error:\x20Attempt\x20ID\x20is\x20required','white','\x0aError:','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','No\x20attempts\x20found','applyPullProject','POLL_INTERVAL_MS','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','✔\x20Deleted\x20project\x20','workflowName','prepareCloneProject','relative','561370JHiNHA','rows','max','Session\x20not\x20found:\x20','Start\x20a\x20workflow\x20run','showWorkflowConsoleUrl','\x20\x20Session\x20context\x20set\x20to:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20new','sessions','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20workflows\x20found','\x20\x20Source:\x20','.\x20Expected\x20format:\x20KEY=VALUE','Source\x20project:\x20','Failed\x20to\x20fetch\x20attempt\x20data','dryRun','\x20\x20Location:\x20','pollTimeline','tdx\x20wf\x20attempt\x20','Project\x20name\x20is\x20required','filter','workflowProject','values','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','attempt:','isArray','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','has','success','verbose','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Force:\x20yes','\x0aFailed\x20to\x20fetch\x20attempt\x20data','projectName','Listing\x20workflow\x20projects...','\x20\x20Workflow:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','💡\x20Tip:\x20Use\x20','\x0aApply\x20these\x20changes?','\x1b[1A\x1b[2K','Fetching\x20log\x20files...','floor','\x20attempt','tdx.json','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','retryAttempt','diff','resumeFrom','readFile','\x0aClone\x20\x22','Task\x20name:\x20','265851RFkCVY','Attempt:\x20','sessionId','attempts','462tGeuqN','startedAt','toLowerCase','803420AswiOI','stdout','\x20of\x20','Status:\x20','from','buildTimelineData','kill','Pushing\x20workflow\x20project...','\x20to\x20see\x20detailed\x20logs','newProjectName','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','MAX_POLL_ITERATIONS','✔\x20Pushed\x20','No\x20log\x20content\x20found','Cancelled','duration','renderSessionsTimeline','parseProjectWorkflowPattern','retryAttemptName','getFullYear','Resume\x20from:\x20','Error:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20sessions\x20found\x20in\x20project:\x20','\x20(system)','Getting\x20attempt\x20tasks...','unchanged','(use\x20--limit\x20to\x20see\x20more)','Select\x20a\x20task\x20to\x20view\x20logs:','some','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','columns','Session\x20time:\x20','/sessions/','red','Downloading\x20project\x20','Updating\x20','name','state','\x0aPolling...\x20(','Tip:\x20cd\x20to\x20workflows/','createdAt','✔\x20Downloaded\x20','fileCount','padStart','sessionTime','cancelRequested','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','finishedAt','force','Select\x20a\x20session\x20to\x20view\x20timeline:','tasks','keys','Target:\x20','No\x20sessions\x20found\x20for:\x20','workflow:use','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','canceling','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','✔\x20Retry\x20started','\x20has\x20no\x20attempts','all','Source:\x20','-\x20nothing\x20pushed','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','✔\x20Workflow\x20project\x20set\x20to:\x20','now','resolveProjectDir','Dry\x20run:\x20yes','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:clone','output','\x27\x20from\x20project\x20\x27','GUTTER','No\x20attempts\x20found\x20for:\x20','workflow','sourceProjectName','No\x20matching\x20sessions\x20found','\x27...','Show\x20specific\x20attempt\x20details','group_error','task','\x0a✔\x20No\x20changes\x20to\x20push','retrySession','requireProject','preparePushProject','workflow:secrets:set','workflow:projects','Getting\x20attempt\x20details...','projects','title','workflow:download','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','\x0aPush\x20these\x20changes?','3520cFlnJz','generateSessionTimelineRows','Session\x20','autocomplete','message','No\x20workflow\x20sessions\x20found','/app/workflows/','Including\x20subtasks:\x20yes','size','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','resolve','25780FTgcgf','session_id','Setting\x20secret...','88UWRMjN','workflow:secrets:delete','write','repeat','split','resolveProject','✔\x20Push\x20complete','ICON_WIDTH','✔\x20Pull\x20complete','\x0aDry\x20run\x20-\x20no\x20project\x20created','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Output\x20directory:\x20','Starting\x20workflow\x20run...','Latest\x20session\x20has\x20no\x20attempt','toISOString'];a51_0xf6ba=function(){return _0x2ce8a0;};return a51_0xf6ba();}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 a51_0x59e223 from'prompts';function getAttemptStatusDisplay(_0x3d78da){const _0x6dd222=a51_0x56f9;if(!_0x3d78da)return{'icon':'⏳','text':''};const {done:_0x2dc84e,success:_0x4ebde9,cancelRequested:_0x2fc6a1}=_0x3d78da;if(!_0x2dc84e)return _0x2fc6a1?{'icon':'🛑','text':a51_0x221e70[_0x6dd222(0x296)]('canceling')}:{'icon':'🔄','text':a51_0x221e70[_0x6dd222(0x2af)]('running')};if(_0x4ebde9)return{'icon':'✅','text':a51_0x221e70[_0x6dd222(0x25a)](_0x6dd222(0x194))};return{'icon':'❌','text':a51_0x221e70[_0x6dd222(0x1d8)](_0x6dd222(0x24c))};}export class WorkflowBaseCommand extends BaseCommand{[a51_0x467f12(0x227)](_0x2cf2dd,_0x4d37da,_0x262f08=0x0){return _0x2cf2dd[_0x262f08]||_0x4d37da['workflowProject'];}[a51_0x467f12(0x20a)](_0x3bb82e,_0x1c28e7,_0x36db4d=0x0){const _0x2f1b73=a51_0x467f12,_0x36f96a=this[_0x2f1b73(0x227)](_0x3bb82e,_0x1c28e7,_0x36db4d);if(!_0x36f96a)return console[_0x2f1b73(0x24c)](a51_0x221e70[_0x2f1b73(0x1d8)](_0x2f1b73(0x1cb)),_0x2f1b73(0x32e)),console[_0x2f1b73(0x24c)](a51_0x221e70[_0x2f1b73(0x2b3)](_0x2f1b73(0x1a5))),null;return _0x36f96a;}[a51_0x467f12(0x1c7)](_0x435fb6,_0x24bd88){const _0x36fafd=a51_0x467f12;if(_0x435fb6[0x0]){const _0xbcbdab=_0x435fb6[0x0][_0x36fafd(0x226)]('.');if(_0xbcbdab[_0x36fafd(0x26e)]===0x1)return{'projectName':_0xbcbdab[0x0],'workflowName':undefined};else return _0xbcbdab[_0x36fafd(0x26e)]===0x2?{'projectName':_0xbcbdab[0x0],'workflowName':_0xbcbdab[0x1]}:(console['error'](a51_0x221e70[_0x36fafd(0x1d8)]('Error:'),_0x36fafd(0x196)),null);}return{'projectName':_0x24bd88[_0x36fafd(0x330)],'workflowName':undefined};}[a51_0x467f12(0x1f9)](_0x48cff8,_0x1c5fd2,_0x430547=0x0){const _0x1dc6bc=a51_0x467f12;if(_0x48cff8[_0x430547])return _0x48cff8[_0x430547];if(_0x1c5fd2['workflowProject']){const _0x54755d=a51_0x5534f1[_0x1dc6bc(0x2e4)](process[_0x1dc6bc(0x2dd)](),_0x1dc6bc(0x236),_0x1c5fd2[_0x1dc6bc(0x330)]);if(existsSync(a51_0x5534f1[_0x1dc6bc(0x2e4)](_0x54755d,_0x1dc6bc(0x1a3))))return _0x54755d;}return undefined;}async[a51_0x467f12(0x31f)](_0x602945,_0xf7b1af,_0x2a614f){const _0x149ada=a51_0x467f12;try{const _0x51a196=await _0x602945[_0x149ada(0x201)]['workflows'](_0xf7b1af,{'limit':0x1});if(_0x51a196[_0x149ada(0x26e)]>0x0){const _0x44fe5e=_0x51a196[0x0]['id'],_0x2397a9=getWorkflowUrl(_0x2a614f,_0x44fe5e);console['error'](_0x149ada(0x292)+a51_0x221e70['cyan'](_0x2397a9));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x1ed);['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x36038a){const _0x3b1e6d=a51_0x467f12,{options:_0x59fe94,args:_0x248574,tdx:_0x3a7a8f}=_0x36038a,_0x602a69=_0x248574[0x0],_0x379e73=_0x59fe94[_0x3b1e6d(0x274)];if(_0x379e73)return saveSessionContext({'workflow_project':undefined},_0x59fe94[_0x3b1e6d(0x29c)]),console['log'](a51_0x221e70[_0x3b1e6d(0x25a)](_0x3b1e6d(0x25e))),0x0;if(!_0x602a69)return console['error'](a51_0x221e70[_0x3b1e6d(0x1d8)](_0x3b1e6d(0x1cb)),_0x3b1e6d(0x32e)),console['error'](a51_0x221e70['dim'](_0x3b1e6d(0x279))),console[_0x3b1e6d(0x24c)](a51_0x221e70['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x3127c4=await withSpinner(_0x3b1e6d(0x306)+_0x602a69+_0x3b1e6d(0x204),()=>_0x3a7a8f[_0x3b1e6d(0x201)]['resolveProjectId'](_0x602a69),{'verbose':_0x59fe94[_0x3b1e6d(0x195)]}),{name:_0x5e62c9}=_0x3127c4[_0x3b1e6d(0x264)];return saveSessionContext({'workflow_project':_0x5e62c9},_0x59fe94[_0x3b1e6d(0x29c)]),console['log'](a51_0x221e70['green'](_0x3b1e6d(0x1f7)+a51_0x221e70['cyan'](_0x5e62c9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x20d);[a51_0x467f12(0x242)]='List\x20all\x20workflow\x20projects';async[a51_0x467f12(0x255)](_0x420644){const _0x48f3e5=a51_0x467f12,{options:_0x1b9504,args:_0x595e22,tdx:_0x490fce}=_0x420644,_0x13c43f=_0x595e22[0x0];_0x1b9504[_0x48f3e5(0x195)]&&_0x13c43f&&console[_0x48f3e5(0x24c)]('Pattern:\x20'+_0x13c43f);const _0x3ec4f5=await withSpinner(_0x48f3e5(0x19a),()=>_0x490fce['workflow'][_0x48f3e5(0x20f)](_0x13c43f,{'limit':_0x1b9504[_0x48f3e5(0x29f)]}),{'verbose':_0x1b9504['verbose']});let _0x4abad2=_0x3ec4f5['data'];_0x4abad2[_0x48f3e5(0x241)]((_0x169b50,_0x5c4cf8)=>_0x169b50['name'][_0x48f3e5(0x2cf)](_0x5c4cf8['name']));const _0x268fc8=_0x1b9504[_0x48f3e5(0x29f)]||0x64,_0x9d8504=_0x4abad2[_0x48f3e5(0x26e)]>=_0x268fc8?a51_0x221e70[_0x48f3e5(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x48f3e5(0x24c)](_0x48f3e5(0x285)+_0x4abad2[_0x48f3e5(0x26e)]+'\x20project'+(_0x4abad2[_0x48f3e5(0x26e)]!==0x1?'s':'')+_0x9d8504);if(_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2e3)||_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2b1)||_0x1b9504[_0x48f3e5(0x252)]===_0x48f3e5(0x2e7))await handleSDKOutput(_0x4abad2,_0x1b9504);else{if(_0x4abad2[_0x48f3e5(0x26e)]===0x0)_0x13c43f?console['log'](_0x48f3e5(0x2bb)+_0x13c43f):console['log'](_0x48f3e5(0x23c));else{const _0x3e2984=_0x4abad2[_0x48f3e5(0x2b6)](_0x2664fc=>{const _0x3d4e3c=_0x48f3e5,_0x4ba335=_0x2664fc['metadata']?.[_0x3d4e3c(0x1d3)](_0x2e224e=>_0x2e224e[_0x3d4e3c(0x2a5)]==='sys'),_0xcb5bab=_0x4ba335?a51_0x221e70['dim'](_0x3d4e3c(0x1ce)):'';return'📁\x20'+_0x2664fc[_0x3d4e3c(0x1db)]+_0xcb5bab;});await writeOutput(_0x3e2984[_0x48f3e5(0x2e4)]('\x0a'),_0x1b9504[_0x48f3e5(0x1fd)],_0x48f3e5(0x304));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x2fe);['description']=a51_0x467f12(0x29b);async[a51_0x467f12(0x255)](_0x427d74){const _0x3a104c=a51_0x467f12,{options:_0x16bf86,args:_0x2bb3c8,tdx:_0x261a0e}=_0x427d74,_0x40d7e9=this[_0x3a104c(0x227)](_0x2bb3c8,_0x16bf86);_0x16bf86['verbose']&&_0x40d7e9&&console[_0x3a104c(0x24c)](_0x3a104c(0x24a)+_0x40d7e9);const _0x3b8067=await withSpinner(_0x3a104c(0x2d0),()=>_0x261a0e[_0x3a104c(0x201)][_0x3a104c(0x236)](_0x40d7e9,{'limit':_0x16bf86[_0x3a104c(0x29f)]}),{'verbose':_0x16bf86[_0x3a104c(0x195)]});let _0x382eba=_0x3b8067[_0x3a104c(0x264)];_0x382eba[_0x3a104c(0x241)]((_0x215f63,_0x3ea009)=>{const _0x51a93e=_0x3a104c,_0x2b9a11=_0x215f63[_0x51a93e(0x1db)]['localeCompare'](_0x3ea009['name']);if(_0x2b9a11!==0x0)return _0x2b9a11;return(_0x215f63['project']?.[_0x51a93e(0x1db)]||'')[_0x51a93e(0x2cf)](_0x3ea009['project']?.[_0x51a93e(0x1db)]||'');});const _0x546ee9=_0x16bf86[_0x3a104c(0x29f)]||0x64,_0x51033e=_0x382eba[_0x3a104c(0x26e)]>=_0x546ee9?a51_0x221e70[_0x3a104c(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x3a104c(0x24c)](_0x3a104c(0x285)+_0x382eba[_0x3a104c(0x26e)]+'\x20workflow'+(_0x382eba[_0x3a104c(0x26e)]!==0x1?'s':'')+_0x51033e);if(_0x16bf86[_0x3a104c(0x252)]===_0x3a104c(0x2e3)||_0x16bf86['format']===_0x3a104c(0x2b1)||_0x16bf86['format']===_0x3a104c(0x2e7))await handleSDKOutput(_0x382eba,_0x16bf86);else{if(_0x382eba[_0x3a104c(0x26e)]===0x0)_0x40d7e9?console[_0x3a104c(0x295)](_0x3a104c(0x23e)+_0x40d7e9):console[_0x3a104c(0x295)](_0x3a104c(0x325));else{const _0x34fa17=_0x16bf86[_0x3a104c(0x26f)],_0x52b65c=_0x382eba['map'](_0x3c6fc5=>{const _0x226593=_0x3a104c,_0x2099b2=a51_0x221e70[_0x226593(0x2b3)]('#'+_0x3c6fc5['id']),_0x44e231=hyperlink(_0x2099b2,getWorkflowUrl(_0x34fa17,_0x3c6fc5['id'])),_0xe98f4c=_0x3c6fc5[_0x226593(0x23f)]?.['name']?a51_0x221e70['dim']('\x20('+_0x3c6fc5[_0x226593(0x23f)][_0x226593(0x1db)]+')'):'';return'📋\x20'+_0x44e231+'\x20'+_0x3c6fc5[_0x226593(0x1db)]+_0xe98f4c;});await writeOutput(_0x52b65c[_0x3a104c(0x2e4)]('\x0a'),_0x16bf86[_0x3a104c(0x1fd)],_0x3a104c(0x304));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x267);[a51_0x467f12(0x242)]=a51_0x467f12(0x243);async[a51_0x467f12(0x255)](_0x1aec0c){const _0x38efab=a51_0x467f12,{options:_0x377413,args:_0x127c57,tdx:_0x31d2db}=_0x1aec0c,_0x1fa47d=this[_0x38efab(0x1c7)](_0x127c57,_0x377413);if(!_0x1fa47d)return 0x1;const {projectName:_0x88bb3,workflowName:_0xd1114a}=_0x1fa47d;if(_0x377413[_0x38efab(0x195)]){if(_0x88bb3&&_0xd1114a)console['error'](_0x38efab(0x280)+_0x88bb3+'.'+_0xd1114a);else _0x88bb3&&console[_0x38efab(0x24c)](_0x38efab(0x283)+_0x88bb3);const _0x4be621=_0x377413['status'];_0x4be621&&console[_0x38efab(0x24c)](_0x38efab(0x1b7)+_0x4be621);}let _0x29d341=0x28;if(process['stdout'][_0x38efab(0x24d)]&&!_0x377413['output']&&!_0x377413[_0x38efab(0x252)]){const _0x38feec=process[_0x38efab(0x1b5)][_0x38efab(0x31b)]||0x28;_0x29d341=Math[_0x38efab(0x31c)](0x14,Math['floor'](_0x38feec*0x2/0x3));}const _0x18982b=_0x377413[_0x38efab(0x29f)]||_0x29d341,_0x5ac2ce=await withSpinner(_0x38efab(0x299),()=>_0x31d2db[_0x38efab(0x201)][_0x38efab(0x323)]({'projectName':_0x88bb3,'workflowName':_0xd1114a,'status':_0x377413[_0x38efab(0x2e8)],'fromTime':_0x377413[_0x38efab(0x1b8)],'toTime':_0x377413['to'],'limit':_0x18982b}),{'verbose':_0x377413[_0x38efab(0x195)]}),_0x45844e=_0x5ac2ce[_0x38efab(0x264)];_0x45844e[_0x38efab(0x241)]((_0x45ec36,_0x1ca32b)=>{const _0x38f185=_0x38efab,_0x5b940f=_0x45ec36[_0x38f185(0x1e3)]||'',_0x8375b5=_0x1ca32b[_0x38f185(0x1e3)]||'';return _0x8375b5[_0x38f185(0x2cf)](_0x5b940f);});_0x45844e[_0x38efab(0x26e)]>=_0x18982b?console[_0x38efab(0x24c)](_0x38efab(0x2e1)+_0x45844e['length']+_0x38efab(0x2cb)+a51_0x221e70['dim'](_0x38efab(0x1d1))):console[_0x38efab(0x24c)](_0x38efab(0x285)+_0x45844e[_0x38efab(0x26e)]+'\x20session'+(_0x45844e[_0x38efab(0x26e)]!==0x1?'s':''));if(_0x377413[_0x38efab(0x252)]==='json'||_0x377413[_0x38efab(0x252)]===_0x38efab(0x2b1)||_0x377413['format']===_0x38efab(0x2e7))await handleSDKOutput(_0x45844e,_0x377413);else{if(!process[_0x38efab(0x1b5)][_0x38efab(0x24d)]||_0x377413[_0x38efab(0x1fd)]){if(_0x45844e[_0x38efab(0x26e)]===0x0){if(_0x88bb3&&_0xd1114a)console[_0x38efab(0x295)](_0x38efab(0x1ec)+_0x88bb3+'.'+_0xd1114a);else _0x88bb3?console[_0x38efab(0x295)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x88bb3):console[_0x38efab(0x295)](_0x38efab(0x293));}else{const _0x4b2eef=_0x377413[_0x38efab(0x26f)],_0x1c204d=this[_0x38efab(0x1c6)](_0x45844e,_0x4b2eef);_0x377413[_0x38efab(0x1fd)]?await writeOutput(_0x1c204d,_0x377413[_0x38efab(0x1fd)],_0x38efab(0x304)):console['log'](_0x1c204d);}!_0x88bb3&&(console[_0x38efab(0x24c)](''),console[_0x38efab(0x24c)](a51_0x221e70[_0x38efab(0x2b3)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a51_0x221e70[_0x38efab(0x2b3)](_0x38efab(0x301))+'or'+a51_0x221e70[_0x38efab(0x2b3)]('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x45844e[_0x38efab(0x26e)]===0x0){if(_0x88bb3&&_0xd1114a)console[_0x38efab(0x295)]('No\x20sessions\x20found\x20for:\x20'+_0x88bb3+'.'+_0xd1114a);else _0x88bb3?console[_0x38efab(0x295)](_0x38efab(0x1cd)+_0x88bb3):console['log'](_0x38efab(0x293));}else await this['navigateSessionsInteractive'](_0x45844e,_0x1aec0c,_0x88bb3);}}return 0x0;}[a51_0x467f12(0x1c6)](_0xa966a3,_0x128492){const _0x4df439=a51_0x467f12,_0x1f1643=[],_0x13550e=new Map();let _0x2f3c71=Infinity,_0x3d9bf7=-Infinity;for(const _0x5b230d of _0xa966a3){if(_0x5b230d['lastAttempt']?.[_0x4df439(0x1df)]){const _0xfd2348=new Date(_0x5b230d['lastAttempt'][_0x4df439(0x1df)])[_0x4df439(0x2ae)](),_0x1c2e45=_0x5b230d[_0x4df439(0x28a)]['finishedAt']?new Date(_0x5b230d[_0x4df439(0x28a)][_0x4df439(0x1e6)])['getTime']():Date['now'](),_0x400dd0=_0x5b230d[_0x4df439(0x23f)]?.['name']||'(unknown)';!_0x13550e[_0x4df439(0x193)](_0x400dd0)&&_0x13550e[_0x4df439(0x2ff)](_0x400dd0,[]),_0x13550e[_0x4df439(0x266)](_0x400dd0)[_0x4df439(0x30a)]({'session':_0x5b230d,'startTime':_0xfd2348,'endTime':_0x1c2e45,'duration':_0x1c2e45-_0xfd2348}),_0x2f3c71=Math[_0x4df439(0x2d7)](_0x2f3c71,_0xfd2348),_0x3d9bf7=Math[_0x4df439(0x31c)](_0x3d9bf7,_0x1c2e45);}}if(_0x13550e[_0x4df439(0x21c)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x1a169d=process[_0x4df439(0x1b5)][_0x4df439(0x1d5)]||0x78,_0x111d44=0x1e,_0x5e31af=0x32,_0x572dc8=0x4,_0x52c990=Math[_0x4df439(0x2d7)](_0x5e31af,Math[_0x4df439(0x31c)](_0x111d44,Math['floor'](_0x1a169d*0.3))),_0x32c71d=_0x1a169d-_0x52c990-TIMELINE_CONFIG[_0x4df439(0x1ff)]-0x3-_0x572dc8,_0xe4648b=_0x3d9bf7-_0x2f3c71,_0x21b5f4=_0xe4648b/_0x52c990,_0x3cfafd=renderTimeAxis({'startTime':_0x2f3c71,'endTime':_0x3d9bf7,'durationMs':_0xe4648b,'msPerChar':_0x21b5f4},_0x52c990),_0x1904f4=[];for(const _0x30b884 of _0x13550e[_0x4df439(0x331)]()){_0x1904f4[_0x4df439(0x30a)](..._0x30b884);}_0x1904f4[_0x4df439(0x241)]((_0x51d42d,_0x4bf58b)=>_0x4bf58b[_0x4df439(0x25c)]-_0x51d42d['startTime']);const _0x1765d8=new Date(_0x2f3c71),_0xa60809=formatDate(_0x1765d8),_0x5a59ee=_0x572dc8+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x4df439(0x257)]+_0x32c71d,_0x5bdbd6='\x20'[_0x4df439(0x225)](_0x5a59ee-_0xa60809['length']),_0x3075b4=_0x5bdbd6+a51_0x221e70[_0x4df439(0x2b3)](_0xa60809)+'\x20'+_0x3cfafd;_0x1f1643[_0x4df439(0x30a)](_0x3075b4);const _0x44b5b4=0x16;let _0x7e7279=0x0;for(const _0x3dde08 of _0x1904f4){const _0x531d0d=_0x3dde08['session'][_0x4df439(0x23f)]?.[_0x4df439(0x1db)]||'?',_0x371f2e=Math[_0x4df439(0x2d7)](stringWidth(_0x531d0d),_0x44b5b4);_0x7e7279=Math['max'](_0x7e7279,_0x371f2e);}for(const _0x30d398 of _0x1904f4){const {session:_0x566252,startTime:_0x181e03,endTime:_0x3b106a,duration:_0x4cb1e2}=_0x30d398,_0x1aa534=_0x566252[_0x4df439(0x23f)]?.['id'],_0xe7b2e0=_0x566252['id'],_0x19d4f6=_0x566252[_0x4df439(0x23f)]?.[_0x4df439(0x1db)]||'?',_0x3cd3a3=_0x566252['workflow']?.[_0x4df439(0x1db)]||'?';let _0x2ce840,_0x216558;if(_0x566252[_0x4df439(0x28a)]){const _0x3154ae=_0x566252[_0x4df439(0x28a)];!_0x3154ae[_0x4df439(0x254)]?(_0x2ce840=_0x3154ae['cancelRequested']?'🛑':'🔄',_0x216558=_0x3154ae['cancelRequested']?a51_0x221e70['yellow']:a51_0x221e70['blue']):(_0x2ce840=_0x3154ae[_0x4df439(0x194)]?'✅':'❌',_0x216558=_0x3154ae[_0x4df439(0x194)]?a51_0x221e70[_0x4df439(0x25a)]:a51_0x221e70[_0x4df439(0x1d8)]);}else _0x2ce840='⏳',_0x216558=a51_0x221e70[_0x4df439(0x2b3)];const _0x4b0084='#'+_0xe7b2e0,_0x55c7b0=_0x1aa534?hyperlink(_0x4b0084,getWorkflowSessionUrl(_0x128492,_0x1aa534,_0xe7b2e0)):_0x4b0084;let _0x69c5b=_0x19d4f6;stringWidth(_0x19d4f6)>_0x44b5b4&&(_0x69c5b=_0x19d4f6[_0x4df439(0x2be)](0x0,_0x44b5b4-0x1)+'…');const _0x1dc55e=a51_0x221e70['dim'](_0x69c5b),_0x4601f3=stringWidth(_0x69c5b),_0x859cfb='\x20'[_0x4df439(0x225)](_0x7e7279-stringWidth(_0x69c5b)+0x2),_0x556984='('+formatElapsed(_0x4cb1e2)+')',_0x215b6c=stringWidth(_0x556984),_0x1d8fc3=stringWidth(_0x4b0084),_0x29d114=_0x1d8fc3+0x1+_0x4601f3+_0x859cfb[_0x4df439(0x26e)],_0x2c7828=_0x32c71d-_0x29d114-_0x215b6c-0x1-0x8;let _0x52dac0=_0x3cd3a3;stringWidth(_0x52dac0)>_0x2c7828&&(_0x52dac0=_0x52dac0[_0x4df439(0x2be)](0x0,_0x2c7828-0x1)+'…');const _0x36cfbf=_0x55c7b0+'\x20'+_0x1dc55e+_0x859cfb+_0x52dac0,_0x5bd3d7=stringWidth(_0x36cfbf),_0x32628d=_0x32c71d-_0x5bd3d7-_0x215b6c,_0x1d7446=_0x36cfbf+'\x20'[_0x4df439(0x225)](Math[_0x4df439(0x31c)](0x1,_0x32628d))+a51_0x221e70[_0x4df439(0x2b3)](_0x556984),_0x4db779=Math[_0x4df439(0x1a1)]((_0x181e03-_0x2f3c71)/_0x21b5f4),_0x54ac2f=Math[_0x4df439(0x1a1)]((_0x3b106a-_0x2f3c71)/_0x21b5f4),_0x2e5b25=Math['max'](_0x4db779+0x1,_0x54ac2f),_0x5b6229=new Array(_0x52c990)[_0x4df439(0x30c)]('\x20');for(let _0x2ab180=_0x4db779;_0x2ab180<Math[_0x4df439(0x2d7)](_0x2e5b25,_0x52c990);_0x2ab180++){_0x5b6229[_0x2ab180]='─';}const _0x41b875=_0x5b6229[_0x4df439(0x2b6)](_0x5b636c=>_0x5b636c==='\x20'?'\x20':_0x216558(_0x5b636c))[_0x4df439(0x2e4)]('');_0x1f1643[_0x4df439(0x30a)](_0x2ce840+'\x20'+_0x1d7446+'│'+_0x41b875+'│');}return _0x1f1643[_0x4df439(0x2e4)]('\x0a');}async[a51_0x467f12(0x2cd)](_0x1d4ff4,_0x425c30,_0x3f6b1b){const _0x5ed0e6=a51_0x467f12,{options:_0x3ad489,tdx:_0x1e3294}=_0x425c30,_0xd61b7=_0x3ad489['site'],{timelineRows:_0x40b87b,timeAxisHeader:_0xc609e0}=this['generateSessionTimelineRows'](_0x1d4ff4,_0xd61b7),_0xa65e92=_0x40b87b[_0x5ed0e6(0x32f)](_0x55d6f0=>_0x55d6f0['attemptId']);if(_0xa65e92['length']===0x0){const _0xa1e642=this[_0x5ed0e6(0x1c6)](_0x1d4ff4,_0xd61b7);console[_0x5ed0e6(0x295)](_0xa1e642);!_0x3f6b1b&&(console['error'](''),console[_0x5ed0e6(0x24c)](a51_0x221e70['dim'](_0x5ed0e6(0x22c))),console[_0x5ed0e6(0x24c)](a51_0x221e70['dim'](_0x5ed0e6(0x301))+'or'+a51_0x221e70[_0x5ed0e6(0x2b3)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xc609e0&&console[_0x5ed0e6(0x295)](_0xc609e0);const _0x31a752=_0x40b87b[_0x5ed0e6(0x32f)](_0x4dbfc6=>_0x4dbfc6['attemptId'])['map'](_0x3683ea=>({'title':_0x3683ea[_0x5ed0e6(0x2bc)],'value':_0x3683ea[_0x5ed0e6(0x27d)]})),_0x503c00=process['stdout']['rows']||0x3c,_0x2778a3=Math[_0x5ed0e6(0x31c)](0x28,Math['floor'](_0x503c00*0x2/0x3)),_0x1c2963=await a51_0x59e223({'type':_0x5ed0e6(0x217),'name':_0x5ed0e6(0x27d),'message':_0x5ed0e6(0x1cc),'choices':_0x31a752,'initial':-0x1,'limit':_0x2778a3,'clearFirst':!![],'fallback':{'title':_0x5ed0e6(0x203),'value':null},'suggest':(_0x1a2097,_0x5bba33)=>{const _0x539d8e=_0x5ed0e6;if(!_0x1a2097)return Promise[_0x539d8e(0x21e)](_0x5bba33);const _0x4c867f=_0x5bba33[_0x539d8e(0x32f)](_0x2d53db=>{const _0x562128=_0x539d8e,_0x59e71e=_0x2d53db;return _0x59e71e[_0x562128(0x210)][_0x562128(0x1b3)]()[_0x562128(0x23a)](_0x1a2097['toLowerCase']());});return Promise[_0x539d8e(0x21e)](_0x4c867f);}}),_0x109959=()=>{const _0x11ad77=_0x5ed0e6;process['stdout'][_0x11ad77(0x224)]('\x1b[1A\x1b[2K'),process[_0x11ad77(0x1b5)]['write'](_0x11ad77(0x19f)),process[_0x11ad77(0x1b5)][_0x11ad77(0x224)](_0x11ad77(0x19f));},_0x2e80dc=_0x1c2963&&_0x1c2963[_0x5ed0e6(0x27d)]&&_0x1c2963['attemptId']!==null&&_0x1c2963[_0x5ed0e6(0x27d)][_0x5ed0e6(0x303)]()!=='';if(!_0x2e80dc){_0x109959(),console[_0x5ed0e6(0x295)](a51_0x221e70[_0x5ed0e6(0x2b3)]('Cancelled'));return;}_0x109959();const _0x1f22d9=_0x1d4ff4['find'](_0x472879=>_0x472879[_0x5ed0e6(0x28a)]?.['id']===_0x1c2963[_0x5ed0e6(0x27d)]);if(_0x1f22d9){const _0x5c7f20=_0x1f22d9['project']?.[_0x5ed0e6(0x1db)]||'?',_0x1aeb03=_0x1f22d9['workflow']?.[_0x5ed0e6(0x1db)]||'?';console[_0x5ed0e6(0x295)](_0x5ed0e6(0x232)+a51_0x221e70[_0x5ed0e6(0x2b3)](_0x5c7f20)+_0x5ed0e6(0x287)+a51_0x221e70[_0x5ed0e6(0x2b3)](_0x1aeb03));}const _0x103744=new WorkflowTimelineCommand();await _0x103744[_0x5ed0e6(0x255)]({'args':[],'options':{..._0x3ad489,'attemptId':_0x1c2963['attemptId']},'tdx':_0x1e3294});}[a51_0x467f12(0x215)](_0x20d10d,_0xca40a7){const _0x377621=a51_0x467f12,_0x3b46be=new Map();for(const _0x34f63d of _0x20d10d){_0x34f63d['id']&&_0x34f63d['lastAttempt']?.['id']&&_0x3b46be[_0x377621(0x2ff)](_0x34f63d['id'],_0x34f63d[_0x377621(0x28a)]['id']);}const _0x2fcd5a=[];let _0x34a941='';const _0x32b488=this[_0x377621(0x1c6)](_0x20d10d,_0xca40a7),_0x19814a=_0x32b488['split']('\x0a');for(const _0x5a9592 of _0x19814a){if(_0x5a9592[_0x377621(0x25d)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x5a9592[_0x377621(0x2ce)](/^\s+\d{4}-\d{2}-\d{2}/))_0x34a941=_0x5a9592;else{if(_0x5a9592[_0x377621(0x2ce)](/^[✅❌🔄🛑⏳]/)){const _0x7eb204=_0x5a9592[_0x377621(0x2ce)](/#(\d+)/),_0x547985=_0x7eb204?_0x7eb204[0x1]:null,_0x77849f=_0x547985?_0x3b46be[_0x377621(0x266)](_0x547985)||null:null,_0x4af2f1=_0x20d10d[_0x377621(0x273)](_0x1d01c6=>_0x1d01c6['id']===_0x547985),_0x1b5f28=_0x4af2f1?.[_0x377621(0x23f)]?.[_0x377621(0x1db)]||'';_0x2fcd5a['push']({'displayLine':_0x5a9592,'attemptId':_0x77849f,'projectName':_0x1b5f28});}}}return{'timelineRows':_0x2fcd5a,'timeAxisHeader':_0x34a941};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';['description']=a51_0x467f12(0x2e5);async[a51_0x467f12(0x255)](_0x36f244){const _0x1b4b78=a51_0x467f12,{options:_0x42b770,args:_0x39c2f8,tdx:_0x25095e}=_0x36f244,_0x4e233b=this[_0x1b4b78(0x1c7)](_0x39c2f8,_0x42b770);if(!_0x4e233b)return 0x1;const {projectName:_0x3ec361,workflowName:_0x5c8e52}=_0x4e233b,_0x5d8ba3=_0x42b770[_0x1b4b78(0x2f0)];if(_0x42b770[_0x1b4b78(0x195)]){if(_0x3ec361&&_0x5c8e52)console[_0x1b4b78(0x24c)](_0x1b4b78(0x280)+_0x3ec361+'.'+_0x5c8e52);else _0x3ec361&&console[_0x1b4b78(0x24c)]('Filter:\x20project='+_0x3ec361);_0x5d8ba3&&console[_0x1b4b78(0x24c)]('Include\x20retried:\x20yes');}const _0x53f7ed=await withSpinner(_0x1b4b78(0x2b8),()=>_0x25095e['workflow'][_0x1b4b78(0x1b0)]({'projectName':_0x3ec361,'workflowName':_0x5c8e52,'includeRetried':_0x5d8ba3,'limit':_0x42b770[_0x1b4b78(0x29f)]}),{'verbose':_0x42b770['verbose']}),_0x185c49=_0x53f7ed[_0x1b4b78(0x264)],_0x2c0647=_0x42b770[_0x1b4b78(0x29f)]||0x64,_0x1c9625=_0x185c49[_0x1b4b78(0x26e)]>=_0x2c0647?a51_0x221e70[_0x1b4b78(0x2b3)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x1b4b78(0x24c)](_0x1b4b78(0x285)+_0x185c49['length']+_0x1b4b78(0x1a2)+(_0x185c49['length']!==0x1?'s':'')+_0x1c9625);if(_0x42b770['format']===_0x1b4b78(0x2e3)||_0x42b770['format']==='jsonl'||_0x42b770[_0x1b4b78(0x252)]===_0x1b4b78(0x2e7))await handleSDKOutput(_0x185c49,_0x42b770);else{if(_0x185c49['length']===0x0){if(_0x3ec361&&_0x5c8e52)console['log'](_0x1b4b78(0x200)+_0x3ec361+'.'+_0x5c8e52);else _0x3ec361?console[_0x1b4b78(0x295)](_0x1b4b78(0x2ef)+_0x3ec361):console[_0x1b4b78(0x295)](_0x1b4b78(0x312));}else{const _0x2017b3=_0x42b770[_0x1b4b78(0x26f)],_0x244646=_0x185c49['map'](_0x3b4fcf=>{const _0x41a023=_0x1b4b78,_0x1f8f59=a51_0x221e70[_0x41a023(0x2b3)]('#'+_0x3b4fcf['id']),_0x50385c=_0x3b4fcf[_0x41a023(0x23f)]?.['id'],_0x31faab=_0x3b4fcf[_0x41a023(0x220)]||_0x3b4fcf[_0x41a023(0x1af)],_0x2a157d=_0x50385c&&_0x31faab?hyperlink(_0x1f8f59,getWorkflowAttemptUrl(_0x2017b3,_0x50385c,_0x31faab,_0x3b4fcf['id'])):_0x1f8f59,{icon:_0x5bdd1a,text:_0x3c0dbc}=getAttemptStatusDisplay(_0x3b4fcf),_0x7d42bb=(_0x3b4fcf['project']?.[_0x41a023(0x1db)]||'?')+'.'+(_0x3b4fcf[_0x41a023(0x201)]?.[_0x41a023(0x1db)]||'?'),_0x34219e=_0x3b4fcf['sessionTime']?a51_0x221e70['dim'](_0x3b4fcf[_0x41a023(0x1e3)]):'';return(_0x2a157d+'\x20'+_0x5bdd1a+(_0x3c0dbc?'\x20'+_0x3c0dbc:'')+'\x20'+_0x7d42bb+'\x20'+_0x34219e)['trimEnd']();});await writeOutput(_0x244646[_0x1b4b78(0x2e4)]('\x0a'),_0x42b770[_0x1b4b78(0x1fd)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x297);[a51_0x467f12(0x242)]=a51_0x467f12(0x205);async[a51_0x467f12(0x255)](_0x42bf27){const _0x54a883=a51_0x467f12,{options:_0x499c4d,args:_0x5899b3,tdx:_0x18cc11}=_0x42bf27,_0x598b07=_0x5899b3[0x0];if(!_0x598b07)return console[_0x54a883(0x24c)](_0x54a883(0x30e)),0x1;_0x499c4d['verbose']&&console['error'](_0x54a883(0x2ed)+_0x598b07);const _0x32ed5f=await withSpinner(_0x54a883(0x20e),()=>_0x18cc11[_0x54a883(0x201)][_0x54a883(0x290)](_0x598b07),{'verbose':_0x499c4d[_0x54a883(0x195)]}),_0x48ae5d=_0x32ed5f['data'];let _0x459a9a;!_0x48ae5d[_0x54a883(0x254)]?_0x459a9a=_0x48ae5d[_0x54a883(0x1e4)]?_0x54a883(0x1ef):_0x54a883(0x23d):_0x459a9a=_0x48ae5d['success']?_0x54a883(0x194):_0x54a883(0x24c);let _0x5d2f95;if(_0x48ae5d['createdAt']&&_0x48ae5d['finishedAt']){const _0x493924=new Date(_0x48ae5d['createdAt'])[_0x54a883(0x2ae)](),_0x32ba86=new Date(_0x48ae5d[_0x54a883(0x1e6)])[_0x54a883(0x2ae)]();_0x5d2f95=Math[_0x54a883(0x2c3)]((_0x32ba86-_0x493924)/0x3e8);}const _0x300a8b={'attempt_id':_0x48ae5d['id'],'status':_0x459a9a,..._0x48ae5d[_0x54a883(0x2c7)]!==undefined&&{'index':_0x48ae5d[_0x54a883(0x2c7)]},..._0x48ae5d[_0x54a883(0x23f)]&&{'project':_0x48ae5d[_0x54a883(0x23f)]['name']},..._0x48ae5d['workflow']&&{'workflow':_0x48ae5d[_0x54a883(0x201)]['name']},..._0x48ae5d['sessionId']&&{'session_id':_0x48ae5d['sessionId']},..._0x48ae5d['sessionTime']&&{'session_time':_0x48ae5d[_0x54a883(0x1e3)]},..._0x48ae5d[_0x54a883(0x1c8)]&&{'retry_attempt':_0x48ae5d['retryAttemptName']},..._0x5d2f95!==undefined&&{'duration_sec':_0x5d2f95},..._0x48ae5d[_0x54a883(0x1df)]&&{'created_at':_0x48ae5d['createdAt']},..._0x48ae5d[_0x54a883(0x1e6)]&&{'finished_at':_0x48ae5d[_0x54a883(0x1e6)]},...Object[_0x54a883(0x1ea)](_0x48ae5d['params'])[_0x54a883(0x26e)]>0x0&&{'params':_0x48ae5d[_0x54a883(0x24b)]}};return await handleSingleObjectOutput(_0x300a8b,_0x499c4d),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x467f12(0x1db)]='workflow:tasks';[a51_0x467f12(0x242)]=a51_0x467f12(0x27a);async['execute'](_0x603c95){const _0x3604e6=a51_0x467f12,{options:_0x14030b,args:_0x520ba4,tdx:_0x54b5ea}=_0x603c95,_0x1852d0=_0x520ba4[0x0];if(!_0x1852d0)return console['error'](_0x3604e6(0x30e)),0x1;const _0x3cdc81=_0x14030b[_0x3604e6(0x2ad)];_0x14030b['verbose']&&(console[_0x3604e6(0x24c)]('Attempt\x20ID:\x20'+_0x1852d0),_0x3cdc81&&console[_0x3604e6(0x24c)](_0x3604e6(0x21b)));const _0x215a9d=await withSpinner(_0x3604e6(0x1cf),()=>_0x54b5ea[_0x3604e6(0x201)][_0x3604e6(0x1e9)](_0x1852d0,_0x3cdc81||![]),{'verbose':_0x14030b['verbose']}),_0x8a73=_0x215a9d['data'];return console['error'](_0x3604e6(0x285)+_0x8a73['length']+_0x3604e6(0x2d1)+(_0x8a73[_0x3604e6(0x26e)]!==0x1?'s':'')),await handleSDKOutput(_0x8a73,_0x14030b),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x2b2);[a51_0x467f12(0x242)]=a51_0x467f12(0x233);async[a51_0x467f12(0x255)](_0x9edc82){const _0x54120c=a51_0x467f12,{options:_0x3f45ee,args:_0x39c943,tdx:_0x1831bf}=_0x9edc82,_0x4f7e0c=_0x39c943[0x0];let _0x3440b9=_0x39c943[0x1];if(!_0x4f7e0c)return console[_0x54120c(0x24c)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x3f45ee[_0x54120c(0x195)]&&(console['error'](_0x54120c(0x2ed)+_0x4f7e0c),_0x3440b9&&console[_0x54120c(0x24c)](_0x54120c(0x1ac)+_0x3440b9));const _0x27551e=await withSpinner(_0x54120c(0x1a0),()=>_0x1831bf['workflow']['logFiles'](_0x4f7e0c,_0x3440b9),{'verbose':_0x3f45ee[_0x54120c(0x195)]}),_0x2dcba0=_0x27551e['data'];if(_0x2dcba0[_0x54120c(0x26e)]===0x0)return console[_0x54120c(0x24c)](_0x54120c(0x1a4)),0x0;if(!_0x3440b9&&(_0x3f45ee[_0x54120c(0x2e3)]||_0x3f45ee[_0x54120c(0x252)]))return await handleSDKOutput(_0x2dcba0,_0x3f45ee),0x0;if(!_0x3440b9){const _0x2533dc=_0x2dcba0[_0x54120c(0x2b6)](_0x1efb39=>({'title':_0x1efb39['taskName']+'\x20('+formatBytes(_0x1efb39['fileSize'])+')','value':_0x1efb39[_0x54120c(0x284)]})),_0x1b507b=await a51_0x59e223({'type':_0x54120c(0x2fd),'name':_0x54120c(0x207),'message':_0x54120c(0x1d2),'choices':_0x2533dc});if(!_0x1b507b[_0x54120c(0x207)])return console['error'](_0x54120c(0x1c4)),0x0;_0x3440b9=_0x1b507b[_0x54120c(0x207)];}const _0x5d0571=await withSpinner(_0x54120c(0x2b7),()=>_0x1831bf[_0x54120c(0x201)]['logs'](_0x4f7e0c,_0x3440b9),{'verbose':_0x3f45ee[_0x54120c(0x195)]}),_0x431acd=_0x5d0571[_0x54120c(0x264)];return _0x431acd?console['log'](_0x431acd):console['error'](_0x54120c(0x1c3)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x253);[a51_0x467f12(0x242)]=a51_0x467f12(0x25b);async[a51_0x467f12(0x255)](_0x285d18){const _0x55fb9e=a51_0x467f12,{options:_0x1feccf,args:_0x168e71,tdx:_0xcb3980}=_0x285d18,_0x18658f=_0x168e71[0x0];if(!_0x18658f)return console['error'](_0x55fb9e(0x30e)),0x1;const _0x1d761a=_0x1feccf['reason'];_0x1feccf['verbose']&&(console[_0x55fb9e(0x24c)](_0x55fb9e(0x2ed)+_0x18658f),_0x1d761a&&console['error']('Reason:\x20'+_0x1d761a));if(!_0x1feccf[_0x55fb9e(0x307)]){if(!isInteractive())return console[_0x55fb9e(0x24c)](a51_0x221e70['red'](_0x55fb9e(0x310)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x55fb9e(0x24c)](a51_0x221e70[_0x55fb9e(0x2b3)](_0x55fb9e(0x324))),0x1;const _0x40177e=await confirmKey(_0x55fb9e(0x1e5)+_0x18658f+'?');if(!_0x40177e)return console[_0x55fb9e(0x24c)](a51_0x221e70[_0x55fb9e(0x296)](_0x55fb9e(0x1c4))),0x1;}const _0x367dd7=await withSpinner(_0x55fb9e(0x2a2),()=>_0xcb3980[_0x55fb9e(0x201)][_0x55fb9e(0x1ba)](_0x18658f,_0x1d761a),{'verbose':_0x1feccf[_0x55fb9e(0x195)]}),_0x428e38=_0x367dd7[_0x55fb9e(0x264)];return console[_0x55fb9e(0x24c)]('✔\x20'+_0x428e38),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a51_0x467f12(0x2d6);['description']=a51_0x467f12(0x2c9);async[a51_0x467f12(0x255)](_0x259e4a){const _0x4757c1=a51_0x467f12,{options:_0x59e1cb,args:_0x495bfe,tdx:_0x15722a}=_0x259e4a,_0x2799fd=_0x495bfe[0x0];if(!_0x2799fd)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x4757c1(0x24c)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0xa78e9c=![],_0x2c0eb3=_0x2799fd;if(_0x2799fd[_0x4757c1(0x25d)](_0x4757c1(0x2ac)))_0xa78e9c=!![],_0x2c0eb3=_0x2799fd['substring'](0x8);else{if(_0x2799fd['startsWith'](_0x4757c1(0x190)))_0xa78e9c=![],_0x2c0eb3=_0x2799fd[_0x4757c1(0x2b4)](0x8);else return console[_0x4757c1(0x24c)](_0x4757c1(0x238)),console[_0x4757c1(0x24c)](_0x4757c1(0x2c5)),0x1;}const _0x2e7380=_0x59e1cb['fromTask'],_0x3a5527=_0x59e1cb[_0x4757c1(0x1a9)],_0x4d01d0=_0x59e1cb[_0x4757c1(0x24b)],_0x324f27=_0x59e1cb[_0x4757c1(0x1e7)];_0x59e1cb[_0x4757c1(0x195)]&&(console[_0x4757c1(0x24c)](_0x4757c1(0x1eb)+(_0xa78e9c?'session':'attempt')+'\x20'+_0x2c0eb3),_0x2e7380&&console[_0x4757c1(0x24c)](_0x4757c1(0x30b)+_0x2e7380),_0x3a5527&&console[_0x4757c1(0x24c)](_0x4757c1(0x1ca)+_0x3a5527),_0x4d01d0&&console[_0x4757c1(0x24c)]('Params:\x20'+_0x4d01d0),_0x324f27&&console[_0x4757c1(0x24c)](_0x4757c1(0x197)));let _0x5cbc5b;if(_0x4d01d0)try{if(_0x4d01d0[_0x4757c1(0x25d)]('@')){const _0x11a927=await import(_0x4757c1(0x2a4)),_0x2c4151=_0x4d01d0[_0x4757c1(0x2b4)](0x1),_0xa50e54=await _0x11a927[_0x4757c1(0x1aa)](_0x2c4151,_0x4757c1(0x27b));_0x5cbc5b=JSON[_0x4757c1(0x240)](_0xa50e54);}else _0x5cbc5b=JSON[_0x4757c1(0x240)](_0x4d01d0);}catch{return console[_0x4757c1(0x24c)](_0x4757c1(0x2e0)),0x1;}if(!_0x59e1cb['yes']){if(!isInteractive())return console['error'](a51_0x221e70[_0x4757c1(0x1d8)](_0x4757c1(0x310)),_0x4757c1(0x28e)),console['error'](a51_0x221e70[_0x4757c1(0x2b3)](_0x4757c1(0x324))),0x1;const _0x224e5a=await confirmKey(_0x4757c1(0x19c)+(_0xa78e9c?_0x4757c1(0x29c):_0x4757c1(0x290))+'\x20'+_0x2c0eb3+'?');if(!_0x224e5a)return console[_0x4757c1(0x24c)](a51_0x221e70[_0x4757c1(0x296)](_0x4757c1(0x1c4))),0x1;}let _0x2767ea;_0xa78e9c?_0x2767ea=await withSpinner(_0x4757c1(0x23b),()=>_0x15722a[_0x4757c1(0x201)][_0x4757c1(0x209)](_0x2c0eb3,{'fromTask':_0x2e7380,'retryParams':_0x5cbc5b}),{'verbose':_0x59e1cb['verbose']}):_0x2767ea=await withSpinner('Retrying\x20attempt...',()=>_0x15722a['workflow'][_0x4757c1(0x1a7)](_0x2c0eb3,{'resumeFrom':_0x3a5527,'retryParams':_0x5cbc5b,'force':_0x324f27}),{'verbose':_0x59e1cb['verbose']});const _0x483028=_0x2767ea[_0x4757c1(0x264)];return console['error'](_0x4757c1(0x1f1)),console['error'](_0x4757c1(0x2c0)+_0x483028[_0x4757c1(0x27d)]),console[_0x4757c1(0x24c)](_0x4757c1(0x286)+_0x483028[_0x4757c1(0x1af)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a51_0x467f12(0x2d4);[a51_0x467f12(0x242)]=a51_0x467f12(0x31e);async[a51_0x467f12(0x255)](_0x559dba){const _0x50c908=a51_0x467f12,{options:_0x12b2b3,args:_0x452d4e,tdx:_0x1e32f4}=_0x559dba;let _0xd3c3d4=_0x452d4e[0x0];if(!_0xd3c3d4){const _0x55a9c6=this[_0x50c908(0x227)]([],_0x12b2b3),_0x4a43ab=await withSpinner('Loading\x20workflows...',()=>_0x1e32f4[_0x50c908(0x201)]['workflows'](_0x55a9c6,{'limit':_0x12b2b3[_0x50c908(0x29f)]}),{'verbose':_0x12b2b3[_0x50c908(0x195)]}),_0x4a173d=_0x4a43ab[_0x50c908(0x264)];if(_0x4a173d[_0x50c908(0x26e)]===0x0)return console[_0x50c908(0x24c)](_0x50c908(0x325)),!_0x55a9c6&&console[_0x50c908(0x24c)](a51_0x221e70['dim'](_0x50c908(0x1a5))),0x1;const _0x40598b=_0x4a173d['map'](_0x2f2d12=>({'title':_0x2f2d12[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]+'.'+_0x2f2d12[_0x50c908(0x1db)],'value':_0x2f2d12[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]+'.'+_0x2f2d12[_0x50c908(0x1db)],'description':_0x2f2d12[_0x50c908(0x2f3)]?'revision:\x20'+_0x2f2d12[_0x50c908(0x2f3)]:undefined})),_0x4e8836=await a51_0x59e223({'type':_0x50c908(0x2fd),'name':_0x50c908(0x201),'message':_0x50c908(0x24e),'choices':_0x40598b});if(!_0x4e8836[_0x50c908(0x201)])return 0x1;_0xd3c3d4=_0x4e8836['workflow'];}if(!_0xd3c3d4[_0x50c908(0x23a)]('.')){const _0x4b24e5=this[_0x50c908(0x227)]([],_0x12b2b3);if(_0x4b24e5)_0xd3c3d4=_0x4b24e5+'.'+_0xd3c3d4;else return console[_0x50c908(0x24c)](a51_0x221e70[_0x50c908(0x1d8)](_0x50c908(0x1cb)),'Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format'),console['error'](a51_0x221e70[_0x50c908(0x2b3)](_0x50c908(0x1a5))),0x1;}const _0x48e9ed=_0x12b2b3[_0x50c908(0x2fb)],_0x18b423=_0x12b2b3[_0x50c908(0x1e3)],_0x277fec={};if(_0x48e9ed&&Array[_0x50c908(0x191)](_0x48e9ed))for(const _0x425af1 of _0x48e9ed){const _0xfaf6a7=_0x425af1[_0x50c908(0x29e)]('=');if(_0xfaf6a7===-0x1)return console['error'](_0x50c908(0x1fb)+_0x425af1),console[_0x50c908(0x24c)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x32b240=_0x425af1[_0x50c908(0x2b4)](0x0,_0xfaf6a7),_0x1fce25=_0x425af1['substring'](_0xfaf6a7+0x1);try{_0x277fec[_0x32b240]=JSON[_0x50c908(0x240)](_0x1fce25);}catch{_0x277fec[_0x32b240]=_0x1fce25;}}_0x12b2b3['verbose']&&(console['error'](_0x50c908(0x2f8)+_0xd3c3d4),Object[_0x50c908(0x1ea)](_0x277fec)[_0x50c908(0x26e)]>0x0&&console[_0x50c908(0x24c)]('Parameters:\x20'+JSON[_0x50c908(0x249)](_0x277fec)),_0x18b423&&console[_0x50c908(0x24c)](_0x50c908(0x1d6)+_0x18b423));const _0x4417f5=await withSpinner(_0x50c908(0x22e),()=>_0x1e32f4['workflow'][_0x50c908(0x2f2)](_0xd3c3d4,_0x277fec,{'sessionTime':_0x18b423}),{'verbose':_0x12b2b3[_0x50c908(0x195)]}),_0x3dbe41=_0x4417f5[_0x50c908(0x264)];console[_0x50c908(0x24c)]('✔\x20Workflow\x20run\x20started'),console[_0x50c908(0x24c)](_0x50c908(0x2db)+_0x3dbe41['id']),console[_0x50c908(0x24c)]('\x20\x20Session\x20ID:\x20'+_0x3dbe41['sessionId']),console[_0x50c908(0x24c)](_0x50c908(0x2c2)+_0x3dbe41[_0x50c908(0x23f)]?.[_0x50c908(0x1db)]),console[_0x50c908(0x24c)](_0x50c908(0x19b)+_0x3dbe41[_0x50c908(0x201)]?.[_0x50c908(0x1db)]);if(_0x3dbe41['project']?.['id']&&_0x3dbe41['sessionId']&&_0x3dbe41['id']){const _0x3e22c2=_0x12b2b3[_0x50c908(0x26f)],_0x40f393=getConsoleUrl(_0x3e22c2,_0x50c908(0x21a)+_0x3dbe41[_0x50c908(0x23f)]['id']+_0x50c908(0x1d7)+_0x3dbe41[_0x50c908(0x1af)]+_0x50c908(0x2ba)+_0x3dbe41['id']);console[_0x50c908(0x24c)](_0x50c908(0x292)+a51_0x221e70['cyan'](_0x40f393));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a51_0x467f12(0x211);[a51_0x467f12(0x242)]=a51_0x467f12(0x332);async[a51_0x467f12(0x255)](_0x1aff62){const _0x3a8dc6=a51_0x467f12,{options:_0x49bed7,args:_0x221af5,tdx:_0x2852b8}=_0x1aff62,_0x17bf63=_0x221af5[0x0],_0x1efcd2=_0x221af5[0x1]||'.';if(!_0x17bf63)return console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x2ec)),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x1c0)),0x1;const _0x2469ae=_0x49bed7[_0x3a8dc6(0x2f3)];_0x49bed7[_0x3a8dc6(0x195)]&&(console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x232)+_0x17bf63),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x22d)+_0x1efcd2),_0x2469ae&&console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x28b)+_0x2469ae));const _0x531827=await withSpinner(_0x3a8dc6(0x1d9)+_0x17bf63+_0x3a8dc6(0x25f),()=>_0x2852b8[_0x3a8dc6(0x201)]['download'](_0x17bf63,_0x1efcd2,{'revision':_0x2469ae}),{'verbose':_0x49bed7['verbose']}),_0x6929ab=_0x531827[_0x3a8dc6(0x264)];return console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x1e0)+_0x6929ab[_0x3a8dc6(0x199)]),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x260)+_0x6929ab['revision']),console[_0x3a8dc6(0x24c)]('\x20\x20Files\x20extracted:\x20'+_0x6929ab['filesExtracted']),console[_0x3a8dc6(0x24c)](_0x3a8dc6(0x32b)+_0x1efcd2+'/'+_0x6929ab[_0x3a8dc6(0x199)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']='workflow:upload';[a51_0x467f12(0x242)]=a51_0x467f12(0x2bd);async[a51_0x467f12(0x255)](_0x1cb9d6){const _0x26bc08=a51_0x467f12,{options:_0xde8096,args:_0x42d349,tdx:_0x1b29fe}=_0x1cb9d6;let _0x488215='.',_0x6998f2=_0xde8096[_0x26bc08(0x1db)];if(_0x42d349[0x0]){const {promises:_0x10e317}=await import('fs');try{const _0x2da5c9=await _0x10e317[_0x26bc08(0x294)](_0x42d349[0x0]);if(_0x2da5c9['isDirectory']())_0x488215=_0x42d349[0x0];else return console[_0x26bc08(0x24c)]('Error:\x20'+_0x42d349[0x0]+_0x26bc08(0x29d)),0x1;}catch{_0x6998f2=_0x42d349[0x0],_0x488215='.';}}const _0x217a0f=_0xde8096['revision'],_0x1b4f7d=_0xde8096[_0x26bc08(0x245)];_0xde8096[_0x26bc08(0x195)]&&(console[_0x26bc08(0x24c)](_0x26bc08(0x2a3)+_0x488215),_0x6998f2&&console[_0x26bc08(0x24c)](_0x26bc08(0x271)+_0x6998f2),_0x217a0f&&console[_0x26bc08(0x24c)]('Revision:\x20'+_0x217a0f),_0x1b4f7d&&console[_0x26bc08(0x24c)](_0x26bc08(0x27c)));const _0x6e50a0=await withSpinner(_0x26bc08(0x1bb),()=>_0x1b29fe['workflow'][_0x26bc08(0x30a)](_0x488215,{'projectName':_0x6998f2,'revision':_0x217a0f,'skipValidation':_0x1b4f7d}),{'verbose':_0xde8096[_0x26bc08(0x195)]}),_0x13deac=_0x6e50a0[_0x26bc08(0x264)];return console['error'](_0x26bc08(0x1c2)+_0x13deac[_0x26bc08(0x199)]),console['error'](_0x26bc08(0x302)+_0x13deac[_0x26bc08(0x2d9)]),console[_0x26bc08(0x24c)](_0x26bc08(0x260)+_0x13deac[_0x26bc08(0x2f3)]),await this[_0x26bc08(0x31f)](_0x1b29fe,_0x13deac[_0x26bc08(0x199)],_0xde8096[_0x26bc08(0x26f)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x467f12(0x1db)]='workflow:pull';[a51_0x467f12(0x242)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a51_0x467f12(0x255)](_0x4b0bf5){const _0x48c090=a51_0x467f12,{options:_0x250dde,args:_0x494616,tdx:_0x5434c6}=_0x4b0bf5,_0x3eda25=_0x494616[0x0],_0x18ddcc=_0x494616[0x1];if(!_0x3eda25)return console['error'](a51_0x221e70[_0x48c090(0x1d8)]('Error:'),_0x48c090(0x32e)),console['error'](a51_0x221e70[_0x48c090(0x2b3)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x241e96=_0x250dde[_0x48c090(0x2f3)];_0x250dde['verbose']&&(console['error'](_0x48c090(0x232)+_0x3eda25),_0x18ddcc&&console[_0x48c090(0x24c)]('Target\x20directory:\x20'+_0x18ddcc),_0x241e96&&console[_0x48c090(0x24c)](_0x48c090(0x28b)+_0x241e96),_0x250dde[_0x48c090(0x32a)]&&console[_0x48c090(0x24c)]('Dry\x20run:\x20yes'));const _0x225382=await withSpinner(_0x48c090(0x256)+_0x3eda25+_0x48c090(0x25f),()=>_0x5434c6[_0x48c090(0x201)][_0x48c090(0x29a)](_0x3eda25,{'targetDir':_0x18ddcc,'revision':_0x241e96}),{'verbose':_0x250dde[_0x48c090(0x195)]}),_0x43821b=_0x225382['data'];_0x43821b['isNewProject']?console[_0x48c090(0x24c)](_0x48c090(0x276)+_0x43821b['projectName']):console['error'](_0x48c090(0x2b5)+_0x43821b[_0x48c090(0x199)]);console['error'](_0x48c090(0x260)+_0x43821b[_0x48c090(0x2f3)]),console[_0x48c090(0x24c)](_0x48c090(0x2f9)+(a51_0x5534f1['relative'](process['cwd'](),_0x43821b['targetDir'])||'.')),console[_0x48c090(0x24c)](_0x48c090(0x26d)+a51_0x221e70[_0x48c090(0x25a)]('+'+_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x2a9)]+_0x48c090(0x322))+',\x20'+(a51_0x221e70[_0x48c090(0x296)]('~'+_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x288)]+'\x20modified')+',\x20')+(a51_0x221e70[_0x48c090(0x1d8)]('-'+_0x43821b[_0x48c090(0x2ab)]['deleted']+_0x48c090(0x291))+',\x20')+(''+a51_0x221e70[_0x48c090(0x2b3)](_0x43821b[_0x48c090(0x2ab)][_0x48c090(0x1d0)]+_0x48c090(0x2df))));for(const _0x393659 of _0x43821b[_0x48c090(0x2c4)]){_0x393659['type']===_0x48c090(0x288)&&_0x393659[_0x48c090(0x1a8)]&&(console[_0x48c090(0x24c)]('\x0a'+a51_0x221e70['cyan'](_0x48c090(0x263)+_0x393659['path'])),console[_0x48c090(0x24c)](_0x393659['diff']));}if(!_0x43821b['hasChanges'])return saveSessionContext({'workflow_project':_0x43821b[_0x48c090(0x199)]},_0x250dde[_0x48c090(0x29c)]),console['error'](a51_0x221e70['green'](_0x48c090(0x308))),console[_0x48c090(0x24c)](a51_0x221e70['dim'](_0x48c090(0x320)+_0x43821b[_0x48c090(0x199)])),0x0;if(_0x250dde['dryRun'])return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x296)](_0x48c090(0x244))),0x0;if(!_0x250dde[_0x48c090(0x307)]){if(!isInteractive())return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x1d8)](_0x48c090(0x310)),_0x48c090(0x28e)),console['error'](a51_0x221e70['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1aa0f7=await confirmKey(_0x48c090(0x19e));if(!_0x1aa0f7)return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x296)](_0x48c090(0x1c4)),'-\x20no\x20files\x20written'),0x1;}await withSpinner(_0x48c090(0x30d),()=>_0x5434c6['workflow'][_0x48c090(0x313)](_0x43821b,{'revision':_0x241e96}),{'verbose':_0x250dde[_0x48c090(0x195)]}),saveSessionContext({'workflow_project':_0x43821b[_0x48c090(0x199)]},_0x250dde[_0x48c090(0x29c)]),console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x25a)](_0x48c090(0x22a)));const _0x2fd2de=a51_0x5534f1[_0x48c090(0x319)](process[_0x48c090(0x2dd)](),_0x43821b['targetDir'])||'.';return console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x2b3)]('\x20\x20Location:\x20'+_0x2fd2de)),console[_0x48c090(0x24c)](a51_0x221e70[_0x48c090(0x2b3)](_0x48c090(0x320)+_0x43821b[_0x48c090(0x199)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]='workflow:push';[a51_0x467f12(0x242)]=a51_0x467f12(0x309);async[a51_0x467f12(0x255)](_0x31d588){const _0x3f70a8=a51_0x467f12,{options:_0x4f42ad,args:_0x1865cd,tdx:_0x347242}=_0x31d588,_0x3f5f89=this['resolveProjectDir'](_0x1865cd,_0x4f42ad),_0x2d8b54=_0x4f42ad['revision'],_0x177ed1=_0x4f42ad['skipValidation'];_0x4f42ad[_0x3f70a8(0x195)]&&(_0x3f5f89&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x2d5)+_0x3f5f89),_0x2d8b54&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x28b)+_0x2d8b54),_0x4f42ad[_0x3f70a8(0x32a)]&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x1fa)),_0x177ed1&&console[_0x3f70a8(0x24c)](_0x3f70a8(0x27c)));let _0x48ed42;try{_0x48ed42=await withSpinner(_0x3f70a8(0x305),()=>_0x347242['workflow'][_0x3f70a8(0x20b)]({'sourceDir':_0x3f5f89,'revision':_0x2d8b54,'skipValidation':_0x177ed1}),{'verbose':_0x4f42ad[_0x3f70a8(0x195)]});}catch(_0x27f172){if(_0x27f172 instanceof Error&&_0x27f172[_0x3f70a8(0x218)][_0x3f70a8(0x23a)](_0x3f70a8(0x2a8)))return console['error'](a51_0x221e70[_0x3f70a8(0x1d8)](_0x3f70a8(0x1cb)),_0x3f70a8(0x1d4)),_0x4f42ad[_0x3f70a8(0x330)]?console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x1de)+_0x4f42ad[_0x3f70a8(0x330)]+_0x3f70a8(0x275)+_0x4f42ad[_0x3f70a8(0x330)]+'\x27')):console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x21d))),0x1;throw _0x27f172;}const _0x3263fa=_0x48ed42['data'];console[_0x3f70a8(0x24c)](_0x3f70a8(0x298)+_0x3263fa[_0x3f70a8(0x199)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x326)+_0x3263fa[_0x3f70a8(0x2fc)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x260)+_0x3263fa[_0x3f70a8(0x2f3)]),console[_0x3f70a8(0x24c)](_0x3f70a8(0x26d)+a51_0x221e70['green']('+'+_0x3263fa['summary'][_0x3f70a8(0x2a9)]+_0x3f70a8(0x322))+',\x20'+(a51_0x221e70[_0x3f70a8(0x296)]('~'+_0x3263fa[_0x3f70a8(0x2ab)][_0x3f70a8(0x288)]+'\x20modified')+',\x20')+(a51_0x221e70[_0x3f70a8(0x1d8)]('-'+_0x3263fa['summary']['deleted']+'\x20deleted')+',\x20')+(''+a51_0x221e70['dim'](_0x3263fa[_0x3f70a8(0x2ab)][_0x3f70a8(0x1d0)]+_0x3f70a8(0x2df))));for(const _0x355f9f of _0x3263fa['changes']){_0x355f9f[_0x3f70a8(0x27f)]==='modified'&&_0x355f9f[_0x3f70a8(0x1a8)]&&(console[_0x3f70a8(0x24c)]('\x0a'+a51_0x221e70[_0x3f70a8(0x2b0)]('---\x20'+_0x355f9f['path'])),console[_0x3f70a8(0x24c)](_0x355f9f[_0x3f70a8(0x1a8)]));}if(!_0x3263fa[_0x3f70a8(0x272)])return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x25a)](_0x3f70a8(0x208))),await this['showWorkflowConsoleUrl'](_0x347242,_0x3263fa[_0x3f70a8(0x199)],_0x4f42ad[_0x3f70a8(0x26f)]),0x0;if(_0x4f42ad[_0x3f70a8(0x32a)])return console[_0x3f70a8(0x24c)](a51_0x221e70['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x4f42ad[_0x3f70a8(0x307)]){if(!isInteractive())return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x1d8)](_0x3f70a8(0x310)),_0x3f70a8(0x28e)),console['error'](a51_0x221e70[_0x3f70a8(0x2b3)](_0x3f70a8(0x324))),0x1;const _0x535d33=await confirmKey(_0x3f70a8(0x213));if(!_0x535d33)return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x296)](_0x3f70a8(0x1c4)),_0x3f70a8(0x1f5)),0x1;}const _0x1e8d55=await withSpinner(_0x3f70a8(0x2a1),()=>_0x347242['workflow'][_0x3f70a8(0x247)](_0x3263fa),{'verbose':_0x4f42ad[_0x3f70a8(0x195)]}),_0x5ca8d6=_0x1e8d55[_0x3f70a8(0x264)];return console[_0x3f70a8(0x24c)](a51_0x221e70[_0x3f70a8(0x25a)](_0x3f70a8(0x228))),console['error']('\x20\x20Project\x20ID:\x20'+_0x5ca8d6['projectId']),console[_0x3f70a8(0x24c)](_0x3f70a8(0x260)+_0x5ca8d6['revision']),await this[_0x3f70a8(0x31f)](_0x347242,_0x5ca8d6['projectName'],_0x4f42ad[_0x3f70a8(0x26f)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x1fc);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a51_0x467f12(0x255)](_0x29fe9b){const _0xfad1ac=a51_0x467f12,{options:_0x5328c2,args:_0xb57f01,tdx:_0x30a6b9}=_0x29fe9b,_0x8285f3=this[_0xfad1ac(0x1f9)](_0xb57f01,_0x5328c2),_0x25b726=_0x5328c2['name'],_0x38da5b=_0x5328c2['revision'],_0x2d3e1c=_0x5328c2[_0xfad1ac(0x245)];if(!_0x8285f3)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x1cb)),_0xfad1ac(0x2d8)),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)](_0xfad1ac(0x315))),0x1;if(!_0x25b726)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x1cb)),_0xfad1ac(0x192)),console['error'](a51_0x221e70['dim'](_0xfad1ac(0x268))),0x1;_0x5328c2[_0xfad1ac(0x195)]&&(console[_0xfad1ac(0x24c)](_0xfad1ac(0x2d5)+_0x8285f3),console[_0xfad1ac(0x24c)](_0xfad1ac(0x258)+_0x25b726),_0x38da5b&&console['error'](_0xfad1ac(0x28b)+_0x38da5b),_0x5328c2[_0xfad1ac(0x32a)]&&console['error'](_0xfad1ac(0x1fa)),_0x2d3e1c&&console[_0xfad1ac(0x24c)](_0xfad1ac(0x27c)));const _0xd2dc17=await withSpinner(_0xfad1ac(0x281),()=>_0x30a6b9[_0xfad1ac(0x201)][_0xfad1ac(0x318)](_0x8285f3,_0x25b726,{'revision':_0x38da5b,'skipValidation':_0x2d3e1c}),{'verbose':_0x5328c2[_0xfad1ac(0x195)]}),_0x924740=_0xd2dc17['data'];console[_0xfad1ac(0x24c)](_0xfad1ac(0x1f4)+_0x924740[_0xfad1ac(0x2fc)]);_0x924740['sourceProjectName']&&console[_0xfad1ac(0x24c)](_0xfad1ac(0x328)+_0x924740[_0xfad1ac(0x202)]);console['error']('New\x20project\x20name:\x20'+_0x924740[_0xfad1ac(0x1bd)]),console[_0xfad1ac(0x24c)]('Revision:\x20'+_0x924740['revision']),console[_0xfad1ac(0x24c)](_0xfad1ac(0x282)+_0x924740[_0xfad1ac(0x1e1)]);_0x924740[_0xfad1ac(0x2aa)]&&(console['error'](a51_0x221e70[_0xfad1ac(0x296)](_0xfad1ac(0x2f5)+_0x924740[_0xfad1ac(0x1bd)]+_0xfad1ac(0x239)+_0x924740[_0xfad1ac(0x261)]+')')),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x5328c2['dryRun'])return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)](_0xfad1ac(0x22b))),0x0;if(!_0x5328c2['yes']){if(!isInteractive())return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x1d8)](_0xfad1ac(0x310)),_0xfad1ac(0x28e)),console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x2b3)](_0xfad1ac(0x324))),0x1;const _0x27fa87=_0x924740['sourceProjectName']||a51_0x5534f1[_0xfad1ac(0x26a)](_0x8285f3),_0x2b1db1=_0x924740[_0xfad1ac(0x2aa)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x25b726+_0xfad1ac(0x2ee):_0xfad1ac(0x1ab)+_0x27fa87+_0xfad1ac(0x28f)+_0x25b726+'\x22?',_0x5622c1=await confirmKey(_0x2b1db1);if(!_0x5622c1)return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x296)]('Cancelled')),0x1;}const _0x4dc36b=await withSpinner(_0x924740[_0xfad1ac(0x2aa)]?_0xfad1ac(0x1da)+_0x25b726+_0xfad1ac(0x25f):'Cloning\x20to\x20'+_0x25b726+_0xfad1ac(0x25f),()=>_0x30a6b9[_0xfad1ac(0x201)]['executeCloneProject'](_0x924740),{'verbose':_0x5328c2[_0xfad1ac(0x195)]}),_0x56e0eb=_0x4dc36b[_0xfad1ac(0x264)];return console[_0xfad1ac(0x24c)](a51_0x221e70[_0xfad1ac(0x25a)](_0x924740['targetExists']?'✔\x20Project\x20updated':_0xfad1ac(0x2f7))),console[_0xfad1ac(0x24c)](_0xfad1ac(0x2c2)+_0x56e0eb[_0xfad1ac(0x1bd)]),console[_0xfad1ac(0x24c)]('\x20\x20Project\x20ID:\x20'+_0x56e0eb[_0xfad1ac(0x2cc)]),console[_0xfad1ac(0x24c)](_0xfad1ac(0x260)+_0x56e0eb['revision']),await this['showWorkflowConsoleUrl'](_0x30a6b9,_0x56e0eb[_0xfad1ac(0x1bd)],_0x5328c2[_0xfad1ac(0x26f)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x250);[a51_0x467f12(0x242)]=a51_0x467f12(0x321);async['execute'](_0x40f15d){const _0x12ee75=a51_0x467f12,{options:_0x40a64e,args:_0x37162f,tdx:_0x162195}=_0x40f15d,_0x466b40=_0x37162f[0x0];if(!_0x466b40)return console[_0x12ee75(0x24c)](_0x12ee75(0x1be)),console[_0x12ee75(0x24c)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x40a64e[_0x12ee75(0x195)]&&console[_0x12ee75(0x24c)]('Project:\x20'+_0x466b40);if(!_0x40a64e['yes']){if(!isInteractive())return console[_0x12ee75(0x24c)](a51_0x221e70['red'](_0x12ee75(0x310)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x221e70[_0x12ee75(0x2b3)](_0x12ee75(0x324))),0x1;const _0x248f9a=await confirmKey(_0x12ee75(0x1f6)+_0x466b40+_0x12ee75(0x2f6));if(!_0x248f9a)return console[_0x12ee75(0x24c)](a51_0x221e70[_0x12ee75(0x296)](_0x12ee75(0x1c4))),0x1;}const _0xbe12fd=await withSpinner('Deleting\x20project\x20'+_0x466b40+_0x12ee75(0x25f),()=>_0x162195[_0x12ee75(0x201)][_0x12ee75(0x2ea)](_0x466b40),{'verbose':_0x40a64e[_0x12ee75(0x195)]}),_0x213288=_0xbe12fd[_0x12ee75(0x264)];return console[_0x12ee75(0x24c)](_0x12ee75(0x316)+_0x213288['projectName']),console[_0x12ee75(0x24c)]('\x20\x20Project\x20ID:\x20'+_0x213288[_0x12ee75(0x2d9)]),0x0;}}export function parseKeyValue(_0x5331b0){const _0xd324ad=a51_0x467f12,_0x15aa8c=_0x5331b0[_0xd324ad(0x29e)]('=');if(_0x15aa8c===-0x1)throw new Error('Invalid\x20format:\x20'+_0x5331b0+_0xd324ad(0x327));const _0xaf4c75=_0x5331b0['substring'](0x0,_0x15aa8c),_0x56404c=_0x5331b0[_0xd324ad(0x2b4)](_0x15aa8c+0x1);if(!_0xaf4c75)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0xaf4c75,'value':_0x56404c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]='workflow:secrets:list';['description']=a51_0x467f12(0x1f0);async[a51_0x467f12(0x255)](_0x1107a9){const _0x474382=a51_0x467f12,{options:_0x92887b,args:_0x422da3,tdx:_0x9ca0f7}=_0x1107a9,_0x58b0e3=this[_0x474382(0x20a)](_0x422da3,_0x92887b);if(!_0x58b0e3)return 0x1;_0x92887b[_0x474382(0x195)]&&console['error'](_0x474382(0x232)+_0x58b0e3);const _0x3c3cab=await withSpinner(_0x474382(0x2c1),()=>_0x9ca0f7['workflow'][_0x474382(0x2e6)](_0x58b0e3),{'verbose':_0x92887b[_0x474382(0x195)]}),{secrets:_0x583627}=_0x3c3cab['data'];return console['error']('✔\x20Found\x20'+_0x583627[_0x474382(0x26e)]+_0x474382(0x2de)+(_0x583627[_0x474382(0x26e)]!==0x1?'s':'')),await handleSDKOutput(_0x583627,_0x92887b),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x20c);[a51_0x467f12(0x242)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x467f12(0x255)](_0x36aa60){const _0x7266a9=a51_0x467f12,{options:_0x21ee3d,args:_0x547b4d,tdx:_0x42533a}=_0x36aa60;let _0x28f2d0,_0x1eecf9;if(_0x547b4d['length']>=0x2)_0x28f2d0=_0x547b4d[0x0],_0x1eecf9=_0x547b4d[0x1];else{if(_0x547b4d[_0x7266a9(0x26e)]===0x1&&_0x21ee3d[_0x7266a9(0x330)])_0x28f2d0=_0x21ee3d[_0x7266a9(0x330)],_0x1eecf9=_0x547b4d[0x0];else return _0x547b4d[_0x7266a9(0x26e)]===0x1?(console[_0x7266a9(0x24c)](_0x7266a9(0x2ec)),console[_0x7266a9(0x24c)](_0x7266a9(0x1a5)),0x1):(console[_0x7266a9(0x24c)]('Error:\x20KEY=VALUE\x20is\x20required'),console[_0x7266a9(0x24c)](_0x7266a9(0x1bf)),0x1);}let _0x5b019c,_0x551c0b;try{({key:_0x5b019c,value:_0x551c0b}=parseKeyValue(_0x1eecf9));}catch(_0x1007d6){return _0x1007d6 instanceof Error&&console[_0x7266a9(0x24c)](a51_0x221e70[_0x7266a9(0x1d8)]('Error:'),_0x1007d6[_0x7266a9(0x218)]),0x1;}_0x21ee3d[_0x7266a9(0x195)]&&(console['error'](_0x7266a9(0x232)+_0x28f2d0),console[_0x7266a9(0x24c)](_0x7266a9(0x2c6)+_0x5b019c));const _0x3319c6=await withSpinner(_0x7266a9(0x221),()=>_0x42533a[_0x7266a9(0x201)][_0x7266a9(0x262)](_0x28f2d0,_0x5b019c,_0x551c0b),{'verbose':_0x21ee3d[_0x7266a9(0x195)]}),_0x10fc71=_0x3319c6[_0x7266a9(0x264)];return console[_0x7266a9(0x24c)](_0x7266a9(0x2a7)+_0x10fc71[_0x7266a9(0x2a5)]+_0x7266a9(0x300)+_0x10fc71[_0x7266a9(0x199)]+'\x27'),(_0x21ee3d[_0x7266a9(0x2e3)]||_0x21ee3d[_0x7266a9(0x2b1)])&&await handleSingleObjectOutput(_0x10fc71,_0x21ee3d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x223);[a51_0x467f12(0x242)]=a51_0x467f12(0x2dc);async[a51_0x467f12(0x255)](_0x6821d9){const _0x32beb3=a51_0x467f12,{options:_0xf879c7,args:_0x450d8b,tdx:_0x9329c3}=_0x6821d9;let _0x35138c,_0x4cc7b3;if(_0x450d8b[_0x32beb3(0x26e)]>=0x2)_0x35138c=_0x450d8b[0x0],_0x4cc7b3=_0x450d8b[0x1];else{if(_0x450d8b[_0x32beb3(0x26e)]===0x1&&_0xf879c7[_0x32beb3(0x330)])_0x35138c=_0xf879c7['workflowProject'],_0x4cc7b3=_0x450d8b[0x0];else return _0x450d8b[_0x32beb3(0x26e)]===0x1?(console[_0x32beb3(0x24c)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x32beb3(0x24c)](_0x32beb3(0x1a5)),0x1):(console[_0x32beb3(0x24c)](_0x32beb3(0x259)),console['error'](_0x32beb3(0x28c)),0x1);}_0xf879c7[_0x32beb3(0x195)]&&(console[_0x32beb3(0x24c)](_0x32beb3(0x232)+_0x35138c),console[_0x32beb3(0x24c)](_0x32beb3(0x2c6)+_0x4cc7b3));if(!_0xf879c7[_0x32beb3(0x307)]){if(!isInteractive())return console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x1d8)](_0x32beb3(0x310)),_0x32beb3(0x28e)),console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x2b3)](_0x32beb3(0x324))),0x1;const _0x409f04=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x4cc7b3+_0x32beb3(0x1fe)+_0x35138c+'\x27?');if(!_0x409f04)return console[_0x32beb3(0x24c)](a51_0x221e70[_0x32beb3(0x296)](_0x32beb3(0x1c4))),0x1;}const _0x261c7c=await withSpinner('Deleting\x20secret...',()=>_0x9329c3[_0x32beb3(0x201)][_0x32beb3(0x2d3)](_0x35138c,_0x4cc7b3),{'verbose':_0xf879c7['verbose']}),_0x472a45=_0x261c7c[_0x32beb3(0x264)];return console[_0x32beb3(0x24c)]('✔\x20Secret\x20\x27'+_0x472a45[_0x32beb3(0x2a5)]+_0x32beb3(0x1a6)+_0x472a45[_0x32beb3(0x199)]+'\x27'),(_0xf879c7[_0x32beb3(0x2e3)]||_0xf879c7[_0x32beb3(0x2b1)])&&await handleSingleObjectOutput(_0x472a45,_0xf879c7),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(_0x165aae){const _0x2c3c15=a51_0x467f12,_0x4ef541=Math[_0x2c3c15(0x1a1)](_0x165aae/0x3e8),_0x64e67d=Math[_0x2c3c15(0x1a1)](_0x4ef541/0x3c),_0xba319c=Math[_0x2c3c15(0x1a1)](_0x64e67d/0x3c),_0x44c404=Math[_0x2c3c15(0x1a1)](_0xba319c/0x18);if(_0x44c404>0x0){const _0x3f77da=_0xba319c%0x18;return _0x3f77da>0x0?_0x44c404+'d\x20'+_0x3f77da+'h':_0x44c404+'d';}else{if(_0xba319c>0x0){const _0x22e4d6=_0x64e67d%0x3c;return _0x22e4d6>0x0?_0xba319c+'h\x20'+_0x22e4d6+'m':_0xba319c+'h';}else{if(_0x64e67d>0x0){const _0x536f54=_0x4ef541%0x3c;return _0x536f54>0x0?_0x64e67d+'m\x20'+_0x536f54+'s':_0x64e67d+'m';}else return _0x4ef541+'s';}}}function formatTimestamp(_0x39f163,_0x2c59e1){const _0xf2956d=a51_0x467f12,_0x17fec9=new Date(_0x39f163),_0x3c714f=String(_0x17fec9['getHours']())[_0xf2956d(0x1e2)](0x2,'0'),_0x47bf69=String(_0x17fec9['getMinutes']())[_0xf2956d(0x1e2)](0x2,'0'),_0x17ffcc=_0x3c714f+':'+_0x47bf69,_0x3d2767=_0x17fec9['getFullYear']()===_0x2c59e1[_0xf2956d(0x1c9)]()&&_0x17fec9['getMonth']()===_0x2c59e1['getMonth']()&&_0x17fec9['getDate']()===_0x2c59e1[_0xf2956d(0x24f)]();if(_0x3d2767)return _0x17ffcc;else{const _0x35f992=String(_0x17fec9['getMonth']()+0x1)[_0xf2956d(0x1e2)](0x2,'0'),_0x21acf3=String(_0x17fec9[_0xf2956d(0x24f)]())['padStart'](0x2,'0');return _0x35f992+'-'+_0x21acf3+'\x20'+_0x17ffcc;}}function formatDate(_0x1e951b){const _0x39ee03=a51_0x467f12,_0x21ab87=_0x1e951b[_0x39ee03(0x1c9)](),_0x20390b=String(_0x1e951b['getMonth']()+0x1)[_0x39ee03(0x1e2)](0x2,'0'),_0x4602a1=String(_0x1e951b[_0x39ee03(0x24f)]())[_0x39ee03(0x1e2)](0x2,'0');return _0x21ab87+'-'+_0x20390b+'-'+_0x4602a1;}function getTaskStateIcon(_0x2953d0){const _0x5b711e={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5b711e[_0x2953d0]||'⚪';}function getBarChar(_0x2fdb2b){const _0x1f571c=a51_0x467f12;return _0x2fdb2b===_0x1f571c(0x24c)||_0x2fdb2b===_0x1f571c(0x206)?'×':'─';}function getBarColor(_0x40c5ef){const _0x2acc43=a51_0x467f12,_0x5e8f9d={'success':a51_0x221e70[_0x2acc43(0x25a)],'error':a51_0x221e70['red'],'group_error':a51_0x221e70[_0x2acc43(0x1d8)],'running':a51_0x221e70[_0x2acc43(0x2af)],'blocked':a51_0x221e70[_0x2acc43(0x296)],'planned':a51_0x221e70[_0x2acc43(0x2b3)],'canceling':a51_0x221e70[_0x2acc43(0x296)]};return _0x5e8f9d[_0x40c5ef]||a51_0x221e70[_0x2acc43(0x30f)];}function parseTaskName(_0x5c5a95){const _0x1c4794=a51_0x467f12;let _0xf4674e=_0x5c5a95['replace'](/^\++/,'');const _0x51cd96=_0xf4674e[_0x1c4794(0x226)]('+'),_0x3a3bb8=_0x51cd96[_0x1c4794(0x26e)]>0x1?_0x51cd96['length']-0x2:0x0,_0x34a1e8=_0x51cd96[_0x51cd96[_0x1c4794(0x26e)]-0x1]||_0xf4674e;return{'level':_0x3a3bb8,'name':'+'+_0x34a1e8};}function truncateTaskName(_0x210a10,_0x2b695e){const _0x3c4f6a=a51_0x467f12,_0x6db817=stringWidth(_0x210a10);if(_0x6db817<=_0x2b695e)return _0x210a10;let _0x1865ad=_0x210a10;while(stringWidth(_0x1865ad+'…')>_0x2b695e&&_0x1865ad[_0x3c4f6a(0x26e)]>0x0){_0x1865ad=_0x1865ad[_0x3c4f6a(0x2be)](0x0,-0x1);}return _0x1865ad+'…';}function calculateTimeScale(_0x4c45a0,_0x425c31){const _0x53ae7f=a51_0x467f12;return{'startTime':_0x4c45a0['start'],'endTime':_0x4c45a0[_0x53ae7f(0x2a6)],'durationMs':_0x4c45a0[_0x53ae7f(0x1c5)],'msPerChar':_0x4c45a0[_0x53ae7f(0x1c5)]/_0x425c31};}function timeToPosition(_0x2b5716,_0x38e222,_0x44c05d){const _0x3ca1d9=a51_0x467f12,_0x4233fc=_0x2b5716-_0x38e222[_0x3ca1d9(0x25c)],_0xdc381e=Math[_0x3ca1d9(0x1a1)](_0x4233fc/_0x38e222[_0x3ca1d9(0x270)]);return Math[_0x3ca1d9(0x31c)](0x0,Math[_0x3ca1d9(0x2d7)](_0xdc381e,_0x44c05d));}function renderTimeAxis(_0x71b4dc,_0x2ae5a7){const _0x271459=a51_0x467f12,_0x171890=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x271459(0x31c)](TIMELINE_CONFIG[_0x271459(0x2a0)],Math['floor'](_0x2ae5a7/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x413599=_0x71b4dc[_0x271459(0x246)]/(_0x171890-0x1),_0x52a191=new Date(_0x71b4dc['startTime']),_0x496cc1=[];for(let _0x2f77f6=0x0;_0x2f77f6<_0x171890;_0x2f77f6++){const _0x501ebf=_0x71b4dc[_0x271459(0x25c)]+_0x2f77f6*_0x413599,_0x14bc0c=timeToPosition(_0x501ebf,_0x71b4dc,_0x2ae5a7),_0x3459e4=formatTimestamp(_0x501ebf,_0x52a191);_0x496cc1[_0x271459(0x30a)]({'pos':_0x14bc0c,'text':_0x3459e4});}const _0x2c9ff4=new Array(_0x2ae5a7)['fill']('\x20');let _0x1b5d85=-0x1;for(const {pos:_0x2f3c9f,text:_0x45a7bd}of _0x496cc1){let _0x403327=Math[_0x271459(0x31c)](0x0,_0x2f3c9f-Math[_0x271459(0x1a1)](_0x45a7bd[_0x271459(0x26e)]/0x2));_0x403327<=_0x1b5d85+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x403327=_0x1b5d85+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x403327+_0x45a7bd[_0x271459(0x26e)]>_0x2ae5a7&&(_0x403327=_0x2ae5a7-_0x45a7bd[_0x271459(0x26e)]);if(_0x403327>=0x0&&_0x403327+_0x45a7bd[_0x271459(0x26e)]<=_0x2ae5a7&&_0x403327>_0x1b5d85){for(let _0x30307e=0x0;_0x30307e<_0x45a7bd[_0x271459(0x26e)];_0x30307e++){_0x2c9ff4[_0x403327+_0x30307e]=_0x45a7bd[_0x30307e];}_0x1b5d85=_0x403327+_0x45a7bd['length']-0x1;}}return _0x2c9ff4[_0x271459(0x2e4)]('');}function renderTaskRow(_0x55d141,_0x599e8b,_0x4c5112,_0x2d5255){const _0x271745=a51_0x467f12,{level:_0x16ba13,name:_0x50b9ab}=parseTaskName(_0x55d141[_0x271745(0x1db)]),_0x275bcf='\x20'[_0x271745(0x225)](_0x16ba13),_0xa6976e=_0x55d141[_0x271745(0x235)]?'('+formatElapsed(_0x55d141[_0x271745(0x235)]['duration'])+')':'',_0x51f19b=stringWidth(_0xa6976e),_0x315fda=_0x16ba13*0x1,_0x43466b=_0x2d5255-_0x315fda-_0x51f19b-0x1,_0x110aff=truncateTaskName(_0x50b9ab,_0x43466b),_0x4281b0=_0x275bcf+_0x110aff,_0xb052af=stringWidth(_0x4281b0),_0x2073a1=_0x2d5255-_0xb052af-_0x51f19b,_0x3f4cba=_0x4281b0+'\x20'[_0x271745(0x225)](Math[_0x271745(0x31c)](0x1,_0x2073a1))+a51_0x221e70[_0x271745(0x2b3)](_0xa6976e),_0x474311=getTaskStateIcon(_0x55d141[_0x271745(0x1dc)]),_0x8f783d=new Array(_0x4c5112)['fill']('\x20');if(_0x55d141[_0x271745(0x235)]){const _0x5dd7c0=timeToPosition(_0x55d141[_0x271745(0x235)][_0x271745(0x234)],_0x599e8b,_0x4c5112),_0x2fde80=timeToPosition(_0x55d141[_0x271745(0x235)]['end'],_0x599e8b,_0x4c5112),_0x36608e=getBarChar(_0x55d141[_0x271745(0x1dc)]),_0x3d5c86=Math[_0x271745(0x31c)](_0x5dd7c0+0x1,_0x2fde80);for(let _0x53d1f0=_0x5dd7c0;_0x53d1f0<Math[_0x271745(0x2d7)](_0x3d5c86,_0x4c5112);_0x53d1f0++){_0x8f783d[_0x53d1f0]=_0x36608e;}}const _0x41feb2=getBarColor(_0x55d141[_0x271745(0x1dc)]),_0x14da59=_0x8f783d[_0x271745(0x2b6)](_0xf4a25e=>_0xf4a25e==='\x20'?'\x20':_0x41feb2(_0xf4a25e))[_0x271745(0x2e4)]('');return _0x474311+'\x20'+_0x3f4cba+'│'+_0x14da59+'│';}function a51_0x56f9(_0x5657ec,_0x99f221){_0x5657ec=_0x5657ec-0x190;const _0xf6ba0a=a51_0xf6ba();let _0x56f9b6=_0xf6ba0a[_0x5657ec];return _0x56f9b6;}function calculateStats(_0xa1ffe){const _0x75a23d=a51_0x467f12,_0x1338e8={'total':_0xa1ffe[_0x75a23d(0x26e)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x196710 of _0xa1ffe){if(_0x196710['state']===_0x75a23d(0x194))_0x1338e8[_0x75a23d(0x194)]++;else{if(_0x196710[_0x75a23d(0x1dc)]===_0x75a23d(0x24c)||_0x196710[_0x75a23d(0x1dc)]==='group_error')_0x1338e8['error']++;else _0x196710['state']==='running'?_0x1338e8[_0x75a23d(0x23d)]++:_0x1338e8[_0x75a23d(0x2da)]++;}}return _0x1338e8;}function formatStats(_0x199cf3){const _0x46dac3=a51_0x467f12;return[_0x46dac3(0x2f4)+_0x199cf3['total'],'✅\x20'+_0x199cf3[_0x46dac3(0x194)],'❌\x20'+_0x199cf3[_0x46dac3(0x24c)],_0x46dac3(0x2fa)+_0x199cf3[_0x46dac3(0x23d)],'⏳\x20'+_0x199cf3[_0x46dac3(0x2da)]][_0x46dac3(0x2e4)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x467f12(0x1db)]=a51_0x467f12(0x269);[a51_0x467f12(0x242)]='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a51_0x467f12(0x255)](_0x2fc28a){const _0x398a6f=a51_0x467f12,{options:_0x578f7c,args:_0x2558d1,tdx:_0x3537d8}=_0x2fc28a;let _0x12febc,_0x4c6e06,_0x3af0df=![];if(_0x2558d1[0x0]){if(_0x2558d1[0x0][_0x398a6f(0x23a)]('.')){const _0x2eca1e=this[_0x398a6f(0x1c7)](_0x2558d1,_0x578f7c);if(!_0x2eca1e)return 0x1;_0x12febc=_0x2eca1e[_0x398a6f(0x199)],_0x4c6e06=_0x2eca1e[_0x398a6f(0x317)];}else{_0x4c6e06=_0x2558d1[0x0],_0x12febc=_0x578f7c['workflowProject'];if(!_0x12febc)return console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x1d8)](_0x398a6f(0x1cb)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x3af0df=!![];}}else{const _0x435967=this[_0x398a6f(0x1c7)](_0x2558d1,_0x578f7c);if(!_0x435967)return 0x1;_0x12febc=_0x435967['projectName'],_0x4c6e06=_0x435967[_0x398a6f(0x317)];}if(_0x578f7c[_0x398a6f(0x195)]){if(_0x12febc&&_0x4c6e06)console['error']('Filter:\x20'+_0x12febc+'.'+_0x4c6e06);else _0x12febc&&console[_0x398a6f(0x24c)](_0x398a6f(0x283)+_0x12febc);}const _0x366e95=_0x578f7c[_0x398a6f(0x27d)],_0x12418f=_0x578f7c[_0x398a6f(0x1af)];if(_0x366e95){_0x12418f&&console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x296)](_0x398a6f(0x27e)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x33f381=_0x578f7c['follow'];return _0x33f381?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x366e95):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x366e95,_0x578f7c),0x0;}if(_0x12418f){const _0x370add=await withSpinner(_0x398a6f(0x248),()=>_0x3537d8[_0x398a6f(0x201)][_0x398a6f(0x323)]({'projectName':_0x12febc,'workflowName':_0x4c6e06,'limit':0x64}),{'verbose':_0x578f7c[_0x398a6f(0x195)]}),_0x3dee9d=_0x370add[_0x398a6f(0x264)]['find'](_0x28d6c0=>_0x28d6c0['id']===_0x12418f);if(!_0x3dee9d)return console['error'](a51_0x221e70[_0x398a6f(0x1d8)]('Error:'),_0x398a6f(0x31d)+_0x12418f),0x1;if(!_0x3dee9d[_0x398a6f(0x28a)]?.['id'])return console[_0x398a6f(0x24c)](a51_0x221e70['red']('Error:'),_0x398a6f(0x216)+_0x12418f+_0x398a6f(0x1f2)),0x1;const _0x4bb5a4=_0x3dee9d[_0x398a6f(0x28a)]['id'];_0x578f7c[_0x398a6f(0x195)]&&console['error']('Using\x20attempt\x20'+_0x4bb5a4+'\x20from\x20session\x20'+_0x12418f);const _0x323f3f=_0x578f7c[_0x398a6f(0x2eb)];return _0x323f3f?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x4bb5a4):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x4bb5a4,_0x578f7c),0x0;}const _0x10cf30=await withSpinner('Loading\x20sessions...',()=>_0x3537d8[_0x398a6f(0x201)][_0x398a6f(0x323)]({'projectName':_0x12febc,'workflowName':_0x4c6e06,'limit':_0x578f7c[_0x398a6f(0x29f)]||0x32}),{'verbose':_0x578f7c[_0x398a6f(0x195)]}),_0x2fad71=_0x10cf30[_0x398a6f(0x264)];if(_0x2fad71[_0x398a6f(0x26e)]===0x0){if(_0x12febc&&_0x4c6e06)console[_0x398a6f(0x24c)]('No\x20sessions\x20found\x20for:\x20'+_0x12febc+'.'+_0x4c6e06);else _0x12febc?console[_0x398a6f(0x24c)](_0x398a6f(0x1cd)+_0x12febc):(console['error'](_0x398a6f(0x219)),console[_0x398a6f(0x24c)](a51_0x221e70[_0x398a6f(0x2b3)](_0x398a6f(0x1ee))));return 0x0;}_0x2fad71[_0x398a6f(0x241)]((_0x577370,_0x46dd1b)=>{const _0x50a7c1=_0x398a6f,_0x93df0f=_0x577370['sessionTime']||'',_0x55c906=_0x46dd1b[_0x50a7c1(0x1e3)]||'';return _0x55c906[_0x50a7c1(0x2cf)](_0x93df0f);});if(_0x578f7c['json']||_0x578f7c[_0x398a6f(0x2b1)])return await handleSDKOutput(_0x2fad71,_0x578f7c),0x0;let _0x24ca48;if(_0x3af0df){const _0x10760f=_0x2fad71[0x0];if(!_0x10760f['lastAttempt']?.['id'])return console[_0x398a6f(0x24c)](_0x398a6f(0x22f)),0x0;_0x24ca48=_0x10760f[_0x398a6f(0x28a)]['id'],_0x578f7c['verbose']&&console[_0x398a6f(0x24c)]('Auto-selected\x20latest\x20session:\x20'+_0x10760f[_0x398a6f(0x1e3)]);}else{const _0x38eb98=_0x2fad71[_0x398a6f(0x2b6)](_0x5618ed=>{const _0x4ef19a=_0x398a6f,_0x4cedba=getAttemptStatusDisplay(_0x5618ed[_0x4ef19a(0x28a)]);return{'title':_0x5618ed[_0x4ef19a(0x23f)]?.['name']+'.'+_0x5618ed[_0x4ef19a(0x201)]?.['name']+_0x4ef19a(0x289)+_0x5618ed[_0x4ef19a(0x1e3)]+'\x20'+_0x4cedba[_0x4ef19a(0x2c8)],'value':_0x5618ed['lastAttempt']?.['id']||'','description':_0x4cedba['text']};}),_0x530eb5=await a51_0x59e223({'type':_0x398a6f(0x2fd),'name':_0x398a6f(0x27d),'message':_0x398a6f(0x1e8),'choices':_0x38eb98[_0x398a6f(0x32f)](_0x426bf5=>_0x426bf5['value']!=='')});if(!_0x530eb5[_0x398a6f(0x27d)])return 0x0;_0x24ca48=_0x530eb5['attemptId'];}const _0x12eee3=_0x578f7c['follow'];return _0x12eee3?await this[_0x398a6f(0x32c)](_0x2fc28a,_0x24ca48):await this[_0x398a6f(0x2bf)](_0x2fc28a,_0x24ca48,_0x578f7c),0x0;}async[a51_0x467f12(0x2bf)](_0x1bf689,_0x1ed336,_0x5b8e78){const _0x59c74a=a51_0x467f12,{tdx:_0x150863}=_0x1bf689;let _0x18cd4a,_0xb33159;try{[_0x18cd4a,_0xb33159]=await Promise[_0x59c74a(0x1f3)]([_0x150863[_0x59c74a(0x201)][_0x59c74a(0x290)](_0x1ed336),_0x150863[_0x59c74a(0x201)]['tasks'](_0x1ed336,![])]);}catch(_0x181a74){console['error'](a51_0x221e70[_0x59c74a(0x1d8)](_0x59c74a(0x329)));_0x5b8e78[_0x59c74a(0x195)]&&console[_0x59c74a(0x24c)](_0x181a74);throw _0x181a74;}if(_0x5b8e78['json']||_0x5b8e78[_0x59c74a(0x2b1)]){const _0x4a4129=this['buildTimelineData'](_0x18cd4a,_0xb33159);await handleSDKOutput([_0x4a4129],_0x5b8e78);return;}const _0x1d89d9=_0x150863['context'][_0x59c74a(0x26f)],_0x22916c=this[_0x59c74a(0x2e9)](_0x18cd4a,_0xb33159,_0x1d89d9);console[_0x59c74a(0x295)](_0x22916c);}async[a51_0x467f12(0x32c)](_0x9a09da,_0x16ad16){const _0x422ba3=a51_0x467f12,{tdx:_0x5cbb80}=_0x9a09da,_0x530565=TIMELINE_CONFIG[_0x422ba3(0x314)],_0xdfabfc=TIMELINE_CONFIG[_0x422ba3(0x1c1)];let _0x568f47=0x0;while(_0x568f47<_0xdfabfc){process[_0x422ba3(0x1b5)][_0x422ba3(0x24d)]&&process[_0x422ba3(0x1b5)][_0x422ba3(0x224)]('\x1bc');let _0x13fcb8,_0x48d00b;try{[_0x13fcb8,_0x48d00b]=await Promise[_0x422ba3(0x1f3)]([_0x5cbb80[_0x422ba3(0x201)]['attempt'](_0x16ad16),_0x5cbb80[_0x422ba3(0x201)]['tasks'](_0x16ad16,![])]);}catch(_0x5d4553){console['error'](a51_0x221e70[_0x422ba3(0x1d8)](_0x422ba3(0x198)));_0x568f47>0x0&&console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x2b3)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x568f47));throw _0x5d4553;}const _0x48ae06=_0x5cbb80[_0x422ba3(0x2b9)][_0x422ba3(0x26f)],_0x348690=this[_0x422ba3(0x2e9)](_0x13fcb8,_0x48d00b,_0x48ae06);console[_0x422ba3(0x295)](_0x348690);const _0x364d63=_0x13fcb8[_0x422ba3(0x254)]&&_0x48d00b['every'](_0xc78db4=>_0xc78db4[_0x422ba3(0x1dc)]!==_0x422ba3(0x23d)&&_0xc78db4[_0x422ba3(0x1dc)]!==_0x422ba3(0x26b));if(_0x364d63){console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x25a)](_0x422ba3(0x265)));break;}console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x2b3)](_0x422ba3(0x1dd)+_0x568f47*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x46f890=>setTimeout(_0x46f890,_0x530565)),_0x568f47++;}_0x568f47>=_0xdfabfc&&console[_0x422ba3(0x24c)](a51_0x221e70[_0x422ba3(0x296)](_0x422ba3(0x212)));}[a51_0x467f12(0x2e9)](_0x587cb2,_0x19687a,_0xdda74b){const _0xb56b00=a51_0x467f12,_0x35992a=[],_0x139fde=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x2660f6=0x5,_0x2a3414=process['stdout'][_0xb56b00(0x1d5)]||0x78,_0x27e841=_0x2a3414-_0x139fde-_0x2660f6,_0x451566=Math['max'](TIMELINE_CONFIG[_0xb56b00(0x2ca)],Math[_0xb56b00(0x2d7)](_0x27e841,TIMELINE_CONFIG[_0xb56b00(0x2d2)])),_0x191861=new Date(_0x587cb2[_0xb56b00(0x1df)])['getTime'](),_0x2e216b=_0x587cb2[_0xb56b00(0x1e6)]?new Date(_0x587cb2[_0xb56b00(0x1e6)])[_0xb56b00(0x2ae)]():Date[_0xb56b00(0x1f8)](),_0x5e6840={'start':_0x191861,'end':_0x2e216b,'duration':_0x2e216b-_0x191861},_0x24f6e6=new Map(),_0x19c0f4=[];for(const _0x180644 of _0x19687a){if(_0x180644[_0xb56b00(0x1b2)]){const _0x403fa6=new Date(_0x180644['startedAt'])[_0xb56b00(0x2ae)](),_0x464150=_0x180644['updatedAt']?new Date(_0x180644[_0xb56b00(0x2f1)])['getTime']():Date[_0xb56b00(0x1f8)](),_0x54c3f2={'start':_0x403fa6,'end':_0x464150,'duration':_0x464150-_0x403fa6};_0x24f6e6[_0xb56b00(0x2ff)](_0x180644['id'],_0x54c3f2),_0x19c0f4[_0xb56b00(0x30a)]({'name':_0x180644['fullName'],'state':_0x180644[_0xb56b00(0x1dc)]||_0xb56b00(0x28d),'window':_0x54c3f2});}else _0x19c0f4[_0xb56b00(0x30a)]({'name':_0x180644[_0xb56b00(0x251)],'state':_0x180644[_0xb56b00(0x1dc)]||_0xb56b00(0x26b),'window':undefined});}_0x19c0f4[_0xb56b00(0x241)]((_0x18032f,_0x235540)=>{const _0x554268=_0xb56b00;if(!_0x18032f[_0x554268(0x235)])return 0x1;if(!_0x235540[_0x554268(0x235)])return-0x1;return _0x18032f[_0x554268(0x235)][_0x554268(0x234)]-_0x235540['window'][_0x554268(0x234)];});const _0x2a4e38=_0x19c0f4[_0xb56b00(0x26e)],_0x2c3f69=_0x2a4e38>TIMELINE_CONFIG['MAX_TASKS_DISPLAY'];_0x2c3f69&&_0x19c0f4[_0xb56b00(0x2e2)](TIMELINE_CONFIG[_0xb56b00(0x237)]);const _0x448e24=calculateTimeScale(_0x5e6840,_0x451566),_0x41694c=_0x587cb2['done']?_0x587cb2[_0xb56b00(0x194)]?a51_0x221e70[_0xb56b00(0x25a)](_0xb56b00(0x194)):a51_0x221e70[_0xb56b00(0x1d8)](_0xb56b00(0x24c)):a51_0x221e70[_0xb56b00(0x2af)](_0xb56b00(0x23d)),_0x3d6f19=_0x587cb2['project']?.['id'],_0x58dafb=_0x587cb2[_0xb56b00(0x1af)];let _0x1e3b2b;if(_0x3d6f19&&_0x58dafb){const _0x28aafe=getWorkflowAttemptUrl(_0xdda74b,_0x3d6f19,_0x58dafb,_0x587cb2['id']);_0x1e3b2b=hyperlink(a51_0x221e70[_0xb56b00(0x2b3)](_0x587cb2['id']),_0x28aafe);}else _0x1e3b2b=a51_0x221e70[_0xb56b00(0x2b3)](_0x587cb2['id']);_0x35992a['push'](_0xb56b00(0x1ae)+_0x1e3b2b+'\x20-\x20'+_0x41694c+'\x20-\x20'+formatElapsed(_0x5e6840['duration']));if(_0x19c0f4[_0xb56b00(0x26e)]>0x0){const _0xbdac33=renderTimeAxis(_0x448e24,_0x451566),_0xe8b1ed=new Date(_0x5e6840['start']),_0x12c29e=formatDate(_0xe8b1ed),_0x2a2154=TIMELINE_CONFIG[_0xb56b00(0x229)]+TIMELINE_CONFIG['ICON_SPACING']+_0x139fde,_0x55d9be=_0x12c29e[_0xb56b00(0x1e2)](_0x2a2154),_0x4c9d28=a51_0x221e70[_0xb56b00(0x2b3)](_0x55d9be);_0x35992a['push'](_0x4c9d28+'\x20'+_0xbdac33);for(const _0x5d6076 of _0x19c0f4){_0x35992a[_0xb56b00(0x30a)](renderTaskRow(_0x5d6076,_0x448e24,_0x451566,_0x139fde));}const _0x1fe7eb=calculateStats(_0x19c0f4);_0x35992a[_0xb56b00(0x30a)](formatStats(_0x1fe7eb)),_0x2c3f69&&_0x35992a['push'](a51_0x221e70['yellow']('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0xb56b00(0x237)]+_0xb56b00(0x1b6)+_0x2a4e38+'\x20tasks')),_0x35992a['push'](''),_0x35992a['push'](a51_0x221e70[_0xb56b00(0x2b3)](_0xb56b00(0x19d))+(_0xb56b00(0x32d)+_0x587cb2['id']+'\x20logs')+a51_0x221e70[_0xb56b00(0x2b3)](_0xb56b00(0x1bc)));}else _0x35992a[_0xb56b00(0x30a)](_0xb56b00(0x311));return _0x35992a['join']('\x0a');}[a51_0x467f12(0x1b9)](_0x75a849,_0x4e9349){const _0x5797d5=a51_0x467f12,_0x2b5d69=new Date(_0x75a849[_0x5797d5(0x1df)])[_0x5797d5(0x2ae)](),_0xdbdcf=_0x75a849['finishedAt']?new Date(_0x75a849[_0x5797d5(0x1e6)])['getTime']():Date[_0x5797d5(0x1f8)](),_0x3efc12=_0xdbdcf-_0x2b5d69,_0x2ca60c=[];for(const _0x33ef99 of _0x4e9349){if(_0x33ef99[_0x5797d5(0x1b2)]){const _0x9d50e0=new Date(_0x33ef99[_0x5797d5(0x1b2)])[_0x5797d5(0x2ae)](),_0x4a8c71=_0x33ef99['updatedAt']?new Date(_0x33ef99[_0x5797d5(0x2f1)])['getTime']():Date[_0x5797d5(0x1f8)]();_0x2ca60c['push']({'name':_0x33ef99[_0x5797d5(0x251)],'state':_0x33ef99['state']||'unknown','window':{'start':_0x9d50e0,'end':_0x4a8c71,'duration':_0x4a8c71-_0x9d50e0}});}else _0x2ca60c[_0x5797d5(0x30a)]({'name':_0x33ef99[_0x5797d5(0x251)],'state':_0x33ef99[_0x5797d5(0x1dc)]||'planned','window':undefined});}const _0x37fae2=calculateStats(_0x2ca60c);return{'attempt':{'id':_0x75a849['id'],'status':_0x75a849['done']?_0x75a849[_0x5797d5(0x194)]?_0x5797d5(0x194):'error':_0x5797d5(0x23d),'createdAt':_0x75a849[_0x5797d5(0x1df)],'finishedAt':_0x75a849[_0x5797d5(0x1e6)],'duration_ms':_0x3efc12},'tasks':_0x2ca60c[_0x5797d5(0x2b6)](_0x3d2b3d=>({'name':_0x3d2b3d[_0x5797d5(0x1db)],'state':_0x3d2b3d['state'],'startedAt':_0x3d2b3d[_0x5797d5(0x235)]?new Date(_0x3d2b3d[_0x5797d5(0x235)][_0x5797d5(0x234)])['toISOString']():null,'updatedAt':_0x3d2b3d['window']?new Date(_0x3d2b3d[_0x5797d5(0x235)][_0x5797d5(0x2a6)])[_0x5797d5(0x230)]():null,'duration_ms':_0x3d2b3d[_0x5797d5(0x235)]?.[_0x5797d5(0x1c5)]||null})),'stats':_0x37fae2};}}
1
+ const a51_0x56fa1c=a51_0x10a5;(function(_0x5e7696,_0xee3462){const _0x43335e=a51_0x10a5,_0x2783a1=_0x5e7696();while(!![]){try{const _0xebba11=-parseInt(_0x43335e(0x2fd))/0x1*(-parseInt(_0x43335e(0x2a0))/0x2)+-parseInt(_0x43335e(0x2db))/0x3+-parseInt(_0x43335e(0x252))/0x4*(-parseInt(_0x43335e(0x2b6))/0x5)+parseInt(_0x43335e(0x1eb))/0x6*(-parseInt(_0x43335e(0x1c5))/0x7)+-parseInt(_0x43335e(0x237))/0x8+parseInt(_0x43335e(0x1f7))/0x9*(-parseInt(_0x43335e(0x1c9))/0xa)+parseInt(_0x43335e(0x2bf))/0xb;if(_0xebba11===_0xee3462)break;else _0x2783a1['push'](_0x2783a1['shift']());}catch(_0x58a66a){_0x2783a1['push'](_0x2783a1['shift']());}}}(a51_0x5c27,0x92439));import a51_0x1e115a from'chalk';import{existsSync}from'fs';import a51_0x58f6d7 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 a51_0x20619d from'prompts';function getAttemptStatusDisplay(_0x8349b3){const _0x4e4dbc=a51_0x10a5;if(!_0x8349b3)return{'icon':'⏳','text':''};const {done:_0x54bbad,success:_0x38c1ab,cancelRequested:_0x2a05c5}=_0x8349b3;if(!_0x54bbad)return _0x2a05c5?{'icon':'🛑','text':a51_0x1e115a[_0x4e4dbc(0x2d6)](_0x4e4dbc(0x222))}:{'icon':'🔄','text':a51_0x1e115a[_0x4e4dbc(0x1df)](_0x4e4dbc(0x18a))};if(_0x38c1ab)return{'icon':'✅','text':a51_0x1e115a[_0x4e4dbc(0x17e)](_0x4e4dbc(0x178))};return{'icon':'❌','text':a51_0x1e115a[_0x4e4dbc(0x1db)](_0x4e4dbc(0x1d3))};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x460e2c,_0xabbdc5,_0x587bfa=0x0){const _0x5db56c=a51_0x10a5;return _0x460e2c[_0x587bfa]||_0xabbdc5[_0x5db56c(0x17a)];}[a51_0x56fa1c(0x2dc)](_0x2e5fd8,_0x19c3c6,_0xa155f3=0x0){const _0x44c2c2=a51_0x56fa1c,_0x4e1c7f=this[_0x44c2c2(0x1d5)](_0x2e5fd8,_0x19c3c6,_0xa155f3);if(!_0x4e1c7f)return console[_0x44c2c2(0x1d3)](a51_0x1e115a[_0x44c2c2(0x1db)](_0x44c2c2(0x293)),_0x44c2c2(0x2e8)),console[_0x44c2c2(0x1d3)](a51_0x1e115a['dim'](_0x44c2c2(0x1e4))),null;return _0x4e1c7f;}[a51_0x56fa1c(0x1d4)](_0x55472e,_0x46af4b){const _0x3e6329=a51_0x56fa1c;if(_0x55472e[0x0]){const _0x5c701b=_0x55472e[0x0][_0x3e6329(0x1d0)]('.');if(_0x5c701b[_0x3e6329(0x2d7)]===0x1)return{'projectName':_0x5c701b[0x0],'workflowName':undefined};else return _0x5c701b[_0x3e6329(0x2d7)]===0x2?{'projectName':_0x5c701b[0x0],'workflowName':_0x5c701b[0x1]}:(console['error'](a51_0x1e115a['red'](_0x3e6329(0x293)),_0x3e6329(0x210)),null);}return{'projectName':_0x46af4b[_0x3e6329(0x17a)],'workflowName':undefined};}[a51_0x56fa1c(0x19b)](_0x2112c9,_0x25ef69,_0x8843ad=0x0){const _0x34f929=a51_0x56fa1c;if(_0x2112c9[_0x8843ad])return _0x2112c9[_0x8843ad];if(_0x25ef69['workflowProject']){const _0x2a04a3=a51_0x58f6d7['join'](process['cwd'](),_0x34f929(0x2e2),_0x25ef69[_0x34f929(0x17a)]);if(existsSync(a51_0x58f6d7['join'](_0x2a04a3,_0x34f929(0x1ee))))return _0x2a04a3;}return undefined;}async[a51_0x56fa1c(0x1d7)](_0x5342c4,_0x4edd07,_0x3aefd1){const _0x10f0b5=a51_0x56fa1c;try{const _0x417c68=await _0x5342c4['workflow'][_0x10f0b5(0x2e2)](_0x4edd07,{'limit':0x1});if(_0x417c68[_0x10f0b5(0x2d7)]>0x0){const _0x2a273b=_0x417c68[0x0]['id'],_0x1cbccd=getWorkflowUrl(_0x3aefd1,_0x2a273b);console[_0x10f0b5(0x1d3)](_0x10f0b5(0x1be)+a51_0x1e115a[_0x10f0b5(0x1a0)](_0x1cbccd));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x267);['description']=a51_0x56fa1c(0x1a4);async['execute'](_0x5d938b){const _0x1d32a4=a51_0x56fa1c,{options:_0x3adfa3,args:_0x29dd1e,tdx:_0x2c795c}=_0x5d938b,_0x178b0c=_0x29dd1e[0x0],_0x547922=_0x3adfa3[_0x1d32a4(0x265)];if(_0x547922)return saveSessionContext({'workflow_project':undefined},_0x3adfa3[_0x1d32a4(0x19e)]),console[_0x1d32a4(0x171)](a51_0x1e115a[_0x1d32a4(0x17e)](_0x1d32a4(0x1f0))),0x0;if(!_0x178b0c)return console[_0x1d32a4(0x1d3)](a51_0x1e115a[_0x1d32a4(0x1db)](_0x1d32a4(0x293)),'Project\x20name\x20is\x20required'),console[_0x1d32a4(0x1d3)](a51_0x1e115a[_0x1d32a4(0x2f8)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x1d32a4(0x1d3)](a51_0x1e115a['dim'](_0x1d32a4(0x16e))),0x1;const _0x478236=await withSpinner('Resolving\x20project\x20\x27'+_0x178b0c+_0x1d32a4(0x2d1),()=>_0x2c795c['workflow']['resolveProjectId'](_0x178b0c),{'verbose':_0x3adfa3['verbose']}),{name:_0x314e3b}=_0x478236[_0x1d32a4(0x2c6)];return saveSessionContext({'workflow_project':_0x314e3b},_0x3adfa3[_0x1d32a4(0x19e)]),console[_0x1d32a4(0x171)](a51_0x1e115a['green'](_0x1d32a4(0x25a)+a51_0x1e115a[_0x1d32a4(0x1a0)](_0x314e3b))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x1c2);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x253);async['execute'](_0x4a6ca8){const _0x1f359b=a51_0x56fa1c,{options:_0x159e70,args:_0x2ddce4,tdx:_0x9edd46}=_0x4a6ca8,_0x4d8173=_0x2ddce4[0x0];_0x159e70[_0x1f359b(0x2e6)]&&_0x4d8173&&console['error'](_0x1f359b(0x1e2)+_0x4d8173);const _0x389692=await withSpinner(_0x1f359b(0x1a3),()=>_0x9edd46[_0x1f359b(0x2ea)][_0x1f359b(0x229)](_0x4d8173,{'limit':_0x159e70[_0x1f359b(0x25d)]}),{'verbose':_0x159e70[_0x1f359b(0x2e6)]});let _0x53dec0=_0x389692[_0x1f359b(0x2c6)];_0x53dec0['sort']((_0xf3196e,_0x810e49)=>_0xf3196e['name']['localeCompare'](_0x810e49['name']));const _0x10c78e=_0x159e70[_0x1f359b(0x25d)]||0x64,_0x62028d=_0x53dec0['length']>=_0x10c78e?a51_0x1e115a[_0x1f359b(0x2f8)](_0x1f359b(0x25c)):'';console['error'](_0x1f359b(0x2eb)+_0x53dec0[_0x1f359b(0x2d7)]+_0x1f359b(0x20b)+(_0x53dec0['length']!==0x1?'s':'')+_0x62028d);if(_0x159e70[_0x1f359b(0x184)]===_0x1f359b(0x18d)||_0x159e70[_0x1f359b(0x184)]===_0x1f359b(0x234)||_0x159e70[_0x1f359b(0x184)]===_0x1f359b(0x16d))await handleSDKOutput(_0x53dec0,_0x159e70);else{if(_0x53dec0[_0x1f359b(0x2d7)]===0x0)_0x4d8173?console[_0x1f359b(0x171)]('No\x20projects\x20match\x20pattern:\x20'+_0x4d8173):console[_0x1f359b(0x171)](_0x1f359b(0x274));else{const _0x3778f0=_0x53dec0[_0x1f359b(0x221)](_0x25c2c4=>{const _0x1cd13c=_0x1f359b,_0x22bebf=_0x25c2c4[_0x1cd13c(0x183)]?.[_0x1cd13c(0x259)](_0xbcecb3=>_0xbcecb3[_0x1cd13c(0x2de)]===_0x1cd13c(0x200)),_0x227442=_0x22bebf?a51_0x1e115a[_0x1cd13c(0x2f8)]('\x20(system)'):'';return _0x1cd13c(0x20c)+_0x25c2c4['name']+_0x227442;});await writeOutput(_0x3778f0[_0x1f359b(0x25f)]('\x0a'),_0x159e70[_0x1f359b(0x185)],_0x1f359b(0x290));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:workflows';[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x297);async['execute'](_0x11e723){const _0x11d0ec=a51_0x56fa1c,{options:_0x4a77f6,args:_0x2bc5d9,tdx:_0xe23d40}=_0x11e723,_0x1ec153=this[_0x11d0ec(0x1d5)](_0x2bc5d9,_0x4a77f6);_0x4a77f6[_0x11d0ec(0x2e6)]&&_0x1ec153&&console[_0x11d0ec(0x1d3)](_0x11d0ec(0x1ef)+_0x1ec153);const _0x276fc1=await withSpinner(_0x11d0ec(0x225),()=>_0xe23d40[_0x11d0ec(0x2ea)][_0x11d0ec(0x2e2)](_0x1ec153,{'limit':_0x4a77f6[_0x11d0ec(0x25d)]}),{'verbose':_0x4a77f6[_0x11d0ec(0x2e6)]});let _0x5a892d=_0x276fc1[_0x11d0ec(0x2c6)];_0x5a892d['sort']((_0x4160c6,_0x4e5bdc)=>{const _0x4f4b88=_0x11d0ec,_0x1e3314=_0x4160c6[_0x4f4b88(0x1cc)]['localeCompare'](_0x4e5bdc[_0x4f4b88(0x1cc)]);if(_0x1e3314!==0x0)return _0x1e3314;return(_0x4160c6[_0x4f4b88(0x248)]?.[_0x4f4b88(0x1cc)]||'')['localeCompare'](_0x4e5bdc[_0x4f4b88(0x248)]?.[_0x4f4b88(0x1cc)]||'');});const _0x445938=_0x4a77f6[_0x11d0ec(0x25d)]||0x64,_0xee83e1=_0x5a892d[_0x11d0ec(0x2d7)]>=_0x445938?a51_0x1e115a['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x11d0ec(0x1d3)]('✔\x20Found\x20'+_0x5a892d[_0x11d0ec(0x2d7)]+'\x20workflow'+(_0x5a892d[_0x11d0ec(0x2d7)]!==0x1?'s':'')+_0xee83e1);if(_0x4a77f6[_0x11d0ec(0x184)]==='json'||_0x4a77f6[_0x11d0ec(0x184)]===_0x11d0ec(0x234)||_0x4a77f6[_0x11d0ec(0x184)]===_0x11d0ec(0x16d))await handleSDKOutput(_0x5a892d,_0x4a77f6);else{if(_0x5a892d[_0x11d0ec(0x2d7)]===0x0)_0x1ec153?console[_0x11d0ec(0x171)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x1ec153):console[_0x11d0ec(0x171)](_0x11d0ec(0x2b4));else{const _0x3c1afb=_0x4a77f6[_0x11d0ec(0x2dd)],_0x3ea086=_0x5a892d[_0x11d0ec(0x221)](_0x1b19ce=>{const _0x2cf2f9=_0x11d0ec,_0x54fffb=a51_0x1e115a[_0x2cf2f9(0x2f8)]('#'+_0x1b19ce['id']),_0x12fa1d=hyperlink(_0x54fffb,getWorkflowUrl(_0x3c1afb,_0x1b19ce['id'])),_0x54bef5=_0x1b19ce[_0x2cf2f9(0x248)]?.[_0x2cf2f9(0x1cc)]?a51_0x1e115a['dim']('\x20('+_0x1b19ce[_0x2cf2f9(0x248)][_0x2cf2f9(0x1cc)]+')'):'';return _0x2cf2f9(0x273)+_0x12fa1d+'\x20'+_0x1b19ce[_0x2cf2f9(0x1cc)]+_0x54bef5;});await writeOutput(_0x3ea086[_0x11d0ec(0x25f)]('\x0a'),_0x4a77f6['output'],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:sessions';['description']=a51_0x56fa1c(0x28e);async['execute'](_0x3e073a){const _0x8e683d=a51_0x56fa1c,{options:_0xada4d5,args:_0x3e6aa1,tdx:_0x2e4bab}=_0x3e073a,_0x30cf77=this[_0x8e683d(0x1d4)](_0x3e6aa1,_0xada4d5);if(!_0x30cf77)return 0x1;const {projectName:_0x16357c,workflowName:_0x160aa0}=_0x30cf77;if(_0xada4d5['verbose']){if(_0x16357c&&_0x160aa0)console[_0x8e683d(0x1d3)](_0x8e683d(0x190)+_0x16357c+'.'+_0x160aa0);else _0x16357c&&console['error']('Filter:\x20project='+_0x16357c);const _0x2b33ec=_0xada4d5[_0x8e683d(0x23a)];_0x2b33ec&&console[_0x8e683d(0x1d3)](_0x8e683d(0x21e)+_0x2b33ec);}let _0x46d7c4=0x28;if(process['stdout'][_0x8e683d(0x2cc)]&&!_0xada4d5[_0x8e683d(0x185)]&&!_0xada4d5['format']){const _0x4947d5=process['stdout']['rows']||0x28;_0x46d7c4=Math[_0x8e683d(0x22c)](0x14,Math['floor'](_0x4947d5*0x2/0x3));}const _0x3f978a=_0xada4d5[_0x8e683d(0x25d)]||_0x46d7c4,_0x680678=await withSpinner(_0x8e683d(0x283),()=>_0x2e4bab[_0x8e683d(0x2ea)]['sessions']({'projectName':_0x16357c,'workflowName':_0x160aa0,'status':_0xada4d5[_0x8e683d(0x23a)],'fromTime':_0xada4d5['from'],'toTime':_0xada4d5['to'],'limit':_0x3f978a}),{'verbose':_0xada4d5['verbose']}),_0x9ca84a=_0x680678[_0x8e683d(0x2c6)];_0x9ca84a['sort']((_0x4b61de,_0x45d782)=>{const _0x2c970d=_0x8e683d,_0x1eb3fc=_0x4b61de['sessionTime']||'',_0x38e78d=_0x45d782[_0x2c970d(0x2c4)]||'';return _0x38e78d[_0x2c970d(0x2e7)](_0x1eb3fc);});_0x9ca84a[_0x8e683d(0x2d7)]>=_0x3f978a?console[_0x8e683d(0x1d3)]('✔\x20Showing\x20'+_0x9ca84a[_0x8e683d(0x2d7)]+_0x8e683d(0x165)+a51_0x1e115a[_0x8e683d(0x2f8)](_0x8e683d(0x2a7))):console[_0x8e683d(0x1d3)]('✔\x20Found\x20'+_0x9ca84a['length']+'\x20session'+(_0x9ca84a[_0x8e683d(0x2d7)]!==0x1?'s':''));if(_0xada4d5[_0x8e683d(0x184)]==='json'||_0xada4d5[_0x8e683d(0x184)]===_0x8e683d(0x234)||_0xada4d5['format']==='table')await handleSDKOutput(_0x9ca84a,_0xada4d5);else{if(!process['stdout'][_0x8e683d(0x2cc)]||_0xada4d5[_0x8e683d(0x185)]){if(_0x9ca84a[_0x8e683d(0x2d7)]===0x0){if(_0x16357c&&_0x160aa0)console['log'](_0x8e683d(0x188)+_0x16357c+'.'+_0x160aa0);else _0x16357c?console[_0x8e683d(0x171)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x16357c):console[_0x8e683d(0x171)](_0x8e683d(0x29d));}else{const _0x113928=_0xada4d5[_0x8e683d(0x2dd)],_0x3bbae4=this[_0x8e683d(0x2bb)](_0x9ca84a,_0x113928);_0xada4d5['output']?await writeOutput(_0x3bbae4,_0xada4d5['output'],'list'):console[_0x8e683d(0x171)](_0x3bbae4);}!_0x16357c&&(console[_0x8e683d(0x1d3)](''),console['error'](a51_0x1e115a[_0x8e683d(0x2f8)](_0x8e683d(0x1cf))),console[_0x8e683d(0x1d3)](a51_0x1e115a[_0x8e683d(0x2f8)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a51_0x1e115a['dim'](_0x8e683d(0x25b))));}else{if(_0x9ca84a[_0x8e683d(0x2d7)]===0x0){if(_0x16357c&&_0x160aa0)console['log'](_0x8e683d(0x188)+_0x16357c+'.'+_0x160aa0);else _0x16357c?console[_0x8e683d(0x171)](_0x8e683d(0x2d8)+_0x16357c):console['log']('No\x20sessions\x20found');}else await this[_0x8e683d(0x1bf)](_0x9ca84a,_0x3e073a,_0x16357c);}}return 0x0;}['renderSessionsTimeline'](_0x125043,_0x508f27){const _0x417ad5=a51_0x56fa1c,_0x36926c=[],_0x3b9a56=new Map();let _0x44a231=Infinity,_0x4f212e=-Infinity;for(const _0xb2c482 of _0x125043){if(_0xb2c482[_0x417ad5(0x1e1)]?.[_0x417ad5(0x287)]){const _0x247269=new Date(_0xb2c482[_0x417ad5(0x1e1)][_0x417ad5(0x287)])[_0x417ad5(0x161)](),_0x31aa33=_0xb2c482[_0x417ad5(0x1e1)][_0x417ad5(0x20d)]?new Date(_0xb2c482[_0x417ad5(0x1e1)][_0x417ad5(0x20d)])[_0x417ad5(0x161)]():Date[_0x417ad5(0x1cb)](),_0xa22001=_0xb2c482[_0x417ad5(0x248)]?.[_0x417ad5(0x1cc)]||'(unknown)';!_0x3b9a56[_0x417ad5(0x24c)](_0xa22001)&&_0x3b9a56[_0x417ad5(0x172)](_0xa22001,[]),_0x3b9a56[_0x417ad5(0x280)](_0xa22001)[_0x417ad5(0x213)]({'session':_0xb2c482,'startTime':_0x247269,'endTime':_0x31aa33,'duration':_0x31aa33-_0x247269}),_0x44a231=Math[_0x417ad5(0x1c4)](_0x44a231,_0x247269),_0x4f212e=Math['max'](_0x4f212e,_0x31aa33);}}if(_0x3b9a56[_0x417ad5(0x275)]===0x0)return _0x417ad5(0x1ac);const _0x4e4dcd=process[_0x417ad5(0x1fb)][_0x417ad5(0x1e5)]||0x78,_0x553129=0x1e,_0x31b081=0x32,_0x239bdc=0x4,_0x264552=Math['min'](_0x31b081,Math['max'](_0x553129,Math[_0x417ad5(0x193)](_0x4e4dcd*0.3))),_0x47ac51=_0x4e4dcd-_0x264552-TIMELINE_CONFIG['GUTTER']-0x3-_0x239bdc,_0x188df3=_0x4f212e-_0x44a231,_0x5b6342=_0x188df3/_0x264552,_0x390398=renderTimeAxis({'startTime':_0x44a231,'endTime':_0x4f212e,'durationMs':_0x188df3,'msPerChar':_0x5b6342},_0x264552),_0x5ebb8c=[];for(const _0x2cff9b of _0x3b9a56[_0x417ad5(0x216)]()){_0x5ebb8c[_0x417ad5(0x213)](..._0x2cff9b);}_0x5ebb8c['sort']((_0x52f43a,_0x10dbe5)=>_0x10dbe5[_0x417ad5(0x272)]-_0x52f43a[_0x417ad5(0x272)]);const _0x120df0=new Date(_0x44a231),_0x2c17f7=formatDate(_0x120df0),_0x5e8a36=_0x239bdc+TIMELINE_CONFIG[_0x417ad5(0x1c3)]+TIMELINE_CONFIG[_0x417ad5(0x241)]+_0x47ac51,_0x485137='\x20'['repeat'](_0x5e8a36-_0x2c17f7[_0x417ad5(0x2d7)]),_0x3d8042=_0x485137+a51_0x1e115a[_0x417ad5(0x2f8)](_0x2c17f7)+'\x20'+_0x390398;_0x36926c[_0x417ad5(0x213)](_0x3d8042);const _0x5f1c13=0x16;let _0x18d8f5=0x0;for(const _0x52fc39 of _0x5ebb8c){const _0x317a03=_0x52fc39[_0x417ad5(0x19e)][_0x417ad5(0x248)]?.['name']||'?',_0x1bb187=Math[_0x417ad5(0x1c4)](stringWidth(_0x317a03),_0x5f1c13);_0x18d8f5=Math[_0x417ad5(0x22c)](_0x18d8f5,_0x1bb187);}for(const _0x54b3c4 of _0x5ebb8c){const {session:_0x2ad3e6,startTime:_0x2c0c73,endTime:_0x1ec7c8,duration:_0x5c79ac}=_0x54b3c4,_0x3c8937=_0x2ad3e6['project']?.['id'],_0x3c6cb3=_0x2ad3e6['id'],_0x242730=_0x2ad3e6['project']?.[_0x417ad5(0x1cc)]||'?',_0xe292b8=_0x2ad3e6['workflow']?.[_0x417ad5(0x1cc)]||'?';let _0x10afc6,_0x21e08b;if(_0x2ad3e6[_0x417ad5(0x1e1)]){const _0x122616=_0x2ad3e6['lastAttempt'];!_0x122616[_0x417ad5(0x2ec)]?(_0x10afc6=_0x122616[_0x417ad5(0x278)]?'🛑':'🔄',_0x21e08b=_0x122616[_0x417ad5(0x278)]?a51_0x1e115a[_0x417ad5(0x2d6)]:a51_0x1e115a[_0x417ad5(0x1df)]):(_0x10afc6=_0x122616['success']?'✅':'❌',_0x21e08b=_0x122616[_0x417ad5(0x178)]?a51_0x1e115a['green']:a51_0x1e115a['red']);}else _0x10afc6='⏳',_0x21e08b=a51_0x1e115a['dim'];const _0x398b95='#'+_0x3c6cb3,_0x154940=_0x3c8937?hyperlink(_0x398b95,getWorkflowSessionUrl(_0x508f27,_0x3c8937,_0x3c6cb3)):_0x398b95;let _0x1414fd=_0x242730;stringWidth(_0x242730)>_0x5f1c13&&(_0x1414fd=_0x242730[_0x417ad5(0x208)](0x0,_0x5f1c13-0x1)+'…');const _0x388949=a51_0x1e115a[_0x417ad5(0x2f8)](_0x1414fd),_0x1e377a=stringWidth(_0x1414fd),_0x36b00e='\x20'[_0x417ad5(0x1d2)](_0x18d8f5-stringWidth(_0x1414fd)+0x2),_0x5e6e6b='('+formatElapsed(_0x5c79ac)+')',_0x15dbbc=stringWidth(_0x5e6e6b),_0x5f0a82=stringWidth(_0x398b95),_0x5758db=_0x5f0a82+0x1+_0x1e377a+_0x36b00e['length'],_0x678446=_0x47ac51-_0x5758db-_0x15dbbc-0x1-0x8;let _0x38d180=_0xe292b8;stringWidth(_0x38d180)>_0x678446&&(_0x38d180=_0x38d180[_0x417ad5(0x208)](0x0,_0x678446-0x1)+'…');const _0x38b23f=_0x154940+'\x20'+_0x388949+_0x36b00e+_0x38d180,_0x550bc3=stringWidth(_0x38b23f),_0x2c8b9d=_0x47ac51-_0x550bc3-_0x15dbbc,_0x40f74a=_0x38b23f+'\x20'['repeat'](Math['max'](0x1,_0x2c8b9d))+a51_0x1e115a[_0x417ad5(0x2f8)](_0x5e6e6b),_0x17d5e9=Math[_0x417ad5(0x193)]((_0x2c0c73-_0x44a231)/_0x5b6342),_0x309367=Math[_0x417ad5(0x193)]((_0x1ec7c8-_0x44a231)/_0x5b6342),_0x4e6a52=Math['max'](_0x17d5e9+0x1,_0x309367),_0x12b045=new Array(_0x264552)[_0x417ad5(0x2df)]('\x20');for(let _0x438a12=_0x17d5e9;_0x438a12<Math[_0x417ad5(0x1c4)](_0x4e6a52,_0x264552);_0x438a12++){_0x12b045[_0x438a12]='─';}const _0x143e42=_0x12b045[_0x417ad5(0x221)](_0x1b9728=>_0x1b9728==='\x20'?'\x20':_0x21e08b(_0x1b9728))['join']('');_0x36926c[_0x417ad5(0x213)](_0x10afc6+'\x20'+_0x40f74a+'│'+_0x143e42+'│');}return _0x36926c['join']('\x0a');}async[a51_0x56fa1c(0x1bf)](_0x36ebcf,_0x3f4cb6,_0x8be509){const _0x18094e=a51_0x56fa1c,{options:_0x1dd0bc,tdx:_0x23f38c}=_0x3f4cb6,_0x32fd6e=_0x1dd0bc[_0x18094e(0x2dd)],{timelineRows:_0x17eac8,timeAxisHeader:_0x1fe8ae}=this[_0x18094e(0x1f3)](_0x36ebcf,_0x32fd6e),_0x45de95=_0x17eac8['filter'](_0x2a95d1=>_0x2a95d1['attemptId']);if(_0x45de95['length']===0x0){const _0x15ddba=this[_0x18094e(0x2bb)](_0x36ebcf,_0x32fd6e);console[_0x18094e(0x171)](_0x15ddba);!_0x8be509&&(console[_0x18094e(0x1d3)](''),console[_0x18094e(0x1d3)](a51_0x1e115a['dim'](_0x18094e(0x1cf))),console[_0x18094e(0x1d3)](a51_0x1e115a[_0x18094e(0x2f8)](_0x18094e(0x1bb))+'or'+a51_0x1e115a[_0x18094e(0x2f8)](_0x18094e(0x25b))));return;}_0x1fe8ae&&console['log'](_0x1fe8ae);const _0x3ba5ef=_0x17eac8[_0x18094e(0x2ce)](_0x357e92=>_0x357e92['attemptId'])[_0x18094e(0x221)](_0x5677c6=>({'title':_0x5677c6[_0x18094e(0x175)],'value':_0x5677c6[_0x18094e(0x258)]})),_0x1c62f1=process[_0x18094e(0x1fb)][_0x18094e(0x2a5)]||0x3c,_0x535e04=Math[_0x18094e(0x22c)](0x28,Math[_0x18094e(0x193)](_0x1c62f1*0x2/0x3)),_0xef777=await a51_0x20619d({'type':_0x18094e(0x20a),'name':_0x18094e(0x258),'message':_0x18094e(0x191),'choices':_0x3ba5ef,'initial':-0x1,'limit':_0x535e04,'clearFirst':!![],'fallback':{'title':_0x18094e(0x1ad),'value':null},'suggest':(_0x4a0323,_0x4cac8b)=>{const _0x1464f9=_0x18094e;if(!_0x4a0323)return Promise[_0x1464f9(0x286)](_0x4cac8b);const _0x1334b9=_0x4cac8b[_0x1464f9(0x2ce)](_0x3a5362=>{const _0x917aba=_0x1464f9,_0x448385=_0x3a5362;return _0x448385[_0x917aba(0x239)][_0x917aba(0x255)]()[_0x917aba(0x281)](_0x4a0323[_0x917aba(0x255)]());});return Promise[_0x1464f9(0x286)](_0x1334b9);}}),_0x470783=()=>{const _0x222935=_0x18094e;process[_0x222935(0x1fb)]['write'](_0x222935(0x254)),process[_0x222935(0x1fb)][_0x222935(0x15f)](_0x222935(0x254)),process[_0x222935(0x1fb)][_0x222935(0x15f)]('\x1b[1A\x1b[2K');},_0x565d40=_0xef777&&_0xef777[_0x18094e(0x258)]&&_0xef777[_0x18094e(0x258)]!==null&&_0xef777[_0x18094e(0x258)][_0x18094e(0x2bc)]()!=='';if(!_0x565d40){_0x470783(),console['log'](a51_0x1e115a[_0x18094e(0x2f8)](_0x18094e(0x207)));return;}_0x470783();const _0x497476=_0x36ebcf[_0x18094e(0x2ba)](_0x533cf4=>_0x533cf4[_0x18094e(0x1e1)]?.['id']===_0xef777[_0x18094e(0x258)]);if(_0x497476){const _0x5680f5=_0x497476[_0x18094e(0x248)]?.['name']||'?',_0x2bb101=_0x497476['workflow']?.[_0x18094e(0x1cc)]||'?';console[_0x18094e(0x171)](_0x18094e(0x27d)+a51_0x1e115a[_0x18094e(0x2f8)](_0x5680f5)+',\x20Workflow:\x20'+a51_0x1e115a[_0x18094e(0x2f8)](_0x2bb101));}const _0x3ad580=new WorkflowTimelineCommand();await _0x3ad580[_0x18094e(0x192)]({'args':[],'options':{..._0x1dd0bc,'attemptId':_0xef777[_0x18094e(0x258)]},'tdx':_0x23f38c});}[a51_0x56fa1c(0x1f3)](_0x4f3675,_0x4db85c){const _0x56d98c=a51_0x56fa1c,_0x34f677=new Map();for(const _0x496321 of _0x4f3675){_0x496321['id']&&_0x496321[_0x56d98c(0x1e1)]?.['id']&&_0x34f677[_0x56d98c(0x172)](_0x496321['id'],_0x496321[_0x56d98c(0x1e1)]['id']);}const _0x1b309c=[];let _0x107571='';const _0x224678=this[_0x56d98c(0x2bb)](_0x4f3675,_0x4db85c),_0x25094e=_0x224678['split']('\x0a');for(const _0x2b0ca8 of _0x25094e){if(_0x2b0ca8['startsWith'](_0x56d98c(0x1bc))||_0x2b0ca8[_0x56d98c(0x219)](/^\s+\d{4}-\d{2}-\d{2}/))_0x107571=_0x2b0ca8;else{if(_0x2b0ca8[_0x56d98c(0x219)](/^[✅❌🔄🛑⏳]/)){const _0x4d4e0b=_0x2b0ca8['match'](/#(\d+)/),_0x30d708=_0x4d4e0b?_0x4d4e0b[0x1]:null,_0x420ef1=_0x30d708?_0x34f677[_0x56d98c(0x280)](_0x30d708)||null:null,_0x882ca7=_0x4f3675['find'](_0x57ade8=>_0x57ade8['id']===_0x30d708),_0x397cf4=_0x882ca7?.['project']?.[_0x56d98c(0x1cc)]||'';_0x1b309c[_0x56d98c(0x213)]({'displayLine':_0x2b0ca8,'attemptId':_0x420ef1,'projectName':_0x397cf4});}}}return{'timelineRows':_0x1b309c,'timeAxisHeader':_0x107571};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:attempts';[a51_0x56fa1c(0x198)]='List\x20workflow\x20attempts';async[a51_0x56fa1c(0x192)](_0x5bff5a){const _0x563884=a51_0x56fa1c,{options:_0x505017,args:_0x433950,tdx:_0x396de6}=_0x5bff5a,_0x35db7a=this[_0x563884(0x1d4)](_0x433950,_0x505017);if(!_0x35db7a)return 0x1;const {projectName:_0x5652a6,workflowName:_0x2789bc}=_0x35db7a,_0x5d2fca=_0x505017['includeRetried'];if(_0x505017[_0x563884(0x2e6)]){if(_0x5652a6&&_0x2789bc)console[_0x563884(0x1d3)](_0x563884(0x190)+_0x5652a6+'.'+_0x2789bc);else _0x5652a6&&console[_0x563884(0x1d3)](_0x563884(0x2d3)+_0x5652a6);_0x5d2fca&&console['error'](_0x563884(0x1ec));}const _0x4aa924=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x396de6[_0x563884(0x2ea)][_0x563884(0x2ef)]({'projectName':_0x5652a6,'workflowName':_0x2789bc,'includeRetried':_0x5d2fca,'limit':_0x505017['limit']}),{'verbose':_0x505017[_0x563884(0x2e6)]}),_0x4304d4=_0x4aa924[_0x563884(0x2c6)],_0x38a5b1=_0x505017[_0x563884(0x25d)]||0x64,_0x452a58=_0x4304d4[_0x563884(0x2d7)]>=_0x38a5b1?a51_0x1e115a[_0x563884(0x2f8)](_0x563884(0x25c)):'';console['error'](_0x563884(0x2eb)+_0x4304d4[_0x563884(0x2d7)]+'\x20attempt'+(_0x4304d4[_0x563884(0x2d7)]!==0x1?'s':'')+_0x452a58);if(_0x505017[_0x563884(0x184)]===_0x563884(0x18d)||_0x505017['format']===_0x563884(0x234)||_0x505017['format']===_0x563884(0x16d))await handleSDKOutput(_0x4304d4,_0x505017);else{if(_0x4304d4['length']===0x0){if(_0x5652a6&&_0x2789bc)console[_0x563884(0x171)]('No\x20attempts\x20found\x20for:\x20'+_0x5652a6+'.'+_0x2789bc);else _0x5652a6?console['log'](_0x563884(0x226)+_0x5652a6):console[_0x563884(0x171)](_0x563884(0x29a));}else{const _0xb041d3=_0x505017[_0x563884(0x2dd)],_0x503b25=_0x4304d4['map'](_0x3ebd31=>{const _0x357239=_0x563884,_0x2911e9=a51_0x1e115a[_0x357239(0x2f8)]('#'+_0x3ebd31['id']),_0xcd701f=_0x3ebd31[_0x357239(0x248)]?.['id'],_0x3ff0aa=_0x3ebd31['session_id']||_0x3ebd31['sessionId'],_0x44afb5=_0xcd701f&&_0x3ff0aa?hyperlink(_0x2911e9,getWorkflowAttemptUrl(_0xb041d3,_0xcd701f,_0x3ff0aa,_0x3ebd31['id'])):_0x2911e9,{icon:_0x115c4b,text:_0x7ac0e3}=getAttemptStatusDisplay(_0x3ebd31),_0x4860e9=(_0x3ebd31[_0x357239(0x248)]?.[_0x357239(0x1cc)]||'?')+'.'+(_0x3ebd31['workflow']?.[_0x357239(0x1cc)]||'?'),_0x45ee0a=_0x3ebd31['sessionTime']?a51_0x1e115a['dim'](_0x3ebd31[_0x357239(0x2c4)]):'';return(_0x44afb5+'\x20'+_0x115c4b+(_0x7ac0e3?'\x20'+_0x7ac0e3:'')+'\x20'+_0x4860e9+'\x20'+_0x45ee0a)[_0x357239(0x2ae)]();});await writeOutput(_0x503b25[_0x563884(0x25f)]('\x0a'),_0x505017[_0x563884(0x185)],_0x563884(0x290));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x1ed);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x291);async['execute'](_0x5b1a18){const _0x189354=a51_0x56fa1c,{options:_0x3e37c4,args:_0x2d09f0,tdx:_0x27dc70}=_0x5b1a18,_0x19621f=_0x2d09f0[0x0];if(!_0x19621f)return console['error'](_0x189354(0x1af)),0x1;_0x3e37c4['verbose']&&console[_0x189354(0x1d3)](_0x189354(0x249)+_0x19621f);const _0x380e4e=await withSpinner(_0x189354(0x1b2),()=>_0x27dc70[_0x189354(0x2ea)][_0x189354(0x302)](_0x19621f),{'verbose':_0x3e37c4[_0x189354(0x2e6)]}),_0x22b5d3=_0x380e4e['data'];let _0x2e75d6;!_0x22b5d3[_0x189354(0x2ec)]?_0x2e75d6=_0x22b5d3[_0x189354(0x278)]?'canceling':_0x189354(0x18a):_0x2e75d6=_0x22b5d3[_0x189354(0x178)]?'success':_0x189354(0x1d3);let _0x2127ec;if(_0x22b5d3[_0x189354(0x287)]&&_0x22b5d3[_0x189354(0x20d)]){const _0x430b41=new Date(_0x22b5d3[_0x189354(0x287)])[_0x189354(0x161)](),_0x14493d=new Date(_0x22b5d3[_0x189354(0x20d)])['getTime']();_0x2127ec=Math[_0x189354(0x169)]((_0x14493d-_0x430b41)/0x3e8);}const _0x2962ab={'attempt_id':_0x22b5d3['id'],'status':_0x2e75d6,..._0x22b5d3[_0x189354(0x29b)]!==undefined&&{'index':_0x22b5d3[_0x189354(0x29b)]},..._0x22b5d3[_0x189354(0x248)]&&{'project':_0x22b5d3[_0x189354(0x248)][_0x189354(0x1cc)]},..._0x22b5d3[_0x189354(0x2ea)]&&{'workflow':_0x22b5d3['workflow'][_0x189354(0x1cc)]},..._0x22b5d3[_0x189354(0x167)]&&{'session_id':_0x22b5d3[_0x189354(0x167)]},..._0x22b5d3[_0x189354(0x2c4)]&&{'session_time':_0x22b5d3[_0x189354(0x2c4)]},..._0x22b5d3['retryAttemptName']&&{'retry_attempt':_0x22b5d3[_0x189354(0x29c)]},..._0x2127ec!==undefined&&{'duration_sec':_0x2127ec},..._0x22b5d3['createdAt']&&{'created_at':_0x22b5d3['createdAt']},..._0x22b5d3[_0x189354(0x20d)]&&{'finished_at':_0x22b5d3['finishedAt']},...Object[_0x189354(0x1a1)](_0x22b5d3[_0x189354(0x2da)])[_0x189354(0x2d7)]>0x0&&{'params':_0x22b5d3['params']}};return await handleSingleObjectOutput(_0x2962ab,_0x3e37c4),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x2c2);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x182);async['execute'](_0x23cf1c){const _0x5c389c=a51_0x56fa1c,{options:_0x2be861,args:_0x3db960,tdx:_0x4454a8}=_0x23cf1c,_0x2ad5f4=_0x3db960[0x0];if(!_0x2ad5f4)return console[_0x5c389c(0x1d3)](_0x5c389c(0x1af)),0x1;const _0x2c6b69=_0x2be861[_0x5c389c(0x2a6)];_0x2be861[_0x5c389c(0x2e6)]&&(console[_0x5c389c(0x1d3)](_0x5c389c(0x249)+_0x2ad5f4),_0x2c6b69&&console[_0x5c389c(0x1d3)](_0x5c389c(0x2c0)));const _0x5df4f7=await withSpinner(_0x5c389c(0x2b1),()=>_0x4454a8['workflow'][_0x5c389c(0x1cd)](_0x2ad5f4,_0x2c6b69||![]),{'verbose':_0x2be861[_0x5c389c(0x2e6)]}),_0x55e1f3=_0x5df4f7['data'];return console[_0x5c389c(0x1d3)](_0x5c389c(0x2eb)+_0x55e1f3[_0x5c389c(0x2d7)]+_0x5c389c(0x1ca)+(_0x55e1f3[_0x5c389c(0x2d7)]!==0x1?'s':'')),await handleSDKOutput(_0x55e1f3,_0x2be861),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:logs';['description']=a51_0x56fa1c(0x174);async['execute'](_0x1e1693){const _0x109ad=a51_0x56fa1c,{options:_0x18bd88,args:_0xf91004,tdx:_0x126b41}=_0x1e1693,_0x4f65dc=_0xf91004[0x0];let _0x1bea13=_0xf91004[0x1];if(!_0x4f65dc)return console[_0x109ad(0x1d3)](_0x109ad(0x1af)),0x1;_0x18bd88[_0x109ad(0x2e6)]&&(console[_0x109ad(0x1d3)](_0x109ad(0x249)+_0x4f65dc),_0x1bea13&&console[_0x109ad(0x1d3)]('Task\x20name:\x20'+_0x1bea13));const _0x4b78ca=await withSpinner(_0x109ad(0x187),()=>_0x126b41[_0x109ad(0x2ea)][_0x109ad(0x19c)](_0x4f65dc,_0x1bea13),{'verbose':_0x18bd88['verbose']}),_0xc2e958=_0x4b78ca['data'];if(_0xc2e958[_0x109ad(0x2d7)]===0x0)return console['error'](_0x109ad(0x2a3)),0x0;if(!_0x1bea13&&(_0x18bd88[_0x109ad(0x18d)]||_0x18bd88[_0x109ad(0x184)]))return await handleSDKOutput(_0xc2e958,_0x18bd88),0x0;if(!_0x1bea13){const _0x589b6=_0xc2e958['map'](_0x56efb7=>({'title':_0x56efb7[_0x109ad(0x1fe)]+'\x20('+formatBytes(_0x56efb7[_0x109ad(0x21b)])+')','value':_0x56efb7[_0x109ad(0x1fe)]})),_0x440c22=await a51_0x20619d({'type':_0x109ad(0x2ca),'name':_0x109ad(0x266),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x589b6});if(!_0x440c22[_0x109ad(0x266)])return console[_0x109ad(0x1d3)](_0x109ad(0x207)),0x0;_0x1bea13=_0x440c22[_0x109ad(0x266)];}const _0x3693e1=await withSpinner(_0x109ad(0x2f0),()=>_0x126b41[_0x109ad(0x2ea)][_0x109ad(0x17b)](_0x4f65dc,_0x1bea13),{'verbose':_0x18bd88[_0x109ad(0x2e6)]}),_0x273f88=_0x3693e1[_0x109ad(0x2c6)];return _0x273f88?console[_0x109ad(0x171)](_0x273f88):console[_0x109ad(0x1d3)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x18c);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x1a6);async['execute'](_0x12da5d){const _0x3f7c94=a51_0x56fa1c,{options:_0x2f0314,args:_0x3b9436,tdx:_0x354a5e}=_0x12da5d,_0x58e344=_0x3b9436[0x0];if(!_0x58e344)return console[_0x3f7c94(0x1d3)](_0x3f7c94(0x1af)),0x1;const _0x33bbfd=_0x2f0314[_0x3f7c94(0x16b)];_0x2f0314[_0x3f7c94(0x2e6)]&&(console[_0x3f7c94(0x1d3)](_0x3f7c94(0x249)+_0x58e344),_0x33bbfd&&console[_0x3f7c94(0x1d3)]('Reason:\x20'+_0x33bbfd));if(!_0x2f0314['yes']){if(!isInteractive())return console['error'](a51_0x1e115a[_0x3f7c94(0x1db)]('\x0aError:'),_0x3f7c94(0x2f4)),console['error'](a51_0x1e115a[_0x3f7c94(0x2f8)](_0x3f7c94(0x2e3))),0x1;const _0x104521=await confirmKey(_0x3f7c94(0x2c1)+_0x58e344+'?');if(!_0x104521)return console[_0x3f7c94(0x1d3)](a51_0x1e115a[_0x3f7c94(0x2d6)]('Cancelled')),0x1;}const _0x7cc50a=await withSpinner(_0x3f7c94(0x2ff),()=>_0x354a5e['workflow']['kill'](_0x58e344,_0x33bbfd),{'verbose':_0x2f0314['verbose']}),_0x268462=_0x7cc50a['data'];return console[_0x3f7c94(0x1d3)]('✔\x20'+_0x268462),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:retry';[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x21f);async[a51_0x56fa1c(0x192)](_0x3c08a6){const _0x279361=a51_0x56fa1c,{options:_0x3cea94,args:_0x5e400c,tdx:_0x25f966}=_0x3c08a6,_0x44b68d=_0x5e400c[0x0];if(!_0x44b68d)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x279361(0x1d3)](_0x279361(0x2f7)),0x1;let _0x14bf42=![],_0x4740c0=_0x44b68d;if(_0x44b68d[_0x279361(0x20f)]('session:'))_0x14bf42=!![],_0x4740c0=_0x44b68d[_0x279361(0x264)](0x8);else{if(_0x44b68d['startsWith'](_0x279361(0x212)))_0x14bf42=![],_0x4740c0=_0x44b68d['substring'](0x8);else return console[_0x279361(0x1d3)](_0x279361(0x194)),console[_0x279361(0x1d3)](_0x279361(0x2f7)),0x1;}const _0x11e806=_0x3cea94[_0x279361(0x2fb)],_0x4f20b4=_0x3cea94[_0x279361(0x164)],_0x429039=_0x3cea94[_0x279361(0x2da)],_0x239486=_0x3cea94[_0x279361(0x295)];_0x3cea94[_0x279361(0x2e6)]&&(console[_0x279361(0x1d3)](_0x279361(0x19f)+(_0x14bf42?_0x279361(0x19e):_0x279361(0x302))+'\x20'+_0x4740c0),_0x11e806&&console[_0x279361(0x1d3)](_0x279361(0x256)+_0x11e806),_0x4f20b4&&console['error'](_0x279361(0x2a4)+_0x4f20b4),_0x429039&&console['error'](_0x279361(0x1b4)+_0x429039),_0x239486&&console['error'](_0x279361(0x179)));let _0x3fe50b;if(_0x429039)try{if(_0x429039[_0x279361(0x20f)]('@')){const _0x5d0a81=await import(_0x279361(0x211)),_0x47d930=_0x429039[_0x279361(0x264)](0x1),_0x252a43=await _0x5d0a81['readFile'](_0x47d930,_0x279361(0x233));_0x3fe50b=JSON['parse'](_0x252a43);}else _0x3fe50b=JSON[_0x279361(0x27a)](_0x429039);}catch{return console[_0x279361(0x1d3)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x3cea94['yes']){if(!isInteractive())return console['error'](a51_0x1e115a[_0x279361(0x1db)](_0x279361(0x166)),_0x279361(0x2f4)),console[_0x279361(0x1d3)](a51_0x1e115a[_0x279361(0x2f8)](_0x279361(0x2e3))),0x1;const _0x529770=await confirmKey(_0x279361(0x2c7)+(_0x14bf42?_0x279361(0x19e):_0x279361(0x302))+'\x20'+_0x4740c0+'?');if(!_0x529770)return console[_0x279361(0x1d3)](a51_0x1e115a[_0x279361(0x2d6)](_0x279361(0x207))),0x1;}let _0x597f3b;_0x14bf42?_0x597f3b=await withSpinner(_0x279361(0x170),()=>_0x25f966['workflow'][_0x279361(0x2c9)](_0x4740c0,{'fromTask':_0x11e806,'retryParams':_0x3fe50b}),{'verbose':_0x3cea94[_0x279361(0x2e6)]}):_0x597f3b=await withSpinner(_0x279361(0x27e),()=>_0x25f966[_0x279361(0x2ea)]['retryAttempt'](_0x4740c0,{'resumeFrom':_0x4f20b4,'retryParams':_0x3fe50b,'force':_0x239486}),{'verbose':_0x3cea94['verbose']});const _0x25c353=_0x597f3b[_0x279361(0x2c6)];return console[_0x279361(0x1d3)]('✔\x20Retry\x20started'),console[_0x279361(0x1d3)](_0x279361(0x2fc)+_0x25c353['attemptId']),console[_0x279361(0x1d3)](_0x279361(0x15c)+_0x25c353[_0x279361(0x167)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:run';[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x231);async[a51_0x56fa1c(0x192)](_0x27ef55){const _0x19ed10=a51_0x56fa1c,{options:_0x3586b7,args:_0x13c3c0,tdx:_0x8cca07}=_0x27ef55;let _0x4b39c7=_0x13c3c0[0x0];if(!_0x4b39c7){const _0x126710=this[_0x19ed10(0x1d5)]([],_0x3586b7),_0x534d29=await withSpinner('Loading\x20workflows...',()=>_0x8cca07[_0x19ed10(0x2ea)]['workflows'](_0x126710,{'limit':_0x3586b7[_0x19ed10(0x25d)]}),{'verbose':_0x3586b7[_0x19ed10(0x2e6)]}),_0x2d8e39=_0x534d29[_0x19ed10(0x2c6)];if(_0x2d8e39[_0x19ed10(0x2d7)]===0x0)return console['error']('No\x20workflows\x20found'),!_0x126710&&console[_0x19ed10(0x1d3)](a51_0x1e115a[_0x19ed10(0x2f8)](_0x19ed10(0x1e4))),0x1;const _0x500d81=_0x2d8e39[_0x19ed10(0x221)](_0x3d71ff=>({'title':_0x3d71ff[_0x19ed10(0x248)]?.[_0x19ed10(0x1cc)]+'.'+_0x3d71ff[_0x19ed10(0x1cc)],'value':_0x3d71ff[_0x19ed10(0x248)]?.[_0x19ed10(0x1cc)]+'.'+_0x3d71ff[_0x19ed10(0x1cc)],'description':_0x3d71ff[_0x19ed10(0x223)]?_0x19ed10(0x2e0)+_0x3d71ff[_0x19ed10(0x223)]:undefined})),_0x2ac1af=await a51_0x20619d({'type':_0x19ed10(0x2ca),'name':_0x19ed10(0x2ea),'message':_0x19ed10(0x176),'choices':_0x500d81});if(!_0x2ac1af[_0x19ed10(0x2ea)])return 0x1;_0x4b39c7=_0x2ac1af[_0x19ed10(0x2ea)];}if(!_0x4b39c7[_0x19ed10(0x281)]('.')){const _0x4df429=this[_0x19ed10(0x1d5)]([],_0x3586b7);if(_0x4df429)_0x4b39c7=_0x4df429+'.'+_0x4b39c7;else return console[_0x19ed10(0x1d3)](a51_0x1e115a[_0x19ed10(0x1db)](_0x19ed10(0x293)),_0x19ed10(0x299)),console['error'](a51_0x1e115a[_0x19ed10(0x2f8)](_0x19ed10(0x1e4))),0x1;}const _0x914f90=_0x3586b7[_0x19ed10(0x2c5)],_0x108b14=_0x3586b7[_0x19ed10(0x2c4)],_0x45cf14={};if(_0x914f90&&Array[_0x19ed10(0x1d9)](_0x914f90))for(const _0xf1213c of _0x914f90){const _0x43ae58=_0xf1213c[_0x19ed10(0x2b8)]('=');if(_0x43ae58===-0x1)return console['error'](_0x19ed10(0x1e6)+_0xf1213c),console[_0x19ed10(0x1d3)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1e77e6=_0xf1213c[_0x19ed10(0x264)](0x0,_0x43ae58),_0x357578=_0xf1213c[_0x19ed10(0x264)](_0x43ae58+0x1);try{_0x45cf14[_0x1e77e6]=JSON[_0x19ed10(0x27a)](_0x357578);}catch{_0x45cf14[_0x1e77e6]=_0x357578;}}_0x3586b7[_0x19ed10(0x2e6)]&&(console[_0x19ed10(0x1d3)]('Workflow:\x20'+_0x4b39c7),Object[_0x19ed10(0x1a1)](_0x45cf14)[_0x19ed10(0x2d7)]>0x0&&console[_0x19ed10(0x1d3)](_0x19ed10(0x1e3)+JSON[_0x19ed10(0x18b)](_0x45cf14)),_0x108b14&&console[_0x19ed10(0x1d3)](_0x19ed10(0x1fd)+_0x108b14));const _0x45a458=await withSpinner('Starting\x20workflow\x20run...',()=>_0x8cca07[_0x19ed10(0x2ea)][_0x19ed10(0x2b5)](_0x4b39c7,_0x45cf14,{'sessionTime':_0x108b14}),{'verbose':_0x3586b7[_0x19ed10(0x2e6)]}),_0x5c8519=_0x45a458[_0x19ed10(0x2c6)];console[_0x19ed10(0x1d3)]('✔\x20Workflow\x20run\x20started'),console['error'](_0x19ed10(0x227)+_0x5c8519['id']),console[_0x19ed10(0x1d3)](_0x19ed10(0x15c)+_0x5c8519['sessionId']),console[_0x19ed10(0x1d3)]('\x20\x20Project:\x20'+_0x5c8519['project']?.[_0x19ed10(0x1cc)]),console[_0x19ed10(0x1d3)]('\x20\x20Workflow:\x20'+_0x5c8519[_0x19ed10(0x2ea)]?.[_0x19ed10(0x1cc)]);if(_0x5c8519['project']?.['id']&&_0x5c8519[_0x19ed10(0x167)]&&_0x5c8519['id']){const _0x281843=_0x3586b7[_0x19ed10(0x2dd)],_0x23e8d8=getConsoleUrl(_0x281843,_0x19ed10(0x197)+_0x5c8519['project']['id']+_0x19ed10(0x1e8)+_0x5c8519[_0x19ed10(0x167)]+_0x19ed10(0x23b)+_0x5c8519['id']);console[_0x19ed10(0x1d3)]('\x20\x20Console:\x20'+a51_0x1e115a[_0x19ed10(0x1a0)](_0x23e8d8));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x26f);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x26d);async[a51_0x56fa1c(0x192)](_0x4ff756){const _0x30e155=a51_0x56fa1c,{options:_0x477b84,args:_0x28456b,tdx:_0x3872cf}=_0x4ff756,_0x25de72=_0x28456b[0x0],_0x22f2ba=_0x28456b[0x1]||'.';if(!_0x25de72)return console[_0x30e155(0x1d3)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x30e155(0x1d3)](_0x30e155(0x2cd)),0x1;const _0x875c3=_0x477b84[_0x30e155(0x223)];_0x477b84[_0x30e155(0x2e6)]&&(console[_0x30e155(0x1d3)](_0x30e155(0x27d)+_0x25de72),console['error'](_0x30e155(0x214)+_0x22f2ba),_0x875c3&&console[_0x30e155(0x1d3)](_0x30e155(0x2d4)+_0x875c3));const _0x518cbf=await withSpinner(_0x30e155(0x2a2)+_0x25de72+_0x30e155(0x24a),()=>_0x3872cf[_0x30e155(0x2ea)][_0x30e155(0x284)](_0x25de72,_0x22f2ba,{'revision':_0x875c3}),{'verbose':_0x477b84[_0x30e155(0x2e6)]}),_0x35fef5=_0x518cbf[_0x30e155(0x2c6)];return console[_0x30e155(0x1d3)](_0x30e155(0x1b1)+_0x35fef5[_0x30e155(0x162)]),console['error']('\x20\x20Revision:\x20'+_0x35fef5[_0x30e155(0x223)]),console[_0x30e155(0x1d3)]('\x20\x20Files\x20extracted:\x20'+_0x35fef5[_0x30e155(0x2b2)]),console[_0x30e155(0x1d3)]('\x20\x20Location:\x20'+_0x22f2ba+'/'+_0x35fef5[_0x30e155(0x162)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{['name']=a51_0x56fa1c(0x247);['description']=a51_0x56fa1c(0x168);async[a51_0x56fa1c(0x192)](_0x27fcce){const _0x14effb=a51_0x56fa1c,{options:_0x31baa8,args:_0x495b9f,tdx:_0x9f50e7}=_0x27fcce;let _0x2538d8='.',_0x592c2e=_0x31baa8['name'];if(_0x495b9f[0x0]){const {promises:_0x36a43d}=await import('fs');try{const _0x51fd13=await _0x36a43d['stat'](_0x495b9f[0x0]);if(_0x51fd13['isDirectory']())_0x2538d8=_0x495b9f[0x0];else return console[_0x14effb(0x1d3)]('Error:\x20'+_0x495b9f[0x0]+_0x14effb(0x1e7)),0x1;}catch{_0x592c2e=_0x495b9f[0x0],_0x2538d8='.';}}const _0x5e5333=_0x31baa8['revision'],_0x4b9a8e=_0x31baa8[_0x14effb(0x224)];_0x31baa8[_0x14effb(0x2e6)]&&(console['error'](_0x14effb(0x2d2)+_0x2538d8),_0x592c2e&&console[_0x14effb(0x1d3)](_0x14effb(0x294)+_0x592c2e),_0x5e5333&&console[_0x14effb(0x1d3)](_0x14effb(0x2d4)+_0x5e5333),_0x4b9a8e&&console[_0x14effb(0x1d3)](_0x14effb(0x2ad)));const _0x532eb2=await withSpinner(_0x14effb(0x15b),()=>_0x9f50e7[_0x14effb(0x2ea)]['push'](_0x2538d8,{'projectName':_0x592c2e,'revision':_0x5e5333,'skipValidation':_0x4b9a8e}),{'verbose':_0x31baa8[_0x14effb(0x2e6)]}),_0x37cf17=_0x532eb2[_0x14effb(0x2c6)];return console[_0x14effb(0x1d3)](_0x14effb(0x15a)+_0x37cf17[_0x14effb(0x162)]),console[_0x14effb(0x1d3)]('\x20\x20Project\x20ID:\x20'+_0x37cf17[_0x14effb(0x1ce)]),console[_0x14effb(0x1d3)](_0x14effb(0x206)+_0x37cf17['revision']),await this[_0x14effb(0x1d7)](_0x9f50e7,_0x37cf17[_0x14effb(0x162)],_0x31baa8[_0x14effb(0x2dd)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x180);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x1d6);async['execute'](_0x1ec7e2){const _0x5a4e3e=a51_0x56fa1c,{options:_0x1db374,args:_0x348bce,tdx:_0x197242}=_0x1ec7e2,_0x2bdd44=_0x348bce[0x0],_0x363c56=_0x348bce[0x1];if(!_0x2bdd44)return console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x1db)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x2f8)]('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x50216e=_0x1db374[_0x5a4e3e(0x223)];_0x1db374['verbose']&&(console[_0x5a4e3e(0x1d3)]('Project:\x20'+_0x2bdd44),_0x363c56&&console['error']('Target\x20directory:\x20'+_0x363c56),_0x50216e&&console[_0x5a4e3e(0x1d3)]('Revision:\x20'+_0x50216e),_0x1db374[_0x5a4e3e(0x2bd)]&&console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x2d5)));const _0x599947=await withSpinner('Pulling\x20project\x20'+_0x2bdd44+_0x5a4e3e(0x24a),()=>_0x197242['workflow'][_0x5a4e3e(0x28b)](_0x2bdd44,{'targetDir':_0x363c56,'revision':_0x50216e}),{'verbose':_0x1db374[_0x5a4e3e(0x2e6)]}),_0x487f93=_0x599947['data'];_0x487f93[_0x5a4e3e(0x29e)]?console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x2f2)+_0x487f93[_0x5a4e3e(0x162)]):console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x230)+_0x487f93[_0x5a4e3e(0x162)]);console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x206)+_0x487f93[_0x5a4e3e(0x223)]),console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x282)+(a51_0x58f6d7[_0x5a4e3e(0x2b7)](process[_0x5a4e3e(0x1c0)](),_0x487f93[_0x5a4e3e(0x29f)])||'.')),console[_0x5a4e3e(0x1d3)](_0x5a4e3e(0x2a8)+a51_0x1e115a[_0x5a4e3e(0x17e)]('+'+_0x487f93[_0x5a4e3e(0x28a)]['new']+_0x5a4e3e(0x2e4))+',\x20'+(a51_0x1e115a[_0x5a4e3e(0x2d6)]('~'+_0x487f93[_0x5a4e3e(0x28a)][_0x5a4e3e(0x232)]+_0x5a4e3e(0x240))+',\x20')+(a51_0x1e115a[_0x5a4e3e(0x1db)]('-'+_0x487f93[_0x5a4e3e(0x28a)][_0x5a4e3e(0x160)]+_0x5a4e3e(0x238))+',\x20')+(''+a51_0x1e115a['dim'](_0x487f93['summary'][_0x5a4e3e(0x20e)]+'\x20unchanged')));for(const _0x58f69f of _0x487f93[_0x5a4e3e(0x1a8)]){_0x58f69f[_0x5a4e3e(0x257)]===_0x5a4e3e(0x232)&&_0x58f69f[_0x5a4e3e(0x296)]&&(console['error']('\x0a'+a51_0x1e115a[_0x5a4e3e(0x1a0)]('---\x20'+_0x58f69f['path'])),console['error'](_0x58f69f[_0x5a4e3e(0x296)]));}if(!_0x487f93[_0x5a4e3e(0x2f9)])return saveSessionContext({'workflow_project':_0x487f93[_0x5a4e3e(0x162)]},_0x1db374[_0x5a4e3e(0x19e)]),console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x17e)](_0x5a4e3e(0x1de))),console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x2f8)]('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x487f93['projectName'])),0x0;if(_0x1db374[_0x5a4e3e(0x2bd)])return console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x2d6)](_0x5a4e3e(0x1f8))),0x0;if(!_0x1db374[_0x5a4e3e(0x17d)]){if(!isInteractive())return console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x1db)]('\x0aError:'),_0x5a4e3e(0x2f4)),console[_0x5a4e3e(0x1d3)](a51_0x1e115a['dim'](_0x5a4e3e(0x2e3))),0x1;const _0x52b166=await confirmKey(_0x5a4e3e(0x2f3));if(!_0x52b166)return console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x2d6)](_0x5a4e3e(0x207)),_0x5a4e3e(0x21d)),0x1;}await withSpinner(_0x5a4e3e(0x209),()=>_0x197242[_0x5a4e3e(0x2ea)][_0x5a4e3e(0x26a)](_0x487f93,{'revision':_0x50216e}),{'verbose':_0x1db374[_0x5a4e3e(0x2e6)]}),saveSessionContext({'workflow_project':_0x487f93[_0x5a4e3e(0x162)]},_0x1db374[_0x5a4e3e(0x19e)]),console['error'](a51_0x1e115a[_0x5a4e3e(0x17e)]('✔\x20Pull\x20complete'));const _0x395618=a51_0x58f6d7[_0x5a4e3e(0x2b7)](process[_0x5a4e3e(0x1c0)](),_0x487f93[_0x5a4e3e(0x29f)])||'.';return console[_0x5a4e3e(0x1d3)](a51_0x1e115a[_0x5a4e3e(0x2f8)]('\x20\x20Location:\x20'+_0x395618)),console['error'](a51_0x1e115a[_0x5a4e3e(0x2f8)](_0x5a4e3e(0x1b6)+_0x487f93['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x1f5);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x218);async['execute'](_0x5054ac){const _0x21aab1=a51_0x56fa1c,{options:_0x4e3aeb,args:_0x3a9368,tdx:_0x1b092e}=_0x5054ac,_0x3f8956=this['resolveProjectDir'](_0x3a9368,_0x4e3aeb),_0x393aba=_0x4e3aeb[_0x21aab1(0x223)],_0x4847c3=_0x4e3aeb[_0x21aab1(0x224)];_0x4e3aeb['verbose']&&(_0x3f8956&&console[_0x21aab1(0x1d3)](_0x21aab1(0x1d8)+_0x3f8956),_0x393aba&&console['error']('Revision:\x20'+_0x393aba),_0x4e3aeb[_0x21aab1(0x2bd)]&&console[_0x21aab1(0x1d3)](_0x21aab1(0x2d5)),_0x4847c3&&console[_0x21aab1(0x1d3)]('Validation:\x20skipped'));let _0x405eba;try{_0x405eba=await withSpinner('Analyzing\x20changes...',()=>_0x1b092e['workflow'][_0x21aab1(0x271)]({'sourceDir':_0x3f8956,'revision':_0x393aba,'skipValidation':_0x4847c3}),{'verbose':_0x4e3aeb[_0x21aab1(0x2e6)]});}catch(_0x5ab494){if(_0x5ab494 instanceof Error&&_0x5ab494[_0x21aab1(0x2f1)][_0x21aab1(0x281)](_0x21aab1(0x263)))return console['error'](a51_0x1e115a[_0x21aab1(0x1db)](_0x21aab1(0x293)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x4e3aeb['workflowProject']?console[_0x21aab1(0x1d3)](a51_0x1e115a['dim'](_0x21aab1(0x17f)+_0x4e3aeb[_0x21aab1(0x17a)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x4e3aeb[_0x21aab1(0x17a)]+'\x27')):console[_0x21aab1(0x1d3)](a51_0x1e115a[_0x21aab1(0x2f8)]('Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.')),0x1;throw _0x5ab494;}const _0x1fdf0a=_0x405eba[_0x21aab1(0x2c6)];console['error'](_0x21aab1(0x1fc)+_0x1fdf0a[_0x21aab1(0x162)]),console[_0x21aab1(0x1d3)](_0x21aab1(0x1d1)+_0x1fdf0a[_0x21aab1(0x289)]),console[_0x21aab1(0x1d3)](_0x21aab1(0x206)+_0x1fdf0a[_0x21aab1(0x223)]),console[_0x21aab1(0x1d3)](_0x21aab1(0x2a8)+a51_0x1e115a['green']('+'+_0x1fdf0a[_0x21aab1(0x28a)][_0x21aab1(0x22a)]+'\x20new')+',\x20'+(a51_0x1e115a[_0x21aab1(0x2d6)]('~'+_0x1fdf0a['summary'][_0x21aab1(0x232)]+'\x20modified')+',\x20')+(a51_0x1e115a[_0x21aab1(0x1db)]('-'+_0x1fdf0a[_0x21aab1(0x28a)][_0x21aab1(0x160)]+_0x21aab1(0x238))+',\x20')+(''+a51_0x1e115a['dim'](_0x1fdf0a[_0x21aab1(0x28a)][_0x21aab1(0x20e)]+_0x21aab1(0x16a))));for(const _0xc1333b of _0x1fdf0a[_0x21aab1(0x1a8)]){_0xc1333b[_0x21aab1(0x257)]===_0x21aab1(0x232)&&_0xc1333b['diff']&&(console[_0x21aab1(0x1d3)]('\x0a'+a51_0x1e115a[_0x21aab1(0x1a0)](_0x21aab1(0x2c3)+_0xc1333b[_0x21aab1(0x1f9)])),console[_0x21aab1(0x1d3)](_0xc1333b[_0x21aab1(0x296)]));}if(!_0x1fdf0a[_0x21aab1(0x2f9)])return console[_0x21aab1(0x1d3)](a51_0x1e115a['green'](_0x21aab1(0x199))),await this[_0x21aab1(0x1d7)](_0x1b092e,_0x1fdf0a[_0x21aab1(0x162)],_0x4e3aeb[_0x21aab1(0x2dd)]),0x0;if(_0x4e3aeb[_0x21aab1(0x2bd)])return console[_0x21aab1(0x1d3)](a51_0x1e115a[_0x21aab1(0x2d6)](_0x21aab1(0x27b))),0x0;if(!_0x4e3aeb[_0x21aab1(0x17d)]){if(!isInteractive())return console[_0x21aab1(0x1d3)](a51_0x1e115a['red'](_0x21aab1(0x166)),_0x21aab1(0x2f4)),console[_0x21aab1(0x1d3)](a51_0x1e115a['dim'](_0x21aab1(0x2e3))),0x1;const _0x8f6a65=await confirmKey(_0x21aab1(0x16c));if(!_0x8f6a65)return console[_0x21aab1(0x1d3)](a51_0x1e115a[_0x21aab1(0x2d6)](_0x21aab1(0x207)),_0x21aab1(0x1dc)),0x1;}const _0x280293=await withSpinner(_0x21aab1(0x163),()=>_0x1b092e[_0x21aab1(0x2ea)]['executePushProject'](_0x1fdf0a),{'verbose':_0x4e3aeb[_0x21aab1(0x2e6)]}),_0xc0146b=_0x280293['data'];return console['error'](a51_0x1e115a[_0x21aab1(0x17e)](_0x21aab1(0x1e9))),console[_0x21aab1(0x1d3)](_0x21aab1(0x1a5)+_0xc0146b[_0x21aab1(0x1ce)]),console[_0x21aab1(0x1d3)](_0x21aab1(0x206)+_0xc0146b[_0x21aab1(0x223)]),await this[_0x21aab1(0x1d7)](_0x1b092e,_0xc0146b[_0x21aab1(0x162)],_0x4e3aeb[_0x21aab1(0x2dd)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a51_0x56fa1c(0x2cf);['description']=a51_0x56fa1c(0x2ac);async[a51_0x56fa1c(0x192)](_0x35a8c8){const _0x19f738=a51_0x56fa1c,{options:_0x487ad3,args:_0x38b2cf,tdx:_0x118b91}=_0x35a8c8,_0x5d122b=this[_0x19f738(0x19b)](_0x38b2cf,_0x487ad3),_0x26e95f=_0x487ad3[_0x19f738(0x1cc)],_0x5b9eaf=_0x487ad3[_0x19f738(0x223)],_0x35e369=_0x487ad3[_0x19f738(0x224)];if(!_0x5d122b)return console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x1db)](_0x19f738(0x293)),'Source\x20directory\x20is\x20required'),console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x2f8)](_0x19f738(0x24f))),console[_0x19f738(0x1d3)](a51_0x1e115a['dim']('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x26e95f)return console['error'](a51_0x1e115a[_0x19f738(0x1db)](_0x19f738(0x293)),_0x19f738(0x2a1)),console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x2f8)](_0x19f738(0x24f))),0x1;_0x487ad3[_0x19f738(0x2e6)]&&(console[_0x19f738(0x1d3)](_0x19f738(0x1d8)+_0x5d122b),console[_0x19f738(0x1d3)](_0x19f738(0x2f5)+_0x26e95f),_0x5b9eaf&&console[_0x19f738(0x1d3)](_0x19f738(0x2d4)+_0x5b9eaf),_0x487ad3[_0x19f738(0x2bd)]&&console[_0x19f738(0x1d3)](_0x19f738(0x2d5)),_0x35e369&&console['error'](_0x19f738(0x2ad)));const _0x582f59=await withSpinner(_0x19f738(0x2ab),()=>_0x118b91[_0x19f738(0x2ea)]['prepareCloneProject'](_0x5d122b,_0x26e95f,{'revision':_0x5b9eaf,'skipValidation':_0x35e369}),{'verbose':_0x487ad3['verbose']}),_0x18fbe8=_0x582f59[_0x19f738(0x2c6)];console[_0x19f738(0x1d3)](_0x19f738(0x276)+_0x18fbe8[_0x19f738(0x289)]);_0x18fbe8['sourceProjectName']&&console[_0x19f738(0x1d3)]('Source\x20project:\x20'+_0x18fbe8['sourceProjectName']);console[_0x19f738(0x1d3)](_0x19f738(0x2f5)+_0x18fbe8[_0x19f738(0x1b0)]),console[_0x19f738(0x1d3)](_0x19f738(0x2d4)+_0x18fbe8[_0x19f738(0x223)]),console[_0x19f738(0x1d3)](_0x19f738(0x2e1)+_0x18fbe8['fileCount']);_0x18fbe8[_0x19f738(0x23f)]&&(console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x2d6)](_0x19f738(0x22e)+_0x18fbe8[_0x19f738(0x1b0)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x18fbe8['existingProjectId']+')')),console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x2d6)](_0x19f738(0x1dd))));if(_0x487ad3[_0x19f738(0x2bd)])return console[_0x19f738(0x1d3)](a51_0x1e115a['yellow'](_0x19f738(0x27c))),0x0;if(!_0x487ad3[_0x19f738(0x17d)]){if(!isInteractive())return console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x1db)](_0x19f738(0x166)),_0x19f738(0x2f4)),console[_0x19f738(0x1d3)](a51_0x1e115a['dim'](_0x19f738(0x2e3))),0x1;const _0x50e5d2=_0x18fbe8[_0x19f738(0x2b0)]||a51_0x58f6d7[_0x19f738(0x196)](_0x5d122b),_0x4e7591=_0x18fbe8[_0x19f738(0x23f)]?_0x19f738(0x215)+_0x26e95f+_0x19f738(0x186):_0x19f738(0x22b)+_0x50e5d2+_0x19f738(0x1a7)+_0x26e95f+'\x22?',_0x233e71=await confirmKey(_0x4e7591);if(!_0x233e71)return console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x2d6)](_0x19f738(0x207))),0x1;}const _0x390cab=await withSpinner(_0x18fbe8[_0x19f738(0x23f)]?_0x19f738(0x2e5)+_0x26e95f+_0x19f738(0x24a):_0x19f738(0x301)+_0x26e95f+_0x19f738(0x24a),()=>_0x118b91['workflow'][_0x19f738(0x288)](_0x18fbe8),{'verbose':_0x487ad3[_0x19f738(0x2e6)]}),_0x4dd6e4=_0x390cab[_0x19f738(0x2c6)];return console[_0x19f738(0x1d3)](a51_0x1e115a[_0x19f738(0x17e)](_0x18fbe8['targetExists']?'✔\x20Project\x20updated':'✔\x20Clone\x20complete')),console[_0x19f738(0x1d3)](_0x19f738(0x24b)+_0x4dd6e4['newProjectName']),console['error'](_0x19f738(0x1a5)+_0x4dd6e4[_0x19f738(0x25e)]),console[_0x19f738(0x1d3)](_0x19f738(0x206)+_0x4dd6e4[_0x19f738(0x223)]),await this[_0x19f738(0x1d7)](_0x118b91,_0x4dd6e4[_0x19f738(0x1b0)],_0x487ad3['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a51_0x56fa1c(0x1cc)]='workflow:delete';[a51_0x56fa1c(0x198)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a51_0x56fa1c(0x192)](_0x4ed274){const _0x3ef66=a51_0x56fa1c,{options:_0x59b1f1,args:_0x5870ed,tdx:_0x43ba25}=_0x4ed274,_0x4a21a5=_0x5870ed[0x0];if(!_0x4a21a5)return console[_0x3ef66(0x1d3)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x3ef66(0x1d3)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x59b1f1['verbose']&&console[_0x3ef66(0x1d3)](_0x3ef66(0x27d)+_0x4a21a5);if(!_0x59b1f1['yes']){if(!isInteractive())return console[_0x3ef66(0x1d3)](a51_0x1e115a['red'](_0x3ef66(0x166)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a51_0x1e115a[_0x3ef66(0x2f8)](_0x3ef66(0x2e3))),0x1;const _0x590285=await confirmKey(_0x3ef66(0x24e)+_0x4a21a5+_0x3ef66(0x195));if(!_0x590285)return console[_0x3ef66(0x1d3)](a51_0x1e115a[_0x3ef66(0x2d6)](_0x3ef66(0x207))),0x1;}const _0x21a6fd=await withSpinner(_0x3ef66(0x1ae)+_0x4a21a5+'...',()=>_0x43ba25['workflow'][_0x3ef66(0x251)](_0x4a21a5),{'verbose':_0x59b1f1[_0x3ef66(0x2e6)]}),_0x2b4460=_0x21a6fd[_0x3ef66(0x2c6)];return console[_0x3ef66(0x1d3)](_0x3ef66(0x1b5)+_0x2b4460[_0x3ef66(0x162)]),console[_0x3ef66(0x1d3)](_0x3ef66(0x1a5)+_0x2b4460[_0x3ef66(0x1ce)]),0x0;}}function a51_0x10a5(_0x45badf,_0x531d5e){_0x45badf=_0x45badf-0x15a;const _0x5c2770=a51_0x5c27();let _0x10a514=_0x5c2770[_0x45badf];return _0x10a514;}export function parseKeyValue(_0x1ca197){const _0x7efabd=a51_0x56fa1c,_0x59d529=_0x1ca197['indexOf']('=');if(_0x59d529===-0x1)throw new Error(_0x7efabd(0x26c)+_0x1ca197+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x2752dd=_0x1ca197[_0x7efabd(0x264)](0x0,_0x59d529),_0xeba245=_0x1ca197[_0x7efabd(0x264)](_0x59d529+0x1);if(!_0x2752dd)throw new Error(_0x7efabd(0x205));return{'key':_0x2752dd,'value':_0xeba245};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x260);['description']=a51_0x56fa1c(0x300);async[a51_0x56fa1c(0x192)](_0x1085df){const _0x4915d0=a51_0x56fa1c,{options:_0x2aa8ef,args:_0x1f313a,tdx:_0x257036}=_0x1085df,_0x4f0361=this[_0x4915d0(0x2dc)](_0x1f313a,_0x2aa8ef);if(!_0x4f0361)return 0x1;_0x2aa8ef['verbose']&&console[_0x4915d0(0x1d3)](_0x4915d0(0x27d)+_0x4f0361);const _0x35468d=await withSpinner('Listing\x20secrets...',()=>_0x257036['workflow'][_0x4915d0(0x203)](_0x4f0361),{'verbose':_0x2aa8ef[_0x4915d0(0x2e6)]}),{secrets:_0xb5fdad}=_0x35468d[_0x4915d0(0x2c6)];return console[_0x4915d0(0x1d3)](_0x4915d0(0x2eb)+_0xb5fdad['length']+'\x20secret'+(_0xb5fdad[_0x4915d0(0x2d7)]!==0x1?'s':'')),await handleSDKOutput(_0xb5fdad,_0x2aa8ef),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a51_0x56fa1c(0x2a9);['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a51_0x56fa1c(0x192)](_0xbeb3b1){const _0x34c23d=a51_0x56fa1c,{options:_0x59372b,args:_0x1b4f9b,tdx:_0x3eb05e}=_0xbeb3b1;let _0x50d77f,_0x1707d2;if(_0x1b4f9b[_0x34c23d(0x2d7)]>=0x2)_0x50d77f=_0x1b4f9b[0x0],_0x1707d2=_0x1b4f9b[0x1];else{if(_0x1b4f9b[_0x34c23d(0x2d7)]===0x1&&_0x59372b[_0x34c23d(0x17a)])_0x50d77f=_0x59372b[_0x34c23d(0x17a)],_0x1707d2=_0x1b4f9b[0x0];else return _0x1b4f9b[_0x34c23d(0x2d7)]===0x1?(console[_0x34c23d(0x1d3)](_0x34c23d(0x1b3)),console['error'](_0x34c23d(0x1e4)),0x1):(console[_0x34c23d(0x1d3)](_0x34c23d(0x228)),console['error'](_0x34c23d(0x279)),0x1);}let _0x56adb7,_0x3740db;try{({key:_0x56adb7,value:_0x3740db}=parseKeyValue(_0x1707d2));}catch(_0x121c4f){return _0x121c4f instanceof Error&&console['error'](a51_0x1e115a[_0x34c23d(0x1db)]('Error:'),_0x121c4f[_0x34c23d(0x2f1)]),0x1;}_0x59372b[_0x34c23d(0x2e6)]&&(console[_0x34c23d(0x1d3)](_0x34c23d(0x27d)+_0x50d77f),console[_0x34c23d(0x1d3)](_0x34c23d(0x2ee)+_0x56adb7));const _0x710848=await withSpinner(_0x34c23d(0x1c1),()=>_0x3eb05e[_0x34c23d(0x2ea)][_0x34c23d(0x217)](_0x50d77f,_0x56adb7,_0x3740db),{'verbose':_0x59372b['verbose']}),_0x13c5ca=_0x710848[_0x34c23d(0x2c6)];return console[_0x34c23d(0x1d3)]('✔\x20Secret\x20\x27'+_0x13c5ca[_0x34c23d(0x2de)]+_0x34c23d(0x26e)+_0x13c5ca['projectName']+'\x27'),(_0x59372b[_0x34c23d(0x18d)]||_0x59372b['jsonl'])&&await handleSingleObjectOutput(_0x13c5ca,_0x59372b),0x0;}}function a51_0x5c27(){const _0x57458c=['success','Force:\x20yes','workflowProject','logs','🔄\x20','yes','green','Tip:\x20cd\x20to\x20workflows/','workflow:pull','MAX_POLL_ITERATIONS','Show\x20tasks\x20for\x20an\x20attempt','metadata','format','output','\x22\x20with\x20new\x20revision?','Fetching\x20log\x20files...','No\x20sessions\x20found\x20for:\x20','\x20tasks','running','stringify','workflow:kill','json','MIN_LABEL_COUNT','all','Filter:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','execute','floor','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','\x22?\x20This\x20cannot\x20be\x20undone.','basename','/app/workflows/','description','\x0a✔\x20No\x20changes\x20to\x20push','workflow:timeline','resolveProjectDir','logFiles','text','session','Target:\x20','cyan','keys','\x0aPolling...\x20(','Listing\x20workflow\x20projects...','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','\x20\x20Project\x20ID:\x20','Kill\x20a\x20running\x20attempt','\x22\x20to\x20new\x20project\x20\x22','changes','\x20from\x20session\x20','replace','\x20-\x20','No\x20sessions\x20with\x20timing\x20information','No\x20matching\x20sessions\x20found','Deleting\x20project\x20','Error:\x20Attempt\x20ID\x20is\x20required','newProjectName','✔\x20Downloaded\x20','Getting\x20attempt\x20details...','Error:\x20Project\x20name\x20is\x20required','Params:\x20','✔\x20Deleted\x20project\x20','\x20\x20Session\x20context\x20set\x20to:\x20','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','value','every','getFullYear','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20of\x20','\x20\x20Console:\x20','navigateSessionsInteractive','cwd','Setting\x20secret...','workflow:projects','ICON_WIDTH','min','14tkuxqh','LABEL_MIN_SPACING','renderSingleTimeline','POLL_INTERVAL_MS','5560dxHQXN','\x20task','now','name','tasks','projectId','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','split','\x20\x20Source:\x20','repeat','error','parseProjectWorkflowPattern','resolveProject','Pull\x20workflow\x20project\x20to\x20local\x20folder','showWorkflowConsoleUrl','Source\x20directory:\x20','isArray','end','red','-\x20nothing\x20pushed','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','\x0a✔\x20Already\x20up\x20to\x20date','blue','pollTimeline','lastAttempt','Pattern:\x20','Parameters:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','columns','Error:\x20Invalid\x20parameter\x20format:\x20','\x20is\x20not\x20a\x20directory','/sessions/','✔\x20Push\x20complete','MIN_TIMELINE_WIDTH','1662378Vowims','Include\x20retried:\x20yes','workflow:attempt','tdx.json','Project\x20filter:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','Session\x20not\x20found:\x20','generateSessionTimelineRows','sort','workflow:push','\x20has\x20no\x20attempts','9378QdqzRI','\x0aDry\x20run\x20-\x20no\x20files\x20written','path','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','stdout','✔\x20Project:\x20','Session\x20time:\x20','taskName','Attempt:\x20','sys','getMinutes','⚠\x20Showing\x20first\x20','listSecrets','splice','Key\x20cannot\x20be\x20empty','\x20\x20Revision:\x20','Cancelled','slice','Writing\x20files...','autocomplete','\x20project','📁\x20','finishedAt','unchanged','startsWith','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','fs/promises','attempt:','push','Output\x20directory:\x20','\x0aUpdate\x20existing\x20project\x20\x22','values','setSecret','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','match','\x0aFailed\x20to\x20fetch\x20attempt\x20data','fileSize','getDate','-\x20no\x20files\x20written','Status:\x20','Retry\x20a\x20session\x20or\x20attempt','Auto-selected\x20latest\x20session:\x20','map','canceling','revision','skipValidation','Listing\x20workflows...','No\x20attempts\x20found\x20in\x20project:\x20','\x20\x20Attempt\x20ID:\x20','Error:\x20KEY=VALUE\x20is\x20required','projects','new','\x0aClone\x20\x22','max','group_error','\x0a⚠\x20Project\x20\x22','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','→\x20Project:\x20','Start\x20a\x20workflow\x20run','modified','utf-8','jsonl','✔\x20Secret\x20\x27','Deleting\x20secret...','1370376toFhIn','\x20deleted','title','status','/attempt/','buildTimelineData','Failed\x20to\x20fetch\x20attempt\x20data','MAX_TASKS_DISPLAY','targetExists','\x20modified','ICON_SPACING','sessions','Warning:','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','duration','workflow:upload','project','Attempt\x20ID:\x20','...','\x20\x20Project:\x20','has','updatedAt','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:secrets:delete','delete','1003220KhCMLW','List\x20all\x20workflow\x20projects','\x1b[1A\x1b[2K','toLowerCase','From\x20task:\x20','type','attemptId','some','✔\x20Workflow\x20project\x20set\x20to:\x20','\x20\x20tdx\x20wf\x20use\x20<project>','\x20(use\x20--limit\x20to\x20show\x20more)','limit','newProjectId','join','workflow:secrets:list','workflowName','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','No\x20workflow\x20tdx.json\x20found','substring','clear','task','workflow:use','unknown','renderTimeline','applyPullProject','No\x20workflow\x20sessions\x20found','Invalid\x20format:\x20','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','workflow:download','TASK_NAME_WIDTH','preparePushProject','startTime','📋\x20','No\x20workflow\x20projects\x20found','size','Source:\x20','getHours','cancelRequested','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','parse','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x0aDry\x20run\x20-\x20no\x20project\x20created','Project:\x20','Retrying\x20attempt...','\x27\x20from\x20project\x20\x27','get','includes','\x20\x20Target:\x20','Listing\x20workflow\x20sessions...','download','window','resolve','createdAt','executeCloneProject','sourceDir','summary','pullProject','Using\x20attempt\x20','deleteSecret','List\x20workflow\x20execution\x20sessions','durationMs','list','Show\x20specific\x20attempt\x20details','LABEL_WIDTH_DIVISOR','Error:','Project\x20name:\x20','force','diff','List\x20workflows','Loading\x20sessions...','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','No\x20attempts\x20found','index','retryAttemptName','No\x20sessions\x20found','isNewProject','targetDir','84826saFyQZ','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','Downloading\x20project\x20','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resume\x20from:\x20','rows','includeSubtasks','(use\x20--limit\x20to\x20see\x20more)','\x20\x20Changes:\x20','workflow:secrets:set','follow','Analyzing\x20project...','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Validation:\x20skipped','trimEnd','planned','sourceProjectName','Getting\x20attempt\x20tasks...','filesExtracted','padStart','No\x20workflows\x20found','run','15BKZPFa','relative','indexOf','MAX_LABEL_COUNT','find','renderSessionsTimeline','trim','dryRun','💡\x20Tip:\x20Use\x20','14698189QYzLPT','Including\x20subtasks:\x20yes','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','workflow:tasks','---\x20','sessionTime','param','data','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','startedAt','retrySession','select','context','isTTY','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','filter','workflow:clone','Session\x20','\x27...','Project\x20directory:\x20','Filter:\x20project=','Revision:\x20','Dry\x20run:\x20yes','yellow','length','No\x20sessions\x20found\x20in\x20project:\x20','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','params','1444899kCxmSH','requireProject','site','key','fill','revision:\x20','Files\x20to\x20upload:\x20','workflows','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new','Updating\x20','verbose','localeCompare','Project\x20name\x20is\x20required','fullName','workflow','✔\x20Found\x20','done','icon','Key:\x20','attempts','Downloading\x20logs...','message','→\x20New\x20project:\x20','\x0aApply\x20these\x20changes?','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20project\x20name:\x20','state','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','dim','hasChanges','Loading\x20session...','fromTask','\x20\x20New\x20attempt\x20ID:\x20','7LYLeIB','start','Killing\x20attempt...','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Cloning\x20to\x20','attempt','✔\x20Pushed\x20','Pushing\x20workflow\x20project...','\x20\x20Session\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20timeline:','toISOString','write','deleted','getTime','projectName','Pushing\x20project...','resumeFrom','\x20sessions\x20','\x0aError:','sessionId','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','round','\x20unchanged','reason','\x0aPush\x20these\x20changes?','table','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','getMonth','Retrying\x20session...','log','set','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','Show\x20logs\x20for\x20a\x20workflow\x20attempt','displayLine','Select\x20a\x20workflow\x20to\x20run','pending'];a51_0x5c27=function(){return _0x57458c;};return a51_0x5c27();}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x250);[a51_0x56fa1c(0x198)]=a51_0x56fa1c(0x1fa);async['execute'](_0x4208ee){const _0x5587a9=a51_0x56fa1c,{options:_0x417d7a,args:_0x65832a,tdx:_0xf8e509}=_0x4208ee;let _0x2accb4,_0x402c71;if(_0x65832a[_0x5587a9(0x2d7)]>=0x2)_0x2accb4=_0x65832a[0x0],_0x402c71=_0x65832a[0x1];else{if(_0x65832a[_0x5587a9(0x2d7)]===0x1&&_0x417d7a[_0x5587a9(0x17a)])_0x2accb4=_0x417d7a[_0x5587a9(0x17a)],_0x402c71=_0x65832a[0x0];else return _0x65832a[_0x5587a9(0x2d7)]===0x1?(console[_0x5587a9(0x1d3)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x5587a9(0x1e4)),0x1):(console[_0x5587a9(0x1d3)]('Error:\x20Secret\x20key\x20is\x20required'),console['error'](_0x5587a9(0x173)),0x1);}_0x417d7a[_0x5587a9(0x2e6)]&&(console[_0x5587a9(0x1d3)](_0x5587a9(0x27d)+_0x2accb4),console[_0x5587a9(0x1d3)](_0x5587a9(0x2ee)+_0x402c71));if(!_0x417d7a[_0x5587a9(0x17d)]){if(!isInteractive())return console[_0x5587a9(0x1d3)](a51_0x1e115a[_0x5587a9(0x1db)](_0x5587a9(0x166)),_0x5587a9(0x2f4)),console['error'](a51_0x1e115a[_0x5587a9(0x2f8)](_0x5587a9(0x2e3))),0x1;const _0x44defd=await confirmKey(_0x5587a9(0x22f)+_0x402c71+_0x5587a9(0x27f)+_0x2accb4+'\x27?');if(!_0x44defd)return console[_0x5587a9(0x1d3)](a51_0x1e115a[_0x5587a9(0x2d6)](_0x5587a9(0x207))),0x1;}const _0x4389aa=await withSpinner(_0x5587a9(0x236),()=>_0xf8e509[_0x5587a9(0x2ea)][_0x5587a9(0x28d)](_0x2accb4,_0x402c71),{'verbose':_0x417d7a[_0x5587a9(0x2e6)]}),_0x21f8ac=_0x4389aa['data'];return console[_0x5587a9(0x1d3)](_0x5587a9(0x235)+_0x21f8ac[_0x5587a9(0x2de)]+_0x5587a9(0x1f1)+_0x21f8ac[_0x5587a9(0x162)]+'\x27'),(_0x417d7a['json']||_0x417d7a[_0x5587a9(0x234)])&&await handleSingleObjectOutput(_0x21f8ac,_0x417d7a),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(_0x52b3cc){const _0x69b98=a51_0x56fa1c,_0x3c6a07=Math[_0x69b98(0x193)](_0x52b3cc/0x3e8),_0x240db0=Math[_0x69b98(0x193)](_0x3c6a07/0x3c),_0x2bf1ec=Math['floor'](_0x240db0/0x3c),_0xb3cb4e=Math[_0x69b98(0x193)](_0x2bf1ec/0x18);if(_0xb3cb4e>0x0){const _0x5693fc=_0x2bf1ec%0x18;return _0x5693fc>0x0?_0xb3cb4e+'d\x20'+_0x5693fc+'h':_0xb3cb4e+'d';}else{if(_0x2bf1ec>0x0){const _0x388ca5=_0x240db0%0x3c;return _0x388ca5>0x0?_0x2bf1ec+'h\x20'+_0x388ca5+'m':_0x2bf1ec+'h';}else{if(_0x240db0>0x0){const _0xf7c2a7=_0x3c6a07%0x3c;return _0xf7c2a7>0x0?_0x240db0+'m\x20'+_0xf7c2a7+'s':_0x240db0+'m';}else return _0x3c6a07+'s';}}}function formatTimestamp(_0x2b6330,_0x25c138){const _0x26926f=a51_0x56fa1c,_0x5489ff=new Date(_0x2b6330),_0x8bf25c=String(_0x5489ff[_0x26926f(0x277)]())[_0x26926f(0x2b3)](0x2,'0'),_0x331cc3=String(_0x5489ff[_0x26926f(0x201)]())['padStart'](0x2,'0'),_0x428d3d=_0x8bf25c+':'+_0x331cc3,_0x5e9998=_0x5489ff[_0x26926f(0x1ba)]()===_0x25c138['getFullYear']()&&_0x5489ff['getMonth']()===_0x25c138[_0x26926f(0x16f)]()&&_0x5489ff[_0x26926f(0x21c)]()===_0x25c138['getDate']();if(_0x5e9998)return _0x428d3d;else{const _0x32ab0b=String(_0x5489ff[_0x26926f(0x16f)]()+0x1)['padStart'](0x2,'0'),_0x497f18=String(_0x5489ff[_0x26926f(0x21c)]())['padStart'](0x2,'0');return _0x32ab0b+'-'+_0x497f18+'\x20'+_0x428d3d;}}function formatDate(_0x1ecab6){const _0x36fc1d=a51_0x56fa1c,_0x5d77e4=_0x1ecab6[_0x36fc1d(0x1ba)](),_0x319c05=String(_0x1ecab6[_0x36fc1d(0x16f)]()+0x1)['padStart'](0x2,'0'),_0x1bdcd9=String(_0x1ecab6['getDate']())[_0x36fc1d(0x2b3)](0x2,'0');return _0x5d77e4+'-'+_0x319c05+'-'+_0x1bdcd9;}function getTaskStateIcon(_0x5ecd0c){const _0x305a33={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x305a33[_0x5ecd0c]||'⚪';}function getBarChar(_0x6d5554){const _0x2d0339=a51_0x56fa1c;return _0x6d5554===_0x2d0339(0x1d3)||_0x6d5554==='group_error'?'×':'─';}function getBarColor(_0x51f651){const _0x4a0989=a51_0x56fa1c,_0x3c70c6={'success':a51_0x1e115a[_0x4a0989(0x17e)],'error':a51_0x1e115a[_0x4a0989(0x1db)],'group_error':a51_0x1e115a[_0x4a0989(0x1db)],'running':a51_0x1e115a[_0x4a0989(0x1df)],'blocked':a51_0x1e115a['yellow'],'planned':a51_0x1e115a[_0x4a0989(0x2f8)],'canceling':a51_0x1e115a[_0x4a0989(0x2d6)]};return _0x3c70c6[_0x51f651]||a51_0x1e115a['white'];}function parseTaskName(_0x331fb6){const _0x267c92=a51_0x56fa1c;let _0x34980=_0x331fb6[_0x267c92(0x1aa)](/^\++/,'');const _0x197cf9=_0x34980[_0x267c92(0x1d0)]('+'),_0x46e005=_0x197cf9['length']>0x1?_0x197cf9[_0x267c92(0x2d7)]-0x2:0x0,_0x582d5a=_0x197cf9[_0x197cf9[_0x267c92(0x2d7)]-0x1]||_0x34980;return{'level':_0x46e005,'name':'+'+_0x582d5a};}function truncateTaskName(_0x3e81a1,_0x10956f){const _0x485276=a51_0x56fa1c,_0x4d62a8=stringWidth(_0x3e81a1);if(_0x4d62a8<=_0x10956f)return _0x3e81a1;let _0x50eb4b=_0x3e81a1;while(stringWidth(_0x50eb4b+'…')>_0x10956f&&_0x50eb4b[_0x485276(0x2d7)]>0x0){_0x50eb4b=_0x50eb4b[_0x485276(0x208)](0x0,-0x1);}return _0x50eb4b+'…';}function calculateTimeScale(_0x23c191,_0x428473){const _0x143a80=a51_0x56fa1c;return{'startTime':_0x23c191[_0x143a80(0x2fe)],'endTime':_0x23c191[_0x143a80(0x1da)],'durationMs':_0x23c191[_0x143a80(0x246)],'msPerChar':_0x23c191[_0x143a80(0x246)]/_0x428473};}function timeToPosition(_0x233d0e,_0x19e2eb,_0x5e493d){const _0xc7fb3a=a51_0x56fa1c,_0x105033=_0x233d0e-_0x19e2eb[_0xc7fb3a(0x272)],_0x3c2f1f=Math[_0xc7fb3a(0x193)](_0x105033/_0x19e2eb['msPerChar']);return Math[_0xc7fb3a(0x22c)](0x0,Math['min'](_0x3c2f1f,_0x5e493d));}function renderTimeAxis(_0x1d2b4d,_0x2ebe88){const _0x3d8cc2=a51_0x56fa1c,_0x5ebf4f=Math['min'](TIMELINE_CONFIG[_0x3d8cc2(0x2b9)],Math[_0x3d8cc2(0x22c)](TIMELINE_CONFIG[_0x3d8cc2(0x18e)],Math[_0x3d8cc2(0x193)](_0x2ebe88/TIMELINE_CONFIG[_0x3d8cc2(0x292)]))),_0x1ad707=_0x1d2b4d[_0x3d8cc2(0x28f)]/(_0x5ebf4f-0x1),_0x57ca8f=new Date(_0x1d2b4d['startTime']),_0x32b468=[];for(let _0x28c5b6=0x0;_0x28c5b6<_0x5ebf4f;_0x28c5b6++){const _0x1061f8=_0x1d2b4d[_0x3d8cc2(0x272)]+_0x28c5b6*_0x1ad707,_0x12d800=timeToPosition(_0x1061f8,_0x1d2b4d,_0x2ebe88),_0x3a5393=formatTimestamp(_0x1061f8,_0x57ca8f);_0x32b468[_0x3d8cc2(0x213)]({'pos':_0x12d800,'text':_0x3a5393});}const _0x205b7b=new Array(_0x2ebe88)[_0x3d8cc2(0x2df)]('\x20');let _0x4b6bb1=-0x1;for(const {pos:_0x4106ef,text:_0x1df151}of _0x32b468){let _0x440a3f=Math[_0x3d8cc2(0x22c)](0x0,_0x4106ef-Math[_0x3d8cc2(0x193)](_0x1df151[_0x3d8cc2(0x2d7)]/0x2));_0x440a3f<=_0x4b6bb1+TIMELINE_CONFIG[_0x3d8cc2(0x1c6)]&&(_0x440a3f=_0x4b6bb1+TIMELINE_CONFIG[_0x3d8cc2(0x1c6)]+0x1);_0x440a3f+_0x1df151[_0x3d8cc2(0x2d7)]>_0x2ebe88&&(_0x440a3f=_0x2ebe88-_0x1df151[_0x3d8cc2(0x2d7)]);if(_0x440a3f>=0x0&&_0x440a3f+_0x1df151['length']<=_0x2ebe88&&_0x440a3f>_0x4b6bb1){for(let _0x35f2fe=0x0;_0x35f2fe<_0x1df151[_0x3d8cc2(0x2d7)];_0x35f2fe++){_0x205b7b[_0x440a3f+_0x35f2fe]=_0x1df151[_0x35f2fe];}_0x4b6bb1=_0x440a3f+_0x1df151[_0x3d8cc2(0x2d7)]-0x1;}}return _0x205b7b['join']('');}function renderTaskRow(_0x217bec,_0x7a1218,_0x236fad,_0x48c80a){const _0x5b7bd2=a51_0x56fa1c,{level:_0x50ace3,name:_0x41a768}=parseTaskName(_0x217bec[_0x5b7bd2(0x1cc)]),_0x2bf330='\x20'[_0x5b7bd2(0x1d2)](_0x50ace3),_0x11d479=_0x217bec[_0x5b7bd2(0x285)]?'('+formatElapsed(_0x217bec[_0x5b7bd2(0x285)][_0x5b7bd2(0x246)])+')':'',_0x358697=stringWidth(_0x11d479),_0x57a690=_0x50ace3*0x1,_0x255abb=_0x48c80a-_0x57a690-_0x358697-0x1,_0x36b600=truncateTaskName(_0x41a768,_0x255abb),_0x145253=_0x2bf330+_0x36b600,_0x100d01=stringWidth(_0x145253),_0x4a8245=_0x48c80a-_0x100d01-_0x358697,_0x37a012=_0x145253+'\x20'[_0x5b7bd2(0x1d2)](Math[_0x5b7bd2(0x22c)](0x1,_0x4a8245))+a51_0x1e115a['dim'](_0x11d479),_0x41f6bf=getTaskStateIcon(_0x217bec['state']),_0x446bed=new Array(_0x236fad)[_0x5b7bd2(0x2df)]('\x20');if(_0x217bec['window']){const _0x11df9e=timeToPosition(_0x217bec[_0x5b7bd2(0x285)]['start'],_0x7a1218,_0x236fad),_0x3611a7=timeToPosition(_0x217bec[_0x5b7bd2(0x285)][_0x5b7bd2(0x1da)],_0x7a1218,_0x236fad),_0x38f949=getBarChar(_0x217bec[_0x5b7bd2(0x2f6)]),_0x393280=Math['max'](_0x11df9e+0x1,_0x3611a7);for(let _0x25da2d=_0x11df9e;_0x25da2d<Math[_0x5b7bd2(0x1c4)](_0x393280,_0x236fad);_0x25da2d++){_0x446bed[_0x25da2d]=_0x38f949;}}const _0x3b4db5=getBarColor(_0x217bec[_0x5b7bd2(0x2f6)]),_0x3afd13=_0x446bed['map'](_0x1254f9=>_0x1254f9==='\x20'?'\x20':_0x3b4db5(_0x1254f9))[_0x5b7bd2(0x25f)]('');return _0x41f6bf+'\x20'+_0x37a012+'│'+_0x3afd13+'│';}function calculateStats(_0x5b412b){const _0x484fcd=a51_0x56fa1c,_0x35afd1={'total':_0x5b412b[_0x484fcd(0x2d7)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x253ece of _0x5b412b){if(_0x253ece['state']===_0x484fcd(0x178))_0x35afd1[_0x484fcd(0x178)]++;else{if(_0x253ece['state']===_0x484fcd(0x1d3)||_0x253ece['state']===_0x484fcd(0x22d))_0x35afd1[_0x484fcd(0x1d3)]++;else _0x253ece[_0x484fcd(0x2f6)]===_0x484fcd(0x18a)?_0x35afd1[_0x484fcd(0x18a)]++:_0x35afd1[_0x484fcd(0x177)]++;}}return _0x35afd1;}function formatStats(_0x5f1af){const _0xfb3ff1=a51_0x56fa1c;return['Total:\x20'+_0x5f1af['total'],'✅\x20'+_0x5f1af[_0xfb3ff1(0x178)],'❌\x20'+_0x5f1af['error'],_0xfb3ff1(0x17c)+_0x5f1af[_0xfb3ff1(0x18a)],'⏳\x20'+_0x5f1af[_0xfb3ff1(0x177)]][_0xfb3ff1(0x25f)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a51_0x56fa1c(0x1cc)]=a51_0x56fa1c(0x19a);['description']=a51_0x56fa1c(0x262);async['execute'](_0xef1ed){const _0x302194=a51_0x56fa1c,{options:_0x4686b4,args:_0x5bb962,tdx:_0x4c2c0c}=_0xef1ed;let _0x28c951,_0xdd40ee,_0x585e46=![];if(_0x5bb962[0x0]){if(_0x5bb962[0x0][_0x302194(0x281)]('.')){const _0x9575c0=this[_0x302194(0x1d4)](_0x5bb962,_0x4686b4);if(!_0x9575c0)return 0x1;_0x28c951=_0x9575c0[_0x302194(0x162)],_0xdd40ee=_0x9575c0[_0x302194(0x261)];}else{_0xdd40ee=_0x5bb962[0x0],_0x28c951=_0x4686b4['workflowProject'];if(!_0x28c951)return console['error'](a51_0x1e115a[_0x302194(0x1db)](_0x302194(0x293)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x585e46=!![];}}else{const _0x4f7946=this[_0x302194(0x1d4)](_0x5bb962,_0x4686b4);if(!_0x4f7946)return 0x1;_0x28c951=_0x4f7946['projectName'],_0xdd40ee=_0x4f7946[_0x302194(0x261)];}if(_0x4686b4[_0x302194(0x2e6)]){if(_0x28c951&&_0xdd40ee)console[_0x302194(0x1d3)](_0x302194(0x190)+_0x28c951+'.'+_0xdd40ee);else _0x28c951&&console[_0x302194(0x1d3)]('Filter:\x20project='+_0x28c951);}const _0x2a65cf=_0x4686b4[_0x302194(0x258)],_0x2fc12a=_0x4686b4[_0x302194(0x167)];if(_0x2a65cf){_0x2fc12a&&console[_0x302194(0x1d3)](a51_0x1e115a[_0x302194(0x2d6)](_0x302194(0x243)),'Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id');const _0x2d20c2=_0x4686b4[_0x302194(0x2aa)];return _0x2d20c2?await this['pollTimeline'](_0xef1ed,_0x2a65cf):await this[_0x302194(0x1c7)](_0xef1ed,_0x2a65cf,_0x4686b4),0x0;}if(_0x2fc12a){const _0x1aa9bd=await withSpinner(_0x302194(0x2fa),()=>_0x4c2c0c[_0x302194(0x2ea)]['sessions']({'projectName':_0x28c951,'workflowName':_0xdd40ee,'limit':0x64}),{'verbose':_0x4686b4['verbose']}),_0x114e4d=_0x1aa9bd[_0x302194(0x2c6)][_0x302194(0x2ba)](_0x4744bc=>_0x4744bc['id']===_0x2fc12a);if(!_0x114e4d)return console['error'](a51_0x1e115a['red'](_0x302194(0x293)),_0x302194(0x1f2)+_0x2fc12a),0x1;if(!_0x114e4d['lastAttempt']?.['id'])return console[_0x302194(0x1d3)](a51_0x1e115a[_0x302194(0x1db)](_0x302194(0x293)),_0x302194(0x2d0)+_0x2fc12a+_0x302194(0x1f6)),0x1;const _0x38afa6=_0x114e4d['lastAttempt']['id'];_0x4686b4[_0x302194(0x2e6)]&&console['error'](_0x302194(0x28c)+_0x38afa6+_0x302194(0x1a9)+_0x2fc12a);const _0x5bf17b=_0x4686b4[_0x302194(0x2aa)];return _0x5bf17b?await this[_0x302194(0x1e0)](_0xef1ed,_0x38afa6):await this[_0x302194(0x1c7)](_0xef1ed,_0x38afa6,_0x4686b4),0x0;}const _0x2f2031=await withSpinner(_0x302194(0x298),()=>_0x4c2c0c['workflow'][_0x302194(0x242)]({'projectName':_0x28c951,'workflowName':_0xdd40ee,'limit':_0x4686b4['limit']||0x32}),{'verbose':_0x4686b4[_0x302194(0x2e6)]}),_0x381b14=_0x2f2031[_0x302194(0x2c6)];if(_0x381b14['length']===0x0){if(_0x28c951&&_0xdd40ee)console[_0x302194(0x1d3)](_0x302194(0x188)+_0x28c951+'.'+_0xdd40ee);else _0x28c951?console['error'](_0x302194(0x2d8)+_0x28c951):(console[_0x302194(0x1d3)](_0x302194(0x26b)),console[_0x302194(0x1d3)](a51_0x1e115a[_0x302194(0x2f8)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x381b14[_0x302194(0x1f4)]((_0x524380,_0x2d4673)=>{const _0x63ac13=_0x302194,_0x54be31=_0x524380['sessionTime']||'',_0x27bf58=_0x2d4673[_0x63ac13(0x2c4)]||'';return _0x27bf58['localeCompare'](_0x54be31);});if(_0x4686b4['json']||_0x4686b4['jsonl'])return await handleSDKOutput(_0x381b14,_0x4686b4),0x0;let _0xe4d9c6;if(_0x585e46){const _0x56baa0=_0x381b14[0x0];if(!_0x56baa0[_0x302194(0x1e1)]?.['id'])return console[_0x302194(0x1d3)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0xe4d9c6=_0x56baa0[_0x302194(0x1e1)]['id'],_0x4686b4['verbose']&&console[_0x302194(0x1d3)](_0x302194(0x220)+_0x56baa0[_0x302194(0x2c4)]);}else{const _0x536c54=_0x381b14[_0x302194(0x221)](_0x429264=>{const _0x139273=_0x302194,_0x271372=getAttemptStatusDisplay(_0x429264[_0x139273(0x1e1)]);return{'title':_0x429264[_0x139273(0x248)]?.[_0x139273(0x1cc)]+'.'+_0x429264[_0x139273(0x2ea)]?.[_0x139273(0x1cc)]+_0x139273(0x1ab)+_0x429264[_0x139273(0x2c4)]+'\x20'+_0x271372[_0x139273(0x2ed)],'value':_0x429264[_0x139273(0x1e1)]?.['id']||'','description':_0x271372[_0x139273(0x19d)]};}),_0x5ce6e2=await a51_0x20619d({'type':_0x302194(0x2ca),'name':_0x302194(0x258),'message':_0x302194(0x15d),'choices':_0x536c54[_0x302194(0x2ce)](_0x587531=>_0x587531[_0x302194(0x1b8)]!=='')});if(!_0x5ce6e2['attemptId'])return 0x0;_0xe4d9c6=_0x5ce6e2[_0x302194(0x258)];}const _0x2ca4cb=_0x4686b4[_0x302194(0x2aa)];return _0x2ca4cb?await this[_0x302194(0x1e0)](_0xef1ed,_0xe4d9c6):await this[_0x302194(0x1c7)](_0xef1ed,_0xe4d9c6,_0x4686b4),0x0;}async[a51_0x56fa1c(0x1c7)](_0x542257,_0x3a34ac,_0x149d2f){const _0x3e6044=a51_0x56fa1c,{tdx:_0x2bc344}=_0x542257;let _0x3817ee,_0x251112;try{[_0x3817ee,_0x251112]=await Promise[_0x3e6044(0x18f)]([_0x2bc344[_0x3e6044(0x2ea)][_0x3e6044(0x302)](_0x3a34ac),_0x2bc344[_0x3e6044(0x2ea)][_0x3e6044(0x1cd)](_0x3a34ac,![])]);}catch(_0x2a1f79){console['error'](a51_0x1e115a[_0x3e6044(0x1db)](_0x3e6044(0x23d)));_0x149d2f[_0x3e6044(0x2e6)]&&console[_0x3e6044(0x1d3)](_0x2a1f79);throw _0x2a1f79;}if(_0x149d2f[_0x3e6044(0x18d)]||_0x149d2f[_0x3e6044(0x234)]){const _0x3b1ddc=this[_0x3e6044(0x23c)](_0x3817ee,_0x251112);await handleSDKOutput([_0x3b1ddc],_0x149d2f);return;}const _0x4fa789=_0x2bc344[_0x3e6044(0x2cb)][_0x3e6044(0x2dd)],_0x580c63=this['renderTimeline'](_0x3817ee,_0x251112,_0x4fa789);console['log'](_0x580c63);}async[a51_0x56fa1c(0x1e0)](_0x105537,_0x4ebb6e){const _0x1fd388=a51_0x56fa1c,{tdx:_0x2a9fb2}=_0x105537,_0x15f2b0=TIMELINE_CONFIG[_0x1fd388(0x1c8)],_0x22c049=TIMELINE_CONFIG[_0x1fd388(0x181)];let _0x3b3c1a=0x0;while(_0x3b3c1a<_0x22c049){process[_0x1fd388(0x1fb)][_0x1fd388(0x2cc)]&&process[_0x1fd388(0x1fb)][_0x1fd388(0x15f)]('\x1bc');let _0x52afb6,_0x26e7db;try{[_0x52afb6,_0x26e7db]=await Promise[_0x1fd388(0x18f)]([_0x2a9fb2[_0x1fd388(0x2ea)]['attempt'](_0x4ebb6e),_0x2a9fb2['workflow'][_0x1fd388(0x1cd)](_0x4ebb6e,![])]);}catch(_0x2e49b3){console['error'](a51_0x1e115a[_0x1fd388(0x1db)](_0x1fd388(0x21a)));_0x3b3c1a>0x0&&console[_0x1fd388(0x1d3)](a51_0x1e115a[_0x1fd388(0x2f8)](_0x1fd388(0x2d9)+_0x3b3c1a));throw _0x2e49b3;}const _0x4a93f7=_0x2a9fb2[_0x1fd388(0x2cb)][_0x1fd388(0x2dd)],_0x2e5906=this[_0x1fd388(0x269)](_0x52afb6,_0x26e7db,_0x4a93f7);console[_0x1fd388(0x171)](_0x2e5906);const _0x37bf90=_0x52afb6[_0x1fd388(0x2ec)]&&_0x26e7db[_0x1fd388(0x1b9)](_0xf908da=>_0xf908da[_0x1fd388(0x2f6)]!==_0x1fd388(0x18a)&&_0xf908da[_0x1fd388(0x2f6)]!==_0x1fd388(0x2af));if(_0x37bf90){console[_0x1fd388(0x1d3)](a51_0x1e115a[_0x1fd388(0x17e)]('\x0a✔\x20Attempt\x20complete'));break;}console['error'](a51_0x1e115a[_0x1fd388(0x2f8)](_0x1fd388(0x1a2)+_0x3b3c1a*0x2+_0x1fd388(0x245))),await new Promise(_0xde52b5=>setTimeout(_0xde52b5,_0x15f2b0)),_0x3b3c1a++;}_0x3b3c1a>=_0x22c049&&console[_0x1fd388(0x1d3)](a51_0x1e115a[_0x1fd388(0x2d6)](_0x1fd388(0x244)));}[a51_0x56fa1c(0x269)](_0x82a28f,_0x2adc60,_0x3fc6c2){const _0x5ef1c0=a51_0x56fa1c,_0x38a398=[],_0x2e708d=TIMELINE_CONFIG[_0x5ef1c0(0x270)],_0x2f7050=0x5,_0x466581=process['stdout'][_0x5ef1c0(0x1e5)]||0x78,_0x36869c=_0x466581-_0x2e708d-_0x2f7050,_0xd5743d=Math[_0x5ef1c0(0x22c)](TIMELINE_CONFIG[_0x5ef1c0(0x1ea)],Math[_0x5ef1c0(0x1c4)](_0x36869c,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x3161b7=new Date(_0x82a28f[_0x5ef1c0(0x287)])['getTime'](),_0x6d2280=_0x82a28f[_0x5ef1c0(0x20d)]?new Date(_0x82a28f['finishedAt'])[_0x5ef1c0(0x161)]():Date[_0x5ef1c0(0x1cb)](),_0x388eb6={'start':_0x3161b7,'end':_0x6d2280,'duration':_0x6d2280-_0x3161b7},_0x353f39=new Map(),_0x46561a=[];for(const _0x425122 of _0x2adc60){if(_0x425122['startedAt']){const _0x76706a=new Date(_0x425122[_0x5ef1c0(0x2c8)])[_0x5ef1c0(0x161)](),_0x51f0b5=_0x425122[_0x5ef1c0(0x24d)]?new Date(_0x425122[_0x5ef1c0(0x24d)])[_0x5ef1c0(0x161)]():Date[_0x5ef1c0(0x1cb)](),_0x10f2c3={'start':_0x76706a,'end':_0x51f0b5,'duration':_0x51f0b5-_0x76706a};_0x353f39[_0x5ef1c0(0x172)](_0x425122['id'],_0x10f2c3),_0x46561a[_0x5ef1c0(0x213)]({'name':_0x425122[_0x5ef1c0(0x2e9)],'state':_0x425122[_0x5ef1c0(0x2f6)]||_0x5ef1c0(0x268),'window':_0x10f2c3});}else _0x46561a['push']({'name':_0x425122[_0x5ef1c0(0x2e9)],'state':_0x425122[_0x5ef1c0(0x2f6)]||_0x5ef1c0(0x2af),'window':undefined});}_0x46561a['sort']((_0x35ba08,_0x5d23c8)=>{const _0x26f8b6=_0x5ef1c0;if(!_0x35ba08[_0x26f8b6(0x285)])return 0x1;if(!_0x5d23c8[_0x26f8b6(0x285)])return-0x1;return _0x35ba08[_0x26f8b6(0x285)][_0x26f8b6(0x2fe)]-_0x5d23c8[_0x26f8b6(0x285)][_0x26f8b6(0x2fe)];});const _0x1ce29f=_0x46561a['length'],_0x36e464=_0x1ce29f>TIMELINE_CONFIG[_0x5ef1c0(0x23e)];_0x36e464&&_0x46561a[_0x5ef1c0(0x204)](TIMELINE_CONFIG[_0x5ef1c0(0x23e)]);const _0x562781=calculateTimeScale(_0x388eb6,_0xd5743d),_0x2ab64b=_0x82a28f[_0x5ef1c0(0x2ec)]?_0x82a28f[_0x5ef1c0(0x178)]?a51_0x1e115a['green'](_0x5ef1c0(0x178)):a51_0x1e115a['red'](_0x5ef1c0(0x1d3)):a51_0x1e115a['blue'](_0x5ef1c0(0x18a)),_0x1e439a=_0x82a28f[_0x5ef1c0(0x248)]?.['id'],_0x1e5217=_0x82a28f[_0x5ef1c0(0x167)];let _0x9ac1fc;if(_0x1e439a&&_0x1e5217){const _0x124112=getWorkflowAttemptUrl(_0x3fc6c2,_0x1e439a,_0x1e5217,_0x82a28f['id']);_0x9ac1fc=hyperlink(a51_0x1e115a['dim'](_0x82a28f['id']),_0x124112);}else _0x9ac1fc=a51_0x1e115a['dim'](_0x82a28f['id']);_0x38a398[_0x5ef1c0(0x213)](_0x5ef1c0(0x1ff)+_0x9ac1fc+_0x5ef1c0(0x1ab)+_0x2ab64b+_0x5ef1c0(0x1ab)+formatElapsed(_0x388eb6[_0x5ef1c0(0x246)]));if(_0x46561a[_0x5ef1c0(0x2d7)]>0x0){const _0x29ba4f=renderTimeAxis(_0x562781,_0xd5743d),_0x5186cb=new Date(_0x388eb6[_0x5ef1c0(0x2fe)]),_0xe643c3=formatDate(_0x5186cb),_0x15f5ca=TIMELINE_CONFIG[_0x5ef1c0(0x1c3)]+TIMELINE_CONFIG['ICON_SPACING']+_0x2e708d,_0x521df9=_0xe643c3['padStart'](_0x15f5ca),_0xbcfea8=a51_0x1e115a[_0x5ef1c0(0x2f8)](_0x521df9);_0x38a398[_0x5ef1c0(0x213)](_0xbcfea8+'\x20'+_0x29ba4f);for(const _0x4bc3f9 of _0x46561a){_0x38a398['push'](renderTaskRow(_0x4bc3f9,_0x562781,_0xd5743d,_0x2e708d));}const _0x15e4d7=calculateStats(_0x46561a);_0x38a398['push'](formatStats(_0x15e4d7)),_0x36e464&&_0x38a398[_0x5ef1c0(0x213)](a51_0x1e115a[_0x5ef1c0(0x2d6)](_0x5ef1c0(0x202)+TIMELINE_CONFIG[_0x5ef1c0(0x23e)]+_0x5ef1c0(0x1bd)+_0x1ce29f+_0x5ef1c0(0x189))),_0x38a398[_0x5ef1c0(0x213)](''),_0x38a398[_0x5ef1c0(0x213)](a51_0x1e115a[_0x5ef1c0(0x2f8)](_0x5ef1c0(0x2be))+('tdx\x20wf\x20attempt\x20'+_0x82a28f['id']+'\x20logs')+a51_0x1e115a[_0x5ef1c0(0x2f8)]('\x20to\x20see\x20detailed\x20logs'));}else _0x38a398['push'](_0x5ef1c0(0x1b7));return _0x38a398[_0x5ef1c0(0x25f)]('\x0a');}['buildTimelineData'](_0xd8664a,_0x2109ba){const _0x3dfafa=a51_0x56fa1c,_0x287d2b=new Date(_0xd8664a[_0x3dfafa(0x287)])[_0x3dfafa(0x161)](),_0x4e81b2=_0xd8664a[_0x3dfafa(0x20d)]?new Date(_0xd8664a['finishedAt'])['getTime']():Date['now'](),_0x434e46=_0x4e81b2-_0x287d2b,_0x2c30b1=[];for(const _0x530cc9 of _0x2109ba){if(_0x530cc9[_0x3dfafa(0x2c8)]){const _0x4b5fd1=new Date(_0x530cc9[_0x3dfafa(0x2c8)])[_0x3dfafa(0x161)](),_0x3f865c=_0x530cc9[_0x3dfafa(0x24d)]?new Date(_0x530cc9[_0x3dfafa(0x24d)])[_0x3dfafa(0x161)]():Date[_0x3dfafa(0x1cb)]();_0x2c30b1[_0x3dfafa(0x213)]({'name':_0x530cc9[_0x3dfafa(0x2e9)],'state':_0x530cc9[_0x3dfafa(0x2f6)]||_0x3dfafa(0x268),'window':{'start':_0x4b5fd1,'end':_0x3f865c,'duration':_0x3f865c-_0x4b5fd1}});}else _0x2c30b1[_0x3dfafa(0x213)]({'name':_0x530cc9[_0x3dfafa(0x2e9)],'state':_0x530cc9[_0x3dfafa(0x2f6)]||_0x3dfafa(0x2af),'window':undefined});}const _0x325dc9=calculateStats(_0x2c30b1);return{'attempt':{'id':_0xd8664a['id'],'status':_0xd8664a[_0x3dfafa(0x2ec)]?_0xd8664a['success']?_0x3dfafa(0x178):_0x3dfafa(0x1d3):_0x3dfafa(0x18a),'createdAt':_0xd8664a[_0x3dfafa(0x287)],'finishedAt':_0xd8664a[_0x3dfafa(0x20d)],'duration_ms':_0x434e46},'tasks':_0x2c30b1[_0x3dfafa(0x221)](_0x4b3e27=>({'name':_0x4b3e27['name'],'state':_0x4b3e27['state'],'startedAt':_0x4b3e27[_0x3dfafa(0x285)]?new Date(_0x4b3e27[_0x3dfafa(0x285)][_0x3dfafa(0x2fe)])[_0x3dfafa(0x15e)]():null,'updatedAt':_0x4b3e27['window']?new Date(_0x4b3e27['window']['end'])[_0x3dfafa(0x15e)]():null,'duration_ms':_0x4b3e27[_0x3dfafa(0x285)]?.[_0x3dfafa(0x246)]||null})),'stats':_0x325dc9};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2ee971,_0x15a4ea){const _0x499c5e=a52_0x5795,_0x5d88a9=_0x2ee971();while(!![]){try{const _0x1c2fe1=-parseInt(_0x499c5e(0x134))/0x1*(parseInt(_0x499c5e(0x12c))/0x2)+-parseInt(_0x499c5e(0x133))/0x3*(parseInt(_0x499c5e(0x132))/0x4)+parseInt(_0x499c5e(0x12b))/0x5+-parseInt(_0x499c5e(0x12d))/0x6+-parseInt(_0x499c5e(0x129))/0x7*(parseInt(_0x499c5e(0x131))/0x8)+-parseInt(_0x499c5e(0x125))/0x9+parseInt(_0x499c5e(0x12f))/0xa;if(_0x1c2fe1===_0x15a4ea)break;else _0x5d88a9['push'](_0x5d88a9['shift']());}catch(_0x1450eb){_0x5d88a9['push'](_0x5d88a9['shift']());}}}(a52_0x4d82,0x6a58c));import{platform}from'os';function a52_0x4d82(){const _0x38e455=['entries','88maNJZS','9808ksAuqO','537VCXKQu','307WvBXiZ','tdx','6354180uqXRVW','Bearer\x20',';\x20node/','Authorization','20573cdgimW','TD1\x20','3455485LSWpco','2362awSKcx','1589292gDgpwE','length','15492050zJsgDB'];a52_0x4d82=function(){return _0x38e455;};return a52_0x4d82();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x266aa4=a52_0x5795,_0x1ea4ba=getVersion(),_0x36eb3c=platform(),_0x318a7f=process['version']['replace']('v','');return'tdx/'+_0x1ea4ba+'\x20('+_0x36eb3c+_0x266aa4(0x127)+_0x318a7f+')';}function a52_0x5795(_0x33a3e7,_0x421bcd){_0x33a3e7=_0x33a3e7-0x125;const _0x4d8209=a52_0x4d82();let _0x579512=_0x4d8209[_0x33a3e7];return _0x579512;}export function getAuthHeaders(_0x26b551,_0x1f9682,_0x53835c){const _0x336038=a52_0x5795,_0x519fc6=getVersion(),_0x40fa46={'User-Agent':getUserAgent(),'X-TD-Client':_0x336038(0x135),'X-TD-Client-Version':_0x519fc6};if(_0x53835c)_0x40fa46[_0x336038(0x128)]=_0x336038(0x126)+_0x53835c;else _0x1f9682&&(_0x40fa46[_0x336038(0x128)]=_0x336038(0x12a)+_0x1f9682);return _0x40fa46;}export function toHeaderRecord(_0x196480){const _0x4b70c9=a52_0x5795,_0x1793c4={};for(const [_0x12ec0e,_0x383d8b]of Object[_0x4b70c9(0x130)](_0x196480)){_0x383d8b!==undefined&&(_0x1793c4[_0x12ec0e]=_0x383d8b);}return _0x1793c4;}export function getTrinoHeaders(_0x4f8ffb,_0x332535,_0x5cfb5e){const _0x189596=a52_0x5795,_0x1011d7=getAuthHeaders(_0x4f8ffb),_0x2abd11=toHeaderRecord(_0x1011d7);if(_0x5cfb5e)_0x2abd11[_0x189596(0x128)]=_0x189596(0x126)+_0x5cfb5e;else _0x332535&&(_0x2abd11['X-Trino-User']=_0x332535);return _0x2abd11;}export function hasAPIKey(_0x567ca4){const _0x1f05a4=a52_0x5795,_0x1e2147=getAPIKey();return _0x1e2147!==undefined&&_0x1e2147[_0x1f05a4(0x12e)]>0x0;}
1
+ (function(_0x38eed3,_0xa21d22){const _0x3d7917=a52_0x2e52,_0x4ea1b1=_0x38eed3();while(!![]){try{const _0x5270c8=parseInt(_0x3d7917(0x1a0))/0x1+parseInt(_0x3d7917(0x1a4))/0x2+-parseInt(_0x3d7917(0x1aa))/0x3*(parseInt(_0x3d7917(0x1a6))/0x4)+-parseInt(_0x3d7917(0x1a3))/0x5*(parseInt(_0x3d7917(0x199))/0x6)+-parseInt(_0x3d7917(0x1a9))/0x7*(-parseInt(_0x3d7917(0x198))/0x8)+parseInt(_0x3d7917(0x1a7))/0x9+-parseInt(_0x3d7917(0x19f))/0xa;if(_0x5270c8===_0xa21d22)break;else _0x4ea1b1['push'](_0x4ea1b1['shift']());}catch(_0x1d1878){_0x4ea1b1['push'](_0x4ea1b1['shift']());}}}(a52_0x4d41,0xd1ffc));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';function a52_0x2e52(_0x8bfdcf,_0x33c707){_0x8bfdcf=_0x8bfdcf-0x198;const _0x4d4151=a52_0x4d41();let _0x2e525b=_0x4d4151[_0x8bfdcf];return _0x2e525b;}export function getUserAgent(){const _0xe8d305=a52_0x2e52,_0x16ffc6=getVersion(),_0x321ecb=platform(),_0x3374c1=process['version'][_0xe8d305(0x1a1)]('v','');return _0xe8d305(0x19c)+_0x16ffc6+'\x20('+_0x321ecb+_0xe8d305(0x19d)+_0x3374c1+')';}export function getAuthHeaders(_0x4fd528,_0x54c95d,_0x119b3){const _0x5e04a6=a52_0x2e52,_0x299046=getVersion(),_0x48f11f={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x299046};if(_0x119b3)_0x48f11f['Authorization']=_0x5e04a6(0x19e)+_0x119b3;else _0x54c95d&&(_0x48f11f[_0x5e04a6(0x1a8)]=_0x5e04a6(0x19a)+_0x54c95d);return _0x48f11f;}function a52_0x4d41(){const _0x5b7c4c=['2982704ESMSdn','6CRZSuq','TD1\x20','length','tdx/',';\x20node/','Bearer\x20','6283310XFdFHz','1327202cIbvZD','replace','entries','2056960zkSfUN','623264QxGgCf','X-Trino-User','16WGFziR','1599255ECPkCS','Authorization','21ZezFSF','776373NiZiQs'];a52_0x4d41=function(){return _0x5b7c4c;};return a52_0x4d41();}export function toHeaderRecord(_0x452eff){const _0x446419=a52_0x2e52,_0xd04342={};for(const [_0x151dc7,_0x7515b0]of Object[_0x446419(0x1a2)](_0x452eff)){_0x7515b0!==undefined&&(_0xd04342[_0x151dc7]=_0x7515b0);}return _0xd04342;}export function getTrinoHeaders(_0x44243d,_0x9031e6,_0x3f207c){const _0x3e9785=a52_0x2e52,_0x593521=getAuthHeaders(_0x44243d),_0x334d7b=toHeaderRecord(_0x593521);if(_0x3f207c)_0x334d7b[_0x3e9785(0x1a8)]=_0x3e9785(0x19e)+_0x3f207c;else _0x9031e6&&(_0x334d7b[_0x3e9785(0x1a5)]=_0x9031e6);return _0x334d7b;}export function hasAPIKey(_0x1af683){const _0x357d01=a52_0x2e52,_0x5a0204=getAPIKey();return _0x5a0204!==undefined&&_0x5a0204[_0x357d01(0x19b)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x3af5a2,_0x4107f0){const _0x5342fc=a53_0x42f9,_0xe3757e=_0x3af5a2();while(!![]){try{const _0x3127c2=-parseInt(_0x5342fc(0x1e1))/0x1+-parseInt(_0x5342fc(0x1e3))/0x2*(-parseInt(_0x5342fc(0x1f1))/0x3)+-parseInt(_0x5342fc(0x1f3))/0x4+parseInt(_0x5342fc(0x1d4))/0x5+-parseInt(_0x5342fc(0x21a))/0x6+parseInt(_0x5342fc(0x207))/0x7*(parseInt(_0x5342fc(0x20e))/0x8)+parseInt(_0x5342fc(0x1df))/0x9;if(_0x3127c2===_0x4107f0)break;else _0xe3757e['push'](_0xe3757e['shift']());}catch(_0x28dda9){_0xe3757e['push'](_0xe3757e['shift']());}}}(a53_0x4a1f,0x65ac1));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 a53_0x1d096b from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x59291f){const _0x43e48d=a53_0x42f9;return _0x59291f[_0x43e48d(0x1ee)]===_0x43e48d(0x1e2)||_0x59291f['format']===_0x43e48d(0x203)||_0x59291f[_0x43e48d(0x1ee)]===_0x43e48d(0x202)||_0x59291f['format']===_0x43e48d(0x1e8)||_0x59291f[_0x43e48d(0x1e2)]===!![]||_0x59291f[_0x43e48d(0x203)]===!![]||_0x59291f[_0x43e48d(0x202)]===!![]||_0x59291f[_0x43e48d(0x1e8)]===!![];}export function parseOutputOptions(_0x25298c){const _0xb4b0ff=a53_0x42f9;return{'format':_0x25298c[_0xb4b0ff(0x1ee)]||'table','output':_0x25298c[_0xb4b0ff(0x211)]||'','limit':_0x25298c[_0xb4b0ff(0x217)],'limitStructuredFormats':_0x25298c['limitStructuredFormats'],'color':_0x25298c[_0xb4b0ff(0x1e0)],'noColor':_0x25298c[_0xb4b0ff(0x1db)]};}function convertSDKResultToQueryResult(_0x421b2d){const _0xa0a1ae=a53_0x42f9,_0x4d1f5e=[];if(_0x421b2d[_0xa0a1ae(0x1f4)]>0x0){const _0x34c5f7=_0x421b2d[0x0];for(const [_0x5e243,_0x4b64bf]of Object[_0xa0a1ae(0x1fb)](_0x34c5f7)){let _0x1fbccf=_0xa0a1ae(0x1dc);if(typeof _0x4b64bf===_0xa0a1ae(0x1fc))_0x1fbccf=Number[_0xa0a1ae(0x209)](_0x4b64bf)?_0xa0a1ae(0x1d7):_0xa0a1ae(0x1ef);else{if(typeof _0x4b64bf===_0xa0a1ae(0x20b))_0x1fbccf='boolean';else _0x4b64bf===null&&(_0x1fbccf=_0xa0a1ae(0x1dc));}_0x4d1f5e[_0xa0a1ae(0x20a)]({'name':_0x5e243,'type':_0x1fbccf});}}return{'queryId':_0xa0a1ae(0x206),'columns':_0x4d1f5e,'data':_0x421b2d,'stats':{'state':_0xa0a1ae(0x210),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x421b2d[_0xa0a1ae(0x1f4)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x24f325,_0x49b490){const _0x823292=convertSDKResultToQueryResult(_0x24f325);return formatQueryOutput(_0x823292,_0x49b490);}export async function formatQueryOutput(_0xf917bd,_0x141a19){const _0x311c83=a53_0x42f9,{format:_0x104ffd,limit:_0x4cacc3,output:_0x4206e5,color:_0x23a322,noColor:_0x449b04,limitStructuredFormats:_0x2c945b}=_0x141a19,_0x5909c5=Boolean(_0x4206e5)&&!_0x23a322,_0x51f1df={'color':_0x23a322,'noColor':_0x449b04||_0x5909c5};if(_0x104ffd===_0x311c83(0x1e8)){const _0x2c642b=shouldUseLess(_0x104ffd,_0x4206e5);return formatAsTable(_0xf917bd,_0x4cacc3,_0x2c642b,_0x51f1df);}const _0x2b8eb8=_0x2c945b&&Number['isFinite'](_0x4cacc3)&&_0xf917bd['data'][_0x311c83(0x1f4)]>_0x4cacc3?{..._0xf917bd,'data':_0xf917bd['data'][_0x311c83(0x20f)](0x0,_0x4cacc3)}:_0xf917bd;if(_0x104ffd===_0x311c83(0x1e2))return formatAsJSON(_0x2b8eb8,_0x51f1df);else return _0x104ffd==='jsonl'?formatAsJSONL(_0x2b8eb8,_0x51f1df):formatQueryResult(_0x2b8eb8,_0x104ffd);}function a53_0x42f9(_0x131c87,_0x7f51fd){_0x131c87=_0x131c87-0x1d4;const _0x4a1f24=a53_0x4a1f();let _0x42f99f=_0x4a1f24[_0x131c87];return _0x42f99f;}function shouldUseLess(_0x3df2e6,_0x139f35){const _0x24dd27=a53_0x42f9;return(_0x3df2e6==='table'||_0x3df2e6===_0x24dd27(0x1da))&&process['stdout']['isTTY']&&!_0x139f35;}export function resolveOutputOptions(_0x40726e){const _0xccb4f9=a53_0x42f9,_0x22c0fb=_0x40726e[_0xccb4f9(0x211)]||'',_0x5777f3=resolveOutputFormat(_0x40726e[_0xccb4f9(0x1ee)],_0x22c0fb,_0xccb4f9(0x1e8));let _0x52db82=typeof _0x40726e[_0xccb4f9(0x217)]===_0xccb4f9(0x1fc)?_0x40726e[_0xccb4f9(0x217)]:parseInt(_0x40726e[_0xccb4f9(0x217)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x40726e[_0xccb4f9(0x217)]===undefined&&shouldUseLess(_0x5777f3,_0x22c0fb)&&(_0x52db82=Infinity),{'format':_0x5777f3,'output':_0x22c0fb,'limit':_0x52db82,'limitStructuredFormats':_0x40726e[_0xccb4f9(0x208)],'color':_0x40726e[_0xccb4f9(0x1e0)],'noColor':_0x40726e[_0xccb4f9(0x1db)]};}export function writeOutput(_0x5315e2,_0x242870,_0x5dcb6b){const _0x530b29=a53_0x42f9;return _0x242870?(writeFileSync(_0x242870,_0x5315e2),console[_0x530b29(0x1ed)](_0x530b29(0x1f0)+_0x242870),Promise[_0x530b29(0x1e7)]()):shouldUseLess(_0x5dcb6b||'','')?new Promise(_0x5608ce=>{const _0x4d5636=_0x530b29,_0x4cdee4=spawn(_0x4d5636(0x214),[_0x4d5636(0x1e9)],{'stdio':[_0x4d5636(0x200),_0x4d5636(0x20c),'inherit']});let _0x15fca7=![];_0x4cdee4['on'](_0x4d5636(0x1ed),()=>{const _0x6430a6=_0x4d5636;!_0x15fca7&&(_0x15fca7=!![],console[_0x6430a6(0x1fd)](_0x5315e2),_0x5608ce());}),_0x4cdee4['on'](_0x4d5636(0x1fa),()=>{!_0x15fca7&&(_0x15fca7=!![],_0x5608ce());}),_0x4cdee4['on'](_0x4d5636(0x1f5),()=>{const _0x71aebf=_0x4d5636;!_0x15fca7&&_0x4cdee4[_0x71aebf(0x201)]&&(_0x4cdee4[_0x71aebf(0x201)]['on']('error',()=>{}),_0x4cdee4[_0x71aebf(0x201)]['write'](_0x5315e2),_0x4cdee4[_0x71aebf(0x201)][_0x71aebf(0x213)]());}),!_0x4cdee4['stdin']&&(!_0x15fca7&&(_0x15fca7=!![],console[_0x4d5636(0x1fd)](_0x5315e2),_0x5608ce()));}):(console[_0x530b29(0x1fd)](_0x5315e2),Promise[_0x530b29(0x1e7)]());}export async function handleSDKOutput(_0x27f18e,_0x5c3395){const _0x3b5a0a=a53_0x42f9,_0x143daf=resolveOutputOptions(_0x5c3395),_0x57fa03=await formatSDKOutput(_0x27f18e,_0x143daf);await writeOutput(_0x57fa03,_0x143daf[_0x3b5a0a(0x211)]||undefined,_0x143daf[_0x3b5a0a(0x1ee)]);}export async function handleQueryOutput(_0x3f503b,_0x17c4fb){const _0x3b2758=resolveOutputOptions(_0x17c4fb),_0x15345e=await formatQueryOutput(_0x3f503b,_0x3b2758);await writeOutput(_0x15345e,_0x3b2758['output']||undefined,_0x3b2758['format']);}async function formatSingleObject(_0x5a9cb4,_0x268978){const _0x196af2=a53_0x42f9,{format:_0x5d2569,color:_0x4fc953,noColor:_0x250333}=_0x268978,_0x55001f={'color':_0x4fc953,'noColor':_0x250333};if(_0x5d2569==='json'){if(shouldUseColor(_0x55001f))return colorizeJSON(_0x5a9cb4,_0x55001f);return JSON[_0x196af2(0x215)](_0x5a9cb4,null,0x2);}else{if(_0x5d2569===_0x196af2(0x203)){if(shouldUseColor(_0x55001f))return colorizeJSONCompact(_0x5a9cb4,_0x55001f);return JSON[_0x196af2(0x215)](_0x5a9cb4);}else{if(_0x5d2569===_0x196af2(0x202))return Object[_0x196af2(0x1fb)](_0x5a9cb4)[_0x196af2(0x204)](([_0x547873,_0x59b3f5])=>_0x547873+'\x09'+_0x59b3f5)['join']('\x0a');else{const _0x2e8c55=Object['entries'](_0x5a9cb4);if(_0x2e8c55[_0x196af2(0x1f4)]===0x0)return _0x196af2(0x1f9);const _0x12cc9c=_0x5a9cb4[_0x196af2(0x1e5)],_0x4b0e59=_0x5a9cb4[_0x196af2(0x218)],_0x992aad=_0x5a9cb4[_0x196af2(0x1d8)],_0x188cb8=_0x5a9cb4['rule'],_0x426776=_0x4b0e59?typeof _0x4b0e59==='string'?_0x4b0e59:JSON[_0x196af2(0x215)](_0x4b0e59,null,0x2):undefined,_0x57f4bd=_0x992aad&&Object['keys'](_0x992aad)[_0x196af2(0x1f4)]>0x0?JSON[_0x196af2(0x215)](_0x992aad,null,0x2):undefined,_0x5ac716=_0x188cb8&&Object[_0x196af2(0x1d9)](_0x188cb8)[_0x196af2(0x1f4)]>0x0?JSON[_0x196af2(0x215)](_0x188cb8,null,0x2):undefined,_0x457499=_0x2e8c55['filter'](([_0x48bba6])=>_0x48bba6!==_0x196af2(0x1e5)&&_0x48bba6!==_0x196af2(0x218)&&_0x48bba6!=='params'&&_0x48bba6!==_0x196af2(0x205)),_0x434788=Math[_0x196af2(0x1fe)](..._0x457499[_0x196af2(0x204)](([_0x20d7d0])=>_0x20d7d0['length'])),_0x50e8c1=Math[_0x196af2(0x1fe)](..._0x457499[_0x196af2(0x204)](([,_0x52aa6a])=>{const _0x26c008=_0x196af2;try{const _0x448309=_0x52aa6a===null||_0x52aa6a===undefined?'':typeof _0x52aa6a===_0x26c008(0x1dd)?JSON['stringify'](_0x52aa6a):String(_0x52aa6a),_0x44b90a=_0x448309[_0x26c008(0x1f6)]('\x0a');return Math[_0x26c008(0x1fe)](..._0x44b90a[_0x26c008(0x204)](_0x158145=>_0x158145[_0x26c008(0x1f4)]),0x0);}catch{return 0x0;}}),0x14),_0x4c8ba9=[];_0x4c8ba9[_0x196af2(0x20a)](colorBorder('┌─'+'─'[_0x196af2(0x1eb)](_0x434788)+_0x196af2(0x1ff)+'─'[_0x196af2(0x1eb)](_0x50e8c1)+'─┐',_0x55001f)),_0x457499[_0x196af2(0x1f8)](([_0x1079ce,_0x53a2c5])=>{const _0x188966=_0x196af2;let _0x5cb8c5;try{_0x5cb8c5=_0x53a2c5===null||_0x53a2c5===undefined?'':typeof _0x53a2c5===_0x188966(0x1dd)?JSON[_0x188966(0x215)](_0x53a2c5):String(_0x53a2c5);}catch{_0x5cb8c5='[Object]';}const _0x244a4b=_0x1079ce['padEnd'](_0x434788),_0x333f06=_0x5cb8c5[_0x188966(0x1f6)]('\x0a');_0x333f06[_0x188966(0x1f8)]((_0x22cd96,_0x3fcab7)=>{const _0x4096bb=_0x188966,_0x2ccaca=colorBorder('│',_0x55001f);_0x3fcab7===0x0?_0x4c8ba9[_0x4096bb(0x20a)](_0x2ccaca+'\x20'+_0x244a4b+'\x20'+_0x2ccaca+'\x20'+_0x22cd96['padEnd'](_0x50e8c1)+'\x20'+_0x2ccaca):_0x4c8ba9[_0x4096bb(0x20a)](_0x2ccaca+'\x20'+'\x20'[_0x4096bb(0x1eb)](_0x434788)+'\x20'+_0x2ccaca+'\x20'+_0x22cd96['padEnd'](_0x50e8c1)+'\x20'+_0x2ccaca);});}),_0x4c8ba9[_0x196af2(0x20a)](colorBorder('└─'+'─'[_0x196af2(0x1eb)](_0x434788)+_0x196af2(0x219)+'─'['repeat'](_0x50e8c1)+'─┘',_0x55001f));_0x426776&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b['yellow'][_0x196af2(0x1f7)](_0x196af2(0x20d)))),_0x4c8ba9[_0x196af2(0x20a)](_0x426776));_0x57f4bd&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9['push'](String(a53_0x1d096b[_0x196af2(0x216)][_0x196af2(0x1f7)]('[params]'))),_0x4c8ba9[_0x196af2(0x20a)](_0x57f4bd));_0x5ac716&&(_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b[_0x196af2(0x1ec)][_0x196af2(0x1f7)](_0x196af2(0x1ea)))),_0x4c8ba9[_0x196af2(0x20a)](_0x5ac716));if(_0x12cc9c){if(_0x12cc9c[_0x196af2(0x1de)]){_0x4c8ba9[_0x196af2(0x20a)](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b['red'][_0x196af2(0x1f7)](_0x196af2(0x1d6))));const _0x3f5329=_0x12cc9c[_0x196af2(0x1de)][_0x196af2(0x1f6)]('\x0a');_0x3f5329[_0x196af2(0x1f8)](_0x4293bc=>{const _0x3bf971=_0x196af2;_0x4293bc[_0x3bf971(0x212)]()&&_0x4c8ba9[_0x3bf971(0x20a)](_0x4293bc);});}if(_0x12cc9c['cmdout']){_0x4c8ba9['push'](''),_0x4c8ba9[_0x196af2(0x20a)](String(a53_0x1d096b[_0x196af2(0x1e6)][_0x196af2(0x1f7)](_0x196af2(0x1e4))));const _0xa0ef66=_0x12cc9c[_0x196af2(0x1d5)][_0x196af2(0x1f6)]('\x0a');_0xa0ef66[_0x196af2(0x1f8)](_0x40873b=>{const _0x117891=_0x196af2;_0x40873b['trim']()&&_0x4c8ba9[_0x117891(0x20a)](_0x40873b);});}}return _0x4c8ba9[_0x196af2(0x1f2)]('\x0a');}}}}function a53_0x4a1f(){const _0x17c1fb=['No\x20data','close','entries','number','log','max','─┬─','pipe','stdin','tsv','jsonl','map','rule','sdk-result','7mprjXM','limitStructuredFormats','isInteger','push','boolean','inherit','[query]','2887928rkjoxj','slice','FINISHED','output','trim','end','less','stringify','blue','limit','query','─┴─','1512108jSakEk','2295130DEHyuU','cmdout','[error]','bigint','params','keys','list','noColor','varchar','object','stderr','5452668KcQozI','color','508692AGfjaK','json','54106NcBzGg','[logs]','debug','cyan','resolve','table','-FXRSn','[rule]','repeat','magenta','error','format','double','Results\x20saved\x20to\x20','48yHEACh','join','2726232YgTrKa','length','spawn','split','bold','forEach'];a53_0x4a1f=function(){return _0x17c1fb;};return a53_0x4a1f();}export async function handleSingleObjectOutput(_0x5b1ff1,_0x12a51b){const _0x316d3c=a53_0x42f9;if(_0x12a51b[_0x316d3c(0x1ee)]==='table'){await handleSDKOutput([_0x5b1ff1],_0x12a51b);return;}const _0x495d17=resolveOutputOptions(_0x12a51b),_0x283fcd=await formatSingleObject(_0x5b1ff1,_0x495d17);await writeOutput(_0x283fcd,_0x495d17[_0x316d3c(0x211)]||undefined,_0x495d17['format']);}
1
+ (function(_0x19dc88,_0x1cf2f3){const _0x11224e=a53_0x23ee,_0x4cce0f=_0x19dc88();while(!![]){try{const _0x316f64=parseInt(_0x11224e(0x1d4))/0x1+-parseInt(_0x11224e(0x1ba))/0x2+parseInt(_0x11224e(0x1cc))/0x3*(parseInt(_0x11224e(0x1d0))/0x4)+-parseInt(_0x11224e(0x1bb))/0x5+parseInt(_0x11224e(0x1e3))/0x6*(parseInt(_0x11224e(0x1e8))/0x7)+-parseInt(_0x11224e(0x1f6))/0x8+parseInt(_0x11224e(0x1e4))/0x9*(-parseInt(_0x11224e(0x1bc))/0xa);if(_0x316f64===_0x1cf2f3)break;else _0x4cce0f['push'](_0x4cce0f['shift']());}catch(_0x59d6ef){_0x4cce0f['push'](_0x4cce0f['shift']());}}}(a53_0x15ba,0x8d03e));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 a53_0x5e49f3 from'chalk';function a53_0x15ba(){const _0x254d0e=['blue','join','error','bold','slice','log','json','FINISHED','stderr','entries','No\x20data','string','6xZNhsM','1071uzejXP','resolve','[logs]','stdout','7025711XBZxeq','stringify','noColor','list','Results\x20saved\x20to\x20','stdin','[query]','─┴─','cyan','color','limit','keys','debug','magenta','4455784ChgNic','close','filter','data','limitStructuredFormats','[params]','write','isInteger','repeat','isTTY','jsonl','[error]','map','[Object]','number','-FXRSn','double','max','1115372LblTzG','3550550AKIRWQ','14340tYGkng','boolean','yellow','tsv','cmdout','split','padEnd','forEach','inherit','─┬─','sdk-result','length','output','varchar','object','push','459hMmJLa','query','table','rule','26648vGGJYo','red','pipe','trim','550054XqzWrc','params','format'];a53_0x15ba=function(){return _0x254d0e;};return a53_0x15ba();}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0xbfdf1f){const _0x320f83=a53_0x23ee;return _0xbfdf1f[_0x320f83(0x1d6)]===_0x320f83(0x1dd)||_0xbfdf1f[_0x320f83(0x1d6)]==='jsonl'||_0xbfdf1f[_0x320f83(0x1d6)]===_0x320f83(0x1bf)||_0xbfdf1f[_0x320f83(0x1d6)]===_0x320f83(0x1ce)||_0xbfdf1f[_0x320f83(0x1dd)]===!![]||_0xbfdf1f[_0x320f83(0x200)]===!![]||_0xbfdf1f[_0x320f83(0x1bf)]===!![]||_0xbfdf1f[_0x320f83(0x1ce)]===!![];}export function parseOutputOptions(_0x1e15a8){const _0x567a7b=a53_0x23ee;return{'format':_0x1e15a8['format']||'table','output':_0x1e15a8['output']||'','limit':_0x1e15a8[_0x567a7b(0x1f2)],'limitStructuredFormats':_0x1e15a8[_0x567a7b(0x1fa)],'color':_0x1e15a8[_0x567a7b(0x1f1)],'noColor':_0x1e15a8[_0x567a7b(0x1ea)]};}function convertSDKResultToQueryResult(_0x7552aa){const _0x2ce386=a53_0x23ee,_0x28ebe6=[];if(_0x7552aa[_0x2ce386(0x1c7)]>0x0){const _0x1b34e8=_0x7552aa[0x0];for(const [_0x3bcd2a,_0x4c8312]of Object['entries'](_0x1b34e8)){let _0x11e4a9=_0x2ce386(0x1c9);if(typeof _0x4c8312===_0x2ce386(0x204))_0x11e4a9=Number[_0x2ce386(0x1fd)](_0x4c8312)?'bigint':_0x2ce386(0x1b8);else{if(typeof _0x4c8312===_0x2ce386(0x1bd))_0x11e4a9='boolean';else _0x4c8312===null&&(_0x11e4a9=_0x2ce386(0x1c9));}_0x28ebe6[_0x2ce386(0x1cb)]({'name':_0x3bcd2a,'type':_0x11e4a9});}}return{'queryId':_0x2ce386(0x1c6),'columns':_0x28ebe6,'data':_0x7552aa,'stats':{'state':_0x2ce386(0x1de),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x7552aa[_0x2ce386(0x1c7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x4f34e0,_0x13e2b2){const _0x3ad39e=convertSDKResultToQueryResult(_0x4f34e0);return formatQueryOutput(_0x3ad39e,_0x13e2b2);}export async function formatQueryOutput(_0x594e99,_0x54da3f){const _0x21308f=a53_0x23ee,{format:_0x492ea2,limit:_0x28b077,output:_0x589753,color:_0x3ff99d,noColor:_0x1aef47,limitStructuredFormats:_0xe48397}=_0x54da3f,_0x303caa=Boolean(_0x589753)&&!_0x3ff99d,_0x109943={'color':_0x3ff99d,'noColor':_0x1aef47||_0x303caa};if(_0x492ea2===_0x21308f(0x1ce)){const _0xaf93ca=shouldUseLess(_0x492ea2,_0x589753);return formatAsTable(_0x594e99,_0x28b077,_0xaf93ca,_0x109943);}const _0x148f6a=_0xe48397&&Number['isFinite'](_0x28b077)&&_0x594e99[_0x21308f(0x1f9)][_0x21308f(0x1c7)]>_0x28b077?{..._0x594e99,'data':_0x594e99[_0x21308f(0x1f9)][_0x21308f(0x1db)](0x0,_0x28b077)}:_0x594e99;if(_0x492ea2===_0x21308f(0x1dd))return formatAsJSON(_0x148f6a,_0x109943);else return _0x492ea2==='jsonl'?formatAsJSONL(_0x148f6a,_0x109943):formatQueryResult(_0x148f6a,_0x492ea2);}function shouldUseLess(_0x2e076b,_0x452a0a){const _0x434c38=a53_0x23ee;return(_0x2e076b===_0x434c38(0x1ce)||_0x2e076b===_0x434c38(0x1eb))&&process[_0x434c38(0x1e7)][_0x434c38(0x1ff)]&&!_0x452a0a;}export function resolveOutputOptions(_0x13e11b){const _0x4a5c2e=a53_0x23ee,_0x57afcd=_0x13e11b[_0x4a5c2e(0x1c8)]||'',_0x232914=resolveOutputFormat(_0x13e11b[_0x4a5c2e(0x1d6)],_0x57afcd,_0x4a5c2e(0x1ce));let _0x4666c4=typeof _0x13e11b[_0x4a5c2e(0x1f2)]===_0x4a5c2e(0x204)?_0x13e11b[_0x4a5c2e(0x1f2)]:parseInt(_0x13e11b[_0x4a5c2e(0x1f2)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x13e11b[_0x4a5c2e(0x1f2)]===undefined&&shouldUseLess(_0x232914,_0x57afcd)&&(_0x4666c4=Infinity),{'format':_0x232914,'output':_0x57afcd,'limit':_0x4666c4,'limitStructuredFormats':_0x13e11b[_0x4a5c2e(0x1fa)],'color':_0x13e11b[_0x4a5c2e(0x1f1)],'noColor':_0x13e11b[_0x4a5c2e(0x1ea)]};}export function writeOutput(_0x5ead05,_0x45c32e,_0x150af3){const _0x2fa092=a53_0x23ee;return _0x45c32e?(writeFileSync(_0x45c32e,_0x5ead05),console[_0x2fa092(0x1d9)](_0x2fa092(0x1ec)+_0x45c32e),Promise[_0x2fa092(0x1e5)]()):shouldUseLess(_0x150af3||'','')?new Promise(_0x31f59f=>{const _0x46ed3a=_0x2fa092,_0x38f8ba=spawn('less',[_0x46ed3a(0x205)],{'stdio':[_0x46ed3a(0x1d2),_0x46ed3a(0x1c4),_0x46ed3a(0x1c4)]});let _0x303681=![];_0x38f8ba['on'](_0x46ed3a(0x1d9),()=>{const _0x1df84e=_0x46ed3a;!_0x303681&&(_0x303681=!![],console[_0x1df84e(0x1dc)](_0x5ead05),_0x31f59f());}),_0x38f8ba['on'](_0x46ed3a(0x1f7),()=>{!_0x303681&&(_0x303681=!![],_0x31f59f());}),_0x38f8ba['on']('spawn',()=>{const _0x4ed88c=_0x46ed3a;!_0x303681&&_0x38f8ba[_0x4ed88c(0x1ed)]&&(_0x38f8ba[_0x4ed88c(0x1ed)]['on'](_0x4ed88c(0x1d9),()=>{}),_0x38f8ba[_0x4ed88c(0x1ed)][_0x4ed88c(0x1fc)](_0x5ead05),_0x38f8ba[_0x4ed88c(0x1ed)]['end']());}),!_0x38f8ba[_0x46ed3a(0x1ed)]&&(!_0x303681&&(_0x303681=!![],console[_0x46ed3a(0x1dc)](_0x5ead05),_0x31f59f()));}):(console[_0x2fa092(0x1dc)](_0x5ead05),Promise['resolve']());}export async function handleSDKOutput(_0x27c6dd,_0x5d2e48){const _0x2ef0e2=a53_0x23ee,_0x53f06a=resolveOutputOptions(_0x5d2e48),_0x52c8fa=await formatSDKOutput(_0x27c6dd,_0x53f06a);await writeOutput(_0x52c8fa,_0x53f06a['output']||undefined,_0x53f06a[_0x2ef0e2(0x1d6)]);}export async function handleQueryOutput(_0x16d50a,_0x45fce2){const _0x5364f6=resolveOutputOptions(_0x45fce2),_0x781140=await formatQueryOutput(_0x16d50a,_0x5364f6);await writeOutput(_0x781140,_0x5364f6['output']||undefined,_0x5364f6['format']);}function a53_0x23ee(_0x3a10ed,_0x1f1641){_0x3a10ed=_0x3a10ed-0x1b8;const _0x15ba34=a53_0x15ba();let _0x23eed1=_0x15ba34[_0x3a10ed];return _0x23eed1;}async function formatSingleObject(_0x220875,_0x3b7af4){const _0x15cdf0=a53_0x23ee,{format:_0x3f3502,color:_0xd98e4a,noColor:_0x5bfcf9}=_0x3b7af4,_0x2a1c62={'color':_0xd98e4a,'noColor':_0x5bfcf9};if(_0x3f3502===_0x15cdf0(0x1dd)){if(shouldUseColor(_0x2a1c62))return colorizeJSON(_0x220875,_0x2a1c62);return JSON['stringify'](_0x220875,null,0x2);}else{if(_0x3f3502===_0x15cdf0(0x200)){if(shouldUseColor(_0x2a1c62))return colorizeJSONCompact(_0x220875,_0x2a1c62);return JSON[_0x15cdf0(0x1e9)](_0x220875);}else{if(_0x3f3502===_0x15cdf0(0x1bf))return Object['entries'](_0x220875)['map'](([_0x19d700,_0x3bb58d])=>_0x19d700+'\x09'+_0x3bb58d)[_0x15cdf0(0x1d8)]('\x0a');else{const _0x3a20e9=Object[_0x15cdf0(0x1e0)](_0x220875);if(_0x3a20e9[_0x15cdf0(0x1c7)]===0x0)return _0x15cdf0(0x1e1);const _0x561c4b=_0x220875[_0x15cdf0(0x1f4)],_0x2d4467=_0x220875['query'],_0x25c44c=_0x220875[_0x15cdf0(0x1d5)],_0x236777=_0x220875[_0x15cdf0(0x1cf)],_0x23a2d7=_0x2d4467?typeof _0x2d4467===_0x15cdf0(0x1e2)?_0x2d4467:JSON[_0x15cdf0(0x1e9)](_0x2d4467,null,0x2):undefined,_0x3fcc90=_0x25c44c&&Object[_0x15cdf0(0x1f3)](_0x25c44c)[_0x15cdf0(0x1c7)]>0x0?JSON['stringify'](_0x25c44c,null,0x2):undefined,_0x5e9121=_0x236777&&Object[_0x15cdf0(0x1f3)](_0x236777)['length']>0x0?JSON['stringify'](_0x236777,null,0x2):undefined,_0x3e44c1=_0x3a20e9[_0x15cdf0(0x1f8)](([_0x373f96])=>_0x373f96!==_0x15cdf0(0x1f4)&&_0x373f96!==_0x15cdf0(0x1cd)&&_0x373f96!==_0x15cdf0(0x1d5)&&_0x373f96!==_0x15cdf0(0x1cf)),_0x14677d=Math[_0x15cdf0(0x1b9)](..._0x3e44c1[_0x15cdf0(0x202)](([_0x1f8a19])=>_0x1f8a19[_0x15cdf0(0x1c7)])),_0x4330fe=Math[_0x15cdf0(0x1b9)](..._0x3e44c1[_0x15cdf0(0x202)](([,_0x58d7f7])=>{const _0x3c1de4=_0x15cdf0;try{const _0x428766=_0x58d7f7===null||_0x58d7f7===undefined?'':typeof _0x58d7f7===_0x3c1de4(0x1ca)?JSON[_0x3c1de4(0x1e9)](_0x58d7f7):String(_0x58d7f7),_0x105685=_0x428766[_0x3c1de4(0x1c1)]('\x0a');return Math[_0x3c1de4(0x1b9)](..._0x105685[_0x3c1de4(0x202)](_0x4cc1a1=>_0x4cc1a1['length']),0x0);}catch{return 0x0;}}),0x14),_0x3c7cfd=[];_0x3c7cfd[_0x15cdf0(0x1cb)](colorBorder('┌─'+'─'[_0x15cdf0(0x1fe)](_0x14677d)+_0x15cdf0(0x1c5)+'─'['repeat'](_0x4330fe)+'─┐',_0x2a1c62)),_0x3e44c1[_0x15cdf0(0x1c3)](([_0x29e993,_0x237ca7])=>{const _0x1ed0bb=_0x15cdf0;let _0x570e00;try{_0x570e00=_0x237ca7===null||_0x237ca7===undefined?'':typeof _0x237ca7===_0x1ed0bb(0x1ca)?JSON[_0x1ed0bb(0x1e9)](_0x237ca7):String(_0x237ca7);}catch{_0x570e00=_0x1ed0bb(0x203);}const _0x3512f9=_0x29e993['padEnd'](_0x14677d),_0x3e30d3=_0x570e00[_0x1ed0bb(0x1c1)]('\x0a');_0x3e30d3[_0x1ed0bb(0x1c3)]((_0x51aa45,_0xd16942)=>{const _0x1bf721=_0x1ed0bb,_0x32fc7e=colorBorder('│',_0x2a1c62);_0xd16942===0x0?_0x3c7cfd[_0x1bf721(0x1cb)](_0x32fc7e+'\x20'+_0x3512f9+'\x20'+_0x32fc7e+'\x20'+_0x51aa45[_0x1bf721(0x1c2)](_0x4330fe)+'\x20'+_0x32fc7e):_0x3c7cfd[_0x1bf721(0x1cb)](_0x32fc7e+'\x20'+'\x20'[_0x1bf721(0x1fe)](_0x14677d)+'\x20'+_0x32fc7e+'\x20'+_0x51aa45[_0x1bf721(0x1c2)](_0x4330fe)+'\x20'+_0x32fc7e);});}),_0x3c7cfd[_0x15cdf0(0x1cb)](colorBorder('└─'+'─'[_0x15cdf0(0x1fe)](_0x14677d)+_0x15cdf0(0x1ef)+'─'[_0x15cdf0(0x1fe)](_0x4330fe)+'─┘',_0x2a1c62));_0x23a2d7&&(_0x3c7cfd[_0x15cdf0(0x1cb)](''),_0x3c7cfd[_0x15cdf0(0x1cb)](String(a53_0x5e49f3[_0x15cdf0(0x1be)][_0x15cdf0(0x1da)](_0x15cdf0(0x1ee)))),_0x3c7cfd['push'](_0x23a2d7));_0x3fcc90&&(_0x3c7cfd[_0x15cdf0(0x1cb)](''),_0x3c7cfd[_0x15cdf0(0x1cb)](String(a53_0x5e49f3[_0x15cdf0(0x1d7)]['bold'](_0x15cdf0(0x1fb)))),_0x3c7cfd['push'](_0x3fcc90));_0x5e9121&&(_0x3c7cfd[_0x15cdf0(0x1cb)](''),_0x3c7cfd[_0x15cdf0(0x1cb)](String(a53_0x5e49f3[_0x15cdf0(0x1f5)]['bold']('[rule]'))),_0x3c7cfd[_0x15cdf0(0x1cb)](_0x5e9121));if(_0x561c4b){if(_0x561c4b[_0x15cdf0(0x1df)]){_0x3c7cfd[_0x15cdf0(0x1cb)](''),_0x3c7cfd['push'](String(a53_0x5e49f3[_0x15cdf0(0x1d1)][_0x15cdf0(0x1da)](_0x15cdf0(0x201))));const _0x284a09=_0x561c4b[_0x15cdf0(0x1df)]['split']('\x0a');_0x284a09[_0x15cdf0(0x1c3)](_0x58cfca=>{const _0x4238ce=_0x15cdf0;_0x58cfca[_0x4238ce(0x1d3)]()&&_0x3c7cfd['push'](_0x58cfca);});}if(_0x561c4b[_0x15cdf0(0x1c0)]){_0x3c7cfd[_0x15cdf0(0x1cb)](''),_0x3c7cfd[_0x15cdf0(0x1cb)](String(a53_0x5e49f3[_0x15cdf0(0x1f0)][_0x15cdf0(0x1da)](_0x15cdf0(0x1e6))));const _0x175dfc=_0x561c4b[_0x15cdf0(0x1c0)][_0x15cdf0(0x1c1)]('\x0a');_0x175dfc[_0x15cdf0(0x1c3)](_0x4d026e=>{const _0x2b4090=_0x15cdf0;_0x4d026e[_0x2b4090(0x1d3)]()&&_0x3c7cfd['push'](_0x4d026e);});}}return _0x3c7cfd[_0x15cdf0(0x1d8)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x3de149,_0x499dec){const _0x5c4941=a53_0x23ee;if(_0x499dec['format']===_0x5c4941(0x1ce)){await handleSDKOutput([_0x3de149],_0x499dec);return;}const _0x4ef653=resolveOutputOptions(_0x499dec),_0x517418=await formatSingleObject(_0x3de149,_0x4ef653);await writeOutput(_0x517418,_0x4ef653[_0x5c4941(0x1c8)]||undefined,_0x4ef653[_0x5c4941(0x1d6)]);}