@treasuredata/tdx 2026.4.0 → 2026.4.1

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_0x130479=a54_0x5811;(function(_0x50f2f1,_0x2f5f55){const _0x39b3c9=a54_0x5811,_0x116800=_0x50f2f1();while(!![]){try{const _0x3ff156=-parseInt(_0x39b3c9(0x342))/0x1*(parseInt(_0x39b3c9(0x1f1))/0x2)+parseInt(_0x39b3c9(0x383))/0x3*(parseInt(_0x39b3c9(0x1f6))/0x4)+-parseInt(_0x39b3c9(0x390))/0x5+-parseInt(_0x39b3c9(0x28e))/0x6+parseInt(_0x39b3c9(0x304))/0x7*(-parseInt(_0x39b3c9(0x265))/0x8)+-parseInt(_0x39b3c9(0x322))/0x9*(-parseInt(_0x39b3c9(0x323))/0xa)+parseInt(_0x39b3c9(0x382))/0xb;if(_0x3ff156===_0x2f5f55)break;else _0x116800['push'](_0x116800['shift']());}catch(_0x556887){_0x116800['push'](_0x116800['shift']());}}}(a54_0x2dfb,0xd5a15));import a54_0x47fe92 from'chalk';import{existsSync}from'fs';import a54_0x5d886b 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';function a54_0x2dfb(){const _0x4cd072=['site','Error:','targetDir','MIN_TIMELINE_WIDTH','state','includeSubtasks','Reason:\x20','map','Downloading\x20project\x20','150088BKhtTg','Deleting\x20project\x20','Revision:\x20','Getting\x20attempt\x20details...','hasChanges','Resume\x20from:\x20','Secrets\x20to\x20set:\x20','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Workflow:\x20','Filter:\x20','skipValidation','Filter:\x20project=','from','force','length','No\x20workflows\x20found\x20in\x20project:\x20',',\x20Workflow:\x20','Include\x20retried:\x20yes','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','generateSessionTimelineRows','toLowerCase','name','summary','ICON_SPACING','prepareCloneProject','MIN_LABEL_COUNT','LABEL_WIDTH_DIVISOR','\x20modified','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]','\x0aClone\x20\x22','pullProject','isDirectory','workflow:retry','workflow:run','Latest\x20session\x20has\x20no\x20attempt','Retrying\x20session...','\x1b[1A\x1b[2K','Project:\x20','filesExtracted','yellow','9487128VtiiRG','getTime','✔\x20Project\x20updated','Workflow:\x20','applyPullProject','No\x20attempts\x20found\x20for:\x20','all','\x20secrets...','fs/promises','No\x20workflow\x20tdx.json\x20found','project','-\x20no\x20files\x20written','isNewProject','\x20workflow','✔\x20Retry\x20started','revision:\x20','some','workflow:pull','\x20(disabled)','Select\x20a\x20session\x20to\x20view\x20timeline:','Using\x20attempt\x20','✔\x20Secret\x20\x27','\x20\x20Next\x20run:\x20','attemptId','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','listSecrets','\x20\x20Session\x20ID:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','start','workflow','\x22\x20already\x20exists\x20(ID:\x20','duration','\x20\x20Source:\x20','.\x20Expected\x20format:\x20KEY=VALUE','List\x20all\x20workflow\x20projects','delete','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','max','durationMs','green','rows','\x0a⚠\x20Project\x20\x22','Error:\x20Secret\x20key\x20is\x20required','No\x20workflows\x20found','\x20(system)','startsWith','getDate','reason','\x22\x20to\x20new\x20project\x20\x22','No\x20workflow\x20projects\x20found','logFiles','renderTimeline','targetExists','type','cyan','sourceDir','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Loading\x20workflows...','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','buildTimelineData','resolveProject','jsonl','\x20\x20Location:\x20','Parameters:\x20','Project\x20directory:\x20','dryRun','\x20session','projectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Auto-selected\x20latest\x20session:\x20','Files\x20to\x20upload:\x20','resolveProjectDir','...','pending','parse','modified','Source\x20directory:\x20','renderSessionsTimeline','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','utf-8','group_error','workflow:push','startedAt','\x0aDry\x20run\x20-\x20no\x20files\x20written','getFullYear','newProjectName','showWorkflowConsoleUrl','Pushing\x20workflow\x20project...','(unknown)','disabledAt','Including\x20subtasks:\x20yes','dim','sessionId','end','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Disable\x20a\x20workflow\x20schedule','preparePushProject','navigateSessionsInteractive','sys','\x20\x20Console:\x20','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','path','fullName','projects','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','select','repeat','No\x20log\x20content\x20found','cwd','workflow:upload','Dry\x20run:\x20yes','relative','workflow:secrets:set','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','Project\x20name\x20is\x20required','log','28jJokLT','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Validation:\x20skipped','✔\x20Schedule\x20#','projectId','json','Pattern:\x20','\x20deleted','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','workflow:attempt','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','\x27...','resolve','📅\x20#','Enabling\x20schedule\x20#','planned','isTTY','fill','min','updatedAt','\x20tasks','slice','parseProjectWorkflowPattern','format','\x20\x20Project\x20ID:\x20','Listing\x20secrets...','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','trimEnd','From\x20task:\x20','\x20\x20Target:\x20','2547yTyoMY','17370itAQcs','retryAttemptName','TASK_NAME_WIDTH','fileCount','pollTimeline','stdout','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','localeCompare','Error:\x20Attempt\x20ID\x20is\x20required','filter','resumeFrom','Task\x20name:\x20','workflow:delete','attempts','\x20new','Deleting\x20secret...','Attempt\x20ID:\x20','Failed\x20to\x20fetch\x20attempt\x20data','Source\x20directory\x20is\x20required','success','-\x20nothing\x20pushed','Session\x20time:\x20','padStart','splice','Listing\x20schedules...','Error:\x20','Listing\x20workflow\x20attempts...','List\x20workflows','Expected\x20format:\x20--param\x20key=value','limit','12zsXaAB','includeRetried','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/app/workflows/','startTime','✔\x20Downloaded\x20','No\x20sessions\x20found','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>','session','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Cloning\x20to\x20','workflow:timeline','index','text','\x20task','New\x20project\x20name:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','Downloading\x20logs...','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20logs','toLocaleString','attempt','workflow:tasks','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','yes','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','Start\x20a\x20workflow\x20run','\x0aDry\x20run\x20-\x20nothing\x20pushed','params','renderSingleTimeline','tdx.json','createdAt','Loading\x20sessions...','⚠\x20Showing\x20first\x20','window','Source\x20project:\x20','workflow:sessions','📋\x20','Updating\x20','MAX_TASKS_DISPLAY','attempt:','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','data','✔\x20Pull\x20complete','workflow:workflows','new','icon','\x20-\x20','Cancelled','description','set','\x20has\x20no\x20attempts','Source:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20workflow\x20sessions\x20found','floor','workflowProject','\x20sessions\x20','Session\x20not\x20found:\x20','Params:\x20','workflow:attempts','45402940kRtHOS','3XoQaqJ','deleted','list','unchanged','nextRunTime','\x20\x20Session\x20context\x20set\x20to:\x20','\x20schedule','workflow:logs','done','unknown','Key:\x20','GUTTER','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','6302935kQoMji','\x0aError:','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','✔\x20Found\x20','Project\x20name:\x20','\x20\x20Revision:\x20','Killing\x20attempt...','Tip:\x20cd\x20to\x20workflows/','find','verbose','disableSchedule','listSchedules','Setting\x20secret...','diff','Disabling\x20schedule\x20#','follow','🔄\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','No\x20attempts\x20found','\x0aPolling...\x20(','indexOf','No\x20matching\x20sessions\x20found','/sessions/','changes','workflow:clone','session:','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x20attempt','push','workflow:use','get','sourceProjectName','\x20unchanged','tasks','substring','267604lbCppT','Enable\x20a\x20workflow\x20schedule','columns','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','✔\x20Project:\x20','3113444hRodjc','total','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20New\x20attempt\x20ID:\x20','✔\x20Pushed\x20','now','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','\x20from\x20session\x20','running','Writing\x20files...','toISOString','List\x20workflow\x20execution\x20sessions','Error:\x20Invalid\x20parameter\x20format:\x20','run','✔\x20Workflow\x20project\x20set\x20to:\x20','ICON_WIDTH','workflows','write','split','Attempt:\x20','Error:\x20Project\x20name\x20is\x20required','No\x20sessions\x20found\x20for:\x20','title','\x20enabled\x20(','message','workflow:secrets:delete','workflow:download','join','No\x20sessions\x20with\x20timing\x20information','getMonth','clear','blue','Listing\x20workflow\x20sessions...','requireProject','logs','taskName','\x20of\x20','✔\x20Workflow\x20project\x20context\x20cleared.','---\x20','Schedule\x20ID\x20is\x20required','(use\x20--limit\x20to\x20see\x20more)','Total:\x20','replace','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20secret','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','finishedAt','red','keys','context','enableSchedule','executePushProject','execute','LABEL_MIN_SPACING','fileSize','\x0a✔\x20Attempt\x20complete','No\x20projects\x20match\x20pattern:\x20','\x20disabled\x20(','Retry\x20a\x20session\x20or\x20attempt','readFile','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Starting\x20workflow\x20run...','output','error','task','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','includes','✔\x20Push\x20complete','Fetching\x20log\x20files...','workflow:kill','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','cancelRequested','\x20\x20Project:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','values','key','revision','\x20\x20Files\x20extracted:\x20','stringify','\x20next:\x20','size','table','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Kill\x20a\x20running\x20attempt','newProjectId','match','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','value','sort','Warning:','lastAttempt','deleteSecret','No\x20sessions\x20found\x20in\x20project:\x20','workflow:secrets:list','autocomplete','Setting\x20','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','status','setSecrets','white','workflowName','Loading\x20session...'];a54_0x2dfb=function(){return _0x4cd072;};return a54_0x2dfb();}import a54_0x4e32c8 from'prompts';function getAttemptStatusDisplay(_0x1f01c6){const _0x281d68=a54_0x5811;if(!_0x1f01c6)return{'icon':'⏳','text':''};const {done:_0x947378,success:_0x5556ee,cancelRequested:_0x1a20f7}=_0x1f01c6;if(!_0x947378)return _0x1a20f7?{'icon':'🛑','text':a54_0x47fe92[_0x281d68(0x28d)]('canceling')}:{'icon':'🔄','text':a54_0x47fe92[_0x281d68(0x215)](_0x281d68(0x1fe))};if(_0x5556ee)return{'icon':'✅','text':a54_0x47fe92[_0x281d68(0x2b5)](_0x281d68(0x337))};return{'icon':'❌','text':a54_0x47fe92[_0x281d68(0x225)](_0x281d68(0x235))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x130479(0x2ca)](_0x69f709,_0x159b1b,_0x3d8a04=0x0){const _0xe20e0d=a54_0x130479;return _0x69f709[_0x3d8a04]||_0x159b1b[_0xe20e0d(0x37d)];}[a54_0x130479(0x217)](_0x1e777b,_0x2d399a,_0x39fb5c=0x0){const _0x2ac37a=a54_0x130479,_0x134360=this['resolveProject'](_0x1e777b,_0x2d399a,_0x39fb5c);if(!_0x134360)return console[_0x2ac37a(0x235)](a54_0x47fe92[_0x2ac37a(0x225)]('Error:'),'Project\x20name\x20is\x20required'),console[_0x2ac37a(0x235)](a54_0x47fe92['dim'](_0x2ac37a(0x277))),null;return _0x134360;}[a54_0x130479(0x31a)](_0x1954ca,_0xadf850){const _0xb70451=a54_0x130479;if(_0x1954ca[0x0]){const _0x5b7cbf=_0x1954ca[0x0][_0xb70451(0x208)]('.');if(_0x5b7cbf['length']===0x1)return{'projectName':_0x5b7cbf[0x0],'workflowName':undefined};else return _0x5b7cbf[_0xb70451(0x273)]===0x2?{'projectName':_0x5b7cbf[0x0],'workflowName':_0x5b7cbf[0x1]}:(console[_0xb70451(0x235)](a54_0x47fe92['red'](_0xb70451(0x25d)),_0xb70451(0x34c)),null);}return{'projectName':_0xadf850[_0xb70451(0x37d)],'workflowName':undefined};}['resolveProjectDir'](_0x107d4b,_0x2049e5,_0x593c12=0x0){const _0x522864=a54_0x130479;if(_0x107d4b[_0x593c12])return _0x107d4b[_0x593c12];if(_0x2049e5['workflowProject']){const _0x24b794=a54_0x5d886b[_0x522864(0x211)](process['cwd'](),_0x522864(0x206),_0x2049e5[_0x522864(0x37d)]);if(existsSync(a54_0x5d886b[_0x522864(0x211)](_0x24b794,_0x522864(0x363))))return _0x24b794;}return undefined;}async['showWorkflowConsoleUrl'](_0x29879f,_0x16d443,_0x4fe048){const _0x9a9144=a54_0x130479;try{const _0x7806a2=await _0x29879f[_0x9a9144(0x2ab)][_0x9a9144(0x206)](_0x16d443,{'limit':0x1});if(_0x7806a2['length']>0x0){const _0x543fe4=_0x7806a2[0x0]['id'],_0x14687e=getWorkflowUrl(_0x4fe048,_0x543fe4);console[_0x9a9144(0x235)]('\x20\x20Console:\x20'+a54_0x47fe92['cyan'](_0x14687e));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{['name']=a54_0x130479(0x1eb);[a54_0x130479(0x376)]=a54_0x130479(0x34d);async[a54_0x130479(0x22a)](_0x53f157){const _0x1037f3=a54_0x130479,{options:_0x22c593,args:_0x41805c,tdx:_0x507990}=_0x53f157,_0x4a44c2=_0x41805c[0x0],_0x30bb1d=_0x22c593[_0x1037f3(0x214)];if(_0x30bb1d)return saveSessionContext({'workflow_project':undefined},_0x22c593['session']),console[_0x1037f3(0x303)](a54_0x47fe92[_0x1037f3(0x2b5)](_0x1037f3(0x21b))),0x0;if(!_0x4a44c2)return console['error'](a54_0x47fe92[_0x1037f3(0x225)](_0x1037f3(0x25d)),_0x1037f3(0x302)),console[_0x1037f3(0x235)](a54_0x47fe92[_0x1037f3(0x2e9)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x1037f3(0x235)](a54_0x47fe92[_0x1037f3(0x2e9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context')),0x1;const _0xd7da30=await withSpinner('Resolving\x20project\x20\x27'+_0x4a44c2+_0x1037f3(0x30f),()=>_0x507990[_0x1037f3(0x2ab)]['resolveProjectId'](_0x4a44c2),{'verbose':_0x22c593['verbose']}),{name:_0x56b407}=_0xd7da30[_0x1037f3(0x36f)];return saveSessionContext({'workflow_project':_0x56b407},_0x22c593['session']),console[_0x1037f3(0x303)](a54_0x47fe92[_0x1037f3(0x2b5)](_0x1037f3(0x204)+a54_0x47fe92[_0x1037f3(0x2c4)](_0x56b407))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:projects';[a54_0x130479(0x376)]=a54_0x130479(0x2b0);async[a54_0x130479(0x22a)](_0x52bc36){const _0x204f22=a54_0x130479,{options:_0x49e551,args:_0x487460,tdx:_0x3bbe5d}=_0x52bc36,_0x4bb061=_0x487460[0x0];_0x49e551[_0x204f22(0x399)]&&_0x4bb061&&console[_0x204f22(0x235)](_0x204f22(0x30a)+_0x4bb061);const _0x53f721=await withSpinner('Listing\x20workflow\x20projects...',()=>_0x3bbe5d['workflow'][_0x204f22(0x2f6)](_0x4bb061,{'limit':_0x49e551['limit']}),{'verbose':_0x49e551['verbose']});let _0x612ac1=_0x53f721['data'];_0x612ac1[_0x204f22(0x24e)]((_0x15a466,_0x37c9af)=>_0x15a466[_0x204f22(0x27b)][_0x204f22(0x32b)](_0x37c9af[_0x204f22(0x27b)]));const _0x356128=_0x49e551[_0x204f22(0x341)]||0x64,_0xc78e1d=_0x612ac1[_0x204f22(0x273)]>=_0x356128?a54_0x47fe92[_0x204f22(0x2e9)](_0x204f22(0x2a9)):'';console[_0x204f22(0x235)]('✔\x20Found\x20'+_0x612ac1[_0x204f22(0x273)]+'\x20project'+(_0x612ac1[_0x204f22(0x273)]!==0x1?'s':'')+_0xc78e1d);if(_0x49e551[_0x204f22(0x31b)]===_0x204f22(0x309)||_0x49e551[_0x204f22(0x31b)]==='jsonl'||_0x49e551[_0x204f22(0x31b)]===_0x204f22(0x247))await handleSDKOutput(_0x612ac1,_0x49e551);else{if(_0x612ac1['length']===0x0)_0x4bb061?console[_0x204f22(0x303)](_0x204f22(0x22e)+_0x4bb061):console['log'](_0x204f22(0x2bf));else{const _0x54ab74=_0x612ac1[_0x204f22(0x263)](_0x3b3db0=>{const _0x11c981=_0x204f22,_0x48f815=_0x3b3db0['metadata']?.[_0x11c981(0x29e)](_0x37ed4b=>_0x37ed4b[_0x11c981(0x241)]===_0x11c981(0x2f0)),_0x36f7bb=_0x48f815?a54_0x47fe92[_0x11c981(0x2e9)](_0x11c981(0x2ba)):'';return'📁\x20'+_0x3b3db0['name']+_0x36f7bb;});await writeOutput(_0x54ab74[_0x204f22(0x211)]('\x0a'),_0x49e551['output'],'list');}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x371);[a54_0x130479(0x376)]=a54_0x130479(0x33f);async[a54_0x130479(0x22a)](_0x3f3338){const _0x13611c=a54_0x130479,{options:_0x2a8744,args:_0x35e8ca,tdx:_0x2fc422}=_0x3f3338,_0x5367e7=this['resolveProject'](_0x35e8ca,_0x2a8744);_0x2a8744[_0x13611c(0x399)]&&_0x5367e7&&console['error']('Project\x20filter:\x20'+_0x5367e7);const _0x3cd304=await withSpinner('Listing\x20workflows...',()=>_0x2fc422[_0x13611c(0x2ab)][_0x13611c(0x206)](_0x5367e7,{'limit':_0x2a8744[_0x13611c(0x341)]}),{'verbose':_0x2a8744['verbose']});let _0x255f23=_0x3cd304[_0x13611c(0x36f)];_0x255f23[_0x13611c(0x24e)]((_0x2bb7d9,_0x3401eb)=>{const _0x2dee19=_0x13611c,_0x6fcdad=_0x2bb7d9['name'][_0x2dee19(0x32b)](_0x3401eb[_0x2dee19(0x27b)]);if(_0x6fcdad!==0x0)return _0x6fcdad;return(_0x2bb7d9[_0x2dee19(0x298)]?.[_0x2dee19(0x27b)]||'')['localeCompare'](_0x3401eb['project']?.['name']||'');});const _0x1d6447=_0x2a8744[_0x13611c(0x341)]||0x64,_0xe13c94=_0x255f23[_0x13611c(0x273)]>=_0x1d6447?a54_0x47fe92[_0x13611c(0x2e9)](_0x13611c(0x2a9)):'';console['error'](_0x13611c(0x393)+_0x255f23[_0x13611c(0x273)]+_0x13611c(0x29b)+(_0x255f23[_0x13611c(0x273)]!==0x1?'s':'')+_0xe13c94);if(_0x2a8744['format']===_0x13611c(0x309)||_0x2a8744[_0x13611c(0x31b)]===_0x13611c(0x2cb)||_0x2a8744[_0x13611c(0x31b)]===_0x13611c(0x247))await handleSDKOutput(_0x255f23,_0x2a8744);else{if(_0x255f23[_0x13611c(0x273)]===0x0)_0x5367e7?console['log'](_0x13611c(0x274)+_0x5367e7):console[_0x13611c(0x303)](_0x13611c(0x2b9));else{const _0x80b58a=_0x2a8744['site'],_0xc207df=_0x255f23['map'](_0x4c8544=>{const _0x2dbb26=_0x13611c,_0x381607=a54_0x47fe92[_0x2dbb26(0x2e9)]('#'+_0x4c8544['id']),_0x3375e9=hyperlink(_0x381607,getWorkflowUrl(_0x80b58a,_0x4c8544['id'])),_0xff2ed4=_0x4c8544[_0x2dbb26(0x298)]?.['name']?a54_0x47fe92[_0x2dbb26(0x2e9)]('\x20('+_0x4c8544[_0x2dbb26(0x298)][_0x2dbb26(0x27b)]+')'):'';return _0x2dbb26(0x36a)+_0x3375e9+'\x20'+_0x4c8544[_0x2dbb26(0x27b)]+_0xff2ed4;});await writeOutput(_0xc207df[_0x13611c(0x211)]('\x0a'),_0x2a8744[_0x13611c(0x234)],'list');}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x369);[a54_0x130479(0x376)]=a54_0x130479(0x201);async[a54_0x130479(0x22a)](_0x3b1780){const _0x4c9cd2=a54_0x130479,{options:_0x59acc4,args:_0x574321,tdx:_0x4ff5d8}=_0x3b1780,_0x337de7=this['parseProjectWorkflowPattern'](_0x574321,_0x59acc4);if(!_0x337de7)return 0x1;const {projectName:_0x146fcf,workflowName:_0x42805c}=_0x337de7;if(_0x59acc4[_0x4c9cd2(0x399)]){if(_0x146fcf&&_0x42805c)console[_0x4c9cd2(0x235)](_0x4c9cd2(0x26e)+_0x146fcf+'.'+_0x42805c);else _0x146fcf&&console[_0x4c9cd2(0x235)]('Filter:\x20project='+_0x146fcf);const _0x120a61=_0x59acc4['status'];_0x120a61&&console['error']('Status:\x20'+_0x120a61);}let _0x3cc68a=0x28;if(process['stdout'][_0x4c9cd2(0x314)]&&!_0x59acc4[_0x4c9cd2(0x234)]&&!_0x59acc4[_0x4c9cd2(0x31b)]){const _0x7b87ee=process[_0x4c9cd2(0x328)][_0x4c9cd2(0x2b6)]||0x28;_0x3cc68a=Math['max'](0x14,Math[_0x4c9cd2(0x37c)](_0x7b87ee*0x2/0x3));}const _0x3e1330=_0x59acc4[_0x4c9cd2(0x341)]||_0x3cc68a,_0x4c4417=await withSpinner(_0x4c9cd2(0x216),()=>_0x4ff5d8[_0x4c9cd2(0x2ab)]['sessions']({'projectName':_0x146fcf,'workflowName':_0x42805c,'status':_0x59acc4[_0x4c9cd2(0x257)],'fromTime':_0x59acc4[_0x4c9cd2(0x271)],'toTime':_0x59acc4['to'],'limit':_0x3e1330}),{'verbose':_0x59acc4[_0x4c9cd2(0x399)]}),_0x5959bf=_0x4c4417[_0x4c9cd2(0x36f)];_0x5959bf[_0x4c9cd2(0x24e)]((_0x527b48,_0x1d277a)=>{const _0x28341c=_0x4c9cd2,_0x111289=_0x527b48[_0x28341c(0x35e)]||'',_0x1d80ea=_0x1d277a[_0x28341c(0x35e)]||'';return _0x1d80ea['localeCompare'](_0x111289);});_0x5959bf[_0x4c9cd2(0x273)]>=_0x3e1330?console['error']('✔\x20Showing\x20'+_0x5959bf['length']+_0x4c9cd2(0x37e)+a54_0x47fe92['dim'](_0x4c9cd2(0x21e))):console['error'](_0x4c9cd2(0x393)+_0x5959bf[_0x4c9cd2(0x273)]+_0x4c9cd2(0x2d0)+(_0x5959bf['length']!==0x1?'s':''));if(_0x59acc4['format']===_0x4c9cd2(0x309)||_0x59acc4[_0x4c9cd2(0x31b)]===_0x4c9cd2(0x2cb)||_0x59acc4[_0x4c9cd2(0x31b)]==='table')await handleSDKOutput(_0x5959bf,_0x59acc4);else{if(!process[_0x4c9cd2(0x328)][_0x4c9cd2(0x314)]||_0x59acc4[_0x4c9cd2(0x234)]){if(_0x5959bf[_0x4c9cd2(0x273)]===0x0){if(_0x146fcf&&_0x42805c)console['log']('No\x20sessions\x20found\x20for:\x20'+_0x146fcf+'.'+_0x42805c);else _0x146fcf?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x146fcf):console[_0x4c9cd2(0x303)](_0x4c9cd2(0x348));}else{const _0x542457=_0x59acc4[_0x4c9cd2(0x25c)],_0x2b4d8d=this['renderSessionsTimeline'](_0x5959bf,_0x542457);_0x59acc4[_0x4c9cd2(0x234)]?await writeOutput(_0x2b4d8d,_0x59acc4['output'],_0x4c9cd2(0x385)):console[_0x4c9cd2(0x303)](_0x2b4d8d);}!_0x146fcf&&(console[_0x4c9cd2(0x235)](''),console[_0x4c9cd2(0x235)](a54_0x47fe92[_0x4c9cd2(0x2e9)](_0x4c9cd2(0x26c))),console[_0x4c9cd2(0x235)](a54_0x47fe92['dim'](_0x4c9cd2(0x1f4))+'or'+a54_0x47fe92['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));}else{if(_0x5959bf['length']===0x0){if(_0x146fcf&&_0x42805c)console[_0x4c9cd2(0x303)](_0x4c9cd2(0x20b)+_0x146fcf+'.'+_0x42805c);else _0x146fcf?console['log']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x146fcf):console[_0x4c9cd2(0x303)](_0x4c9cd2(0x348));}else await this['navigateSessionsInteractive'](_0x5959bf,_0x3b1780,_0x146fcf);}}return 0x0;}['renderSessionsTimeline'](_0x2bb48e,_0x36e717){const _0x596e19=a54_0x130479,_0x5e767d=[],_0x80b483=new Map();let _0x111d86=Infinity,_0x3ab7db=-Infinity;for(const _0xe01b8f of _0x2bb48e){if(_0xe01b8f[_0x596e19(0x250)]?.['createdAt']){const _0x1e7c2a=new Date(_0xe01b8f['lastAttempt'][_0x596e19(0x364)])['getTime'](),_0x321c6d=_0xe01b8f[_0x596e19(0x250)][_0x596e19(0x224)]?new Date(_0xe01b8f[_0x596e19(0x250)][_0x596e19(0x224)])[_0x596e19(0x28f)]():Date['now'](),_0x20cbcb=_0xe01b8f[_0x596e19(0x298)]?.[_0x596e19(0x27b)]||_0x596e19(0x2e6);!_0x80b483['has'](_0x20cbcb)&&_0x80b483[_0x596e19(0x377)](_0x20cbcb,[]),_0x80b483[_0x596e19(0x1ec)](_0x20cbcb)[_0x596e19(0x1ea)]({'session':_0xe01b8f,'startTime':_0x1e7c2a,'endTime':_0x321c6d,'duration':_0x321c6d-_0x1e7c2a}),_0x111d86=Math[_0x596e19(0x316)](_0x111d86,_0x1e7c2a),_0x3ab7db=Math[_0x596e19(0x2b3)](_0x3ab7db,_0x321c6d);}}if(_0x80b483[_0x596e19(0x246)]===0x0)return _0x596e19(0x212);const _0x2916bc=process[_0x596e19(0x328)][_0x596e19(0x1f3)]||0x78,_0x29c7f7=0x1e,_0x53abde=0x32,_0x22f335=0x4,_0x48132d=Math[_0x596e19(0x316)](_0x53abde,Math[_0x596e19(0x2b3)](_0x29c7f7,Math[_0x596e19(0x37c)](_0x2916bc*0.3))),_0xb6e7d1=_0x2916bc-_0x48132d-TIMELINE_CONFIG[_0x596e19(0x38e)]-0x3-_0x22f335,_0x1bdf36=_0x3ab7db-_0x111d86,_0x5d2f5a=_0x1bdf36/_0x48132d,_0x422f86=renderTimeAxis({'startTime':_0x111d86,'endTime':_0x3ab7db,'durationMs':_0x1bdf36,'msPerChar':_0x5d2f5a},_0x48132d),_0x969127=[];for(const _0x59eeb7 of _0x80b483[_0x596e19(0x240)]()){_0x969127[_0x596e19(0x1ea)](..._0x59eeb7);}_0x969127[_0x596e19(0x24e)]((_0x1008e6,_0x2be6ee)=>_0x2be6ee[_0x596e19(0x346)]-_0x1008e6[_0x596e19(0x346)]);const _0x16a64e=new Date(_0x111d86),_0x436838=formatDate(_0x16a64e),_0x1c8c82=_0x22f335+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG['ICON_SPACING']+_0xb6e7d1,_0x3720e1='\x20'[_0x596e19(0x2fa)](_0x1c8c82-_0x436838[_0x596e19(0x273)]),_0x3fe650=_0x3720e1+a54_0x47fe92[_0x596e19(0x2e9)](_0x436838)+'\x20'+_0x422f86;_0x5e767d['push'](_0x3fe650);const _0x28fe59=0x16;let _0x5ce825=0x0;for(const _0x21a636 of _0x969127){const _0x232627=_0x21a636[_0x596e19(0x34b)][_0x596e19(0x298)]?.['name']||'?',_0x104263=Math[_0x596e19(0x316)](stringWidth(_0x232627),_0x28fe59);_0x5ce825=Math[_0x596e19(0x2b3)](_0x5ce825,_0x104263);}for(const _0x3cc8d3 of _0x969127){const {session:_0x56fd46,startTime:_0x23ff74,endTime:_0x287660,duration:_0x3ed9a7}=_0x3cc8d3,_0x5b2d2b=_0x56fd46['project']?.['id'],_0x11d1de=_0x56fd46['id'],_0x31e52c=_0x56fd46[_0x596e19(0x298)]?.['name']||'?',_0x4ccd3b=_0x56fd46[_0x596e19(0x2ab)]?.[_0x596e19(0x27b)]||'?';let _0x42259f,_0x4ca81e;if(_0x56fd46[_0x596e19(0x250)]){const _0x1fc5fa=_0x56fd46[_0x596e19(0x250)];!_0x1fc5fa[_0x596e19(0x38b)]?(_0x42259f=_0x1fc5fa[_0x596e19(0x23d)]?'🛑':'🔄',_0x4ca81e=_0x1fc5fa[_0x596e19(0x23d)]?a54_0x47fe92['yellow']:a54_0x47fe92['blue']):(_0x42259f=_0x1fc5fa['success']?'✅':'❌',_0x4ca81e=_0x1fc5fa['success']?a54_0x47fe92['green']:a54_0x47fe92['red']);}else _0x42259f='⏳',_0x4ca81e=a54_0x47fe92[_0x596e19(0x2e9)];const _0x2ab17f='#'+_0x11d1de,_0x592683=_0x5b2d2b?hyperlink(_0x2ab17f,getWorkflowSessionUrl(_0x36e717,_0x5b2d2b,_0x11d1de)):_0x2ab17f;let _0x4f4bdc=_0x31e52c;stringWidth(_0x31e52c)>_0x28fe59&&(_0x4f4bdc=_0x31e52c[_0x596e19(0x319)](0x0,_0x28fe59-0x1)+'…');const _0x2e4e60=a54_0x47fe92[_0x596e19(0x2e9)](_0x4f4bdc),_0x5f4974=stringWidth(_0x4f4bdc),_0x42fb36='\x20'['repeat'](_0x5ce825-stringWidth(_0x4f4bdc)+0x2),_0x1b0154='('+formatElapsed(_0x3ed9a7)+')',_0x46dcec=stringWidth(_0x1b0154),_0x81060c=stringWidth(_0x2ab17f),_0x179b94=_0x81060c+0x1+_0x5f4974+_0x42fb36['length'],_0x5b3a49=_0xb6e7d1-_0x179b94-_0x46dcec-0x1-0x8;let _0x3881cb=_0x4ccd3b;stringWidth(_0x3881cb)>_0x5b3a49&&(_0x3881cb=_0x3881cb[_0x596e19(0x319)](0x0,_0x5b3a49-0x1)+'…');const _0x10a1ed=_0x592683+'\x20'+_0x2e4e60+_0x42fb36+_0x3881cb,_0x4cbadf=stringWidth(_0x10a1ed),_0x22d8d9=_0xb6e7d1-_0x4cbadf-_0x46dcec,_0x219702=_0x10a1ed+'\x20'[_0x596e19(0x2fa)](Math[_0x596e19(0x2b3)](0x1,_0x22d8d9))+a54_0x47fe92['dim'](_0x1b0154),_0x4d44aa=Math[_0x596e19(0x37c)]((_0x23ff74-_0x111d86)/_0x5d2f5a),_0x433c94=Math[_0x596e19(0x37c)]((_0x287660-_0x111d86)/_0x5d2f5a),_0x30f626=Math[_0x596e19(0x2b3)](_0x4d44aa+0x1,_0x433c94),_0x5a6b6d=new Array(_0x48132d)[_0x596e19(0x315)]('\x20');for(let _0x4306eb=_0x4d44aa;_0x4306eb<Math[_0x596e19(0x316)](_0x30f626,_0x48132d);_0x4306eb++){_0x5a6b6d[_0x4306eb]='─';}const _0x38b31a=_0x5a6b6d[_0x596e19(0x263)](_0x1da31e=>_0x1da31e==='\x20'?'\x20':_0x4ca81e(_0x1da31e))[_0x596e19(0x211)]('');_0x5e767d['push'](_0x42259f+'\x20'+_0x219702+'│'+_0x38b31a+'│');}return _0x5e767d[_0x596e19(0x211)]('\x0a');}async[a54_0x130479(0x2ef)](_0x4b5835,_0x218710,_0x2eb9fe){const _0x576a07=a54_0x130479,{options:_0x2e842d,tdx:_0x44f62c}=_0x218710,_0x2307ec=_0x2e842d[_0x576a07(0x25c)],{timelineRows:_0x58eda9,timeAxisHeader:_0xe4725c}=this['generateSessionTimelineRows'](_0x4b5835,_0x2307ec),_0x945ee=_0x58eda9[_0x576a07(0x32d)](_0x3b1771=>_0x3b1771[_0x576a07(0x2a5)]);if(_0x945ee[_0x576a07(0x273)]===0x0){const _0x544309=this[_0x576a07(0x2db)](_0x4b5835,_0x2307ec);console[_0x576a07(0x303)](_0x544309);!_0x2eb9fe&&(console[_0x576a07(0x235)](''),console[_0x576a07(0x235)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x26c))),console[_0x576a07(0x235)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x1f4))+'or'+a54_0x47fe92['dim']('\x20\x20tdx\x20wf\x20use\x20<project>')));return;}_0xe4725c&&console[_0x576a07(0x303)](_0xe4725c);const _0x2f1f08=_0x58eda9[_0x576a07(0x32d)](_0x46d6df=>_0x46d6df[_0x576a07(0x2a5)])[_0x576a07(0x263)](_0x1d8b3d=>({'title':_0x1d8b3d['displayLine'],'value':_0x1d8b3d['attemptId']})),_0x41f33b=process[_0x576a07(0x328)][_0x576a07(0x2b6)]||0x3c,_0x2f9c4b=Math[_0x576a07(0x2b3)](0x28,Math[_0x576a07(0x37c)](_0x41f33b*0x2/0x3)),_0x1bc293=await a54_0x4e32c8({'type':_0x576a07(0x254),'name':_0x576a07(0x2a5),'message':_0x576a07(0x392),'choices':_0x2f1f08,'initial':-0x1,'limit':_0x2f9c4b,'clearFirst':!![],'fallback':{'title':_0x576a07(0x3a5),'value':null},'suggest':(_0x44d04f,_0x2e44e9)=>{const _0x138771=_0x576a07;if(!_0x44d04f)return Promise[_0x138771(0x310)](_0x2e44e9);const _0x1c979f=_0x2e44e9[_0x138771(0x32d)](_0x51a701=>{const _0x464af6=_0x138771,_0x41da4d=_0x51a701;return _0x41da4d[_0x464af6(0x20c)]['toLowerCase']()[_0x464af6(0x238)](_0x44d04f[_0x464af6(0x27a)]());});return Promise[_0x138771(0x310)](_0x1c979f);}}),_0x3a160a=()=>{const _0x2bd397=_0x576a07;process[_0x2bd397(0x328)][_0x2bd397(0x207)]('\x1b[1A\x1b[2K'),process[_0x2bd397(0x328)][_0x2bd397(0x207)](_0x2bd397(0x28a)),process[_0x2bd397(0x328)]['write'](_0x2bd397(0x28a));},_0x522d3f=_0x1bc293&&_0x1bc293[_0x576a07(0x2a5)]&&_0x1bc293[_0x576a07(0x2a5)]!==null&&_0x1bc293[_0x576a07(0x2a5)]['trim']()!=='';if(!_0x522d3f){_0x3a160a(),console[_0x576a07(0x303)](a54_0x47fe92[_0x576a07(0x2e9)](_0x576a07(0x375)));return;}_0x3a160a();const _0x1951a9=_0x4b5835[_0x576a07(0x398)](_0x5846ad=>_0x5846ad[_0x576a07(0x250)]?.['id']===_0x1bc293[_0x576a07(0x2a5)]);if(_0x1951a9){const _0x5002fd=_0x1951a9[_0x576a07(0x298)]?.[_0x576a07(0x27b)]||'?',_0x131924=_0x1951a9['workflow']?.[_0x576a07(0x27b)]||'?';console['log'](_0x576a07(0x28b)+a54_0x47fe92['dim'](_0x5002fd)+_0x576a07(0x275)+a54_0x47fe92[_0x576a07(0x2e9)](_0x131924));}const _0x28181f=new WorkflowTimelineCommand();await _0x28181f[_0x576a07(0x22a)]({'args':[],'options':{..._0x2e842d,'attemptId':_0x1bc293[_0x576a07(0x2a5)]},'tdx':_0x44f62c});}[a54_0x130479(0x279)](_0x2de567,_0x1d6a70){const _0x2e3461=a54_0x130479,_0xa644d5=new Map();for(const _0x34d13c of _0x2de567){_0x34d13c['id']&&_0x34d13c[_0x2e3461(0x250)]?.['id']&&_0xa644d5[_0x2e3461(0x377)](_0x34d13c['id'],_0x34d13c[_0x2e3461(0x250)]['id']);}const _0xd7ee9e=[];let _0x39644a='';const _0x25c004=this['renderSessionsTimeline'](_0x2de567,_0x1d6a70),_0x3180c6=_0x25c004[_0x2e3461(0x208)]('\x0a');for(const _0x5e343b of _0x3180c6){if(_0x5e343b[_0x2e3461(0x2bb)](_0x2e3461(0x329))||_0x5e343b[_0x2e3461(0x24b)](/^\s+\d{4}-\d{2}-\d{2}/))_0x39644a=_0x5e343b;else{if(_0x5e343b[_0x2e3461(0x24b)](/^[✅❌🔄🛑⏳]/)){const _0x546e56=_0x5e343b[_0x2e3461(0x24b)](/#(\d+)/),_0x2a2867=_0x546e56?_0x546e56[0x1]:null,_0x532016=_0x2a2867?_0xa644d5[_0x2e3461(0x1ec)](_0x2a2867)||null:null,_0x4a4aef=_0x2de567[_0x2e3461(0x398)](_0x17ded0=>_0x17ded0['id']===_0x2a2867),_0x3d19d4=_0x4a4aef?.[_0x2e3461(0x298)]?.[_0x2e3461(0x27b)]||'';_0xd7ee9e['push']({'displayLine':_0x5e343b,'attemptId':_0x532016,'projectName':_0x3d19d4});}}}return{'timelineRows':_0xd7ee9e,'timeAxisHeader':_0x39644a};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x381);[a54_0x130479(0x376)]='List\x20workflow\x20attempts';async[a54_0x130479(0x22a)](_0x214325){const _0xc2e44c=a54_0x130479,{options:_0x467322,args:_0x3be360,tdx:_0x5271fc}=_0x214325,_0x43343=this[_0xc2e44c(0x31a)](_0x3be360,_0x467322);if(!_0x43343)return 0x1;const {projectName:_0x28497e,workflowName:_0x2f357f}=_0x43343,_0x220fc4=_0x467322[_0xc2e44c(0x343)];if(_0x467322[_0xc2e44c(0x399)]){if(_0x28497e&&_0x2f357f)console[_0xc2e44c(0x235)](_0xc2e44c(0x26e)+_0x28497e+'.'+_0x2f357f);else _0x28497e&&console[_0xc2e44c(0x235)](_0xc2e44c(0x270)+_0x28497e);_0x220fc4&&console['error'](_0xc2e44c(0x276));}const _0x3d36ef=await withSpinner(_0xc2e44c(0x33e),()=>_0x5271fc['workflow'][_0xc2e44c(0x331)]({'projectName':_0x28497e,'workflowName':_0x2f357f,'includeRetried':_0x220fc4,'limit':_0x467322[_0xc2e44c(0x341)]}),{'verbose':_0x467322[_0xc2e44c(0x399)]}),_0x111687=_0x3d36ef[_0xc2e44c(0x36f)],_0x1db272=_0x467322[_0xc2e44c(0x341)]||0x64,_0x4429dd=_0x111687[_0xc2e44c(0x273)]>=_0x1db272?a54_0x47fe92[_0xc2e44c(0x2e9)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error']('✔\x20Found\x20'+_0x111687['length']+_0xc2e44c(0x1e9)+(_0x111687[_0xc2e44c(0x273)]!==0x1?'s':'')+_0x4429dd);if(_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x309)||_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x2cb)||_0x467322[_0xc2e44c(0x31b)]===_0xc2e44c(0x247))await handleSDKOutput(_0x111687,_0x467322);else{if(_0x111687[_0xc2e44c(0x273)]===0x0){if(_0x28497e&&_0x2f357f)console[_0xc2e44c(0x303)](_0xc2e44c(0x293)+_0x28497e+'.'+_0x2f357f);else _0x28497e?console['log']('No\x20attempts\x20found\x20in\x20project:\x20'+_0x28497e):console[_0xc2e44c(0x303)](_0xc2e44c(0x3a2));}else{const _0x23fafb=_0x467322[_0xc2e44c(0x25c)],_0x237d6c=_0x111687['map'](_0x499a9c=>{const _0x549e3c=_0xc2e44c,_0x233404=a54_0x47fe92[_0x549e3c(0x2e9)]('#'+_0x499a9c['id']),_0x25f5f7=_0x499a9c[_0x549e3c(0x298)]?.['id'],_0x20bc4b=_0x499a9c['session_id']||_0x499a9c['sessionId'],_0x546ef2=_0x25f5f7&&_0x20bc4b?hyperlink(_0x233404,getWorkflowAttemptUrl(_0x23fafb,_0x25f5f7,_0x20bc4b,_0x499a9c['id'])):_0x233404,{icon:_0x11a8ff,text:_0x427698}=getAttemptStatusDisplay(_0x499a9c),_0x5aad6a=(_0x499a9c[_0x549e3c(0x298)]?.[_0x549e3c(0x27b)]||'?')+'.'+(_0x499a9c['workflow']?.['name']||'?'),_0x46fae6=_0x499a9c[_0x549e3c(0x35e)]?a54_0x47fe92[_0x549e3c(0x2e9)](_0x499a9c[_0x549e3c(0x35e)]):'';return(_0x546ef2+'\x20'+_0x11a8ff+(_0x427698?'\x20'+_0x427698:'')+'\x20'+_0x5aad6a+'\x20'+_0x46fae6)[_0x549e3c(0x31f)]();});await writeOutput(_0x237d6c['join']('\x0a'),_0x467322[_0xc2e44c(0x234)],_0xc2e44c(0x385));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x30d);[a54_0x130479(0x376)]='Show\x20specific\x20attempt\x20details';async['execute'](_0x2d5641){const _0x41fb11=a54_0x130479,{options:_0x14696c,args:_0x497b82,tdx:_0xa090c7}=_0x2d5641,_0x636c02=_0x497b82[0x0];if(!_0x636c02)return console[_0x41fb11(0x235)](_0x41fb11(0x32c)),0x1;_0x14696c[_0x41fb11(0x399)]&&console[_0x41fb11(0x235)](_0x41fb11(0x334)+_0x636c02);const _0xef8a57=await withSpinner(_0x41fb11(0x268),()=>_0xa090c7['workflow'][_0x41fb11(0x359)](_0x636c02),{'verbose':_0x14696c['verbose']}),_0x5f54c2=_0xef8a57[_0x41fb11(0x36f)];let _0x4f8ed1;!_0x5f54c2['done']?_0x4f8ed1=_0x5f54c2['cancelRequested']?'canceling':'running':_0x4f8ed1=_0x5f54c2['success']?_0x41fb11(0x337):_0x41fb11(0x235);let _0x256a43;if(_0x5f54c2[_0x41fb11(0x364)]&&_0x5f54c2['finishedAt']){const _0x33605c=new Date(_0x5f54c2['createdAt'])[_0x41fb11(0x28f)](),_0xdbf886=new Date(_0x5f54c2['finishedAt'])[_0x41fb11(0x28f)]();_0x256a43=Math['round']((_0xdbf886-_0x33605c)/0x3e8);}const _0xa017={'attempt_id':_0x5f54c2['id'],'status':_0x4f8ed1,..._0x5f54c2[_0x41fb11(0x350)]!==undefined&&{'index':_0x5f54c2['index']},..._0x5f54c2['project']&&{'project':_0x5f54c2['project']['name']},..._0x5f54c2[_0x41fb11(0x2ab)]&&{'workflow':_0x5f54c2[_0x41fb11(0x2ab)][_0x41fb11(0x27b)]},..._0x5f54c2[_0x41fb11(0x2ea)]&&{'session_id':_0x5f54c2['sessionId']},..._0x5f54c2[_0x41fb11(0x35e)]&&{'session_time':_0x5f54c2[_0x41fb11(0x35e)]},..._0x5f54c2[_0x41fb11(0x324)]&&{'retry_attempt':_0x5f54c2[_0x41fb11(0x324)]},..._0x256a43!==undefined&&{'duration_sec':_0x256a43},..._0x5f54c2[_0x41fb11(0x364)]&&{'created_at':_0x5f54c2[_0x41fb11(0x364)]},..._0x5f54c2[_0x41fb11(0x224)]&&{'finished_at':_0x5f54c2['finishedAt']},...Object[_0x41fb11(0x226)](_0x5f54c2[_0x41fb11(0x361)])['length']>0x0&&{'params':_0x5f54c2[_0x41fb11(0x361)]}};return await handleSingleObjectOutput(_0xa017,_0x14696c),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a54_0x130479(0x35a);[a54_0x130479(0x376)]='Show\x20tasks\x20for\x20an\x20attempt';async[a54_0x130479(0x22a)](_0x2e0a25){const _0x43ea52=a54_0x130479,{options:_0x4d2cf8,args:_0x22cc86,tdx:_0x4009b5}=_0x2e0a25,_0x4c2448=_0x22cc86[0x0];if(!_0x4c2448)return console[_0x43ea52(0x235)](_0x43ea52(0x32c)),0x1;const _0x5bdc99=_0x4d2cf8[_0x43ea52(0x261)];_0x4d2cf8[_0x43ea52(0x399)]&&(console['error'](_0x43ea52(0x334)+_0x4c2448),_0x5bdc99&&console[_0x43ea52(0x235)](_0x43ea52(0x2e8)));const _0x3e62d2=await withSpinner('Getting\x20attempt\x20tasks...',()=>_0x4009b5[_0x43ea52(0x2ab)][_0x43ea52(0x1ef)](_0x4c2448,_0x5bdc99||![]),{'verbose':_0x4d2cf8[_0x43ea52(0x399)]}),_0x5d13c3=_0x3e62d2[_0x43ea52(0x36f)];return console[_0x43ea52(0x235)](_0x43ea52(0x393)+_0x5d13c3[_0x43ea52(0x273)]+_0x43ea52(0x352)+(_0x5d13c3[_0x43ea52(0x273)]!==0x1?'s':'')),await handleSDKOutput(_0x5d13c3,_0x4d2cf8),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x38a);[a54_0x130479(0x376)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a54_0x130479(0x22a)](_0x58d4a3){const _0x188887=a54_0x130479,{options:_0xb5bc54,args:_0x5f3b0b,tdx:_0x31ae6b}=_0x58d4a3,_0x3f70f7=_0x5f3b0b[0x0];let _0x1eeaf3=_0x5f3b0b[0x1];if(!_0x3f70f7)return console['error'](_0x188887(0x32c)),0x1;_0xb5bc54[_0x188887(0x399)]&&(console['error']('Attempt\x20ID:\x20'+_0x3f70f7),_0x1eeaf3&&console[_0x188887(0x235)](_0x188887(0x32f)+_0x1eeaf3));const _0x501d9d=await withSpinner(_0x188887(0x23a),()=>_0x31ae6b[_0x188887(0x2ab)][_0x188887(0x2c0)](_0x3f70f7,_0x1eeaf3),{'verbose':_0xb5bc54[_0x188887(0x399)]}),_0x21de8c=_0x501d9d[_0x188887(0x36f)];if(_0x21de8c[_0x188887(0x273)]===0x0)return console[_0x188887(0x235)](_0x188887(0x221)),0x0;if(!_0x1eeaf3&&(_0xb5bc54[_0x188887(0x309)]||_0xb5bc54[_0x188887(0x31b)]))return await handleSDKOutput(_0x21de8c,_0xb5bc54),0x0;if(!_0x1eeaf3){const _0x3a9ebb=_0x21de8c['map'](_0x10434b=>({'title':_0x10434b[_0x188887(0x219)]+'\x20('+formatBytes(_0x10434b[_0x188887(0x22c)])+')','value':_0x10434b[_0x188887(0x219)]})),_0x3e4203=await a54_0x4e32c8({'type':'select','name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x3a9ebb});if(!_0x3e4203[_0x188887(0x236)])return console['error'](_0x188887(0x375)),0x0;_0x1eeaf3=_0x3e4203[_0x188887(0x236)];}const _0x3265b8=await withSpinner(_0x188887(0x355),()=>_0x31ae6b[_0x188887(0x2ab)][_0x188887(0x218)](_0x3f70f7,_0x1eeaf3),{'verbose':_0xb5bc54[_0x188887(0x399)]}),_0x1ec31e=_0x3265b8[_0x188887(0x36f)];return _0x1ec31e?console[_0x188887(0x303)](_0x1ec31e):console['error'](_0x188887(0x2fb)),0x0;}}export class WorkflowKillCommand extends BaseCommand{['name']=a54_0x130479(0x23b);[a54_0x130479(0x376)]=a54_0x130479(0x249);async['execute'](_0x2b3f05){const _0x13c9dd=a54_0x130479,{options:_0x16676a,args:_0x3fbd89,tdx:_0x249b6f}=_0x2b3f05,_0x3980c5=_0x3fbd89[0x0];if(!_0x3980c5)return console[_0x13c9dd(0x235)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2cbd62=_0x16676a[_0x13c9dd(0x2bd)];_0x16676a[_0x13c9dd(0x399)]&&(console[_0x13c9dd(0x235)]('Attempt\x20ID:\x20'+_0x3980c5),_0x2cbd62&&console[_0x13c9dd(0x235)](_0x13c9dd(0x262)+_0x2cbd62));if(!_0x16676a['yes']){if(!isInteractive())return console[_0x13c9dd(0x235)](a54_0x47fe92[_0x13c9dd(0x225)](_0x13c9dd(0x391)),_0x13c9dd(0x2d2)),console[_0x13c9dd(0x235)](a54_0x47fe92['dim'](_0x13c9dd(0x344))),0x1;const _0x2c0fe9=await confirmKey(_0x13c9dd(0x3a1)+_0x3980c5+'?');if(!_0x2c0fe9)return console[_0x13c9dd(0x235)](a54_0x47fe92[_0x13c9dd(0x28d)](_0x13c9dd(0x375))),0x1;}const _0x16a7c2=await withSpinner(_0x13c9dd(0x396),()=>_0x249b6f['workflow']['kill'](_0x3980c5,_0x2cbd62),{'verbose':_0x16676a['verbose']}),_0x5149ee=_0x16a7c2[_0x13c9dd(0x36f)];return console[_0x13c9dd(0x235)]('✔\x20'+_0x5149ee),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x286);[a54_0x130479(0x376)]=a54_0x130479(0x230);async[a54_0x130479(0x22a)](_0x795605){const _0x26d1fb=a54_0x130479,{options:_0x118a8d,args:_0xaa70e,tdx:_0x4c1586}=_0x795605,_0x57541c=_0xaa70e[0x0];if(!_0x57541c)return console[_0x26d1fb(0x235)](_0x26d1fb(0x1f8)),console[_0x26d1fb(0x235)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x2ab40a=![],_0xd976d0=_0x57541c;if(_0x57541c[_0x26d1fb(0x2bb)](_0x26d1fb(0x1e7)))_0x2ab40a=!![],_0xd976d0=_0x57541c['substring'](0x8);else{if(_0x57541c[_0x26d1fb(0x2bb)](_0x26d1fb(0x36d)))_0x2ab40a=![],_0xd976d0=_0x57541c[_0x26d1fb(0x1f0)](0x8);else return console[_0x26d1fb(0x235)](_0x26d1fb(0x23f)),console[_0x26d1fb(0x235)](_0x26d1fb(0x30c)),0x1;}const _0x25c8b9=_0x118a8d['fromTask'],_0xe76489=_0x118a8d[_0x26d1fb(0x32e)],_0x43d4ee=_0x118a8d[_0x26d1fb(0x361)],_0x216bf0=_0x118a8d[_0x26d1fb(0x272)];_0x118a8d['verbose']&&(console[_0x26d1fb(0x235)]('Target:\x20'+(_0x2ab40a?_0x26d1fb(0x34b):'attempt')+'\x20'+_0xd976d0),_0x25c8b9&&console[_0x26d1fb(0x235)](_0x26d1fb(0x320)+_0x25c8b9),_0xe76489&&console[_0x26d1fb(0x235)](_0x26d1fb(0x26a)+_0xe76489),_0x43d4ee&&console[_0x26d1fb(0x235)](_0x26d1fb(0x380)+_0x43d4ee),_0x216bf0&&console[_0x26d1fb(0x235)]('Force:\x20yes'));let _0x22fb70;if(_0x43d4ee)try{if(_0x43d4ee[_0x26d1fb(0x2bb)]('@')){const _0x56f518=await import(_0x26d1fb(0x296)),_0x470d5a=_0x43d4ee[_0x26d1fb(0x1f0)](0x1),_0x1dbd83=await _0x56f518[_0x26d1fb(0x231)](_0x470d5a,_0x26d1fb(0x2dd));_0x22fb70=JSON[_0x26d1fb(0x2d8)](_0x1dbd83);}else _0x22fb70=JSON[_0x26d1fb(0x2d8)](_0x43d4ee);}catch{return console[_0x26d1fb(0x235)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x118a8d[_0x26d1fb(0x35c)]){if(!isInteractive())return console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x225)](_0x26d1fb(0x391)),_0x26d1fb(0x2d2)),console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x2e9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2fd649=await confirmKey(_0x26d1fb(0x31e)+(_0x2ab40a?_0x26d1fb(0x34b):_0x26d1fb(0x359))+'\x20'+_0xd976d0+'?');if(!_0x2fd649)return console[_0x26d1fb(0x235)](a54_0x47fe92[_0x26d1fb(0x28d)](_0x26d1fb(0x375))),0x1;}let _0x2774a5;_0x2ab40a?_0x2774a5=await withSpinner(_0x26d1fb(0x289),()=>_0x4c1586[_0x26d1fb(0x2ab)]['retrySession'](_0xd976d0,{'fromTask':_0x25c8b9,'retryParams':_0x22fb70}),{'verbose':_0x118a8d[_0x26d1fb(0x399)]}):_0x2774a5=await withSpinner('Retrying\x20attempt...',()=>_0x4c1586['workflow']['retryAttempt'](_0xd976d0,{'resumeFrom':_0xe76489,'retryParams':_0x22fb70,'force':_0x216bf0}),{'verbose':_0x118a8d[_0x26d1fb(0x399)]});const _0xf25ea4=_0x2774a5[_0x26d1fb(0x36f)];return console[_0x26d1fb(0x235)](_0x26d1fb(0x29c)),console[_0x26d1fb(0x235)](_0x26d1fb(0x1f9)+_0xf25ea4['attemptId']),console[_0x26d1fb(0x235)](_0x26d1fb(0x2a8)+_0xf25ea4[_0x26d1fb(0x2ea)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x287);['description']=a54_0x130479(0x35f);async[a54_0x130479(0x22a)](_0x251658){const _0x4a1020=a54_0x130479,{options:_0x15421f,args:_0x2340cb,tdx:_0x1a26ed}=_0x251658;let _0x401d99=_0x2340cb[0x0];if(!_0x401d99){const _0x1b03ff=this[_0x4a1020(0x2ca)]([],_0x15421f),_0x81439a=await withSpinner(_0x4a1020(0x2c7),()=>_0x1a26ed[_0x4a1020(0x2ab)][_0x4a1020(0x206)](_0x1b03ff,{'limit':_0x15421f[_0x4a1020(0x341)]}),{'verbose':_0x15421f[_0x4a1020(0x399)]}),_0x3df4a5=_0x81439a[_0x4a1020(0x36f)];if(_0x3df4a5[_0x4a1020(0x273)]===0x0)return console[_0x4a1020(0x235)](_0x4a1020(0x2b9)),!_0x1b03ff&&console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x2e9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x252617=_0x3df4a5[_0x4a1020(0x263)](_0x27246e=>({'title':_0x27246e['project']?.[_0x4a1020(0x27b)]+'.'+_0x27246e[_0x4a1020(0x27b)],'value':_0x27246e[_0x4a1020(0x298)]?.['name']+'.'+_0x27246e[_0x4a1020(0x27b)],'description':_0x27246e['revision']?_0x4a1020(0x29d)+_0x27246e[_0x4a1020(0x242)]:undefined})),_0x43f5ff=await a54_0x4e32c8({'type':_0x4a1020(0x2f9),'name':_0x4a1020(0x2ab),'message':'Select\x20a\x20workflow\x20to\x20run','choices':_0x252617});if(!_0x43f5ff[_0x4a1020(0x2ab)])return 0x1;_0x401d99=_0x43f5ff[_0x4a1020(0x2ab)];}if(!_0x401d99[_0x4a1020(0x238)]('.')){const _0x417b25=this[_0x4a1020(0x2ca)]([],_0x15421f);if(_0x417b25)_0x401d99=_0x417b25+'.'+_0x401d99;else return console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x225)]('Error:'),_0x4a1020(0x256)),console[_0x4a1020(0x235)](a54_0x47fe92[_0x4a1020(0x2e9)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x3c528a=_0x15421f['param'],_0x278814=_0x15421f['sessionTime'],_0x2a8e7b={};if(_0x3c528a&&Array['isArray'](_0x3c528a))for(const _0x3af5e2 of _0x3c528a){const _0x598610=_0x3af5e2[_0x4a1020(0x3a4)]('=');if(_0x598610===-0x1)return console[_0x4a1020(0x235)](_0x4a1020(0x202)+_0x3af5e2),console['error'](_0x4a1020(0x340)),0x1;const _0x40e158=_0x3af5e2[_0x4a1020(0x1f0)](0x0,_0x598610),_0x1b70d7=_0x3af5e2['substring'](_0x598610+0x1);try{_0x2a8e7b[_0x40e158]=JSON[_0x4a1020(0x2d8)](_0x1b70d7);}catch{_0x2a8e7b[_0x40e158]=_0x1b70d7;}}_0x15421f[_0x4a1020(0x399)]&&(console[_0x4a1020(0x235)](_0x4a1020(0x291)+_0x401d99),Object['keys'](_0x2a8e7b)[_0x4a1020(0x273)]>0x0&&console[_0x4a1020(0x235)](_0x4a1020(0x2cd)+JSON[_0x4a1020(0x244)](_0x2a8e7b)),_0x278814&&console[_0x4a1020(0x235)](_0x4a1020(0x339)+_0x278814));const _0x17bada=await withSpinner(_0x4a1020(0x233),()=>_0x1a26ed['workflow'][_0x4a1020(0x203)](_0x401d99,_0x2a8e7b,{'sessionTime':_0x278814}),{'verbose':_0x15421f['verbose']}),_0x28b7e9=_0x17bada[_0x4a1020(0x36f)];console[_0x4a1020(0x235)]('✔\x20Workflow\x20run\x20started'),console['error']('\x20\x20Attempt\x20ID:\x20'+_0x28b7e9['id']),console[_0x4a1020(0x235)](_0x4a1020(0x2a8)+_0x28b7e9[_0x4a1020(0x2ea)]),console[_0x4a1020(0x235)](_0x4a1020(0x23e)+_0x28b7e9[_0x4a1020(0x298)]?.['name']),console[_0x4a1020(0x235)](_0x4a1020(0x26d)+_0x28b7e9['workflow']?.['name']);if(_0x28b7e9[_0x4a1020(0x298)]?.['id']&&_0x28b7e9[_0x4a1020(0x2ea)]&&_0x28b7e9['id']){const _0x1156e0=_0x15421f[_0x4a1020(0x25c)],_0x1b8a7e=getConsoleUrl(_0x1156e0,_0x4a1020(0x345)+_0x28b7e9[_0x4a1020(0x298)]['id']+_0x4a1020(0x3a6)+_0x28b7e9['sessionId']+'/attempt/'+_0x28b7e9['id']);console[_0x4a1020(0x235)](_0x4a1020(0x2f1)+a54_0x47fe92['cyan'](_0x1b8a7e));}return 0x0;}}function a54_0x5811(_0x245546,_0x1b4d86){_0x245546=_0x245546-0x1e6;const _0x2dfb40=a54_0x2dfb();let _0x5811c3=_0x2dfb40[_0x245546];return _0x5811c3;}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x210);[a54_0x130479(0x376)]=a54_0x130479(0x2dc);async[a54_0x130479(0x22a)](_0x5d5dc1){const _0x282127=a54_0x130479,{options:_0x1117f0,args:_0x26a919,tdx:_0x16bfa1}=_0x5d5dc1,_0x5d13ea=_0x26a919[0x0],_0x291f0a=_0x26a919[0x1]||'.';if(!_0x5d13ea)return console[_0x282127(0x235)](_0x282127(0x20a)),console[_0x282127(0x235)](_0x282127(0x237)),0x1;const _0x20d077=_0x1117f0['revision'];_0x1117f0[_0x282127(0x399)]&&(console[_0x282127(0x235)]('Project:\x20'+_0x5d13ea),console[_0x282127(0x235)]('Output\x20directory:\x20'+_0x291f0a),_0x20d077&&console[_0x282127(0x235)](_0x282127(0x267)+_0x20d077));const _0x2a854d=await withSpinner(_0x282127(0x264)+_0x5d13ea+'...',()=>_0x16bfa1[_0x282127(0x2ab)]['download'](_0x5d13ea,_0x291f0a,{'revision':_0x20d077}),{'verbose':_0x1117f0[_0x282127(0x399)]}),_0x499d40=_0x2a854d['data'];return console[_0x282127(0x235)](_0x282127(0x347)+_0x499d40['projectName']),console[_0x282127(0x235)](_0x282127(0x395)+_0x499d40['revision']),console[_0x282127(0x235)](_0x282127(0x243)+_0x499d40[_0x282127(0x28c)]),console['error'](_0x282127(0x2cc)+_0x291f0a+'/'+_0x499d40['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x2fd);[a54_0x130479(0x376)]=a54_0x130479(0x24c);async[a54_0x130479(0x22a)](_0x5cc06c){const _0x454bdf=a54_0x130479,{options:_0x5802f2,args:_0x342671,tdx:_0x51fd04}=_0x5cc06c;let _0x444c71='.',_0x10a218=_0x5802f2[_0x454bdf(0x27b)];if(_0x342671[0x0]){const {promises:_0x2a3716}=await import('fs');try{const _0x43f9a7=await _0x2a3716['stat'](_0x342671[0x0]);if(_0x43f9a7[_0x454bdf(0x285)]())_0x444c71=_0x342671[0x0];else return console[_0x454bdf(0x235)](_0x454bdf(0x33d)+_0x342671[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x10a218=_0x342671[0x0],_0x444c71='.';}}const _0x433cc8=_0x5802f2[_0x454bdf(0x242)],_0x27c61b=_0x5802f2[_0x454bdf(0x26f)];_0x5802f2[_0x454bdf(0x399)]&&(console[_0x454bdf(0x235)](_0x454bdf(0x2ce)+_0x444c71),_0x10a218&&console[_0x454bdf(0x235)](_0x454bdf(0x394)+_0x10a218),_0x433cc8&&console[_0x454bdf(0x235)](_0x454bdf(0x267)+_0x433cc8),_0x27c61b&&console[_0x454bdf(0x235)](_0x454bdf(0x306)));const _0x2a4b11=await withSpinner(_0x454bdf(0x2e5),()=>_0x51fd04[_0x454bdf(0x2ab)]['push'](_0x444c71,{'projectName':_0x10a218,'revision':_0x433cc8,'skipValidation':_0x27c61b}),{'verbose':_0x5802f2['verbose']}),_0x104d3d=_0x2a4b11[_0x454bdf(0x36f)];return console[_0x454bdf(0x235)](_0x454bdf(0x1fa)+_0x104d3d[_0x454bdf(0x2d1)]),console[_0x454bdf(0x235)]('\x20\x20Project\x20ID:\x20'+_0x104d3d[_0x454bdf(0x308)]),console['error'](_0x454bdf(0x395)+_0x104d3d[_0x454bdf(0x242)]),await this[_0x454bdf(0x2e4)](_0x51fd04,_0x104d3d[_0x454bdf(0x2d1)],_0x5802f2[_0x454bdf(0x25c)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x29f);['description']='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a54_0x130479(0x22a)](_0x11cc71){const _0xced934=a54_0x130479,{options:_0x12035b,args:_0x89762b,tdx:_0x4a0c08}=_0x11cc71,_0x4165be=_0x89762b[0x0],_0x523d60=_0x89762b[0x1];if(!_0x4165be)return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x225)]('Error:'),_0xced934(0x302)),console[_0xced934(0x235)](a54_0x47fe92['dim']('Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]')),0x1;const _0x1ee7fd=_0x12035b[_0xced934(0x242)];_0x12035b[_0xced934(0x399)]&&(console[_0xced934(0x235)](_0xced934(0x28b)+_0x4165be),_0x523d60&&console[_0xced934(0x235)]('Target\x20directory:\x20'+_0x523d60),_0x1ee7fd&&console[_0xced934(0x235)](_0xced934(0x267)+_0x1ee7fd),_0x12035b[_0xced934(0x2cf)]&&console['error'](_0xced934(0x2fe)));const _0x4ec67d=await withSpinner('Pulling\x20project\x20'+_0x4165be+'...',()=>_0x4a0c08[_0xced934(0x2ab)][_0xced934(0x284)](_0x4165be,{'targetDir':_0x523d60,'revision':_0x1ee7fd}),{'verbose':_0x12035b[_0xced934(0x399)]}),_0x48af75=_0x4ec67d['data'];_0x48af75[_0xced934(0x29a)]?console['error']('→\x20New\x20project:\x20'+_0x48af75[_0xced934(0x2d1)]):console[_0xced934(0x235)]('→\x20Project:\x20'+_0x48af75['projectName']);console[_0xced934(0x235)]('\x20\x20Revision:\x20'+_0x48af75[_0xced934(0x242)]),console[_0xced934(0x235)](_0xced934(0x321)+(a54_0x5d886b['relative'](process[_0xced934(0x2fc)](),_0x48af75[_0xced934(0x25e)])||'.')),console[_0xced934(0x235)]('\x20\x20Changes:\x20'+a54_0x47fe92[_0xced934(0x2b5)]('+'+_0x48af75[_0xced934(0x27c)]['new']+_0xced934(0x332))+',\x20'+(a54_0x47fe92[_0xced934(0x28d)]('~'+_0x48af75[_0xced934(0x27c)][_0xced934(0x2d9)]+_0xced934(0x281))+',\x20')+(a54_0x47fe92['red']('-'+_0x48af75[_0xced934(0x27c)][_0xced934(0x384)]+_0xced934(0x30b))+',\x20')+(''+a54_0x47fe92[_0xced934(0x2e9)](_0x48af75['summary'][_0xced934(0x386)]+_0xced934(0x1ee))));for(const _0x570155 of _0x48af75[_0xced934(0x3a7)]){_0x570155[_0xced934(0x2c3)]===_0xced934(0x2d9)&&_0x570155[_0xced934(0x39d)]&&(console[_0xced934(0x235)]('\x0a'+a54_0x47fe92[_0xced934(0x2c4)]('---\x20'+_0x570155[_0xced934(0x2f4)])),console[_0xced934(0x235)](_0x570155[_0xced934(0x39d)]));}if(!_0x48af75[_0xced934(0x269)])return saveSessionContext({'workflow_project':_0x48af75['projectName']},_0x12035b[_0xced934(0x34b)]),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2b5)]('\x0a✔\x20Already\x20up\x20to\x20date')),console['error'](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x388)+_0x48af75[_0xced934(0x2d1)])),0x0;if(_0x12035b[_0xced934(0x2cf)])return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x28d)](_0xced934(0x2e1))),0x0;if(!_0x12035b[_0xced934(0x35c)]){if(!isInteractive())return console['error'](a54_0x47fe92[_0xced934(0x225)](_0xced934(0x391)),_0xced934(0x2d2)),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x344))),0x1;const _0x3be46f=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x3be46f)return console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x28d)](_0xced934(0x375)),_0xced934(0x299)),0x1;}await withSpinner(_0xced934(0x1ff),()=>_0x4a0c08[_0xced934(0x2ab)][_0xced934(0x292)](_0x48af75,{'revision':_0x1ee7fd}),{'verbose':_0x12035b[_0xced934(0x399)]}),saveSessionContext({'workflow_project':_0x48af75[_0xced934(0x2d1)]},_0x12035b[_0xced934(0x34b)]),console['error'](a54_0x47fe92[_0xced934(0x2b5)](_0xced934(0x370)));const _0x10a4ef=a54_0x5d886b[_0xced934(0x2ff)](process[_0xced934(0x2fc)](),_0x48af75[_0xced934(0x25e)])||'.';return console['error'](a54_0x47fe92['dim'](_0xced934(0x2cc)+_0x10a4ef)),console[_0xced934(0x235)](a54_0x47fe92[_0xced934(0x2e9)](_0xced934(0x388)+_0x48af75[_0xced934(0x2d1)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x2df);['description']=a54_0x130479(0x232);async[a54_0x130479(0x22a)](_0x187481){const _0xa2986c=a54_0x130479,{options:_0x45fb58,args:_0x31d52d,tdx:_0x203beb}=_0x187481,_0x43404b=this[_0xa2986c(0x2d5)](_0x31d52d,_0x45fb58),_0x1941d2=_0x45fb58[_0xa2986c(0x242)],_0x3a894d=_0x45fb58[_0xa2986c(0x26f)];_0x45fb58['verbose']&&(_0x43404b&&console[_0xa2986c(0x235)](_0xa2986c(0x2da)+_0x43404b),_0x1941d2&&console[_0xa2986c(0x235)](_0xa2986c(0x267)+_0x1941d2),_0x45fb58[_0xa2986c(0x2cf)]&&console[_0xa2986c(0x235)](_0xa2986c(0x2fe)),_0x3a894d&&console[_0xa2986c(0x235)](_0xa2986c(0x306)));let _0x377753;try{_0x377753=await withSpinner('Analyzing\x20changes...',()=>_0x203beb[_0xa2986c(0x2ab)][_0xa2986c(0x2ee)]({'sourceDir':_0x43404b,'revision':_0x1941d2,'skipValidation':_0x3a894d}),{'verbose':_0x45fb58[_0xa2986c(0x399)]});}catch(_0x5cadee){if(_0x5cadee instanceof Error&&_0x5cadee[_0xa2986c(0x20e)]['includes'](_0xa2986c(0x297)))return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x225)](_0xa2986c(0x25d)),'No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents'),_0x45fb58['workflowProject']?console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x397)+_0x45fb58['workflowProject']+_0xa2986c(0x30e)+_0x45fb58[_0xa2986c(0x37d)]+'\x27')):console['error'](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x32a))),0x1;throw _0x5cadee;}const _0x50b8fb=_0x377753[_0xa2986c(0x36f)];console['error'](_0xa2986c(0x1f5)+_0x50b8fb[_0xa2986c(0x2d1)]),console['error'](_0xa2986c(0x2ae)+_0x50b8fb[_0xa2986c(0x2c5)]),console[_0xa2986c(0x235)](_0xa2986c(0x395)+_0x50b8fb[_0xa2986c(0x242)]),console[_0xa2986c(0x235)]('\x20\x20Changes:\x20'+a54_0x47fe92[_0xa2986c(0x2b5)]('+'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x372)]+_0xa2986c(0x332))+',\x20'+(a54_0x47fe92[_0xa2986c(0x28d)]('~'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x2d9)]+_0xa2986c(0x281))+',\x20')+(a54_0x47fe92['red']('-'+_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x384)]+_0xa2986c(0x30b))+',\x20')+(''+a54_0x47fe92[_0xa2986c(0x2e9)](_0x50b8fb[_0xa2986c(0x27c)][_0xa2986c(0x386)]+'\x20unchanged')));for(const _0x44fdcd of _0x50b8fb[_0xa2986c(0x3a7)]){_0x44fdcd[_0xa2986c(0x2c3)]==='modified'&&_0x44fdcd['diff']&&(console[_0xa2986c(0x235)]('\x0a'+a54_0x47fe92[_0xa2986c(0x2c4)](_0xa2986c(0x21c)+_0x44fdcd[_0xa2986c(0x2f4)])),console[_0xa2986c(0x235)](_0x44fdcd[_0xa2986c(0x39d)]));}if(!_0x50b8fb[_0xa2986c(0x269)])return console[_0xa2986c(0x235)](a54_0x47fe92['green']('\x0a✔\x20No\x20changes\x20to\x20push')),await this[_0xa2986c(0x2e4)](_0x203beb,_0x50b8fb['projectName'],_0x45fb58[_0xa2986c(0x25c)]),0x0;if(_0x45fb58['dryRun'])return console[_0xa2986c(0x235)](a54_0x47fe92['yellow'](_0xa2986c(0x360))),0x0;if(!_0x45fb58[_0xa2986c(0x35c)]){if(!isInteractive())return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x225)](_0xa2986c(0x391)),_0xa2986c(0x2d2)),console['error'](a54_0x47fe92[_0xa2986c(0x2e9)](_0xa2986c(0x344))),0x1;const _0x2efeb4=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0x2efeb4)return console['error'](a54_0x47fe92[_0xa2986c(0x28d)](_0xa2986c(0x375)),_0xa2986c(0x338)),0x1;}const _0x7fd555=await withSpinner('Pushing\x20project...',()=>_0x203beb[_0xa2986c(0x2ab)][_0xa2986c(0x229)](_0x50b8fb),{'verbose':_0x45fb58[_0xa2986c(0x399)]}),_0x1a7f15=_0x7fd555[_0xa2986c(0x36f)];return console[_0xa2986c(0x235)](a54_0x47fe92[_0xa2986c(0x2b5)](_0xa2986c(0x239))),console['error'](_0xa2986c(0x31c)+_0x1a7f15[_0xa2986c(0x308)]),console['error'](_0xa2986c(0x395)+_0x1a7f15[_0xa2986c(0x242)]),await this['showWorkflowConsoleUrl'](_0x203beb,_0x1a7f15['projectName'],_0x45fb58[_0xa2986c(0x25c)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x1e6);[a54_0x130479(0x376)]=a54_0x130479(0x2c6);async[a54_0x130479(0x22a)](_0x3b3575){const _0x5cdc4e=a54_0x130479,{options:_0x4b8e84,args:_0x138b69,tdx:_0xa01939}=_0x3b3575,_0x180ded=this['resolveProjectDir'](_0x138b69,_0x4b8e84),_0x464ce5=_0x4b8e84[_0x5cdc4e(0x27b)],_0x1c2305=_0x4b8e84[_0x5cdc4e(0x242)],_0x57f622=_0x4b8e84[_0x5cdc4e(0x26f)];if(!_0x180ded)return console['error'](a54_0x47fe92[_0x5cdc4e(0x225)](_0x5cdc4e(0x25d)),_0x5cdc4e(0x336)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x305))),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x38f))),0x1;if(!_0x464ce5)return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x225)]('Error:'),_0x5cdc4e(0x35b)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x305))),0x1;_0x4b8e84[_0x5cdc4e(0x399)]&&(console[_0x5cdc4e(0x235)]('Source\x20directory:\x20'+_0x180ded),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x353)+_0x464ce5),_0x1c2305&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x267)+_0x1c2305),_0x4b8e84['dryRun']&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x2fe)),_0x57f622&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x306)));const _0x3033e5=await withSpinner('Analyzing\x20project...',()=>_0xa01939[_0x5cdc4e(0x2ab)][_0x5cdc4e(0x27e)](_0x180ded,_0x464ce5,{'revision':_0x1c2305,'skipValidation':_0x57f622}),{'verbose':_0x4b8e84[_0x5cdc4e(0x399)]}),_0x191305=_0x3033e5[_0x5cdc4e(0x36f)];console[_0x5cdc4e(0x235)](_0x5cdc4e(0x379)+_0x191305[_0x5cdc4e(0x2c5)]);_0x191305[_0x5cdc4e(0x1ed)]&&console[_0x5cdc4e(0x235)](_0x5cdc4e(0x368)+_0x191305[_0x5cdc4e(0x1ed)]);console[_0x5cdc4e(0x235)](_0x5cdc4e(0x353)+_0x191305['newProjectName']),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x267)+_0x191305[_0x5cdc4e(0x242)]),console['error'](_0x5cdc4e(0x2d4)+_0x191305[_0x5cdc4e(0x326)]);_0x191305['targetExists']&&(console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x28d)](_0x5cdc4e(0x2b7)+_0x191305[_0x5cdc4e(0x2e3)]+_0x5cdc4e(0x2ac)+_0x191305['existingProjectId']+')')),console[_0x5cdc4e(0x235)](a54_0x47fe92['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x4b8e84[_0x5cdc4e(0x2cf)])return console['error'](a54_0x47fe92['yellow'](_0x5cdc4e(0x1e8))),0x0;if(!_0x4b8e84[_0x5cdc4e(0x35c)]){if(!isInteractive())return console['error'](a54_0x47fe92[_0x5cdc4e(0x225)]('\x0aError:'),_0x5cdc4e(0x2d2)),console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2e9)](_0x5cdc4e(0x344))),0x1;const _0x4bca71=_0x191305[_0x5cdc4e(0x1ed)]||a54_0x5d886b['basename'](_0x180ded),_0x42bf2=_0x191305[_0x5cdc4e(0x2c2)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x464ce5+'\x22\x20with\x20new\x20revision?':_0x5cdc4e(0x283)+_0x4bca71+_0x5cdc4e(0x2be)+_0x464ce5+'\x22?',_0x79e1e2=await confirmKey(_0x42bf2);if(!_0x79e1e2)return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x28d)]('Cancelled')),0x1;}const _0x34fb41=await withSpinner(_0x191305[_0x5cdc4e(0x2c2)]?_0x5cdc4e(0x36b)+_0x464ce5+_0x5cdc4e(0x2d6):_0x5cdc4e(0x34e)+_0x464ce5+'...',()=>_0xa01939['workflow']['executeCloneProject'](_0x191305),{'verbose':_0x4b8e84[_0x5cdc4e(0x399)]}),_0x369197=_0x34fb41['data'];return console[_0x5cdc4e(0x235)](a54_0x47fe92[_0x5cdc4e(0x2b5)](_0x191305[_0x5cdc4e(0x2c2)]?_0x5cdc4e(0x290):'✔\x20Clone\x20complete')),console[_0x5cdc4e(0x235)]('\x20\x20Project:\x20'+_0x369197['newProjectName']),console['error'](_0x5cdc4e(0x31c)+_0x369197[_0x5cdc4e(0x24a)]),console[_0x5cdc4e(0x235)](_0x5cdc4e(0x395)+_0x369197['revision']),await this['showWorkflowConsoleUrl'](_0xa01939,_0x369197['newProjectName'],_0x4b8e84['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x330);[a54_0x130479(0x376)]=a54_0x130479(0x37a);async[a54_0x130479(0x22a)](_0x3b123f){const _0x390ba8=a54_0x130479,{options:_0x433c99,args:_0x4a68b2,tdx:_0x5380a7}=_0x3b123f,_0x511d46=_0x4a68b2[0x0];if(!_0x511d46)return console['error'](_0x390ba8(0x2f7)),console[_0x390ba8(0x235)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x433c99[_0x390ba8(0x399)]&&console[_0x390ba8(0x235)](_0x390ba8(0x28b)+_0x511d46);if(!_0x433c99['yes']){if(!isInteractive())return console[_0x390ba8(0x235)](a54_0x47fe92['red'](_0x390ba8(0x391)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x390ba8(0x235)](a54_0x47fe92['dim'](_0x390ba8(0x344))),0x1;const _0x19acae=await confirmKey(_0x390ba8(0x354)+_0x511d46+_0x390ba8(0x35d));if(!_0x19acae)return console[_0x390ba8(0x235)](a54_0x47fe92[_0x390ba8(0x28d)](_0x390ba8(0x375))),0x1;}const _0x38be97=await withSpinner(_0x390ba8(0x266)+_0x511d46+'...',()=>_0x5380a7[_0x390ba8(0x2ab)][_0x390ba8(0x2b1)](_0x511d46),{'verbose':_0x433c99[_0x390ba8(0x399)]}),_0xeb233d=_0x38be97[_0x390ba8(0x36f)];return console[_0x390ba8(0x235)]('✔\x20Deleted\x20project\x20'+_0xeb233d[_0x390ba8(0x2d1)]),console[_0x390ba8(0x235)](_0x390ba8(0x31c)+_0xeb233d[_0x390ba8(0x308)]),0x0;}}export function parseKeyValue(_0x4b9463){const _0x17d51d=a54_0x130479,_0x82de9=_0x4b9463[_0x17d51d(0x3a4)]('=');if(_0x82de9===-0x1)throw new Error('Invalid\x20format:\x20'+_0x4b9463+_0x17d51d(0x2af));const _0x34fd9c=_0x4b9463[_0x17d51d(0x1f0)](0x0,_0x82de9),_0x66833c=_0x4b9463['substring'](_0x82de9+0x1);if(!_0x34fd9c)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x34fd9c,'value':_0x66833c};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x253);[a54_0x130479(0x376)]=a54_0x130479(0x2f2);async[a54_0x130479(0x22a)](_0x256177){const _0x589bba=a54_0x130479,{options:_0x4d8891,args:_0x334331,tdx:_0x56e716}=_0x256177,_0x5e3cce=this['requireProject'](_0x334331,_0x4d8891);if(!_0x5e3cce)return 0x1;_0x4d8891['verbose']&&console[_0x589bba(0x235)]('Project:\x20'+_0x5e3cce);const _0x54ed24=await withSpinner(_0x589bba(0x31d),()=>_0x56e716['workflow'][_0x589bba(0x2a7)](_0x5e3cce),{'verbose':_0x4d8891['verbose']}),{secrets:_0x45b6ba}=_0x54ed24[_0x589bba(0x36f)];return console[_0x589bba(0x235)](_0x589bba(0x393)+_0x45b6ba['length']+_0x589bba(0x222)+(_0x45b6ba['length']!==0x1?'s':'')),await handleSDKOutput(_0x45b6ba,_0x4d8891),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x300);['description']=a54_0x130479(0x2b2);async['execute'](_0x15c505){const _0x37c05f=a54_0x130479,{options:_0x3b35f2,args:_0xddeaa7,tdx:_0x155a02}=_0x15c505;let _0x17ba4c,_0x40a824;if(_0xddeaa7[_0x37c05f(0x273)]>=0x1&&!_0xddeaa7[0x0]['includes']('='))_0x17ba4c=_0xddeaa7[0x0],_0x40a824=_0xddeaa7[_0x37c05f(0x319)](0x1);else{if(_0xddeaa7[_0x37c05f(0x273)]>=0x1&&_0x3b35f2[_0x37c05f(0x37d)])_0x17ba4c=_0x3b35f2[_0x37c05f(0x37d)],_0x40a824=_0xddeaa7;else return _0xddeaa7['length']>=0x1?(console[_0x37c05f(0x235)](_0x37c05f(0x20a)),console[_0x37c05f(0x235)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x37c05f(0x235)](_0x37c05f(0x36e)),console[_0x37c05f(0x235)](_0x37c05f(0x282)),0x1);}if(_0x40a824[_0x37c05f(0x273)]===0x0)return console[_0x37c05f(0x235)](_0x37c05f(0x36e)),console[_0x37c05f(0x235)](_0x37c05f(0x282)),0x1;const _0x33a39f={};try{for(const _0x348b4d of _0x40a824){const {key:_0x23fb3c,value:_0x194d42}=parseKeyValue(_0x348b4d);_0x33a39f[_0x23fb3c]=_0x194d42;}}catch(_0x1faaae){return _0x1faaae instanceof Error&&console[_0x37c05f(0x235)](a54_0x47fe92[_0x37c05f(0x225)](_0x37c05f(0x25d)),_0x1faaae[_0x37c05f(0x20e)]),0x1;}const _0xc8bd37=Object[_0x37c05f(0x226)](_0x33a39f);_0x3b35f2[_0x37c05f(0x399)]&&(console[_0x37c05f(0x235)](_0x37c05f(0x28b)+_0x17ba4c),console[_0x37c05f(0x235)](_0x37c05f(0x26b)+_0xc8bd37[_0x37c05f(0x211)](',\x20')));const _0x6e3f37=await withSpinner(_0xc8bd37[_0x37c05f(0x273)]===0x1?_0x37c05f(0x39c):_0x37c05f(0x255)+_0xc8bd37[_0x37c05f(0x273)]+_0x37c05f(0x295),()=>_0x155a02[_0x37c05f(0x2ab)][_0x37c05f(0x258)](_0x17ba4c,_0x33a39f),{'verbose':_0x3b35f2['verbose']}),_0x3ef8e7=_0x6e3f37[_0x37c05f(0x36f)];return console[_0x37c05f(0x235)](_0xc8bd37['length']===0x1?_0x37c05f(0x2a3)+_0x3ef8e7[_0x37c05f(0x226)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x3ef8e7[_0x37c05f(0x2d1)]+'\x27':'✔\x20'+_0x3ef8e7['keys']['length']+'\x20secrets\x20set\x20for\x20project\x20\x27'+_0x3ef8e7[_0x37c05f(0x2d1)]+'\x27'),(_0x3b35f2['json']||_0x3b35f2['jsonl'])&&await handleSingleObjectOutput(_0x3ef8e7,_0x3b35f2),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x130479(0x20f);['description']=a54_0x130479(0x223);async[a54_0x130479(0x22a)](_0x3b63c3){const _0x54a0c5=a54_0x130479,{options:_0x9f643e,args:_0x3b4671,tdx:_0x438bbd}=_0x3b63c3;let _0x2c29e5,_0x5c1cc6;if(_0x3b4671['length']>=0x2)_0x2c29e5=_0x3b4671[0x0],_0x5c1cc6=_0x3b4671[0x1];else{if(_0x3b4671[_0x54a0c5(0x273)]===0x1&&_0x9f643e['workflowProject'])_0x2c29e5=_0x9f643e[_0x54a0c5(0x37d)],_0x5c1cc6=_0x3b4671[0x0];else return _0x3b4671[_0x54a0c5(0x273)]===0x1?(console[_0x54a0c5(0x235)](_0x54a0c5(0x20a)),console[_0x54a0c5(0x235)](_0x54a0c5(0x277)),0x1):(console['error'](_0x54a0c5(0x2b8)),console[_0x54a0c5(0x235)](_0x54a0c5(0x23c)),0x1);}_0x9f643e['verbose']&&(console[_0x54a0c5(0x235)]('Project:\x20'+_0x2c29e5),console[_0x54a0c5(0x235)](_0x54a0c5(0x38d)+_0x5c1cc6));if(!_0x9f643e['yes']){if(!isInteractive())return console[_0x54a0c5(0x235)](a54_0x47fe92[_0x54a0c5(0x225)]('\x0aError:'),_0x54a0c5(0x2d2)),console[_0x54a0c5(0x235)](a54_0x47fe92['dim'](_0x54a0c5(0x344))),0x1;const _0x304639=await confirmKey(_0x54a0c5(0x2f3)+_0x5c1cc6+'\x27\x20from\x20project\x20\x27'+_0x2c29e5+'\x27?');if(!_0x304639)return console[_0x54a0c5(0x235)](a54_0x47fe92[_0x54a0c5(0x28d)]('Cancelled')),0x1;}const _0x5e11c6=await withSpinner(_0x54a0c5(0x333),()=>_0x438bbd[_0x54a0c5(0x2ab)][_0x54a0c5(0x251)](_0x2c29e5,_0x5c1cc6),{'verbose':_0x9f643e['verbose']}),_0x3b83ee=_0x5e11c6[_0x54a0c5(0x36f)];return console[_0x54a0c5(0x235)](_0x54a0c5(0x2a3)+_0x3b83ee[_0x54a0c5(0x241)]+_0x54a0c5(0x1fc)+_0x3b83ee['projectName']+'\x27'),(_0x9f643e[_0x54a0c5(0x309)]||_0x9f643e[_0x54a0c5(0x2cb)])&&await handleSingleObjectOutput(_0x3b83ee,_0x9f643e),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(_0xe40372){const _0x254f05=a54_0x130479,_0xca2393=Math['floor'](_0xe40372/0x3e8),_0x488329=Math[_0x254f05(0x37c)](_0xca2393/0x3c),_0x54ff87=Math['floor'](_0x488329/0x3c),_0x13e762=Math[_0x254f05(0x37c)](_0x54ff87/0x18);if(_0x13e762>0x0){const _0x4dff25=_0x54ff87%0x18;return _0x4dff25>0x0?_0x13e762+'d\x20'+_0x4dff25+'h':_0x13e762+'d';}else{if(_0x54ff87>0x0){const _0x28565d=_0x488329%0x3c;return _0x28565d>0x0?_0x54ff87+'h\x20'+_0x28565d+'m':_0x54ff87+'h';}else{if(_0x488329>0x0){const _0x427b13=_0xca2393%0x3c;return _0x427b13>0x0?_0x488329+'m\x20'+_0x427b13+'s':_0x488329+'m';}else return _0xca2393+'s';}}}function formatTimestamp(_0x497115,_0x472944){const _0x4cbe21=a54_0x130479,_0x14e305=new Date(_0x497115),_0x5dd7ac=String(_0x14e305['getHours']())['padStart'](0x2,'0'),_0x1ef34b=String(_0x14e305['getMinutes']())['padStart'](0x2,'0'),_0x336677=_0x5dd7ac+':'+_0x1ef34b,_0x3ab553=_0x14e305[_0x4cbe21(0x2e2)]()===_0x472944[_0x4cbe21(0x2e2)]()&&_0x14e305[_0x4cbe21(0x213)]()===_0x472944[_0x4cbe21(0x213)]()&&_0x14e305[_0x4cbe21(0x2bc)]()===_0x472944[_0x4cbe21(0x2bc)]();if(_0x3ab553)return _0x336677;else{const _0x7c75d2=String(_0x14e305[_0x4cbe21(0x213)]()+0x1)[_0x4cbe21(0x33a)](0x2,'0'),_0x45e2db=String(_0x14e305[_0x4cbe21(0x2bc)]())['padStart'](0x2,'0');return _0x7c75d2+'-'+_0x45e2db+'\x20'+_0x336677;}}function formatDate(_0xc95c54){const _0x57a5fd=a54_0x130479,_0xeae70=_0xc95c54[_0x57a5fd(0x2e2)](),_0x3fff5b=String(_0xc95c54[_0x57a5fd(0x213)]()+0x1)[_0x57a5fd(0x33a)](0x2,'0'),_0x5b5a6b=String(_0xc95c54['getDate']())[_0x57a5fd(0x33a)](0x2,'0');return _0xeae70+'-'+_0x3fff5b+'-'+_0x5b5a6b;}function getTaskStateIcon(_0x123144){const _0x432ee7={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x432ee7[_0x123144]||'⚪';}function getBarChar(_0x2c25d3){const _0x4eaf37=a54_0x130479;return _0x2c25d3==='error'||_0x2c25d3===_0x4eaf37(0x2de)?'×':'─';}function getBarColor(_0x57fb88){const _0x969b9=a54_0x130479,_0x240b89={'success':a54_0x47fe92[_0x969b9(0x2b5)],'error':a54_0x47fe92[_0x969b9(0x225)],'group_error':a54_0x47fe92[_0x969b9(0x225)],'running':a54_0x47fe92[_0x969b9(0x215)],'blocked':a54_0x47fe92[_0x969b9(0x28d)],'planned':a54_0x47fe92[_0x969b9(0x2e9)],'canceling':a54_0x47fe92[_0x969b9(0x28d)]};return _0x240b89[_0x57fb88]||a54_0x47fe92[_0x969b9(0x259)];}function parseTaskName(_0x55ee76){const _0x50f375=a54_0x130479;let _0x403478=_0x55ee76[_0x50f375(0x220)](/^\++/,'');const _0x2681e9=_0x403478['split']('+'),_0x15b985=_0x2681e9[_0x50f375(0x273)]>0x1?_0x2681e9[_0x50f375(0x273)]-0x2:0x0,_0x51dcf8=_0x2681e9[_0x2681e9[_0x50f375(0x273)]-0x1]||_0x403478;return{'level':_0x15b985,'name':'+'+_0x51dcf8};}function truncateTaskName(_0x55ce43,_0x5710e9){const _0x4839c0=a54_0x130479,_0x409db0=stringWidth(_0x55ce43);if(_0x409db0<=_0x5710e9)return _0x55ce43;let _0x22547b=_0x55ce43;while(stringWidth(_0x22547b+'…')>_0x5710e9&&_0x22547b[_0x4839c0(0x273)]>0x0){_0x22547b=_0x22547b['slice'](0x0,-0x1);}return _0x22547b+'…';}function calculateTimeScale(_0x3c753a,_0x2a02bc){const _0x14d473=a54_0x130479;return{'startTime':_0x3c753a[_0x14d473(0x2aa)],'endTime':_0x3c753a[_0x14d473(0x2eb)],'durationMs':_0x3c753a[_0x14d473(0x2ad)],'msPerChar':_0x3c753a[_0x14d473(0x2ad)]/_0x2a02bc};}function timeToPosition(_0x1b411c,_0x152057,_0x2d12e4){const _0x3d7d3f=a54_0x130479,_0x495c90=_0x1b411c-_0x152057['startTime'],_0x1d5a2b=Math[_0x3d7d3f(0x37c)](_0x495c90/_0x152057['msPerChar']);return Math['max'](0x0,Math[_0x3d7d3f(0x316)](_0x1d5a2b,_0x2d12e4));}function renderTimeAxis(_0x24df3e,_0x55a04f){const _0x3a4db0=a54_0x130479,_0x173e31=Math[_0x3a4db0(0x316)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x3a4db0(0x2b3)](TIMELINE_CONFIG[_0x3a4db0(0x27f)],Math['floor'](_0x55a04f/TIMELINE_CONFIG[_0x3a4db0(0x280)]))),_0x4615bc=_0x24df3e[_0x3a4db0(0x2b4)]/(_0x173e31-0x1),_0x3d1a73=new Date(_0x24df3e[_0x3a4db0(0x346)]),_0xa2e59c=[];for(let _0x542501=0x0;_0x542501<_0x173e31;_0x542501++){const _0x477ac8=_0x24df3e[_0x3a4db0(0x346)]+_0x542501*_0x4615bc,_0x5db18c=timeToPosition(_0x477ac8,_0x24df3e,_0x55a04f),_0x1304e5=formatTimestamp(_0x477ac8,_0x3d1a73);_0xa2e59c[_0x3a4db0(0x1ea)]({'pos':_0x5db18c,'text':_0x1304e5});}const _0x419634=new Array(_0x55a04f)[_0x3a4db0(0x315)]('\x20');let _0x33038e=-0x1;for(const {pos:_0x1cfce6,text:_0x32abaf}of _0xa2e59c){let _0x1e7381=Math[_0x3a4db0(0x2b3)](0x0,_0x1cfce6-Math[_0x3a4db0(0x37c)](_0x32abaf[_0x3a4db0(0x273)]/0x2));_0x1e7381<=_0x33038e+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x1e7381=_0x33038e+TIMELINE_CONFIG[_0x3a4db0(0x22b)]+0x1);_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]>_0x55a04f&&(_0x1e7381=_0x55a04f-_0x32abaf[_0x3a4db0(0x273)]);if(_0x1e7381>=0x0&&_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]<=_0x55a04f&&_0x1e7381>_0x33038e){for(let _0x407a04=0x0;_0x407a04<_0x32abaf[_0x3a4db0(0x273)];_0x407a04++){_0x419634[_0x1e7381+_0x407a04]=_0x32abaf[_0x407a04];}_0x33038e=_0x1e7381+_0x32abaf[_0x3a4db0(0x273)]-0x1;}}return _0x419634[_0x3a4db0(0x211)]('');}function renderTaskRow(_0x21e58a,_0x384616,_0x564c46,_0x380558){const _0x2445eb=a54_0x130479,{level:_0x1e31e1,name:_0x376762}=parseTaskName(_0x21e58a[_0x2445eb(0x27b)]),_0x4a8eda='\x20'[_0x2445eb(0x2fa)](_0x1e31e1),_0x5b62cd=_0x21e58a[_0x2445eb(0x367)]?'('+formatElapsed(_0x21e58a[_0x2445eb(0x367)]['duration'])+')':'',_0x579dda=stringWidth(_0x5b62cd),_0x53b7f9=_0x1e31e1*0x1,_0x216128=_0x380558-_0x53b7f9-_0x579dda-0x1,_0x3fcd98=truncateTaskName(_0x376762,_0x216128),_0x229e53=_0x4a8eda+_0x3fcd98,_0x33a8f7=stringWidth(_0x229e53),_0x5f1840=_0x380558-_0x33a8f7-_0x579dda,_0x46480b=_0x229e53+'\x20'[_0x2445eb(0x2fa)](Math[_0x2445eb(0x2b3)](0x1,_0x5f1840))+a54_0x47fe92[_0x2445eb(0x2e9)](_0x5b62cd),_0x504844=getTaskStateIcon(_0x21e58a[_0x2445eb(0x260)]),_0x539c78=new Array(_0x564c46)[_0x2445eb(0x315)]('\x20');if(_0x21e58a['window']){const _0x2201ad=timeToPosition(_0x21e58a['window'][_0x2445eb(0x2aa)],_0x384616,_0x564c46),_0x38b8dc=timeToPosition(_0x21e58a[_0x2445eb(0x367)][_0x2445eb(0x2eb)],_0x384616,_0x564c46),_0x1264f0=getBarChar(_0x21e58a[_0x2445eb(0x260)]),_0x349280=Math[_0x2445eb(0x2b3)](_0x2201ad+0x1,_0x38b8dc);for(let _0x590a9f=_0x2201ad;_0x590a9f<Math[_0x2445eb(0x316)](_0x349280,_0x564c46);_0x590a9f++){_0x539c78[_0x590a9f]=_0x1264f0;}}const _0x5f31b=getBarColor(_0x21e58a[_0x2445eb(0x260)]),_0x4621d4=_0x539c78[_0x2445eb(0x263)](_0x3b6ed6=>_0x3b6ed6==='\x20'?'\x20':_0x5f31b(_0x3b6ed6))[_0x2445eb(0x211)]('');return _0x504844+'\x20'+_0x46480b+'│'+_0x4621d4+'│';}function calculateStats(_0x360883){const _0x55d5e4=a54_0x130479,_0x466907={'total':_0x360883[_0x55d5e4(0x273)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5d5d51 of _0x360883){if(_0x5d5d51[_0x55d5e4(0x260)]===_0x55d5e4(0x337))_0x466907['success']++;else{if(_0x5d5d51[_0x55d5e4(0x260)]===_0x55d5e4(0x235)||_0x5d5d51[_0x55d5e4(0x260)]==='group_error')_0x466907[_0x55d5e4(0x235)]++;else _0x5d5d51['state']===_0x55d5e4(0x1fe)?_0x466907[_0x55d5e4(0x1fe)]++:_0x466907[_0x55d5e4(0x2d7)]++;}}return _0x466907;}function formatStats(_0x33c2a9){const _0x4fc979=a54_0x130479;return[_0x4fc979(0x21f)+_0x33c2a9[_0x4fc979(0x1f7)],'✅\x20'+_0x33c2a9[_0x4fc979(0x337)],'❌\x20'+_0x33c2a9['error'],_0x4fc979(0x3a0)+_0x33c2a9[_0x4fc979(0x1fe)],'⏳\x20'+_0x33c2a9[_0x4fc979(0x2d7)]][_0x4fc979(0x211)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a54_0x130479(0x27b)]=a54_0x130479(0x34f);['description']='Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt';async[a54_0x130479(0x22a)](_0x40993b){const _0x8e0a8d=a54_0x130479,{options:_0x2dfd85,args:_0x3b2cd7,tdx:_0x1bd326}=_0x40993b;let _0x6297c7,_0x474173,_0x347308=![];if(_0x3b2cd7[0x0]){if(_0x3b2cd7[0x0][_0x8e0a8d(0x238)]('.')){const _0x3e676c=this[_0x8e0a8d(0x31a)](_0x3b2cd7,_0x2dfd85);if(!_0x3e676c)return 0x1;_0x6297c7=_0x3e676c[_0x8e0a8d(0x2d1)],_0x474173=_0x3e676c['workflowName'];}else{_0x474173=_0x3b2cd7[0x0],_0x6297c7=_0x2dfd85[_0x8e0a8d(0x37d)];if(!_0x6297c7)return console[_0x8e0a8d(0x235)](a54_0x47fe92['red'](_0x8e0a8d(0x25d)),_0x8e0a8d(0x2ec)),0x1;_0x347308=!![];}}else{const _0x477d4a=this['parseProjectWorkflowPattern'](_0x3b2cd7,_0x2dfd85);if(!_0x477d4a)return 0x1;_0x6297c7=_0x477d4a[_0x8e0a8d(0x2d1)],_0x474173=_0x477d4a[_0x8e0a8d(0x25a)];}if(_0x2dfd85[_0x8e0a8d(0x399)]){if(_0x6297c7&&_0x474173)console[_0x8e0a8d(0x235)](_0x8e0a8d(0x26e)+_0x6297c7+'.'+_0x474173);else _0x6297c7&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x270)+_0x6297c7);}const _0x4741cb=_0x2dfd85[_0x8e0a8d(0x2a5)],_0xafe999=_0x2dfd85[_0x8e0a8d(0x2ea)];if(_0x4741cb){_0xafe999&&console['error'](a54_0x47fe92[_0x8e0a8d(0x28d)](_0x8e0a8d(0x24f)),_0x8e0a8d(0x2c8));const _0x2160b9=_0x2dfd85[_0x8e0a8d(0x39f)];return _0x2160b9?await this[_0x8e0a8d(0x327)](_0x40993b,_0x4741cb):await this['renderSingleTimeline'](_0x40993b,_0x4741cb,_0x2dfd85),0x0;}if(_0xafe999){const _0x3eb3fa=await withSpinner(_0x8e0a8d(0x25b),()=>_0x1bd326[_0x8e0a8d(0x2ab)]['sessions']({'projectName':_0x6297c7,'workflowName':_0x474173,'limit':0x64}),{'verbose':_0x2dfd85['verbose']}),_0x3b732b=_0x3eb3fa[_0x8e0a8d(0x36f)][_0x8e0a8d(0x398)](_0x20606b=>_0x20606b['id']===_0xafe999);if(!_0x3b732b)return console['error'](a54_0x47fe92[_0x8e0a8d(0x225)](_0x8e0a8d(0x25d)),_0x8e0a8d(0x37f)+_0xafe999),0x1;if(!_0x3b732b[_0x8e0a8d(0x250)]?.['id'])return console[_0x8e0a8d(0x235)](a54_0x47fe92[_0x8e0a8d(0x225)](_0x8e0a8d(0x25d)),'Session\x20'+_0xafe999+_0x8e0a8d(0x378)),0x1;const _0xebbedf=_0x3b732b[_0x8e0a8d(0x250)]['id'];_0x2dfd85[_0x8e0a8d(0x399)]&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x2a2)+_0xebbedf+_0x8e0a8d(0x1fd)+_0xafe999);const _0x8aa9d=_0x2dfd85['follow'];return _0x8aa9d?await this['pollTimeline'](_0x40993b,_0xebbedf):await this[_0x8e0a8d(0x362)](_0x40993b,_0xebbedf,_0x2dfd85),0x0;}const _0x5705f7=await withSpinner(_0x8e0a8d(0x365),()=>_0x1bd326[_0x8e0a8d(0x2ab)]['sessions']({'projectName':_0x6297c7,'workflowName':_0x474173,'limit':_0x2dfd85[_0x8e0a8d(0x341)]||0x32}),{'verbose':_0x2dfd85['verbose']}),_0x5297ea=_0x5705f7['data'];if(_0x5297ea[_0x8e0a8d(0x273)]===0x0){if(_0x6297c7&&_0x474173)console[_0x8e0a8d(0x235)]('No\x20sessions\x20found\x20for:\x20'+_0x6297c7+'.'+_0x474173);else _0x6297c7?console[_0x8e0a8d(0x235)](_0x8e0a8d(0x252)+_0x6297c7):(console['error'](_0x8e0a8d(0x37b)),console[_0x8e0a8d(0x235)](a54_0x47fe92[_0x8e0a8d(0x2e9)](_0x8e0a8d(0x248))));return 0x0;}_0x5297ea[_0x8e0a8d(0x24e)]((_0x5817be,_0x4ffbd1)=>{const _0x105c8e=_0x8e0a8d,_0x2c20a3=_0x5817be[_0x105c8e(0x35e)]||'',_0x1684d3=_0x4ffbd1[_0x105c8e(0x35e)]||'';return _0x1684d3['localeCompare'](_0x2c20a3);});if(_0x2dfd85[_0x8e0a8d(0x309)]||_0x2dfd85[_0x8e0a8d(0x2cb)])return await handleSDKOutput(_0x5297ea,_0x2dfd85),0x0;let _0x2cce3f;if(_0x347308){const _0x287432=_0x5297ea[0x0];if(!_0x287432[_0x8e0a8d(0x250)]?.['id'])return console[_0x8e0a8d(0x235)](_0x8e0a8d(0x288)),0x0;_0x2cce3f=_0x287432['lastAttempt']['id'],_0x2dfd85[_0x8e0a8d(0x399)]&&console[_0x8e0a8d(0x235)](_0x8e0a8d(0x2d3)+_0x287432[_0x8e0a8d(0x35e)]);}else{const _0x37b92a=_0x5297ea[_0x8e0a8d(0x263)](_0x2d6b25=>{const _0x58f7a6=_0x8e0a8d,_0x5d061e=getAttemptStatusDisplay(_0x2d6b25[_0x58f7a6(0x250)]);return{'title':_0x2d6b25[_0x58f7a6(0x298)]?.[_0x58f7a6(0x27b)]+'.'+_0x2d6b25[_0x58f7a6(0x2ab)]?.[_0x58f7a6(0x27b)]+'\x20-\x20'+_0x2d6b25[_0x58f7a6(0x35e)]+'\x20'+_0x5d061e[_0x58f7a6(0x373)],'value':_0x2d6b25[_0x58f7a6(0x250)]?.['id']||'','description':_0x5d061e[_0x58f7a6(0x351)]};}),_0x237fcf=await a54_0x4e32c8({'type':_0x8e0a8d(0x2f9),'name':_0x8e0a8d(0x2a5),'message':_0x8e0a8d(0x2a1),'choices':_0x37b92a['filter'](_0x4285a2=>_0x4285a2[_0x8e0a8d(0x24d)]!=='')});if(!_0x237fcf['attemptId'])return 0x0;_0x2cce3f=_0x237fcf[_0x8e0a8d(0x2a5)];}const _0x2ca336=_0x2dfd85['follow'];return _0x2ca336?await this[_0x8e0a8d(0x327)](_0x40993b,_0x2cce3f):await this['renderSingleTimeline'](_0x40993b,_0x2cce3f,_0x2dfd85),0x0;}async[a54_0x130479(0x362)](_0x162f92,_0x340c78,_0x9cce50){const _0x134178=a54_0x130479,{tdx:_0x473c7c}=_0x162f92;let _0x35d33c,_0x213677;try{[_0x35d33c,_0x213677]=await Promise['all']([_0x473c7c[_0x134178(0x2ab)][_0x134178(0x359)](_0x340c78),_0x473c7c['workflow']['tasks'](_0x340c78,![])]);}catch(_0x243adf){console[_0x134178(0x235)](a54_0x47fe92[_0x134178(0x225)](_0x134178(0x335)));_0x9cce50[_0x134178(0x399)]&&console[_0x134178(0x235)](_0x243adf);throw _0x243adf;}if(_0x9cce50[_0x134178(0x309)]||_0x9cce50['jsonl']){const _0x1cc77f=this[_0x134178(0x2c9)](_0x35d33c,_0x213677);await handleSDKOutput([_0x1cc77f],_0x9cce50);return;}const _0x291795=_0x473c7c[_0x134178(0x227)][_0x134178(0x25c)],_0x37b372=this[_0x134178(0x2c1)](_0x35d33c,_0x213677,_0x291795);console[_0x134178(0x303)](_0x37b372);}async[a54_0x130479(0x327)](_0x37fa53,_0x37dadf){const _0x15728b=a54_0x130479,{tdx:_0x134883}=_0x37fa53,_0x37c279=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x294f0b=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x2e9345=0x0;while(_0x2e9345<_0x294f0b){process[_0x15728b(0x328)]['isTTY']&&process[_0x15728b(0x328)]['write']('\x1bc');let _0x1ca620,_0x31a238;try{[_0x1ca620,_0x31a238]=await Promise[_0x15728b(0x294)]([_0x134883[_0x15728b(0x2ab)]['attempt'](_0x37dadf),_0x134883[_0x15728b(0x2ab)][_0x15728b(0x1ef)](_0x37dadf,![])]);}catch(_0x1872af){console[_0x15728b(0x235)](a54_0x47fe92['red'](_0x15728b(0x356)));_0x2e9345>0x0&&console[_0x15728b(0x235)](a54_0x47fe92['dim'](_0x15728b(0x349)+_0x2e9345));throw _0x1872af;}const _0x1625f1=_0x134883['context'][_0x15728b(0x25c)],_0x6b94b4=this[_0x15728b(0x2c1)](_0x1ca620,_0x31a238,_0x1625f1);console[_0x15728b(0x303)](_0x6b94b4);const _0x797e4b=_0x1ca620['done']&&_0x31a238['every'](_0xfb261c=>_0xfb261c['state']!==_0x15728b(0x1fe)&&_0xfb261c[_0x15728b(0x260)]!==_0x15728b(0x313));if(_0x797e4b){console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x2b5)](_0x15728b(0x22d)));break;}console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x2e9)](_0x15728b(0x3a3)+_0x2e9345*0x2+_0x15728b(0x301))),await new Promise(_0x3d7df0=>setTimeout(_0x3d7df0,_0x37c279)),_0x2e9345++;}_0x2e9345>=_0x294f0b&&console[_0x15728b(0x235)](a54_0x47fe92[_0x15728b(0x28d)](_0x15728b(0x2a6)));}[a54_0x130479(0x2c1)](_0x2d4405,_0x160351,_0x346c93){const _0x5e0293=a54_0x130479,_0x1d9346=[],_0x4c0fc6=TIMELINE_CONFIG[_0x5e0293(0x325)],_0x4e0ac1=0x5,_0x525797=process[_0x5e0293(0x328)][_0x5e0293(0x1f3)]||0x78,_0x168d0c=_0x525797-_0x4c0fc6-_0x4e0ac1,_0x1ec6df=Math[_0x5e0293(0x2b3)](TIMELINE_CONFIG[_0x5e0293(0x25f)],Math[_0x5e0293(0x316)](_0x168d0c,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x1f19bd=new Date(_0x2d4405['createdAt'])['getTime'](),_0x391a99=_0x2d4405[_0x5e0293(0x224)]?new Date(_0x2d4405[_0x5e0293(0x224)])[_0x5e0293(0x28f)]():Date[_0x5e0293(0x1fb)](),_0x148c12={'start':_0x1f19bd,'end':_0x391a99,'duration':_0x391a99-_0x1f19bd},_0x2abded=new Map(),_0x4d6cbd=[];for(const _0x437b63 of _0x160351){if(_0x437b63[_0x5e0293(0x2e0)]){const _0x264871=new Date(_0x437b63[_0x5e0293(0x2e0)])[_0x5e0293(0x28f)](),_0x378eb8=_0x437b63[_0x5e0293(0x317)]?new Date(_0x437b63['updatedAt'])[_0x5e0293(0x28f)]():Date[_0x5e0293(0x1fb)](),_0x4d93bc={'start':_0x264871,'end':_0x378eb8,'duration':_0x378eb8-_0x264871};_0x2abded[_0x5e0293(0x377)](_0x437b63['id'],_0x4d93bc),_0x4d6cbd[_0x5e0293(0x1ea)]({'name':_0x437b63['fullName'],'state':_0x437b63[_0x5e0293(0x260)]||_0x5e0293(0x38c),'window':_0x4d93bc});}else _0x4d6cbd[_0x5e0293(0x1ea)]({'name':_0x437b63[_0x5e0293(0x2f5)],'state':_0x437b63[_0x5e0293(0x260)]||'planned','window':undefined});}_0x4d6cbd['sort']((_0x33dedf,_0x2572ea)=>{const _0x217571=_0x5e0293;if(!_0x33dedf[_0x217571(0x367)])return 0x1;if(!_0x2572ea[_0x217571(0x367)])return-0x1;return _0x33dedf[_0x217571(0x367)]['start']-_0x2572ea[_0x217571(0x367)][_0x217571(0x2aa)];});const _0x159b71=_0x4d6cbd['length'],_0xa088d8=_0x159b71>TIMELINE_CONFIG[_0x5e0293(0x36c)];_0xa088d8&&_0x4d6cbd[_0x5e0293(0x33b)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x1f3198=calculateTimeScale(_0x148c12,_0x1ec6df),_0x3109c0=_0x2d4405[_0x5e0293(0x38b)]?_0x2d4405[_0x5e0293(0x337)]?a54_0x47fe92[_0x5e0293(0x2b5)](_0x5e0293(0x337)):a54_0x47fe92[_0x5e0293(0x225)](_0x5e0293(0x235)):a54_0x47fe92['blue'](_0x5e0293(0x1fe)),_0x4f6742=_0x2d4405[_0x5e0293(0x298)]?.['id'],_0x46c07d=_0x2d4405[_0x5e0293(0x2ea)];let _0xd2c96a;if(_0x4f6742&&_0x46c07d){const _0x292535=getWorkflowAttemptUrl(_0x346c93,_0x4f6742,_0x46c07d,_0x2d4405['id']);_0xd2c96a=hyperlink(a54_0x47fe92[_0x5e0293(0x2e9)](_0x2d4405['id']),_0x292535);}else _0xd2c96a=a54_0x47fe92[_0x5e0293(0x2e9)](_0x2d4405['id']);_0x1d9346[_0x5e0293(0x1ea)](_0x5e0293(0x209)+_0xd2c96a+'\x20-\x20'+_0x3109c0+_0x5e0293(0x374)+formatElapsed(_0x148c12[_0x5e0293(0x2ad)]));if(_0x4d6cbd[_0x5e0293(0x273)]>0x0){const _0x5e39a1=renderTimeAxis(_0x1f3198,_0x1ec6df),_0x4c8705=new Date(_0x148c12[_0x5e0293(0x2aa)]),_0x41686e=formatDate(_0x4c8705),_0x3e263b=TIMELINE_CONFIG[_0x5e0293(0x205)]+TIMELINE_CONFIG[_0x5e0293(0x27d)]+_0x4c0fc6,_0x4495b4=_0x41686e['padStart'](_0x3e263b),_0x1a2a4c=a54_0x47fe92[_0x5e0293(0x2e9)](_0x4495b4);_0x1d9346[_0x5e0293(0x1ea)](_0x1a2a4c+'\x20'+_0x5e39a1);for(const _0x4d9d85 of _0x4d6cbd){_0x1d9346[_0x5e0293(0x1ea)](renderTaskRow(_0x4d9d85,_0x1f3198,_0x1ec6df,_0x4c0fc6));}const _0x4e0cf6=calculateStats(_0x4d6cbd);_0x1d9346[_0x5e0293(0x1ea)](formatStats(_0x4e0cf6)),_0xa088d8&&_0x1d9346['push'](a54_0x47fe92[_0x5e0293(0x28d)](_0x5e0293(0x366)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+_0x5e0293(0x21a)+_0x159b71+_0x5e0293(0x318))),_0x1d9346[_0x5e0293(0x1ea)](''),_0x1d9346[_0x5e0293(0x1ea)](a54_0x47fe92[_0x5e0293(0x2e9)]('💡\x20Tip:\x20Use\x20')+('tdx\x20wf\x20attempt\x20'+_0x2d4405['id']+_0x5e0293(0x357))+a54_0x47fe92[_0x5e0293(0x2e9)]('\x20to\x20see\x20detailed\x20logs'));}else _0x1d9346[_0x5e0293(0x1ea)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x1d9346[_0x5e0293(0x211)]('\x0a');}['buildTimelineData'](_0x201bcc,_0x28bcb3){const _0x17c546=a54_0x130479,_0x1ee891=new Date(_0x201bcc[_0x17c546(0x364)])['getTime'](),_0x13bc41=_0x201bcc[_0x17c546(0x224)]?new Date(_0x201bcc[_0x17c546(0x224)])[_0x17c546(0x28f)]():Date['now'](),_0x1e51fc=_0x13bc41-_0x1ee891,_0x4ef1db=[];for(const _0x4db135 of _0x28bcb3){if(_0x4db135[_0x17c546(0x2e0)]){const _0x3565f7=new Date(_0x4db135[_0x17c546(0x2e0)])[_0x17c546(0x28f)](),_0x1c514a=_0x4db135['updatedAt']?new Date(_0x4db135[_0x17c546(0x317)])['getTime']():Date[_0x17c546(0x1fb)]();_0x4ef1db[_0x17c546(0x1ea)]({'name':_0x4db135['fullName'],'state':_0x4db135['state']||_0x17c546(0x38c),'window':{'start':_0x3565f7,'end':_0x1c514a,'duration':_0x1c514a-_0x3565f7}});}else _0x4ef1db[_0x17c546(0x1ea)]({'name':_0x4db135['fullName'],'state':_0x4db135[_0x17c546(0x260)]||_0x17c546(0x313),'window':undefined});}const _0x82c3bb=calculateStats(_0x4ef1db);return{'attempt':{'id':_0x201bcc['id'],'status':_0x201bcc['done']?_0x201bcc[_0x17c546(0x337)]?_0x17c546(0x337):_0x17c546(0x235):'running','createdAt':_0x201bcc[_0x17c546(0x364)],'finishedAt':_0x201bcc[_0x17c546(0x224)],'duration_ms':_0x1e51fc},'tasks':_0x4ef1db[_0x17c546(0x263)](_0x7bbc0d=>({'name':_0x7bbc0d['name'],'state':_0x7bbc0d[_0x17c546(0x260)],'startedAt':_0x7bbc0d['window']?new Date(_0x7bbc0d[_0x17c546(0x367)][_0x17c546(0x2aa)])[_0x17c546(0x200)]():null,'updatedAt':_0x7bbc0d[_0x17c546(0x367)]?new Date(_0x7bbc0d[_0x17c546(0x367)]['end'])[_0x17c546(0x200)]():null,'duration_ms':_0x7bbc0d['window']?.[_0x17c546(0x2ad)]||null})),'stats':_0x82c3bb};}}export class WorkflowSchedulesCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:schedules';['description']='List\x20workflow\x20schedules';async[a54_0x130479(0x22a)](_0x3b9187){const _0x398db4=a54_0x130479,{options:_0x763d55,tdx:_0x18b2a3}=_0x3b9187,_0x12dd26=await withSpinner(_0x398db4(0x33c),()=>_0x18b2a3[_0x398db4(0x2ab)][_0x398db4(0x39b)](),{'verbose':_0x763d55[_0x398db4(0x399)]}),_0x4ec8e7=_0x12dd26[_0x398db4(0x36f)];console[_0x398db4(0x235)](_0x398db4(0x393)+_0x4ec8e7['length']+_0x398db4(0x389)+(_0x4ec8e7[_0x398db4(0x273)]!==0x1?'s':''));if(isStructuredFormat(_0x763d55))await handleSDKOutput(_0x4ec8e7,_0x763d55);else{if(_0x4ec8e7['length']===0x0)console[_0x398db4(0x303)]('No\x20schedules\x20found');else for(const _0x73a11b of _0x4ec8e7){const _0x5bb44d=_0x73a11b[_0x398db4(0x2e7)]?a54_0x47fe92['yellow'](_0x398db4(0x2a0)):'',_0x448302=_0x73a11b[_0x398db4(0x298)]?.[_0x398db4(0x27b)]?a54_0x47fe92['dim']('\x20['+_0x73a11b[_0x398db4(0x298)][_0x398db4(0x27b)]+']'):'',_0x407e00=_0x73a11b['nextRunTime']?a54_0x47fe92[_0x398db4(0x2e9)](_0x398db4(0x245)+new Date(_0x73a11b['nextRunTime'])[_0x398db4(0x358)]()):'';console[_0x398db4(0x303)](_0x398db4(0x311)+_0x73a11b['id']+'\x20'+(_0x73a11b[_0x398db4(0x2ab)]?.['name']||'(unknown)')+_0x448302+_0x5bb44d+_0x407e00);}}return 0x0;}}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x130479(0x27b)]='workflow:schedule:enable';[a54_0x130479(0x376)]=a54_0x130479(0x1f2);async[a54_0x130479(0x22a)](_0xf6ae26){const _0x5e19c7=a54_0x130479,{options:_0x10c6b1,args:_0x4ac71d,tdx:_0x33e0f0}=_0xf6ae26,_0x3ec1fb=_0x4ac71d[0x0];if(!_0x3ec1fb)return console['error'](a54_0x47fe92[_0x5e19c7(0x225)](_0x5e19c7(0x25d)),_0x5e19c7(0x21d)),console[_0x5e19c7(0x235)](a54_0x47fe92['dim'](_0x5e19c7(0x34a))),console[_0x5e19c7(0x235)](a54_0x47fe92[_0x5e19c7(0x2e9)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x42e484=await withSpinner(_0x5e19c7(0x312)+_0x3ec1fb+_0x5e19c7(0x2d6),()=>_0x33e0f0[_0x5e19c7(0x2ab)][_0x5e19c7(0x228)](_0x3ec1fb),{'verbose':_0x10c6b1[_0x5e19c7(0x399)]}),_0x36f88c=_0x42e484[_0x5e19c7(0x36f)];return isStructuredFormat(_0x10c6b1)?await handleSingleObjectOutput(_0x36f88c,_0x10c6b1):(console[_0x5e19c7(0x303)](_0x5e19c7(0x307)+_0x3ec1fb+_0x5e19c7(0x20d)+(_0x36f88c[_0x5e19c7(0x2ab)]?.[_0x5e19c7(0x27b)]||_0x5e19c7(0x38c))+')'),_0x36f88c['nextRunTime']&&console[_0x5e19c7(0x303)](a54_0x47fe92[_0x5e19c7(0x2e9)](_0x5e19c7(0x2a4)+new Date(_0x36f88c[_0x5e19c7(0x387)])[_0x5e19c7(0x358)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{['name']='workflow:schedule:disable';['description']=a54_0x130479(0x2ed);async[a54_0x130479(0x22a)](_0x4ffa9e){const _0x44a923=a54_0x130479,{options:_0x2fc527,args:_0x35b8e1,tdx:_0x5c4588}=_0x4ffa9e,_0x1a316d=_0x35b8e1[0x0];if(!_0x1a316d)return console['error'](a54_0x47fe92[_0x44a923(0x225)](_0x44a923(0x25d)),_0x44a923(0x21d)),console[_0x44a923(0x235)](a54_0x47fe92['dim'](_0x44a923(0x2f8))),console[_0x44a923(0x235)](a54_0x47fe92[_0x44a923(0x2e9)](_0x44a923(0x278))),0x1;const _0x2e7eb3=await withSpinner(_0x44a923(0x39e)+_0x1a316d+'...',()=>_0x5c4588['workflow'][_0x44a923(0x39a)](_0x1a316d),{'verbose':_0x2fc527[_0x44a923(0x399)]}),_0x1ab0e9=_0x2e7eb3['data'];return isStructuredFormat(_0x2fc527)?await handleSingleObjectOutput(_0x1ab0e9,_0x2fc527):console[_0x44a923(0x303)](_0x44a923(0x307)+_0x1a316d+_0x44a923(0x22f)+(_0x1ab0e9['workflow']?.[_0x44a923(0x27b)]||'unknown')+')'),0x0;}}
1
+ const a54_0x132d15=a54_0x593d;(function(_0x5952d6,_0x4c5b5b){const _0x19e110=a54_0x593d,_0x2573df=_0x5952d6();while(!![]){try{const _0x277f52=parseInt(_0x19e110(0x1d5))/0x1*(-parseInt(_0x19e110(0x1ef))/0x2)+parseInt(_0x19e110(0x1ce))/0x3*(parseInt(_0x19e110(0x1b7))/0x4)+-parseInt(_0x19e110(0x30b))/0x5+parseInt(_0x19e110(0x254))/0x6*(-parseInt(_0x19e110(0x1c2))/0x7)+-parseInt(_0x19e110(0x335))/0x8*(parseInt(_0x19e110(0x1f4))/0x9)+-parseInt(_0x19e110(0x23f))/0xa+-parseInt(_0x19e110(0x2be))/0xb*(-parseInt(_0x19e110(0x2c3))/0xc);if(_0x277f52===_0x4c5b5b)break;else _0x2573df['push'](_0x2573df['shift']());}catch(_0xf4ac73){_0x2573df['push'](_0x2573df['shift']());}}}(a54_0x10ad,0x9d8c2));import a54_0x4527ac from'chalk';import{existsSync}from'fs';import a54_0x1c0d96 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_0x3fb545 from'prompts';function getAttemptStatusDisplay(_0x19acfa){const _0x359791=a54_0x593d;if(!_0x19acfa)return{'icon':'⏳','text':''};const {done:_0x550e53,success:_0x35d349,cancelRequested:_0x3c12ca}=_0x19acfa;if(!_0x550e53)return _0x3c12ca?{'icon':'🛑','text':a54_0x4527ac['yellow'](_0x359791(0x315))}:{'icon':'🔄','text':a54_0x4527ac[_0x359791(0x30f)](_0x359791(0x297))};if(_0x35d349)return{'icon':'✅','text':a54_0x4527ac['green'](_0x359791(0x236))};return{'icon':'❌','text':a54_0x4527ac[_0x359791(0x232)](_0x359791(0x25a))};}export class WorkflowBaseCommand extends BaseCommand{[a54_0x132d15(0x185)](_0x444bb5,_0x2d8b68,_0x18b704=0x0){const _0x2d76af=a54_0x132d15;return _0x444bb5[_0x18b704]||_0x2d8b68[_0x2d76af(0x28c)];}[a54_0x132d15(0x2d9)](_0x2ee4df,_0x2c890d,_0x4a96b5=0x0){const _0x128f5f=a54_0x132d15,_0x49371f=this['resolveProject'](_0x2ee4df,_0x2c890d,_0x4a96b5);if(!_0x49371f)return console[_0x128f5f(0x25a)](a54_0x4527ac['red'](_0x128f5f(0x1de)),_0x128f5f(0x2f7)),console[_0x128f5f(0x25a)](a54_0x4527ac['dim'](_0x128f5f(0x2e4))),null;return _0x49371f;}[a54_0x132d15(0x1a8)](_0x4ea07e,_0xc2d5c1){const _0x536c30=a54_0x132d15;if(_0x4ea07e[0x0]){const _0x5dbcde=_0x4ea07e[0x0][_0x536c30(0x2ff)]('.');if(_0x5dbcde[_0x536c30(0x303)]===0x1)return{'projectName':_0x5dbcde[0x0],'workflowName':undefined};else return _0x5dbcde[_0x536c30(0x303)]===0x2?{'projectName':_0x5dbcde[0x0],'workflowName':_0x5dbcde[0x1]}:(console[_0x536c30(0x25a)](a54_0x4527ac[_0x536c30(0x232)]('Error:'),_0x536c30(0x24d)),null);}return{'projectName':_0xc2d5c1[_0x536c30(0x28c)],'workflowName':undefined};}['resolveProjectDir'](_0x28a050,_0x4d79c7,_0x3f5c66=0x0){const _0x376140=a54_0x132d15;if(_0x28a050[_0x3f5c66])return _0x28a050[_0x3f5c66];if(_0x4d79c7[_0x376140(0x28c)]){const _0x324606=a54_0x1c0d96[_0x376140(0x1a7)](process[_0x376140(0x231)](),_0x376140(0x1c7),_0x4d79c7[_0x376140(0x28c)]);if(existsSync(a54_0x1c0d96[_0x376140(0x1a7)](_0x324606,'tdx.json')))return _0x324606;}return undefined;}async[a54_0x132d15(0x198)](_0x1cbe68,_0x16929d,_0x3f4eeb){const _0x2e98a0=a54_0x132d15;try{const _0x4b0c1a=await _0x1cbe68[_0x2e98a0(0x199)][_0x2e98a0(0x1c7)](_0x16929d,{'limit':0x1});if(_0x4b0c1a[_0x2e98a0(0x303)]>0x0){const _0x4ba01c=_0x4b0c1a[0x0]['id'],_0x2e33ca=getWorkflowUrl(_0x3f4eeb,_0x4ba01c);console[_0x2e98a0(0x25a)](_0x2e98a0(0x1ad)+a54_0x4527ac[_0x2e98a0(0x2ae)](_0x2e33ca));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x240);[a54_0x132d15(0x31f)]=a54_0x132d15(0x336);async[a54_0x132d15(0x1be)](_0x3696b9){const _0x4debdb=a54_0x132d15,{options:_0x41c6f0,args:_0x32693b,tdx:_0xb9d1db}=_0x3696b9,_0x472c3d=_0x32693b[0x0],_0x29c45d=_0x41c6f0[_0x4debdb(0x308)];if(_0x29c45d)return saveSessionContext({'workflow_project':undefined},_0x41c6f0[_0x4debdb(0x2b5)]),console[_0x4debdb(0x17b)](a54_0x4527ac[_0x4debdb(0x267)](_0x4debdb(0x1e6))),0x0;if(!_0x472c3d)return console[_0x4debdb(0x25a)](a54_0x4527ac[_0x4debdb(0x232)](_0x4debdb(0x1de)),_0x4debdb(0x2f7)),console[_0x4debdb(0x25a)](a54_0x4527ac[_0x4debdb(0x29e)](_0x4debdb(0x1dc))),console[_0x4debdb(0x25a)](a54_0x4527ac['dim'](_0x4debdb(0x18f))),0x1;const _0x4ae5b2=await withSpinner(_0x4debdb(0x1d9)+_0x472c3d+'\x27...',()=>_0xb9d1db[_0x4debdb(0x199)]['resolveProjectId'](_0x472c3d),{'verbose':_0x41c6f0[_0x4debdb(0x329)]}),{name:_0x59982b}=_0x4ae5b2[_0x4debdb(0x18d)];return saveSessionContext({'workflow_project':_0x59982b},_0x41c6f0[_0x4debdb(0x2b5)]),console['log'](a54_0x4527ac[_0x4debdb(0x267)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a54_0x4527ac['cyan'](_0x59982b))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x214);[a54_0x132d15(0x31f)]='List\x20all\x20workflow\x20projects';async['execute'](_0x33d41a){const _0x2a81da=a54_0x132d15,{options:_0x79478d,args:_0x666257,tdx:_0x97e7c5}=_0x33d41a,_0x58100f=_0x666257[0x0];_0x79478d[_0x2a81da(0x329)]&&_0x58100f&&console['error'](_0x2a81da(0x271)+_0x58100f);const _0x2e5e7f=await withSpinner(_0x2a81da(0x184),()=>_0x97e7c5[_0x2a81da(0x199)][_0x2a81da(0x32a)](_0x58100f,{'limit':_0x79478d[_0x2a81da(0x1d4)]}),{'verbose':_0x79478d[_0x2a81da(0x329)]});let _0x4b5927=_0x2e5e7f[_0x2a81da(0x18d)];_0x4b5927['sort']((_0x1a1ad2,_0x4daa96)=>_0x1a1ad2[_0x2a81da(0x2b2)][_0x2a81da(0x24a)](_0x4daa96['name']));const _0x2b3c06=_0x79478d['limit']||0x64,_0x399dfd=_0x4b5927[_0x2a81da(0x303)]>=_0x2b3c06?a54_0x4527ac[_0x2a81da(0x29e)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console['error'](_0x2a81da(0x25f)+_0x4b5927[_0x2a81da(0x303)]+'\x20project'+(_0x4b5927[_0x2a81da(0x303)]!==0x1?'s':'')+_0x399dfd);if(_0x79478d['format']==='json'||_0x79478d['format']===_0x2a81da(0x2f5)||_0x79478d['format']===_0x2a81da(0x248))await handleSDKOutput(_0x4b5927,_0x79478d);else{if(_0x4b5927[_0x2a81da(0x303)]===0x0)_0x58100f?console[_0x2a81da(0x17b)](_0x2a81da(0x20d)+_0x58100f):console['log'](_0x2a81da(0x21e));else{const _0x4f613b=_0x4b5927['map'](_0x46f548=>{const _0x1fbe32=_0x2a81da,_0x189c48=_0x46f548[_0x1fbe32(0x1e9)]?.['some'](_0x2b0c32=>_0x2b0c32['key']==='sys'),_0x3013c0=_0x189c48?a54_0x4527ac['dim']('\x20(system)'):'';return _0x1fbe32(0x238)+_0x46f548[_0x1fbe32(0x2b2)]+_0x3013c0;});await writeOutput(_0x4f613b['join']('\x0a'),_0x79478d['output'],_0x2a81da(0x257));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x234);['description']=a54_0x132d15(0x23c);async[a54_0x132d15(0x1be)](_0x5dacfe){const _0x25042f=a54_0x132d15,{options:_0x30af02,args:_0x5269e8,tdx:_0x45890c}=_0x5dacfe,_0x2f1932=this[_0x25042f(0x185)](_0x5269e8,_0x30af02);_0x30af02['verbose']&&_0x2f1932&&console[_0x25042f(0x25a)](_0x25042f(0x1c9)+_0x2f1932);const _0x2229f6=await withSpinner(_0x25042f(0x2ed),()=>_0x45890c['workflow'][_0x25042f(0x1c7)](_0x2f1932,{'limit':_0x30af02[_0x25042f(0x1d4)]}),{'verbose':_0x30af02['verbose']});let _0x5b75cd=_0x2229f6[_0x25042f(0x18d)];_0x5b75cd[_0x25042f(0x26b)]((_0x142d16,_0x109f08)=>{const _0x45a568=_0x25042f,_0xc002bb=_0x142d16[_0x45a568(0x2b2)][_0x45a568(0x24a)](_0x109f08['name']);if(_0xc002bb!==0x0)return _0xc002bb;return(_0x142d16[_0x45a568(0x296)]?.[_0x45a568(0x2b2)]||'')['localeCompare'](_0x109f08[_0x45a568(0x296)]?.[_0x45a568(0x2b2)]||'');});const _0x551acc=_0x30af02[_0x25042f(0x1d4)]||0x64,_0x165d42=_0x5b75cd[_0x25042f(0x303)]>=_0x551acc?a54_0x4527ac[_0x25042f(0x29e)](_0x25042f(0x1f6)):'';console[_0x25042f(0x25a)](_0x25042f(0x25f)+_0x5b75cd[_0x25042f(0x303)]+_0x25042f(0x191)+(_0x5b75cd[_0x25042f(0x303)]!==0x1?'s':'')+_0x165d42);if(_0x30af02[_0x25042f(0x220)]===_0x25042f(0x1f7)||_0x30af02[_0x25042f(0x220)]===_0x25042f(0x2f5)||_0x30af02['format']===_0x25042f(0x248))await handleSDKOutput(_0x5b75cd,_0x30af02);else{if(_0x5b75cd[_0x25042f(0x303)]===0x0)_0x2f1932?console['log'](_0x25042f(0x326)+_0x2f1932):console[_0x25042f(0x17b)](_0x25042f(0x302));else{const _0x55907a=_0x30af02[_0x25042f(0x227)],_0x18abc5=_0x5b75cd[_0x25042f(0x25d)](_0x34b832=>{const _0x9b6f2d=_0x25042f,_0x3d1f6e=a54_0x4527ac[_0x9b6f2d(0x29e)]('#'+_0x34b832['id']),_0x1b489c=hyperlink(_0x3d1f6e,getWorkflowUrl(_0x55907a,_0x34b832['id'])),_0x4817cf=_0x34b832[_0x9b6f2d(0x296)]?.[_0x9b6f2d(0x2b2)]?a54_0x4527ac[_0x9b6f2d(0x29e)]('\x20('+_0x34b832[_0x9b6f2d(0x296)]['name']+')'):'';return _0x9b6f2d(0x2e7)+_0x1b489c+'\x20'+_0x34b832[_0x9b6f2d(0x2b2)]+_0x4817cf;});await writeOutput(_0x18abc5[_0x25042f(0x1a7)]('\x0a'),_0x30af02['output'],_0x25042f(0x257));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a54_0x132d15(0x2b2)]='workflow:sessions';[a54_0x132d15(0x31f)]=a54_0x132d15(0x211);async['execute'](_0x1180ec){const _0x292b99=a54_0x132d15,{options:_0x4bad15,args:_0x105f0a,tdx:_0x404b43}=_0x1180ec,_0x3ec8ea=this[_0x292b99(0x1a8)](_0x105f0a,_0x4bad15);if(!_0x3ec8ea)return 0x1;const {projectName:_0x222e8e,workflowName:_0x58b455}=_0x3ec8ea;if(_0x4bad15['verbose']){if(_0x222e8e&&_0x58b455)console[_0x292b99(0x25a)](_0x292b99(0x1c3)+_0x222e8e+'.'+_0x58b455);else _0x222e8e&&console[_0x292b99(0x25a)](_0x292b99(0x270)+_0x222e8e);const _0x3245bb=_0x4bad15['status'];_0x3245bb&&console[_0x292b99(0x25a)](_0x292b99(0x2a3)+_0x3245bb);}let _0x8268a2=0x28;if(process[_0x292b99(0x2f4)][_0x292b99(0x1a0)]&&!_0x4bad15['output']&&!_0x4bad15[_0x292b99(0x220)]){const _0x153941=process[_0x292b99(0x2f4)]['rows']||0x28;_0x8268a2=Math[_0x292b99(0x23b)](0x14,Math['floor'](_0x153941*0x2/0x3));}const _0x2468df=_0x4bad15[_0x292b99(0x1d4)]||_0x8268a2,_0xbfd7f1=await withSpinner(_0x292b99(0x32f),()=>_0x404b43[_0x292b99(0x199)]['sessions']({'projectName':_0x222e8e,'workflowName':_0x58b455,'status':_0x4bad15[_0x292b99(0x32d)],'fromTime':_0x4bad15[_0x292b99(0x1bb)],'toTime':_0x4bad15['to'],'limit':_0x2468df}),{'verbose':_0x4bad15[_0x292b99(0x329)]}),_0xd45b7=_0xbfd7f1[_0x292b99(0x18d)];_0xd45b7[_0x292b99(0x26b)]((_0x57d7c6,_0x5b724f)=>{const _0x3a0e45=_0x292b99,_0x6b34ea=_0x57d7c6[_0x3a0e45(0x193)]||'',_0x51802c=_0x5b724f[_0x3a0e45(0x193)]||'';return _0x51802c[_0x3a0e45(0x24a)](_0x6b34ea);});_0xd45b7[_0x292b99(0x303)]>=_0x2468df?console[_0x292b99(0x25a)](_0x292b99(0x2e1)+_0xd45b7[_0x292b99(0x303)]+_0x292b99(0x273)+a54_0x4527ac[_0x292b99(0x29e)](_0x292b99(0x283))):console['error']('✔\x20Found\x20'+_0xd45b7['length']+_0x292b99(0x2ab)+(_0xd45b7['length']!==0x1?'s':''));if(_0x4bad15[_0x292b99(0x220)]===_0x292b99(0x1f7)||_0x4bad15[_0x292b99(0x220)]===_0x292b99(0x2f5)||_0x4bad15[_0x292b99(0x220)]===_0x292b99(0x248))await handleSDKOutput(_0xd45b7,_0x4bad15);else{if(!process[_0x292b99(0x2f4)][_0x292b99(0x1a0)]||_0x4bad15['output']){if(_0xd45b7[_0x292b99(0x303)]===0x0){if(_0x222e8e&&_0x58b455)console[_0x292b99(0x17b)](_0x292b99(0x2a9)+_0x222e8e+'.'+_0x58b455);else _0x222e8e?console[_0x292b99(0x17b)](_0x292b99(0x2e0)+_0x222e8e):console[_0x292b99(0x17b)](_0x292b99(0x2e2));}else{const _0x32fcff=_0x4bad15[_0x292b99(0x227)],_0x132829=this[_0x292b99(0x1d8)](_0xd45b7,_0x32fcff);_0x4bad15[_0x292b99(0x274)]?await writeOutput(_0x132829,_0x4bad15[_0x292b99(0x274)],_0x292b99(0x257)):console[_0x292b99(0x17b)](_0x132829);}!_0x222e8e&&(console[_0x292b99(0x25a)](''),console[_0x292b99(0x25a)](a54_0x4527ac[_0x292b99(0x29e)](_0x292b99(0x183))),console[_0x292b99(0x25a)](a54_0x4527ac[_0x292b99(0x29e)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a54_0x4527ac[_0x292b99(0x29e)](_0x292b99(0x32e))));}else{if(_0xd45b7[_0x292b99(0x303)]===0x0){if(_0x222e8e&&_0x58b455)console[_0x292b99(0x17b)](_0x292b99(0x2a9)+_0x222e8e+'.'+_0x58b455);else _0x222e8e?console[_0x292b99(0x17b)](_0x292b99(0x2e0)+_0x222e8e):console['log'](_0x292b99(0x2e2));}else await this[_0x292b99(0x31b)](_0xd45b7,_0x1180ec,_0x222e8e);}}return 0x0;}['renderSessionsTimeline'](_0x22cca9,_0x2e3e1f){const _0x265685=a54_0x132d15,_0x574f3c=[],_0x53d3e6=new Map();let _0x46c8f9=Infinity,_0x5645d5=-Infinity;for(const _0x495c3f of _0x22cca9){if(_0x495c3f[_0x265685(0x2fc)]?.['createdAt']){const _0xc496ac=new Date(_0x495c3f[_0x265685(0x2fc)][_0x265685(0x2a1)])[_0x265685(0x192)](),_0x23b21=_0x495c3f[_0x265685(0x2fc)][_0x265685(0x295)]?new Date(_0x495c3f[_0x265685(0x2fc)][_0x265685(0x295)])[_0x265685(0x192)]():Date[_0x265685(0x256)](),_0x37d92c=_0x495c3f['project']?.[_0x265685(0x2b2)]||'(unknown)';!_0x53d3e6[_0x265685(0x2fb)](_0x37d92c)&&_0x53d3e6[_0x265685(0x228)](_0x37d92c,[]),_0x53d3e6['get'](_0x37d92c)[_0x265685(0x218)]({'session':_0x495c3f,'startTime':_0xc496ac,'endTime':_0x23b21,'duration':_0x23b21-_0xc496ac}),_0x46c8f9=Math[_0x265685(0x19b)](_0x46c8f9,_0xc496ac),_0x5645d5=Math['max'](_0x5645d5,_0x23b21);}}if(_0x53d3e6[_0x265685(0x2a5)]===0x0)return _0x265685(0x19a);const _0x54d908=process['stdout']['columns']||0x78,_0x37fb28=0x1e,_0x18d0b7=0x32,_0x4ff8cd=0x4,_0x5bbd86=Math['min'](_0x18d0b7,Math[_0x265685(0x23b)](_0x37fb28,Math['floor'](_0x54d908*0.3))),_0x51925c=_0x54d908-_0x5bbd86-TIMELINE_CONFIG[_0x265685(0x323)]-0x3-_0x4ff8cd,_0x2dc1d8=_0x5645d5-_0x46c8f9,_0x2895fe=_0x2dc1d8/_0x5bbd86,_0x621f62=renderTimeAxis({'startTime':_0x46c8f9,'endTime':_0x5645d5,'durationMs':_0x2dc1d8,'msPerChar':_0x2895fe},_0x5bbd86),_0x2945cc=[];for(const _0x1ba92c of _0x53d3e6[_0x265685(0x1d1)]()){_0x2945cc[_0x265685(0x218)](..._0x1ba92c);}_0x2945cc[_0x265685(0x26b)]((_0x36a38a,_0x3b565c)=>_0x3b565c['startTime']-_0x36a38a[_0x265685(0x2af)]);const _0x3a4c6f=new Date(_0x46c8f9),_0x2031e5=formatDate(_0x3a4c6f),_0xf75ea5=_0x4ff8cd+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x265685(0x1f1)]+_0x51925c,_0x122680='\x20'['repeat'](_0xf75ea5-_0x2031e5[_0x265685(0x303)]),_0x4692e5=_0x122680+a54_0x4527ac[_0x265685(0x29e)](_0x2031e5)+'\x20'+_0x621f62;_0x574f3c[_0x265685(0x218)](_0x4692e5);const _0x3ecf65=0x16;let _0x415cb2=0x0;for(const _0xf3fdca of _0x2945cc){const _0x18c32c=_0xf3fdca['session'][_0x265685(0x296)]?.[_0x265685(0x2b2)]||'?',_0x148a81=Math['min'](stringWidth(_0x18c32c),_0x3ecf65);_0x415cb2=Math['max'](_0x415cb2,_0x148a81);}for(const _0x4e9332 of _0x2945cc){const {session:_0x4d972c,startTime:_0x2ffde4,endTime:_0x144359,duration:_0x2a0d3b}=_0x4e9332,_0xc4c0b1=_0x4d972c[_0x265685(0x296)]?.['id'],_0x47824b=_0x4d972c['id'],_0x2d110c=_0x4d972c[_0x265685(0x296)]?.[_0x265685(0x2b2)]||'?',_0x2d10f1=_0x4d972c[_0x265685(0x199)]?.[_0x265685(0x2b2)]||'?';let _0x1cf08c,_0x30a6ae;if(_0x4d972c[_0x265685(0x2fc)]){const _0x4b74a1=_0x4d972c[_0x265685(0x2fc)];!_0x4b74a1[_0x265685(0x290)]?(_0x1cf08c=_0x4b74a1[_0x265685(0x28e)]?'🛑':'🔄',_0x30a6ae=_0x4b74a1['cancelRequested']?a54_0x4527ac[_0x265685(0x219)]:a54_0x4527ac[_0x265685(0x30f)]):(_0x1cf08c=_0x4b74a1[_0x265685(0x236)]?'✅':'❌',_0x30a6ae=_0x4b74a1[_0x265685(0x236)]?a54_0x4527ac[_0x265685(0x267)]:a54_0x4527ac[_0x265685(0x232)]);}else _0x1cf08c='⏳',_0x30a6ae=a54_0x4527ac['dim'];const _0x1680f7='#'+_0x47824b,_0x1272be=_0xc4c0b1?hyperlink(_0x1680f7,getWorkflowSessionUrl(_0x2e3e1f,_0xc4c0b1,_0x47824b)):_0x1680f7;let _0x50f7f7=_0x2d110c;stringWidth(_0x2d110c)>_0x3ecf65&&(_0x50f7f7=_0x2d110c[_0x265685(0x1e3)](0x0,_0x3ecf65-0x1)+'…');const _0x2a26e4=a54_0x4527ac[_0x265685(0x29e)](_0x50f7f7),_0x4bc74c=stringWidth(_0x50f7f7),_0x10907e='\x20'['repeat'](_0x415cb2-stringWidth(_0x50f7f7)+0x2),_0x1ba298='('+formatElapsed(_0x2a0d3b)+')',_0x41255f=stringWidth(_0x1ba298),_0x1657ae=stringWidth(_0x1680f7),_0x42d412=_0x1657ae+0x1+_0x4bc74c+_0x10907e[_0x265685(0x303)],_0x12f4fc=_0x51925c-_0x42d412-_0x41255f-0x1-0x8;let _0x3cf984=_0x2d10f1;stringWidth(_0x3cf984)>_0x12f4fc&&(_0x3cf984=_0x3cf984[_0x265685(0x1e3)](0x0,_0x12f4fc-0x1)+'…');const _0x39563d=_0x1272be+'\x20'+_0x2a26e4+_0x10907e+_0x3cf984,_0x1de8a0=stringWidth(_0x39563d),_0x11d5d4=_0x51925c-_0x1de8a0-_0x41255f,_0x31bf09=_0x39563d+'\x20'[_0x265685(0x328)](Math[_0x265685(0x23b)](0x1,_0x11d5d4))+a54_0x4527ac[_0x265685(0x29e)](_0x1ba298),_0x56bf3f=Math[_0x265685(0x223)]((_0x2ffde4-_0x46c8f9)/_0x2895fe),_0xdc329c=Math[_0x265685(0x223)]((_0x144359-_0x46c8f9)/_0x2895fe),_0x1f2468=Math[_0x265685(0x23b)](_0x56bf3f+0x1,_0xdc329c),_0x533f8a=new Array(_0x5bbd86)[_0x265685(0x205)]('\x20');for(let _0x288219=_0x56bf3f;_0x288219<Math['min'](_0x1f2468,_0x5bbd86);_0x288219++){_0x533f8a[_0x288219]='─';}const _0x4f7ebd=_0x533f8a['map'](_0x1c0bc1=>_0x1c0bc1==='\x20'?'\x20':_0x30a6ae(_0x1c0bc1))[_0x265685(0x1a7)]('');_0x574f3c[_0x265685(0x218)](_0x1cf08c+'\x20'+_0x31bf09+'│'+_0x4f7ebd+'│');}return _0x574f3c['join']('\x0a');}async[a54_0x132d15(0x31b)](_0x170c3c,_0x1364c2,_0x79fdd0){const _0x2bec23=a54_0x132d15,{options:_0x4d4089,tdx:_0x40629c}=_0x1364c2,_0x5660e2=_0x4d4089[_0x2bec23(0x227)],{timelineRows:_0x30e636,timeAxisHeader:_0x2cfbb4}=this[_0x2bec23(0x2b6)](_0x170c3c,_0x5660e2),_0xd801a4=_0x30e636[_0x2bec23(0x262)](_0x116925=>_0x116925[_0x2bec23(0x28b)]);if(_0xd801a4['length']===0x0){const _0x90e16b=this[_0x2bec23(0x1d8)](_0x170c3c,_0x5660e2);console[_0x2bec23(0x17b)](_0x90e16b);!_0x79fdd0&&(console[_0x2bec23(0x25a)](''),console[_0x2bec23(0x25a)](a54_0x4527ac[_0x2bec23(0x29e)](_0x2bec23(0x183))),console[_0x2bec23(0x25a)](a54_0x4527ac['dim'](_0x2bec23(0x2c8))+'or'+a54_0x4527ac['dim'](_0x2bec23(0x32e))));return;}_0x2cfbb4&&console['log'](_0x2cfbb4);const _0x55ba4e=_0x30e636[_0x2bec23(0x262)](_0x33d799=>_0x33d799[_0x2bec23(0x28b)])[_0x2bec23(0x25d)](_0x2c7001=>({'title':_0x2c7001[_0x2bec23(0x1a4)],'value':_0x2c7001[_0x2bec23(0x28b)]})),_0x31359d=process[_0x2bec23(0x2f4)]['rows']||0x3c,_0x1504e6=Math['max'](0x28,Math[_0x2bec23(0x223)](_0x31359d*0x2/0x3)),_0x552946=await a54_0x3fb545({'type':_0x2bec23(0x28d),'name':_0x2bec23(0x28b),'message':_0x2bec23(0x20a),'choices':_0x55ba4e,'initial':-0x1,'limit':_0x1504e6,'clearFirst':!![],'fallback':{'title':_0x2bec23(0x2ac),'value':null},'suggest':(_0x146b51,_0x201480)=>{const _0x4b9afe=_0x2bec23;if(!_0x146b51)return Promise[_0x4b9afe(0x293)](_0x201480);const _0x284c64=_0x201480[_0x4b9afe(0x262)](_0x3f2b35=>{const _0x1e3545=_0x4b9afe,_0x32a4a8=_0x3f2b35;return _0x32a4a8[_0x1e3545(0x187)][_0x1e3545(0x22b)]()[_0x1e3545(0x2ec)](_0x146b51[_0x1e3545(0x22b)]());});return Promise[_0x4b9afe(0x293)](_0x284c64);}}),_0x1ffa47=()=>{const _0x33dfbd=_0x2bec23;process[_0x33dfbd(0x2f4)][_0x33dfbd(0x174)](_0x33dfbd(0x244)),process[_0x33dfbd(0x2f4)]['write']('\x1b[1A\x1b[2K'),process[_0x33dfbd(0x2f4)][_0x33dfbd(0x174)](_0x33dfbd(0x244));},_0x535b8b=_0x552946&&_0x552946[_0x2bec23(0x28b)]&&_0x552946[_0x2bec23(0x28b)]!==null&&_0x552946[_0x2bec23(0x28b)][_0x2bec23(0x1fa)]()!=='';if(!_0x535b8b){_0x1ffa47(),console[_0x2bec23(0x17b)](a54_0x4527ac[_0x2bec23(0x29e)]('Cancelled'));return;}_0x1ffa47();const _0x1afbae=_0x170c3c[_0x2bec23(0x20b)](_0x3932f8=>_0x3932f8[_0x2bec23(0x2fc)]?.['id']===_0x552946['attemptId']);if(_0x1afbae){const _0x497804=_0x1afbae['project']?.[_0x2bec23(0x2b2)]||'?',_0x4b94bd=_0x1afbae['workflow']?.['name']||'?';console[_0x2bec23(0x17b)](_0x2bec23(0x29c)+a54_0x4527ac['dim'](_0x497804)+_0x2bec23(0x2f8)+a54_0x4527ac[_0x2bec23(0x29e)](_0x4b94bd));}const _0x927089=new WorkflowTimelineCommand();await _0x927089['execute']({'args':[],'options':{..._0x4d4089,'attemptId':_0x552946[_0x2bec23(0x28b)]},'tdx':_0x40629c});}[a54_0x132d15(0x2b6)](_0x175452,_0x2f2d53){const _0x497c4e=a54_0x132d15,_0x5e81d8=new Map();for(const _0x4a069f of _0x175452){_0x4a069f['id']&&_0x4a069f['lastAttempt']?.['id']&&_0x5e81d8[_0x497c4e(0x228)](_0x4a069f['id'],_0x4a069f['lastAttempt']['id']);}const _0x2981ca=[];let _0x2fab91='';const _0x316957=this[_0x497c4e(0x1d8)](_0x175452,_0x2f2d53),_0x2ba337=_0x316957[_0x497c4e(0x2ff)]('\x0a');for(const _0x1ad8ef of _0x2ba337){if(_0x1ad8ef['startsWith'](_0x497c4e(0x1ca))||_0x1ad8ef['match'](/^\s+\d{4}-\d{2}-\d{2}/))_0x2fab91=_0x1ad8ef;else{if(_0x1ad8ef[_0x497c4e(0x229)](/^[✅❌🔄🛑⏳]/)){const _0x31a482=_0x1ad8ef[_0x497c4e(0x229)](/#(\d+)/),_0x25b6b5=_0x31a482?_0x31a482[0x1]:null,_0x48ffd0=_0x25b6b5?_0x5e81d8['get'](_0x25b6b5)||null:null,_0xfb6a63=_0x175452[_0x497c4e(0x20b)](_0x49b308=>_0x49b308['id']===_0x25b6b5),_0x168269=_0xfb6a63?.['project']?.['name']||'';_0x2981ca['push']({'displayLine':_0x1ad8ef,'attemptId':_0x48ffd0,'projectName':_0x168269});}}}return{'timelineRows':_0x2981ca,'timeAxisHeader':_0x2fab91};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a54_0x132d15(0x2b2)]='workflow:attempts';['description']='List\x20workflow\x20attempts';async[a54_0x132d15(0x1be)](_0x3bfa01){const _0x37ffb1=a54_0x132d15,{options:_0x13dd8f,args:_0x786e00,tdx:_0x10946f}=_0x3bfa01,_0x479f5b=this[_0x37ffb1(0x1a8)](_0x786e00,_0x13dd8f);if(!_0x479f5b)return 0x1;const {projectName:_0x4fbafd,workflowName:_0x402bdb}=_0x479f5b,_0x264e76=_0x13dd8f[_0x37ffb1(0x330)];if(_0x13dd8f['verbose']){if(_0x4fbafd&&_0x402bdb)console[_0x37ffb1(0x25a)]('Filter:\x20'+_0x4fbafd+'.'+_0x402bdb);else _0x4fbafd&&console[_0x37ffb1(0x25a)](_0x37ffb1(0x270)+_0x4fbafd);_0x264e76&&console['error'](_0x37ffb1(0x2fe));}const _0x8e7a40=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x10946f[_0x37ffb1(0x199)][_0x37ffb1(0x2bc)]({'projectName':_0x4fbafd,'workflowName':_0x402bdb,'includeRetried':_0x264e76,'limit':_0x13dd8f[_0x37ffb1(0x1d4)]}),{'verbose':_0x13dd8f[_0x37ffb1(0x329)]}),_0x34d1c0=_0x8e7a40[_0x37ffb1(0x18d)],_0x5a5784=_0x13dd8f[_0x37ffb1(0x1d4)]||0x64,_0x3526cd=_0x34d1c0['length']>=_0x5a5784?a54_0x4527ac['dim'](_0x37ffb1(0x1f6)):'';console[_0x37ffb1(0x25a)](_0x37ffb1(0x25f)+_0x34d1c0[_0x37ffb1(0x303)]+_0x37ffb1(0x197)+(_0x34d1c0[_0x37ffb1(0x303)]!==0x1?'s':'')+_0x3526cd);if(_0x13dd8f[_0x37ffb1(0x220)]===_0x37ffb1(0x1f7)||_0x13dd8f[_0x37ffb1(0x220)]===_0x37ffb1(0x2f5)||_0x13dd8f[_0x37ffb1(0x220)]===_0x37ffb1(0x248))await handleSDKOutput(_0x34d1c0,_0x13dd8f);else{if(_0x34d1c0[_0x37ffb1(0x303)]===0x0){if(_0x4fbafd&&_0x402bdb)console[_0x37ffb1(0x17b)](_0x37ffb1(0x1e2)+_0x4fbafd+'.'+_0x402bdb);else _0x4fbafd?console[_0x37ffb1(0x17b)](_0x37ffb1(0x287)+_0x4fbafd):console[_0x37ffb1(0x17b)](_0x37ffb1(0x2eb));}else{const _0x2e48db=_0x13dd8f[_0x37ffb1(0x227)],_0x3f8764=_0x34d1c0[_0x37ffb1(0x25d)](_0x2f91f7=>{const _0x4f34a8=_0x37ffb1,_0x3f2a07=a54_0x4527ac[_0x4f34a8(0x29e)]('#'+_0x2f91f7['id']),_0x2b379d=_0x2f91f7[_0x4f34a8(0x296)]?.['id'],_0x1d3df9=_0x2f91f7[_0x4f34a8(0x1fc)]||_0x2f91f7[_0x4f34a8(0x202)],_0x229dac=_0x2b379d&&_0x1d3df9?hyperlink(_0x3f2a07,getWorkflowAttemptUrl(_0x2e48db,_0x2b379d,_0x1d3df9,_0x2f91f7['id'])):_0x3f2a07,{icon:_0x378126,text:_0x4c0033}=getAttemptStatusDisplay(_0x2f91f7),_0x267011=(_0x2f91f7[_0x4f34a8(0x296)]?.[_0x4f34a8(0x2b2)]||'?')+'.'+(_0x2f91f7[_0x4f34a8(0x199)]?.[_0x4f34a8(0x2b2)]||'?'),_0xed0d53=_0x2f91f7[_0x4f34a8(0x193)]?a54_0x4527ac[_0x4f34a8(0x29e)](_0x2f91f7[_0x4f34a8(0x193)]):'';return(_0x229dac+'\x20'+_0x378126+(_0x4c0033?'\x20'+_0x4c0033:'')+'\x20'+_0x267011+'\x20'+_0xed0d53)['trimEnd']();});await writeOutput(_0x3f8764[_0x37ffb1(0x1a7)]('\x0a'),_0x13dd8f['output'],_0x37ffb1(0x257));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x2da);[a54_0x132d15(0x31f)]=a54_0x132d15(0x278);async[a54_0x132d15(0x1be)](_0x292a19){const _0x1985dd=a54_0x132d15,{options:_0x22f15b,args:_0xc927d4,tdx:_0x2b4563}=_0x292a19,_0x278fe4=_0xc927d4[0x0];if(!_0x278fe4)return console[_0x1985dd(0x25a)](_0x1985dd(0x2b9)),0x1;_0x22f15b['verbose']&&console['error'](_0x1985dd(0x266)+_0x278fe4);const _0x48673c=await withSpinner(_0x1985dd(0x25c),()=>_0x2b4563[_0x1985dd(0x199)][_0x1985dd(0x1f5)](_0x278fe4),{'verbose':_0x22f15b[_0x1985dd(0x329)]}),_0x12a8ff=_0x48673c['data'];let _0x50a732;!_0x12a8ff[_0x1985dd(0x290)]?_0x50a732=_0x12a8ff[_0x1985dd(0x28e)]?'canceling':_0x1985dd(0x297):_0x50a732=_0x12a8ff[_0x1985dd(0x236)]?_0x1985dd(0x236):_0x1985dd(0x25a);let _0x3a7841;if(_0x12a8ff[_0x1985dd(0x2a1)]&&_0x12a8ff[_0x1985dd(0x295)]){const _0x482d0e=new Date(_0x12a8ff[_0x1985dd(0x2a1)])['getTime'](),_0x9c555d=new Date(_0x12a8ff[_0x1985dd(0x295)])[_0x1985dd(0x192)]();_0x3a7841=Math[_0x1985dd(0x235)]((_0x9c555d-_0x482d0e)/0x3e8);}const _0x3eb819={'attempt_id':_0x12a8ff['id'],'status':_0x50a732,..._0x12a8ff[_0x1985dd(0x26c)]!==undefined&&{'index':_0x12a8ff[_0x1985dd(0x26c)]},..._0x12a8ff[_0x1985dd(0x296)]&&{'project':_0x12a8ff['project'][_0x1985dd(0x2b2)]},..._0x12a8ff[_0x1985dd(0x199)]&&{'workflow':_0x12a8ff[_0x1985dd(0x199)][_0x1985dd(0x2b2)]},..._0x12a8ff[_0x1985dd(0x202)]&&{'session_id':_0x12a8ff[_0x1985dd(0x202)]},..._0x12a8ff[_0x1985dd(0x193)]&&{'session_time':_0x12a8ff[_0x1985dd(0x193)]},..._0x12a8ff[_0x1985dd(0x2d7)]&&{'retry_attempt':_0x12a8ff[_0x1985dd(0x2d7)]},..._0x3a7841!==undefined&&{'duration_sec':_0x3a7841},..._0x12a8ff[_0x1985dd(0x2a1)]&&{'created_at':_0x12a8ff[_0x1985dd(0x2a1)]},..._0x12a8ff['finishedAt']&&{'finished_at':_0x12a8ff[_0x1985dd(0x295)]},...Object[_0x1985dd(0x2d3)](_0x12a8ff['params'])[_0x1985dd(0x303)]>0x0&&{'params':_0x12a8ff['params']}};return await handleSingleObjectOutput(_0x3eb819,_0x22f15b),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a54_0x132d15(0x2b2)]='workflow:tasks';[a54_0x132d15(0x31f)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x45893d){const _0x3b8744=a54_0x132d15,{options:_0x8a7c1d,args:_0x56fea9,tdx:_0x17385e}=_0x45893d,_0x4c7d98=_0x56fea9[0x0];if(!_0x4c7d98)return console['error'](_0x3b8744(0x2b9)),0x1;const _0x28a3e6=_0x8a7c1d['includeSubtasks'];_0x8a7c1d[_0x3b8744(0x329)]&&(console[_0x3b8744(0x25a)](_0x3b8744(0x266)+_0x4c7d98),_0x28a3e6&&console[_0x3b8744(0x25a)](_0x3b8744(0x24c)));const _0x2ee3d0=await withSpinner(_0x3b8744(0x1ff),()=>_0x17385e[_0x3b8744(0x199)]['tasks'](_0x4c7d98,_0x28a3e6||![]),{'verbose':_0x8a7c1d[_0x3b8744(0x329)]}),_0x30b003=_0x2ee3d0[_0x3b8744(0x18d)];return console[_0x3b8744(0x25a)](_0x3b8744(0x25f)+_0x30b003[_0x3b8744(0x303)]+'\x20task'+(_0x30b003[_0x3b8744(0x303)]!==0x1?'s':'')),await handleSDKOutput(_0x30b003,_0x8a7c1d),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x1cb);[a54_0x132d15(0x31f)]=a54_0x132d15(0x1b1);async['execute'](_0x20ab1a){const _0x195ff7=a54_0x132d15,{options:_0x5c57e5,args:_0x5c19c5,tdx:_0x1cf866}=_0x20ab1a,_0x696fd6=_0x5c19c5[0x0];let _0x13859d=_0x5c19c5[0x1];if(!_0x696fd6)return console[_0x195ff7(0x25a)](_0x195ff7(0x2b9)),0x1;_0x5c57e5[_0x195ff7(0x329)]&&(console[_0x195ff7(0x25a)](_0x195ff7(0x266)+_0x696fd6),_0x13859d&&console[_0x195ff7(0x25a)](_0x195ff7(0x20f)+_0x13859d));const _0x39a649=await withSpinner(_0x195ff7(0x18c),()=>_0x1cf866[_0x195ff7(0x199)]['logFiles'](_0x696fd6,_0x13859d),{'verbose':_0x5c57e5[_0x195ff7(0x329)]}),_0x1e802d=_0x39a649[_0x195ff7(0x18d)];if(_0x1e802d[_0x195ff7(0x303)]===0x0)return console[_0x195ff7(0x25a)](_0x195ff7(0x2c5)),0x0;if(!_0x13859d&&(_0x5c57e5[_0x195ff7(0x1f7)]||_0x5c57e5[_0x195ff7(0x220)]))return await handleSDKOutput(_0x1e802d,_0x5c57e5),0x0;if(!_0x13859d){const _0x2e8e41=_0x1e802d[_0x195ff7(0x25d)](_0xaa7cbb=>({'title':_0xaa7cbb[_0x195ff7(0x28f)]+'\x20('+formatBytes(_0xaa7cbb[_0x195ff7(0x188)])+')','value':_0xaa7cbb['taskName']})),_0x58d7d7=await a54_0x3fb545({'type':_0x195ff7(0x275),'name':'task','message':_0x195ff7(0x32c),'choices':_0x2e8e41});if(!_0x58d7d7['task'])return console[_0x195ff7(0x25a)](_0x195ff7(0x2ca)),0x0;_0x13859d=_0x58d7d7[_0x195ff7(0x331)];}const _0x528de1=await withSpinner(_0x195ff7(0x215),()=>_0x1cf866[_0x195ff7(0x199)][_0x195ff7(0x175)](_0x696fd6,_0x13859d),{'verbose':_0x5c57e5[_0x195ff7(0x329)]}),_0x479277=_0x528de1[_0x195ff7(0x18d)];return _0x479277?console[_0x195ff7(0x17b)](_0x479277):console['error'](_0x195ff7(0x2bf)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x245);[a54_0x132d15(0x31f)]=a54_0x132d15(0x2ad);async['execute'](_0x161d90){const _0x3a27=a54_0x132d15,{options:_0x18b28f,args:_0x440ac8,tdx:_0x16fddb}=_0x161d90,_0x26a68a=_0x440ac8[0x0];if(!_0x26a68a)return console[_0x3a27(0x25a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x135820=_0x18b28f[_0x3a27(0x21c)];_0x18b28f['verbose']&&(console[_0x3a27(0x25a)](_0x3a27(0x266)+_0x26a68a),_0x135820&&console[_0x3a27(0x25a)](_0x3a27(0x258)+_0x135820));if(!_0x18b28f['yes']){if(!isInteractive())return console['error'](a54_0x4527ac[_0x3a27(0x232)](_0x3a27(0x26d)),_0x3a27(0x309)),console[_0x3a27(0x25a)](a54_0x4527ac['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x34706a=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x26a68a+'?');if(!_0x34706a)return console[_0x3a27(0x25a)](a54_0x4527ac[_0x3a27(0x219)](_0x3a27(0x2ca))),0x1;}const _0x49a808=await withSpinner(_0x3a27(0x196),()=>_0x16fddb[_0x3a27(0x199)][_0x3a27(0x31a)](_0x26a68a,_0x135820),{'verbose':_0x18b28f[_0x3a27(0x329)]}),_0x48615a=_0x49a808[_0x3a27(0x18d)];return console['error']('✔\x20'+_0x48615a),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x2bd);[a54_0x132d15(0x31f)]=a54_0x132d15(0x221);async[a54_0x132d15(0x1be)](_0x5440dd){const _0x2216a9=a54_0x132d15,{options:_0x1fc5fc,args:_0x2452d8,tdx:_0x286f1c}=_0x5440dd,_0x3cda21=_0x2452d8[0x0];if(!_0x3cda21)return console[_0x2216a9(0x25a)](_0x2216a9(0x2a6)),console[_0x2216a9(0x25a)](_0x2216a9(0x17d)),0x1;let _0x1c8703=![],_0x1779e0=_0x3cda21;if(_0x3cda21['startsWith']('session:'))_0x1c8703=!![],_0x1779e0=_0x3cda21[_0x2216a9(0x2e5)](0x8);else{if(_0x3cda21[_0x2216a9(0x180)](_0x2216a9(0x272)))_0x1c8703=![],_0x1779e0=_0x3cda21['substring'](0x8);else return console[_0x2216a9(0x25a)](_0x2216a9(0x2ce)),console[_0x2216a9(0x25a)](_0x2216a9(0x17d)),0x1;}const _0x46ce4f=_0x1fc5fc[_0x2216a9(0x2d5)],_0x51f2cf=_0x1fc5fc[_0x2216a9(0x25b)],_0x4e6e92=_0x1fc5fc['params'],_0x22bdcd=_0x1fc5fc[_0x2216a9(0x2f9)];_0x1fc5fc[_0x2216a9(0x329)]&&(console[_0x2216a9(0x25a)](_0x2216a9(0x312)+(_0x1c8703?'session':_0x2216a9(0x1f5))+'\x20'+_0x1779e0),_0x46ce4f&&console[_0x2216a9(0x25a)](_0x2216a9(0x264)+_0x46ce4f),_0x51f2cf&&console[_0x2216a9(0x25a)]('Resume\x20from:\x20'+_0x51f2cf),_0x4e6e92&&console[_0x2216a9(0x25a)](_0x2216a9(0x2d4)+_0x4e6e92),_0x22bdcd&&console['error'](_0x2216a9(0x22e)));let _0x12a6aa;if(_0x4e6e92)try{if(_0x4e6e92[_0x2216a9(0x180)]('@')){const _0x3c1555=await import(_0x2216a9(0x277)),_0x199532=_0x4e6e92[_0x2216a9(0x2e5)](0x1),_0x491c31=await _0x3c1555[_0x2216a9(0x2de)](_0x199532,_0x2216a9(0x1ea));_0x12a6aa=JSON['parse'](_0x491c31);}else _0x12a6aa=JSON['parse'](_0x4e6e92);}catch{return console[_0x2216a9(0x25a)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x1fc5fc[_0x2216a9(0x289)]){if(!isInteractive())return console[_0x2216a9(0x25a)](a54_0x4527ac['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a54_0x4527ac[_0x2216a9(0x29e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x19d751=await confirmKey(_0x2216a9(0x239)+(_0x1c8703?_0x2216a9(0x2b5):_0x2216a9(0x1f5))+'\x20'+_0x1779e0+'?');if(!_0x19d751)return console['error'](a54_0x4527ac['yellow'](_0x2216a9(0x2ca))),0x1;}let _0x2283ad;_0x1c8703?_0x2283ad=await withSpinner(_0x2216a9(0x20e),()=>_0x286f1c['workflow']['retrySession'](_0x1779e0,{'fromTask':_0x46ce4f,'retryParams':_0x12a6aa}),{'verbose':_0x1fc5fc[_0x2216a9(0x329)]}):_0x2283ad=await withSpinner('Retrying\x20attempt...',()=>_0x286f1c['workflow'][_0x2216a9(0x237)](_0x1779e0,{'resumeFrom':_0x51f2cf,'retryParams':_0x12a6aa,'force':_0x22bdcd}),{'verbose':_0x1fc5fc[_0x2216a9(0x329)]});const _0x1ccea5=_0x2283ad['data'];return console[_0x2216a9(0x25a)](_0x2216a9(0x176)),console[_0x2216a9(0x25a)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x1ccea5[_0x2216a9(0x28b)]),console['error']('\x20\x20Session\x20ID:\x20'+_0x1ccea5[_0x2216a9(0x202)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x2b3);['description']='Start\x20a\x20workflow\x20run';async[a54_0x132d15(0x1be)](_0x3b4789){const _0x46ba67=a54_0x132d15,{options:_0x323661,args:_0x33e7fc,tdx:_0x86b6e7}=_0x3b4789;let _0x4c5cc7=_0x33e7fc[0x0];if(!_0x4c5cc7){const _0x28cc41=this[_0x46ba67(0x185)]([],_0x323661),_0x3bc6ea=await withSpinner(_0x46ba67(0x30e),()=>_0x86b6e7['workflow']['workflows'](_0x28cc41,{'limit':_0x323661['limit']}),{'verbose':_0x323661[_0x46ba67(0x329)]}),_0x5b8e5b=_0x3bc6ea['data'];if(_0x5b8e5b[_0x46ba67(0x303)]===0x0)return console['error'](_0x46ba67(0x302)),!_0x28cc41&&console[_0x46ba67(0x25a)](a54_0x4527ac[_0x46ba67(0x29e)](_0x46ba67(0x2e4))),0x1;const _0x4af133=_0x5b8e5b[_0x46ba67(0x25d)](_0x365cd7=>({'title':_0x365cd7[_0x46ba67(0x296)]?.[_0x46ba67(0x2b2)]+'.'+_0x365cd7['name'],'value':_0x365cd7[_0x46ba67(0x296)]?.['name']+'.'+_0x365cd7[_0x46ba67(0x2b2)],'description':_0x365cd7['revision']?_0x46ba67(0x2b4)+_0x365cd7[_0x46ba67(0x2ba)]:undefined})),_0x426b23=await a54_0x3fb545({'type':'select','name':'workflow','message':_0x46ba67(0x1d7),'choices':_0x4af133});if(!_0x426b23[_0x46ba67(0x199)])return 0x1;_0x4c5cc7=_0x426b23['workflow'];}if(!_0x4c5cc7['includes']('.')){const _0x398485=this[_0x46ba67(0x185)]([],_0x323661);if(_0x398485)_0x4c5cc7=_0x398485+'.'+_0x4c5cc7;else return console[_0x46ba67(0x25a)](a54_0x4527ac[_0x46ba67(0x232)]('Error:'),_0x46ba67(0x332)),console[_0x46ba67(0x25a)](a54_0x4527ac[_0x46ba67(0x29e)](_0x46ba67(0x2e4))),0x1;}const _0x212afc=_0x323661[_0x46ba67(0x1b0)],_0x203221=_0x323661[_0x46ba67(0x193)],_0x13e52a={};if(_0x212afc&&Array[_0x46ba67(0x2e9)](_0x212afc))for(const _0x228d44 of _0x212afc){const _0x23cfc0=_0x228d44['indexOf']('=');if(_0x23cfc0===-0x1)return console[_0x46ba67(0x25a)](_0x46ba67(0x2ee)+_0x228d44),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x1cb2a3=_0x228d44[_0x46ba67(0x2e5)](0x0,_0x23cfc0),_0xfe3eeb=_0x228d44[_0x46ba67(0x2e5)](_0x23cfc0+0x1);try{_0x13e52a[_0x1cb2a3]=JSON['parse'](_0xfe3eeb);}catch{_0x13e52a[_0x1cb2a3]=_0xfe3eeb;}}_0x323661[_0x46ba67(0x329)]&&(console['error'](_0x46ba67(0x276)+_0x4c5cc7),Object[_0x46ba67(0x2d3)](_0x13e52a)[_0x46ba67(0x303)]>0x0&&console[_0x46ba67(0x25a)](_0x46ba67(0x222)+JSON[_0x46ba67(0x2a8)](_0x13e52a)),_0x203221&&console[_0x46ba67(0x25a)]('Session\x20time:\x20'+_0x203221));const _0x129606=await withSpinner(_0x46ba67(0x1ba),()=>_0x86b6e7['workflow'][_0x46ba67(0x1aa)](_0x4c5cc7,_0x13e52a,{'sessionTime':_0x203221}),{'verbose':_0x323661[_0x46ba67(0x329)]}),_0x3bd499=_0x129606[_0x46ba67(0x18d)];console[_0x46ba67(0x25a)](_0x46ba67(0x252)),console[_0x46ba67(0x25a)](_0x46ba67(0x181)+_0x3bd499['id']),console[_0x46ba67(0x25a)]('\x20\x20Session\x20ID:\x20'+_0x3bd499['sessionId']),console[_0x46ba67(0x25a)](_0x46ba67(0x299)+_0x3bd499['project']?.[_0x46ba67(0x2b2)]),console[_0x46ba67(0x25a)](_0x46ba67(0x2c6)+_0x3bd499['workflow']?.[_0x46ba67(0x2b2)]);if(_0x3bd499[_0x46ba67(0x296)]?.['id']&&_0x3bd499[_0x46ba67(0x202)]&&_0x3bd499['id']){const _0x325786=_0x323661['site'],_0x1e53a1=getConsoleUrl(_0x325786,_0x46ba67(0x21b)+_0x3bd499['project']['id']+_0x46ba67(0x22f)+_0x3bd499['sessionId']+'/attempt/'+_0x3bd499['id']);console[_0x46ba67(0x25a)](_0x46ba67(0x1ad)+a54_0x4527ac[_0x46ba67(0x2ae)](_0x1e53a1));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a54_0x132d15(0x2b2)]='workflow:download';['description']=a54_0x132d15(0x22c);async[a54_0x132d15(0x1be)](_0x28c83e){const _0x27b5a9=a54_0x132d15,{options:_0xfddc65,args:_0x1951a3,tdx:_0x166ec4}=_0x28c83e,_0x1fb559=_0x1951a3[0x0],_0x971b98=_0x1951a3[0x1]||'.';if(!_0x1fb559)return console[_0x27b5a9(0x25a)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x27b5a9(0x25a)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x13ea35=_0xfddc65[_0x27b5a9(0x2ba)];_0xfddc65[_0x27b5a9(0x329)]&&(console[_0x27b5a9(0x25a)](_0x27b5a9(0x29c)+_0x1fb559),console[_0x27b5a9(0x25a)](_0x27b5a9(0x178)+_0x971b98),_0x13ea35&&console[_0x27b5a9(0x25a)](_0x27b5a9(0x179)+_0x13ea35));const _0x471ab9=await withSpinner('Downloading\x20project\x20'+_0x1fb559+_0x27b5a9(0x2b8),()=>_0x166ec4[_0x27b5a9(0x199)][_0x27b5a9(0x2f3)](_0x1fb559,_0x971b98,{'revision':_0x13ea35}),{'verbose':_0xfddc65[_0x27b5a9(0x329)]}),_0x3d1b07=_0x471ab9[_0x27b5a9(0x18d)];return console['error'](_0x27b5a9(0x1c1)+_0x3d1b07[_0x27b5a9(0x233)]),console[_0x27b5a9(0x25a)](_0x27b5a9(0x2cb)+_0x3d1b07[_0x27b5a9(0x2ba)]),console[_0x27b5a9(0x25a)](_0x27b5a9(0x2f2)+_0x3d1b07['filesExtracted']),console[_0x27b5a9(0x25a)](_0x27b5a9(0x2fa)+_0x971b98+'/'+_0x3d1b07[_0x27b5a9(0x233)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x25e);[a54_0x132d15(0x31f)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a54_0x132d15(0x1be)](_0xfd5672){const _0x3f21f4=a54_0x132d15,{options:_0xee8ad7,args:_0x5d499a,tdx:_0x555ca1}=_0xfd5672;let _0x42f4bb='.',_0x18356f=_0xee8ad7[_0x3f21f4(0x2b2)];if(_0x5d499a[0x0]){const {promises:_0x1078f5}=await import('fs');try{const _0x434e9b=await _0x1078f5[_0x3f21f4(0x27e)](_0x5d499a[0x0]);if(_0x434e9b['isDirectory']())_0x42f4bb=_0x5d499a[0x0];else return console[_0x3f21f4(0x25a)](_0x3f21f4(0x208)+_0x5d499a[0x0]+_0x3f21f4(0x29d)),0x1;}catch{_0x18356f=_0x5d499a[0x0],_0x42f4bb='.';}}const _0x20a29c=_0xee8ad7[_0x3f21f4(0x2ba)],_0x4b7780=_0xee8ad7[_0x3f21f4(0x263)];_0xee8ad7[_0x3f21f4(0x329)]&&(console[_0x3f21f4(0x25a)](_0x3f21f4(0x279)+_0x42f4bb),_0x18356f&&console['error'](_0x3f21f4(0x22a)+_0x18356f),_0x20a29c&&console[_0x3f21f4(0x25a)](_0x3f21f4(0x179)+_0x20a29c),_0x4b7780&&console[_0x3f21f4(0x25a)](_0x3f21f4(0x321)));const _0x3ee9ca=await withSpinner(_0x3f21f4(0x1c5),()=>_0x555ca1['workflow'][_0x3f21f4(0x218)](_0x42f4bb,{'projectName':_0x18356f,'revision':_0x20a29c,'skipValidation':_0x4b7780}),{'verbose':_0xee8ad7[_0x3f21f4(0x329)]}),_0x5a3a13=_0x3ee9ca[_0x3f21f4(0x18d)];return console['error'](_0x3f21f4(0x313)+_0x5a3a13[_0x3f21f4(0x233)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x5a3a13['projectId']),console[_0x3f21f4(0x25a)](_0x3f21f4(0x2cb)+_0x5a3a13[_0x3f21f4(0x2ba)]),await this['showWorkflowConsoleUrl'](_0x555ca1,_0x5a3a13[_0x3f21f4(0x233)],_0xee8ad7[_0x3f21f4(0x227)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x1da);['description']=a54_0x132d15(0x29b);async[a54_0x132d15(0x1be)](_0x18b6ae){const _0x21e7ad=a54_0x132d15,{options:_0x567b6e,args:_0x13e567,tdx:_0x2e9434}=_0x18b6ae,_0xf577bc=_0x13e567[0x0],_0x3ec258=_0x13e567[0x1];if(!_0xf577bc)return console[_0x21e7ad(0x25a)](a54_0x4527ac[_0x21e7ad(0x232)](_0x21e7ad(0x1de)),_0x21e7ad(0x2f7)),console[_0x21e7ad(0x25a)](a54_0x4527ac[_0x21e7ad(0x29e)](_0x21e7ad(0x217))),0x1;const _0x536015=_0x567b6e[_0x21e7ad(0x2ba)];_0x567b6e[_0x21e7ad(0x329)]&&(console[_0x21e7ad(0x25a)](_0x21e7ad(0x29c)+_0xf577bc),_0x3ec258&&console[_0x21e7ad(0x25a)](_0x21e7ad(0x31e)+_0x3ec258),_0x536015&&console[_0x21e7ad(0x25a)]('Revision:\x20'+_0x536015),_0x567b6e[_0x21e7ad(0x27d)]&&console['error']('Dry\x20run:\x20yes'));const _0x5cdad5=await withSpinner(_0x21e7ad(0x19c)+_0xf577bc+_0x21e7ad(0x2b8),()=>_0x2e9434[_0x21e7ad(0x199)][_0x21e7ad(0x2f0)](_0xf577bc,{'targetDir':_0x3ec258,'revision':_0x536015}),{'verbose':_0x567b6e[_0x21e7ad(0x329)]}),_0x5bd7c2=_0x5cdad5[_0x21e7ad(0x18d)];_0x5bd7c2['isNewProject']?console[_0x21e7ad(0x25a)](_0x21e7ad(0x2d6)+_0x5bd7c2[_0x21e7ad(0x233)]):console['error'](_0x21e7ad(0x2c7)+_0x5bd7c2[_0x21e7ad(0x233)]);console['error'](_0x21e7ad(0x2cb)+_0x5bd7c2['revision']),console['error'](_0x21e7ad(0x189)+(a54_0x1c0d96[_0x21e7ad(0x216)](process[_0x21e7ad(0x231)](),_0x5bd7c2[_0x21e7ad(0x27c)])||'.')),console[_0x21e7ad(0x25a)](_0x21e7ad(0x2a4)+a54_0x4527ac['green']('+'+_0x5bd7c2[_0x21e7ad(0x1af)][_0x21e7ad(0x210)]+_0x21e7ad(0x1b9))+',\x20'+(a54_0x4527ac['yellow']('~'+_0x5bd7c2[_0x21e7ad(0x1af)]['modified']+_0x21e7ad(0x1cc))+',\x20')+(a54_0x4527ac[_0x21e7ad(0x232)]('-'+_0x5bd7c2['summary'][_0x21e7ad(0x324)]+'\x20deleted')+',\x20')+(''+a54_0x4527ac[_0x21e7ad(0x29e)](_0x5bd7c2[_0x21e7ad(0x1af)][_0x21e7ad(0x20c)]+'\x20unchanged')));for(const _0x163a2c of _0x5bd7c2[_0x21e7ad(0x24e)]){_0x163a2c[_0x21e7ad(0x2bb)]==='modified'&&_0x163a2c[_0x21e7ad(0x298)]&&(console[_0x21e7ad(0x25a)]('\x0a'+a54_0x4527ac[_0x21e7ad(0x2ae)](_0x21e7ad(0x19d)+_0x163a2c[_0x21e7ad(0x242)])),console[_0x21e7ad(0x25a)](_0x163a2c[_0x21e7ad(0x298)]));}if(!_0x5bd7c2[_0x21e7ad(0x1df)])return saveSessionContext({'workflow_project':_0x5bd7c2[_0x21e7ad(0x233)]},_0x567b6e[_0x21e7ad(0x2b5)]),console[_0x21e7ad(0x25a)](a54_0x4527ac[_0x21e7ad(0x267)](_0x21e7ad(0x17c))),console[_0x21e7ad(0x25a)](a54_0x4527ac[_0x21e7ad(0x29e)](_0x21e7ad(0x1bf)+_0x5bd7c2[_0x21e7ad(0x233)])),0x0;if(_0x567b6e['dryRun'])return console['error'](a54_0x4527ac['yellow'](_0x21e7ad(0x2c9))),0x0;if(!_0x567b6e[_0x21e7ad(0x289)]){if(!isInteractive())return console[_0x21e7ad(0x25a)](a54_0x4527ac['red']('\x0aError:'),_0x21e7ad(0x309)),console['error'](a54_0x4527ac[_0x21e7ad(0x29e)](_0x21e7ad(0x280))),0x1;const _0x3bf1e6=await confirmKey(_0x21e7ad(0x26a));if(!_0x3bf1e6)return console[_0x21e7ad(0x25a)](a54_0x4527ac[_0x21e7ad(0x219)]('Cancelled'),_0x21e7ad(0x282)),0x1;}await withSpinner(_0x21e7ad(0x1f9),()=>_0x2e9434[_0x21e7ad(0x199)][_0x21e7ad(0x33a)](_0x5bd7c2,{'revision':_0x536015}),{'verbose':_0x567b6e[_0x21e7ad(0x329)]}),saveSessionContext({'workflow_project':_0x5bd7c2[_0x21e7ad(0x233)]},_0x567b6e[_0x21e7ad(0x2b5)]),console[_0x21e7ad(0x25a)](a54_0x4527ac['green'](_0x21e7ad(0x1fe)));const _0x3b2edd=a54_0x1c0d96[_0x21e7ad(0x216)](process[_0x21e7ad(0x231)](),_0x5bd7c2[_0x21e7ad(0x27c)])||'.';return console['error'](a54_0x4527ac[_0x21e7ad(0x29e)](_0x21e7ad(0x2fa)+_0x3b2edd)),console[_0x21e7ad(0x25a)](a54_0x4527ac['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x5bd7c2['projectName'])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x1e4);[a54_0x132d15(0x31f)]=a54_0x132d15(0x1bd);async['execute'](_0x11a83a){const _0x48bf33=a54_0x132d15,{options:_0x877d56,args:_0x2313e4,tdx:_0x117ce9}=_0x11a83a,_0xb239df=this['resolveProjectDir'](_0x2313e4,_0x877d56),_0x16c1f8=_0x877d56[_0x48bf33(0x2ba)],_0x530d8e=_0x877d56[_0x48bf33(0x263)];_0x877d56['verbose']&&(_0xb239df&&console[_0x48bf33(0x25a)](_0x48bf33(0x2b7)+_0xb239df),_0x16c1f8&&console['error']('Revision:\x20'+_0x16c1f8),_0x877d56['dryRun']&&console[_0x48bf33(0x25a)](_0x48bf33(0x32b)),_0x530d8e&&console[_0x48bf33(0x25a)]('Validation:\x20skipped'));let _0x522a3d;try{_0x522a3d=await withSpinner(_0x48bf33(0x21d),()=>_0x117ce9[_0x48bf33(0x199)]['preparePushProject']({'sourceDir':_0xb239df,'revision':_0x16c1f8,'skipValidation':_0x530d8e}),{'verbose':_0x877d56[_0x48bf33(0x329)]});}catch(_0x2b115a){if(_0x2b115a instanceof Error&&_0x2b115a['message']['includes'](_0x48bf33(0x1e0)))return console[_0x48bf33(0x25a)](a54_0x4527ac[_0x48bf33(0x232)](_0x48bf33(0x1de)),_0x48bf33(0x288)),_0x877d56[_0x48bf33(0x28c)]?console[_0x48bf33(0x25a)](a54_0x4527ac[_0x48bf33(0x29e)]('Tip:\x20cd\x20to\x20workflows/'+_0x877d56['workflowProject']+_0x48bf33(0x26e)+_0x877d56[_0x48bf33(0x28c)]+'\x27')):console[_0x48bf33(0x25a)](a54_0x4527ac['dim'](_0x48bf33(0x269))),0x1;throw _0x2b115a;}const _0x395f01=_0x522a3d[_0x48bf33(0x18d)];console[_0x48bf33(0x25a)](_0x48bf33(0x320)+_0x395f01[_0x48bf33(0x233)]),console[_0x48bf33(0x25a)]('\x20\x20Source:\x20'+_0x395f01['sourceDir']),console['error'](_0x48bf33(0x2cb)+_0x395f01[_0x48bf33(0x2ba)]),console['error'](_0x48bf33(0x2a4)+a54_0x4527ac[_0x48bf33(0x267)]('+'+_0x395f01[_0x48bf33(0x1af)][_0x48bf33(0x210)]+_0x48bf33(0x1b9))+',\x20'+(a54_0x4527ac[_0x48bf33(0x219)]('~'+_0x395f01['summary'][_0x48bf33(0x2b0)]+_0x48bf33(0x1cc))+',\x20')+(a54_0x4527ac[_0x48bf33(0x232)]('-'+_0x395f01[_0x48bf33(0x1af)][_0x48bf33(0x324)]+_0x48bf33(0x1e7))+',\x20')+(''+a54_0x4527ac['dim'](_0x395f01[_0x48bf33(0x1af)][_0x48bf33(0x20c)]+'\x20unchanged')));for(const _0x5b65c7 of _0x395f01[_0x48bf33(0x24e)]){_0x5b65c7[_0x48bf33(0x2bb)]===_0x48bf33(0x2b0)&&_0x5b65c7[_0x48bf33(0x298)]&&(console['error']('\x0a'+a54_0x4527ac['cyan'](_0x48bf33(0x19d)+_0x5b65c7[_0x48bf33(0x242)])),console['error'](_0x5b65c7['diff']));}if(!_0x395f01[_0x48bf33(0x1df)])return console['error'](a54_0x4527ac[_0x48bf33(0x267)](_0x48bf33(0x261))),await this['showWorkflowConsoleUrl'](_0x117ce9,_0x395f01[_0x48bf33(0x233)],_0x877d56[_0x48bf33(0x227)]),0x0;if(_0x877d56[_0x48bf33(0x27d)])return console[_0x48bf33(0x25a)](a54_0x4527ac[_0x48bf33(0x219)](_0x48bf33(0x1ed))),0x0;if(!_0x877d56[_0x48bf33(0x289)]){if(!isInteractive())return console[_0x48bf33(0x25a)](a54_0x4527ac['red']('\x0aError:'),_0x48bf33(0x309)),console[_0x48bf33(0x25a)](a54_0x4527ac[_0x48bf33(0x29e)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xcf4e9d=await confirmKey('\x0aPush\x20these\x20changes?');if(!_0xcf4e9d)return console['error'](a54_0x4527ac[_0x48bf33(0x219)](_0x48bf33(0x2ca)),_0x48bf33(0x27a)),0x1;}const _0x35b692=await withSpinner(_0x48bf33(0x1a1),()=>_0x117ce9[_0x48bf33(0x199)][_0x48bf33(0x1c4)](_0x395f01),{'verbose':_0x877d56['verbose']}),_0x560ce3=_0x35b692[_0x48bf33(0x18d)];return console['error'](a54_0x4527ac['green'](_0x48bf33(0x334))),console[_0x48bf33(0x25a)]('\x20\x20Project\x20ID:\x20'+_0x560ce3[_0x48bf33(0x224)]),console['error']('\x20\x20Revision:\x20'+_0x560ce3[_0x48bf33(0x2ba)]),await this['showWorkflowConsoleUrl'](_0x117ce9,_0x560ce3['projectName'],_0x877d56[_0x48bf33(0x227)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x2cf);[a54_0x132d15(0x31f)]=a54_0x132d15(0x2df);async['execute'](_0x263a07){const _0x574fa5=a54_0x132d15,{options:_0x58421d,args:_0x44671e,tdx:_0x4df165}=_0x263a07,_0x5b397c=this['resolveProjectDir'](_0x44671e,_0x58421d),_0x3da683=_0x58421d[_0x574fa5(0x2b2)],_0x4d0d2b=_0x58421d['revision'],_0x2b4fcd=_0x58421d['skipValidation'];if(!_0x5b397c)return console['error'](a54_0x4527ac[_0x574fa5(0x232)](_0x574fa5(0x1de)),_0x574fa5(0x2cc)),console[_0x574fa5(0x25a)](a54_0x4527ac['dim'](_0x574fa5(0x339))),console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x29e)](_0x574fa5(0x291))),0x1;if(!_0x3da683)return console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x232)](_0x574fa5(0x1de)),_0x574fa5(0x2aa)),console['error'](a54_0x4527ac[_0x574fa5(0x29e)](_0x574fa5(0x339))),0x1;_0x58421d[_0x574fa5(0x329)]&&(console[_0x574fa5(0x25a)](_0x574fa5(0x2b7)+_0x5b397c),console[_0x574fa5(0x25a)](_0x574fa5(0x247)+_0x3da683),_0x4d0d2b&&console[_0x574fa5(0x25a)]('Revision:\x20'+_0x4d0d2b),_0x58421d[_0x574fa5(0x27d)]&&console[_0x574fa5(0x25a)]('Dry\x20run:\x20yes'),_0x2b4fcd&&console['error'](_0x574fa5(0x321)));const _0x5132c7=await withSpinner(_0x574fa5(0x2d8),()=>_0x4df165['workflow'][_0x574fa5(0x2f1)](_0x5b397c,_0x3da683,{'revision':_0x4d0d2b,'skipValidation':_0x2b4fcd}),{'verbose':_0x58421d[_0x574fa5(0x329)]}),_0xe304d=_0x5132c7[_0x574fa5(0x18d)];console[_0x574fa5(0x25a)](_0x574fa5(0x2cd)+_0xe304d[_0x574fa5(0x251)]);_0xe304d[_0x574fa5(0x243)]&&console[_0x574fa5(0x25a)]('Source\x20project:\x20'+_0xe304d[_0x574fa5(0x243)]);console[_0x574fa5(0x25a)](_0x574fa5(0x247)+_0xe304d[_0x574fa5(0x200)]),console['error'](_0x574fa5(0x179)+_0xe304d['revision']),console[_0x574fa5(0x25a)](_0x574fa5(0x311)+_0xe304d['fileCount']);_0xe304d[_0x574fa5(0x1b5)]&&(console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x219)](_0x574fa5(0x260)+_0xe304d[_0x574fa5(0x200)]+_0x574fa5(0x19f)+_0xe304d[_0x574fa5(0x286)]+')')),console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x219)]('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x58421d['dryRun'])return console['error'](a54_0x4527ac[_0x574fa5(0x219)](_0x574fa5(0x307))),0x0;if(!_0x58421d[_0x574fa5(0x289)]){if(!isInteractive())return console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x232)](_0x574fa5(0x26d)),_0x574fa5(0x309)),console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x29e)](_0x574fa5(0x280))),0x1;const _0xd3395=_0xe304d[_0x574fa5(0x243)]||a54_0x1c0d96['basename'](_0x5b397c),_0x53e4ad=_0xe304d[_0x574fa5(0x1b5)]?'\x0aUpdate\x20existing\x20project\x20\x22'+_0x3da683+'\x22\x20with\x20new\x20revision?':_0x574fa5(0x337)+_0xd3395+_0x574fa5(0x1b2)+_0x3da683+'\x22?',_0x306059=await confirmKey(_0x53e4ad);if(!_0x306059)return console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x219)](_0x574fa5(0x2ca))),0x1;}const _0x38b19b=await withSpinner(_0xe304d['targetExists']?'Updating\x20'+_0x3da683+'...':'Cloning\x20to\x20'+_0x3da683+'...',()=>_0x4df165['workflow'][_0x574fa5(0x24f)](_0xe304d),{'verbose':_0x58421d['verbose']}),_0x22a445=_0x38b19b[_0x574fa5(0x18d)];return console[_0x574fa5(0x25a)](a54_0x4527ac[_0x574fa5(0x267)](_0xe304d[_0x574fa5(0x1b5)]?_0x574fa5(0x23d):'✔\x20Clone\x20complete')),console[_0x574fa5(0x25a)](_0x574fa5(0x299)+_0x22a445[_0x574fa5(0x200)]),console[_0x574fa5(0x25a)](_0x574fa5(0x1b8)+_0x22a445[_0x574fa5(0x31d)]),console[_0x574fa5(0x25a)](_0x574fa5(0x2cb)+_0x22a445[_0x574fa5(0x2ba)]),await this[_0x574fa5(0x198)](_0x4df165,_0x22a445['newProjectName'],_0x58421d[_0x574fa5(0x227)]),0x0;}}function a54_0x593d(_0x5661a9,_0x374e4f){_0x5661a9=_0x5661a9-0x174;const _0x10adb4=a54_0x10ad();let _0x593d67=_0x10adb4[_0x5661a9];return _0x593d67;}export class WorkflowDeleteCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x1f3);['description']='Delete\x20workflow\x20project\x20from\x20Treasure\x20Data';async[a54_0x132d15(0x1be)](_0x127081){const _0x450065=a54_0x132d15,{options:_0x4b641e,args:_0x401301,tdx:_0x24334c}=_0x127081,_0x40452b=_0x401301[0x0];if(!_0x40452b)return console[_0x450065(0x25a)]('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x450065(0x25a)]('Usage:\x20workflow:delete\x20<project-name-or-id>'),0x1;_0x4b641e['verbose']&&console[_0x450065(0x25a)](_0x450065(0x29c)+_0x40452b);if(!_0x4b641e[_0x450065(0x289)]){if(!isInteractive())return console['error'](a54_0x4527ac['red'](_0x450065(0x26d)),_0x450065(0x309)),console['error'](a54_0x4527ac['dim'](_0x450065(0x280))),0x1;const _0x29768b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x40452b+_0x450065(0x24b));if(!_0x29768b)return console[_0x450065(0x25a)](a54_0x4527ac['yellow']('Cancelled')),0x1;}const _0x54bf13=await withSpinner(_0x450065(0x1ac)+_0x40452b+_0x450065(0x2b8),()=>_0x24334c[_0x450065(0x199)][_0x450065(0x304)](_0x40452b),{'verbose':_0x4b641e[_0x450065(0x329)]}),_0x3997b6=_0x54bf13[_0x450065(0x18d)];return console['error'](_0x450065(0x1f8)+_0x3997b6[_0x450065(0x233)]),console['error'](_0x450065(0x1b8)+_0x3997b6[_0x450065(0x224)]),0x0;}}export function parseKeyValue(_0xc6dbea){const _0x312e15=a54_0x132d15,_0x34e772=_0xc6dbea[_0x312e15(0x301)]('=');if(_0x34e772===-0x1)throw new Error(_0x312e15(0x285)+_0xc6dbea+_0x312e15(0x204));const _0x52716d=_0xc6dbea[_0x312e15(0x2e5)](0x0,_0x34e772),_0x8ce13=_0xc6dbea[_0x312e15(0x2e5)](_0x34e772+0x1);if(!_0x52716d)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x52716d,'value':_0x8ce13};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x2a0);['description']=a54_0x132d15(0x281);async[a54_0x132d15(0x1be)](_0x2b8cf2){const _0x1a6c53=a54_0x132d15,{options:_0xe4a917,args:_0x3be68f,tdx:_0x22cebe}=_0x2b8cf2,_0x2674fb=this['requireProject'](_0x3be68f,_0xe4a917);if(!_0x2674fb)return 0x1;_0xe4a917[_0x1a6c53(0x329)]&&console[_0x1a6c53(0x25a)](_0x1a6c53(0x29c)+_0x2674fb);const _0x391383=await withSpinner(_0x1a6c53(0x1ee),()=>_0x22cebe[_0x1a6c53(0x199)][_0x1a6c53(0x30a)](_0x2674fb),{'verbose':_0xe4a917[_0x1a6c53(0x329)]}),{secrets:_0x3f1e71}=_0x391383[_0x1a6c53(0x18d)];return console[_0x1a6c53(0x25a)](_0x1a6c53(0x25f)+_0x3f1e71['length']+_0x1a6c53(0x1d3)+(_0x3f1e71['length']!==0x1?'s':'')),await handleSDKOutput(_0x3f1e71,_0xe4a917),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x2c2);['description']='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a54_0x132d15(0x1be)](_0x2a8be2){const _0x278893=a54_0x132d15,{options:_0x4e0e60,args:_0x18ad97,tdx:_0xfb6923}=_0x2a8be2;let _0x3b6a17,_0x312324;if(_0x18ad97[_0x278893(0x303)]>=0x1&&!_0x18ad97[0x0][_0x278893(0x2ec)]('='))_0x3b6a17=_0x18ad97[0x0],_0x312324=_0x18ad97['slice'](0x1);else{if(_0x18ad97['length']>=0x1&&_0x4e0e60['workflowProject'])_0x3b6a17=_0x4e0e60[_0x278893(0x28c)],_0x312324=_0x18ad97;else return _0x18ad97[_0x278893(0x303)]>=0x1?(console[_0x278893(0x25a)](_0x278893(0x305)),console[_0x278893(0x25a)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>'),0x1):(console[_0x278893(0x25a)](_0x278893(0x1b6)),console['error']('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1);}if(_0x312324[_0x278893(0x303)]===0x0)return console['error'](_0x278893(0x1b6)),console[_0x278893(0x25a)]('Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE\x20[KEY2=VALUE2\x20...]'),0x1;const _0x3d3a96={};try{for(const _0x159494 of _0x312324){const {key:_0x54336b,value:_0xd103d0}=parseKeyValue(_0x159494);_0x3d3a96[_0x54336b]=_0xd103d0;}}catch(_0x3d4adf){return _0x3d4adf instanceof Error&&console[_0x278893(0x25a)](a54_0x4527ac[_0x278893(0x232)](_0x278893(0x1de)),_0x3d4adf[_0x278893(0x316)]),0x1;}const _0x2ece3d=Object['keys'](_0x3d3a96);_0x4e0e60[_0x278893(0x329)]&&(console[_0x278893(0x25a)](_0x278893(0x29c)+_0x3b6a17),console[_0x278893(0x25a)](_0x278893(0x1d2)+_0x2ece3d[_0x278893(0x1a7)](',\x20')));const _0x4bf929=await withSpinner(_0x2ece3d[_0x278893(0x303)]===0x1?_0x278893(0x230):_0x278893(0x1e5)+_0x2ece3d[_0x278893(0x303)]+_0x278893(0x1db),()=>_0xfb6923['workflow'][_0x278893(0x212)](_0x3b6a17,_0x3d3a96),{'verbose':_0x4e0e60[_0x278893(0x329)]}),_0x454c3f=_0x4bf929[_0x278893(0x18d)];return console[_0x278893(0x25a)](_0x2ece3d[_0x278893(0x303)]===0x1?'✔\x20Secret\x20\x27'+_0x454c3f[_0x278893(0x2d3)][0x0]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x454c3f[_0x278893(0x233)]+'\x27':'✔\x20'+_0x454c3f[_0x278893(0x2d3)]['length']+_0x278893(0x1e8)+_0x454c3f[_0x278893(0x233)]+'\x27'),(_0x4e0e60[_0x278893(0x1f7)]||_0x4e0e60['jsonl'])&&await handleSingleObjectOutput(_0x454c3f,_0x4e0e60),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x1ab);[a54_0x132d15(0x31f)]=a54_0x132d15(0x2db);async[a54_0x132d15(0x1be)](_0x47ec72){const _0x31623b=a54_0x132d15,{options:_0x286902,args:_0x526655,tdx:_0x13a478}=_0x47ec72;let _0x324de4,_0x1a9011;if(_0x526655['length']>=0x2)_0x324de4=_0x526655[0x0],_0x1a9011=_0x526655[0x1];else{if(_0x526655['length']===0x1&&_0x286902[_0x31623b(0x28c)])_0x324de4=_0x286902[_0x31623b(0x28c)],_0x1a9011=_0x526655[0x0];else return _0x526655[_0x31623b(0x303)]===0x1?(console['error'](_0x31623b(0x305)),console[_0x31623b(0x25a)](_0x31623b(0x2e4)),0x1):(console[_0x31623b(0x25a)](_0x31623b(0x2fd)),console[_0x31623b(0x25a)](_0x31623b(0x1a2)),0x1);}_0x286902[_0x31623b(0x329)]&&(console[_0x31623b(0x25a)](_0x31623b(0x29c)+_0x324de4),console['error'](_0x31623b(0x203)+_0x1a9011));if(!_0x286902[_0x31623b(0x289)]){if(!isInteractive())return console['error'](a54_0x4527ac[_0x31623b(0x232)](_0x31623b(0x26d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x31623b(0x25a)](a54_0x4527ac[_0x31623b(0x29e)](_0x31623b(0x280))),0x1;const _0x26210e=await confirmKey(_0x31623b(0x1bc)+_0x1a9011+'\x27\x20from\x20project\x20\x27'+_0x324de4+'\x27?');if(!_0x26210e)return console[_0x31623b(0x25a)](a54_0x4527ac[_0x31623b(0x219)](_0x31623b(0x2ca))),0x1;}const _0x4a2a0d=await withSpinner(_0x31623b(0x255),()=>_0x13a478['workflow'][_0x31623b(0x27f)](_0x324de4,_0x1a9011),{'verbose':_0x286902['verbose']}),_0x4c38af=_0x4a2a0d[_0x31623b(0x18d)];return console[_0x31623b(0x25a)](_0x31623b(0x2e6)+_0x4c38af['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x4c38af['projectName']+'\x27'),(_0x286902['json']||_0x286902['jsonl'])&&await handleSingleObjectOutput(_0x4c38af,_0x286902),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(_0x5ea308){const _0x113bf8=a54_0x132d15,_0x12d549=Math['floor'](_0x5ea308/0x3e8),_0x15466f=Math[_0x113bf8(0x223)](_0x12d549/0x3c),_0x29ee07=Math[_0x113bf8(0x223)](_0x15466f/0x3c),_0x5143df=Math['floor'](_0x29ee07/0x18);if(_0x5143df>0x0){const _0x35e9cb=_0x29ee07%0x18;return _0x35e9cb>0x0?_0x5143df+'d\x20'+_0x35e9cb+'h':_0x5143df+'d';}else{if(_0x29ee07>0x0){const _0x27e5c7=_0x15466f%0x3c;return _0x27e5c7>0x0?_0x29ee07+'h\x20'+_0x27e5c7+'m':_0x29ee07+'h';}else{if(_0x15466f>0x0){const _0x1e0a40=_0x12d549%0x3c;return _0x1e0a40>0x0?_0x15466f+'m\x20'+_0x1e0a40+'s':_0x15466f+'m';}else return _0x12d549+'s';}}}function formatTimestamp(_0x50b88c,_0x5646de){const _0x3c028e=a54_0x132d15,_0x2d405e=new Date(_0x50b88c),_0x289981=String(_0x2d405e[_0x3c028e(0x226)]())[_0x3c028e(0x26f)](0x2,'0'),_0x21fc58=String(_0x2d405e[_0x3c028e(0x1fd)]())[_0x3c028e(0x26f)](0x2,'0'),_0x2a4c7f=_0x289981+':'+_0x21fc58,_0x1fb52e=_0x2d405e[_0x3c028e(0x1e1)]()===_0x5646de[_0x3c028e(0x1e1)]()&&_0x2d405e[_0x3c028e(0x333)]()===_0x5646de[_0x3c028e(0x333)]()&&_0x2d405e[_0x3c028e(0x18b)]()===_0x5646de[_0x3c028e(0x18b)]();if(_0x1fb52e)return _0x2a4c7f;else{const _0x3db32b=String(_0x2d405e[_0x3c028e(0x333)]()+0x1)[_0x3c028e(0x26f)](0x2,'0'),_0x5de9c5=String(_0x2d405e[_0x3c028e(0x18b)]())[_0x3c028e(0x26f)](0x2,'0');return _0x3db32b+'-'+_0x5de9c5+'\x20'+_0x2a4c7f;}}function formatDate(_0x527e59){const _0x475b99=a54_0x132d15,_0x9097f6=_0x527e59[_0x475b99(0x1e1)](),_0x341103=String(_0x527e59[_0x475b99(0x333)]()+0x1)[_0x475b99(0x26f)](0x2,'0'),_0x93e3b=String(_0x527e59[_0x475b99(0x18b)]())[_0x475b99(0x26f)](0x2,'0');return _0x9097f6+'-'+_0x341103+'-'+_0x93e3b;}function getTaskStateIcon(_0x3ac98d){const _0x5148cf={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5148cf[_0x3ac98d]||'⚪';}function getBarChar(_0x42fb21){const _0x4e978c=a54_0x132d15;return _0x42fb21==='error'||_0x42fb21===_0x4e978c(0x206)?'×':'─';}function getBarColor(_0x3bae98){const _0x102ce=a54_0x132d15,_0xfa78c7={'success':a54_0x4527ac['green'],'error':a54_0x4527ac[_0x102ce(0x232)],'group_error':a54_0x4527ac['red'],'running':a54_0x4527ac[_0x102ce(0x30f)],'blocked':a54_0x4527ac['yellow'],'planned':a54_0x4527ac['dim'],'canceling':a54_0x4527ac[_0x102ce(0x219)]};return _0xfa78c7[_0x3bae98]||a54_0x4527ac[_0x102ce(0x292)];}function parseTaskName(_0x4585f0){const _0x30028c=a54_0x132d15;let _0x1f0ce7=_0x4585f0[_0x30028c(0x18a)](/^\++/,'');const _0x5ac23b=_0x1f0ce7[_0x30028c(0x2ff)]('+'),_0x3560ed=_0x5ac23b['length']>0x1?_0x5ac23b[_0x30028c(0x303)]-0x2:0x0,_0x48d463=_0x5ac23b[_0x5ac23b[_0x30028c(0x303)]-0x1]||_0x1f0ce7;return{'level':_0x3560ed,'name':'+'+_0x48d463};}function truncateTaskName(_0x11b57b,_0x14aa5b){const _0x24b595=a54_0x132d15,_0x30de86=stringWidth(_0x11b57b);if(_0x30de86<=_0x14aa5b)return _0x11b57b;let _0x5a7d43=_0x11b57b;while(stringWidth(_0x5a7d43+'…')>_0x14aa5b&&_0x5a7d43['length']>0x0){_0x5a7d43=_0x5a7d43[_0x24b595(0x1e3)](0x0,-0x1);}return _0x5a7d43+'…';}function calculateTimeScale(_0x376bed,_0x47bff9){const _0x5f18c0=a54_0x132d15;return{'startTime':_0x376bed[_0x5f18c0(0x2e8)],'endTime':_0x376bed['end'],'durationMs':_0x376bed[_0x5f18c0(0x21f)],'msPerChar':_0x376bed[_0x5f18c0(0x21f)]/_0x47bff9};}function timeToPosition(_0x129f11,_0x4483e2,_0x2c68ee){const _0x5dfdac=a54_0x132d15,_0x4851d5=_0x129f11-_0x4483e2['startTime'],_0x5b02a6=Math[_0x5dfdac(0x223)](_0x4851d5/_0x4483e2[_0x5dfdac(0x2d2)]);return Math[_0x5dfdac(0x23b)](0x0,Math[_0x5dfdac(0x19b)](_0x5b02a6,_0x2c68ee));}function renderTimeAxis(_0x2b39fa,_0x47e5a5){const _0x2f5fbc=a54_0x132d15,_0x359881=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x2f5fbc(0x223)](_0x47e5a5/TIMELINE_CONFIG[_0x2f5fbc(0x30c)]))),_0x43ad17=_0x2b39fa[_0x2f5fbc(0x195)]/(_0x359881-0x1),_0x31b812=new Date(_0x2b39fa[_0x2f5fbc(0x2af)]),_0x32f3a6=[];for(let _0x3ec2a0=0x0;_0x3ec2a0<_0x359881;_0x3ec2a0++){const _0x316a15=_0x2b39fa[_0x2f5fbc(0x2af)]+_0x3ec2a0*_0x43ad17,_0xed55e0=timeToPosition(_0x316a15,_0x2b39fa,_0x47e5a5),_0x312802=formatTimestamp(_0x316a15,_0x31b812);_0x32f3a6['push']({'pos':_0xed55e0,'text':_0x312802});}const _0x3a1e65=new Array(_0x47e5a5)[_0x2f5fbc(0x205)]('\x20');let _0x50884e=-0x1;for(const {pos:_0x4cddbb,text:_0x6874b4}of _0x32f3a6){let _0x55982b=Math[_0x2f5fbc(0x23b)](0x0,_0x4cddbb-Math[_0x2f5fbc(0x223)](_0x6874b4['length']/0x2));_0x55982b<=_0x50884e+TIMELINE_CONFIG[_0x2f5fbc(0x310)]&&(_0x55982b=_0x50884e+TIMELINE_CONFIG[_0x2f5fbc(0x310)]+0x1);_0x55982b+_0x6874b4[_0x2f5fbc(0x303)]>_0x47e5a5&&(_0x55982b=_0x47e5a5-_0x6874b4[_0x2f5fbc(0x303)]);if(_0x55982b>=0x0&&_0x55982b+_0x6874b4[_0x2f5fbc(0x303)]<=_0x47e5a5&&_0x55982b>_0x50884e){for(let _0x5091d1=0x0;_0x5091d1<_0x6874b4[_0x2f5fbc(0x303)];_0x5091d1++){_0x3a1e65[_0x55982b+_0x5091d1]=_0x6874b4[_0x5091d1];}_0x50884e=_0x55982b+_0x6874b4[_0x2f5fbc(0x303)]-0x1;}}return _0x3a1e65[_0x2f5fbc(0x1a7)]('');}function renderTaskRow(_0x36514a,_0x4f95ad,_0x3073af,_0x3eacaa){const _0x4ca274=a54_0x132d15,{level:_0x30ef3f,name:_0x5d7f62}=parseTaskName(_0x36514a[_0x4ca274(0x2b2)]),_0x1c4fd8='\x20'[_0x4ca274(0x328)](_0x30ef3f),_0x2cea0b=_0x36514a[_0x4ca274(0x213)]?'('+formatElapsed(_0x36514a[_0x4ca274(0x213)]['duration'])+')':'',_0x3be659=stringWidth(_0x2cea0b),_0x2a5f60=_0x30ef3f*0x1,_0x2326a0=_0x3eacaa-_0x2a5f60-_0x3be659-0x1,_0x326f36=truncateTaskName(_0x5d7f62,_0x2326a0),_0x35190a=_0x1c4fd8+_0x326f36,_0x1899c9=stringWidth(_0x35190a),_0x40ffa8=_0x3eacaa-_0x1899c9-_0x3be659,_0x391c6e=_0x35190a+'\x20'['repeat'](Math[_0x4ca274(0x23b)](0x1,_0x40ffa8))+a54_0x4527ac['dim'](_0x2cea0b),_0x1022e6=getTaskStateIcon(_0x36514a[_0x4ca274(0x1a9)]),_0x2bd626=new Array(_0x3073af)[_0x4ca274(0x205)]('\x20');if(_0x36514a[_0x4ca274(0x213)]){const _0xa1d3d3=timeToPosition(_0x36514a['window']['start'],_0x4f95ad,_0x3073af),_0x110b4d=timeToPosition(_0x36514a[_0x4ca274(0x213)][_0x4ca274(0x1a3)],_0x4f95ad,_0x3073af),_0x56fa93=getBarChar(_0x36514a[_0x4ca274(0x1a9)]),_0x5875dd=Math[_0x4ca274(0x23b)](_0xa1d3d3+0x1,_0x110b4d);for(let _0x1c661f=_0xa1d3d3;_0x1c661f<Math[_0x4ca274(0x19b)](_0x5875dd,_0x3073af);_0x1c661f++){_0x2bd626[_0x1c661f]=_0x56fa93;}}const _0x3cb762=getBarColor(_0x36514a[_0x4ca274(0x1a9)]),_0x1582ba=_0x2bd626[_0x4ca274(0x25d)](_0x32ff05=>_0x32ff05==='\x20'?'\x20':_0x3cb762(_0x32ff05))['join']('');return _0x1022e6+'\x20'+_0x391c6e+'│'+_0x1582ba+'│';}function calculateStats(_0x1a0de7){const _0x53fa24=a54_0x132d15,_0x5213f0={'total':_0x1a0de7['length'],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x3db039 of _0x1a0de7){if(_0x3db039['state']===_0x53fa24(0x236))_0x5213f0[_0x53fa24(0x236)]++;else{if(_0x3db039[_0x53fa24(0x1a9)]===_0x53fa24(0x25a)||_0x3db039['state']===_0x53fa24(0x206))_0x5213f0[_0x53fa24(0x25a)]++;else _0x3db039['state']==='running'?_0x5213f0[_0x53fa24(0x297)]++:_0x5213f0[_0x53fa24(0x2a2)]++;}}return _0x5213f0;}function formatStats(_0x53be7b){const _0x553c3e=a54_0x132d15;return['Total:\x20'+_0x53be7b[_0x553c3e(0x2dd)],'✅\x20'+_0x53be7b['success'],'❌\x20'+_0x53be7b[_0x553c3e(0x25a)],_0x553c3e(0x325)+_0x53be7b['running'],'⏳\x20'+_0x53be7b[_0x553c3e(0x2a2)]][_0x553c3e(0x1a7)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{['name']=a54_0x132d15(0x2d1);[a54_0x132d15(0x31f)]=a54_0x132d15(0x250);async['execute'](_0x3e5def){const _0x1ac568=a54_0x132d15,{options:_0x3ad147,args:_0x46aa3f,tdx:_0x4833ab}=_0x3e5def;let _0x21dc6f,_0x5a7859,_0x3c7eb8=![];if(_0x46aa3f[0x0]){if(_0x46aa3f[0x0]['includes']('.')){const _0x205696=this[_0x1ac568(0x1a8)](_0x46aa3f,_0x3ad147);if(!_0x205696)return 0x1;_0x21dc6f=_0x205696[_0x1ac568(0x233)],_0x5a7859=_0x205696[_0x1ac568(0x19e)];}else{_0x5a7859=_0x46aa3f[0x0],_0x21dc6f=_0x3ad147[_0x1ac568(0x28c)];if(!_0x21dc6f)return console[_0x1ac568(0x25a)](a54_0x4527ac['red'](_0x1ac568(0x1de)),_0x1ac568(0x1d6)),0x1;_0x3c7eb8=!![];}}else{const _0x260e41=this[_0x1ac568(0x1a8)](_0x46aa3f,_0x3ad147);if(!_0x260e41)return 0x1;_0x21dc6f=_0x260e41[_0x1ac568(0x233)],_0x5a7859=_0x260e41[_0x1ac568(0x19e)];}if(_0x3ad147[_0x1ac568(0x329)]){if(_0x21dc6f&&_0x5a7859)console[_0x1ac568(0x25a)](_0x1ac568(0x1c3)+_0x21dc6f+'.'+_0x5a7859);else _0x21dc6f&&console[_0x1ac568(0x25a)](_0x1ac568(0x270)+_0x21dc6f);}const _0x55432d=_0x3ad147[_0x1ac568(0x28b)],_0x55889b=_0x3ad147[_0x1ac568(0x202)];if(_0x55432d){_0x55889b&&console['error'](a54_0x4527ac[_0x1ac568(0x219)]('Warning:'),_0x1ac568(0x23e));const _0x1b30d3=_0x3ad147[_0x1ac568(0x317)];return _0x1b30d3?await this[_0x1ac568(0x319)](_0x3e5def,_0x55432d):await this[_0x1ac568(0x1c8)](_0x3e5def,_0x55432d,_0x3ad147),0x0;}if(_0x55889b){const _0x19ccbe=await withSpinner(_0x1ac568(0x182),()=>_0x4833ab[_0x1ac568(0x199)][_0x1ac568(0x194)]({'projectName':_0x21dc6f,'workflowName':_0x5a7859,'limit':0x64}),{'verbose':_0x3ad147['verbose']}),_0x47d3b4=_0x19ccbe[_0x1ac568(0x18d)][_0x1ac568(0x20b)](_0x5d5c8e=>_0x5d5c8e['id']===_0x55889b);if(!_0x47d3b4)return console[_0x1ac568(0x25a)](a54_0x4527ac[_0x1ac568(0x232)](_0x1ac568(0x1de)),'Session\x20not\x20found:\x20'+_0x55889b),0x1;if(!_0x47d3b4[_0x1ac568(0x2fc)]?.['id'])return console[_0x1ac568(0x25a)](a54_0x4527ac[_0x1ac568(0x232)](_0x1ac568(0x1de)),_0x1ac568(0x177)+_0x55889b+_0x1ac568(0x249)),0x1;const _0xc5e01=_0x47d3b4[_0x1ac568(0x2fc)]['id'];_0x3ad147['verbose']&&console['error'](_0x1ac568(0x1a6)+_0xc5e01+'\x20from\x20session\x20'+_0x55889b);const _0x1d4f0b=_0x3ad147[_0x1ac568(0x317)];return _0x1d4f0b?await this[_0x1ac568(0x319)](_0x3e5def,_0xc5e01):await this[_0x1ac568(0x1c8)](_0x3e5def,_0xc5e01,_0x3ad147),0x0;}const _0x1187be=await withSpinner(_0x1ac568(0x322),()=>_0x4833ab[_0x1ac568(0x199)][_0x1ac568(0x194)]({'projectName':_0x21dc6f,'workflowName':_0x5a7859,'limit':_0x3ad147['limit']||0x32}),{'verbose':_0x3ad147[_0x1ac568(0x329)]}),_0x42b46f=_0x1187be['data'];if(_0x42b46f[_0x1ac568(0x303)]===0x0){if(_0x21dc6f&&_0x5a7859)console[_0x1ac568(0x25a)](_0x1ac568(0x2a9)+_0x21dc6f+'.'+_0x5a7859);else _0x21dc6f?console[_0x1ac568(0x25a)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x21dc6f):(console[_0x1ac568(0x25a)](_0x1ac568(0x28a)),console[_0x1ac568(0x25a)](a54_0x4527ac[_0x1ac568(0x29e)](_0x1ac568(0x207))));return 0x0;}_0x42b46f[_0x1ac568(0x26b)]((_0x1ba42d,_0x110ba2)=>{const _0x37ce2a=_0x1ac568,_0x32e7e3=_0x1ba42d[_0x37ce2a(0x193)]||'',_0x3b17e3=_0x110ba2[_0x37ce2a(0x193)]||'';return _0x3b17e3[_0x37ce2a(0x24a)](_0x32e7e3);});if(_0x3ad147[_0x1ac568(0x1f7)]||_0x3ad147[_0x1ac568(0x2f5)])return await handleSDKOutput(_0x42b46f,_0x3ad147),0x0;let _0x5d8cc7;if(_0x3c7eb8){const _0x2bbc4f=_0x42b46f[0x0];if(!_0x2bbc4f['lastAttempt']?.['id'])return console[_0x1ac568(0x25a)](_0x1ac568(0x1c6)),0x0;_0x5d8cc7=_0x2bbc4f[_0x1ac568(0x2fc)]['id'],_0x3ad147[_0x1ac568(0x329)]&&console[_0x1ac568(0x25a)](_0x1ac568(0x2d0)+_0x2bbc4f[_0x1ac568(0x193)]);}else{const _0xec924d=_0x42b46f[_0x1ac568(0x25d)](_0x41df3a=>{const _0x5b611c=_0x1ac568,_0x2b74ae=getAttemptStatusDisplay(_0x41df3a[_0x5b611c(0x2fc)]);return{'title':_0x41df3a[_0x5b611c(0x296)]?.[_0x5b611c(0x2b2)]+'.'+_0x41df3a[_0x5b611c(0x199)]?.[_0x5b611c(0x2b2)]+'\x20-\x20'+_0x41df3a['sessionTime']+'\x20'+_0x2b74ae[_0x5b611c(0x190)],'value':_0x41df3a[_0x5b611c(0x2fc)]?.['id']||'','description':_0x2b74ae[_0x5b611c(0x294)]};}),_0x364408=await a54_0x3fb545({'type':_0x1ac568(0x275),'name':_0x1ac568(0x28b),'message':_0x1ac568(0x17e),'choices':_0xec924d[_0x1ac568(0x262)](_0x481e19=>_0x481e19[_0x1ac568(0x2c1)]!=='')});if(!_0x364408[_0x1ac568(0x28b)])return 0x0;_0x5d8cc7=_0x364408[_0x1ac568(0x28b)];}const _0x1f850f=_0x3ad147[_0x1ac568(0x317)];return _0x1f850f?await this[_0x1ac568(0x319)](_0x3e5def,_0x5d8cc7):await this[_0x1ac568(0x1c8)](_0x3e5def,_0x5d8cc7,_0x3ad147),0x0;}async[a54_0x132d15(0x1c8)](_0x4c990b,_0x1e01bc,_0x4d734d){const _0x2b7b3c=a54_0x132d15,{tdx:_0x34dff3}=_0x4c990b;let _0x32285b,_0x1754c1;try{[_0x32285b,_0x1754c1]=await Promise[_0x2b7b3c(0x314)]([_0x34dff3[_0x2b7b3c(0x199)][_0x2b7b3c(0x1f5)](_0x1e01bc),_0x34dff3[_0x2b7b3c(0x199)][_0x2b7b3c(0x1c0)](_0x1e01bc,![])]);}catch(_0x5dc1b2){console['error'](a54_0x4527ac[_0x2b7b3c(0x232)]('Failed\x20to\x20fetch\x20attempt\x20data'));_0x4d734d['verbose']&&console['error'](_0x5dc1b2);throw _0x5dc1b2;}if(_0x4d734d[_0x2b7b3c(0x1f7)]||_0x4d734d[_0x2b7b3c(0x2f5)]){const _0x5a2732=this[_0x2b7b3c(0x18e)](_0x32285b,_0x1754c1);await handleSDKOutput([_0x5a2732],_0x4d734d);return;}const _0x4918f8=_0x34dff3[_0x2b7b3c(0x327)][_0x2b7b3c(0x227)],_0x326e80=this[_0x2b7b3c(0x2ef)](_0x32285b,_0x1754c1,_0x4918f8);console[_0x2b7b3c(0x17b)](_0x326e80);}async[a54_0x132d15(0x319)](_0x8697fe,_0x2179d7){const _0xe5a5ce=a54_0x132d15,{tdx:_0x4bbf0a}=_0x8697fe,_0x484a44=TIMELINE_CONFIG['POLL_INTERVAL_MS'],_0x351b62=TIMELINE_CONFIG[_0xe5a5ce(0x31c)];let _0x108698=0x0;while(_0x108698<_0x351b62){process[_0xe5a5ce(0x2f4)][_0xe5a5ce(0x1a0)]&&process[_0xe5a5ce(0x2f4)][_0xe5a5ce(0x174)]('\x1bc');let _0x5c56df,_0x178235;try{[_0x5c56df,_0x178235]=await Promise['all']([_0x4bbf0a[_0xe5a5ce(0x199)]['attempt'](_0x2179d7),_0x4bbf0a[_0xe5a5ce(0x199)][_0xe5a5ce(0x1c0)](_0x2179d7,![])]);}catch(_0x4ac589){console['error'](a54_0x4527ac[_0xe5a5ce(0x232)](_0xe5a5ce(0x259)));_0x108698>0x0&&console[_0xe5a5ce(0x25a)](a54_0x4527ac[_0xe5a5ce(0x29e)](_0xe5a5ce(0x27b)+_0x108698));throw _0x4ac589;}const _0x3de27e=_0x4bbf0a['context'][_0xe5a5ce(0x227)],_0x517f4a=this['renderTimeline'](_0x5c56df,_0x178235,_0x3de27e);console[_0xe5a5ce(0x17b)](_0x517f4a);const _0xf0b910=_0x5c56df[_0xe5a5ce(0x290)]&&_0x178235[_0xe5a5ce(0x2e3)](_0xc41cb1=>_0xc41cb1[_0xe5a5ce(0x1a9)]!==_0xe5a5ce(0x297)&&_0xc41cb1[_0xe5a5ce(0x1a9)]!==_0xe5a5ce(0x300));if(_0xf0b910){console[_0xe5a5ce(0x25a)](a54_0x4527ac[_0xe5a5ce(0x267)](_0xe5a5ce(0x2f6)));break;}console[_0xe5a5ce(0x25a)](a54_0x4527ac[_0xe5a5ce(0x29e)](_0xe5a5ce(0x186)+_0x108698*0x2+'s\x20elapsed,\x20Ctrl+C\x20to\x20exit)')),await new Promise(_0x70157f=>setTimeout(_0x70157f,_0x484a44)),_0x108698++;}_0x108698>=_0x351b62&&console[_0xe5a5ce(0x25a)](a54_0x4527ac[_0xe5a5ce(0x219)](_0xe5a5ce(0x209)));}[a54_0x132d15(0x2ef)](_0x11c8fb,_0x14a2d8,_0x3af556){const _0x1d754b=a54_0x132d15,_0x413466=[],_0x30bdf6=TIMELINE_CONFIG[_0x1d754b(0x1cf)],_0x7dd409=0x5,_0x48e85a=process['stdout']['columns']||0x78,_0x144017=_0x48e85a-_0x30bdf6-_0x7dd409,_0x545b1e=Math[_0x1d754b(0x23b)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math[_0x1d754b(0x19b)](_0x144017,TIMELINE_CONFIG[_0x1d754b(0x1a5)])),_0x1f7cb8=new Date(_0x11c8fb[_0x1d754b(0x2a1)])['getTime'](),_0x58ebc3=_0x11c8fb['finishedAt']?new Date(_0x11c8fb[_0x1d754b(0x295)])['getTime']():Date['now'](),_0x1be25e={'start':_0x1f7cb8,'end':_0x58ebc3,'duration':_0x58ebc3-_0x1f7cb8},_0x1d5605=new Map(),_0x270eaf=[];for(const _0x2aa06b of _0x14a2d8){if(_0x2aa06b['startedAt']){const _0x55fea3=new Date(_0x2aa06b[_0x1d754b(0x29a)])['getTime'](),_0x446d83=_0x2aa06b[_0x1d754b(0x268)]?new Date(_0x2aa06b[_0x1d754b(0x268)])[_0x1d754b(0x192)]():Date[_0x1d754b(0x256)](),_0x382ed0={'start':_0x55fea3,'end':_0x446d83,'duration':_0x446d83-_0x55fea3};_0x1d5605[_0x1d754b(0x228)](_0x2aa06b['id'],_0x382ed0),_0x270eaf[_0x1d754b(0x218)]({'name':_0x2aa06b[_0x1d754b(0x22d)],'state':_0x2aa06b[_0x1d754b(0x1a9)]||'unknown','window':_0x382ed0});}else _0x270eaf[_0x1d754b(0x218)]({'name':_0x2aa06b[_0x1d754b(0x22d)],'state':_0x2aa06b[_0x1d754b(0x1a9)]||'planned','window':undefined});}_0x270eaf[_0x1d754b(0x26b)]((_0x2b9875,_0x5b1f4e)=>{const _0x430ee9=_0x1d754b;if(!_0x2b9875['window'])return 0x1;if(!_0x5b1f4e['window'])return-0x1;return _0x2b9875[_0x430ee9(0x213)]['start']-_0x5b1f4e[_0x430ee9(0x213)]['start'];});const _0x3d227e=_0x270eaf['length'],_0x3d5902=_0x3d227e>TIMELINE_CONFIG[_0x1d754b(0x201)];_0x3d5902&&_0x270eaf[_0x1d754b(0x306)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x37d32d=calculateTimeScale(_0x1be25e,_0x545b1e),_0x18aa82=_0x11c8fb[_0x1d754b(0x290)]?_0x11c8fb['success']?a54_0x4527ac[_0x1d754b(0x267)]('success'):a54_0x4527ac[_0x1d754b(0x232)](_0x1d754b(0x25a)):a54_0x4527ac[_0x1d754b(0x30f)](_0x1d754b(0x297)),_0x41a4ec=_0x11c8fb[_0x1d754b(0x296)]?.['id'],_0x77fe00=_0x11c8fb[_0x1d754b(0x202)];let _0x1540e8;if(_0x41a4ec&&_0x77fe00){const _0x33ae0c=getWorkflowAttemptUrl(_0x3af556,_0x41a4ec,_0x77fe00,_0x11c8fb['id']);_0x1540e8=hyperlink(a54_0x4527ac[_0x1d754b(0x29e)](_0x11c8fb['id']),_0x33ae0c);}else _0x1540e8=a54_0x4527ac[_0x1d754b(0x29e)](_0x11c8fb['id']);_0x413466['push'](_0x1d754b(0x284)+_0x1540e8+_0x1d754b(0x2ea)+_0x18aa82+_0x1d754b(0x2ea)+formatElapsed(_0x1be25e[_0x1d754b(0x21f)]));if(_0x270eaf[_0x1d754b(0x303)]>0x0){const _0x4d0071=renderTimeAxis(_0x37d32d,_0x545b1e),_0xacd79f=new Date(_0x1be25e[_0x1d754b(0x2e8)]),_0x5144d4=formatDate(_0xacd79f),_0x4803f4=TIMELINE_CONFIG[_0x1d754b(0x1f0)]+TIMELINE_CONFIG[_0x1d754b(0x1f1)]+_0x30bdf6,_0x29dc3c=_0x5144d4['padStart'](_0x4803f4),_0x59aaae=a54_0x4527ac[_0x1d754b(0x29e)](_0x29dc3c);_0x413466['push'](_0x59aaae+'\x20'+_0x4d0071);for(const _0x4d1503 of _0x270eaf){_0x413466[_0x1d754b(0x218)](renderTaskRow(_0x4d1503,_0x37d32d,_0x545b1e,_0x30bdf6));}const _0xa14d5b=calculateStats(_0x270eaf);_0x413466[_0x1d754b(0x218)](formatStats(_0xa14d5b)),_0x3d5902&&_0x413466[_0x1d754b(0x218)](a54_0x4527ac[_0x1d754b(0x219)](_0x1d754b(0x253)+TIMELINE_CONFIG[_0x1d754b(0x201)]+_0x1d754b(0x241)+_0x3d227e+_0x1d754b(0x1b4))),_0x413466['push'](''),_0x413466[_0x1d754b(0x218)](a54_0x4527ac[_0x1d754b(0x29e)](_0x1d754b(0x1ec))+('tdx\x20wf\x20attempt\x20'+_0x11c8fb['id']+'\x20logs')+a54_0x4527ac[_0x1d754b(0x29e)](_0x1d754b(0x2dc)));}else _0x413466['push'](_0x1d754b(0x30d));return _0x413466[_0x1d754b(0x1a7)]('\x0a');}[a54_0x132d15(0x18e)](_0x16b70d,_0x18f198){const _0x269fc3=a54_0x132d15,_0x176ec2=new Date(_0x16b70d['createdAt'])[_0x269fc3(0x192)](),_0x44afc5=_0x16b70d[_0x269fc3(0x295)]?new Date(_0x16b70d[_0x269fc3(0x295)])[_0x269fc3(0x192)]():Date[_0x269fc3(0x256)](),_0x3bbe1a=_0x44afc5-_0x176ec2,_0x4de2bf=[];for(const _0x5d11d7 of _0x18f198){if(_0x5d11d7[_0x269fc3(0x29a)]){const _0x56b234=new Date(_0x5d11d7[_0x269fc3(0x29a)])[_0x269fc3(0x192)](),_0x23ac50=_0x5d11d7['updatedAt']?new Date(_0x5d11d7[_0x269fc3(0x268)])[_0x269fc3(0x192)]():Date[_0x269fc3(0x256)]();_0x4de2bf[_0x269fc3(0x218)]({'name':_0x5d11d7['fullName'],'state':_0x5d11d7['state']||_0x269fc3(0x225),'window':{'start':_0x56b234,'end':_0x23ac50,'duration':_0x23ac50-_0x56b234}});}else _0x4de2bf['push']({'name':_0x5d11d7['fullName'],'state':_0x5d11d7[_0x269fc3(0x1a9)]||_0x269fc3(0x300),'window':undefined});}const _0x116429=calculateStats(_0x4de2bf);return{'attempt':{'id':_0x16b70d['id'],'status':_0x16b70d[_0x269fc3(0x290)]?_0x16b70d[_0x269fc3(0x236)]?_0x269fc3(0x236):'error':_0x269fc3(0x297),'createdAt':_0x16b70d[_0x269fc3(0x2a1)],'finishedAt':_0x16b70d[_0x269fc3(0x295)],'duration_ms':_0x3bbe1a},'tasks':_0x4de2bf[_0x269fc3(0x25d)](_0x2848d3=>({'name':_0x2848d3[_0x269fc3(0x2b2)],'state':_0x2848d3[_0x269fc3(0x1a9)],'startedAt':_0x2848d3[_0x269fc3(0x213)]?new Date(_0x2848d3[_0x269fc3(0x213)][_0x269fc3(0x2e8)])[_0x269fc3(0x246)]():null,'updatedAt':_0x2848d3[_0x269fc3(0x213)]?new Date(_0x2848d3['window'][_0x269fc3(0x1a3)])['toISOString']():null,'duration_ms':_0x2848d3[_0x269fc3(0x213)]?.[_0x269fc3(0x21f)]||null})),'stats':_0x116429};}}export class WorkflowSchedulesCommand extends BaseCommand{['name']=a54_0x132d15(0x1dd);[a54_0x132d15(0x31f)]=a54_0x132d15(0x17a);async[a54_0x132d15(0x1be)](_0x304d97){const _0x34e8bf=a54_0x132d15,{options:_0x1b0343,tdx:_0x56b83c}=_0x304d97,_0x5a174b=await withSpinner(_0x34e8bf(0x21a),()=>_0x56b83c[_0x34e8bf(0x199)]['listSchedules'](),{'verbose':_0x1b0343['verbose']}),_0x10e05e=_0x5a174b['data'];console['error'](_0x34e8bf(0x25f)+_0x10e05e[_0x34e8bf(0x303)]+'\x20schedule'+(_0x10e05e[_0x34e8bf(0x303)]!==0x1?'s':''));if(isStructuredFormat(_0x1b0343))await handleSDKOutput(_0x10e05e,_0x1b0343);else{if(_0x10e05e[_0x34e8bf(0x303)]===0x0)console[_0x34e8bf(0x17b)](_0x34e8bf(0x2c4));else for(const _0x2a051a of _0x10e05e){const _0xa5b1b4=_0x2a051a[_0x34e8bf(0x1b3)]?a54_0x4527ac['yellow']('\x20(disabled)'):'',_0x344ab1=_0x2a051a[_0x34e8bf(0x296)]?.[_0x34e8bf(0x2b2)]?a54_0x4527ac['dim']('\x20['+_0x2a051a[_0x34e8bf(0x296)][_0x34e8bf(0x2b2)]+']'):'',_0x1c0d6b=_0x2a051a[_0x34e8bf(0x265)]?a54_0x4527ac['dim']('\x20next:\x20'+new Date(_0x2a051a[_0x34e8bf(0x265)])['toLocaleString']()):'';console[_0x34e8bf(0x17b)](_0x34e8bf(0x1ae)+_0x2a051a['id']+'\x20'+(_0x2a051a['workflow']?.[_0x34e8bf(0x2b2)]||_0x34e8bf(0x318))+_0x344ab1+_0xa5b1b4+_0x1c0d6b);}}return 0x0;}}function a54_0x10ad(){const _0x5740eb=['Set\x20default\x20workflow\x20project\x20for\x20this\x20session','\x0aClone\x20\x22','toLocaleString','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','applyPullProject','write','logs','✔\x20Retry\x20started','Session\x20','Output\x20directory:\x20','Revision:\x20','List\x20workflow\x20schedules','log','\x0a✔\x20Already\x20up\x20to\x20date','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','Select\x20a\x20session\x20to\x20view\x20timeline:','\x20disabled\x20(','startsWith','\x20\x20Attempt\x20ID:\x20','Loading\x20session...','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Listing\x20workflow\x20projects...','resolveProject','\x0aPolling...\x20(','title','fileSize','\x20\x20Target:\x20','replace','getDate','Fetching\x20log\x20files...','data','buildTimelineData','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','icon','\x20workflow','getTime','sessionTime','sessions','durationMs','Killing\x20attempt...','\x20attempt','showWorkflowConsoleUrl','workflow','No\x20sessions\x20with\x20timing\x20information','min','Pulling\x20project\x20','---\x20','workflowName','\x22\x20already\x20exists\x20(ID:\x20','isTTY','Pushing\x20project...','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','end','displayLine','MAX_TIMELINE_WIDTH','Using\x20attempt\x20','join','parseProjectWorkflowPattern','state','run','workflow:secrets:delete','Deleting\x20project\x20','\x20\x20Console:\x20','📅\x20#','summary','param','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x22\x20to\x20new\x20project\x20\x22','disabledAt','\x20tasks','targetExists','Error:\x20At\x20least\x20one\x20KEY=VALUE\x20is\x20required','1309660EjJjTr','\x20\x20Project\x20ID:\x20','\x20new','Starting\x20workflow\x20run...','from','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','execute','\x20\x20Session\x20context\x20set\x20to:\x20','tasks','✔\x20Downloaded\x20','896861BnQXZr','Filter:\x20','executePushProject','Pushing\x20workflow\x20project...','Latest\x20session\x20has\x20no\x20attempt','workflows','renderSingleTimeline','Project\x20filter:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','workflow:logs','\x20modified','workflow:schedule:enable','3GpLyIM','TASK_NAME_WIDTH','Enabling\x20schedule\x20#','values','Secrets\x20to\x20set:\x20','\x20secret','limit','803541WWqbYm','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Select\x20a\x20workflow\x20to\x20run','renderSessionsTimeline','Resolving\x20project\x20\x27','workflow:pull','\x20secrets...','Usage:\x20tdx\x20wf\x20use\x20<project>','workflow:schedules','Error:','hasChanges','No\x20workflow\x20tdx.json\x20found','getFullYear','No\x20attempts\x20found\x20for:\x20','slice','workflow:push','Setting\x20','✔\x20Workflow\x20project\x20context\x20cleared.','\x20deleted','\x20secrets\x20set\x20for\x20project\x20\x27','metadata','utf-8','Usage:\x20tdx\x20wf\x20schedule\x20disable\x20<id>','💡\x20Tip:\x20Use\x20','\x0aDry\x20run\x20-\x20nothing\x20pushed','Listing\x20secrets...','2uydZXB','ICON_WIDTH','ICON_SPACING','✔\x20Schedule\x20#','workflow:delete','16920rGvKRv','attempt','\x20(use\x20--limit\x20to\x20show\x20more)','json','✔\x20Deleted\x20project\x20','Writing\x20files...','trim','enableSchedule','session_id','getMinutes','✔\x20Pull\x20complete','Getting\x20attempt\x20tasks...','newProjectName','MAX_TASKS_DISPLAY','sessionId','Key:\x20','.\x20Expected\x20format:\x20KEY=VALUE','fill','group_error','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','Error:\x20','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','find','unchanged','No\x20projects\x20match\x20pattern:\x20','Retrying\x20session...','Task\x20name:\x20','new','List\x20workflow\x20execution\x20sessions','setSecrets','window','workflow:projects','Downloading\x20logs...','relative','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','push','yellow','Listing\x20schedules...','/app/workflows/','reason','Analyzing\x20changes...','No\x20workflow\x20projects\x20found','duration','format','Retry\x20a\x20session\x20or\x20attempt','Parameters:\x20','floor','projectId','unknown','getHours','site','set','match','Project\x20name:\x20','toLowerCase','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','fullName','Force:\x20yes','/sessions/','Setting\x20secret...','cwd','red','projectName','workflow:workflows','round','success','retryAttempt','📁\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','Schedule\x20ID\x20is\x20required','max','List\x20workflows','✔\x20Project\x20updated','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','9455990sdcGnF','workflow:use','\x20of\x20','path','sourceProjectName','\x1b[1A\x1b[2K','workflow:kill','toISOString','New\x20project\x20name:\x20','table','\x20has\x20no\x20attempts','localeCompare','\x22?\x20This\x20cannot\x20be\x20undone.','Including\x20subtasks:\x20yes','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','changes','executeCloneProject','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','sourceDir','✔\x20Workflow\x20run\x20started','⚠\x20Showing\x20first\x20','18GgQGgr','Deleting\x20secret...','now','list','Reason:\x20','\x0aFailed\x20to\x20fetch\x20attempt\x20data','error','resumeFrom','Getting\x20attempt\x20details...','map','workflow:upload','✔\x20Found\x20','\x0a⚠\x20Project\x20\x22','\x0a✔\x20No\x20changes\x20to\x20push','filter','skipValidation','From\x20task:\x20','nextRunTime','Attempt\x20ID:\x20','green','updatedAt','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x0aApply\x20these\x20changes?','sort','index','\x0aError:','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','padStart','Filter:\x20project=','Pattern:\x20','attempt:','\x20sessions\x20','output','select','Workflow:\x20','fs/promises','Show\x20specific\x20attempt\x20details','Project\x20directory:\x20','-\x20nothing\x20pushed','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','targetDir','dryRun','stat','deleteSecret','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','-\x20no\x20files\x20written','(use\x20--limit\x20to\x20see\x20more)','Attempt:\x20','Invalid\x20format:\x20','existingProjectId','No\x20attempts\x20found\x20in\x20project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','yes','No\x20workflow\x20sessions\x20found','attemptId','workflowProject','autocomplete','cancelRequested','taskName','done','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','white','resolve','text','finishedAt','project','running','diff','\x20\x20Project:\x20','startedAt','Pull\x20workflow\x20project\x20to\x20local\x20folder','Project:\x20','\x20is\x20not\x20a\x20directory','dim','disableSchedule','workflow:secrets:list','createdAt','pending','Status:\x20','\x20\x20Changes:\x20','size','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','\x20\x20Next\x20run:\x20','stringify','No\x20sessions\x20found\x20for:\x20','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x20session','No\x20matching\x20sessions\x20found','Kill\x20a\x20running\x20attempt','cyan','startTime','modified','Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs','name','workflow:run','revision:\x20','session','generateSessionTimelineRows','Source\x20directory:\x20','...','Error:\x20Attempt\x20ID\x20is\x20required','revision','type','attempts','workflow:retry','34390961ZQOTXo','No\x20log\x20content\x20found','Disable\x20a\x20workflow\x20schedule','value','workflow:secrets:set','12SGjXPd','No\x20schedules\x20found','No\x20log\x20files\x20found\x20for\x20this\x20attempt','\x20\x20Workflow:\x20','→\x20Project:\x20','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','Cancelled','\x20\x20Revision:\x20','Source\x20directory\x20is\x20required','Source:\x20','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:clone','Auto-selected\x20latest\x20session:\x20','workflow:timeline','msPerChar','keys','Params:\x20','fromTask','→\x20New\x20project:\x20','retryAttemptName','Analyzing\x20project...','requireProject','workflow:attempt','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20to\x20see\x20detailed\x20logs','total','readFile','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','No\x20sessions\x20found\x20in\x20project:\x20','✔\x20Showing\x20','No\x20sessions\x20found','every','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','substring','✔\x20Secret\x20\x27','📋\x20','start','isArray','\x20-\x20','No\x20attempts\x20found','includes','Listing\x20workflows...','Error:\x20Invalid\x20parameter\x20format:\x20','renderTimeline','pullProject','prepareCloneProject','\x20\x20Files\x20extracted:\x20','download','stdout','jsonl','\x0a✔\x20Attempt\x20complete','Project\x20name\x20is\x20required',',\x20Workflow:\x20','force','\x20\x20Location:\x20','has','lastAttempt','Error:\x20Secret\x20key\x20is\x20required','Include\x20retried:\x20yes','split','planned','indexOf','No\x20workflows\x20found','length','delete','Error:\x20Project\x20name\x20is\x20required','splice','\x0aDry\x20run\x20-\x20no\x20project\x20created','clear','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','listSecrets','376615pwbzKi','LABEL_WIDTH_DIVISOR','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Loading\x20workflows...','blue','LABEL_MIN_SPACING','Files\x20to\x20upload:\x20','Target:\x20','✔\x20Pushed\x20','all','canceling','message','follow','(unknown)','pollTimeline','kill','navigateSessionsInteractive','MAX_POLL_ITERATIONS','newProjectId','Target\x20directory:\x20','description','✔\x20Project:\x20','Validation:\x20skipped','Loading\x20sessions...','GUTTER','deleted','🔄\x20','No\x20workflows\x20found\x20in\x20project:\x20','context','repeat','verbose','projects','Dry\x20run:\x20yes','Select\x20a\x20task\x20to\x20view\x20logs:','status','\x20\x20tdx\x20wf\x20use\x20<project>','Listing\x20workflow\x20sessions...','includeRetried','task','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','getMonth','✔\x20Push\x20complete','2552ODpczM'];a54_0x10ad=function(){return _0x5740eb;};return a54_0x10ad();}export class WorkflowScheduleEnableCommand extends BaseCommand{[a54_0x132d15(0x2b2)]=a54_0x132d15(0x1cd);[a54_0x132d15(0x31f)]='Enable\x20a\x20workflow\x20schedule';async[a54_0x132d15(0x1be)](_0x42e2c6){const _0x17e5d6=a54_0x132d15,{options:_0x5919d7,args:_0x399e69,tdx:_0x41abd9}=_0x42e2c6,_0x5bf585=_0x399e69[0x0];if(!_0x5bf585)return console['error'](a54_0x4527ac['red'](_0x17e5d6(0x1de)),'Schedule\x20ID\x20is\x20required'),console[_0x17e5d6(0x25a)](a54_0x4527ac['dim']('Usage:\x20tdx\x20wf\x20schedule\x20enable\x20<id>')),console['error'](a54_0x4527ac[_0x17e5d6(0x29e)]('Tip:\x20Run\x20\x22tdx\x20wf\x20schedules\x22\x20to\x20see\x20schedule\x20IDs')),0x1;const _0x34d027=await withSpinner(_0x17e5d6(0x1d0)+_0x5bf585+'...',()=>_0x41abd9[_0x17e5d6(0x199)][_0x17e5d6(0x1fb)](_0x5bf585),{'verbose':_0x5919d7[_0x17e5d6(0x329)]}),_0x1850a9=_0x34d027[_0x17e5d6(0x18d)];return isStructuredFormat(_0x5919d7)?await handleSingleObjectOutput(_0x1850a9,_0x5919d7):(console[_0x17e5d6(0x17b)](_0x17e5d6(0x1f2)+_0x5bf585+'\x20enabled\x20('+(_0x1850a9['workflow']?.['name']||'unknown')+')'),_0x1850a9[_0x17e5d6(0x265)]&&console[_0x17e5d6(0x17b)](a54_0x4527ac[_0x17e5d6(0x29e)](_0x17e5d6(0x2a7)+new Date(_0x1850a9[_0x17e5d6(0x265)])[_0x17e5d6(0x338)]()))),0x0;}}export class WorkflowScheduleDisableCommand extends BaseCommand{[a54_0x132d15(0x2b2)]='workflow:schedule:disable';[a54_0x132d15(0x31f)]=a54_0x132d15(0x2c0);async['execute'](_0x3b7784){const _0x459fad=a54_0x132d15,{options:_0x36b937,args:_0x4c9660,tdx:_0x525a85}=_0x3b7784,_0x146a4f=_0x4c9660[0x0];if(!_0x146a4f)return console[_0x459fad(0x25a)](a54_0x4527ac[_0x459fad(0x232)](_0x459fad(0x1de)),_0x459fad(0x23a)),console[_0x459fad(0x25a)](a54_0x4527ac[_0x459fad(0x29e)](_0x459fad(0x1eb))),console[_0x459fad(0x25a)](a54_0x4527ac['dim'](_0x459fad(0x2b1))),0x1;const _0x68995d=await withSpinner('Disabling\x20schedule\x20#'+_0x146a4f+_0x459fad(0x2b8),()=>_0x525a85[_0x459fad(0x199)][_0x459fad(0x29f)](_0x146a4f),{'verbose':_0x36b937[_0x459fad(0x329)]}),_0x157f15=_0x68995d[_0x459fad(0x18d)];return isStructuredFormat(_0x36b937)?await handleSingleObjectOutput(_0x157f15,_0x36b937):console[_0x459fad(0x17b)]('✔\x20Schedule\x20#'+_0x146a4f+_0x459fad(0x17f)+(_0x157f15[_0x459fad(0x199)]?.['name']||_0x459fad(0x225))+')'),0x0;}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a55_0x4372(_0x543eab,_0x5476db){_0x543eab=_0x543eab-0x17f;const _0x12b086=a55_0x12b0();let _0x43721b=_0x12b086[_0x543eab];return _0x43721b;}(function(_0x512133,_0x1f3d1c){const _0x4a8e03=a55_0x4372,_0x3cf346=_0x512133();while(!![]){try{const _0x14a03d=-parseInt(_0x4a8e03(0x18a))/0x1*(parseInt(_0x4a8e03(0x181))/0x2)+-parseInt(_0x4a8e03(0x17f))/0x3*(parseInt(_0x4a8e03(0x186))/0x4)+parseInt(_0x4a8e03(0x18e))/0x5*(parseInt(_0x4a8e03(0x187))/0x6)+parseInt(_0x4a8e03(0x184))/0x7*(parseInt(_0x4a8e03(0x191))/0x8)+-parseInt(_0x4a8e03(0x18c))/0x9+parseInt(_0x4a8e03(0x189))/0xa*(-parseInt(_0x4a8e03(0x18f))/0xb)+parseInt(_0x4a8e03(0x185))/0xc;if(_0x14a03d===_0x1f3d1c)break;else _0x3cf346['push'](_0x3cf346['shift']());}catch(_0x10fb9f){_0x3cf346['push'](_0x3cf346['shift']());}}}(a55_0x12b0,0x2f1de));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 _0x1547d3=a55_0x4372,_0x290cff=getVersion(),_0x2be39a=platform(),_0x2ad3a0=process['version'][_0x1547d3(0x190)]('v','');return'tdx/'+_0x290cff+'\x20('+_0x2be39a+_0x1547d3(0x188)+_0x2ad3a0+')';}export function getAuthHeaders(_0xb989b6,_0x4a313c,_0x4a7138){const _0x5b3674=a55_0x4372,_0x9877a1=getVersion(),_0x3e9f5c={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x9877a1};if(_0x4a7138)_0x3e9f5c['Authorization']=_0x5b3674(0x18d)+_0x4a7138;else _0x4a313c&&(_0x3e9f5c['Authorization']=_0x5b3674(0x182)+_0x4a313c);return _0x3e9f5c;}export function toHeaderRecord(_0x4fde08){const _0x4b9365=a55_0x4372,_0x428fb5={};for(const [_0x31b88e,_0x179013]of Object[_0x4b9365(0x180)](_0x4fde08)){_0x179013!==undefined&&(_0x428fb5[_0x31b88e]=_0x179013);}return _0x428fb5;}function a55_0x12b0(){const _0x262aa3=['replace','2915912RjfzNd','6DiGOET','entries','89116IuGCyA','TD1\x20','Authorization','7NbbWEf','7757388SQheaY','678196yWfnOk','6EijgzQ',';\x20node/','52340lsTBpJ','7SJtDjA','length','878229xhtXIy','Bearer\x20','412115ymkaAy','319KbKohU'];a55_0x12b0=function(){return _0x262aa3;};return a55_0x12b0();}export function getTrinoHeaders(_0x4061a0,_0xa7d5c6,_0x2ef1a8){const _0x3da821=a55_0x4372,_0x12f69d=getAuthHeaders(_0x4061a0),_0x1f90e9=toHeaderRecord(_0x12f69d);if(_0x2ef1a8)_0x1f90e9[_0x3da821(0x183)]=_0x3da821(0x18d)+_0x2ef1a8;else _0xa7d5c6&&(_0x1f90e9['X-Trino-User']=_0xa7d5c6);return _0x1f90e9;}export function hasAPIKey(_0x48660d){const _0x2570c2=a55_0x4372,_0x474bc7=getAPIKey();return _0x474bc7!==undefined&&_0x474bc7[_0x2570c2(0x18b)]>0x0;}
1
+ (function(_0x227f4d,_0x4c6bc3){const _0x451e90=a55_0x3e0e,_0x23a83e=_0x227f4d();while(!![]){try{const _0x5275c6=parseInt(_0x451e90(0xde))/0x1+parseInt(_0x451e90(0xdb))/0x2+-parseInt(_0x451e90(0xd9))/0x3+-parseInt(_0x451e90(0xdd))/0x4+parseInt(_0x451e90(0xe4))/0x5*(-parseInt(_0x451e90(0xe0))/0x6)+parseInt(_0x451e90(0xe2))/0x7+parseInt(_0x451e90(0xe3))/0x8;if(_0x5275c6===_0x4c6bc3)break;else _0x23a83e['push'](_0x23a83e['shift']());}catch(_0x7e6b2e){_0x23a83e['push'](_0x23a83e['shift']());}}}(a55_0x235f,0x2ad51));function a55_0x3e0e(_0x26a983,_0x328d48){_0x26a983=_0x26a983-0xd5;const _0x235f6f=a55_0x235f();let _0x3e0ed7=_0x235f6f[_0x26a983];return _0x3e0ed7;}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 _0x3f5de4=a55_0x3e0e,_0x36172b=getVersion(),_0x285282=platform(),_0x53cc28=process[_0x3f5de4(0xd6)]['replace']('v','');return'tdx/'+_0x36172b+'\x20('+_0x285282+';\x20node/'+_0x53cc28+')';}export function getAuthHeaders(_0x3e0a2c,_0x2561b1,_0x1ceac4){const _0x2aa389=a55_0x3e0e,_0xab7ca0=getVersion(),_0x36f1b3={'User-Agent':getUserAgent(),'X-TD-Client':_0x2aa389(0xd5),'X-TD-Client-Version':_0xab7ca0};if(_0x1ceac4)_0x36f1b3[_0x2aa389(0xdf)]=_0x2aa389(0xd7)+_0x1ceac4;else _0x2561b1&&(_0x36f1b3['Authorization']=_0x2aa389(0xda)+_0x2561b1);return _0x36f1b3;}export function toHeaderRecord(_0x4c0c4c){const _0x4314e8=a55_0x3e0e,_0x155d96={};for(const [_0x116beb,_0xd6296f]of Object[_0x4314e8(0xd8)](_0x4c0c4c)){_0xd6296f!==undefined&&(_0x155d96[_0x116beb]=_0xd6296f);}return _0x155d96;}function a55_0x235f(){const _0x331b97=['857874HfdOir','TD1\x20','276030uNiBYV','X-Trino-User','570128KZXWTA','346513wghYic','Authorization','290154vXSMbJ','length','1684963Wmwdkv','1737656IzzWSR','35Udcwhu','tdx','version','Bearer\x20','entries'];a55_0x235f=function(){return _0x331b97;};return a55_0x235f();}export function getTrinoHeaders(_0x4fad60,_0x5072aa,_0x9cd247){const _0x27796b=a55_0x3e0e,_0x3ef92e=getAuthHeaders(_0x4fad60),_0x5b698c=toHeaderRecord(_0x3ef92e);if(_0x9cd247)_0x5b698c['Authorization']=_0x27796b(0xd7)+_0x9cd247;else _0x5072aa&&(_0x5b698c[_0x27796b(0xdc)]=_0x5072aa);return _0x5b698c;}export function hasAPIKey(_0x1de53d){const _0x47917d=a55_0x3e0e,_0x494012=getAPIKey();return _0x494012!==undefined&&_0x494012[_0x47917d(0xe1)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x2c4600,_0x5f509c){const _0x40d34e=a56_0x3b93,_0x14694f=_0x2c4600();while(!![]){try{const _0x4b21fd=-parseInt(_0x40d34e(0x20f))/0x1+-parseInt(_0x40d34e(0x21c))/0x2*(-parseInt(_0x40d34e(0x216))/0x3)+parseInt(_0x40d34e(0x206))/0x4+-parseInt(_0x40d34e(0x1f5))/0x5+-parseInt(_0x40d34e(0x211))/0x6+parseInt(_0x40d34e(0x218))/0x7*(-parseInt(_0x40d34e(0x220))/0x8)+parseInt(_0x40d34e(0x1fc))/0x9;if(_0x4b21fd===_0x5f509c)break;else _0x14694f['push'](_0x14694f['shift']());}catch(_0x5d2028){_0x14694f['push'](_0x14694f['shift']());}}}(a56_0x2a17,0xcba9a));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_0x498008 from'chalk';function a56_0x3b93(_0x579806,_0x1e24ea){_0x579806=_0x579806-0x1ef;const _0x2a1759=a56_0x2a17();let _0x3b9399=_0x2a1759[_0x579806];return _0x3b9399;}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x54efee){const _0x47245c=a56_0x3b93;return _0x54efee['format']===_0x47245c(0x226)||_0x54efee['format']===_0x47245c(0x207)||_0x54efee['format']===_0x47245c(0x20c)||_0x54efee[_0x47245c(0x234)]===_0x47245c(0x22b)||_0x54efee[_0x47245c(0x226)]===!![]||_0x54efee['jsonl']===!![]||_0x54efee[_0x47245c(0x20c)]===!![]||_0x54efee['table']===!![];}export function parseOutputOptions(_0x8f01cc){const _0xd70cce=a56_0x3b93;return{'format':_0x8f01cc['format']||'table','output':_0x8f01cc[_0xd70cce(0x20e)]||'','limit':_0x8f01cc[_0xd70cce(0x1fd)],'limitStructuredFormats':_0x8f01cc[_0xd70cce(0x237)],'color':_0x8f01cc[_0xd70cce(0x1f2)],'noColor':_0x8f01cc[_0xd70cce(0x221)]};}function convertSDKResultToQueryResult(_0x22d28b){const _0x10d8b3=a56_0x3b93,_0x4b6851=[];if(_0x22d28b['length']>0x0){const _0x289da4=_0x22d28b[0x0];for(const [_0x3ffb7e,_0x108aeb]of Object[_0x10d8b3(0x233)](_0x289da4)){let _0x2d2b68=_0x10d8b3(0x20a);if(typeof _0x108aeb===_0x10d8b3(0x208))_0x2d2b68=Number[_0x10d8b3(0x22e)](_0x108aeb)?_0x10d8b3(0x236):_0x10d8b3(0x1f8);else{if(typeof _0x108aeb===_0x10d8b3(0x22c))_0x2d2b68=_0x10d8b3(0x22c);else _0x108aeb===null&&(_0x2d2b68='varchar');}_0x4b6851['push']({'name':_0x3ffb7e,'type':_0x2d2b68});}}return{'queryId':_0x10d8b3(0x1fe),'columns':_0x4b6851,'data':_0x22d28b,'stats':{'state':_0x10d8b3(0x204),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x22d28b[_0x10d8b3(0x202)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5bdd8e,_0x24fea6){const _0xad1da3=convertSDKResultToQueryResult(_0x5bdd8e);return formatQueryOutput(_0xad1da3,_0x24fea6);}export async function formatQueryOutput(_0x345f47,_0x53559e){const _0x284004=a56_0x3b93,{format:_0xf8115e,limit:_0x5b27d9,output:_0x5bb7ce,color:_0x11d019,noColor:_0x1febaf,limitStructuredFormats:_0x42bd22}=_0x53559e,_0x4463ec=Boolean(_0x5bb7ce)&&!_0x11d019,_0x40c4b6={'color':_0x11d019,'noColor':_0x1febaf||_0x4463ec};if(_0xf8115e===_0x284004(0x22b)){const _0x18c223=shouldUseLess(_0xf8115e,_0x5bb7ce);return formatAsTable(_0x345f47,_0x5b27d9,_0x18c223,_0x40c4b6);}const _0x1dcb5a=_0x42bd22&&Number[_0x284004(0x1f7)](_0x5b27d9)&&_0x345f47[_0x284004(0x231)][_0x284004(0x202)]>_0x5b27d9?{..._0x345f47,'data':_0x345f47['data']['slice'](0x0,_0x5b27d9)}:_0x345f47;if(_0xf8115e===_0x284004(0x226))return formatAsJSON(_0x1dcb5a,_0x40c4b6);else return _0xf8115e==='jsonl'?formatAsJSONL(_0x1dcb5a,_0x40c4b6):formatQueryResult(_0x1dcb5a,_0xf8115e);}function shouldUseLess(_0x1f21b7,_0x298864){const _0x4d89ca=a56_0x3b93;return(_0x1f21b7===_0x4d89ca(0x22b)||_0x1f21b7===_0x4d89ca(0x20d))&&process['stdout'][_0x4d89ca(0x230)]&&!_0x298864;}export function resolveOutputOptions(_0x1b755e){const _0x27ddeb=a56_0x3b93,_0x5daeec=_0x1b755e['output']||'',_0x41490c=resolveOutputFormat(_0x1b755e[_0x27ddeb(0x234)],_0x5daeec,_0x27ddeb(0x22b));let _0x40d854=typeof _0x1b755e[_0x27ddeb(0x1fd)]===_0x27ddeb(0x208)?_0x1b755e['limit']:parseInt(_0x1b755e['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x1b755e[_0x27ddeb(0x1fd)]===undefined&&shouldUseLess(_0x41490c,_0x5daeec)&&(_0x40d854=Infinity),{'format':_0x41490c,'output':_0x5daeec,'limit':_0x40d854,'limitStructuredFormats':_0x1b755e[_0x27ddeb(0x237)],'color':_0x1b755e[_0x27ddeb(0x1f2)],'noColor':_0x1b755e['noColor']};}export function writeOutput(_0x442b04,_0x387ac4,_0x38acda){const _0x193f68=a56_0x3b93;return _0x387ac4?(writeFileSync(_0x387ac4,_0x442b04),console[_0x193f68(0x1f1)]('Results\x20saved\x20to\x20'+_0x387ac4),Promise[_0x193f68(0x21f)]()):shouldUseLess(_0x38acda||'','')?new Promise(_0x287bd7=>{const _0x23d33f=_0x193f68,_0x11136f=spawn('less',[_0x23d33f(0x1f3)],{'stdio':[_0x23d33f(0x219),_0x23d33f(0x21b),_0x23d33f(0x21b)]});let _0x432ff4=![];_0x11136f['on'](_0x23d33f(0x1f1),()=>{const _0x500e16=_0x23d33f;!_0x432ff4&&(_0x432ff4=!![],console[_0x500e16(0x217)](_0x442b04),_0x287bd7());}),_0x11136f['on'](_0x23d33f(0x238),()=>{!_0x432ff4&&(_0x432ff4=!![],_0x287bd7());}),_0x11136f['on'](_0x23d33f(0x1fa),()=>{const _0x4aad2b=_0x23d33f;!_0x432ff4&&_0x11136f[_0x4aad2b(0x223)]&&(_0x11136f['stdin']['on']('error',()=>{}),_0x11136f['stdin'][_0x4aad2b(0x1fb)](_0x442b04),_0x11136f[_0x4aad2b(0x223)][_0x4aad2b(0x203)]());}),!_0x11136f['stdin']&&(!_0x432ff4&&(_0x432ff4=!![],console[_0x23d33f(0x217)](_0x442b04),_0x287bd7()));}):(console[_0x193f68(0x217)](_0x442b04),Promise[_0x193f68(0x21f)]());}function a56_0x2a17(){const _0x169eb3=['keys','inherit','752yYzqbk','[logs]','stringify','resolve','379752CsSmdM','noColor','[params]','stdin','─┬─','params','json','No\x20data','padEnd','[error]','[query]','table','boolean','[Object]','isInteger','filter','isTTY','data','[rule]','entries','format','join','bigint','limitStructuredFormats','close','repeat','trim','error','color','-FXRSn','max','6907790dxXJZC','split','isFinite','double','map','spawn','write','21997377yYzwKJ','limit','sdk-result','debug','red','magenta','length','end','FINISHED','cmdout','3496160WKLWsE','jsonl','number','forEach','varchar','query','tsv','list','output','1464033URXFBI','yellow','3844410BUzbOV','bold','rule','push','object','12921HUKrgq','log','91vdghjX','pipe'];a56_0x2a17=function(){return _0x169eb3;};return a56_0x2a17();}export async function handleSDKOutput(_0x5f0233,_0x3e65c6){const _0x1063e4=a56_0x3b93,_0x2ccaa1=resolveOutputOptions(_0x3e65c6),_0x2e7829=await formatSDKOutput(_0x5f0233,_0x2ccaa1);await writeOutput(_0x2e7829,_0x2ccaa1[_0x1063e4(0x20e)]||undefined,_0x2ccaa1[_0x1063e4(0x234)]);}export async function handleQueryOutput(_0x1f0add,_0x5950a4){const _0x1c02bc=a56_0x3b93,_0x1214e0=resolveOutputOptions(_0x5950a4),_0xc8c443=await formatQueryOutput(_0x1f0add,_0x1214e0);await writeOutput(_0xc8c443,_0x1214e0[_0x1c02bc(0x20e)]||undefined,_0x1214e0[_0x1c02bc(0x234)]);}async function formatSingleObject(_0x477ef3,_0x13189c){const _0x17c194=a56_0x3b93,{format:_0x3c5ca1,color:_0x26124d,noColor:_0x24fe15}=_0x13189c,_0xbefe8e={'color':_0x26124d,'noColor':_0x24fe15};if(_0x3c5ca1===_0x17c194(0x226)){if(shouldUseColor(_0xbefe8e))return colorizeJSON(_0x477ef3,_0xbefe8e);return JSON[_0x17c194(0x21e)](_0x477ef3,null,0x2);}else{if(_0x3c5ca1===_0x17c194(0x207)){if(shouldUseColor(_0xbefe8e))return colorizeJSONCompact(_0x477ef3,_0xbefe8e);return JSON[_0x17c194(0x21e)](_0x477ef3);}else{if(_0x3c5ca1===_0x17c194(0x20c))return Object['entries'](_0x477ef3)[_0x17c194(0x1f9)](([_0x564ef6,_0x1d71a5])=>_0x564ef6+'\x09'+_0x1d71a5)[_0x17c194(0x235)]('\x0a');else{const _0x43c027=Object[_0x17c194(0x233)](_0x477ef3);if(_0x43c027[_0x17c194(0x202)]===0x0)return _0x17c194(0x227);const _0x40cd5c=_0x477ef3[_0x17c194(0x1ff)],_0x2b6c14=_0x477ef3[_0x17c194(0x20b)],_0x497f3a=_0x477ef3[_0x17c194(0x225)],_0x2e5437=_0x477ef3[_0x17c194(0x213)],_0x3a2975=_0x2b6c14?typeof _0x2b6c14==='string'?_0x2b6c14:JSON['stringify'](_0x2b6c14,null,0x2):undefined,_0x56622a=_0x497f3a&&Object[_0x17c194(0x21a)](_0x497f3a)[_0x17c194(0x202)]>0x0?JSON['stringify'](_0x497f3a,null,0x2):undefined,_0xd9a5ca=_0x2e5437&&Object['keys'](_0x2e5437)[_0x17c194(0x202)]>0x0?JSON[_0x17c194(0x21e)](_0x2e5437,null,0x2):undefined,_0x31c9f4=_0x43c027[_0x17c194(0x22f)](([_0x4ca936])=>_0x4ca936!==_0x17c194(0x1ff)&&_0x4ca936!=='query'&&_0x4ca936!==_0x17c194(0x225)&&_0x4ca936!==_0x17c194(0x213)),_0x546915=Math[_0x17c194(0x1f4)](..._0x31c9f4[_0x17c194(0x1f9)](([_0x54ad7b])=>_0x54ad7b[_0x17c194(0x202)])),_0x32e9d4=Math[_0x17c194(0x1f4)](..._0x31c9f4[_0x17c194(0x1f9)](([,_0x579018])=>{const _0x22a73c=_0x17c194;try{const _0x28cd88=_0x579018===null||_0x579018===undefined?'':typeof _0x579018===_0x22a73c(0x215)?JSON[_0x22a73c(0x21e)](_0x579018):String(_0x579018),_0xf57232=_0x28cd88[_0x22a73c(0x1f6)]('\x0a');return Math[_0x22a73c(0x1f4)](..._0xf57232[_0x22a73c(0x1f9)](_0xdc46d=>_0xdc46d[_0x22a73c(0x202)]),0x0);}catch{return 0x0;}}),0x14),_0x13cd3f=[];_0x13cd3f[_0x17c194(0x214)](colorBorder('┌─'+'─'[_0x17c194(0x1ef)](_0x546915)+_0x17c194(0x224)+'─'[_0x17c194(0x1ef)](_0x32e9d4)+'─┐',_0xbefe8e)),_0x31c9f4['forEach'](([_0x3b879e,_0x5562dd])=>{const _0x2c05bf=_0x17c194;let _0x57b17b;try{_0x57b17b=_0x5562dd===null||_0x5562dd===undefined?'':typeof _0x5562dd===_0x2c05bf(0x215)?JSON[_0x2c05bf(0x21e)](_0x5562dd):String(_0x5562dd);}catch{_0x57b17b=_0x2c05bf(0x22d);}const _0x3cc9ed=_0x3b879e['padEnd'](_0x546915),_0x36e972=_0x57b17b[_0x2c05bf(0x1f6)]('\x0a');_0x36e972['forEach']((_0x50f408,_0x18bfc9)=>{const _0x587a93=_0x2c05bf,_0x505fdd=colorBorder('│',_0xbefe8e);_0x18bfc9===0x0?_0x13cd3f[_0x587a93(0x214)](_0x505fdd+'\x20'+_0x3cc9ed+'\x20'+_0x505fdd+'\x20'+_0x50f408[_0x587a93(0x228)](_0x32e9d4)+'\x20'+_0x505fdd):_0x13cd3f[_0x587a93(0x214)](_0x505fdd+'\x20'+'\x20'[_0x587a93(0x1ef)](_0x546915)+'\x20'+_0x505fdd+'\x20'+_0x50f408[_0x587a93(0x228)](_0x32e9d4)+'\x20'+_0x505fdd);});}),_0x13cd3f['push'](colorBorder('└─'+'─'[_0x17c194(0x1ef)](_0x546915)+'─┴─'+'─'[_0x17c194(0x1ef)](_0x32e9d4)+'─┘',_0xbefe8e));_0x3a2975&&(_0x13cd3f[_0x17c194(0x214)](''),_0x13cd3f[_0x17c194(0x214)](String(a56_0x498008[_0x17c194(0x210)][_0x17c194(0x212)](_0x17c194(0x22a)))),_0x13cd3f[_0x17c194(0x214)](_0x3a2975));_0x56622a&&(_0x13cd3f['push'](''),_0x13cd3f[_0x17c194(0x214)](String(a56_0x498008['blue'][_0x17c194(0x212)](_0x17c194(0x222)))),_0x13cd3f[_0x17c194(0x214)](_0x56622a));_0xd9a5ca&&(_0x13cd3f[_0x17c194(0x214)](''),_0x13cd3f['push'](String(a56_0x498008[_0x17c194(0x201)][_0x17c194(0x212)](_0x17c194(0x232)))),_0x13cd3f['push'](_0xd9a5ca));if(_0x40cd5c){if(_0x40cd5c['stderr']){_0x13cd3f[_0x17c194(0x214)](''),_0x13cd3f[_0x17c194(0x214)](String(a56_0x498008[_0x17c194(0x200)][_0x17c194(0x212)](_0x17c194(0x229))));const _0x5e2da6=_0x40cd5c['stderr']['split']('\x0a');_0x5e2da6[_0x17c194(0x209)](_0x2a1a2b=>{const _0x26420d=_0x17c194;_0x2a1a2b[_0x26420d(0x1f0)]()&&_0x13cd3f[_0x26420d(0x214)](_0x2a1a2b);});}if(_0x40cd5c[_0x17c194(0x205)]){_0x13cd3f[_0x17c194(0x214)](''),_0x13cd3f[_0x17c194(0x214)](String(a56_0x498008['cyan'][_0x17c194(0x212)](_0x17c194(0x21d))));const _0xd483b1=_0x40cd5c[_0x17c194(0x205)][_0x17c194(0x1f6)]('\x0a');_0xd483b1[_0x17c194(0x209)](_0xf2d541=>{const _0x5a8ee5=_0x17c194;_0xf2d541[_0x5a8ee5(0x1f0)]()&&_0x13cd3f[_0x5a8ee5(0x214)](_0xf2d541);});}}return _0x13cd3f[_0x17c194(0x235)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x57c9a8,_0x2d2c4f){const _0x30ba99=a56_0x3b93;if(_0x2d2c4f[_0x30ba99(0x234)]==='table'){await handleSDKOutput([_0x57c9a8],_0x2d2c4f);return;}const _0x33e500=resolveOutputOptions(_0x2d2c4f),_0x57883a=await formatSingleObject(_0x57c9a8,_0x33e500);await writeOutput(_0x57883a,_0x33e500['output']||undefined,_0x33e500[_0x30ba99(0x234)]);}
1
+ (function(_0x497181,_0x283d3b){const _0x448780=a56_0x4a78,_0x3af688=_0x497181();while(!![]){try{const _0x502029=-parseInt(_0x448780(0xb6))/0x1+-parseInt(_0x448780(0xc0))/0x2+-parseInt(_0x448780(0xa1))/0x3+parseInt(_0x448780(0xba))/0x4+parseInt(_0x448780(0xd9))/0x5+parseInt(_0x448780(0xb0))/0x6+-parseInt(_0x448780(0xcb))/0x7;if(_0x502029===_0x283d3b)break;else _0x3af688['push'](_0x3af688['shift']());}catch(_0x119fb2){_0x3af688['push'](_0x3af688['shift']());}}}(a56_0xb5d7,0x74550));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_0x1f54e5 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x2bc923){const _0x125126=a56_0x4a78;return _0x2bc923['format']===_0x125126(0x94)||_0x2bc923[_0x125126(0xb5)]===_0x125126(0xd2)||_0x2bc923[_0x125126(0xb5)]==='tsv'||_0x2bc923[_0x125126(0xb5)]===_0x125126(0xcd)||_0x2bc923['json']===!![]||_0x2bc923[_0x125126(0xd2)]===!![]||_0x2bc923[_0x125126(0x95)]===!![]||_0x2bc923[_0x125126(0xcd)]===!![];}export function parseOutputOptions(_0x807596){const _0x58689d=a56_0x4a78;return{'format':_0x807596['format']||_0x58689d(0xcd),'output':_0x807596['output']||'','limit':_0x807596[_0x58689d(0x99)],'limitStructuredFormats':_0x807596[_0x58689d(0xd3)],'color':_0x807596[_0x58689d(0x9e)],'noColor':_0x807596['noColor']};}function convertSDKResultToQueryResult(_0x55e963){const _0x11157a=a56_0x4a78,_0x348cd0=[];if(_0x55e963[_0x11157a(0xd7)]>0x0){const _0x269f20=_0x55e963[0x0];for(const [_0x3f674d,_0x2e330b]of Object['entries'](_0x269f20)){let _0x241240=_0x11157a(0xcf);if(typeof _0x2e330b===_0x11157a(0xd5))_0x241240=Number['isInteger'](_0x2e330b)?_0x11157a(0xca):_0x11157a(0x9b);else{if(typeof _0x2e330b===_0x11157a(0x9f))_0x241240='boolean';else _0x2e330b===null&&(_0x241240=_0x11157a(0xcf));}_0x348cd0[_0x11157a(0x91)]({'name':_0x3f674d,'type':_0x241240});}}return{'queryId':_0x11157a(0x9d),'columns':_0x348cd0,'data':_0x55e963,'stats':{'state':_0x11157a(0xb3),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x55e963[_0x11157a(0xd7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x7fd7d5,_0x4b139f){const _0x2499cd=convertSDKResultToQueryResult(_0x7fd7d5);return formatQueryOutput(_0x2499cd,_0x4b139f);}export async function formatQueryOutput(_0x32d1f8,_0x2dccbe){const _0x1d62dd=a56_0x4a78,{format:_0x5c6c2d,limit:_0x83698,output:_0x145260,color:_0xc02e02,noColor:_0x493a91,limitStructuredFormats:_0x36e90b}=_0x2dccbe,_0x57bc7e=Boolean(_0x145260)&&!_0xc02e02,_0x958264={'color':_0xc02e02,'noColor':_0x493a91||_0x57bc7e};if(_0x5c6c2d===_0x1d62dd(0xcd)){const _0x3504e6=shouldUseLess(_0x5c6c2d,_0x145260);return formatAsTable(_0x32d1f8,_0x83698,_0x3504e6,_0x958264);}const _0x42cbe9=_0x36e90b&&Number[_0x1d62dd(0x9a)](_0x83698)&&_0x32d1f8[_0x1d62dd(0xa4)][_0x1d62dd(0xd7)]>_0x83698?{..._0x32d1f8,'data':_0x32d1f8['data'][_0x1d62dd(0xa7)](0x0,_0x83698)}:_0x32d1f8;if(_0x5c6c2d==='json')return formatAsJSON(_0x42cbe9,_0x958264);else return _0x5c6c2d===_0x1d62dd(0xd2)?formatAsJSONL(_0x42cbe9,_0x958264):formatQueryResult(_0x42cbe9,_0x5c6c2d);}function shouldUseLess(_0x42dd18,_0x401bfa){const _0x28b154=a56_0x4a78;return(_0x42dd18===_0x28b154(0xcd)||_0x42dd18===_0x28b154(0x96))&&process[_0x28b154(0xd4)]['isTTY']&&!_0x401bfa;}export function resolveOutputOptions(_0x2a047f){const _0x3176e5=a56_0x4a78,_0x20375c=_0x2a047f[_0x3176e5(0xa3)]||'',_0x542d41=resolveOutputFormat(_0x2a047f[_0x3176e5(0xb5)],_0x20375c,_0x3176e5(0xcd));let _0x1920f5=typeof _0x2a047f[_0x3176e5(0x99)]===_0x3176e5(0xd5)?_0x2a047f[_0x3176e5(0x99)]:parseInt(_0x2a047f[_0x3176e5(0x99)]||String(DEFAULT_DISPLAY_LIMIT),0xa);return _0x2a047f[_0x3176e5(0x99)]===undefined&&shouldUseLess(_0x542d41,_0x20375c)&&(_0x1920f5=Infinity),{'format':_0x542d41,'output':_0x20375c,'limit':_0x1920f5,'limitStructuredFormats':_0x2a047f['limitStructuredFormats'],'color':_0x2a047f[_0x3176e5(0x9e)],'noColor':_0x2a047f[_0x3176e5(0xa9)]};}export function writeOutput(_0x32312d,_0x232246,_0x2acaff){const _0x284ff0=a56_0x4a78;return _0x232246?(writeFileSync(_0x232246,_0x32312d),console[_0x284ff0(0xa8)](_0x284ff0(0xac)+_0x232246),Promise[_0x284ff0(0xad)]()):shouldUseLess(_0x2acaff||'','')?new Promise(_0xc520d0=>{const _0x3977d8=_0x284ff0,_0x155e67=spawn('less',[_0x3977d8(0xbd)],{'stdio':[_0x3977d8(0xaf),_0x3977d8(0xc5),_0x3977d8(0xc5)]});let _0x151dae=![];_0x155e67['on'](_0x3977d8(0xa8),()=>{const _0x4d2450=_0x3977d8;!_0x151dae&&(_0x151dae=!![],console[_0x4d2450(0xd1)](_0x32312d),_0xc520d0());}),_0x155e67['on'](_0x3977d8(0xb9),()=>{!_0x151dae&&(_0x151dae=!![],_0xc520d0());}),_0x155e67['on'](_0x3977d8(0xbe),()=>{const _0x187015=_0x3977d8;!_0x151dae&&_0x155e67[_0x187015(0x92)]&&(_0x155e67[_0x187015(0x92)]['on']('error',()=>{}),_0x155e67[_0x187015(0x92)][_0x187015(0xc6)](_0x32312d),_0x155e67[_0x187015(0x92)][_0x187015(0x90)]());}),!_0x155e67['stdin']&&(!_0x151dae&&(_0x151dae=!![],console[_0x3977d8(0xd1)](_0x32312d),_0xc520d0()));}):(console[_0x284ff0(0xd1)](_0x32312d),Promise[_0x284ff0(0xad)]());}export async function handleSDKOutput(_0x2090ee,_0x1bd276){const _0x4c4404=a56_0x4a78,_0xecabb6=resolveOutputOptions(_0x1bd276),_0x247b10=await formatSDKOutput(_0x2090ee,_0xecabb6);await writeOutput(_0x247b10,_0xecabb6[_0x4c4404(0xa3)]||undefined,_0xecabb6['format']);}function a56_0xb5d7(){const _0x103524=['padEnd','slice','error','noColor','debug','[params]','Results\x20saved\x20to\x20','resolve','rule','pipe','1035828fKmUvS','yellow','object','FINISHED','map','format','795497klnjHs','entries','[Object]','close','3433656VfMDon','stderr','query','-FXRSn','spawn','red','774656ddNKrd','cmdout','split','forEach','trim','inherit','write','stringify','keys','[error]','bigint','360913hCezwi','string','table','params','varchar','blue','log','jsonl','limitStructuredFormats','stdout','number','bold','length','─┬─','3821800uYxXKl','end','push','stdin','[rule]','json','tsv','list','cyan','repeat','limit','isFinite','double','join','sdk-result','color','boolean','max','253596owtawo','[logs]','output','data','magenta'];a56_0xb5d7=function(){return _0x103524;};return a56_0xb5d7();}export async function handleQueryOutput(_0x197098,_0x2da9f6){const _0x2a783e=a56_0x4a78,_0x15afd7=resolveOutputOptions(_0x2da9f6),_0x1d87c6=await formatQueryOutput(_0x197098,_0x15afd7);await writeOutput(_0x1d87c6,_0x15afd7[_0x2a783e(0xa3)]||undefined,_0x15afd7[_0x2a783e(0xb5)]);}async function formatSingleObject(_0x1d4782,_0x15a73e){const _0x3ed3bd=a56_0x4a78,{format:_0x1330a8,color:_0x13961f,noColor:_0x7f5be2}=_0x15a73e,_0x4644f7={'color':_0x13961f,'noColor':_0x7f5be2};if(_0x1330a8==='json'){if(shouldUseColor(_0x4644f7))return colorizeJSON(_0x1d4782,_0x4644f7);return JSON[_0x3ed3bd(0xc7)](_0x1d4782,null,0x2);}else{if(_0x1330a8===_0x3ed3bd(0xd2)){if(shouldUseColor(_0x4644f7))return colorizeJSONCompact(_0x1d4782,_0x4644f7);return JSON[_0x3ed3bd(0xc7)](_0x1d4782);}else{if(_0x1330a8===_0x3ed3bd(0x95))return Object['entries'](_0x1d4782)[_0x3ed3bd(0xb4)](([_0x4d0e91,_0x83ec42])=>_0x4d0e91+'\x09'+_0x83ec42)[_0x3ed3bd(0x9c)]('\x0a');else{const _0x57a455=Object[_0x3ed3bd(0xb7)](_0x1d4782);if(_0x57a455[_0x3ed3bd(0xd7)]===0x0)return'No\x20data';const _0x3cc834=_0x1d4782[_0x3ed3bd(0xaa)],_0x5458a5=_0x1d4782[_0x3ed3bd(0xbc)],_0x23adbb=_0x1d4782[_0x3ed3bd(0xce)],_0x1990ff=_0x1d4782[_0x3ed3bd(0xae)],_0x528fbf=_0x5458a5?typeof _0x5458a5===_0x3ed3bd(0xcc)?_0x5458a5:JSON['stringify'](_0x5458a5,null,0x2):undefined,_0x31f35e=_0x23adbb&&Object[_0x3ed3bd(0xc8)](_0x23adbb)[_0x3ed3bd(0xd7)]>0x0?JSON['stringify'](_0x23adbb,null,0x2):undefined,_0x2cb223=_0x1990ff&&Object[_0x3ed3bd(0xc8)](_0x1990ff)[_0x3ed3bd(0xd7)]>0x0?JSON['stringify'](_0x1990ff,null,0x2):undefined,_0x5bbca1=_0x57a455['filter'](([_0xebfbbb])=>_0xebfbbb!=='debug'&&_0xebfbbb!=='query'&&_0xebfbbb!==_0x3ed3bd(0xce)&&_0xebfbbb!==_0x3ed3bd(0xae)),_0x173aed=Math[_0x3ed3bd(0xa0)](..._0x5bbca1[_0x3ed3bd(0xb4)](([_0x3d7de4])=>_0x3d7de4[_0x3ed3bd(0xd7)])),_0x1a6960=Math[_0x3ed3bd(0xa0)](..._0x5bbca1[_0x3ed3bd(0xb4)](([,_0x384c5c])=>{const _0x4a9676=_0x3ed3bd;try{const _0x207f7b=_0x384c5c===null||_0x384c5c===undefined?'':typeof _0x384c5c===_0x4a9676(0xb2)?JSON['stringify'](_0x384c5c):String(_0x384c5c),_0x3a5fe4=_0x207f7b['split']('\x0a');return Math[_0x4a9676(0xa0)](..._0x3a5fe4[_0x4a9676(0xb4)](_0x390e27=>_0x390e27[_0x4a9676(0xd7)]),0x0);}catch{return 0x0;}}),0x14),_0x1bea0e=[];_0x1bea0e[_0x3ed3bd(0x91)](colorBorder('┌─'+'─'[_0x3ed3bd(0x98)](_0x173aed)+_0x3ed3bd(0xd8)+'─'[_0x3ed3bd(0x98)](_0x1a6960)+'─┐',_0x4644f7)),_0x5bbca1[_0x3ed3bd(0xc3)](([_0x1bf4e7,_0x3ed9bd])=>{const _0x202255=_0x3ed3bd;let _0x535f99;try{_0x535f99=_0x3ed9bd===null||_0x3ed9bd===undefined?'':typeof _0x3ed9bd===_0x202255(0xb2)?JSON[_0x202255(0xc7)](_0x3ed9bd):String(_0x3ed9bd);}catch{_0x535f99=_0x202255(0xb8);}const _0x13fc44=_0x1bf4e7[_0x202255(0xa6)](_0x173aed),_0x3d5b5e=_0x535f99['split']('\x0a');_0x3d5b5e[_0x202255(0xc3)]((_0x414b31,_0x4d51e9)=>{const _0x59ff39=_0x202255,_0x4eee31=colorBorder('│',_0x4644f7);_0x4d51e9===0x0?_0x1bea0e[_0x59ff39(0x91)](_0x4eee31+'\x20'+_0x13fc44+'\x20'+_0x4eee31+'\x20'+_0x414b31[_0x59ff39(0xa6)](_0x1a6960)+'\x20'+_0x4eee31):_0x1bea0e[_0x59ff39(0x91)](_0x4eee31+'\x20'+'\x20'['repeat'](_0x173aed)+'\x20'+_0x4eee31+'\x20'+_0x414b31[_0x59ff39(0xa6)](_0x1a6960)+'\x20'+_0x4eee31);});}),_0x1bea0e[_0x3ed3bd(0x91)](colorBorder('└─'+'─'['repeat'](_0x173aed)+'─┴─'+'─'['repeat'](_0x1a6960)+'─┘',_0x4644f7));_0x528fbf&&(_0x1bea0e[_0x3ed3bd(0x91)](''),_0x1bea0e['push'](String(a56_0x1f54e5[_0x3ed3bd(0xb1)][_0x3ed3bd(0xd6)]('[query]'))),_0x1bea0e[_0x3ed3bd(0x91)](_0x528fbf));_0x31f35e&&(_0x1bea0e[_0x3ed3bd(0x91)](''),_0x1bea0e['push'](String(a56_0x1f54e5[_0x3ed3bd(0xd0)][_0x3ed3bd(0xd6)](_0x3ed3bd(0xab)))),_0x1bea0e[_0x3ed3bd(0x91)](_0x31f35e));_0x2cb223&&(_0x1bea0e['push'](''),_0x1bea0e[_0x3ed3bd(0x91)](String(a56_0x1f54e5[_0x3ed3bd(0xa5)][_0x3ed3bd(0xd6)](_0x3ed3bd(0x93)))),_0x1bea0e[_0x3ed3bd(0x91)](_0x2cb223));if(_0x3cc834){if(_0x3cc834[_0x3ed3bd(0xbb)]){_0x1bea0e[_0x3ed3bd(0x91)](''),_0x1bea0e['push'](String(a56_0x1f54e5[_0x3ed3bd(0xbf)][_0x3ed3bd(0xd6)](_0x3ed3bd(0xc9))));const _0x40098b=_0x3cc834[_0x3ed3bd(0xbb)][_0x3ed3bd(0xc2)]('\x0a');_0x40098b[_0x3ed3bd(0xc3)](_0x182e4a=>{const _0xab37c9=_0x3ed3bd;_0x182e4a[_0xab37c9(0xc4)]()&&_0x1bea0e[_0xab37c9(0x91)](_0x182e4a);});}if(_0x3cc834['cmdout']){_0x1bea0e[_0x3ed3bd(0x91)](''),_0x1bea0e[_0x3ed3bd(0x91)](String(a56_0x1f54e5[_0x3ed3bd(0x97)][_0x3ed3bd(0xd6)](_0x3ed3bd(0xa2))));const _0x5bf606=_0x3cc834[_0x3ed3bd(0xc1)][_0x3ed3bd(0xc2)]('\x0a');_0x5bf606[_0x3ed3bd(0xc3)](_0x1b1843=>{const _0x3a56ca=_0x3ed3bd;_0x1b1843['trim']()&&_0x1bea0e[_0x3a56ca(0x91)](_0x1b1843);});}}return _0x1bea0e[_0x3ed3bd(0x9c)]('\x0a');}}}}function a56_0x4a78(_0x27f2ef,_0x67a2fb){_0x27f2ef=_0x27f2ef-0x90;const _0xb5d733=a56_0xb5d7();let _0x4a783f=_0xb5d733[_0x27f2ef];return _0x4a783f;}export async function handleSingleObjectOutput(_0x2e53f2,_0xd433a2){const _0x3fcae0=a56_0x4a78;if(_0xd433a2[_0x3fcae0(0xb5)]==='table'){await handleSDKOutput([_0x2e53f2],_0xd433a2);return;}const _0x4c24af=resolveOutputOptions(_0xd433a2),_0x499255=await formatSingleObject(_0x2e53f2,_0x4c24af);await writeOutput(_0x499255,_0x4c24af['output']||undefined,_0x4c24af[_0x3fcae0(0xb5)]);}