@treasuredata/tdx 0.14.3 → 0.14.5

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 (170) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.d.ts +1 -1
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli-categories.js.map +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +1 -1
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/activations.js +1 -1
  10. package/dist/commands/agent-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.d.ts +0 -4
  15. package/dist/commands/claude-command.d.ts.map +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-command.js.map +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/llm-proxy.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.d.ts +1 -1
  32. package/dist/commands/profile-command.d.ts.map +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profile-command.js.map +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.d.ts +18 -0
  49. package/dist/commands/unset-command.d.ts.map +1 -0
  50. package/dist/commands/unset-command.js +1 -0
  51. package/dist/commands/unset-command.js.map +1 -0
  52. package/dist/commands/use-command.d.ts.map +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/use-command.js.map +1 -1
  55. package/dist/commands/user-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/profile.d.ts +18 -0
  66. package/dist/core/profile.d.ts.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/profile.js.map +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.d.ts +11 -0
  71. package/dist/core/session.d.ts.map +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/session.js.map +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/proxy/anthropic-adapter.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  81. package/dist/proxy/context-signature.js +1 -1
  82. package/dist/proxy/conversation-utils.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/server.js +1 -1
  85. package/dist/proxy/session-cache.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/endpoints.js +1 -1
  93. package/dist/sdk/client/engage-api-client.js +1 -1
  94. package/dist/sdk/client/http-client.js +1 -1
  95. package/dist/sdk/client/llm-api-client.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/engage.js +1 -1
  103. package/dist/sdk/errors.js +1 -1
  104. package/dist/sdk/index.js +1 -1
  105. package/dist/sdk/io/index.js +1 -1
  106. package/dist/sdk/io/node-filesystem.js +1 -1
  107. package/dist/sdk/job.js +1 -1
  108. package/dist/sdk/journey.js +1 -1
  109. package/dist/sdk/llm/chat-cache.js +1 -1
  110. package/dist/sdk/llm/index.js +1 -1
  111. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  112. package/dist/sdk/llm/model-aliases.js +1 -1
  113. package/dist/sdk/llm/model-factors.js +1 -1
  114. package/dist/sdk/query/index.js +1 -1
  115. package/dist/sdk/query/sql-parser.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-yaml.js +1 -1
  121. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  122. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  123. package/dist/sdk/segment/pull-workflow.js +1 -1
  124. package/dist/sdk/segment/push-workflow.js +1 -1
  125. package/dist/sdk/segment/resolution-context.js +1 -1
  126. package/dist/sdk/segment/segment-path-parser.js +1 -1
  127. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  128. package/dist/sdk/segment/target-resolution.js +1 -1
  129. package/dist/sdk/segment/tdx-config.js +1 -1
  130. package/dist/sdk/segment/validate-files.js +1 -1
  131. package/dist/sdk/segment/yaml-validator.js +1 -1
  132. package/dist/sdk/segment.js +1 -1
  133. package/dist/sdk/types/index.d.ts +1 -0
  134. package/dist/sdk/types/index.d.ts.map +1 -1
  135. package/dist/sdk/types/index.js +1 -1
  136. package/dist/sdk/types/index.js.map +1 -1
  137. package/dist/sdk/types/progress.js +1 -1
  138. package/dist/sdk/user.js +1 -1
  139. package/dist/sdk/util/format-detector.js +1 -1
  140. package/dist/sdk/util/formatters.js +1 -1
  141. package/dist/sdk/util/index.js +1 -1
  142. package/dist/sdk/util/tree-formatter.js +1 -1
  143. package/dist/sdk/workflow/clone-workflow.js +1 -1
  144. package/dist/sdk/workflow/index.js +1 -1
  145. package/dist/sdk/workflow/pull-workflow.js +1 -1
  146. package/dist/sdk/workflow/push-workflow.js +1 -1
  147. package/dist/sdk/workflow/tdx-config.js +1 -1
  148. package/dist/sdk/workflow/workflow-utils.js +1 -1
  149. package/dist/utils/async.js +1 -1
  150. package/dist/utils/colors.js +1 -1
  151. package/dist/utils/diff.js +1 -1
  152. package/dist/utils/file-permissions.js +1 -1
  153. package/dist/utils/json-loader.js +1 -1
  154. package/dist/utils/option-validation.js +1 -1
  155. package/dist/utils/port.js +1 -1
  156. package/dist/utils/process.d.ts +25 -1
  157. package/dist/utils/process.d.ts.map +1 -1
  158. package/dist/utils/process.js +1 -1
  159. package/dist/utils/process.js.map +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.d.ts +3 -0
  162. package/dist/utils/spinner.d.ts.map +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/spinner.js.map +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- function a38_0x7b70(){const _0x33a318=['targetExists','No\x20workflow\x20sessions\x20found','error','Filter:\x20','showWorkflowConsoleUrl','Pull\x20workflow\x20project\x20to\x20local\x20folder','resolveProjectId','follow','get','format','\x20\x20Source:\x20','running','workflow:upload','table','Including\x20subtasks:\x20yes','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','Analyzing\x20changes...','\x0aPush\x20these\x20changes?','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','fill','unknown','Project:\x20','renderSessionsTimeline','unchanged','\x20\x20Location:\x20','219744CMhpFz','find','Kill\x20a\x20running\x20attempt','force','Retry\x20a\x20session\x20or\x20attempt','...','\x0a✔\x20No\x20changes\x20to\x20push','\x20\x20Revision:\x20','✔\x20Workflow\x20project\x20context\x20cleared.','parseProjectWorkflowPattern','Status:\x20','Resume\x20from:\x20','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','workflow:run','red','readFile','workflow:tasks','workflowProject','filter','workflowName','87YojkcH','5AxtAcj','duration','workflow:sessions','Pattern:\x20','✔\x20Downloaded\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','hasChanges','finishedAt','Revision:\x20','\x20(use\x20--limit\x20to\x20show\x20more)','total','filesExtracted','5735436cRKRwD','state','workflow:projects','sessionTime','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','autocomplete','📁\x20','sys','MAX_TIMELINE_WIDTH','workflow:attempts','Pulling\x20project\x20','No\x20attempts\x20found\x20for:\x20','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','setSecret','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','Project\x20name\x20is\x20required','basename','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','Show\x20logs\x20for\x20a\x20workflow\x20attempt','\x20-\x20','fileSize','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','getHours','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','🔄\x20','param','session','resolveProjectDir','sessionId','sessions','Analyzing\x20project...','toLowerCase','delete','revision','MAX_TASKS_DISPLAY','workflow:secrets:set','Loading\x20sessions...','done','\x20session','modified','\x20task','cyan','tasks','match','sort','MIN_LABEL_COUNT','\x0aFailed\x20to\x20fetch\x20attempt\x20data','includeRetried','Listing\x20workflow\x20projects...','Cloning\x20to\x20','description','existingProjectId','No\x20projects\x20match\x20pattern:\x20','all','\x0aPolling...\x20(','✔\x20Found\x20','/attempt/','stdout','Dry\x20run:\x20yes','Show\x20specific\x20attempt\x20details','getFullYear','No\x20workflows\x20found','21888DEPQUw','Files\x20to\x20upload:\x20','1458541uXBrrM','some','substring','Usage:\x20workflow:delete\x20<project-name-or-id>','workflow','summary','icon','Key\x20cannot\x20be\x20empty','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','MIN_TIMELINE_WIDTH','workflow:pull','targetDir','Key:\x20','max','\x20attempt','\x20from\x20session\x20','min','\x0aDry\x20run\x20-\x20no\x20files\x20written','✔\x20Deleted\x20project\x20','✔\x20Pushed\x20','localeCompare','\x20modified','Start\x20a\x20workflow\x20run','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','\x20\x20Session\x20ID:\x20','run','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','write','columns','group_error','Session\x20not\x20found:\x20','Writing\x20files...','start','/sessions/','deleteSecret','renderSingleTimeline','Attempt\x20ID:\x20','\x22?\x20This\x20cannot\x20be\x20undone.','2258qDwamm','\x1b[1A\x1b[2K','changes','includes','Project\x20name:\x20','54klBZgJ','workflow:download','repeat','retrySession','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','padStart','\x20sessions\x20','attempt:','\x27\x20from\x20project\x20\x27','dim','---\x20','trim','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','length','requireProject','attempts','taskName','revision:\x20','Deleting\x20project\x20','window','Error:\x20KEY=VALUE\x20is\x20required','metadata','GUTTER','durationMs','relative','getMonth','message','Cancelled','stat','Filter:\x20project=','values','getTime','every','MAX_POLL_ITERATIONS','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','now','renderTimeline','\x0a✔\x20Already\x20up\x20to\x20date','\x0aApply\x20these\x20changes?','No\x20workflows\x20found\x20in\x20project:\x20','Target\x20directory:\x20','✔\x20Retry\x20started','Starting\x20workflow\x20run...','workflow:attempt','lastAttempt','Select\x20a\x20workflow\x20to\x20run','workflows','jsonl','skipValidation','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','TASK_NAME_WIDTH','\x20deleted','select','Error:\x20Secret\x20key\x20is\x20required','(unknown)','Updating\x20','Source\x20directory\x20is\x20required','✔\x20Workflow\x20run\x20started','No\x20log\x20content\x20found','session:','new','displayLine','\x0a⚠\x20Project\x20\x22','task','diff','cancelRequested','sourceDir','Task\x20name:\x20','resolve','Deleting\x20secret...','Reason:\x20','pollTimeline','success','1580yjZrSX','Total:\x20','Getting\x20attempt\x20details...','retryAttempt','\x20\x20Project\x20ID:\x20','Validation:\x20skipped','join','12078000ogxeoO','isArray','projectId','\x20has\x20no\x20attempts','resolveProject','Pushing\x20workflow\x20project...','fromTask','blue','No\x20sessions\x20found\x20in\x20project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Attempt\x20ID:\x20','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','tdx\x20wf\x20attempt\x20','generateSessionTimelineRows','New\x20project\x20name:\x20','(use\x20--limit\x20to\x20see\x20more)','planned','pending','prepareCloneProject','has','workflow:timeline','Listing\x20secrets...','Select\x20a\x20task\x20to\x20view\x20logs:','Setting\x20secret...','Getting\x20attempt\x20tasks...','⚠\x20Showing\x20first\x20','No\x20workflow\x20projects\x20found','output','Listing\x20workflows...','floor','Workflow:\x20','POLL_INTERVAL_MS','isDirectory','applyPullProject','listSecrets','project','stringify','No\x20workflow\x20tdx.json\x20found','title','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Source:\x20','status','List\x20workflows','✔\x20Clone\x20complete','workflow:kill','Error:\x20Invalid\x20parameter\x20format:\x20','workflow:workflows','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','workflow:secrets:delete','fullName','replace','Error:\x20Attempt\x20ID\x20is\x20required','slice','No\x20sessions\x20found\x20for:\x20','end','reason','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','push','resumeFrom','Select\x20a\x20session\x20to\x20view\x20timeline:','split','name','\x20\x20Session\x20context\x20set\x20to:\x20','\x20\x20Files\x20extracted:\x20','\x20\x20Project:\x20','No\x20sessions\x20found','\x20to\x20see\x20detailed\x20logs','yes','fs/promises','LABEL_WIDTH_DIVISOR','execute','attemptId','Downloading\x20project\x20','projectName','attempt','\x20secret','getDate','✔\x20Project:\x20','yellow','✔\x20Pull\x20complete','\x27...','\x20unchanged','retryAttemptName','canceling','LABEL_MIN_SPACING','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','startedAt','MAX_LABEL_COUNT','limit','Error:','list','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','trimEnd','logFiles','workflow:retry','isTTY','List\x20all\x20workflow\x20projects','kill','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','context','cwd','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','executeCloneProject','✔\x20Project\x20updated','data','newProjectId','navigateSessionsInteractive','Retrying\x20session...','pullProject','Error:\x20Project\x20name\x20is\x20required','startTime','newProjectName','green','utf-8','workflow:push','✔\x20Push\x20complete','\x20\x20Changes:\x20','\x20new','updatedAt','\x20logs','Source\x20directory:\x20','1225481WnnoVr','projects','json','site','buildTimelineData','Tip:\x20cd\x20to\x20workflows/','Source\x20project:\x20','Loading\x20workflows...','Loading\x20session...','workflow:secrets:list','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','keys','Invalid\x20format:\x20','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>',',\x20Workflow:\x20','workflow:clone','No\x20log\x20files\x20found\x20for\x20this\x20attempt','ICON_SPACING','key','indexOf','dryRun','No\x20attempts\x20found\x20in\x20project:\x20','\x20\x20Console:\x20','map','Failed\x20to\x20fetch\x20attempt\x20data','Resolving\x20project\x20\x27','ICON_WIDTH','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','\x0aUpdate\x20existing\x20project\x20\x22','workflow:logs','Error:\x20Invalid\x20JSON\x20in\x20--params','List\x20workflow\x20execution\x20sessions','startsWith','\x0aDry\x20run\x20-\x20no\x20project\x20created','Attempt:\x20','log','from','List\x20workflow\x20attempts','index','\x20\x20tdx\x20wf\x20use\x20<project>','Retrying\x20attempt...','deleted','fileCount','Output\x20directory:\x20','Listing\x20workflow\x20sessions...','parse','createdAt','✔\x20Secret\x20\x27','isNewProject','verbose'];a38_0x7b70=function(){return _0x33a318;};return a38_0x7b70();}const a38_0x3ccc70=a38_0x1c90;(function(_0x2bfa6a,_0x27b830){const _0x80e713=a38_0x1c90,_0x21f4f2=_0x2bfa6a();while(!![]){try{const _0x284315=parseInt(_0x80e713(0x206))/0x1+-parseInt(_0x80e713(0x136))/0x2*(parseInt(_0x80e713(0xc0))/0x3)+parseInt(_0x80e713(0xcf))/0x4*(-parseInt(_0x80e713(0xc1))/0x5)+parseInt(_0x80e713(0x13b))/0x6*(parseInt(_0x80e713(0x110))/0x7)+parseInt(_0x80e713(0x252))/0x8+-parseInt(_0x80e713(0x10e))/0x9*(-parseInt(_0x80e713(0x185))/0xa)+-parseInt(_0x80e713(0x18c))/0xb;if(_0x284315===_0x27b830)break;else _0x21f4f2['push'](_0x21f4f2['shift']());}catch(_0x33e61b){_0x21f4f2['push'](_0x21f4f2['shift']());}}}(a38_0x7b70,0xe76a0));function a38_0x1c90(_0x5a3b76,_0x1fd5c9){_0x5a3b76=_0x5a3b76-0xb7;const _0x7b70fe=a38_0x7b70();let _0x1c90b2=_0x7b70fe[_0x5a3b76];return _0x1c90b2;}import a38_0x39faf3 from'chalk';import{existsSync}from'fs';import a38_0x1ded24 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}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 a38_0x2ed35b from'prompts';function getAttemptStatusDisplay(_0x371c5e){const _0x1b3a14=a38_0x1c90;if(!_0x371c5e)return{'icon':'⏳','text':''};const {done:_0x29aed0,success:_0x29e918,cancelRequested:_0x5d4bf5}=_0x371c5e;if(!_0x29aed0)return _0x5d4bf5?{'icon':'🛑','text':a38_0x39faf3[_0x1b3a14(0x1db)](_0x1b3a14(0x1e0))}:{'icon':'🔄','text':a38_0x39faf3['blue'](_0x1b3a14(0x243))};if(_0x29e918)return{'icon':'✅','text':a38_0x39faf3['green'](_0x1b3a14(0x184))};return{'icon':'❌','text':a38_0x39faf3[_0x1b3a14(0xba)](_0x1b3a14(0x23a))};}export class WorkflowBaseCommand extends BaseCommand{[a38_0x3ccc70(0x190)](_0xbddd0a,_0x3ceea7,_0x1049fe=0x0){const _0x20a5ae=a38_0x3ccc70;return _0xbddd0a[_0x1049fe]||_0x3ceea7[_0x20a5ae(0xbd)];}[a38_0x3ccc70(0x149)](_0x2e24e4,_0x58cea1,_0x40880c=0x0){const _0x167c91=a38_0x3ccc70,_0x29de03=this[_0x167c91(0x190)](_0x2e24e4,_0x58cea1,_0x40880c);if(!_0x29de03)return console[_0x167c91(0x23a)](a38_0x39faf3['red'](_0x167c91(0x1e6)),_0x167c91(0xdf)),console['error'](a38_0x39faf3[_0x167c91(0x144)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),null;return _0x29de03;}['parseProjectWorkflowPattern'](_0x2ddee9,_0x45348f){const _0xc0e0d=a38_0x3ccc70;if(_0x2ddee9[0x0]){const _0x264dc4=_0x2ddee9[0x0][_0xc0e0d(0x1c9)]('.');if(_0x264dc4[_0xc0e0d(0x148)]===0x1)return{'projectName':_0x264dc4[0x0],'workflowName':undefined};else return _0x264dc4[_0xc0e0d(0x148)]===0x2?{'projectName':_0x264dc4[0x0],'workflowName':_0x264dc4[0x1]}:(console['error'](a38_0x39faf3[_0xc0e0d(0xba)](_0xc0e0d(0x1e6)),_0xc0e0d(0xd3)),null);}return{'projectName':_0x45348f[_0xc0e0d(0xbd)],'workflowName':undefined};}[a38_0x3ccc70(0xeb)](_0x3b9d8a,_0x37968a,_0x4828a6=0x0){const _0x5c8e1e=a38_0x3ccc70;if(_0x3b9d8a[_0x4828a6])return _0x3b9d8a[_0x4828a6];if(_0x37968a[_0x5c8e1e(0xbd)]){const _0xfbfb31=a38_0x1ded24['join'](process[_0x5c8e1e(0x1f1)](),_0x5c8e1e(0x16a),_0x37968a[_0x5c8e1e(0xbd)]);if(existsSync(a38_0x1ded24[_0x5c8e1e(0x18b)](_0xfbfb31,'tdx.json')))return _0xfbfb31;}return undefined;}async[a38_0x3ccc70(0x23c)](_0x50318c,_0x44c425,_0x3a4fcf){const _0x17e386=a38_0x3ccc70;try{const _0x12743a=await _0x50318c[_0x17e386(0x114)][_0x17e386(0x16a)](_0x44c425,{'limit':0x1});if(_0x12743a[_0x17e386(0x148)]>0x0){const _0xcaa383=_0x12743a[0x0]['id'],_0x2400b6=getWorkflowUrl(_0x3a4fcf,_0xcaa383);console[_0x17e386(0x23a)]('\x20\x20Console:\x20'+a38_0x39faf3[_0x17e386(0xf9)](_0x2400b6));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]='workflow:use';['description']=a38_0x3ccc70(0xe5);async['execute'](_0x219be9){const _0x3fdc89=a38_0x3ccc70,{options:_0x4d0986,args:_0x1620c1,tdx:_0x1239d9}=_0x219be9,_0x689871=_0x1620c1[0x0],_0x516663=_0x4d0986['clear'];if(_0x516663)return saveSessionContext({'workflow_project':undefined},_0x4d0986[_0x3fdc89(0xea)]),console[_0x3fdc89(0x229)](a38_0x39faf3[_0x3fdc89(0x1fd)](_0x3fdc89(0x25a))),0x0;if(!_0x689871)return console[_0x3fdc89(0x23a)](a38_0x39faf3[_0x3fdc89(0xba)](_0x3fdc89(0x1e6)),_0x3fdc89(0xdf)),console[_0x3fdc89(0x23a)](a38_0x39faf3[_0x3fdc89(0x144)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x3fdc89(0x23a)](a38_0x39faf3[_0x3fdc89(0x144)](_0x3fdc89(0xc6))),0x1;const _0x56263b=await withSpinner(_0x3fdc89(0x21f)+_0x689871+_0x3fdc89(0x1dd),()=>_0x1239d9[_0x3fdc89(0x114)][_0x3fdc89(0x23e)](_0x689871),{'verbose':_0x4d0986['verbose']}),{name:_0x46e773}=_0x56263b[_0x3fdc89(0x1f5)];return saveSessionContext({'workflow_project':_0x46e773},_0x4d0986['session']),console[_0x3fdc89(0x229)](a38_0x39faf3[_0x3fdc89(0x1fd)]('✔\x20Workflow\x20project\x20set\x20to:\x20'+a38_0x39faf3[_0x3fdc89(0xf9)](_0x46e773))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0xd1);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x1ed);async[a38_0x3ccc70(0x1d3)](_0x366895){const _0x2d4cc9=a38_0x3ccc70,{options:_0x3d4b93,args:_0x5d0072,tdx:_0x3e2379}=_0x366895,_0x409973=_0x5d0072[0x0];_0x3d4b93[_0x2d4cc9(0x237)]&&_0x409973&&console['error'](_0x2d4cc9(0xc4)+_0x409973);const _0x2a33dd=await withSpinner(_0x2d4cc9(0x100),()=>_0x3e2379[_0x2d4cc9(0x114)][_0x2d4cc9(0x207)](_0x409973,{'limit':_0x3d4b93[_0x2d4cc9(0x1e5)]}),{'verbose':_0x3d4b93[_0x2d4cc9(0x237)]});let _0x45bbc8=_0x2a33dd[_0x2d4cc9(0x1f5)];_0x45bbc8[_0x2d4cc9(0xfc)]((_0x4a62f0,_0x58f2e8)=>_0x4a62f0['name'][_0x2d4cc9(0x124)](_0x58f2e8[_0x2d4cc9(0x1ca)]));const _0xfd1471=_0x3d4b93['limit']||0x64,_0x2d7dac=_0x45bbc8[_0x2d4cc9(0x148)]>=_0xfd1471?a38_0x39faf3[_0x2d4cc9(0x144)](_0x2d4cc9(0xcc)):'';console['error'](_0x2d4cc9(0x107)+_0x45bbc8[_0x2d4cc9(0x148)]+'\x20project'+(_0x45bbc8['length']!==0x1?'s':'')+_0x2d7dac);if(_0x3d4b93[_0x2d4cc9(0x241)]===_0x2d4cc9(0x208)||_0x3d4b93['format']===_0x2d4cc9(0x16b)||_0x3d4b93[_0x2d4cc9(0x241)]===_0x2d4cc9(0x245))await handleSDKOutput(_0x45bbc8,_0x3d4b93);else{if(_0x45bbc8[_0x2d4cc9(0x148)]===0x0)_0x409973?console[_0x2d4cc9(0x229)](_0x2d4cc9(0x104)+_0x409973):console['log'](_0x2d4cc9(0x1a7));else{const _0x1c666c=_0x45bbc8[_0x2d4cc9(0x21d)](_0x28b2c9=>{const _0x270b42=_0x2d4cc9,_0x2eb7a4=_0x28b2c9[_0x270b42(0x150)]?.[_0x270b42(0x111)](_0x4e54a8=>_0x4e54a8['key']===_0x270b42(0xd6)),_0x4914b0=_0x2eb7a4?a38_0x39faf3[_0x270b42(0x144)]('\x20(system)'):'';return _0x270b42(0xd5)+_0x28b2c9[_0x270b42(0x1ca)]+_0x4914b0;});await writeOutput(_0x1c666c['join']('\x0a'),_0x3d4b93[_0x2d4cc9(0x1a8)],_0x2d4cc9(0x1e7));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x1bb);['description']=a38_0x3ccc70(0x1b7);async[a38_0x3ccc70(0x1d3)](_0x424193){const _0x23c8c4=a38_0x3ccc70,{options:_0xff9db9,args:_0x26141c,tdx:_0x32dbc3}=_0x424193,_0x393668=this[_0x23c8c4(0x190)](_0x26141c,_0xff9db9);_0xff9db9[_0x23c8c4(0x237)]&&_0x393668&&console[_0x23c8c4(0x23a)]('Project\x20filter:\x20'+_0x393668);const _0x3885d4=await withSpinner(_0x23c8c4(0x1a9),()=>_0x32dbc3[_0x23c8c4(0x114)][_0x23c8c4(0x16a)](_0x393668,{'limit':_0xff9db9[_0x23c8c4(0x1e5)]}),{'verbose':_0xff9db9[_0x23c8c4(0x237)]});let _0xf3239e=_0x3885d4[_0x23c8c4(0x1f5)];_0xf3239e[_0x23c8c4(0xfc)]((_0x338531,_0x3a5eb3)=>{const _0x362814=_0x23c8c4,_0x51a5b6=_0x338531['name'][_0x362814(0x124)](_0x3a5eb3[_0x362814(0x1ca)]);if(_0x51a5b6!==0x0)return _0x51a5b6;return(_0x338531['project']?.[_0x362814(0x1ca)]||'')[_0x362814(0x124)](_0x3a5eb3[_0x362814(0x1b0)]?.[_0x362814(0x1ca)]||'');});const _0x4e97fb=_0xff9db9[_0x23c8c4(0x1e5)]||0x64,_0x5389b8=_0xf3239e['length']>=_0x4e97fb?a38_0x39faf3[_0x23c8c4(0x144)](_0x23c8c4(0xcc)):'';console['error'](_0x23c8c4(0x107)+_0xf3239e[_0x23c8c4(0x148)]+'\x20workflow'+(_0xf3239e[_0x23c8c4(0x148)]!==0x1?'s':'')+_0x5389b8);if(_0xff9db9['format']===_0x23c8c4(0x208)||_0xff9db9['format']===_0x23c8c4(0x16b)||_0xff9db9[_0x23c8c4(0x241)]===_0x23c8c4(0x245))await handleSDKOutput(_0xf3239e,_0xff9db9);else{if(_0xf3239e[_0x23c8c4(0x148)]===0x0)_0x393668?console[_0x23c8c4(0x229)](_0x23c8c4(0x163)+_0x393668):console[_0x23c8c4(0x229)](_0x23c8c4(0x10d));else{const _0xfca326=_0xff9db9[_0x23c8c4(0x209)],_0x2dd0ec=_0xf3239e[_0x23c8c4(0x21d)](_0x1b0205=>{const _0x3920d2=_0x23c8c4,_0x24693d=a38_0x39faf3[_0x3920d2(0x144)]('#'+_0x1b0205['id']),_0x55b441=hyperlink(_0x24693d,getWorkflowUrl(_0xfca326,_0x1b0205['id'])),_0xff631d=_0x1b0205[_0x3920d2(0x1b0)]?.[_0x3920d2(0x1ca)]?a38_0x39faf3[_0x3920d2(0x144)]('\x20('+_0x1b0205[_0x3920d2(0x1b0)][_0x3920d2(0x1ca)]+')'):'';return'📋\x20'+_0x55b441+'\x20'+_0x1b0205[_0x3920d2(0x1ca)]+_0xff631d;});await writeOutput(_0x2dd0ec['join']('\x0a'),_0xff9db9[_0x23c8c4(0x1a8)],_0x23c8c4(0x1e7));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a38_0x3ccc70(0xc3);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x225);async['execute'](_0x30b380){const _0x38e4cf=a38_0x3ccc70,{options:_0x502756,args:_0x3b4da3,tdx:_0x5b8fcc}=_0x30b380,_0x467f93=this['parseProjectWorkflowPattern'](_0x3b4da3,_0x502756);if(!_0x467f93)return 0x1;const {projectName:_0x3e37c3,workflowName:_0x1f6dd7}=_0x467f93;if(_0x502756[_0x38e4cf(0x237)]){if(_0x3e37c3&&_0x1f6dd7)console[_0x38e4cf(0x23a)]('Filter:\x20'+_0x3e37c3+'.'+_0x1f6dd7);else _0x3e37c3&&console[_0x38e4cf(0x23a)](_0x38e4cf(0x158)+_0x3e37c3);const _0x5014cd=_0x502756[_0x38e4cf(0x1b6)];_0x5014cd&&console[_0x38e4cf(0x23a)](_0x38e4cf(0x25c)+_0x5014cd);}let _0x3bd24c=0x28;if(process[_0x38e4cf(0x109)]['isTTY']&&!_0x502756['output']&&!_0x502756['format']){const _0x360ac8=process[_0x38e4cf(0x109)]['rows']||0x28;_0x3bd24c=Math[_0x38e4cf(0x11d)](0x14,Math['floor'](_0x360ac8*0x2/0x3));}const _0x311917=_0x502756[_0x38e4cf(0x1e5)]||_0x3bd24c,_0x389798=await withSpinner(_0x38e4cf(0x232),()=>_0x5b8fcc[_0x38e4cf(0x114)]['sessions']({'projectName':_0x3e37c3,'workflowName':_0x1f6dd7,'status':_0x502756[_0x38e4cf(0x1b6)],'fromTime':_0x502756[_0x38e4cf(0x22a)],'toTime':_0x502756['to'],'limit':_0x311917}),{'verbose':_0x502756[_0x38e4cf(0x237)]}),_0x2650c0=_0x389798[_0x38e4cf(0x1f5)];_0x2650c0[_0x38e4cf(0xfc)]((_0x3a15f8,_0x16a737)=>{const _0x5816c5=_0x38e4cf,_0xec8ebf=_0x3a15f8[_0x5816c5(0xd2)]||'',_0x33d2f4=_0x16a737[_0x5816c5(0xd2)]||'';return _0x33d2f4['localeCompare'](_0xec8ebf);});_0x2650c0['length']>=_0x311917?console[_0x38e4cf(0x23a)]('✔\x20Showing\x20'+_0x2650c0[_0x38e4cf(0x148)]+_0x38e4cf(0x141)+a38_0x39faf3[_0x38e4cf(0x144)](_0x38e4cf(0x19c))):console[_0x38e4cf(0x23a)](_0x38e4cf(0x107)+_0x2650c0['length']+_0x38e4cf(0xf6)+(_0x2650c0['length']!==0x1?'s':''));if(_0x502756[_0x38e4cf(0x241)]===_0x38e4cf(0x208)||_0x502756[_0x38e4cf(0x241)]===_0x38e4cf(0x16b)||_0x502756['format']===_0x38e4cf(0x245))await handleSDKOutput(_0x2650c0,_0x502756);else{if(!process['stdout'][_0x38e4cf(0x1ec)]||_0x502756[_0x38e4cf(0x1a8)]){if(_0x2650c0[_0x38e4cf(0x148)]===0x0){if(_0x3e37c3&&_0x1f6dd7)console[_0x38e4cf(0x229)](_0x38e4cf(0x1c2)+_0x3e37c3+'.'+_0x1f6dd7);else _0x3e37c3?console[_0x38e4cf(0x229)]('No\x20sessions\x20found\x20in\x20project:\x20'+_0x3e37c3):console['log'](_0x38e4cf(0x1ce));}else{const _0xa653a7=_0x502756[_0x38e4cf(0x209)],_0xdca772=this[_0x38e4cf(0x24f)](_0x2650c0,_0xa653a7);_0x502756[_0x38e4cf(0x1a8)]?await writeOutput(_0xdca772,_0x502756[_0x38e4cf(0x1a8)],_0x38e4cf(0x1e7)):console[_0x38e4cf(0x229)](_0xdca772);}!_0x3e37c3&&(console[_0x38e4cf(0x23a)](''),console[_0x38e4cf(0x23a)](a38_0x39faf3[_0x38e4cf(0x144)](_0x38e4cf(0x127))),console[_0x38e4cf(0x23a)](a38_0x39faf3[_0x38e4cf(0x144)](_0x38e4cf(0x147))+'or'+a38_0x39faf3[_0x38e4cf(0x144)](_0x38e4cf(0x22d))));}else{if(_0x2650c0[_0x38e4cf(0x148)]===0x0){if(_0x3e37c3&&_0x1f6dd7)console[_0x38e4cf(0x229)](_0x38e4cf(0x1c2)+_0x3e37c3+'.'+_0x1f6dd7);else _0x3e37c3?console[_0x38e4cf(0x229)](_0x38e4cf(0x194)+_0x3e37c3):console['log'](_0x38e4cf(0x1ce));}else await this[_0x38e4cf(0x1f7)](_0x2650c0,_0x30b380,_0x3e37c3);}}return 0x0;}[a38_0x3ccc70(0x24f)](_0x223544,_0x15ccce){const _0x24227b=a38_0x3ccc70,_0x4977d0=[],_0x5c5a78=new Map();let _0xf03607=Infinity,_0x2b8dbe=-Infinity;for(const _0x56a8bf of _0x223544){if(_0x56a8bf[_0x24227b(0x168)]?.[_0x24227b(0x234)]){const _0x2e1ce6=new Date(_0x56a8bf[_0x24227b(0x168)][_0x24227b(0x234)])[_0x24227b(0x15a)](),_0x338f1b=_0x56a8bf[_0x24227b(0x168)]['finishedAt']?new Date(_0x56a8bf['lastAttempt'][_0x24227b(0xca)])[_0x24227b(0x15a)]():Date[_0x24227b(0x15f)](),_0x5659fd=_0x56a8bf[_0x24227b(0x1b0)]?.[_0x24227b(0x1ca)]||_0x24227b(0x172);!_0x5c5a78[_0x24227b(0x1a0)](_0x5659fd)&&_0x5c5a78['set'](_0x5659fd,[]),_0x5c5a78[_0x24227b(0x240)](_0x5659fd)[_0x24227b(0x1c6)]({'session':_0x56a8bf,'startTime':_0x2e1ce6,'endTime':_0x338f1b,'duration':_0x338f1b-_0x2e1ce6}),_0xf03607=Math[_0x24227b(0x120)](_0xf03607,_0x2e1ce6),_0x2b8dbe=Math['max'](_0x2b8dbe,_0x338f1b);}}if(_0x5c5a78['size']===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x1340be=process['stdout'][_0x24227b(0x12c)]||0x78,_0x45088f=0x1e,_0x6a361e=0x32,_0x308579=0x4,_0x1abb24=Math[_0x24227b(0x120)](_0x6a361e,Math[_0x24227b(0x11d)](_0x45088f,Math[_0x24227b(0x1aa)](_0x1340be*0.3))),_0x380a85=_0x1340be-_0x1abb24-TIMELINE_CONFIG[_0x24227b(0x151)]-0x3-_0x308579,_0x54f00e=_0x2b8dbe-_0xf03607,_0x1f78ee=_0x54f00e/_0x1abb24,_0x1f3727=renderTimeAxis({'startTime':_0xf03607,'endTime':_0x2b8dbe,'durationMs':_0x54f00e,'msPerChar':_0x1f78ee},_0x1abb24),_0x32f2e9=[];for(const _0x1fb330 of _0x5c5a78[_0x24227b(0x159)]()){_0x32f2e9['push'](..._0x1fb330);}_0x32f2e9[_0x24227b(0xfc)]((_0x2e3726,_0xdbb7a0)=>_0xdbb7a0[_0x24227b(0x1fb)]-_0x2e3726['startTime']);const _0x1a2058=new Date(_0xf03607),_0xa3cf4a=formatDate(_0x1a2058),_0x43d5a7=_0x308579+TIMELINE_CONFIG[_0x24227b(0x220)]+TIMELINE_CONFIG[_0x24227b(0x217)]+_0x380a85,_0xc7599b='\x20'[_0x24227b(0x13d)](_0x43d5a7-_0xa3cf4a['length']),_0x268f94=_0xc7599b+a38_0x39faf3[_0x24227b(0x144)](_0xa3cf4a)+'\x20'+_0x1f3727;_0x4977d0[_0x24227b(0x1c6)](_0x268f94);const _0x253ca4=0x16;let _0x5d9f46=0x0;for(const _0x41de29 of _0x32f2e9){const _0x3464ce=_0x41de29[_0x24227b(0xea)][_0x24227b(0x1b0)]?.['name']||'?',_0x556676=Math[_0x24227b(0x120)](stringWidth(_0x3464ce),_0x253ca4);_0x5d9f46=Math[_0x24227b(0x11d)](_0x5d9f46,_0x556676);}for(const _0x5e65ed of _0x32f2e9){const {session:_0x1ed580,startTime:_0x4d47bd,endTime:_0x366986,duration:_0x95c91a}=_0x5e65ed,_0xc42db7=_0x1ed580['project']?.['id'],_0x4d5fe8=_0x1ed580['id'],_0x20919f=_0x1ed580[_0x24227b(0x1b0)]?.[_0x24227b(0x1ca)]||'?',_0x5ee766=_0x1ed580[_0x24227b(0x114)]?.[_0x24227b(0x1ca)]||'?';let _0x51e297,_0x47cfc9;if(_0x1ed580[_0x24227b(0x168)]){const _0x2b83bb=_0x1ed580[_0x24227b(0x168)];!_0x2b83bb[_0x24227b(0xf5)]?(_0x51e297=_0x2b83bb[_0x24227b(0x17d)]?'🛑':'🔄',_0x47cfc9=_0x2b83bb[_0x24227b(0x17d)]?a38_0x39faf3['yellow']:a38_0x39faf3[_0x24227b(0x193)]):(_0x51e297=_0x2b83bb[_0x24227b(0x184)]?'✅':'❌',_0x47cfc9=_0x2b83bb[_0x24227b(0x184)]?a38_0x39faf3[_0x24227b(0x1fd)]:a38_0x39faf3[_0x24227b(0xba)]);}else _0x51e297='⏳',_0x47cfc9=a38_0x39faf3['dim'];const _0x342554='#'+_0x4d5fe8,_0x121445=_0xc42db7?hyperlink(_0x342554,getWorkflowSessionUrl(_0x15ccce,_0xc42db7,_0x4d5fe8)):_0x342554;let _0x5563e9=_0x20919f;stringWidth(_0x20919f)>_0x253ca4&&(_0x5563e9=_0x20919f['slice'](0x0,_0x253ca4-0x1)+'…');const _0x2306c4=a38_0x39faf3[_0x24227b(0x144)](_0x5563e9),_0x49a6d5=stringWidth(_0x5563e9),_0x5cfc56='\x20'['repeat'](_0x5d9f46-stringWidth(_0x5563e9)+0x2),_0x3ba1bb='('+formatElapsed(_0x95c91a)+')',_0x1240f7=stringWidth(_0x3ba1bb),_0x4a4ce0=stringWidth(_0x342554),_0x4e9917=_0x4a4ce0+0x1+_0x49a6d5+_0x5cfc56[_0x24227b(0x148)],_0x5e2c61=_0x380a85-_0x4e9917-_0x1240f7-0x1-0x8;let _0x465aa9=_0x5ee766;stringWidth(_0x465aa9)>_0x5e2c61&&(_0x465aa9=_0x465aa9[_0x24227b(0x1c1)](0x0,_0x5e2c61-0x1)+'…');const _0x1f3844=_0x121445+'\x20'+_0x2306c4+_0x5cfc56+_0x465aa9,_0x236d2a=stringWidth(_0x1f3844),_0xca0d28=_0x380a85-_0x236d2a-_0x1240f7,_0x547de1=_0x1f3844+'\x20'['repeat'](Math[_0x24227b(0x11d)](0x1,_0xca0d28))+a38_0x39faf3[_0x24227b(0x144)](_0x3ba1bb),_0x15f06a=Math[_0x24227b(0x1aa)]((_0x4d47bd-_0xf03607)/_0x1f78ee),_0x16b037=Math[_0x24227b(0x1aa)]((_0x366986-_0xf03607)/_0x1f78ee),_0x4710e8=Math['max'](_0x15f06a+0x1,_0x16b037),_0x4c713b=new Array(_0x1abb24)[_0x24227b(0x24c)]('\x20');for(let _0x18b059=_0x15f06a;_0x18b059<Math['min'](_0x4710e8,_0x1abb24);_0x18b059++){_0x4c713b[_0x18b059]='─';}const _0x39d401=_0x4c713b['map'](_0x91226=>_0x91226==='\x20'?'\x20':_0x47cfc9(_0x91226))[_0x24227b(0x18b)]('');_0x4977d0[_0x24227b(0x1c6)](_0x51e297+'\x20'+_0x547de1+'│'+_0x39d401+'│');}return _0x4977d0['join']('\x0a');}async['navigateSessionsInteractive'](_0x3a515a,_0x1df783,_0x4a35f0){const _0x935f32=a38_0x3ccc70,{options:_0x317ff7,tdx:_0x1f6d44}=_0x1df783,_0x58ac85=_0x317ff7[_0x935f32(0x209)],{timelineRows:_0x4a2c64,timeAxisHeader:_0x2d1d3e}=this[_0x935f32(0x19a)](_0x3a515a,_0x58ac85),_0x326ab8=_0x4a2c64[_0x935f32(0xbe)](_0x19571d=>_0x19571d[_0x935f32(0x1d4)]);if(_0x326ab8[_0x935f32(0x148)]===0x0){const _0x3f0515=this[_0x935f32(0x24f)](_0x3a515a,_0x58ac85);console[_0x935f32(0x229)](_0x3f0515);!_0x4a35f0&&(console['error'](''),console[_0x935f32(0x23a)](a38_0x39faf3[_0x935f32(0x144)](_0x935f32(0x127))),console[_0x935f32(0x23a)](a38_0x39faf3[_0x935f32(0x144)](_0x935f32(0x147))+'or'+a38_0x39faf3[_0x935f32(0x144)](_0x935f32(0x22d))));return;}_0x2d1d3e&&console[_0x935f32(0x229)](_0x2d1d3e);const _0x5ab686=_0x4a2c64['filter'](_0x4bed89=>_0x4bed89[_0x935f32(0x1d4)])[_0x935f32(0x21d)](_0x2ae9ba=>({'title':_0x2ae9ba[_0x935f32(0x179)],'value':_0x2ae9ba[_0x935f32(0x1d4)]})),_0x561934=process[_0x935f32(0x109)]['rows']||0x3c,_0x4e2244=Math[_0x935f32(0x11d)](0x28,Math['floor'](_0x561934*0x2/0x3)),_0x56554b=await a38_0x2ed35b({'type':_0x935f32(0xd4),'name':_0x935f32(0x1d4),'message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x5ab686,'initial':-0x1,'limit':_0x4e2244,'clearFirst':!![],'fallback':{'title':'No\x20matching\x20sessions\x20found','value':null},'suggest':(_0x495791,_0x11ad2a)=>{const _0x52f851=_0x935f32;if(!_0x495791)return Promise[_0x52f851(0x180)](_0x11ad2a);const _0x16e33b=_0x11ad2a[_0x52f851(0xbe)](_0x26fa88=>{const _0x4d4f86=_0x52f851,_0x693e48=_0x26fa88;return _0x693e48[_0x4d4f86(0x1b3)]['toLowerCase']()[_0x4d4f86(0x139)](_0x495791[_0x4d4f86(0xef)]());});return Promise[_0x52f851(0x180)](_0x16e33b);}}),_0x2d8a95=()=>{const _0x482949=_0x935f32;process[_0x482949(0x109)][_0x482949(0x12b)](_0x482949(0x137)),process[_0x482949(0x109)][_0x482949(0x12b)](_0x482949(0x137)),process[_0x482949(0x109)][_0x482949(0x12b)]('\x1b[1A\x1b[2K');},_0x35dc74=_0x56554b&&_0x56554b[_0x935f32(0x1d4)]&&_0x56554b['attemptId']!==null&&_0x56554b['attemptId'][_0x935f32(0x146)]()!=='';if(!_0x35dc74){_0x2d8a95(),console['log'](a38_0x39faf3['dim'](_0x935f32(0x156)));return;}_0x2d8a95();const _0x45e203=_0x3a515a[_0x935f32(0x253)](_0x442ac4=>_0x442ac4[_0x935f32(0x168)]?.['id']===_0x56554b[_0x935f32(0x1d4)]);if(_0x45e203){const _0x9f3a70=_0x45e203['project']?.[_0x935f32(0x1ca)]||'?',_0x109614=_0x45e203[_0x935f32(0x114)]?.['name']||'?';console[_0x935f32(0x229)](_0x935f32(0x24e)+a38_0x39faf3['dim'](_0x9f3a70)+_0x935f32(0x214)+a38_0x39faf3[_0x935f32(0x144)](_0x109614));}const _0x429b62=new WorkflowTimelineCommand();await _0x429b62[_0x935f32(0x1d3)]({'args':[],'options':{..._0x317ff7,'attemptId':_0x56554b['attemptId']},'tdx':_0x1f6d44});}[a38_0x3ccc70(0x19a)](_0x2ae8b4,_0x15354c){const _0x52db12=a38_0x3ccc70,_0x197fa4=new Map();for(const _0x4fad8c of _0x2ae8b4){_0x4fad8c['id']&&_0x4fad8c[_0x52db12(0x168)]?.['id']&&_0x197fa4['set'](_0x4fad8c['id'],_0x4fad8c[_0x52db12(0x168)]['id']);}const _0x141569=[];let _0xd6072d='';const _0x12f795=this[_0x52db12(0x24f)](_0x2ae8b4,_0x15354c),_0xf5f325=_0x12f795[_0x52db12(0x1c9)]('\x0a');for(const _0x36802a of _0xf5f325){if(_0x36802a[_0x52db12(0x226)](_0x52db12(0x1ef))||_0x36802a[_0x52db12(0xfb)](/^\s+\d{4}-\d{2}-\d{2}/))_0xd6072d=_0x36802a;else{if(_0x36802a[_0x52db12(0xfb)](/^[✅❌🔄🛑⏳]/)){const _0x1f15ec=_0x36802a[_0x52db12(0xfb)](/#(\d+)/),_0x2c7b3e=_0x1f15ec?_0x1f15ec[0x1]:null,_0x244410=_0x2c7b3e?_0x197fa4[_0x52db12(0x240)](_0x2c7b3e)||null:null,_0x466517=_0x2ae8b4[_0x52db12(0x253)](_0x506fc1=>_0x506fc1['id']===_0x2c7b3e),_0x27470a=_0x466517?.[_0x52db12(0x1b0)]?.[_0x52db12(0x1ca)]||'';_0x141569[_0x52db12(0x1c6)]({'displayLine':_0x36802a,'attemptId':_0x244410,'projectName':_0x27470a});}}}return{'timelineRows':_0x141569,'timeAxisHeader':_0xd6072d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0xd8);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x22b);async[a38_0x3ccc70(0x1d3)](_0x20c22e){const _0x59603b=a38_0x3ccc70,{options:_0x48e4a6,args:_0x28f5e9,tdx:_0x28438e}=_0x20c22e,_0x55bfdd=this['parseProjectWorkflowPattern'](_0x28f5e9,_0x48e4a6);if(!_0x55bfdd)return 0x1;const {projectName:_0x2b9b6d,workflowName:_0x189095}=_0x55bfdd,_0x1b7a38=_0x48e4a6[_0x59603b(0xff)];if(_0x48e4a6[_0x59603b(0x237)]){if(_0x2b9b6d&&_0x189095)console['error'](_0x59603b(0x23b)+_0x2b9b6d+'.'+_0x189095);else _0x2b9b6d&&console[_0x59603b(0x23a)](_0x59603b(0x158)+_0x2b9b6d);_0x1b7a38&&console[_0x59603b(0x23a)]('Include\x20retried:\x20yes');}const _0x1bf66b=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x28438e[_0x59603b(0x114)][_0x59603b(0x14a)]({'projectName':_0x2b9b6d,'workflowName':_0x189095,'includeRetried':_0x1b7a38,'limit':_0x48e4a6[_0x59603b(0x1e5)]}),{'verbose':_0x48e4a6['verbose']}),_0x56695f=_0x1bf66b['data'],_0x26ee5b=_0x48e4a6[_0x59603b(0x1e5)]||0x64,_0x14015d=_0x56695f[_0x59603b(0x148)]>=_0x26ee5b?a38_0x39faf3[_0x59603b(0x144)](_0x59603b(0xcc)):'';console[_0x59603b(0x23a)](_0x59603b(0x107)+_0x56695f[_0x59603b(0x148)]+_0x59603b(0x11e)+(_0x56695f['length']!==0x1?'s':'')+_0x14015d);if(_0x48e4a6[_0x59603b(0x241)]===_0x59603b(0x208)||_0x48e4a6[_0x59603b(0x241)]===_0x59603b(0x16b)||_0x48e4a6[_0x59603b(0x241)]===_0x59603b(0x245))await handleSDKOutput(_0x56695f,_0x48e4a6);else{if(_0x56695f[_0x59603b(0x148)]===0x0){if(_0x2b9b6d&&_0x189095)console['log'](_0x59603b(0xda)+_0x2b9b6d+'.'+_0x189095);else _0x2b9b6d?console[_0x59603b(0x229)](_0x59603b(0x21b)+_0x2b9b6d):console[_0x59603b(0x229)]('No\x20attempts\x20found');}else{const _0x494f6c=_0x48e4a6[_0x59603b(0x209)],_0xb9fc50=_0x56695f[_0x59603b(0x21d)](_0x1ff65d=>{const _0x175c96=_0x59603b,_0x56229a=a38_0x39faf3['dim']('#'+_0x1ff65d['id']),_0x337008=_0x1ff65d[_0x175c96(0x1b0)]?.['id'],_0x2d88f7=_0x1ff65d['session_id']||_0x1ff65d[_0x175c96(0xec)],_0x565643=_0x337008&&_0x2d88f7?hyperlink(_0x56229a,getWorkflowAttemptUrl(_0x494f6c,_0x337008,_0x2d88f7,_0x1ff65d['id'])):_0x56229a,{icon:_0x443182,text:_0x535b60}=getAttemptStatusDisplay(_0x1ff65d),_0x360d20=(_0x1ff65d['project']?.[_0x175c96(0x1ca)]||'?')+'.'+(_0x1ff65d['workflow']?.[_0x175c96(0x1ca)]||'?'),_0x4a9516=_0x1ff65d[_0x175c96(0xd2)]?a38_0x39faf3[_0x175c96(0x144)](_0x1ff65d[_0x175c96(0xd2)]):'';return(_0x565643+'\x20'+_0x443182+(_0x535b60?'\x20'+_0x535b60:'')+'\x20'+_0x360d20+'\x20'+_0x4a9516)[_0x175c96(0x1e9)]();});await writeOutput(_0xb9fc50['join']('\x0a'),_0x48e4a6['output'],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x167);['description']=a38_0x3ccc70(0x10b);async['execute'](_0x30b7ea){const _0x2e6758=a38_0x3ccc70,{options:_0x452ece,args:_0x418dbe,tdx:_0x1ef2dd}=_0x30b7ea,_0x3911a9=_0x418dbe[0x0];if(!_0x3911a9)return console[_0x2e6758(0x23a)](_0x2e6758(0x1c0)),0x1;_0x452ece[_0x2e6758(0x237)]&&console[_0x2e6758(0x23a)](_0x2e6758(0x134)+_0x3911a9);const _0x3a0674=await withSpinner(_0x2e6758(0x187),()=>_0x1ef2dd[_0x2e6758(0x114)][_0x2e6758(0x1d7)](_0x3911a9),{'verbose':_0x452ece[_0x2e6758(0x237)]}),_0x1d28d4=_0x3a0674[_0x2e6758(0x1f5)];let _0x328e7e;!_0x1d28d4[_0x2e6758(0xf5)]?_0x328e7e=_0x1d28d4[_0x2e6758(0x17d)]?_0x2e6758(0x1e0):_0x2e6758(0x243):_0x328e7e=_0x1d28d4[_0x2e6758(0x184)]?_0x2e6758(0x184):'error';let _0x239663;if(_0x1d28d4[_0x2e6758(0x234)]&&_0x1d28d4[_0x2e6758(0xca)]){const _0x2e566a=new Date(_0x1d28d4[_0x2e6758(0x234)])[_0x2e6758(0x15a)](),_0x573257=new Date(_0x1d28d4[_0x2e6758(0xca)])[_0x2e6758(0x15a)]();_0x239663=Math['round']((_0x573257-_0x2e566a)/0x3e8);}const _0x1b5b31={'attempt_id':_0x1d28d4['id'],'status':_0x328e7e,..._0x1d28d4[_0x2e6758(0x22c)]!==undefined&&{'index':_0x1d28d4[_0x2e6758(0x22c)]},..._0x1d28d4[_0x2e6758(0x1b0)]&&{'project':_0x1d28d4[_0x2e6758(0x1b0)][_0x2e6758(0x1ca)]},..._0x1d28d4[_0x2e6758(0x114)]&&{'workflow':_0x1d28d4['workflow'][_0x2e6758(0x1ca)]},..._0x1d28d4['sessionId']&&{'session_id':_0x1d28d4[_0x2e6758(0xec)]},..._0x1d28d4[_0x2e6758(0xd2)]&&{'session_time':_0x1d28d4[_0x2e6758(0xd2)]},..._0x1d28d4['retryAttemptName']&&{'retry_attempt':_0x1d28d4[_0x2e6758(0x1df)]},..._0x239663!==undefined&&{'duration_sec':_0x239663},..._0x1d28d4['createdAt']&&{'created_at':_0x1d28d4[_0x2e6758(0x234)]},..._0x1d28d4['finishedAt']&&{'finished_at':_0x1d28d4[_0x2e6758(0xca)]},...Object[_0x2e6758(0x211)](_0x1d28d4['params'])[_0x2e6758(0x148)]>0x0&&{'params':_0x1d28d4['params']}};return await handleSingleObjectOutput(_0x1b5b31,_0x452ece),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0xbc);[a38_0x3ccc70(0x102)]='Show\x20tasks\x20for\x20an\x20attempt';async[a38_0x3ccc70(0x1d3)](_0x7328ef){const _0x345201=a38_0x3ccc70,{options:_0x5416c4,args:_0x470302,tdx:_0x142c66}=_0x7328ef,_0x5c207b=_0x470302[0x0];if(!_0x5c207b)return console[_0x345201(0x23a)](_0x345201(0x1c0)),0x1;const _0x1130ff=_0x5416c4['includeSubtasks'];_0x5416c4[_0x345201(0x237)]&&(console[_0x345201(0x23a)](_0x345201(0x134)+_0x5c207b),_0x1130ff&&console[_0x345201(0x23a)](_0x345201(0x246)));const _0x54b833=await withSpinner(_0x345201(0x1a5),()=>_0x142c66[_0x345201(0x114)][_0x345201(0xfa)](_0x5c207b,_0x1130ff||![]),{'verbose':_0x5416c4[_0x345201(0x237)]}),_0x10fc80=_0x54b833['data'];return console[_0x345201(0x23a)](_0x345201(0x107)+_0x10fc80[_0x345201(0x148)]+_0x345201(0xf8)+(_0x10fc80['length']!==0x1?'s':'')),await handleSDKOutput(_0x10fc80,_0x5416c4),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x223);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0xe2);async[a38_0x3ccc70(0x1d3)](_0x2ee223){const _0x58731e=a38_0x3ccc70,{options:_0x1c341e,args:_0x59075c,tdx:_0x236b3b}=_0x2ee223,_0x171d3b=_0x59075c[0x0];let _0x385d72=_0x59075c[0x1];if(!_0x171d3b)return console[_0x58731e(0x23a)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x1c341e[_0x58731e(0x237)]&&(console['error']('Attempt\x20ID:\x20'+_0x171d3b),_0x385d72&&console['error'](_0x58731e(0x17f)+_0x385d72));const _0xb696f8=await withSpinner('Fetching\x20log\x20files...',()=>_0x236b3b[_0x58731e(0x114)][_0x58731e(0x1ea)](_0x171d3b,_0x385d72),{'verbose':_0x1c341e['verbose']}),_0x531310=_0xb696f8[_0x58731e(0x1f5)];if(_0x531310[_0x58731e(0x148)]===0x0)return console['error'](_0x58731e(0x216)),0x0;if(!_0x385d72&&(_0x1c341e[_0x58731e(0x208)]||_0x1c341e[_0x58731e(0x241)]))return await handleSDKOutput(_0x531310,_0x1c341e),0x0;if(!_0x385d72){const _0x5c288b=_0x531310[_0x58731e(0x21d)](_0x24c156=>({'title':_0x24c156['taskName']+'\x20('+formatBytes(_0x24c156[_0x58731e(0xe4)])+')','value':_0x24c156[_0x58731e(0x14b)]})),_0x345d66=await a38_0x2ed35b({'type':'select','name':_0x58731e(0x17b),'message':_0x58731e(0x1a3),'choices':_0x5c288b});if(!_0x345d66[_0x58731e(0x17b)])return console[_0x58731e(0x23a)](_0x58731e(0x156)),0x0;_0x385d72=_0x345d66[_0x58731e(0x17b)];}const _0x5f2b5f=await withSpinner('Downloading\x20logs...',()=>_0x236b3b[_0x58731e(0x114)]['logs'](_0x171d3b,_0x385d72),{'verbose':_0x1c341e[_0x58731e(0x237)]}),_0x1de5b6=_0x5f2b5f[_0x58731e(0x1f5)];return _0x1de5b6?console[_0x58731e(0x229)](_0x1de5b6):console[_0x58731e(0x23a)](_0x58731e(0x176)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x1b9);['description']=a38_0x3ccc70(0x254);async['execute'](_0xcb9f26){const _0x218a18=a38_0x3ccc70,{options:_0x5e7c65,args:_0x1bca30,tdx:_0x27f919}=_0xcb9f26,_0x224f6b=_0x1bca30[0x0];if(!_0x224f6b)return console[_0x218a18(0x23a)](_0x218a18(0x1c0)),0x1;const _0xb9cd7d=_0x5e7c65[_0x218a18(0x1c4)];_0x5e7c65[_0x218a18(0x237)]&&(console[_0x218a18(0x23a)]('Attempt\x20ID:\x20'+_0x224f6b),_0xb9cd7d&&console['error'](_0x218a18(0x182)+_0xb9cd7d));if(!_0x5e7c65[_0x218a18(0x1d0)]){const _0x31ea1b=await confirmKey(_0x218a18(0x1e8)+_0x224f6b+'?');if(!_0x31ea1b)return console[_0x218a18(0x23a)](_0x218a18(0x156)),0x0;}const _0x2b32e6=await withSpinner('Killing\x20attempt...',()=>_0x27f919[_0x218a18(0x114)][_0x218a18(0x1ee)](_0x224f6b,_0xb9cd7d),{'verbose':_0x5e7c65[_0x218a18(0x237)]}),_0x22f834=_0x2b32e6['data'];return console['error']('✔\x20'+_0x22f834),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a38_0x3ccc70(0x1eb);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x256);async[a38_0x3ccc70(0x1d3)](_0x5d3dda){const _0x198170=a38_0x3ccc70,{options:_0x8e542c,args:_0x45317c,tdx:_0x3b04b1}=_0x5d3dda,_0x4e2570=_0x45317c[0x0];if(!_0x4e2570)return console['error']('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x198170(0x23a)](_0x198170(0x213)),0x1;let _0x254ddf=![],_0x39970f=_0x4e2570;if(_0x4e2570[_0x198170(0x226)](_0x198170(0x177)))_0x254ddf=!![],_0x39970f=_0x4e2570[_0x198170(0x112)](0x8);else{if(_0x4e2570[_0x198170(0x226)](_0x198170(0x142)))_0x254ddf=![],_0x39970f=_0x4e2570['substring'](0x8);else return console[_0x198170(0x23a)](_0x198170(0x1bc)),console[_0x198170(0x23a)](_0x198170(0x213)),0x1;}const _0x625fa2=_0x8e542c[_0x198170(0x192)],_0x5550ba=_0x8e542c[_0x198170(0x1c7)],_0x520c08=_0x8e542c['params'],_0x596393=_0x8e542c[_0x198170(0x255)];_0x8e542c[_0x198170(0x237)]&&(console[_0x198170(0x23a)]('Target:\x20'+(_0x254ddf?'session':'attempt')+'\x20'+_0x39970f),_0x625fa2&&console[_0x198170(0x23a)]('From\x20task:\x20'+_0x625fa2),_0x5550ba&&console[_0x198170(0x23a)](_0x198170(0xb7)+_0x5550ba),_0x520c08&&console[_0x198170(0x23a)]('Params:\x20'+_0x520c08),_0x596393&&console[_0x198170(0x23a)]('Force:\x20yes'));let _0x7c465;if(_0x520c08)try{if(_0x520c08[_0x198170(0x226)]('@')){const _0x49cfdb=await import(_0x198170(0x1d1)),_0x596f8c=_0x520c08[_0x198170(0x112)](0x1),_0x1b5562=await _0x49cfdb[_0x198170(0xbb)](_0x596f8c,_0x198170(0x1fe));_0x7c465=JSON[_0x198170(0x233)](_0x1b5562);}else _0x7c465=JSON['parse'](_0x520c08);}catch{return console[_0x198170(0x23a)](_0x198170(0x224)),0x1;}if(!_0x8e542c[_0x198170(0x1d0)]){const _0x2d2037=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x254ddf?_0x198170(0xea):_0x198170(0x1d7))+'\x20'+_0x39970f+'?');if(!_0x2d2037)return console[_0x198170(0x23a)](_0x198170(0x156)),0x0;}let _0x3539a2;_0x254ddf?_0x3539a2=await withSpinner(_0x198170(0x1f8),()=>_0x3b04b1['workflow'][_0x198170(0x13e)](_0x39970f,{'fromTask':_0x625fa2,'retryParams':_0x7c465}),{'verbose':_0x8e542c[_0x198170(0x237)]}):_0x3539a2=await withSpinner(_0x198170(0x22e),()=>_0x3b04b1[_0x198170(0x114)][_0x198170(0x188)](_0x39970f,{'resumeFrom':_0x5550ba,'retryParams':_0x7c465,'force':_0x596393}),{'verbose':_0x8e542c[_0x198170(0x237)]});const _0x1104ab=_0x3539a2[_0x198170(0x1f5)];return console[_0x198170(0x23a)](_0x198170(0x165)),console[_0x198170(0x23a)]('\x20\x20New\x20attempt\x20ID:\x20'+_0x1104ab[_0x198170(0x1d4)]),console['error'](_0x198170(0x128)+_0x1104ab[_0x198170(0xec)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0xb9);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x126);async[a38_0x3ccc70(0x1d3)](_0x592700){const _0x3cbd01=a38_0x3ccc70,{options:_0x5887ca,args:_0x322086,tdx:_0x3f78e6}=_0x592700;let _0x5732ca=_0x322086[0x0];if(!_0x5732ca){const _0x5b9480=this['resolveProject']([],_0x5887ca),_0x56af40=await withSpinner(_0x3cbd01(0x20d),()=>_0x3f78e6[_0x3cbd01(0x114)][_0x3cbd01(0x16a)](_0x5b9480,{'limit':_0x5887ca['limit']}),{'verbose':_0x5887ca[_0x3cbd01(0x237)]}),_0x200a39=_0x56af40[_0x3cbd01(0x1f5)];if(_0x200a39['length']===0x0)return console['error'](_0x3cbd01(0x10d)),!_0x5b9480&&console[_0x3cbd01(0x23a)](a38_0x39faf3[_0x3cbd01(0x144)](_0x3cbd01(0xb8))),0x1;const _0x12bfa2=_0x200a39[_0x3cbd01(0x21d)](_0x2bc977=>({'title':_0x2bc977[_0x3cbd01(0x1b0)]?.[_0x3cbd01(0x1ca)]+'.'+_0x2bc977['name'],'value':_0x2bc977['project']?.['name']+'.'+_0x2bc977['name'],'description':_0x2bc977[_0x3cbd01(0xf1)]?_0x3cbd01(0x14c)+_0x2bc977[_0x3cbd01(0xf1)]:undefined})),_0x195954=await a38_0x2ed35b({'type':_0x3cbd01(0x170),'name':'workflow','message':_0x3cbd01(0x169),'choices':_0x12bfa2});if(!_0x195954[_0x3cbd01(0x114)])return 0x1;_0x5732ca=_0x195954[_0x3cbd01(0x114)];}if(!_0x5732ca[_0x3cbd01(0x139)]('.')){const _0x487fb2=this[_0x3cbd01(0x190)]([],_0x5887ca);if(_0x487fb2)_0x5732ca=_0x487fb2+'.'+_0x5732ca;else return console[_0x3cbd01(0x23a)](a38_0x39faf3[_0x3cbd01(0xba)](_0x3cbd01(0x1e6)),_0x3cbd01(0xdc)),console[_0x3cbd01(0x23a)](a38_0x39faf3[_0x3cbd01(0x144)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x5b1685=_0x5887ca[_0x3cbd01(0xe9)],_0x11e3a0=_0x5887ca['sessionTime'],_0x431811={};if(_0x5b1685&&Array[_0x3cbd01(0x18d)](_0x5b1685))for(const _0x8110c4 of _0x5b1685){const _0x348769=_0x8110c4['indexOf']('=');if(_0x348769===-0x1)return console[_0x3cbd01(0x23a)](_0x3cbd01(0x1ba)+_0x8110c4),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x5184ae=_0x8110c4[_0x3cbd01(0x112)](0x0,_0x348769),_0x3558cd=_0x8110c4[_0x3cbd01(0x112)](_0x348769+0x1);try{_0x431811[_0x5184ae]=JSON[_0x3cbd01(0x233)](_0x3558cd);}catch{_0x431811[_0x5184ae]=_0x3558cd;}}_0x5887ca[_0x3cbd01(0x237)]&&(console[_0x3cbd01(0x23a)](_0x3cbd01(0x1ab)+_0x5732ca),Object['keys'](_0x431811)['length']>0x0&&console['error']('Parameters:\x20'+JSON[_0x3cbd01(0x1b1)](_0x431811)),_0x11e3a0&&console[_0x3cbd01(0x23a)]('Session\x20time:\x20'+_0x11e3a0));const _0x121da0=await withSpinner(_0x3cbd01(0x166),()=>_0x3f78e6[_0x3cbd01(0x114)][_0x3cbd01(0x129)](_0x5732ca,_0x431811,{'sessionTime':_0x11e3a0}),{'verbose':_0x5887ca[_0x3cbd01(0x237)]}),_0x476b9d=_0x121da0[_0x3cbd01(0x1f5)];console[_0x3cbd01(0x23a)](_0x3cbd01(0x175)),console['error'](_0x3cbd01(0x197)+_0x476b9d['id']),console[_0x3cbd01(0x23a)](_0x3cbd01(0x128)+_0x476b9d[_0x3cbd01(0xec)]),console[_0x3cbd01(0x23a)](_0x3cbd01(0x1cd)+_0x476b9d[_0x3cbd01(0x1b0)]?.['name']),console['error']('\x20\x20Workflow:\x20'+_0x476b9d['workflow']?.[_0x3cbd01(0x1ca)]);if(_0x476b9d['project']?.['id']&&_0x476b9d[_0x3cbd01(0xec)]&&_0x476b9d['id']){const _0x5c185d=_0x5887ca[_0x3cbd01(0x209)],_0x5926ab=getConsoleUrl(_0x5c185d,'/app/workflows/'+_0x476b9d[_0x3cbd01(0x1b0)]['id']+_0x3cbd01(0x131)+_0x476b9d[_0x3cbd01(0xec)]+_0x3cbd01(0x108)+_0x476b9d['id']);console[_0x3cbd01(0x23a)](_0x3cbd01(0x21c)+a38_0x39faf3['cyan'](_0x5926ab));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x13c);[a38_0x3ccc70(0x102)]='Download\x20workflow\x20project\x20from\x20Treasure\x20Data';async['execute'](_0x52aa6d){const _0x5d0ea5=a38_0x3ccc70,{options:_0x2d4987,args:_0x17f4c7,tdx:_0x30a1dc}=_0x52aa6d,_0x4c22ad=_0x17f4c7[0x0],_0x5e6100=_0x17f4c7[0x1]||'.';if(!_0x4c22ad)return console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x1fa)),console[_0x5d0ea5(0x23a)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x19836a=_0x2d4987[_0x5d0ea5(0xf1)];_0x2d4987[_0x5d0ea5(0x237)]&&(console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x24e)+_0x4c22ad),console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x231)+_0x5e6100),_0x19836a&&console['error'](_0x5d0ea5(0xcb)+_0x19836a));const _0x2fa612=await withSpinner(_0x5d0ea5(0x1d5)+_0x4c22ad+_0x5d0ea5(0x257),()=>_0x30a1dc['workflow']['download'](_0x4c22ad,_0x5e6100,{'revision':_0x19836a}),{'verbose':_0x2d4987[_0x5d0ea5(0x237)]}),_0x10bad4=_0x2fa612[_0x5d0ea5(0x1f5)];return console[_0x5d0ea5(0x23a)](_0x5d0ea5(0xc5)+_0x10bad4[_0x5d0ea5(0x1d6)]),console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x259)+_0x10bad4['revision']),console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x1cc)+_0x10bad4[_0x5d0ea5(0xce)]),console[_0x5d0ea5(0x23a)](_0x5d0ea5(0x251)+_0x5e6100+'/'+_0x10bad4[_0x5d0ea5(0x1d6)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x244);[a38_0x3ccc70(0x102)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a38_0x3ccc70(0x1d3)](_0x3911b6){const _0x18b6e2=a38_0x3ccc70,{options:_0x34cbfb,args:_0x4fc099,tdx:_0x471f66}=_0x3911b6;let _0xaa384f='.',_0x4a3710=_0x34cbfb[_0x18b6e2(0x1ca)];if(_0x4fc099[0x0]){const {promises:_0x178f67}=await import('fs');try{const _0x3fcf16=await _0x178f67[_0x18b6e2(0x157)](_0x4fc099[0x0]);if(_0x3fcf16[_0x18b6e2(0x1ad)]())_0xaa384f=_0x4fc099[0x0];else return console[_0x18b6e2(0x23a)]('Error:\x20'+_0x4fc099[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x4a3710=_0x4fc099[0x0],_0xaa384f='.';}}const _0x2e98ed=_0x34cbfb[_0x18b6e2(0xf1)],_0x920255=_0x34cbfb['skipValidation'];_0x34cbfb['verbose']&&(console[_0x18b6e2(0x23a)]('Project\x20directory:\x20'+_0xaa384f),_0x4a3710&&console[_0x18b6e2(0x23a)](_0x18b6e2(0x13a)+_0x4a3710),_0x2e98ed&&console[_0x18b6e2(0x23a)](_0x18b6e2(0xcb)+_0x2e98ed),_0x920255&&console['error'](_0x18b6e2(0x18a)));const _0x26cbaa=await withSpinner(_0x18b6e2(0x191),()=>_0x471f66['workflow'][_0x18b6e2(0x1c6)](_0xaa384f,{'projectName':_0x4a3710,'revision':_0x2e98ed,'skipValidation':_0x920255}),{'verbose':_0x34cbfb['verbose']}),_0x3dc645=_0x26cbaa['data'];return console[_0x18b6e2(0x23a)](_0x18b6e2(0x123)+_0x3dc645[_0x18b6e2(0x1d6)]),console[_0x18b6e2(0x23a)](_0x18b6e2(0x189)+_0x3dc645[_0x18b6e2(0x18e)]),console[_0x18b6e2(0x23a)]('\x20\x20Revision:\x20'+_0x3dc645[_0x18b6e2(0xf1)]),await this['showWorkflowConsoleUrl'](_0x471f66,_0x3dc645[_0x18b6e2(0x1d6)],_0x34cbfb['site']),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x11a);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x23d);async['execute'](_0x48edd8){const _0x1b8887=a38_0x3ccc70,{options:_0x20e524,args:_0x4b5586,tdx:_0x19e660}=_0x48edd8,_0x36165b=_0x4b5586[0x0],_0x1280dd=_0x4b5586[0x1];if(!_0x36165b)return console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0xba)](_0x1b8887(0x1e6)),_0x1b8887(0xdf)),console['error'](a38_0x39faf3[_0x1b8887(0x144)](_0x1b8887(0xdb))),0x1;const _0xd22ead=_0x20e524[_0x1b8887(0xf1)];_0x20e524['verbose']&&(console['error']('Project:\x20'+_0x36165b),_0x1280dd&&console['error'](_0x1b8887(0x164)+_0x1280dd),_0xd22ead&&console[_0x1b8887(0x23a)](_0x1b8887(0xcb)+_0xd22ead),_0x20e524[_0x1b8887(0x21a)]&&console[_0x1b8887(0x23a)]('Dry\x20run:\x20yes'));const _0x1453f4=await withSpinner(_0x1b8887(0xd9)+_0x36165b+'...',()=>_0x19e660['workflow'][_0x1b8887(0x1f9)](_0x36165b,{'targetDir':_0x1280dd,'revision':_0xd22ead}),{'verbose':_0x20e524[_0x1b8887(0x237)]}),_0x41370e=_0x1453f4[_0x1b8887(0x1f5)];_0x41370e[_0x1b8887(0x236)]?console[_0x1b8887(0x23a)]('✔\x20New\x20project:\x20'+_0x41370e[_0x1b8887(0x1d6)]):console['error'](_0x1b8887(0x1da)+_0x41370e[_0x1b8887(0x1d6)]);console[_0x1b8887(0x23a)](_0x1b8887(0x259)+_0x41370e['revision']),console[_0x1b8887(0x23a)]('\x20\x20Target:\x20'+(a38_0x1ded24[_0x1b8887(0x153)](process['cwd'](),_0x41370e[_0x1b8887(0x11b)])||'.')),console[_0x1b8887(0x23a)](_0x1b8887(0x201)+a38_0x39faf3[_0x1b8887(0x1fd)]('+'+_0x41370e[_0x1b8887(0x115)]['new']+_0x1b8887(0x202))+',\x20'+(a38_0x39faf3[_0x1b8887(0x1db)]('~'+_0x41370e[_0x1b8887(0x115)][_0x1b8887(0xf7)]+_0x1b8887(0x125))+',\x20')+(a38_0x39faf3[_0x1b8887(0xba)]('-'+_0x41370e[_0x1b8887(0x115)][_0x1b8887(0x22f)]+_0x1b8887(0x16f))+',\x20')+(''+a38_0x39faf3[_0x1b8887(0x144)](_0x41370e[_0x1b8887(0x115)][_0x1b8887(0x250)]+_0x1b8887(0x1de))));for(const _0x5a0cce of _0x41370e[_0x1b8887(0x138)]){_0x5a0cce['type']===_0x1b8887(0xf7)&&_0x5a0cce[_0x1b8887(0x17c)]&&(console[_0x1b8887(0x23a)]('\x0a'+a38_0x39faf3[_0x1b8887(0xf9)](_0x1b8887(0x145)+_0x5a0cce['path'])),console[_0x1b8887(0x23a)](_0x5a0cce[_0x1b8887(0x17c)]));}if(!_0x41370e[_0x1b8887(0xc9)])return saveSessionContext({'workflow_project':_0x41370e[_0x1b8887(0x1d6)]},_0x20e524['session']),console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0x1fd)](_0x1b8887(0x161))),console['error'](a38_0x39faf3['dim']('\x20\x20Session\x20context\x20set\x20to:\x20'+_0x41370e['projectName'])),0x0;if(_0x20e524[_0x1b8887(0x21a)])return console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0x1db)](_0x1b8887(0x121))),0x0;if(!_0x20e524[_0x1b8887(0x1d0)]){const _0x516b98=await confirmKey(_0x1b8887(0x162));if(!_0x516b98)return console[_0x1b8887(0x23a)]('Cancelled'),0x0;}await withSpinner(_0x1b8887(0x12f),()=>_0x19e660[_0x1b8887(0x114)][_0x1b8887(0x1ae)](_0x41370e,{'revision':_0xd22ead}),{'verbose':_0x20e524[_0x1b8887(0x237)]}),saveSessionContext({'workflow_project':_0x41370e[_0x1b8887(0x1d6)]},_0x20e524[_0x1b8887(0xea)]),console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0x1fd)](_0x1b8887(0x1dc)));const _0x4ee7a7=a38_0x1ded24[_0x1b8887(0x153)](process[_0x1b8887(0x1f1)](),_0x41370e['targetDir'])||'.';return console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0x144)]('\x20\x20Location:\x20'+_0x4ee7a7)),console[_0x1b8887(0x23a)](a38_0x39faf3[_0x1b8887(0x144)](_0x1b8887(0x1cb)+_0x41370e[_0x1b8887(0x1d6)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x1ff);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x198);async[a38_0x3ccc70(0x1d3)](_0x5a14a3){const _0x2c379f=a38_0x3ccc70,{options:_0x44e621,args:_0x48adcb,tdx:_0x1a9ce0}=_0x5a14a3,_0x281089=this[_0x2c379f(0xeb)](_0x48adcb,_0x44e621),_0x311847=_0x44e621[_0x2c379f(0xf1)],_0x32734c=_0x44e621['skipValidation'];_0x44e621[_0x2c379f(0x237)]&&(_0x281089&&console[_0x2c379f(0x23a)](_0x2c379f(0x205)+_0x281089),_0x311847&&console['error'](_0x2c379f(0xcb)+_0x311847),_0x44e621['dryRun']&&console['error'](_0x2c379f(0x10a)),_0x32734c&&console[_0x2c379f(0x23a)](_0x2c379f(0x18a)));let _0x43ecbb;try{_0x43ecbb=await withSpinner(_0x2c379f(0x248),()=>_0x1a9ce0[_0x2c379f(0x114)]['preparePushProject']({'sourceDir':_0x281089,'revision':_0x311847,'skipValidation':_0x32734c}),{'verbose':_0x44e621[_0x2c379f(0x237)]});}catch(_0x439277){if(_0x439277 instanceof Error&&_0x439277['message'][_0x2c379f(0x139)](_0x2c379f(0x1b2)))return console[_0x2c379f(0x23a)](a38_0x39faf3['red'](_0x2c379f(0x1e6)),_0x2c379f(0x195)),_0x44e621['workflowProject']?console[_0x2c379f(0x23a)](a38_0x39faf3['dim'](_0x2c379f(0x20b)+_0x44e621[_0x2c379f(0xbd)]+_0x2c379f(0x15d)+_0x44e621[_0x2c379f(0xbd)]+'\x27')):console[_0x2c379f(0x23a)](a38_0x39faf3[_0x2c379f(0x144)](_0x2c379f(0x196))),0x1;throw _0x439277;}const _0x4edef0=_0x43ecbb['data'];console['error'](_0x2c379f(0x1da)+_0x4edef0[_0x2c379f(0x1d6)]),console['error'](_0x2c379f(0x242)+_0x4edef0[_0x2c379f(0x17e)]),console[_0x2c379f(0x23a)](_0x2c379f(0x259)+_0x4edef0[_0x2c379f(0xf1)]),console['error'](_0x2c379f(0x201)+a38_0x39faf3[_0x2c379f(0x1fd)]('+'+_0x4edef0[_0x2c379f(0x115)][_0x2c379f(0x178)]+'\x20new')+',\x20'+(a38_0x39faf3[_0x2c379f(0x1db)]('~'+_0x4edef0[_0x2c379f(0x115)]['modified']+_0x2c379f(0x125))+',\x20')+(a38_0x39faf3[_0x2c379f(0xba)]('-'+_0x4edef0['summary'][_0x2c379f(0x22f)]+_0x2c379f(0x16f))+',\x20')+(''+a38_0x39faf3[_0x2c379f(0x144)](_0x4edef0[_0x2c379f(0x115)][_0x2c379f(0x250)]+_0x2c379f(0x1de))));for(const _0x5136e1 of _0x4edef0['changes']){_0x5136e1['type']===_0x2c379f(0xf7)&&_0x5136e1['diff']&&(console[_0x2c379f(0x23a)]('\x0a'+a38_0x39faf3[_0x2c379f(0xf9)]('---\x20'+_0x5136e1['path'])),console['error'](_0x5136e1[_0x2c379f(0x17c)]));}if(!_0x4edef0[_0x2c379f(0xc9)])return console[_0x2c379f(0x23a)](a38_0x39faf3['green'](_0x2c379f(0x258))),await this['showWorkflowConsoleUrl'](_0x1a9ce0,_0x4edef0[_0x2c379f(0x1d6)],_0x44e621[_0x2c379f(0x209)]),0x0;if(_0x44e621[_0x2c379f(0x21a)])return console[_0x2c379f(0x23a)](a38_0x39faf3[_0x2c379f(0x1db)]('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x44e621[_0x2c379f(0x1d0)]){const _0x1afa87=await confirmKey(_0x2c379f(0x249));if(!_0x1afa87)return console[_0x2c379f(0x23a)](_0x2c379f(0x156)),0x0;}const _0x496786=await withSpinner('Pushing\x20project...',()=>_0x1a9ce0['workflow']['executePushProject'](_0x4edef0),{'verbose':_0x44e621[_0x2c379f(0x237)]}),_0x67f4a7=_0x496786['data'];return console[_0x2c379f(0x23a)](a38_0x39faf3['green'](_0x2c379f(0x200))),console[_0x2c379f(0x23a)](_0x2c379f(0x189)+_0x67f4a7['projectId']),console[_0x2c379f(0x23a)](_0x2c379f(0x259)+_0x67f4a7[_0x2c379f(0xf1)]),await this['showWorkflowConsoleUrl'](_0x1a9ce0,_0x67f4a7['projectName'],_0x44e621[_0x2c379f(0x209)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{['name']=a38_0x3ccc70(0x215);['description']='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a38_0x3ccc70(0x1d3)](_0x9df816){const _0x3cbd12=a38_0x3ccc70,{options:_0x1b4cc2,args:_0x579d89,tdx:_0x50ab10}=_0x9df816,_0x5d5ae0=this[_0x3cbd12(0xeb)](_0x579d89,_0x1b4cc2),_0x5678d4=_0x1b4cc2[_0x3cbd12(0x1ca)],_0x1d4d6a=_0x1b4cc2[_0x3cbd12(0xf1)],_0xe14ea2=_0x1b4cc2[_0x3cbd12(0x16c)];if(!_0x5d5ae0)return console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0xba)](_0x3cbd12(0x1e6)),_0x3cbd12(0x174)),console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0x144)](_0x3cbd12(0x118))),console['error'](a38_0x39faf3[_0x3cbd12(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x5678d4)return console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0xba)](_0x3cbd12(0x1e6)),_0x3cbd12(0x221)),console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0x144)](_0x3cbd12(0x118))),0x1;_0x1b4cc2[_0x3cbd12(0x237)]&&(console[_0x3cbd12(0x23a)](_0x3cbd12(0x205)+_0x5d5ae0),console[_0x3cbd12(0x23a)](_0x3cbd12(0x19b)+_0x5678d4),_0x1d4d6a&&console[_0x3cbd12(0x23a)](_0x3cbd12(0xcb)+_0x1d4d6a),_0x1b4cc2[_0x3cbd12(0x21a)]&&console[_0x3cbd12(0x23a)](_0x3cbd12(0x10a)),_0xe14ea2&&console[_0x3cbd12(0x23a)](_0x3cbd12(0x18a)));const _0x49dfcf=await withSpinner(_0x3cbd12(0xee),()=>_0x50ab10[_0x3cbd12(0x114)][_0x3cbd12(0x19f)](_0x5d5ae0,_0x5678d4,{'revision':_0x1d4d6a,'skipValidation':_0xe14ea2}),{'verbose':_0x1b4cc2[_0x3cbd12(0x237)]}),_0x4259d3=_0x49dfcf[_0x3cbd12(0x1f5)];console[_0x3cbd12(0x23a)](_0x3cbd12(0x1b5)+_0x4259d3[_0x3cbd12(0x17e)]);_0x4259d3['sourceProjectName']&&console[_0x3cbd12(0x23a)](_0x3cbd12(0x20c)+_0x4259d3['sourceProjectName']);console[_0x3cbd12(0x23a)](_0x3cbd12(0x19b)+_0x4259d3['newProjectName']),console[_0x3cbd12(0x23a)](_0x3cbd12(0xcb)+_0x4259d3['revision']),console['error'](_0x3cbd12(0x10f)+_0x4259d3[_0x3cbd12(0x230)]);_0x4259d3[_0x3cbd12(0x238)]&&(console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0x1db)](_0x3cbd12(0x17a)+_0x4259d3[_0x3cbd12(0x1fc)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x4259d3[_0x3cbd12(0x103)]+')')),console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0x1db)](_0x3cbd12(0xde))));if(_0x1b4cc2[_0x3cbd12(0x21a)])return console[_0x3cbd12(0x23a)](a38_0x39faf3[_0x3cbd12(0x1db)](_0x3cbd12(0x227))),0x0;if(!_0x1b4cc2[_0x3cbd12(0x1d0)]){const _0x9809e3=_0x4259d3['sourceProjectName']||a38_0x1ded24[_0x3cbd12(0xe0)](_0x5d5ae0),_0x1ee68d=_0x4259d3['targetExists']?_0x3cbd12(0x222)+_0x5678d4+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x9809e3+'\x22\x20to\x20new\x20project\x20\x22'+_0x5678d4+'\x22?',_0x643df1=await confirmKey(_0x1ee68d);if(!_0x643df1)return console[_0x3cbd12(0x23a)](_0x3cbd12(0x156)),0x0;}const _0x5dfbf1=await withSpinner(_0x4259d3[_0x3cbd12(0x238)]?_0x3cbd12(0x173)+_0x5678d4+_0x3cbd12(0x257):_0x3cbd12(0x101)+_0x5678d4+_0x3cbd12(0x257),()=>_0x50ab10[_0x3cbd12(0x114)][_0x3cbd12(0x1f3)](_0x4259d3),{'verbose':_0x1b4cc2[_0x3cbd12(0x237)]}),_0x1ad617=_0x5dfbf1['data'];return console[_0x3cbd12(0x23a)](a38_0x39faf3['green'](_0x4259d3[_0x3cbd12(0x238)]?_0x3cbd12(0x1f4):_0x3cbd12(0x1b8))),console[_0x3cbd12(0x23a)](_0x3cbd12(0x1cd)+_0x1ad617['newProjectName']),console['error'](_0x3cbd12(0x189)+_0x1ad617[_0x3cbd12(0x1f6)]),console[_0x3cbd12(0x23a)](_0x3cbd12(0x259)+_0x1ad617['revision']),await this[_0x3cbd12(0x23c)](_0x50ab10,_0x1ad617[_0x3cbd12(0x1fc)],_0x1b4cc2[_0x3cbd12(0x209)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a38_0x3ccc70(0x1ca)]='workflow:delete';[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x12a);async[a38_0x3ccc70(0x1d3)](_0x13c503){const _0xf72537=a38_0x3ccc70,{options:_0x526911,args:_0x249314,tdx:_0x2b1539}=_0x13c503,_0x34cddd=_0x249314[0x0];if(!_0x34cddd)return console[_0xf72537(0x23a)](_0xf72537(0x15e)),console['error'](_0xf72537(0x113)),0x1;_0x526911[_0xf72537(0x237)]&&console[_0xf72537(0x23a)](_0xf72537(0x24e)+_0x34cddd);if(!_0x526911[_0xf72537(0x1d0)]){const _0x50d7b0=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x34cddd+_0xf72537(0x135));if(!_0x50d7b0)return console['error'](_0xf72537(0x156)),0x0;}const _0x3b3109=await withSpinner(_0xf72537(0x14d)+_0x34cddd+_0xf72537(0x257),()=>_0x2b1539[_0xf72537(0x114)][_0xf72537(0xf0)](_0x34cddd),{'verbose':_0x526911['verbose']}),_0x3c95ec=_0x3b3109['data'];return console[_0xf72537(0x23a)](_0xf72537(0x122)+_0x3c95ec['projectName']),console[_0xf72537(0x23a)](_0xf72537(0x189)+_0x3c95ec[_0xf72537(0x18e)]),0x0;}}export function parseKeyValue(_0x1616fd){const _0x1d21b7=a38_0x3ccc70,_0x5dcc2e=_0x1616fd[_0x1d21b7(0x219)]('=');if(_0x5dcc2e===-0x1)throw new Error(_0x1d21b7(0x212)+_0x1616fd+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x1bb7b2=_0x1616fd[_0x1d21b7(0x112)](0x0,_0x5dcc2e),_0x3e78be=_0x1616fd[_0x1d21b7(0x112)](_0x5dcc2e+0x1);if(!_0x1bb7b2)throw new Error(_0x1d21b7(0x117));return{'key':_0x1bb7b2,'value':_0x3e78be};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x20f);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0x1c5);async[a38_0x3ccc70(0x1d3)](_0x508ecd){const _0xecc293=a38_0x3ccc70,{options:_0x2e4543,args:_0x3eaea8,tdx:_0x3a95ca}=_0x508ecd,_0x32eb57=this[_0xecc293(0x149)](_0x3eaea8,_0x2e4543);if(!_0x32eb57)return 0x1;_0x2e4543[_0xecc293(0x237)]&&console['error']('Project:\x20'+_0x32eb57);const _0x4cc00d=await withSpinner(_0xecc293(0x1a2),()=>_0x3a95ca['workflow'][_0xecc293(0x1af)](_0x32eb57),{'verbose':_0x2e4543[_0xecc293(0x237)]}),{secrets:_0x2bef77}=_0x4cc00d[_0xecc293(0x1f5)];return console[_0xecc293(0x23a)](_0xecc293(0x107)+_0x2bef77[_0xecc293(0x148)]+_0xecc293(0x1d8)+(_0x2bef77['length']!==0x1?'s':'')),await handleSDKOutput(_0x2bef77,_0x2e4543),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{['name']=a38_0x3ccc70(0xf3);['description']=a38_0x3ccc70(0x13f);async[a38_0x3ccc70(0x1d3)](_0x46010c){const _0x22d5e4=a38_0x3ccc70,{options:_0x406d03,args:_0x18ee34,tdx:_0x495bc5}=_0x46010c;let _0x1b82f2,_0x14715f;if(_0x18ee34[_0x22d5e4(0x148)]>=0x2)_0x1b82f2=_0x18ee34[0x0],_0x14715f=_0x18ee34[0x1];else{if(_0x18ee34[_0x22d5e4(0x148)]===0x1&&_0x406d03[_0x22d5e4(0xbd)])_0x1b82f2=_0x406d03[_0x22d5e4(0xbd)],_0x14715f=_0x18ee34[0x0];else return _0x18ee34['length']===0x1?(console[_0x22d5e4(0x23a)](_0x22d5e4(0x1fa)),console[_0x22d5e4(0x23a)](_0x22d5e4(0xb8)),0x1):(console[_0x22d5e4(0x23a)](_0x22d5e4(0x14f)),console[_0x22d5e4(0x23a)](_0x22d5e4(0x16d)),0x1);}let _0x3f755e,_0x2bcb66;try{({key:_0x3f755e,value:_0x2bcb66}=parseKeyValue(_0x14715f));}catch(_0x20d39b){return _0x20d39b instanceof Error&&console[_0x22d5e4(0x23a)](a38_0x39faf3['red']('Error:'),_0x20d39b[_0x22d5e4(0x155)]),0x1;}_0x406d03[_0x22d5e4(0x237)]&&(console[_0x22d5e4(0x23a)]('Project:\x20'+_0x1b82f2),console[_0x22d5e4(0x23a)]('Key:\x20'+_0x3f755e));const _0x4ae41a=await withSpinner(_0x22d5e4(0x1a4),()=>_0x495bc5['workflow'][_0x22d5e4(0xdd)](_0x1b82f2,_0x3f755e,_0x2bcb66),{'verbose':_0x406d03[_0x22d5e4(0x237)]}),_0x135b56=_0x4ae41a[_0x22d5e4(0x1f5)];return console[_0x22d5e4(0x23a)](_0x22d5e4(0x235)+_0x135b56['key']+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x135b56[_0x22d5e4(0x1d6)]+'\x27'),(_0x406d03[_0x22d5e4(0x208)]||_0x406d03[_0x22d5e4(0x16b)])&&await handleSingleObjectOutput(_0x135b56,_0x406d03),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x1bd);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0xc7);async[a38_0x3ccc70(0x1d3)](_0xacb87e){const _0x50557c=a38_0x3ccc70,{options:_0x21f98,args:_0x100d68,tdx:_0x790b50}=_0xacb87e;let _0x59b26d,_0x35f981;if(_0x100d68[_0x50557c(0x148)]>=0x2)_0x59b26d=_0x100d68[0x0],_0x35f981=_0x100d68[0x1];else{if(_0x100d68[_0x50557c(0x148)]===0x1&&_0x21f98[_0x50557c(0xbd)])_0x59b26d=_0x21f98[_0x50557c(0xbd)],_0x35f981=_0x100d68[0x0];else return _0x100d68[_0x50557c(0x148)]===0x1?(console[_0x50557c(0x23a)](_0x50557c(0x1fa)),console[_0x50557c(0x23a)](_0x50557c(0xb8)),0x1):(console[_0x50557c(0x23a)](_0x50557c(0x171)),console[_0x50557c(0x23a)](_0x50557c(0x1e2)),0x1);}_0x21f98[_0x50557c(0x237)]&&(console[_0x50557c(0x23a)]('Project:\x20'+_0x59b26d),console[_0x50557c(0x23a)](_0x50557c(0x11c)+_0x35f981));if(!_0x21f98[_0x50557c(0x1d0)]){const _0x5267d1=await confirmKey(_0x50557c(0x247)+_0x35f981+_0x50557c(0x143)+_0x59b26d+'\x27?');if(!_0x5267d1)return console[_0x50557c(0x23a)](_0x50557c(0x156)),0x0;}const _0x4d231c=await withSpinner(_0x50557c(0x181),()=>_0x790b50[_0x50557c(0x114)][_0x50557c(0x132)](_0x59b26d,_0x35f981),{'verbose':_0x21f98[_0x50557c(0x237)]}),_0x5a3cb1=_0x4d231c[_0x50557c(0x1f5)];return console['error'](_0x50557c(0x235)+_0x5a3cb1[_0x50557c(0x218)]+_0x50557c(0x1f2)+_0x5a3cb1[_0x50557c(0x1d6)]+'\x27'),(_0x21f98[_0x50557c(0x208)]||_0x21f98[_0x50557c(0x16b)])&&await handleSingleObjectOutput(_0x5a3cb1,_0x21f98),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(_0x47da5a){const _0xc8ee62=a38_0x3ccc70,_0x3dc80d=Math[_0xc8ee62(0x1aa)](_0x47da5a/0x3e8),_0x2271de=Math[_0xc8ee62(0x1aa)](_0x3dc80d/0x3c),_0x2e18c6=Math[_0xc8ee62(0x1aa)](_0x2271de/0x3c),_0x3e2ba9=Math['floor'](_0x2e18c6/0x18);if(_0x3e2ba9>0x0){const _0x49f4eb=_0x2e18c6%0x18;return _0x49f4eb>0x0?_0x3e2ba9+'d\x20'+_0x49f4eb+'h':_0x3e2ba9+'d';}else{if(_0x2e18c6>0x0){const _0x29a931=_0x2271de%0x3c;return _0x29a931>0x0?_0x2e18c6+'h\x20'+_0x29a931+'m':_0x2e18c6+'h';}else{if(_0x2271de>0x0){const _0x4ef162=_0x3dc80d%0x3c;return _0x4ef162>0x0?_0x2271de+'m\x20'+_0x4ef162+'s':_0x2271de+'m';}else return _0x3dc80d+'s';}}}function formatTimestamp(_0x124a87,_0x920b51){const _0xf9dcb4=a38_0x3ccc70,_0x56ca5f=new Date(_0x124a87),_0x22e4e3=String(_0x56ca5f[_0xf9dcb4(0xe6)]())[_0xf9dcb4(0x140)](0x2,'0'),_0x31cc19=String(_0x56ca5f['getMinutes']())['padStart'](0x2,'0'),_0x30ce38=_0x22e4e3+':'+_0x31cc19,_0x561ec2=_0x56ca5f[_0xf9dcb4(0x10c)]()===_0x920b51[_0xf9dcb4(0x10c)]()&&_0x56ca5f[_0xf9dcb4(0x154)]()===_0x920b51[_0xf9dcb4(0x154)]()&&_0x56ca5f[_0xf9dcb4(0x1d9)]()===_0x920b51[_0xf9dcb4(0x1d9)]();if(_0x561ec2)return _0x30ce38;else{const _0x229994=String(_0x56ca5f[_0xf9dcb4(0x154)]()+0x1)[_0xf9dcb4(0x140)](0x2,'0'),_0x435992=String(_0x56ca5f[_0xf9dcb4(0x1d9)]())['padStart'](0x2,'0');return _0x229994+'-'+_0x435992+'\x20'+_0x30ce38;}}function formatDate(_0x2ae47e){const _0x359a00=a38_0x3ccc70,_0xf90b38=_0x2ae47e[_0x359a00(0x10c)](),_0x2c38ca=String(_0x2ae47e[_0x359a00(0x154)]()+0x1)[_0x359a00(0x140)](0x2,'0'),_0x2a3a00=String(_0x2ae47e['getDate']())['padStart'](0x2,'0');return _0xf90b38+'-'+_0x2c38ca+'-'+_0x2a3a00;}function getTaskStateIcon(_0x1b0f94){const _0x46185d={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x46185d[_0x1b0f94]||'⚪';}function getBarChar(_0x12a82f){const _0x3e528a=a38_0x3ccc70;return _0x12a82f==='error'||_0x12a82f===_0x3e528a(0x12d)?'×':'─';}function getBarColor(_0x3ceb2b){const _0x214ed2=a38_0x3ccc70,_0x475533={'success':a38_0x39faf3['green'],'error':a38_0x39faf3['red'],'group_error':a38_0x39faf3[_0x214ed2(0xba)],'running':a38_0x39faf3[_0x214ed2(0x193)],'blocked':a38_0x39faf3[_0x214ed2(0x1db)],'planned':a38_0x39faf3['dim'],'canceling':a38_0x39faf3[_0x214ed2(0x1db)]};return _0x475533[_0x3ceb2b]||a38_0x39faf3['white'];}function parseTaskName(_0x518034){const _0x1755c3=a38_0x3ccc70;let _0x5d606e=_0x518034[_0x1755c3(0x1bf)](/^\++/,'');const _0x2f8830=_0x5d606e[_0x1755c3(0x1c9)]('+'),_0x445db4=_0x2f8830[_0x1755c3(0x148)]>0x1?_0x2f8830['length']-0x2:0x0,_0x4734f6=_0x2f8830[_0x2f8830[_0x1755c3(0x148)]-0x1]||_0x5d606e;return{'level':_0x445db4,'name':'+'+_0x4734f6};}function truncateTaskName(_0x5b0164,_0x17612c){const _0x2842f3=a38_0x3ccc70,_0x250b68=stringWidth(_0x5b0164);if(_0x250b68<=_0x17612c)return _0x5b0164;let _0x2c2256=_0x5b0164;while(stringWidth(_0x2c2256+'…')>_0x17612c&&_0x2c2256[_0x2842f3(0x148)]>0x0){_0x2c2256=_0x2c2256['slice'](0x0,-0x1);}return _0x2c2256+'…';}function calculateTimeScale(_0x47f9d5,_0x3aec17){const _0x485418=a38_0x3ccc70;return{'startTime':_0x47f9d5[_0x485418(0x130)],'endTime':_0x47f9d5[_0x485418(0x1c3)],'durationMs':_0x47f9d5[_0x485418(0xc2)],'msPerChar':_0x47f9d5[_0x485418(0xc2)]/_0x3aec17};}function timeToPosition(_0x2591cd,_0x5123ad,_0xcb1efe){const _0x436ac9=a38_0x3ccc70,_0x3711cc=_0x2591cd-_0x5123ad['startTime'],_0x3bcd27=Math['floor'](_0x3711cc/_0x5123ad['msPerChar']);return Math[_0x436ac9(0x11d)](0x0,Math[_0x436ac9(0x120)](_0x3bcd27,_0xcb1efe));}function renderTimeAxis(_0x53ceb6,_0x38c0c2){const _0x5e031e=a38_0x3ccc70,_0x354b92=Math['min'](TIMELINE_CONFIG[_0x5e031e(0x1e4)],Math[_0x5e031e(0x11d)](TIMELINE_CONFIG[_0x5e031e(0xfd)],Math['floor'](_0x38c0c2/TIMELINE_CONFIG[_0x5e031e(0x1d2)]))),_0x240ede=_0x53ceb6[_0x5e031e(0x152)]/(_0x354b92-0x1),_0x3e0dd9=new Date(_0x53ceb6[_0x5e031e(0x1fb)]),_0x55168a=[];for(let _0x291efb=0x0;_0x291efb<_0x354b92;_0x291efb++){const _0x3edea5=_0x53ceb6[_0x5e031e(0x1fb)]+_0x291efb*_0x240ede,_0x34eed6=timeToPosition(_0x3edea5,_0x53ceb6,_0x38c0c2),_0x56b384=formatTimestamp(_0x3edea5,_0x3e0dd9);_0x55168a[_0x5e031e(0x1c6)]({'pos':_0x34eed6,'text':_0x56b384});}const _0x276c0e=new Array(_0x38c0c2)[_0x5e031e(0x24c)]('\x20');let _0x111056=-0x1;for(const {pos:_0x40a6dd,text:_0x58f9d2}of _0x55168a){let _0x1cf4f7=Math[_0x5e031e(0x11d)](0x0,_0x40a6dd-Math[_0x5e031e(0x1aa)](_0x58f9d2[_0x5e031e(0x148)]/0x2));_0x1cf4f7<=_0x111056+TIMELINE_CONFIG[_0x5e031e(0x1e1)]&&(_0x1cf4f7=_0x111056+TIMELINE_CONFIG[_0x5e031e(0x1e1)]+0x1);_0x1cf4f7+_0x58f9d2[_0x5e031e(0x148)]>_0x38c0c2&&(_0x1cf4f7=_0x38c0c2-_0x58f9d2[_0x5e031e(0x148)]);if(_0x1cf4f7>=0x0&&_0x1cf4f7+_0x58f9d2['length']<=_0x38c0c2&&_0x1cf4f7>_0x111056){for(let _0x35796=0x0;_0x35796<_0x58f9d2['length'];_0x35796++){_0x276c0e[_0x1cf4f7+_0x35796]=_0x58f9d2[_0x35796];}_0x111056=_0x1cf4f7+_0x58f9d2[_0x5e031e(0x148)]-0x1;}}return _0x276c0e[_0x5e031e(0x18b)]('');}function renderTaskRow(_0x2ce1b6,_0x2e4c87,_0x13e822,_0x4da246){const _0x4633de=a38_0x3ccc70,{level:_0x202363,name:_0x2d0c87}=parseTaskName(_0x2ce1b6[_0x4633de(0x1ca)]),_0x1ca88f='\x20'[_0x4633de(0x13d)](_0x202363),_0x1d89f5=_0x2ce1b6[_0x4633de(0x14e)]?'('+formatElapsed(_0x2ce1b6[_0x4633de(0x14e)][_0x4633de(0xc2)])+')':'',_0x49aa71=stringWidth(_0x1d89f5),_0x6cbd43=_0x202363*0x1,_0x36deff=_0x4da246-_0x6cbd43-_0x49aa71-0x1,_0x1fc509=truncateTaskName(_0x2d0c87,_0x36deff),_0x34fd8e=_0x1ca88f+_0x1fc509,_0x411746=stringWidth(_0x34fd8e),_0x54d36d=_0x4da246-_0x411746-_0x49aa71,_0x5549ae=_0x34fd8e+'\x20'[_0x4633de(0x13d)](Math[_0x4633de(0x11d)](0x1,_0x54d36d))+a38_0x39faf3[_0x4633de(0x144)](_0x1d89f5),_0x489d7a=getTaskStateIcon(_0x2ce1b6['state']),_0x2979f3=new Array(_0x13e822)[_0x4633de(0x24c)]('\x20');if(_0x2ce1b6[_0x4633de(0x14e)]){const _0x20d768=timeToPosition(_0x2ce1b6[_0x4633de(0x14e)][_0x4633de(0x130)],_0x2e4c87,_0x13e822),_0x2d0037=timeToPosition(_0x2ce1b6['window'][_0x4633de(0x1c3)],_0x2e4c87,_0x13e822),_0x2f2fa9=getBarChar(_0x2ce1b6[_0x4633de(0xd0)]),_0x1ee4c0=Math[_0x4633de(0x11d)](_0x20d768+0x1,_0x2d0037);for(let _0x34412e=_0x20d768;_0x34412e<Math[_0x4633de(0x120)](_0x1ee4c0,_0x13e822);_0x34412e++){_0x2979f3[_0x34412e]=_0x2f2fa9;}}const _0x4f947d=getBarColor(_0x2ce1b6[_0x4633de(0xd0)]),_0xd318af=_0x2979f3[_0x4633de(0x21d)](_0x40a9bd=>_0x40a9bd==='\x20'?'\x20':_0x4f947d(_0x40a9bd))[_0x4633de(0x18b)]('');return _0x489d7a+'\x20'+_0x5549ae+'│'+_0xd318af+'│';}function calculateStats(_0x324608){const _0x23b0c2=a38_0x3ccc70,_0x3fd4d7={'total':_0x324608[_0x23b0c2(0x148)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0xc03124 of _0x324608){if(_0xc03124['state']==='success')_0x3fd4d7['success']++;else{if(_0xc03124[_0x23b0c2(0xd0)]===_0x23b0c2(0x23a)||_0xc03124['state']===_0x23b0c2(0x12d))_0x3fd4d7['error']++;else _0xc03124[_0x23b0c2(0xd0)]==='running'?_0x3fd4d7['running']++:_0x3fd4d7[_0x23b0c2(0x19e)]++;}}return _0x3fd4d7;}function formatStats(_0x151898){const _0x212ba6=a38_0x3ccc70;return[_0x212ba6(0x186)+_0x151898[_0x212ba6(0xcd)],'✅\x20'+_0x151898[_0x212ba6(0x184)],'❌\x20'+_0x151898[_0x212ba6(0x23a)],_0x212ba6(0xe8)+_0x151898[_0x212ba6(0x243)],'⏳\x20'+_0x151898['pending']]['join']('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a38_0x3ccc70(0x1ca)]=a38_0x3ccc70(0x1a1);[a38_0x3ccc70(0x102)]=a38_0x3ccc70(0xe1);async[a38_0x3ccc70(0x1d3)](_0x55a69a){const _0x3c2e11=a38_0x3ccc70,{options:_0x518476,args:_0x1e892e,tdx:_0x1c6c43}=_0x55a69a;let _0x90293d,_0x3eaf00,_0x54588b=![];if(_0x1e892e[0x0]){if(_0x1e892e[0x0][_0x3c2e11(0x139)]('.')){const _0x47bf16=this['parseProjectWorkflowPattern'](_0x1e892e,_0x518476);if(!_0x47bf16)return 0x1;_0x90293d=_0x47bf16[_0x3c2e11(0x1d6)],_0x3eaf00=_0x47bf16[_0x3c2e11(0xbf)];}else{_0x3eaf00=_0x1e892e[0x0],_0x90293d=_0x518476['workflowProject'];if(!_0x90293d)return console['error'](a38_0x39faf3[_0x3c2e11(0xba)](_0x3c2e11(0x1e6)),_0x3c2e11(0x24b)),0x1;_0x54588b=!![];}}else{const _0x29dc6f=this[_0x3c2e11(0x25b)](_0x1e892e,_0x518476);if(!_0x29dc6f)return 0x1;_0x90293d=_0x29dc6f[_0x3c2e11(0x1d6)],_0x3eaf00=_0x29dc6f[_0x3c2e11(0xbf)];}if(_0x518476[_0x3c2e11(0x237)]){if(_0x90293d&&_0x3eaf00)console[_0x3c2e11(0x23a)]('Filter:\x20'+_0x90293d+'.'+_0x3eaf00);else _0x90293d&&console['error'](_0x3c2e11(0x158)+_0x90293d);}const _0x27249b=_0x518476[_0x3c2e11(0x1d4)],_0x5adfc9=_0x518476[_0x3c2e11(0xec)];if(_0x27249b){_0x5adfc9&&console[_0x3c2e11(0x23a)](a38_0x39faf3[_0x3c2e11(0x1db)]('Warning:'),_0x3c2e11(0xe7));const _0x35d62d=_0x518476[_0x3c2e11(0x23f)];return _0x35d62d?await this[_0x3c2e11(0x183)](_0x55a69a,_0x27249b):await this[_0x3c2e11(0x133)](_0x55a69a,_0x27249b,_0x518476),0x0;}if(_0x5adfc9){const _0x2defba=await withSpinner(_0x3c2e11(0x20e),()=>_0x1c6c43[_0x3c2e11(0x114)][_0x3c2e11(0xed)]({'projectName':_0x90293d,'workflowName':_0x3eaf00,'limit':0x64}),{'verbose':_0x518476[_0x3c2e11(0x237)]}),_0x6c5c69=_0x2defba['data'][_0x3c2e11(0x253)](_0x187cdb=>_0x187cdb['id']===_0x5adfc9);if(!_0x6c5c69)return console[_0x3c2e11(0x23a)](a38_0x39faf3[_0x3c2e11(0xba)](_0x3c2e11(0x1e6)),_0x3c2e11(0x12e)+_0x5adfc9),0x1;if(!_0x6c5c69['lastAttempt']?.['id'])return console['error'](a38_0x39faf3[_0x3c2e11(0xba)](_0x3c2e11(0x1e6)),'Session\x20'+_0x5adfc9+_0x3c2e11(0x18f)),0x1;const _0x4a6246=_0x6c5c69[_0x3c2e11(0x168)]['id'];_0x518476[_0x3c2e11(0x237)]&&console[_0x3c2e11(0x23a)]('Using\x20attempt\x20'+_0x4a6246+_0x3c2e11(0x11f)+_0x5adfc9);const _0x3e5fb3=_0x518476[_0x3c2e11(0x23f)];return _0x3e5fb3?await this[_0x3c2e11(0x183)](_0x55a69a,_0x4a6246):await this[_0x3c2e11(0x133)](_0x55a69a,_0x4a6246,_0x518476),0x0;}const _0x2ad986=await withSpinner(_0x3c2e11(0xf4),()=>_0x1c6c43[_0x3c2e11(0x114)]['sessions']({'projectName':_0x90293d,'workflowName':_0x3eaf00,'limit':_0x518476[_0x3c2e11(0x1e5)]||0x32}),{'verbose':_0x518476[_0x3c2e11(0x237)]}),_0x278f55=_0x2ad986['data'];if(_0x278f55['length']===0x0){if(_0x90293d&&_0x3eaf00)console[_0x3c2e11(0x23a)]('No\x20sessions\x20found\x20for:\x20'+_0x90293d+'.'+_0x3eaf00);else _0x90293d?console['error']('No\x20sessions\x20found\x20in\x20project:\x20'+_0x90293d):(console[_0x3c2e11(0x23a)](_0x3c2e11(0x239)),console[_0x3c2e11(0x23a)](a38_0x39faf3[_0x3c2e11(0x144)](_0x3c2e11(0xc8))));return 0x0;}_0x278f55['sort']((_0x158d07,_0x292b62)=>{const _0x19dfb3=_0x3c2e11,_0x477361=_0x158d07['sessionTime']||'',_0x54a216=_0x292b62['sessionTime']||'';return _0x54a216[_0x19dfb3(0x124)](_0x477361);});if(_0x518476[_0x3c2e11(0x208)]||_0x518476['jsonl'])return await handleSDKOutput(_0x278f55,_0x518476),0x0;let _0x121201;if(_0x54588b){const _0x201fdb=_0x278f55[0x0];if(!_0x201fdb[_0x3c2e11(0x168)]?.['id'])return console['error']('Latest\x20session\x20has\x20no\x20attempt'),0x0;_0x121201=_0x201fdb[_0x3c2e11(0x168)]['id'],_0x518476[_0x3c2e11(0x237)]&&console[_0x3c2e11(0x23a)]('Auto-selected\x20latest\x20session:\x20'+_0x201fdb['sessionTime']);}else{const _0x5513f9=_0x278f55[_0x3c2e11(0x21d)](_0x123743=>{const _0xc08cb2=_0x3c2e11,_0x4874f4=getAttemptStatusDisplay(_0x123743['lastAttempt']);return{'title':_0x123743[_0xc08cb2(0x1b0)]?.[_0xc08cb2(0x1ca)]+'.'+_0x123743[_0xc08cb2(0x114)]?.['name']+_0xc08cb2(0xe3)+_0x123743[_0xc08cb2(0xd2)]+'\x20'+_0x4874f4[_0xc08cb2(0x116)],'value':_0x123743[_0xc08cb2(0x168)]?.['id']||'','description':_0x4874f4['text']};}),_0x2baac9=await a38_0x2ed35b({'type':_0x3c2e11(0x170),'name':_0x3c2e11(0x1d4),'message':_0x3c2e11(0x1c8),'choices':_0x5513f9[_0x3c2e11(0xbe)](_0x46be9a=>_0x46be9a['value']!=='')});if(!_0x2baac9[_0x3c2e11(0x1d4)])return 0x0;_0x121201=_0x2baac9['attemptId'];}const _0x5f3610=_0x518476[_0x3c2e11(0x23f)];return _0x5f3610?await this[_0x3c2e11(0x183)](_0x55a69a,_0x121201):await this[_0x3c2e11(0x133)](_0x55a69a,_0x121201,_0x518476),0x0;}async[a38_0x3ccc70(0x133)](_0x1fbe82,_0x2d9217,_0x43b963){const _0x330d72=a38_0x3ccc70,{tdx:_0x3b576e}=_0x1fbe82;let _0x2174d3,_0x32732a;try{[_0x2174d3,_0x32732a]=await Promise[_0x330d72(0x105)]([_0x3b576e[_0x330d72(0x114)][_0x330d72(0x1d7)](_0x2d9217),_0x3b576e['workflow'][_0x330d72(0xfa)](_0x2d9217,![])]);}catch(_0x5c1ae3){console[_0x330d72(0x23a)](a38_0x39faf3[_0x330d72(0xba)](_0x330d72(0x21e)));_0x43b963[_0x330d72(0x237)]&&console[_0x330d72(0x23a)](_0x5c1ae3);throw _0x5c1ae3;}if(_0x43b963[_0x330d72(0x208)]||_0x43b963[_0x330d72(0x16b)]){const _0x411b9a=this[_0x330d72(0x20a)](_0x2174d3,_0x32732a);await handleSDKOutput([_0x411b9a],_0x43b963);return;}const _0xc59e01=_0x3b576e[_0x330d72(0x1f0)][_0x330d72(0x209)],_0x514f80=this['renderTimeline'](_0x2174d3,_0x32732a,_0xc59e01);console[_0x330d72(0x229)](_0x514f80);}async[a38_0x3ccc70(0x183)](_0x2c1b2f,_0x475925){const _0x93355f=a38_0x3ccc70,{tdx:_0x134b69}=_0x2c1b2f,_0x516cf5=TIMELINE_CONFIG[_0x93355f(0x1ac)],_0x373f61=TIMELINE_CONFIG[_0x93355f(0x15c)];let _0x1e696e=0x0;while(_0x1e696e<_0x373f61){process[_0x93355f(0x109)][_0x93355f(0x1ec)]&&process[_0x93355f(0x109)][_0x93355f(0x12b)]('\x1bc');let _0x570948,_0x1cc51b;try{[_0x570948,_0x1cc51b]=await Promise[_0x93355f(0x105)]([_0x134b69['workflow'][_0x93355f(0x1d7)](_0x475925),_0x134b69[_0x93355f(0x114)]['tasks'](_0x475925,![])]);}catch(_0x27d027){console[_0x93355f(0x23a)](a38_0x39faf3[_0x93355f(0xba)](_0x93355f(0xfe)));_0x1e696e>0x0&&console[_0x93355f(0x23a)](a38_0x39faf3[_0x93355f(0x144)](_0x93355f(0x1b4)+_0x1e696e));throw _0x27d027;}const _0x59e1b9=_0x134b69['context'][_0x93355f(0x209)],_0x2649db=this[_0x93355f(0x160)](_0x570948,_0x1cc51b,_0x59e1b9);console[_0x93355f(0x229)](_0x2649db);const _0x3b4d02=_0x570948[_0x93355f(0xf5)]&&_0x1cc51b[_0x93355f(0x15b)](_0x1e17ea=>_0x1e17ea[_0x93355f(0xd0)]!==_0x93355f(0x243)&&_0x1e17ea['state']!==_0x93355f(0x19d));if(_0x3b4d02){console[_0x93355f(0x23a)](a38_0x39faf3[_0x93355f(0x1fd)]('\x0a✔\x20Attempt\x20complete'));break;}console[_0x93355f(0x23a)](a38_0x39faf3[_0x93355f(0x144)](_0x93355f(0x106)+_0x1e696e*0x2+_0x93355f(0x210))),await new Promise(_0x48db0c=>setTimeout(_0x48db0c,_0x516cf5)),_0x1e696e++;}_0x1e696e>=_0x373f61&&console[_0x93355f(0x23a)](a38_0x39faf3[_0x93355f(0x1db)](_0x93355f(0x24a)));}[a38_0x3ccc70(0x160)](_0x1d65db,_0x1d5702,_0x315814){const _0x39e3ff=a38_0x3ccc70,_0xf71ec0=[],_0x38ada8=TIMELINE_CONFIG[_0x39e3ff(0x16e)],_0x387610=0x5,_0x4d0c6b=process[_0x39e3ff(0x109)][_0x39e3ff(0x12c)]||0x78,_0x324d74=_0x4d0c6b-_0x38ada8-_0x387610,_0x57de90=Math['max'](TIMELINE_CONFIG[_0x39e3ff(0x119)],Math['min'](_0x324d74,TIMELINE_CONFIG[_0x39e3ff(0xd7)])),_0x43c862=new Date(_0x1d65db[_0x39e3ff(0x234)])['getTime'](),_0x39fc8c=_0x1d65db[_0x39e3ff(0xca)]?new Date(_0x1d65db[_0x39e3ff(0xca)])[_0x39e3ff(0x15a)]():Date[_0x39e3ff(0x15f)](),_0x22f187={'start':_0x43c862,'end':_0x39fc8c,'duration':_0x39fc8c-_0x43c862},_0x574811=new Map(),_0x1e76cc=[];for(const _0x3921b4 of _0x1d5702){if(_0x3921b4[_0x39e3ff(0x1e3)]){const _0x2d3852=new Date(_0x3921b4['startedAt'])[_0x39e3ff(0x15a)](),_0x39d285=_0x3921b4[_0x39e3ff(0x203)]?new Date(_0x3921b4[_0x39e3ff(0x203)])['getTime']():Date[_0x39e3ff(0x15f)](),_0x27b71a={'start':_0x2d3852,'end':_0x39d285,'duration':_0x39d285-_0x2d3852};_0x574811['set'](_0x3921b4['id'],_0x27b71a),_0x1e76cc[_0x39e3ff(0x1c6)]({'name':_0x3921b4[_0x39e3ff(0x1be)],'state':_0x3921b4['state']||_0x39e3ff(0x24d),'window':_0x27b71a});}else _0x1e76cc[_0x39e3ff(0x1c6)]({'name':_0x3921b4[_0x39e3ff(0x1be)],'state':_0x3921b4[_0x39e3ff(0xd0)]||_0x39e3ff(0x19d),'window':undefined});}_0x1e76cc[_0x39e3ff(0xfc)]((_0xd5a92a,_0x1fd0c3)=>{const _0x5d6177=_0x39e3ff;if(!_0xd5a92a['window'])return 0x1;if(!_0x1fd0c3[_0x5d6177(0x14e)])return-0x1;return _0xd5a92a[_0x5d6177(0x14e)][_0x5d6177(0x130)]-_0x1fd0c3[_0x5d6177(0x14e)]['start'];});const _0x234a54=_0x1e76cc[_0x39e3ff(0x148)],_0x137e01=_0x234a54>TIMELINE_CONFIG[_0x39e3ff(0xf2)];_0x137e01&&_0x1e76cc['splice'](TIMELINE_CONFIG[_0x39e3ff(0xf2)]);const _0x173cd9=calculateTimeScale(_0x22f187,_0x57de90),_0x2061ae=_0x1d65db[_0x39e3ff(0xf5)]?_0x1d65db[_0x39e3ff(0x184)]?a38_0x39faf3['green']('success'):a38_0x39faf3[_0x39e3ff(0xba)](_0x39e3ff(0x23a)):a38_0x39faf3[_0x39e3ff(0x193)](_0x39e3ff(0x243)),_0x57c8ac=_0x1d65db['project']?.['id'],_0x2d943c=_0x1d65db[_0x39e3ff(0xec)];let _0x46b94e;if(_0x57c8ac&&_0x2d943c){const _0x2369ff=getWorkflowAttemptUrl(_0x315814,_0x57c8ac,_0x2d943c,_0x1d65db['id']);_0x46b94e=hyperlink(a38_0x39faf3['dim'](_0x1d65db['id']),_0x2369ff);}else _0x46b94e=a38_0x39faf3['dim'](_0x1d65db['id']);_0xf71ec0[_0x39e3ff(0x1c6)](_0x39e3ff(0x228)+_0x46b94e+'\x20-\x20'+_0x2061ae+_0x39e3ff(0xe3)+formatElapsed(_0x22f187[_0x39e3ff(0xc2)]));if(_0x1e76cc[_0x39e3ff(0x148)]>0x0){const _0x16e436=renderTimeAxis(_0x173cd9,_0x57de90),_0x5d7a52=new Date(_0x22f187[_0x39e3ff(0x130)]),_0x6d0d7d=formatDate(_0x5d7a52),_0x495826=TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x39e3ff(0x217)]+_0x38ada8,_0x1d9c27=_0x6d0d7d[_0x39e3ff(0x140)](_0x495826),_0x8a9672=a38_0x39faf3[_0x39e3ff(0x144)](_0x1d9c27);_0xf71ec0[_0x39e3ff(0x1c6)](_0x8a9672+'\x20'+_0x16e436);for(const _0x3ffc4f of _0x1e76cc){_0xf71ec0[_0x39e3ff(0x1c6)](renderTaskRow(_0x3ffc4f,_0x173cd9,_0x57de90,_0x38ada8));}const _0x1e0780=calculateStats(_0x1e76cc);_0xf71ec0[_0x39e3ff(0x1c6)](formatStats(_0x1e0780)),_0x137e01&&_0xf71ec0['push'](a38_0x39faf3[_0x39e3ff(0x1db)](_0x39e3ff(0x1a6)+TIMELINE_CONFIG['MAX_TASKS_DISPLAY']+'\x20of\x20'+_0x234a54+'\x20tasks')),_0xf71ec0[_0x39e3ff(0x1c6)](''),_0xf71ec0[_0x39e3ff(0x1c6)](a38_0x39faf3['dim']('💡\x20Tip:\x20Use\x20')+(_0x39e3ff(0x199)+_0x1d65db['id']+_0x39e3ff(0x204))+a38_0x39faf3[_0x39e3ff(0x144)](_0x39e3ff(0x1cf)));}else _0xf71ec0[_0x39e3ff(0x1c6)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0xf71ec0[_0x39e3ff(0x18b)]('\x0a');}[a38_0x3ccc70(0x20a)](_0x19904d,_0x367242){const _0x2aa8de=a38_0x3ccc70,_0x22fb5f=new Date(_0x19904d[_0x2aa8de(0x234)])[_0x2aa8de(0x15a)](),_0x54ba20=_0x19904d['finishedAt']?new Date(_0x19904d[_0x2aa8de(0xca)])[_0x2aa8de(0x15a)]():Date['now'](),_0x55a210=_0x54ba20-_0x22fb5f,_0x3644d2=[];for(const _0x3d2f48 of _0x367242){if(_0x3d2f48[_0x2aa8de(0x1e3)]){const _0x38fbc7=new Date(_0x3d2f48[_0x2aa8de(0x1e3)])['getTime'](),_0x3990fe=_0x3d2f48[_0x2aa8de(0x203)]?new Date(_0x3d2f48['updatedAt'])[_0x2aa8de(0x15a)]():Date['now']();_0x3644d2['push']({'name':_0x3d2f48[_0x2aa8de(0x1be)],'state':_0x3d2f48[_0x2aa8de(0xd0)]||_0x2aa8de(0x24d),'window':{'start':_0x38fbc7,'end':_0x3990fe,'duration':_0x3990fe-_0x38fbc7}});}else _0x3644d2[_0x2aa8de(0x1c6)]({'name':_0x3d2f48[_0x2aa8de(0x1be)],'state':_0x3d2f48[_0x2aa8de(0xd0)]||'planned','window':undefined});}const _0x90ac04=calculateStats(_0x3644d2);return{'attempt':{'id':_0x19904d['id'],'status':_0x19904d[_0x2aa8de(0xf5)]?_0x19904d[_0x2aa8de(0x184)]?'success':_0x2aa8de(0x23a):_0x2aa8de(0x243),'createdAt':_0x19904d[_0x2aa8de(0x234)],'finishedAt':_0x19904d['finishedAt'],'duration_ms':_0x55a210},'tasks':_0x3644d2[_0x2aa8de(0x21d)](_0x37298c=>({'name':_0x37298c['name'],'state':_0x37298c['state'],'startedAt':_0x37298c[_0x2aa8de(0x14e)]?new Date(_0x37298c[_0x2aa8de(0x14e)][_0x2aa8de(0x130)])['toISOString']():null,'updatedAt':_0x37298c[_0x2aa8de(0x14e)]?new Date(_0x37298c[_0x2aa8de(0x14e)][_0x2aa8de(0x1c3)])['toISOString']():null,'duration_ms':_0x37298c[_0x2aa8de(0x14e)]?.[_0x2aa8de(0xc2)]||null})),'stats':_0x90ac04};}}
1
+ const a39_0xf0f359=a39_0x4576;(function(_0x3415a6,_0x224f47){const _0x297bf3=a39_0x4576,_0x549994=_0x3415a6();while(!![]){try{const _0x49ad9a=-parseInt(_0x297bf3(0x25e))/0x1+parseInt(_0x297bf3(0x15e))/0x2+parseInt(_0x297bf3(0x15c))/0x3+-parseInt(_0x297bf3(0x1df))/0x4+parseInt(_0x297bf3(0x256))/0x5*(parseInt(_0x297bf3(0x111))/0x6)+-parseInt(_0x297bf3(0x1ef))/0x7*(-parseInt(_0x297bf3(0x1c4))/0x8)+-parseInt(_0x297bf3(0x24a))/0x9*(-parseInt(_0x297bf3(0x113))/0xa);if(_0x49ad9a===_0x224f47)break;else _0x549994['push'](_0x549994['shift']());}catch(_0x5a8cff){_0x549994['push'](_0x549994['shift']());}}}(a39_0x413e,0x8401a));import a39_0x37d687 from'chalk';import{existsSync}from'fs';import a39_0x2e3d89 from'path';import{BaseCommand}from'./command.js';function a39_0x413e(){const _0x21aa70=['Pull\x20workflow\x20project\x20to\x20local\x20folder','set','\x0aPolling...\x20(','Session\x20','getTime','Listing\x20workflows...','pollTimeline','message','No\x20sessions\x20found\x20for:\x20','every','workflow:use','tasks','Error:\x20Secret\x20key\x20is\x20required','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','Cancelled','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','max','No\x20attempts\x20found\x20in\x20project:\x20','startsWith','\x0a⚠\x20Maximum\x20polling\x20time\x20reached','Project\x20name\x20is\x20required','includeSubtasks','green','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','Select\x20a\x20workflow\x20to\x20run','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','✔\x20Deleted\x20project\x20','getDate','3169386arqrOo','Failed\x20to\x20fetch\x20attempt\x20data','173370rdcmoj','Attempt\x20ID:\x20','\x20\x20Project:\x20','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','sourceProjectName','\x20workflow','Target:\x20','group_error','\x20\x20Location:\x20','No\x20sessions\x20found','Select\x20a\x20session\x20to\x20view\x20timeline:','deleteSecret','\x0aApply\x20these\x20changes?','getMonth','run','Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required','filesExtracted','relative','Params:\x20','---\x20','workflows','Key:\x20','jsonl','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','Cloning\x20to\x20','type','session:','generateSessionTimelineRows','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','\x20\x20Changes:\x20','getFullYear','fs/promises','fileCount','total','Deleting\x20project\x20','\x20has\x20no\x20attempts','prepareCloneProject','\x20\x20Session\x20ID:\x20','workflow:projects','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','params','No\x20workflows\x20found','status','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','new','summary','MIN_LABEL_COUNT','\x22\x20already\x20exists\x20(ID:\x20','Error:\x20Attempt\x20ID\x20is\x20required','dim','sessions','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','sort','revision:\x20','Pulling\x20project\x20','modified','deleted','Pattern:\x20','\x20sessions\x20','resolveProjectDir','workflow:logs','workflow:tasks','Attempt:\x20','success','fullName','.\x20Expected\x20format:\x20KEY=VALUE','find','Kill\x20a\x20running\x20attempt','json','Error:\x20Project\x20name\x20is\x20required','\x20\x20Project\x20ID:\x20','\x20from\x20session\x20','485517iyTXbu','\x20logs','656932ZQBnGh','session_id','replace','title','Start\x20a\x20workflow\x20run','No\x20projects\x20match\x20pattern:\x20','project','stdout','💡\x20Tip:\x20Use\x20','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','List\x20workflow\x20execution\x20sessions','\x20\x20Attempt\x20ID:\x20','output','select','startTime','Usage:\x20workflow:delete\x20<project-name-or-id>','✔\x20Pull\x20complete','pending','attempt','\x0aClone\x20\x22','trimEnd','Files\x20to\x20upload:\x20','\x20(system)','workflow:upload','sessionId','ICON_WIDTH','Deleting\x20secret...','GUTTER','text','resolveProject','finishedAt','applyPullProject','indexOf','✔\x20Project:\x20','✔\x20Push\x20complete','No\x20log\x20content\x20found','unknown','ICON_SPACING','floor','\x20modified','LABEL_MIN_SPACING','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','TASK_NAME_WIDTH','renderSessionsTimeline','Latest\x20session\x20has\x20no\x20attempt','round','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','size','Getting\x20attempt\x20tasks...','projectName','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','has','index','MAX_TIMELINE_WIDTH','Downloading\x20project\x20','Warning:','retrySession','resolveProjectId','workflow:secrets:delete','Reason:\x20','Auto-selected\x20latest\x20session:\x20','table','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','canceling','planned','some','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','\x20of\x20','✔\x20Workflow\x20run\x20started','navigateSessionsInteractive','state','Error:\x20Invalid\x20parameter\x20format:\x20','Resume\x20from:\x20','MAX_TASKS_DISPLAY','\x20\x20tdx\x20wf\x20use\x20<project>','splice','diff','newProjectName','Session\x20time:\x20','toISOString','\x20\x20Session\x20context\x20set\x20to:\x20','fill','✔\x20Secret\x20\x27','\x0aDry\x20run\x20-\x20nothing\x20pushed','No\x20attempts\x20found\x20for:\x20','(unknown)','Project\x20directory:\x20','error','existingProjectId','Retrying\x20session...','attempt:','param','key','✔\x20Workflow\x20project\x20context\x20cleared.','workflow:push','projectId','\x20attempt','name','No\x20matching\x20sessions\x20found','Dry\x20run:\x20yes','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','990184saPJPM','\x20unchanged','localeCompare','log','Filter:\x20','isNewProject','push','substring','metadata','No\x20sessions\x20with\x20timing\x20information','workflowName','Fetching\x20log\x20files...','getHours','Usage:\x20tdx\x20wf\x20use\x20<project>','Output\x20directory:\x20','running','filter','✔\x20Clone\x20complete','Show\x20specific\x20attempt\x20details','\x0aFailed\x20to\x20fetch\x20attempt\x20data','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Revision:\x20','Include\x20retried:\x20yes','\x27...','List\x20workflow\x20attempts','\x20\x20Workflow:\x20','2851040DFaKiQ','\x0aPush\x20these\x20changes?','\x20\x20Target:\x20','targetDir','\x0a✔\x20Attempt\x20complete','blue','duration','path','lastAttempt','workflow:sessions','yes','Updating\x20','split','Filter:\x20project=','pullProject','window','21RTCiYE','No\x20log\x20files\x20found\x20for\x20this\x20attempt','slice','Project\x20name:\x20','\x20session','msPerChar','Status:\x20','preparePushProject','retryAttemptName','/sessions/','Error:\x20','resolve','Show\x20logs\x20for\x20a\x20workflow\x20attempt','done','yellow','isDirectory','fromTask','\x20deleted','from','✔\x20Found\x20','now','\x20\x20Revision:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','Tip:\x20cd\x20to\x20workflows/','workflow:attempts','\x0a⚠\x20Project\x20\x22','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','revision','displayLine','✔\x20Workflow\x20project\x20set\x20to:\x20','🔄\x20','stat','Analyzing\x20project...','workflow:timeline','all','MAX_POLL_ITERATIONS','✔\x20Pushed\x20','description','verbose','No\x20workflow\x20projects\x20found','keys','durationMs','showWorkflowConsoleUrl','fileSize','Source\x20directory:\x20','dryRun','Source:\x20','\x20tasks','stringify','Resolving\x20project\x20\x27','start','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','unchanged','red','format','repeat','basename','Project:\x20','follow','skipValidation','isArray','Force:\x20yes','\x22?\x20This\x20cannot\x20be\x20undone.','sessionTime','MIN_TIMELINE_WIDTH','data','workflow:delete','taskName','site','From\x20task:\x20','cyan','...','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','parse','renderSingleTimeline','Source\x20directory\x20is\x20required','LABEL_WIDTH_DIVISOR','session','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','List\x20all\x20workflow\x20projects','Total:\x20','workflow:kill','parseProjectWorkflowPattern','No\x20attempts\x20found','reason','No\x20workflow\x20sessions\x20found','download','execute','✔\x20Showing\x20','includeRetried','columns','351wPzNPh','attemptId','\x20-\x20','Expected\x20format:\x20--param\x20key=value','readFile','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','Loading\x20session...','changes','autocomplete','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','match','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','5eqrPcg','\x0aUpdate\x20existing\x20project\x20\x22','list','min','Retrying\x20attempt...','end','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','Listing\x20workflow\x20sessions...','812540kIRGCG','logFiles','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','workflow:clone','workflow','updatedAt','Error:','workflow:run','📋\x20','Listing\x20workflow\x20attempts...','Error:\x20KEY=VALUE\x20is\x20required','\x0a✔\x20No\x20changes\x20to\x20push','write','\x20\x20Source:\x20','trim','cancelRequested','No\x20sessions\x20found\x20in\x20project:\x20','cwd','delete','\x22\x20to\x20new\x20project\x20\x22','workflow:secrets:list','isTTY','\x20(use\x20--limit\x20to\x20show\x20more)','Listing\x20workflow\x20projects...','includes','\x20new','No\x20workflow\x20tdx.json\x20found','createdAt','resumeFrom','Validation:\x20skipped','force','map','New\x20project\x20name:\x20','limit','padStart','Error:\x20Invalid\x20JSON\x20in\x20--params','✔\x20New\x20project:\x20','Downloading\x20logs...','✔\x20Downloaded\x20','white','requireProject','workflowProject','length','retryAttempt','targetExists',',\x20Workflow:\x20','POLL_INTERVAL_MS','Retry\x20a\x20session\x20or\x20attempt','context','newProjectId','join','workflow:download','projects','startedAt','renderTimeline','\x20task','value','icon','workflow:attempt','executePushProject','task','\x0aDry\x20run\x20-\x20no\x20project\x20created','\x0a✔\x20Already\x20up\x20to\x20date'];a39_0x413e=function(){return _0x21aa70;};return a39_0x413e();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}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 a39_0xe7a3e1 from'prompts';function getAttemptStatusDisplay(_0x3ccf18){const _0x21dda2=a39_0x4576;if(!_0x3ccf18)return{'icon':'⏳','text':''};const {done:_0x17751e,success:_0x40cacc,cancelRequested:_0x539b0b}=_0x3ccf18;if(!_0x17751e)return _0x539b0b?{'icon':'🛑','text':a39_0x37d687[_0x21dda2(0x1fd)](_0x21dda2(0x19e))}:{'icon':'🔄','text':a39_0x37d687['blue']('running')};if(_0x40cacc)return{'icon':'✅','text':a39_0x37d687[_0x21dda2(0x10b)](_0x21dda2(0x153))};return{'icon':'❌','text':a39_0x37d687['red']('error')};}export class WorkflowBaseCommand extends BaseCommand{['resolveProject'](_0x7580d3,_0x34db1d,_0x225f16=0x0){const _0x40efd0=a39_0x4576;return _0x7580d3[_0x225f16]||_0x34db1d[_0x40efd0(0x287)];}[a39_0xf0f359(0x286)](_0x20e92e,_0x10f0a7,_0x2ee668=0x0){const _0x1bc2c5=a39_0xf0f359,_0x5a164b=this[_0x1bc2c5(0x17b)](_0x20e92e,_0x10f0a7,_0x2ee668);if(!_0x5a164b)return console[_0x1bc2c5(0x1b6)](a39_0x37d687[_0x1bc2c5(0x224)](_0x1bc2c5(0x264)),_0x1bc2c5(0x109)),console[_0x1bc2c5(0x1b6)](a39_0x37d687[_0x1bc2c5(0x145)](_0x1bc2c5(0x209))),null;return _0x5a164b;}[a39_0xf0f359(0x241)](_0x44b373,_0xa6227e){const _0x48de35=a39_0xf0f359;if(_0x44b373[0x0]){const _0x448eaf=_0x44b373[0x0][_0x48de35(0x1eb)]('.');if(_0x448eaf['length']===0x1)return{'projectName':_0x448eaf[0x0],'workflowName':undefined};else return _0x448eaf[_0x48de35(0x288)]===0x2?{'projectName':_0x448eaf[0x0],'workflowName':_0x448eaf[0x1]}:(console['error'](a39_0x37d687['red'](_0x48de35(0x264)),_0x48de35(0x23d)),null);}return{'projectName':_0xa6227e[_0x48de35(0x287)],'workflowName':undefined};}['resolveProjectDir'](_0x51a365,_0x19c25c,_0x452e57=0x0){const _0x1cc809=a39_0xf0f359;if(_0x51a365[_0x452e57])return _0x51a365[_0x452e57];if(_0x19c25c['workflowProject']){const _0x49a931=a39_0x2e3d89[_0x1cc809(0xe8)](process[_0x1cc809(0x26f)](),'workflows',_0x19c25c['workflowProject']);if(existsSync(a39_0x2e3d89['join'](_0x49a931,'tdx.json')))return _0x49a931;}return undefined;}async[a39_0xf0f359(0x219)](_0x53d825,_0x2a3f27,_0x512b29){const _0x5cb50b=a39_0xf0f359;try{const _0x10240d=await _0x53d825[_0x5cb50b(0x262)][_0x5cb50b(0x127)](_0x2a3f27,{'limit':0x1});if(_0x10240d['length']>0x0){const _0x1fd18a=_0x10240d[0x0]['id'],_0x40178d=getWorkflowUrl(_0x512b29,_0x1fd18a);console[_0x5cb50b(0x1b6)]('\x20\x20Console:\x20'+a39_0x37d687[_0x5cb50b(0x235)](_0x40178d));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xff);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d9);async['execute'](_0x27ee6a){const _0x9beb85=a39_0xf0f359,{options:_0x2a3c8a,args:_0x3b5b7b,tdx:_0x4300e0}=_0x27ee6a,_0x1b39d8=_0x3b5b7b[0x0],_0x3513af=_0x2a3c8a['clear'];if(_0x3513af)return saveSessionContext({'workflow_project':undefined},_0x2a3c8a['session']),console[_0x9beb85(0x1c7)](a39_0x37d687[_0x9beb85(0x10b)](_0x9beb85(0x1bc))),0x0;if(!_0x1b39d8)return console[_0x9beb85(0x1b6)](a39_0x37d687['red'](_0x9beb85(0x264)),_0x9beb85(0x109)),console[_0x9beb85(0x1b6)](a39_0x37d687[_0x9beb85(0x145)](_0x9beb85(0x1d1))),console[_0x9beb85(0x1b6)](a39_0x37d687['dim'](_0x9beb85(0x255))),0x1;const _0x57bd08=await withSpinner(_0x9beb85(0x220)+_0x1b39d8+_0x9beb85(0x1dc),()=>_0x4300e0[_0x9beb85(0x262)][_0x9beb85(0x198)](_0x1b39d8),{'verbose':_0x2a3c8a[_0x9beb85(0x215)]}),{name:_0x38b3ca}=_0x57bd08[_0x9beb85(0x230)];return saveSessionContext({'workflow_project':_0x38b3ca},_0x2a3c8a[_0x9beb85(0x23c)]),console[_0x9beb85(0x1c7)](a39_0x37d687[_0x9beb85(0x10b)](_0x9beb85(0x20c)+a39_0x37d687[_0x9beb85(0x235)](_0x38b3ca))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a39_0xf0f359(0x139);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x23e);async[a39_0xf0f359(0x246)](_0x56b2fe){const _0x465bf4=a39_0xf0f359,{options:_0x2af902,args:_0x91b47,tdx:_0x5991b2}=_0x56b2fe,_0x40002f=_0x91b47[0x0];_0x2af902['verbose']&&_0x40002f&&console[_0x465bf4(0x1b6)](_0x465bf4(0x14d)+_0x40002f);const _0xa6e102=await withSpinner(_0x465bf4(0x275),()=>_0x5991b2['workflow'][_0x465bf4(0xea)](_0x40002f,{'limit':_0x2af902[_0x465bf4(0x27f)]}),{'verbose':_0x2af902[_0x465bf4(0x215)]});let _0x1338e4=_0xa6e102[_0x465bf4(0x230)];_0x1338e4[_0x465bf4(0x148)]((_0x56fd52,_0x3429d3)=>_0x56fd52[_0x465bf4(0x1c0)][_0x465bf4(0x1c6)](_0x3429d3[_0x465bf4(0x1c0)]));const _0x582a92=_0x2af902[_0x465bf4(0x27f)]||0x64,_0x7f4a89=_0x1338e4[_0x465bf4(0x288)]>=_0x582a92?a39_0x37d687[_0x465bf4(0x145)](_0x465bf4(0x274)):'';console['error'](_0x465bf4(0x202)+_0x1338e4['length']+'\x20project'+(_0x1338e4[_0x465bf4(0x288)]!==0x1?'s':'')+_0x7f4a89);if(_0x2af902[_0x465bf4(0x225)]===_0x465bf4(0x158)||_0x2af902['format']===_0x465bf4(0x129)||_0x2af902['format']===_0x465bf4(0x19c))await handleSDKOutput(_0x1338e4,_0x2af902);else{if(_0x1338e4['length']===0x0)_0x40002f?console[_0x465bf4(0x1c7)](_0x465bf4(0x163)+_0x40002f):console[_0x465bf4(0x1c7)](_0x465bf4(0x216));else{const _0x54277a=_0x1338e4['map'](_0x552ebf=>{const _0x424230=_0x465bf4,_0x34726c=_0x552ebf[_0x424230(0x1cc)]?.[_0x424230(0x1a0)](_0x1a2032=>_0x1a2032['key']==='sys'),_0x1a592e=_0x34726c?a39_0x37d687['dim'](_0x424230(0x174)):'';return'📁\x20'+_0x552ebf[_0x424230(0x1c0)]+_0x1a592e;});await writeOutput(_0x54277a['join']('\x0a'),_0x2af902['output'],_0x465bf4(0x258));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{['name']='workflow:workflows';[a39_0xf0f359(0x214)]='List\x20workflows';async[a39_0xf0f359(0x246)](_0x43601a){const _0x2e1d2b=a39_0xf0f359,{options:_0x489e1e,args:_0x2e8741,tdx:_0x266e9c}=_0x43601a,_0x524cc8=this[_0x2e1d2b(0x17b)](_0x2e8741,_0x489e1e);_0x489e1e['verbose']&&_0x524cc8&&console['error']('Project\x20filter:\x20'+_0x524cc8);const _0x1bdaaa=await withSpinner(_0x2e1d2b(0xfa),()=>_0x266e9c[_0x2e1d2b(0x262)][_0x2e1d2b(0x127)](_0x524cc8,{'limit':_0x489e1e[_0x2e1d2b(0x27f)]}),{'verbose':_0x489e1e[_0x2e1d2b(0x215)]});let _0x19f9a2=_0x1bdaaa[_0x2e1d2b(0x230)];_0x19f9a2[_0x2e1d2b(0x148)]((_0x241e07,_0x459eb7)=>{const _0x56b172=_0x2e1d2b,_0x4a1e9c=_0x241e07[_0x56b172(0x1c0)][_0x56b172(0x1c6)](_0x459eb7['name']);if(_0x4a1e9c!==0x0)return _0x4a1e9c;return(_0x241e07[_0x56b172(0x164)]?.[_0x56b172(0x1c0)]||'')[_0x56b172(0x1c6)](_0x459eb7[_0x56b172(0x164)]?.['name']||'');});const _0x14397d=_0x489e1e[_0x2e1d2b(0x27f)]||0x64,_0x5225f4=_0x19f9a2['length']>=_0x14397d?a39_0x37d687[_0x2e1d2b(0x145)](_0x2e1d2b(0x274)):'';console['error'](_0x2e1d2b(0x202)+_0x19f9a2[_0x2e1d2b(0x288)]+_0x2e1d2b(0x118)+(_0x19f9a2[_0x2e1d2b(0x288)]!==0x1?'s':'')+_0x5225f4);if(_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x158)||_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x129)||_0x489e1e[_0x2e1d2b(0x225)]===_0x2e1d2b(0x19c))await handleSDKOutput(_0x19f9a2,_0x489e1e);else{if(_0x19f9a2['length']===0x0)_0x524cc8?console[_0x2e1d2b(0x1c7)]('No\x20workflows\x20found\x20in\x20project:\x20'+_0x524cc8):console[_0x2e1d2b(0x1c7)](_0x2e1d2b(0x13c));else{const _0x2bdf39=_0x489e1e['site'],_0x2ac52a=_0x19f9a2[_0x2e1d2b(0x27d)](_0x1ffe5d=>{const _0x1326e0=_0x2e1d2b,_0x21d1a3=a39_0x37d687[_0x1326e0(0x145)]('#'+_0x1ffe5d['id']),_0x13185b=hyperlink(_0x21d1a3,getWorkflowUrl(_0x2bdf39,_0x1ffe5d['id'])),_0x285934=_0x1ffe5d[_0x1326e0(0x164)]?.['name']?a39_0x37d687['dim']('\x20('+_0x1ffe5d['project'][_0x1326e0(0x1c0)]+')'):'';return _0x1326e0(0x266)+_0x13185b+'\x20'+_0x1ffe5d[_0x1326e0(0x1c0)]+_0x285934;});await writeOutput(_0x2ac52a['join']('\x0a'),_0x489e1e[_0x2e1d2b(0x16a)],_0x2e1d2b(0x258));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{['name']=a39_0xf0f359(0x1e8);['description']=a39_0xf0f359(0x168);async[a39_0xf0f359(0x246)](_0x28f403){const _0x2a4b69=a39_0xf0f359,{options:_0x4a8799,args:_0x55cc62,tdx:_0x2c2bce}=_0x28f403,_0x4b9af2=this[_0x2a4b69(0x241)](_0x55cc62,_0x4a8799);if(!_0x4b9af2)return 0x1;const {projectName:_0x3a87eb,workflowName:_0x40b416}=_0x4b9af2;if(_0x4a8799[_0x2a4b69(0x215)]){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1b6)]('Filter:\x20'+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb&&console[_0x2a4b69(0x1b6)](_0x2a4b69(0x1ec)+_0x3a87eb);const _0x5715b5=_0x4a8799[_0x2a4b69(0x13d)];_0x5715b5&&console[_0x2a4b69(0x1b6)](_0x2a4b69(0x1f5)+_0x5715b5);}let _0x371e10=0x28;if(process[_0x2a4b69(0x165)][_0x2a4b69(0x273)]&&!_0x4a8799[_0x2a4b69(0x16a)]&&!_0x4a8799['format']){const _0x8a4726=process[_0x2a4b69(0x165)]['rows']||0x28;_0x371e10=Math[_0x2a4b69(0x105)](0x14,Math['floor'](_0x8a4726*0x2/0x3));}const _0x562114=_0x4a8799[_0x2a4b69(0x27f)]||_0x371e10,_0x24add3=await withSpinner(_0x2a4b69(0x25d),()=>_0x2c2bce['workflow'][_0x2a4b69(0x146)]({'projectName':_0x3a87eb,'workflowName':_0x40b416,'status':_0x4a8799[_0x2a4b69(0x13d)],'fromTime':_0x4a8799[_0x2a4b69(0x201)],'toTime':_0x4a8799['to'],'limit':_0x562114}),{'verbose':_0x4a8799[_0x2a4b69(0x215)]}),_0x3bda5b=_0x24add3['data'];_0x3bda5b[_0x2a4b69(0x148)]((_0x2114bc,_0x6051e1)=>{const _0x395a1f=_0x2a4b69,_0x2064bf=_0x2114bc['sessionTime']||'',_0x2abc8f=_0x6051e1[_0x395a1f(0x22e)]||'';return _0x2abc8f[_0x395a1f(0x1c6)](_0x2064bf);});_0x3bda5b['length']>=_0x562114?console[_0x2a4b69(0x1b6)](_0x2a4b69(0x247)+_0x3bda5b[_0x2a4b69(0x288)]+_0x2a4b69(0x14e)+a39_0x37d687[_0x2a4b69(0x145)]('(use\x20--limit\x20to\x20see\x20more)')):console['error'](_0x2a4b69(0x202)+_0x3bda5b[_0x2a4b69(0x288)]+_0x2a4b69(0x1f3)+(_0x3bda5b[_0x2a4b69(0x288)]!==0x1?'s':''));if(_0x4a8799[_0x2a4b69(0x225)]==='json'||_0x4a8799[_0x2a4b69(0x225)]===_0x2a4b69(0x129)||_0x4a8799[_0x2a4b69(0x225)]===_0x2a4b69(0x19c))await handleSDKOutput(_0x3bda5b,_0x4a8799);else{if(!process[_0x2a4b69(0x165)][_0x2a4b69(0x273)]||_0x4a8799[_0x2a4b69(0x16a)]){if(_0x3bda5b[_0x2a4b69(0x288)]===0x0){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1c7)](_0x2a4b69(0xfd)+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb?console['log'](_0x2a4b69(0x26e)+_0x3a87eb):console[_0x2a4b69(0x1c7)](_0x2a4b69(0x11c));}else{const _0x1e6737=_0x4a8799[_0x2a4b69(0x233)],_0x840af8=this[_0x2a4b69(0x189)](_0x3bda5b,_0x1e6737);_0x4a8799[_0x2a4b69(0x16a)]?await writeOutput(_0x840af8,_0x4a8799[_0x2a4b69(0x16a)],'list'):console[_0x2a4b69(0x1c7)](_0x840af8);}!_0x3a87eb&&(console['error'](''),console[_0x2a4b69(0x1b6)](a39_0x37d687[_0x2a4b69(0x145)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x2a4b69(0x1b6)](a39_0x37d687[_0x2a4b69(0x145)](_0x2a4b69(0x260))+'or'+a39_0x37d687[_0x2a4b69(0x145)](_0x2a4b69(0x1a9))));}else{if(_0x3bda5b[_0x2a4b69(0x288)]===0x0){if(_0x3a87eb&&_0x40b416)console[_0x2a4b69(0x1c7)]('No\x20sessions\x20found\x20for:\x20'+_0x3a87eb+'.'+_0x40b416);else _0x3a87eb?console[_0x2a4b69(0x1c7)](_0x2a4b69(0x26e)+_0x3a87eb):console[_0x2a4b69(0x1c7)](_0x2a4b69(0x11c));}else await this[_0x2a4b69(0x1a4)](_0x3bda5b,_0x28f403,_0x3a87eb);}}return 0x0;}[a39_0xf0f359(0x189)](_0x44956d,_0x52a367){const _0x397b77=a39_0xf0f359,_0x1c7407=[],_0x582b87=new Map();let _0x337b1e=Infinity,_0x5cfabf=-Infinity;for(const _0x4cd59f of _0x44956d){if(_0x4cd59f['lastAttempt']?.['createdAt']){const _0x963b87=new Date(_0x4cd59f['lastAttempt'][_0x397b77(0x279)])['getTime'](),_0x41bd4c=_0x4cd59f['lastAttempt'][_0x397b77(0x17c)]?new Date(_0x4cd59f['lastAttempt'][_0x397b77(0x17c)])[_0x397b77(0xf9)]():Date['now'](),_0x341474=_0x4cd59f[_0x397b77(0x164)]?.[_0x397b77(0x1c0)]||_0x397b77(0x1b4);!_0x582b87[_0x397b77(0x192)](_0x341474)&&_0x582b87[_0x397b77(0xf6)](_0x341474,[]),_0x582b87['get'](_0x341474)[_0x397b77(0x1ca)]({'session':_0x4cd59f,'startTime':_0x963b87,'endTime':_0x41bd4c,'duration':_0x41bd4c-_0x963b87}),_0x337b1e=Math[_0x397b77(0x259)](_0x337b1e,_0x963b87),_0x5cfabf=Math[_0x397b77(0x105)](_0x5cfabf,_0x41bd4c);}}if(_0x582b87[_0x397b77(0x18d)]===0x0)return _0x397b77(0x1cd);const _0x267377=process[_0x397b77(0x165)][_0x397b77(0x249)]||0x78,_0x4075b1=0x1e,_0x284175=0x32,_0x1817a9=0x4,_0x1c48ad=Math[_0x397b77(0x259)](_0x284175,Math['max'](_0x4075b1,Math[_0x397b77(0x184)](_0x267377*0.3))),_0x336d6e=_0x267377-_0x1c48ad-TIMELINE_CONFIG[_0x397b77(0x179)]-0x3-_0x1817a9,_0x584e9a=_0x5cfabf-_0x337b1e,_0x273e1c=_0x584e9a/_0x1c48ad,_0x582049=renderTimeAxis({'startTime':_0x337b1e,'endTime':_0x5cfabf,'durationMs':_0x584e9a,'msPerChar':_0x273e1c},_0x1c48ad),_0x333f03=[];for(const _0x399632 of _0x582b87['values']()){_0x333f03[_0x397b77(0x1ca)](..._0x399632);}_0x333f03[_0x397b77(0x148)]((_0x119583,_0x154b8a)=>_0x154b8a[_0x397b77(0x16c)]-_0x119583[_0x397b77(0x16c)]);const _0x163d1b=new Date(_0x337b1e),_0xa03ff5=formatDate(_0x163d1b),_0x19d5b5=_0x1817a9+TIMELINE_CONFIG[_0x397b77(0x177)]+TIMELINE_CONFIG['ICON_SPACING']+_0x336d6e,_0x46a7b6='\x20'[_0x397b77(0x226)](_0x19d5b5-_0xa03ff5['length']),_0x2d5f8f=_0x46a7b6+a39_0x37d687['dim'](_0xa03ff5)+'\x20'+_0x582049;_0x1c7407['push'](_0x2d5f8f);const _0x16a100=0x16;let _0x179798=0x0;for(const _0x44934d of _0x333f03){const _0x12fd41=_0x44934d[_0x397b77(0x23c)]['project']?.[_0x397b77(0x1c0)]||'?',_0x424bb6=Math[_0x397b77(0x259)](stringWidth(_0x12fd41),_0x16a100);_0x179798=Math[_0x397b77(0x105)](_0x179798,_0x424bb6);}for(const _0x3ceb18 of _0x333f03){const {session:_0x262cb4,startTime:_0x30f327,endTime:_0x20dcde,duration:_0x1f845c}=_0x3ceb18,_0x410fcf=_0x262cb4[_0x397b77(0x164)]?.['id'],_0x4c4c6f=_0x262cb4['id'],_0x98dce0=_0x262cb4[_0x397b77(0x164)]?.[_0x397b77(0x1c0)]||'?',_0x145447=_0x262cb4[_0x397b77(0x262)]?.[_0x397b77(0x1c0)]||'?';let _0x26a61b,_0x467a74;if(_0x262cb4['lastAttempt']){const _0x52b657=_0x262cb4[_0x397b77(0x1e7)];!_0x52b657['done']?(_0x26a61b=_0x52b657['cancelRequested']?'🛑':'🔄',_0x467a74=_0x52b657[_0x397b77(0x26d)]?a39_0x37d687['yellow']:a39_0x37d687[_0x397b77(0x1e4)]):(_0x26a61b=_0x52b657[_0x397b77(0x153)]?'✅':'❌',_0x467a74=_0x52b657[_0x397b77(0x153)]?a39_0x37d687[_0x397b77(0x10b)]:a39_0x37d687['red']);}else _0x26a61b='⏳',_0x467a74=a39_0x37d687['dim'];const _0x510ea5='#'+_0x4c4c6f,_0x430c37=_0x410fcf?hyperlink(_0x510ea5,getWorkflowSessionUrl(_0x52a367,_0x410fcf,_0x4c4c6f)):_0x510ea5;let _0x5dcf84=_0x98dce0;stringWidth(_0x98dce0)>_0x16a100&&(_0x5dcf84=_0x98dce0['slice'](0x0,_0x16a100-0x1)+'…');const _0x5d0fee=a39_0x37d687[_0x397b77(0x145)](_0x5dcf84),_0x467f73=stringWidth(_0x5dcf84),_0x45d9ea='\x20'[_0x397b77(0x226)](_0x179798-stringWidth(_0x5dcf84)+0x2),_0x40ec4c='('+formatElapsed(_0x1f845c)+')',_0x7c23b2=stringWidth(_0x40ec4c),_0x4c2747=stringWidth(_0x510ea5),_0x2c8fb0=_0x4c2747+0x1+_0x467f73+_0x45d9ea[_0x397b77(0x288)],_0x342223=_0x336d6e-_0x2c8fb0-_0x7c23b2-0x1-0x8;let _0x4efc17=_0x145447;stringWidth(_0x4efc17)>_0x342223&&(_0x4efc17=_0x4efc17['slice'](0x0,_0x342223-0x1)+'…');const _0x53663a=_0x430c37+'\x20'+_0x5d0fee+_0x45d9ea+_0x4efc17,_0x2e0d42=stringWidth(_0x53663a),_0x12c0f5=_0x336d6e-_0x2e0d42-_0x7c23b2,_0xa98880=_0x53663a+'\x20'[_0x397b77(0x226)](Math['max'](0x1,_0x12c0f5))+a39_0x37d687['dim'](_0x40ec4c),_0x103cd0=Math[_0x397b77(0x184)]((_0x30f327-_0x337b1e)/_0x273e1c),_0x344bde=Math[_0x397b77(0x184)]((_0x20dcde-_0x337b1e)/_0x273e1c),_0x14e172=Math[_0x397b77(0x105)](_0x103cd0+0x1,_0x344bde),_0x1d5176=new Array(_0x1c48ad)[_0x397b77(0x1b0)]('\x20');for(let _0x6a3b7f=_0x103cd0;_0x6a3b7f<Math[_0x397b77(0x259)](_0x14e172,_0x1c48ad);_0x6a3b7f++){_0x1d5176[_0x6a3b7f]='─';}const _0x5b8e38=_0x1d5176[_0x397b77(0x27d)](_0x54e464=>_0x54e464==='\x20'?'\x20':_0x467a74(_0x54e464))['join']('');_0x1c7407[_0x397b77(0x1ca)](_0x26a61b+'\x20'+_0xa98880+'│'+_0x5b8e38+'│');}return _0x1c7407[_0x397b77(0xe8)]('\x0a');}async[a39_0xf0f359(0x1a4)](_0x343686,_0x53cea2,_0x5f57c1){const _0x2ace30=a39_0xf0f359,{options:_0x1d8be0,tdx:_0x5e40a6}=_0x53cea2,_0x32afcf=_0x1d8be0[_0x2ace30(0x233)],{timelineRows:_0x1e328a,timeAxisHeader:_0xbea986}=this[_0x2ace30(0x12e)](_0x343686,_0x32afcf),_0x29658e=_0x1e328a[_0x2ace30(0x1d4)](_0x1f8e40=>_0x1f8e40[_0x2ace30(0x24b)]);if(_0x29658e[_0x2ace30(0x288)]===0x0){const _0x26fb1c=this[_0x2ace30(0x189)](_0x343686,_0x32afcf);console[_0x2ace30(0x1c7)](_0x26fb1c);!_0x5f57c1&&(console[_0x2ace30(0x1b6)](''),console[_0x2ace30(0x1b6)](a39_0x37d687['dim'](_0x2ace30(0x13a))),console[_0x2ace30(0x1b6)](a39_0x37d687[_0x2ace30(0x145)](_0x2ace30(0x260))+'or'+a39_0x37d687['dim'](_0x2ace30(0x1a9))));return;}_0xbea986&&console[_0x2ace30(0x1c7)](_0xbea986);const _0x34478c=_0x1e328a['filter'](_0x504706=>_0x504706[_0x2ace30(0x24b)])['map'](_0x5421bf=>({'title':_0x5421bf[_0x2ace30(0x20b)],'value':_0x5421bf[_0x2ace30(0x24b)]})),_0xbcc741=process[_0x2ace30(0x165)]['rows']||0x3c,_0xe529c5=Math[_0x2ace30(0x105)](0x28,Math[_0x2ace30(0x184)](_0xbcc741*0x2/0x3)),_0x480fa9=await a39_0xe7a3e1({'type':_0x2ace30(0x252),'name':'attemptId','message':'Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','choices':_0x34478c,'initial':-0x1,'limit':_0xe529c5,'clearFirst':!![],'fallback':{'title':_0x2ace30(0x1c1),'value':null},'suggest':(_0x3d04b4,_0x1453d0)=>{const _0x32f743=_0x2ace30;if(!_0x3d04b4)return Promise['resolve'](_0x1453d0);const _0x27ced9=_0x1453d0[_0x32f743(0x1d4)](_0x3f4e6d=>{const _0xa0d96b=_0x32f743,_0x1ecb4e=_0x3f4e6d;return _0x1ecb4e[_0xa0d96b(0x161)]['toLowerCase']()['includes'](_0x3d04b4['toLowerCase']());});return Promise[_0x32f743(0x1fa)](_0x27ced9);}}),_0x28e285=()=>{const _0x32cc9d=_0x2ace30;process['stdout']['write']('\x1b[1A\x1b[2K'),process[_0x32cc9d(0x165)]['write']('\x1b[1A\x1b[2K'),process[_0x32cc9d(0x165)][_0x32cc9d(0x26a)]('\x1b[1A\x1b[2K');},_0x26f502=_0x480fa9&&_0x480fa9[_0x2ace30(0x24b)]&&_0x480fa9['attemptId']!==null&&_0x480fa9['attemptId'][_0x2ace30(0x26c)]()!=='';if(!_0x26f502){_0x28e285(),console[_0x2ace30(0x1c7)](a39_0x37d687[_0x2ace30(0x145)](_0x2ace30(0x103)));return;}_0x28e285();const _0x26b092=_0x343686[_0x2ace30(0x156)](_0x14d453=>_0x14d453['lastAttempt']?.['id']===_0x480fa9[_0x2ace30(0x24b)]);if(_0x26b092){const _0xf74a2b=_0x26b092[_0x2ace30(0x164)]?.['name']||'?',_0xd39bc7=_0x26b092[_0x2ace30(0x262)]?.['name']||'?';console[_0x2ace30(0x1c7)](_0x2ace30(0x228)+a39_0x37d687[_0x2ace30(0x145)](_0xf74a2b)+_0x2ace30(0xe3)+a39_0x37d687[_0x2ace30(0x145)](_0xd39bc7));}const _0x294e78=new WorkflowTimelineCommand();await _0x294e78[_0x2ace30(0x246)]({'args':[],'options':{..._0x1d8be0,'attemptId':_0x480fa9[_0x2ace30(0x24b)]},'tdx':_0x5e40a6});}[a39_0xf0f359(0x12e)](_0x461581,_0x293937){const _0x3bec3a=a39_0xf0f359,_0x1748d8=new Map();for(const _0x12eac7 of _0x461581){_0x12eac7['id']&&_0x12eac7[_0x3bec3a(0x1e7)]?.['id']&&_0x1748d8['set'](_0x12eac7['id'],_0x12eac7[_0x3bec3a(0x1e7)]['id']);}const _0x1051cd=[];let _0x8d0b04='';const _0x4093e8=this[_0x3bec3a(0x189)](_0x461581,_0x293937),_0x1a098c=_0x4093e8[_0x3bec3a(0x1eb)]('\x0a');for(const _0x16bac1 of _0x1a098c){if(_0x16bac1['startsWith']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20')||_0x16bac1[_0x3bec3a(0x254)](/^\s+\d{4}-\d{2}-\d{2}/))_0x8d0b04=_0x16bac1;else{if(_0x16bac1[_0x3bec3a(0x254)](/^[✅❌🔄🛑⏳]/)){const _0x33c45e=_0x16bac1['match'](/#(\d+)/),_0x486d55=_0x33c45e?_0x33c45e[0x1]:null,_0x49ccd2=_0x486d55?_0x1748d8['get'](_0x486d55)||null:null,_0x2e121b=_0x461581[_0x3bec3a(0x156)](_0x10452d=>_0x10452d['id']===_0x486d55),_0x282449=_0x2e121b?.[_0x3bec3a(0x164)]?.[_0x3bec3a(0x1c0)]||'';_0x1051cd['push']({'displayLine':_0x16bac1,'attemptId':_0x49ccd2,'projectName':_0x282449});}}}return{'timelineRows':_0x1051cd,'timeAxisHeader':_0x8d0b04};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x207);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1dd);async[a39_0xf0f359(0x246)](_0x23ddcc){const _0x1f9c98=a39_0xf0f359,{options:_0x4cc009,args:_0x5c7e31,tdx:_0x110098}=_0x23ddcc,_0x334ddf=this[_0x1f9c98(0x241)](_0x5c7e31,_0x4cc009);if(!_0x334ddf)return 0x1;const {projectName:_0x59daa4,workflowName:_0x5847a0}=_0x334ddf,_0x1ac5e2=_0x4cc009[_0x1f9c98(0x248)];if(_0x4cc009['verbose']){if(_0x59daa4&&_0x5847a0)console[_0x1f9c98(0x1b6)]('Filter:\x20'+_0x59daa4+'.'+_0x5847a0);else _0x59daa4&&console[_0x1f9c98(0x1b6)]('Filter:\x20project='+_0x59daa4);_0x1ac5e2&&console[_0x1f9c98(0x1b6)](_0x1f9c98(0x1db));}const _0x46f980=await withSpinner(_0x1f9c98(0x267),()=>_0x110098[_0x1f9c98(0x262)]['attempts']({'projectName':_0x59daa4,'workflowName':_0x5847a0,'includeRetried':_0x1ac5e2,'limit':_0x4cc009[_0x1f9c98(0x27f)]}),{'verbose':_0x4cc009[_0x1f9c98(0x215)]}),_0x2fcdd4=_0x46f980['data'],_0x5650db=_0x4cc009['limit']||0x64,_0x1c0c37=_0x2fcdd4[_0x1f9c98(0x288)]>=_0x5650db?a39_0x37d687[_0x1f9c98(0x145)](_0x1f9c98(0x274)):'';console[_0x1f9c98(0x1b6)]('✔\x20Found\x20'+_0x2fcdd4[_0x1f9c98(0x288)]+_0x1f9c98(0x1bf)+(_0x2fcdd4[_0x1f9c98(0x288)]!==0x1?'s':'')+_0x1c0c37);if(_0x4cc009[_0x1f9c98(0x225)]==='json'||_0x4cc009['format']===_0x1f9c98(0x129)||_0x4cc009[_0x1f9c98(0x225)]===_0x1f9c98(0x19c))await handleSDKOutput(_0x2fcdd4,_0x4cc009);else{if(_0x2fcdd4['length']===0x0){if(_0x59daa4&&_0x5847a0)console[_0x1f9c98(0x1c7)](_0x1f9c98(0x1b3)+_0x59daa4+'.'+_0x5847a0);else _0x59daa4?console[_0x1f9c98(0x1c7)](_0x1f9c98(0x106)+_0x59daa4):console[_0x1f9c98(0x1c7)](_0x1f9c98(0x242));}else{const _0xeec727=_0x4cc009[_0x1f9c98(0x233)],_0x34d8bf=_0x2fcdd4[_0x1f9c98(0x27d)](_0xbae08b=>{const _0x123d04=_0x1f9c98,_0xf55f5d=a39_0x37d687[_0x123d04(0x145)]('#'+_0xbae08b['id']),_0xdd4c9b=_0xbae08b[_0x123d04(0x164)]?.['id'],_0x437211=_0xbae08b[_0x123d04(0x15f)]||_0xbae08b['sessionId'],_0x84bf=_0xdd4c9b&&_0x437211?hyperlink(_0xf55f5d,getWorkflowAttemptUrl(_0xeec727,_0xdd4c9b,_0x437211,_0xbae08b['id'])):_0xf55f5d,{icon:_0x147a93,text:_0x41d003}=getAttemptStatusDisplay(_0xbae08b),_0x107eec=(_0xbae08b[_0x123d04(0x164)]?.[_0x123d04(0x1c0)]||'?')+'.'+(_0xbae08b[_0x123d04(0x262)]?.[_0x123d04(0x1c0)]||'?'),_0x525dec=_0xbae08b[_0x123d04(0x22e)]?a39_0x37d687[_0x123d04(0x145)](_0xbae08b[_0x123d04(0x22e)]):'';return(_0x84bf+'\x20'+_0x147a93+(_0x41d003?'\x20'+_0x41d003:'')+'\x20'+_0x107eec+'\x20'+_0x525dec)[_0x123d04(0x172)]();});await writeOutput(_0x34d8bf[_0x1f9c98(0xe8)]('\x0a'),_0x4cc009[_0x1f9c98(0x16a)],'list');}}return 0x0;}}function a39_0x4576(_0x501420,_0x22c6b7){_0x501420=_0x501420-0xe2;const _0x413ea=a39_0x413e();let _0x45769d=_0x413ea[_0x501420];return _0x45769d;}export class WorkflowAttemptCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xf0);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d6);async['execute'](_0x2ddfe6){const _0x134cce=a39_0xf0f359,{options:_0x1523f1,args:_0x23f181,tdx:_0x152a36}=_0x2ddfe6,_0x159121=_0x23f181[0x0];if(!_0x159121)return console[_0x134cce(0x1b6)](_0x134cce(0x144)),0x1;_0x1523f1['verbose']&&console[_0x134cce(0x1b6)](_0x134cce(0x114)+_0x159121);const _0xc3ea94=await withSpinner('Getting\x20attempt\x20details...',()=>_0x152a36[_0x134cce(0x262)][_0x134cce(0x170)](_0x159121),{'verbose':_0x1523f1[_0x134cce(0x215)]}),_0x20a806=_0xc3ea94['data'];let _0xaae21d;!_0x20a806[_0x134cce(0x1fc)]?_0xaae21d=_0x20a806['cancelRequested']?_0x134cce(0x19e):_0x134cce(0x1d3):_0xaae21d=_0x20a806['success']?'success':_0x134cce(0x1b6);let _0x38c034;if(_0x20a806['createdAt']&&_0x20a806['finishedAt']){const _0x2c998f=new Date(_0x20a806[_0x134cce(0x279)])['getTime'](),_0x3ace07=new Date(_0x20a806['finishedAt'])[_0x134cce(0xf9)]();_0x38c034=Math[_0x134cce(0x18b)]((_0x3ace07-_0x2c998f)/0x3e8);}const _0x5360b0={'attempt_id':_0x20a806['id'],'status':_0xaae21d,..._0x20a806[_0x134cce(0x193)]!==undefined&&{'index':_0x20a806[_0x134cce(0x193)]},..._0x20a806[_0x134cce(0x164)]&&{'project':_0x20a806[_0x134cce(0x164)][_0x134cce(0x1c0)]},..._0x20a806[_0x134cce(0x262)]&&{'workflow':_0x20a806[_0x134cce(0x262)]['name']},..._0x20a806[_0x134cce(0x176)]&&{'session_id':_0x20a806['sessionId']},..._0x20a806['sessionTime']&&{'session_time':_0x20a806[_0x134cce(0x22e)]},..._0x20a806[_0x134cce(0x1f7)]&&{'retry_attempt':_0x20a806[_0x134cce(0x1f7)]},..._0x38c034!==undefined&&{'duration_sec':_0x38c034},..._0x20a806[_0x134cce(0x279)]&&{'created_at':_0x20a806[_0x134cce(0x279)]},..._0x20a806[_0x134cce(0x17c)]&&{'finished_at':_0x20a806[_0x134cce(0x17c)]},...Object[_0x134cce(0x217)](_0x20a806['params'])[_0x134cce(0x288)]>0x0&&{'params':_0x20a806[_0x134cce(0x13b)]}};return await handleSingleObjectOutput(_0x5360b0,_0x1523f1),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x151);[a39_0xf0f359(0x214)]='Show\x20tasks\x20for\x20an\x20attempt';async[a39_0xf0f359(0x246)](_0x6a602b){const _0xbe9fed=a39_0xf0f359,{options:_0x44cfff,args:_0x51224b,tdx:_0x4b283a}=_0x6a602b,_0x911fb9=_0x51224b[0x0];if(!_0x911fb9)return console[_0xbe9fed(0x1b6)](_0xbe9fed(0x144)),0x1;const _0x3d79f2=_0x44cfff[_0xbe9fed(0x10a)];_0x44cfff[_0xbe9fed(0x215)]&&(console['error'](_0xbe9fed(0x114)+_0x911fb9),_0x3d79f2&&console[_0xbe9fed(0x1b6)]('Including\x20subtasks:\x20yes'));const _0xa8498f=await withSpinner(_0xbe9fed(0x18e),()=>_0x4b283a[_0xbe9fed(0x262)]['tasks'](_0x911fb9,_0x3d79f2||![]),{'verbose':_0x44cfff[_0xbe9fed(0x215)]}),_0x350109=_0xa8498f[_0xbe9fed(0x230)];return console[_0xbe9fed(0x1b6)](_0xbe9fed(0x202)+_0x350109[_0xbe9fed(0x288)]+_0xbe9fed(0xed)+(_0x350109[_0xbe9fed(0x288)]!==0x1?'s':'')),await handleSDKOutput(_0x350109,_0x44cfff),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x150);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1fb);async[a39_0xf0f359(0x246)](_0x241c21){const _0x91e76a=a39_0xf0f359,{options:_0x5e163b,args:_0x1ce8bc,tdx:_0x4a3b39}=_0x241c21,_0x2334e0=_0x1ce8bc[0x0];let _0x333d85=_0x1ce8bc[0x1];if(!_0x2334e0)return console[_0x91e76a(0x1b6)](_0x91e76a(0x144)),0x1;_0x5e163b[_0x91e76a(0x215)]&&(console[_0x91e76a(0x1b6)](_0x91e76a(0x114)+_0x2334e0),_0x333d85&&console[_0x91e76a(0x1b6)]('Task\x20name:\x20'+_0x333d85));const _0x4dd0ce=await withSpinner(_0x91e76a(0x1cf),()=>_0x4a3b39[_0x91e76a(0x262)][_0x91e76a(0x25f)](_0x2334e0,_0x333d85),{'verbose':_0x5e163b[_0x91e76a(0x215)]}),_0x2ad14b=_0x4dd0ce['data'];if(_0x2ad14b[_0x91e76a(0x288)]===0x0)return console[_0x91e76a(0x1b6)](_0x91e76a(0x1f0)),0x0;if(!_0x333d85&&(_0x5e163b['json']||_0x5e163b[_0x91e76a(0x225)]))return await handleSDKOutput(_0x2ad14b,_0x5e163b),0x0;if(!_0x333d85){const _0x468d75=_0x2ad14b[_0x91e76a(0x27d)](_0x42ce11=>({'title':_0x42ce11[_0x91e76a(0x232)]+'\x20('+formatBytes(_0x42ce11[_0x91e76a(0x21a)])+')','value':_0x42ce11[_0x91e76a(0x232)]})),_0x41719d=await a39_0xe7a3e1({'type':_0x91e76a(0x16b),'name':'task','message':'Select\x20a\x20task\x20to\x20view\x20logs:','choices':_0x468d75});if(!_0x41719d[_0x91e76a(0xf2)])return console['error']('Cancelled'),0x0;_0x333d85=_0x41719d['task'];}const _0x497c4d=await withSpinner(_0x91e76a(0x283),()=>_0x4a3b39[_0x91e76a(0x262)]['logs'](_0x2334e0,_0x333d85),{'verbose':_0x5e163b[_0x91e76a(0x215)]}),_0x1cf05a=_0x497c4d[_0x91e76a(0x230)];return _0x1cf05a?console['log'](_0x1cf05a):console[_0x91e76a(0x1b6)](_0x91e76a(0x181)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x240);['description']=a39_0xf0f359(0x157);async[a39_0xf0f359(0x246)](_0x323c66){const _0x454467=a39_0xf0f359,{options:_0x58ba42,args:_0x4a41ae,tdx:_0xf3d109}=_0x323c66,_0x5dd587=_0x4a41ae[0x0];if(!_0x5dd587)return console[_0x454467(0x1b6)](_0x454467(0x144)),0x1;const _0xc23cb1=_0x58ba42[_0x454467(0x243)];_0x58ba42[_0x454467(0x215)]&&(console[_0x454467(0x1b6)](_0x454467(0x114)+_0x5dd587),_0xc23cb1&&console[_0x454467(0x1b6)](_0x454467(0x19a)+_0xc23cb1));if(!_0x58ba42['yes']){const _0x4a6dca=await confirmKey(_0x454467(0x24f)+_0x5dd587+'?');if(!_0x4a6dca)return console[_0x454467(0x1b6)](_0x454467(0x103)),0x0;}const _0x17655d=await withSpinner('Killing\x20attempt...',()=>_0xf3d109['workflow']['kill'](_0x5dd587,_0xc23cb1),{'verbose':_0x58ba42[_0x454467(0x215)]}),_0x564269=_0x17655d[_0x454467(0x230)];return console[_0x454467(0x1b6)]('✔\x20'+_0x564269),0x0;}}export class WorkflowRetryCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]='workflow:retry';[a39_0xf0f359(0x214)]=a39_0xf0f359(0xe5);async[a39_0xf0f359(0x246)](_0x132d1a){const _0x378efb=a39_0xf0f359,{options:_0x1109f8,args:_0x14ee5f,tdx:_0x3026a2}=_0x132d1a,_0x16e251=_0x14ee5f[0x0];if(!_0x16e251)return console['error'](_0x378efb(0x122)),console[_0x378efb(0x1b6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x5b3aea=![],_0x45df59=_0x16e251;if(_0x16e251['startsWith'](_0x378efb(0x12d)))_0x5b3aea=!![],_0x45df59=_0x16e251[_0x378efb(0x1cb)](0x8);else{if(_0x16e251[_0x378efb(0x107)](_0x378efb(0x1b9)))_0x5b3aea=![],_0x45df59=_0x16e251[_0x378efb(0x1cb)](0x8);else return console[_0x378efb(0x1b6)](_0x378efb(0x12a)),console[_0x378efb(0x1b6)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0xe82b5c=_0x1109f8[_0x378efb(0x1ff)],_0x18dde9=_0x1109f8[_0x378efb(0x27a)],_0x7eef50=_0x1109f8['params'],_0x410525=_0x1109f8[_0x378efb(0x27c)];_0x1109f8[_0x378efb(0x215)]&&(console[_0x378efb(0x1b6)](_0x378efb(0x119)+(_0x5b3aea?_0x378efb(0x23c):_0x378efb(0x170))+'\x20'+_0x45df59),_0xe82b5c&&console[_0x378efb(0x1b6)](_0x378efb(0x234)+_0xe82b5c),_0x18dde9&&console['error'](_0x378efb(0x1a7)+_0x18dde9),_0x7eef50&&console[_0x378efb(0x1b6)](_0x378efb(0x125)+_0x7eef50),_0x410525&&console['error'](_0x378efb(0x22c)));let _0x130192;if(_0x7eef50)try{if(_0x7eef50[_0x378efb(0x107)]('@')){const _0x82dc5=await import(_0x378efb(0x132)),_0x17e5a5=_0x7eef50[_0x378efb(0x1cb)](0x1),_0x3fbeec=await _0x82dc5[_0x378efb(0x24e)](_0x17e5a5,'utf-8');_0x130192=JSON[_0x378efb(0x238)](_0x3fbeec);}else _0x130192=JSON['parse'](_0x7eef50);}catch{return console[_0x378efb(0x1b6)](_0x378efb(0x281)),0x1;}if(!_0x1109f8[_0x378efb(0x1e9)]){const _0x5d47ea=await confirmKey(_0x378efb(0x104)+(_0x5b3aea?_0x378efb(0x23c):_0x378efb(0x170))+'\x20'+_0x45df59+'?');if(!_0x5d47ea)return console[_0x378efb(0x1b6)]('Cancelled'),0x0;}let _0x446406;_0x5b3aea?_0x446406=await withSpinner(_0x378efb(0x1b8),()=>_0x3026a2[_0x378efb(0x262)][_0x378efb(0x197)](_0x45df59,{'fromTask':_0xe82b5c,'retryParams':_0x130192}),{'verbose':_0x1109f8[_0x378efb(0x215)]}):_0x446406=await withSpinner(_0x378efb(0x25a),()=>_0x3026a2[_0x378efb(0x262)][_0x378efb(0x289)](_0x45df59,{'resumeFrom':_0x18dde9,'retryParams':_0x130192,'force':_0x410525}),{'verbose':_0x1109f8['verbose']});const _0x343ead=_0x446406[_0x378efb(0x230)];return console[_0x378efb(0x1b6)]('✔\x20Retry\x20started'),console['error']('\x20\x20New\x20attempt\x20ID:\x20'+_0x343ead[_0x378efb(0x24b)]),console[_0x378efb(0x1b6)](_0x378efb(0x138)+_0x343ead[_0x378efb(0x176)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{['name']=a39_0xf0f359(0x265);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x162);async[a39_0xf0f359(0x246)](_0x3970a8){const _0x12eca6=a39_0xf0f359,{options:_0x2ac1ff,args:_0x3765fa,tdx:_0x11afda}=_0x3970a8;let _0x304ece=_0x3765fa[0x0];if(!_0x304ece){const _0xfc478c=this[_0x12eca6(0x17b)]([],_0x2ac1ff),_0x3c2abe=await withSpinner('Loading\x20workflows...',()=>_0x11afda['workflow'][_0x12eca6(0x127)](_0xfc478c,{'limit':_0x2ac1ff[_0x12eca6(0x27f)]}),{'verbose':_0x2ac1ff['verbose']}),_0x441fae=_0x3c2abe[_0x12eca6(0x230)];if(_0x441fae[_0x12eca6(0x288)]===0x0)return console[_0x12eca6(0x1b6)]('No\x20workflows\x20found'),!_0xfc478c&&console['error'](a39_0x37d687[_0x12eca6(0x145)](_0x12eca6(0x209))),0x1;const _0x21c372=_0x441fae[_0x12eca6(0x27d)](_0x55da42=>({'title':_0x55da42[_0x12eca6(0x164)]?.[_0x12eca6(0x1c0)]+'.'+_0x55da42[_0x12eca6(0x1c0)],'value':_0x55da42[_0x12eca6(0x164)]?.['name']+'.'+_0x55da42[_0x12eca6(0x1c0)],'description':_0x55da42[_0x12eca6(0x20a)]?_0x12eca6(0x149)+_0x55da42[_0x12eca6(0x20a)]:undefined})),_0xaef4d0=await a39_0xe7a3e1({'type':_0x12eca6(0x16b),'name':'workflow','message':_0x12eca6(0x10d),'choices':_0x21c372});if(!_0xaef4d0[_0x12eca6(0x262)])return 0x1;_0x304ece=_0xaef4d0[_0x12eca6(0x262)];}if(!_0x304ece[_0x12eca6(0x276)]('.')){const _0x31e045=this['resolveProject']([],_0x2ac1ff);if(_0x31e045)_0x304ece=_0x31e045+'.'+_0x304ece;else return console[_0x12eca6(0x1b6)](a39_0x37d687[_0x12eca6(0x224)]('Error:'),_0x12eca6(0x253)),console['error'](a39_0x37d687['dim'](_0x12eca6(0x209))),0x1;}const _0x107bf8=_0x2ac1ff[_0x12eca6(0x1ba)],_0x1d1add=_0x2ac1ff['sessionTime'],_0xb55e6d={};if(_0x107bf8&&Array[_0x12eca6(0x22b)](_0x107bf8))for(const _0x518c6d of _0x107bf8){const _0x24a9ec=_0x518c6d['indexOf']('=');if(_0x24a9ec===-0x1)return console[_0x12eca6(0x1b6)](_0x12eca6(0x1a6)+_0x518c6d),console['error'](_0x12eca6(0x24d)),0x1;const _0x5431d9=_0x518c6d[_0x12eca6(0x1cb)](0x0,_0x24a9ec),_0x22456e=_0x518c6d[_0x12eca6(0x1cb)](_0x24a9ec+0x1);try{_0xb55e6d[_0x5431d9]=JSON[_0x12eca6(0x238)](_0x22456e);}catch{_0xb55e6d[_0x5431d9]=_0x22456e;}}_0x2ac1ff['verbose']&&(console[_0x12eca6(0x1b6)]('Workflow:\x20'+_0x304ece),Object['keys'](_0xb55e6d)[_0x12eca6(0x288)]>0x0&&console[_0x12eca6(0x1b6)]('Parameters:\x20'+JSON[_0x12eca6(0x21f)](_0xb55e6d)),_0x1d1add&&console[_0x12eca6(0x1b6)](_0x12eca6(0x1ad)+_0x1d1add));const _0x5e9991=await withSpinner('Starting\x20workflow\x20run...',()=>_0x11afda[_0x12eca6(0x262)][_0x12eca6(0x121)](_0x304ece,_0xb55e6d,{'sessionTime':_0x1d1add}),{'verbose':_0x2ac1ff['verbose']}),_0x905d6e=_0x5e9991[_0x12eca6(0x230)];console[_0x12eca6(0x1b6)](_0x12eca6(0x1a3)),console[_0x12eca6(0x1b6)](_0x12eca6(0x169)+_0x905d6e['id']),console[_0x12eca6(0x1b6)](_0x12eca6(0x138)+_0x905d6e[_0x12eca6(0x176)]),console['error'](_0x12eca6(0x115)+_0x905d6e[_0x12eca6(0x164)]?.[_0x12eca6(0x1c0)]),console['error'](_0x12eca6(0x1de)+_0x905d6e[_0x12eca6(0x262)]?.[_0x12eca6(0x1c0)]);if(_0x905d6e[_0x12eca6(0x164)]?.['id']&&_0x905d6e['sessionId']&&_0x905d6e['id']){const _0xc29920=_0x2ac1ff['site'],_0xf149af=getConsoleUrl(_0xc29920,'/app/workflows/'+_0x905d6e[_0x12eca6(0x164)]['id']+_0x12eca6(0x1f8)+_0x905d6e[_0x12eca6(0x176)]+'/attempt/'+_0x905d6e['id']);console[_0x12eca6(0x1b6)]('\x20\x20Console:\x20'+a39_0x37d687[_0x12eca6(0x235)](_0xf149af));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0xe9);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x13f);async[a39_0xf0f359(0x246)](_0x323b73){const _0x10a5d9=a39_0xf0f359,{options:_0x10195c,args:_0x782f61,tdx:_0x400b92}=_0x323b73,_0x152ac4=_0x782f61[0x0],_0x244602=_0x782f61[0x1]||'.';if(!_0x152ac4)return console[_0x10a5d9(0x1b6)](_0x10a5d9(0x159)),console[_0x10a5d9(0x1b6)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0x464006=_0x10195c[_0x10a5d9(0x20a)];_0x10195c['verbose']&&(console[_0x10a5d9(0x1b6)]('Project:\x20'+_0x152ac4),console[_0x10a5d9(0x1b6)](_0x10a5d9(0x1d2)+_0x244602),_0x464006&&console[_0x10a5d9(0x1b6)](_0x10a5d9(0x1da)+_0x464006));const _0x352473=await withSpinner(_0x10a5d9(0x195)+_0x152ac4+_0x10a5d9(0x236),()=>_0x400b92[_0x10a5d9(0x262)][_0x10a5d9(0x245)](_0x152ac4,_0x244602,{'revision':_0x464006}),{'verbose':_0x10195c[_0x10a5d9(0x215)]}),_0x20d928=_0x352473[_0x10a5d9(0x230)];return console[_0x10a5d9(0x1b6)](_0x10a5d9(0x284)+_0x20d928['projectName']),console['error'](_0x10a5d9(0x204)+_0x20d928[_0x10a5d9(0x20a)]),console[_0x10a5d9(0x1b6)]('\x20\x20Files\x20extracted:\x20'+_0x20d928[_0x10a5d9(0x123)]),console[_0x10a5d9(0x1b6)](_0x10a5d9(0x11b)+_0x244602+'/'+_0x20d928['projectName']),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x175);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x102);async['execute'](_0x5294de){const _0x56570d=a39_0xf0f359,{options:_0x28c77f,args:_0x72318a,tdx:_0x39b069}=_0x5294de;let _0x560b85='.',_0x46d745=_0x28c77f[_0x56570d(0x1c0)];if(_0x72318a[0x0]){const {promises:_0x112f20}=await import('fs');try{const _0x374c8d=await _0x112f20[_0x56570d(0x20e)](_0x72318a[0x0]);if(_0x374c8d[_0x56570d(0x1fe)]())_0x560b85=_0x72318a[0x0];else return console[_0x56570d(0x1b6)](_0x56570d(0x1f9)+_0x72318a[0x0]+'\x20is\x20not\x20a\x20directory'),0x1;}catch{_0x46d745=_0x72318a[0x0],_0x560b85='.';}}const _0x1e73ca=_0x28c77f[_0x56570d(0x20a)],_0x2fa0c1=_0x28c77f[_0x56570d(0x22a)];_0x28c77f['verbose']&&(console[_0x56570d(0x1b6)](_0x56570d(0x1b5)+_0x560b85),_0x46d745&&console[_0x56570d(0x1b6)](_0x56570d(0x1f2)+_0x46d745),_0x1e73ca&&console['error'](_0x56570d(0x1da)+_0x1e73ca),_0x2fa0c1&&console[_0x56570d(0x1b6)](_0x56570d(0x27b)));const _0x5a0c7b=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x39b069[_0x56570d(0x262)][_0x56570d(0x1ca)](_0x560b85,{'projectName':_0x46d745,'revision':_0x1e73ca,'skipValidation':_0x2fa0c1}),{'verbose':_0x28c77f[_0x56570d(0x215)]}),_0x58fcaf=_0x5a0c7b['data'];return console['error'](_0x56570d(0x213)+_0x58fcaf[_0x56570d(0x18f)]),console[_0x56570d(0x1b6)](_0x56570d(0x15a)+_0x58fcaf[_0x56570d(0x1be)]),console[_0x56570d(0x1b6)](_0x56570d(0x204)+_0x58fcaf[_0x56570d(0x20a)]),await this[_0x56570d(0x219)](_0x39b069,_0x58fcaf[_0x56570d(0x18f)],_0x28c77f[_0x56570d(0x233)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]='workflow:pull';['description']=a39_0xf0f359(0xf5);async[a39_0xf0f359(0x246)](_0x960e27){const _0xb92b10=a39_0xf0f359,{options:_0xf372d2,args:_0x526c1f,tdx:_0x40da89}=_0x960e27,_0x369240=_0x526c1f[0x0],_0x410b3a=_0x526c1f[0x1];if(!_0x369240)return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x224)]('Error:'),'Project\x20name\x20is\x20required'),console['error'](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x237))),0x1;const _0x5353ee=_0xf372d2['revision'];_0xf372d2[_0xb92b10(0x215)]&&(console[_0xb92b10(0x1b6)](_0xb92b10(0x228)+_0x369240),_0x410b3a&&console[_0xb92b10(0x1b6)]('Target\x20directory:\x20'+_0x410b3a),_0x5353ee&&console[_0xb92b10(0x1b6)]('Revision:\x20'+_0x5353ee),_0xf372d2['dryRun']&&console['error'](_0xb92b10(0x1c2)));const _0x2ac775=await withSpinner(_0xb92b10(0x14a)+_0x369240+_0xb92b10(0x236),()=>_0x40da89['workflow'][_0xb92b10(0x1ed)](_0x369240,{'targetDir':_0x410b3a,'revision':_0x5353ee}),{'verbose':_0xf372d2[_0xb92b10(0x215)]}),_0x2a6258=_0x2ac775['data'];_0x2a6258[_0xb92b10(0x1c9)]?console[_0xb92b10(0x1b6)](_0xb92b10(0x282)+_0x2a6258[_0xb92b10(0x18f)]):console['error'](_0xb92b10(0x17f)+_0x2a6258[_0xb92b10(0x18f)]);console[_0xb92b10(0x1b6)](_0xb92b10(0x204)+_0x2a6258[_0xb92b10(0x20a)]),console['error'](_0xb92b10(0x1e1)+(a39_0x2e3d89[_0xb92b10(0x124)](process[_0xb92b10(0x26f)](),_0x2a6258['targetDir'])||'.')),console[_0xb92b10(0x1b6)](_0xb92b10(0x130)+a39_0x37d687['green']('+'+_0x2a6258[_0xb92b10(0x141)][_0xb92b10(0x140)]+'\x20new')+',\x20'+(a39_0x37d687[_0xb92b10(0x1fd)]('~'+_0x2a6258[_0xb92b10(0x141)]['modified']+_0xb92b10(0x185))+',\x20')+(a39_0x37d687[_0xb92b10(0x224)]('-'+_0x2a6258['summary']['deleted']+_0xb92b10(0x200))+',\x20')+(''+a39_0x37d687['dim'](_0x2a6258[_0xb92b10(0x141)][_0xb92b10(0x223)]+_0xb92b10(0x1c5))));for(const _0x12c20b of _0x2a6258[_0xb92b10(0x251)]){_0x12c20b[_0xb92b10(0x12c)]===_0xb92b10(0x14b)&&_0x12c20b[_0xb92b10(0x1ab)]&&(console[_0xb92b10(0x1b6)]('\x0a'+a39_0x37d687['cyan'](_0xb92b10(0x126)+_0x12c20b[_0xb92b10(0x1e6)])),console[_0xb92b10(0x1b6)](_0x12c20b[_0xb92b10(0x1ab)]));}if(!_0x2a6258['hasChanges'])return saveSessionContext({'workflow_project':_0x2a6258['projectName']},_0xf372d2[_0xb92b10(0x23c)]),console[_0xb92b10(0x1b6)](a39_0x37d687['green'](_0xb92b10(0xf4))),console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x1af)+_0x2a6258[_0xb92b10(0x18f)])),0x0;if(_0xf372d2[_0xb92b10(0x21c)])return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x1fd)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0xf372d2['yes']){const _0x5d70f5=await confirmKey(_0xb92b10(0x11f));if(!_0x5d70f5)return console[_0xb92b10(0x1b6)]('Cancelled'),0x0;}await withSpinner('Writing\x20files...',()=>_0x40da89['workflow'][_0xb92b10(0x17d)](_0x2a6258,{'revision':_0x5353ee}),{'verbose':_0xf372d2[_0xb92b10(0x215)]}),saveSessionContext({'workflow_project':_0x2a6258[_0xb92b10(0x18f)]},_0xf372d2[_0xb92b10(0x23c)]),console['error'](a39_0x37d687[_0xb92b10(0x10b)](_0xb92b10(0x16e)));const _0xe567cc=a39_0x2e3d89[_0xb92b10(0x124)](process[_0xb92b10(0x26f)](),_0x2a6258[_0xb92b10(0x1e2)])||'.';return console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)]('\x20\x20Location:\x20'+_0xe567cc)),console[_0xb92b10(0x1b6)](a39_0x37d687[_0xb92b10(0x145)](_0xb92b10(0x1af)+_0x2a6258[_0xb92b10(0x18f)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x1bd);[a39_0xf0f359(0x214)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async['execute'](_0xd92ded){const _0x35a805=a39_0xf0f359,{options:_0x5ace8e,args:_0x369339,tdx:_0x54e655}=_0xd92ded,_0x55f7e6=this[_0x35a805(0x14f)](_0x369339,_0x5ace8e),_0x3f5155=_0x5ace8e[_0x35a805(0x20a)],_0x57ae02=_0x5ace8e[_0x35a805(0x22a)];_0x5ace8e[_0x35a805(0x215)]&&(_0x55f7e6&&console[_0x35a805(0x1b6)](_0x35a805(0x21b)+_0x55f7e6),_0x3f5155&&console['error'](_0x35a805(0x1da)+_0x3f5155),_0x5ace8e['dryRun']&&console[_0x35a805(0x1b6)](_0x35a805(0x1c2)),_0x57ae02&&console[_0x35a805(0x1b6)]('Validation:\x20skipped'));let _0x457d9b;try{_0x457d9b=await withSpinner('Analyzing\x20changes...',()=>_0x54e655[_0x35a805(0x262)][_0x35a805(0x1f6)]({'sourceDir':_0x55f7e6,'revision':_0x3f5155,'skipValidation':_0x57ae02}),{'verbose':_0x5ace8e['verbose']});}catch(_0x24035b){if(_0x24035b instanceof Error&&_0x24035b[_0x35a805(0xfc)][_0x35a805(0x276)](_0x35a805(0x278)))return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x224)](_0x35a805(0x264)),_0x35a805(0x116)),_0x5ace8e[_0x35a805(0x287)]?console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x145)](_0x35a805(0x206)+_0x5ace8e['workflowProject']+_0x35a805(0x25c)+_0x5ace8e[_0x35a805(0x287)]+'\x27')):console[_0x35a805(0x1b6)](a39_0x37d687['dim'](_0x35a805(0x187))),0x1;throw _0x24035b;}const _0xffa95f=_0x457d9b['data'];console['error'](_0x35a805(0x17f)+_0xffa95f['projectName']),console['error'](_0x35a805(0x26b)+_0xffa95f['sourceDir']),console[_0x35a805(0x1b6)]('\x20\x20Revision:\x20'+_0xffa95f['revision']),console[_0x35a805(0x1b6)](_0x35a805(0x130)+a39_0x37d687['green']('+'+_0xffa95f[_0x35a805(0x141)]['new']+_0x35a805(0x277))+',\x20'+(a39_0x37d687[_0x35a805(0x1fd)]('~'+_0xffa95f[_0x35a805(0x141)][_0x35a805(0x14b)]+'\x20modified')+',\x20')+(a39_0x37d687[_0x35a805(0x224)]('-'+_0xffa95f[_0x35a805(0x141)][_0x35a805(0x14c)]+_0x35a805(0x200))+',\x20')+(''+a39_0x37d687[_0x35a805(0x145)](_0xffa95f[_0x35a805(0x141)][_0x35a805(0x223)]+_0x35a805(0x1c5))));for(const _0x3caa56 of _0xffa95f[_0x35a805(0x251)]){_0x3caa56[_0x35a805(0x12c)]===_0x35a805(0x14b)&&_0x3caa56[_0x35a805(0x1ab)]&&(console[_0x35a805(0x1b6)]('\x0a'+a39_0x37d687[_0x35a805(0x235)]('---\x20'+_0x3caa56['path'])),console[_0x35a805(0x1b6)](_0x3caa56[_0x35a805(0x1ab)]));}if(!_0xffa95f['hasChanges'])return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x10b)](_0x35a805(0x269))),await this[_0x35a805(0x219)](_0x54e655,_0xffa95f['projectName'],_0x5ace8e['site']),0x0;if(_0x5ace8e[_0x35a805(0x21c)])return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x1fd)](_0x35a805(0x1b2))),0x0;if(!_0x5ace8e['yes']){const _0x3f51ac=await confirmKey(_0x35a805(0x1e0));if(!_0x3f51ac)return console[_0x35a805(0x1b6)](_0x35a805(0x103)),0x0;}const _0x310ada=await withSpinner('Pushing\x20project...',()=>_0x54e655[_0x35a805(0x262)][_0x35a805(0xf1)](_0xffa95f),{'verbose':_0x5ace8e[_0x35a805(0x215)]}),_0x607ade=_0x310ada[_0x35a805(0x230)];return console[_0x35a805(0x1b6)](a39_0x37d687[_0x35a805(0x10b)](_0x35a805(0x180))),console[_0x35a805(0x1b6)](_0x35a805(0x15a)+_0x607ade[_0x35a805(0x1be)]),console[_0x35a805(0x1b6)]('\x20\x20Revision:\x20'+_0x607ade[_0x35a805(0x20a)]),await this['showWorkflowConsoleUrl'](_0x54e655,_0x607ade[_0x35a805(0x18f)],_0x5ace8e[_0x35a805(0x233)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x261);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x1d8);async[a39_0xf0f359(0x246)](_0x20c351){const _0x2f94e8=a39_0xf0f359,{options:_0x431f4c,args:_0x477b9e,tdx:_0x32e7c2}=_0x20c351,_0x553391=this[_0x2f94e8(0x14f)](_0x477b9e,_0x431f4c),_0xc05b29=_0x431f4c[_0x2f94e8(0x1c0)],_0x8a0497=_0x431f4c[_0x2f94e8(0x20a)],_0x1165b8=_0x431f4c[_0x2f94e8(0x22a)];if(!_0x553391)return console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x224)](_0x2f94e8(0x264)),_0x2f94e8(0x23a)),console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x10c))),console['error'](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x12f))),0x1;if(!_0xc05b29)return console['error'](a39_0x37d687[_0x2f94e8(0x224)](_0x2f94e8(0x264)),_0x2f94e8(0x10e)),console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x145)](_0x2f94e8(0x10c))),0x1;_0x431f4c[_0x2f94e8(0x215)]&&(console[_0x2f94e8(0x1b6)](_0x2f94e8(0x21b)+_0x553391),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x27e)+_0xc05b29),_0x8a0497&&console[_0x2f94e8(0x1b6)]('Revision:\x20'+_0x8a0497),_0x431f4c[_0x2f94e8(0x21c)]&&console['error']('Dry\x20run:\x20yes'),_0x1165b8&&console[_0x2f94e8(0x1b6)]('Validation:\x20skipped'));const _0x4d0549=await withSpinner(_0x2f94e8(0x20f),()=>_0x32e7c2[_0x2f94e8(0x262)][_0x2f94e8(0x137)](_0x553391,_0xc05b29,{'revision':_0x8a0497,'skipValidation':_0x1165b8}),{'verbose':_0x431f4c['verbose']}),_0x2000fd=_0x4d0549['data'];console[_0x2f94e8(0x1b6)](_0x2f94e8(0x21d)+_0x2000fd['sourceDir']);_0x2000fd[_0x2f94e8(0x117)]&&console[_0x2f94e8(0x1b6)]('Source\x20project:\x20'+_0x2000fd[_0x2f94e8(0x117)]);console['error'](_0x2f94e8(0x27e)+_0x2000fd['newProjectName']),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x1da)+_0x2000fd[_0x2f94e8(0x20a)]),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x173)+_0x2000fd[_0x2f94e8(0x133)]);_0x2000fd[_0x2f94e8(0xe2)]&&(console[_0x2f94e8(0x1b6)](a39_0x37d687['yellow'](_0x2f94e8(0x208)+_0x2000fd[_0x2f94e8(0x1ac)]+_0x2f94e8(0x143)+_0x2000fd[_0x2f94e8(0x1b7)]+')')),console['error'](a39_0x37d687[_0x2f94e8(0x1fd)](_0x2f94e8(0x191))));if(_0x431f4c[_0x2f94e8(0x21c)])return console['error'](a39_0x37d687[_0x2f94e8(0x1fd)](_0x2f94e8(0xf3))),0x0;if(!_0x431f4c['yes']){const _0x286f48=_0x2000fd[_0x2f94e8(0x117)]||a39_0x2e3d89[_0x2f94e8(0x227)](_0x553391),_0x1d2f2a=_0x2000fd['targetExists']?_0x2f94e8(0x257)+_0xc05b29+'\x22\x20with\x20new\x20revision?':_0x2f94e8(0x171)+_0x286f48+_0x2f94e8(0x271)+_0xc05b29+'\x22?',_0x4848a5=await confirmKey(_0x1d2f2a);if(!_0x4848a5)return console[_0x2f94e8(0x1b6)](_0x2f94e8(0x103)),0x0;}const _0x53ee9a=await withSpinner(_0x2000fd[_0x2f94e8(0xe2)]?_0x2f94e8(0x1ea)+_0xc05b29+_0x2f94e8(0x236):_0x2f94e8(0x12b)+_0xc05b29+_0x2f94e8(0x236),()=>_0x32e7c2[_0x2f94e8(0x262)]['executeCloneProject'](_0x2000fd),{'verbose':_0x431f4c[_0x2f94e8(0x215)]}),_0x4be0b1=_0x53ee9a['data'];return console[_0x2f94e8(0x1b6)](a39_0x37d687[_0x2f94e8(0x10b)](_0x2000fd[_0x2f94e8(0xe2)]?'✔\x20Project\x20updated':_0x2f94e8(0x1d5))),console['error'](_0x2f94e8(0x115)+_0x4be0b1['newProjectName']),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x15a)+_0x4be0b1[_0x2f94e8(0xe7)]),console[_0x2f94e8(0x1b6)](_0x2f94e8(0x204)+_0x4be0b1[_0x2f94e8(0x20a)]),await this[_0x2f94e8(0x219)](_0x32e7c2,_0x4be0b1[_0x2f94e8(0x1ac)],_0x431f4c[_0x2f94e8(0x233)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x231);['description']=a39_0xf0f359(0x205);async[a39_0xf0f359(0x246)](_0x570e5c){const _0x32552e=a39_0xf0f359,{options:_0x4249ee,args:_0x105301,tdx:_0x2c69f1}=_0x570e5c,_0x8fb2b6=_0x105301[0x0];if(!_0x8fb2b6)return console['error'](_0x32552e(0x1a1)),console[_0x32552e(0x1b6)](_0x32552e(0x16d)),0x1;_0x4249ee[_0x32552e(0x215)]&&console['error'](_0x32552e(0x228)+_0x8fb2b6);if(!_0x4249ee[_0x32552e(0x1e9)]){const _0x416931=await confirmKey(_0x32552e(0x18c)+_0x8fb2b6+_0x32552e(0x22d));if(!_0x416931)return console[_0x32552e(0x1b6)]('Cancelled'),0x0;}const _0xeb77d4=await withSpinner(_0x32552e(0x135)+_0x8fb2b6+_0x32552e(0x236),()=>_0x2c69f1[_0x32552e(0x262)][_0x32552e(0x270)](_0x8fb2b6),{'verbose':_0x4249ee[_0x32552e(0x215)]}),_0x553a35=_0xeb77d4[_0x32552e(0x230)];return console[_0x32552e(0x1b6)](_0x32552e(0x10f)+_0x553a35['projectName']),console['error'](_0x32552e(0x15a)+_0x553a35[_0x32552e(0x1be)]),0x0;}}export function parseKeyValue(_0x201315){const _0xf9c1e5=a39_0xf0f359,_0x39d183=_0x201315[_0xf9c1e5(0x17e)]('=');if(_0x39d183===-0x1)throw new Error('Invalid\x20format:\x20'+_0x201315+_0xf9c1e5(0x155));const _0x384af4=_0x201315[_0xf9c1e5(0x1cb)](0x0,_0x39d183),_0x508b21=_0x201315['substring'](_0x39d183+0x1);if(!_0x384af4)throw new Error('Key\x20cannot\x20be\x20empty');return{'key':_0x384af4,'value':_0x508b21};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x272);[a39_0xf0f359(0x214)]='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a39_0xf0f359(0x246)](_0x536c9e){const _0x4d73f3=a39_0xf0f359,{options:_0x1de6c7,args:_0xe9a774,tdx:_0x1efbec}=_0x536c9e,_0x5cc13c=this[_0x4d73f3(0x286)](_0xe9a774,_0x1de6c7);if(!_0x5cc13c)return 0x1;_0x1de6c7['verbose']&&console['error'](_0x4d73f3(0x228)+_0x5cc13c);const _0x58bc78=await withSpinner('Listing\x20secrets...',()=>_0x1efbec['workflow']['listSecrets'](_0x5cc13c),{'verbose':_0x1de6c7['verbose']}),{secrets:_0x1b1119}=_0x58bc78[_0x4d73f3(0x230)];return console[_0x4d73f3(0x1b6)](_0x4d73f3(0x202)+_0x1b1119[_0x4d73f3(0x288)]+'\x20secret'+(_0x1b1119['length']!==0x1?'s':'')),await handleSDKOutput(_0x1b1119,_0x1de6c7),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]='workflow:secrets:set';[a39_0xf0f359(0x214)]='Set\x20a\x20secret\x20for\x20a\x20workflow\x20project';async[a39_0xf0f359(0x246)](_0xf4364d){const _0x16b8a8=a39_0xf0f359,{options:_0x38ca3d,args:_0x516459,tdx:_0x2b2f02}=_0xf4364d;let _0xe276af,_0x1f07f7;if(_0x516459[_0x16b8a8(0x288)]>=0x2)_0xe276af=_0x516459[0x0],_0x1f07f7=_0x516459[0x1];else{if(_0x516459[_0x16b8a8(0x288)]===0x1&&_0x38ca3d[_0x16b8a8(0x287)])_0xe276af=_0x38ca3d[_0x16b8a8(0x287)],_0x1f07f7=_0x516459[0x0];else return _0x516459[_0x16b8a8(0x288)]===0x1?(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x159)),console[_0x16b8a8(0x1b6)](_0x16b8a8(0x209)),0x1):(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x268)),console[_0x16b8a8(0x1b6)](_0x16b8a8(0x13e)),0x1);}let _0x223cd2,_0x294d87;try{({key:_0x223cd2,value:_0x294d87}=parseKeyValue(_0x1f07f7));}catch(_0x6e6e7b){return _0x6e6e7b instanceof Error&&console[_0x16b8a8(0x1b6)](a39_0x37d687[_0x16b8a8(0x224)](_0x16b8a8(0x264)),_0x6e6e7b[_0x16b8a8(0xfc)]),0x1;}_0x38ca3d[_0x16b8a8(0x215)]&&(console[_0x16b8a8(0x1b6)](_0x16b8a8(0x228)+_0xe276af),console['error'](_0x16b8a8(0x128)+_0x223cd2));const _0x11dfc6=await withSpinner('Setting\x20secret...',()=>_0x2b2f02[_0x16b8a8(0x262)]['setSecret'](_0xe276af,_0x223cd2,_0x294d87),{'verbose':_0x38ca3d['verbose']}),_0x247203=_0x11dfc6[_0x16b8a8(0x230)];return console[_0x16b8a8(0x1b6)](_0x16b8a8(0x1b1)+_0x247203['key']+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x247203[_0x16b8a8(0x18f)]+'\x27'),(_0x38ca3d[_0x16b8a8(0x158)]||_0x38ca3d[_0x16b8a8(0x129)])&&await handleSingleObjectOutput(_0x247203,_0x38ca3d),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x199);[a39_0xf0f359(0x214)]=a39_0xf0f359(0x190);async[a39_0xf0f359(0x246)](_0x27baf1){const _0x22ecd1=a39_0xf0f359,{options:_0x1a05fb,args:_0x367329,tdx:_0x7683e3}=_0x27baf1;let _0x340967,_0x14c165;if(_0x367329[_0x22ecd1(0x288)]>=0x2)_0x340967=_0x367329[0x0],_0x14c165=_0x367329[0x1];else{if(_0x367329['length']===0x1&&_0x1a05fb[_0x22ecd1(0x287)])_0x340967=_0x1a05fb[_0x22ecd1(0x287)],_0x14c165=_0x367329[0x0];else return _0x367329[_0x22ecd1(0x288)]===0x1?(console[_0x22ecd1(0x1b6)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x22ecd1(0x209)),0x1):(console[_0x22ecd1(0x1b6)](_0x22ecd1(0x101)),console[_0x22ecd1(0x1b6)](_0x22ecd1(0x167)),0x1);}_0x1a05fb[_0x22ecd1(0x215)]&&(console[_0x22ecd1(0x1b6)]('Project:\x20'+_0x340967),console[_0x22ecd1(0x1b6)]('Key:\x20'+_0x14c165));if(!_0x1a05fb['yes']){const _0x1301dc=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27'+_0x14c165+'\x27\x20from\x20project\x20\x27'+_0x340967+'\x27?');if(!_0x1301dc)return console['error'](_0x22ecd1(0x103)),0x0;}const _0xb63bd9=await withSpinner(_0x22ecd1(0x178),()=>_0x7683e3[_0x22ecd1(0x262)][_0x22ecd1(0x11e)](_0x340967,_0x14c165),{'verbose':_0x1a05fb[_0x22ecd1(0x215)]}),_0x2cebe9=_0xb63bd9[_0x22ecd1(0x230)];return console['error']('✔\x20Secret\x20\x27'+_0x2cebe9[_0x22ecd1(0x1bb)]+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x2cebe9[_0x22ecd1(0x18f)]+'\x27'),(_0x1a05fb[_0x22ecd1(0x158)]||_0x1a05fb[_0x22ecd1(0x129)])&&await handleSingleObjectOutput(_0x2cebe9,_0x1a05fb),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(_0x3a648f){const _0x1c7e0f=a39_0xf0f359,_0x12abd1=Math['floor'](_0x3a648f/0x3e8),_0x3f0393=Math[_0x1c7e0f(0x184)](_0x12abd1/0x3c),_0x45d617=Math[_0x1c7e0f(0x184)](_0x3f0393/0x3c),_0x2117bf=Math[_0x1c7e0f(0x184)](_0x45d617/0x18);if(_0x2117bf>0x0){const _0x56576e=_0x45d617%0x18;return _0x56576e>0x0?_0x2117bf+'d\x20'+_0x56576e+'h':_0x2117bf+'d';}else{if(_0x45d617>0x0){const _0x4c3779=_0x3f0393%0x3c;return _0x4c3779>0x0?_0x45d617+'h\x20'+_0x4c3779+'m':_0x45d617+'h';}else{if(_0x3f0393>0x0){const _0x14d790=_0x12abd1%0x3c;return _0x14d790>0x0?_0x3f0393+'m\x20'+_0x14d790+'s':_0x3f0393+'m';}else return _0x12abd1+'s';}}}function formatTimestamp(_0x1e64e4,_0x1dbed2){const _0x50679f=a39_0xf0f359,_0x1213a5=new Date(_0x1e64e4),_0x436a33=String(_0x1213a5[_0x50679f(0x1d0)]())[_0x50679f(0x280)](0x2,'0'),_0xbd19df=String(_0x1213a5['getMinutes']())['padStart'](0x2,'0'),_0x357361=_0x436a33+':'+_0xbd19df,_0x2072c5=_0x1213a5[_0x50679f(0x131)]()===_0x1dbed2[_0x50679f(0x131)]()&&_0x1213a5[_0x50679f(0x120)]()===_0x1dbed2[_0x50679f(0x120)]()&&_0x1213a5[_0x50679f(0x110)]()===_0x1dbed2['getDate']();if(_0x2072c5)return _0x357361;else{const _0x5a3924=String(_0x1213a5[_0x50679f(0x120)]()+0x1)[_0x50679f(0x280)](0x2,'0'),_0x28c378=String(_0x1213a5[_0x50679f(0x110)]())[_0x50679f(0x280)](0x2,'0');return _0x5a3924+'-'+_0x28c378+'\x20'+_0x357361;}}function formatDate(_0x4907f8){const _0x3ae2a3=a39_0xf0f359,_0x122b45=_0x4907f8[_0x3ae2a3(0x131)](),_0x18ab37=String(_0x4907f8[_0x3ae2a3(0x120)]()+0x1)[_0x3ae2a3(0x280)](0x2,'0'),_0x23f733=String(_0x4907f8[_0x3ae2a3(0x110)]())[_0x3ae2a3(0x280)](0x2,'0');return _0x122b45+'-'+_0x18ab37+'-'+_0x23f733;}function getTaskStateIcon(_0x19c2af){const _0x5487b5={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x5487b5[_0x19c2af]||'⚪';}function getBarChar(_0xe3a1ae){const _0x1fffa1=a39_0xf0f359;return _0xe3a1ae==='error'||_0xe3a1ae===_0x1fffa1(0x11a)?'×':'─';}function getBarColor(_0x75f7b6){const _0x44578b=a39_0xf0f359,_0x3315fe={'success':a39_0x37d687['green'],'error':a39_0x37d687['red'],'group_error':a39_0x37d687[_0x44578b(0x224)],'running':a39_0x37d687[_0x44578b(0x1e4)],'blocked':a39_0x37d687[_0x44578b(0x1fd)],'planned':a39_0x37d687[_0x44578b(0x145)],'canceling':a39_0x37d687['yellow']};return _0x3315fe[_0x75f7b6]||a39_0x37d687[_0x44578b(0x285)];}function parseTaskName(_0x15ec74){const _0x33441b=a39_0xf0f359;let _0x46b15e=_0x15ec74[_0x33441b(0x160)](/^\++/,'');const _0x578a32=_0x46b15e['split']('+'),_0x57d3d6=_0x578a32[_0x33441b(0x288)]>0x1?_0x578a32[_0x33441b(0x288)]-0x2:0x0,_0x93639e=_0x578a32[_0x578a32['length']-0x1]||_0x46b15e;return{'level':_0x57d3d6,'name':'+'+_0x93639e};}function truncateTaskName(_0x1f3629,_0x271878){const _0x125464=a39_0xf0f359,_0x266bfc=stringWidth(_0x1f3629);if(_0x266bfc<=_0x271878)return _0x1f3629;let _0x4ae129=_0x1f3629;while(stringWidth(_0x4ae129+'…')>_0x271878&&_0x4ae129[_0x125464(0x288)]>0x0){_0x4ae129=_0x4ae129[_0x125464(0x1f1)](0x0,-0x1);}return _0x4ae129+'…';}function calculateTimeScale(_0x3d883a,_0x12b105){const _0x346070=a39_0xf0f359;return{'startTime':_0x3d883a[_0x346070(0x221)],'endTime':_0x3d883a['end'],'durationMs':_0x3d883a[_0x346070(0x1e5)],'msPerChar':_0x3d883a['duration']/_0x12b105};}function timeToPosition(_0x595a8c,_0x49710f,_0x7b7a66){const _0x275d82=a39_0xf0f359,_0x5d0989=_0x595a8c-_0x49710f[_0x275d82(0x16c)],_0x2bb539=Math['floor'](_0x5d0989/_0x49710f[_0x275d82(0x1f4)]);return Math[_0x275d82(0x105)](0x0,Math[_0x275d82(0x259)](_0x2bb539,_0x7b7a66));}function renderTimeAxis(_0x331e4c,_0x4c0e80){const _0x1680d9=a39_0xf0f359,_0x46ff34=Math[_0x1680d9(0x259)](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math['max'](TIMELINE_CONFIG[_0x1680d9(0x142)],Math['floor'](_0x4c0e80/TIMELINE_CONFIG[_0x1680d9(0x23b)]))),_0x5f3549=_0x331e4c[_0x1680d9(0x218)]/(_0x46ff34-0x1),_0x1e2b96=new Date(_0x331e4c[_0x1680d9(0x16c)]),_0x516fd=[];for(let _0x40e075=0x0;_0x40e075<_0x46ff34;_0x40e075++){const _0x1a7d2d=_0x331e4c['startTime']+_0x40e075*_0x5f3549,_0xc4b956=timeToPosition(_0x1a7d2d,_0x331e4c,_0x4c0e80),_0x6184fc=formatTimestamp(_0x1a7d2d,_0x1e2b96);_0x516fd['push']({'pos':_0xc4b956,'text':_0x6184fc});}const _0x524760=new Array(_0x4c0e80)[_0x1680d9(0x1b0)]('\x20');let _0x39a50a=-0x1;for(const {pos:_0x513028,text:_0x368d22}of _0x516fd){let _0x2c1579=Math['max'](0x0,_0x513028-Math[_0x1680d9(0x184)](_0x368d22['length']/0x2));_0x2c1579<=_0x39a50a+TIMELINE_CONFIG['LABEL_MIN_SPACING']&&(_0x2c1579=_0x39a50a+TIMELINE_CONFIG[_0x1680d9(0x186)]+0x1);_0x2c1579+_0x368d22[_0x1680d9(0x288)]>_0x4c0e80&&(_0x2c1579=_0x4c0e80-_0x368d22[_0x1680d9(0x288)]);if(_0x2c1579>=0x0&&_0x2c1579+_0x368d22[_0x1680d9(0x288)]<=_0x4c0e80&&_0x2c1579>_0x39a50a){for(let _0x2b451f=0x0;_0x2b451f<_0x368d22[_0x1680d9(0x288)];_0x2b451f++){_0x524760[_0x2c1579+_0x2b451f]=_0x368d22[_0x2b451f];}_0x39a50a=_0x2c1579+_0x368d22[_0x1680d9(0x288)]-0x1;}}return _0x524760[_0x1680d9(0xe8)]('');}function renderTaskRow(_0x376379,_0x225967,_0xe9f4b1,_0x5a63d6){const _0x20f9ff=a39_0xf0f359,{level:_0x57a8c4,name:_0x1091ce}=parseTaskName(_0x376379[_0x20f9ff(0x1c0)]),_0x4e6a38='\x20'['repeat'](_0x57a8c4),_0x1b5403=_0x376379[_0x20f9ff(0x1ee)]?'('+formatElapsed(_0x376379[_0x20f9ff(0x1ee)][_0x20f9ff(0x1e5)])+')':'',_0x478623=stringWidth(_0x1b5403),_0x2566f5=_0x57a8c4*0x1,_0x945971=_0x5a63d6-_0x2566f5-_0x478623-0x1,_0x4c199c=truncateTaskName(_0x1091ce,_0x945971),_0x26f7aa=_0x4e6a38+_0x4c199c,_0x4f6a88=stringWidth(_0x26f7aa),_0x305496=_0x5a63d6-_0x4f6a88-_0x478623,_0x1d952f=_0x26f7aa+'\x20'[_0x20f9ff(0x226)](Math['max'](0x1,_0x305496))+a39_0x37d687['dim'](_0x1b5403),_0x20ef95=getTaskStateIcon(_0x376379[_0x20f9ff(0x1a5)]),_0x32862c=new Array(_0xe9f4b1)[_0x20f9ff(0x1b0)]('\x20');if(_0x376379['window']){const _0x4b30ac=timeToPosition(_0x376379[_0x20f9ff(0x1ee)]['start'],_0x225967,_0xe9f4b1),_0x3ddcee=timeToPosition(_0x376379[_0x20f9ff(0x1ee)][_0x20f9ff(0x25b)],_0x225967,_0xe9f4b1),_0x132b75=getBarChar(_0x376379[_0x20f9ff(0x1a5)]),_0x4311db=Math[_0x20f9ff(0x105)](_0x4b30ac+0x1,_0x3ddcee);for(let _0x1babe9=_0x4b30ac;_0x1babe9<Math[_0x20f9ff(0x259)](_0x4311db,_0xe9f4b1);_0x1babe9++){_0x32862c[_0x1babe9]=_0x132b75;}}const _0x341590=getBarColor(_0x376379['state']),_0x40636c=_0x32862c[_0x20f9ff(0x27d)](_0x3dd9e1=>_0x3dd9e1==='\x20'?'\x20':_0x341590(_0x3dd9e1))['join']('');return _0x20ef95+'\x20'+_0x1d952f+'│'+_0x40636c+'│';}function calculateStats(_0x31ab49){const _0xd32afc=a39_0xf0f359,_0x38b382={'total':_0x31ab49[_0xd32afc(0x288)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x17dd61 of _0x31ab49){if(_0x17dd61[_0xd32afc(0x1a5)]===_0xd32afc(0x153))_0x38b382[_0xd32afc(0x153)]++;else{if(_0x17dd61['state']===_0xd32afc(0x1b6)||_0x17dd61[_0xd32afc(0x1a5)]==='group_error')_0x38b382[_0xd32afc(0x1b6)]++;else _0x17dd61[_0xd32afc(0x1a5)]===_0xd32afc(0x1d3)?_0x38b382[_0xd32afc(0x1d3)]++:_0x38b382['pending']++;}}return _0x38b382;}function formatStats(_0x37a73d){const _0x52f549=a39_0xf0f359;return[_0x52f549(0x23f)+_0x37a73d[_0x52f549(0x134)],'✅\x20'+_0x37a73d[_0x52f549(0x153)],'❌\x20'+_0x37a73d[_0x52f549(0x1b6)],_0x52f549(0x20d)+_0x37a73d[_0x52f549(0x1d3)],'⏳\x20'+_0x37a73d[_0x52f549(0x16f)]][_0x52f549(0xe8)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a39_0xf0f359(0x1c0)]=a39_0xf0f359(0x210);['description']=a39_0xf0f359(0x222);async[a39_0xf0f359(0x246)](_0xb8fc60){const _0x148c16=a39_0xf0f359,{options:_0x39c69e,args:_0x2f9a6c,tdx:_0x39de4e}=_0xb8fc60;let _0x4af9f1,_0x40b410,_0x46115b=![];if(_0x2f9a6c[0x0]){if(_0x2f9a6c[0x0][_0x148c16(0x276)]('.')){const _0xad437=this[_0x148c16(0x241)](_0x2f9a6c,_0x39c69e);if(!_0xad437)return 0x1;_0x4af9f1=_0xad437['projectName'],_0x40b410=_0xad437[_0x148c16(0x1ce)];}else{_0x40b410=_0x2f9a6c[0x0],_0x4af9f1=_0x39c69e[_0x148c16(0x287)];if(!_0x4af9f1)return console[_0x148c16(0x1b6)](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),_0x148c16(0x1c3)),0x1;_0x46115b=!![];}}else{const _0x1fab33=this[_0x148c16(0x241)](_0x2f9a6c,_0x39c69e);if(!_0x1fab33)return 0x1;_0x4af9f1=_0x1fab33[_0x148c16(0x18f)],_0x40b410=_0x1fab33[_0x148c16(0x1ce)];}if(_0x39c69e[_0x148c16(0x215)]){if(_0x4af9f1&&_0x40b410)console[_0x148c16(0x1b6)](_0x148c16(0x1c8)+_0x4af9f1+'.'+_0x40b410);else _0x4af9f1&&console[_0x148c16(0x1b6)](_0x148c16(0x1ec)+_0x4af9f1);}const _0xf3e16f=_0x39c69e['attemptId'],_0x43bb18=_0x39c69e[_0x148c16(0x176)];if(_0xf3e16f){_0x43bb18&&console[_0x148c16(0x1b6)](a39_0x37d687['yellow'](_0x148c16(0x196)),_0x148c16(0x147));const _0x56a68d=_0x39c69e[_0x148c16(0x229)];return _0x56a68d?await this[_0x148c16(0xfb)](_0xb8fc60,_0xf3e16f):await this[_0x148c16(0x239)](_0xb8fc60,_0xf3e16f,_0x39c69e),0x0;}if(_0x43bb18){const _0x1265d5=await withSpinner(_0x148c16(0x250),()=>_0x39de4e[_0x148c16(0x262)][_0x148c16(0x146)]({'projectName':_0x4af9f1,'workflowName':_0x40b410,'limit':0x64}),{'verbose':_0x39c69e[_0x148c16(0x215)]}),_0x2f639f=_0x1265d5[_0x148c16(0x230)][_0x148c16(0x156)](_0x100566=>_0x100566['id']===_0x43bb18);if(!_0x2f639f)return console['error'](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),'Session\x20not\x20found:\x20'+_0x43bb18),0x1;if(!_0x2f639f[_0x148c16(0x1e7)]?.['id'])return console['error'](a39_0x37d687[_0x148c16(0x224)](_0x148c16(0x264)),_0x148c16(0xf8)+_0x43bb18+_0x148c16(0x136)),0x1;const _0x32e2d8=_0x2f639f[_0x148c16(0x1e7)]['id'];_0x39c69e['verbose']&&console[_0x148c16(0x1b6)]('Using\x20attempt\x20'+_0x32e2d8+_0x148c16(0x15b)+_0x43bb18);const _0x361e96=_0x39c69e[_0x148c16(0x229)];return _0x361e96?await this[_0x148c16(0xfb)](_0xb8fc60,_0x32e2d8):await this['renderSingleTimeline'](_0xb8fc60,_0x32e2d8,_0x39c69e),0x0;}const _0x3856d5=await withSpinner('Loading\x20sessions...',()=>_0x39de4e['workflow'][_0x148c16(0x146)]({'projectName':_0x4af9f1,'workflowName':_0x40b410,'limit':_0x39c69e[_0x148c16(0x27f)]||0x32}),{'verbose':_0x39c69e['verbose']}),_0x533a6a=_0x3856d5[_0x148c16(0x230)];if(_0x533a6a[_0x148c16(0x288)]===0x0){if(_0x4af9f1&&_0x40b410)console[_0x148c16(0x1b6)](_0x148c16(0xfd)+_0x4af9f1+'.'+_0x40b410);else _0x4af9f1?console[_0x148c16(0x1b6)](_0x148c16(0x26e)+_0x4af9f1):(console[_0x148c16(0x1b6)](_0x148c16(0x244)),console[_0x148c16(0x1b6)](a39_0x37d687[_0x148c16(0x145)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x533a6a[_0x148c16(0x148)]((_0x29d7a0,_0x4e1021)=>{const _0x2806c9=_0x148c16,_0x25cc22=_0x29d7a0[_0x2806c9(0x22e)]||'',_0x18a7ed=_0x4e1021[_0x2806c9(0x22e)]||'';return _0x18a7ed[_0x2806c9(0x1c6)](_0x25cc22);});if(_0x39c69e[_0x148c16(0x158)]||_0x39c69e[_0x148c16(0x129)])return await handleSDKOutput(_0x533a6a,_0x39c69e),0x0;let _0x3f0563;if(_0x46115b){const _0x3a9da7=_0x533a6a[0x0];if(!_0x3a9da7[_0x148c16(0x1e7)]?.['id'])return console[_0x148c16(0x1b6)](_0x148c16(0x18a)),0x0;_0x3f0563=_0x3a9da7[_0x148c16(0x1e7)]['id'],_0x39c69e['verbose']&&console[_0x148c16(0x1b6)](_0x148c16(0x19b)+_0x3a9da7[_0x148c16(0x22e)]);}else{const _0x3bdbe9=_0x533a6a[_0x148c16(0x27d)](_0x4cf47d=>{const _0x5a0976=_0x148c16,_0x1acf31=getAttemptStatusDisplay(_0x4cf47d[_0x5a0976(0x1e7)]);return{'title':_0x4cf47d[_0x5a0976(0x164)]?.[_0x5a0976(0x1c0)]+'.'+_0x4cf47d[_0x5a0976(0x262)]?.[_0x5a0976(0x1c0)]+_0x5a0976(0x24c)+_0x4cf47d[_0x5a0976(0x22e)]+'\x20'+_0x1acf31[_0x5a0976(0xef)],'value':_0x4cf47d[_0x5a0976(0x1e7)]?.['id']||'','description':_0x1acf31[_0x5a0976(0x17a)]};}),_0x48b7f2=await a39_0xe7a3e1({'type':_0x148c16(0x16b),'name':_0x148c16(0x24b),'message':_0x148c16(0x11d),'choices':_0x3bdbe9[_0x148c16(0x1d4)](_0x1a88b7=>_0x1a88b7[_0x148c16(0xee)]!=='')});if(!_0x48b7f2[_0x148c16(0x24b)])return 0x0;_0x3f0563=_0x48b7f2[_0x148c16(0x24b)];}const _0x576767=_0x39c69e['follow'];return _0x576767?await this[_0x148c16(0xfb)](_0xb8fc60,_0x3f0563):await this[_0x148c16(0x239)](_0xb8fc60,_0x3f0563,_0x39c69e),0x0;}async[a39_0xf0f359(0x239)](_0x219b4b,_0x3c675f,_0x51fd8a){const _0x3f65b8=a39_0xf0f359,{tdx:_0x576bf5}=_0x219b4b;let _0x26f5d2,_0xf84ab0;try{[_0x26f5d2,_0xf84ab0]=await Promise[_0x3f65b8(0x211)]([_0x576bf5['workflow']['attempt'](_0x3c675f),_0x576bf5[_0x3f65b8(0x262)][_0x3f65b8(0x100)](_0x3c675f,![])]);}catch(_0x45c671){console[_0x3f65b8(0x1b6)](a39_0x37d687[_0x3f65b8(0x224)](_0x3f65b8(0x112)));_0x51fd8a['verbose']&&console[_0x3f65b8(0x1b6)](_0x45c671);throw _0x45c671;}if(_0x51fd8a['json']||_0x51fd8a[_0x3f65b8(0x129)]){const _0x1b0b34=this['buildTimelineData'](_0x26f5d2,_0xf84ab0);await handleSDKOutput([_0x1b0b34],_0x51fd8a);return;}const _0x34ed31=_0x576bf5[_0x3f65b8(0xe6)]['site'],_0x5df9e2=this[_0x3f65b8(0xec)](_0x26f5d2,_0xf84ab0,_0x34ed31);console[_0x3f65b8(0x1c7)](_0x5df9e2);}async[a39_0xf0f359(0xfb)](_0x34944e,_0x553d40){const _0x16474b=a39_0xf0f359,{tdx:_0x6b3253}=_0x34944e,_0xbcfadd=TIMELINE_CONFIG[_0x16474b(0xe4)],_0x382d33=TIMELINE_CONFIG[_0x16474b(0x212)];let _0x46bc2f=0x0;while(_0x46bc2f<_0x382d33){process[_0x16474b(0x165)][_0x16474b(0x273)]&&process[_0x16474b(0x165)]['write']('\x1bc');let _0x3274c1,_0x4036f2;try{[_0x3274c1,_0x4036f2]=await Promise[_0x16474b(0x211)]([_0x6b3253[_0x16474b(0x262)][_0x16474b(0x170)](_0x553d40),_0x6b3253['workflow'][_0x16474b(0x100)](_0x553d40,![])]);}catch(_0x17dd81){console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x224)](_0x16474b(0x1d7)));_0x46bc2f>0x0&&console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x145)]('Last\x20successful\x20update\x20was\x20at\x20iteration\x20'+_0x46bc2f));throw _0x17dd81;}const _0x538535=_0x6b3253[_0x16474b(0xe6)][_0x16474b(0x233)],_0x155190=this[_0x16474b(0xec)](_0x3274c1,_0x4036f2,_0x538535);console[_0x16474b(0x1c7)](_0x155190);const _0x3b0f17=_0x3274c1[_0x16474b(0x1fc)]&&_0x4036f2[_0x16474b(0xfe)](_0x4f615f=>_0x4f615f['state']!==_0x16474b(0x1d3)&&_0x4f615f[_0x16474b(0x1a5)]!==_0x16474b(0x19f));if(_0x3b0f17){console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x10b)](_0x16474b(0x1e3)));break;}console[_0x16474b(0x1b6)](a39_0x37d687[_0x16474b(0x145)](_0x16474b(0xf7)+_0x46bc2f*0x2+_0x16474b(0x19d))),await new Promise(_0x4561b5=>setTimeout(_0x4561b5,_0xbcfadd)),_0x46bc2f++;}_0x46bc2f>=_0x382d33&&console['error'](a39_0x37d687[_0x16474b(0x1fd)](_0x16474b(0x108)));}[a39_0xf0f359(0xec)](_0x50535b,_0x3117d1,_0x1237a8){const _0x359fce=a39_0xf0f359,_0x205f29=[],_0x540444=TIMELINE_CONFIG[_0x359fce(0x188)],_0x2b6778=0x5,_0xa0696=process[_0x359fce(0x165)][_0x359fce(0x249)]||0x78,_0x4846da=_0xa0696-_0x540444-_0x2b6778,_0x37273b=Math[_0x359fce(0x105)](TIMELINE_CONFIG[_0x359fce(0x22f)],Math[_0x359fce(0x259)](_0x4846da,TIMELINE_CONFIG[_0x359fce(0x194)])),_0xb1d6f0=new Date(_0x50535b['createdAt'])[_0x359fce(0xf9)](),_0x2d007c=_0x50535b[_0x359fce(0x17c)]?new Date(_0x50535b[_0x359fce(0x17c)])[_0x359fce(0xf9)]():Date['now'](),_0x44d5cb={'start':_0xb1d6f0,'end':_0x2d007c,'duration':_0x2d007c-_0xb1d6f0},_0x145563=new Map(),_0x118f58=[];for(const _0x33b083 of _0x3117d1){if(_0x33b083[_0x359fce(0xeb)]){const _0x2febdc=new Date(_0x33b083[_0x359fce(0xeb)])[_0x359fce(0xf9)](),_0x4ecacc=_0x33b083[_0x359fce(0x263)]?new Date(_0x33b083[_0x359fce(0x263)])[_0x359fce(0xf9)]():Date[_0x359fce(0x203)](),_0x353c3b={'start':_0x2febdc,'end':_0x4ecacc,'duration':_0x4ecacc-_0x2febdc};_0x145563[_0x359fce(0xf6)](_0x33b083['id'],_0x353c3b),_0x118f58['push']({'name':_0x33b083[_0x359fce(0x154)],'state':_0x33b083[_0x359fce(0x1a5)]||_0x359fce(0x182),'window':_0x353c3b});}else _0x118f58[_0x359fce(0x1ca)]({'name':_0x33b083[_0x359fce(0x154)],'state':_0x33b083[_0x359fce(0x1a5)]||_0x359fce(0x19f),'window':undefined});}_0x118f58[_0x359fce(0x148)]((_0x125770,_0x4b9807)=>{const _0x13c323=_0x359fce;if(!_0x125770[_0x13c323(0x1ee)])return 0x1;if(!_0x4b9807['window'])return-0x1;return _0x125770[_0x13c323(0x1ee)][_0x13c323(0x221)]-_0x4b9807['window']['start'];});const _0x29159c=_0x118f58[_0x359fce(0x288)],_0x20403f=_0x29159c>TIMELINE_CONFIG[_0x359fce(0x1a8)];_0x20403f&&_0x118f58[_0x359fce(0x1aa)](TIMELINE_CONFIG['MAX_TASKS_DISPLAY']);const _0x395453=calculateTimeScale(_0x44d5cb,_0x37273b),_0x55ca40=_0x50535b[_0x359fce(0x1fc)]?_0x50535b[_0x359fce(0x153)]?a39_0x37d687[_0x359fce(0x10b)](_0x359fce(0x153)):a39_0x37d687['red']('error'):a39_0x37d687[_0x359fce(0x1e4)](_0x359fce(0x1d3)),_0x51a9c3=_0x50535b[_0x359fce(0x164)]?.['id'],_0x308769=_0x50535b[_0x359fce(0x176)];let _0xf69f81;if(_0x51a9c3&&_0x308769){const _0x6806c=getWorkflowAttemptUrl(_0x1237a8,_0x51a9c3,_0x308769,_0x50535b['id']);_0xf69f81=hyperlink(a39_0x37d687[_0x359fce(0x145)](_0x50535b['id']),_0x6806c);}else _0xf69f81=a39_0x37d687[_0x359fce(0x145)](_0x50535b['id']);_0x205f29[_0x359fce(0x1ca)](_0x359fce(0x152)+_0xf69f81+_0x359fce(0x24c)+_0x55ca40+'\x20-\x20'+formatElapsed(_0x44d5cb[_0x359fce(0x1e5)]));if(_0x118f58[_0x359fce(0x288)]>0x0){const _0x108c96=renderTimeAxis(_0x395453,_0x37273b),_0x23e0ce=new Date(_0x44d5cb[_0x359fce(0x221)]),_0x4ed694=formatDate(_0x23e0ce),_0xe1a28b=TIMELINE_CONFIG[_0x359fce(0x177)]+TIMELINE_CONFIG[_0x359fce(0x183)]+_0x540444,_0x195baf=_0x4ed694[_0x359fce(0x280)](_0xe1a28b),_0x58cf7a=a39_0x37d687[_0x359fce(0x145)](_0x195baf);_0x205f29['push'](_0x58cf7a+'\x20'+_0x108c96);for(const _0x537fde of _0x118f58){_0x205f29[_0x359fce(0x1ca)](renderTaskRow(_0x537fde,_0x395453,_0x37273b,_0x540444));}const _0x4f5ba1=calculateStats(_0x118f58);_0x205f29[_0x359fce(0x1ca)](formatStats(_0x4f5ba1)),_0x20403f&&_0x205f29[_0x359fce(0x1ca)](a39_0x37d687[_0x359fce(0x1fd)]('⚠\x20Showing\x20first\x20'+TIMELINE_CONFIG[_0x359fce(0x1a8)]+_0x359fce(0x1a2)+_0x29159c+_0x359fce(0x21e))),_0x205f29['push'](''),_0x205f29[_0x359fce(0x1ca)](a39_0x37d687[_0x359fce(0x145)](_0x359fce(0x166))+('tdx\x20wf\x20attempt\x20'+_0x50535b['id']+_0x359fce(0x15d))+a39_0x37d687['dim']('\x20to\x20see\x20detailed\x20logs'));}else _0x205f29[_0x359fce(0x1ca)]('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x205f29[_0x359fce(0xe8)]('\x0a');}['buildTimelineData'](_0x1d8834,_0x4fd744){const _0x54140a=a39_0xf0f359,_0x23ecf2=new Date(_0x1d8834[_0x54140a(0x279)])[_0x54140a(0xf9)](),_0x117d5d=_0x1d8834['finishedAt']?new Date(_0x1d8834[_0x54140a(0x17c)])[_0x54140a(0xf9)]():Date[_0x54140a(0x203)](),_0x25ef52=_0x117d5d-_0x23ecf2,_0x3b5070=[];for(const _0x4e5598 of _0x4fd744){if(_0x4e5598[_0x54140a(0xeb)]){const _0x84f53f=new Date(_0x4e5598[_0x54140a(0xeb)])['getTime'](),_0x393483=_0x4e5598['updatedAt']?new Date(_0x4e5598['updatedAt'])[_0x54140a(0xf9)]():Date[_0x54140a(0x203)]();_0x3b5070[_0x54140a(0x1ca)]({'name':_0x4e5598[_0x54140a(0x154)],'state':_0x4e5598[_0x54140a(0x1a5)]||_0x54140a(0x182),'window':{'start':_0x84f53f,'end':_0x393483,'duration':_0x393483-_0x84f53f}});}else _0x3b5070[_0x54140a(0x1ca)]({'name':_0x4e5598[_0x54140a(0x154)],'state':_0x4e5598[_0x54140a(0x1a5)]||_0x54140a(0x19f),'window':undefined});}const _0x448b5b=calculateStats(_0x3b5070);return{'attempt':{'id':_0x1d8834['id'],'status':_0x1d8834[_0x54140a(0x1fc)]?_0x1d8834[_0x54140a(0x153)]?'success':_0x54140a(0x1b6):_0x54140a(0x1d3),'createdAt':_0x1d8834[_0x54140a(0x279)],'finishedAt':_0x1d8834[_0x54140a(0x17c)],'duration_ms':_0x25ef52},'tasks':_0x3b5070['map'](_0x2b1f01=>({'name':_0x2b1f01[_0x54140a(0x1c0)],'state':_0x2b1f01[_0x54140a(0x1a5)],'startedAt':_0x2b1f01[_0x54140a(0x1ee)]?new Date(_0x2b1f01[_0x54140a(0x1ee)][_0x54140a(0x221)])['toISOString']():null,'updatedAt':_0x2b1f01[_0x54140a(0x1ee)]?new Date(_0x2b1f01['window'][_0x54140a(0x25b)])[_0x54140a(0x1ae)]():null,'duration_ms':_0x2b1f01[_0x54140a(0x1ee)]?.[_0x54140a(0x1e5)]||null})),'stats':_0x448b5b};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- (function(_0x14f548,_0x478509){const _0x54fdf3=a39_0x25d3,_0xdd4025=_0x14f548();while(!![]){try{const _0x2b144a=parseInt(_0x54fdf3(0xe7))/0x1+-parseInt(_0x54fdf3(0xe9))/0x2*(parseInt(_0x54fdf3(0xf1))/0x3)+-parseInt(_0x54fdf3(0xec))/0x4*(-parseInt(_0x54fdf3(0xf4))/0x5)+-parseInt(_0x54fdf3(0xe8))/0x6*(parseInt(_0x54fdf3(0xf0))/0x7)+-parseInt(_0x54fdf3(0xed))/0x8+-parseInt(_0x54fdf3(0xf3))/0x9+parseInt(_0x54fdf3(0xef))/0xa;if(_0x2b144a===_0x478509)break;else _0xdd4025['push'](_0xdd4025['shift']());}catch(_0xcf7e0a){_0xdd4025['push'](_0xdd4025['shift']());}}}(a39_0x5417,0xcc610));import{platform}from'os';import{getAPIKey}from'./config.js';function a39_0x5417(){const _0x1ae7cb=['803277vEPAlX','6138pRMGzS','474898evsKNN','Authorization','tdx/','5764asuPtK','11258576yhVMlz','X-Trino-User','30533630mBkpfH','8470OETiWX','3WgLnNS','TD1\x20','6873642XkItUT','2175TTXNpn','replace','version','length'];a39_0x5417=function(){return _0x1ae7cb;};return a39_0x5417();}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x5988b9=a39_0x25d3,_0x3086c4=getVersion(),_0x843d29=platform(),_0x12571a=process[_0x5988b9(0xf6)][_0x5988b9(0xf5)]('v','');return _0x5988b9(0xeb)+_0x3086c4+'\x20('+_0x843d29+';\x20node/'+_0x12571a+')';}export function getAuthHeaders(_0x215d4f,_0x15001e){const _0x5d2a2a=a39_0x25d3,_0x1b73f0=getVersion(),_0x33f23a={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x1b73f0};return _0x15001e&&(_0x33f23a[_0x5d2a2a(0xea)]=_0x5d2a2a(0xf2)+_0x15001e),_0x33f23a;}export function toHeaderRecord(_0x1cc890){const _0x50e3ac={};for(const [_0x38a86d,_0x58c781]of Object['entries'](_0x1cc890)){_0x58c781!==undefined&&(_0x50e3ac[_0x38a86d]=_0x58c781);}return _0x50e3ac;}export function getTrinoHeaders(_0x3a6a52,_0x30b2fa){const _0x30fd63=a39_0x25d3,_0x4978d4=getAuthHeaders(_0x3a6a52,_0x30b2fa),_0xaaa9fc=toHeaderRecord(_0x4978d4);return delete _0xaaa9fc[_0x30fd63(0xea)],_0x30b2fa&&(_0xaaa9fc[_0x30fd63(0xee)]=_0x30b2fa),_0xaaa9fc;}function a39_0x25d3(_0x4c09e0,_0x2f4445){_0x4c09e0=_0x4c09e0-0xe7;const _0x5417cf=a39_0x5417();let _0x25d308=_0x5417cf[_0x4c09e0];return _0x25d308;}export function hasAPIKey(_0x5e8338){const _0x49d503=a39_0x25d3,_0x4d764d=getAPIKey(_0x5e8338);return _0x4d764d!==undefined&&_0x4d764d[_0x49d503(0xf7)]>0x0;}
1
+ (function(_0x3b4d08,_0x3db161){const _0x1ce750=a40_0x1b33,_0x3ab1ab=_0x3b4d08();while(!![]){try{const _0x24edb5=parseInt(_0x1ce750(0x1b9))/0x1*(parseInt(_0x1ce750(0x1b5))/0x2)+parseInt(_0x1ce750(0x1c2))/0x3*(-parseInt(_0x1ce750(0x1c1))/0x4)+-parseInt(_0x1ce750(0x1c0))/0x5+parseInt(_0x1ce750(0x1b4))/0x6+parseInt(_0x1ce750(0x1ba))/0x7*(parseInt(_0x1ce750(0x1b7))/0x8)+parseInt(_0x1ce750(0x1c3))/0x9+-parseInt(_0x1ce750(0x1bd))/0xa*(parseInt(_0x1ce750(0x1bc))/0xb);if(_0x24edb5===_0x3db161)break;else _0x3ab1ab['push'](_0x3ab1ab['shift']());}catch(_0x44e2b2){_0x3ab1ab['push'](_0x3ab1ab['shift']());}}}(a40_0x7523,0xcf5c8));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';function a40_0x7523(){const _0x425c4a=['856WCVNUc','replace','1pCgZFD','4298ugVxYZ','Authorization','7766TqBmwq','1850bnLPdD','tdx/','X-Trino-User','1886685RMHlqR','24968PoQZcT','318ZkohLK','2292039xEsHWq','754086uRWRfA','3145802gwXylH','version'];a40_0x7523=function(){return _0x425c4a;};return a40_0x7523();}export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x3bb331=a40_0x1b33,_0x112c2b=getVersion(),_0x505ed6=platform(),_0x2c8f9c=process[_0x3bb331(0x1b6)][_0x3bb331(0x1b8)]('v','');return _0x3bb331(0x1be)+_0x112c2b+'\x20('+_0x505ed6+';\x20node/'+_0x2c8f9c+')';}function a40_0x1b33(_0x5adaad,_0xf4b045){_0x5adaad=_0x5adaad-0x1b4;const _0x752350=a40_0x7523();let _0x1b33b4=_0x752350[_0x5adaad];return _0x1b33b4;}export function getAuthHeaders(_0x3d6ccd,_0x15d098){const _0x4b4f19=a40_0x1b33,_0x156753=getVersion(),_0x4e5cf6={'User-Agent':getUserAgent(),'X-TD-Client':'tdx','X-TD-Client-Version':_0x156753};return _0x15d098&&(_0x4e5cf6[_0x4b4f19(0x1bb)]='TD1\x20'+_0x15d098),_0x4e5cf6;}export function toHeaderRecord(_0x3d0e45){const _0x558ece={};for(const [_0x54f271,_0x1adcb8]of Object['entries'](_0x3d0e45)){_0x1adcb8!==undefined&&(_0x558ece[_0x54f271]=_0x1adcb8);}return _0x558ece;}export function getTrinoHeaders(_0x403699,_0x1ed264){const _0x27b7a2=a40_0x1b33,_0x18b117=getAuthHeaders(_0x403699,_0x1ed264),_0x561a92=toHeaderRecord(_0x18b117);return delete _0x561a92['Authorization'],_0x1ed264&&(_0x561a92[_0x27b7a2(0x1bf)]=_0x1ed264),_0x561a92;}export function hasAPIKey(_0x1d7b92){const _0x342823=getAPIKey(_0x1d7b92);return _0x342823!==undefined&&_0x342823['length']>0x0;}
@@ -1 +1 @@
1
- (function(_0x16fdaa,_0x46f279){const _0x3bcd3f=a40_0x7f00,_0x3c1066=_0x16fdaa();while(!![]){try{const _0x1e633b=parseInt(_0x3bcd3f(0x1c3))/0x1+parseInt(_0x3bcd3f(0x1e4))/0x2*(parseInt(_0x3bcd3f(0x1f8))/0x3)+-parseInt(_0x3bcd3f(0x1d2))/0x4+-parseInt(_0x3bcd3f(0x1bc))/0x5+-parseInt(_0x3bcd3f(0x1e9))/0x6*(-parseInt(_0x3bcd3f(0x1e7))/0x7)+parseInt(_0x3bcd3f(0x1ff))/0x8+-parseInt(_0x3bcd3f(0x1cd))/0x9;if(_0x1e633b===_0x46f279)break;else _0x3c1066['push'](_0x3c1066['shift']());}catch(_0x742913){_0x3c1066['push'](_0x3c1066['shift']());}}}(a40_0x1397,0xc54e6));import{writeFileSync}from'fs';function a40_0x7f00(_0x1f5029,_0x1a4fcd){_0x1f5029=_0x1f5029-0x1b7;const _0x139709=a40_0x1397();let _0x7f003c=_0x139709[_0x1f5029];return _0x7f003c;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a40_0x171fd6 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x4fb16d){const _0x43d5bd=a40_0x7f00;return _0x4fb16d['format']===_0x43d5bd(0x1e8)||_0x4fb16d[_0x43d5bd(0x1bd)]===_0x43d5bd(0x1b7)||_0x4fb16d[_0x43d5bd(0x1bd)]===_0x43d5bd(0x1d6)||_0x4fb16d[_0x43d5bd(0x1bd)]===_0x43d5bd(0x1f7)||_0x4fb16d['json']===!![]||_0x4fb16d[_0x43d5bd(0x1b7)]===!![]||_0x4fb16d[_0x43d5bd(0x1d6)]===!![]||_0x4fb16d[_0x43d5bd(0x1f7)]===!![];}export function parseOutputOptions(_0x3dbada){const _0x4fa160=a40_0x7f00;return{'format':_0x3dbada[_0x4fa160(0x1bd)]||_0x4fa160(0x1f7),'output':_0x3dbada[_0x4fa160(0x1de)]||'','limit':_0x3dbada['limit'],'color':_0x3dbada['color'],'noColor':_0x3dbada[_0x4fa160(0x1d3)]};}function convertSDKResultToQueryResult(_0x106cb3){const _0x5aface=a40_0x7f00,_0x1febce=[];if(_0x106cb3[_0x5aface(0x1d8)]>0x0){const _0x2f1078=_0x106cb3[0x0];for(const [_0x31a0b8,_0x59ce03]of Object['entries'](_0x2f1078)){let _0x1b2ed9=_0x5aface(0x1ca);if(typeof _0x59ce03===_0x5aface(0x1ce))_0x1b2ed9=Number[_0x5aface(0x1e3)](_0x59ce03)?_0x5aface(0x1dd):'double';else{if(typeof _0x59ce03===_0x5aface(0x1cc))_0x1b2ed9=_0x5aface(0x1cc);else _0x59ce03===null&&(_0x1b2ed9=_0x5aface(0x1ca));}_0x1febce[_0x5aface(0x1e6)]({'name':_0x31a0b8,'type':_0x1b2ed9});}}return{'queryId':'sdk-result','columns':_0x1febce,'data':_0x106cb3,'stats':{'state':_0x5aface(0x1eb),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x106cb3['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x1d843d,_0x165c2e){const _0x342e22=convertSDKResultToQueryResult(_0x1d843d);return formatQueryOutput(_0x342e22,_0x165c2e);}export async function formatQueryOutput(_0xd883b6,_0x20273e){const _0x4cbf7a=a40_0x7f00,{format:_0x493aa9,limit:_0x25b5e4,output:_0x557d1c,color:_0x1c51a5,noColor:_0x13aefb}=_0x20273e,_0x116cd9=Boolean(_0x557d1c)&&!_0x1c51a5,_0x312b10={'color':_0x1c51a5,'noColor':_0x13aefb||_0x116cd9};if(_0x493aa9===_0x4cbf7a(0x1f7)){const _0x35eea3=shouldUseLess(_0x493aa9,_0x557d1c);return formatAsTable(_0xd883b6,_0x25b5e4,_0x35eea3,_0x312b10);}else{if(_0x493aa9===_0x4cbf7a(0x1e8))return formatAsJSON(_0xd883b6,_0x312b10);else return _0x493aa9==='jsonl'?formatAsJSONL(_0xd883b6,_0x312b10):formatQueryResult(_0xd883b6,_0x493aa9);}}function a40_0x1397(){const _0x1c7669=['[query]','varchar','stderr','boolean','22207248rMwjdT','number','forEach','No\x20data','object','3526800BeUfUU','noColor','trim','cmdout','tsv','─┬─','length','log','stdin','keys','end','bigint','output','blue','red','error','color','isInteger','8mbjHYB','[Object]','push','7cfmCWf','json','9263874LoycBW','close','FINISHED','max','yellow','isTTY','map','limit','stringify','bold','pipe','repeat','Results\x20saved\x20to\x20','[rule]','table','373335gkrOHs','entries','resolve','inherit','split','join','-FXRSn','10474360rjfrJB','params','jsonl','list','query','magenta','rule','2592680XHENxK','format','string','write','─┴─','[params]','padEnd','1324820HNdxsF','[logs]','spawn','debug','less','cyan'];a40_0x1397=function(){return _0x1c7669;};return a40_0x1397();}function shouldUseLess(_0x1f413c,_0x10397a){const _0x3eae70=a40_0x7f00;return(_0x1f413c==='table'||_0x1f413c===_0x3eae70(0x1b8))&&process['stdout'][_0x3eae70(0x1ee)]&&!_0x10397a;}export function resolveOutputOptions(_0x169df7){const _0x3dfbec=a40_0x7f00,_0x3a1601=resolveOutputFormat(_0x169df7['format'],_0x169df7[_0x3dfbec(0x1de)],_0x3dfbec(0x1f7));let _0x426fa5=typeof _0x169df7[_0x3dfbec(0x1f0)]===_0x3dfbec(0x1ce)?_0x169df7[_0x3dfbec(0x1f0)]:parseInt(_0x169df7[_0x3dfbec(0x1f0)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x147603=_0x169df7['output']||'';return shouldUseLess(_0x3a1601,_0x147603)&&(_0x426fa5=Infinity),{'format':_0x3a1601,'output':_0x147603,'limit':_0x426fa5,'color':_0x169df7[_0x3dfbec(0x1e2)],'noColor':_0x169df7[_0x3dfbec(0x1d3)]};}export function writeOutput(_0x16ee49,_0x56fd0d,_0x3cf929){const _0xb82d99=a40_0x7f00;return _0x56fd0d?(writeFileSync(_0x56fd0d,_0x16ee49),console['error'](_0xb82d99(0x1f5)+_0x56fd0d),Promise[_0xb82d99(0x1fa)]()):shouldUseLess(_0x3cf929||'','')?new Promise(_0x500613=>{const _0x1b9d65=_0xb82d99,_0x168a79=spawn(_0x1b9d65(0x1c7),[_0x1b9d65(0x1fe)],{'stdio':[_0x1b9d65(0x1f3),_0x1b9d65(0x1fb),_0x1b9d65(0x1fb)]});let _0x52110e=![];_0x168a79['on']('error',()=>{const _0x442841=_0x1b9d65;!_0x52110e&&(_0x52110e=!![],console[_0x442841(0x1d9)](_0x16ee49),_0x500613());}),_0x168a79['on'](_0x1b9d65(0x1ea),()=>{!_0x52110e&&(_0x52110e=!![],_0x500613());}),_0x168a79['on'](_0x1b9d65(0x1c5),()=>{const _0x5346bc=_0x1b9d65;!_0x52110e&&_0x168a79[_0x5346bc(0x1da)]&&(_0x168a79[_0x5346bc(0x1da)]['on'](_0x5346bc(0x1e1),()=>{}),_0x168a79[_0x5346bc(0x1da)][_0x5346bc(0x1bf)](_0x16ee49),_0x168a79[_0x5346bc(0x1da)][_0x5346bc(0x1dc)]());}),!_0x168a79['stdin']&&(!_0x52110e&&(_0x52110e=!![],console[_0x1b9d65(0x1d9)](_0x16ee49),_0x500613()));}):(console[_0xb82d99(0x1d9)](_0x16ee49),Promise['resolve']());}export async function handleSDKOutput(_0x34f3f7,_0x2699db){const _0x2a0f25=a40_0x7f00,_0x24e5b2=resolveOutputOptions(_0x2699db),_0x37f52b=await formatSDKOutput(_0x34f3f7,_0x24e5b2);await writeOutput(_0x37f52b,_0x24e5b2[_0x2a0f25(0x1de)]||undefined,_0x24e5b2[_0x2a0f25(0x1bd)]);}export async function handleQueryOutput(_0x1cee6d,_0x259014){const _0x510252=a40_0x7f00,_0x524644=resolveOutputOptions(_0x259014),_0x3569fe=await formatQueryOutput(_0x1cee6d,_0x524644);await writeOutput(_0x3569fe,_0x524644[_0x510252(0x1de)]||undefined,_0x524644['format']);}async function formatSingleObject(_0x24b5b4,_0x1f2fa8){const _0x110943=a40_0x7f00,{format:_0x4247b6,color:_0x5bf6a9,noColor:_0x291c8b}=_0x1f2fa8,_0xbb89ec={'color':_0x5bf6a9,'noColor':_0x291c8b};if(_0x4247b6===_0x110943(0x1e8)){if(shouldUseColor(_0xbb89ec))return colorizeJSON(_0x24b5b4,_0xbb89ec);return JSON[_0x110943(0x1f1)](_0x24b5b4,null,0x2);}else{if(_0x4247b6==='jsonl'){if(shouldUseColor(_0xbb89ec))return colorizeJSONCompact(_0x24b5b4,_0xbb89ec);return JSON['stringify'](_0x24b5b4);}else{if(_0x4247b6===_0x110943(0x1d6))return Object[_0x110943(0x1f9)](_0x24b5b4)['map'](([_0xeb64f3,_0x17fa56])=>_0xeb64f3+'\x09'+_0x17fa56)['join']('\x0a');else{const _0x2c43ed=Object[_0x110943(0x1f9)](_0x24b5b4);if(_0x2c43ed[_0x110943(0x1d8)]===0x0)return _0x110943(0x1d0);const _0x2fd748=_0x24b5b4[_0x110943(0x1c6)],_0x9ea921=_0x24b5b4['query'],_0x31d39d=_0x24b5b4['params'],_0x1f4836=_0x24b5b4[_0x110943(0x1bb)],_0x1a28ff=_0x9ea921?typeof _0x9ea921===_0x110943(0x1be)?_0x9ea921:JSON[_0x110943(0x1f1)](_0x9ea921,null,0x2):undefined,_0x1a34e5=_0x31d39d&&Object['keys'](_0x31d39d)[_0x110943(0x1d8)]>0x0?JSON[_0x110943(0x1f1)](_0x31d39d,null,0x2):undefined,_0x2134c1=_0x1f4836&&Object[_0x110943(0x1db)](_0x1f4836)[_0x110943(0x1d8)]>0x0?JSON['stringify'](_0x1f4836,null,0x2):undefined,_0x443fcb=_0x2c43ed['filter'](([_0x15c3d4])=>_0x15c3d4!==_0x110943(0x1c6)&&_0x15c3d4!==_0x110943(0x1b9)&&_0x15c3d4!==_0x110943(0x200)&&_0x15c3d4!==_0x110943(0x1bb)),_0x3e3901=Math[_0x110943(0x1ec)](..._0x443fcb[_0x110943(0x1ef)](([_0x52da09])=>_0x52da09['length'])),_0x12e789=Math[_0x110943(0x1ec)](..._0x443fcb[_0x110943(0x1ef)](([,_0x19259d])=>{const _0x2e9835=_0x110943;try{const _0x365945=_0x19259d===null||_0x19259d===undefined?'':typeof _0x19259d===_0x2e9835(0x1d1)?JSON[_0x2e9835(0x1f1)](_0x19259d):String(_0x19259d),_0x5a3189=_0x365945[_0x2e9835(0x1fc)]('\x0a');return Math[_0x2e9835(0x1ec)](..._0x5a3189[_0x2e9835(0x1ef)](_0x3219d8=>_0x3219d8[_0x2e9835(0x1d8)]),0x0);}catch{return 0x0;}}),0x14),_0x4c1bd2=[];_0x4c1bd2[_0x110943(0x1e6)](colorBorder('┌─'+'─'[_0x110943(0x1f4)](_0x3e3901)+_0x110943(0x1d7)+'─'[_0x110943(0x1f4)](_0x12e789)+'─┐',_0xbb89ec)),_0x443fcb['forEach'](([_0x3d01e6,_0x3a871b])=>{const _0x505aab=_0x110943;let _0x36fefb;try{_0x36fefb=_0x3a871b===null||_0x3a871b===undefined?'':typeof _0x3a871b===_0x505aab(0x1d1)?JSON[_0x505aab(0x1f1)](_0x3a871b):String(_0x3a871b);}catch{_0x36fefb=_0x505aab(0x1e5);}const _0x4a180d=_0x3d01e6[_0x505aab(0x1c2)](_0x3e3901),_0x997cb1=_0x36fefb['split']('\x0a');_0x997cb1[_0x505aab(0x1cf)]((_0x20e728,_0x178bb1)=>{const _0xa04157=_0x505aab,_0x42756f=colorBorder('│',_0xbb89ec);_0x178bb1===0x0?_0x4c1bd2['push'](_0x42756f+'\x20'+_0x4a180d+'\x20'+_0x42756f+'\x20'+_0x20e728[_0xa04157(0x1c2)](_0x12e789)+'\x20'+_0x42756f):_0x4c1bd2[_0xa04157(0x1e6)](_0x42756f+'\x20'+'\x20'[_0xa04157(0x1f4)](_0x3e3901)+'\x20'+_0x42756f+'\x20'+_0x20e728[_0xa04157(0x1c2)](_0x12e789)+'\x20'+_0x42756f);});}),_0x4c1bd2[_0x110943(0x1e6)](colorBorder('└─'+'─'[_0x110943(0x1f4)](_0x3e3901)+_0x110943(0x1c0)+'─'['repeat'](_0x12e789)+'─┘',_0xbb89ec));_0x1a28ff&&(_0x4c1bd2[_0x110943(0x1e6)](''),_0x4c1bd2['push'](String(a40_0x171fd6[_0x110943(0x1ed)]['bold'](_0x110943(0x1c9)))),_0x4c1bd2[_0x110943(0x1e6)](_0x1a28ff));_0x1a34e5&&(_0x4c1bd2[_0x110943(0x1e6)](''),_0x4c1bd2[_0x110943(0x1e6)](String(a40_0x171fd6[_0x110943(0x1df)]['bold'](_0x110943(0x1c1)))),_0x4c1bd2[_0x110943(0x1e6)](_0x1a34e5));_0x2134c1&&(_0x4c1bd2[_0x110943(0x1e6)](''),_0x4c1bd2[_0x110943(0x1e6)](String(a40_0x171fd6[_0x110943(0x1ba)][_0x110943(0x1f2)](_0x110943(0x1f6)))),_0x4c1bd2[_0x110943(0x1e6)](_0x2134c1));if(_0x2fd748){if(_0x2fd748[_0x110943(0x1cb)]){_0x4c1bd2['push'](''),_0x4c1bd2['push'](String(a40_0x171fd6[_0x110943(0x1e0)][_0x110943(0x1f2)]('[error]')));const _0x77d9cd=_0x2fd748[_0x110943(0x1cb)][_0x110943(0x1fc)]('\x0a');_0x77d9cd[_0x110943(0x1cf)](_0x3f466b=>{const _0x19ead5=_0x110943;_0x3f466b[_0x19ead5(0x1d4)]()&&_0x4c1bd2[_0x19ead5(0x1e6)](_0x3f466b);});}if(_0x2fd748[_0x110943(0x1d5)]){_0x4c1bd2[_0x110943(0x1e6)](''),_0x4c1bd2[_0x110943(0x1e6)](String(a40_0x171fd6[_0x110943(0x1c8)][_0x110943(0x1f2)](_0x110943(0x1c4))));const _0xcaad36=_0x2fd748[_0x110943(0x1d5)][_0x110943(0x1fc)]('\x0a');_0xcaad36[_0x110943(0x1cf)](_0x5ec92a=>{const _0x3a2a2e=_0x110943;_0x5ec92a[_0x3a2a2e(0x1d4)]()&&_0x4c1bd2[_0x3a2a2e(0x1e6)](_0x5ec92a);});}}return _0x4c1bd2[_0x110943(0x1fd)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x58643f,_0x51a9ca){const _0x1df369=a40_0x7f00;if(_0x51a9ca[_0x1df369(0x1bd)]===_0x1df369(0x1f7)){await handleSDKOutput([_0x58643f],_0x51a9ca);return;}const _0x5b419e=resolveOutputOptions(_0x51a9ca),_0x3e20e2=await formatSingleObject(_0x58643f,_0x5b419e);await writeOutput(_0x3e20e2,_0x5b419e['output']||undefined,_0x5b419e[_0x1df369(0x1bd)]);}
1
+ (function(_0x4192f6,_0x1259b8){const _0x2bdb1c=a41_0x13fa,_0x395521=_0x4192f6();while(!![]){try{const _0x7068c2=parseInt(_0x2bdb1c(0xeb))/0x1+parseInt(_0x2bdb1c(0xec))/0x2+-parseInt(_0x2bdb1c(0xca))/0x3+-parseInt(_0x2bdb1c(0xb6))/0x4+-parseInt(_0x2bdb1c(0xcb))/0x5*(-parseInt(_0x2bdb1c(0xf6))/0x6)+parseInt(_0x2bdb1c(0xcc))/0x7*(-parseInt(_0x2bdb1c(0xc5))/0x8)+-parseInt(_0x2bdb1c(0xdd))/0x9*(parseInt(_0x2bdb1c(0xbd))/0xa);if(_0x7068c2===_0x1259b8)break;else _0x395521['push'](_0x395521['shift']());}catch(_0x247568){_0x395521['push'](_0x395521['shift']());}}}(a41_0xbd76,0xbd60b));import{writeFileSync}from'fs';function a41_0x13fa(_0x552a58,_0x8b81f){_0x552a58=_0x552a58-0xb2;const _0xbd76b8=a41_0xbd76();let _0x13fa50=_0xbd76b8[_0x552a58];return _0x13fa50;}import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a41_0x427623 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x3b7916){const _0x18b82c=a41_0x13fa;return _0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xdc)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xb5)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xf4)||_0x3b7916[_0x18b82c(0xb7)]===_0x18b82c(0xda)||_0x3b7916[_0x18b82c(0xdc)]===!![]||_0x3b7916['jsonl']===!![]||_0x3b7916['tsv']===!![]||_0x3b7916[_0x18b82c(0xda)]===!![];}export function parseOutputOptions(_0x50e2a2){const _0x514c65=a41_0x13fa;return{'format':_0x50e2a2[_0x514c65(0xb7)]||_0x514c65(0xda),'output':_0x50e2a2[_0x514c65(0xc0)]||'','limit':_0x50e2a2['limit'],'color':_0x50e2a2[_0x514c65(0xe6)],'noColor':_0x50e2a2[_0x514c65(0xc3)]};}function convertSDKResultToQueryResult(_0x56e311){const _0x20d489=a41_0x13fa,_0x1ceb7d=[];if(_0x56e311[_0x20d489(0xdb)]>0x0){const _0x352095=_0x56e311[0x0];for(const [_0x5e3f2d,_0x51789b]of Object[_0x20d489(0xc2)](_0x352095)){let _0xcc6fbb=_0x20d489(0xc9);if(typeof _0x51789b===_0x20d489(0xe3))_0xcc6fbb=Number[_0x20d489(0xd2)](_0x51789b)?'bigint':_0x20d489(0xd8);else{if(typeof _0x51789b===_0x20d489(0xf3))_0xcc6fbb=_0x20d489(0xf3);else _0x51789b===null&&(_0xcc6fbb=_0x20d489(0xc9));}_0x1ceb7d[_0x20d489(0xf5)]({'name':_0x5e3f2d,'type':_0xcc6fbb});}}return{'queryId':'sdk-result','columns':_0x1ceb7d,'data':_0x56e311,'stats':{'state':_0x20d489(0xf8),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x56e311[_0x20d489(0xdb)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x573181,_0x3198a6){const _0x25b320=convertSDKResultToQueryResult(_0x573181);return formatQueryOutput(_0x25b320,_0x3198a6);}export async function formatQueryOutput(_0x28954c,_0x4a46f9){const _0x3fc51f=a41_0x13fa,{format:_0x1b9908,limit:_0x57909c,output:_0x518fe4,color:_0x540ad7,noColor:_0x5a6897}=_0x4a46f9,_0x1b7fe3=Boolean(_0x518fe4)&&!_0x540ad7,_0x48c33c={'color':_0x540ad7,'noColor':_0x5a6897||_0x1b7fe3};if(_0x1b9908===_0x3fc51f(0xda)){const _0x58bc5d=shouldUseLess(_0x1b9908,_0x518fe4);return formatAsTable(_0x28954c,_0x57909c,_0x58bc5d,_0x48c33c);}else{if(_0x1b9908===_0x3fc51f(0xdc))return formatAsJSON(_0x28954c,_0x48c33c);else return _0x1b9908===_0x3fc51f(0xb5)?formatAsJSONL(_0x28954c,_0x48c33c):formatQueryResult(_0x28954c,_0x1b9908);}}function shouldUseLess(_0x43f84e,_0x4e56e2){const _0xa4a960=a41_0x13fa;return(_0x43f84e===_0xa4a960(0xda)||_0x43f84e===_0xa4a960(0xed))&&process[_0xa4a960(0xe2)][_0xa4a960(0xc7)]&&!_0x4e56e2;}function a41_0xbd76(){const _0x46a1c5=['342kuPdxZ','repeat','FINISHED','resolve','limit','query','jsonl','3385724gBwsyZ','format','bold','inherit','less','cmdout','blue','20aNmgch','[rule]','string','output','error','entries','noColor','trim','4594904tgxhEJ','[query]','isTTY','magenta','varchar','1730511tmsvKs','117175iORavp','14aBBKMh','split','─┬─','object','No\x20data','[logs]','isInteger','map','keys','spawn','write','─┴─','double','debug','table','length','json','2174373WexgRW','params','stdin','end','log','stdout','number','rule','forEach','color','[error]','max','pipe','Results\x20saved\x20to\x20','1303655UbnEXH','2382858RWHQuC','list','join','stderr','stringify','red','padEnd','boolean','tsv','push'];a41_0xbd76=function(){return _0x46a1c5;};return a41_0xbd76();}export function resolveOutputOptions(_0xe7e3fe){const _0x3deaed=a41_0x13fa,_0xb7cf94=resolveOutputFormat(_0xe7e3fe[_0x3deaed(0xb7)],_0xe7e3fe['output'],'table');let _0x43a937=typeof _0xe7e3fe[_0x3deaed(0xb3)]==='number'?_0xe7e3fe[_0x3deaed(0xb3)]:parseInt(_0xe7e3fe['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xfa00d2=_0xe7e3fe[_0x3deaed(0xc0)]||'';return shouldUseLess(_0xb7cf94,_0xfa00d2)&&(_0x43a937=Infinity),{'format':_0xb7cf94,'output':_0xfa00d2,'limit':_0x43a937,'color':_0xe7e3fe[_0x3deaed(0xe6)],'noColor':_0xe7e3fe[_0x3deaed(0xc3)]};}export function writeOutput(_0x5cfbeb,_0x48b7e8,_0x9895a6){const _0x371a1=a41_0x13fa;return _0x48b7e8?(writeFileSync(_0x48b7e8,_0x5cfbeb),console['error'](_0x371a1(0xea)+_0x48b7e8),Promise[_0x371a1(0xb2)]()):shouldUseLess(_0x9895a6||'','')?new Promise(_0x1ccb85=>{const _0x9412cf=_0x371a1,_0x26dddc=spawn(_0x9412cf(0xba),['-FXRSn'],{'stdio':[_0x9412cf(0xe9),_0x9412cf(0xb9),_0x9412cf(0xb9)]});let _0x4e4f80=![];_0x26dddc['on']('error',()=>{const _0x51490b=_0x9412cf;!_0x4e4f80&&(_0x4e4f80=!![],console[_0x51490b(0xe1)](_0x5cfbeb),_0x1ccb85());}),_0x26dddc['on']('close',()=>{!_0x4e4f80&&(_0x4e4f80=!![],_0x1ccb85());}),_0x26dddc['on'](_0x9412cf(0xd5),()=>{const _0x394180=_0x9412cf;!_0x4e4f80&&_0x26dddc[_0x394180(0xdf)]&&(_0x26dddc[_0x394180(0xdf)]['on'](_0x394180(0xc1),()=>{}),_0x26dddc[_0x394180(0xdf)][_0x394180(0xd6)](_0x5cfbeb),_0x26dddc[_0x394180(0xdf)][_0x394180(0xe0)]());}),!_0x26dddc[_0x9412cf(0xdf)]&&(!_0x4e4f80&&(_0x4e4f80=!![],console[_0x9412cf(0xe1)](_0x5cfbeb),_0x1ccb85()));}):(console['log'](_0x5cfbeb),Promise[_0x371a1(0xb2)]());}export async function handleSDKOutput(_0x39e949,_0x2b4fe1){const _0x187208=a41_0x13fa,_0x6796a=resolveOutputOptions(_0x2b4fe1),_0x36899a=await formatSDKOutput(_0x39e949,_0x6796a);await writeOutput(_0x36899a,_0x6796a[_0x187208(0xc0)]||undefined,_0x6796a[_0x187208(0xb7)]);}export async function handleQueryOutput(_0x6082dc,_0x24cdec){const _0x594b69=a41_0x13fa,_0x380a4e=resolveOutputOptions(_0x24cdec),_0x527c35=await formatQueryOutput(_0x6082dc,_0x380a4e);await writeOutput(_0x527c35,_0x380a4e[_0x594b69(0xc0)]||undefined,_0x380a4e[_0x594b69(0xb7)]);}async function formatSingleObject(_0x1bfa23,_0x9f1b07){const _0x1dacc1=a41_0x13fa,{format:_0x1aeb3a,color:_0x26247c,noColor:_0x56a197}=_0x9f1b07,_0x5ea563={'color':_0x26247c,'noColor':_0x56a197};if(_0x1aeb3a==='json'){if(shouldUseColor(_0x5ea563))return colorizeJSON(_0x1bfa23,_0x5ea563);return JSON[_0x1dacc1(0xf0)](_0x1bfa23,null,0x2);}else{if(_0x1aeb3a===_0x1dacc1(0xb5)){if(shouldUseColor(_0x5ea563))return colorizeJSONCompact(_0x1bfa23,_0x5ea563);return JSON[_0x1dacc1(0xf0)](_0x1bfa23);}else{if(_0x1aeb3a===_0x1dacc1(0xf4))return Object[_0x1dacc1(0xc2)](_0x1bfa23)[_0x1dacc1(0xd3)](([_0x596b44,_0x474f1c])=>_0x596b44+'\x09'+_0x474f1c)[_0x1dacc1(0xee)]('\x0a');else{const _0x5316f2=Object[_0x1dacc1(0xc2)](_0x1bfa23);if(_0x5316f2[_0x1dacc1(0xdb)]===0x0)return _0x1dacc1(0xd0);const _0x24dbb3=_0x1bfa23[_0x1dacc1(0xd9)],_0x209821=_0x1bfa23[_0x1dacc1(0xb4)],_0x475413=_0x1bfa23[_0x1dacc1(0xde)],_0x28178a=_0x1bfa23[_0x1dacc1(0xe4)],_0x34be0b=_0x209821?typeof _0x209821===_0x1dacc1(0xbf)?_0x209821:JSON[_0x1dacc1(0xf0)](_0x209821,null,0x2):undefined,_0x509fdb=_0x475413&&Object[_0x1dacc1(0xd4)](_0x475413)[_0x1dacc1(0xdb)]>0x0?JSON[_0x1dacc1(0xf0)](_0x475413,null,0x2):undefined,_0x31813a=_0x28178a&&Object[_0x1dacc1(0xd4)](_0x28178a)['length']>0x0?JSON[_0x1dacc1(0xf0)](_0x28178a,null,0x2):undefined,_0x4b2632=_0x5316f2['filter'](([_0x2ed219])=>_0x2ed219!==_0x1dacc1(0xd9)&&_0x2ed219!==_0x1dacc1(0xb4)&&_0x2ed219!==_0x1dacc1(0xde)&&_0x2ed219!==_0x1dacc1(0xe4)),_0x57ba7f=Math['max'](..._0x4b2632[_0x1dacc1(0xd3)](([_0x741cb6])=>_0x741cb6[_0x1dacc1(0xdb)])),_0x128163=Math['max'](..._0x4b2632[_0x1dacc1(0xd3)](([,_0x1803d0])=>{const _0x191745=_0x1dacc1;try{const _0x59d93e=_0x1803d0===null||_0x1803d0===undefined?'':typeof _0x1803d0===_0x191745(0xcf)?JSON[_0x191745(0xf0)](_0x1803d0):String(_0x1803d0),_0x9897b9=_0x59d93e['split']('\x0a');return Math[_0x191745(0xe8)](..._0x9897b9[_0x191745(0xd3)](_0x46fc2f=>_0x46fc2f['length']),0x0);}catch{return 0x0;}}),0x14),_0x3a1d37=[];_0x3a1d37[_0x1dacc1(0xf5)](colorBorder('┌─'+'─'[_0x1dacc1(0xf7)](_0x57ba7f)+_0x1dacc1(0xce)+'─'[_0x1dacc1(0xf7)](_0x128163)+'─┐',_0x5ea563)),_0x4b2632[_0x1dacc1(0xe5)](([_0x44b642,_0x27185e])=>{const _0xf75055=_0x1dacc1;let _0x33894d;try{_0x33894d=_0x27185e===null||_0x27185e===undefined?'':typeof _0x27185e===_0xf75055(0xcf)?JSON[_0xf75055(0xf0)](_0x27185e):String(_0x27185e);}catch{_0x33894d='[Object]';}const _0x1f2034=_0x44b642[_0xf75055(0xf2)](_0x57ba7f),_0x5a5297=_0x33894d[_0xf75055(0xcd)]('\x0a');_0x5a5297['forEach']((_0x1e42fb,_0x1d74c7)=>{const _0x5cee3e=_0xf75055,_0x4fd94a=colorBorder('│',_0x5ea563);_0x1d74c7===0x0?_0x3a1d37[_0x5cee3e(0xf5)](_0x4fd94a+'\x20'+_0x1f2034+'\x20'+_0x4fd94a+'\x20'+_0x1e42fb[_0x5cee3e(0xf2)](_0x128163)+'\x20'+_0x4fd94a):_0x3a1d37[_0x5cee3e(0xf5)](_0x4fd94a+'\x20'+'\x20'[_0x5cee3e(0xf7)](_0x57ba7f)+'\x20'+_0x4fd94a+'\x20'+_0x1e42fb[_0x5cee3e(0xf2)](_0x128163)+'\x20'+_0x4fd94a);});}),_0x3a1d37[_0x1dacc1(0xf5)](colorBorder('└─'+'─'[_0x1dacc1(0xf7)](_0x57ba7f)+_0x1dacc1(0xd7)+'─'[_0x1dacc1(0xf7)](_0x128163)+'─┘',_0x5ea563));_0x34be0b&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623['yellow'][_0x1dacc1(0xb8)](_0x1dacc1(0xc6)))),_0x3a1d37[_0x1dacc1(0xf5)](_0x34be0b));_0x509fdb&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37['push'](String(a41_0x427623[_0x1dacc1(0xbc)]['bold']('[params]'))),_0x3a1d37[_0x1dacc1(0xf5)](_0x509fdb));_0x31813a&&(_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623[_0x1dacc1(0xc8)]['bold'](_0x1dacc1(0xbe)))),_0x3a1d37[_0x1dacc1(0xf5)](_0x31813a));if(_0x24dbb3){if(_0x24dbb3[_0x1dacc1(0xef)]){_0x3a1d37[_0x1dacc1(0xf5)](''),_0x3a1d37['push'](String(a41_0x427623[_0x1dacc1(0xf1)][_0x1dacc1(0xb8)](_0x1dacc1(0xe7))));const _0x4b374a=_0x24dbb3[_0x1dacc1(0xef)][_0x1dacc1(0xcd)]('\x0a');_0x4b374a[_0x1dacc1(0xe5)](_0x58b79b=>{const _0x2c1235=_0x1dacc1;_0x58b79b[_0x2c1235(0xc4)]()&&_0x3a1d37[_0x2c1235(0xf5)](_0x58b79b);});}if(_0x24dbb3[_0x1dacc1(0xbb)]){_0x3a1d37['push'](''),_0x3a1d37[_0x1dacc1(0xf5)](String(a41_0x427623['cyan']['bold'](_0x1dacc1(0xd1))));const _0x30fffc=_0x24dbb3[_0x1dacc1(0xbb)]['split']('\x0a');_0x30fffc[_0x1dacc1(0xe5)](_0x5a1e9d=>{const _0x2c4838=_0x1dacc1;_0x5a1e9d[_0x2c4838(0xc4)]()&&_0x3a1d37[_0x2c4838(0xf5)](_0x5a1e9d);});}}return _0x3a1d37[_0x1dacc1(0xee)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x220f35,_0x1e8961){const _0x4e7ef8=a41_0x13fa;if(_0x1e8961['format']===_0x4e7ef8(0xda)){await handleSDKOutput([_0x220f35],_0x1e8961);return;}const _0x2c836f=resolveOutputOptions(_0x1e8961),_0x224dc4=await formatSingleObject(_0x220f35,_0x2c836f);await writeOutput(_0x224dc4,_0x2c836f[_0x4e7ef8(0xc0)]||undefined,_0x2c836f[_0x4e7ef8(0xb7)]);}