@treasuredata/tdx 0.23.1 → 0.24.0

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 (164) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/process.js.map +1 -1
  157. package/dist/utils/prompt.js +1 -1
  158. package/dist/utils/spinner.js +1 -1
  159. package/dist/utils/sse-parser.js +1 -1
  160. package/dist/utils/string-utils.js +1 -1
  161. package/dist/utils/table-ref-parser.js +1 -1
  162. package/dist/utils/tdx-logger.js +1 -1
  163. package/dist/utils/version-check.js +1 -1
  164. package/package.json +1 -1
@@ -1 +1 @@
1
- const a42_0x548fe7=a42_0x3632;(function(_0x220811,_0xf56ec6){const _0xb87c72=a42_0x3632,_0xd0e709=_0x220811();while(!![]){try{const _0xeb8ff8=parseInt(_0xb87c72(0x304))/0x1+-parseInt(_0xb87c72(0x205))/0x2*(parseInt(_0xb87c72(0x353))/0x3)+-parseInt(_0xb87c72(0x226))/0x4*(parseInt(_0xb87c72(0x21f))/0x5)+parseInt(_0xb87c72(0x37d))/0x6+-parseInt(_0xb87c72(0x2a8))/0x7+parseInt(_0xb87c72(0x2be))/0x8*(-parseInt(_0xb87c72(0x2f0))/0x9)+parseInt(_0xb87c72(0x2b3))/0xa;if(_0xeb8ff8===_0xf56ec6)break;else _0xd0e709['push'](_0xd0e709['shift']());}catch(_0x1ad299){_0xd0e709['push'](_0xd0e709['shift']());}}}(a42_0x46c0,0x291cf));import a42_0x5737de from'chalk';import{existsSync}from'fs';import a42_0x32a3eb from'path';import{BaseCommand}from'./command.js';function a42_0x46c0(){const _0x3a4e79=['No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Reason:\x20','running','Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>','workflow:kill','generateSessionTimelineRows','Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data','Parameters:\x20','localeCompare','\x20attempt','projects','Project\x20name\x20is\x20required','Using\x20attempt\x20','\x20\x20Session\x20context\x20set\x20to:\x20','isTTY','limit','---\x20','planned','getDate','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','startedAt','createdAt','getFullYear','\x20tasks','sessionTime','resumeFrom','relative','\x0aPolling...\x20(','toLowerCase','499142RAylvk','now','message','tasks','List\x20workflow\x20execution\x20sessions','\x0a⚠\x20Project\x20\x22','Project:\x20','MAX_POLL_ITERATIONS','jsonl','Error:\x20Secret\x20key\x20is\x20required','\x20has\x20no\x20attempts','5653880LNcEaN','list','durationMs','No\x20sessions\x20found','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','reason','Attempt:\x20','Source\x20directory:\x20','prepareCloneProject','Error:\x20Invalid\x20JSON\x20in\x20--params','→\x20Project:\x20','136QFqEgW','projectId','substring','applyPullProject','sort','blue','unchanged','run','\x20(use\x20--limit\x20to\x20show\x20more)','listSecrets','📁\x20','window','workflow:tasks','Getting\x20attempt\x20details...','ICON_SPACING','Source\x20project:\x20','Usage:\x20workflow:delete\x20<project-name-or-id>','Pull\x20workflow\x20project\x20to\x20local\x20folder','Show\x20tasks\x20for\x20an\x20attempt','Error:\x20Invalid\x20parameter\x20format:\x20','dim','indexOf','Killing\x20attempt...','No\x20sessions\x20found\x20in\x20project:\x20','from','getMonth','Session\x20not\x20found:\x20','\x0aError:','description','fileSize','Invalid\x20format:\x20','Key:\x20','msPerChar','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','buildTimelineData','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','red','Output\x20directory:\x20','No\x20workflow\x20sessions\x20found','renderSingleTimeline','rows','Error:\x20Attempt\x20ID\x20is\x20required','List\x20all\x20workflow\x20projects','size','workflowProject','Error:\x20','revision','metadata','✔\x20Project\x20updated','Warning:','146871hrjLdX','kill','\x1b[1A\x1b[2K','newProjectId','/attempt/','No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)','Include\x20retried:\x20yes','logFiles','✔\x20Found\x20','padStart','workflow:use','write','Listing\x20secrets...','Auto-selected\x20latest\x20session:\x20','duration','Downloading\x20logs...','workflow:workflows','summary','session','workflow:secrets:delete','267821eVjKPO','yes','site','\x20(system)','filesExtracted','⚠\x20Showing\x20first\x20','✔\x20Retry\x20started','renderTimeline','resolveProjectDir','Force:\x20yes','\x0a✔\x20Attempt\x20complete','text','Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20','No\x20attempts\x20found','No\x20workflow\x20projects\x20found','name','yellow','autocomplete','workflows','min','Resume\x20from:\x20','Files\x20to\x20upload:\x20','updatedAt','Failed\x20to\x20fetch\x20attempt\x20data','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','\x20\x20Revision:\x20','isNewProject','.\x20Expected\x20format:\x20KEY=VALUE','\x27\x20from\x20project\x20\x27','setSecret','has','MIN_LABEL_COUNT','\x0aDry\x20run\x20-\x20nothing\x20pushed','set','Error:\x20Project\x20name\x20is\x20required','✔\x20Push\x20complete','\x20\x20tdx\x20wf\x20use\x20<project>','\x20\x20New\x20attempt\x20ID:\x20','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','No\x20workflows\x20found','startTime','\x22\x20already\x20exists\x20(ID:\x20','✔\x20Secret\x20\x27','-\x20nothing\x20pushed','getMinutes','workflow:timeline','MAX_TASKS_DISPLAY','error','cyan','pullProject','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20','modified','retryAttempt','title','deleteSecret','find','skipValidation','\x20deleted','group_error','\x20workflow','path','preparePushProject','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22','success','Fetching\x20log\x20files...','navigateSessionsInteractive','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20Project:\x20','changes','\x20unchanged','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','✔\x20Showing\x20','✔\x20Workflow\x20project\x20context\x20cleared.','fullName','attempt','end','workflow','\x22?\x20This\x20cannot\x20be\x20undone.','\x22\x20to\x20new\x20project\x20\x22','111MbBaAM','\x20to\x20see\x20detailed\x20logs','(use\x20--limit\x20to\x20see\x20more)','session_id','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','Cloning\x20to\x20','parseProjectWorkflowPattern','sourceProjectName','pollTimeline','Tip:\x20cd\x20to\x20workflows/','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','start','executeCloneProject','Source\x20directory\x20is\x20required','workflow:attempt','green','New\x20project\x20name:\x20','tdx.json','(unknown)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','unknown','renderSessionsTimeline','every','total','type','-\x20no\x20files\x20written','max','List\x20workflows','POLL_INTERVAL_MS','\x20logs','finishedAt','executePushProject','log','dryRun','\x0a✔\x20No\x20changes\x20to\x20push','params','replace','readFile','\x20\x20Workflow:\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Project\x20ID:\x20','Target:\x20','51036opjSsk','Attempt\x20ID:\x20','\x20-\x20','value','workflow:download','push','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','filter','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','Task\x20name:\x20','\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','Select\x20a\x20workflow\x20to\x20run','List\x20workflow\x20attempts','includeRetried','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','Select\x20a\x20task\x20to\x20view\x20logs:','requireProject','Listing\x20workflow\x20projects...','No\x20matching\x20sessions\x20found','resolve','sessions','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','map','deleted','task','targetDir','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','match','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','/sessions/','Latest\x20session\x20has\x20no\x20attempt','Filter:\x20project=','From\x20task:\x20','targetExists','Source:\x20','\x20\x20Location:\x20','follow','toISOString','Resolving\x20project\x20\x27','splice','stdout','fileCount','workflow:clone','✔\x20Clone\x20complete','pending','basename','Retrying\x20session...','✔\x20Workflow\x20run\x20started','Retrying\x20attempt...','stringify','cwd','✔\x20Pushed\x20','\x20task','No\x20log\x20files\x20found\x20for\x20this\x20attempt','10038krHTzl','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','...','newProjectName','Total:\x20','ICON_WIDTH','\x20\x20Console:\x20','round','cancelRequested','workflow:retry','\x20new','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','Analyzing\x20changes...','No\x20projects\x20match\x20pattern:\x20','resolveProjectId','length','No\x20sessions\x20found\x20for:\x20','\x20session','keys','Including\x20subtasks:\x20yes','\x20\x20Source:\x20','verbose','Deleting\x20project\x20','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','→\x20New\x20project:\x20','\x20is\x20not\x20a\x20directory','694420wcKTiS','startsWith','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','Session\x20','output','\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.','project','4xSAFum','force','Validation:\x20skipped','trimEnd','tdx\x20wf\x20attempt\x20','slice','white','MIN_TIMELINE_WIDTH','\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20','key','json','No\x20attempts\x20found\x20in\x20project:\x20','TASK_NAME_WIDTH','Params:\x20','canceling','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','clear','Dry\x20run:\x20yes','🔄\x20','Show\x20specific\x20attempt\x20details','lastAttempt','taskName','hasChanges','workflow:projects','sys','Key\x20cannot\x20be\x20empty','isArray','✔\x20Deleted\x20project\x20','Deleting\x20secret...','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','session:','showWorkflowConsoleUrl','Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)','parse','\x20\x20Session\x20ID:\x20','trim','Start\x20a\x20workflow\x20run','GUTTER','format','join','getTime','table','done','\x20secret','data','Session\x20time:\x20','\x20\x20Changes:\x20','Filter:\x20','\x0aPush\x20these\x20changes?','Status:\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','includes','attempts','✔\x20Pull\x20complete','get','utf-8','MAX_LABEL_COUNT','retrySession','Updating\x20','\x20sessions\x20','execute','Error:\x20KEY=VALUE\x20is\x20required','Cancelled','repeat','split','Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name','workflow:secrets:set','attemptId','\x0aUpdate\x20existing\x20project\x20\x22','download','Getting\x20attempt\x20tasks...','No\x20workflows\x20found\x20in\x20project:\x20','fill','projectName','resolveProject','Revision:\x20','diff','floor','Project\x20name:\x20','Project\x20filter:\x20','Loading\x20workflows...','workflowName','getHours','sourceDir','Setting\x20secret...','\x20modified','delete','Error:','\x20\x20Attempt\x20ID:\x20','fs/promises','sessionId','state','✔\x20Workflow\x20project\x20set\x20to:\x20','💡\x20Tip:\x20Use\x20','LABEL_MIN_SPACING','select','index','displayLine','\x20\x20Target:\x20','new','\x0aFailed\x20to\x20fetch\x20attempt\x20data'];a42_0x46c0=function(){return _0x3a4e79;};return a42_0x46c0();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x2a4a52 from'prompts';function getAttemptStatusDisplay(_0x31fbc3){const _0x4e4037=a42_0x3632;if(!_0x31fbc3)return{'icon':'⏳','text':''};const {done:_0x26091d,success:_0x4ee619,cancelRequested:_0x226621}=_0x31fbc3;if(!_0x26091d)return _0x226621?{'icon':'🛑','text':a42_0x5737de[_0x4e4037(0x314)](_0x4e4037(0x234))}:{'icon':'🔄','text':a42_0x5737de[_0x4e4037(0x2c3)](_0x4e4037(0x28d))};if(_0x4ee619)return{'icon':'✅','text':a42_0x5737de[_0x4e4037(0x362)](_0x4e4037(0x343))};return{'icon':'❌','text':a42_0x5737de[_0x4e4037(0x2e2)](_0x4e4037(0x333))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x548fe7(0x270)](_0x297db6,_0x243d99,_0x1df67f=0x0){const _0x5f2bfb=a42_0x548fe7;return _0x297db6[_0x1df67f]||_0x243d99[_0x5f2bfb(0x2ea)];}[a42_0x548fe7(0x38e)](_0xcef595,_0x17238e,_0xe9453=0x0){const _0x3c6e11=a42_0x548fe7,_0x446675=this['resolveProject'](_0xcef595,_0x17238e,_0xe9453);if(!_0x446675)return console[_0x3c6e11(0x333)](a42_0x5737de['red'](_0x3c6e11(0x27d)),_0x3c6e11(0x296)),console[_0x3c6e11(0x333)](a42_0x5737de['dim'](_0x3c6e11(0x34a))),null;return _0x446675;}[a42_0x548fe7(0x359)](_0x5cd2de,_0x301f7f){const _0x20857b=a42_0x548fe7;if(_0x5cd2de[0x0]){const _0x3cd391=_0x5cd2de[0x0][_0x20857b(0x266)]('.');if(_0x3cd391['length']===0x1)return{'projectName':_0x3cd391[0x0],'workflowName':undefined};else return _0x3cd391[_0x20857b(0x214)]===0x2?{'projectName':_0x3cd391[0x0],'workflowName':_0x3cd391[0x1]}:(console[_0x20857b(0x333)](a42_0x5737de[_0x20857b(0x2e2)](_0x20857b(0x27d)),_0x20857b(0x35d)),null);}return{'projectName':_0x301f7f[_0x20857b(0x2ea)],'workflowName':undefined};}['resolveProjectDir'](_0x37b183,_0x433d76,_0x18c5b3=0x0){const _0x1b980a=a42_0x548fe7;if(_0x37b183[_0x18c5b3])return _0x37b183[_0x18c5b3];if(_0x433d76[_0x1b980a(0x2ea)]){const _0x46a890=a42_0x32a3eb[_0x1b980a(0x24d)](process['cwd'](),_0x1b980a(0x316),_0x433d76['workflowProject']);if(existsSync(a42_0x32a3eb[_0x1b980a(0x24d)](_0x46a890,_0x1b980a(0x364))))return _0x46a890;}return undefined;}async['showWorkflowConsoleUrl'](_0x21f519,_0x2635a3,_0x511aa3){const _0x5e3867=a42_0x548fe7;try{const _0x26c424=await _0x21f519[_0x5e3867(0x350)][_0x5e3867(0x316)](_0x2635a3,{'limit':0x1});if(_0x26c424[_0x5e3867(0x214)]>0x0){const _0x1874a6=_0x26c424[0x0]['id'],_0x48f7f0=getWorkflowUrl(_0x511aa3,_0x1874a6);console['error']('\x20\x20Console:\x20'+a42_0x5737de[_0x5e3867(0x334)](_0x48f7f0));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x2fa);[a42_0x548fe7(0x2da)]='Set\x20default\x20workflow\x20project\x20for\x20this\x20session';async[a42_0x548fe7(0x262)](_0x1b07da){const _0x4e1f45=a42_0x548fe7,{options:_0x29f45c,args:_0x3b62c7,tdx:_0x328c84}=_0x1b07da,_0x545aae=_0x3b62c7[0x0],_0x2003fc=_0x29f45c[_0x4e1f45(0x236)];if(_0x2003fc)return saveSessionContext({'workflow_project':undefined},_0x29f45c[_0x4e1f45(0x302)]),console[_0x4e1f45(0x373)](a42_0x5737de['green'](_0x4e1f45(0x34c))),0x0;if(!_0x545aae)return console[_0x4e1f45(0x333)](a42_0x5737de['red']('Error:'),_0x4e1f45(0x296)),console['error'](a42_0x5737de[_0x4e1f45(0x2d2)]('Usage:\x20tdx\x20wf\x20use\x20<project>')),console[_0x4e1f45(0x333)](a42_0x5737de[_0x4e1f45(0x2d2)](_0x4e1f45(0x346))),0x1;const _0x300760=await withSpinner(_0x4e1f45(0x1f5)+_0x545aae+'\x27...',()=>_0x328c84[_0x4e1f45(0x350)][_0x4e1f45(0x213)](_0x545aae),{'verbose':_0x29f45c[_0x4e1f45(0x21a)]}),{name:_0xbfb7a9}=_0x300760[_0x4e1f45(0x252)];return saveSessionContext({'workflow_project':_0xbfb7a9},_0x29f45c['session']),console['log'](a42_0x5737de[_0x4e1f45(0x362)](_0x4e1f45(0x282)+a42_0x5737de['cyan'](_0xbfb7a9))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x548fe7(0x23d);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2e8);async[a42_0x548fe7(0x262)](_0x308048){const _0x14f68b=a42_0x548fe7,{options:_0x2d22c0,args:_0x326669,tdx:_0x10bfee}=_0x308048,_0xcee178=_0x326669[0x0];_0x2d22c0[_0x14f68b(0x21a)]&&_0xcee178&&console[_0x14f68b(0x333)]('Pattern:\x20'+_0xcee178);const _0x518a2b=await withSpinner(_0x14f68b(0x38f),()=>_0x10bfee[_0x14f68b(0x350)][_0x14f68b(0x295)](_0xcee178,{'limit':_0x2d22c0[_0x14f68b(0x29a)]}),{'verbose':_0x2d22c0['verbose']});let _0x3ee269=_0x518a2b['data'];_0x3ee269['sort']((_0x3001bf,_0x281421)=>_0x3001bf[_0x14f68b(0x313)][_0x14f68b(0x293)](_0x281421['name']));const _0x59ba40=_0x2d22c0[_0x14f68b(0x29a)]||0x64,_0x579432=_0x3ee269['length']>=_0x59ba40?a42_0x5737de[_0x14f68b(0x2d2)]('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x14f68b(0x333)]('✔\x20Found\x20'+_0x3ee269['length']+'\x20project'+(_0x3ee269['length']!==0x1?'s':'')+_0x579432);if(_0x2d22c0[_0x14f68b(0x24c)]===_0x14f68b(0x230)||_0x2d22c0['format']==='jsonl'||_0x2d22c0[_0x14f68b(0x24c)]===_0x14f68b(0x24f))await handleSDKOutput(_0x3ee269,_0x2d22c0);else{if(_0x3ee269['length']===0x0)_0xcee178?console['log'](_0x14f68b(0x212)+_0xcee178):console['log'](_0x14f68b(0x312));else{const _0x1c2400=_0x3ee269['map'](_0x149eb0=>{const _0x2be110=_0x14f68b,_0x82a2ca=_0x149eb0[_0x2be110(0x2ed)]?.['some'](_0x93afce=>_0x93afce[_0x2be110(0x22f)]===_0x2be110(0x23e)),_0xea0a3c=_0x82a2ca?a42_0x5737de['dim'](_0x2be110(0x307)):'';return _0x2be110(0x2c8)+_0x149eb0['name']+_0xea0a3c;});await writeOutput(_0x1c2400[_0x14f68b(0x24d)]('\x0a'),_0x2d22c0['output'],_0x14f68b(0x2b4));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x300);['description']=a42_0x548fe7(0x36e);async[a42_0x548fe7(0x262)](_0x3d2645){const _0x360754=a42_0x548fe7,{options:_0x21385c,args:_0x4b4f61,tdx:_0x2bcbf8}=_0x3d2645,_0x37959d=this[_0x360754(0x270)](_0x4b4f61,_0x21385c);_0x21385c[_0x360754(0x21a)]&&_0x37959d&&console[_0x360754(0x333)](_0x360754(0x275)+_0x37959d);const _0x5c9a21=await withSpinner('Listing\x20workflows...',()=>_0x2bcbf8[_0x360754(0x350)][_0x360754(0x316)](_0x37959d,{'limit':_0x21385c[_0x360754(0x29a)]}),{'verbose':_0x21385c[_0x360754(0x21a)]});let _0x4f681a=_0x5c9a21['data'];_0x4f681a[_0x360754(0x2c2)]((_0x6a6122,_0x1bfa32)=>{const _0x1cca46=_0x360754,_0x558adf=_0x6a6122[_0x1cca46(0x313)]['localeCompare'](_0x1bfa32[_0x1cca46(0x313)]);if(_0x558adf!==0x0)return _0x558adf;return(_0x6a6122[_0x1cca46(0x225)]?.[_0x1cca46(0x313)]||'')[_0x1cca46(0x293)](_0x1bfa32[_0x1cca46(0x225)]?.['name']||'');});const _0x4da198=_0x21385c[_0x360754(0x29a)]||0x64,_0x42c140=_0x4f681a[_0x360754(0x214)]>=_0x4da198?a42_0x5737de['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x360754(0x333)]('✔\x20Found\x20'+_0x4f681a[_0x360754(0x214)]+_0x360754(0x33f)+(_0x4f681a[_0x360754(0x214)]!==0x1?'s':'')+_0x42c140);if(_0x21385c[_0x360754(0x24c)]==='json'||_0x21385c[_0x360754(0x24c)]===_0x360754(0x2b0)||_0x21385c[_0x360754(0x24c)]==='table')await handleSDKOutput(_0x4f681a,_0x21385c);else{if(_0x4f681a[_0x360754(0x214)]===0x0)_0x37959d?console['log'](_0x360754(0x26d)+_0x37959d):console['log'](_0x360754(0x32b));else{const _0x292e92=_0x21385c['site'],_0x22d406=_0x4f681a[_0x360754(0x394)](_0x559521=>{const _0x370cc3=_0x360754,_0x394d4c=a42_0x5737de[_0x370cc3(0x2d2)]('#'+_0x559521['id']),_0x290548=hyperlink(_0x394d4c,getWorkflowUrl(_0x292e92,_0x559521['id'])),_0xf50f5e=_0x559521[_0x370cc3(0x225)]?.[_0x370cc3(0x313)]?a42_0x5737de[_0x370cc3(0x2d2)]('\x20('+_0x559521['project'][_0x370cc3(0x313)]+')'):'';return'📋\x20'+_0x290548+'\x20'+_0x559521[_0x370cc3(0x313)]+_0xf50f5e;});await writeOutput(_0x22d406['join']('\x0a'),_0x21385c[_0x360754(0x223)],_0x360754(0x2b4));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:sessions';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2ac);async['execute'](_0x479d71){const _0x4035e5=a42_0x548fe7,{options:_0x46251d,args:_0x466db9,tdx:_0xa3d7e4}=_0x479d71,_0x1d450f=this['parseProjectWorkflowPattern'](_0x466db9,_0x46251d);if(!_0x1d450f)return 0x1;const {projectName:_0x4b6b18,workflowName:_0x6e1ba2}=_0x1d450f;if(_0x46251d[_0x4035e5(0x21a)]){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x333)](_0x4035e5(0x255)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18&&console['error'](_0x4035e5(0x1ee)+_0x4b6b18);const _0x183a5d=_0x46251d['status'];_0x183a5d&&console[_0x4035e5(0x333)](_0x4035e5(0x257)+_0x183a5d);}let _0x1d9a51=0x28;if(process[_0x4035e5(0x1f7)][_0x4035e5(0x299)]&&!_0x46251d[_0x4035e5(0x223)]&&!_0x46251d[_0x4035e5(0x24c)]){const _0x2f823b=process[_0x4035e5(0x1f7)][_0x4035e5(0x2e6)]||0x28;_0x1d9a51=Math[_0x4035e5(0x36d)](0x14,Math[_0x4035e5(0x273)](_0x2f823b*0x2/0x3));}const _0x212d27=_0x46251d[_0x4035e5(0x29a)]||_0x1d9a51,_0x10e9ec=await withSpinner('Listing\x20workflow\x20sessions...',()=>_0xa3d7e4['workflow'][_0x4035e5(0x392)]({'projectName':_0x4b6b18,'workflowName':_0x6e1ba2,'status':_0x46251d['status'],'fromTime':_0x46251d[_0x4035e5(0x2d6)],'toTime':_0x46251d['to'],'limit':_0x212d27}),{'verbose':_0x46251d[_0x4035e5(0x21a)]}),_0xab1ea5=_0x10e9ec[_0x4035e5(0x252)];_0xab1ea5['sort']((_0x1a45bb,_0x49d324)=>{const _0x52e990=_0x4035e5,_0x324d45=_0x1a45bb[_0x52e990(0x2a3)]||'',_0x1d031a=_0x49d324[_0x52e990(0x2a3)]||'';return _0x1d031a[_0x52e990(0x293)](_0x324d45);});_0xab1ea5[_0x4035e5(0x214)]>=_0x212d27?console[_0x4035e5(0x333)](_0x4035e5(0x34b)+_0xab1ea5['length']+_0x4035e5(0x261)+a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x355))):console['error']('✔\x20Found\x20'+_0xab1ea5[_0x4035e5(0x214)]+_0x4035e5(0x216)+(_0xab1ea5[_0x4035e5(0x214)]!==0x1?'s':''));if(_0x46251d[_0x4035e5(0x24c)]===_0x4035e5(0x230)||_0x46251d[_0x4035e5(0x24c)]===_0x4035e5(0x2b0)||_0x46251d[_0x4035e5(0x24c)]==='table')await handleSDKOutput(_0xab1ea5,_0x46251d);else{if(!process[_0x4035e5(0x1f7)][_0x4035e5(0x299)]||_0x46251d[_0x4035e5(0x223)]){if(_0xab1ea5['length']===0x0){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x373)](_0x4035e5(0x215)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18?console[_0x4035e5(0x373)](_0x4035e5(0x2d5)+_0x4b6b18):console[_0x4035e5(0x373)](_0x4035e5(0x2b6));}else{const _0x51177b=_0x46251d['site'],_0x453358=this['renderSessionsTimeline'](_0xab1ea5,_0x51177b);_0x46251d[_0x4035e5(0x223)]?await writeOutput(_0x453358,_0x46251d[_0x4035e5(0x223)],_0x4035e5(0x2b4)):console[_0x4035e5(0x373)](_0x453358);}!_0x4b6b18&&(console[_0x4035e5(0x333)](''),console[_0x4035e5(0x333)](a42_0x5737de['dim'](_0x4035e5(0x388))),console['error'](a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x22e))+'or'+a42_0x5737de[_0x4035e5(0x2d2)](_0x4035e5(0x328))));}else{if(_0xab1ea5[_0x4035e5(0x214)]===0x0){if(_0x4b6b18&&_0x6e1ba2)console[_0x4035e5(0x373)](_0x4035e5(0x215)+_0x4b6b18+'.'+_0x6e1ba2);else _0x4b6b18?console[_0x4035e5(0x373)](_0x4035e5(0x2d5)+_0x4b6b18):console[_0x4035e5(0x373)](_0x4035e5(0x2b6));}else await this['navigateSessionsInteractive'](_0xab1ea5,_0x479d71,_0x4b6b18);}}return 0x0;}['renderSessionsTimeline'](_0x4d3db2,_0xd25341){const _0x28d738=a42_0x548fe7,_0x24da2c=[],_0x11de17=new Map();let _0x4f902e=Infinity,_0x2e3e86=-Infinity;for(const _0x3e5aa1 of _0x4d3db2){if(_0x3e5aa1[_0x28d738(0x23a)]?.['createdAt']){const _0x547dd1=new Date(_0x3e5aa1[_0x28d738(0x23a)]['createdAt'])[_0x28d738(0x24e)](),_0x50df69=_0x3e5aa1['lastAttempt'][_0x28d738(0x371)]?new Date(_0x3e5aa1[_0x28d738(0x23a)][_0x28d738(0x371)])['getTime']():Date[_0x28d738(0x2a9)](),_0xdfc5b4=_0x3e5aa1['project']?.[_0x28d738(0x313)]||_0x28d738(0x365);!_0x11de17[_0x28d738(0x322)](_0xdfc5b4)&&_0x11de17['set'](_0xdfc5b4,[]),_0x11de17[_0x28d738(0x25c)](_0xdfc5b4)['push']({'session':_0x3e5aa1,'startTime':_0x547dd1,'endTime':_0x50df69,'duration':_0x50df69-_0x547dd1}),_0x4f902e=Math['min'](_0x4f902e,_0x547dd1),_0x2e3e86=Math[_0x28d738(0x36d)](_0x2e3e86,_0x50df69);}}if(_0x11de17[_0x28d738(0x2e9)]===0x0)return'No\x20sessions\x20with\x20timing\x20information';const _0x4d26ec=process[_0x28d738(0x1f7)]['columns']||0x78,_0x1306a4=0x1e,_0x2d6977=0x32,_0x1073cd=0x4,_0x498c88=Math[_0x28d738(0x317)](_0x2d6977,Math[_0x28d738(0x36d)](_0x1306a4,Math[_0x28d738(0x273)](_0x4d26ec*0.3))),_0x319d17=_0x4d26ec-_0x498c88-TIMELINE_CONFIG[_0x28d738(0x24b)]-0x3-_0x1073cd,_0x313294=_0x2e3e86-_0x4f902e,_0x493071=_0x313294/_0x498c88,_0x201703=renderTimeAxis({'startTime':_0x4f902e,'endTime':_0x2e3e86,'durationMs':_0x313294,'msPerChar':_0x493071},_0x498c88),_0x2210eb=[];for(const _0x1c1de9 of _0x11de17['values']()){_0x2210eb[_0x28d738(0x382)](..._0x1c1de9);}_0x2210eb[_0x28d738(0x2c2)]((_0x403e93,_0x4be78b)=>_0x4be78b['startTime']-_0x403e93['startTime']);const _0x27e3ae=new Date(_0x4f902e),_0x4a28da=formatDate(_0x27e3ae),_0x4f3264=_0x1073cd+TIMELINE_CONFIG[_0x28d738(0x20a)]+TIMELINE_CONFIG[_0x28d738(0x2cc)]+_0x319d17,_0x17cb4e='\x20'[_0x28d738(0x265)](_0x4f3264-_0x4a28da[_0x28d738(0x214)]),_0x107dc2=_0x17cb4e+a42_0x5737de[_0x28d738(0x2d2)](_0x4a28da)+'\x20'+_0x201703;_0x24da2c[_0x28d738(0x382)](_0x107dc2);const _0x1ff45e=0x16;let _0x553ec9=0x0;for(const _0x377ff1 of _0x2210eb){const _0x4b36a0=_0x377ff1[_0x28d738(0x302)]['project']?.['name']||'?',_0x4870cd=Math[_0x28d738(0x317)](stringWidth(_0x4b36a0),_0x1ff45e);_0x553ec9=Math[_0x28d738(0x36d)](_0x553ec9,_0x4870cd);}for(const _0x3b0088 of _0x2210eb){const {session:_0xb4221c,startTime:_0x500a05,endTime:_0x21f175,duration:_0xbf352a}=_0x3b0088,_0x21b614=_0xb4221c[_0x28d738(0x225)]?.['id'],_0x285bdb=_0xb4221c['id'],_0x3f82a8=_0xb4221c[_0x28d738(0x225)]?.[_0x28d738(0x313)]||'?',_0x3b46d3=_0xb4221c[_0x28d738(0x350)]?.[_0x28d738(0x313)]||'?';let _0x315e00,_0x35d7fc;if(_0xb4221c[_0x28d738(0x23a)]){const _0x5d77a1=_0xb4221c[_0x28d738(0x23a)];!_0x5d77a1[_0x28d738(0x250)]?(_0x315e00=_0x5d77a1[_0x28d738(0x20d)]?'🛑':'🔄',_0x35d7fc=_0x5d77a1[_0x28d738(0x20d)]?a42_0x5737de['yellow']:a42_0x5737de[_0x28d738(0x2c3)]):(_0x315e00=_0x5d77a1[_0x28d738(0x343)]?'✅':'❌',_0x35d7fc=_0x5d77a1[_0x28d738(0x343)]?a42_0x5737de[_0x28d738(0x362)]:a42_0x5737de[_0x28d738(0x2e2)]);}else _0x315e00='⏳',_0x35d7fc=a42_0x5737de[_0x28d738(0x2d2)];const _0x404d03='#'+_0x285bdb,_0x390533=_0x21b614?hyperlink(_0x404d03,getWorkflowSessionUrl(_0xd25341,_0x21b614,_0x285bdb)):_0x404d03;let _0x454d73=_0x3f82a8;stringWidth(_0x3f82a8)>_0x1ff45e&&(_0x454d73=_0x3f82a8[_0x28d738(0x22b)](0x0,_0x1ff45e-0x1)+'…');const _0x3a6c8c=a42_0x5737de['dim'](_0x454d73),_0x425593=stringWidth(_0x454d73),_0x189363='\x20'[_0x28d738(0x265)](_0x553ec9-stringWidth(_0x454d73)+0x2),_0x3c4ea8='('+formatElapsed(_0xbf352a)+')',_0x3d40d2=stringWidth(_0x3c4ea8),_0x44373e=stringWidth(_0x404d03),_0x39395c=_0x44373e+0x1+_0x425593+_0x189363[_0x28d738(0x214)],_0x5b0d8d=_0x319d17-_0x39395c-_0x3d40d2-0x1-0x8;let _0x307195=_0x3b46d3;stringWidth(_0x307195)>_0x5b0d8d&&(_0x307195=_0x307195['slice'](0x0,_0x5b0d8d-0x1)+'…');const _0x49159c=_0x390533+'\x20'+_0x3a6c8c+_0x189363+_0x307195,_0x502ddb=stringWidth(_0x49159c),_0xe9b6d8=_0x319d17-_0x502ddb-_0x3d40d2,_0x318dbe=_0x49159c+'\x20'[_0x28d738(0x265)](Math[_0x28d738(0x36d)](0x1,_0xe9b6d8))+a42_0x5737de[_0x28d738(0x2d2)](_0x3c4ea8),_0x199f3a=Math[_0x28d738(0x273)]((_0x500a05-_0x4f902e)/_0x493071),_0x2a2c36=Math[_0x28d738(0x273)]((_0x21f175-_0x4f902e)/_0x493071),_0x1e6980=Math[_0x28d738(0x36d)](_0x199f3a+0x1,_0x2a2c36),_0x46e20e=new Array(_0x498c88)[_0x28d738(0x26e)]('\x20');for(let _0x5577e2=_0x199f3a;_0x5577e2<Math['min'](_0x1e6980,_0x498c88);_0x5577e2++){_0x46e20e[_0x5577e2]='─';}const _0x5bef0f=_0x46e20e[_0x28d738(0x394)](_0x3d1e30=>_0x3d1e30==='\x20'?'\x20':_0x35d7fc(_0x3d1e30))[_0x28d738(0x24d)]('');_0x24da2c[_0x28d738(0x382)](_0x315e00+'\x20'+_0x318dbe+'│'+_0x5bef0f+'│');}return _0x24da2c['join']('\x0a');}async[a42_0x548fe7(0x345)](_0x1b7cf5,_0x3a6a22,_0x1c5c29){const _0xd13e1d=a42_0x548fe7,{options:_0x23d756,tdx:_0x2b2820}=_0x3a6a22,_0x2381bd=_0x23d756[_0xd13e1d(0x306)],{timelineRows:_0x13c6f4,timeAxisHeader:_0x187c0c}=this[_0xd13e1d(0x290)](_0x1b7cf5,_0x2381bd),_0x147d27=_0x13c6f4[_0xd13e1d(0x384)](_0x14c8c3=>_0x14c8c3[_0xd13e1d(0x269)]);if(_0x147d27[_0xd13e1d(0x214)]===0x0){const _0x365238=this[_0xd13e1d(0x368)](_0x1b7cf5,_0x2381bd);console[_0xd13e1d(0x373)](_0x365238);!_0x1c5c29&&(console[_0xd13e1d(0x333)](''),console[_0xd13e1d(0x333)](a42_0x5737de['dim'](_0xd13e1d(0x388))),console[_0xd13e1d(0x333)](a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x22e))+'or'+a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x328))));return;}_0x187c0c&&console[_0xd13e1d(0x373)](_0x187c0c);const _0x4a61b5=_0x13c6f4[_0xd13e1d(0x384)](_0x4887d8=>_0x4887d8['attemptId'])['map'](_0x3fe34d=>({'title':_0x3fe34d[_0xd13e1d(0x287)],'value':_0x3fe34d[_0xd13e1d(0x269)]})),_0x1f889f=process['stdout']['rows']||0x3c,_0xeee27d=Math[_0xd13e1d(0x36d)](0x28,Math['floor'](_0x1f889f*0x2/0x3)),_0x21e027=await a42_0x2a4a52({'type':_0xd13e1d(0x315),'name':'attemptId','message':_0xd13e1d(0x32a),'choices':_0x4a61b5,'initial':-0x1,'limit':_0xeee27d,'clearFirst':!![],'fallback':{'title':_0xd13e1d(0x390),'value':null},'suggest':(_0x2a0403,_0x4a8d6b)=>{const _0x67bd9b=_0xd13e1d;if(!_0x2a0403)return Promise[_0x67bd9b(0x391)](_0x4a8d6b);const _0x666fc=_0x4a8d6b[_0x67bd9b(0x384)](_0x32078b=>{const _0x4acc65=_0x67bd9b,_0x2bd40a=_0x32078b;return _0x2bd40a[_0x4acc65(0x339)][_0x4acc65(0x2a7)]()['includes'](_0x2a0403[_0x4acc65(0x2a7)]());});return Promise[_0x67bd9b(0x391)](_0x666fc);}}),_0x117d73=()=>{const _0x564390=_0xd13e1d;process['stdout'][_0x564390(0x2fb)](_0x564390(0x2f2)),process['stdout'][_0x564390(0x2fb)](_0x564390(0x2f2)),process[_0x564390(0x1f7)][_0x564390(0x2fb)](_0x564390(0x2f2));},_0x24f662=_0x21e027&&_0x21e027[_0xd13e1d(0x269)]&&_0x21e027[_0xd13e1d(0x269)]!==null&&_0x21e027['attemptId'][_0xd13e1d(0x249)]()!=='';if(!_0x24f662){_0x117d73(),console[_0xd13e1d(0x373)](a42_0x5737de[_0xd13e1d(0x2d2)](_0xd13e1d(0x264)));return;}_0x117d73();const _0x2c2513=_0x1b7cf5['find'](_0x4e0576=>_0x4e0576[_0xd13e1d(0x23a)]?.['id']===_0x21e027['attemptId']);if(_0x2c2513){const _0x56f48a=_0x2c2513[_0xd13e1d(0x225)]?.[_0xd13e1d(0x313)]||'?',_0x4f0121=_0x2c2513[_0xd13e1d(0x350)]?.[_0xd13e1d(0x313)]||'?';console['log']('Project:\x20'+a42_0x5737de[_0xd13e1d(0x2d2)](_0x56f48a)+',\x20Workflow:\x20'+a42_0x5737de[_0xd13e1d(0x2d2)](_0x4f0121));}const _0x7b19d3=new WorkflowTimelineCommand();await _0x7b19d3[_0xd13e1d(0x262)]({'args':[],'options':{..._0x23d756,'attemptId':_0x21e027[_0xd13e1d(0x269)]},'tdx':_0x2b2820});}[a42_0x548fe7(0x290)](_0x45107e,_0xa6cb72){const _0x170c5d=a42_0x548fe7,_0x357c3e=new Map();for(const _0xee43f1 of _0x45107e){_0xee43f1['id']&&_0xee43f1[_0x170c5d(0x23a)]?.['id']&&_0x357c3e[_0x170c5d(0x325)](_0xee43f1['id'],_0xee43f1[_0x170c5d(0x23a)]['id']);}const _0x12b86c=[];let _0x186d0d='';const _0x2759ab=this[_0x170c5d(0x368)](_0x45107e,_0xa6cb72),_0x3a3963=_0x2759ab[_0x170c5d(0x266)]('\x0a');for(const _0x71ec38 of _0x3a3963){if(_0x71ec38[_0x170c5d(0x220)](_0x170c5d(0x37a))||_0x71ec38[_0x170c5d(0x1ea)](/^\s+\d{4}-\d{2}-\d{2}/))_0x186d0d=_0x71ec38;else{if(_0x71ec38['match'](/^[✅❌🔄🛑⏳]/)){const _0x346ef6=_0x71ec38[_0x170c5d(0x1ea)](/#(\d+)/),_0x137f07=_0x346ef6?_0x346ef6[0x1]:null,_0x2f84be=_0x137f07?_0x357c3e[_0x170c5d(0x25c)](_0x137f07)||null:null,_0x1b37a2=_0x45107e['find'](_0x50069c=>_0x50069c['id']===_0x137f07),_0x2c78c0=_0x1b37a2?.[_0x170c5d(0x225)]?.['name']||'';_0x12b86c['push']({'displayLine':_0x71ec38,'attemptId':_0x2f84be,'projectName':_0x2c78c0});}}}return{'timelineRows':_0x12b86c,'timeAxisHeader':_0x186d0d};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';['description']=a42_0x548fe7(0x38a);async[a42_0x548fe7(0x262)](_0x1f6d71){const _0x212bdf=a42_0x548fe7,{options:_0xab0d0b,args:_0x50ed2b,tdx:_0x499e4f}=_0x1f6d71,_0xdf6d62=this[_0x212bdf(0x359)](_0x50ed2b,_0xab0d0b);if(!_0xdf6d62)return 0x1;const {projectName:_0x41bdac,workflowName:_0x213441}=_0xdf6d62,_0x36c388=_0xab0d0b[_0x212bdf(0x38b)];if(_0xab0d0b[_0x212bdf(0x21a)]){if(_0x41bdac&&_0x213441)console[_0x212bdf(0x333)](_0x212bdf(0x255)+_0x41bdac+'.'+_0x213441);else _0x41bdac&&console[_0x212bdf(0x333)]('Filter:\x20project='+_0x41bdac);_0x36c388&&console[_0x212bdf(0x333)](_0x212bdf(0x2f6));}const _0x32b32f=await withSpinner('Listing\x20workflow\x20attempts...',()=>_0x499e4f[_0x212bdf(0x350)][_0x212bdf(0x25a)]({'projectName':_0x41bdac,'workflowName':_0x213441,'includeRetried':_0x36c388,'limit':_0xab0d0b[_0x212bdf(0x29a)]}),{'verbose':_0xab0d0b[_0x212bdf(0x21a)]}),_0x2ab4e1=_0x32b32f['data'],_0x2a673c=_0xab0d0b['limit']||0x64,_0x1ca62d=_0x2ab4e1['length']>=_0x2a673c?a42_0x5737de['dim'](_0x212bdf(0x2c6)):'';console[_0x212bdf(0x333)](_0x212bdf(0x2f8)+_0x2ab4e1[_0x212bdf(0x214)]+_0x212bdf(0x294)+(_0x2ab4e1['length']!==0x1?'s':'')+_0x1ca62d);if(_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x230)||_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x2b0)||_0xab0d0b[_0x212bdf(0x24c)]===_0x212bdf(0x24f))await handleSDKOutput(_0x2ab4e1,_0xab0d0b);else{if(_0x2ab4e1[_0x212bdf(0x214)]===0x0){if(_0x41bdac&&_0x213441)console[_0x212bdf(0x373)]('No\x20attempts\x20found\x20for:\x20'+_0x41bdac+'.'+_0x213441);else _0x41bdac?console[_0x212bdf(0x373)](_0x212bdf(0x231)+_0x41bdac):console['log'](_0x212bdf(0x311));}else{const _0x32f5e9=_0xab0d0b[_0x212bdf(0x306)],_0x18c566=_0x2ab4e1['map'](_0x5e4d2b=>{const _0x43111a=_0x212bdf,_0x3467ad=a42_0x5737de['dim']('#'+_0x5e4d2b['id']),_0x44645f=_0x5e4d2b['project']?.['id'],_0x28ad3f=_0x5e4d2b[_0x43111a(0x356)]||_0x5e4d2b[_0x43111a(0x280)],_0x1a6c2e=_0x44645f&&_0x28ad3f?hyperlink(_0x3467ad,getWorkflowAttemptUrl(_0x32f5e9,_0x44645f,_0x28ad3f,_0x5e4d2b['id'])):_0x3467ad,{icon:_0x2d9f80,text:_0x4c7eb9}=getAttemptStatusDisplay(_0x5e4d2b),_0x2ba2eb=(_0x5e4d2b['project']?.[_0x43111a(0x313)]||'?')+'.'+(_0x5e4d2b[_0x43111a(0x350)]?.['name']||'?'),_0x2aac79=_0x5e4d2b['sessionTime']?a42_0x5737de[_0x43111a(0x2d2)](_0x5e4d2b['sessionTime']):'';return(_0x1a6c2e+'\x20'+_0x2d9f80+(_0x4c7eb9?'\x20'+_0x4c7eb9:'')+'\x20'+_0x2ba2eb+'\x20'+_0x2aac79)[_0x43111a(0x229)]();});await writeOutput(_0x18c566[_0x212bdf(0x24d)]('\x0a'),_0xab0d0b['output'],_0x212bdf(0x2b4));}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x361);['description']=a42_0x548fe7(0x239);async['execute'](_0x1bb502){const _0x4ea1d7=a42_0x548fe7,{options:_0x9d2c08,args:_0x52610a,tdx:_0x576ec4}=_0x1bb502,_0x183943=_0x52610a[0x0];if(!_0x183943)return console[_0x4ea1d7(0x333)](_0x4ea1d7(0x2e7)),0x1;_0x9d2c08[_0x4ea1d7(0x21a)]&&console[_0x4ea1d7(0x333)]('Attempt\x20ID:\x20'+_0x183943);const _0x1c4e12=await withSpinner(_0x4ea1d7(0x2cb),()=>_0x576ec4[_0x4ea1d7(0x350)]['attempt'](_0x183943),{'verbose':_0x9d2c08[_0x4ea1d7(0x21a)]}),_0xea0dc0=_0x1c4e12['data'];let _0x4c1fc2;!_0xea0dc0[_0x4ea1d7(0x250)]?_0x4c1fc2=_0xea0dc0[_0x4ea1d7(0x20d)]?_0x4ea1d7(0x234):_0x4ea1d7(0x28d):_0x4c1fc2=_0xea0dc0[_0x4ea1d7(0x343)]?_0x4ea1d7(0x343):_0x4ea1d7(0x333);let _0x46d172;if(_0xea0dc0['createdAt']&&_0xea0dc0['finishedAt']){const _0x298ec8=new Date(_0xea0dc0[_0x4ea1d7(0x2a0)])[_0x4ea1d7(0x24e)](),_0x302d47=new Date(_0xea0dc0['finishedAt'])['getTime']();_0x46d172=Math[_0x4ea1d7(0x20c)]((_0x302d47-_0x298ec8)/0x3e8);}const _0x18598f={'attempt_id':_0xea0dc0['id'],'status':_0x4c1fc2,..._0xea0dc0[_0x4ea1d7(0x286)]!==undefined&&{'index':_0xea0dc0[_0x4ea1d7(0x286)]},..._0xea0dc0[_0x4ea1d7(0x225)]&&{'project':_0xea0dc0['project'][_0x4ea1d7(0x313)]},..._0xea0dc0[_0x4ea1d7(0x350)]&&{'workflow':_0xea0dc0[_0x4ea1d7(0x350)][_0x4ea1d7(0x313)]},..._0xea0dc0[_0x4ea1d7(0x280)]&&{'session_id':_0xea0dc0[_0x4ea1d7(0x280)]},..._0xea0dc0[_0x4ea1d7(0x2a3)]&&{'session_time':_0xea0dc0[_0x4ea1d7(0x2a3)]},..._0xea0dc0['retryAttemptName']&&{'retry_attempt':_0xea0dc0['retryAttemptName']},..._0x46d172!==undefined&&{'duration_sec':_0x46d172},..._0xea0dc0['createdAt']&&{'created_at':_0xea0dc0[_0x4ea1d7(0x2a0)]},..._0xea0dc0[_0x4ea1d7(0x371)]&&{'finished_at':_0xea0dc0[_0x4ea1d7(0x371)]},...Object[_0x4ea1d7(0x217)](_0xea0dc0[_0x4ea1d7(0x376)])[_0x4ea1d7(0x214)]>0x0&&{'params':_0xea0dc0[_0x4ea1d7(0x376)]}};return await handleSingleObjectOutput(_0x18598f,_0x9d2c08),0x0;}}export class WorkflowTasksCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x2ca);['description']=a42_0x548fe7(0x2d0);async[a42_0x548fe7(0x262)](_0xa707e7){const _0x3755f4=a42_0x548fe7,{options:_0x5bb324,args:_0x1f5570,tdx:_0x429902}=_0xa707e7,_0x592ae2=_0x1f5570[0x0];if(!_0x592ae2)return console['error']('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;const _0x2d1a4c=_0x5bb324['includeSubtasks'];_0x5bb324['verbose']&&(console['error'](_0x3755f4(0x37e)+_0x592ae2),_0x2d1a4c&&console[_0x3755f4(0x333)](_0x3755f4(0x218)));const _0x25b2bd=await withSpinner(_0x3755f4(0x26c),()=>_0x429902[_0x3755f4(0x350)][_0x3755f4(0x2ab)](_0x592ae2,_0x2d1a4c||![]),{'verbose':_0x5bb324[_0x3755f4(0x21a)]}),_0x1e1030=_0x25b2bd['data'];return console[_0x3755f4(0x333)](_0x3755f4(0x2f8)+_0x1e1030[_0x3755f4(0x214)]+_0x3755f4(0x203)+(_0x1e1030[_0x3755f4(0x214)]!==0x1?'s':'')),await handleSDKOutput(_0x1e1030,_0x5bb324),0x0;}}export class WorkflowLogsCommand extends BaseCommand{['name']='workflow:logs';[a42_0x548fe7(0x2da)]='Show\x20logs\x20for\x20a\x20workflow\x20attempt';async[a42_0x548fe7(0x262)](_0x509324){const _0x4b8937=a42_0x548fe7,{options:_0x395f67,args:_0x3d9796,tdx:_0x292ff8}=_0x509324,_0x2f1a36=_0x3d9796[0x0];let _0x5b4474=_0x3d9796[0x1];if(!_0x2f1a36)return console['error'](_0x4b8937(0x2e7)),0x1;_0x395f67[_0x4b8937(0x21a)]&&(console[_0x4b8937(0x333)](_0x4b8937(0x37e)+_0x2f1a36),_0x5b4474&&console[_0x4b8937(0x333)](_0x4b8937(0x386)+_0x5b4474));const _0x1aad2d=await withSpinner(_0x4b8937(0x344),()=>_0x292ff8['workflow'][_0x4b8937(0x2f7)](_0x2f1a36,_0x5b4474),{'verbose':_0x395f67[_0x4b8937(0x21a)]}),_0x7da375=_0x1aad2d[_0x4b8937(0x252)];if(_0x7da375[_0x4b8937(0x214)]===0x0)return console['error'](_0x4b8937(0x204)),0x0;if(!_0x5b4474&&(_0x395f67[_0x4b8937(0x230)]||_0x395f67['format']))return await handleSDKOutput(_0x7da375,_0x395f67),0x0;if(!_0x5b4474){const _0x597fb7=_0x7da375[_0x4b8937(0x394)](_0x58b038=>({'title':_0x58b038[_0x4b8937(0x23b)]+'\x20('+formatBytes(_0x58b038[_0x4b8937(0x2db)])+')','value':_0x58b038[_0x4b8937(0x23b)]})),_0x265e1d=await a42_0x2a4a52({'type':'select','name':_0x4b8937(0x396),'message':_0x4b8937(0x38d),'choices':_0x597fb7});if(!_0x265e1d['task'])return console[_0x4b8937(0x333)](_0x4b8937(0x264)),0x0;_0x5b4474=_0x265e1d[_0x4b8937(0x396)];}const _0x57accf=await withSpinner(_0x4b8937(0x2ff),()=>_0x292ff8[_0x4b8937(0x350)]['logs'](_0x2f1a36,_0x5b4474),{'verbose':_0x395f67[_0x4b8937(0x21a)]}),_0x1762ae=_0x57accf[_0x4b8937(0x252)];return _0x1762ae?console[_0x4b8937(0x373)](_0x1762ae):console[_0x4b8937(0x333)]('No\x20log\x20content\x20found'),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x28f);['description']='Kill\x20a\x20running\x20attempt';async[a42_0x548fe7(0x262)](_0xbf6e64){const _0x25e1d8=a42_0x548fe7,{options:_0x2169dd,args:_0x1fbc41,tdx:_0x572790}=_0xbf6e64,_0x2227ea=_0x1fbc41[0x0];if(!_0x2227ea)return console['error'](_0x25e1d8(0x2e7)),0x1;const _0x404bc8=_0x2169dd[_0x25e1d8(0x2b8)];_0x2169dd['verbose']&&(console[_0x25e1d8(0x333)](_0x25e1d8(0x37e)+_0x2227ea),_0x404bc8&&console['error'](_0x25e1d8(0x28c)+_0x404bc8));if(!_0x2169dd[_0x25e1d8(0x305)]){if(!isInteractive())return console[_0x25e1d8(0x333)](a42_0x5737de[_0x25e1d8(0x2e2)]('\x0aError:'),_0x25e1d8(0x366)),console['error'](a42_0x5737de[_0x25e1d8(0x2d2)](_0x25e1d8(0x393))),0x1;const _0x292238=await confirmKey(_0x25e1d8(0x336)+_0x2227ea+'?');if(!_0x292238)return console['error'](a42_0x5737de[_0x25e1d8(0x314)](_0x25e1d8(0x264))),0x1;}const _0x49393b=await withSpinner(_0x25e1d8(0x2d4),()=>_0x572790[_0x25e1d8(0x350)][_0x25e1d8(0x2f1)](_0x2227ea,_0x404bc8),{'verbose':_0x2169dd['verbose']}),_0x569ee3=_0x49393b['data'];return console['error']('✔\x20'+_0x569ee3),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']=a42_0x548fe7(0x20e);[a42_0x548fe7(0x2da)]='Retry\x20a\x20session\x20or\x20attempt';async[a42_0x548fe7(0x262)](_0xc0c708){const _0x504a97=a42_0x548fe7,{options:_0x467d3f,args:_0x1a889f,tdx:_0x10d19f}=_0xc0c708,_0x41b30e=_0x1a889f[0x0];if(!_0x41b30e)return console[_0x504a97(0x333)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x504a97(0x333)]('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;let _0x21b1db=![],_0x5649a0=_0x41b30e;if(_0x41b30e[_0x504a97(0x220)](_0x504a97(0x244)))_0x21b1db=!![],_0x5649a0=_0x41b30e[_0x504a97(0x2c0)](0x8);else{if(_0x41b30e['startsWith']('attempt:'))_0x21b1db=![],_0x5649a0=_0x41b30e['substring'](0x8);else return console[_0x504a97(0x333)](_0x504a97(0x235)),console['error']('Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>'),0x1;}const _0x5c743c=_0x467d3f['fromTask'],_0x5db078=_0x467d3f[_0x504a97(0x2a4)],_0x4a81c2=_0x467d3f[_0x504a97(0x376)],_0x5f0215=_0x467d3f[_0x504a97(0x227)];_0x467d3f[_0x504a97(0x21a)]&&(console['error'](_0x504a97(0x37c)+(_0x21b1db?_0x504a97(0x302):_0x504a97(0x34e))+'\x20'+_0x5649a0),_0x5c743c&&console[_0x504a97(0x333)](_0x504a97(0x1ef)+_0x5c743c),_0x5db078&&console['error'](_0x504a97(0x318)+_0x5db078),_0x4a81c2&&console[_0x504a97(0x333)](_0x504a97(0x233)+_0x4a81c2),_0x5f0215&&console[_0x504a97(0x333)](_0x504a97(0x30d)));let _0x29fef1;if(_0x4a81c2)try{if(_0x4a81c2[_0x504a97(0x220)]('@')){const _0x4f2436=await import(_0x504a97(0x27f)),_0x5ced2f=_0x4a81c2[_0x504a97(0x2c0)](0x1),_0x2e3d56=await _0x4f2436[_0x504a97(0x378)](_0x5ced2f,_0x504a97(0x25d));_0x29fef1=JSON[_0x504a97(0x247)](_0x2e3d56);}else _0x29fef1=JSON['parse'](_0x4a81c2);}catch{return console['error'](_0x504a97(0x2bc)),0x1;}if(!_0x467d3f[_0x504a97(0x305)]){if(!isInteractive())return console[_0x504a97(0x333)](a42_0x5737de[_0x504a97(0x2e2)](_0x504a97(0x2d9)),_0x504a97(0x366)),console[_0x504a97(0x333)](a42_0x5737de['dim'](_0x504a97(0x393))),0x1;const _0x54d330=await confirmKey(_0x504a97(0x310)+(_0x21b1db?_0x504a97(0x302):'attempt')+'\x20'+_0x5649a0+'?');if(!_0x54d330)return console['error'](a42_0x5737de[_0x504a97(0x314)](_0x504a97(0x264))),0x1;}let _0x27ed22;_0x21b1db?_0x27ed22=await withSpinner(_0x504a97(0x1fd),()=>_0x10d19f[_0x504a97(0x350)][_0x504a97(0x25f)](_0x5649a0,{'fromTask':_0x5c743c,'retryParams':_0x29fef1}),{'verbose':_0x467d3f['verbose']}):_0x27ed22=await withSpinner(_0x504a97(0x1ff),()=>_0x10d19f[_0x504a97(0x350)][_0x504a97(0x338)](_0x5649a0,{'resumeFrom':_0x5db078,'retryParams':_0x29fef1,'force':_0x5f0215}),{'verbose':_0x467d3f[_0x504a97(0x21a)]});const _0x24e6ce=_0x27ed22['data'];return console['error'](_0x504a97(0x30a)),console['error'](_0x504a97(0x329)+_0x24e6ce[_0x504a97(0x269)]),console[_0x504a97(0x333)]('\x20\x20Session\x20ID:\x20'+_0x24e6ce['sessionId']),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:run';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x24a);async['execute'](_0x4b49c2){const _0x323071=a42_0x548fe7,{options:_0x149786,args:_0x116863,tdx:_0x3deabf}=_0x4b49c2;let _0x5b0777=_0x116863[0x0];if(!_0x5b0777){const _0x6071e7=this[_0x323071(0x270)]([],_0x149786),_0x5b3275=await withSpinner(_0x323071(0x276),()=>_0x3deabf[_0x323071(0x350)][_0x323071(0x316)](_0x6071e7,{'limit':_0x149786[_0x323071(0x29a)]}),{'verbose':_0x149786[_0x323071(0x21a)]}),_0x12a5f9=_0x5b3275[_0x323071(0x252)];if(_0x12a5f9['length']===0x0)return console[_0x323071(0x333)](_0x323071(0x32b)),!_0x6071e7&&console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2d2)](_0x323071(0x34a))),0x1;const _0x5655a4=_0x12a5f9[_0x323071(0x394)](_0xc70a0a=>({'title':_0xc70a0a[_0x323071(0x225)]?.[_0x323071(0x313)]+'.'+_0xc70a0a[_0x323071(0x313)],'value':_0xc70a0a[_0x323071(0x225)]?.[_0x323071(0x313)]+'.'+_0xc70a0a[_0x323071(0x313)],'description':_0xc70a0a['revision']?'revision:\x20'+_0xc70a0a['revision']:undefined})),_0x5285f8=await a42_0x2a4a52({'type':_0x323071(0x285),'name':_0x323071(0x350),'message':_0x323071(0x389),'choices':_0x5655a4});if(!_0x5285f8['workflow'])return 0x1;_0x5b0777=_0x5285f8[_0x323071(0x350)];}if(!_0x5b0777[_0x323071(0x259)]('.')){const _0x41bc4a=this[_0x323071(0x270)]([],_0x149786);if(_0x41bc4a)_0x5b0777=_0x41bc4a+'.'+_0x5b0777;else return console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2e2)](_0x323071(0x27d)),_0x323071(0x1eb)),console[_0x323071(0x333)](a42_0x5737de[_0x323071(0x2d2)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;}const _0x1c9374=_0x149786['param'],_0x13b589=_0x149786[_0x323071(0x2a3)],_0x2f44ad={};if(_0x1c9374&&Array[_0x323071(0x240)](_0x1c9374))for(const _0x299fbd of _0x1c9374){const _0x9b833f=_0x299fbd[_0x323071(0x2d3)]('=');if(_0x9b833f===-0x1)return console[_0x323071(0x333)](_0x323071(0x2d1)+_0x299fbd),console[_0x323071(0x333)]('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x6b515b=_0x299fbd[_0x323071(0x2c0)](0x0,_0x9b833f),_0x172789=_0x299fbd['substring'](_0x9b833f+0x1);try{_0x2f44ad[_0x6b515b]=JSON[_0x323071(0x247)](_0x172789);}catch{_0x2f44ad[_0x6b515b]=_0x172789;}}_0x149786['verbose']&&(console[_0x323071(0x333)]('Workflow:\x20'+_0x5b0777),Object[_0x323071(0x217)](_0x2f44ad)[_0x323071(0x214)]>0x0&&console[_0x323071(0x333)](_0x323071(0x292)+JSON[_0x323071(0x200)](_0x2f44ad)),_0x13b589&&console['error'](_0x323071(0x253)+_0x13b589));const _0x160d52=await withSpinner('Starting\x20workflow\x20run...',()=>_0x3deabf[_0x323071(0x350)][_0x323071(0x2c5)](_0x5b0777,_0x2f44ad,{'sessionTime':_0x13b589}),{'verbose':_0x149786[_0x323071(0x21a)]}),_0x5dd7a4=_0x160d52[_0x323071(0x252)];console[_0x323071(0x333)](_0x323071(0x1fe)),console['error'](_0x323071(0x27e)+_0x5dd7a4['id']),console['error'](_0x323071(0x248)+_0x5dd7a4[_0x323071(0x280)]),console[_0x323071(0x333)](_0x323071(0x347)+_0x5dd7a4[_0x323071(0x225)]?.[_0x323071(0x313)]),console['error'](_0x323071(0x379)+_0x5dd7a4[_0x323071(0x350)]?.['name']);if(_0x5dd7a4[_0x323071(0x225)]?.['id']&&_0x5dd7a4[_0x323071(0x280)]&&_0x5dd7a4['id']){const _0x2d3ee1=_0x149786[_0x323071(0x306)],_0x2a4b31=getConsoleUrl(_0x2d3ee1,'/app/workflows/'+_0x5dd7a4[_0x323071(0x225)]['id']+_0x323071(0x1ec)+_0x5dd7a4[_0x323071(0x280)]+_0x323071(0x2f4)+_0x5dd7a4['id']);console[_0x323071(0x333)](_0x323071(0x20b)+a42_0x5737de[_0x323071(0x334)](_0x2a4b31));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x381);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2df);async[a42_0x548fe7(0x262)](_0x10c02f){const _0x5e7a95=a42_0x548fe7,{options:_0x55d913,args:_0x4dc8a5,tdx:_0x1e283d}=_0x10c02f,_0x11cf44=_0x4dc8a5[0x0],_0xefb325=_0x4dc8a5[0x1]||'.';if(!_0x11cf44)return console[_0x5e7a95(0x333)]('Error:\x20Project\x20name\x20is\x20required'),console[_0x5e7a95(0x333)]('Usage:\x20workflow:download\x20<project-name>\x20[output-dir]'),0x1;const _0xff608f=_0x55d913['revision'];_0x55d913[_0x5e7a95(0x21a)]&&(console['error'](_0x5e7a95(0x2ae)+_0x11cf44),console['error'](_0x5e7a95(0x2e3)+_0xefb325),_0xff608f&&console['error']('Revision:\x20'+_0xff608f));const _0xf5d71f=await withSpinner('Downloading\x20project\x20'+_0x11cf44+_0x5e7a95(0x207),()=>_0x1e283d[_0x5e7a95(0x350)][_0x5e7a95(0x26b)](_0x11cf44,_0xefb325,{'revision':_0xff608f}),{'verbose':_0x55d913[_0x5e7a95(0x21a)]}),_0x36f308=_0xf5d71f[_0x5e7a95(0x252)];return console[_0x5e7a95(0x333)]('✔\x20Downloaded\x20'+_0x36f308[_0x5e7a95(0x26f)]),console[_0x5e7a95(0x333)](_0x5e7a95(0x31d)+_0x36f308[_0x5e7a95(0x2ec)]),console[_0x5e7a95(0x333)]('\x20\x20Files\x20extracted:\x20'+_0x36f308[_0x5e7a95(0x308)]),console[_0x5e7a95(0x333)](_0x5e7a95(0x1f2)+_0xefb325+'/'+_0x36f308[_0x5e7a95(0x26f)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:upload';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x246);async[a42_0x548fe7(0x262)](_0x1f5a09){const _0x20d665=a42_0x548fe7,{options:_0x31c480,args:_0x2379c9,tdx:_0x3a981d}=_0x1f5a09;let _0x53afe6='.',_0x1b4fbc=_0x31c480['name'];if(_0x2379c9[0x0]){const {promises:_0x456755}=await import('fs');try{const _0x499718=await _0x456755['stat'](_0x2379c9[0x0]);if(_0x499718['isDirectory']())_0x53afe6=_0x2379c9[0x0];else return console['error'](_0x20d665(0x2eb)+_0x2379c9[0x0]+_0x20d665(0x21e)),0x1;}catch{_0x1b4fbc=_0x2379c9[0x0],_0x53afe6='.';}}const _0x1c0fc3=_0x31c480[_0x20d665(0x2ec)],_0x2e6b67=_0x31c480[_0x20d665(0x33c)];_0x31c480[_0x20d665(0x21a)]&&(console[_0x20d665(0x333)]('Project\x20directory:\x20'+_0x53afe6),_0x1b4fbc&&console[_0x20d665(0x333)](_0x20d665(0x274)+_0x1b4fbc),_0x1c0fc3&&console[_0x20d665(0x333)](_0x20d665(0x271)+_0x1c0fc3),_0x2e6b67&&console[_0x20d665(0x333)](_0x20d665(0x228)));const _0x39ebec=await withSpinner('Pushing\x20workflow\x20project...',()=>_0x3a981d[_0x20d665(0x350)][_0x20d665(0x382)](_0x53afe6,{'projectName':_0x1b4fbc,'revision':_0x1c0fc3,'skipValidation':_0x2e6b67}),{'verbose':_0x31c480[_0x20d665(0x21a)]}),_0x25d60d=_0x39ebec[_0x20d665(0x252)];return console[_0x20d665(0x333)](_0x20d665(0x202)+_0x25d60d[_0x20d665(0x26f)]),console['error']('\x20\x20Project\x20ID:\x20'+_0x25d60d['projectId']),console[_0x20d665(0x333)](_0x20d665(0x31d)+_0x25d60d[_0x20d665(0x2ec)]),await this[_0x20d665(0x245)](_0x3a981d,_0x25d60d[_0x20d665(0x26f)],_0x31c480[_0x20d665(0x306)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x548fe7(0x313)]='workflow:pull';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2cf);async['execute'](_0xeb6f60){const _0x1985ca=a42_0x548fe7,{options:_0x484cfa,args:_0x1fd5c8,tdx:_0x35c5a9}=_0xeb6f60,_0x5b43bf=_0x1fd5c8[0x0],_0x4edb5c=_0x1fd5c8[0x1];if(!_0x5b43bf)return console['error'](a42_0x5737de['red'](_0x1985ca(0x27d)),_0x1985ca(0x296)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x38c))),0x1;const _0x40824c=_0x484cfa[_0x1985ca(0x2ec)];_0x484cfa[_0x1985ca(0x21a)]&&(console[_0x1985ca(0x333)](_0x1985ca(0x2ae)+_0x5b43bf),_0x4edb5c&&console[_0x1985ca(0x333)]('Target\x20directory:\x20'+_0x4edb5c),_0x40824c&&console[_0x1985ca(0x333)](_0x1985ca(0x271)+_0x40824c),_0x484cfa['dryRun']&&console['error'](_0x1985ca(0x237)));const _0x4fde35=await withSpinner('Pulling\x20project\x20'+_0x5b43bf+'...',()=>_0x35c5a9[_0x1985ca(0x350)][_0x1985ca(0x335)](_0x5b43bf,{'targetDir':_0x4edb5c,'revision':_0x40824c}),{'verbose':_0x484cfa[_0x1985ca(0x21a)]}),_0x512883=_0x4fde35[_0x1985ca(0x252)];_0x512883[_0x1985ca(0x31e)]?console[_0x1985ca(0x333)](_0x1985ca(0x21d)+_0x512883[_0x1985ca(0x26f)]):console['error'](_0x1985ca(0x2bd)+_0x512883[_0x1985ca(0x26f)]);console['error'](_0x1985ca(0x31d)+_0x512883[_0x1985ca(0x2ec)]),console[_0x1985ca(0x333)](_0x1985ca(0x288)+(a42_0x32a3eb['relative'](process[_0x1985ca(0x201)](),_0x512883[_0x1985ca(0x397)])||'.')),console[_0x1985ca(0x333)]('\x20\x20Changes:\x20'+a42_0x5737de[_0x1985ca(0x362)]('+'+_0x512883['summary']['new']+_0x1985ca(0x20f))+',\x20'+(a42_0x5737de[_0x1985ca(0x314)]('~'+_0x512883['summary']['modified']+_0x1985ca(0x27b))+',\x20')+(a42_0x5737de[_0x1985ca(0x2e2)]('-'+_0x512883['summary'][_0x1985ca(0x395)]+'\x20deleted')+',\x20')+(''+a42_0x5737de[_0x1985ca(0x2d2)](_0x512883['summary'][_0x1985ca(0x2c4)]+_0x1985ca(0x349))));for(const _0x58c82e of _0x512883['changes']){_0x58c82e[_0x1985ca(0x36b)]===_0x1985ca(0x337)&&_0x58c82e[_0x1985ca(0x272)]&&(console[_0x1985ca(0x333)]('\x0a'+a42_0x5737de[_0x1985ca(0x334)](_0x1985ca(0x29b)+_0x58c82e[_0x1985ca(0x340)])),console[_0x1985ca(0x333)](_0x58c82e['diff']));}if(!_0x512883[_0x1985ca(0x23c)])return saveSessionContext({'workflow_project':_0x512883['projectName']},_0x484cfa[_0x1985ca(0x302)]),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x362)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x298)+_0x512883['projectName'])),0x0;if(_0x484cfa[_0x1985ca(0x374)])return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x314)]('\x0aDry\x20run\x20-\x20no\x20files\x20written')),0x0;if(!_0x484cfa[_0x1985ca(0x305)]){if(!isInteractive())return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2e2)](_0x1985ca(0x2d9)),_0x1985ca(0x366)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x393))),0x1;const _0x7d079b=await confirmKey('\x0aApply\x20these\x20changes?');if(!_0x7d079b)return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x314)]('Cancelled'),_0x1985ca(0x36c)),0x1;}await withSpinner('Writing\x20files...',()=>_0x35c5a9[_0x1985ca(0x350)][_0x1985ca(0x2c1)](_0x512883,{'revision':_0x40824c}),{'verbose':_0x484cfa[_0x1985ca(0x21a)]}),saveSessionContext({'workflow_project':_0x512883[_0x1985ca(0x26f)]},_0x484cfa[_0x1985ca(0x302)]),console['error'](a42_0x5737de['green'](_0x1985ca(0x25b)));const _0x5f2d8a=a42_0x32a3eb[_0x1985ca(0x2a5)](process['cwd'](),_0x512883[_0x1985ca(0x397)])||'.';return console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x1f2)+_0x5f2d8a)),console[_0x1985ca(0x333)](a42_0x5737de[_0x1985ca(0x2d2)](_0x1985ca(0x298)+_0x512883[_0x1985ca(0x26f)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{['name']='workflow:push';['description']=a42_0x548fe7(0x291);async[a42_0x548fe7(0x262)](_0x471c83){const _0x4f81db=a42_0x548fe7,{options:_0x1ddae4,args:_0x4eaa4c,tdx:_0x4e3119}=_0x471c83,_0x1a2fae=this[_0x4f81db(0x30c)](_0x4eaa4c,_0x1ddae4),_0x10464e=_0x1ddae4[_0x4f81db(0x2ec)],_0x2a6d60=_0x1ddae4[_0x4f81db(0x33c)];_0x1ddae4[_0x4f81db(0x21a)]&&(_0x1a2fae&&console[_0x4f81db(0x333)](_0x4f81db(0x2ba)+_0x1a2fae),_0x10464e&&console[_0x4f81db(0x333)]('Revision:\x20'+_0x10464e),_0x1ddae4[_0x4f81db(0x374)]&&console['error'](_0x4f81db(0x237)),_0x2a6d60&&console[_0x4f81db(0x333)](_0x4f81db(0x228)));let _0x34195c;try{_0x34195c=await withSpinner(_0x4f81db(0x211),()=>_0x4e3119[_0x4f81db(0x350)][_0x4f81db(0x341)]({'sourceDir':_0x1a2fae,'revision':_0x10464e,'skipValidation':_0x2a6d60}),{'verbose':_0x1ddae4['verbose']});}catch(_0x483ed7){if(_0x483ed7 instanceof Error&&_0x483ed7['message']['includes']('No\x20workflow\x20tdx.json\x20found'))return console['error'](a42_0x5737de[_0x4f81db(0x2e2)](_0x4f81db(0x27d)),_0x4f81db(0x28b)),_0x1ddae4[_0x4f81db(0x2ea)]?console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x35c)+_0x1ddae4['workflowProject']+_0x4f81db(0x29e)+_0x1ddae4[_0x4f81db(0x2ea)]+'\x27')):console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x1e9))),0x1;throw _0x483ed7;}const _0x237aa8=_0x34195c[_0x4f81db(0x252)];console[_0x4f81db(0x333)]('✔\x20Project:\x20'+_0x237aa8[_0x4f81db(0x26f)]),console['error'](_0x4f81db(0x219)+_0x237aa8['sourceDir']),console[_0x4f81db(0x333)](_0x4f81db(0x31d)+_0x237aa8[_0x4f81db(0x2ec)]),console[_0x4f81db(0x333)](_0x4f81db(0x254)+a42_0x5737de['green']('+'+_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x289)]+'\x20new')+',\x20'+(a42_0x5737de['yellow']('~'+_0x237aa8[_0x4f81db(0x301)]['modified']+_0x4f81db(0x27b))+',\x20')+(a42_0x5737de['red']('-'+_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x395)]+_0x4f81db(0x33d))+',\x20')+(''+a42_0x5737de[_0x4f81db(0x2d2)](_0x237aa8[_0x4f81db(0x301)][_0x4f81db(0x2c4)]+_0x4f81db(0x349))));for(const _0x386af2 of _0x237aa8[_0x4f81db(0x348)]){_0x386af2[_0x4f81db(0x36b)]===_0x4f81db(0x337)&&_0x386af2[_0x4f81db(0x272)]&&(console[_0x4f81db(0x333)]('\x0a'+a42_0x5737de['cyan'](_0x4f81db(0x29b)+_0x386af2[_0x4f81db(0x340)])),console[_0x4f81db(0x333)](_0x386af2[_0x4f81db(0x272)]));}if(!_0x237aa8[_0x4f81db(0x23c)])return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x362)](_0x4f81db(0x375))),await this[_0x4f81db(0x245)](_0x4e3119,_0x237aa8['projectName'],_0x1ddae4['site']),0x0;if(_0x1ddae4[_0x4f81db(0x374)])return console['error'](a42_0x5737de['yellow'](_0x4f81db(0x324))),0x0;if(!_0x1ddae4[_0x4f81db(0x305)]){if(!isInteractive())return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2e2)](_0x4f81db(0x2d9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x2d2)](_0x4f81db(0x393))),0x1;const _0x2cae97=await confirmKey(_0x4f81db(0x256));if(!_0x2cae97)return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x314)](_0x4f81db(0x264)),_0x4f81db(0x32f)),0x1;}const _0x3804f3=await withSpinner('Pushing\x20project...',()=>_0x4e3119[_0x4f81db(0x350)][_0x4f81db(0x372)](_0x237aa8),{'verbose':_0x1ddae4[_0x4f81db(0x21a)]}),_0x48664f=_0x3804f3['data'];return console[_0x4f81db(0x333)](a42_0x5737de[_0x4f81db(0x362)](_0x4f81db(0x327))),console['error'](_0x4f81db(0x37b)+_0x48664f['projectId']),console['error'](_0x4f81db(0x31d)+_0x48664f[_0x4f81db(0x2ec)]),await this['showWorkflowConsoleUrl'](_0x4e3119,_0x48664f[_0x4f81db(0x26f)],_0x1ddae4['site']),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x1f9);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x267);async[a42_0x548fe7(0x262)](_0x4ee035){const _0xbd4dc6=a42_0x548fe7,{options:_0x3caac2,args:_0x6a4696,tdx:_0x4e5aea}=_0x4ee035,_0x11238b=this[_0xbd4dc6(0x30c)](_0x6a4696,_0x3caac2),_0x4d1915=_0x3caac2['name'],_0x46de18=_0x3caac2[_0xbd4dc6(0x2ec)],_0x1bdb11=_0x3caac2[_0xbd4dc6(0x33c)];if(!_0x11238b)return console['error'](a42_0x5737de[_0xbd4dc6(0x2e2)](_0xbd4dc6(0x27d)),_0xbd4dc6(0x360)),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x2d2)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a42_0x5737de[_0xbd4dc6(0x2d2)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context')),0x1;if(!_0x4d1915)return console[_0xbd4dc6(0x333)](a42_0x5737de['red'](_0xbd4dc6(0x27d)),_0xbd4dc6(0x383)),console['error'](a42_0x5737de[_0xbd4dc6(0x2d2)](_0xbd4dc6(0x28e))),0x1;_0x3caac2[_0xbd4dc6(0x21a)]&&(console['error'](_0xbd4dc6(0x2ba)+_0x11238b),console[_0xbd4dc6(0x333)]('New\x20project\x20name:\x20'+_0x4d1915),_0x46de18&&console['error'](_0xbd4dc6(0x271)+_0x46de18),_0x3caac2['dryRun']&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x237)),_0x1bdb11&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x228)));const _0x3753d6=await withSpinner('Analyzing\x20project...',()=>_0x4e5aea[_0xbd4dc6(0x350)][_0xbd4dc6(0x2bb)](_0x11238b,_0x4d1915,{'revision':_0x46de18,'skipValidation':_0x1bdb11}),{'verbose':_0x3caac2[_0xbd4dc6(0x21a)]}),_0xa6b0c0=_0x3753d6[_0xbd4dc6(0x252)];console[_0xbd4dc6(0x333)](_0xbd4dc6(0x1f1)+_0xa6b0c0[_0xbd4dc6(0x279)]);_0xa6b0c0['sourceProjectName']&&console[_0xbd4dc6(0x333)](_0xbd4dc6(0x2cd)+_0xa6b0c0[_0xbd4dc6(0x35a)]);console[_0xbd4dc6(0x333)](_0xbd4dc6(0x363)+_0xa6b0c0[_0xbd4dc6(0x208)]),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x271)+_0xa6b0c0[_0xbd4dc6(0x2ec)]),console['error'](_0xbd4dc6(0x319)+_0xa6b0c0[_0xbd4dc6(0x1f8)]);_0xa6b0c0[_0xbd4dc6(0x1f0)]&&(console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x314)](_0xbd4dc6(0x2ad)+_0xa6b0c0[_0xbd4dc6(0x208)]+_0xbd4dc6(0x32d)+_0xa6b0c0['existingProjectId']+')')),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x314)](_0xbd4dc6(0x224))));if(_0x3caac2['dryRun'])return console['error'](a42_0x5737de[_0xbd4dc6(0x314)]('\x0aDry\x20run\x20-\x20no\x20project\x20created')),0x0;if(!_0x3caac2[_0xbd4dc6(0x305)]){if(!isInteractive())return console['error'](a42_0x5737de[_0xbd4dc6(0x2e2)](_0xbd4dc6(0x2d9)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x2d2)](_0xbd4dc6(0x393))),0x1;const _0x137f7b=_0xa6b0c0[_0xbd4dc6(0x35a)]||a42_0x32a3eb[_0xbd4dc6(0x1fc)](_0x11238b),_0x4f2101=_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x26a)+_0x4d1915+'\x22\x20with\x20new\x20revision?':'\x0aClone\x20\x22'+_0x137f7b+_0xbd4dc6(0x352)+_0x4d1915+'\x22?',_0x23d380=await confirmKey(_0x4f2101);if(!_0x23d380)return console['error'](a42_0x5737de['yellow'](_0xbd4dc6(0x264))),0x1;}const _0x20e39a=await withSpinner(_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x260)+_0x4d1915+_0xbd4dc6(0x207):_0xbd4dc6(0x358)+_0x4d1915+_0xbd4dc6(0x207),()=>_0x4e5aea[_0xbd4dc6(0x350)][_0xbd4dc6(0x35f)](_0xa6b0c0),{'verbose':_0x3caac2[_0xbd4dc6(0x21a)]}),_0x1c99f4=_0x20e39a['data'];return console[_0xbd4dc6(0x333)](a42_0x5737de[_0xbd4dc6(0x362)](_0xa6b0c0[_0xbd4dc6(0x1f0)]?_0xbd4dc6(0x2ee):_0xbd4dc6(0x1fa))),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x347)+_0x1c99f4['newProjectName']),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x37b)+_0x1c99f4[_0xbd4dc6(0x2f3)]),console[_0xbd4dc6(0x333)](_0xbd4dc6(0x31d)+_0x1c99f4['revision']),await this['showWorkflowConsoleUrl'](_0x4e5aea,_0x1c99f4[_0xbd4dc6(0x208)],_0x3caac2[_0xbd4dc6(0x306)]),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{[a42_0x548fe7(0x313)]='workflow:delete';[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x258);async[a42_0x548fe7(0x262)](_0x45a61d){const _0x3128a2=a42_0x548fe7,{options:_0x50d360,args:_0x496338,tdx:_0x5465a1}=_0x45a61d,_0x3ce076=_0x496338[0x0];if(!_0x3ce076)return console['error']('Error:\x20Project\x20name\x20or\x20ID\x20is\x20required'),console[_0x3128a2(0x333)](_0x3128a2(0x2ce)),0x1;_0x50d360[_0x3128a2(0x21a)]&&console[_0x3128a2(0x333)]('Project:\x20'+_0x3ce076);if(!_0x50d360['yes']){if(!isInteractive())return console[_0x3128a2(0x333)](a42_0x5737de[_0x3128a2(0x2e2)](_0x3128a2(0x2d9)),_0x3128a2(0x366)),console[_0x3128a2(0x333)](a42_0x5737de['dim'](_0x3128a2(0x393))),0x1;const _0x35567f=await confirmKey(_0x3128a2(0x342)+_0x3ce076+_0x3128a2(0x351));if(!_0x35567f)return console['error'](a42_0x5737de[_0x3128a2(0x314)](_0x3128a2(0x264))),0x1;}const _0x3db09b=await withSpinner(_0x3128a2(0x21b)+_0x3ce076+_0x3128a2(0x207),()=>_0x5465a1['workflow'][_0x3128a2(0x27c)](_0x3ce076),{'verbose':_0x50d360[_0x3128a2(0x21a)]}),_0x4618d1=_0x3db09b[_0x3128a2(0x252)];return console[_0x3128a2(0x333)](_0x3128a2(0x241)+_0x4618d1[_0x3128a2(0x26f)]),console[_0x3128a2(0x333)](_0x3128a2(0x37b)+_0x4618d1[_0x3128a2(0x2bf)]),0x0;}}export function parseKeyValue(_0x1de4c2){const _0x58152c=a42_0x548fe7,_0x17644a=_0x1de4c2[_0x58152c(0x2d3)]('=');if(_0x17644a===-0x1)throw new Error(_0x58152c(0x2dc)+_0x1de4c2+_0x58152c(0x31f));const _0xe8c54d=_0x1de4c2[_0x58152c(0x2c0)](0x0,_0x17644a),_0x475c53=_0x1de4c2[_0x58152c(0x2c0)](_0x17644a+0x1);if(!_0xe8c54d)throw new Error(_0x58152c(0x23f));return{'key':_0xe8c54d,'value':_0x475c53};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]='workflow:secrets:list';['description']='List\x20secret\x20keys\x20for\x20a\x20workflow\x20project';async[a42_0x548fe7(0x262)](_0x3ee15e){const _0x43c21a=a42_0x548fe7,{options:_0x4338fb,args:_0x54e150,tdx:_0x2e66dc}=_0x3ee15e,_0x4824b3=this['requireProject'](_0x54e150,_0x4338fb);if(!_0x4824b3)return 0x1;_0x4338fb[_0x43c21a(0x21a)]&&console[_0x43c21a(0x333)]('Project:\x20'+_0x4824b3);const _0x59e49c=await withSpinner(_0x43c21a(0x2fc),()=>_0x2e66dc[_0x43c21a(0x350)][_0x43c21a(0x2c7)](_0x4824b3),{'verbose':_0x4338fb[_0x43c21a(0x21a)]}),{secrets:_0x43b843}=_0x59e49c[_0x43c21a(0x252)];return console[_0x43c21a(0x333)](_0x43c21a(0x2f8)+_0x43b843[_0x43c21a(0x214)]+_0x43c21a(0x251)+(_0x43b843[_0x43c21a(0x214)]!==0x1?'s':'')),await handleSDKOutput(_0x43b843,_0x4338fb),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x268);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x357);async[a42_0x548fe7(0x262)](_0x5bb3fc){const _0x5342e6=a42_0x548fe7,{options:_0x476180,args:_0x37d7a1,tdx:_0x4bc263}=_0x5bb3fc;let _0xcb5262,_0x32d29f;if(_0x37d7a1['length']>=0x2)_0xcb5262=_0x37d7a1[0x0],_0x32d29f=_0x37d7a1[0x1];else{if(_0x37d7a1[_0x5342e6(0x214)]===0x1&&_0x476180[_0x5342e6(0x2ea)])_0xcb5262=_0x476180[_0x5342e6(0x2ea)],_0x32d29f=_0x37d7a1[0x0];else return _0x37d7a1['length']===0x1?(console['error'](_0x5342e6(0x326)),console[_0x5342e6(0x333)](_0x5342e6(0x34a)),0x1):(console[_0x5342e6(0x333)](_0x5342e6(0x263)),console[_0x5342e6(0x333)](_0x5342e6(0x206)),0x1);}let _0x59995a,_0x20c4b0;try{({key:_0x59995a,value:_0x20c4b0}=parseKeyValue(_0x32d29f));}catch(_0x786910){return _0x786910 instanceof Error&&console[_0x5342e6(0x333)](a42_0x5737de[_0x5342e6(0x2e2)](_0x5342e6(0x27d)),_0x786910[_0x5342e6(0x2aa)]),0x1;}_0x476180[_0x5342e6(0x21a)]&&(console[_0x5342e6(0x333)](_0x5342e6(0x2ae)+_0xcb5262),console[_0x5342e6(0x333)]('Key:\x20'+_0x59995a));const _0x1994e6=await withSpinner(_0x5342e6(0x27a),()=>_0x4bc263[_0x5342e6(0x350)][_0x5342e6(0x321)](_0xcb5262,_0x59995a,_0x20c4b0),{'verbose':_0x476180[_0x5342e6(0x21a)]}),_0x171deb=_0x1994e6[_0x5342e6(0x252)];return console[_0x5342e6(0x333)]('✔\x20Secret\x20\x27'+_0x171deb[_0x5342e6(0x22f)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x171deb[_0x5342e6(0x26f)]+'\x27'),(_0x476180[_0x5342e6(0x230)]||_0x476180[_0x5342e6(0x2b0)])&&await handleSingleObjectOutput(_0x171deb,_0x476180),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x303);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x21c);async[a42_0x548fe7(0x262)](_0x3c3078){const _0x1c164f=a42_0x548fe7,{options:_0x367544,args:_0x5f57d6,tdx:_0x3e3e0d}=_0x3c3078;let _0x3f3f35,_0x244a83;if(_0x5f57d6['length']>=0x2)_0x3f3f35=_0x5f57d6[0x0],_0x244a83=_0x5f57d6[0x1];else{if(_0x5f57d6[_0x1c164f(0x214)]===0x1&&_0x367544[_0x1c164f(0x2ea)])_0x3f3f35=_0x367544['workflowProject'],_0x244a83=_0x5f57d6[0x0];else return _0x5f57d6[_0x1c164f(0x214)]===0x1?(console[_0x1c164f(0x333)]('Error:\x20Project\x20name\x20is\x20required'),console['error'](_0x1c164f(0x34a)),0x1):(console['error'](_0x1c164f(0x2b1)),console[_0x1c164f(0x333)](_0x1c164f(0x31c)),0x1);}_0x367544[_0x1c164f(0x21a)]&&(console[_0x1c164f(0x333)](_0x1c164f(0x2ae)+_0x3f3f35),console[_0x1c164f(0x333)](_0x1c164f(0x2dd)+_0x244a83));if(!_0x367544['yes']){if(!isInteractive())return console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x2e2)]('\x0aError:'),_0x1c164f(0x366)),console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x2d2)](_0x1c164f(0x393))),0x1;const _0xb5b2f=await confirmKey(_0x1c164f(0x2b7)+_0x244a83+_0x1c164f(0x320)+_0x3f3f35+'\x27?');if(!_0xb5b2f)return console[_0x1c164f(0x333)](a42_0x5737de[_0x1c164f(0x314)](_0x1c164f(0x264))),0x1;}const _0x147ae1=await withSpinner(_0x1c164f(0x242),()=>_0x3e3e0d[_0x1c164f(0x350)][_0x1c164f(0x33a)](_0x3f3f35,_0x244a83),{'verbose':_0x367544[_0x1c164f(0x21a)]}),_0x55d37e=_0x147ae1[_0x1c164f(0x252)];return console[_0x1c164f(0x333)](_0x1c164f(0x32e)+_0x55d37e[_0x1c164f(0x22f)]+_0x1c164f(0x387)+_0x55d37e[_0x1c164f(0x26f)]+'\x27'),(_0x367544[_0x1c164f(0x230)]||_0x367544[_0x1c164f(0x2b0)])&&await handleSingleObjectOutput(_0x55d37e,_0x367544),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(_0x2e81ce){const _0x274088=a42_0x548fe7,_0x5469a1=Math[_0x274088(0x273)](_0x2e81ce/0x3e8),_0xe9b4c=Math[_0x274088(0x273)](_0x5469a1/0x3c),_0x3ccf30=Math[_0x274088(0x273)](_0xe9b4c/0x3c),_0x3509f4=Math[_0x274088(0x273)](_0x3ccf30/0x18);if(_0x3509f4>0x0){const _0x5ac706=_0x3ccf30%0x18;return _0x5ac706>0x0?_0x3509f4+'d\x20'+_0x5ac706+'h':_0x3509f4+'d';}else{if(_0x3ccf30>0x0){const _0x327baa=_0xe9b4c%0x3c;return _0x327baa>0x0?_0x3ccf30+'h\x20'+_0x327baa+'m':_0x3ccf30+'h';}else{if(_0xe9b4c>0x0){const _0x49b09e=_0x5469a1%0x3c;return _0x49b09e>0x0?_0xe9b4c+'m\x20'+_0x49b09e+'s':_0xe9b4c+'m';}else return _0x5469a1+'s';}}}function formatTimestamp(_0x3148c0,_0x219ab5){const _0x3bf275=a42_0x548fe7,_0x507642=new Date(_0x3148c0),_0x17d99c=String(_0x507642[_0x3bf275(0x278)]())['padStart'](0x2,'0'),_0x113341=String(_0x507642[_0x3bf275(0x330)]())[_0x3bf275(0x2f9)](0x2,'0'),_0x18b2a3=_0x17d99c+':'+_0x113341,_0x34e208=_0x507642[_0x3bf275(0x2a1)]()===_0x219ab5[_0x3bf275(0x2a1)]()&&_0x507642[_0x3bf275(0x2d7)]()===_0x219ab5[_0x3bf275(0x2d7)]()&&_0x507642[_0x3bf275(0x29d)]()===_0x219ab5['getDate']();if(_0x34e208)return _0x18b2a3;else{const _0xd81691=String(_0x507642['getMonth']()+0x1)[_0x3bf275(0x2f9)](0x2,'0'),_0x431201=String(_0x507642[_0x3bf275(0x29d)]())[_0x3bf275(0x2f9)](0x2,'0');return _0xd81691+'-'+_0x431201+'\x20'+_0x18b2a3;}}function formatDate(_0x3eeff9){const _0x5acca8=a42_0x548fe7,_0x3c325e=_0x3eeff9[_0x5acca8(0x2a1)](),_0x56e812=String(_0x3eeff9['getMonth']()+0x1)['padStart'](0x2,'0'),_0x24a483=String(_0x3eeff9[_0x5acca8(0x29d)]())['padStart'](0x2,'0');return _0x3c325e+'-'+_0x56e812+'-'+_0x24a483;}function a42_0x3632(_0x1a6033,_0xcefc7b){_0x1a6033=_0x1a6033-0x1e9;const _0x46c0b0=a42_0x46c0();let _0x3632d4=_0x46c0b0[_0x1a6033];return _0x3632d4;}function getTaskStateIcon(_0x24b671){const _0x41f612={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x41f612[_0x24b671]||'⚪';}function getBarChar(_0x52673d){const _0x2232cf=a42_0x548fe7;return _0x52673d==='error'||_0x52673d===_0x2232cf(0x33e)?'×':'─';}function getBarColor(_0x5b9511){const _0x1511ae=a42_0x548fe7,_0x11ca6d={'success':a42_0x5737de[_0x1511ae(0x362)],'error':a42_0x5737de[_0x1511ae(0x2e2)],'group_error':a42_0x5737de[_0x1511ae(0x2e2)],'running':a42_0x5737de[_0x1511ae(0x2c3)],'blocked':a42_0x5737de[_0x1511ae(0x314)],'planned':a42_0x5737de[_0x1511ae(0x2d2)],'canceling':a42_0x5737de['yellow']};return _0x11ca6d[_0x5b9511]||a42_0x5737de[_0x1511ae(0x22c)];}function parseTaskName(_0x4cac28){const _0x126ea8=a42_0x548fe7;let _0x41ecad=_0x4cac28[_0x126ea8(0x377)](/^\++/,'');const _0x52a84e=_0x41ecad[_0x126ea8(0x266)]('+'),_0x439288=_0x52a84e[_0x126ea8(0x214)]>0x1?_0x52a84e['length']-0x2:0x0,_0x5893c8=_0x52a84e[_0x52a84e[_0x126ea8(0x214)]-0x1]||_0x41ecad;return{'level':_0x439288,'name':'+'+_0x5893c8};}function truncateTaskName(_0x37843b,_0x25047c){const _0x14c5a2=a42_0x548fe7,_0x6f664d=stringWidth(_0x37843b);if(_0x6f664d<=_0x25047c)return _0x37843b;let _0x422199=_0x37843b;while(stringWidth(_0x422199+'…')>_0x25047c&&_0x422199[_0x14c5a2(0x214)]>0x0){_0x422199=_0x422199[_0x14c5a2(0x22b)](0x0,-0x1);}return _0x422199+'…';}function calculateTimeScale(_0x28eb92,_0x4bd1a3){const _0x495040=a42_0x548fe7;return{'startTime':_0x28eb92[_0x495040(0x35e)],'endTime':_0x28eb92['end'],'durationMs':_0x28eb92[_0x495040(0x2fe)],'msPerChar':_0x28eb92[_0x495040(0x2fe)]/_0x4bd1a3};}function timeToPosition(_0x21d6c0,_0x46bc27,_0x1885ca){const _0x4ffd1b=a42_0x548fe7,_0x2d3c64=_0x21d6c0-_0x46bc27[_0x4ffd1b(0x32c)],_0x24aff1=Math[_0x4ffd1b(0x273)](_0x2d3c64/_0x46bc27[_0x4ffd1b(0x2de)]);return Math[_0x4ffd1b(0x36d)](0x0,Math[_0x4ffd1b(0x317)](_0x24aff1,_0x1885ca));}function renderTimeAxis(_0x4112f2,_0x21b01f){const _0x313c2f=a42_0x548fe7,_0x23fc28=Math[_0x313c2f(0x317)](TIMELINE_CONFIG[_0x313c2f(0x25e)],Math[_0x313c2f(0x36d)](TIMELINE_CONFIG[_0x313c2f(0x323)],Math[_0x313c2f(0x273)](_0x21b01f/TIMELINE_CONFIG['LABEL_WIDTH_DIVISOR']))),_0x50ebed=_0x4112f2[_0x313c2f(0x2b5)]/(_0x23fc28-0x1),_0x45ea75=new Date(_0x4112f2['startTime']),_0x4f983b=[];for(let _0x2cb93a=0x0;_0x2cb93a<_0x23fc28;_0x2cb93a++){const _0x28104e=_0x4112f2['startTime']+_0x2cb93a*_0x50ebed,_0x3ccdd8=timeToPosition(_0x28104e,_0x4112f2,_0x21b01f),_0xcf146d=formatTimestamp(_0x28104e,_0x45ea75);_0x4f983b[_0x313c2f(0x382)]({'pos':_0x3ccdd8,'text':_0xcf146d});}const _0x1cd6e3=new Array(_0x21b01f)[_0x313c2f(0x26e)]('\x20');let _0x4516ab=-0x1;for(const {pos:_0x17117c,text:_0x28da98}of _0x4f983b){let _0x39534b=Math[_0x313c2f(0x36d)](0x0,_0x17117c-Math[_0x313c2f(0x273)](_0x28da98[_0x313c2f(0x214)]/0x2));_0x39534b<=_0x4516ab+TIMELINE_CONFIG[_0x313c2f(0x284)]&&(_0x39534b=_0x4516ab+TIMELINE_CONFIG[_0x313c2f(0x284)]+0x1);_0x39534b+_0x28da98['length']>_0x21b01f&&(_0x39534b=_0x21b01f-_0x28da98[_0x313c2f(0x214)]);if(_0x39534b>=0x0&&_0x39534b+_0x28da98[_0x313c2f(0x214)]<=_0x21b01f&&_0x39534b>_0x4516ab){for(let _0xe62e8c=0x0;_0xe62e8c<_0x28da98[_0x313c2f(0x214)];_0xe62e8c++){_0x1cd6e3[_0x39534b+_0xe62e8c]=_0x28da98[_0xe62e8c];}_0x4516ab=_0x39534b+_0x28da98[_0x313c2f(0x214)]-0x1;}}return _0x1cd6e3[_0x313c2f(0x24d)]('');}function renderTaskRow(_0xdbd99e,_0x174058,_0xf23900,_0x2b0fd9){const _0x2fbfef=a42_0x548fe7,{level:_0x31676a,name:_0xec952b}=parseTaskName(_0xdbd99e['name']),_0x31b9b3='\x20'[_0x2fbfef(0x265)](_0x31676a),_0x34bd44=_0xdbd99e[_0x2fbfef(0x2c9)]?'('+formatElapsed(_0xdbd99e[_0x2fbfef(0x2c9)][_0x2fbfef(0x2fe)])+')':'',_0x164351=stringWidth(_0x34bd44),_0x55d24f=_0x31676a*0x1,_0x20a7e5=_0x2b0fd9-_0x55d24f-_0x164351-0x1,_0x1e24aa=truncateTaskName(_0xec952b,_0x20a7e5),_0x5dbf2f=_0x31b9b3+_0x1e24aa,_0x59ffe7=stringWidth(_0x5dbf2f),_0x81a1cb=_0x2b0fd9-_0x59ffe7-_0x164351,_0x3c97bb=_0x5dbf2f+'\x20'['repeat'](Math[_0x2fbfef(0x36d)](0x1,_0x81a1cb))+a42_0x5737de[_0x2fbfef(0x2d2)](_0x34bd44),_0x500826=getTaskStateIcon(_0xdbd99e[_0x2fbfef(0x281)]),_0x1f778b=new Array(_0xf23900)[_0x2fbfef(0x26e)]('\x20');if(_0xdbd99e['window']){const _0x1323c1=timeToPosition(_0xdbd99e[_0x2fbfef(0x2c9)][_0x2fbfef(0x35e)],_0x174058,_0xf23900),_0x1301b6=timeToPosition(_0xdbd99e[_0x2fbfef(0x2c9)]['end'],_0x174058,_0xf23900),_0x5be582=getBarChar(_0xdbd99e[_0x2fbfef(0x281)]),_0x415b3c=Math['max'](_0x1323c1+0x1,_0x1301b6);for(let _0x5d543b=_0x1323c1;_0x5d543b<Math[_0x2fbfef(0x317)](_0x415b3c,_0xf23900);_0x5d543b++){_0x1f778b[_0x5d543b]=_0x5be582;}}const _0x6e9b5=getBarColor(_0xdbd99e['state']),_0x5e8476=_0x1f778b[_0x2fbfef(0x394)](_0x2459e9=>_0x2459e9==='\x20'?'\x20':_0x6e9b5(_0x2459e9))['join']('');return _0x500826+'\x20'+_0x3c97bb+'│'+_0x5e8476+'│';}function calculateStats(_0x3cf30a){const _0x422f65=a42_0x548fe7,_0x5b2df8={'total':_0x3cf30a[_0x422f65(0x214)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5840b2 of _0x3cf30a){if(_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x343))_0x5b2df8[_0x422f65(0x343)]++;else{if(_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x333)||_0x5840b2[_0x422f65(0x281)]===_0x422f65(0x33e))_0x5b2df8['error']++;else _0x5840b2[_0x422f65(0x281)]===_0x422f65(0x28d)?_0x5b2df8[_0x422f65(0x28d)]++:_0x5b2df8[_0x422f65(0x1fb)]++;}}return _0x5b2df8;}function formatStats(_0x555c2d){const _0xb59538=a42_0x548fe7;return[_0xb59538(0x209)+_0x555c2d[_0xb59538(0x36a)],'✅\x20'+_0x555c2d['success'],'❌\x20'+_0x555c2d['error'],_0xb59538(0x238)+_0x555c2d['running'],'⏳\x20'+_0x555c2d[_0xb59538(0x1fb)]][_0xb59538(0x24d)]('\x20\x20');}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x548fe7(0x313)]=a42_0x548fe7(0x331);[a42_0x548fe7(0x2da)]=a42_0x548fe7(0x2e1);async['execute'](_0x4881bc){const _0x395242=a42_0x548fe7,{options:_0x1857d0,args:_0x28e4d9,tdx:_0x2cfa54}=_0x4881bc;let _0x14f744,_0x5a6102,_0x774d9=![];if(_0x28e4d9[0x0]){if(_0x28e4d9[0x0][_0x395242(0x259)]('.')){const _0x4fd3a5=this[_0x395242(0x359)](_0x28e4d9,_0x1857d0);if(!_0x4fd3a5)return 0x1;_0x14f744=_0x4fd3a5[_0x395242(0x26f)],_0x5a6102=_0x4fd3a5[_0x395242(0x277)];}else{_0x5a6102=_0x28e4d9[0x0],_0x14f744=_0x1857d0['workflowProject'];if(!_0x14f744)return console[_0x395242(0x333)](a42_0x5737de['red']('Error:'),_0x395242(0x210)),0x1;_0x774d9=!![];}}else{const _0x286ec5=this[_0x395242(0x359)](_0x28e4d9,_0x1857d0);if(!_0x286ec5)return 0x1;_0x14f744=_0x286ec5['projectName'],_0x5a6102=_0x286ec5[_0x395242(0x277)];}if(_0x1857d0[_0x395242(0x21a)]){if(_0x14f744&&_0x5a6102)console[_0x395242(0x333)](_0x395242(0x255)+_0x14f744+'.'+_0x5a6102);else _0x14f744&&console[_0x395242(0x333)]('Filter:\x20project='+_0x14f744);}const _0x37bf70=_0x1857d0[_0x395242(0x269)],_0x597184=_0x1857d0[_0x395242(0x280)];if(_0x37bf70){_0x597184&&console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x314)](_0x395242(0x2ef)),_0x395242(0x385));const _0x1f28e0=_0x1857d0['follow'];return _0x1f28e0?await this[_0x395242(0x35b)](_0x4881bc,_0x37bf70):await this[_0x395242(0x2e5)](_0x4881bc,_0x37bf70,_0x1857d0),0x0;}if(_0x597184){const _0x3aef49=await withSpinner('Loading\x20session...',()=>_0x2cfa54[_0x395242(0x350)][_0x395242(0x392)]({'projectName':_0x14f744,'workflowName':_0x5a6102,'limit':0x64}),{'verbose':_0x1857d0['verbose']}),_0x34c8d6=_0x3aef49['data'][_0x395242(0x33b)](_0x2499d4=>_0x2499d4['id']===_0x597184);if(!_0x34c8d6)return console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2e2)]('Error:'),_0x395242(0x2d8)+_0x597184),0x1;if(!_0x34c8d6[_0x395242(0x23a)]?.['id'])return console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2e2)]('Error:'),_0x395242(0x222)+_0x597184+_0x395242(0x2b2)),0x1;const _0x585fcb=_0x34c8d6[_0x395242(0x23a)]['id'];_0x1857d0[_0x395242(0x21a)]&&console[_0x395242(0x333)](_0x395242(0x297)+_0x585fcb+'\x20from\x20session\x20'+_0x597184);const _0x3333b8=_0x1857d0[_0x395242(0x1f3)];return _0x3333b8?await this[_0x395242(0x35b)](_0x4881bc,_0x585fcb):await this[_0x395242(0x2e5)](_0x4881bc,_0x585fcb,_0x1857d0),0x0;}const _0x4f6fc3=await withSpinner('Loading\x20sessions...',()=>_0x2cfa54['workflow'][_0x395242(0x392)]({'projectName':_0x14f744,'workflowName':_0x5a6102,'limit':_0x1857d0[_0x395242(0x29a)]||0x32}),{'verbose':_0x1857d0[_0x395242(0x21a)]}),_0x1f39e2=_0x4f6fc3['data'];if(_0x1f39e2[_0x395242(0x214)]===0x0){if(_0x14f744&&_0x5a6102)console[_0x395242(0x333)](_0x395242(0x215)+_0x14f744+'.'+_0x5a6102);else _0x14f744?console['error'](_0x395242(0x2d5)+_0x14f744):(console[_0x395242(0x333)](_0x395242(0x2e4)),console[_0x395242(0x333)](a42_0x5737de[_0x395242(0x2d2)]('Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>')));return 0x0;}_0x1f39e2[_0x395242(0x2c2)]((_0x56319f,_0x3c0908)=>{const _0x4ea7bd=_0x395242,_0x1ebe82=_0x56319f[_0x4ea7bd(0x2a3)]||'',_0xca80f5=_0x3c0908[_0x4ea7bd(0x2a3)]||'';return _0xca80f5['localeCompare'](_0x1ebe82);});if(_0x1857d0['json']||_0x1857d0[_0x395242(0x2b0)])return await handleSDKOutput(_0x1f39e2,_0x1857d0),0x0;let _0x5cf999;if(_0x774d9){const _0x42e729=_0x1f39e2[0x0];if(!_0x42e729[_0x395242(0x23a)]?.['id'])return console[_0x395242(0x333)](_0x395242(0x1ed)),0x0;_0x5cf999=_0x42e729[_0x395242(0x23a)]['id'],_0x1857d0['verbose']&&console['error'](_0x395242(0x2fd)+_0x42e729[_0x395242(0x2a3)]);}else{const _0x3a363f=_0x1f39e2['map'](_0x1b16c9=>{const _0x3aac24=_0x395242,_0x44b89f=getAttemptStatusDisplay(_0x1b16c9[_0x3aac24(0x23a)]);return{'title':_0x1b16c9['project']?.[_0x3aac24(0x313)]+'.'+_0x1b16c9[_0x3aac24(0x350)]?.[_0x3aac24(0x313)]+'\x20-\x20'+_0x1b16c9['sessionTime']+'\x20'+_0x44b89f['icon'],'value':_0x1b16c9[_0x3aac24(0x23a)]?.['id']||'','description':_0x44b89f[_0x3aac24(0x30f)]};}),_0x24d747=await a42_0x2a4a52({'type':'select','name':_0x395242(0x269),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x3a363f[_0x395242(0x384)](_0x41f1c0=>_0x41f1c0[_0x395242(0x380)]!=='')});if(!_0x24d747['attemptId'])return 0x0;_0x5cf999=_0x24d747['attemptId'];}const _0x3fc209=_0x1857d0[_0x395242(0x1f3)];return _0x3fc209?await this[_0x395242(0x35b)](_0x4881bc,_0x5cf999):await this[_0x395242(0x2e5)](_0x4881bc,_0x5cf999,_0x1857d0),0x0;}async[a42_0x548fe7(0x2e5)](_0x42c7c5,_0x46f757,_0x175368){const _0x578d83=a42_0x548fe7,{tdx:_0x5886b0}=_0x42c7c5;let _0x58b6ba,_0x211612;try{[_0x58b6ba,_0x211612]=await Promise['all']([_0x5886b0[_0x578d83(0x350)][_0x578d83(0x34e)](_0x46f757),_0x5886b0['workflow'][_0x578d83(0x2ab)](_0x46f757,![])]);}catch(_0x461d17){console['error'](a42_0x5737de['red'](_0x578d83(0x31b)));_0x175368['verbose']&&console[_0x578d83(0x333)](_0x461d17);throw _0x461d17;}if(_0x175368['json']||_0x175368[_0x578d83(0x2b0)]){const _0xa820c3=this[_0x578d83(0x2e0)](_0x58b6ba,_0x211612);await handleSDKOutput([_0xa820c3],_0x175368);return;}const _0x298ce2=_0x5886b0['context'][_0x578d83(0x306)],_0x9c9b6a=this[_0x578d83(0x30b)](_0x58b6ba,_0x211612,_0x298ce2);console['log'](_0x9c9b6a);}async[a42_0x548fe7(0x35b)](_0x279b1b,_0x1db7e6){const _0x1f832b=a42_0x548fe7,{tdx:_0x39e7bb}=_0x279b1b,_0x2c2cf8=TIMELINE_CONFIG[_0x1f832b(0x36f)],_0x2dedb0=TIMELINE_CONFIG[_0x1f832b(0x2af)];let _0x29dc5b=0x0;while(_0x29dc5b<_0x2dedb0){process[_0x1f832b(0x1f7)][_0x1f832b(0x299)]&&process[_0x1f832b(0x1f7)]['write']('\x1bc');let _0x1e3b1f,_0x237861;try{[_0x1e3b1f,_0x237861]=await Promise['all']([_0x39e7bb[_0x1f832b(0x350)][_0x1f832b(0x34e)](_0x1db7e6),_0x39e7bb[_0x1f832b(0x350)][_0x1f832b(0x2ab)](_0x1db7e6,![])]);}catch(_0x488414){console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x2e2)](_0x1f832b(0x28a)));_0x29dc5b>0x0&&console[_0x1f832b(0x333)](a42_0x5737de['dim'](_0x1f832b(0x221)+_0x29dc5b));throw _0x488414;}const _0x1e5663=_0x39e7bb['context'][_0x1f832b(0x306)],_0x5953e6=this[_0x1f832b(0x30b)](_0x1e3b1f,_0x237861,_0x1e5663);console['log'](_0x5953e6);const _0x26db27=_0x1e3b1f[_0x1f832b(0x250)]&&_0x237861[_0x1f832b(0x369)](_0x3e7993=>_0x3e7993[_0x1f832b(0x281)]!==_0x1f832b(0x28d)&&_0x3e7993[_0x1f832b(0x281)]!=='planned');if(_0x26db27){console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x362)](_0x1f832b(0x30e)));break;}console['error'](a42_0x5737de[_0x1f832b(0x2d2)](_0x1f832b(0x2a6)+_0x29dc5b*0x2+_0x1f832b(0x243))),await new Promise(_0x4f1b7a=>setTimeout(_0x4f1b7a,_0x2c2cf8)),_0x29dc5b++;}_0x29dc5b>=_0x2dedb0&&console[_0x1f832b(0x333)](a42_0x5737de[_0x1f832b(0x314)]('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x548fe7(0x30b)](_0x2d9760,_0x1b49ee,_0x2b26b9){const _0x380563=a42_0x548fe7,_0x284e5e=[],_0x2e997e=TIMELINE_CONFIG[_0x380563(0x232)],_0x35b3a1=0x5,_0x1a3e57=process[_0x380563(0x1f7)]['columns']||0x78,_0xa7e8fc=_0x1a3e57-_0x2e997e-_0x35b3a1,_0x44aa20=Math[_0x380563(0x36d)](TIMELINE_CONFIG[_0x380563(0x22d)],Math[_0x380563(0x317)](_0xa7e8fc,TIMELINE_CONFIG['MAX_TIMELINE_WIDTH'])),_0x456402=new Date(_0x2d9760[_0x380563(0x2a0)])[_0x380563(0x24e)](),_0x9170bf=_0x2d9760[_0x380563(0x371)]?new Date(_0x2d9760['finishedAt'])[_0x380563(0x24e)]():Date['now'](),_0x146444={'start':_0x456402,'end':_0x9170bf,'duration':_0x9170bf-_0x456402},_0xa81a1c=new Map(),_0x39b970=[];for(const _0x4d3b0e of _0x1b49ee){if(_0x4d3b0e[_0x380563(0x29f)]){const _0x1b00e6=new Date(_0x4d3b0e[_0x380563(0x29f)])[_0x380563(0x24e)](),_0x202369=_0x4d3b0e[_0x380563(0x31a)]?new Date(_0x4d3b0e[_0x380563(0x31a)])[_0x380563(0x24e)]():Date[_0x380563(0x2a9)](),_0x4fea12={'start':_0x1b00e6,'end':_0x202369,'duration':_0x202369-_0x1b00e6};_0xa81a1c[_0x380563(0x325)](_0x4d3b0e['id'],_0x4fea12),_0x39b970[_0x380563(0x382)]({'name':_0x4d3b0e[_0x380563(0x34d)],'state':_0x4d3b0e['state']||_0x380563(0x367),'window':_0x4fea12});}else _0x39b970[_0x380563(0x382)]({'name':_0x4d3b0e[_0x380563(0x34d)],'state':_0x4d3b0e[_0x380563(0x281)]||'planned','window':undefined});}_0x39b970[_0x380563(0x2c2)]((_0x3c07ad,_0x52e7ea)=>{const _0x3318e9=_0x380563;if(!_0x3c07ad['window'])return 0x1;if(!_0x52e7ea[_0x3318e9(0x2c9)])return-0x1;return _0x3c07ad[_0x3318e9(0x2c9)][_0x3318e9(0x35e)]-_0x52e7ea[_0x3318e9(0x2c9)][_0x3318e9(0x35e)];});const _0x1b6d5c=_0x39b970[_0x380563(0x214)],_0x1ff0a3=_0x1b6d5c>TIMELINE_CONFIG[_0x380563(0x332)];_0x1ff0a3&&_0x39b970[_0x380563(0x1f6)](TIMELINE_CONFIG[_0x380563(0x332)]);const _0x2d7bbd=calculateTimeScale(_0x146444,_0x44aa20),_0x1732bf=_0x2d9760[_0x380563(0x250)]?_0x2d9760[_0x380563(0x343)]?a42_0x5737de['green'](_0x380563(0x343)):a42_0x5737de[_0x380563(0x2e2)](_0x380563(0x333)):a42_0x5737de[_0x380563(0x2c3)]('running'),_0x244211=_0x2d9760[_0x380563(0x225)]?.['id'],_0x5b16a8=_0x2d9760[_0x380563(0x280)];let _0x7e7171;if(_0x244211&&_0x5b16a8){const _0x26301c=getWorkflowAttemptUrl(_0x2b26b9,_0x244211,_0x5b16a8,_0x2d9760['id']);_0x7e7171=hyperlink(a42_0x5737de[_0x380563(0x2d2)](_0x2d9760['id']),_0x26301c);}else _0x7e7171=a42_0x5737de[_0x380563(0x2d2)](_0x2d9760['id']);_0x284e5e['push'](_0x380563(0x2b9)+_0x7e7171+_0x380563(0x37f)+_0x1732bf+_0x380563(0x37f)+formatElapsed(_0x146444['duration']));if(_0x39b970['length']>0x0){const _0x2ff428=renderTimeAxis(_0x2d7bbd,_0x44aa20),_0x3c4f58=new Date(_0x146444[_0x380563(0x35e)]),_0x14c81c=formatDate(_0x3c4f58),_0x43ef6e=TIMELINE_CONFIG[_0x380563(0x20a)]+TIMELINE_CONFIG[_0x380563(0x2cc)]+_0x2e997e,_0x12ed5e=_0x14c81c['padStart'](_0x43ef6e),_0x54264f=a42_0x5737de['dim'](_0x12ed5e);_0x284e5e[_0x380563(0x382)](_0x54264f+'\x20'+_0x2ff428);for(const _0x3b2ad2 of _0x39b970){_0x284e5e[_0x380563(0x382)](renderTaskRow(_0x3b2ad2,_0x2d7bbd,_0x44aa20,_0x2e997e));}const _0x4eae21=calculateStats(_0x39b970);_0x284e5e[_0x380563(0x382)](formatStats(_0x4eae21)),_0x1ff0a3&&_0x284e5e[_0x380563(0x382)](a42_0x5737de['yellow'](_0x380563(0x309)+TIMELINE_CONFIG[_0x380563(0x332)]+'\x20of\x20'+_0x1b6d5c+_0x380563(0x2a2))),_0x284e5e[_0x380563(0x382)](''),_0x284e5e[_0x380563(0x382)](a42_0x5737de['dim'](_0x380563(0x283))+(_0x380563(0x22a)+_0x2d9760['id']+_0x380563(0x370))+a42_0x5737de[_0x380563(0x2d2)](_0x380563(0x354)));}else _0x284e5e[_0x380563(0x382)](_0x380563(0x2f5));return _0x284e5e['join']('\x0a');}[a42_0x548fe7(0x2e0)](_0xaf5d6f,_0x5595f9){const _0x222da3=a42_0x548fe7,_0xdb0790=new Date(_0xaf5d6f[_0x222da3(0x2a0)])[_0x222da3(0x24e)](),_0xec5aef=_0xaf5d6f['finishedAt']?new Date(_0xaf5d6f[_0x222da3(0x371)])['getTime']():Date[_0x222da3(0x2a9)](),_0x5a4fca=_0xec5aef-_0xdb0790,_0x1bc98c=[];for(const _0x262a73 of _0x5595f9){if(_0x262a73['startedAt']){const _0xa6d8dd=new Date(_0x262a73['startedAt'])[_0x222da3(0x24e)](),_0x16d4d6=_0x262a73['updatedAt']?new Date(_0x262a73['updatedAt'])[_0x222da3(0x24e)]():Date[_0x222da3(0x2a9)]();_0x1bc98c[_0x222da3(0x382)]({'name':_0x262a73[_0x222da3(0x34d)],'state':_0x262a73[_0x222da3(0x281)]||_0x222da3(0x367),'window':{'start':_0xa6d8dd,'end':_0x16d4d6,'duration':_0x16d4d6-_0xa6d8dd}});}else _0x1bc98c['push']({'name':_0x262a73[_0x222da3(0x34d)],'state':_0x262a73[_0x222da3(0x281)]||_0x222da3(0x29c),'window':undefined});}const _0x34d24d=calculateStats(_0x1bc98c);return{'attempt':{'id':_0xaf5d6f['id'],'status':_0xaf5d6f[_0x222da3(0x250)]?_0xaf5d6f[_0x222da3(0x343)]?_0x222da3(0x343):_0x222da3(0x333):_0x222da3(0x28d),'createdAt':_0xaf5d6f[_0x222da3(0x2a0)],'finishedAt':_0xaf5d6f[_0x222da3(0x371)],'duration_ms':_0x5a4fca},'tasks':_0x1bc98c[_0x222da3(0x394)](_0x2d787a=>({'name':_0x2d787a[_0x222da3(0x313)],'state':_0x2d787a[_0x222da3(0x281)],'startedAt':_0x2d787a[_0x222da3(0x2c9)]?new Date(_0x2d787a['window'][_0x222da3(0x35e)])[_0x222da3(0x1f4)]():null,'updatedAt':_0x2d787a['window']?new Date(_0x2d787a[_0x222da3(0x2c9)][_0x222da3(0x34f)])[_0x222da3(0x1f4)]():null,'duration_ms':_0x2d787a[_0x222da3(0x2c9)]?.[_0x222da3(0x2fe)]||null})),'stats':_0x34d24d};}}
1
+ const a42_0x4b6388=a42_0x22fd;(function(_0x28bdbf,_0x2ad772){const _0x281a4e=a42_0x22fd,_0x4ae53f=_0x28bdbf();while(!![]){try{const _0x1368e4=-parseInt(_0x281a4e(0x24d))/0x1+parseInt(_0x281a4e(0x192))/0x2*(-parseInt(_0x281a4e(0x22f))/0x3)+parseInt(_0x281a4e(0x1da))/0x4*(-parseInt(_0x281a4e(0x278))/0x5)+parseInt(_0x281a4e(0x288))/0x6*(parseInt(_0x281a4e(0x24e))/0x7)+-parseInt(_0x281a4e(0x16e))/0x8+parseInt(_0x281a4e(0x1ac))/0x9*(-parseInt(_0x281a4e(0x185))/0xa)+parseInt(_0x281a4e(0x1cf))/0xb*(parseInt(_0x281a4e(0x2b1))/0xc);if(_0x1368e4===_0x2ad772)break;else _0x4ae53f['push'](_0x4ae53f['shift']());}catch(_0x5d63e6){_0x4ae53f['push'](_0x4ae53f['shift']());}}}(a42_0x2277,0x6a031));import a42_0x917536 from'chalk';import{existsSync}from'fs';import a42_0x2bb9e5 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{formatBytes,hyperlink}from'../sdk/util/formatters.js';import{stringWidth}from'../utils/string-utils.js';import{getWorkflowUrl,getConsoleUrl,getWorkflowSessionUrl,getWorkflowAttemptUrl}from'../sdk/client/endpoints.js';import a42_0x525db1 from'prompts';function getAttemptStatusDisplay(_0x112bf0){const _0x5e778b=a42_0x22fd;if(!_0x112bf0)return{'icon':'⏳','text':''};const {done:_0x1e2bb6,success:_0x333c76,cancelRequested:_0xa95aa}=_0x112bf0;if(!_0x1e2bb6)return _0xa95aa?{'icon':'🛑','text':a42_0x917536[_0x5e778b(0x1ed)](_0x5e778b(0x154))}:{'icon':'🔄','text':a42_0x917536[_0x5e778b(0x167)]('running')};if(_0x333c76)return{'icon':'✅','text':a42_0x917536['green'](_0x5e778b(0x1fc))};return{'icon':'❌','text':a42_0x917536['red'](_0x5e778b(0x1b6))};}export class WorkflowBaseCommand extends BaseCommand{[a42_0x4b6388(0x1bd)](_0x508297,_0xf298a9,_0x231956=0x0){const _0x2dc2b3=a42_0x4b6388;return _0x508297[_0x231956]||_0xf298a9[_0x2dc2b3(0x1aa)];}[a42_0x4b6388(0x158)](_0x13ae59,_0xd7bd71,_0x1d648d=0x0){const _0x3eba29=a42_0x4b6388,_0x243ea1=this['resolveProject'](_0x13ae59,_0xd7bd71,_0x1d648d);if(!_0x243ea1)return console['error'](a42_0x917536[_0x3eba29(0x281)](_0x3eba29(0x242)),_0x3eba29(0x290)),console[_0x3eba29(0x1b6)](a42_0x917536[_0x3eba29(0x199)](_0x3eba29(0x180))),null;return _0x243ea1;}['parseProjectWorkflowPattern'](_0x287adc,_0x2caf5d){const _0x411ac0=a42_0x4b6388;if(_0x287adc[0x0]){const _0x2f57cc=_0x287adc[0x0][_0x411ac0(0x177)]('.');if(_0x2f57cc[_0x411ac0(0x1cd)]===0x1)return{'projectName':_0x2f57cc[0x0],'workflowName':undefined};else return _0x2f57cc[_0x411ac0(0x1cd)]===0x2?{'projectName':_0x2f57cc[0x0],'workflowName':_0x2f57cc[0x1]}:(console[_0x411ac0(0x1b6)](a42_0x917536[_0x411ac0(0x281)](_0x411ac0(0x242)),_0x411ac0(0x21e)),null);}return{'projectName':_0x2caf5d[_0x411ac0(0x1aa)],'workflowName':undefined};}[a42_0x4b6388(0x265)](_0x464d99,_0x5c2b5f,_0x282f72=0x0){const _0x317200=a42_0x4b6388;if(_0x464d99[_0x282f72])return _0x464d99[_0x282f72];if(_0x5c2b5f[_0x317200(0x1aa)]){const _0x41592a=a42_0x2bb9e5['join'](process[_0x317200(0x212)](),_0x317200(0x284),_0x5c2b5f[_0x317200(0x1aa)]);if(existsSync(a42_0x2bb9e5[_0x317200(0x1a0)](_0x41592a,'tdx.json')))return _0x41592a;}return undefined;}async['showWorkflowConsoleUrl'](_0x2b75fa,_0x5a321c,_0x16b04b){const _0x14dde6=a42_0x4b6388;try{const _0x10fc0f=await _0x2b75fa[_0x14dde6(0x2b5)][_0x14dde6(0x284)](_0x5a321c,{'limit':0x1});if(_0x10fc0f[_0x14dde6(0x1cd)]>0x0){const _0x2ecf99=_0x10fc0f[0x0]['id'],_0x110891=getWorkflowUrl(_0x16b04b,_0x2ecf99);console[_0x14dde6(0x1b6)](_0x14dde6(0x295)+a42_0x917536['cyan'](_0x110891));}}catch{}}}export class WorkflowUseCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x226);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x179);async['execute'](_0x3757ea){const _0x11fb97=a42_0x4b6388,{options:_0x27fef3,args:_0x2a2beb,tdx:_0x189d3f}=_0x3757ea,_0x1aee03=_0x2a2beb[0x0],_0x20510f=_0x27fef3[_0x11fb97(0x2bd)];if(_0x20510f)return saveSessionContext({'workflow_project':undefined},_0x27fef3[_0x11fb97(0x13f)]),console[_0x11fb97(0x1d4)](a42_0x917536[_0x11fb97(0x1b9)]('✔\x20Workflow\x20project\x20context\x20cleared.')),0x0;if(!_0x1aee03)return console[_0x11fb97(0x1b6)](a42_0x917536[_0x11fb97(0x281)](_0x11fb97(0x242)),_0x11fb97(0x290)),console['error'](a42_0x917536['dim']('Usage:\x20tdx\x20wf\x20use\x20<project>')),console['error'](a42_0x917536[_0x11fb97(0x199)](_0x11fb97(0x258))),0x1;const _0x466130=await withSpinner(_0x11fb97(0x165)+_0x1aee03+_0x11fb97(0x22b),()=>_0x189d3f['workflow'][_0x11fb97(0x207)](_0x1aee03),{'verbose':_0x27fef3[_0x11fb97(0x198)]}),{name:_0x2a1584}=_0x466130[_0x11fb97(0x240)];return saveSessionContext({'workflow_project':_0x2a1584},_0x27fef3['session']),console[_0x11fb97(0x1d4)](a42_0x917536['green'](_0x11fb97(0x235)+a42_0x917536[_0x11fb97(0x202)](_0x2a1584))),0x0;}}export class WorkflowProjectsCommand extends BaseCommand{['name']=a42_0x4b6388(0x1ff);[a42_0x4b6388(0x1fd)]='List\x20all\x20workflow\x20projects';async[a42_0x4b6388(0x20c)](_0x43d453){const _0x8c1e2e=a42_0x4b6388,{options:_0x336c06,args:_0x2d7c80,tdx:_0x3f1572}=_0x43d453,_0x236e9c=_0x2d7c80[0x0];_0x336c06[_0x8c1e2e(0x198)]&&_0x236e9c&&console[_0x8c1e2e(0x1b6)](_0x8c1e2e(0x267)+_0x236e9c);const _0x5312bc=await withSpinner(_0x8c1e2e(0x294),()=>_0x3f1572['workflow'][_0x8c1e2e(0x181)](_0x236e9c,{'limit':_0x336c06[_0x8c1e2e(0x1cb)]}),{'verbose':_0x336c06[_0x8c1e2e(0x198)]});let _0x3b0b8d=_0x5312bc[_0x8c1e2e(0x240)];_0x3b0b8d[_0x8c1e2e(0x232)]((_0x3e1896,_0xee146f)=>_0x3e1896[_0x8c1e2e(0x2c8)][_0x8c1e2e(0x14e)](_0xee146f['name']));const _0x54ad9f=_0x336c06[_0x8c1e2e(0x1cb)]||0x64,_0x437fd5=_0x3b0b8d[_0x8c1e2e(0x1cd)]>=_0x54ad9f?a42_0x917536['dim']('\x20(use\x20--limit\x20to\x20show\x20more)'):'';console[_0x8c1e2e(0x1b6)](_0x8c1e2e(0x2c4)+_0x3b0b8d[_0x8c1e2e(0x1cd)]+'\x20project'+(_0x3b0b8d['length']!==0x1?'s':'')+_0x437fd5);if(_0x336c06[_0x8c1e2e(0x1a3)]===_0x8c1e2e(0x13c)||_0x336c06[_0x8c1e2e(0x1a3)]===_0x8c1e2e(0x1dd)||_0x336c06[_0x8c1e2e(0x1a3)]===_0x8c1e2e(0x200))await handleSDKOutput(_0x3b0b8d,_0x336c06);else{if(_0x3b0b8d[_0x8c1e2e(0x1cd)]===0x0)_0x236e9c?console[_0x8c1e2e(0x1d4)](_0x8c1e2e(0x2a4)+_0x236e9c):console[_0x8c1e2e(0x1d4)](_0x8c1e2e(0x291));else{const _0x16bc2c=_0x3b0b8d['map'](_0x561489=>{const _0x1bcd15=_0x8c1e2e,_0x90e928=_0x561489['metadata']?.[_0x1bcd15(0x1ec)](_0xa4d062=>_0xa4d062[_0x1bcd15(0x2a9)]==='sys'),_0x5f5cf9=_0x90e928?a42_0x917536['dim'](_0x1bcd15(0x143)):'';return _0x1bcd15(0x297)+_0x561489[_0x1bcd15(0x2c8)]+_0x5f5cf9;});await writeOutput(_0x16bc2c[_0x8c1e2e(0x1a0)]('\x0a'),_0x336c06['output'],_0x8c1e2e(0x24a));}}return 0x0;}}export class WorkflowWorkflowsCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]='workflow:workflows';[a42_0x4b6388(0x1fd)]='List\x20workflows';async[a42_0x4b6388(0x20c)](_0x19bff1){const _0x200bfa=a42_0x4b6388,{options:_0x539a96,args:_0x10c6c2,tdx:_0x3718fd}=_0x19bff1,_0x4540c4=this[_0x200bfa(0x1bd)](_0x10c6c2,_0x539a96);_0x539a96['verbose']&&_0x4540c4&&console['error']('Project\x20filter:\x20'+_0x4540c4);const _0x52fc70=await withSpinner(_0x200bfa(0x1c4),()=>_0x3718fd[_0x200bfa(0x2b5)][_0x200bfa(0x284)](_0x4540c4,{'limit':_0x539a96[_0x200bfa(0x1cb)]}),{'verbose':_0x539a96[_0x200bfa(0x198)]});let _0x54b98d=_0x52fc70[_0x200bfa(0x240)];_0x54b98d['sort']((_0xcc2cc6,_0x14b1a4)=>{const _0x323371=_0x200bfa,_0x25c4dd=_0xcc2cc6[_0x323371(0x2c8)][_0x323371(0x14e)](_0x14b1a4[_0x323371(0x2c8)]);if(_0x25c4dd!==0x0)return _0x25c4dd;return(_0xcc2cc6[_0x323371(0x139)]?.['name']||'')['localeCompare'](_0x14b1a4['project']?.[_0x323371(0x2c8)]||'');});const _0x3296db=_0x539a96['limit']||0x64,_0x819bf5=_0x54b98d[_0x200bfa(0x1cd)]>=_0x3296db?a42_0x917536['dim'](_0x200bfa(0x1e1)):'';console[_0x200bfa(0x1b6)](_0x200bfa(0x2c4)+_0x54b98d[_0x200bfa(0x1cd)]+_0x200bfa(0x2c9)+(_0x54b98d[_0x200bfa(0x1cd)]!==0x1?'s':'')+_0x819bf5);if(_0x539a96['format']===_0x200bfa(0x13c)||_0x539a96[_0x200bfa(0x1a3)]==='jsonl'||_0x539a96[_0x200bfa(0x1a3)]===_0x200bfa(0x200))await handleSDKOutput(_0x54b98d,_0x539a96);else{if(_0x54b98d[_0x200bfa(0x1cd)]===0x0)_0x4540c4?console[_0x200bfa(0x1d4)](_0x200bfa(0x244)+_0x4540c4):console[_0x200bfa(0x1d4)](_0x200bfa(0x17f));else{const _0x2b3738=_0x539a96['site'],_0x335c27=_0x54b98d[_0x200bfa(0x151)](_0x180a61=>{const _0x29422a=_0x200bfa,_0xc4f52e=a42_0x917536['dim']('#'+_0x180a61['id']),_0x554082=hyperlink(_0xc4f52e,getWorkflowUrl(_0x2b3738,_0x180a61['id'])),_0x239656=_0x180a61[_0x29422a(0x139)]?.[_0x29422a(0x2c8)]?a42_0x917536[_0x29422a(0x199)]('\x20('+_0x180a61[_0x29422a(0x139)][_0x29422a(0x2c8)]+')'):'';return'📋\x20'+_0x554082+'\x20'+_0x180a61[_0x29422a(0x2c8)]+_0x239656;});await writeOutput(_0x335c27['join']('\x0a'),_0x539a96[_0x200bfa(0x1ee)],_0x200bfa(0x24a));}}return 0x0;}}export class WorkflowSessionsCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]='workflow:sessions';[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x173);async[a42_0x4b6388(0x20c)](_0x28df84){const _0x325c1b=a42_0x4b6388,{options:_0x4a0025,args:_0x430b51,tdx:_0xfff7ff}=_0x28df84,_0x471d43=this['parseProjectWorkflowPattern'](_0x430b51,_0x4a0025);if(!_0x471d43)return 0x1;const {projectName:_0x2edd75,workflowName:_0x291cdb}=_0x471d43;if(_0x4a0025[_0x325c1b(0x198)]){if(_0x2edd75&&_0x291cdb)console[_0x325c1b(0x1b6)](_0x325c1b(0x20a)+_0x2edd75+'.'+_0x291cdb);else _0x2edd75&&console[_0x325c1b(0x1b6)](_0x325c1b(0x1c1)+_0x2edd75);const _0x1fa516=_0x4a0025[_0x325c1b(0x15c)];_0x1fa516&&console[_0x325c1b(0x1b6)](_0x325c1b(0x21b)+_0x1fa516);}let _0x436647=0x28;if(process[_0x325c1b(0x1e8)][_0x325c1b(0x248)]&&!_0x4a0025[_0x325c1b(0x1ee)]&&!_0x4a0025[_0x325c1b(0x1a3)]){const _0x3b7f30=process[_0x325c1b(0x1e8)][_0x325c1b(0x14a)]||0x28;_0x436647=Math[_0x325c1b(0x253)](0x14,Math[_0x325c1b(0x25d)](_0x3b7f30*0x2/0x3));}const _0xe63459=_0x4a0025['limit']||_0x436647,_0x43792d=await withSpinner(_0x325c1b(0x25e),()=>_0xfff7ff[_0x325c1b(0x2b5)][_0x325c1b(0x16c)]({'projectName':_0x2edd75,'workflowName':_0x291cdb,'status':_0x4a0025['status'],'fromTime':_0x4a0025['from'],'toTime':_0x4a0025['to'],'limit':_0xe63459}),{'verbose':_0x4a0025[_0x325c1b(0x198)]}),_0x424f77=_0x43792d['data'];_0x424f77[_0x325c1b(0x232)]((_0x2eda6c,_0x46d8bd)=>{const _0xd9e111=_0x325c1b,_0x1bec36=_0x2eda6c[_0xd9e111(0x1e2)]||'',_0x35b071=_0x46d8bd[_0xd9e111(0x1e2)]||'';return _0x35b071[_0xd9e111(0x14e)](_0x1bec36);});_0x424f77[_0x325c1b(0x1cd)]>=_0xe63459?console['error'](_0x325c1b(0x195)+_0x424f77[_0x325c1b(0x1cd)]+_0x325c1b(0x270)+a42_0x917536[_0x325c1b(0x199)](_0x325c1b(0x224))):console['error']('✔\x20Found\x20'+_0x424f77[_0x325c1b(0x1cd)]+_0x325c1b(0x2bf)+(_0x424f77['length']!==0x1?'s':''));if(_0x4a0025['format']===_0x325c1b(0x13c)||_0x4a0025[_0x325c1b(0x1a3)]===_0x325c1b(0x1dd)||_0x4a0025[_0x325c1b(0x1a3)]==='table')await handleSDKOutput(_0x424f77,_0x4a0025);else{if(!process['stdout'][_0x325c1b(0x248)]||_0x4a0025[_0x325c1b(0x1ee)]){if(_0x424f77['length']===0x0){if(_0x2edd75&&_0x291cdb)console[_0x325c1b(0x1d4)]('No\x20sessions\x20found\x20for:\x20'+_0x2edd75+'.'+_0x291cdb);else _0x2edd75?console[_0x325c1b(0x1d4)](_0x325c1b(0x1fe)+_0x2edd75):console['log'](_0x325c1b(0x20d));}else{const _0x5589da=_0x4a0025[_0x325c1b(0x1b0)],_0x245254=this['renderSessionsTimeline'](_0x424f77,_0x5589da);_0x4a0025[_0x325c1b(0x1ee)]?await writeOutput(_0x245254,_0x4a0025[_0x325c1b(0x1ee)],_0x325c1b(0x24a)):console[_0x325c1b(0x1d4)](_0x245254);}!_0x2edd75&&(console[_0x325c1b(0x1b6)](''),console['error'](a42_0x917536[_0x325c1b(0x199)]('💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:')),console[_0x325c1b(0x1b6)](a42_0x917536[_0x325c1b(0x199)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x917536[_0x325c1b(0x199)](_0x325c1b(0x237))));}else{if(_0x424f77[_0x325c1b(0x1cd)]===0x0){if(_0x2edd75&&_0x291cdb)console[_0x325c1b(0x1d4)](_0x325c1b(0x1de)+_0x2edd75+'.'+_0x291cdb);else _0x2edd75?console[_0x325c1b(0x1d4)](_0x325c1b(0x1fe)+_0x2edd75):console[_0x325c1b(0x1d4)](_0x325c1b(0x20d));}else await this[_0x325c1b(0x234)](_0x424f77,_0x28df84,_0x2edd75);}}return 0x0;}[a42_0x4b6388(0x1b5)](_0x11baa3,_0x1c1719){const _0x2ece4b=a42_0x4b6388,_0x5b80ff=[],_0x1cdab6=new Map();let _0x395bbc=Infinity,_0x1afc3e=-Infinity;for(const _0x308767 of _0x11baa3){if(_0x308767[_0x2ece4b(0x149)]?.[_0x2ece4b(0x1d6)]){const _0x2ad1bf=new Date(_0x308767[_0x2ece4b(0x149)][_0x2ece4b(0x1d6)])[_0x2ece4b(0x1b1)](),_0x2a41a2=_0x308767[_0x2ece4b(0x149)][_0x2ece4b(0x162)]?new Date(_0x308767[_0x2ece4b(0x149)][_0x2ece4b(0x162)])[_0x2ece4b(0x1b1)]():Date[_0x2ece4b(0x182)](),_0x19fda3=_0x308767[_0x2ece4b(0x139)]?.['name']||'(unknown)';!_0x1cdab6[_0x2ece4b(0x1a4)](_0x19fda3)&&_0x1cdab6[_0x2ece4b(0x29c)](_0x19fda3,[]),_0x1cdab6[_0x2ece4b(0x1df)](_0x19fda3)[_0x2ece4b(0x287)]({'session':_0x308767,'startTime':_0x2ad1bf,'endTime':_0x2a41a2,'duration':_0x2a41a2-_0x2ad1bf}),_0x395bbc=Math['min'](_0x395bbc,_0x2ad1bf),_0x1afc3e=Math[_0x2ece4b(0x253)](_0x1afc3e,_0x2a41a2);}}if(_0x1cdab6[_0x2ece4b(0x1e0)]===0x0)return _0x2ece4b(0x1bc);const _0x5c7a86=process[_0x2ece4b(0x1e8)][_0x2ece4b(0x2a0)]||0x78,_0x12b601=0x1e,_0x19b8ba=0x32,_0x2aedcc=0x4,_0x290142=Math[_0x2ece4b(0x277)](_0x19b8ba,Math[_0x2ece4b(0x253)](_0x12b601,Math[_0x2ece4b(0x25d)](_0x5c7a86*0.3))),_0x46a5ac=_0x5c7a86-_0x290142-TIMELINE_CONFIG[_0x2ece4b(0x26a)]-0x3-_0x2aedcc,_0x2a3050=_0x1afc3e-_0x395bbc,_0xd13e09=_0x2a3050/_0x290142,_0x3e29de=renderTimeAxis({'startTime':_0x395bbc,'endTime':_0x1afc3e,'durationMs':_0x2a3050,'msPerChar':_0xd13e09},_0x290142),_0x5a1549=[];for(const _0x2ee39a of _0x1cdab6['values']()){_0x5a1549['push'](..._0x2ee39a);}_0x5a1549[_0x2ece4b(0x232)]((_0xd6a6db,_0x1a43b0)=>_0x1a43b0[_0x2ece4b(0x2ad)]-_0xd6a6db[_0x2ece4b(0x2ad)]);const _0x497e9c=new Date(_0x395bbc),_0xe5fdb1=formatDate(_0x497e9c),_0x48400c=_0x2aedcc+TIMELINE_CONFIG['ICON_WIDTH']+TIMELINE_CONFIG[_0x2ece4b(0x2bc)]+_0x46a5ac,_0x59670b='\x20'['repeat'](_0x48400c-_0xe5fdb1['length']),_0x39b2a8=_0x59670b+a42_0x917536[_0x2ece4b(0x199)](_0xe5fdb1)+'\x20'+_0x3e29de;_0x5b80ff[_0x2ece4b(0x287)](_0x39b2a8);const _0x2e9f0d=0x16;let _0x66a84f=0x0;for(const _0xf3092f of _0x5a1549){const _0x47a40a=_0xf3092f[_0x2ece4b(0x13f)][_0x2ece4b(0x139)]?.['name']||'?',_0x31a991=Math[_0x2ece4b(0x277)](stringWidth(_0x47a40a),_0x2e9f0d);_0x66a84f=Math[_0x2ece4b(0x253)](_0x66a84f,_0x31a991);}for(const _0xcc2323 of _0x5a1549){const {session:_0x574962,startTime:_0x3ebf2c,endTime:_0x1380e6,duration:_0x168bfb}=_0xcc2323,_0x1ac4cc=_0x574962[_0x2ece4b(0x139)]?.['id'],_0x4629de=_0x574962['id'],_0x49d30b=_0x574962[_0x2ece4b(0x139)]?.[_0x2ece4b(0x2c8)]||'?',_0x12de30=_0x574962[_0x2ece4b(0x2b5)]?.[_0x2ece4b(0x2c8)]||'?';let _0x3394f4,_0x53aa58;if(_0x574962['lastAttempt']){const _0x3b7099=_0x574962[_0x2ece4b(0x149)];!_0x3b7099[_0x2ece4b(0x1a5)]?(_0x3394f4=_0x3b7099[_0x2ece4b(0x160)]?'🛑':'🔄',_0x53aa58=_0x3b7099[_0x2ece4b(0x160)]?a42_0x917536['yellow']:a42_0x917536[_0x2ece4b(0x167)]):(_0x3394f4=_0x3b7099[_0x2ece4b(0x1fc)]?'✅':'❌',_0x53aa58=_0x3b7099['success']?a42_0x917536['green']:a42_0x917536[_0x2ece4b(0x281)]);}else _0x3394f4='⏳',_0x53aa58=a42_0x917536['dim'];const _0x4d2cf4='#'+_0x4629de,_0x16144a=_0x1ac4cc?hyperlink(_0x4d2cf4,getWorkflowSessionUrl(_0x1c1719,_0x1ac4cc,_0x4629de)):_0x4d2cf4;let _0x9b712=_0x49d30b;stringWidth(_0x49d30b)>_0x2e9f0d&&(_0x9b712=_0x49d30b[_0x2ece4b(0x1c7)](0x0,_0x2e9f0d-0x1)+'…');const _0x5a1345=a42_0x917536['dim'](_0x9b712),_0x44fc97=stringWidth(_0x9b712),_0x188a39='\x20'[_0x2ece4b(0x238)](_0x66a84f-stringWidth(_0x9b712)+0x2),_0x578e16='('+formatElapsed(_0x168bfb)+')',_0x581c5f=stringWidth(_0x578e16),_0x29fffb=stringWidth(_0x4d2cf4),_0x14b7c3=_0x29fffb+0x1+_0x44fc97+_0x188a39[_0x2ece4b(0x1cd)],_0x56a91=_0x46a5ac-_0x14b7c3-_0x581c5f-0x1-0x8;let _0xf96db8=_0x12de30;stringWidth(_0xf96db8)>_0x56a91&&(_0xf96db8=_0xf96db8[_0x2ece4b(0x1c7)](0x0,_0x56a91-0x1)+'…');const _0x23bed7=_0x16144a+'\x20'+_0x5a1345+_0x188a39+_0xf96db8,_0xf7c6fa=stringWidth(_0x23bed7),_0x17a804=_0x46a5ac-_0xf7c6fa-_0x581c5f,_0xf0d5e6=_0x23bed7+'\x20'[_0x2ece4b(0x238)](Math['max'](0x1,_0x17a804))+a42_0x917536['dim'](_0x578e16),_0x179ab2=Math[_0x2ece4b(0x25d)]((_0x3ebf2c-_0x395bbc)/_0xd13e09),_0x4b79b9=Math[_0x2ece4b(0x25d)]((_0x1380e6-_0x395bbc)/_0xd13e09),_0x6d6bef=Math[_0x2ece4b(0x253)](_0x179ab2+0x1,_0x4b79b9),_0x56f471=new Array(_0x290142)[_0x2ece4b(0x2ca)]('\x20');for(let _0x10acea=_0x179ab2;_0x10acea<Math['min'](_0x6d6bef,_0x290142);_0x10acea++){_0x56f471[_0x10acea]='─';}const _0x48e2b3=_0x56f471[_0x2ece4b(0x151)](_0x50b079=>_0x50b079==='\x20'?'\x20':_0x53aa58(_0x50b079))[_0x2ece4b(0x1a0)]('');_0x5b80ff[_0x2ece4b(0x287)](_0x3394f4+'\x20'+_0xf0d5e6+'│'+_0x48e2b3+'│');}return _0x5b80ff['join']('\x0a');}async[a42_0x4b6388(0x234)](_0x4db2db,_0x52c7c2,_0x4396f6){const _0x571761=a42_0x4b6388,{options:_0x365811,tdx:_0xb087a1}=_0x52c7c2,_0x5e239c=_0x365811['site'],{timelineRows:_0xea6a09,timeAxisHeader:_0x2bf104}=this[_0x571761(0x161)](_0x4db2db,_0x5e239c),_0x4fa5e9=_0xea6a09[_0x571761(0x2cb)](_0xca0101=>_0xca0101[_0x571761(0x2aa)]);if(_0x4fa5e9['length']===0x0){const _0x30ef42=this[_0x571761(0x1b5)](_0x4db2db,_0x5e239c);console[_0x571761(0x1d4)](_0x30ef42);!_0x4396f6&&(console['error'](''),console[_0x571761(0x1b6)](a42_0x917536['dim'](_0x571761(0x1af))),console[_0x571761(0x1b6)](a42_0x917536[_0x571761(0x199)]('\x20\x20\x20tdx\x20wf\x20sessions\x20<project>\x20\x20')+'or'+a42_0x917536[_0x571761(0x199)](_0x571761(0x237))));return;}_0x2bf104&&console[_0x571761(0x1d4)](_0x2bf104);const _0x245e04=_0xea6a09['filter'](_0x525c48=>_0x525c48[_0x571761(0x2aa)])[_0x571761(0x151)](_0xfaf2ba=>({'title':_0xfaf2ba['displayLine'],'value':_0xfaf2ba[_0x571761(0x2aa)]})),_0xdbfff7=process['stdout'][_0x571761(0x14a)]||0x3c,_0x2555be=Math[_0x571761(0x253)](0x28,Math[_0x571761(0x25d)](_0xdbfff7*0x2/0x3)),_0x1310c6=await a42_0x525db1({'type':'autocomplete','name':_0x571761(0x2aa),'message':_0x571761(0x1db),'choices':_0x245e04,'initial':-0x1,'limit':_0x2555be,'clearFirst':!![],'fallback':{'title':_0x571761(0x223),'value':null},'suggest':(_0x1a583,_0x28803b)=>{const _0x369840=_0x571761;if(!_0x1a583)return Promise[_0x369840(0x250)](_0x28803b);const _0x31ac99=_0x28803b['filter'](_0x579a15=>{const _0x154f7d=_0x369840,_0x47ff94=_0x579a15;return _0x47ff94[_0x154f7d(0x29e)]['toLowerCase']()[_0x154f7d(0x246)](_0x1a583[_0x154f7d(0x1f8)]());});return Promise['resolve'](_0x31ac99);}}),_0x5557e9=()=>{const _0x2f6b8f=_0x571761;process['stdout']['write']('\x1b[1A\x1b[2K'),process['stdout'][_0x2f6b8f(0x225)](_0x2f6b8f(0x1f2)),process[_0x2f6b8f(0x1e8)][_0x2f6b8f(0x225)]('\x1b[1A\x1b[2K');},_0x4c7a6e=_0x1310c6&&_0x1310c6[_0x571761(0x2aa)]&&_0x1310c6[_0x571761(0x2aa)]!==null&&_0x1310c6[_0x571761(0x2aa)][_0x571761(0x282)]()!=='';if(!_0x4c7a6e){_0x5557e9(),console['log'](a42_0x917536[_0x571761(0x199)](_0x571761(0x260)));return;}_0x5557e9();const _0x2d5864=_0x4db2db['find'](_0x1679d3=>_0x1679d3[_0x571761(0x149)]?.['id']===_0x1310c6[_0x571761(0x2aa)]);if(_0x2d5864){const _0x535ac2=_0x2d5864['project']?.[_0x571761(0x2c8)]||'?',_0x5f4132=_0x2d5864[_0x571761(0x2b5)]?.[_0x571761(0x2c8)]||'?';console[_0x571761(0x1d4)](_0x571761(0x211)+a42_0x917536[_0x571761(0x199)](_0x535ac2)+_0x571761(0x29d)+a42_0x917536['dim'](_0x5f4132));}const _0x3f0ec1=new WorkflowTimelineCommand();await _0x3f0ec1[_0x571761(0x20c)]({'args':[],'options':{..._0x365811,'attemptId':_0x1310c6[_0x571761(0x2aa)]},'tdx':_0xb087a1});}[a42_0x4b6388(0x161)](_0x334319,_0x44a940){const _0x245511=a42_0x4b6388,_0x254f1c=new Map();for(const _0x58df16 of _0x334319){_0x58df16['id']&&_0x58df16[_0x245511(0x149)]?.['id']&&_0x254f1c[_0x245511(0x29c)](_0x58df16['id'],_0x58df16[_0x245511(0x149)]['id']);}const _0x16ff82=[];let _0x12bd48='';const _0x1301fa=this[_0x245511(0x1b5)](_0x334319,_0x44a940),_0x32f482=_0x1301fa[_0x245511(0x177)]('\x0a');for(const _0x54fd1c of _0x32f482){if(_0x54fd1c[_0x245511(0x1d0)](_0x245511(0x28f))||_0x54fd1c[_0x245511(0x293)](/^\s+\d{4}-\d{2}-\d{2}/))_0x12bd48=_0x54fd1c;else{if(_0x54fd1c[_0x245511(0x293)](/^[✅❌🔄🛑⏳]/)){const _0x2b0d62=_0x54fd1c[_0x245511(0x293)](/#(\d+)/),_0x1f6ea9=_0x2b0d62?_0x2b0d62[0x1]:null,_0x32065d=_0x1f6ea9?_0x254f1c[_0x245511(0x1df)](_0x1f6ea9)||null:null,_0x37c765=_0x334319[_0x245511(0x1c9)](_0x2d7adc=>_0x2d7adc['id']===_0x1f6ea9),_0x1d9c13=_0x37c765?.['project']?.[_0x245511(0x2c8)]||'';_0x16ff82[_0x245511(0x287)]({'displayLine':_0x54fd1c,'attemptId':_0x32065d,'projectName':_0x1d9c13});}}}return{'timelineRows':_0x16ff82,'timeAxisHeader':_0x12bd48};}}export class WorkflowAttemptsCommand extends WorkflowBaseCommand{['name']='workflow:attempts';[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x1f4);async[a42_0x4b6388(0x20c)](_0x2d97cc){const _0x1eea80=a42_0x4b6388,{options:_0x2879e2,args:_0x41bd6b,tdx:_0x2609ec}=_0x2d97cc,_0x27926c=this[_0x1eea80(0x2a5)](_0x41bd6b,_0x2879e2);if(!_0x27926c)return 0x1;const {projectName:_0x3694a0,workflowName:_0x1d529c}=_0x27926c,_0x2eae73=_0x2879e2['includeRetried'];if(_0x2879e2[_0x1eea80(0x198)]){if(_0x3694a0&&_0x1d529c)console[_0x1eea80(0x1b6)]('Filter:\x20'+_0x3694a0+'.'+_0x1d529c);else _0x3694a0&&console[_0x1eea80(0x1b6)](_0x1eea80(0x1c1)+_0x3694a0);_0x2eae73&&console[_0x1eea80(0x1b6)]('Include\x20retried:\x20yes');}const _0x4cbe27=await withSpinner(_0x1eea80(0x197),()=>_0x2609ec[_0x1eea80(0x2b5)][_0x1eea80(0x1d5)]({'projectName':_0x3694a0,'workflowName':_0x1d529c,'includeRetried':_0x2eae73,'limit':_0x2879e2['limit']}),{'verbose':_0x2879e2[_0x1eea80(0x198)]}),_0x1b6202=_0x4cbe27[_0x1eea80(0x240)],_0x2fdf7a=_0x2879e2[_0x1eea80(0x1cb)]||0x64,_0xaf6764=_0x1b6202[_0x1eea80(0x1cd)]>=_0x2fdf7a?a42_0x917536[_0x1eea80(0x199)](_0x1eea80(0x1e1)):'';console[_0x1eea80(0x1b6)](_0x1eea80(0x2c4)+_0x1b6202[_0x1eea80(0x1cd)]+_0x1eea80(0x141)+(_0x1b6202[_0x1eea80(0x1cd)]!==0x1?'s':'')+_0xaf6764);if(_0x2879e2[_0x1eea80(0x1a3)]===_0x1eea80(0x13c)||_0x2879e2[_0x1eea80(0x1a3)]===_0x1eea80(0x1dd)||_0x2879e2['format']===_0x1eea80(0x200))await handleSDKOutput(_0x1b6202,_0x2879e2);else{if(_0x1b6202[_0x1eea80(0x1cd)]===0x0){if(_0x3694a0&&_0x1d529c)console[_0x1eea80(0x1d4)](_0x1eea80(0x275)+_0x3694a0+'.'+_0x1d529c);else _0x3694a0?console[_0x1eea80(0x1d4)](_0x1eea80(0x280)+_0x3694a0):console[_0x1eea80(0x1d4)](_0x1eea80(0x196));}else{const _0x1cd5c6=_0x2879e2[_0x1eea80(0x1b0)],_0x17c399=_0x1b6202[_0x1eea80(0x151)](_0x318486=>{const _0x55c255=_0x1eea80,_0x1f335a=a42_0x917536[_0x55c255(0x199)]('#'+_0x318486['id']),_0x294fdb=_0x318486['project']?.['id'],_0x4b200f=_0x318486[_0x55c255(0x171)]||_0x318486[_0x55c255(0x22a)],_0x25eb07=_0x294fdb&&_0x4b200f?hyperlink(_0x1f335a,getWorkflowAttemptUrl(_0x1cd5c6,_0x294fdb,_0x4b200f,_0x318486['id'])):_0x1f335a,{icon:_0x260098,text:_0x3e5e1b}=getAttemptStatusDisplay(_0x318486),_0x4687fd=(_0x318486['project']?.[_0x55c255(0x2c8)]||'?')+'.'+(_0x318486[_0x55c255(0x2b5)]?.[_0x55c255(0x2c8)]||'?'),_0x239886=_0x318486['sessionTime']?a42_0x917536[_0x55c255(0x199)](_0x318486['sessionTime']):'';return(_0x25eb07+'\x20'+_0x260098+(_0x3e5e1b?'\x20'+_0x3e5e1b:'')+'\x20'+_0x4687fd+'\x20'+_0x239886)[_0x55c255(0x2b8)]();});await writeOutput(_0x17c399[_0x1eea80(0x1a0)]('\x0a'),_0x2879e2[_0x1eea80(0x1ee)],'list');}}return 0x0;}}export class WorkflowAttemptCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]='workflow:attempt';[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x1a9);async[a42_0x4b6388(0x20c)](_0x1a40ad){const _0xb79236=a42_0x4b6388,{options:_0x2584ee,args:_0x459d4d,tdx:_0x61212e}=_0x1a40ad,_0x262f60=_0x459d4d[0x0];if(!_0x262f60)return console[_0xb79236(0x1b6)]('Error:\x20Attempt\x20ID\x20is\x20required'),0x1;_0x2584ee['verbose']&&console['error'](_0xb79236(0x271)+_0x262f60);const _0x241537=await withSpinner('Getting\x20attempt\x20details...',()=>_0x61212e[_0xb79236(0x2b5)][_0xb79236(0x21d)](_0x262f60),{'verbose':_0x2584ee[_0xb79236(0x198)]}),_0x2f7e7c=_0x241537['data'];let _0x1bc44d;!_0x2f7e7c[_0xb79236(0x1a5)]?_0x1bc44d=_0x2f7e7c[_0xb79236(0x160)]?'canceling':_0xb79236(0x2c5):_0x1bc44d=_0x2f7e7c[_0xb79236(0x1fc)]?_0xb79236(0x1fc):_0xb79236(0x1b6);let _0x56e39f;if(_0x2f7e7c['createdAt']&&_0x2f7e7c['finishedAt']){const _0x2ab490=new Date(_0x2f7e7c[_0xb79236(0x1d6)])[_0xb79236(0x1b1)](),_0x300149=new Date(_0x2f7e7c['finishedAt'])[_0xb79236(0x1b1)]();_0x56e39f=Math['round']((_0x300149-_0x2ab490)/0x3e8);}const _0x4a5e7b={'attempt_id':_0x2f7e7c['id'],'status':_0x1bc44d,..._0x2f7e7c[_0xb79236(0x289)]!==undefined&&{'index':_0x2f7e7c[_0xb79236(0x289)]},..._0x2f7e7c[_0xb79236(0x139)]&&{'project':_0x2f7e7c[_0xb79236(0x139)][_0xb79236(0x2c8)]},..._0x2f7e7c[_0xb79236(0x2b5)]&&{'workflow':_0x2f7e7c['workflow'][_0xb79236(0x2c8)]},..._0x2f7e7c[_0xb79236(0x22a)]&&{'session_id':_0x2f7e7c['sessionId']},..._0x2f7e7c[_0xb79236(0x1e2)]&&{'session_time':_0x2f7e7c[_0xb79236(0x1e2)]},..._0x2f7e7c[_0xb79236(0x217)]&&{'retry_attempt':_0x2f7e7c[_0xb79236(0x217)]},..._0x56e39f!==undefined&&{'duration_sec':_0x56e39f},..._0x2f7e7c[_0xb79236(0x1d6)]&&{'created_at':_0x2f7e7c[_0xb79236(0x1d6)]},..._0x2f7e7c['finishedAt']&&{'finished_at':_0x2f7e7c['finishedAt']},...Object[_0xb79236(0x1cc)](_0x2f7e7c[_0xb79236(0x1d8)])[_0xb79236(0x1cd)]>0x0&&{'params':_0x2f7e7c['params']}};return await handleSingleObjectOutput(_0x4a5e7b,_0x2584ee),0x0;}}export class WorkflowTasksCommand extends BaseCommand{['name']=a42_0x4b6388(0x19e);[a42_0x4b6388(0x1fd)]='Show\x20tasks\x20for\x20an\x20attempt';async['execute'](_0x3f398b){const _0x5af845=a42_0x4b6388,{options:_0x2fbabb,args:_0x2b3dc2,tdx:_0x21bfc7}=_0x3f398b,_0xc31c40=_0x2b3dc2[0x0];if(!_0xc31c40)return console[_0x5af845(0x1b6)](_0x5af845(0x1a2)),0x1;const _0x34fc73=_0x2fbabb['includeSubtasks'];_0x2fbabb[_0x5af845(0x198)]&&(console[_0x5af845(0x1b6)](_0x5af845(0x271)+_0xc31c40),_0x34fc73&&console[_0x5af845(0x1b6)](_0x5af845(0x21a)));const _0xf8e76d=await withSpinner(_0x5af845(0x2a7),()=>_0x21bfc7['workflow'][_0x5af845(0x230)](_0xc31c40,_0x34fc73||![]),{'verbose':_0x2fbabb[_0x5af845(0x198)]}),_0x26a9e3=_0xf8e76d['data'];return console[_0x5af845(0x1b6)](_0x5af845(0x2c4)+_0x26a9e3[_0x5af845(0x1cd)]+_0x5af845(0x2cf)+(_0x26a9e3[_0x5af845(0x1cd)]!==0x1?'s':'')),await handleSDKOutput(_0x26a9e3,_0x2fbabb),0x0;}}export class WorkflowLogsCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x254);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x22c);async['execute'](_0x138151){const _0x2ad96a=a42_0x4b6388,{options:_0x287922,args:_0x20ffcd,tdx:_0x1a80df}=_0x138151,_0x1487ad=_0x20ffcd[0x0];let _0x5576b4=_0x20ffcd[0x1];if(!_0x1487ad)return console[_0x2ad96a(0x1b6)](_0x2ad96a(0x1a2)),0x1;_0x287922[_0x2ad96a(0x198)]&&(console[_0x2ad96a(0x1b6)](_0x2ad96a(0x271)+_0x1487ad),_0x5576b4&&console[_0x2ad96a(0x1b6)]('Task\x20name:\x20'+_0x5576b4));const _0x1f9c9=await withSpinner('Fetching\x20log\x20files...',()=>_0x1a80df['workflow']['logFiles'](_0x1487ad,_0x5576b4),{'verbose':_0x287922[_0x2ad96a(0x198)]}),_0x102bf6=_0x1f9c9[_0x2ad96a(0x240)];if(_0x102bf6[_0x2ad96a(0x1cd)]===0x0)return console[_0x2ad96a(0x1b6)](_0x2ad96a(0x264)),0x0;if(!_0x5576b4&&(_0x287922[_0x2ad96a(0x13c)]||_0x287922[_0x2ad96a(0x1a3)]))return await handleSDKOutput(_0x102bf6,_0x287922),0x0;if(!_0x5576b4){const _0x2fd41e=_0x102bf6[_0x2ad96a(0x151)](_0x420e97=>({'title':_0x420e97[_0x2ad96a(0x2c3)]+'\x20('+formatBytes(_0x420e97[_0x2ad96a(0x1e5)])+')','value':_0x420e97['taskName']})),_0x1d399b=await a42_0x525db1({'type':_0x2ad96a(0x2b6),'name':'task','message':_0x2ad96a(0x23d),'choices':_0x2fd41e});if(!_0x1d399b[_0x2ad96a(0x137)])return console[_0x2ad96a(0x1b6)]('Cancelled'),0x0;_0x5576b4=_0x1d399b[_0x2ad96a(0x137)];}const _0x668072=await withSpinner('Downloading\x20logs...',()=>_0x1a80df[_0x2ad96a(0x2b5)][_0x2ad96a(0x2b7)](_0x1487ad,_0x5576b4),{'verbose':_0x287922[_0x2ad96a(0x198)]}),_0x408594=_0x668072[_0x2ad96a(0x240)];return _0x408594?console[_0x2ad96a(0x1d4)](_0x408594):console[_0x2ad96a(0x1b6)](_0x2ad96a(0x215)),0x0;}}export class WorkflowKillCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]='workflow:kill';[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x188);async[a42_0x4b6388(0x20c)](_0x85fb03){const _0x4607a2=a42_0x4b6388,{options:_0x199322,args:_0x4b2f95,tdx:_0x319b36}=_0x85fb03,_0x1f7234=_0x4b2f95[0x0];if(!_0x1f7234)return console[_0x4607a2(0x1b6)](_0x4607a2(0x1a2)),0x1;const _0xec1d4f=_0x199322[_0x4607a2(0x15f)];_0x199322['verbose']&&(console['error']('Attempt\x20ID:\x20'+_0x1f7234),_0xec1d4f&&console[_0x4607a2(0x1b6)](_0x4607a2(0x228)+_0xec1d4f));if(!_0x199322[_0x4607a2(0x16b)]){if(!isInteractive())return console['error'](a42_0x917536[_0x4607a2(0x281)](_0x4607a2(0x236)),_0x4607a2(0x159)),console[_0x4607a2(0x1b6)](a42_0x917536[_0x4607a2(0x199)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b5f1b=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20attempt\x20'+_0x1f7234+'?');if(!_0x1b5f1b)return console[_0x4607a2(0x1b6)](a42_0x917536['yellow'](_0x4607a2(0x260))),0x1;}const _0x2f3e4b=await withSpinner('Killing\x20attempt...',()=>_0x319b36['workflow'][_0x4607a2(0x1a1)](_0x1f7234,_0xec1d4f),{'verbose':_0x199322[_0x4607a2(0x198)]}),_0x60bbdf=_0x2f3e4b[_0x4607a2(0x240)];return console[_0x4607a2(0x1b6)]('✔\x20'+_0x60bbdf),0x0;}}export class WorkflowRetryCommand extends BaseCommand{['name']='workflow:retry';['description']=a42_0x4b6388(0x1d9);async[a42_0x4b6388(0x20c)](_0x172e8d){const _0x3e4dcd=a42_0x4b6388,{options:_0x2ab10d,args:_0x174cae,tdx:_0x5c0734}=_0x172e8d,_0x28c9ca=_0x174cae[0x0];if(!_0x28c9ca)return console[_0x3e4dcd(0x1b6)]('Error:\x20Session\x20ID\x20or\x20attempt\x20ID\x20is\x20required'),console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x1ae)),0x1;let _0x5b9025=![],_0x4c6565=_0x28c9ca;if(_0x28c9ca[_0x3e4dcd(0x1d0)]('session:'))_0x5b9025=!![],_0x4c6565=_0x28c9ca[_0x3e4dcd(0x268)](0x8);else{if(_0x28c9ca['startsWith'](_0x3e4dcd(0x269)))_0x5b9025=![],_0x4c6565=_0x28c9ca[_0x3e4dcd(0x268)](0x8);else return console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x1f3)),console['error'](_0x3e4dcd(0x1ae)),0x1;}const _0x5ad62a=_0x2ab10d[_0x3e4dcd(0x2ab)],_0x302b57=_0x2ab10d['resumeFrom'],_0x3e38ce=_0x2ab10d[_0x3e4dcd(0x1d8)],_0x1fd6f6=_0x2ab10d[_0x3e4dcd(0x194)];_0x2ab10d[_0x3e4dcd(0x198)]&&(console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x13d)+(_0x5b9025?'session':'attempt')+'\x20'+_0x4c6565),_0x5ad62a&&console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x193)+_0x5ad62a),_0x302b57&&console[_0x3e4dcd(0x1b6)]('Resume\x20from:\x20'+_0x302b57),_0x3e38ce&&console['error'](_0x3e4dcd(0x24b)+_0x3e38ce),_0x1fd6f6&&console[_0x3e4dcd(0x1b6)]('Force:\x20yes'));let _0x580968;if(_0x3e38ce)try{if(_0x3e38ce[_0x3e4dcd(0x1d0)]('@')){const _0x554265=await import(_0x3e4dcd(0x2c2)),_0x23a547=_0x3e38ce[_0x3e4dcd(0x268)](0x1),_0x3b26f1=await _0x554265[_0x3e4dcd(0x231)](_0x23a547,_0x3e4dcd(0x26b));_0x580968=JSON[_0x3e4dcd(0x218)](_0x3b26f1);}else _0x580968=JSON[_0x3e4dcd(0x218)](_0x3e38ce);}catch{return console[_0x3e4dcd(0x1b6)]('Error:\x20Invalid\x20JSON\x20in\x20--params'),0x1;}if(!_0x2ab10d['yes']){if(!isInteractive())return console['error'](a42_0x917536[_0x3e4dcd(0x281)](_0x3e4dcd(0x236)),_0x3e4dcd(0x159)),console[_0x3e4dcd(0x1b6)](a42_0x917536[_0x3e4dcd(0x199)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x155af6=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20retry\x20'+(_0x5b9025?_0x3e4dcd(0x13f):_0x3e4dcd(0x21d))+'\x20'+_0x4c6565+'?');if(!_0x155af6)return console[_0x3e4dcd(0x1b6)](a42_0x917536[_0x3e4dcd(0x1ed)](_0x3e4dcd(0x260))),0x1;}let _0x2aaccb;_0x5b9025?_0x2aaccb=await withSpinner(_0x3e4dcd(0x285),()=>_0x5c0734[_0x3e4dcd(0x2b5)][_0x3e4dcd(0x257)](_0x4c6565,{'fromTask':_0x5ad62a,'retryParams':_0x580968}),{'verbose':_0x2ab10d[_0x3e4dcd(0x198)]}):_0x2aaccb=await withSpinner(_0x3e4dcd(0x272),()=>_0x5c0734['workflow'][_0x3e4dcd(0x164)](_0x4c6565,{'resumeFrom':_0x302b57,'retryParams':_0x580968,'force':_0x1fd6f6}),{'verbose':_0x2ab10d[_0x3e4dcd(0x198)]});const _0x53b950=_0x2aaccb[_0x3e4dcd(0x240)];return console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x26c)),console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x20f)+_0x53b950[_0x3e4dcd(0x2aa)]),console[_0x3e4dcd(0x1b6)](_0x3e4dcd(0x209)+_0x53b950[_0x3e4dcd(0x22a)]),0x0;}}export class WorkflowRunCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]='workflow:run';[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x20e);async[a42_0x4b6388(0x20c)](_0x41fdb0){const _0x1dd58c=a42_0x4b6388,{options:_0x2b7fb9,args:_0x345aca,tdx:_0x3d6863}=_0x41fdb0;let _0xac686e=_0x345aca[0x0];if(!_0xac686e){const _0x5bce0e=this[_0x1dd58c(0x1bd)]([],_0x2b7fb9),_0x20a5ec=await withSpinner('Loading\x20workflows...',()=>_0x3d6863[_0x1dd58c(0x2b5)][_0x1dd58c(0x284)](_0x5bce0e,{'limit':_0x2b7fb9['limit']}),{'verbose':_0x2b7fb9[_0x1dd58c(0x198)]}),_0x452044=_0x20a5ec['data'];if(_0x452044[_0x1dd58c(0x1cd)]===0x0)return console[_0x1dd58c(0x1b6)](_0x1dd58c(0x17f)),!_0x5bce0e&&console[_0x1dd58c(0x1b6)](a42_0x917536[_0x1dd58c(0x199)]('Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>')),0x1;const _0x25b771=_0x452044[_0x1dd58c(0x151)](_0x122435=>({'title':_0x122435[_0x1dd58c(0x139)]?.[_0x1dd58c(0x2c8)]+'.'+_0x122435[_0x1dd58c(0x2c8)],'value':_0x122435['project']?.[_0x1dd58c(0x2c8)]+'.'+_0x122435[_0x1dd58c(0x2c8)],'description':_0x122435[_0x1dd58c(0x28a)]?'revision:\x20'+_0x122435[_0x1dd58c(0x28a)]:undefined})),_0x66b03f=await a42_0x525db1({'type':_0x1dd58c(0x2b6),'name':_0x1dd58c(0x2b5),'message':_0x1dd58c(0x2af),'choices':_0x25b771});if(!_0x66b03f[_0x1dd58c(0x2b5)])return 0x1;_0xac686e=_0x66b03f['workflow'];}if(!_0xac686e[_0x1dd58c(0x246)]('.')){const _0x28bbc3=this[_0x1dd58c(0x1bd)]([],_0x2b7fb9);if(_0x28bbc3)_0xac686e=_0x28bbc3+'.'+_0xac686e;else return console['error'](a42_0x917536[_0x1dd58c(0x281)](_0x1dd58c(0x242)),_0x1dd58c(0x17a)),console[_0x1dd58c(0x1b6)](a42_0x917536[_0x1dd58c(0x199)](_0x1dd58c(0x180))),0x1;}const _0x2b6ca4=_0x2b7fb9[_0x1dd58c(0x16a)],_0x449fcb=_0x2b7fb9[_0x1dd58c(0x1e2)],_0x3e10b4={};if(_0x2b6ca4&&Array[_0x1dd58c(0x2c6)](_0x2b6ca4))for(const _0x4dfb8b of _0x2b6ca4){const _0x1dba1f=_0x4dfb8b[_0x1dd58c(0x2bb)]('=');if(_0x1dba1f===-0x1)return console[_0x1dd58c(0x1b6)](_0x1dd58c(0x1c8)+_0x4dfb8b),console['error']('Expected\x20format:\x20--param\x20key=value'),0x1;const _0x3386ab=_0x4dfb8b['substring'](0x0,_0x1dba1f),_0x1a7621=_0x4dfb8b['substring'](_0x1dba1f+0x1);try{_0x3e10b4[_0x3386ab]=JSON[_0x1dd58c(0x218)](_0x1a7621);}catch{_0x3e10b4[_0x3386ab]=_0x1a7621;}}_0x2b7fb9[_0x1dd58c(0x198)]&&(console[_0x1dd58c(0x1b6)](_0x1dd58c(0x176)+_0xac686e),Object[_0x1dd58c(0x1cc)](_0x3e10b4)['length']>0x0&&console[_0x1dd58c(0x1b6)]('Parameters:\x20'+JSON['stringify'](_0x3e10b4)),_0x449fcb&&console['error'](_0x1dd58c(0x220)+_0x449fcb));const _0x2825d9=await withSpinner(_0x1dd58c(0x252),()=>_0x3d6863[_0x1dd58c(0x2b5)][_0x1dd58c(0x296)](_0xac686e,_0x3e10b4,{'sessionTime':_0x449fcb}),{'verbose':_0x2b7fb9[_0x1dd58c(0x198)]}),_0x4d7107=_0x2825d9[_0x1dd58c(0x240)];console['error'](_0x1dd58c(0x23c)),console[_0x1dd58c(0x1b6)](_0x1dd58c(0x2ae)+_0x4d7107['id']),console['error'](_0x1dd58c(0x209)+_0x4d7107[_0x1dd58c(0x22a)]),console['error'](_0x1dd58c(0x1a7)+_0x4d7107[_0x1dd58c(0x139)]?.['name']),console[_0x1dd58c(0x1b6)]('\x20\x20Workflow:\x20'+_0x4d7107[_0x1dd58c(0x2b5)]?.[_0x1dd58c(0x2c8)]);if(_0x4d7107[_0x1dd58c(0x139)]?.['id']&&_0x4d7107[_0x1dd58c(0x22a)]&&_0x4d7107['id']){const _0x72a7f7=_0x2b7fb9['site'],_0x601fc0=getConsoleUrl(_0x72a7f7,'/app/workflows/'+_0x4d7107['project']['id']+'/sessions/'+_0x4d7107[_0x1dd58c(0x22a)]+_0x1dd58c(0x2a8)+_0x4d7107['id']);console['error'](_0x1dd58c(0x295)+a42_0x917536[_0x1dd58c(0x202)](_0x601fc0));}return 0x0;}}export class WorkflowDownloadCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x2b0);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x1e3);async['execute'](_0x2f0cdd){const _0x3fdb2f=a42_0x4b6388,{options:_0x268a19,args:_0x221cb1,tdx:_0x2d06bb}=_0x2f0cdd,_0x47c0d3=_0x221cb1[0x0],_0x5d75db=_0x221cb1[0x1]||'.';if(!_0x47c0d3)return console[_0x3fdb2f(0x1b6)](_0x3fdb2f(0x256)),console[_0x3fdb2f(0x1b6)](_0x3fdb2f(0x19a)),0x1;const _0x19fceb=_0x268a19['revision'];_0x268a19[_0x3fdb2f(0x198)]&&(console[_0x3fdb2f(0x1b6)]('Project:\x20'+_0x47c0d3),console[_0x3fdb2f(0x1b6)](_0x3fdb2f(0x23e)+_0x5d75db),_0x19fceb&&console['error'](_0x3fdb2f(0x274)+_0x19fceb));const _0x38746d=await withSpinner(_0x3fdb2f(0x241)+_0x47c0d3+_0x3fdb2f(0x2c1),()=>_0x2d06bb[_0x3fdb2f(0x2b5)][_0x3fdb2f(0x142)](_0x47c0d3,_0x5d75db,{'revision':_0x19fceb}),{'verbose':_0x268a19[_0x3fdb2f(0x198)]}),_0x39670e=_0x38746d[_0x3fdb2f(0x240)];return console[_0x3fdb2f(0x1b6)](_0x3fdb2f(0x138)+_0x39670e[_0x3fdb2f(0x239)]),console[_0x3fdb2f(0x1b6)]('\x20\x20Revision:\x20'+_0x39670e[_0x3fdb2f(0x28a)]),console[_0x3fdb2f(0x1b6)](_0x3fdb2f(0x2b2)+_0x39670e[_0x3fdb2f(0x144)]),console[_0x3fdb2f(0x1b6)]('\x20\x20Location:\x20'+_0x5d75db+'/'+_0x39670e[_0x3fdb2f(0x239)]),0x0;}}export class WorkflowUploadCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x1a8);[a42_0x4b6388(0x1fd)]='Upload\x20workflow\x20project\x20to\x20Treasure\x20Data\x20(digdag-style)';async[a42_0x4b6388(0x20c)](_0x2fc7f2){const _0x17e908=a42_0x4b6388,{options:_0x468eeb,args:_0x287aff,tdx:_0x599bf3}=_0x2fc7f2;let _0x4909c7='.',_0x495acc=_0x468eeb['name'];if(_0x287aff[0x0]){const {promises:_0x237342}=await import('fs');try{const _0x13e3aa=await _0x237342['stat'](_0x287aff[0x0]);if(_0x13e3aa[_0x17e908(0x1e4)]())_0x4909c7=_0x287aff[0x0];else return console['error'](_0x17e908(0x25c)+_0x287aff[0x0]+_0x17e908(0x1dc)),0x1;}catch{_0x495acc=_0x287aff[0x0],_0x4909c7='.';}}const _0x598ccc=_0x468eeb['revision'],_0x1d7d3d=_0x468eeb[_0x17e908(0x1b3)];_0x468eeb[_0x17e908(0x198)]&&(console[_0x17e908(0x1b6)]('Project\x20directory:\x20'+_0x4909c7),_0x495acc&&console['error']('Project\x20name:\x20'+_0x495acc),_0x598ccc&&console[_0x17e908(0x1b6)](_0x17e908(0x274)+_0x598ccc),_0x1d7d3d&&console[_0x17e908(0x1b6)]('Validation:\x20skipped'));const _0x37f937=await withSpinner(_0x17e908(0x24c),()=>_0x599bf3['workflow']['push'](_0x4909c7,{'projectName':_0x495acc,'revision':_0x598ccc,'skipValidation':_0x1d7d3d}),{'verbose':_0x468eeb[_0x17e908(0x198)]}),_0xa40cc4=_0x37f937['data'];return console[_0x17e908(0x1b6)](_0x17e908(0x175)+_0xa40cc4['projectName']),console['error'](_0x17e908(0x183)+_0xa40cc4['projectId']),console[_0x17e908(0x1b6)](_0x17e908(0x292)+_0xa40cc4[_0x17e908(0x28a)]),await this[_0x17e908(0x15d)](_0x599bf3,_0xa40cc4[_0x17e908(0x239)],_0x468eeb[_0x17e908(0x1b0)]),0x0;}}export class WorkflowPullCommand extends BaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x1f1);[a42_0x4b6388(0x1fd)]='Pull\x20workflow\x20project\x20to\x20local\x20folder';async[a42_0x4b6388(0x20c)](_0x355531){const _0x31d91d=a42_0x4b6388,{options:_0x389ca4,args:_0x1e707d,tdx:_0x42d1be}=_0x355531,_0x489290=_0x1e707d[0x0],_0x44bbf7=_0x1e707d[0x1];if(!_0x489290)return console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x281)](_0x31d91d(0x242)),'Project\x20name\x20is\x20required'),console['error'](a42_0x917536[_0x31d91d(0x199)](_0x31d91d(0x214))),0x1;const _0x185491=_0x389ca4[_0x31d91d(0x28a)];_0x389ca4['verbose']&&(console[_0x31d91d(0x1b6)]('Project:\x20'+_0x489290),_0x44bbf7&&console[_0x31d91d(0x1b6)](_0x31d91d(0x140)+_0x44bbf7),_0x185491&&console[_0x31d91d(0x1b6)](_0x31d91d(0x274)+_0x185491),_0x389ca4['dryRun']&&console[_0x31d91d(0x1b6)]('Dry\x20run:\x20yes'));const _0x218ca4=await withSpinner('Pulling\x20project\x20'+_0x489290+_0x31d91d(0x2c1),()=>_0x42d1be['workflow'][_0x31d91d(0x219)](_0x489290,{'targetDir':_0x44bbf7,'revision':_0x185491}),{'verbose':_0x389ca4[_0x31d91d(0x198)]}),_0x1e1874=_0x218ca4[_0x31d91d(0x240)];_0x1e1874['isNewProject']?console[_0x31d91d(0x1b6)](_0x31d91d(0x17b)+_0x1e1874[_0x31d91d(0x239)]):console[_0x31d91d(0x1b6)]('→\x20Project:\x20'+_0x1e1874[_0x31d91d(0x239)]);console[_0x31d91d(0x1b6)]('\x20\x20Revision:\x20'+_0x1e1874[_0x31d91d(0x28a)]),console[_0x31d91d(0x1b6)](_0x31d91d(0x1e6)+(a42_0x2bb9e5[_0x31d91d(0x19f)](process[_0x31d91d(0x212)](),_0x1e1874[_0x31d91d(0x1ca)])||'.')),console[_0x31d91d(0x1b6)](_0x31d91d(0x178)+a42_0x917536[_0x31d91d(0x1b9)]('+'+_0x1e1874[_0x31d91d(0x157)][_0x31d91d(0x247)]+_0x31d91d(0x2be))+',\x20'+(a42_0x917536['yellow']('~'+_0x1e1874['summary'][_0x31d91d(0x273)]+_0x31d91d(0x208))+',\x20')+(a42_0x917536[_0x31d91d(0x281)]('-'+_0x1e1874['summary'][_0x31d91d(0x23a)]+_0x31d91d(0x1c6))+',\x20')+(''+a42_0x917536['dim'](_0x1e1874[_0x31d91d(0x157)][_0x31d91d(0x249)]+_0x31d91d(0x1be))));for(const _0x5ab035 of _0x1e1874[_0x31d91d(0x155)]){_0x5ab035[_0x31d91d(0x28d)]===_0x31d91d(0x273)&&_0x5ab035['diff']&&(console[_0x31d91d(0x1b6)]('\x0a'+a42_0x917536[_0x31d91d(0x202)]('---\x20'+_0x5ab035['path'])),console[_0x31d91d(0x1b6)](_0x5ab035[_0x31d91d(0x259)]));}if(!_0x1e1874[_0x31d91d(0x25b)])return saveSessionContext({'workflow_project':_0x1e1874[_0x31d91d(0x239)]},_0x389ca4[_0x31d91d(0x13f)]),console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x1b9)]('\x0a✔\x20Already\x20up\x20to\x20date')),console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x199)](_0x31d91d(0x29b)+_0x1e1874['projectName'])),0x0;if(_0x389ca4[_0x31d91d(0x169)])return console[_0x31d91d(0x1b6)](a42_0x917536['yellow'](_0x31d91d(0x210))),0x0;if(!_0x389ca4[_0x31d91d(0x16b)]){if(!isInteractive())return console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x281)](_0x31d91d(0x236)),_0x31d91d(0x159)),console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x199)](_0x31d91d(0x204))),0x1;const _0x4f7852=await confirmKey(_0x31d91d(0x28c));if(!_0x4f7852)return console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x1ed)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}await withSpinner('Writing\x20files...',()=>_0x42d1be[_0x31d91d(0x2b5)][_0x31d91d(0x2c0)](_0x1e1874,{'revision':_0x185491}),{'verbose':_0x389ca4[_0x31d91d(0x198)]}),saveSessionContext({'workflow_project':_0x1e1874[_0x31d91d(0x239)]},_0x389ca4['session']),console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x1b9)](_0x31d91d(0x203)));const _0x21765b=a42_0x2bb9e5[_0x31d91d(0x19f)](process['cwd'](),_0x1e1874[_0x31d91d(0x1ca)])||'.';return console['error'](a42_0x917536[_0x31d91d(0x199)](_0x31d91d(0x19b)+_0x21765b)),console[_0x31d91d(0x1b6)](a42_0x917536[_0x31d91d(0x199)](_0x31d91d(0x29b)+_0x1e1874[_0x31d91d(0x239)])),0x0;}}export class WorkflowPushCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x25a);[a42_0x4b6388(0x1fd)]='Push\x20local\x20workflow\x20changes\x20to\x20Treasure\x20Data';async[a42_0x4b6388(0x20c)](_0x1eb2e6){const _0x586158=a42_0x4b6388,{options:_0x1532af,args:_0x259e37,tdx:_0x3203ff}=_0x1eb2e6,_0x55f190=this['resolveProjectDir'](_0x259e37,_0x1532af),_0x1b775d=_0x1532af[_0x586158(0x28a)],_0x2884a=_0x1532af[_0x586158(0x1b3)];_0x1532af[_0x586158(0x198)]&&(_0x55f190&&console['error']('Source\x20directory:\x20'+_0x55f190),_0x1b775d&&console[_0x586158(0x1b6)](_0x586158(0x274)+_0x1b775d),_0x1532af[_0x586158(0x169)]&&console[_0x586158(0x1b6)](_0x586158(0x156)),_0x2884a&&console[_0x586158(0x1b6)](_0x586158(0x245)));let _0x307ac6;try{_0x307ac6=await withSpinner(_0x586158(0x191),()=>_0x3203ff[_0x586158(0x2b5)][_0x586158(0x187)]({'sourceDir':_0x55f190,'revision':_0x1b775d,'skipValidation':_0x2884a}),{'verbose':_0x1532af[_0x586158(0x198)]});}catch(_0xe956f3){if(_0xe956f3 instanceof Error&&_0xe956f3[_0x586158(0x14d)][_0x586158(0x246)](_0x586158(0x279)))return console[_0x586158(0x1b6)](a42_0x917536['red'](_0x586158(0x242)),_0x586158(0x145)),_0x1532af[_0x586158(0x1aa)]?console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x199)](_0x586158(0x261)+_0x1532af['workflowProject']+_0x586158(0x1b2)+_0x1532af[_0x586158(0x1aa)]+'\x27')):console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x199)](_0x586158(0x2ac))),0x1;throw _0xe956f3;}const _0x359480=_0x307ac6[_0x586158(0x240)];console['error']('✔\x20Project:\x20'+_0x359480[_0x586158(0x239)]),console[_0x586158(0x1b6)](_0x586158(0x2c7)+_0x359480['sourceDir']),console['error'](_0x586158(0x292)+_0x359480[_0x586158(0x28a)]),console['error'](_0x586158(0x178)+a42_0x917536[_0x586158(0x1b9)]('+'+_0x359480[_0x586158(0x157)][_0x586158(0x247)]+_0x586158(0x2be))+',\x20'+(a42_0x917536['yellow']('~'+_0x359480[_0x586158(0x157)]['modified']+_0x586158(0x208))+',\x20')+(a42_0x917536['red']('-'+_0x359480[_0x586158(0x157)][_0x586158(0x23a)]+_0x586158(0x1c6))+',\x20')+(''+a42_0x917536['dim'](_0x359480[_0x586158(0x157)][_0x586158(0x249)]+_0x586158(0x1be))));for(const _0x1c5365 of _0x359480['changes']){_0x1c5365['type']===_0x586158(0x273)&&_0x1c5365[_0x586158(0x259)]&&(console[_0x586158(0x1b6)]('\x0a'+a42_0x917536[_0x586158(0x202)](_0x586158(0x299)+_0x1c5365['path'])),console[_0x586158(0x1b6)](_0x1c5365[_0x586158(0x259)]));}if(!_0x359480[_0x586158(0x25b)])return console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x1b9)](_0x586158(0x186))),await this[_0x586158(0x15d)](_0x3203ff,_0x359480[_0x586158(0x239)],_0x1532af[_0x586158(0x1b0)]),0x0;if(_0x1532af['dryRun'])return console[_0x586158(0x1b6)](a42_0x917536['yellow']('\x0aDry\x20run\x20-\x20nothing\x20pushed')),0x0;if(!_0x1532af['yes']){if(!isInteractive())return console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x281)]('\x0aError:'),_0x586158(0x159)),console['error'](a42_0x917536[_0x586158(0x199)](_0x586158(0x204))),0x1;const _0x1f1ef1=await confirmKey(_0x586158(0x2a6));if(!_0x1f1ef1)return console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x1ed)](_0x586158(0x260)),_0x586158(0x1d1)),0x1;}const _0x19c383=await withSpinner('Pushing\x20project...',()=>_0x3203ff[_0x586158(0x2b5)][_0x586158(0x18b)](_0x359480),{'verbose':_0x1532af[_0x586158(0x198)]}),_0x2e5a39=_0x19c383[_0x586158(0x240)];return console[_0x586158(0x1b6)](a42_0x917536[_0x586158(0x1b9)]('✔\x20Push\x20complete')),console['error']('\x20\x20Project\x20ID:\x20'+_0x2e5a39[_0x586158(0x14b)]),console[_0x586158(0x1b6)](_0x586158(0x292)+_0x2e5a39[_0x586158(0x28a)]),await this[_0x586158(0x15d)](_0x3203ff,_0x2e5a39[_0x586158(0x239)],_0x1532af[_0x586158(0x1b0)]),0x0;}}export class WorkflowCloneCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x26e);[a42_0x4b6388(0x1fd)]='Clone\x20a\x20workflow\x20project\x20to\x20a\x20new\x20project\x20name';async[a42_0x4b6388(0x20c)](_0xcf7b31){const _0x5aa816=a42_0x4b6388,{options:_0x3a9f8f,args:_0x4af9e0,tdx:_0x182734}=_0xcf7b31,_0x305fff=this[_0x5aa816(0x265)](_0x4af9e0,_0x3a9f8f),_0xfc1e1c=_0x3a9f8f[_0x5aa816(0x2c8)],_0x21690e=_0x3a9f8f['revision'],_0xf2f6cc=_0x3a9f8f[_0x5aa816(0x1b3)];if(!_0x305fff)return console[_0x5aa816(0x1b6)](a42_0x917536['red']('Error:'),_0x5aa816(0x1ab)),console[_0x5aa816(0x1b6)](a42_0x917536[_0x5aa816(0x199)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),console['error'](a42_0x917536[_0x5aa816(0x199)](_0x5aa816(0x13a))),0x1;if(!_0xfc1e1c)return console[_0x5aa816(0x1b6)](a42_0x917536[_0x5aa816(0x281)]('Error:'),_0x5aa816(0x163)),console['error'](a42_0x917536[_0x5aa816(0x199)]('Usage:\x20tdx\x20wf\x20clone\x20<source-dir>\x20--name\x20<new-project-name>')),0x1;_0x3a9f8f[_0x5aa816(0x198)]&&(console['error'](_0x5aa816(0x2ce)+_0x305fff),console['error'](_0x5aa816(0x1d7)+_0xfc1e1c),_0x21690e&&console[_0x5aa816(0x1b6)](_0x5aa816(0x274)+_0x21690e),_0x3a9f8f['dryRun']&&console['error'](_0x5aa816(0x156)),_0xf2f6cc&&console[_0x5aa816(0x1b6)](_0x5aa816(0x245)));const _0x4623f8=await withSpinner(_0x5aa816(0x29a),()=>_0x182734[_0x5aa816(0x2b5)]['prepareCloneProject'](_0x305fff,_0xfc1e1c,{'revision':_0x21690e,'skipValidation':_0xf2f6cc}),{'verbose':_0x3a9f8f[_0x5aa816(0x198)]}),_0x483b0c=_0x4623f8[_0x5aa816(0x240)];console['error'](_0x5aa816(0x17e)+_0x483b0c[_0x5aa816(0x21f)]);_0x483b0c['sourceProjectName']&&console[_0x5aa816(0x1b6)](_0x5aa816(0x184)+_0x483b0c['sourceProjectName']);console['error']('New\x20project\x20name:\x20'+_0x483b0c[_0x5aa816(0x15e)]),console[_0x5aa816(0x1b6)](_0x5aa816(0x274)+_0x483b0c['revision']),console[_0x5aa816(0x1b6)](_0x5aa816(0x25f)+_0x483b0c[_0x5aa816(0x21c)]);_0x483b0c[_0x5aa816(0x243)]&&(console[_0x5aa816(0x1b6)](a42_0x917536[_0x5aa816(0x1ed)](_0x5aa816(0x1ea)+_0x483b0c[_0x5aa816(0x15e)]+'\x22\x20already\x20exists\x20(ID:\x20'+_0x483b0c[_0x5aa816(0x213)]+')')),console[_0x5aa816(0x1b6)](a42_0x917536['yellow']('\x20\x20This\x20will\x20create\x20a\x20new\x20revision\x20of\x20the\x20existing\x20project.')));if(_0x3a9f8f[_0x5aa816(0x169)])return console[_0x5aa816(0x1b6)](a42_0x917536[_0x5aa816(0x1ed)](_0x5aa816(0x1d3))),0x0;if(!_0x3a9f8f[_0x5aa816(0x16b)]){if(!isInteractive())return console['error'](a42_0x917536[_0x5aa816(0x281)](_0x5aa816(0x236)),_0x5aa816(0x159)),console[_0x5aa816(0x1b6)](a42_0x917536['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1b0c7a=_0x483b0c[_0x5aa816(0x17d)]||a42_0x2bb9e5['basename'](_0x305fff),_0x25eb3f=_0x483b0c[_0x5aa816(0x243)]?_0x5aa816(0x166)+_0xfc1e1c+_0x5aa816(0x1f7):_0x5aa816(0x29f)+_0x1b0c7a+'\x22\x20to\x20new\x20project\x20\x22'+_0xfc1e1c+'\x22?',_0x143bbf=await confirmKey(_0x25eb3f);if(!_0x143bbf)return console[_0x5aa816(0x1b6)](a42_0x917536['yellow'](_0x5aa816(0x260))),0x1;}const _0x4ee13a=await withSpinner(_0x483b0c[_0x5aa816(0x243)]?_0x5aa816(0x1b7)+_0xfc1e1c+_0x5aa816(0x2c1):_0x5aa816(0x16d)+_0xfc1e1c+_0x5aa816(0x2c1),()=>_0x182734[_0x5aa816(0x2b5)][_0x5aa816(0x19d)](_0x483b0c),{'verbose':_0x3a9f8f['verbose']}),_0x2446ec=_0x4ee13a[_0x5aa816(0x240)];return console[_0x5aa816(0x1b6)](a42_0x917536[_0x5aa816(0x1b9)](_0x483b0c[_0x5aa816(0x243)]?_0x5aa816(0x2cd):'✔\x20Clone\x20complete')),console[_0x5aa816(0x1b6)](_0x5aa816(0x1a7)+_0x2446ec['newProjectName']),console[_0x5aa816(0x1b6)](_0x5aa816(0x183)+_0x2446ec[_0x5aa816(0x1ce)]),console[_0x5aa816(0x1b6)](_0x5aa816(0x292)+_0x2446ec[_0x5aa816(0x28a)]),await this[_0x5aa816(0x15d)](_0x182734,_0x2446ec[_0x5aa816(0x15e)],_0x3a9f8f['site']),0x0;}}export class WorkflowDeleteCommand extends BaseCommand{['name']=a42_0x4b6388(0x1c2);['description']=a42_0x4b6388(0x2a3);async[a42_0x4b6388(0x20c)](_0x41fa61){const _0xb81759=a42_0x4b6388,{options:_0x34938a,args:_0x27ec1c,tdx:_0x237cce}=_0x41fa61,_0x1bac0b=_0x27ec1c[0x0];if(!_0x1bac0b)return console[_0xb81759(0x1b6)](_0xb81759(0x227)),console[_0xb81759(0x1b6)](_0xb81759(0x14c)),0x1;_0x34938a[_0xb81759(0x198)]&&console['error'](_0xb81759(0x211)+_0x1bac0b);if(!_0x34938a[_0xb81759(0x16b)]){if(!isInteractive())return console[_0xb81759(0x1b6)](a42_0x917536['red'](_0xb81759(0x236)),_0xb81759(0x159)),console[_0xb81759(0x1b6)](a42_0x917536['dim'](_0xb81759(0x204))),0x1;const _0x29291f=await confirmKey('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20project\x20\x22'+_0x1bac0b+_0xb81759(0x189));if(!_0x29291f)return console[_0xb81759(0x1b6)](a42_0x917536[_0xb81759(0x1ed)]('Cancelled')),0x1;}const _0x12bc6c=await withSpinner(_0xb81759(0x17c)+_0x1bac0b+_0xb81759(0x2c1),()=>_0x237cce[_0xb81759(0x2b5)][_0xb81759(0x283)](_0x1bac0b),{'verbose':_0x34938a['verbose']}),_0x1397a9=_0x12bc6c['data'];return console[_0xb81759(0x1b6)](_0xb81759(0x190)+_0x1397a9['projectName']),console[_0xb81759(0x1b6)](_0xb81759(0x183)+_0x1397a9[_0xb81759(0x14b)]),0x0;}}export function parseKeyValue(_0x49ec86){const _0x41b9bc=a42_0x4b6388,_0xfc6544=_0x49ec86[_0x41b9bc(0x2bb)]('=');if(_0xfc6544===-0x1)throw new Error('Invalid\x20format:\x20'+_0x49ec86+'.\x20Expected\x20format:\x20KEY=VALUE');const _0x14c7c8=_0x49ec86[_0x41b9bc(0x268)](0x0,_0xfc6544),_0x17bd2a=_0x49ec86[_0x41b9bc(0x268)](_0xfc6544+0x1);if(!_0x14c7c8)throw new Error(_0x41b9bc(0x18c));return{'key':_0x14c7c8,'value':_0x17bd2a};}export class WorkflowSecretsListCommand extends WorkflowBaseCommand{['name']=a42_0x4b6388(0x2cc);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x18f);async[a42_0x4b6388(0x20c)](_0x42dfb6){const _0x479b19=a42_0x4b6388,{options:_0x3ab277,args:_0x1e34e2,tdx:_0x3509b8}=_0x42dfb6,_0xe58d67=this[_0x479b19(0x158)](_0x1e34e2,_0x3ab277);if(!_0xe58d67)return 0x1;_0x3ab277[_0x479b19(0x198)]&&console[_0x479b19(0x1b6)](_0x479b19(0x211)+_0xe58d67);const _0x5b175b=await withSpinner('Listing\x20secrets...',()=>_0x3509b8[_0x479b19(0x2b5)][_0x479b19(0x18e)](_0xe58d67),{'verbose':_0x3ab277[_0x479b19(0x198)]}),{secrets:_0x3206e7}=_0x5b175b[_0x479b19(0x240)];return console[_0x479b19(0x1b6)](_0x479b19(0x2c4)+_0x3206e7[_0x479b19(0x1cd)]+'\x20secret'+(_0x3206e7['length']!==0x1?'s':'')),await handleSDKOutput(_0x3206e7,_0x3ab277),0x0;}}export class WorkflowSecretsSetCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x1f9);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x19c);async['execute'](_0x1e11f3){const _0xa90409=a42_0x4b6388,{options:_0x572e2b,args:_0x98b9e3,tdx:_0x423c8b}=_0x1e11f3;let _0x16067c,_0x25c8a6;if(_0x98b9e3[_0xa90409(0x1cd)]>=0x2)_0x16067c=_0x98b9e3[0x0],_0x25c8a6=_0x98b9e3[0x1];else{if(_0x98b9e3[_0xa90409(0x1cd)]===0x1&&_0x572e2b['workflowProject'])_0x16067c=_0x572e2b['workflowProject'],_0x25c8a6=_0x98b9e3[0x0];else return _0x98b9e3[_0xa90409(0x1cd)]===0x1?(console['error'](_0xa90409(0x256)),console[_0xa90409(0x1b6)](_0xa90409(0x180)),0x1):(console[_0xa90409(0x1b6)](_0xa90409(0x14f)),console['error'](_0xa90409(0x266)),0x1);}let _0x279401,_0x285f3c;try{({key:_0x279401,value:_0x285f3c}=parseKeyValue(_0x25c8a6));}catch(_0x534d00){return _0x534d00 instanceof Error&&console[_0xa90409(0x1b6)](a42_0x917536['red'](_0xa90409(0x242)),_0x534d00[_0xa90409(0x14d)]),0x1;}_0x572e2b[_0xa90409(0x198)]&&(console['error'](_0xa90409(0x211)+_0x16067c),console[_0xa90409(0x1b6)]('Key:\x20'+_0x279401));const _0x221cc1=await withSpinner('Setting\x20secret...',()=>_0x423c8b[_0xa90409(0x2b5)][_0xa90409(0x1bf)](_0x16067c,_0x279401,_0x285f3c),{'verbose':_0x572e2b[_0xa90409(0x198)]}),_0x41b97a=_0x221cc1[_0xa90409(0x240)];return console[_0xa90409(0x1b6)](_0xa90409(0x2a1)+_0x41b97a[_0xa90409(0x2a9)]+'\x27\x20has\x20been\x20set\x20for\x20project\x20\x27'+_0x41b97a[_0xa90409(0x239)]+'\x27'),(_0x572e2b[_0xa90409(0x13c)]||_0x572e2b[_0xa90409(0x1dd)])&&await handleSingleObjectOutput(_0x41b97a,_0x572e2b),0x0;}}export class WorkflowSecretsDeleteCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x153);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x1ef);async[a42_0x4b6388(0x20c)](_0xd57c36){const _0x94bdc9=a42_0x4b6388,{options:_0x343b3b,args:_0x13f118,tdx:_0x3001f1}=_0xd57c36;let _0x54d4e2,_0x49b844;if(_0x13f118[_0x94bdc9(0x1cd)]>=0x2)_0x54d4e2=_0x13f118[0x0],_0x49b844=_0x13f118[0x1];else{if(_0x13f118[_0x94bdc9(0x1cd)]===0x1&&_0x343b3b[_0x94bdc9(0x1aa)])_0x54d4e2=_0x343b3b[_0x94bdc9(0x1aa)],_0x49b844=_0x13f118[0x0];else return _0x13f118[_0x94bdc9(0x1cd)]===0x1?(console[_0x94bdc9(0x1b6)](_0x94bdc9(0x256)),console[_0x94bdc9(0x1b6)](_0x94bdc9(0x180)),0x1):(console['error'](_0x94bdc9(0x1f6)),console[_0x94bdc9(0x1b6)](_0x94bdc9(0x263)),0x1);}_0x343b3b[_0x94bdc9(0x198)]&&(console[_0x94bdc9(0x1b6)]('Project:\x20'+_0x54d4e2),console['error'](_0x94bdc9(0x229)+_0x49b844));if(!_0x343b3b[_0x94bdc9(0x16b)]){if(!isInteractive())return console[_0x94bdc9(0x1b6)](a42_0x917536[_0x94bdc9(0x281)](_0x94bdc9(0x236)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x94bdc9(0x1b6)](a42_0x917536[_0x94bdc9(0x199)](_0x94bdc9(0x204))),0x1;const _0x19ed24=await confirmKey(_0x94bdc9(0x27b)+_0x49b844+_0x94bdc9(0x170)+_0x54d4e2+'\x27?');if(!_0x19ed24)return console[_0x94bdc9(0x1b6)](a42_0x917536['yellow']('Cancelled')),0x1;}const _0x2854cb=await withSpinner('Deleting\x20secret...',()=>_0x3001f1[_0x94bdc9(0x2b5)][_0x94bdc9(0x1c3)](_0x54d4e2,_0x49b844),{'verbose':_0x343b3b[_0x94bdc9(0x198)]}),_0x293475=_0x2854cb[_0x94bdc9(0x240)];return console[_0x94bdc9(0x1b6)](_0x94bdc9(0x2a1)+_0x293475['key']+'\x27\x20has\x20been\x20deleted\x20from\x20project\x20\x27'+_0x293475[_0x94bdc9(0x239)]+'\x27'),(_0x343b3b[_0x94bdc9(0x13c)]||_0x343b3b[_0x94bdc9(0x1dd)])&&await handleSingleObjectOutput(_0x293475,_0x343b3b),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(_0x1dfef7){const _0x246439=a42_0x4b6388,_0x1a2345=Math[_0x246439(0x25d)](_0x1dfef7/0x3e8),_0x3012de=Math['floor'](_0x1a2345/0x3c),_0x5567ee=Math['floor'](_0x3012de/0x3c),_0x25aa4d=Math[_0x246439(0x25d)](_0x5567ee/0x18);if(_0x25aa4d>0x0){const _0x12dd56=_0x5567ee%0x18;return _0x12dd56>0x0?_0x25aa4d+'d\x20'+_0x12dd56+'h':_0x25aa4d+'d';}else{if(_0x5567ee>0x0){const _0x1cf7c4=_0x3012de%0x3c;return _0x1cf7c4>0x0?_0x5567ee+'h\x20'+_0x1cf7c4+'m':_0x5567ee+'h';}else{if(_0x3012de>0x0){const _0x384786=_0x1a2345%0x3c;return _0x384786>0x0?_0x3012de+'m\x20'+_0x384786+'s':_0x3012de+'m';}else return _0x1a2345+'s';}}}function formatTimestamp(_0x32f183,_0x8c36d8){const _0x5a4c5a=a42_0x4b6388,_0x5a373b=new Date(_0x32f183),_0x23884a=String(_0x5a373b[_0x5a4c5a(0x221)]())[_0x5a4c5a(0x1fb)](0x2,'0'),_0x591db8=String(_0x5a373b['getMinutes']())['padStart'](0x2,'0'),_0x2176e1=_0x23884a+':'+_0x591db8,_0x31e374=_0x5a373b[_0x5a4c5a(0x2b3)]()===_0x8c36d8['getFullYear']()&&_0x5a373b[_0x5a4c5a(0x1f5)]()===_0x8c36d8[_0x5a4c5a(0x1f5)]()&&_0x5a373b['getDate']()===_0x8c36d8['getDate']();if(_0x31e374)return _0x2176e1;else{const _0x33ec4f=String(_0x5a373b[_0x5a4c5a(0x1f5)]()+0x1)[_0x5a4c5a(0x1fb)](0x2,'0'),_0x534f02=String(_0x5a373b['getDate']())[_0x5a4c5a(0x1fb)](0x2,'0');return _0x33ec4f+'-'+_0x534f02+'\x20'+_0x2176e1;}}function formatDate(_0x45447c){const _0x2d2a04=a42_0x4b6388,_0x4907f9=_0x45447c[_0x2d2a04(0x2b3)](),_0x463c11=String(_0x45447c[_0x2d2a04(0x1f5)]()+0x1)['padStart'](0x2,'0'),_0x3a1bb2=String(_0x45447c[_0x2d2a04(0x22d)]())['padStart'](0x2,'0');return _0x4907f9+'-'+_0x463c11+'-'+_0x3a1bb2;}function getTaskStateIcon(_0x4db514){const _0x3dd1={'success':'✅','error':'❌','group_error':'❌','running':'🔄','blocked':'🛑','planned':'⏳','canceled':'🚫','canceling':'🛑'};return _0x3dd1[_0x4db514]||'⚪';}function getBarChar(_0x3e8fe1){const _0x1de9b3=a42_0x4b6388;return _0x3e8fe1===_0x1de9b3(0x1b6)||_0x3e8fe1===_0x1de9b3(0x24f)?'×':'─';}function getBarColor(_0x323505){const _0x22c1a6=a42_0x4b6388,_0x34eedd={'success':a42_0x917536['green'],'error':a42_0x917536[_0x22c1a6(0x281)],'group_error':a42_0x917536[_0x22c1a6(0x281)],'running':a42_0x917536['blue'],'blocked':a42_0x917536[_0x22c1a6(0x1ed)],'planned':a42_0x917536[_0x22c1a6(0x199)],'canceling':a42_0x917536[_0x22c1a6(0x1ed)]};return _0x34eedd[_0x323505]||a42_0x917536['white'];}function parseTaskName(_0x24dbc0){const _0x552e53=a42_0x4b6388;let _0x4eb002=_0x24dbc0[_0x552e53(0x1eb)](/^\++/,'');const _0x235d94=_0x4eb002[_0x552e53(0x177)]('+'),_0x34b2fe=_0x235d94[_0x552e53(0x1cd)]>0x1?_0x235d94[_0x552e53(0x1cd)]-0x2:0x0,_0x1ce577=_0x235d94[_0x235d94[_0x552e53(0x1cd)]-0x1]||_0x4eb002;return{'level':_0x34b2fe,'name':'+'+_0x1ce577};}function truncateTaskName(_0xe07e4d,_0x433de0){const _0x31e31d=a42_0x4b6388,_0x43c25a=stringWidth(_0xe07e4d);if(_0x43c25a<=_0x433de0)return _0xe07e4d;let _0x5edce5=_0xe07e4d;while(stringWidth(_0x5edce5+'…')>_0x433de0&&_0x5edce5['length']>0x0){_0x5edce5=_0x5edce5[_0x31e31d(0x1c7)](0x0,-0x1);}return _0x5edce5+'…';}function calculateTimeScale(_0x33db15,_0x23fd52){const _0x24a8c3=a42_0x4b6388;return{'startTime':_0x33db15[_0x24a8c3(0x298)],'endTime':_0x33db15[_0x24a8c3(0x15b)],'durationMs':_0x33db15['duration'],'msPerChar':_0x33db15[_0x24a8c3(0x1b4)]/_0x23fd52};}function timeToPosition(_0x461c47,_0x1fc3a0,_0x362dac){const _0x3d4e2d=a42_0x4b6388,_0x38f4a0=_0x461c47-_0x1fc3a0[_0x3d4e2d(0x2ad)],_0x5f01d0=Math[_0x3d4e2d(0x25d)](_0x38f4a0/_0x1fc3a0['msPerChar']);return Math['max'](0x0,Math[_0x3d4e2d(0x277)](_0x5f01d0,_0x362dac));}function renderTimeAxis(_0x42ba61,_0x2a5a1d){const _0x2389fb=a42_0x4b6388,_0x5d5e2f=Math['min'](TIMELINE_CONFIG['MAX_LABEL_COUNT'],Math[_0x2389fb(0x253)](TIMELINE_CONFIG['MIN_LABEL_COUNT'],Math[_0x2389fb(0x25d)](_0x2a5a1d/TIMELINE_CONFIG[_0x2389fb(0x13b)]))),_0x221950=_0x42ba61['durationMs']/(_0x5d5e2f-0x1),_0x50bda3=new Date(_0x42ba61[_0x2389fb(0x2ad)]),_0x353149=[];for(let _0x137d4d=0x0;_0x137d4d<_0x5d5e2f;_0x137d4d++){const _0x9be980=_0x42ba61['startTime']+_0x137d4d*_0x221950,_0x5d2714=timeToPosition(_0x9be980,_0x42ba61,_0x2a5a1d),_0x77bb06=formatTimestamp(_0x9be980,_0x50bda3);_0x353149['push']({'pos':_0x5d2714,'text':_0x77bb06});}const _0x15755d=new Array(_0x2a5a1d)[_0x2389fb(0x2ca)]('\x20');let _0x1f4905=-0x1;for(const {pos:_0xcf05d5,text:_0x363169}of _0x353149){let _0x4e7a08=Math['max'](0x0,_0xcf05d5-Math['floor'](_0x363169[_0x2389fb(0x1cd)]/0x2));_0x4e7a08<=_0x1f4905+TIMELINE_CONFIG[_0x2389fb(0x1ad)]&&(_0x4e7a08=_0x1f4905+TIMELINE_CONFIG['LABEL_MIN_SPACING']+0x1);_0x4e7a08+_0x363169[_0x2389fb(0x1cd)]>_0x2a5a1d&&(_0x4e7a08=_0x2a5a1d-_0x363169['length']);if(_0x4e7a08>=0x0&&_0x4e7a08+_0x363169[_0x2389fb(0x1cd)]<=_0x2a5a1d&&_0x4e7a08>_0x1f4905){for(let _0xdf0b01=0x0;_0xdf0b01<_0x363169['length'];_0xdf0b01++){_0x15755d[_0x4e7a08+_0xdf0b01]=_0x363169[_0xdf0b01];}_0x1f4905=_0x4e7a08+_0x363169[_0x2389fb(0x1cd)]-0x1;}}return _0x15755d[_0x2389fb(0x1a0)]('');}function renderTaskRow(_0x2b8ebb,_0x319581,_0x220cc9,_0x4045cc){const _0x1caff3=a42_0x4b6388,{level:_0x421fcd,name:_0x49aa93}=parseTaskName(_0x2b8ebb[_0x1caff3(0x2c8)]),_0x1cbf73='\x20'[_0x1caff3(0x238)](_0x421fcd),_0x90e6a4=_0x2b8ebb[_0x1caff3(0x1a6)]?'('+formatElapsed(_0x2b8ebb['window'][_0x1caff3(0x1b4)])+')':'',_0x2fd68f=stringWidth(_0x90e6a4),_0x398f0d=_0x421fcd*0x1,_0x15b266=_0x4045cc-_0x398f0d-_0x2fd68f-0x1,_0x333ace=truncateTaskName(_0x49aa93,_0x15b266),_0x3f8934=_0x1cbf73+_0x333ace,_0x69d654=stringWidth(_0x3f8934),_0x1c9237=_0x4045cc-_0x69d654-_0x2fd68f,_0x3f2bf0=_0x3f8934+'\x20'[_0x1caff3(0x238)](Math[_0x1caff3(0x253)](0x1,_0x1c9237))+a42_0x917536[_0x1caff3(0x199)](_0x90e6a4),_0x4e4b9e=getTaskStateIcon(_0x2b8ebb[_0x1caff3(0x205)]),_0x53763d=new Array(_0x220cc9)['fill']('\x20');if(_0x2b8ebb['window']){const _0x504cec=timeToPosition(_0x2b8ebb[_0x1caff3(0x1a6)]['start'],_0x319581,_0x220cc9),_0x2c2a7b=timeToPosition(_0x2b8ebb['window']['end'],_0x319581,_0x220cc9),_0x21d3d5=getBarChar(_0x2b8ebb[_0x1caff3(0x205)]),_0x2116ab=Math[_0x1caff3(0x253)](_0x504cec+0x1,_0x2c2a7b);for(let _0x5e2fab=_0x504cec;_0x5e2fab<Math[_0x1caff3(0x277)](_0x2116ab,_0x220cc9);_0x5e2fab++){_0x53763d[_0x5e2fab]=_0x21d3d5;}}const _0x292ab2=getBarColor(_0x2b8ebb[_0x1caff3(0x205)]),_0x1ffc95=_0x53763d['map'](_0x5b028c=>_0x5b028c==='\x20'?'\x20':_0x292ab2(_0x5b028c))[_0x1caff3(0x1a0)]('');return _0x4e4b9e+'\x20'+_0x3f2bf0+'│'+_0x1ffc95+'│';}function calculateStats(_0x163383){const _0x76e847=a42_0x4b6388,_0xe52ddb={'total':_0x163383[_0x76e847(0x1cd)],'success':0x0,'error':0x0,'running':0x0,'pending':0x0};for(const _0x5486b1 of _0x163383){if(_0x5486b1[_0x76e847(0x205)]===_0x76e847(0x1fc))_0xe52ddb[_0x76e847(0x1fc)]++;else{if(_0x5486b1[_0x76e847(0x205)]===_0x76e847(0x1b6)||_0x5486b1[_0x76e847(0x205)]===_0x76e847(0x24f))_0xe52ddb[_0x76e847(0x1b6)]++;else _0x5486b1[_0x76e847(0x205)]===_0x76e847(0x2c5)?_0xe52ddb['running']++:_0xe52ddb[_0x76e847(0x276)]++;}}return _0xe52ddb;}function a42_0x2277(){const _0x4a849d=['fromTask','Run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','startTime','\x20\x20Attempt\x20ID:\x20','Select\x20a\x20workflow\x20to\x20run','workflow:download','31037316kfMMAQ','\x20\x20Files\x20extracted:\x20','getFullYear','icon','workflow','select','logs','trimEnd','ICON_WIDTH','Project\x20not\x20set.\x20Use\x20format:\x20project.workflow\x20or\x20set\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','indexOf','ICON_SPACING','clear','\x20new','\x20session','applyPullProject','...','fs/promises','taskName','✔\x20Found\x20','running','isArray','\x20\x20Source:\x20','name','\x20workflow','fill','filter','workflow:secrets:list','✔\x20Project\x20updated','Source\x20directory:\x20','\x20task','task','✔\x20Downloaded\x20','project','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20clone\x20--name\x20<new-project-name>\x20\x20#\x20Use\x20session\x20context','LABEL_WIDTH_DIVISOR','json','Target:\x20','Warning:','session','Target\x20directory:\x20','\x20attempt','download','\x20(system)','filesExtracted','No\x20tdx.json\x20found\x20in\x20current\x20directory\x20or\x20parents','Both\x20--attempt-id\x20and\x20--session-id\x20provided,\x20using\x20--attempt-id','startedAt','Session\x20not\x20found:\x20','lastAttempt','rows','projectId','Usage:\x20workflow:delete\x20<project-name-or-id>','message','localeCompare','Error:\x20KEY=VALUE\x20is\x20required','Show\x20task\x20execution\x20timeline\x20for\x20a\x20workflow\x20attempt','map','💡\x20Tip:\x20Use\x20','workflow:secrets:delete','canceling','changes','Dry\x20run:\x20yes','summary','requireProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20tasks','end','status','showWorkflowConsoleUrl','newProjectName','reason','cancelRequested','generateSessionTimelineRows','finishedAt','--name\x20is\x20required\x20to\x20specify\x20the\x20new\x20project\x20name','retryAttempt','Resolving\x20project\x20\x27','\x0aUpdate\x20existing\x20project\x20\x22','blue','fullName','dryRun','param','yes','sessions','Cloning\x20to\x20','4150408aNjvFg','updatedAt','\x27\x20from\x20project\x20\x27','session_id','toISOString','List\x20workflow\x20execution\x20sessions','Loading\x20session...','✔\x20Pushed\x20','Workflow:\x20','split','\x20\x20Changes:\x20','Set\x20default\x20workflow\x20project\x20for\x20this\x20session','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','→\x20New\x20project:\x20','Deleting\x20project\x20','sourceProjectName','Source:\x20','No\x20workflows\x20found','Tip:\x20Set\x20a\x20default\x20project\x20with:\x20tdx\x20wf\x20use\x20<project>','projects','now','\x20\x20Project\x20ID:\x20','Source\x20project:\x20','180HxETuO','\x0a✔\x20No\x20changes\x20to\x20push','preparePushProject','Kill\x20a\x20running\x20attempt','\x22?\x20This\x20cannot\x20be\x20undone.','s\x20elapsed,\x20Ctrl+C\x20to\x20exit)','executePushProject','Key\x20cannot\x20be\x20empty','workflow:timeline','listSecrets','List\x20secret\x20keys\x20for\x20a\x20workflow\x20project','✔\x20Deleted\x20project\x20','Analyzing\x20changes...','2YXXmmL','From\x20task:\x20','force','✔\x20Showing\x20','No\x20attempts\x20found','Listing\x20workflow\x20attempts...','verbose','dim','Usage:\x20workflow:download\x20<project-name>\x20[output-dir]','\x20\x20Location:\x20','Set\x20a\x20secret\x20for\x20a\x20workflow\x20project','executeCloneProject','workflow:tasks','relative','join','kill','Error:\x20Attempt\x20ID\x20is\x20required','format','has','done','window','\x20\x20Project:\x20','workflow:upload','Show\x20specific\x20attempt\x20details','workflowProject','Source\x20directory\x20is\x20required','133668xGVuwX','LABEL_MIN_SPACING','Usage:\x20workflow\x20retry\x20session:<id>\x20or\x20workflow\x20retry\x20attempt:<id>','💡\x20Tip:\x20Narrow\x20down\x20results\x20by\x20specifying\x20a\x20project:','site','getTime','/\x20or\x20run\x20\x27tdx\x20wf\x20pull\x20','skipValidation','duration','renderSessionsTimeline','error','Updating\x20','\x0a✔\x20Attempt\x20complete','green','splice','follow','No\x20sessions\x20with\x20timing\x20information','resolveProject','\x20unchanged','setSecret','total','Filter:\x20project=','workflow:delete','deleteSecret','Listing\x20workflows...','TASK_NAME_WIDTH','\x20deleted','slice','Error:\x20Invalid\x20parameter\x20format:\x20','find','targetDir','limit','keys','length','newProjectId','11cCiyVL','startsWith','-\x20nothing\x20pushed','context','\x0aDry\x20run\x20-\x20no\x20project\x20created','log','attempts','createdAt','New\x20project\x20name:\x20','params','Retry\x20a\x20session\x20or\x20attempt','1110280cyCFDW','Select\x20a\x20session\x20to\x20view\x20task\x20timeline\x20(Esc\x20to\x20exit,\x20type\x20to\x20filter)','\x20is\x20not\x20a\x20directory','jsonl','No\x20sessions\x20found\x20for:\x20','get','size','\x20(use\x20--limit\x20to\x20show\x20more)','sessionTime','Download\x20workflow\x20project\x20from\x20Treasure\x20Data','isDirectory','fileSize','\x20\x20Target:\x20','\x20of\x20','stdout','Tip:\x20Run\x20a\x20workflow\x20first\x20with:\x20tdx\x20wf\x20run\x20<project>.<workflow>','\x0a⚠\x20Project\x20\x22','replace','some','yellow','output','Delete\x20a\x20secret\x20from\x20a\x20workflow\x20project','renderSingleTimeline','workflow:pull','\x1b[1A\x1b[2K','Error:\x20Target\x20must\x20be\x20prefixed\x20with\x20\x22session:\x22\x20or\x20\x22attempt:\x22','List\x20workflow\x20attempts','getMonth','Error:\x20Secret\x20key\x20is\x20required','\x22\x20with\x20new\x20revision?','toLowerCase','workflow:secrets:set','Latest\x20session\x20has\x20no\x20attempt','padStart','success','description','No\x20sessions\x20found\x20in\x20project:\x20','workflow:projects','table','\x20-\x20','cyan','✔\x20Pull\x20complete','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','state','every','resolveProjectId','\x20modified','\x20\x20Session\x20ID:\x20','Filter:\x20','Using\x20attempt\x20','execute','No\x20sessions\x20found','Start\x20a\x20workflow\x20run','\x20\x20New\x20attempt\x20ID:\x20','\x0aDry\x20run\x20-\x20no\x20files\x20written','Project:\x20','cwd','existingProjectId','Usage:\x20tdx\x20wf\x20pull\x20<project>\x20[target-dir]','No\x20log\x20content\x20found','MAX_TASKS_DISPLAY','retryAttemptName','parse','pullProject','Including\x20subtasks:\x20yes','Status:\x20','fileCount','attempt','Invalid\x20pattern.\x20Use\x20format:\x20project\x20or\x20project.workflow','sourceDir','Session\x20time:\x20','getHours','MAX_TIMELINE_WIDTH','No\x20matching\x20sessions\x20found','(use\x20--limit\x20to\x20see\x20more)','write','workflow:use','Error:\x20Project\x20name\x20or\x20ID\x20is\x20required','Reason:\x20','Key:\x20','sessionId','\x27...','Show\x20logs\x20for\x20a\x20workflow\x20attempt','getDate','POLL_INTERVAL_MS','2111085LuWuLl','tasks','readFile','sort','tdx\x20wf\x20attempt\x20','navigateSessionsInteractive','✔\x20Workflow\x20project\x20set\x20to:\x20','\x0aError:','\x20\x20tdx\x20wf\x20use\x20<project>','repeat','projectName','deleted','Last\x20successful\x20update\x20was\x20at\x20iteration\x20','✔\x20Workflow\x20run\x20started','Select\x20a\x20task\x20to\x20view\x20logs:','Output\x20directory:\x20','text','data','Downloading\x20project\x20','Error:','targetExists','No\x20workflows\x20found\x20in\x20project:\x20','Validation:\x20skipped','includes','new','isTTY','unchanged','list','Params:\x20','Pushing\x20workflow\x20project...','341562klVAbJ','16982wHqgBa','group_error','resolve','Session\x20','Starting\x20workflow\x20run...','max','workflow:logs','renderTimeline','Error:\x20Project\x20name\x20is\x20required','retrySession','\x20\x20\x20\x20\x20\x20\x20tdx\x20wf\x20use\x20--clear\x20\x20\x20\x20#\x20Clear\x20context','diff','workflow:push','hasChanges','Error:\x20','floor','Listing\x20workflow\x20sessions...','Files\x20to\x20upload:\x20','Cancelled','Tip:\x20cd\x20to\x20workflows/','No\x20workflow\x20sessions\x20found','Usage:\x20wf\x20secrets\x20delete\x20[project]\x20<key>','No\x20log\x20files\x20found\x20for\x20this\x20attempt','resolveProjectDir','Usage:\x20wf\x20secrets\x20set\x20[project]\x20KEY=VALUE','Pattern:\x20','substring','attempt:','GUTTER','utf-8','✔\x20Retry\x20started','unknown','workflow:clone','Attempt:\x20','\x20sessions\x20','Attempt\x20ID:\x20','Retrying\x20attempt...','modified','Revision:\x20','No\x20attempts\x20found\x20for:\x20','pending','min','15vxDsvN','No\x20workflow\x20tdx.json\x20found','\x20to\x20see\x20detailed\x20logs','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20secret\x20\x27','pollTimeline','all','\x20has\x20no\x20attempts','buildTimelineData','No\x20attempts\x20found\x20in\x20project:\x20','red','trim','delete','workflows','Retrying\x20session...','Failed\x20to\x20fetch\x20attempt\x20data','push','1266skScwg','index','revision','planned','\x0aApply\x20these\x20changes?','type','\x0aFailed\x20to\x20fetch\x20attempt\x20data','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project\x20name\x20is\x20required','No\x20workflow\x20projects\x20found','\x20\x20Revision:\x20','match','Listing\x20workflow\x20projects...','\x20\x20Console:\x20','run','📁\x20','start','---\x20','Analyzing\x20project...','\x20\x20Session\x20context\x20set\x20to:\x20','set',',\x20Workflow:\x20','title','\x0aClone\x20\x22','columns','✔\x20Secret\x20\x27','⚠\x20Showing\x20first\x20','Delete\x20workflow\x20project\x20from\x20Treasure\x20Data','No\x20projects\x20match\x20pattern:\x20','parseProjectWorkflowPattern','\x0aPush\x20these\x20changes?','Getting\x20attempt\x20tasks...','/attempt/','key','attemptId'];a42_0x2277=function(){return _0x4a849d;};return a42_0x2277();}function formatStats(_0xe2bd40){const _0x355284=a42_0x4b6388;return['Total:\x20'+_0xe2bd40[_0x355284(0x1c0)],'✅\x20'+_0xe2bd40['success'],'❌\x20'+_0xe2bd40[_0x355284(0x1b6)],'🔄\x20'+_0xe2bd40[_0x355284(0x2c5)],'⏳\x20'+_0xe2bd40[_0x355284(0x276)]][_0x355284(0x1a0)]('\x20\x20');}function a42_0x22fd(_0xa6aa98,_0x5a336b){_0xa6aa98=_0xa6aa98-0x137;const _0x22774f=a42_0x2277();let _0x22fd54=_0x22774f[_0xa6aa98];return _0x22fd54;}export class WorkflowTimelineCommand extends WorkflowBaseCommand{[a42_0x4b6388(0x2c8)]=a42_0x4b6388(0x18d);[a42_0x4b6388(0x1fd)]=a42_0x4b6388(0x150);async[a42_0x4b6388(0x20c)](_0x508dfa){const _0x18ad49=a42_0x4b6388,{options:_0x2cb98a,args:_0xa879c0,tdx:_0xc628cc}=_0x508dfa;let _0x1fc307,_0x484f5e,_0x2150f1=![];if(_0xa879c0[0x0]){if(_0xa879c0[0x0][_0x18ad49(0x246)]('.')){const _0x2d6a4f=this[_0x18ad49(0x2a5)](_0xa879c0,_0x2cb98a);if(!_0x2d6a4f)return 0x1;_0x1fc307=_0x2d6a4f[_0x18ad49(0x239)],_0x484f5e=_0x2d6a4f['workflowName'];}else{_0x484f5e=_0xa879c0[0x0],_0x1fc307=_0x2cb98a[_0x18ad49(0x1aa)];if(!_0x1fc307)return console['error'](a42_0x917536[_0x18ad49(0x281)](_0x18ad49(0x242)),_0x18ad49(0x2ba)),0x1;_0x2150f1=!![];}}else{const _0x4430de=this[_0x18ad49(0x2a5)](_0xa879c0,_0x2cb98a);if(!_0x4430de)return 0x1;_0x1fc307=_0x4430de['projectName'],_0x484f5e=_0x4430de['workflowName'];}if(_0x2cb98a[_0x18ad49(0x198)]){if(_0x1fc307&&_0x484f5e)console['error']('Filter:\x20'+_0x1fc307+'.'+_0x484f5e);else _0x1fc307&&console[_0x18ad49(0x1b6)](_0x18ad49(0x1c1)+_0x1fc307);}const _0x3cfcf9=_0x2cb98a[_0x18ad49(0x2aa)],_0x5c3f9f=_0x2cb98a['sessionId'];if(_0x3cfcf9){_0x5c3f9f&&console[_0x18ad49(0x1b6)](a42_0x917536['yellow'](_0x18ad49(0x13e)),_0x18ad49(0x146));const _0x6920dc=_0x2cb98a['follow'];return _0x6920dc?await this['pollTimeline'](_0x508dfa,_0x3cfcf9):await this[_0x18ad49(0x1f0)](_0x508dfa,_0x3cfcf9,_0x2cb98a),0x0;}if(_0x5c3f9f){const _0x30f99e=await withSpinner(_0x18ad49(0x174),()=>_0xc628cc['workflow'][_0x18ad49(0x16c)]({'projectName':_0x1fc307,'workflowName':_0x484f5e,'limit':0x64}),{'verbose':_0x2cb98a['verbose']}),_0x353dbd=_0x30f99e[_0x18ad49(0x240)]['find'](_0x3c7efa=>_0x3c7efa['id']===_0x5c3f9f);if(!_0x353dbd)return console[_0x18ad49(0x1b6)](a42_0x917536[_0x18ad49(0x281)](_0x18ad49(0x242)),_0x18ad49(0x148)+_0x5c3f9f),0x1;if(!_0x353dbd[_0x18ad49(0x149)]?.['id'])return console['error'](a42_0x917536[_0x18ad49(0x281)]('Error:'),_0x18ad49(0x251)+_0x5c3f9f+_0x18ad49(0x27e)),0x1;const _0x541369=_0x353dbd[_0x18ad49(0x149)]['id'];_0x2cb98a[_0x18ad49(0x198)]&&console[_0x18ad49(0x1b6)](_0x18ad49(0x20b)+_0x541369+'\x20from\x20session\x20'+_0x5c3f9f);const _0x5536af=_0x2cb98a['follow'];return _0x5536af?await this[_0x18ad49(0x27c)](_0x508dfa,_0x541369):await this[_0x18ad49(0x1f0)](_0x508dfa,_0x541369,_0x2cb98a),0x0;}const _0x4bf519=await withSpinner('Loading\x20sessions...',()=>_0xc628cc[_0x18ad49(0x2b5)][_0x18ad49(0x16c)]({'projectName':_0x1fc307,'workflowName':_0x484f5e,'limit':_0x2cb98a[_0x18ad49(0x1cb)]||0x32}),{'verbose':_0x2cb98a[_0x18ad49(0x198)]}),_0xa0dfd1=_0x4bf519[_0x18ad49(0x240)];if(_0xa0dfd1[_0x18ad49(0x1cd)]===0x0){if(_0x1fc307&&_0x484f5e)console[_0x18ad49(0x1b6)](_0x18ad49(0x1de)+_0x1fc307+'.'+_0x484f5e);else _0x1fc307?console[_0x18ad49(0x1b6)](_0x18ad49(0x1fe)+_0x1fc307):(console[_0x18ad49(0x1b6)](_0x18ad49(0x262)),console[_0x18ad49(0x1b6)](a42_0x917536[_0x18ad49(0x199)](_0x18ad49(0x1e9))));return 0x0;}_0xa0dfd1[_0x18ad49(0x232)]((_0xbf62ca,_0x204dc3)=>{const _0x3631ad=_0x18ad49,_0x461b33=_0xbf62ca[_0x3631ad(0x1e2)]||'',_0x35fd93=_0x204dc3['sessionTime']||'';return _0x35fd93[_0x3631ad(0x14e)](_0x461b33);});if(_0x2cb98a['json']||_0x2cb98a['jsonl'])return await handleSDKOutput(_0xa0dfd1,_0x2cb98a),0x0;let _0x43b334;if(_0x2150f1){const _0x41bf08=_0xa0dfd1[0x0];if(!_0x41bf08[_0x18ad49(0x149)]?.['id'])return console['error'](_0x18ad49(0x1fa)),0x0;_0x43b334=_0x41bf08[_0x18ad49(0x149)]['id'],_0x2cb98a[_0x18ad49(0x198)]&&console[_0x18ad49(0x1b6)]('Auto-selected\x20latest\x20session:\x20'+_0x41bf08[_0x18ad49(0x1e2)]);}else{const _0x55a4c0=_0xa0dfd1[_0x18ad49(0x151)](_0x396a52=>{const _0x5c2cd6=_0x18ad49,_0x48095f=getAttemptStatusDisplay(_0x396a52[_0x5c2cd6(0x149)]);return{'title':_0x396a52[_0x5c2cd6(0x139)]?.[_0x5c2cd6(0x2c8)]+'.'+_0x396a52[_0x5c2cd6(0x2b5)]?.[_0x5c2cd6(0x2c8)]+_0x5c2cd6(0x201)+_0x396a52[_0x5c2cd6(0x1e2)]+'\x20'+_0x48095f[_0x5c2cd6(0x2b4)],'value':_0x396a52[_0x5c2cd6(0x149)]?.['id']||'','description':_0x48095f[_0x5c2cd6(0x23f)]};}),_0x1dfff5=await a42_0x525db1({'type':'select','name':_0x18ad49(0x2aa),'message':'Select\x20a\x20session\x20to\x20view\x20timeline:','choices':_0x55a4c0[_0x18ad49(0x2cb)](_0x5cb1be=>_0x5cb1be['value']!=='')});if(!_0x1dfff5[_0x18ad49(0x2aa)])return 0x0;_0x43b334=_0x1dfff5[_0x18ad49(0x2aa)];}const _0x4005fe=_0x2cb98a[_0x18ad49(0x1bb)];return _0x4005fe?await this[_0x18ad49(0x27c)](_0x508dfa,_0x43b334):await this[_0x18ad49(0x1f0)](_0x508dfa,_0x43b334,_0x2cb98a),0x0;}async[a42_0x4b6388(0x1f0)](_0x2fbb0b,_0xd5a289,_0x8d2de){const _0x39bfb2=a42_0x4b6388,{tdx:_0x49aaac}=_0x2fbb0b;let _0x2f2dfc,_0x143495;try{[_0x2f2dfc,_0x143495]=await Promise[_0x39bfb2(0x27d)]([_0x49aaac['workflow'][_0x39bfb2(0x21d)](_0xd5a289),_0x49aaac[_0x39bfb2(0x2b5)][_0x39bfb2(0x230)](_0xd5a289,![])]);}catch(_0x553585){console['error'](a42_0x917536[_0x39bfb2(0x281)](_0x39bfb2(0x286)));_0x8d2de[_0x39bfb2(0x198)]&&console[_0x39bfb2(0x1b6)](_0x553585);throw _0x553585;}if(_0x8d2de[_0x39bfb2(0x13c)]||_0x8d2de['jsonl']){const _0x42d597=this[_0x39bfb2(0x27f)](_0x2f2dfc,_0x143495);await handleSDKOutput([_0x42d597],_0x8d2de);return;}const _0x38b692=_0x49aaac[_0x39bfb2(0x1d2)]['site'],_0x3da527=this[_0x39bfb2(0x255)](_0x2f2dfc,_0x143495,_0x38b692);console[_0x39bfb2(0x1d4)](_0x3da527);}async[a42_0x4b6388(0x27c)](_0x32b77b,_0xeda831){const _0x188993=a42_0x4b6388,{tdx:_0x1e79a3}=_0x32b77b,_0x5e4181=TIMELINE_CONFIG[_0x188993(0x22e)],_0x111acd=TIMELINE_CONFIG['MAX_POLL_ITERATIONS'];let _0x113f10=0x0;while(_0x113f10<_0x111acd){process[_0x188993(0x1e8)][_0x188993(0x248)]&&process[_0x188993(0x1e8)][_0x188993(0x225)]('\x1bc');let _0x1b87d6,_0x41024;try{[_0x1b87d6,_0x41024]=await Promise[_0x188993(0x27d)]([_0x1e79a3[_0x188993(0x2b5)][_0x188993(0x21d)](_0xeda831),_0x1e79a3['workflow'][_0x188993(0x230)](_0xeda831,![])]);}catch(_0x16b3eb){console[_0x188993(0x1b6)](a42_0x917536[_0x188993(0x281)](_0x188993(0x28e)));_0x113f10>0x0&&console[_0x188993(0x1b6)](a42_0x917536['dim'](_0x188993(0x23b)+_0x113f10));throw _0x16b3eb;}const _0x19283f=_0x1e79a3[_0x188993(0x1d2)][_0x188993(0x1b0)],_0x37337f=this[_0x188993(0x255)](_0x1b87d6,_0x41024,_0x19283f);console[_0x188993(0x1d4)](_0x37337f);const _0x584a5b=_0x1b87d6[_0x188993(0x1a5)]&&_0x41024[_0x188993(0x206)](_0x45f125=>_0x45f125[_0x188993(0x205)]!==_0x188993(0x2c5)&&_0x45f125[_0x188993(0x205)]!=='planned');if(_0x584a5b){console[_0x188993(0x1b6)](a42_0x917536[_0x188993(0x1b9)](_0x188993(0x1b8)));break;}console[_0x188993(0x1b6)](a42_0x917536[_0x188993(0x199)]('\x0aPolling...\x20('+_0x113f10*0x2+_0x188993(0x18a))),await new Promise(_0x481b0b=>setTimeout(_0x481b0b,_0x5e4181)),_0x113f10++;}_0x113f10>=_0x111acd&&console[_0x188993(0x1b6)](a42_0x917536['yellow']('\x0a⚠\x20Maximum\x20polling\x20time\x20reached'));}[a42_0x4b6388(0x255)](_0x4a41d9,_0x4f9d4c,_0x3a7eec){const _0xee0b4c=a42_0x4b6388,_0x2b9fa4=[],_0x1e1b8c=TIMELINE_CONFIG[_0xee0b4c(0x1c5)],_0x35ab8c=0x5,_0x231018=process[_0xee0b4c(0x1e8)][_0xee0b4c(0x2a0)]||0x78,_0x516216=_0x231018-_0x1e1b8c-_0x35ab8c,_0x259421=Math[_0xee0b4c(0x253)](TIMELINE_CONFIG['MIN_TIMELINE_WIDTH'],Math['min'](_0x516216,TIMELINE_CONFIG[_0xee0b4c(0x222)])),_0x554c7a=new Date(_0x4a41d9[_0xee0b4c(0x1d6)])[_0xee0b4c(0x1b1)](),_0x157dc0=_0x4a41d9[_0xee0b4c(0x162)]?new Date(_0x4a41d9[_0xee0b4c(0x162)])[_0xee0b4c(0x1b1)]():Date[_0xee0b4c(0x182)](),_0x32cbbf={'start':_0x554c7a,'end':_0x157dc0,'duration':_0x157dc0-_0x554c7a},_0x544297=new Map(),_0x576d7f=[];for(const _0x20ceee of _0x4f9d4c){if(_0x20ceee[_0xee0b4c(0x147)]){const _0x2ba39a=new Date(_0x20ceee[_0xee0b4c(0x147)])['getTime'](),_0x3b0972=_0x20ceee['updatedAt']?new Date(_0x20ceee[_0xee0b4c(0x16f)])[_0xee0b4c(0x1b1)]():Date['now'](),_0x152358={'start':_0x2ba39a,'end':_0x3b0972,'duration':_0x3b0972-_0x2ba39a};_0x544297['set'](_0x20ceee['id'],_0x152358),_0x576d7f[_0xee0b4c(0x287)]({'name':_0x20ceee['fullName'],'state':_0x20ceee['state']||_0xee0b4c(0x26d),'window':_0x152358});}else _0x576d7f['push']({'name':_0x20ceee[_0xee0b4c(0x168)],'state':_0x20ceee[_0xee0b4c(0x205)]||_0xee0b4c(0x28b),'window':undefined});}_0x576d7f[_0xee0b4c(0x232)]((_0x38e50d,_0x5168fd)=>{const _0x522a13=_0xee0b4c;if(!_0x38e50d[_0x522a13(0x1a6)])return 0x1;if(!_0x5168fd['window'])return-0x1;return _0x38e50d[_0x522a13(0x1a6)][_0x522a13(0x298)]-_0x5168fd[_0x522a13(0x1a6)][_0x522a13(0x298)];});const _0x3875ac=_0x576d7f[_0xee0b4c(0x1cd)],_0x5c93d9=_0x3875ac>TIMELINE_CONFIG[_0xee0b4c(0x216)];_0x5c93d9&&_0x576d7f[_0xee0b4c(0x1ba)](TIMELINE_CONFIG[_0xee0b4c(0x216)]);const _0x14722e=calculateTimeScale(_0x32cbbf,_0x259421),_0x411925=_0x4a41d9[_0xee0b4c(0x1a5)]?_0x4a41d9[_0xee0b4c(0x1fc)]?a42_0x917536[_0xee0b4c(0x1b9)](_0xee0b4c(0x1fc)):a42_0x917536[_0xee0b4c(0x281)]('error'):a42_0x917536['blue'](_0xee0b4c(0x2c5)),_0x1b574c=_0x4a41d9[_0xee0b4c(0x139)]?.['id'],_0x604f1b=_0x4a41d9[_0xee0b4c(0x22a)];let _0x2cfbdc;if(_0x1b574c&&_0x604f1b){const _0x427bb7=getWorkflowAttemptUrl(_0x3a7eec,_0x1b574c,_0x604f1b,_0x4a41d9['id']);_0x2cfbdc=hyperlink(a42_0x917536[_0xee0b4c(0x199)](_0x4a41d9['id']),_0x427bb7);}else _0x2cfbdc=a42_0x917536[_0xee0b4c(0x199)](_0x4a41d9['id']);_0x2b9fa4[_0xee0b4c(0x287)](_0xee0b4c(0x26f)+_0x2cfbdc+'\x20-\x20'+_0x411925+_0xee0b4c(0x201)+formatElapsed(_0x32cbbf[_0xee0b4c(0x1b4)]));if(_0x576d7f[_0xee0b4c(0x1cd)]>0x0){const _0x15d96d=renderTimeAxis(_0x14722e,_0x259421),_0x502b35=new Date(_0x32cbbf[_0xee0b4c(0x298)]),_0x5d13d5=formatDate(_0x502b35),_0xda3901=TIMELINE_CONFIG[_0xee0b4c(0x2b9)]+TIMELINE_CONFIG[_0xee0b4c(0x2bc)]+_0x1e1b8c,_0xd8e7aa=_0x5d13d5['padStart'](_0xda3901),_0x5abccf=a42_0x917536[_0xee0b4c(0x199)](_0xd8e7aa);_0x2b9fa4[_0xee0b4c(0x287)](_0x5abccf+'\x20'+_0x15d96d);for(const _0x28ac4c of _0x576d7f){_0x2b9fa4[_0xee0b4c(0x287)](renderTaskRow(_0x28ac4c,_0x14722e,_0x259421,_0x1e1b8c));}const _0x2da20d=calculateStats(_0x576d7f);_0x2b9fa4['push'](formatStats(_0x2da20d)),_0x5c93d9&&_0x2b9fa4[_0xee0b4c(0x287)](a42_0x917536['yellow'](_0xee0b4c(0x2a2)+TIMELINE_CONFIG[_0xee0b4c(0x216)]+_0xee0b4c(0x1e7)+_0x3875ac+_0xee0b4c(0x15a))),_0x2b9fa4[_0xee0b4c(0x287)](''),_0x2b9fa4[_0xee0b4c(0x287)](a42_0x917536[_0xee0b4c(0x199)](_0xee0b4c(0x152))+(_0xee0b4c(0x233)+_0x4a41d9['id']+'\x20logs')+a42_0x917536['dim'](_0xee0b4c(0x27a)));}else _0x2b9fa4['push']('No\x20tasks\x20found\x20(attempt\x20may\x20be\x20queued)');return _0x2b9fa4[_0xee0b4c(0x1a0)]('\x0a');}[a42_0x4b6388(0x27f)](_0x17090d,_0x3cc8b0){const _0x2dd08e=a42_0x4b6388,_0x540a86=new Date(_0x17090d[_0x2dd08e(0x1d6)])[_0x2dd08e(0x1b1)](),_0x1b6cad=_0x17090d[_0x2dd08e(0x162)]?new Date(_0x17090d[_0x2dd08e(0x162)])[_0x2dd08e(0x1b1)]():Date[_0x2dd08e(0x182)](),_0x5c4278=_0x1b6cad-_0x540a86,_0x7d79a7=[];for(const _0x462a4f of _0x3cc8b0){if(_0x462a4f['startedAt']){const _0x21c5b9=new Date(_0x462a4f[_0x2dd08e(0x147)])[_0x2dd08e(0x1b1)](),_0x161d0b=_0x462a4f[_0x2dd08e(0x16f)]?new Date(_0x462a4f[_0x2dd08e(0x16f)])[_0x2dd08e(0x1b1)]():Date['now']();_0x7d79a7[_0x2dd08e(0x287)]({'name':_0x462a4f['fullName'],'state':_0x462a4f[_0x2dd08e(0x205)]||_0x2dd08e(0x26d),'window':{'start':_0x21c5b9,'end':_0x161d0b,'duration':_0x161d0b-_0x21c5b9}});}else _0x7d79a7['push']({'name':_0x462a4f['fullName'],'state':_0x462a4f[_0x2dd08e(0x205)]||_0x2dd08e(0x28b),'window':undefined});}const _0x4a9d4e=calculateStats(_0x7d79a7);return{'attempt':{'id':_0x17090d['id'],'status':_0x17090d[_0x2dd08e(0x1a5)]?_0x17090d[_0x2dd08e(0x1fc)]?_0x2dd08e(0x1fc):'error':_0x2dd08e(0x2c5),'createdAt':_0x17090d[_0x2dd08e(0x1d6)],'finishedAt':_0x17090d['finishedAt'],'duration_ms':_0x5c4278},'tasks':_0x7d79a7['map'](_0x22a817=>({'name':_0x22a817[_0x2dd08e(0x2c8)],'state':_0x22a817[_0x2dd08e(0x205)],'startedAt':_0x22a817[_0x2dd08e(0x1a6)]?new Date(_0x22a817[_0x2dd08e(0x1a6)]['start'])['toISOString']():null,'updatedAt':_0x22a817[_0x2dd08e(0x1a6)]?new Date(_0x22a817[_0x2dd08e(0x1a6)][_0x2dd08e(0x15b)])[_0x2dd08e(0x172)]():null,'duration_ms':_0x22a817[_0x2dd08e(0x1a6)]?.[_0x2dd08e(0x1b4)]||null})),'stats':_0x4a9d4e};}}
package/dist/core/auth.js CHANGED
@@ -1 +1 @@
1
- function a43_0x212a(){const _0x41147d=['6JmlQfs','195002tWDsyO','15645HnZmOE','replace','60KcAKhs','8NpxWyo','X-Trino-User','10nMcQTX','version','380838SyXLjm','entries','16178256Vdzfkf','Authorization','10424007kXqgEb','85nOcGtD',';\x20node/','tdx','5966891OtrfKh','3808575YoKGIR'];a43_0x212a=function(){return _0x41147d;};return a43_0x212a();}(function(_0x3236ca,_0xb2018b){const _0x3fbc02=a43_0x4d02,_0x447917=_0x3236ca();while(!![]){try{const _0x30b320=parseInt(_0x3fbc02(0x1e5))/0x1*(-parseInt(_0x3fbc02(0x1e4))/0x2)+parseInt(_0x3fbc02(0x1e6))/0x3*(parseInt(_0x3fbc02(0x1e8))/0x4)+-parseInt(_0x3fbc02(0x1df))/0x5*(-parseInt(_0x3fbc02(0x1ed))/0x6)+-parseInt(_0x3fbc02(0x1e2))/0x7*(parseInt(_0x3fbc02(0x1e9))/0x8)+parseInt(_0x3fbc02(0x1e3))/0x9+-parseInt(_0x3fbc02(0x1eb))/0xa*(parseInt(_0x3fbc02(0x1f1))/0xb)+parseInt(_0x3fbc02(0x1ef))/0xc;if(_0x30b320===_0xb2018b)break;else _0x447917['push'](_0x447917['shift']());}catch(_0x45a7e1){_0x447917['push'](_0x447917['shift']());}}}(a43_0x212a,0x84b55));import{platform}from'os';import{getAPIKey}from'./config.js';import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x29b58f=a43_0x4d02,_0x52b712=getVersion(),_0x23d321=platform(),_0xb16d2=process[_0x29b58f(0x1ec)][_0x29b58f(0x1e7)]('v','');return'tdx/'+_0x52b712+'\x20('+_0x23d321+_0x29b58f(0x1e0)+_0xb16d2+')';}export function getAuthHeaders(_0xf31ab4,_0x4556d4){const _0x32e0d9=a43_0x4d02,_0x19b558=getVersion(),_0x5c2608={'User-Agent':getUserAgent(),'X-TD-Client':_0x32e0d9(0x1e1),'X-TD-Client-Version':_0x19b558};return _0x4556d4&&(_0x5c2608[_0x32e0d9(0x1f0)]='TD1\x20'+_0x4556d4),_0x5c2608;}export function toHeaderRecord(_0x5de6da){const _0x57c4cb=a43_0x4d02,_0xa6b80e={};for(const [_0x554f66,_0x18a057]of Object[_0x57c4cb(0x1ee)](_0x5de6da)){_0x18a057!==undefined&&(_0xa6b80e[_0x554f66]=_0x18a057);}return _0xa6b80e;}function a43_0x4d02(_0x29c491,_0x464a8b){_0x29c491=_0x29c491-0x1df;const _0x212a34=a43_0x212a();let _0x4d0298=_0x212a34[_0x29c491];return _0x4d0298;}export function getTrinoHeaders(_0xbd6fd7,_0x34b89e){const _0x31c21f=a43_0x4d02,_0xfbd9ed=getAuthHeaders(_0xbd6fd7,_0x34b89e),_0x2b0750=toHeaderRecord(_0xfbd9ed);return delete _0x2b0750[_0x31c21f(0x1f0)],_0x34b89e&&(_0x2b0750[_0x31c21f(0x1ea)]=_0x34b89e),_0x2b0750;}export function hasAPIKey(_0x792cb){const _0x55195e=getAPIKey();return _0x55195e!==undefined&&_0x55195e['length']>0x0;}
1
+ (function(_0x3bfc54,_0x280ff2){const _0x4723fe=a43_0x6ed5,_0x18625f=_0x3bfc54();while(!![]){try{const _0x265946=-parseInt(_0x4723fe(0x90))/0x1*(parseInt(_0x4723fe(0x93))/0x2)+-parseInt(_0x4723fe(0x9b))/0x3*(-parseInt(_0x4723fe(0x91))/0x4)+parseInt(_0x4723fe(0x8c))/0x5*(parseInt(_0x4723fe(0x99))/0x6)+parseInt(_0x4723fe(0x9d))/0x7+-parseInt(_0x4723fe(0x9c))/0x8*(parseInt(_0x4723fe(0x96))/0x9)+-parseInt(_0x4723fe(0x9a))/0xa*(parseInt(_0x4723fe(0x8b))/0xb)+parseInt(_0x4723fe(0x8f))/0xc*(parseInt(_0x4723fe(0x95))/0xd);if(_0x265946===_0x280ff2)break;else _0x18625f['push'](_0x18625f['shift']());}catch(_0x4fa78e){_0x18625f['push'](_0x18625f['shift']());}}}(a43_0x92a1,0x7f0a2));import{platform}from'os';import{getAPIKey}from'./config.js';function a43_0x92a1(){const _0x38699c=['4751224mvcXiU','4819108MltJKF','length','version','11EqzkOb','915oljBOd','replace','Authorization','79812AxeHFP','1tbvvGB','4PfSUCr','tdx/','1090734FRWhMS','tdx','741UNfKHV','9XLIHlf','TD1\x20','X-Trino-User','20778zZHjeL','1174170tCXPGi','227283XToCfu'];a43_0x92a1=function(){return _0x38699c;};return a43_0x92a1();}function a43_0x6ed5(_0x5018c3,_0x8628d1){_0x5018c3=_0x5018c3-0x89;const _0x92a10=a43_0x92a1();let _0x6ed58b=_0x92a10[_0x5018c3];return _0x6ed58b;}import{getVersion}from'./version.js';export{getVersion,getBuildInfo,isDevVersion}from'./version.js';export function getUserAgent(){const _0x529100=a43_0x6ed5,_0x3749c3=getVersion(),_0x4ac82a=platform(),_0x40cb96=process[_0x529100(0x8a)][_0x529100(0x8d)]('v','');return _0x529100(0x92)+_0x3749c3+'\x20('+_0x4ac82a+';\x20node/'+_0x40cb96+')';}export function getAuthHeaders(_0x322779,_0x5a87e6){const _0x4573e9=a43_0x6ed5,_0x2a47ed=getVersion(),_0x4bde4a={'User-Agent':getUserAgent(),'X-TD-Client':_0x4573e9(0x94),'X-TD-Client-Version':_0x2a47ed};return _0x5a87e6&&(_0x4bde4a[_0x4573e9(0x8e)]=_0x4573e9(0x97)+_0x5a87e6),_0x4bde4a;}export function toHeaderRecord(_0x4666fe){const _0x42871c={};for(const [_0x390ba3,_0x5a370b]of Object['entries'](_0x4666fe)){_0x5a370b!==undefined&&(_0x42871c[_0x390ba3]=_0x5a370b);}return _0x42871c;}export function getTrinoHeaders(_0x430a09,_0x3daaa4){const _0x34846a=a43_0x6ed5,_0x3effc1=getAuthHeaders(_0x430a09,_0x3daaa4),_0x40895a=toHeaderRecord(_0x3effc1);return delete _0x40895a[_0x34846a(0x8e)],_0x3daaa4&&(_0x40895a[_0x34846a(0x98)]=_0x3daaa4),_0x40895a;}export function hasAPIKey(_0x5420f5){const _0x1536bb=a43_0x6ed5,_0xb64f89=getAPIKey();return _0xb64f89!==undefined&&_0xb64f89[_0x1536bb(0x89)]>0x0;}
@@ -1 +1 @@
1
- (function(_0x1dd258,_0x3bf123){const _0x5c3675=a44_0x56f5,_0x3c493d=_0x1dd258();while(!![]){try{const _0x36909a=-parseInt(_0x5c3675(0x140))/0x1+parseInt(_0x5c3675(0x10f))/0x2*(-parseInt(_0x5c3675(0x122))/0x3)+-parseInt(_0x5c3675(0x132))/0x4+-parseInt(_0x5c3675(0x127))/0x5+-parseInt(_0x5c3675(0x12b))/0x6+-parseInt(_0x5c3675(0x139))/0x7*(-parseInt(_0x5c3675(0x12a))/0x8)+-parseInt(_0x5c3675(0x111))/0x9*(-parseInt(_0x5c3675(0x138))/0xa);if(_0x36909a===_0x3bf123)break;else _0x3c493d['push'](_0x3c493d['shift']());}catch(_0x10b7d7){_0x3c493d['push'](_0x3c493d['shift']());}}}(a44_0x2e4d,0x43e42));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x4dfe64 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x48ac6f){const _0x2b5dd7=a44_0x56f5;return _0x48ac6f[_0x2b5dd7(0x13e)]==='json'||_0x48ac6f[_0x2b5dd7(0x13e)]==='jsonl'||_0x48ac6f['format']===_0x2b5dd7(0x13f)||_0x48ac6f[_0x2b5dd7(0x13e)]===_0x2b5dd7(0x114)||_0x48ac6f['json']===!![]||_0x48ac6f[_0x2b5dd7(0x11d)]===!![]||_0x48ac6f[_0x2b5dd7(0x13f)]===!![]||_0x48ac6f[_0x2b5dd7(0x114)]===!![];}export function parseOutputOptions(_0x3288a4){const _0x34d40f=a44_0x56f5;return{'format':_0x3288a4['format']||_0x34d40f(0x114),'output':_0x3288a4[_0x34d40f(0x12d)]||'','limit':_0x3288a4[_0x34d40f(0x130)],'color':_0x3288a4[_0x34d40f(0x106)],'noColor':_0x3288a4[_0x34d40f(0x120)]};}function convertSDKResultToQueryResult(_0xc8f08){const _0x310d09=a44_0x56f5,_0x22ee09=[];if(_0xc8f08[_0x310d09(0x137)]>0x0){const _0x380e9f=_0xc8f08[0x0];for(const [_0x151e68,_0x411e7f]of Object[_0x310d09(0x10a)](_0x380e9f)){let _0x35497e=_0x310d09(0x11e);if(typeof _0x411e7f===_0x310d09(0x112))_0x35497e=Number[_0x310d09(0x10c)](_0x411e7f)?_0x310d09(0x13c):_0x310d09(0x135);else{if(typeof _0x411e7f==='boolean')_0x35497e=_0x310d09(0x10e);else _0x411e7f===null&&(_0x35497e='varchar');}_0x22ee09[_0x310d09(0x142)]({'name':_0x151e68,'type':_0x35497e});}}return{'queryId':_0x310d09(0x10b),'columns':_0x22ee09,'data':_0xc8f08,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xc8f08[_0x310d09(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5a2015,_0x51d993){const _0x51bd0c=convertSDKResultToQueryResult(_0x5a2015);return formatQueryOutput(_0x51bd0c,_0x51d993);}function a44_0x56f5(_0xc26417,_0x1a5692){_0xc26417=_0xc26417-0x101;const _0x2e4db1=a44_0x2e4d();let _0x56f5a8=_0x2e4db1[_0xc26417];return _0x56f5a8;}export async function formatQueryOutput(_0x3166b5,_0x4c3293){const _0x5369ed=a44_0x56f5,{format:_0x155060,limit:_0x378e64,output:_0x37d38f,color:_0x176107,noColor:_0x28b362}=_0x4c3293,_0x24790b=Boolean(_0x37d38f)&&!_0x176107,_0x391700={'color':_0x176107,'noColor':_0x28b362||_0x24790b};if(_0x155060===_0x5369ed(0x114)){const _0x59b30d=shouldUseLess(_0x155060,_0x37d38f);return formatAsTable(_0x3166b5,_0x378e64,_0x59b30d,_0x391700);}else{if(_0x155060===_0x5369ed(0x123))return formatAsJSON(_0x3166b5,_0x391700);else return _0x155060===_0x5369ed(0x11d)?formatAsJSONL(_0x3166b5,_0x391700):formatQueryResult(_0x3166b5,_0x155060);}}function shouldUseLess(_0x1c0758,_0x229dca){const _0x213010=a44_0x56f5;return(_0x1c0758===_0x213010(0x114)||_0x1c0758===_0x213010(0x143))&&process['stdout'][_0x213010(0x12f)]&&!_0x229dca;}export function resolveOutputOptions(_0x2894f6){const _0x30cf6c=a44_0x56f5,_0x25aac8=resolveOutputFormat(_0x2894f6[_0x30cf6c(0x13e)],_0x2894f6[_0x30cf6c(0x12d)],_0x30cf6c(0x114));let _0x35e868=typeof _0x2894f6[_0x30cf6c(0x130)]===_0x30cf6c(0x112)?_0x2894f6[_0x30cf6c(0x130)]:parseInt(_0x2894f6['limit']||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0xcd20aa=_0x2894f6[_0x30cf6c(0x12d)]||'';return shouldUseLess(_0x25aac8,_0xcd20aa)&&(_0x35e868=Infinity),{'format':_0x25aac8,'output':_0xcd20aa,'limit':_0x35e868,'color':_0x2894f6[_0x30cf6c(0x106)],'noColor':_0x2894f6[_0x30cf6c(0x120)]};}export function writeOutput(_0x2a6d0e,_0x4d1d40,_0x4c28fb){const _0x7dccec=a44_0x56f5;return _0x4d1d40?(writeFileSync(_0x4d1d40,_0x2a6d0e),console[_0x7dccec(0x128)]('Results\x20saved\x20to\x20'+_0x4d1d40),Promise['resolve']()):shouldUseLess(_0x4c28fb||'','')?new Promise(_0x4672f4=>{const _0x4b65be=_0x7dccec,_0x30322d=spawn(_0x4b65be(0x110),[_0x4b65be(0x102)],{'stdio':['pipe',_0x4b65be(0x131),'inherit']});let _0x7898af=![];_0x30322d['on']('error',()=>{const _0x5659de=_0x4b65be;!_0x7898af&&(_0x7898af=!![],console[_0x5659de(0x136)](_0x2a6d0e),_0x4672f4());}),_0x30322d['on'](_0x4b65be(0x108),()=>{!_0x7898af&&(_0x7898af=!![],_0x4672f4());}),_0x30322d['on']('spawn',()=>{const _0x4f210c=_0x4b65be;!_0x7898af&&_0x30322d[_0x4f210c(0x124)]&&(_0x30322d[_0x4f210c(0x124)]['on'](_0x4f210c(0x128),()=>{}),_0x30322d['stdin'][_0x4f210c(0x134)](_0x2a6d0e),_0x30322d['stdin'][_0x4f210c(0x125)]());}),!_0x30322d[_0x4b65be(0x124)]&&(!_0x7898af&&(_0x7898af=!![],console[_0x4b65be(0x136)](_0x2a6d0e),_0x4672f4()));}):(console['log'](_0x2a6d0e),Promise[_0x7dccec(0x11f)]());}function a44_0x2e4d(){const _0x3ec475=['repeat','[logs]','cyan','stringify','─┴─','padEnd','jsonl','varchar','resolve','noColor','red','3iaZzaH','json','stdin','end','[query]','2298470ALztOq','error','debug','80768UKbfhO','440994ZAFzgQ','[params]','output','bold','isTTY','limit','inherit','380644zhSpUb','trim','write','double','log','length','1295870Iuwzzu','133XQddMh','No\x20data','map','bigint','join','format','tsv','227904ZvhmFo','split','push','list','max','-FXRSn','string','[rule]','stderr','color','yellow','close','forEach','entries','sdk-result','isInteger','magenta','boolean','706708RIyRIC','less','90ZIfupm','number','keys','table','─┬─','params'];a44_0x2e4d=function(){return _0x3ec475;};return a44_0x2e4d();}export async function handleSDKOutput(_0x4825d8,_0x15797b){const _0x3d6b03=a44_0x56f5,_0x582823=resolveOutputOptions(_0x15797b),_0x262834=await formatSDKOutput(_0x4825d8,_0x582823);await writeOutput(_0x262834,_0x582823['output']||undefined,_0x582823[_0x3d6b03(0x13e)]);}export async function handleQueryOutput(_0x5940d5,_0x4e90ea){const _0x1ad16a=a44_0x56f5,_0x4345fc=resolveOutputOptions(_0x4e90ea),_0x292f58=await formatQueryOutput(_0x5940d5,_0x4345fc);await writeOutput(_0x292f58,_0x4345fc['output']||undefined,_0x4345fc[_0x1ad16a(0x13e)]);}async function formatSingleObject(_0x619a51,_0x2a01d3){const _0x3286e3=a44_0x56f5,{format:_0x972417,color:_0x491f85,noColor:_0x584c9c}=_0x2a01d3,_0x5313aa={'color':_0x491f85,'noColor':_0x584c9c};if(_0x972417===_0x3286e3(0x123)){if(shouldUseColor(_0x5313aa))return colorizeJSON(_0x619a51,_0x5313aa);return JSON['stringify'](_0x619a51,null,0x2);}else{if(_0x972417===_0x3286e3(0x11d)){if(shouldUseColor(_0x5313aa))return colorizeJSONCompact(_0x619a51,_0x5313aa);return JSON[_0x3286e3(0x11a)](_0x619a51);}else{if(_0x972417==='tsv')return Object[_0x3286e3(0x10a)](_0x619a51)[_0x3286e3(0x13b)](([_0x2fce92,_0xbfd0e3])=>_0x2fce92+'\x09'+_0xbfd0e3)['join']('\x0a');else{const _0x387f0a=Object[_0x3286e3(0x10a)](_0x619a51);if(_0x387f0a[_0x3286e3(0x137)]===0x0)return _0x3286e3(0x13a);const _0x4068d1=_0x619a51['debug'],_0xf4dda4=_0x619a51['query'],_0xe57be=_0x619a51[_0x3286e3(0x116)],_0x328a60=_0x619a51['rule'],_0x2c3754=_0xf4dda4?typeof _0xf4dda4===_0x3286e3(0x103)?_0xf4dda4:JSON[_0x3286e3(0x11a)](_0xf4dda4,null,0x2):undefined,_0x5729cd=_0xe57be&&Object[_0x3286e3(0x113)](_0xe57be)['length']>0x0?JSON['stringify'](_0xe57be,null,0x2):undefined,_0x28760c=_0x328a60&&Object[_0x3286e3(0x113)](_0x328a60)[_0x3286e3(0x137)]>0x0?JSON[_0x3286e3(0x11a)](_0x328a60,null,0x2):undefined,_0x9e1c85=_0x387f0a['filter'](([_0x179a4c])=>_0x179a4c!==_0x3286e3(0x129)&&_0x179a4c!=='query'&&_0x179a4c!=='params'&&_0x179a4c!=='rule'),_0x321533=Math[_0x3286e3(0x101)](..._0x9e1c85[_0x3286e3(0x13b)](([_0x59e06a])=>_0x59e06a[_0x3286e3(0x137)])),_0x4bc800=Math['max'](..._0x9e1c85[_0x3286e3(0x13b)](([,_0x435587])=>{const _0x45ed7b=_0x3286e3;try{const _0x4e1ccb=_0x435587===null||_0x435587===undefined?'':typeof _0x435587==='object'?JSON[_0x45ed7b(0x11a)](_0x435587):String(_0x435587),_0x13c699=_0x4e1ccb[_0x45ed7b(0x141)]('\x0a');return Math[_0x45ed7b(0x101)](..._0x13c699['map'](_0x1e33d1=>_0x1e33d1['length']),0x0);}catch{return 0x0;}}),0x14),_0x27f3ee=[];_0x27f3ee['push'](colorBorder('┌─'+'─'['repeat'](_0x321533)+_0x3286e3(0x115)+'─'[_0x3286e3(0x117)](_0x4bc800)+'─┐',_0x5313aa)),_0x9e1c85['forEach'](([_0x2094c9,_0x5db99d])=>{const _0x4528a4=_0x3286e3;let _0x4073;try{_0x4073=_0x5db99d===null||_0x5db99d===undefined?'':typeof _0x5db99d==='object'?JSON[_0x4528a4(0x11a)](_0x5db99d):String(_0x5db99d);}catch{_0x4073='[Object]';}const _0x4f36bb=_0x2094c9[_0x4528a4(0x11c)](_0x321533),_0x51390=_0x4073[_0x4528a4(0x141)]('\x0a');_0x51390[_0x4528a4(0x109)]((_0x9b4cb1,_0x518c08)=>{const _0x28f679=_0x4528a4,_0x16a580=colorBorder('│',_0x5313aa);_0x518c08===0x0?_0x27f3ee['push'](_0x16a580+'\x20'+_0x4f36bb+'\x20'+_0x16a580+'\x20'+_0x9b4cb1[_0x28f679(0x11c)](_0x4bc800)+'\x20'+_0x16a580):_0x27f3ee[_0x28f679(0x142)](_0x16a580+'\x20'+'\x20'[_0x28f679(0x117)](_0x321533)+'\x20'+_0x16a580+'\x20'+_0x9b4cb1[_0x28f679(0x11c)](_0x4bc800)+'\x20'+_0x16a580);});}),_0x27f3ee[_0x3286e3(0x142)](colorBorder('└─'+'─'[_0x3286e3(0x117)](_0x321533)+_0x3286e3(0x11b)+'─'[_0x3286e3(0x117)](_0x4bc800)+'─┘',_0x5313aa));_0x2c3754&&(_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x107)][_0x3286e3(0x12e)](_0x3286e3(0x126)))),_0x27f3ee[_0x3286e3(0x142)](_0x2c3754));_0x5729cd&&(_0x27f3ee['push'](''),_0x27f3ee['push'](String(a44_0x4dfe64['blue'][_0x3286e3(0x12e)](_0x3286e3(0x12c)))),_0x27f3ee['push'](_0x5729cd));_0x28760c&&(_0x27f3ee['push'](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x10d)][_0x3286e3(0x12e)](_0x3286e3(0x104)))),_0x27f3ee[_0x3286e3(0x142)](_0x28760c));if(_0x4068d1){if(_0x4068d1[_0x3286e3(0x105)]){_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x121)][_0x3286e3(0x12e)]('[error]')));const _0x34be46=_0x4068d1[_0x3286e3(0x105)][_0x3286e3(0x141)]('\x0a');_0x34be46['forEach'](_0x4db5c4=>{const _0x257c34=_0x3286e3;_0x4db5c4[_0x257c34(0x133)]()&&_0x27f3ee[_0x257c34(0x142)](_0x4db5c4);});}if(_0x4068d1['cmdout']){_0x27f3ee[_0x3286e3(0x142)](''),_0x27f3ee[_0x3286e3(0x142)](String(a44_0x4dfe64[_0x3286e3(0x119)][_0x3286e3(0x12e)](_0x3286e3(0x118))));const _0xf3da3b=_0x4068d1['cmdout'][_0x3286e3(0x141)]('\x0a');_0xf3da3b[_0x3286e3(0x109)](_0x582b30=>{const _0x3f562e=_0x3286e3;_0x582b30[_0x3f562e(0x133)]()&&_0x27f3ee['push'](_0x582b30);});}}return _0x27f3ee[_0x3286e3(0x13d)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x2170ca,_0x3ed082){const _0x443e12=a44_0x56f5;if(_0x3ed082[_0x443e12(0x13e)]===_0x443e12(0x114)){await handleSDKOutput([_0x2170ca],_0x3ed082);return;}const _0x87681a=resolveOutputOptions(_0x3ed082),_0x18afac=await formatSingleObject(_0x2170ca,_0x87681a);await writeOutput(_0x18afac,_0x87681a[_0x443e12(0x12d)]||undefined,_0x87681a[_0x443e12(0x13e)]);}
1
+ (function(_0x338b9d,_0x2b4e88){const _0x60b60d=a44_0xb7b6,_0x49a0e0=_0x338b9d();while(!![]){try{const _0x3f2f81=parseInt(_0x60b60d(0x1bb))/0x1*(parseInt(_0x60b60d(0x18c))/0x2)+-parseInt(_0x60b60d(0x1b6))/0x3+-parseInt(_0x60b60d(0x199))/0x4+parseInt(_0x60b60d(0x1a3))/0x5+parseInt(_0x60b60d(0x183))/0x6+parseInt(_0x60b60d(0x1b7))/0x7*(-parseInt(_0x60b60d(0x19f))/0x8)+parseInt(_0x60b60d(0x196))/0x9;if(_0x3f2f81===_0x2b4e88)break;else _0x49a0e0['push'](_0x49a0e0['shift']());}catch(_0x5b977e){_0x49a0e0['push'](_0x49a0e0['shift']());}}}(a44_0x4fa5,0x70847));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'../sdk/util/format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../utils/colors.js';import a44_0x495a61 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'../sdk/util/formatters.js';export function isStructuredFormat(_0x13eef8){const _0x4084c6=a44_0xb7b6;return _0x13eef8[_0x4084c6(0x18a)]==='json'||_0x13eef8[_0x4084c6(0x18a)]===_0x4084c6(0x19c)||_0x13eef8[_0x4084c6(0x18a)]===_0x4084c6(0x1c1)||_0x13eef8[_0x4084c6(0x18a)]==='table'||_0x13eef8[_0x4084c6(0x1a9)]===!![]||_0x13eef8[_0x4084c6(0x19c)]===!![]||_0x13eef8[_0x4084c6(0x1c1)]===!![]||_0x13eef8['table']===!![];}export function parseOutputOptions(_0x44cec3){const _0x26c976=a44_0xb7b6;return{'format':_0x44cec3[_0x26c976(0x18a)]||'table','output':_0x44cec3['output']||'','limit':_0x44cec3[_0x26c976(0x19d)],'color':_0x44cec3[_0x26c976(0x19a)],'noColor':_0x44cec3[_0x26c976(0x19e)]};}function convertSDKResultToQueryResult(_0x33c74d){const _0x5cd462=a44_0xb7b6,_0x13bd58=[];if(_0x33c74d[_0x5cd462(0x1ae)]>0x0){const _0xf0132c=_0x33c74d[0x0];for(const [_0x24bcb8,_0x5dc1f7]of Object['entries'](_0xf0132c)){let _0x2ad736=_0x5cd462(0x1a0);if(typeof _0x5dc1f7===_0x5cd462(0x1ac))_0x2ad736=Number[_0x5cd462(0x198)](_0x5dc1f7)?'bigint':_0x5cd462(0x182);else{if(typeof _0x5dc1f7===_0x5cd462(0x1b3))_0x2ad736='boolean';else _0x5dc1f7===null&&(_0x2ad736=_0x5cd462(0x1a0));}_0x13bd58[_0x5cd462(0x195)]({'name':_0x24bcb8,'type':_0x2ad736});}}return{'queryId':'sdk-result','columns':_0x13bd58,'data':_0x33c74d,'stats':{'state':_0x5cd462(0x1b5),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x33c74d[_0x5cd462(0x1ae)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x68677c,_0x1cc405){const _0x77b399=convertSDKResultToQueryResult(_0x68677c);return formatQueryOutput(_0x77b399,_0x1cc405);}export async function formatQueryOutput(_0x19584d,_0x22742d){const _0x5ea4a9=a44_0xb7b6,{format:_0x4a35c4,limit:_0x12019a,output:_0x1f1dec,color:_0x5c35d4,noColor:_0x32e854}=_0x22742d,_0x2d5b68=Boolean(_0x1f1dec)&&!_0x5c35d4,_0x48d79b={'color':_0x5c35d4,'noColor':_0x32e854||_0x2d5b68};if(_0x4a35c4===_0x5ea4a9(0x1a1)){const _0x509794=shouldUseLess(_0x4a35c4,_0x1f1dec);return formatAsTable(_0x19584d,_0x12019a,_0x509794,_0x48d79b);}else{if(_0x4a35c4===_0x5ea4a9(0x1a9))return formatAsJSON(_0x19584d,_0x48d79b);else return _0x4a35c4==='jsonl'?formatAsJSONL(_0x19584d,_0x48d79b):formatQueryResult(_0x19584d,_0x4a35c4);}}function shouldUseLess(_0x98a5f8,_0x296b4c){const _0x244398=a44_0xb7b6;return(_0x98a5f8===_0x244398(0x1a1)||_0x98a5f8==='list')&&process[_0x244398(0x1a7)]['isTTY']&&!_0x296b4c;}export function resolveOutputOptions(_0x2fcdf2){const _0x3bed74=a44_0xb7b6,_0x1af69a=resolveOutputFormat(_0x2fcdf2[_0x3bed74(0x18a)],_0x2fcdf2[_0x3bed74(0x1ba)],_0x3bed74(0x1a1));let _0x185853=typeof _0x2fcdf2[_0x3bed74(0x19d)]==='number'?_0x2fcdf2[_0x3bed74(0x19d)]:parseInt(_0x2fcdf2[_0x3bed74(0x19d)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x270fbc=_0x2fcdf2['output']||'';return shouldUseLess(_0x1af69a,_0x270fbc)&&(_0x185853=Infinity),{'format':_0x1af69a,'output':_0x270fbc,'limit':_0x185853,'color':_0x2fcdf2[_0x3bed74(0x19a)],'noColor':_0x2fcdf2[_0x3bed74(0x19e)]};}export function writeOutput(_0x5e84ea,_0x3f86cb,_0x2ffa80){const _0x28c691=a44_0xb7b6;return _0x3f86cb?(writeFileSync(_0x3f86cb,_0x5e84ea),console[_0x28c691(0x1a4)]('Results\x20saved\x20to\x20'+_0x3f86cb),Promise[_0x28c691(0x1a5)]()):shouldUseLess(_0x2ffa80||'','')?new Promise(_0x5a2d86=>{const _0x30385f=_0x28c691,_0x55b2bd=spawn(_0x30385f(0x181),[_0x30385f(0x1a6)],{'stdio':[_0x30385f(0x1b8),'inherit','inherit']});let _0x47e095=![];_0x55b2bd['on']('error',()=>{const _0x280ff3=_0x30385f;!_0x47e095&&(_0x47e095=!![],console[_0x280ff3(0x19b)](_0x5e84ea),_0x5a2d86());}),_0x55b2bd['on']('close',()=>{!_0x47e095&&(_0x47e095=!![],_0x5a2d86());}),_0x55b2bd['on']('spawn',()=>{const _0x10cb04=_0x30385f;!_0x47e095&&_0x55b2bd[_0x10cb04(0x180)]&&(_0x55b2bd['stdin']['on']('error',()=>{}),_0x55b2bd[_0x10cb04(0x180)][_0x10cb04(0x191)](_0x5e84ea),_0x55b2bd['stdin'][_0x10cb04(0x18d)]());}),!_0x55b2bd['stdin']&&(!_0x47e095&&(_0x47e095=!![],console[_0x30385f(0x19b)](_0x5e84ea),_0x5a2d86()));}):(console[_0x28c691(0x19b)](_0x5e84ea),Promise[_0x28c691(0x1a5)]());}function a44_0xb7b6(_0x4390bb,_0x2afdff){_0x4390bb=_0x4390bb-0x180;const _0x4fa5cb=a44_0x4fa5();let _0xb7b63a=_0x4fa5cb[_0x4390bb];return _0xb7b63a;}export async function handleSDKOutput(_0x1d99df,_0x1eb31d){const _0x555d71=a44_0xb7b6,_0x5dfe8e=resolveOutputOptions(_0x1eb31d),_0x4d4d38=await formatSDKOutput(_0x1d99df,_0x5dfe8e);await writeOutput(_0x4d4d38,_0x5dfe8e['output']||undefined,_0x5dfe8e[_0x555d71(0x18a)]);}export async function handleQueryOutput(_0x30e12b,_0x555db9){const _0x2e1e7c=a44_0xb7b6,_0x3ca27d=resolveOutputOptions(_0x555db9),_0x4a2480=await formatQueryOutput(_0x30e12b,_0x3ca27d);await writeOutput(_0x4a2480,_0x3ca27d[_0x2e1e7c(0x1ba)]||undefined,_0x3ca27d[_0x2e1e7c(0x18a)]);}async function formatSingleObject(_0x5e8e96,_0x574d2a){const _0x3d1a10=a44_0xb7b6,{format:_0x1274c4,color:_0x3af72f,noColor:_0x22f2f6}=_0x574d2a,_0x53e15a={'color':_0x3af72f,'noColor':_0x22f2f6};if(_0x1274c4===_0x3d1a10(0x1a9)){if(shouldUseColor(_0x53e15a))return colorizeJSON(_0x5e8e96,_0x53e15a);return JSON[_0x3d1a10(0x1b2)](_0x5e8e96,null,0x2);}else{if(_0x1274c4===_0x3d1a10(0x19c)){if(shouldUseColor(_0x53e15a))return colorizeJSONCompact(_0x5e8e96,_0x53e15a);return JSON[_0x3d1a10(0x1b2)](_0x5e8e96);}else{if(_0x1274c4==='tsv')return Object[_0x3d1a10(0x1a8)](_0x5e8e96)[_0x3d1a10(0x1bc)](([_0xcd872d,_0x3ff22f])=>_0xcd872d+'\x09'+_0x3ff22f)[_0x3d1a10(0x188)]('\x0a');else{const _0x229fbc=Object['entries'](_0x5e8e96);if(_0x229fbc[_0x3d1a10(0x1ae)]===0x0)return _0x3d1a10(0x1ab);const _0x572467=_0x5e8e96['debug'],_0x3d4e0c=_0x5e8e96['query'],_0x5af626=_0x5e8e96[_0x3d1a10(0x189)],_0x240727=_0x5e8e96[_0x3d1a10(0x186)],_0x5e8840=_0x3d4e0c?typeof _0x3d4e0c===_0x3d1a10(0x1aa)?_0x3d4e0c:JSON[_0x3d1a10(0x1b2)](_0x3d4e0c,null,0x2):undefined,_0x4c10f4=_0x5af626&&Object['keys'](_0x5af626)[_0x3d1a10(0x1ae)]>0x0?JSON[_0x3d1a10(0x1b2)](_0x5af626,null,0x2):undefined,_0x3bea6d=_0x240727&&Object[_0x3d1a10(0x1b4)](_0x240727)['length']>0x0?JSON[_0x3d1a10(0x1b2)](_0x240727,null,0x2):undefined,_0x1043c8=_0x229fbc[_0x3d1a10(0x1bf)](([_0x1a2157])=>_0x1a2157!==_0x3d1a10(0x192)&&_0x1a2157!=='query'&&_0x1a2157!==_0x3d1a10(0x189)&&_0x1a2157!=='rule'),_0x2e3105=Math[_0x3d1a10(0x190)](..._0x1043c8[_0x3d1a10(0x1bc)](([_0x37d60f])=>_0x37d60f[_0x3d1a10(0x1ae)])),_0x3d804e=Math['max'](..._0x1043c8[_0x3d1a10(0x1bc)](([,_0x184de2])=>{const _0x11518a=_0x3d1a10;try{const _0x119231=_0x184de2===null||_0x184de2===undefined?'':typeof _0x184de2===_0x11518a(0x185)?JSON[_0x11518a(0x1b2)](_0x184de2):String(_0x184de2),_0x3f449f=_0x119231[_0x11518a(0x18f)]('\x0a');return Math[_0x11518a(0x190)](..._0x3f449f[_0x11518a(0x1bc)](_0xc0368f=>_0xc0368f[_0x11518a(0x1ae)]),0x0);}catch{return 0x0;}}),0x14),_0x50dd5a=[];_0x50dd5a[_0x3d1a10(0x195)](colorBorder('┌─'+'─'[_0x3d1a10(0x1c2)](_0x2e3105)+_0x3d1a10(0x1b9)+'─'[_0x3d1a10(0x1c2)](_0x3d804e)+'─┐',_0x53e15a)),_0x1043c8[_0x3d1a10(0x18e)](([_0x2cbcc1,_0x297f77])=>{const _0x5126f4=_0x3d1a10;let _0x3579bc;try{_0x3579bc=_0x297f77===null||_0x297f77===undefined?'':typeof _0x297f77===_0x5126f4(0x185)?JSON[_0x5126f4(0x1b2)](_0x297f77):String(_0x297f77);}catch{_0x3579bc=_0x5126f4(0x1bd);}const _0x5ccf43=_0x2cbcc1['padEnd'](_0x2e3105),_0x226d9f=_0x3579bc[_0x5126f4(0x18f)]('\x0a');_0x226d9f[_0x5126f4(0x18e)]((_0x42afc6,_0x31d7a2)=>{const _0x3641ca=_0x5126f4,_0x3a2877=colorBorder('│',_0x53e15a);_0x31d7a2===0x0?_0x50dd5a['push'](_0x3a2877+'\x20'+_0x5ccf43+'\x20'+_0x3a2877+'\x20'+_0x42afc6['padEnd'](_0x3d804e)+'\x20'+_0x3a2877):_0x50dd5a[_0x3641ca(0x195)](_0x3a2877+'\x20'+'\x20'['repeat'](_0x2e3105)+'\x20'+_0x3a2877+'\x20'+_0x42afc6['padEnd'](_0x3d804e)+'\x20'+_0x3a2877);});}),_0x50dd5a[_0x3d1a10(0x195)](colorBorder('└─'+'─'[_0x3d1a10(0x1c2)](_0x2e3105)+_0x3d1a10(0x1af)+'─'[_0x3d1a10(0x1c2)](_0x3d804e)+'─┘',_0x53e15a));_0x5e8840&&(_0x50dd5a[_0x3d1a10(0x195)](''),_0x50dd5a['push'](String(a44_0x495a61[_0x3d1a10(0x197)][_0x3d1a10(0x1c0)](_0x3d1a10(0x1a2)))),_0x50dd5a[_0x3d1a10(0x195)](_0x5e8840));_0x4c10f4&&(_0x50dd5a[_0x3d1a10(0x195)](''),_0x50dd5a[_0x3d1a10(0x195)](String(a44_0x495a61[_0x3d1a10(0x1b0)][_0x3d1a10(0x1c0)](_0x3d1a10(0x1b1)))),_0x50dd5a[_0x3d1a10(0x195)](_0x4c10f4));_0x3bea6d&&(_0x50dd5a[_0x3d1a10(0x195)](''),_0x50dd5a[_0x3d1a10(0x195)](String(a44_0x495a61[_0x3d1a10(0x184)][_0x3d1a10(0x1c0)](_0x3d1a10(0x194)))),_0x50dd5a[_0x3d1a10(0x195)](_0x3bea6d));if(_0x572467){if(_0x572467[_0x3d1a10(0x193)]){_0x50dd5a[_0x3d1a10(0x195)](''),_0x50dd5a[_0x3d1a10(0x195)](String(a44_0x495a61[_0x3d1a10(0x187)][_0x3d1a10(0x1c0)](_0x3d1a10(0x1ad))));const _0x364cb0=_0x572467[_0x3d1a10(0x193)][_0x3d1a10(0x18f)]('\x0a');_0x364cb0['forEach'](_0x139420=>{_0x139420['trim']()&&_0x50dd5a['push'](_0x139420);});}if(_0x572467['cmdout']){_0x50dd5a[_0x3d1a10(0x195)](''),_0x50dd5a[_0x3d1a10(0x195)](String(a44_0x495a61[_0x3d1a10(0x1c3)]['bold'](_0x3d1a10(0x18b))));const _0x2f3651=_0x572467['cmdout'][_0x3d1a10(0x18f)]('\x0a');_0x2f3651[_0x3d1a10(0x18e)](_0x597db0=>{const _0x370054=_0x3d1a10;_0x597db0[_0x370054(0x1be)]()&&_0x50dd5a[_0x370054(0x195)](_0x597db0);});}}return _0x50dd5a[_0x3d1a10(0x188)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x186bb7,_0xd2465c){const _0x41c1fc=a44_0xb7b6;if(_0xd2465c[_0x41c1fc(0x18a)]===_0x41c1fc(0x1a1)){await handleSDKOutput([_0x186bb7],_0xd2465c);return;}const _0x5b8d91=resolveOutputOptions(_0xd2465c),_0x4a86b6=await formatSingleObject(_0x186bb7,_0x5b8d91);await writeOutput(_0x4a86b6,_0x5b8d91['output']||undefined,_0x5b8d91['format']);}function a44_0x4fa5(){const _0x57e66a=['varchar','table','[query]','2524455FaAfjX','error','resolve','-FXRSn','stdout','entries','json','string','No\x20data','number','[error]','length','─┴─','blue','[params]','stringify','boolean','keys','FINISHED','1732632MLWJDn','189ihoqxK','pipe','─┬─','output','1RqsERD','map','[Object]','trim','filter','bold','tsv','repeat','cyan','stdin','less','double','4428084TZNaEd','magenta','object','rule','red','join','params','format','[logs]','490462afiyRI','end','forEach','split','max','write','debug','stderr','[rule]','push','6658407hNeQpG','yellow','isInteger','3535940AmbEgS','color','log','jsonl','limit','noColor','90536kWoCyl'];a44_0x4fa5=function(){return _0x57e66a;};return a44_0x4fa5();}