@treasuredata/tdx 2026.4.2 → 2026.4.4

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-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/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a54_0x47092e=a54_0x5152;(function(_0x2c8a93,_0x33c51c){const _0x35f388=a54_0x5152,_0x138b09=_0x2c8a93();while(!![]){try{const _0x2c82cc=parseInt(_0x35f388(0x269))/0x1+parseInt(_0x35f388(0x1ee))/0x2+-parseInt(_0x35f388(0x27a))/0x3*(parseInt(_0x35f388(0x299))/0x4)+parseInt(_0x35f388(0x332))/0x5*(parseInt(_0x35f388(0x305))/0x6)+-parseInt(_0x35f388(0x18a))/0x7*(-parseInt(_0x35f388(0x1d2))/0x8)+-parseInt(_0x35f388(0x2f3))/0x9+-parseInt(_0x35f388(0x2ff))/0xa;if(_0x2c82cc===_0x33c51c)break;else _0x138b09['push'](_0x138b09['shift']());}catch(_0x1d1fbb){_0x138b09['push'](_0x138b09['shift']());}}}(a54_0x45e2,0x9e579));import a54_0xdf4b4c from'chalk';import{existsSync}from'fs';import a54_0x4287ed from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';function a54_0x5152(_0x5acbfc,_0x4ef7cf){_0x5acbfc=_0x5acbfc-0x184;const _0x45e2f7=a54_0x45e2();let _0x5152d2=_0x45e2f7[_0x5acbfc];return _0x5152d2;}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';function a54_0x45e2(){const _0x167f27=['--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x22\x20already\x20exists\x20(ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','getMonth','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','revision','\x20secrets\x20set\x20for\x20project\x20\x27','\x20\x20Location:\x20','\x20attempt','format','24OCGOOB','\x20workflow','Source\x20directory:\x20','Filter:\x20','\x20session','✔\x20Downloaded\x20','\x20schedule','\x20(disabled)','Retry\x20a\x20session\x20or\x20attempt','cwd','\x20new','session_id','Select\x20a\x20session\x20to\x20view\x20timeline:','logs','localeCompare','attemptId','write','\x20from\x20session\x20','toLocaleString','LABEL_MIN_SPACING','Failed\x20to\x20fetch\x20attempt\x20data','sourceProjectName','resolveProjectId','start','task','✔\x20Secret\x20\x27','\x20\x20Session\x20context\x20set\x20to:\x20','\x20secret','2262398CxiHXH','Key\x20cannot\x20be\x20empty','splice','getTime','TASK_NAME_WIDTH','every','Schedule\x20ID\x20is\x20required','project','hasChanges','path','values','planned','state','relative','MAX_TIMELINE_WIDTH','nextRunTime','Task\x20name:\x20','prepareCloneProject','match','workflow:secrets:list','filesExtracted','List\x20all\x20workflow\x20projects','\x22\x20with\x20new\x20revision?','projectName','msPerChar','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','repeat','Status:\x20','size','Filter:\x20project=','fill','Project:\x20','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Attempt:\x20','workflow:clone','yes','No\x20schedules\x20found','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Listing\x20secrets...','✔\x20Clone\x20complete','\x0a✔\x20Attempt\x20complete','all','Dry\x20run:\x20yes','\x20\x20Target:\x20','workflow:secrets:set','\x27\x20from\x20project\x20\x27','workflow:kill','workflow:attempt','Source\x20project:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','No\x20workflow\x20sessions\x20found','Listing\x20workflow\x20sessions...','canceling','isArray','\x20tasks','attempt','table','buildTimelineData','\x20\x20Changes:\x20','revision:\x20','window','resolve','durationMs','\x20\x20Project\x20ID:\x20','List\x20workflow\x20attempts','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','changes','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','✔\x20Found\x20','Listing\x20workflow\x20attempts...','max','follow','round','getDate','utf-8','Deleting\x20secret...','blue','MAX_POLL_ITERATIONS','Expected\x20format:\x20--param\x20key=value','Error:\x20','Pushing\x20workflow\x20project...','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','group_error','fullName','map','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:workflows','indexOf','No\x20attempts\x20found','select','Resume\x20from:\x20','\x20to\x20see\x20detailed\x20logs','workflowName','\x20\x20Source:\x20','\x0aApply\x20these\x20changes?','\x20has\x20no\x20attempts','✔\x20Workflow\x20project\x20set\x20to:\x20','Listing\x20workflow\x20projects...','toLowerCase','Show\x20specific\x20attempt\x20details','\x20unchanged','workflow:logs','\x22\x20to\x20new\x20project\x20\x22','\x1b[1A\x1b[2K','toISOString','parseProjectWorkflowPattern','No\x20sessions\x20found','Include\x20retried:\x20yes','💡\x20Tip:\x20Use\x20','retrySession','\x0aError:','finishedAt','pending','message','log','\x20-\x20','force','Validation:\x20skipped','\x0a✔\x20Already\x20up\x20to\x20date','Total:\x20','\x0a⚠\x20Project\x20\x22','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','lastAttempt','1167437sdNEco','\x20\x20Revision:\x20','skipValidation','pullProject','→\x20New\x20project:\x20','updatedAt','\x0aDry\x20run\x20-\x20nothing\x20pushed','\x20disabled\x20(','basename','key','Downloading\x20logs...','substring','Loading\x20workflows...','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','pollTimeline','fs/promises','6QcPJIf','dryRun','MIN_TIMELINE_WIDTH','floor','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','reason','Disable\x20a\x20workflow\x20schedule','No\x20workflow\x20projects\x20found','workflow','✔\x20Workflow\x20project\x20context\x20cleared.','---\x20','context','generateSessionTimelineRows','end','MIN_LABEL_COUNT','sys','List\x20workflow\x20execution\x20sessions','autocomplete','type','Error:\x20Project\x20name\x20is\x20required','execute','done','workflow:projects','limit','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','sort','Auto-selected\x20latest\x20session:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','✔\x20Retry\x20started','workflow:schedule:enable','resolveProject','690140YwVLpg','Source\x20directory\x20is\x20required','isTTY','targetExists','/attempt/','padStart','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','ICON_SPACING','Writing\x20files...','(use\x20--limit\x20to\x20see\x20more)','showWorkflowConsoleUrl','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','kill','success','\x20deleted','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','stringify','modified','output','newProjectName','sourceDir','✔\x20Project:\x20','Force:\x20yes','deleteSecret','Reason:\x20','renderTimeline','targetDir','No\x20log\x20files\x20found\x20for\x20this\x20attempt','No\x20matching\x20sessions\x20found','workflow:push','No\x20attempts\x20found\x20in\x20project:\x20','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','workflow:retry','No\x20sessions\x20found\x20for:\x20','new','total','Downloading\x20project\x20','Pulling\x20project\x20','\x20modified','isNewProject','json','Kill\x20a\x20running\x20attempt','min','workflow:attempts','projectId','error','running','attempt:','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','-\x20no\x20files\x20written','resolveProjectDir','yellow','workflow:delete','From\x20task:\x20','List\x20workflow\x20schedules','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Usage:\x20tdx\x20wf\x20use\x20<project>','params','index','now','Project\x20name\x20is\x20required','filter','Session\x20time:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:upload','\x20\x20Project:\x20','Key:\x20','stdout','Secrets\x20to\x20set:\x20','/sessions/','icon','includeRetried','data','renderSessionsTimeline','find','resumeFrom','preparePushProject','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','✔\x20Schedule\x20#','No\x20workflows\x20found\x20in\x20project:\x20','Show\x20tasks\x20for\x20an\x20attempt','startedAt','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','trim','Starting\x20workflow\x20run...','✔\x20Deleted\x20project\x20','Loading\x20session...','9074646DPwAWh','some','enableSchedule','Target:\x20','displayLine','\x20\x20Files\x20extracted:\x20','New\x20project\x20name:\x20','parse','\x0a✔\x20No\x20changes\x20to\x20push','requireProject','✔\x20Project\x20updated','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','7892860vLcZgC','No\x20sessions\x20found\x20in\x20project:\x20','fromTask','Loading\x20sessions...','verbose','\x20sessions\x20','354hyogcq','split','\x20\x20Attempt\x20ID:\x20','retryAttempt','taskName','push','jsonl','red','createdAt','status','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','listSecrets','white','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Select\x20a\x20workflow\x20to\x20run','join','Cancelled','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','length','Project\x20name:\x20','fileCount','renderSingleTimeline','fileSize','\x0aPush\x20these\x20changes?','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','\x0aClone\x20\x22','⚠\x20Showing\x20first\x20','sessions','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','slice','sessionTime','dim','Updating\x20','(unknown)','navigateSessionsInteractive','📋\x20','ICON_WIDTH','\x20project','workflows','\x20of\x20','duration','\x20\x20New\x20attempt\x20ID:\x20','Project\x20filter:\x20','rows','text','30430WlKSUy','session:','📁\x20','site','cyan','executePushProject','\x0aUpdate\x20existing\x20project\x20\x22','Fetching\x20log\x20files...','delete','No\x20workflows\x20found','workflowProject','sessionId','stat','attempts','Attempt\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','Workflow:\x20','.\x20Expected\x20format:\x20KEY=VALUE','311521DogExp','✔\x20Pull\x20complete','✔\x20Pushed\x20','\x20is\x20not\x20a\x20directory','\x20(system)','startsWith','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','workflow:schedule:disable','listSchedules','columns','\x20\x20Console:\x20','workflow:schedules','unchanged','workflow:run','newProjectId','Error:','\x20enabled\x20(','includeSubtasks','get','title','No\x20sessions\x20with\x20timing\x20information','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','summary','\x20\x20Workflow:\x20','Error:\x20Attempt\x20ID\x20is\x20required','startTime','Source:\x20','Retrying\x20session...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','workflow:download','Invalid\x20format:\x20','includes','MAX_TASKS_DISPLAY','\x20\x20Session\x20ID:\x20','Files\x20to\x20upload:\x20','isDirectory','Warning:','set','...','unknown','green','keys','getFullYear','diff','has','list','retryAttemptName','Start\x20a\x20workflow\x20run','cancelRequested','Killing\x20attempt...','\x20(use\x20--limit\x20to\x20show\x20more)','Revision:\x20','Project\x20directory:\x20','tasks','LABEL_WIDTH_DIVISOR','Deleting\x20project\x20','session','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description','Tip:\x20cd\x20to\x20workflows/','tdx.json'];a54_0x45e2=function(){return _0x167f27;};return a54_0x45e2();}import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x5c5794 from'prompts';function getAttemptStatusDisplay(_0x575759){const _0x26b14b=a54_0x5152;if(!_0x575759)return{'icon':'⏳','text':''};const {done:_0x2d8b20,success:_0x4a5467,cancelRequested:_0x41e8d4}=_0x575759;if(!_0x2d8b20)return _0x41e8d4?{'icon':'🛑','text':a54_0xdf4b4c['yellow'](_0x26b14b(0x222))}:{'icon':'🔄','text':a54_0xdf4b4c[_0x26b14b(0x23a)](_0x26b14b(0x2c9))};if(_0x4a5467)return{'icon':'✅','text':a54_0xdf4b4c[_0x26b14b(0x1b2)]('success')};return{'icon':'❌','text':a54_0xdf4b4c[_0x26b14b(0x30c)](_0x26b14b(0x2c8))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x47092e(0x298)](_0x1b5456,_0x3011a9,_0x3c5022=0x0){const _0x211843=a54_0x47092e;return _0x1b5456[_0x3c5022]||_0x3011a9[_0x211843(0x33c)];}[a54_0x47092e(0x2fc)](_0x222df5,_0x13291b,_0x3ea222=0x0){const _0x36f6db=a54_0x47092e,_0x71c3c8=this['resolveProject'](_0x222df5,_0x13291b,_0x3ea222);if(!_0x71c3c8)return console[_0x36f6db(0x2c8)](a54_0xdf4b4c[_0x36f6db(0x30c)]('Error:'),_0x36f6db(0x2d7)),console[_0x36f6db(0x2c8)](a54_0xdf4b4c['dim']('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x71c3c8;}['parseProjectWorkflowPattern'](_0x4d683b,_0x590deb){const _0x3b5322=a54_0x47092e;if(_0x4d683b[0x0]){const _0x7e98b3=_0x4d683b[0x0]['split']('.');if(_0x7e98b3[_0x3b5322(0x317)]===0x1)return{'projectName':_0x7e98b3[0x0],'workflowName':undefined};else return _0x7e98b3[_0x3b5322(0x317)]===0x2?{'projectName':_0x7e98b3[0x0],'workflowName':_0x7e98b3[0x1]}:(console[_0x3b5322(0x2c8)](a54_0xdf4b4c['red'](_0x3b5322(0x199)),'Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow'),null);}return{'projectName':_0x590deb[_0x3b5322(0x33c)],'workflowName':undefined};}[a54_0x47092e(0x2cd)](_0x52a2d6,_0x48d352,_0x500f42=0x0){const _0x2ab3a7=a54_0x47092e;if(_0x52a2d6[_0x500f42])return _0x52a2d6[_0x500f42];if(_0x48d352['workflowProject']){const _0x1da8b6=a54_0x4287ed[_0x2ab3a7(0x314)](process[_0x2ab3a7(0x1db)](),_0x2ab3a7(0x32b),_0x48d352['workflowProject']);if(existsSync(a54_0x4287ed['join'](_0x1da8b6,_0x2ab3a7(0x1c7))))return _0x1da8b6;}return undefined;}async[a54_0x47092e(0x2a4)](_0x174d70,_0xcf37fe,_0xbba974){const _0x21cdb1=a54_0x47092e;try{const _0x14baf2=await _0x174d70[_0x21cdb1(0x282)][_0x21cdb1(0x32b)](_0xcf37fe,{'limit':0x1});if(_0x14baf2[_0x21cdb1(0x317)]>0x0){const _0xe0b0f5=_0x14baf2[0x0]['id'],_0x5298b3=getWorkflowUrl(_0xbba974,_0xe0b0f5);console[_0x21cdb1(0x2c8)](_0x21cdb1(0x194)+a54_0xdf4b4c[_0x21cdb1(0x336)](_0x5298b3));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';['description']='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async['execute'](_0x57ca6b){const _0x4fcf06=a54_0x47092e,{options:_0x176062,args:_0x1327d3,tdx:_0x124534}=_0x57ca6b,_0xf462f4=_0x1327d3[0x0],_0x5a303d=_0x176062['clear'];if(_0x5a303d)return saveSessionContext({'workflow_project':undefined},_0x176062['session']),console[_0x4fcf06(0x260)](a54_0xdf4b4c['green'](_0x4fcf06(0x283))),0x0;if(!_0xf462f4)return console['error'](a54_0xdf4b4c[_0x4fcf06(0x30c)](_0x4fcf06(0x199)),_0x4fcf06(0x2d7)),console['error'](a54_0xdf4b4c[_0x4fcf06(0x324)](_0x4fcf06(0x2d3))),console[_0x4fcf06(0x2c8)](a54_0xdf4b4c[_0x4fcf06(0x324)](_0x4fcf06(0x2ee))),0x1;const _0xb68b16=await withSpinner('Resolving\x20project\x20\x27'+_0xf462f4+'\x27...',()=>_0x124534[_0x4fcf06(0x282)][_0x4fcf06(0x1e8)](_0xf462f4),{'verbose':_0x176062[_0x4fcf06(0x303)]}),{name:_0x5e945b}=_0xb68b16[_0x4fcf06(0x2e3)];return saveSessionContext({'workflow_project':_0x5e945b},_0x176062[_0x4fcf06(0x1c2)]),console['log'](a54_0xdf4b4c[_0x4fcf06(0x1b2)](_0x4fcf06(0x24e)+a54_0xdf4b4c[_0x4fcf06(0x336)](_0x5e945b))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x290);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x203);async['execute'](_0x41341f){const _0x505477=a54_0x47092e,{options:_0x3ce0b8,args:_0x2e3299,tdx:_0x1515a3}=_0x41341f,_0x2ca9b4=_0x2e3299[0x0];_0x3ce0b8[_0x505477(0x303)]&&_0x2ca9b4&&console[_0x505477(0x2c8)]('Pattern:\x20'+_0x2ca9b4);const _0x11a494=await withSpinner(_0x505477(0x24f),()=>_0x1515a3[_0x505477(0x282)]['projects'](_0x2ca9b4,{'limit':_0x3ce0b8[_0x505477(0x291)]}),{'verbose':_0x3ce0b8[_0x505477(0x303)]});let _0x5bd61b=_0x11a494[_0x505477(0x2e3)];_0x5bd61b[_0x505477(0x293)]((_0x24eb32,_0x2e1052)=>_0x24eb32[_0x505477(0x2a0)][_0x505477(0x1e0)](_0x2e1052[_0x505477(0x2a0)]));const _0x38188d=_0x3ce0b8[_0x505477(0x291)]||0x64,_0x309c4a=_0x5bd61b[_0x505477(0x317)]>=_0x38188d?a54_0xdf4b4c[_0x505477(0x324)](_0x505477(0x1bc)):'';console['error']('✔\x20Found\x20'+_0x5bd61b[_0x505477(0x317)]+_0x505477(0x32a)+(_0x5bd61b[_0x505477(0x317)]!==0x1?'s':'')+_0x309c4a);if(_0x3ce0b8['format']===_0x505477(0x2c3)||_0x3ce0b8[_0x505477(0x1d1)]===_0x505477(0x30b)||_0x3ce0b8[_0x505477(0x1d1)]==='table')await handleSDKOutput(_0x5bd61b,_0x3ce0b8);else{if(_0x5bd61b[_0x505477(0x317)]===0x0)_0x2ca9b4?console[_0x505477(0x260)]('No\x20projects\x20match\x20pattern:\x20'+_0x2ca9b4):console[_0x505477(0x260)](_0x505477(0x281));else{const _0x49c332=_0x5bd61b[_0x505477(0x242)](_0x528fa3=>{const _0x2a4cb1=_0x505477,_0x3ad9cf=_0x528fa3['metadata']?.[_0x2a4cb1(0x2f4)](_0x3c153d=>_0x3c153d[_0x2a4cb1(0x272)]===_0x2a4cb1(0x289)),_0x32f1bf=_0x3ad9cf?a54_0xdf4b4c[_0x2a4cb1(0x324)](_0x2a4cb1(0x18e)):'';return _0x2a4cb1(0x334)+_0x528fa3['name']+_0x32f1bf;});await writeOutput(_0x49c332[_0x505477(0x314)]('\x0a'),_0x3ce0b8[_0x505477(0x2ad)],_0x505477(0x1b7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x244);[a54_0x47092e(0x1c5)]='List\x20workflows';async[a54_0x47092e(0x28e)](_0x122737){const _0x4c0be0=a54_0x47092e,{options:_0x4a71ff,args:_0x1d9b6d,tdx:_0x10dc64}=_0x122737,_0x1ff5aa=this[_0x4c0be0(0x298)](_0x1d9b6d,_0x4a71ff);_0x4a71ff[_0x4c0be0(0x303)]&&_0x1ff5aa&&console['error'](_0x4c0be0(0x32f)+_0x1ff5aa);const _0x545656=await withSpinner('Listing\x20workflows...',()=>_0x10dc64[_0x4c0be0(0x282)][_0x4c0be0(0x32b)](_0x1ff5aa,{'limit':_0x4a71ff['limit']}),{'verbose':_0x4a71ff['verbose']});let _0x153990=_0x545656['data'];_0x153990[_0x4c0be0(0x293)]((_0xa234e9,_0x434885)=>{const _0x10ebd2=_0x4c0be0,_0x49486d=_0xa234e9[_0x10ebd2(0x2a0)]['localeCompare'](_0x434885[_0x10ebd2(0x2a0)]);if(_0x49486d!==0x0)return _0x49486d;return(_0xa234e9[_0x10ebd2(0x1f5)]?.[_0x10ebd2(0x2a0)]||'')['localeCompare'](_0x434885[_0x10ebd2(0x1f5)]?.[_0x10ebd2(0x2a0)]||'');});const _0x20b9ad=_0x4a71ff[_0x4c0be0(0x291)]||0x64,_0x377d06=_0x153990[_0x4c0be0(0x317)]>=_0x20b9ad?a54_0xdf4b4c['dim'](_0x4c0be0(0x1bc)):'';console[_0x4c0be0(0x2c8)](_0x4c0be0(0x232)+_0x153990[_0x4c0be0(0x317)]+_0x4c0be0(0x1d3)+(_0x153990[_0x4c0be0(0x317)]!==0x1?'s':'')+_0x377d06);if(_0x4a71ff['format']===_0x4c0be0(0x2c3)||_0x4a71ff[_0x4c0be0(0x1d1)]==='jsonl'||_0x4a71ff[_0x4c0be0(0x1d1)]===_0x4c0be0(0x226))await handleSDKOutput(_0x153990,_0x4a71ff);else{if(_0x153990[_0x4c0be0(0x317)]===0x0)_0x1ff5aa?console['log'](_0x4c0be0(0x2ea)+_0x1ff5aa):console[_0x4c0be0(0x260)](_0x4c0be0(0x33b));else{const _0x2d29d7=_0x4a71ff[_0x4c0be0(0x335)],_0x356b25=_0x153990[_0x4c0be0(0x242)](_0x7887d0=>{const _0x3348e5=_0x4c0be0,_0x13939a=a54_0xdf4b4c[_0x3348e5(0x324)]('#'+_0x7887d0['id']),_0x26b654=hyperlink(_0x13939a,getWorkflowUrl(_0x2d29d7,_0x7887d0['id'])),_0x58d7dc=_0x7887d0[_0x3348e5(0x1f5)]?.['name']?a54_0xdf4b4c[_0x3348e5(0x324)]('\x20('+_0x7887d0[_0x3348e5(0x1f5)]['name']+')'):'';return _0x3348e5(0x328)+_0x26b654+'\x20'+_0x7887d0[_0x3348e5(0x2a0)]+_0x58d7dc;});await writeOutput(_0x356b25[_0x4c0be0(0x314)]('\x0a'),_0x4a71ff[_0x4c0be0(0x2ad)],_0x4c0be0(0x1b7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]='workflow:sessions';['description']=a54_0x47092e(0x28a);async[a54_0x47092e(0x28e)](_0x243755){const _0xd0b498=a54_0x47092e,{options:_0x2b7c65,args:_0x4e36d2,tdx:_0x836d18}=_0x243755,_0x16b1b8=this[_0xd0b498(0x257)](_0x4e36d2,_0x2b7c65);if(!_0x16b1b8)return 0x1;const {projectName:_0x4aaab2,workflowName:_0x22503d}=_0x16b1b8;if(_0x2b7c65[_0xd0b498(0x303)]){if(_0x4aaab2&&_0x22503d)console[_0xd0b498(0x2c8)]('Filter:\x20'+_0x4aaab2+'.'+_0x22503d);else _0x4aaab2&&console[_0xd0b498(0x2c8)](_0xd0b498(0x20b)+_0x4aaab2);const _0x13747d=_0x2b7c65['status'];_0x13747d&&console[_0xd0b498(0x2c8)](_0xd0b498(0x209)+_0x13747d);}let _0x4fcc50=0x28;if(process[_0xd0b498(0x2de)][_0xd0b498(0x29b)]&&!_0x2b7c65[_0xd0b498(0x2ad)]&&!_0x2b7c65[_0xd0b498(0x1d1)]){const _0x3765f5=process[_0xd0b498(0x2de)]['rows']||0x28;_0x4fcc50=Math[_0xd0b498(0x234)](0x14,Math['floor'](_0x3765f5*0x2/0x3));}const _0x1187e0=_0x2b7c65['limit']||_0x4fcc50,_0x1fc2df=await withSpinner(_0xd0b498(0x221),()=>_0x836d18[_0xd0b498(0x282)]['sessions']({'projectName':_0x4aaab2,'workflowName':_0x22503d,'status':_0x2b7c65[_0xd0b498(0x30e)],'fromTime':_0x2b7c65['from'],'toTime':_0x2b7c65['to'],'limit':_0x1187e0}),{'verbose':_0x2b7c65['verbose']}),_0x1efbe0=_0x1fc2df[_0xd0b498(0x2e3)];_0x1efbe0[_0xd0b498(0x293)]((_0x305a4a,_0x5b8078)=>{const _0x3acb0b=_0xd0b498,_0xc58bef=_0x305a4a['sessionTime']||'',_0x5bba56=_0x5b8078['sessionTime']||'';return _0x5bba56[_0x3acb0b(0x1e0)](_0xc58bef);});_0x1efbe0[_0xd0b498(0x317)]>=_0x1187e0?console[_0xd0b498(0x2c8)]('✔\x20Showing\x20'+_0x1efbe0['length']+_0xd0b498(0x304)+a54_0xdf4b4c[_0xd0b498(0x324)](_0xd0b498(0x2a3))):console[_0xd0b498(0x2c8)]('✔\x20Found\x20'+_0x1efbe0[_0xd0b498(0x317)]+_0xd0b498(0x1d6)+(_0x1efbe0[_0xd0b498(0x317)]!==0x1?'s':''));if(_0x2b7c65[_0xd0b498(0x1d1)]==='json'||_0x2b7c65[_0xd0b498(0x1d1)]===_0xd0b498(0x30b)||_0x2b7c65[_0xd0b498(0x1d1)]===_0xd0b498(0x226))await handleSDKOutput(_0x1efbe0,_0x2b7c65);else{if(!process[_0xd0b498(0x2de)][_0xd0b498(0x29b)]||_0x2b7c65[_0xd0b498(0x2ad)]){if(_0x1efbe0[_0xd0b498(0x317)]===0x0){if(_0x4aaab2&&_0x22503d)console[_0xd0b498(0x260)](_0xd0b498(0x2bc)+_0x4aaab2+'.'+_0x22503d);else _0x4aaab2?console[_0xd0b498(0x260)](_0xd0b498(0x300)+_0x4aaab2):console[_0xd0b498(0x260)](_0xd0b498(0x258));}else{const _0x375723=_0x2b7c65[_0xd0b498(0x335)],_0xb955d8=this['renderSessionsTimeline'](_0x1efbe0,_0x375723);_0x2b7c65['output']?await writeOutput(_0xb955d8,_0x2b7c65[_0xd0b498(0x2ad)],_0xd0b498(0x1b7)):console[_0xd0b498(0x260)](_0xb955d8);}!_0x4aaab2&&(console[_0xd0b498(0x2c8)](''),console[_0xd0b498(0x2c8)](a54_0xdf4b4c['dim']('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0xd0b498(0x2c8)](a54_0xdf4b4c[_0xd0b498(0x324)](_0xd0b498(0x243))+'or'+a54_0xdf4b4c['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x1efbe0['length']===0x0){if(_0x4aaab2&&_0x22503d)console[_0xd0b498(0x260)](_0xd0b498(0x2bc)+_0x4aaab2+'.'+_0x22503d);else _0x4aaab2?console[_0xd0b498(0x260)](_0xd0b498(0x300)+_0x4aaab2):console[_0xd0b498(0x260)](_0xd0b498(0x258));}else await this[_0xd0b498(0x327)](_0x1efbe0,_0x243755,_0x4aaab2);}}return 0x0;}['renderSessionsTimeline'](_0xbcd2a5,_0x2b5c07){const _0x1b8d6f=a54_0x47092e,_0x54857a=[],_0x155ae1=new Map();let _0x53ef1c=Infinity,_0x43e5ab=-Infinity;for(const _0x15affa of _0xbcd2a5){if(_0x15affa[_0x1b8d6f(0x268)]?.[_0x1b8d6f(0x30d)]){const _0x51d0a7=new Date(_0x15affa[_0x1b8d6f(0x268)]['createdAt'])[_0x1b8d6f(0x1f1)](),_0x5518de=_0x15affa[_0x1b8d6f(0x268)]['finishedAt']?new Date(_0x15affa['lastAttempt'][_0x1b8d6f(0x25d)])[_0x1b8d6f(0x1f1)]():Date[_0x1b8d6f(0x2d6)](),_0x3dc473=_0x15affa[_0x1b8d6f(0x1f5)]?.[_0x1b8d6f(0x2a0)]||_0x1b8d6f(0x326);!_0x155ae1[_0x1b8d6f(0x1b6)](_0x3dc473)&&_0x155ae1[_0x1b8d6f(0x1af)](_0x3dc473,[]),_0x155ae1[_0x1b8d6f(0x19c)](_0x3dc473)['push']({'session':_0x15affa,'startTime':_0x51d0a7,'endTime':_0x5518de,'duration':_0x5518de-_0x51d0a7}),_0x53ef1c=Math[_0x1b8d6f(0x2c5)](_0x53ef1c,_0x51d0a7),_0x43e5ab=Math[_0x1b8d6f(0x234)](_0x43e5ab,_0x5518de);}}if(_0x155ae1[_0x1b8d6f(0x20a)]===0x0)return _0x1b8d6f(0x19e);const _0x48bf56=process[_0x1b8d6f(0x2de)][_0x1b8d6f(0x193)]||0x78,_0x38bae6=0x1e,_0x338b5d=0x32,_0x58fd67=0x4,_0x424277=Math['min'](_0x338b5d,Math[_0x1b8d6f(0x234)](_0x38bae6,Math['floor'](_0x48bf56*0.3))),_0x472d4d=_0x48bf56-_0x424277-TIMELINE_CONFIG['GUTTER']-0x3-_0x58fd67,_0x2e69ab=_0x43e5ab-_0x53ef1c,_0x3d4118=_0x2e69ab/_0x424277,_0x20cdcf=renderTimeAxis({'startTime':_0x53ef1c,'endTime':_0x43e5ab,'durationMs':_0x2e69ab,'msPerChar':_0x3d4118},_0x424277),_0x62cc53=[];for(const _0x346178 of _0x155ae1[_0x1b8d6f(0x1f8)]()){_0x62cc53['push'](..._0x346178);}_0x62cc53[_0x1b8d6f(0x293)]((_0x1ed9a6,_0x212576)=>_0x212576['startTime']-_0x1ed9a6[_0x1b8d6f(0x1a3)]);const _0xc89a98=new Date(_0x53ef1c),_0x273b42=formatDate(_0xc89a98),_0xd743db=_0x58fd67+TIMELINE_CONFIG[_0x1b8d6f(0x329)]+TIMELINE_CONFIG[_0x1b8d6f(0x2a1)]+_0x472d4d,_0xfb2203='\x20'[_0x1b8d6f(0x208)](_0xd743db-_0x273b42[_0x1b8d6f(0x317)]),_0x4946ad=_0xfb2203+a54_0xdf4b4c[_0x1b8d6f(0x324)](_0x273b42)+'\x20'+_0x20cdcf;_0x54857a['push'](_0x4946ad);const _0xc81647=0x16;let _0x2d00ca=0x0;for(const _0x34f1a6 of _0x62cc53){const _0x30c7fb=_0x34f1a6[_0x1b8d6f(0x1c2)]['project']?.[_0x1b8d6f(0x2a0)]||'?',_0x1a551b=Math[_0x1b8d6f(0x2c5)](stringWidth(_0x30c7fb),_0xc81647);_0x2d00ca=Math[_0x1b8d6f(0x234)](_0x2d00ca,_0x1a551b);}for(const _0x3543e3 of _0x62cc53){const {session:_0xa4b23a,startTime:_0x3588dc,endTime:_0xd5b11c,duration:_0x160443}=_0x3543e3,_0x48ef9b=_0xa4b23a[_0x1b8d6f(0x1f5)]?.['id'],_0x34bf18=_0xa4b23a['id'],_0x54e47a=_0xa4b23a[_0x1b8d6f(0x1f5)]?.['name']||'?',_0x2b9782=_0xa4b23a[_0x1b8d6f(0x282)]?.[_0x1b8d6f(0x2a0)]||'?';let _0x516500,_0x138b70;if(_0xa4b23a['lastAttempt']){const _0x4c9fc4=_0xa4b23a[_0x1b8d6f(0x268)];!_0x4c9fc4['done']?(_0x516500=_0x4c9fc4[_0x1b8d6f(0x1ba)]?'🛑':'🔄',_0x138b70=_0x4c9fc4[_0x1b8d6f(0x1ba)]?a54_0xdf4b4c[_0x1b8d6f(0x2ce)]:a54_0xdf4b4c['blue']):(_0x516500=_0x4c9fc4[_0x1b8d6f(0x2a7)]?'✅':'❌',_0x138b70=_0x4c9fc4[_0x1b8d6f(0x2a7)]?a54_0xdf4b4c[_0x1b8d6f(0x1b2)]:a54_0xdf4b4c['red']);}else _0x516500='⏳',_0x138b70=a54_0xdf4b4c[_0x1b8d6f(0x324)];const _0x4d5f13='#'+_0x34bf18,_0x47c476=_0x48ef9b?hyperlink(_0x4d5f13,getWorkflowSessionUrl(_0x2b5c07,_0x48ef9b,_0x34bf18)):_0x4d5f13;let _0x5af377=_0x54e47a;stringWidth(_0x54e47a)>_0xc81647&&(_0x5af377=_0x54e47a[_0x1b8d6f(0x322)](0x0,_0xc81647-0x1)+'…');const _0x5a13ef=a54_0xdf4b4c['dim'](_0x5af377),_0x43feca=stringWidth(_0x5af377),_0x2048ee='\x20'[_0x1b8d6f(0x208)](_0x2d00ca-stringWidth(_0x5af377)+0x2),_0x21799a='('+formatElapsed(_0x160443)+')',_0x31db90=stringWidth(_0x21799a),_0x5e012f=stringWidth(_0x4d5f13),_0x2a7a3f=_0x5e012f+0x1+_0x43feca+_0x2048ee[_0x1b8d6f(0x317)],_0x1f2c6d=_0x472d4d-_0x2a7a3f-_0x31db90-0x1-0x8;let _0x22fbe0=_0x2b9782;stringWidth(_0x22fbe0)>_0x1f2c6d&&(_0x22fbe0=_0x22fbe0[_0x1b8d6f(0x322)](0x0,_0x1f2c6d-0x1)+'…');const _0x59999d=_0x47c476+'\x20'+_0x5a13ef+_0x2048ee+_0x22fbe0,_0x111bf5=stringWidth(_0x59999d),_0x434be5=_0x472d4d-_0x111bf5-_0x31db90,_0x57408e=_0x59999d+'\x20'['repeat'](Math['max'](0x1,_0x434be5))+a54_0xdf4b4c[_0x1b8d6f(0x324)](_0x21799a),_0x20013d=Math[_0x1b8d6f(0x27d)]((_0x3588dc-_0x53ef1c)/_0x3d4118),_0x44cdb1=Math['floor']((_0xd5b11c-_0x53ef1c)/_0x3d4118),_0x45cad4=Math[_0x1b8d6f(0x234)](_0x20013d+0x1,_0x44cdb1),_0x154646=new Array(_0x424277)[_0x1b8d6f(0x20c)]('\x20');for(let _0x14480f=_0x20013d;_0x14480f<Math[_0x1b8d6f(0x2c5)](_0x45cad4,_0x424277);_0x14480f++){_0x154646[_0x14480f]='─';}const _0x522642=_0x154646[_0x1b8d6f(0x242)](_0x328025=>_0x328025==='\x20'?'\x20':_0x138b70(_0x328025))[_0x1b8d6f(0x314)]('');_0x54857a[_0x1b8d6f(0x30a)](_0x516500+'\x20'+_0x57408e+'│'+_0x522642+'│');}return _0x54857a['join']('\x0a');}async[a54_0x47092e(0x327)](_0x8f938f,_0x57f704,_0x3a96af){const _0x325eb5=a54_0x47092e,{options:_0x4e3d4f,tdx:_0xcb2e5c}=_0x57f704,_0x3e4c54=_0x4e3d4f[_0x325eb5(0x335)],{timelineRows:_0x182411,timeAxisHeader:_0x41d346}=this['generateSessionTimelineRows'](_0x8f938f,_0x3e4c54),_0xe3075c=_0x182411['filter'](_0x523de3=>_0x523de3[_0x325eb5(0x1e1)]);if(_0xe3075c[_0x325eb5(0x317)]===0x0){const _0x45c66d=this[_0x325eb5(0x2e4)](_0x8f938f,_0x3e4c54);console['log'](_0x45c66d);!_0x3a96af&&(console[_0x325eb5(0x2c8)](''),console[_0x325eb5(0x2c8)](a54_0xdf4b4c['dim'](_0x325eb5(0x321))),console[_0x325eb5(0x2c8)](a54_0xdf4b4c[_0x325eb5(0x324)](_0x325eb5(0x243))+'or'+a54_0xdf4b4c[_0x325eb5(0x324)]('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0x41d346&&console['log'](_0x41d346);const _0xbfa2f3=_0x182411[_0x325eb5(0x2d8)](_0x39d853=>_0x39d853['attemptId'])['map'](_0x8821cf=>({'title':_0x8821cf[_0x325eb5(0x2f7)],'value':_0x8821cf[_0x325eb5(0x1e1)]})),_0x4995cf=process[_0x325eb5(0x2de)][_0x325eb5(0x330)]||0x3c,_0x329d00=Math[_0x325eb5(0x234)](0x28,Math[_0x325eb5(0x27d)](_0x4995cf*0x2/0x3)),_0x2d8b9d=await a54_0x5c5794({'type':_0x325eb5(0x28b),'name':_0x325eb5(0x1e1),'message':_0x325eb5(0x2e8),'choices':_0xbfa2f3,'initial':-0x1,'limit':_0x329d00,'clearFirst':!![],'fallback':{'title':_0x325eb5(0x2b7),'value':null},'suggest':(_0x1e25b4,_0x203a88)=>{const _0x57c843=_0x325eb5;if(!_0x1e25b4)return Promise['resolve'](_0x203a88);const _0x579de4=_0x203a88['filter'](_0x417697=>{const _0x60cdd0=a54_0x5152,_0xc42cc8=_0x417697;return _0xc42cc8[_0x60cdd0(0x19d)][_0x60cdd0(0x250)]()['includes'](_0x1e25b4[_0x60cdd0(0x250)]());});return Promise[_0x57c843(0x22b)](_0x579de4);}}),_0x46fe53=()=>{const _0x365c3b=_0x325eb5;process[_0x365c3b(0x2de)][_0x365c3b(0x1e2)]('\x1b[1A\x1b[2K'),process[_0x365c3b(0x2de)]['write'](_0x365c3b(0x255)),process[_0x365c3b(0x2de)][_0x365c3b(0x1e2)](_0x365c3b(0x255));},_0x50b565=_0x2d8b9d&&_0x2d8b9d[_0x325eb5(0x1e1)]&&_0x2d8b9d[_0x325eb5(0x1e1)]!==null&&_0x2d8b9d[_0x325eb5(0x1e1)][_0x325eb5(0x2ef)]()!=='';if(!_0x50b565){_0x46fe53(),console[_0x325eb5(0x260)](a54_0xdf4b4c['dim']('Cancelled'));return;}_0x46fe53();const _0x1b7770=_0x8f938f[_0x325eb5(0x2e5)](_0x41771f=>_0x41771f['lastAttempt']?.['id']===_0x2d8b9d[_0x325eb5(0x1e1)]);if(_0x1b7770){const _0x49fbca=_0x1b7770[_0x325eb5(0x1f5)]?.[_0x325eb5(0x2a0)]||'?',_0x360207=_0x1b7770[_0x325eb5(0x282)]?.[_0x325eb5(0x2a0)]||'?';console[_0x325eb5(0x260)](_0x325eb5(0x20d)+a54_0xdf4b4c[_0x325eb5(0x324)](_0x49fbca)+',\x20Workflow:\x20'+a54_0xdf4b4c[_0x325eb5(0x324)](_0x360207));}const _0x4d1a0f=new WorkflowTimelineCommand();await _0x4d1a0f['execute']({'args':[],'options':{..._0x4e3d4f,'attemptId':_0x2d8b9d[_0x325eb5(0x1e1)]},'tdx':_0xcb2e5c});}[a54_0x47092e(0x286)](_0x13b35a,_0x11753f){const _0x2dc2e0=a54_0x47092e,_0x40189a=new Map();for(const _0x59d5c9 of _0x13b35a){_0x59d5c9['id']&&_0x59d5c9['lastAttempt']?.['id']&&_0x40189a['set'](_0x59d5c9['id'],_0x59d5c9[_0x2dc2e0(0x268)]['id']);}const _0x94f9ba=[];let _0x54fab5='';const _0x372028=this['renderSessionsTimeline'](_0x13b35a,_0x11753f),_0x2f7001=_0x372028[_0x2dc2e0(0x306)]('\x0a');for(const _0x589789 of _0x2f7001){if(_0x589789[_0x2dc2e0(0x18f)](_0x2dc2e0(0x1c4))||_0x589789[_0x2dc2e0(0x200)](/^\s+\d{4}-\d{2}-\d{2}/))_0x54fab5=_0x589789;else{if(_0x589789[_0x2dc2e0(0x200)](/^[✅❌🔄🛑⏳]/)){const _0x4713a6=_0x589789['match'](/#(\d+)/),_0x75f777=_0x4713a6?_0x4713a6[0x1]:null,_0x50040a=_0x75f777?_0x40189a[_0x2dc2e0(0x19c)](_0x75f777)||null:null,_0x430c70=_0x13b35a[_0x2dc2e0(0x2e5)](_0x292100=>_0x292100['id']===_0x75f777),_0x414c08=_0x430c70?.[_0x2dc2e0(0x1f5)]?.[_0x2dc2e0(0x2a0)]||'';_0x94f9ba[_0x2dc2e0(0x30a)]({'displayLine':_0x589789,'attemptId':_0x50040a,'projectName':_0x414c08});}}}return{'timelineRows':_0x94f9ba,'timeAxisHeader':_0x54fab5};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x2c6);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x22e);async['execute'](_0x58d188){const _0x1b542b=a54_0x47092e,{options:_0x28f20a,args:_0x11d8ed,tdx:_0x13c90b}=_0x58d188,_0x257485=this[_0x1b542b(0x257)](_0x11d8ed,_0x28f20a);if(!_0x257485)return 0x1;const {projectName:_0x37fac5,workflowName:_0x37bc6f}=_0x257485,_0x1e7be2=_0x28f20a[_0x1b542b(0x2e2)];if(_0x28f20a[_0x1b542b(0x303)]){if(_0x37fac5&&_0x37bc6f)console[_0x1b542b(0x2c8)]('Filter:\x20'+_0x37fac5+'.'+_0x37bc6f);else _0x37fac5&&console[_0x1b542b(0x2c8)](_0x1b542b(0x20b)+_0x37fac5);_0x1e7be2&&console['error'](_0x1b542b(0x259));}const _0x5932e9=await withSpinner(_0x1b542b(0x233),()=>_0x13c90b[_0x1b542b(0x282)][_0x1b542b(0x185)]({'projectName':_0x37fac5,'workflowName':_0x37bc6f,'includeRetried':_0x1e7be2,'limit':_0x28f20a[_0x1b542b(0x291)]}),{'verbose':_0x28f20a[_0x1b542b(0x303)]}),_0x529932=_0x5932e9['data'],_0x231265=_0x28f20a[_0x1b542b(0x291)]||0x64,_0x40a608=_0x529932[_0x1b542b(0x317)]>=_0x231265?a54_0xdf4b4c[_0x1b542b(0x324)](_0x1b542b(0x1bc)):'';console[_0x1b542b(0x2c8)](_0x1b542b(0x232)+_0x529932['length']+_0x1b542b(0x1d0)+(_0x529932[_0x1b542b(0x317)]!==0x1?'s':'')+_0x40a608);if(_0x28f20a[_0x1b542b(0x1d1)]===_0x1b542b(0x2c3)||_0x28f20a[_0x1b542b(0x1d1)]==='jsonl'||_0x28f20a[_0x1b542b(0x1d1)]==='table')await handleSDKOutput(_0x529932,_0x28f20a);else{if(_0x529932[_0x1b542b(0x317)]===0x0){if(_0x37fac5&&_0x37bc6f)console[_0x1b542b(0x260)]('No\x20attempts\x20found\x20for:\x20'+_0x37fac5+'.'+_0x37bc6f);else _0x37fac5?console['log'](_0x1b542b(0x2b9)+_0x37fac5):console[_0x1b542b(0x260)](_0x1b542b(0x246));}else{const _0x3edf02=_0x28f20a[_0x1b542b(0x335)],_0xc362b2=_0x529932[_0x1b542b(0x242)](_0x3d3da9=>{const _0x8f0e9a=_0x1b542b,_0x532310=a54_0xdf4b4c[_0x8f0e9a(0x324)]('#'+_0x3d3da9['id']),_0xf94931=_0x3d3da9[_0x8f0e9a(0x1f5)]?.['id'],_0x16552e=_0x3d3da9[_0x8f0e9a(0x1dd)]||_0x3d3da9[_0x8f0e9a(0x33d)],_0x53e472=_0xf94931&&_0x16552e?hyperlink(_0x532310,getWorkflowAttemptUrl(_0x3edf02,_0xf94931,_0x16552e,_0x3d3da9['id'])):_0x532310,{icon:_0x22b7cf,text:_0x31f147}=getAttemptStatusDisplay(_0x3d3da9),_0x2c450f=(_0x3d3da9[_0x8f0e9a(0x1f5)]?.[_0x8f0e9a(0x2a0)]||'?')+'.'+(_0x3d3da9[_0x8f0e9a(0x282)]?.[_0x8f0e9a(0x2a0)]||'?'),_0x3b13d3=_0x3d3da9['sessionTime']?a54_0xdf4b4c[_0x8f0e9a(0x324)](_0x3d3da9[_0x8f0e9a(0x323)]):'';return(_0x53e472+'\x20'+_0x22b7cf+(_0x31f147?'\x20'+_0x31f147:'')+'\x20'+_0x2c450f+'\x20'+_0x3b13d3)['trimEnd']();});await writeOutput(_0xc362b2['join']('\x0a'),_0x28f20a[_0x1b542b(0x2ad)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x21d);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x251);async[a54_0x47092e(0x28e)](_0x5c6ae1){const _0x24e7b0=a54_0x47092e,{options:_0x31e432,args:_0x2a7a03,tdx:_0xcf182}=_0x5c6ae1,_0x6a15e0=_0x2a7a03[0x0];if(!_0x6a15e0)return console['error'](_0x24e7b0(0x1a2)),0x1;_0x31e432['verbose']&&console['error'](_0x24e7b0(0x186)+_0x6a15e0);const _0x3c03a8=await withSpinner('Getting\x20attempt\x20details...',()=>_0xcf182['workflow']['attempt'](_0x6a15e0),{'verbose':_0x31e432['verbose']}),_0x18c83f=_0x3c03a8[_0x24e7b0(0x2e3)];let _0x842911;!_0x18c83f[_0x24e7b0(0x28f)]?_0x842911=_0x18c83f[_0x24e7b0(0x1ba)]?'canceling':'running':_0x842911=_0x18c83f[_0x24e7b0(0x2a7)]?_0x24e7b0(0x2a7):'error';let _0x57dd1a;if(_0x18c83f[_0x24e7b0(0x30d)]&&_0x18c83f[_0x24e7b0(0x25d)]){const _0x4865a7=new Date(_0x18c83f[_0x24e7b0(0x30d)])[_0x24e7b0(0x1f1)](),_0x44ca52=new Date(_0x18c83f[_0x24e7b0(0x25d)])[_0x24e7b0(0x1f1)]();_0x57dd1a=Math[_0x24e7b0(0x236)]((_0x44ca52-_0x4865a7)/0x3e8);}const _0x50bb2e={'attempt_id':_0x18c83f['id'],'status':_0x842911,..._0x18c83f[_0x24e7b0(0x2d5)]!==undefined&&{'index':_0x18c83f[_0x24e7b0(0x2d5)]},..._0x18c83f[_0x24e7b0(0x1f5)]&&{'project':_0x18c83f['project'][_0x24e7b0(0x2a0)]},..._0x18c83f[_0x24e7b0(0x282)]&&{'workflow':_0x18c83f[_0x24e7b0(0x282)][_0x24e7b0(0x2a0)]},..._0x18c83f['sessionId']&&{'session_id':_0x18c83f[_0x24e7b0(0x33d)]},..._0x18c83f[_0x24e7b0(0x323)]&&{'session_time':_0x18c83f[_0x24e7b0(0x323)]},..._0x18c83f[_0x24e7b0(0x1b8)]&&{'retry_attempt':_0x18c83f[_0x24e7b0(0x1b8)]},..._0x57dd1a!==undefined&&{'duration_sec':_0x57dd1a},..._0x18c83f[_0x24e7b0(0x30d)]&&{'created_at':_0x18c83f[_0x24e7b0(0x30d)]},..._0x18c83f[_0x24e7b0(0x25d)]&&{'finished_at':_0x18c83f[_0x24e7b0(0x25d)]},...Object[_0x24e7b0(0x1b3)](_0x18c83f[_0x24e7b0(0x2d4)])[_0x24e7b0(0x317)]>0x0&&{'params':_0x18c83f['params']}};return await handleSingleObjectOutput(_0x50bb2e,_0x31e432),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x47092e(0x2a0)]='workflow:tasks';['description']=a54_0x47092e(0x2eb);async[a54_0x47092e(0x28e)](_0x1b80c1){const _0x51407e=a54_0x47092e,{options:_0x48ec44,args:_0x2fea61,tdx:_0x461314}=_0x1b80c1,_0x1df832=_0x2fea61[0x0];if(!_0x1df832)return console[_0x51407e(0x2c8)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0xb64a14=_0x48ec44[_0x51407e(0x19b)];_0x48ec44[_0x51407e(0x303)]&&(console[_0x51407e(0x2c8)](_0x51407e(0x186)+_0x1df832),_0xb64a14&&console[_0x51407e(0x2c8)]('Including\x20subtasks:\x20yes'));const _0x27d374=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x461314[_0x51407e(0x282)][_0x51407e(0x1bf)](_0x1df832,_0xb64a14||![]),{'verbose':_0x48ec44[_0x51407e(0x303)]}),_0x47b20c=_0x27d374[_0x51407e(0x2e3)];return console['error']('✔\x20Found\x20'+_0x47b20c[_0x51407e(0x317)]+'\x20task'+(_0x47b20c[_0x51407e(0x317)]!==0x1?'s':'')),await handleSDKOutput(_0x47b20c,_0x48ec44),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x253);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x1a6);async[a54_0x47092e(0x28e)](_0x3c55fd){const _0x4b5b4d=a54_0x47092e,{options:_0x4863bf,args:_0x1feaec,tdx:_0x217b99}=_0x3c55fd,_0x22e069=_0x1feaec[0x0];let _0x41685c=_0x1feaec[0x1];if(!_0x22e069)return console[_0x4b5b4d(0x2c8)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x4863bf[_0x4b5b4d(0x303)]&&(console[_0x4b5b4d(0x2c8)](_0x4b5b4d(0x186)+_0x22e069),_0x41685c&&console[_0x4b5b4d(0x2c8)](_0x4b5b4d(0x1fe)+_0x41685c));const _0x35f05e=await withSpinner(_0x4b5b4d(0x339),()=>_0x217b99[_0x4b5b4d(0x282)]['logFiles'](_0x22e069,_0x41685c),{'verbose':_0x4863bf[_0x4b5b4d(0x303)]}),_0x13a69a=_0x35f05e[_0x4b5b4d(0x2e3)];if(_0x13a69a[_0x4b5b4d(0x317)]===0x0)return console[_0x4b5b4d(0x2c8)](_0x4b5b4d(0x2b6)),0x0;if(!_0x41685c&&(_0x4863bf['json']||_0x4863bf['format']))return await handleSDKOutput(_0x13a69a,_0x4863bf),0x0;if(!_0x41685c){const _0x127fc3=_0x13a69a[_0x4b5b4d(0x242)](_0xebaeb1=>({'title':_0xebaeb1[_0x4b5b4d(0x309)]+'\x20('+formatBytes(_0xebaeb1[_0x4b5b4d(0x31b)])+')','value':_0xebaeb1[_0x4b5b4d(0x309)]})),_0xf63258=await a54_0x5c5794({'type':_0x4b5b4d(0x247),'name':_0x4b5b4d(0x1ea),'message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x127fc3});if(!_0xf63258[_0x4b5b4d(0x1ea)])return console[_0x4b5b4d(0x2c8)](_0x4b5b4d(0x315)),0x0;_0x41685c=_0xf63258[_0x4b5b4d(0x1ea)];}const _0x296684=await withSpinner(_0x4b5b4d(0x273),()=>_0x217b99[_0x4b5b4d(0x282)][_0x4b5b4d(0x1df)](_0x22e069,_0x41685c),{'verbose':_0x4863bf[_0x4b5b4d(0x303)]}),_0x22c24c=_0x296684[_0x4b5b4d(0x2e3)];return _0x22c24c?console[_0x4b5b4d(0x260)](_0x22c24c):console[_0x4b5b4d(0x2c8)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x21c);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x2c4);async[a54_0x47092e(0x28e)](_0x442aad){const _0x2b0d94=a54_0x47092e,{options:_0x320496,args:_0x588186,tdx:_0x4bf57a}=_0x442aad,_0x3ee914=_0x588186[0x0];if(!_0x3ee914)return console[_0x2b0d94(0x2c8)](_0x2b0d94(0x1a2)),0x1;const _0x19aedb=_0x320496[_0x2b0d94(0x27f)];_0x320496['verbose']&&(console[_0x2b0d94(0x2c8)](_0x2b0d94(0x186)+_0x3ee914),_0x19aedb&&console[_0x2b0d94(0x2c8)](_0x2b0d94(0x2b3)+_0x19aedb));if(!_0x320496['yes']){if(!isInteractive())return console[_0x2b0d94(0x2c8)](a54_0xdf4b4c['red'](_0x2b0d94(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2b0d94(0x2c8)](a54_0xdf4b4c[_0x2b0d94(0x324)](_0x2b0d94(0x29f))),0x1;const _0x476a1b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x3ee914+'?');if(!_0x476a1b)return console[_0x2b0d94(0x2c8)](a54_0xdf4b4c[_0x2b0d94(0x2ce)](_0x2b0d94(0x315))),0x1;}const _0x4b143e=await withSpinner(_0x2b0d94(0x1bb),()=>_0x4bf57a[_0x2b0d94(0x282)][_0x2b0d94(0x2a6)](_0x3ee914,_0x19aedb),{'verbose':_0x320496[_0x2b0d94(0x303)]}),_0x175853=_0x4b143e['data'];return console['error']('✔\x20'+_0x175853),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x2bb);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x1da);async[a54_0x47092e(0x28e)](_0x338596){const _0x57edfc=a54_0x47092e,{options:_0x575186,args:_0xc6852c,tdx:_0x3303d1}=_0x338596,_0x3b622d=_0xc6852c[0x0];if(!_0x3b622d)return console[_0x57edfc(0x2c8)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console['error'](_0x57edfc(0x2da)),0x1;let _0x36ea69=![],_0x136824=_0x3b622d;if(_0x3b622d[_0x57edfc(0x18f)](_0x57edfc(0x333)))_0x36ea69=!![],_0x136824=_0x3b622d['substring'](0x8);else{if(_0x3b622d[_0x57edfc(0x18f)](_0x57edfc(0x2ca)))_0x36ea69=![],_0x136824=_0x3b622d[_0x57edfc(0x274)](0x8);else return console['error'](_0x57edfc(0x1cc)),console['error'](_0x57edfc(0x2da)),0x1;}const _0x5e18ae=_0x575186[_0x57edfc(0x301)],_0x34e50e=_0x575186[_0x57edfc(0x2e6)],_0x3e5e46=_0x575186[_0x57edfc(0x2d4)],_0x4cfd10=_0x575186[_0x57edfc(0x262)];_0x575186[_0x57edfc(0x303)]&&(console[_0x57edfc(0x2c8)](_0x57edfc(0x2f6)+(_0x36ea69?_0x57edfc(0x1c2):_0x57edfc(0x225))+'\x20'+_0x136824),_0x5e18ae&&console[_0x57edfc(0x2c8)](_0x57edfc(0x2d0)+_0x5e18ae),_0x34e50e&&console['error'](_0x57edfc(0x248)+_0x34e50e),_0x3e5e46&&console[_0x57edfc(0x2c8)]('Params:\x20'+_0x3e5e46),_0x4cfd10&&console['error'](_0x57edfc(0x2b1)));let _0x1be545;if(_0x3e5e46)try{if(_0x3e5e46[_0x57edfc(0x18f)]('@')){const _0x55af75=await import(_0x57edfc(0x279)),_0x4b1055=_0x3e5e46[_0x57edfc(0x274)](0x1),_0xa36631=await _0x55af75['readFile'](_0x4b1055,_0x57edfc(0x238));_0x1be545=JSON['parse'](_0xa36631);}else _0x1be545=JSON[_0x57edfc(0x2fa)](_0x3e5e46);}catch{return console[_0x57edfc(0x2c8)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x575186['yes']){if(!isInteractive())return console[_0x57edfc(0x2c8)](a54_0xdf4b4c[_0x57edfc(0x30c)](_0x57edfc(0x25c)),_0x57edfc(0x2aa)),console[_0x57edfc(0x2c8)](a54_0xdf4b4c['dim'](_0x57edfc(0x29f))),0x1;const _0x318c72=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x36ea69?_0x57edfc(0x1c2):_0x57edfc(0x225))+'\x20'+_0x136824+'?');if(!_0x318c72)return console[_0x57edfc(0x2c8)](a54_0xdf4b4c[_0x57edfc(0x2ce)](_0x57edfc(0x315))),0x1;}let _0x4889f7;_0x36ea69?_0x4889f7=await withSpinner(_0x57edfc(0x1a5),()=>_0x3303d1[_0x57edfc(0x282)][_0x57edfc(0x25b)](_0x136824,{'fromTask':_0x5e18ae,'retryParams':_0x1be545}),{'verbose':_0x575186[_0x57edfc(0x303)]}):_0x4889f7=await withSpinner('Retrying\x20attempt...',()=>_0x3303d1[_0x57edfc(0x282)][_0x57edfc(0x308)](_0x136824,{'resumeFrom':_0x34e50e,'retryParams':_0x1be545,'force':_0x4cfd10}),{'verbose':_0x575186['verbose']});const _0x298c9a=_0x4889f7[_0x57edfc(0x2e3)];return console[_0x57edfc(0x2c8)](_0x57edfc(0x296)),console['error'](_0x57edfc(0x32e)+_0x298c9a[_0x57edfc(0x1e1)]),console[_0x57edfc(0x2c8)](_0x57edfc(0x1ab)+_0x298c9a[_0x57edfc(0x33d)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x197);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x1b9);async[a54_0x47092e(0x28e)](_0x29d6eb){const _0x1cc078=a54_0x47092e,{options:_0x43b520,args:_0x255391,tdx:_0x1e8a5b}=_0x29d6eb;let _0x3ebad5=_0x255391[0x0];if(!_0x3ebad5){const _0x336555=this[_0x1cc078(0x298)]([],_0x43b520),_0x4b0343=await withSpinner(_0x1cc078(0x275),()=>_0x1e8a5b[_0x1cc078(0x282)][_0x1cc078(0x32b)](_0x336555,{'limit':_0x43b520[_0x1cc078(0x291)]}),{'verbose':_0x43b520['verbose']}),_0x517623=_0x4b0343[_0x1cc078(0x2e3)];if(_0x517623[_0x1cc078(0x317)]===0x0)return console[_0x1cc078(0x2c8)](_0x1cc078(0x33b)),!_0x336555&&console[_0x1cc078(0x2c8)](a54_0xdf4b4c[_0x1cc078(0x324)](_0x1cc078(0x31d))),0x1;const _0x1cdcc6=_0x517623[_0x1cc078(0x242)](_0x2397ff=>({'title':_0x2397ff[_0x1cc078(0x1f5)]?.[_0x1cc078(0x2a0)]+'.'+_0x2397ff['name'],'value':_0x2397ff[_0x1cc078(0x1f5)]?.['name']+'.'+_0x2397ff[_0x1cc078(0x2a0)],'description':_0x2397ff[_0x1cc078(0x1cd)]?_0x1cc078(0x229)+_0x2397ff[_0x1cc078(0x1cd)]:undefined})),_0x53ac07=await a54_0x5c5794({'type':_0x1cc078(0x247),'name':_0x1cc078(0x282),'message':_0x1cc078(0x313),'choices':_0x1cdcc6});if(!_0x53ac07[_0x1cc078(0x282)])return 0x1;_0x3ebad5=_0x53ac07[_0x1cc078(0x282)];}if(!_0x3ebad5[_0x1cc078(0x1a9)]('.')){const _0x466924=this[_0x1cc078(0x298)]([],_0x43b520);if(_0x466924)_0x3ebad5=_0x466924+'.'+_0x3ebad5;else return console['error'](a54_0xdf4b4c[_0x1cc078(0x30c)](_0x1cc078(0x199)),_0x1cc078(0x213)),console['error'](a54_0xdf4b4c[_0x1cc078(0x324)](_0x1cc078(0x31d))),0x1;}const _0x54a054=_0x43b520['param'],_0x21de4c=_0x43b520['sessionTime'],_0x206c30={};if(_0x54a054&&Array[_0x1cc078(0x223)](_0x54a054))for(const _0x3cac2f of _0x54a054){const _0x551f15=_0x3cac2f['indexOf']('=');if(_0x551f15===-0x1)return console[_0x1cc078(0x2c8)]('Error:\x20Invalid\x20parameter\x20format:\x20'+_0x3cac2f),console[_0x1cc078(0x2c8)](_0x1cc078(0x23c)),0x1;const _0x5a6d77=_0x3cac2f[_0x1cc078(0x274)](0x0,_0x551f15),_0x57bf89=_0x3cac2f[_0x1cc078(0x274)](_0x551f15+0x1);try{_0x206c30[_0x5a6d77]=JSON[_0x1cc078(0x2fa)](_0x57bf89);}catch{_0x206c30[_0x5a6d77]=_0x57bf89;}}_0x43b520[_0x1cc078(0x303)]&&(console['error'](_0x1cc078(0x188)+_0x3ebad5),Object['keys'](_0x206c30)['length']>0x0&&console[_0x1cc078(0x2c8)]('Parameters:\x20'+JSON[_0x1cc078(0x2ab)](_0x206c30)),_0x21de4c&&console[_0x1cc078(0x2c8)](_0x1cc078(0x2d9)+_0x21de4c));const _0x238471=await withSpinner(_0x1cc078(0x2f0),()=>_0x1e8a5b[_0x1cc078(0x282)]['run'](_0x3ebad5,_0x206c30,{'sessionTime':_0x21de4c}),{'verbose':_0x43b520[_0x1cc078(0x303)]}),_0x5aa153=_0x238471['data'];console[_0x1cc078(0x2c8)]('✔\x20Workflow\x20run\x20started'),console[_0x1cc078(0x2c8)](_0x1cc078(0x307)+_0x5aa153['id']),console[_0x1cc078(0x2c8)]('\x20\x20Session\x20ID:\x20'+_0x5aa153['sessionId']),console[_0x1cc078(0x2c8)](_0x1cc078(0x2dc)+_0x5aa153[_0x1cc078(0x1f5)]?.['name']),console[_0x1cc078(0x2c8)](_0x1cc078(0x1a1)+_0x5aa153[_0x1cc078(0x282)]?.[_0x1cc078(0x2a0)]);if(_0x5aa153[_0x1cc078(0x1f5)]?.['id']&&_0x5aa153['sessionId']&&_0x5aa153['id']){const _0x9911d=_0x43b520['site'],_0x13c1b0=getConsoleUrl(_0x9911d,'/app/workflows/'+_0x5aa153[_0x1cc078(0x1f5)]['id']+_0x1cc078(0x2e0)+_0x5aa153['sessionId']+_0x1cc078(0x29d)+_0x5aa153['id']);console[_0x1cc078(0x2c8)](_0x1cc078(0x194)+a54_0xdf4b4c[_0x1cc078(0x336)](_0x13c1b0));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x47092e(0x1a7);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x2ed);async[a54_0x47092e(0x28e)](_0x3d287b){const _0x3d7fd8=a54_0x47092e,{options:_0x359ad1,args:_0x14608d,tdx:_0x54d325}=_0x3d287b,_0x3a657d=_0x14608d[0x0],_0x141ccb=_0x14608d[0x1]||'.';if(!_0x3a657d)return console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x28d)),console[_0x3d7fd8(0x2c8)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x21c64c=_0x359ad1['revision'];_0x359ad1[_0x3d7fd8(0x303)]&&(console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x20d)+_0x3a657d),console[_0x3d7fd8(0x2c8)]('Output\x20directory:\x20'+_0x141ccb),_0x21c64c&&console['error'](_0x3d7fd8(0x1bd)+_0x21c64c));const _0x16ec6f=await withSpinner(_0x3d7fd8(0x2bf)+_0x3a657d+_0x3d7fd8(0x1b0),()=>_0x54d325[_0x3d7fd8(0x282)]['download'](_0x3a657d,_0x141ccb,{'revision':_0x21c64c}),{'verbose':_0x359ad1['verbose']}),_0x55e0d8=_0x16ec6f[_0x3d7fd8(0x2e3)];return console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x1d7)+_0x55e0d8['projectName']),console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x26a)+_0x55e0d8[_0x3d7fd8(0x1cd)]),console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x2f8)+_0x55e0d8[_0x3d7fd8(0x202)]),console[_0x3d7fd8(0x2c8)](_0x3d7fd8(0x1cf)+_0x141ccb+'/'+_0x55e0d8['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x2db);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x2ba);async[a54_0x47092e(0x28e)](_0x404e7b){const _0x505c1b=a54_0x47092e,{options:_0x36b777,args:_0x19091f,tdx:_0x2d1bad}=_0x404e7b;let _0xcc2e3e='.',_0x3f647a=_0x36b777[_0x505c1b(0x2a0)];if(_0x19091f[0x0]){const {promises:_0x22ff7c}=await import('fs');try{const _0x5128e9=await _0x22ff7c[_0x505c1b(0x184)](_0x19091f[0x0]);if(_0x5128e9[_0x505c1b(0x1ad)]())_0xcc2e3e=_0x19091f[0x0];else return console[_0x505c1b(0x2c8)](_0x505c1b(0x23d)+_0x19091f[0x0]+_0x505c1b(0x18d)),0x1;}catch{_0x3f647a=_0x19091f[0x0],_0xcc2e3e='.';}}const _0x3b0338=_0x36b777['revision'],_0x5b5972=_0x36b777[_0x505c1b(0x26b)];_0x36b777['verbose']&&(console[_0x505c1b(0x2c8)](_0x505c1b(0x1be)+_0xcc2e3e),_0x3f647a&&console[_0x505c1b(0x2c8)](_0x505c1b(0x318)+_0x3f647a),_0x3b0338&&console[_0x505c1b(0x2c8)](_0x505c1b(0x1bd)+_0x3b0338),_0x5b5972&&console[_0x505c1b(0x2c8)](_0x505c1b(0x263)));const _0x23c6a9=await withSpinner(_0x505c1b(0x23e),()=>_0x2d1bad['workflow'][_0x505c1b(0x30a)](_0xcc2e3e,{'projectName':_0x3f647a,'revision':_0x3b0338,'skipValidation':_0x5b5972}),{'verbose':_0x36b777[_0x505c1b(0x303)]}),_0x45f51e=_0x23c6a9[_0x505c1b(0x2e3)];return console['error'](_0x505c1b(0x18c)+_0x45f51e['projectName']),console[_0x505c1b(0x2c8)]('\x20\x20Project\x20ID:\x20'+_0x45f51e[_0x505c1b(0x2c7)]),console[_0x505c1b(0x2c8)](_0x505c1b(0x26a)+_0x45f51e[_0x505c1b(0x1cd)]),await this['showWorkflowConsoleUrl'](_0x2d1bad,_0x45f51e[_0x505c1b(0x205)],_0x36b777[_0x505c1b(0x335)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x47092e(0x2a0)]='workflow:pull';[a54_0x47092e(0x1c5)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x47092e(0x28e)](_0x2167c0){const _0x5f4fd0=a54_0x47092e,{options:_0x8e2571,args:_0x5ac58f,tdx:_0x2caa89}=_0x2167c0,_0x438294=_0x5ac58f[0x0],_0x5588a6=_0x5ac58f[0x1];if(!_0x438294)return console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c[_0x5f4fd0(0x30c)](_0x5f4fd0(0x199)),_0x5f4fd0(0x2d7)),console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c[_0x5f4fd0(0x324)](_0x5f4fd0(0x2fe))),0x1;const _0x3c4b6a=_0x8e2571['revision'];_0x8e2571[_0x5f4fd0(0x303)]&&(console[_0x5f4fd0(0x2c8)](_0x5f4fd0(0x20d)+_0x438294),_0x5588a6&&console[_0x5f4fd0(0x2c8)]('Target\x20directory:\x20'+_0x5588a6),_0x3c4b6a&&console[_0x5f4fd0(0x2c8)](_0x5f4fd0(0x1bd)+_0x3c4b6a),_0x8e2571[_0x5f4fd0(0x27b)]&&console['error'](_0x5f4fd0(0x218)));const _0x1726b9=await withSpinner(_0x5f4fd0(0x2c0)+_0x438294+_0x5f4fd0(0x1b0),()=>_0x2caa89[_0x5f4fd0(0x282)][_0x5f4fd0(0x26c)](_0x438294,{'targetDir':_0x5588a6,'revision':_0x3c4b6a}),{'verbose':_0x8e2571[_0x5f4fd0(0x303)]}),_0x22b7cb=_0x1726b9[_0x5f4fd0(0x2e3)];_0x22b7cb[_0x5f4fd0(0x2c2)]?console[_0x5f4fd0(0x2c8)](_0x5f4fd0(0x26d)+_0x22b7cb[_0x5f4fd0(0x205)]):console[_0x5f4fd0(0x2c8)]('→\x20Project:\x20'+_0x22b7cb[_0x5f4fd0(0x205)]);console[_0x5f4fd0(0x2c8)]('\x20\x20Revision:\x20'+_0x22b7cb[_0x5f4fd0(0x1cd)]),console[_0x5f4fd0(0x2c8)](_0x5f4fd0(0x219)+(a54_0x4287ed['relative'](process['cwd'](),_0x22b7cb[_0x5f4fd0(0x2b5)])||'.')),console[_0x5f4fd0(0x2c8)]('\x20\x20Changes:\x20'+a54_0xdf4b4c[_0x5f4fd0(0x1b2)]('+'+_0x22b7cb['summary']['new']+'\x20new')+',\x20'+(a54_0xdf4b4c['yellow']('~'+_0x22b7cb[_0x5f4fd0(0x1a0)]['modified']+_0x5f4fd0(0x2c1))+',\x20')+(a54_0xdf4b4c[_0x5f4fd0(0x30c)]('-'+_0x22b7cb['summary']['deleted']+_0x5f4fd0(0x2a8))+',\x20')+(''+a54_0xdf4b4c[_0x5f4fd0(0x324)](_0x22b7cb[_0x5f4fd0(0x1a0)][_0x5f4fd0(0x196)]+_0x5f4fd0(0x252))));for(const _0x4529f2 of _0x22b7cb[_0x5f4fd0(0x230)]){_0x4529f2['type']===_0x5f4fd0(0x2ac)&&_0x4529f2[_0x5f4fd0(0x1b5)]&&(console['error']('\x0a'+a54_0xdf4b4c[_0x5f4fd0(0x336)]('---\x20'+_0x4529f2[_0x5f4fd0(0x1f7)])),console[_0x5f4fd0(0x2c8)](_0x4529f2[_0x5f4fd0(0x1b5)]));}if(!_0x22b7cb[_0x5f4fd0(0x1f6)])return saveSessionContext({'workflow_project':_0x22b7cb['projectName']},_0x8e2571[_0x5f4fd0(0x1c2)]),console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c['green'](_0x5f4fd0(0x264))),console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c[_0x5f4fd0(0x324)](_0x5f4fd0(0x1ec)+_0x22b7cb[_0x5f4fd0(0x205)])),0x0;if(_0x8e2571[_0x5f4fd0(0x27b)])return console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c[_0x5f4fd0(0x2ce)](_0x5f4fd0(0x21f))),0x0;if(!_0x8e2571[_0x5f4fd0(0x211)]){if(!isInteractive())return console['error'](a54_0xdf4b4c[_0x5f4fd0(0x30c)](_0x5f4fd0(0x25c)),_0x5f4fd0(0x2aa)),console['error'](a54_0xdf4b4c[_0x5f4fd0(0x324)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x676371=await confirmKey(_0x5f4fd0(0x24c));if(!_0x676371)return console['error'](a54_0xdf4b4c['yellow']('Cancelled'),_0x5f4fd0(0x2cc)),0x1;}await withSpinner(_0x5f4fd0(0x2a2),()=>_0x2caa89[_0x5f4fd0(0x282)]['applyPullProject'](_0x22b7cb,{'revision':_0x3c4b6a}),{'verbose':_0x8e2571[_0x5f4fd0(0x303)]}),saveSessionContext({'workflow_project':_0x22b7cb[_0x5f4fd0(0x205)]},_0x8e2571[_0x5f4fd0(0x1c2)]),console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c[_0x5f4fd0(0x1b2)](_0x5f4fd0(0x18b)));const _0x4c3a11=a54_0x4287ed[_0x5f4fd0(0x1fb)](process['cwd'](),_0x22b7cb[_0x5f4fd0(0x2b5)])||'.';return console[_0x5f4fd0(0x2c8)](a54_0xdf4b4c['dim'](_0x5f4fd0(0x1cf)+_0x4c3a11)),console['error'](a54_0xdf4b4c[_0x5f4fd0(0x324)](_0x5f4fd0(0x1ec)+_0x22b7cb['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x2b8);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x295);async[a54_0x47092e(0x28e)](_0x229bbe){const _0x116f0e=a54_0x47092e,{options:_0x513ffc,args:_0x5242b9,tdx:_0x516cff}=_0x229bbe,_0x271912=this[_0x116f0e(0x2cd)](_0x5242b9,_0x513ffc),_0x84e862=_0x513ffc[_0x116f0e(0x1cd)],_0x23bb42=_0x513ffc[_0x116f0e(0x26b)];_0x513ffc[_0x116f0e(0x303)]&&(_0x271912&&console[_0x116f0e(0x2c8)](_0x116f0e(0x1d4)+_0x271912),_0x84e862&&console[_0x116f0e(0x2c8)](_0x116f0e(0x1bd)+_0x84e862),_0x513ffc[_0x116f0e(0x27b)]&&console[_0x116f0e(0x2c8)](_0x116f0e(0x218)),_0x23bb42&&console[_0x116f0e(0x2c8)](_0x116f0e(0x263)));let _0x4255f9;try{_0x4255f9=await withSpinner('Analyzing\x20changes...',()=>_0x516cff['workflow'][_0x116f0e(0x2e7)]({'sourceDir':_0x271912,'revision':_0x84e862,'skipValidation':_0x23bb42}),{'verbose':_0x513ffc[_0x116f0e(0x303)]});}catch(_0x1833bd){if(_0x1833bd instanceof Error&&_0x1833bd[_0x116f0e(0x25f)][_0x116f0e(0x1a9)]('No\x20workflow\x20tdx.json\x20found'))return console['error'](a54_0xdf4b4c['red'](_0x116f0e(0x199)),_0x116f0e(0x22f)),_0x513ffc[_0x116f0e(0x33c)]?console[_0x116f0e(0x2c8)](a54_0xdf4b4c[_0x116f0e(0x324)](_0x116f0e(0x1c6)+_0x513ffc[_0x116f0e(0x33c)]+'/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20'+_0x513ffc['workflowProject']+'\x27')):console['error'](a54_0xdf4b4c['dim'](_0x116f0e(0x1c3))),0x1;throw _0x1833bd;}const _0x265b56=_0x4255f9['data'];console[_0x116f0e(0x2c8)](_0x116f0e(0x2b0)+_0x265b56[_0x116f0e(0x205)]),console[_0x116f0e(0x2c8)](_0x116f0e(0x24b)+_0x265b56[_0x116f0e(0x2af)]),console[_0x116f0e(0x2c8)](_0x116f0e(0x26a)+_0x265b56[_0x116f0e(0x1cd)]),console[_0x116f0e(0x2c8)](_0x116f0e(0x228)+a54_0xdf4b4c[_0x116f0e(0x1b2)]('+'+_0x265b56[_0x116f0e(0x1a0)][_0x116f0e(0x2bd)]+_0x116f0e(0x1dc))+',\x20'+(a54_0xdf4b4c[_0x116f0e(0x2ce)]('~'+_0x265b56[_0x116f0e(0x1a0)][_0x116f0e(0x2ac)]+_0x116f0e(0x2c1))+',\x20')+(a54_0xdf4b4c['red']('-'+_0x265b56['summary']['deleted']+_0x116f0e(0x2a8))+',\x20')+(''+a54_0xdf4b4c['dim'](_0x265b56[_0x116f0e(0x1a0)]['unchanged']+_0x116f0e(0x252))));for(const _0x5116a2 of _0x265b56[_0x116f0e(0x230)]){_0x5116a2[_0x116f0e(0x28c)]===_0x116f0e(0x2ac)&&_0x5116a2[_0x116f0e(0x1b5)]&&(console[_0x116f0e(0x2c8)]('\x0a'+a54_0xdf4b4c[_0x116f0e(0x336)](_0x116f0e(0x284)+_0x5116a2[_0x116f0e(0x1f7)])),console[_0x116f0e(0x2c8)](_0x5116a2[_0x116f0e(0x1b5)]));}if(!_0x265b56[_0x116f0e(0x1f6)])return console[_0x116f0e(0x2c8)](a54_0xdf4b4c[_0x116f0e(0x1b2)](_0x116f0e(0x2fb))),await this[_0x116f0e(0x2a4)](_0x516cff,_0x265b56[_0x116f0e(0x205)],_0x513ffc[_0x116f0e(0x335)]),0x0;if(_0x513ffc[_0x116f0e(0x27b)])return console[_0x116f0e(0x2c8)](a54_0xdf4b4c[_0x116f0e(0x2ce)](_0x116f0e(0x26f))),0x0;if(!_0x513ffc[_0x116f0e(0x211)]){if(!isInteractive())return console[_0x116f0e(0x2c8)](a54_0xdf4b4c['red'](_0x116f0e(0x25c)),_0x116f0e(0x2aa)),console[_0x116f0e(0x2c8)](a54_0xdf4b4c['dim'](_0x116f0e(0x29f))),0x1;const _0x137b6c=await confirmKey(_0x116f0e(0x31c));if(!_0x137b6c)return console[_0x116f0e(0x2c8)](a54_0xdf4b4c[_0x116f0e(0x2ce)](_0x116f0e(0x315)),'-\x20nothing\x20pushed'),0x1;}const _0x28deb6=await withSpinner('Pushing\x20project...',()=>_0x516cff[_0x116f0e(0x282)][_0x116f0e(0x337)](_0x265b56),{'verbose':_0x513ffc[_0x116f0e(0x303)]}),_0x2c3e5b=_0x28deb6[_0x116f0e(0x2e3)];return console[_0x116f0e(0x2c8)](a54_0xdf4b4c[_0x116f0e(0x1b2)]('✔\x20Push\x20complete')),console[_0x116f0e(0x2c8)](_0x116f0e(0x22d)+_0x2c3e5b['projectId']),console['error'](_0x116f0e(0x26a)+_0x2c3e5b[_0x116f0e(0x1cd)]),await this[_0x116f0e(0x2a4)](_0x516cff,_0x2c3e5b[_0x116f0e(0x205)],_0x513ffc['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x47092e(0x210);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x2d2);async[a54_0x47092e(0x28e)](_0x3ea9da){const _0x577a08=a54_0x47092e,{options:_0x1371a0,args:_0x2ffc67,tdx:_0xdbba93}=_0x3ea9da,_0x47759c=this[_0x577a08(0x2cd)](_0x2ffc67,_0x1371a0),_0x24c5b9=_0x1371a0['name'],_0x29a1bb=_0x1371a0[_0x577a08(0x1cd)],_0x32ef9b=_0x1371a0[_0x577a08(0x26b)];if(!_0x47759c)return console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x30c)]('Error:'),_0x577a08(0x29a)),console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x324)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console[_0x577a08(0x2c8)](a54_0xdf4b4c['dim'](_0x577a08(0x187))),0x1;if(!_0x24c5b9)return console['error'](a54_0xdf4b4c['red'](_0x577a08(0x199)),_0x577a08(0x1c8)),console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x324)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x1371a0[_0x577a08(0x303)]&&(console[_0x577a08(0x2c8)](_0x577a08(0x1d4)+_0x47759c),console[_0x577a08(0x2c8)](_0x577a08(0x2f9)+_0x24c5b9),_0x29a1bb&&console['error'](_0x577a08(0x1bd)+_0x29a1bb),_0x1371a0['dryRun']&&console[_0x577a08(0x2c8)](_0x577a08(0x218)),_0x32ef9b&&console[_0x577a08(0x2c8)](_0x577a08(0x263)));const _0x152a59=await withSpinner('Analyzing\x20project...',()=>_0xdbba93['workflow'][_0x577a08(0x1ff)](_0x47759c,_0x24c5b9,{'revision':_0x29a1bb,'skipValidation':_0x32ef9b}),{'verbose':_0x1371a0[_0x577a08(0x303)]}),_0x467425=_0x152a59[_0x577a08(0x2e3)];console[_0x577a08(0x2c8)](_0x577a08(0x1a4)+_0x467425[_0x577a08(0x2af)]);_0x467425[_0x577a08(0x1e7)]&&console[_0x577a08(0x2c8)](_0x577a08(0x21e)+_0x467425[_0x577a08(0x1e7)]);console[_0x577a08(0x2c8)](_0x577a08(0x2f9)+_0x467425[_0x577a08(0x2ae)]),console[_0x577a08(0x2c8)]('Revision:\x20'+_0x467425[_0x577a08(0x1cd)]),console[_0x577a08(0x2c8)](_0x577a08(0x1ac)+_0x467425[_0x577a08(0x319)]);_0x467425[_0x577a08(0x29c)]&&(console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x2ce)](_0x577a08(0x266)+_0x467425['newProjectName']+_0x577a08(0x1c9)+_0x467425['existingProjectId']+')')),console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x2ce)](_0x577a08(0x23f))));if(_0x1371a0[_0x577a08(0x27b)])return console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x2ce)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x1371a0[_0x577a08(0x211)]){if(!isInteractive())return console[_0x577a08(0x2c8)](a54_0xdf4b4c['red'](_0x577a08(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x324)](_0x577a08(0x29f))),0x1;const _0x312f55=_0x467425[_0x577a08(0x1e7)]||a54_0x4287ed[_0x577a08(0x271)](_0x47759c),_0x5b0c18=_0x467425[_0x577a08(0x29c)]?_0x577a08(0x338)+_0x24c5b9+_0x577a08(0x204):_0x577a08(0x31e)+_0x312f55+_0x577a08(0x254)+_0x24c5b9+'\x22?',_0x135ea3=await confirmKey(_0x5b0c18);if(!_0x135ea3)return console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x2ce)](_0x577a08(0x315))),0x1;}const _0x10e0d9=await withSpinner(_0x467425['targetExists']?_0x577a08(0x325)+_0x24c5b9+_0x577a08(0x1b0):'Cloning\x20to\x20'+_0x24c5b9+_0x577a08(0x1b0),()=>_0xdbba93['workflow']['executeCloneProject'](_0x467425),{'verbose':_0x1371a0[_0x577a08(0x303)]}),_0x5b2803=_0x10e0d9['data'];return console[_0x577a08(0x2c8)](a54_0xdf4b4c[_0x577a08(0x1b2)](_0x467425[_0x577a08(0x29c)]?_0x577a08(0x2fd):_0x577a08(0x215))),console['error'](_0x577a08(0x2dc)+_0x5b2803['newProjectName']),console[_0x577a08(0x2c8)](_0x577a08(0x22d)+_0x5b2803[_0x577a08(0x198)]),console[_0x577a08(0x2c8)](_0x577a08(0x26a)+_0x5b2803['revision']),await this['showWorkflowConsoleUrl'](_0xdbba93,_0x5b2803[_0x577a08(0x2ae)],_0x1371a0[_0x577a08(0x335)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x2cf);[a54_0x47092e(0x1c5)]='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x47092e(0x28e)](_0x2b7beb){const _0x400298=a54_0x47092e,{options:_0x3109cd,args:_0x2b7572,tdx:_0x36b057}=_0x2b7beb,_0x58c5fe=_0x2b7572[0x0];if(!_0x58c5fe)return console['error'](_0x400298(0x19f)),console[_0x400298(0x2c8)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x3109cd[_0x400298(0x303)]&&console[_0x400298(0x2c8)](_0x400298(0x20d)+_0x58c5fe);if(!_0x3109cd[_0x400298(0x211)]){if(!isInteractive())return console[_0x400298(0x2c8)](a54_0xdf4b4c[_0x400298(0x30c)](_0x400298(0x25c)),_0x400298(0x2aa)),console[_0x400298(0x2c8)](a54_0xdf4b4c[_0x400298(0x324)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x347080=await confirmKey(_0x400298(0x2a5)+_0x58c5fe+_0x400298(0x1ca));if(!_0x347080)return console[_0x400298(0x2c8)](a54_0xdf4b4c[_0x400298(0x2ce)](_0x400298(0x315))),0x1;}const _0x14d5ff=await withSpinner(_0x400298(0x1c1)+_0x58c5fe+_0x400298(0x1b0),()=>_0x36b057[_0x400298(0x282)][_0x400298(0x33a)](_0x58c5fe),{'verbose':_0x3109cd[_0x400298(0x303)]}),_0x5ec2cb=_0x14d5ff[_0x400298(0x2e3)];return console[_0x400298(0x2c8)](_0x400298(0x2f1)+_0x5ec2cb[_0x400298(0x205)]),console[_0x400298(0x2c8)](_0x400298(0x22d)+_0x5ec2cb[_0x400298(0x2c7)]),0x0;}}export function parseKeyValue(_0x14c21a){const _0x13680d=a54_0x47092e,_0x532548=_0x14c21a[_0x13680d(0x245)]('=');if(_0x532548===-0x1)throw new Error(_0x13680d(0x1a8)+_0x14c21a+_0x13680d(0x189));const _0x2dae88=_0x14c21a[_0x13680d(0x274)](0x0,_0x532548),_0xcd9630=_0x14c21a['substring'](_0x532548+0x1);if(!_0x2dae88)throw new Error(_0x13680d(0x1ef));return{'key':_0x2dae88,'value':_0xcd9630};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x201);['description']=a54_0x47092e(0x267);async['execute'](_0x5eebc8){const _0x5bdc68=a54_0x47092e,{options:_0x1b3900,args:_0x4a020d,tdx:_0x4aab63}=_0x5eebc8,_0x219aba=this[_0x5bdc68(0x2fc)](_0x4a020d,_0x1b3900);if(!_0x219aba)return 0x1;_0x1b3900[_0x5bdc68(0x303)]&&console[_0x5bdc68(0x2c8)](_0x5bdc68(0x20d)+_0x219aba);const _0x27e74e=await withSpinner(_0x5bdc68(0x214),()=>_0x4aab63['workflow'][_0x5bdc68(0x310)](_0x219aba),{'verbose':_0x1b3900[_0x5bdc68(0x303)]}),{secrets:_0x356a14}=_0x27e74e[_0x5bdc68(0x2e3)];return console['error']('✔\x20Found\x20'+_0x356a14['length']+_0x5bdc68(0x1ed)+(_0x356a14[_0x5bdc68(0x317)]!==0x1?'s':'')),await handleSDKOutput(_0x356a14,_0x1b3900),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x21a);[a54_0x47092e(0x1c5)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async['execute'](_0x5bc8f0){const _0x105468=a54_0x47092e,{options:_0x4f0a78,args:_0x55ff12,tdx:_0x31fa14}=_0x5bc8f0;let _0x156c31,_0x42d881;if(_0x55ff12['length']>=0x1&&!_0x55ff12[0x0][_0x105468(0x1a9)]('='))_0x156c31=_0x55ff12[0x0],_0x42d881=_0x55ff12[_0x105468(0x322)](0x1);else{if(_0x55ff12[_0x105468(0x317)]>=0x1&&_0x4f0a78[_0x105468(0x33c)])_0x156c31=_0x4f0a78[_0x105468(0x33c)],_0x42d881=_0x55ff12;else return _0x55ff12[_0x105468(0x317)]>=0x1?(console[_0x105468(0x2c8)](_0x105468(0x28d)),console[_0x105468(0x2c8)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console['error'](_0x105468(0x316)),console[_0x105468(0x2c8)](_0x105468(0x20e)),0x1);}if(_0x42d881[_0x105468(0x317)]===0x0)return console[_0x105468(0x2c8)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x105468(0x2c8)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x456af5={};try{for(const _0x7288e4 of _0x42d881){const {key:_0x475369,value:_0x3510bf}=parseKeyValue(_0x7288e4);_0x456af5[_0x475369]=_0x3510bf;}}catch(_0x475093){return _0x475093 instanceof Error&&console['error'](a54_0xdf4b4c[_0x105468(0x30c)](_0x105468(0x199)),_0x475093[_0x105468(0x25f)]),0x1;}const _0x6bf73e=Object[_0x105468(0x1b3)](_0x456af5);_0x4f0a78[_0x105468(0x303)]&&(console[_0x105468(0x2c8)]('Project:\x20'+_0x156c31),console['error'](_0x105468(0x2df)+_0x6bf73e[_0x105468(0x314)](',\x20')));const _0x24a816=await withSpinner(_0x6bf73e['length']===0x1?'Setting\x20secret...':'Setting\x20'+_0x6bf73e['length']+'\x20secrets...',()=>_0x31fa14[_0x105468(0x282)]['setSecrets'](_0x156c31,_0x456af5),{'verbose':_0x4f0a78[_0x105468(0x303)]}),_0x2bf027=_0x24a816['data'];return console[_0x105468(0x2c8)](_0x6bf73e[_0x105468(0x317)]===0x1?'✔\x20Secret\x20\x27'+_0x2bf027[_0x105468(0x1b3)][0x0]+_0x105468(0x276)+_0x2bf027['projectName']+'\x27':'✔\x20'+_0x2bf027[_0x105468(0x1b3)][_0x105468(0x317)]+_0x105468(0x1ce)+_0x2bf027[_0x105468(0x205)]+'\x27'),(_0x4f0a78['json']||_0x4f0a78[_0x105468(0x30b)])&&await handleSingleObjectOutput(_0x2bf027,_0x4f0a78),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]='workflow:secrets:delete';[a54_0x47092e(0x1c5)]=a54_0x47092e(0x312);async['execute'](_0x1e1526){const _0x3a1c36=a54_0x47092e,{options:_0x1346a3,args:_0x52528d,tdx:_0x59baf5}=_0x1e1526;let _0x3611ba,_0xfbbdc9;if(_0x52528d[_0x3a1c36(0x317)]>=0x2)_0x3611ba=_0x52528d[0x0],_0xfbbdc9=_0x52528d[0x1];else{if(_0x52528d[_0x3a1c36(0x317)]===0x1&&_0x1346a3[_0x3a1c36(0x33c)])_0x3611ba=_0x1346a3['workflowProject'],_0xfbbdc9=_0x52528d[0x0];else return _0x52528d[_0x3a1c36(0x317)]===0x1?(console[_0x3a1c36(0x2c8)](_0x3a1c36(0x28d)),console[_0x3a1c36(0x2c8)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x3a1c36(0x2c8)]('Error:\x20Secret\x20key\x20is\x20required'),console[_0x3a1c36(0x2c8)]('Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>'),0x1);}_0x1346a3[_0x3a1c36(0x303)]&&(console[_0x3a1c36(0x2c8)](_0x3a1c36(0x20d)+_0x3611ba),console[_0x3a1c36(0x2c8)](_0x3a1c36(0x2dd)+_0xfbbdc9));if(!_0x1346a3[_0x3a1c36(0x211)]){if(!isInteractive())return console[_0x3a1c36(0x2c8)](a54_0xdf4b4c[_0x3a1c36(0x30c)](_0x3a1c36(0x25c)),_0x3a1c36(0x2aa)),console['error'](a54_0xdf4b4c['dim'](_0x3a1c36(0x29f))),0x1;const _0x8a9425=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0xfbbdc9+_0x3a1c36(0x21b)+_0x3611ba+'\x27?');if(!_0x8a9425)return console[_0x3a1c36(0x2c8)](a54_0xdf4b4c[_0x3a1c36(0x2ce)](_0x3a1c36(0x315))),0x1;}const _0x18f743=await withSpinner(_0x3a1c36(0x239),()=>_0x59baf5[_0x3a1c36(0x282)][_0x3a1c36(0x2b2)](_0x3611ba,_0xfbbdc9),{'verbose':_0x1346a3['verbose']}),_0x48c25f=_0x18f743['data'];return console[_0x3a1c36(0x2c8)](_0x3a1c36(0x1eb)+_0x48c25f[_0x3a1c36(0x272)]+_0x3a1c36(0x231)+_0x48c25f[_0x3a1c36(0x205)]+'\x27'),(_0x1346a3[_0x3a1c36(0x2c3)]||_0x1346a3[_0x3a1c36(0x30b)])&&await handleSingleObjectOutput(_0x48c25f,_0x1346a3),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(_0x57d2bc){const _0xec2411=a54_0x47092e,_0x164cf9=Math['floor'](_0x57d2bc/0x3e8),_0x2a0485=Math[_0xec2411(0x27d)](_0x164cf9/0x3c),_0x37c46b=Math[_0xec2411(0x27d)](_0x2a0485/0x3c),_0x21249f=Math['floor'](_0x37c46b/0x18);if(_0x21249f>0x0){const _0x5f4026=_0x37c46b%0x18;return _0x5f4026>0x0?_0x21249f+'d\x20'+_0x5f4026+'h':_0x21249f+'d';}else{if(_0x37c46b>0x0){const _0x45b0be=_0x2a0485%0x3c;return _0x45b0be>0x0?_0x37c46b+'h\x20'+_0x45b0be+'m':_0x37c46b+'h';}else{if(_0x2a0485>0x0){const _0x436ee9=_0x164cf9%0x3c;return _0x436ee9>0x0?_0x2a0485+'m\x20'+_0x436ee9+'s':_0x2a0485+'m';}else return _0x164cf9+'s';}}}function formatTimestamp(_0x58aab1,_0x103307){const _0x4a55e6=a54_0x47092e,_0x31c64c=new Date(_0x58aab1),_0x2afbec=String(_0x31c64c['getHours']())[_0x4a55e6(0x29e)](0x2,'0'),_0x2dab74=String(_0x31c64c['getMinutes']())[_0x4a55e6(0x29e)](0x2,'0'),_0x4112c0=_0x2afbec+':'+_0x2dab74,_0x33873f=_0x31c64c[_0x4a55e6(0x1b4)]()===_0x103307[_0x4a55e6(0x1b4)]()&&_0x31c64c[_0x4a55e6(0x1cb)]()===_0x103307[_0x4a55e6(0x1cb)]()&&_0x31c64c[_0x4a55e6(0x237)]()===_0x103307[_0x4a55e6(0x237)]();if(_0x33873f)return _0x4112c0;else{const _0x2d1a4e=String(_0x31c64c['getMonth']()+0x1)['padStart'](0x2,'0'),_0x403e1a=String(_0x31c64c[_0x4a55e6(0x237)]())[_0x4a55e6(0x29e)](0x2,'0');return _0x2d1a4e+'-'+_0x403e1a+'\x20'+_0x4112c0;}}function formatDate(_0x14adec){const _0xdc8482=a54_0x47092e,_0x126dc6=_0x14adec['getFullYear'](),_0x31dc31=String(_0x14adec[_0xdc8482(0x1cb)]()+0x1)['padStart'](0x2,'0'),_0x3ad189=String(_0x14adec[_0xdc8482(0x237)]())['padStart'](0x2,'0');return _0x126dc6+'-'+_0x31dc31+'-'+_0x3ad189;}function getTaskStateIcon(_0x44e27f){const _0x1e2f4f={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x1e2f4f[_0x44e27f]||'⚪';}function getBarChar(_0x857c2c){const _0x48dd4e=a54_0x47092e;return _0x857c2c==='error'||_0x857c2c===_0x48dd4e(0x240)?'×':'─';}function getBarColor(_0x1951be){const _0x5bb308=a54_0x47092e,_0x5bb776={'success':a54_0xdf4b4c[_0x5bb308(0x1b2)],'error':a54_0xdf4b4c['red'],'group_error':a54_0xdf4b4c['red'],'running':a54_0xdf4b4c[_0x5bb308(0x23a)],'blocked':a54_0xdf4b4c['yellow'],'planned':a54_0xdf4b4c[_0x5bb308(0x324)],'canceling':a54_0xdf4b4c[_0x5bb308(0x2ce)]};return _0x5bb776[_0x1951be]||a54_0xdf4b4c[_0x5bb308(0x311)];}function parseTaskName(_0x362053){const _0x4a2f88=a54_0x47092e;let _0x5b66e1=_0x362053['replace'](/^\++/,'');const _0x476724=_0x5b66e1[_0x4a2f88(0x306)]('+'),_0x5f53b0=_0x476724['length']>0x1?_0x476724['length']-0x2:0x0,_0xfa409d=_0x476724[_0x476724[_0x4a2f88(0x317)]-0x1]||_0x5b66e1;return{'level':_0x5f53b0,'name':'+'+_0xfa409d};}function truncateTaskName(_0x1f36d0,_0x22c8bd){const _0x1705d1=a54_0x47092e,_0x1df53b=stringWidth(_0x1f36d0);if(_0x1df53b<=_0x22c8bd)return _0x1f36d0;let _0x18f44f=_0x1f36d0;while(stringWidth(_0x18f44f+'…')>_0x22c8bd&&_0x18f44f[_0x1705d1(0x317)]>0x0){_0x18f44f=_0x18f44f[_0x1705d1(0x322)](0x0,-0x1);}return _0x18f44f+'…';}function calculateTimeScale(_0x545d4a,_0x40a257){const _0x51fb0b=a54_0x47092e;return{'startTime':_0x545d4a[_0x51fb0b(0x1e9)],'endTime':_0x545d4a[_0x51fb0b(0x287)],'durationMs':_0x545d4a[_0x51fb0b(0x32d)],'msPerChar':_0x545d4a[_0x51fb0b(0x32d)]/_0x40a257};}function timeToPosition(_0x225cd3,_0x3accd1,_0x23de62){const _0x5e9cf4=a54_0x47092e,_0x106d61=_0x225cd3-_0x3accd1[_0x5e9cf4(0x1a3)],_0x151178=Math[_0x5e9cf4(0x27d)](_0x106d61/_0x3accd1[_0x5e9cf4(0x206)]);return Math[_0x5e9cf4(0x234)](0x0,Math[_0x5e9cf4(0x2c5)](_0x151178,_0x23de62));}function renderTimeAxis(_0x59e21c,_0x2c4012){const _0x8b1e81=a54_0x47092e,_0x20eb35=Math[_0x8b1e81(0x2c5)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x8b1e81(0x288)],Math[_0x8b1e81(0x27d)](_0x2c4012/TIMELINE_CONFIG[_0x8b1e81(0x1c0)]))),_0x9dcea0=_0x59e21c[_0x8b1e81(0x22c)]/(_0x20eb35-0x1),_0x597e12=new Date(_0x59e21c[_0x8b1e81(0x1a3)]),_0x5ec035=[];for(let _0x1387dd=0x0;_0x1387dd<_0x20eb35;_0x1387dd++){const _0x5b38b6=_0x59e21c[_0x8b1e81(0x1a3)]+_0x1387dd*_0x9dcea0,_0x294b3c=timeToPosition(_0x5b38b6,_0x59e21c,_0x2c4012),_0x42f198=formatTimestamp(_0x5b38b6,_0x597e12);_0x5ec035['push']({'pos':_0x294b3c,'text':_0x42f198});}const _0x1d0ad2=new Array(_0x2c4012)['fill']('\x20');let _0x4c0cca=-0x1;for(const {pos:_0x205712,text:_0x1b311a}of _0x5ec035){let _0x3c45a8=Math['max'](0x0,_0x205712-Math[_0x8b1e81(0x27d)](_0x1b311a['length']/0x2));_0x3c45a8<=_0x4c0cca+TIMELINE_CONFIG[_0x8b1e81(0x1e5)]&&(_0x3c45a8=_0x4c0cca+TIMELINE_CONFIG[_0x8b1e81(0x1e5)]+0x1);_0x3c45a8+_0x1b311a['length']>_0x2c4012&&(_0x3c45a8=_0x2c4012-_0x1b311a['length']);if(_0x3c45a8>=0x0&&_0x3c45a8+_0x1b311a['length']<=_0x2c4012&&_0x3c45a8>_0x4c0cca){for(let _0xe1b4ac=0x0;_0xe1b4ac<_0x1b311a[_0x8b1e81(0x317)];_0xe1b4ac++){_0x1d0ad2[_0x3c45a8+_0xe1b4ac]=_0x1b311a[_0xe1b4ac];}_0x4c0cca=_0x3c45a8+_0x1b311a[_0x8b1e81(0x317)]-0x1;}}return _0x1d0ad2[_0x8b1e81(0x314)]('');}function renderTaskRow(_0x1ab6bb,_0x400576,_0x37c803,_0x6f7903){const _0x150ffc=a54_0x47092e,{level:_0x43d22f,name:_0x19e2bd}=parseTaskName(_0x1ab6bb[_0x150ffc(0x2a0)]),_0x1090f9='\x20'[_0x150ffc(0x208)](_0x43d22f),_0x38fea7=_0x1ab6bb[_0x150ffc(0x22a)]?'('+formatElapsed(_0x1ab6bb[_0x150ffc(0x22a)]['duration'])+')':'',_0x2e773b=stringWidth(_0x38fea7),_0x397b00=_0x43d22f*0x1,_0x301196=_0x6f7903-_0x397b00-_0x2e773b-0x1,_0x36a301=truncateTaskName(_0x19e2bd,_0x301196),_0x1aaa20=_0x1090f9+_0x36a301,_0x5e4282=stringWidth(_0x1aaa20),_0x4aa963=_0x6f7903-_0x5e4282-_0x2e773b,_0x2eeea0=_0x1aaa20+'\x20'[_0x150ffc(0x208)](Math[_0x150ffc(0x234)](0x1,_0x4aa963))+a54_0xdf4b4c[_0x150ffc(0x324)](_0x38fea7),_0x199454=getTaskStateIcon(_0x1ab6bb['state']),_0x4f0680=new Array(_0x37c803)[_0x150ffc(0x20c)]('\x20');if(_0x1ab6bb[_0x150ffc(0x22a)]){const _0x485b9d=timeToPosition(_0x1ab6bb[_0x150ffc(0x22a)][_0x150ffc(0x1e9)],_0x400576,_0x37c803),_0x1de5c3=timeToPosition(_0x1ab6bb['window'][_0x150ffc(0x287)],_0x400576,_0x37c803),_0x20a366=getBarChar(_0x1ab6bb['state']),_0x4cbaa2=Math[_0x150ffc(0x234)](_0x485b9d+0x1,_0x1de5c3);for(let _0x4c0785=_0x485b9d;_0x4c0785<Math[_0x150ffc(0x2c5)](_0x4cbaa2,_0x37c803);_0x4c0785++){_0x4f0680[_0x4c0785]=_0x20a366;}}const _0x2ad3de=getBarColor(_0x1ab6bb[_0x150ffc(0x1fa)]),_0x395274=_0x4f0680['map'](_0x4a7ea4=>_0x4a7ea4==='\x20'?'\x20':_0x2ad3de(_0x4a7ea4))[_0x150ffc(0x314)]('');return _0x199454+'\x20'+_0x2eeea0+'│'+_0x395274+'│';}function calculateStats(_0x24c99e){const _0x3297e0=a54_0x47092e,_0x3e51fd={'total':_0x24c99e[_0x3297e0(0x317)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x484373 of _0x24c99e){if(_0x484373[_0x3297e0(0x1fa)]===_0x3297e0(0x2a7))_0x3e51fd[_0x3297e0(0x2a7)]++;else{if(_0x484373[_0x3297e0(0x1fa)]===_0x3297e0(0x2c8)||_0x484373[_0x3297e0(0x1fa)]===_0x3297e0(0x240))_0x3e51fd[_0x3297e0(0x2c8)]++;else _0x484373[_0x3297e0(0x1fa)]===_0x3297e0(0x2c9)?_0x3e51fd[_0x3297e0(0x2c9)]++:_0x3e51fd[_0x3297e0(0x25e)]++;}}return _0x3e51fd;}function formatStats(_0x444986){const _0x29aca7=a54_0x47092e;return[_0x29aca7(0x265)+_0x444986[_0x29aca7(0x2be)],'✅\x20'+_0x444986['success'],'❌\x20'+_0x444986['error'],'🔄\x20'+_0x444986[_0x29aca7(0x2c9)],'⏳\x20'+_0x444986['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x47092e(0x2a0)]='workflow:timeline';[a54_0x47092e(0x1c5)]=a54_0x47092e(0x292);async[a54_0x47092e(0x28e)](_0x318755){const _0x465c2b=a54_0x47092e,{options:_0x151a42,args:_0x210d47,tdx:_0x3d4dad}=_0x318755;let _0x555fef,_0x48437c,_0x466b9e=![];if(_0x210d47[0x0]){if(_0x210d47[0x0][_0x465c2b(0x1a9)]('.')){const _0x4f532b=this[_0x465c2b(0x257)](_0x210d47,_0x151a42);if(!_0x4f532b)return 0x1;_0x555fef=_0x4f532b[_0x465c2b(0x205)],_0x48437c=_0x4f532b[_0x465c2b(0x24a)];}else{_0x48437c=_0x210d47[0x0],_0x555fef=_0x151a42[_0x465c2b(0x33c)];if(!_0x555fef)return console['error'](a54_0xdf4b4c[_0x465c2b(0x30c)](_0x465c2b(0x199)),'Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1;_0x466b9e=!![];}}else{const _0x5782d0=this[_0x465c2b(0x257)](_0x210d47,_0x151a42);if(!_0x5782d0)return 0x1;_0x555fef=_0x5782d0[_0x465c2b(0x205)],_0x48437c=_0x5782d0['workflowName'];}if(_0x151a42[_0x465c2b(0x303)]){if(_0x555fef&&_0x48437c)console['error'](_0x465c2b(0x1d5)+_0x555fef+'.'+_0x48437c);else _0x555fef&&console[_0x465c2b(0x2c8)](_0x465c2b(0x20b)+_0x555fef);}const _0x12dad5=_0x151a42[_0x465c2b(0x1e1)],_0x4eb1c8=_0x151a42[_0x465c2b(0x33d)];if(_0x12dad5){_0x4eb1c8&&console[_0x465c2b(0x2c8)](a54_0xdf4b4c[_0x465c2b(0x2ce)](_0x465c2b(0x1ae)),_0x465c2b(0x27e));const _0x4abf9a=_0x151a42[_0x465c2b(0x235)];return _0x4abf9a?await this['pollTimeline'](_0x318755,_0x12dad5):await this['renderSingleTimeline'](_0x318755,_0x12dad5,_0x151a42),0x0;}if(_0x4eb1c8){const _0x4e181f=await withSpinner(_0x465c2b(0x2f2),()=>_0x3d4dad[_0x465c2b(0x282)]['sessions']({'projectName':_0x555fef,'workflowName':_0x48437c,'limit':0x64}),{'verbose':_0x151a42[_0x465c2b(0x303)]}),_0x2065f4=_0x4e181f[_0x465c2b(0x2e3)][_0x465c2b(0x2e5)](_0x1e1ff7=>_0x1e1ff7['id']===_0x4eb1c8);if(!_0x2065f4)return console[_0x465c2b(0x2c8)](a54_0xdf4b4c[_0x465c2b(0x30c)](_0x465c2b(0x199)),'Session\x20not\x20found:\x20'+_0x4eb1c8),0x1;if(!_0x2065f4['lastAttempt']?.['id'])return console[_0x465c2b(0x2c8)](a54_0xdf4b4c[_0x465c2b(0x30c)](_0x465c2b(0x199)),'Session\x20'+_0x4eb1c8+_0x465c2b(0x24d)),0x1;const _0x58396e=_0x2065f4[_0x465c2b(0x268)]['id'];_0x151a42[_0x465c2b(0x303)]&&console[_0x465c2b(0x2c8)]('Using\x20attempt\x20'+_0x58396e+_0x465c2b(0x1e3)+_0x4eb1c8);const _0x469994=_0x151a42[_0x465c2b(0x235)];return _0x469994?await this[_0x465c2b(0x278)](_0x318755,_0x58396e):await this['renderSingleTimeline'](_0x318755,_0x58396e,_0x151a42),0x0;}const _0x3dab48=await withSpinner(_0x465c2b(0x302),()=>_0x3d4dad[_0x465c2b(0x282)][_0x465c2b(0x320)]({'projectName':_0x555fef,'workflowName':_0x48437c,'limit':_0x151a42[_0x465c2b(0x291)]||0x32}),{'verbose':_0x151a42[_0x465c2b(0x303)]}),_0x3ebaa1=_0x3dab48[_0x465c2b(0x2e3)];if(_0x3ebaa1[_0x465c2b(0x317)]===0x0){if(_0x555fef&&_0x48437c)console['error']('No\x20sessions\x20found\x20for:\x20'+_0x555fef+'.'+_0x48437c);else _0x555fef?console[_0x465c2b(0x2c8)](_0x465c2b(0x300)+_0x555fef):(console[_0x465c2b(0x2c8)](_0x465c2b(0x220)),console[_0x465c2b(0x2c8)](a54_0xdf4b4c[_0x465c2b(0x324)](_0x465c2b(0x2cb))));return 0x0;}_0x3ebaa1['sort']((_0x2816f1,_0x3dd84a)=>{const _0x30b89e=_0x465c2b,_0x2f2dc6=_0x2816f1[_0x30b89e(0x323)]||'',_0x7b063e=_0x3dd84a[_0x30b89e(0x323)]||'';return _0x7b063e[_0x30b89e(0x1e0)](_0x2f2dc6);});if(_0x151a42[_0x465c2b(0x2c3)]||_0x151a42[_0x465c2b(0x30b)])return await handleSDKOutput(_0x3ebaa1,_0x151a42),0x0;let _0x2f901d;if(_0x466b9e){const _0x50b83e=_0x3ebaa1[0x0];if(!_0x50b83e[_0x465c2b(0x268)]?.['id'])return console[_0x465c2b(0x2c8)]('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x2f901d=_0x50b83e[_0x465c2b(0x268)]['id'],_0x151a42['verbose']&&console[_0x465c2b(0x2c8)](_0x465c2b(0x294)+_0x50b83e[_0x465c2b(0x323)]);}else{const _0x429b07=_0x3ebaa1[_0x465c2b(0x242)](_0x124987=>{const _0x28d6f8=_0x465c2b,_0x3a46bd=getAttemptStatusDisplay(_0x124987[_0x28d6f8(0x268)]);return{'title':_0x124987[_0x28d6f8(0x1f5)]?.[_0x28d6f8(0x2a0)]+'.'+_0x124987[_0x28d6f8(0x282)]?.[_0x28d6f8(0x2a0)]+_0x28d6f8(0x261)+_0x124987['sessionTime']+'\x20'+_0x3a46bd[_0x28d6f8(0x2e1)],'value':_0x124987['lastAttempt']?.['id']||'','description':_0x3a46bd[_0x28d6f8(0x331)]};}),_0x3642b5=await a54_0x5c5794({'type':'select','name':_0x465c2b(0x1e1),'message':_0x465c2b(0x1de),'choices':_0x429b07[_0x465c2b(0x2d8)](_0x28b163=>_0x28b163['value']!=='')});if(!_0x3642b5[_0x465c2b(0x1e1)])return 0x0;_0x2f901d=_0x3642b5[_0x465c2b(0x1e1)];}const _0x4e11c6=_0x151a42[_0x465c2b(0x235)];return _0x4e11c6?await this[_0x465c2b(0x278)](_0x318755,_0x2f901d):await this['renderSingleTimeline'](_0x318755,_0x2f901d,_0x151a42),0x0;}async[a54_0x47092e(0x31a)](_0x502073,_0x2e9147,_0x388b2c){const _0x264500=a54_0x47092e,{tdx:_0x176e0c}=_0x502073;let _0x5013a8,_0x2f5051;try{[_0x5013a8,_0x2f5051]=await Promise[_0x264500(0x217)]([_0x176e0c[_0x264500(0x282)][_0x264500(0x225)](_0x2e9147),_0x176e0c[_0x264500(0x282)][_0x264500(0x1bf)](_0x2e9147,![])]);}catch(_0x12d344){console[_0x264500(0x2c8)](a54_0xdf4b4c[_0x264500(0x30c)](_0x264500(0x1e6)));_0x388b2c[_0x264500(0x303)]&&console[_0x264500(0x2c8)](_0x12d344);throw _0x12d344;}if(_0x388b2c[_0x264500(0x2c3)]||_0x388b2c[_0x264500(0x30b)]){const _0x2d4a7b=this['buildTimelineData'](_0x5013a8,_0x2f5051);await handleSDKOutput([_0x2d4a7b],_0x388b2c);return;}const _0x50e1a6=_0x176e0c[_0x264500(0x285)][_0x264500(0x335)],_0x41380d=this[_0x264500(0x2b4)](_0x5013a8,_0x2f5051,_0x50e1a6);console[_0x264500(0x260)](_0x41380d);}async['pollTimeline'](_0x25bfbc,_0x271157){const _0xd3a1e4=a54_0x47092e,{tdx:_0x4d5c9b}=_0x25bfbc,_0x42390f=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x219712=TIMELINE_CONFIG[_0xd3a1e4(0x23b)];let _0x21f786=0x0;while(_0x21f786<_0x219712){process[_0xd3a1e4(0x2de)][_0xd3a1e4(0x29b)]&&process[_0xd3a1e4(0x2de)][_0xd3a1e4(0x1e2)]('\x1bc');let _0x5d490d,_0x3549cb;try{[_0x5d490d,_0x3549cb]=await Promise['all']([_0x4d5c9b[_0xd3a1e4(0x282)][_0xd3a1e4(0x225)](_0x271157),_0x4d5c9b['workflow']['tasks'](_0x271157,![])]);}catch(_0xd01711){console[_0xd3a1e4(0x2c8)](a54_0xdf4b4c['red']('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x21f786>0x0&&console[_0xd3a1e4(0x2c8)](a54_0xdf4b4c[_0xd3a1e4(0x324)](_0xd3a1e4(0x190)+_0x21f786));throw _0xd01711;}const _0x2e5792=_0x4d5c9b[_0xd3a1e4(0x285)][_0xd3a1e4(0x335)],_0x4cf554=this[_0xd3a1e4(0x2b4)](_0x5d490d,_0x3549cb,_0x2e5792);console[_0xd3a1e4(0x260)](_0x4cf554);const _0xc04be4=_0x5d490d[_0xd3a1e4(0x28f)]&&_0x3549cb[_0xd3a1e4(0x1f3)](_0x226252=>_0x226252[_0xd3a1e4(0x1fa)]!==_0xd3a1e4(0x2c9)&&_0x226252[_0xd3a1e4(0x1fa)]!==_0xd3a1e4(0x1f9));if(_0xc04be4){console[_0xd3a1e4(0x2c8)](a54_0xdf4b4c[_0xd3a1e4(0x1b2)](_0xd3a1e4(0x216)));break;}console[_0xd3a1e4(0x2c8)](a54_0xdf4b4c['dim']('\x0aPolling...\x20('+_0x21f786*0x2+_0xd3a1e4(0x2a9))),await new Promise(_0x51b957=>setTimeout(_0x51b957,_0x42390f)),_0x21f786++;}_0x21f786>=_0x219712&&console[_0xd3a1e4(0x2c8)](a54_0xdf4b4c[_0xd3a1e4(0x2ce)](_0xd3a1e4(0x277)));}[a54_0x47092e(0x2b4)](_0x19e0e3,_0x52439a,_0x513272){const _0x326ab6=a54_0x47092e,_0x360dac=[],_0x90bb87=TIMELINE_CONFIG[_0x326ab6(0x1f2)],_0x16fbdf=0x5,_0x6286e8=process[_0x326ab6(0x2de)][_0x326ab6(0x193)]||0x78,_0x2c2a62=_0x6286e8-_0x90bb87-_0x16fbdf,_0x5e109b=Math[_0x326ab6(0x234)](TIMELINE_CONFIG[_0x326ab6(0x27c)],Math[_0x326ab6(0x2c5)](_0x2c2a62,TIMELINE_CONFIG[_0x326ab6(0x1fc)])),_0x5ad8aa=new Date(_0x19e0e3['createdAt'])['getTime'](),_0x2678f7=_0x19e0e3[_0x326ab6(0x25d)]?new Date(_0x19e0e3[_0x326ab6(0x25d)])[_0x326ab6(0x1f1)]():Date[_0x326ab6(0x2d6)](),_0x481ab7={'start':_0x5ad8aa,'end':_0x2678f7,'duration':_0x2678f7-_0x5ad8aa},_0xa73ec8=new Map(),_0x200817=[];for(const _0x42a439 of _0x52439a){if(_0x42a439[_0x326ab6(0x2ec)]){const _0x4d58f0=new Date(_0x42a439[_0x326ab6(0x2ec)])[_0x326ab6(0x1f1)](),_0x2d5d47=_0x42a439[_0x326ab6(0x26e)]?new Date(_0x42a439['updatedAt'])[_0x326ab6(0x1f1)]():Date[_0x326ab6(0x2d6)](),_0x4783fd={'start':_0x4d58f0,'end':_0x2d5d47,'duration':_0x2d5d47-_0x4d58f0};_0xa73ec8['set'](_0x42a439['id'],_0x4783fd),_0x200817['push']({'name':_0x42a439['fullName'],'state':_0x42a439[_0x326ab6(0x1fa)]||_0x326ab6(0x1b1),'window':_0x4783fd});}else _0x200817[_0x326ab6(0x30a)]({'name':_0x42a439[_0x326ab6(0x241)],'state':_0x42a439['state']||_0x326ab6(0x1f9),'window':undefined});}_0x200817['sort']((_0x3644dc,_0x2108c3)=>{const _0x5af156=_0x326ab6;if(!_0x3644dc['window'])return 0x1;if(!_0x2108c3[_0x5af156(0x22a)])return-0x1;return _0x3644dc[_0x5af156(0x22a)][_0x5af156(0x1e9)]-_0x2108c3[_0x5af156(0x22a)][_0x5af156(0x1e9)];});const _0x30291b=_0x200817[_0x326ab6(0x317)],_0x2fb552=_0x30291b>TIMELINE_CONFIG[_0x326ab6(0x1aa)];_0x2fb552&&_0x200817[_0x326ab6(0x1f0)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x138615=calculateTimeScale(_0x481ab7,_0x5e109b),_0x17595c=_0x19e0e3[_0x326ab6(0x28f)]?_0x19e0e3[_0x326ab6(0x2a7)]?a54_0xdf4b4c[_0x326ab6(0x1b2)](_0x326ab6(0x2a7)):a54_0xdf4b4c[_0x326ab6(0x30c)](_0x326ab6(0x2c8)):a54_0xdf4b4c[_0x326ab6(0x23a)]('running'),_0xbf08c7=_0x19e0e3['project']?.['id'],_0x512481=_0x19e0e3[_0x326ab6(0x33d)];let _0x429689;if(_0xbf08c7&&_0x512481){const _0x5852d0=getWorkflowAttemptUrl(_0x513272,_0xbf08c7,_0x512481,_0x19e0e3['id']);_0x429689=hyperlink(a54_0xdf4b4c['dim'](_0x19e0e3['id']),_0x5852d0);}else _0x429689=a54_0xdf4b4c[_0x326ab6(0x324)](_0x19e0e3['id']);_0x360dac['push'](_0x326ab6(0x20f)+_0x429689+_0x326ab6(0x261)+_0x17595c+'\x20-\x20'+formatElapsed(_0x481ab7['duration']));if(_0x200817[_0x326ab6(0x317)]>0x0){const _0x2d0763=renderTimeAxis(_0x138615,_0x5e109b),_0xdd93d=new Date(_0x481ab7[_0x326ab6(0x1e9)]),_0x24019c=formatDate(_0xdd93d),_0x382444=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x90bb87,_0x21cf6b=_0x24019c[_0x326ab6(0x29e)](_0x382444),_0x15ba2a=a54_0xdf4b4c[_0x326ab6(0x324)](_0x21cf6b);_0x360dac[_0x326ab6(0x30a)](_0x15ba2a+'\x20'+_0x2d0763);for(const _0x21a891 of _0x200817){_0x360dac['push'](renderTaskRow(_0x21a891,_0x138615,_0x5e109b,_0x90bb87));}const _0xb8c991=calculateStats(_0x200817);_0x360dac[_0x326ab6(0x30a)](formatStats(_0xb8c991)),_0x2fb552&&_0x360dac[_0x326ab6(0x30a)](a54_0xdf4b4c[_0x326ab6(0x2ce)](_0x326ab6(0x31f)+TIMELINE_CONFIG[_0x326ab6(0x1aa)]+_0x326ab6(0x32c)+_0x30291b+_0x326ab6(0x224))),_0x360dac['push'](''),_0x360dac[_0x326ab6(0x30a)](a54_0xdf4b4c[_0x326ab6(0x324)](_0x326ab6(0x25a))+('tdx\x20wf\x20attempt\x20'+_0x19e0e3['id']+'\x20logs')+a54_0xdf4b4c['dim'](_0x326ab6(0x249)));}else _0x360dac[_0x326ab6(0x30a)](_0x326ab6(0x207));return _0x360dac[_0x326ab6(0x314)]('\x0a');}[a54_0x47092e(0x227)](_0x3cce45,_0x3e168c){const _0x1ef80c=a54_0x47092e,_0x114594=new Date(_0x3cce45[_0x1ef80c(0x30d)])['getTime'](),_0x3534d7=_0x3cce45[_0x1ef80c(0x25d)]?new Date(_0x3cce45[_0x1ef80c(0x25d)])['getTime']():Date[_0x1ef80c(0x2d6)](),_0xff82a7=_0x3534d7-_0x114594,_0x63aa9a=[];for(const _0x36c252 of _0x3e168c){if(_0x36c252[_0x1ef80c(0x2ec)]){const _0x714f09=new Date(_0x36c252['startedAt'])[_0x1ef80c(0x1f1)](),_0x5bcacd=_0x36c252[_0x1ef80c(0x26e)]?new Date(_0x36c252[_0x1ef80c(0x26e)])[_0x1ef80c(0x1f1)]():Date[_0x1ef80c(0x2d6)]();_0x63aa9a[_0x1ef80c(0x30a)]({'name':_0x36c252[_0x1ef80c(0x241)],'state':_0x36c252['state']||_0x1ef80c(0x1b1),'window':{'start':_0x714f09,'end':_0x5bcacd,'duration':_0x5bcacd-_0x714f09}});}else _0x63aa9a[_0x1ef80c(0x30a)]({'name':_0x36c252[_0x1ef80c(0x241)],'state':_0x36c252[_0x1ef80c(0x1fa)]||_0x1ef80c(0x1f9),'window':undefined});}const _0x16de61=calculateStats(_0x63aa9a);return{'attempt':{'id':_0x3cce45['id'],'status':_0x3cce45[_0x1ef80c(0x28f)]?_0x3cce45[_0x1ef80c(0x2a7)]?_0x1ef80c(0x2a7):'error':_0x1ef80c(0x2c9),'createdAt':_0x3cce45[_0x1ef80c(0x30d)],'finishedAt':_0x3cce45[_0x1ef80c(0x25d)],'duration_ms':_0xff82a7},'tasks':_0x63aa9a[_0x1ef80c(0x242)](_0x5baed5=>({'name':_0x5baed5[_0x1ef80c(0x2a0)],'state':_0x5baed5[_0x1ef80c(0x1fa)],'startedAt':_0x5baed5[_0x1ef80c(0x22a)]?new Date(_0x5baed5['window'][_0x1ef80c(0x1e9)])[_0x1ef80c(0x256)]():null,'updatedAt':_0x5baed5[_0x1ef80c(0x22a)]?new Date(_0x5baed5[_0x1ef80c(0x22a)]['end'])[_0x1ef80c(0x256)]():null,'duration_ms':_0x5baed5[_0x1ef80c(0x22a)]?.[_0x1ef80c(0x32d)]||null})),'stats':_0x16de61};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x195);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x2d1);async[a54_0x47092e(0x28e)](_0x4c6cb1){const _0x31f6d4=a54_0x47092e,{options:_0x2e8c27,tdx:_0x4ddf30}=_0x4c6cb1,_0x150712=await withSpinner('Listing\x20schedules...',()=>_0x4ddf30[_0x31f6d4(0x282)][_0x31f6d4(0x192)](),{'verbose':_0x2e8c27[_0x31f6d4(0x303)]}),_0x5032dd=_0x150712[_0x31f6d4(0x2e3)];console[_0x31f6d4(0x2c8)](_0x31f6d4(0x232)+_0x5032dd[_0x31f6d4(0x317)]+_0x31f6d4(0x1d8)+(_0x5032dd[_0x31f6d4(0x317)]!==0x1?'s':''));if(isStructuredFormat(_0x2e8c27))await handleSDKOutput(_0x5032dd,_0x2e8c27);else{if(_0x5032dd[_0x31f6d4(0x317)]===0x0)console[_0x31f6d4(0x260)](_0x31f6d4(0x212));else for(const _0x211ccb of _0x5032dd){const _0x2b93cf=_0x211ccb['disabledAt']?a54_0xdf4b4c[_0x31f6d4(0x2ce)](_0x31f6d4(0x1d9)):'',_0x4f14a5=_0x211ccb[_0x31f6d4(0x1f5)]?.['name']?a54_0xdf4b4c[_0x31f6d4(0x324)]('\x20['+_0x211ccb['project']['name']+']'):'',_0x8f0efc=_0x211ccb[_0x31f6d4(0x1fd)]?a54_0xdf4b4c[_0x31f6d4(0x324)]('\x20next:\x20'+new Date(_0x211ccb[_0x31f6d4(0x1fd)])['toLocaleString']()):'';console[_0x31f6d4(0x260)]('📅\x20#'+_0x211ccb['id']+'\x20'+(_0x211ccb[_0x31f6d4(0x282)]?.['name']||_0x31f6d4(0x326))+_0x4f14a5+_0x2b93cf+_0x8f0efc);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x297);[a54_0x47092e(0x1c5)]='Enable\x20a\x20workflow\x20schedule';async[a54_0x47092e(0x28e)](_0x107027){const _0x4e3e24=a54_0x47092e,{options:_0x3efd41,args:_0x5e5ebe,tdx:_0x41e276}=_0x107027,_0x26d572=_0x5e5ebe[0x0];if(!_0x26d572)return console['error'](a54_0xdf4b4c['red'](_0x4e3e24(0x199)),'Schedule\x20ID\x20is\x20required'),console[_0x4e3e24(0x2c8)](a54_0xdf4b4c['dim']('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console[_0x4e3e24(0x2c8)](a54_0xdf4b4c['dim'](_0x4e3e24(0x30f))),0x1;const _0x489f5f=await withSpinner('Enabling\x20schedule\x20#'+_0x26d572+_0x4e3e24(0x1b0),()=>_0x41e276['workflow'][_0x4e3e24(0x2f5)](_0x26d572),{'verbose':_0x3efd41[_0x4e3e24(0x303)]}),_0x395889=_0x489f5f['data'];return isStructuredFormat(_0x3efd41)?await handleSingleObjectOutput(_0x395889,_0x3efd41):(console[_0x4e3e24(0x260)](_0x4e3e24(0x2e9)+_0x26d572+_0x4e3e24(0x19a)+(_0x395889[_0x4e3e24(0x282)]?.[_0x4e3e24(0x2a0)]||_0x4e3e24(0x1b1))+')'),_0x395889['nextRunTime']&&console[_0x4e3e24(0x260)](a54_0xdf4b4c[_0x4e3e24(0x324)]('\x20\x20Next\x20run:\x20'+new Date(_0x395889[_0x4e3e24(0x1fd)])[_0x4e3e24(0x1e4)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x47092e(0x2a0)]=a54_0x47092e(0x191);[a54_0x47092e(0x1c5)]=a54_0x47092e(0x280);async[a54_0x47092e(0x28e)](_0xae9f61){const _0xadd035=a54_0x47092e,{options:_0x5042ab,args:_0x22a9bc,tdx:_0x312478}=_0xae9f61,_0x277523=_0x22a9bc[0x0];if(!_0x277523)return console[_0xadd035(0x2c8)](a54_0xdf4b4c[_0xadd035(0x30c)]('Error:'),_0xadd035(0x1f4)),console[_0xadd035(0x2c8)](a54_0xdf4b4c['dim']('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0xadd035(0x2c8)](a54_0xdf4b4c['dim'](_0xadd035(0x30f))),0x1;const _0x11da5f=await withSpinner('Disabling\x20schedule\x20#'+_0x277523+_0xadd035(0x1b0),()=>_0x312478[_0xadd035(0x282)]['disableSchedule'](_0x277523),{'verbose':_0x5042ab[_0xadd035(0x303)]}),_0x29f170=_0x11da5f[_0xadd035(0x2e3)];return isStructuredFormat(_0x5042ab)?await handleSingleObjectOutput(_0x29f170,_0x5042ab):console[_0xadd035(0x260)](_0xadd035(0x2e9)+_0x277523+_0xadd035(0x270)+(_0x29f170[_0xadd035(0x282)]?.['name']||_0xadd035(0x1b1))+')'),0x0;}}
1
+ const a54_0x3a8226=a54_0x5f04;(function(_0x59aec9,_0x47b2df){const _0xffb16e=a54_0x5f04,_0x1cff99=_0x59aec9();while(!![]){try{const _0x367b72=-parseInt(_0xffb16e(0xeb))/0x1+-parseInt(_0xffb16e(0x1ec))/0x2*(parseInt(_0xffb16e(0x235))/0x3)+-parseInt(_0xffb16e(0x107))/0x4+parseInt(_0xffb16e(0x1b9))/0x5+-parseInt(_0xffb16e(0x120))/0x6*(-parseInt(_0xffb16e(0x11e))/0x7)+-parseInt(_0xffb16e(0x2aa))/0x8+parseInt(_0xffb16e(0x1f3))/0x9;if(_0x367b72===_0x47b2df)break;else _0x1cff99['push'](_0x1cff99['shift']());}catch(_0x4a6528){_0x1cff99['push'](_0x1cff99['shift']());}}}(a54_0x5eae,0xbf567));import a54_0x1e596b from'chalk';import{existsSync}from'fs';function a54_0x5f04(_0xb08127,_0x13f6a0){_0xb08127=_0xb08127-0xe8;const _0x5eae79=a54_0x5eae();let _0x5f046c=_0x5eae79[_0xb08127];return _0x5f046c;}import a54_0x1e7b2e from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a54_0x89dadd from'prompts';function getAttemptStatusDisplay(_0x525019){const _0x2da6a3=a54_0x5f04;if(!_0x525019)return{'icon':'⏳','text':''};const {done:_0x10e647,success:_0x3dd528,cancelRequested:_0x30bbe3}=_0x525019;if(!_0x10e647)return _0x30bbe3?{'icon':'🛑','text':a54_0x1e596b[_0x2da6a3(0x1f4)](_0x2da6a3(0x1b2))}:{'icon':'🔄','text':a54_0x1e596b[_0x2da6a3(0x1df)]('running')};if(_0x3dd528)return{'icon':'✅','text':a54_0x1e596b[_0x2da6a3(0xfb)](_0x2da6a3(0x1b0))};return{'icon':'❌','text':a54_0x1e596b[_0x2da6a3(0x227)](_0x2da6a3(0x26f))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x3a8226(0x1f0)](_0x411f89,_0x489ce7,_0x2e0b82=0x0){return _0x411f89[_0x2e0b82]||_0x489ce7['workflowProject'];}[a54_0x3a8226(0x160)](_0x4c5485,_0x17e71f,_0x4c4e3d=0x0){const _0x3c131c=a54_0x3a8226,_0x2de7f6=this[_0x3c131c(0x1f0)](_0x4c5485,_0x17e71f,_0x4c4e3d);if(!_0x2de7f6)return console[_0x3c131c(0x26f)](a54_0x1e596b['red'](_0x3c131c(0x23e)),'Project\x20name\x20is\x20required'),console[_0x3c131c(0x26f)](a54_0x1e596b[_0x3c131c(0xe8)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x2de7f6;}[a54_0x3a8226(0x1ef)](_0x33d036,_0x8163ca){const _0x5419fe=a54_0x3a8226;if(_0x33d036[0x0]){const _0x21d049=_0x33d036[0x0]['split']('.');if(_0x21d049[_0x5419fe(0x294)]===0x1)return{'projectName':_0x21d049[0x0],'workflowName':undefined};else return _0x21d049[_0x5419fe(0x294)]===0x2?{'projectName':_0x21d049[0x0],'workflowName':_0x21d049[0x1]}:(console[_0x5419fe(0x26f)](a54_0x1e596b[_0x5419fe(0x227)]('Error:'),_0x5419fe(0xf6)),null);}return{'projectName':_0x8163ca[_0x5419fe(0x22d)],'workflowName':undefined};}[a54_0x3a8226(0x175)](_0x39f784,_0x2ea348,_0x1845d7=0x0){const _0x42d8d2=a54_0x3a8226;if(_0x39f784[_0x1845d7])return _0x39f784[_0x1845d7];if(_0x2ea348[_0x42d8d2(0x22d)]){const _0x44e3b1=a54_0x1e7b2e[_0x42d8d2(0x258)](process[_0x42d8d2(0x2a9)](),_0x42d8d2(0x256),_0x2ea348[_0x42d8d2(0x22d)]);if(existsSync(a54_0x1e7b2e[_0x42d8d2(0x258)](_0x44e3b1,_0x42d8d2(0x115))))return _0x44e3b1;}return undefined;}async['showWorkflowConsoleUrl'](_0x3f6bf3,_0x16a4f4,_0x5d29aa){const _0x4800ec=a54_0x3a8226;try{const _0x10d273=await _0x3f6bf3[_0x4800ec(0x267)]['workflows'](_0x16a4f4,{'limit':0x1});if(_0x10d273[_0x4800ec(0x294)]>0x0){const _0x2742ab=_0x10d273[0x0]['id'],_0x2bc084=getWorkflowUrl(_0x5d29aa,_0x2742ab);console[_0x4800ec(0x26f)](_0x4800ec(0x17a)+a54_0x1e596b[_0x4800ec(0x106)](_0x2bc084));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']='workflow:use';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x22f);async[a54_0x3a8226(0x1cd)](_0x56ca1f){const _0x5ddce5=a54_0x3a8226,{options:_0x27e2fa,args:_0x42f58f,tdx:_0x33ca9d}=_0x56ca1f,_0xb82d83=_0x42f58f[0x0],_0x510ab5=_0x27e2fa['clear'];if(_0x510ab5)return saveSessionContext({'workflow_project':undefined},_0x27e2fa['session']),console[_0x5ddce5(0x204)](a54_0x1e596b['green'](_0x5ddce5(0x12c))),0x0;if(!_0xb82d83)return console[_0x5ddce5(0x26f)](a54_0x1e596b[_0x5ddce5(0x227)](_0x5ddce5(0x23e)),_0x5ddce5(0x1b4)),console[_0x5ddce5(0x26f)](a54_0x1e596b['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a54_0x1e596b[_0x5ddce5(0xe8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0x41e61a=await withSpinner(_0x5ddce5(0x279)+_0xb82d83+'\x27...',()=>_0x33ca9d[_0x5ddce5(0x267)][_0x5ddce5(0x155)](_0xb82d83),{'verbose':_0x27e2fa[_0x5ddce5(0x272)]}),{name:_0x11ae11}=_0x41e61a[_0x5ddce5(0x1ba)];return saveSessionContext({'workflow_project':_0x11ae11},_0x27e2fa[_0x5ddce5(0x128)]),console[_0x5ddce5(0x204)](a54_0x1e596b[_0x5ddce5(0xfb)](_0x5ddce5(0x1a0)+a54_0x1e596b[_0x5ddce5(0x106)](_0x11ae11))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x276);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x25d);async[a54_0x3a8226(0x1cd)](_0x3a18ee){const _0x2e0f20=a54_0x3a8226,{options:_0x1bed3a,args:_0x7c9959,tdx:_0x458cff}=_0x3a18ee,_0x2e3eb9=_0x7c9959[0x0];_0x1bed3a['verbose']&&_0x2e3eb9&&console[_0x2e0f20(0x26f)](_0x2e0f20(0x167)+_0x2e3eb9);const _0x1e1961=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x458cff['workflow'][_0x2e0f20(0x297)](_0x2e3eb9,{'limit':_0x1bed3a['limit']}),{'verbose':_0x1bed3a[_0x2e0f20(0x272)]});let _0x30378d=_0x1e1961['data'];_0x30378d[_0x2e0f20(0x1c8)]((_0x59d325,_0x23617a)=>_0x59d325[_0x2e0f20(0xf9)][_0x2e0f20(0x234)](_0x23617a['name']));const _0x5754ba=_0x1bed3a['limit']||0x64,_0x12b67e=_0x30378d[_0x2e0f20(0x294)]>=_0x5754ba?a54_0x1e596b[_0x2e0f20(0xe8)](_0x2e0f20(0x214)):'';console['error'](_0x2e0f20(0x151)+_0x30378d[_0x2e0f20(0x294)]+_0x2e0f20(0xf1)+(_0x30378d[_0x2e0f20(0x294)]!==0x1?'s':'')+_0x12b67e);if(_0x1bed3a[_0x2e0f20(0x275)]===_0x2e0f20(0x10d)||_0x1bed3a[_0x2e0f20(0x275)]===_0x2e0f20(0x1c4)||_0x1bed3a[_0x2e0f20(0x275)]==='table')await handleSDKOutput(_0x30378d,_0x1bed3a);else{if(_0x30378d[_0x2e0f20(0x294)]===0x0)_0x2e3eb9?console[_0x2e0f20(0x204)](_0x2e0f20(0x18b)+_0x2e3eb9):console[_0x2e0f20(0x204)]('No\x20workflow\x20projects\x20found');else{const _0x4abcf2=_0x30378d[_0x2e0f20(0x1bc)](_0x253fc4=>{const _0x5c87de=_0x2e0f20,_0x31eb47=_0x253fc4[_0x5c87de(0x1a8)]?.['some'](_0xffa67a=>_0xffa67a[_0x5c87de(0x1fe)]===_0x5c87de(0x247)),_0x2389a1=_0x31eb47?a54_0x1e596b[_0x5c87de(0xe8)](_0x5c87de(0x1e7)):'';return'📁\x20'+_0x253fc4[_0x5c87de(0xf9)]+_0x2389a1;});await writeOutput(_0x4abcf2[_0x2e0f20(0x258)]('\x0a'),_0x1bed3a[_0x2e0f20(0x232)],_0x2e0f20(0x110));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x168);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x163);async[a54_0x3a8226(0x1cd)](_0x2faecd){const _0x5ed874=a54_0x3a8226,{options:_0x5e7af7,args:_0x54de99,tdx:_0x2c1f9b}=_0x2faecd,_0x58d1b6=this[_0x5ed874(0x1f0)](_0x54de99,_0x5e7af7);_0x5e7af7[_0x5ed874(0x272)]&&_0x58d1b6&&console[_0x5ed874(0x26f)](_0x5ed874(0x169)+_0x58d1b6);const _0x494ea5=await withSpinner(_0x5ed874(0x230),()=>_0x2c1f9b['workflow'][_0x5ed874(0x256)](_0x58d1b6,{'limit':_0x5e7af7[_0x5ed874(0x171)]}),{'verbose':_0x5e7af7[_0x5ed874(0x272)]});let _0x1e8403=_0x494ea5['data'];_0x1e8403[_0x5ed874(0x1c8)]((_0xe4d791,_0x395ee8)=>{const _0x5e7b63=_0x5ed874,_0x1fa0c0=_0xe4d791['name']['localeCompare'](_0x395ee8[_0x5e7b63(0xf9)]);if(_0x1fa0c0!==0x0)return _0x1fa0c0;return(_0xe4d791[_0x5e7b63(0x1cb)]?.['name']||'')['localeCompare'](_0x395ee8[_0x5e7b63(0x1cb)]?.['name']||'');});const _0x1b625d=_0x5e7af7['limit']||0x64,_0x3f54f9=_0x1e8403[_0x5ed874(0x294)]>=_0x1b625d?a54_0x1e596b[_0x5ed874(0xe8)](_0x5ed874(0x214)):'';console[_0x5ed874(0x26f)]('✔\x20Found\x20'+_0x1e8403[_0x5ed874(0x294)]+_0x5ed874(0x16c)+(_0x1e8403[_0x5ed874(0x294)]!==0x1?'s':'')+_0x3f54f9);if(_0x5e7af7[_0x5ed874(0x275)]===_0x5ed874(0x10d)||_0x5e7af7['format']===_0x5ed874(0x1c4)||_0x5e7af7[_0x5ed874(0x275)]==='table')await handleSDKOutput(_0x1e8403,_0x5e7af7);else{if(_0x1e8403[_0x5ed874(0x294)]===0x0)_0x58d1b6?console[_0x5ed874(0x204)](_0x5ed874(0x174)+_0x58d1b6):console[_0x5ed874(0x204)](_0x5ed874(0x1bf));else{const _0x3414fa=_0x5e7af7['site'],_0x161959=_0x1e8403['map'](_0x2ad7d3=>{const _0x58c34e=_0x5ed874,_0x2863ad=a54_0x1e596b[_0x58c34e(0xe8)]('#'+_0x2ad7d3['id']),_0x569a97=hyperlink(_0x2863ad,getWorkflowUrl(_0x3414fa,_0x2ad7d3['id'])),_0x22cae7=_0x2ad7d3[_0x58c34e(0x1cb)]?.['name']?a54_0x1e596b[_0x58c34e(0xe8)]('\x20('+_0x2ad7d3[_0x58c34e(0x1cb)][_0x58c34e(0xf9)]+')'):'';return'📋\x20'+_0x569a97+'\x20'+_0x2ad7d3['name']+_0x22cae7;});await writeOutput(_0x161959['join']('\x0a'),_0x5e7af7[_0x5ed874(0x232)],_0x5ed874(0x110));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1f5);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x263);async['execute'](_0x5ba8fc){const _0x33a835=a54_0x3a8226,{options:_0x42cc39,args:_0x3f670c,tdx:_0x595582}=_0x5ba8fc,_0x1344cc=this[_0x33a835(0x1ef)](_0x3f670c,_0x42cc39);if(!_0x1344cc)return 0x1;const {projectName:_0x45825a,workflowName:_0x5c1b55}=_0x1344cc;if(_0x42cc39[_0x33a835(0x272)]){if(_0x45825a&&_0x5c1b55)console['error'](_0x33a835(0x176)+_0x45825a+'.'+_0x5c1b55);else _0x45825a&&console[_0x33a835(0x26f)]('Filter:\x20project='+_0x45825a);const _0x5b3c2d=_0x42cc39['status'];_0x5b3c2d&&console[_0x33a835(0x26f)](_0x33a835(0x1e4)+_0x5b3c2d);}let _0x5f4b25=0x28;if(process[_0x33a835(0x1f6)][_0x33a835(0x1e8)]&&!_0x42cc39['output']&&!_0x42cc39[_0x33a835(0x275)]){const _0x1ca584=process['stdout']['rows']||0x28;_0x5f4b25=Math[_0x33a835(0xf7)](0x14,Math[_0x33a835(0x20e)](_0x1ca584*0x2/0x3));}const _0x50018c=_0x42cc39[_0x33a835(0x171)]||_0x5f4b25,_0x2bcd08=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0x595582[_0x33a835(0x267)]['sessions']({'projectName':_0x45825a,'workflowName':_0x5c1b55,'status':_0x42cc39[_0x33a835(0x23b)],'fromTime':_0x42cc39['from'],'toTime':_0x42cc39['to'],'limit':_0x50018c}),{'verbose':_0x42cc39[_0x33a835(0x272)]}),_0x84c2d4=_0x2bcd08[_0x33a835(0x1ba)];_0x84c2d4[_0x33a835(0x1c8)]((_0x6b0a01,_0x5dab99)=>{const _0x25b640=_0x33a835,_0x51259d=_0x6b0a01[_0x25b640(0x194)]||'',_0x46786f=_0x5dab99['sessionTime']||'';return _0x46786f[_0x25b640(0x234)](_0x51259d);});_0x84c2d4[_0x33a835(0x294)]>=_0x50018c?console[_0x33a835(0x26f)](_0x33a835(0x181)+_0x84c2d4[_0x33a835(0x294)]+'\x20sessions\x20'+a54_0x1e596b[_0x33a835(0xe8)]('(use\x20--limit\x20to\x20see\x20more)')):console[_0x33a835(0x26f)](_0x33a835(0x151)+_0x84c2d4[_0x33a835(0x294)]+_0x33a835(0x210)+(_0x84c2d4[_0x33a835(0x294)]!==0x1?'s':''));if(_0x42cc39['format']===_0x33a835(0x10d)||_0x42cc39[_0x33a835(0x275)]===_0x33a835(0x1c4)||_0x42cc39[_0x33a835(0x275)]===_0x33a835(0x1a4))await handleSDKOutput(_0x84c2d4,_0x42cc39);else{if(!process[_0x33a835(0x1f6)][_0x33a835(0x1e8)]||_0x42cc39['output']){if(_0x84c2d4['length']===0x0){if(_0x45825a&&_0x5c1b55)console[_0x33a835(0x204)](_0x33a835(0x1d9)+_0x45825a+'.'+_0x5c1b55);else _0x45825a?console['log'](_0x33a835(0x287)+_0x45825a):console[_0x33a835(0x204)](_0x33a835(0x2ab));}else{const _0x44ecd1=_0x42cc39[_0x33a835(0x241)],_0x46e7b6=this['renderSessionsTimeline'](_0x84c2d4,_0x44ecd1);_0x42cc39[_0x33a835(0x232)]?await writeOutput(_0x46e7b6,_0x42cc39['output'],'list'):console['log'](_0x46e7b6);}!_0x45825a&&(console['error'](''),console[_0x33a835(0x26f)](a54_0x1e596b[_0x33a835(0xe8)](_0x33a835(0x25a))),console[_0x33a835(0x26f)](a54_0x1e596b['dim'](_0x33a835(0x13f))+'or'+a54_0x1e596b[_0x33a835(0xe8)](_0x33a835(0x228))));}else{if(_0x84c2d4[_0x33a835(0x294)]===0x0){if(_0x45825a&&_0x5c1b55)console['log'](_0x33a835(0x1d9)+_0x45825a+'.'+_0x5c1b55);else _0x45825a?console['log'](_0x33a835(0x287)+_0x45825a):console[_0x33a835(0x204)]('No\x20sessions\x20found');}else await this[_0x33a835(0x1e9)](_0x84c2d4,_0x5ba8fc,_0x45825a);}}return 0x0;}[a54_0x3a8226(0x19b)](_0x491d0,_0x5c563b){const _0x4230b4=a54_0x3a8226,_0x159f3e=[],_0x4d4c6d=new Map();let _0x2265fe=Infinity,_0x5ef098=-Infinity;for(const _0x5f0dbe of _0x491d0){if(_0x5f0dbe[_0x4230b4(0x212)]?.['createdAt']){const _0x4285c1=new Date(_0x5f0dbe[_0x4230b4(0x212)][_0x4230b4(0x1af)])[_0x4230b4(0x1a1)](),_0xf320f3=_0x5f0dbe['lastAttempt'][_0x4230b4(0x11f)]?new Date(_0x5f0dbe[_0x4230b4(0x212)][_0x4230b4(0x11f)])[_0x4230b4(0x1a1)]():Date[_0x4230b4(0x237)](),_0x55838b=_0x5f0dbe[_0x4230b4(0x1cb)]?.[_0x4230b4(0xf9)]||'(unknown)';!_0x4d4c6d['has'](_0x55838b)&&_0x4d4c6d[_0x4230b4(0x277)](_0x55838b,[]),_0x4d4c6d[_0x4230b4(0x1d4)](_0x55838b)['push']({'session':_0x5f0dbe,'startTime':_0x4285c1,'endTime':_0xf320f3,'duration':_0xf320f3-_0x4285c1}),_0x2265fe=Math[_0x4230b4(0x23a)](_0x2265fe,_0x4285c1),_0x5ef098=Math[_0x4230b4(0xf7)](_0x5ef098,_0xf320f3);}}if(_0x4d4c6d['size']===0x0)return _0x4230b4(0x19d);const _0x35284c=process[_0x4230b4(0x1f6)]['columns']||0x78,_0x1af0b9=0x1e,_0x44ec40=0x32,_0x331d5e=0x4,_0x186c58=Math[_0x4230b4(0x23a)](_0x44ec40,Math[_0x4230b4(0xf7)](_0x1af0b9,Math['floor'](_0x35284c*0.3))),_0x409a9c=_0x35284c-_0x186c58-TIMELINE_CONFIG[_0x4230b4(0xf5)]-0x3-_0x331d5e,_0x2e0d7b=_0x5ef098-_0x2265fe,_0x60003e=_0x2e0d7b/_0x186c58,_0x1e3c4b=renderTimeAxis({'startTime':_0x2265fe,'endTime':_0x5ef098,'durationMs':_0x2e0d7b,'msPerChar':_0x60003e},_0x186c58),_0x1d7e21=[];for(const _0x266ab9 of _0x4d4c6d[_0x4230b4(0x219)]()){_0x1d7e21[_0x4230b4(0x23c)](..._0x266ab9);}_0x1d7e21['sort']((_0x4c09b2,_0x27110a)=>_0x27110a[_0x4230b4(0x21f)]-_0x4c09b2[_0x4230b4(0x21f)]);const _0x439d63=new Date(_0x2265fe),_0x3fe888=formatDate(_0x439d63),_0x9fffca=_0x331d5e+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0x409a9c,_0x56b084='\x20'[_0x4230b4(0x16d)](_0x9fffca-_0x3fe888[_0x4230b4(0x294)]),_0xa390b0=_0x56b084+a54_0x1e596b[_0x4230b4(0xe8)](_0x3fe888)+'\x20'+_0x1e3c4b;_0x159f3e[_0x4230b4(0x23c)](_0xa390b0);const _0x10659c=0x16;let _0x13dfc5=0x0;for(const _0x3d70a3 of _0x1d7e21){const _0x5b78ff=_0x3d70a3['session'][_0x4230b4(0x1cb)]?.[_0x4230b4(0xf9)]||'?',_0x4355cf=Math[_0x4230b4(0x23a)](stringWidth(_0x5b78ff),_0x10659c);_0x13dfc5=Math[_0x4230b4(0xf7)](_0x13dfc5,_0x4355cf);}for(const _0x42128e of _0x1d7e21){const {session:_0x5e5c59,startTime:_0x1cbd65,endTime:_0x30c56b,duration:_0x3371fe}=_0x42128e,_0x3b6ad3=_0x5e5c59[_0x4230b4(0x1cb)]?.['id'],_0x1ef1c3=_0x5e5c59['id'],_0x9dc6ee=_0x5e5c59['project']?.[_0x4230b4(0xf9)]||'?',_0xe1159f=_0x5e5c59[_0x4230b4(0x267)]?.[_0x4230b4(0xf9)]||'?';let _0x1e0950,_0x5d3758;if(_0x5e5c59['lastAttempt']){const _0x4c4674=_0x5e5c59[_0x4230b4(0x212)];!_0x4c4674[_0x4230b4(0x20a)]?(_0x1e0950=_0x4c4674[_0x4230b4(0x29e)]?'🛑':'🔄',_0x5d3758=_0x4c4674[_0x4230b4(0x29e)]?a54_0x1e596b[_0x4230b4(0x1f4)]:a54_0x1e596b['blue']):(_0x1e0950=_0x4c4674[_0x4230b4(0x1b0)]?'✅':'❌',_0x5d3758=_0x4c4674[_0x4230b4(0x1b0)]?a54_0x1e596b[_0x4230b4(0xfb)]:a54_0x1e596b[_0x4230b4(0x227)]);}else _0x1e0950='⏳',_0x5d3758=a54_0x1e596b['dim'];const _0x3ed7ae='#'+_0x1ef1c3,_0x249fd3=_0x3b6ad3?hyperlink(_0x3ed7ae,getWorkflowSessionUrl(_0x5c563b,_0x3b6ad3,_0x1ef1c3)):_0x3ed7ae;let _0x370dc1=_0x9dc6ee;stringWidth(_0x9dc6ee)>_0x10659c&&(_0x370dc1=_0x9dc6ee[_0x4230b4(0x12b)](0x0,_0x10659c-0x1)+'…');const _0x23c3f5=a54_0x1e596b[_0x4230b4(0xe8)](_0x370dc1),_0x209207=stringWidth(_0x370dc1),_0x4417f2='\x20'[_0x4230b4(0x16d)](_0x13dfc5-stringWidth(_0x370dc1)+0x2),_0xeb853c='('+formatElapsed(_0x3371fe)+')',_0x403c92=stringWidth(_0xeb853c),_0x47cb74=stringWidth(_0x3ed7ae),_0x265aa1=_0x47cb74+0x1+_0x209207+_0x4417f2[_0x4230b4(0x294)],_0x2864f0=_0x409a9c-_0x265aa1-_0x403c92-0x1-0x8;let _0x22044a=_0xe1159f;stringWidth(_0x22044a)>_0x2864f0&&(_0x22044a=_0x22044a[_0x4230b4(0x12b)](0x0,_0x2864f0-0x1)+'…');const _0x49a2ce=_0x249fd3+'\x20'+_0x23c3f5+_0x4417f2+_0x22044a,_0x127556=stringWidth(_0x49a2ce),_0x1e8618=_0x409a9c-_0x127556-_0x403c92,_0x5fe5f1=_0x49a2ce+'\x20'[_0x4230b4(0x16d)](Math[_0x4230b4(0xf7)](0x1,_0x1e8618))+a54_0x1e596b[_0x4230b4(0xe8)](_0xeb853c),_0x475c77=Math[_0x4230b4(0x20e)]((_0x1cbd65-_0x2265fe)/_0x60003e),_0x3ca9bb=Math[_0x4230b4(0x20e)]((_0x30c56b-_0x2265fe)/_0x60003e),_0x11c260=Math['max'](_0x475c77+0x1,_0x3ca9bb),_0x57b80a=new Array(_0x186c58)['fill']('\x20');for(let _0x1e0f9c=_0x475c77;_0x1e0f9c<Math[_0x4230b4(0x23a)](_0x11c260,_0x186c58);_0x1e0f9c++){_0x57b80a[_0x1e0f9c]='─';}const _0x46718b=_0x57b80a[_0x4230b4(0x1bc)](_0xdcf08e=>_0xdcf08e==='\x20'?'\x20':_0x5d3758(_0xdcf08e))[_0x4230b4(0x258)]('');_0x159f3e[_0x4230b4(0x23c)](_0x1e0950+'\x20'+_0x5fe5f1+'│'+_0x46718b+'│');}return _0x159f3e[_0x4230b4(0x258)]('\x0a');}async[a54_0x3a8226(0x1e9)](_0x284b6b,_0x1f35d1,_0x131c9b){const _0x1d8a28=a54_0x3a8226,{options:_0x1f3df7,tdx:_0xd07563}=_0x1f35d1,_0x4cd32f=_0x1f3df7['site'],{timelineRows:_0x16b80d,timeAxisHeader:_0x44c247}=this[_0x1d8a28(0x1ee)](_0x284b6b,_0x4cd32f),_0x18c593=_0x16b80d['filter'](_0x56def0=>_0x56def0[_0x1d8a28(0x1e2)]);if(_0x18c593[_0x1d8a28(0x294)]===0x0){const _0x2eda33=this['renderSessionsTimeline'](_0x284b6b,_0x4cd32f);console['log'](_0x2eda33);!_0x131c9b&&(console[_0x1d8a28(0x26f)](''),console['error'](a54_0x1e596b[_0x1d8a28(0xe8)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console['error'](a54_0x1e596b[_0x1d8a28(0xe8)](_0x1d8a28(0x13f))+'or'+a54_0x1e596b[_0x1d8a28(0xe8)](_0x1d8a28(0x228))));return;}_0x44c247&&console[_0x1d8a28(0x204)](_0x44c247);const _0x4e6bc9=_0x16b80d[_0x1d8a28(0x242)](_0x44030b=>_0x44030b[_0x1d8a28(0x1e2)])[_0x1d8a28(0x1bc)](_0x5f135f=>({'title':_0x5f135f[_0x1d8a28(0x147)],'value':_0x5f135f[_0x1d8a28(0x1e2)]})),_0x52f479=process[_0x1d8a28(0x1f6)]['rows']||0x3c,_0x36545a=Math['max'](0x28,Math[_0x1d8a28(0x20e)](_0x52f479*0x2/0x3)),_0x25961d=await a54_0x89dadd({'type':_0x1d8a28(0x119),'name':_0x1d8a28(0x1e2),'message':_0x1d8a28(0x1cf),'choices':_0x4e6bc9,'initial':-0x1,'limit':_0x36545a,'clearFirst':!![],'fallback':{'title':_0x1d8a28(0x1c3),'value':null},'suggest':(_0x50af13,_0x49149d)=>{const _0x4f432a=_0x1d8a28;if(!_0x50af13)return Promise[_0x4f432a(0x15b)](_0x49149d);const _0x5a8ce3=_0x49149d['filter'](_0x3866db=>{const _0x516cce=_0x4f432a,_0x122f81=_0x3866db;return _0x122f81[_0x516cce(0xee)][_0x516cce(0x1ad)]()[_0x516cce(0x127)](_0x50af13['toLowerCase']());});return Promise[_0x4f432a(0x15b)](_0x5a8ce3);}}),_0x54b74f=()=>{const _0x40d3b1=_0x1d8a28;process[_0x40d3b1(0x1f6)][_0x40d3b1(0x1a7)](_0x40d3b1(0x1d5)),process[_0x40d3b1(0x1f6)]['write'](_0x40d3b1(0x1d5)),process[_0x40d3b1(0x1f6)][_0x40d3b1(0x1a7)](_0x40d3b1(0x1d5));},_0x575e74=_0x25961d&&_0x25961d[_0x1d8a28(0x1e2)]&&_0x25961d['attemptId']!==null&&_0x25961d[_0x1d8a28(0x1e2)][_0x1d8a28(0x190)]()!=='';if(!_0x575e74){_0x54b74f(),console['log'](a54_0x1e596b[_0x1d8a28(0xe8)]('Cancelled'));return;}_0x54b74f();const _0x5d9a57=_0x284b6b[_0x1d8a28(0x1da)](_0x2ad36c=>_0x2ad36c[_0x1d8a28(0x212)]?.['id']===_0x25961d[_0x1d8a28(0x1e2)]);if(_0x5d9a57){const _0x304733=_0x5d9a57[_0x1d8a28(0x1cb)]?.[_0x1d8a28(0xf9)]||'?',_0x2b42c3=_0x5d9a57[_0x1d8a28(0x267)]?.[_0x1d8a28(0xf9)]||'?';console[_0x1d8a28(0x204)](_0x1d8a28(0x183)+a54_0x1e596b[_0x1d8a28(0xe8)](_0x304733)+_0x1d8a28(0x1c7)+a54_0x1e596b[_0x1d8a28(0xe8)](_0x2b42c3));}const _0x500dfe=new WorkflowTimelineCommand();await _0x500dfe[_0x1d8a28(0x1cd)]({'args':[],'options':{..._0x1f3df7,'attemptId':_0x25961d[_0x1d8a28(0x1e2)]},'tdx':_0xd07563});}[a54_0x3a8226(0x1ee)](_0x211548,_0x59f9c6){const _0x197e5d=a54_0x3a8226,_0x10dee7=new Map();for(const _0x3baa95 of _0x211548){_0x3baa95['id']&&_0x3baa95['lastAttempt']?.['id']&&_0x10dee7['set'](_0x3baa95['id'],_0x3baa95[_0x197e5d(0x212)]['id']);}const _0x51158b=[];let _0x28dac9='';const _0x45b519=this[_0x197e5d(0x19b)](_0x211548,_0x59f9c6),_0x43079c=_0x45b519[_0x197e5d(0x10c)]('\x0a');for(const _0x5987f7 of _0x43079c){if(_0x5987f7[_0x197e5d(0x13e)](_0x197e5d(0x18d))||_0x5987f7[_0x197e5d(0x113)](/^\s+\d{4}-\d{2}-\d{2}/))_0x28dac9=_0x5987f7;else{if(_0x5987f7['match'](/^[✅❌🔄🛑⏳]/)){const _0x4f1d5e=_0x5987f7[_0x197e5d(0x113)](/#(\d+)/),_0x28313b=_0x4f1d5e?_0x4f1d5e[0x1]:null,_0x20c79b=_0x28313b?_0x10dee7[_0x197e5d(0x1d4)](_0x28313b)||null:null,_0x1e264a=_0x211548[_0x197e5d(0x1da)](_0x2b48cc=>_0x2b48cc['id']===_0x28313b),_0x357225=_0x1e264a?.[_0x197e5d(0x1cb)]?.[_0x197e5d(0xf9)]||'';_0x51158b[_0x197e5d(0x23c)]({'displayLine':_0x5987f7,'attemptId':_0x20c79b,'projectName':_0x357225});}}}return{'timelineRows':_0x51158b,'timeAxisHeader':_0x28dac9};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1e3);['description']='List\x20workflow\x20attempts';async['execute'](_0x386d52){const _0x1c70e3=a54_0x3a8226,{options:_0x4a111b,args:_0x423549,tdx:_0x4fbbee}=_0x386d52,_0x5973cc=this[_0x1c70e3(0x1ef)](_0x423549,_0x4a111b);if(!_0x5973cc)return 0x1;const {projectName:_0x2d72d0,workflowName:_0x5c2954}=_0x5973cc,_0x159b36=_0x4a111b[_0x1c70e3(0x114)];if(_0x4a111b['verbose']){if(_0x2d72d0&&_0x5c2954)console[_0x1c70e3(0x26f)](_0x1c70e3(0x176)+_0x2d72d0+'.'+_0x5c2954);else _0x2d72d0&&console[_0x1c70e3(0x26f)](_0x1c70e3(0x20d)+_0x2d72d0);_0x159b36&&console[_0x1c70e3(0x26f)](_0x1c70e3(0x17d));}const _0x10d114=await withSpinner(_0x1c70e3(0x14b),()=>_0x4fbbee[_0x1c70e3(0x267)][_0x1c70e3(0x244)]({'projectName':_0x2d72d0,'workflowName':_0x5c2954,'includeRetried':_0x159b36,'limit':_0x4a111b[_0x1c70e3(0x171)]}),{'verbose':_0x4a111b[_0x1c70e3(0x272)]}),_0xb359c8=_0x10d114[_0x1c70e3(0x1ba)],_0x1b1a8f=_0x4a111b[_0x1c70e3(0x171)]||0x64,_0xc5621d=_0xb359c8[_0x1c70e3(0x294)]>=_0x1b1a8f?a54_0x1e596b[_0x1c70e3(0xe8)](_0x1c70e3(0x214)):'';console[_0x1c70e3(0x26f)](_0x1c70e3(0x151)+_0xb359c8[_0x1c70e3(0x294)]+_0x1c70e3(0xf0)+(_0xb359c8[_0x1c70e3(0x294)]!==0x1?'s':'')+_0xc5621d);if(_0x4a111b['format']==='json'||_0x4a111b['format']===_0x1c70e3(0x1c4)||_0x4a111b[_0x1c70e3(0x275)]===_0x1c70e3(0x1a4))await handleSDKOutput(_0xb359c8,_0x4a111b);else{if(_0xb359c8[_0x1c70e3(0x294)]===0x0){if(_0x2d72d0&&_0x5c2954)console['log'](_0x1c70e3(0x28b)+_0x2d72d0+'.'+_0x5c2954);else _0x2d72d0?console[_0x1c70e3(0x204)](_0x1c70e3(0x2a8)+_0x2d72d0):console[_0x1c70e3(0x204)](_0x1c70e3(0x265));}else{const _0xd8cb19=_0x4a111b[_0x1c70e3(0x241)],_0x3391f4=_0xb359c8[_0x1c70e3(0x1bc)](_0x3b8758=>{const _0x3e4dd3=_0x1c70e3,_0x3ef7c9=a54_0x1e596b['dim']('#'+_0x3b8758['id']),_0x4d6fae=_0x3b8758[_0x3e4dd3(0x1cb)]?.['id'],_0x177252=_0x3b8758[_0x3e4dd3(0x195)]||_0x3b8758[_0x3e4dd3(0x1ff)],_0x3d3bb3=_0x4d6fae&&_0x177252?hyperlink(_0x3ef7c9,getWorkflowAttemptUrl(_0xd8cb19,_0x4d6fae,_0x177252,_0x3b8758['id'])):_0x3ef7c9,{icon:_0x2478c6,text:_0x46f291}=getAttemptStatusDisplay(_0x3b8758),_0x4a917d=(_0x3b8758[_0x3e4dd3(0x1cb)]?.['name']||'?')+'.'+(_0x3b8758['workflow']?.[_0x3e4dd3(0xf9)]||'?'),_0xce8a21=_0x3b8758[_0x3e4dd3(0x194)]?a54_0x1e596b[_0x3e4dd3(0xe8)](_0x3b8758[_0x3e4dd3(0x194)]):'';return(_0x3d3bb3+'\x20'+_0x2478c6+(_0x46f291?'\x20'+_0x46f291:'')+'\x20'+_0x4a917d+'\x20'+_0xce8a21)[_0x3e4dd3(0x285)]();});await writeOutput(_0x3391f4[_0x1c70e3(0x258)]('\x0a'),_0x4a111b['output'],_0x1c70e3(0x110));}}return 0x0;}}function a54_0x5eae(){const _0x2767fc=['newProjectId','padStart','⚠\x20Showing\x20first\x20','key','sessionId','\x20\x20Attempt\x20ID:\x20','Starting\x20workflow\x20run...','\x20has\x20no\x20attempts','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','log','workflow:logs','white','\x0aPush\x20these\x20changes?','LABEL_MIN_SPACING','end','done','download','workflow:push','Filter:\x20project=','floor','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20session','\x0aDry\x20run\x20-\x20no\x20files\x20written','lastAttempt','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','\x20(use\x20--limit\x20to\x20show\x20more)','.\x20Expected\x20format:\x20KEY=VALUE','\x0a✔\x20Already\x20up\x20to\x20date','\x20of\x20','start','values','Loading\x20sessions...','executeCloneProject','splice','\x20\x20Project:\x20','Killing\x20attempt...','startTime','summary','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Error:\x20Invalid\x20parameter\x20format:\x20','Key:\x20','\x20tasks','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','red','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20Revision:\x20','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','basename','columns','workflowProject','→\x20Project:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Listing\x20workflows...','setSecrets','output','\x20unchanged','localeCompare','4474419zDaktN','Setting\x20','now','🔄\x20','indexOf','min','status','push','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Error:','index','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','site','filter','text','attempts','round','MAX_LABEL_COUNT','sys','✔\x20Pull\x20complete','projectName','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','Deleting\x20project\x20','nextRunTime','state','Using\x20attempt\x20','path','Validation:\x20skipped','/attempt/','buildTimelineData','revision:\x20','fromTask','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','workflows','Fetching\x20log\x20files...','join','attempt','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','every','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','List\x20all\x20workflow\x20projects','\x20schedule','isNewProject','Project\x20directory:\x20','\x0a⚠\x20Project\x20\x22','MAX_TIMELINE_WIDTH','List\x20workflow\x20execution\x20sessions','✔\x20Schedule\x20#','No\x20attempts\x20found','Auto-selected\x20latest\x20session:\x20','workflow','Analyzing\x20changes...','Task\x20name:\x20','\x20\x20Workflow:\x20','Show\x20logs\x20for\x20a\x20workflow\x20attempt','Error:\x20','task','Source\x20directory\x20is\x20required','error','Source:\x20','relative','verbose','Error:\x20Secret\x20key\x20is\x20required','Error:\x20Attempt\x20ID\x20is\x20required','format','workflow:projects','set','No\x20log\x20files\x20found\x20for\x20this\x20attempt','Resolving\x20project\x20\x27','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','description','MAX_TASKS_DISPLAY','Select\x20a\x20task\x20to\x20view\x20logs:','\x0aDry\x20run\x20-\x20nothing\x20pushed','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','pending','retryAttempt','Select\x20a\x20workflow\x20to\x20run','Parameters:\x20','No\x20log\x20content\x20found','trimEnd','\x20\x20Target:\x20','No\x20sessions\x20found\x20in\x20project:\x20','follow','icon','workflow:secrets:delete','No\x20attempts\x20found\x20for:\x20','substring','fs/promises','Writing\x20files...','✔\x20Downloaded\x20','hasChanges','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','getFullYear','logFiles','length','MIN_LABEL_COUNT','workflow:run','projects','\x0aError:','message','group_error','attempt:','replace','✔\x20Workflow\x20run\x20started','cancelRequested','Listing\x20schedules...','isDirectory','\x27\x20from\x20project\x20\x27','Target\x20directory:\x20','planned','workflow:timeline','→\x20New\x20project:\x20','\x20\x20Session\x20context\x20set\x20to:\x20','existingProjectId','No\x20attempts\x20found\x20in\x20project:\x20','cwd','6568704ymVtWb','No\x20sessions\x20found','unknown','dim','stringify','Downloading\x20project\x20','732664OGfkZA','Error:\x20Project\x20name\x20is\x20required','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','title','workflow:schedules','\x20attempt','\x20project','getHours','Files\x20to\x20upload:\x20','Analyzing\x20project...','GUTTER','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','max','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','green','No\x20workflow\x20sessions\x20found','\x20is\x20not\x20a\x20directory','\x20-\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','fullName','deleted','\x20to\x20see\x20detailed\x20logs','Enabling\x20schedule\x20#','Source\x20directory:\x20','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','cyan','283272HiiwlA','\x22\x20to\x20new\x20project\x20\x22','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','workflowName','Pulling\x20project\x20','split','json','Retrying\x20session...','Resume\x20from:\x20','list','sourceProjectName','Params:\x20','match','includeRetried','tdx.json','Updating\x20','/app/workflows/','No\x20workflow\x20tdx.json\x20found','autocomplete','disableSchedule','\x0aDry\x20run\x20-\x20no\x20project\x20created','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','sourceDir','28HPZCBV','finishedAt','1954734FlZRIw','changes','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','\x20disabled\x20(','Session\x20not\x20found:\x20','\x20\x20Location:\x20','\x20from\x20session\x20','includes','session','\x20\x20Changes:\x20','prepareCloneProject','slice','✔\x20Workflow\x20project\x20context\x20cleared.','Start\x20a\x20workflow\x20run','\x0aUpdate\x20existing\x20project\x20\x22','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x0aApply\x20these\x20changes?','params','delete','\x0a✔\x20Attempt\x20complete','readFile','\x27\x20has\x20been\x20set\x20for\x20project\x20\x27','select','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','enableSchedule','Listing\x20secrets...','Pushing\x20project...','sessions','Session\x20time:\x20','startsWith','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','new','---\x20','/sessions/','modified','getMinutes','toLocaleString','✔\x20Project\x20updated','displayLine','updatedAt','\x20deleted','(unknown)','Listing\x20workflow\x20attempts...','💡\x20Tip:\x20Use\x20','-\x20nothing\x20pushed','taskName','Getting\x20attempt\x20details...','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','✔\x20Found\x20','workflow:download','pollTimeline','Latest\x20session\x20has\x20no\x20attempt','resolveProjectId','retryAttemptName','getDate','Error:\x20Invalid\x20JSON\x20in\x20--params','fileSize','\x20task','resolve','\x22?\x20This\x20cannot\x20be\x20undone.','msPerChar','projectId','window','requireProject','type','Workflow:\x20','List\x20workflows','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','showWorkflowConsoleUrl','Session\x20','Pattern:\x20','workflow:workflows','Project\x20filter:\x20','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','\x20workflow','repeat','Pull\x20workflow\x20project\x20to\x20local\x20folder','\x20\x20Source:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','limit','📅\x20#','Retry\x20a\x20session\x20or\x20attempt','No\x20workflows\x20found\x20in\x20project:\x20','resolveProjectDir','Filter:\x20','targetDir','tasks','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Console:\x20','workflow:attempt','\x20(disabled)','Include\x20retried:\x20yes','Dry\x20run:\x20yes','workflow:clone','Show\x20specific\x20attempt\x20details','✔\x20Showing\x20','diff','Project:\x20','New\x20project\x20name:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','ICON_WIDTH','Including\x20subtasks:\x20yes','Schedule\x20ID\x20is\x20required','-\x20no\x20files\x20written','\x20\x20Session\x20ID:\x20','No\x20projects\x20match\x20pattern:\x20','running','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','startedAt','Downloading\x20logs...','trim','workflow:schedule:disable','workflow:schedule:enable','MAX_POLL_ITERATIONS','sessionTime','session_id','newProjectName','duration','\x20logs','targetExists','Loading\x20session...','renderSessionsTimeline','✔\x20Pushed\x20','No\x20sessions\x20with\x20timing\x20information','Select\x20a\x20session\x20to\x20view\x20timeline:','✔\x20Secret\x20\x27','✔\x20Workflow\x20project\x20set\x20to:\x20','getTime','revision','\x20\x20Next\x20run:\x20','table','stat','Usage:\x20workflow:delete\x20<project-name-or-id>','write','metadata','executePushProject','fill','yes','all','toLowerCase','dryRun','createdAt','success','✔\x20Clone\x20complete','canceling','Warning:','Project\x20name\x20is\x20required','applyPullProject','Enable\x20a\x20workflow\x20schedule','Attempt:\x20','Disabling\x20schedule\x20#','3540925CGCvTX','data','Cancelled','map','total','Revision:\x20','No\x20workflows\x20found','Invalid\x20format:\x20','Attempt\x20ID:\x20','\x20\x20Project\x20ID:\x20','No\x20matching\x20sessions\x20found','jsonl','No\x20schedules\x20found','getMonth',',\x20Workflow:\x20','sort','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','retrySession','project','Target:\x20','execute','workflow:upload','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','workflow:tasks','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Pushing\x20workflow\x20project...','Setting\x20secret...','get','\x1b[1A\x1b[2K','deleteSecret','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','✔\x20Project:\x20','No\x20sessions\x20found\x20for:\x20','find','\x20\x20New\x20attempt\x20ID:\x20','Disable\x20a\x20workflow\x20schedule','POLL_INTERVAL_MS','skipValidation','blue','parse','Show\x20tasks\x20for\x20an\x20attempt','attemptId','workflow:attempts','Status:\x20','Expected\x20format:\x20--param\x20key=value','durationMs','\x20(system)','isTTY','navigateSessionsInteractive','workflow:secrets:set','Failed\x20to\x20fetch\x20attempt\x20data','2olbeqX','\x20new','generateSessionTimelineRows','parseProjectWorkflowPattern','resolveProject','disabledAt','renderTimeline','16995789OcUAtJ','yellow','workflow:sessions','stdout','renderSingleTimeline','\x20modified','...','keys'];a54_0x5eae=function(){return _0x2767fc;};return a54_0x5eae();}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x17b);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x180);async[a54_0x3a8226(0x1cd)](_0x223fa1){const _0x21a2d6=a54_0x3a8226,{options:_0x13e3f7,args:_0x3917bc,tdx:_0x580d41}=_0x223fa1,_0x2e9b1e=_0x3917bc[0x0];if(!_0x2e9b1e)return console['error'](_0x21a2d6(0x274)),0x1;_0x13e3f7['verbose']&&console[_0x21a2d6(0x26f)]('Attempt\x20ID:\x20'+_0x2e9b1e);const _0x5e0472=await withSpinner(_0x21a2d6(0x14f),()=>_0x580d41[_0x21a2d6(0x267)][_0x21a2d6(0x259)](_0x2e9b1e),{'verbose':_0x13e3f7[_0x21a2d6(0x272)]}),_0x30e7c4=_0x5e0472[_0x21a2d6(0x1ba)];let _0x26b1e9;!_0x30e7c4[_0x21a2d6(0x20a)]?_0x26b1e9=_0x30e7c4[_0x21a2d6(0x29e)]?_0x21a2d6(0x1b2):_0x21a2d6(0x18c):_0x26b1e9=_0x30e7c4[_0x21a2d6(0x1b0)]?'success':_0x21a2d6(0x26f);let _0x4cae02;if(_0x30e7c4[_0x21a2d6(0x1af)]&&_0x30e7c4[_0x21a2d6(0x11f)]){const _0x5729ec=new Date(_0x30e7c4[_0x21a2d6(0x1af)])[_0x21a2d6(0x1a1)](),_0x3c6382=new Date(_0x30e7c4[_0x21a2d6(0x11f)])[_0x21a2d6(0x1a1)]();_0x4cae02=Math[_0x21a2d6(0x245)]((_0x3c6382-_0x5729ec)/0x3e8);}const _0x298005={'attempt_id':_0x30e7c4['id'],'status':_0x26b1e9,..._0x30e7c4[_0x21a2d6(0x23f)]!==undefined&&{'index':_0x30e7c4[_0x21a2d6(0x23f)]},..._0x30e7c4['project']&&{'project':_0x30e7c4[_0x21a2d6(0x1cb)][_0x21a2d6(0xf9)]},..._0x30e7c4['workflow']&&{'workflow':_0x30e7c4['workflow'][_0x21a2d6(0xf9)]},..._0x30e7c4[_0x21a2d6(0x1ff)]&&{'session_id':_0x30e7c4[_0x21a2d6(0x1ff)]},..._0x30e7c4[_0x21a2d6(0x194)]&&{'session_time':_0x30e7c4[_0x21a2d6(0x194)]},..._0x30e7c4[_0x21a2d6(0x156)]&&{'retry_attempt':_0x30e7c4[_0x21a2d6(0x156)]},..._0x4cae02!==undefined&&{'duration_sec':_0x4cae02},..._0x30e7c4[_0x21a2d6(0x1af)]&&{'created_at':_0x30e7c4[_0x21a2d6(0x1af)]},..._0x30e7c4[_0x21a2d6(0x11f)]&&{'finished_at':_0x30e7c4['finishedAt']},...Object['keys'](_0x30e7c4['params'])['length']>0x0&&{'params':_0x30e7c4[_0x21a2d6(0x131)]}};return await handleSingleObjectOutput(_0x298005,_0x13e3f7),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1d0);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1e1);async['execute'](_0x1e28d5){const _0x5f419e=a54_0x3a8226,{options:_0x38da9a,args:_0x5dde84,tdx:_0x1a37d8}=_0x1e28d5,_0x1a93fd=_0x5dde84[0x0];if(!_0x1a93fd)return console[_0x5f419e(0x26f)](_0x5f419e(0x274)),0x1;const _0x3b78b9=_0x38da9a['includeSubtasks'];_0x38da9a['verbose']&&(console[_0x5f419e(0x26f)](_0x5f419e(0x1c1)+_0x1a93fd),_0x3b78b9&&console[_0x5f419e(0x26f)](_0x5f419e(0x187)));const _0x206eca=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x1a37d8[_0x5f419e(0x267)][_0x5f419e(0x178)](_0x1a93fd,_0x3b78b9||![]),{'verbose':_0x38da9a[_0x5f419e(0x272)]}),_0x275d53=_0x206eca[_0x5f419e(0x1ba)];return console[_0x5f419e(0x26f)](_0x5f419e(0x151)+_0x275d53[_0x5f419e(0x294)]+_0x5f419e(0x15a)+(_0x275d53[_0x5f419e(0x294)]!==0x1?'s':'')),await handleSDKOutput(_0x275d53,_0x38da9a),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x205);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x26b);async[a54_0x3a8226(0x1cd)](_0x22ce77){const _0x39417e=a54_0x3a8226,{options:_0x342ea8,args:_0x5ea0ae,tdx:_0x3e9584}=_0x22ce77,_0x311d05=_0x5ea0ae[0x0];let _0xaec270=_0x5ea0ae[0x1];if(!_0x311d05)return console[_0x39417e(0x26f)](_0x39417e(0x274)),0x1;_0x342ea8[_0x39417e(0x272)]&&(console['error']('Attempt\x20ID:\x20'+_0x311d05),_0xaec270&&console['error'](_0x39417e(0x269)+_0xaec270));const _0x3495c9=await withSpinner(_0x39417e(0x257),()=>_0x3e9584['workflow'][_0x39417e(0x293)](_0x311d05,_0xaec270),{'verbose':_0x342ea8['verbose']}),_0x275b99=_0x3495c9['data'];if(_0x275b99[_0x39417e(0x294)]===0x0)return console[_0x39417e(0x26f)](_0x39417e(0x278)),0x0;if(!_0xaec270&&(_0x342ea8['json']||_0x342ea8['format']))return await handleSDKOutput(_0x275b99,_0x342ea8),0x0;if(!_0xaec270){const _0x32f3d1=_0x275b99[_0x39417e(0x1bc)](_0x442029=>({'title':_0x442029[_0x39417e(0x14e)]+'\x20('+formatBytes(_0x442029[_0x39417e(0x159)])+')','value':_0x442029['taskName']})),_0x53932c=await a54_0x89dadd({'type':_0x39417e(0x136),'name':_0x39417e(0x26d),'message':_0x39417e(0x27d),'choices':_0x32f3d1});if(!_0x53932c[_0x39417e(0x26d)])return console[_0x39417e(0x26f)](_0x39417e(0x1bb)),0x0;_0xaec270=_0x53932c[_0x39417e(0x26d)];}const _0x3c3ec5=await withSpinner(_0x39417e(0x18f),()=>_0x3e9584['workflow']['logs'](_0x311d05,_0xaec270),{'verbose':_0x342ea8[_0x39417e(0x272)]}),_0x4924f2=_0x3c3ec5[_0x39417e(0x1ba)];return _0x4924f2?console['log'](_0x4924f2):console[_0x39417e(0x26f)](_0x39417e(0x284)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:kill';['description']='Kill\x20a\x20running\x20attempt';async[a54_0x3a8226(0x1cd)](_0x4784c0){const _0x2428bc=a54_0x3a8226,{options:_0x3118d4,args:_0x365d91,tdx:_0x3325b8}=_0x4784c0,_0x4f8404=_0x365d91[0x0];if(!_0x4f8404)return console['error'](_0x2428bc(0x274)),0x1;const _0x305ffb=_0x3118d4['reason'];_0x3118d4['verbose']&&(console[_0x2428bc(0x26f)]('Attempt\x20ID:\x20'+_0x4f8404),_0x305ffb&&console[_0x2428bc(0x26f)]('Reason:\x20'+_0x305ffb));if(!_0x3118d4['yes']){if(!isInteractive())return console[_0x2428bc(0x26f)](a54_0x1e596b['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x1e596b[_0x2428bc(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x56db1a=await confirmKey(_0x2428bc(0x1d1)+_0x4f8404+'?');if(!_0x56db1a)return console[_0x2428bc(0x26f)](a54_0x1e596b[_0x2428bc(0x1f4)](_0x2428bc(0x1bb))),0x1;}const _0x3eb5ed=await withSpinner(_0x2428bc(0x21e),()=>_0x3325b8['workflow']['kill'](_0x4f8404,_0x305ffb),{'verbose':_0x3118d4['verbose']}),_0x1f3dd2=_0x3eb5ed[_0x2428bc(0x1ba)];return console[_0x2428bc(0x26f)]('✔\x20'+_0x1f3dd2),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:retry';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x173);async[a54_0x3a8226(0x1cd)](_0x2d5d8b){const _0x3582ec=a54_0x3a8226,{options:_0x49c2e8,args:_0x2c06ee,tdx:_0x18ef56}=_0x2d5d8b,_0x27773c=_0x2c06ee[0x0];if(!_0x27773c)return console[_0x3582ec(0x26f)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3582ec(0x26f)](_0x3582ec(0x11c)),0x1;let _0x1a0771=![],_0x48ab51=_0x27773c;if(_0x27773c[_0x3582ec(0x13e)]('session:'))_0x1a0771=!![],_0x48ab51=_0x27773c['substring'](0x8);else{if(_0x27773c[_0x3582ec(0x13e)](_0x3582ec(0x29b)))_0x1a0771=![],_0x48ab51=_0x27773c[_0x3582ec(0x28c)](0x8);else return console[_0x3582ec(0x26f)](_0x3582ec(0xf8)),console[_0x3582ec(0x26f)](_0x3582ec(0x11c)),0x1;}const _0x4537a7=_0x49c2e8[_0x3582ec(0x254)],_0x130b23=_0x49c2e8['resumeFrom'],_0x482cfa=_0x49c2e8[_0x3582ec(0x131)],_0x3df70b=_0x49c2e8['force'];_0x49c2e8[_0x3582ec(0x272)]&&(console[_0x3582ec(0x26f)](_0x3582ec(0x1cc)+(_0x1a0771?_0x3582ec(0x128):_0x3582ec(0x259))+'\x20'+_0x48ab51),_0x4537a7&&console['error']('From\x20task:\x20'+_0x4537a7),_0x130b23&&console[_0x3582ec(0x26f)](_0x3582ec(0x10f)+_0x130b23),_0x482cfa&&console[_0x3582ec(0x26f)](_0x3582ec(0x112)+_0x482cfa),_0x3df70b&&console[_0x3582ec(0x26f)]('Force:\x20yes'));let _0x5daf0b;if(_0x482cfa)try{if(_0x482cfa[_0x3582ec(0x13e)]('@')){const _0x2ac93a=await import(_0x3582ec(0x28d)),_0x3a7cdc=_0x482cfa[_0x3582ec(0x28c)](0x1),_0x17a507=await _0x2ac93a[_0x3582ec(0x134)](_0x3a7cdc,'utf-8');_0x5daf0b=JSON[_0x3582ec(0x1e0)](_0x17a507);}else _0x5daf0b=JSON[_0x3582ec(0x1e0)](_0x482cfa);}catch{return console['error'](_0x3582ec(0x158)),0x1;}if(!_0x49c2e8[_0x3582ec(0x1ab)]){if(!isInteractive())return console[_0x3582ec(0x26f)](a54_0x1e596b[_0x3582ec(0x227)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3582ec(0x26f)](a54_0x1e596b[_0x3582ec(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x14d83d=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x1a0771?'session':_0x3582ec(0x259))+'\x20'+_0x48ab51+'?');if(!_0x14d83d)return console[_0x3582ec(0x26f)](a54_0x1e596b['yellow'](_0x3582ec(0x1bb))),0x1;}let _0x9d783a;_0x1a0771?_0x9d783a=await withSpinner(_0x3582ec(0x10e),()=>_0x18ef56[_0x3582ec(0x267)][_0x3582ec(0x1ca)](_0x48ab51,{'fromTask':_0x4537a7,'retryParams':_0x5daf0b}),{'verbose':_0x49c2e8[_0x3582ec(0x272)]}):_0x9d783a=await withSpinner('Retrying\x20attempt...',()=>_0x18ef56[_0x3582ec(0x267)][_0x3582ec(0x281)](_0x48ab51,{'resumeFrom':_0x130b23,'retryParams':_0x5daf0b,'force':_0x3df70b}),{'verbose':_0x49c2e8[_0x3582ec(0x272)]});const _0xb724d6=_0x9d783a[_0x3582ec(0x1ba)];return console[_0x3582ec(0x26f)]('✔\x20Retry\x20started'),console[_0x3582ec(0x26f)](_0x3582ec(0x1db)+_0xb724d6['attemptId']),console[_0x3582ec(0x26f)](_0x3582ec(0x18a)+_0xb724d6['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x3a8226(0x296);['description']=a54_0x3a8226(0x12d);async[a54_0x3a8226(0x1cd)](_0x32375f){const _0x476459=a54_0x3a8226,{options:_0x293de3,args:_0x5e48a3,tdx:_0x35cb2c}=_0x32375f;let _0x4b836f=_0x5e48a3[0x0];if(!_0x4b836f){const _0x43f4dc=this[_0x476459(0x1f0)]([],_0x293de3),_0x440198=await withSpinner('Loading\x20workflows...',()=>_0x35cb2c[_0x476459(0x267)][_0x476459(0x256)](_0x43f4dc,{'limit':_0x293de3[_0x476459(0x171)]}),{'verbose':_0x293de3[_0x476459(0x272)]}),_0x1d7a44=_0x440198[_0x476459(0x1ba)];if(_0x1d7a44[_0x476459(0x294)]===0x0)return console['error'](_0x476459(0x1bf)),!_0x43f4dc&&console[_0x476459(0x26f)](a54_0x1e596b[_0x476459(0xe8)](_0x476459(0x185))),0x1;const _0x321260=_0x1d7a44[_0x476459(0x1bc)](_0x2d4ee7=>({'title':_0x2d4ee7[_0x476459(0x1cb)]?.['name']+'.'+_0x2d4ee7[_0x476459(0xf9)],'value':_0x2d4ee7['project']?.[_0x476459(0xf9)]+'.'+_0x2d4ee7[_0x476459(0xf9)],'description':_0x2d4ee7[_0x476459(0x1a2)]?_0x476459(0x253)+_0x2d4ee7[_0x476459(0x1a2)]:undefined})),_0x56becb=await a54_0x89dadd({'type':'select','name':_0x476459(0x267),'message':_0x476459(0x282),'choices':_0x321260});if(!_0x56becb[_0x476459(0x267)])return 0x1;_0x4b836f=_0x56becb[_0x476459(0x267)];}if(!_0x4b836f[_0x476459(0x127)]('.')){const _0x547013=this['resolveProject']([],_0x293de3);if(_0x547013)_0x4b836f=_0x547013+'.'+_0x4b836f;else return console['error'](a54_0x1e596b[_0x476459(0x227)]('Error:'),_0x476459(0x138)),console[_0x476459(0x26f)](a54_0x1e596b[_0x476459(0xe8)](_0x476459(0x185))),0x1;}const _0x3af332=_0x293de3['param'],_0x988825=_0x293de3['sessionTime'],_0x2a19dc={};if(_0x3af332&&Array['isArray'](_0x3af332))for(const _0xa0e28 of _0x3af332){const _0x2040a5=_0xa0e28[_0x476459(0x239)]('=');if(_0x2040a5===-0x1)return console[_0x476459(0x26f)](_0x476459(0x223)+_0xa0e28),console['error'](_0x476459(0x1e5)),0x1;const _0x5acfd9=_0xa0e28[_0x476459(0x28c)](0x0,_0x2040a5),_0x57b538=_0xa0e28['substring'](_0x2040a5+0x1);try{_0x2a19dc[_0x5acfd9]=JSON[_0x476459(0x1e0)](_0x57b538);}catch{_0x2a19dc[_0x5acfd9]=_0x57b538;}}_0x293de3[_0x476459(0x272)]&&(console['error'](_0x476459(0x162)+_0x4b836f),Object[_0x476459(0x1fa)](_0x2a19dc)[_0x476459(0x294)]>0x0&&console['error'](_0x476459(0x283)+JSON[_0x476459(0xe9)](_0x2a19dc)),_0x988825&&console[_0x476459(0x26f)](_0x476459(0x13d)+_0x988825));const _0x17e630=await withSpinner(_0x476459(0x201),()=>_0x35cb2c['workflow']['run'](_0x4b836f,_0x2a19dc,{'sessionTime':_0x988825}),{'verbose':_0x293de3['verbose']}),_0x4bd845=_0x17e630['data'];console[_0x476459(0x26f)](_0x476459(0x29d)),console[_0x476459(0x26f)](_0x476459(0x200)+_0x4bd845['id']),console['error'](_0x476459(0x18a)+_0x4bd845['sessionId']),console[_0x476459(0x26f)](_0x476459(0x21d)+_0x4bd845['project']?.[_0x476459(0xf9)]),console[_0x476459(0x26f)](_0x476459(0x26a)+_0x4bd845['workflow']?.[_0x476459(0xf9)]);if(_0x4bd845[_0x476459(0x1cb)]?.['id']&&_0x4bd845[_0x476459(0x1ff)]&&_0x4bd845['id']){const _0x3d440d=_0x293de3['site'],_0x2fd595=getConsoleUrl(_0x3d440d,_0x476459(0x117)+_0x4bd845[_0x476459(0x1cb)]['id']+_0x476459(0x142)+_0x4bd845[_0x476459(0x1ff)]+_0x476459(0x251)+_0x4bd845['id']);console[_0x476459(0x26f)]('\x20\x20Console:\x20'+a54_0x1e596b[_0x476459(0x106)](_0x2fd595));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{['name']=a54_0x3a8226(0x152);['description']=a54_0x3a8226(0x27a);async[a54_0x3a8226(0x1cd)](_0x58a88e){const _0x3efd43=a54_0x3a8226,{options:_0x26f344,args:_0x4b38c5,tdx:_0x6387d}=_0x58a88e,_0x164760=_0x4b38c5[0x0],_0xaf2b3=_0x4b38c5[0x1]||'.';if(!_0x164760)return console[_0x3efd43(0x26f)](_0x3efd43(0xec)),console[_0x3efd43(0x26f)](_0x3efd43(0x109)),0x1;const _0x555945=_0x26f344[_0x3efd43(0x1a2)];_0x26f344[_0x3efd43(0x272)]&&(console[_0x3efd43(0x26f)](_0x3efd43(0x183)+_0x164760),console[_0x3efd43(0x26f)]('Output\x20directory:\x20'+_0xaf2b3),_0x555945&&console[_0x3efd43(0x26f)]('Revision:\x20'+_0x555945));const _0x3313d8=await withSpinner(_0x3efd43(0xea)+_0x164760+_0x3efd43(0x1f9),()=>_0x6387d[_0x3efd43(0x267)][_0x3efd43(0x20b)](_0x164760,_0xaf2b3,{'revision':_0x555945}),{'verbose':_0x26f344[_0x3efd43(0x272)]}),_0x416737=_0x3313d8[_0x3efd43(0x1ba)];return console[_0x3efd43(0x26f)](_0x3efd43(0x28f)+_0x416737[_0x3efd43(0x249)]),console[_0x3efd43(0x26f)](_0x3efd43(0x229)+_0x416737[_0x3efd43(0x1a2)]),console[_0x3efd43(0x26f)]('\x20\x20Files\x20extracted:\x20'+_0x416737['filesExtracted']),console[_0x3efd43(0x26f)](_0x3efd43(0x125)+_0xaf2b3+'/'+_0x416737['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1ce);['description']=a54_0x3a8226(0x16b);async[a54_0x3a8226(0x1cd)](_0xf0f619){const _0x430a8d=a54_0x3a8226,{options:_0x44294a,args:_0x1da9e3,tdx:_0x3ce793}=_0xf0f619;let _0x26b18a='.',_0x196595=_0x44294a[_0x430a8d(0xf9)];if(_0x1da9e3[0x0]){const {promises:_0xc1dd22}=await import('fs');try{const _0x267703=await _0xc1dd22[_0x430a8d(0x1a5)](_0x1da9e3[0x0]);if(_0x267703[_0x430a8d(0x2a0)]())_0x26b18a=_0x1da9e3[0x0];else return console['error'](_0x430a8d(0x26c)+_0x1da9e3[0x0]+_0x430a8d(0xfd)),0x1;}catch{_0x196595=_0x1da9e3[0x0],_0x26b18a='.';}}const _0x3b2dbe=_0x44294a[_0x430a8d(0x1a2)],_0x1262cc=_0x44294a[_0x430a8d(0x1de)];_0x44294a[_0x430a8d(0x272)]&&(console[_0x430a8d(0x26f)](_0x430a8d(0x260)+_0x26b18a),_0x196595&&console['error']('Project\x20name:\x20'+_0x196595),_0x3b2dbe&&console[_0x430a8d(0x26f)]('Revision:\x20'+_0x3b2dbe),_0x1262cc&&console[_0x430a8d(0x26f)]('Validation:\x20skipped'));const _0x28af5a=await withSpinner(_0x430a8d(0x1d2),()=>_0x3ce793['workflow'][_0x430a8d(0x23c)](_0x26b18a,{'projectName':_0x196595,'revision':_0x3b2dbe,'skipValidation':_0x1262cc}),{'verbose':_0x44294a['verbose']}),_0x30f1fb=_0x28af5a[_0x430a8d(0x1ba)];return console[_0x430a8d(0x26f)](_0x430a8d(0x19c)+_0x30f1fb['projectName']),console[_0x430a8d(0x26f)](_0x430a8d(0x1c2)+_0x30f1fb[_0x430a8d(0x15e)]),console[_0x430a8d(0x26f)]('\x20\x20Revision:\x20'+_0x30f1fb[_0x430a8d(0x1a2)]),await this[_0x430a8d(0x165)](_0x3ce793,_0x30f1fb[_0x430a8d(0x249)],_0x44294a[_0x430a8d(0x241)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{['name']='workflow:pull';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x16e);async[a54_0x3a8226(0x1cd)](_0x29c085){const _0x59e0e7=a54_0x3a8226,{options:_0x42c5f4,args:_0x28004b,tdx:_0x14b2b5}=_0x29c085,_0x25894f=_0x28004b[0x0],_0x2398b8=_0x28004b[0x1];if(!_0x25894f)return console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0x227)](_0x59e0e7(0x23e)),_0x59e0e7(0x1b4)),console['error'](a54_0x1e596b[_0x59e0e7(0xe8)](_0x59e0e7(0x291))),0x1;const _0x340788=_0x42c5f4[_0x59e0e7(0x1a2)];_0x42c5f4['verbose']&&(console[_0x59e0e7(0x26f)](_0x59e0e7(0x183)+_0x25894f),_0x2398b8&&console[_0x59e0e7(0x26f)](_0x59e0e7(0x2a2)+_0x2398b8),_0x340788&&console[_0x59e0e7(0x26f)]('Revision:\x20'+_0x340788),_0x42c5f4['dryRun']&&console[_0x59e0e7(0x26f)](_0x59e0e7(0x17e)));const _0x54d63a=await withSpinner(_0x59e0e7(0x10b)+_0x25894f+_0x59e0e7(0x1f9),()=>_0x14b2b5['workflow']['pullProject'](_0x25894f,{'targetDir':_0x2398b8,'revision':_0x340788}),{'verbose':_0x42c5f4[_0x59e0e7(0x272)]}),_0x2d2f9f=_0x54d63a[_0x59e0e7(0x1ba)];_0x2d2f9f[_0x59e0e7(0x25f)]?console['error'](_0x59e0e7(0x2a5)+_0x2d2f9f[_0x59e0e7(0x249)]):console[_0x59e0e7(0x26f)](_0x59e0e7(0x22e)+_0x2d2f9f[_0x59e0e7(0x249)]);console[_0x59e0e7(0x26f)](_0x59e0e7(0x229)+_0x2d2f9f[_0x59e0e7(0x1a2)]),console[_0x59e0e7(0x26f)](_0x59e0e7(0x286)+(a54_0x1e7b2e[_0x59e0e7(0x271)](process['cwd'](),_0x2d2f9f[_0x59e0e7(0x177)])||'.')),console['error']('\x20\x20Changes:\x20'+a54_0x1e596b['green']('+'+_0x2d2f9f[_0x59e0e7(0x220)][_0x59e0e7(0x140)]+_0x59e0e7(0x1ed))+',\x20'+(a54_0x1e596b['yellow']('~'+_0x2d2f9f['summary'][_0x59e0e7(0x143)]+'\x20modified')+',\x20')+(a54_0x1e596b['red']('-'+_0x2d2f9f[_0x59e0e7(0x220)][_0x59e0e7(0x101)]+_0x59e0e7(0x149))+',\x20')+(''+a54_0x1e596b['dim'](_0x2d2f9f[_0x59e0e7(0x220)]['unchanged']+_0x59e0e7(0x233))));for(const _0x30e72e of _0x2d2f9f[_0x59e0e7(0x121)]){_0x30e72e[_0x59e0e7(0x161)]===_0x59e0e7(0x143)&&_0x30e72e[_0x59e0e7(0x182)]&&(console[_0x59e0e7(0x26f)]('\x0a'+a54_0x1e596b[_0x59e0e7(0x106)](_0x59e0e7(0x141)+_0x30e72e[_0x59e0e7(0x24f)])),console[_0x59e0e7(0x26f)](_0x30e72e['diff']));}if(!_0x2d2f9f[_0x59e0e7(0x290)])return saveSessionContext({'workflow_project':_0x2d2f9f[_0x59e0e7(0x249)]},_0x42c5f4[_0x59e0e7(0x128)]),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xfb)](_0x59e0e7(0x216))),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xe8)](_0x59e0e7(0x2a6)+_0x2d2f9f[_0x59e0e7(0x249)])),0x0;if(_0x42c5f4[_0x59e0e7(0x1ae)])return console[_0x59e0e7(0x26f)](a54_0x1e596b['yellow'](_0x59e0e7(0x211))),0x0;if(!_0x42c5f4[_0x59e0e7(0x1ab)]){if(!isInteractive())return console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0x227)](_0x59e0e7(0x298)),_0x59e0e7(0x170)),console[_0x59e0e7(0x26f)](a54_0x1e596b['dim'](_0x59e0e7(0x226))),0x1;const _0x53bbe8=await confirmKey(_0x59e0e7(0x130));if(!_0x53bbe8)return console['error'](a54_0x1e596b[_0x59e0e7(0x1f4)](_0x59e0e7(0x1bb)),_0x59e0e7(0x189)),0x1;}await withSpinner(_0x59e0e7(0x28e),()=>_0x14b2b5[_0x59e0e7(0x267)][_0x59e0e7(0x1b5)](_0x2d2f9f,{'revision':_0x340788}),{'verbose':_0x42c5f4['verbose']}),saveSessionContext({'workflow_project':_0x2d2f9f[_0x59e0e7(0x249)]},_0x42c5f4[_0x59e0e7(0x128)]),console[_0x59e0e7(0x26f)](a54_0x1e596b[_0x59e0e7(0xfb)](_0x59e0e7(0x248)));const _0x2cc706=a54_0x1e7b2e[_0x59e0e7(0x271)](process[_0x59e0e7(0x2a9)](),_0x2d2f9f[_0x59e0e7(0x177)])||'.';return console[_0x59e0e7(0x26f)](a54_0x1e596b['dim'](_0x59e0e7(0x125)+_0x2cc706)),console['error'](a54_0x1e596b['dim'](_0x59e0e7(0x2a6)+_0x2d2f9f[_0x59e0e7(0x249)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x20c);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x25c);async[a54_0x3a8226(0x1cd)](_0x427fba){const _0x5e36af=a54_0x3a8226,{options:_0x32e992,args:_0x1cd81d,tdx:_0x3fb977}=_0x427fba,_0x65d726=this[_0x5e36af(0x175)](_0x1cd81d,_0x32e992),_0x107430=_0x32e992[_0x5e36af(0x1a2)],_0x5f41a7=_0x32e992['skipValidation'];_0x32e992[_0x5e36af(0x272)]&&(_0x65d726&&console[_0x5e36af(0x26f)]('Source\x20directory:\x20'+_0x65d726),_0x107430&&console['error'](_0x5e36af(0x1be)+_0x107430),_0x32e992[_0x5e36af(0x1ae)]&&console[_0x5e36af(0x26f)]('Dry\x20run:\x20yes'),_0x5f41a7&&console[_0x5e36af(0x26f)]('Validation:\x20skipped'));let _0x315119;try{_0x315119=await withSpinner(_0x5e36af(0x268),()=>_0x3fb977['workflow']['preparePushProject']({'sourceDir':_0x65d726,'revision':_0x107430,'skipValidation':_0x5f41a7}),{'verbose':_0x32e992[_0x5e36af(0x272)]});}catch(_0x8c336b){if(_0x8c336b instanceof Error&&_0x8c336b['message'][_0x5e36af(0x127)](_0x5e36af(0x118)))return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0x227)]('Error:'),_0x5e36af(0x137)),_0x32e992[_0x5e36af(0x22d)]?console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)]('Tip:\x20cd\x20to\x20workflows/'+_0x32e992[_0x5e36af(0x22d)]+_0x5e36af(0x12f)+_0x32e992['workflowProject']+'\x27')):console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)](_0x5e36af(0x1d7))),0x1;throw _0x8c336b;}const _0x554832=_0x315119[_0x5e36af(0x1ba)];console[_0x5e36af(0x26f)](_0x5e36af(0x1d8)+_0x554832[_0x5e36af(0x249)]),console['error'](_0x5e36af(0x16f)+_0x554832[_0x5e36af(0x11d)]),console[_0x5e36af(0x26f)](_0x5e36af(0x229)+_0x554832[_0x5e36af(0x1a2)]),console[_0x5e36af(0x26f)](_0x5e36af(0x129)+a54_0x1e596b[_0x5e36af(0xfb)]('+'+_0x554832['summary']['new']+_0x5e36af(0x1ed))+',\x20'+(a54_0x1e596b[_0x5e36af(0x1f4)]('~'+_0x554832['summary'][_0x5e36af(0x143)]+_0x5e36af(0x1f8))+',\x20')+(a54_0x1e596b[_0x5e36af(0x227)]('-'+_0x554832['summary'][_0x5e36af(0x101)]+_0x5e36af(0x149))+',\x20')+(''+a54_0x1e596b[_0x5e36af(0xe8)](_0x554832['summary']['unchanged']+'\x20unchanged')));for(const _0x4fee2d of _0x554832[_0x5e36af(0x121)]){_0x4fee2d[_0x5e36af(0x161)]===_0x5e36af(0x143)&&_0x4fee2d[_0x5e36af(0x182)]&&(console[_0x5e36af(0x26f)]('\x0a'+a54_0x1e596b['cyan']('---\x20'+_0x4fee2d[_0x5e36af(0x24f)])),console['error'](_0x4fee2d[_0x5e36af(0x182)]));}if(!_0x554832[_0x5e36af(0x290)])return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xfb)]('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0x5e36af(0x165)](_0x3fb977,_0x554832['projectName'],_0x32e992[_0x5e36af(0x241)]),0x0;if(_0x32e992[_0x5e36af(0x1ae)])return console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0x1f4)](_0x5e36af(0x27e))),0x0;if(!_0x32e992['yes']){if(!isInteractive())return console['error'](a54_0x1e596b[_0x5e36af(0x227)](_0x5e36af(0x298)),_0x5e36af(0x170)),console[_0x5e36af(0x26f)](a54_0x1e596b[_0x5e36af(0xe8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x250a75=await confirmKey(_0x5e36af(0x207));if(!_0x250a75)return console['error'](a54_0x1e596b[_0x5e36af(0x1f4)]('Cancelled'),_0x5e36af(0x14d)),0x1;}const _0x56f8cb=await withSpinner(_0x5e36af(0x13b),()=>_0x3fb977['workflow'][_0x5e36af(0x1a9)](_0x554832),{'verbose':_0x32e992['verbose']}),_0x58c8ee=_0x56f8cb[_0x5e36af(0x1ba)];return console['error'](a54_0x1e596b[_0x5e36af(0xfb)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x58c8ee[_0x5e36af(0x15e)]),console[_0x5e36af(0x26f)](_0x5e36af(0x229)+_0x58c8ee[_0x5e36af(0x1a2)]),await this[_0x5e36af(0x165)](_0x3fb977,_0x58c8ee['projectName'],_0x32e992[_0x5e36af(0x241)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x17f);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x122);async[a54_0x3a8226(0x1cd)](_0x320a61){const _0x1ac291=a54_0x3a8226,{options:_0x4255de,args:_0x987a65,tdx:_0x5492b7}=_0x320a61,_0x1d79c6=this[_0x1ac291(0x175)](_0x987a65,_0x4255de),_0x25affd=_0x4255de[_0x1ac291(0xf9)],_0x11dbbe=_0x4255de['revision'],_0x30f113=_0x4255de['skipValidation'];if(!_0x1d79c6)return console[_0x1ac291(0x26f)](a54_0x1e596b['red'](_0x1ac291(0x23e)),_0x1ac291(0x26e)),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xe8)](_0x1ac291(0x203))),console['error'](a54_0x1e596b['dim'](_0x1ac291(0x179))),0x1;if(!_0x25affd)return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x227)]('Error:'),'--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name'),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xe8)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x4255de[_0x1ac291(0x272)]&&(console['error'](_0x1ac291(0x104)+_0x1d79c6),console[_0x1ac291(0x26f)](_0x1ac291(0x184)+_0x25affd),_0x11dbbe&&console[_0x1ac291(0x26f)](_0x1ac291(0x1be)+_0x11dbbe),_0x4255de[_0x1ac291(0x1ae)]&&console[_0x1ac291(0x26f)](_0x1ac291(0x17e)),_0x30f113&&console[_0x1ac291(0x26f)](_0x1ac291(0x250)));const _0x37725d=await withSpinner(_0x1ac291(0xf4),()=>_0x5492b7[_0x1ac291(0x267)][_0x1ac291(0x12a)](_0x1d79c6,_0x25affd,{'revision':_0x11dbbe,'skipValidation':_0x30f113}),{'verbose':_0x4255de[_0x1ac291(0x272)]}),_0x31289d=_0x37725d[_0x1ac291(0x1ba)];console[_0x1ac291(0x26f)](_0x1ac291(0x270)+_0x31289d[_0x1ac291(0x11d)]);_0x31289d[_0x1ac291(0x111)]&&console[_0x1ac291(0x26f)]('Source\x20project:\x20'+_0x31289d[_0x1ac291(0x111)]);console[_0x1ac291(0x26f)](_0x1ac291(0x184)+_0x31289d[_0x1ac291(0x196)]),console[_0x1ac291(0x26f)]('Revision:\x20'+_0x31289d[_0x1ac291(0x1a2)]),console[_0x1ac291(0x26f)](_0x1ac291(0xf3)+_0x31289d['fileCount']);_0x31289d['targetExists']&&(console['error'](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x261)+_0x31289d[_0x1ac291(0x196)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x31289d[_0x1ac291(0x2a7)]+')')),console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x221))));if(_0x4255de[_0x1ac291(0x1ae)])return console[_0x1ac291(0x26f)](a54_0x1e596b['yellow'](_0x1ac291(0x11b))),0x0;if(!_0x4255de['yes']){if(!isInteractive())return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0x227)]('\x0aError:'),_0x1ac291(0x170)),console['error'](a54_0x1e596b['dim'](_0x1ac291(0x226))),0x1;const _0x37539a=_0x31289d[_0x1ac291(0x111)]||a54_0x1e7b2e[_0x1ac291(0x22b)](_0x1d79c6),_0x5b376c=_0x31289d[_0x1ac291(0x199)]?_0x1ac291(0x12e)+_0x25affd+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x37539a+_0x1ac291(0x108)+_0x25affd+'\x22?',_0x3b1b24=await confirmKey(_0x5b376c);if(!_0x3b1b24)return console['error'](a54_0x1e596b[_0x1ac291(0x1f4)](_0x1ac291(0x1bb))),0x1;}const _0x4d3ddf=await withSpinner(_0x31289d[_0x1ac291(0x199)]?_0x1ac291(0x116)+_0x25affd+_0x1ac291(0x1f9):'Cloning\x20to\x20'+_0x25affd+'...',()=>_0x5492b7['workflow'][_0x1ac291(0x21b)](_0x31289d),{'verbose':_0x4255de[_0x1ac291(0x272)]}),_0xf42e=_0x4d3ddf['data'];return console[_0x1ac291(0x26f)](a54_0x1e596b[_0x1ac291(0xfb)](_0x31289d['targetExists']?_0x1ac291(0x146):_0x1ac291(0x1b1))),console[_0x1ac291(0x26f)](_0x1ac291(0x21d)+_0xf42e[_0x1ac291(0x196)]),console['error']('\x20\x20Project\x20ID:\x20'+_0xf42e[_0x1ac291(0x1fb)]),console[_0x1ac291(0x26f)](_0x1ac291(0x229)+_0xf42e['revision']),await this['showWorkflowConsoleUrl'](_0x5492b7,_0xf42e[_0x1ac291(0x196)],_0x4255de[_0x1ac291(0x241)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x3a8226(0xf9)]='workflow:delete';['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x3ddf74){const _0x194825=a54_0x3a8226,{options:_0x4afa5c,args:_0x2c75af,tdx:_0x57e512}=_0x3ddf74,_0x1a8738=_0x2c75af[0x0];if(!_0x1a8738)return console['error'](_0x194825(0x27f)),console['error'](_0x194825(0x1a6)),0x1;_0x4afa5c[_0x194825(0x272)]&&console[_0x194825(0x26f)]('Project:\x20'+_0x1a8738);if(!_0x4afa5c[_0x194825(0x1ab)]){if(!isInteractive())return console[_0x194825(0x26f)](a54_0x1e596b[_0x194825(0x227)](_0x194825(0x298)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x1e596b[_0x194825(0xe8)](_0x194825(0x226))),0x1;const _0x5e257f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1a8738+_0x194825(0x15c));if(!_0x5e257f)return console[_0x194825(0x26f)](a54_0x1e596b[_0x194825(0x1f4)](_0x194825(0x1bb))),0x1;}const _0x2431bf=await withSpinner(_0x194825(0x24b)+_0x1a8738+'...',()=>_0x57e512[_0x194825(0x267)][_0x194825(0x132)](_0x1a8738),{'verbose':_0x4afa5c[_0x194825(0x272)]}),_0x3b0293=_0x2431bf[_0x194825(0x1ba)];return console[_0x194825(0x26f)]('✔\x20Deleted\x20project\x20'+_0x3b0293[_0x194825(0x249)]),console['error'](_0x194825(0x1c2)+_0x3b0293['projectId']),0x0;}}export function parseKeyValue(_0x1c59d4){const _0xb36d5d=a54_0x3a8226,_0x1b991c=_0x1c59d4[_0xb36d5d(0x239)]('=');if(_0x1b991c===-0x1)throw new Error(_0xb36d5d(0x1c0)+_0x1c59d4+_0xb36d5d(0x215));const _0x1a8926=_0x1c59d4[_0xb36d5d(0x28c)](0x0,_0x1b991c),_0x1a4c9=_0x1c59d4[_0xb36d5d(0x28c)](_0x1b991c+0x1);if(!_0x1a8926)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x1a8926,'value':_0x1a4c9};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]='workflow:secrets:list';[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x222);async[a54_0x3a8226(0x1cd)](_0x1784bf){const _0x205f61=a54_0x3a8226,{options:_0x1c61dd,args:_0x539e07,tdx:_0x4aeb76}=_0x1784bf,_0x53e4ce=this[_0x205f61(0x160)](_0x539e07,_0x1c61dd);if(!_0x53e4ce)return 0x1;_0x1c61dd['verbose']&&console['error']('Project:\x20'+_0x53e4ce);const _0x1b763a=await withSpinner(_0x205f61(0x13a),()=>_0x4aeb76[_0x205f61(0x267)]['listSecrets'](_0x53e4ce),{'verbose':_0x1c61dd[_0x205f61(0x272)]}),{secrets:_0x5c9e48}=_0x1b763a[_0x205f61(0x1ba)];return console['error'](_0x205f61(0x151)+_0x5c9e48[_0x205f61(0x294)]+'\x20secret'+(_0x5c9e48[_0x205f61(0x294)]!==0x1?'s':'')),await handleSDKOutput(_0x5c9e48,_0x1c61dd),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x1ea);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x255);async['execute'](_0x1e607c){const _0x350a93=a54_0x3a8226,{options:_0x214442,args:_0x14edff,tdx:_0x5d92dc}=_0x1e607c;let _0x13fec7,_0x11612f;if(_0x14edff[_0x350a93(0x294)]>=0x1&&!_0x14edff[0x0][_0x350a93(0x127)]('='))_0x13fec7=_0x14edff[0x0],_0x11612f=_0x14edff[_0x350a93(0x12b)](0x1);else{if(_0x14edff[_0x350a93(0x294)]>=0x1&&_0x214442['workflowProject'])_0x13fec7=_0x214442[_0x350a93(0x22d)],_0x11612f=_0x14edff;else return _0x14edff[_0x350a93(0x294)]>=0x1?(console[_0x350a93(0x26f)](_0x350a93(0xec)),console['error'](_0x350a93(0x185)),0x1):(console[_0x350a93(0x26f)]('Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required'),console[_0x350a93(0x26f)](_0x350a93(0x24a)),0x1);}if(_0x11612f[_0x350a93(0x294)]===0x0)return console[_0x350a93(0x26f)](_0x350a93(0x150)),console[_0x350a93(0x26f)](_0x350a93(0x24a)),0x1;const _0x312286={};try{for(const _0x351724 of _0x11612f){const {key:_0x1732ed,value:_0x16287b}=parseKeyValue(_0x351724);_0x312286[_0x1732ed]=_0x16287b;}}catch(_0x3b3aa4){return _0x3b3aa4 instanceof Error&&console['error'](a54_0x1e596b[_0x350a93(0x227)](_0x350a93(0x23e)),_0x3b3aa4[_0x350a93(0x299)]),0x1;}const _0x4d2f7d=Object[_0x350a93(0x1fa)](_0x312286);_0x214442[_0x350a93(0x272)]&&(console[_0x350a93(0x26f)](_0x350a93(0x183)+_0x13fec7),console[_0x350a93(0x26f)]('Secrets\x20to\x20set:\x20'+_0x4d2f7d['join'](',\x20')));const _0xfc1c21=await withSpinner(_0x4d2f7d[_0x350a93(0x294)]===0x1?_0x350a93(0x1d3):_0x350a93(0x236)+_0x4d2f7d[_0x350a93(0x294)]+'\x20secrets...',()=>_0x5d92dc[_0x350a93(0x267)][_0x350a93(0x231)](_0x13fec7,_0x312286),{'verbose':_0x214442['verbose']}),_0x416dfd=_0xfc1c21['data'];return console[_0x350a93(0x26f)](_0x4d2f7d['length']===0x1?_0x350a93(0x19f)+_0x416dfd['keys'][0x0]+_0x350a93(0x135)+_0x416dfd[_0x350a93(0x249)]+'\x27':'✔\x20'+_0x416dfd[_0x350a93(0x1fa)][_0x350a93(0x294)]+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x416dfd[_0x350a93(0x249)]+'\x27'),(_0x214442['json']||_0x214442[_0x350a93(0x1c4)])&&await handleSingleObjectOutput(_0x416dfd,_0x214442),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x28a);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1c9);async[a54_0x3a8226(0x1cd)](_0x3ee19e){const _0x324398=a54_0x3a8226,{options:_0x485510,args:_0x4b5aed,tdx:_0x514cd2}=_0x3ee19e;let _0x19397a,_0x299994;if(_0x4b5aed[_0x324398(0x294)]>=0x2)_0x19397a=_0x4b5aed[0x0],_0x299994=_0x4b5aed[0x1];else{if(_0x4b5aed[_0x324398(0x294)]===0x1&&_0x485510[_0x324398(0x22d)])_0x19397a=_0x485510[_0x324398(0x22d)],_0x299994=_0x4b5aed[0x0];else return _0x4b5aed[_0x324398(0x294)]===0x1?(console[_0x324398(0x26f)](_0x324398(0xec)),console[_0x324398(0x26f)](_0x324398(0x185)),0x1):(console['error'](_0x324398(0x273)),console[_0x324398(0x26f)](_0x324398(0xff)),0x1);}_0x485510[_0x324398(0x272)]&&(console[_0x324398(0x26f)]('Project:\x20'+_0x19397a),console['error'](_0x324398(0x224)+_0x299994));if(!_0x485510['yes']){if(!isInteractive())return console[_0x324398(0x26f)](a54_0x1e596b['red'](_0x324398(0x298)),_0x324398(0x170)),console[_0x324398(0x26f)](a54_0x1e596b[_0x324398(0xe8)](_0x324398(0x226))),0x1;const _0x16982e=await confirmKey(_0x324398(0xfa)+_0x299994+_0x324398(0x2a1)+_0x19397a+'\x27?');if(!_0x16982e)return console[_0x324398(0x26f)](a54_0x1e596b[_0x324398(0x1f4)]('Cancelled')),0x1;}const _0xc8b0ee=await withSpinner('Deleting\x20secret...',()=>_0x514cd2[_0x324398(0x267)][_0x324398(0x1d6)](_0x19397a,_0x299994),{'verbose':_0x485510[_0x324398(0x272)]}),_0x5e14c2=_0xc8b0ee['data'];return console[_0x324398(0x26f)](_0x324398(0x19f)+_0x5e14c2['key']+_0x324398(0x20f)+_0x5e14c2[_0x324398(0x249)]+'\x27'),(_0x485510[_0x324398(0x10d)]||_0x485510[_0x324398(0x1c4)])&&await handleSingleObjectOutput(_0x5e14c2,_0x485510),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(_0x5a0b64){const _0x4567c4=a54_0x3a8226,_0x302b54=Math[_0x4567c4(0x20e)](_0x5a0b64/0x3e8),_0x2a2742=Math['floor'](_0x302b54/0x3c),_0xf912cb=Math[_0x4567c4(0x20e)](_0x2a2742/0x3c),_0x12bc23=Math['floor'](_0xf912cb/0x18);if(_0x12bc23>0x0){const _0x30ca23=_0xf912cb%0x18;return _0x30ca23>0x0?_0x12bc23+'d\x20'+_0x30ca23+'h':_0x12bc23+'d';}else{if(_0xf912cb>0x0){const _0x5d6765=_0x2a2742%0x3c;return _0x5d6765>0x0?_0xf912cb+'h\x20'+_0x5d6765+'m':_0xf912cb+'h';}else{if(_0x2a2742>0x0){const _0x1174cd=_0x302b54%0x3c;return _0x1174cd>0x0?_0x2a2742+'m\x20'+_0x1174cd+'s':_0x2a2742+'m';}else return _0x302b54+'s';}}}function formatTimestamp(_0x3ef3cc,_0x166906){const _0x13b263=a54_0x3a8226,_0x16a097=new Date(_0x3ef3cc),_0xe6a3af=String(_0x16a097[_0x13b263(0xf2)]())[_0x13b263(0x1fc)](0x2,'0'),_0x169560=String(_0x16a097[_0x13b263(0x144)]())[_0x13b263(0x1fc)](0x2,'0'),_0x10f220=_0xe6a3af+':'+_0x169560,_0xa0ff4d=_0x16a097[_0x13b263(0x292)]()===_0x166906[_0x13b263(0x292)]()&&_0x16a097['getMonth']()===_0x166906[_0x13b263(0x1c6)]()&&_0x16a097[_0x13b263(0x157)]()===_0x166906[_0x13b263(0x157)]();if(_0xa0ff4d)return _0x10f220;else{const _0x1a509d=String(_0x16a097[_0x13b263(0x1c6)]()+0x1)[_0x13b263(0x1fc)](0x2,'0'),_0x6dc38e=String(_0x16a097['getDate']())[_0x13b263(0x1fc)](0x2,'0');return _0x1a509d+'-'+_0x6dc38e+'\x20'+_0x10f220;}}function formatDate(_0x1a450e){const _0x5039e6=a54_0x3a8226,_0x57520c=_0x1a450e[_0x5039e6(0x292)](),_0x1aff81=String(_0x1a450e[_0x5039e6(0x1c6)]()+0x1)[_0x5039e6(0x1fc)](0x2,'0'),_0x598fbd=String(_0x1a450e['getDate']())[_0x5039e6(0x1fc)](0x2,'0');return _0x57520c+'-'+_0x1aff81+'-'+_0x598fbd;}function getTaskStateIcon(_0x32e8b5){const _0x154e96={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x154e96[_0x32e8b5]||'⚪';}function getBarChar(_0x146738){const _0x3c0efa=a54_0x3a8226;return _0x146738===_0x3c0efa(0x26f)||_0x146738==='group_error'?'×':'─';}function getBarColor(_0x6bca29){const _0x1db828=a54_0x3a8226,_0x4f0629={'success':a54_0x1e596b[_0x1db828(0xfb)],'error':a54_0x1e596b['red'],'group_error':a54_0x1e596b[_0x1db828(0x227)],'running':a54_0x1e596b[_0x1db828(0x1df)],'blocked':a54_0x1e596b[_0x1db828(0x1f4)],'planned':a54_0x1e596b['dim'],'canceling':a54_0x1e596b[_0x1db828(0x1f4)]};return _0x4f0629[_0x6bca29]||a54_0x1e596b[_0x1db828(0x206)];}function parseTaskName(_0x54d47d){const _0x5cb6d8=a54_0x3a8226;let _0x34724a=_0x54d47d[_0x5cb6d8(0x29c)](/^\++/,'');const _0x2be6b6=_0x34724a[_0x5cb6d8(0x10c)]('+'),_0x19d8fc=_0x2be6b6[_0x5cb6d8(0x294)]>0x1?_0x2be6b6[_0x5cb6d8(0x294)]-0x2:0x0,_0x21fb63=_0x2be6b6[_0x2be6b6['length']-0x1]||_0x34724a;return{'level':_0x19d8fc,'name':'+'+_0x21fb63};}function truncateTaskName(_0x57c672,_0x352007){const _0x1eee9e=a54_0x3a8226,_0x12ea6e=stringWidth(_0x57c672);if(_0x12ea6e<=_0x352007)return _0x57c672;let _0x23377c=_0x57c672;while(stringWidth(_0x23377c+'…')>_0x352007&&_0x23377c[_0x1eee9e(0x294)]>0x0){_0x23377c=_0x23377c[_0x1eee9e(0x12b)](0x0,-0x1);}return _0x23377c+'…';}function calculateTimeScale(_0x143235,_0x5bdfa7){const _0xc7f36e=a54_0x3a8226;return{'startTime':_0x143235[_0xc7f36e(0x218)],'endTime':_0x143235[_0xc7f36e(0x209)],'durationMs':_0x143235[_0xc7f36e(0x197)],'msPerChar':_0x143235[_0xc7f36e(0x197)]/_0x5bdfa7};}function timeToPosition(_0x5010db,_0x28beed,_0x387033){const _0x125f56=a54_0x3a8226,_0x193158=_0x5010db-_0x28beed['startTime'],_0x1c1f86=Math['floor'](_0x193158/_0x28beed[_0x125f56(0x15d)]);return Math[_0x125f56(0xf7)](0x0,Math[_0x125f56(0x23a)](_0x1c1f86,_0x387033));}function renderTimeAxis(_0x4e00ff,_0x46a521){const _0x111bfc=a54_0x3a8226,_0x355f06=Math[_0x111bfc(0x23a)](TIMELINE_CONFIG[_0x111bfc(0x246)],Math['max'](TIMELINE_CONFIG[_0x111bfc(0x295)],Math[_0x111bfc(0x20e)](_0x46a521/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x41f242=_0x4e00ff[_0x111bfc(0x1e6)]/(_0x355f06-0x1),_0x48b63b=new Date(_0x4e00ff[_0x111bfc(0x21f)]),_0x1142ab=[];for(let _0x413db7=0x0;_0x413db7<_0x355f06;_0x413db7++){const _0x40ff96=_0x4e00ff[_0x111bfc(0x21f)]+_0x413db7*_0x41f242,_0x1eeb90=timeToPosition(_0x40ff96,_0x4e00ff,_0x46a521),_0x4e58d0=formatTimestamp(_0x40ff96,_0x48b63b);_0x1142ab[_0x111bfc(0x23c)]({'pos':_0x1eeb90,'text':_0x4e58d0});}const _0x20d77d=new Array(_0x46a521)[_0x111bfc(0x1aa)]('\x20');let _0x56a016=-0x1;for(const {pos:_0x4f6fa7,text:_0x18a1e4}of _0x1142ab){let _0x3e3dfb=Math[_0x111bfc(0xf7)](0x0,_0x4f6fa7-Math[_0x111bfc(0x20e)](_0x18a1e4[_0x111bfc(0x294)]/0x2));_0x3e3dfb<=_0x56a016+TIMELINE_CONFIG[_0x111bfc(0x208)]&&(_0x3e3dfb=_0x56a016+TIMELINE_CONFIG[_0x111bfc(0x208)]+0x1);_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]>_0x46a521&&(_0x3e3dfb=_0x46a521-_0x18a1e4[_0x111bfc(0x294)]);if(_0x3e3dfb>=0x0&&_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]<=_0x46a521&&_0x3e3dfb>_0x56a016){for(let _0x43826e=0x0;_0x43826e<_0x18a1e4[_0x111bfc(0x294)];_0x43826e++){_0x20d77d[_0x3e3dfb+_0x43826e]=_0x18a1e4[_0x43826e];}_0x56a016=_0x3e3dfb+_0x18a1e4[_0x111bfc(0x294)]-0x1;}}return _0x20d77d['join']('');}function renderTaskRow(_0x38e3e1,_0x5dd360,_0xd4bdd6,_0x64fd7f){const _0x284bf4=a54_0x3a8226,{level:_0x40c1e1,name:_0x1542aa}=parseTaskName(_0x38e3e1[_0x284bf4(0xf9)]),_0x4260bb='\x20'[_0x284bf4(0x16d)](_0x40c1e1),_0x28073b=_0x38e3e1[_0x284bf4(0x15f)]?'('+formatElapsed(_0x38e3e1[_0x284bf4(0x15f)][_0x284bf4(0x197)])+')':'',_0x2a4949=stringWidth(_0x28073b),_0x40d13a=_0x40c1e1*0x1,_0x2bb546=_0x64fd7f-_0x40d13a-_0x2a4949-0x1,_0x10368e=truncateTaskName(_0x1542aa,_0x2bb546),_0x9e1ef8=_0x4260bb+_0x10368e,_0x2b63cd=stringWidth(_0x9e1ef8),_0x1d3f46=_0x64fd7f-_0x2b63cd-_0x2a4949,_0x5015b1=_0x9e1ef8+'\x20'[_0x284bf4(0x16d)](Math[_0x284bf4(0xf7)](0x1,_0x1d3f46))+a54_0x1e596b['dim'](_0x28073b),_0x5c62b6=getTaskStateIcon(_0x38e3e1[_0x284bf4(0x24d)]),_0x33fedf=new Array(_0xd4bdd6)[_0x284bf4(0x1aa)]('\x20');if(_0x38e3e1['window']){const _0x41dde2=timeToPosition(_0x38e3e1['window'][_0x284bf4(0x218)],_0x5dd360,_0xd4bdd6),_0x2da917=timeToPosition(_0x38e3e1[_0x284bf4(0x15f)]['end'],_0x5dd360,_0xd4bdd6),_0x2b61d1=getBarChar(_0x38e3e1[_0x284bf4(0x24d)]),_0x30a41a=Math[_0x284bf4(0xf7)](_0x41dde2+0x1,_0x2da917);for(let _0x4f50e6=_0x41dde2;_0x4f50e6<Math[_0x284bf4(0x23a)](_0x30a41a,_0xd4bdd6);_0x4f50e6++){_0x33fedf[_0x4f50e6]=_0x2b61d1;}}const _0x4388e8=getBarColor(_0x38e3e1[_0x284bf4(0x24d)]),_0x412dd6=_0x33fedf[_0x284bf4(0x1bc)](_0x70c7b2=>_0x70c7b2==='\x20'?'\x20':_0x4388e8(_0x70c7b2))[_0x284bf4(0x258)]('');return _0x5c62b6+'\x20'+_0x5015b1+'│'+_0x412dd6+'│';}function calculateStats(_0x26ffaf){const _0x573152=a54_0x3a8226,_0x1d2fa3={'total':_0x26ffaf[_0x573152(0x294)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x318629 of _0x26ffaf){if(_0x318629[_0x573152(0x24d)]===_0x573152(0x1b0))_0x1d2fa3[_0x573152(0x1b0)]++;else{if(_0x318629[_0x573152(0x24d)]===_0x573152(0x26f)||_0x318629[_0x573152(0x24d)]===_0x573152(0x29a))_0x1d2fa3[_0x573152(0x26f)]++;else _0x318629[_0x573152(0x24d)]==='running'?_0x1d2fa3[_0x573152(0x18c)]++:_0x1d2fa3['pending']++;}}return _0x1d2fa3;}function formatStats(_0x32ca6d){const _0x4d6c09=a54_0x3a8226;return['Total:\x20'+_0x32ca6d[_0x4d6c09(0x1bd)],'✅\x20'+_0x32ca6d[_0x4d6c09(0x1b0)],'❌\x20'+_0x32ca6d[_0x4d6c09(0x26f)],_0x4d6c09(0x238)+_0x32ca6d['running'],'⏳\x20'+_0x32ca6d[_0x4d6c09(0x280)]]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x2a4);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x164);async[a54_0x3a8226(0x1cd)](_0x3ad1fe){const _0x27a216=a54_0x3a8226,{options:_0x32997c,args:_0x2bdaa8,tdx:_0x427e6a}=_0x3ad1fe;let _0x10a1ab,_0x17a612,_0x413968=![];if(_0x2bdaa8[0x0]){if(_0x2bdaa8[0x0][_0x27a216(0x127)]('.')){const _0x508117=this[_0x27a216(0x1ef)](_0x2bdaa8,_0x32997c);if(!_0x508117)return 0x1;_0x10a1ab=_0x508117['projectName'],_0x17a612=_0x508117[_0x27a216(0x10a)];}else{_0x17a612=_0x2bdaa8[0x0],_0x10a1ab=_0x32997c[_0x27a216(0x22d)];if(!_0x10a1ab)return console[_0x27a216(0x26f)](a54_0x1e596b[_0x27a216(0x227)](_0x27a216(0x23e)),_0x27a216(0x240)),0x1;_0x413968=!![];}}else{const _0x46c732=this[_0x27a216(0x1ef)](_0x2bdaa8,_0x32997c);if(!_0x46c732)return 0x1;_0x10a1ab=_0x46c732[_0x27a216(0x249)],_0x17a612=_0x46c732['workflowName'];}if(_0x32997c[_0x27a216(0x272)]){if(_0x10a1ab&&_0x17a612)console[_0x27a216(0x26f)]('Filter:\x20'+_0x10a1ab+'.'+_0x17a612);else _0x10a1ab&&console[_0x27a216(0x26f)](_0x27a216(0x20d)+_0x10a1ab);}const _0x48e1dd=_0x32997c['attemptId'],_0x4c5e22=_0x32997c[_0x27a216(0x1ff)];if(_0x48e1dd){_0x4c5e22&&console[_0x27a216(0x26f)](a54_0x1e596b['yellow'](_0x27a216(0x1b3)),_0x27a216(0x105));const _0x2bb917=_0x32997c[_0x27a216(0x288)];return _0x2bb917?await this[_0x27a216(0x153)](_0x3ad1fe,_0x48e1dd):await this[_0x27a216(0x1f7)](_0x3ad1fe,_0x48e1dd,_0x32997c),0x0;}if(_0x4c5e22){const _0x501245=await withSpinner(_0x27a216(0x19a),()=>_0x427e6a[_0x27a216(0x267)][_0x27a216(0x13c)]({'projectName':_0x10a1ab,'workflowName':_0x17a612,'limit':0x64}),{'verbose':_0x32997c['verbose']}),_0x25e196=_0x501245[_0x27a216(0x1ba)]['find'](_0x1296d1=>_0x1296d1['id']===_0x4c5e22);if(!_0x25e196)return console[_0x27a216(0x26f)](a54_0x1e596b[_0x27a216(0x227)](_0x27a216(0x23e)),_0x27a216(0x124)+_0x4c5e22),0x1;if(!_0x25e196[_0x27a216(0x212)]?.['id'])return console[_0x27a216(0x26f)](a54_0x1e596b['red'](_0x27a216(0x23e)),_0x27a216(0x166)+_0x4c5e22+_0x27a216(0x202)),0x1;const _0x244c58=_0x25e196['lastAttempt']['id'];_0x32997c[_0x27a216(0x272)]&&console[_0x27a216(0x26f)](_0x27a216(0x24e)+_0x244c58+_0x27a216(0x126)+_0x4c5e22);const _0x29f40a=_0x32997c[_0x27a216(0x288)];return _0x29f40a?await this[_0x27a216(0x153)](_0x3ad1fe,_0x244c58):await this['renderSingleTimeline'](_0x3ad1fe,_0x244c58,_0x32997c),0x0;}const _0x220501=await withSpinner(_0x27a216(0x21a),()=>_0x427e6a[_0x27a216(0x267)]['sessions']({'projectName':_0x10a1ab,'workflowName':_0x17a612,'limit':_0x32997c[_0x27a216(0x171)]||0x32}),{'verbose':_0x32997c[_0x27a216(0x272)]}),_0x334e5d=_0x220501[_0x27a216(0x1ba)];if(_0x334e5d[_0x27a216(0x294)]===0x0){if(_0x10a1ab&&_0x17a612)console['error'](_0x27a216(0x1d9)+_0x10a1ab+'.'+_0x17a612);else _0x10a1ab?console[_0x27a216(0x26f)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x10a1ab):(console[_0x27a216(0x26f)](_0x27a216(0xfc)),console[_0x27a216(0x26f)](a54_0x1e596b['dim']('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x334e5d[_0x27a216(0x1c8)]((_0x18b8d9,_0x5d23cf)=>{const _0x23862f=_0x27a216,_0x3159aa=_0x18b8d9['sessionTime']||'',_0x2a78cd=_0x5d23cf[_0x23862f(0x194)]||'';return _0x2a78cd[_0x23862f(0x234)](_0x3159aa);});if(_0x32997c['json']||_0x32997c[_0x27a216(0x1c4)])return await handleSDKOutput(_0x334e5d,_0x32997c),0x0;let _0x400c6e;if(_0x413968){const _0x2daee3=_0x334e5d[0x0];if(!_0x2daee3[_0x27a216(0x212)]?.['id'])return console[_0x27a216(0x26f)](_0x27a216(0x154)),0x0;_0x400c6e=_0x2daee3[_0x27a216(0x212)]['id'],_0x32997c[_0x27a216(0x272)]&&console['error'](_0x27a216(0x266)+_0x2daee3[_0x27a216(0x194)]);}else{const _0x378cb2=_0x334e5d['map'](_0x3a4d92=>{const _0x46ec5d=_0x27a216,_0x2e392f=getAttemptStatusDisplay(_0x3a4d92[_0x46ec5d(0x212)]);return{'title':_0x3a4d92[_0x46ec5d(0x1cb)]?.[_0x46ec5d(0xf9)]+'.'+_0x3a4d92[_0x46ec5d(0x267)]?.[_0x46ec5d(0xf9)]+'\x20-\x20'+_0x3a4d92['sessionTime']+'\x20'+_0x2e392f[_0x46ec5d(0x289)],'value':_0x3a4d92[_0x46ec5d(0x212)]?.['id']||'','description':_0x2e392f[_0x46ec5d(0x243)]};}),_0x142bc9=await a54_0x89dadd({'type':_0x27a216(0x136),'name':_0x27a216(0x1e2),'message':_0x27a216(0x19e),'choices':_0x378cb2[_0x27a216(0x242)](_0x113849=>_0x113849['value']!=='')});if(!_0x142bc9[_0x27a216(0x1e2)])return 0x0;_0x400c6e=_0x142bc9['attemptId'];}const _0x2a2801=_0x32997c[_0x27a216(0x288)];return _0x2a2801?await this[_0x27a216(0x153)](_0x3ad1fe,_0x400c6e):await this[_0x27a216(0x1f7)](_0x3ad1fe,_0x400c6e,_0x32997c),0x0;}async[a54_0x3a8226(0x1f7)](_0x4ed24c,_0x59807c,_0xa8727c){const _0x4f3c48=a54_0x3a8226,{tdx:_0x3c942b}=_0x4ed24c;let _0x395bc4,_0x18bc6a;try{[_0x395bc4,_0x18bc6a]=await Promise['all']([_0x3c942b[_0x4f3c48(0x267)][_0x4f3c48(0x259)](_0x59807c),_0x3c942b[_0x4f3c48(0x267)][_0x4f3c48(0x178)](_0x59807c,![])]);}catch(_0x44fbb5){console['error'](a54_0x1e596b[_0x4f3c48(0x227)](_0x4f3c48(0x1eb)));_0xa8727c[_0x4f3c48(0x272)]&&console[_0x4f3c48(0x26f)](_0x44fbb5);throw _0x44fbb5;}if(_0xa8727c[_0x4f3c48(0x10d)]||_0xa8727c[_0x4f3c48(0x1c4)]){const _0x20c4d0=this[_0x4f3c48(0x252)](_0x395bc4,_0x18bc6a);await handleSDKOutput([_0x20c4d0],_0xa8727c);return;}const _0x3ef686=_0x3c942b['context'][_0x4f3c48(0x241)],_0x43a92d=this[_0x4f3c48(0x1f2)](_0x395bc4,_0x18bc6a,_0x3ef686);console[_0x4f3c48(0x204)](_0x43a92d);}async['pollTimeline'](_0x5d2b1b,_0x4b5032){const _0x2316e2=a54_0x3a8226,{tdx:_0x15e90f}=_0x5d2b1b,_0x5e7f94=TIMELINE_CONFIG[_0x2316e2(0x1dd)],_0x4c7448=TIMELINE_CONFIG[_0x2316e2(0x193)];let _0x3a1ffa=0x0;while(_0x3a1ffa<_0x4c7448){process['stdout']['isTTY']&&process[_0x2316e2(0x1f6)][_0x2316e2(0x1a7)]('\x1bc');let _0x55ea58,_0x33a6d9;try{[_0x55ea58,_0x33a6d9]=await Promise[_0x2316e2(0x1ac)]([_0x15e90f[_0x2316e2(0x267)][_0x2316e2(0x259)](_0x4b5032),_0x15e90f[_0x2316e2(0x267)][_0x2316e2(0x178)](_0x4b5032,![])]);}catch(_0xb22e00){console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0x227)]('\x0aFailed\x20to\x20fetch\x20attempt\x20data'));_0x3a1ffa>0x0&&console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0xe8)](_0x2316e2(0x213)+_0x3a1ffa));throw _0xb22e00;}const _0x5c5611=_0x15e90f['context'][_0x2316e2(0x241)],_0x1f5845=this[_0x2316e2(0x1f2)](_0x55ea58,_0x33a6d9,_0x5c5611);console[_0x2316e2(0x204)](_0x1f5845);const _0x477280=_0x55ea58['done']&&_0x33a6d9[_0x2316e2(0x25b)](_0x490fd4=>_0x490fd4[_0x2316e2(0x24d)]!=='running'&&_0x490fd4[_0x2316e2(0x24d)]!==_0x2316e2(0x2a3));if(_0x477280){console[_0x2316e2(0x26f)](a54_0x1e596b['green'](_0x2316e2(0x133)));break;}console[_0x2316e2(0x26f)](a54_0x1e596b['dim']('\x0aPolling...\x20('+_0x3a1ffa*0x2+_0x2316e2(0x16a))),await new Promise(_0x483550=>setTimeout(_0x483550,_0x5e7f94)),_0x3a1ffa++;}_0x3a1ffa>=_0x4c7448&&console[_0x2316e2(0x26f)](a54_0x1e596b[_0x2316e2(0x1f4)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a54_0x3a8226(0x1f2)](_0x30849d,_0x537a88,_0x4b7d5d){const _0x1d4c86=a54_0x3a8226,_0x525a74=[],_0x1bb256=TIMELINE_CONFIG['TASK_NAME_WIDTH'],_0x53d8b5=0x5,_0x3f69bf=process[_0x1d4c86(0x1f6)][_0x1d4c86(0x22c)]||0x78,_0x4a3b55=_0x3f69bf-_0x1bb256-_0x53d8b5,_0x21f929=Math[_0x1d4c86(0xf7)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x1d4c86(0x23a)](_0x4a3b55,TIMELINE_CONFIG[_0x1d4c86(0x262)])),_0x42a4c9=new Date(_0x30849d[_0x1d4c86(0x1af)])[_0x1d4c86(0x1a1)](),_0x290ee6=_0x30849d[_0x1d4c86(0x11f)]?new Date(_0x30849d['finishedAt'])[_0x1d4c86(0x1a1)]():Date[_0x1d4c86(0x237)](),_0x437177={'start':_0x42a4c9,'end':_0x290ee6,'duration':_0x290ee6-_0x42a4c9},_0x1360e5=new Map(),_0x2c670f=[];for(const _0x3097b2 of _0x537a88){if(_0x3097b2[_0x1d4c86(0x18e)]){const _0x4d6421=new Date(_0x3097b2[_0x1d4c86(0x18e)])[_0x1d4c86(0x1a1)](),_0x3b63db=_0x3097b2[_0x1d4c86(0x148)]?new Date(_0x3097b2[_0x1d4c86(0x148)])[_0x1d4c86(0x1a1)]():Date[_0x1d4c86(0x237)](),_0x336e27={'start':_0x4d6421,'end':_0x3b63db,'duration':_0x3b63db-_0x4d6421};_0x1360e5[_0x1d4c86(0x277)](_0x3097b2['id'],_0x336e27),_0x2c670f[_0x1d4c86(0x23c)]({'name':_0x3097b2[_0x1d4c86(0x100)],'state':_0x3097b2[_0x1d4c86(0x24d)]||'unknown','window':_0x336e27});}else _0x2c670f[_0x1d4c86(0x23c)]({'name':_0x3097b2[_0x1d4c86(0x100)],'state':_0x3097b2[_0x1d4c86(0x24d)]||'planned','window':undefined});}_0x2c670f[_0x1d4c86(0x1c8)]((_0x3a1b08,_0x886dca)=>{const _0x199baa=_0x1d4c86;if(!_0x3a1b08[_0x199baa(0x15f)])return 0x1;if(!_0x886dca[_0x199baa(0x15f)])return-0x1;return _0x3a1b08[_0x199baa(0x15f)][_0x199baa(0x218)]-_0x886dca[_0x199baa(0x15f)][_0x199baa(0x218)];});const _0x501027=_0x2c670f['length'],_0x569e0f=_0x501027>TIMELINE_CONFIG[_0x1d4c86(0x27c)];_0x569e0f&&_0x2c670f[_0x1d4c86(0x21c)](TIMELINE_CONFIG[_0x1d4c86(0x27c)]);const _0x59c68f=calculateTimeScale(_0x437177,_0x21f929),_0x31b67f=_0x30849d[_0x1d4c86(0x20a)]?_0x30849d['success']?a54_0x1e596b[_0x1d4c86(0xfb)]('success'):a54_0x1e596b[_0x1d4c86(0x227)](_0x1d4c86(0x26f)):a54_0x1e596b['blue'](_0x1d4c86(0x18c)),_0x3a7048=_0x30849d[_0x1d4c86(0x1cb)]?.['id'],_0x4a1a0c=_0x30849d[_0x1d4c86(0x1ff)];let _0x20d363;if(_0x3a7048&&_0x4a1a0c){const _0x40650a=getWorkflowAttemptUrl(_0x4b7d5d,_0x3a7048,_0x4a1a0c,_0x30849d['id']);_0x20d363=hyperlink(a54_0x1e596b[_0x1d4c86(0xe8)](_0x30849d['id']),_0x40650a);}else _0x20d363=a54_0x1e596b[_0x1d4c86(0xe8)](_0x30849d['id']);_0x525a74[_0x1d4c86(0x23c)](_0x1d4c86(0x1b7)+_0x20d363+_0x1d4c86(0xfe)+_0x31b67f+_0x1d4c86(0xfe)+formatElapsed(_0x437177[_0x1d4c86(0x197)]));if(_0x2c670f[_0x1d4c86(0x294)]>0x0){const _0x4ce0af=renderTimeAxis(_0x59c68f,_0x21f929),_0x11cddf=new Date(_0x437177[_0x1d4c86(0x218)]),_0x1b6532=formatDate(_0x11cddf),_0x248b87=TIMELINE_CONFIG[_0x1d4c86(0x186)]+TIMELINE_CONFIG['ICON_SPACING']+_0x1bb256,_0x2aaefe=_0x1b6532[_0x1d4c86(0x1fc)](_0x248b87),_0x589775=a54_0x1e596b[_0x1d4c86(0xe8)](_0x2aaefe);_0x525a74['push'](_0x589775+'\x20'+_0x4ce0af);for(const _0x54bbf5 of _0x2c670f){_0x525a74['push'](renderTaskRow(_0x54bbf5,_0x59c68f,_0x21f929,_0x1bb256));}const _0x514448=calculateStats(_0x2c670f);_0x525a74['push'](formatStats(_0x514448)),_0x569e0f&&_0x525a74[_0x1d4c86(0x23c)](a54_0x1e596b[_0x1d4c86(0x1f4)](_0x1d4c86(0x1fd)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x1d4c86(0x217)+_0x501027+_0x1d4c86(0x225))),_0x525a74[_0x1d4c86(0x23c)](''),_0x525a74['push'](a54_0x1e596b[_0x1d4c86(0xe8)](_0x1d4c86(0x14c))+('tdx\x20wf\x20attempt\x20'+_0x30849d['id']+_0x1d4c86(0x198))+a54_0x1e596b[_0x1d4c86(0xe8)](_0x1d4c86(0x102)));}else _0x525a74[_0x1d4c86(0x23c)](_0x1d4c86(0x23d));return _0x525a74[_0x1d4c86(0x258)]('\x0a');}['buildTimelineData'](_0x1e59b0,_0x3ccea9){const _0x5eb7d5=a54_0x3a8226,_0x314f71=new Date(_0x1e59b0[_0x5eb7d5(0x1af)])[_0x5eb7d5(0x1a1)](),_0x28adb5=_0x1e59b0[_0x5eb7d5(0x11f)]?new Date(_0x1e59b0['finishedAt'])['getTime']():Date[_0x5eb7d5(0x237)](),_0x13cc46=_0x28adb5-_0x314f71,_0x1d0a5e=[];for(const _0x19bb8f of _0x3ccea9){if(_0x19bb8f['startedAt']){const _0x806f1e=new Date(_0x19bb8f[_0x5eb7d5(0x18e)])[_0x5eb7d5(0x1a1)](),_0x48e109=_0x19bb8f['updatedAt']?new Date(_0x19bb8f[_0x5eb7d5(0x148)])[_0x5eb7d5(0x1a1)]():Date['now']();_0x1d0a5e['push']({'name':_0x19bb8f[_0x5eb7d5(0x100)],'state':_0x19bb8f[_0x5eb7d5(0x24d)]||_0x5eb7d5(0x2ac),'window':{'start':_0x806f1e,'end':_0x48e109,'duration':_0x48e109-_0x806f1e}});}else _0x1d0a5e[_0x5eb7d5(0x23c)]({'name':_0x19bb8f[_0x5eb7d5(0x100)],'state':_0x19bb8f[_0x5eb7d5(0x24d)]||'planned','window':undefined});}const _0x3dc4ae=calculateStats(_0x1d0a5e);return{'attempt':{'id':_0x1e59b0['id'],'status':_0x1e59b0[_0x5eb7d5(0x20a)]?_0x1e59b0[_0x5eb7d5(0x1b0)]?'success':'error':_0x5eb7d5(0x18c),'createdAt':_0x1e59b0[_0x5eb7d5(0x1af)],'finishedAt':_0x1e59b0['finishedAt'],'duration_ms':_0x13cc46},'tasks':_0x1d0a5e['map'](_0x4f2ca5=>({'name':_0x4f2ca5[_0x5eb7d5(0xf9)],'state':_0x4f2ca5[_0x5eb7d5(0x24d)],'startedAt':_0x4f2ca5[_0x5eb7d5(0x15f)]?new Date(_0x4f2ca5[_0x5eb7d5(0x15f)][_0x5eb7d5(0x218)])['toISOString']():null,'updatedAt':_0x4f2ca5[_0x5eb7d5(0x15f)]?new Date(_0x4f2ca5['window'][_0x5eb7d5(0x209)])['toISOString']():null,'duration_ms':_0x4f2ca5[_0x5eb7d5(0x15f)]?.['duration']||null})),'stats':_0x3dc4ae};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0xef);[a54_0x3a8226(0x27b)]='List\x20workflow\x20schedules';async['execute'](_0x1d5cf9){const _0x3cabbb=a54_0x3a8226,{options:_0x2ca42d,tdx:_0x2054fa}=_0x1d5cf9,_0x3be3c3=await withSpinner(_0x3cabbb(0x29f),()=>_0x2054fa[_0x3cabbb(0x267)]['listSchedules'](),{'verbose':_0x2ca42d[_0x3cabbb(0x272)]}),_0x275040=_0x3be3c3['data'];console[_0x3cabbb(0x26f)]('✔\x20Found\x20'+_0x275040[_0x3cabbb(0x294)]+_0x3cabbb(0x25e)+(_0x275040['length']!==0x1?'s':''));if(isStructuredFormat(_0x2ca42d))await handleSDKOutput(_0x275040,_0x2ca42d);else{if(_0x275040[_0x3cabbb(0x294)]===0x0)console[_0x3cabbb(0x204)](_0x3cabbb(0x1c5));else for(const _0x50dada of _0x275040){const _0x30635b=_0x50dada[_0x3cabbb(0x1f1)]?a54_0x1e596b[_0x3cabbb(0x1f4)](_0x3cabbb(0x17c)):'',_0x19b5e3=_0x50dada['project']?.['name']?a54_0x1e596b[_0x3cabbb(0xe8)]('\x20['+_0x50dada['project']['name']+']'):'',_0x2afb0f=_0x50dada[_0x3cabbb(0x24c)]?a54_0x1e596b['dim']('\x20next:\x20'+new Date(_0x50dada[_0x3cabbb(0x24c)])[_0x3cabbb(0x145)]()):'';console[_0x3cabbb(0x204)](_0x3cabbb(0x172)+_0x50dada['id']+'\x20'+(_0x50dada[_0x3cabbb(0x267)]?.[_0x3cabbb(0xf9)]||_0x3cabbb(0x14a))+_0x19b5e3+_0x30635b+_0x2afb0f);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x192);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1b6);async[a54_0x3a8226(0x1cd)](_0x1822c4){const _0x308b88=a54_0x3a8226,{options:_0x3c20ad,args:_0x42fcdb,tdx:_0x24332a}=_0x1822c4,_0x54d2a5=_0x42fcdb[0x0];if(!_0x54d2a5)return console['error'](a54_0x1e596b[_0x308b88(0x227)](_0x308b88(0x23e)),_0x308b88(0x188)),console[_0x308b88(0x26f)](a54_0x1e596b['dim'](_0x308b88(0xed))),console[_0x308b88(0x26f)](a54_0x1e596b[_0x308b88(0xe8)](_0x308b88(0x22a))),0x1;const _0x38c5eb=await withSpinner(_0x308b88(0x103)+_0x54d2a5+_0x308b88(0x1f9),()=>_0x24332a[_0x308b88(0x267)][_0x308b88(0x139)](_0x54d2a5),{'verbose':_0x3c20ad[_0x308b88(0x272)]}),_0xa540fd=_0x38c5eb['data'];return isStructuredFormat(_0x3c20ad)?await handleSingleObjectOutput(_0xa540fd,_0x3c20ad):(console[_0x308b88(0x204)](_0x308b88(0x264)+_0x54d2a5+'\x20enabled\x20('+(_0xa540fd['workflow']?.['name']||_0x308b88(0x2ac))+')'),_0xa540fd[_0x308b88(0x24c)]&&console[_0x308b88(0x204)](a54_0x1e596b[_0x308b88(0xe8)](_0x308b88(0x1a3)+new Date(_0xa540fd[_0x308b88(0x24c)])[_0x308b88(0x145)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x3a8226(0xf9)]=a54_0x3a8226(0x191);[a54_0x3a8226(0x27b)]=a54_0x3a8226(0x1dc);async[a54_0x3a8226(0x1cd)](_0x283c7a){const _0x25fdb2=a54_0x3a8226,{options:_0x2f154d,args:_0x2e1672,tdx:_0x1d00c1}=_0x283c7a,_0x608607=_0x2e1672[0x0];if(!_0x608607)return console['error'](a54_0x1e596b['red'](_0x25fdb2(0x23e)),_0x25fdb2(0x188)),console[_0x25fdb2(0x26f)](a54_0x1e596b[_0x25fdb2(0xe8)]('Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>')),console[_0x25fdb2(0x26f)](a54_0x1e596b[_0x25fdb2(0xe8)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x2bc74c=await withSpinner(_0x25fdb2(0x1b8)+_0x608607+_0x25fdb2(0x1f9),()=>_0x1d00c1['workflow'][_0x25fdb2(0x11a)](_0x608607),{'verbose':_0x2f154d[_0x25fdb2(0x272)]}),_0x5e8ec2=_0x2bc74c[_0x25fdb2(0x1ba)];return isStructuredFormat(_0x2f154d)?await handleSingleObjectOutput(_0x5e8ec2,_0x2f154d):console['log'](_0x25fdb2(0x264)+_0x608607+_0x25fdb2(0x123)+(_0x5e8ec2[_0x25fdb2(0x267)]?.[_0x25fdb2(0xf9)]||'unknown')+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0xe9f8e7,_0xb780ee){const _0x5accc9=a55_0x1ff3,_0x5dd0cf=_0xe9f8e7();while(!![]){try{const _0x127958=-parseInt(_0x5accc9(0x131))/0x1+parseInt(_0x5accc9(0x12b))/0x2+-parseInt(_0x5accc9(0x135))/0x3*(parseInt(_0x5accc9(0x136))/0x4)+-parseInt(_0x5accc9(0x12a))/0x5+parseInt(_0x5accc9(0x132))/0x6*(-parseInt(_0x5accc9(0x13d))/0x7)+-parseInt(_0x5accc9(0x12f))/0x8*(-parseInt(_0x5accc9(0x12c))/0x9)+parseInt(_0x5accc9(0x133))/0xa*(parseInt(_0x5accc9(0x138))/0xb);if(_0x127958===_0xb780ee)break;else _0x5dd0cf['push'](_0x5dd0cf['shift']());}catch(_0x369203){_0x5dd0cf['push'](_0x5dd0cf['shift']());}}}(a55_0x44ff,0x4c652));import{platform}from'os';function a55_0x44ff(){const _0x2e2dc6=['tdx',';\x20node/','length','7HoFKAb','X-Trino-User','791230aPNBCq','632604CPRPxa','51885EEsQEv','tdx/','Bearer\x20','48Rsvnas','version','56772scpdjd','1598718rFqCmN','200dpuVUg','TD1\x20','3MlyPYZ','995708CeuGmB','Authorization','380831XvhmbO','replace'];a55_0x44ff=function(){return _0x2e2dc6;};return a55_0x44ff();}import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5b7923=a55_0x1ff3,_0x12ab16=getVersion(),_0x2023c6=platform(),_0x53545d=process[_0x5b7923(0x130)][_0x5b7923(0x139)]('v','');return _0x5b7923(0x12d)+_0x12ab16+'\x20('+_0x2023c6+_0x5b7923(0x13b)+_0x53545d+')';}export function getAuthHeaders(_0x46da36,_0x1c132b,_0x592d1f){const _0x3aaa8a=a55_0x1ff3,_0x221c40=getVersion(),_0x33b36d={'User-Agent':getUserAgent(),'X-TD-Client':_0x3aaa8a(0x13a),'X-TD-Client-Version':_0x221c40};if(_0x592d1f)_0x33b36d[_0x3aaa8a(0x137)]='Bearer\x20'+_0x592d1f;else _0x1c132b&&(_0x33b36d[_0x3aaa8a(0x137)]=_0x3aaa8a(0x134)+_0x1c132b);return _0x33b36d;}export function toHeaderRecord(_0x586ffa){const _0x1c9dba={};for(const [_0x594b0e,_0x2bc4c8]of Object['entries'](_0x586ffa)){_0x2bc4c8!==undefined&&(_0x1c9dba[_0x594b0e]=_0x2bc4c8);}return _0x1c9dba;}function a55_0x1ff3(_0x9235ac,_0x293585){_0x9235ac=_0x9235ac-0x129;const _0x44fff0=a55_0x44ff();let _0x1ff374=_0x44fff0[_0x9235ac];return _0x1ff374;}export function getTrinoHeaders(_0x3a3d14,_0x18b4c1,_0x596b24){const _0x1ced05=a55_0x1ff3,_0x4aef03=getAuthHeaders(_0x3a3d14),_0x5acd5f=toHeaderRecord(_0x4aef03);if(_0x596b24)_0x5acd5f['Authorization']=_0x1ced05(0x12e)+_0x596b24;else _0x18b4c1&&(_0x5acd5f[_0x1ced05(0x129)]=_0x18b4c1);return _0x5acd5f;}export function hasAPIKey(_0x427996){const _0x4c6d91=a55_0x1ff3,_0x4ef384=getAPIKey();return _0x4ef384!==undefined&&_0x4ef384[_0x4c6d91(0x13c)]>0x0;}
1
+ function a55_0x29a7(){const _0x5aea94=['X-Trino-User','TD1\x20','replace','7583565TRzEWy','9gDzBDZ','929914VDgoZC','6ewXAeD','Bearer\x20','length','10038656YUqmsn','tdx/','3241596CSSCeE','4GhzwTV','version','Authorization','58919660JqiErR','2947494xkZmYO','entries','9241799DhuELK'];a55_0x29a7=function(){return _0x5aea94;};return a55_0x29a7();}(function(_0x4fa2b7,_0x3ce18a){const _0x339ba1=a55_0x434a,_0x1318fa=_0x4fa2b7();while(!![]){try{const _0x5ed3ac=-parseInt(_0x339ba1(0xc9))/0x1+-parseInt(_0x339ba1(0xd4))/0x2+-parseInt(_0x339ba1(0xcf))/0x3+parseInt(_0x339ba1(0xd0))/0x4*(-parseInt(_0x339ba1(0xc7))/0x5)+-parseInt(_0x339ba1(0xca))/0x6*(parseInt(_0x339ba1(0xd6))/0x7)+parseInt(_0x339ba1(0xcd))/0x8+parseInt(_0x339ba1(0xc8))/0x9*(parseInt(_0x339ba1(0xd3))/0xa);if(_0x5ed3ac===_0x3ce18a)break;else _0x1318fa['push'](_0x1318fa['shift']());}catch(_0xb7bace){_0x1318fa['push'](_0x1318fa['shift']());}}}(a55_0x29a7,0xc9923));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x462a0a=a55_0x434a,_0x27db97=getVersion(),_0x4ba0b5=platform(),_0x210ce0=process[_0x462a0a(0xd1)][_0x462a0a(0xc6)]('v','');return _0x462a0a(0xce)+_0x27db97+'\x20('+_0x4ba0b5+';\x20node/'+_0x210ce0+')';}export function getAuthHeaders(_0x37269b,_0x32ff98,_0x4815b3){const _0xc2b30c=a55_0x434a,_0x49a4c3=getVersion(),_0x88c91d={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x49a4c3};if(_0x4815b3)_0x88c91d[_0xc2b30c(0xd2)]=_0xc2b30c(0xcb)+_0x4815b3;else _0x32ff98&&(_0x88c91d[_0xc2b30c(0xd2)]=_0xc2b30c(0xd8)+_0x32ff98);return _0x88c91d;}function a55_0x434a(_0xe4a717,_0x1c0f59){_0xe4a717=_0xe4a717-0xc6;const _0x29a755=a55_0x29a7();let _0x434a8a=_0x29a755[_0xe4a717];return _0x434a8a;}export function toHeaderRecord(_0x404c3b){const _0x21ba4d=a55_0x434a,_0x1a84e1={};for(const [_0x27336e,_0x51af1c]of Object[_0x21ba4d(0xd5)](_0x404c3b)){_0x51af1c!==undefined&&(_0x1a84e1[_0x27336e]=_0x51af1c);}return _0x1a84e1;}export function getTrinoHeaders(_0x2a48bc,_0x3c2e17,_0x11d350){const _0xf2be93=a55_0x434a,_0x5769da=getAuthHeaders(_0x2a48bc),_0x51f90c=toHeaderRecord(_0x5769da);if(_0x11d350)_0x51f90c[_0xf2be93(0xd2)]=_0xf2be93(0xcb)+_0x11d350;else _0x3c2e17&&(_0x51f90c[_0xf2be93(0xd7)]=_0x3c2e17);return _0x51f90c;}export function hasAPIKey(_0x455e9e){const _0x1d358e=a55_0x434a,_0x3e0b6a=getAPIKey();return _0x3e0b6a!==undefined&&_0x3e0b6a[_0x1d358e(0xcc)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x542062,_0x190e6f){const _0xe87dc5=a56_0x527c,_0x28972f=_0x542062();while(!![]){try{const _0xa8ed33=parseInt(_0xe87dc5(0x12a))/0x1+parseInt(_0xe87dc5(0x151))/0x2*(parseInt(_0xe87dc5(0x165))/0x3)+parseInt(_0xe87dc5(0x162))/0x4+parseInt(_0xe87dc5(0x125))/0x5*(parseInt(_0xe87dc5(0x14e))/0x6)+-parseInt(_0xe87dc5(0x145))/0x7*(-parseInt(_0xe87dc5(0x15c))/0x8)+parseInt(_0xe87dc5(0x142))/0x9*(-parseInt(_0xe87dc5(0x15f))/0xa)+parseInt(_0xe87dc5(0x128))/0xb*(-parseInt(_0xe87dc5(0x13e))/0xc);if(_0xa8ed33===_0x190e6f)break;else _0x28972f['push'](_0x28972f['shift']());}catch(_0x2243df){_0x28972f['push'](_0x28972f['shift']());}}}(a56_0x27f8,0xb29f9));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x2f23e1 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x499dca){const _0x1e0172=a56_0x527c;return _0x499dca[_0x1e0172(0x12c)]==='json'||_0x499dca[_0x1e0172(0x12c)]===_0x1e0172(0x16b)||_0x499dca[_0x1e0172(0x12c)]===_0x1e0172(0x123)||_0x499dca[_0x1e0172(0x12c)]===_0x1e0172(0x160)||_0x499dca[_0x1e0172(0x127)]===!![]||_0x499dca['jsonl']===!![]||_0x499dca[_0x1e0172(0x123)]===!![]||_0x499dca[_0x1e0172(0x160)]===!![];}function a56_0x27f8(){const _0x59bd48=['296849bDCgNx','padEnd','map','red','filter','string','-FXRSn','push','spawn','426FdhnAf','─┴─','[Object]','75372uRquti','inherit','number','rule','sdk-result','color','resolve','error','split','slice','[rule]','192bwWetm','limit','repeat','7032750mrzteL','table','limitStructuredFormats','4178984dpDyuV','boolean','entries','102GiOasm','data','isTTY','object','magenta','keys','jsonl','write','forEach','pipe','─┬─','close','list','tsv','params','73265amAUkf','bold','json','45855821UKflGk','[query]','1219426nsHVbF','yellow','format','max','join','query','length','cmdout','[logs]','log','noColor','stdin','trim','debug','double','FINISHED','varchar','Results\x20saved\x20to\x20','output','stderr','12dVpVrQ','stringify','[error]','stdout','9eIPTBX','cyan','isInteger'];a56_0x27f8=function(){return _0x59bd48;};return a56_0x27f8();}export function parseOutputOptions(_0x24522e){const _0x822b70=a56_0x527c;return{'format':_0x24522e[_0x822b70(0x12c)]||_0x822b70(0x160),'output':_0x24522e[_0x822b70(0x13c)]||'','limit':_0x24522e[_0x822b70(0x15d)],'limitStructuredFormats':_0x24522e[_0x822b70(0x161)],'color':_0x24522e[_0x822b70(0x156)],'noColor':_0x24522e[_0x822b70(0x134)]};}function convertSDKResultToQueryResult(_0x222f29){const _0x4c568b=a56_0x527c,_0x1d8260=[];if(_0x222f29['length']>0x0){const _0x541c7f=_0x222f29[0x0];for(const [_0x235a52,_0x4b600b]of Object['entries'](_0x541c7f)){let _0x364e50=_0x4c568b(0x13a);if(typeof _0x4b600b===_0x4c568b(0x153))_0x364e50=Number[_0x4c568b(0x144)](_0x4b600b)?'bigint':_0x4c568b(0x138);else{if(typeof _0x4b600b==='boolean')_0x364e50=_0x4c568b(0x163);else _0x4b600b===null&&(_0x364e50=_0x4c568b(0x13a));}_0x1d8260[_0x4c568b(0x14c)]({'name':_0x235a52,'type':_0x364e50});}}return{'queryId':_0x4c568b(0x155),'columns':_0x1d8260,'data':_0x222f29,'stats':{'state':_0x4c568b(0x139),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x222f29[_0x4c568b(0x130)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x372466,_0x282b94){const _0xe96c93=convertSDKResultToQueryResult(_0x372466);return formatQueryOutput(_0xe96c93,_0x282b94);}export async function formatQueryOutput(_0x54d6b3,_0xf6e280){const _0x353e27=a56_0x527c,{format:_0xb1844b,limit:_0x1ffaf8,output:_0x434816,color:_0x33a889,noColor:_0x3d14f4,limitStructuredFormats:_0x1de0e7}=_0xf6e280,_0x3a3a0a=Boolean(_0x434816)&&!_0x33a889,_0x56c0ce={'color':_0x33a889,'noColor':_0x3d14f4||_0x3a3a0a};if(_0xb1844b===_0x353e27(0x160)){const _0x26da2d=shouldUseLess(_0xb1844b,_0x434816);return formatAsTable(_0x54d6b3,_0x1ffaf8,_0x26da2d,_0x56c0ce);}const _0x171815=_0x1de0e7&&Number['isFinite'](_0x1ffaf8)&&_0x54d6b3[_0x353e27(0x166)][_0x353e27(0x130)]>_0x1ffaf8?{..._0x54d6b3,'data':_0x54d6b3[_0x353e27(0x166)][_0x353e27(0x15a)](0x0,_0x1ffaf8)}:_0x54d6b3;if(_0xb1844b===_0x353e27(0x127))return formatAsJSON(_0x171815,_0x56c0ce);else return _0xb1844b===_0x353e27(0x16b)?formatAsJSONL(_0x171815,_0x56c0ce):formatQueryResult(_0x171815,_0xb1844b);}function shouldUseLess(_0x4a0f11,_0x28650e){const _0x3df5e0=a56_0x527c;return(_0x4a0f11===_0x3df5e0(0x160)||_0x4a0f11===_0x3df5e0(0x122))&&process[_0x3df5e0(0x141)][_0x3df5e0(0x167)]&&!_0x28650e;}function a56_0x527c(_0x8cd4f8,_0x56f260){_0x8cd4f8=_0x8cd4f8-0x120;const _0x27f884=a56_0x27f8();let _0x527c23=_0x27f884[_0x8cd4f8];return _0x527c23;}export function resolveOutputOptions(_0x285f22){const _0x84a277=a56_0x527c,_0x5213dd=_0x285f22[_0x84a277(0x13c)]||'',_0xf955da=resolveOutputFormat(_0x285f22[_0x84a277(0x12c)],_0x5213dd,'table');let _0x23be12=typeof _0x285f22[_0x84a277(0x15d)]===_0x84a277(0x153)?_0x285f22[_0x84a277(0x15d)]:parseInt(_0x285f22[_0x84a277(0x15d)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x285f22[_0x84a277(0x15d)]===undefined&&shouldUseLess(_0xf955da,_0x5213dd)&&(_0x23be12=Infinity),{'format':_0xf955da,'output':_0x5213dd,'limit':_0x23be12,'limitStructuredFormats':_0x285f22[_0x84a277(0x161)],'color':_0x285f22[_0x84a277(0x156)],'noColor':_0x285f22[_0x84a277(0x134)]};}export function writeOutput(_0x3e4cd9,_0x24c298,_0x5c4418){const _0x3b0f19=a56_0x527c;return _0x24c298?(writeFileSync(_0x24c298,_0x3e4cd9),console[_0x3b0f19(0x158)](_0x3b0f19(0x13b)+_0x24c298),Promise[_0x3b0f19(0x157)]()):shouldUseLess(_0x5c4418||'','')?new Promise(_0x4626a0=>{const _0x5d96f0=_0x3b0f19,_0x6faeb7=spawn('less',[_0x5d96f0(0x14b)],{'stdio':[_0x5d96f0(0x16e),_0x5d96f0(0x152),_0x5d96f0(0x152)]});let _0xb7165a=![];_0x6faeb7['on'](_0x5d96f0(0x158),()=>{const _0xd20ed8=_0x5d96f0;!_0xb7165a&&(_0xb7165a=!![],console[_0xd20ed8(0x133)](_0x3e4cd9),_0x4626a0());}),_0x6faeb7['on'](_0x5d96f0(0x121),()=>{!_0xb7165a&&(_0xb7165a=!![],_0x4626a0());}),_0x6faeb7['on'](_0x5d96f0(0x14d),()=>{const _0x23d487=_0x5d96f0;!_0xb7165a&&_0x6faeb7[_0x23d487(0x135)]&&(_0x6faeb7[_0x23d487(0x135)]['on'](_0x23d487(0x158),()=>{}),_0x6faeb7[_0x23d487(0x135)][_0x23d487(0x16c)](_0x3e4cd9),_0x6faeb7[_0x23d487(0x135)]['end']());}),!_0x6faeb7[_0x5d96f0(0x135)]&&(!_0xb7165a&&(_0xb7165a=!![],console[_0x5d96f0(0x133)](_0x3e4cd9),_0x4626a0()));}):(console['log'](_0x3e4cd9),Promise['resolve']());}export async function handleSDKOutput(_0x3f79df,_0x1000a4){const _0x12d9c6=a56_0x527c,_0x345677=resolveOutputOptions(_0x1000a4),_0x30067e=await formatSDKOutput(_0x3f79df,_0x345677);await writeOutput(_0x30067e,_0x345677[_0x12d9c6(0x13c)]||undefined,_0x345677[_0x12d9c6(0x12c)]);}export async function handleQueryOutput(_0x162879,_0x5e5212){const _0x349d34=resolveOutputOptions(_0x5e5212),_0x53bd5e=await formatQueryOutput(_0x162879,_0x349d34);await writeOutput(_0x53bd5e,_0x349d34['output']||undefined,_0x349d34['format']);}async function formatSingleObject(_0x38a733,_0x2993aa){const _0x282abd=a56_0x527c,{format:_0x41e392,color:_0x15b903,noColor:_0x101402}=_0x2993aa,_0x47f936={'color':_0x15b903,'noColor':_0x101402};if(_0x41e392===_0x282abd(0x127)){if(shouldUseColor(_0x47f936))return colorizeJSON(_0x38a733,_0x47f936);return JSON[_0x282abd(0x13f)](_0x38a733,null,0x2);}else{if(_0x41e392===_0x282abd(0x16b)){if(shouldUseColor(_0x47f936))return colorizeJSONCompact(_0x38a733,_0x47f936);return JSON[_0x282abd(0x13f)](_0x38a733);}else{if(_0x41e392==='tsv')return Object[_0x282abd(0x164)](_0x38a733)[_0x282abd(0x147)](([_0x43d0ee,_0x27d3d5])=>_0x43d0ee+'\x09'+_0x27d3d5)[_0x282abd(0x12e)]('\x0a');else{const _0x504367=Object[_0x282abd(0x164)](_0x38a733);if(_0x504367[_0x282abd(0x130)]===0x0)return'No\x20data';const _0xbb5f7c=_0x38a733[_0x282abd(0x137)],_0x1b9d39=_0x38a733['query'],_0xaf0c71=_0x38a733[_0x282abd(0x124)],_0x470315=_0x38a733['rule'],_0x4b3dff=_0x1b9d39?typeof _0x1b9d39===_0x282abd(0x14a)?_0x1b9d39:JSON[_0x282abd(0x13f)](_0x1b9d39,null,0x2):undefined,_0xab3e8c=_0xaf0c71&&Object[_0x282abd(0x16a)](_0xaf0c71)[_0x282abd(0x130)]>0x0?JSON['stringify'](_0xaf0c71,null,0x2):undefined,_0x4228f3=_0x470315&&Object[_0x282abd(0x16a)](_0x470315)[_0x282abd(0x130)]>0x0?JSON[_0x282abd(0x13f)](_0x470315,null,0x2):undefined,_0x5bae12=_0x504367[_0x282abd(0x149)](([_0x17eb25])=>_0x17eb25!==_0x282abd(0x137)&&_0x17eb25!==_0x282abd(0x12f)&&_0x17eb25!==_0x282abd(0x124)&&_0x17eb25!==_0x282abd(0x154)),_0x589939=Math[_0x282abd(0x12d)](..._0x5bae12[_0x282abd(0x147)](([_0x1330f3])=>_0x1330f3[_0x282abd(0x130)])),_0x3507f0=Math[_0x282abd(0x12d)](..._0x5bae12[_0x282abd(0x147)](([,_0x1ff903])=>{const _0x1d2678=_0x282abd;try{const _0x2e5b72=_0x1ff903===null||_0x1ff903===undefined?'':typeof _0x1ff903===_0x1d2678(0x168)?JSON[_0x1d2678(0x13f)](_0x1ff903):String(_0x1ff903),_0x4492b7=_0x2e5b72[_0x1d2678(0x159)]('\x0a');return Math[_0x1d2678(0x12d)](..._0x4492b7[_0x1d2678(0x147)](_0x1b3373=>_0x1b3373[_0x1d2678(0x130)]),0x0);}catch{return 0x0;}}),0x14),_0x35886d=[];_0x35886d['push'](colorBorder('┌─'+'─'['repeat'](_0x589939)+_0x282abd(0x120)+'─'['repeat'](_0x3507f0)+'─┐',_0x47f936)),_0x5bae12['forEach'](([_0x449fba,_0x3ae1be])=>{const _0xbb86da=_0x282abd;let _0x5e0e01;try{_0x5e0e01=_0x3ae1be===null||_0x3ae1be===undefined?'':typeof _0x3ae1be==='object'?JSON[_0xbb86da(0x13f)](_0x3ae1be):String(_0x3ae1be);}catch{_0x5e0e01=_0xbb86da(0x150);}const _0x4185e2=_0x449fba[_0xbb86da(0x146)](_0x589939),_0x207071=_0x5e0e01[_0xbb86da(0x159)]('\x0a');_0x207071[_0xbb86da(0x16d)]((_0xeab5cd,_0x4becd6)=>{const _0x53eff6=_0xbb86da,_0x4ff1f1=colorBorder('│',_0x47f936);_0x4becd6===0x0?_0x35886d[_0x53eff6(0x14c)](_0x4ff1f1+'\x20'+_0x4185e2+'\x20'+_0x4ff1f1+'\x20'+_0xeab5cd[_0x53eff6(0x146)](_0x3507f0)+'\x20'+_0x4ff1f1):_0x35886d['push'](_0x4ff1f1+'\x20'+'\x20'[_0x53eff6(0x15e)](_0x589939)+'\x20'+_0x4ff1f1+'\x20'+_0xeab5cd[_0x53eff6(0x146)](_0x3507f0)+'\x20'+_0x4ff1f1);});}),_0x35886d[_0x282abd(0x14c)](colorBorder('└─'+'─'[_0x282abd(0x15e)](_0x589939)+_0x282abd(0x14f)+'─'[_0x282abd(0x15e)](_0x3507f0)+'─┘',_0x47f936));_0x4b3dff&&(_0x35886d['push'](''),_0x35886d[_0x282abd(0x14c)](String(a56_0x2f23e1[_0x282abd(0x12b)][_0x282abd(0x126)](_0x282abd(0x129)))),_0x35886d[_0x282abd(0x14c)](_0x4b3dff));_0xab3e8c&&(_0x35886d[_0x282abd(0x14c)](''),_0x35886d[_0x282abd(0x14c)](String(a56_0x2f23e1['blue'][_0x282abd(0x126)]('[params]'))),_0x35886d[_0x282abd(0x14c)](_0xab3e8c));_0x4228f3&&(_0x35886d[_0x282abd(0x14c)](''),_0x35886d[_0x282abd(0x14c)](String(a56_0x2f23e1[_0x282abd(0x169)][_0x282abd(0x126)](_0x282abd(0x15b)))),_0x35886d[_0x282abd(0x14c)](_0x4228f3));if(_0xbb5f7c){if(_0xbb5f7c['stderr']){_0x35886d[_0x282abd(0x14c)](''),_0x35886d[_0x282abd(0x14c)](String(a56_0x2f23e1[_0x282abd(0x148)][_0x282abd(0x126)](_0x282abd(0x140))));const _0xb03026=_0xbb5f7c[_0x282abd(0x13d)][_0x282abd(0x159)]('\x0a');_0xb03026[_0x282abd(0x16d)](_0x49d981=>{const _0x92b31a=_0x282abd;_0x49d981[_0x92b31a(0x136)]()&&_0x35886d[_0x92b31a(0x14c)](_0x49d981);});}if(_0xbb5f7c[_0x282abd(0x131)]){_0x35886d[_0x282abd(0x14c)](''),_0x35886d['push'](String(a56_0x2f23e1[_0x282abd(0x143)]['bold'](_0x282abd(0x132))));const _0x2020fe=_0xbb5f7c[_0x282abd(0x131)][_0x282abd(0x159)]('\x0a');_0x2020fe[_0x282abd(0x16d)](_0x50ff71=>{const _0x14af3c=_0x282abd;_0x50ff71[_0x14af3c(0x136)]()&&_0x35886d[_0x14af3c(0x14c)](_0x50ff71);});}}return _0x35886d[_0x282abd(0x12e)]('\x0a');}}}}export async function handleSingleObjectOutput(_0xbc148c,_0x42e093){const _0x1cd916=a56_0x527c;if(_0x42e093[_0x1cd916(0x12c)]===_0x1cd916(0x160)){await handleSDKOutput([_0xbc148c],_0x42e093);return;}const _0x5b8030=resolveOutputOptions(_0x42e093),_0x453285=await formatSingleObject(_0xbc148c,_0x5b8030);await writeOutput(_0x453285,_0x5b8030['output']||undefined,_0x5b8030['format']);}
1
+ (function(_0x576b27,_0x44d9d2){const _0xbf205b=a56_0x42d8,_0x30eb5c=_0x576b27();while(!![]){try{const _0x381aeb=parseInt(_0xbf205b(0x109))/0x1*(-parseInt(_0xbf205b(0x14a))/0x2)+-parseInt(_0xbf205b(0x110))/0x3+parseInt(_0xbf205b(0x123))/0x4+-parseInt(_0xbf205b(0x145))/0x5*(parseInt(_0xbf205b(0x104))/0x6)+parseInt(_0xbf205b(0x117))/0x7*(-parseInt(_0xbf205b(0x114))/0x8)+parseInt(_0xbf205b(0x12b))/0x9*(parseInt(_0xbf205b(0x121))/0xa)+parseInt(_0xbf205b(0x127))/0xb;if(_0x381aeb===_0x44d9d2)break;else _0x30eb5c['push'](_0x30eb5c['shift']());}catch(_0x41c1bf){_0x30eb5c['push'](_0x30eb5c['shift']());}}}(a56_0x234e,0x6c421));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a56_0x27e193 from'chalk';function a56_0x42d8(_0x1cfaab,_0x201864){_0x1cfaab=_0x1cfaab-0x100;const _0x234e8d=a56_0x234e();let _0x42d89d=_0x234e8d[_0x1cfaab];return _0x42d89d;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2bec30){const _0x493859=a56_0x42d8;return _0x2bec30['format']===_0x493859(0x118)||_0x2bec30['format']==='jsonl'||_0x2bec30[_0x493859(0x11c)]==='tsv'||_0x2bec30[_0x493859(0x11c)]===_0x493859(0x131)||_0x2bec30[_0x493859(0x118)]===!![]||_0x2bec30[_0x493859(0x100)]===!![]||_0x2bec30[_0x493859(0x149)]===!![]||_0x2bec30[_0x493859(0x131)]===!![];}export function parseOutputOptions(_0x5539a6){const _0x27294e=a56_0x42d8;return{'format':_0x5539a6['format']||'table','output':_0x5539a6[_0x27294e(0x129)]||'','limit':_0x5539a6[_0x27294e(0x105)],'limitStructuredFormats':_0x5539a6['limitStructuredFormats'],'color':_0x5539a6[_0x27294e(0x147)],'noColor':_0x5539a6['noColor']};}function convertSDKResultToQueryResult(_0x6abf8f){const _0x26234a=a56_0x42d8,_0x2c57ee=[];if(_0x6abf8f[_0x26234a(0x101)]>0x0){const _0x174a4d=_0x6abf8f[0x0];for(const [_0x14f00a,_0x580c86]of Object[_0x26234a(0x12a)](_0x174a4d)){let _0x4200b1=_0x26234a(0x140);if(typeof _0x580c86===_0x26234a(0x134))_0x4200b1=Number[_0x26234a(0x124)](_0x580c86)?_0x26234a(0x103):_0x26234a(0x102);else{if(typeof _0x580c86==='boolean')_0x4200b1=_0x26234a(0x135);else _0x580c86===null&&(_0x4200b1=_0x26234a(0x140));}_0x2c57ee[_0x26234a(0x13f)]({'name':_0x14f00a,'type':_0x4200b1});}}return{'queryId':_0x26234a(0x146),'columns':_0x2c57ee,'data':_0x6abf8f,'stats':{'state':_0x26234a(0x125),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x6abf8f['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x170dda,_0x26118b){const _0x392c14=convertSDKResultToQueryResult(_0x170dda);return formatQueryOutput(_0x392c14,_0x26118b);}export async function formatQueryOutput(_0x554264,_0x70382b){const _0x2df624=a56_0x42d8,{format:_0x2eabdc,limit:_0x2e4841,output:_0x45c4fb,color:_0x51cfac,noColor:_0x5ad1ff,limitStructuredFormats:_0x36d9fc}=_0x70382b,_0x4dd923=Boolean(_0x45c4fb)&&!_0x51cfac,_0x12aa2c={'color':_0x51cfac,'noColor':_0x5ad1ff||_0x4dd923};if(_0x2eabdc==='table'){const _0x48feeb=shouldUseLess(_0x2eabdc,_0x45c4fb);return formatAsTable(_0x554264,_0x2e4841,_0x48feeb,_0x12aa2c);}const _0x3e1f9a=_0x36d9fc&&Number['isFinite'](_0x2e4841)&&_0x554264['data'][_0x2df624(0x101)]>_0x2e4841?{..._0x554264,'data':_0x554264[_0x2df624(0x13c)][_0x2df624(0x10a)](0x0,_0x2e4841)}:_0x554264;if(_0x2eabdc==='json')return formatAsJSON(_0x3e1f9a,_0x12aa2c);else return _0x2eabdc==='jsonl'?formatAsJSONL(_0x3e1f9a,_0x12aa2c):formatQueryResult(_0x3e1f9a,_0x2eabdc);}function shouldUseLess(_0x183d73,_0x19ab9d){const _0x464535=a56_0x42d8;return(_0x183d73===_0x464535(0x131)||_0x183d73===_0x464535(0x11e))&&process[_0x464535(0x106)][_0x464535(0x133)]&&!_0x19ab9d;}export function resolveOutputOptions(_0x161810){const _0x3e29e6=a56_0x42d8,_0x4e8d56=_0x161810[_0x3e29e6(0x129)]||'',_0x338535=resolveOutputFormat(_0x161810[_0x3e29e6(0x11c)],_0x4e8d56,'table');let _0x1e3ffc=typeof _0x161810[_0x3e29e6(0x105)]===_0x3e29e6(0x134)?_0x161810['limit']:parseInt(_0x161810['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x161810[_0x3e29e6(0x105)]===undefined&&shouldUseLess(_0x338535,_0x4e8d56)&&(_0x1e3ffc=Infinity),{'format':_0x338535,'output':_0x4e8d56,'limit':_0x1e3ffc,'limitStructuredFormats':_0x161810[_0x3e29e6(0x13a)],'color':_0x161810[_0x3e29e6(0x147)],'noColor':_0x161810['noColor']};}export function writeOutput(_0x7a338b,_0x125f11,_0x2d708a){const _0x5c8c63=a56_0x42d8;return _0x125f11?(writeFileSync(_0x125f11,_0x7a338b),console[_0x5c8c63(0x138)](_0x5c8c63(0x112)+_0x125f11),Promise[_0x5c8c63(0x107)]()):shouldUseLess(_0x2d708a||'','')?new Promise(_0x4f73a8=>{const _0x3aa625=_0x5c8c63,_0x14bb2b=spawn(_0x3aa625(0x141),[_0x3aa625(0x126)],{'stdio':[_0x3aa625(0x144),_0x3aa625(0x13b),_0x3aa625(0x13b)]});let _0x137341=![];_0x14bb2b['on'](_0x3aa625(0x138),()=>{!_0x137341&&(_0x137341=!![],console['log'](_0x7a338b),_0x4f73a8());}),_0x14bb2b['on'](_0x3aa625(0x130),()=>{!_0x137341&&(_0x137341=!![],_0x4f73a8());}),_0x14bb2b['on']('spawn',()=>{const _0x19ecdc=_0x3aa625;!_0x137341&&_0x14bb2b[_0x19ecdc(0x10e)]&&(_0x14bb2b[_0x19ecdc(0x10e)]['on'](_0x19ecdc(0x138),()=>{}),_0x14bb2b[_0x19ecdc(0x10e)][_0x19ecdc(0x113)](_0x7a338b),_0x14bb2b[_0x19ecdc(0x10e)]['end']());}),!_0x14bb2b[_0x3aa625(0x10e)]&&(!_0x137341&&(_0x137341=!![],console[_0x3aa625(0x11b)](_0x7a338b),_0x4f73a8()));}):(console[_0x5c8c63(0x11b)](_0x7a338b),Promise[_0x5c8c63(0x107)]());}function a56_0x234e(){const _0x5325f6=['3137964fDjVXR','isInteger','FINISHED','-FXRSn','9635615pzFmVG','string','output','entries','297KualAw','magenta','─┴─','split','debug','close','table','[error]','isTTY','number','boolean','[logs]','[Object]','error','map','limitStructuredFormats','inherit','data','rule','max','push','varchar','less','filter','stringify','pipe','5KBQhPF','sdk-result','color','forEach','tsv','858fDVlOE','jsonl','length','double','bigint','497166CHbTdR','limit','stdout','resolve','blue','1378tiLcMw','slice','[params]','join','padEnd','stdin','repeat','1419027FOUMRt','query','Results\x20saved\x20to\x20','write','168sRtYKz','params','cmdout','264068QKvQkf','json','bold','No\x20data','log','format','stderr','list','trim','keys','218850LioznL','─┬─'];a56_0x234e=function(){return _0x5325f6;};return a56_0x234e();}export async function handleSDKOutput(_0x33609c,_0x92e98f){const _0xbc4b95=a56_0x42d8,_0x5c6d76=resolveOutputOptions(_0x92e98f),_0x50082f=await formatSDKOutput(_0x33609c,_0x5c6d76);await writeOutput(_0x50082f,_0x5c6d76[_0xbc4b95(0x129)]||undefined,_0x5c6d76['format']);}export async function handleQueryOutput(_0x1945d2,_0x1bb352){const _0x415722=a56_0x42d8,_0x571fb4=resolveOutputOptions(_0x1bb352),_0x59fed7=await formatQueryOutput(_0x1945d2,_0x571fb4);await writeOutput(_0x59fed7,_0x571fb4[_0x415722(0x129)]||undefined,_0x571fb4[_0x415722(0x11c)]);}async function formatSingleObject(_0x1e73a1,_0x3d13a4){const _0x4c594c=a56_0x42d8,{format:_0x3a89ed,color:_0x40e164,noColor:_0x1c6c1f}=_0x3d13a4,_0x96b809={'color':_0x40e164,'noColor':_0x1c6c1f};if(_0x3a89ed===_0x4c594c(0x118)){if(shouldUseColor(_0x96b809))return colorizeJSON(_0x1e73a1,_0x96b809);return JSON[_0x4c594c(0x143)](_0x1e73a1,null,0x2);}else{if(_0x3a89ed==='jsonl'){if(shouldUseColor(_0x96b809))return colorizeJSONCompact(_0x1e73a1,_0x96b809);return JSON[_0x4c594c(0x143)](_0x1e73a1);}else{if(_0x3a89ed===_0x4c594c(0x149))return Object[_0x4c594c(0x12a)](_0x1e73a1)[_0x4c594c(0x139)](([_0x2c8825,_0x365eea])=>_0x2c8825+'\x09'+_0x365eea)[_0x4c594c(0x10c)]('\x0a');else{const _0x2d51ca=Object[_0x4c594c(0x12a)](_0x1e73a1);if(_0x2d51ca[_0x4c594c(0x101)]===0x0)return _0x4c594c(0x11a);const _0x1c3efc=_0x1e73a1[_0x4c594c(0x12f)],_0x26b19b=_0x1e73a1['query'],_0x31817e=_0x1e73a1[_0x4c594c(0x115)],_0x2af90c=_0x1e73a1[_0x4c594c(0x13d)],_0x24dcaf=_0x26b19b?typeof _0x26b19b===_0x4c594c(0x128)?_0x26b19b:JSON[_0x4c594c(0x143)](_0x26b19b,null,0x2):undefined,_0x263076=_0x31817e&&Object['keys'](_0x31817e)[_0x4c594c(0x101)]>0x0?JSON[_0x4c594c(0x143)](_0x31817e,null,0x2):undefined,_0x5bee44=_0x2af90c&&Object[_0x4c594c(0x120)](_0x2af90c)[_0x4c594c(0x101)]>0x0?JSON[_0x4c594c(0x143)](_0x2af90c,null,0x2):undefined,_0x21ff38=_0x2d51ca[_0x4c594c(0x142)](([_0x77cb24])=>_0x77cb24!=='debug'&&_0x77cb24!==_0x4c594c(0x111)&&_0x77cb24!==_0x4c594c(0x115)&&_0x77cb24!=='rule'),_0x6c3d09=Math['max'](..._0x21ff38['map'](([_0x261a9e])=>_0x261a9e[_0x4c594c(0x101)])),_0x2869ba=Math[_0x4c594c(0x13e)](..._0x21ff38[_0x4c594c(0x139)](([,_0xd4adec])=>{const _0x11683a=_0x4c594c;try{const _0x48d4e3=_0xd4adec===null||_0xd4adec===undefined?'':typeof _0xd4adec==='object'?JSON['stringify'](_0xd4adec):String(_0xd4adec),_0x12dcb1=_0x48d4e3[_0x11683a(0x12e)]('\x0a');return Math['max'](..._0x12dcb1[_0x11683a(0x139)](_0x4b57a1=>_0x4b57a1[_0x11683a(0x101)]),0x0);}catch{return 0x0;}}),0x14),_0xa16272=[];_0xa16272[_0x4c594c(0x13f)](colorBorder('┌─'+'─'[_0x4c594c(0x10f)](_0x6c3d09)+_0x4c594c(0x122)+'─'[_0x4c594c(0x10f)](_0x2869ba)+'─┐',_0x96b809)),_0x21ff38[_0x4c594c(0x148)](([_0x49b385,_0x4d7ea5])=>{const _0x312d73=_0x4c594c;let _0x54789;try{_0x54789=_0x4d7ea5===null||_0x4d7ea5===undefined?'':typeof _0x4d7ea5==='object'?JSON[_0x312d73(0x143)](_0x4d7ea5):String(_0x4d7ea5);}catch{_0x54789=_0x312d73(0x137);}const _0x3bf8d3=_0x49b385[_0x312d73(0x10d)](_0x6c3d09),_0x21c661=_0x54789[_0x312d73(0x12e)]('\x0a');_0x21c661[_0x312d73(0x148)]((_0x3064d3,_0x300da2)=>{const _0x3ad413=_0x312d73,_0x47ad03=colorBorder('│',_0x96b809);_0x300da2===0x0?_0xa16272[_0x3ad413(0x13f)](_0x47ad03+'\x20'+_0x3bf8d3+'\x20'+_0x47ad03+'\x20'+_0x3064d3['padEnd'](_0x2869ba)+'\x20'+_0x47ad03):_0xa16272['push'](_0x47ad03+'\x20'+'\x20'[_0x3ad413(0x10f)](_0x6c3d09)+'\x20'+_0x47ad03+'\x20'+_0x3064d3['padEnd'](_0x2869ba)+'\x20'+_0x47ad03);});}),_0xa16272[_0x4c594c(0x13f)](colorBorder('└─'+'─'['repeat'](_0x6c3d09)+_0x4c594c(0x12d)+'─'['repeat'](_0x2869ba)+'─┘',_0x96b809));_0x24dcaf&&(_0xa16272['push'](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193['yellow'][_0x4c594c(0x119)]('[query]'))),_0xa16272['push'](_0x24dcaf));_0x263076&&(_0xa16272['push'](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193[_0x4c594c(0x108)][_0x4c594c(0x119)](_0x4c594c(0x10b)))),_0xa16272[_0x4c594c(0x13f)](_0x263076));_0x5bee44&&(_0xa16272[_0x4c594c(0x13f)](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193[_0x4c594c(0x12c)][_0x4c594c(0x119)]('[rule]'))),_0xa16272['push'](_0x5bee44));if(_0x1c3efc){if(_0x1c3efc[_0x4c594c(0x11d)]){_0xa16272[_0x4c594c(0x13f)](''),_0xa16272[_0x4c594c(0x13f)](String(a56_0x27e193['red'][_0x4c594c(0x119)](_0x4c594c(0x132))));const _0x2fd8d1=_0x1c3efc[_0x4c594c(0x11d)][_0x4c594c(0x12e)]('\x0a');_0x2fd8d1['forEach'](_0x430b9c=>{const _0x410c81=_0x4c594c;_0x430b9c[_0x410c81(0x11f)]()&&_0xa16272[_0x410c81(0x13f)](_0x430b9c);});}if(_0x1c3efc[_0x4c594c(0x116)]){_0xa16272[_0x4c594c(0x13f)](''),_0xa16272['push'](String(a56_0x27e193['cyan'][_0x4c594c(0x119)](_0x4c594c(0x136))));const _0x4b2114=_0x1c3efc['cmdout'][_0x4c594c(0x12e)]('\x0a');_0x4b2114[_0x4c594c(0x148)](_0x2612b6=>{const _0x2077dd=_0x4c594c;_0x2612b6[_0x2077dd(0x11f)]()&&_0xa16272[_0x2077dd(0x13f)](_0x2612b6);});}}return _0xa16272['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x2f9c21,_0x482237){const _0x4339e3=a56_0x42d8;if(_0x482237[_0x4339e3(0x11c)]===_0x4339e3(0x131)){await handleSDKOutput([_0x2f9c21],_0x482237);return;}const _0x44114e=resolveOutputOptions(_0x482237),_0x445dc7=await formatSingleObject(_0x2f9c21,_0x44114e);await writeOutput(_0x445dc7,_0x44114e[_0x4339e3(0x129)]||undefined,_0x44114e['format']);}